Tutorial by Examples: ed

The standard doesn't specify if char should be signed or unsigned. Different compilers implement it differently, or might allow to change it using a command line switch.
A few modules in the standard library have been renamed: Old nameNew name_winregwinregConfigParserconfigparsercopy_regcopyregQueuequeueSocketServersocketserver_markupbasemarkupbasereprreprlibtest.test_supporttest.supportTkintertkintertkFileDialogtkinter.filedialogurllib / urllib2urllib, urllib.pars...
We can repeat an action some number of times using repeat. CL-USER> (loop repeat 10 do (format t "Hello!~%")) Hello! Hello! Hello! Hello! Hello! Hello! Hello! Hello! Hello! Hello! NIL CL-USER> (loop repeat 10 collect (random 50)) (28 46 44 31 5 33 43 35 37 4)
Combining typedef with struct can make code clearer. For example: typedef struct { int x, y; } Point; as opposed to: struct Point { int x, y; }; could be declared as: Point point; instead of: struct Point point; Even better is to use the following typedef struct Poin...
You can restrict the valid types used in a generic class by bounding that type in the class definition. Given the following simple type hierarchy: public abstract class Animal { public abstract String getSound(); } public class Cat extends Animal { public String getSound() { ...
For if you have to fine-tune what is published. import { Mongo } from 'meteor/mongo'; import { Meteor } from 'meteor/meteor'; import { Random } from 'meteor/random'; if (Meteor.isClient) { // established this collection on the client only. // a name is required (first parameter) and this...
Using the dateutil library as in the previous example on parsing timezone-aware timestamps, it is also possible to parse timestamps with a specified "short" time zone name. For dates formatted with short time zone names or abbreviations, which are generally ambiguous (e.g. CST, which coul...
By default all datetime objects are naive. To make them timezone-aware, you must attach a tzinfo object, which provides the UTC offset and timezone abbreviation as a function of date and time. Fixed Offset Time Zones For time zones that are a fixed offset from UTC, in Python 3.2+, the datetime mod...
When trying to select from a table called order like this select * from order the error rises: Error Code: 1064. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order' at line 1 Reserved keywords in MySQ...
Given the model: class MyModel(models.Model): name = models.CharField(max_length=10) model_num = models.IntegerField() flag = models.NullBooleanField(default=False) We can use Q objects to create AND , OR conditions in your lookup query. For example, say we want all objects that ...
SELECT FIND_IN_SET('b','a,b,c'); Return value: 2 SELECT FIND_IN_SET('d','a,b,c'); Return value: 0
You can nest quotes simply by including multiple > characters, like so: > Often makes no sense. > > Commenting above your quote… Often makes no sense. Commenting above your quote…
Follow previous example of creating a seed. This example uses a MySQL Dump to seed a table in the project database. The table must be created before seeding. <?php use Illuminate\Database\Seeder; class UserTableSeeder extends Seeder { /** * Run the database seeds. * ...
In case you have a Named Range in your Sheet, and you want to dynamically get the last row of that Dynamic Named Range. Also covers cases where the Named Range doesn't start from the first Row. Sub FindingLastRow() Dim sht As Worksheet Dim LastRow As Long Dim FirstRow As Long Set sht =...
SharedPreferences Manager (Singleton) class to read and write all types of data. import android.content.Context; import android.content.SharedPreferences; import android.util.Log; import com.google.gson.Gson; import java.lang.reflect.Type; /** * Singleton Class for accessing SharedPref...
You may pull (download) files from the device by executing the following command: adb pull <remote> <local> For example: adb pull /sdcard/ ~/ You may also push (upload) files from your computer to the device: adb push <local> <remote> For example: adb push ~/im...
Executing code after 1.5 seconds: Handler handler = new Handler(); handler.postDelayed(new Runnable() { @Override public void run() { //The code you want to run after the time is up } }, 1500); //the time you want to delay in milliseconds Executing code repeatedly every...
__CLASS__ magic constant returns the same result as get_class() function called without parameters and they both return the name of the class where it was defined (i.e. where you wrote the function call/constant name ). In contrast, get_class($this) and get_called_class() functions call, will both ...
git stash list This will list all stashes in the stack in reverse chronological order. You will get a list that looks something like this: stash@{0}: WIP on master: 67a4e01 Merge tests into develop stash@{1}: WIP on master: 70f0d95 Add user role to localStorage on user login You can refer t...
Destructuring allows us to refer to one key in an object, but declare it as a variable with a different name. The syntax looks like the key-value syntax for a normal JavaScript object. let user = { name: 'John Smith', id: 10, email: '[email protected]', }; let {user: userName, id: us...

Page 17 of 145