Tutorial by Examples: st

If you want to see the schema information of your table, you can use one of the following: SHOW CREATE TABLE child; -- Option 1 CREATE TABLE `child` ( `id` int(11) NOT NULL AUTO_INCREMENT, `fullName` varchar(100) NOT NULL, `myParent` int(11) NOT NULL, PRIMARY KEY (`id`), KEY `momm...
In general, it is considered good practice to throw by value (rather than by pointer), but catch by (const) reference. try { // throw new std::runtime_error("Error!"); // Don't do this! // This creates an exception object // on the heap and would require you to catch the ...
This object, Shape has a property image that depends on numberOfSides and sideWidth. If either one of them is set, than the image has to be recalculated. But recalculation is presumably long, and only needs to be done once if both properties are set, so the Shape provides a way to set both propertie...
Suppose you have types like the following: interface IThing { } class Thing : IThing { } LINQ allows you to create a projection that changes the compile-time generic type of an IEnumerable<> via the Enumerable.Cast<>() and Enumerable.OfType<>() extension methods. IEnumerabl...
Suppose you have many changes in one or more files but from each file you only want to commit some of the changes, you can select the desired changes using: git add -p or git add -p [file] Each of your changes will be displayed individually, and for each change you will be prompted to choose...
Modern A weak reference looks like one of these: @property (weak) NSString *property; NSString *__weak variable; If you have a weak reference to an object, then under the hood: You're not retaining it. When it gets deallocated, every reference to it will automatically be set to nil Obje...
Register a production/sandbox account at https://dashboard.stripe.com/register Insert below code into your webpage where you want to have a checkout button. <form action="/charge" method="POST"> <script src="https://checkout.stripe.com/checkout.js" cl...
The installation instructions are available on IIS.net. See this for installing IIS 8.5
Send an HTTP response with status code 200 to indicate a successful request. The HTTP response status line is then: HTTP/1.1 200 OK The status text OK is only informative. The response body (message payload) should contain a representation of the requested resource. If there is no representation...
PHP is a loosely typed language. This means that, by default, it doesn't require operands in an expression to be of the same (or compatible) types. For example, you can append a number to a string and expect it to work. var_dump ("This is example number " . 1); The output will be: ...
When you install Oracle 11g or 12cR1, an older version of Apex is pre-installed. It is highly recommended to upgrade it to the latest version. Go to apex.oracle.com and download the latest version of Apex. Follow the documentation for the specific version to install it. Important Docu...
Haskell has list comprehensions, which are a lot like set comprehensions in math and similar implementations in imperative languages such as Python and JavaScript. At their most basic, list comprehensions take the following form. [ x | x <- someList ] For example [ x | x <- [1..4] ] -...
A 'tab bar' is commonly found in most iOS apps and is used to present distinct views in each tab. To create a tab bar controller using the interface builder, drag a tab bar Controller from the Object Library into the canvas. By default a tab bar controller comes with two views. To add additional...
We can destructure lists of compound objects CL-USER> (loop for (a . b) in '((1 . 2) (3 . 4) (5 . 6)) collect a) (1 3 5) CL-USER> (loop for (a . b) in '((1 . 2) (3 . 4) (5 . 6)) collect b) (2 4 6) CL-USER> (loop for (a b c) in '((1 2 3) (4 5 6) (7 8 9) (10 11 12)) collect b) (2 5 8 11...
package main import ( "fmt" "io/ioutil" ) func main() { files, err := ioutil.ReadDir(".") if err != nil { panic(err) } fmt.Println("Folders in the current directory:") for _, fileInfo := range files { ...
The equivalent to git pull is the command git svn rebase This retrieves all the changes from the SVN repository and applies them on top of your local commits in your current branch. You can also use the command git svn fetch to retrieve the changes from the SVN repository and bring them to ...
The command git svn dcommit will create a SVN revision for each of your local git commits. As with SVN, your local git history must be in sync with the latest changes in the SVN repository, so if the command fails, try performing a git svn rebase first.
Go to File -> Settings -> Editor -> Colors & Fonts -> Android Logcat Change the colors as you need: Choose the appropriate color:
This example demonstrates how to fetch the URI's of system ringtones (RingtoneManager.TYPE_RINGTONE): private List<Uri> loadLocalRingtonesUris() { List<Uri> alarms = new ArrayList<>(); try { RingtoneManager ringtoneMgr = new RingtoneManager(getActivi...
In most cases, you may want to set I18n locale. One might want to set the locale for the current session, the current user, or based on a URL parameter This is easily achievable by implementing a before_action in one of your controllers, or in ApplicationController to have it in all of your controll...

Page 95 of 369