Tutorial by Examples: l

Open the psql command line tool connected to the database where your table is. Then type the following command: \d tablename To get extended information type \d+ tablename If you have forgotten the name of the table, just type \d into psql to obtain a list of tables and views in the current ...
Let's say you have a table called person: CREATE TABLE person ( person_id BIGINT NOT NULL, last_name VARCHAR(255) NOT NULL, first_name VARCHAR(255), age INT NOT NULL, PRIMARY KEY (person_id) ); You can create a new table of people over 30 like this: CREATE TABLE p...
Intellij IDEA attempts to appeal to the wide Java fanbase which uses Eclipse for their development by allowing developers to migrate their Eclipse projects over to an IDEA structure with a few simple clicks! First, start IDEA and click Import Project from the startup window: Then, select your Ec...
Date always have a different format, they can be parsed using a specific parse_dates function. This input.csv: 2016 06 10 20:30:00 foo 2016 07 11 19:45:30 bar 2013 10 12 4:30:00 foo Can be parsed like this : mydateparser = lambda x: pd.datetime.strptime(x, "%Y %m %d %H:%M:%S...
Consider entities Customer, Purchase and PurchaseItem as follows: public class Customer { public string Id { get; set } // A unique Id that identifies customer public string Name {get; set; } } public class Purchase { public string Id { get; set } public string CustomerId...
PropertyInfo[] stringProps = typeof (string).GetProperties();//string properties PropertyInfo[] builderProps = typeof(StringBuilder).GetProperties();//stringbuilder properties var query = from s in stringProps join b in builderProps on new { s.Name, s.P...
You can insert multiple rows in the database at the same time: INSERT INTO person (name, age) VALUES ('john doe', 25), ('jane doe', 20);
You can insert data in a table as the result of a select statement: INSERT INTO person SELECT * FROM tmp_person WHERE age < 30; Note that the projection of the select must match the columns required for the insert. In this case, the tmp_person table has the same columns as person.
GridViews allow commands to be sent from a GridView row. This is useful for passing row-specific information into an event handler as command arguments. To subscribe to a command event: <asp:GridView ID="GridView1" ... OnRowCommand="GridView1_RowCommand"> Buttons are t...
You can also apply a mixin globally. Use caution! Once you apply a mixin globally, it will affect every Vue instance created afterwards. When used properly, this can be used to inject processing logic for custom options: // inject a handler for `myOption` custom option Vue.mixin({ created: func...
Let's say you have a service the same as the one defined in the "First service and host" example. To create a client, define the client configuration section in the system.serviceModel section of your client configuration file. <system.serviceModel> <services> <cli...
RoboGuice is a framework that brings the simplicity and ease of Dependency Injection to Android, using Google's own Guice library. @ContentView(R.layout.main) class RoboWay extends RoboActivity { @InjectView(R.id.name) TextView name; @InjectView(R.id.thumbnail) Image...
Add the following pom to the dependencies section of your gradle build file : project.dependencies { compile 'org.roboguice:roboguice:3.+' provided 'org.roboguice:roboblender:3.+' }
The UIAlertController available since iOS8 allows you to use the same alert object for either Action sheets or more classic alerts. The only difference is the UIAlertControllerStyle passed as a parameter when creating. This line changes from an AlertView to an ActionSheet, compared to some other ex...
It was common practice to use NSRunLoop to show modal UIAlertView to block code execution until user input is processed in iOS; until Apple released the iOS7, it broke few existing apps. Fortunately, there is a better way of implementing it with C#’s async/await. Here’s the new code taking advantag...
User input Imagine you want a user to enter a number via input. You want to ensure that the input is a number. You can use try/except for this: Python 3.x3.0 while True: try: nb = int(input('Enter a number: ')) break except ValueError: print('This is not a num...
Functions have two built-in methods that allow the programmer to supply arguments and the this variable differently: call and apply. This is useful, because functions that operate on one object (the object that they are a property of) can be repurposed to operate on another, compatible object. Addi...
To create a variable: variableType variableName; For example: int a; To create a variable and initialize it: variableType variableName = initialValue; For example: int a = 2;
If you have a variable declared before, you can assign some value to it: For example: int a; // declared previously a = 2; Or change the value: int a = 3; // initalized previously a = 2;
char : signed 1-byte character value byte : unsigned 8-bit integer int : signed 16-bit (on ATMEGA based boards) or 32-bit (on Arduino Due) integer unsigned int : unsigned 16-bit (on ATMEGA based boards) or 32-bit (on Arduino Due) integer long : signed 32-bit integer unsigned long : unsigned 3...

Page 200 of 861