Tutorial by Examples: sin

A modeless form is employed (usually) when you need to shows something permanentely alongside your application main screen (think about a legend or an view on a stream of data coming asynchronously from a device or an MDI Child Window). But a modeless form poses an unique challenge when you want t...
When a form is shown using the ShowDialog method, it is necessary to set the form's DialogResult property to close to form. This property can be set using the enum that's also called DialogResult. To close a form, you just need to set the form's DialogResult property (to any value by DialogResult.N...
-- Create a sample JSON with ARRAY create table car_sample(dim_id integer, info varchar(2000)); insert into car_sample values (200, '{"cars": [ { "Manufacturer": "Nissan", "Models": [{"Name":"Sentra", "doors":4}, {"Name&quo...
SELECT E.EMPLOYEE_ID,E.LAST_NAME,E.MANAGER_ID FROM HR.EMPLOYEES E CONNECT BY PRIOR E.EMPLOYEE_ID = E.MANAGER_ID; The CONNECT BY clause to define the relationship between employees and managers.
We can create Singleton class in such a way that developers are forced to used the shared instance (singleton object) instead of creating their own instances. @implementation MySingletonClass + (instancetype)sharedInstance { static MySingletonClass *_sharedInstance = nil; static dispa...
Steps: clone the gradle-script-kotlin project copy/paste from the cloned project to your project: build.gradle.kts gradlew gradlew.bat settings.gradle update the content of the build.gradle.kts based on your needs, you can use as inspiration the scripts in the project just clo...
A single entry point to your application is possible with RequireJS by using the data-main attributed within the <script> tag. <script type="text/javascript" data-main="scripts/main" src="http://requirejs.org/docs/release/2.3.2/minified/require.js"></scr...
By default, the escape character is ~. Just go ahead and type ~. in your opened SSH session. After hitting Enter your session will end immediately. Go ahead and try it in any session, it works regardless of the responsiveness of your session.
import spock.lang.* class HelloWorldSpec extends Specification { @Shared message = 'Hello world!' def "The world can say hello using when and then"() { when: def newMessage = message then: newMessage == 'Hello world!' } ...
We create a dataset that we then fit with a straight line $f(x) = m x + c$. npoints = 20 slope = 2 offset = 3 x = np.arange(npoints) y = slope * x + offset + np.random.normal(size=npoints) p = np.polyfit(x,y,1) # Last argument is degree of polynomial To see what we've done: impor...
We use the same dataset as with polyfit: npoints = 20 slope = 2 offset = 3 x = np.arange(npoints) y = slope * x + offset + np.random.normal(size=npoints) Now, we try to find a solution by minimizing the system of linear equations A b = c by minimizing |c-A b|**2 import matplotlib.pyplot as...
Using the Flyable example as a starting point, we can add a second interface, Swimmable, with the following code: Sub Swim() ' No code End Sub The Duck object can Implement both flying and swimming: Implements Flyable Implements Swimmable Public Sub Flyable_Fly() Debug.Print &quo...
In tables recording events there is often a datetime field recording the time an event happened. Finding the single most recent event can be difficult because it's always possible that two events were recorded with exactly identical timestamps. You can use row_number() over (order by ...) to make su...
from sqlalchemy import create_engine cnx = create_engine('mysql+pymysql://username:password@server:3306/database').connect() sql = 'select * from mytable' df = pd.read_sql(sql, cnx)
While chrome browser is open to any tab (except welcome tabs) you have three options to open Chrome Dev Tools: Keyboard: Type command ⌘+option+i Browser Menu: Click 'Menu' > 'More Tools' > 'Developer Tools' Program Menu (at top of your screen): Click 'View' > 'Developer' > 'Develope...
var providerName = "System.Data.SqlClient"; //Oracle.ManagedDataAccess.Client, IBM.Data.DB2 var connectionString = "{your-connection-string}"; //you will probably get the above two values in the ConnectionStringSettings object from .config file var factory = DbProviderFac...
class Person { String name; public Person(String name) { this.name = name; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Person person = (Person) ...
Progress supports one dimensional arrays, but they are called EXTENTS. /* Define a character array with the length 5, and display it's length */ DEFINE VARIABLE a AS CHARACTER EXTENT 5 NO-UNDO. DISPLAY EXTENT(a). Individual positions i the array is accessed using "standard" c-style b...
First, Go to Tools > NuGet Package Manager > Package Manager Console. Enter this Command "Install-Package Plugin.Facebook" in Package Manger Console. Now all the file is automatically created. Video : Login with Facebook in Xamarin Forms Other Authentication by using Pl...
Array Implementation #include<stdio.h> #define MAX 100000 //Global variables int top = -1; int a[MAX]; void push(int x){ if(top == MAX-1){ // Check whether stack is full printf("Stack Overflow\n"); retur...

Page 134 of 161