Tutorial by Examples

Racket is a full-spectrum programming language. It goes beyond Lisp and Scheme with dialects that support objects, types, laziness, and more. Racket enables programmers to link components written in different dialects, and it empowers programmers to create new, project-specific dialects. Racket's li...
Environment variables that affect the go tool can be viewed via the go env [var ...] command: $ go env GOARCH="amd64" GOBIN="/home/yourname/bin" GOEXE="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOOS="linux" GOPATH="/home/yourname&q...
If Go is not pre-installed in your system you can go to https://golang.org/dl/ and choose your platform to download and install Go. To set up a basic Go development environment, only a few of the many environment variables that affect the behavior of the go tool (See: Listing Go Environment Variabl...
Quantitative data is often read in as strings that must be converted to numeric types before processing. The types of all list items can be converted with either a List Comprehension or the map() function. # Convert a list of strings to integers. items = ["1","2","3",...
A deadlock is what occurs when two or more threads are waiting for eachother to complete or to release a resource in such a way that they wait forever. A typical scenario of two threads waiting on eachother to complete is when a Windows Forms GUI thread waits for a worker thread and the worker thre...
A deadlock is what occurs when two or more threads are waiting for eachother to complete or to release a resource in such a way that they wait forever. If thread1 holds a lock on resource A and is waiting for resource B to be released while thread2 holds resource B and is waiting for resource A to ...
To draw a vector SVG image, the operation is not different from a raster image : You first need to load your SVG image into an HTMLImage element, then use the drawImage() method. var image = new Image(); image.onload = function(){ ctx.drawImage(this, 0,0); } image.src = "someFile.SVG&...
This is a nice trick to add a link to code, so it will be easy to jump to the code that issued the log. With the following code, this call: MyLogger.logWithLink("MyTag","param="+param); Will result in: 07-26...012/com.myapp D/MyTag: MyFrag:onStart(param=3) (MyFrag.java:236...
Current updates the branch on the remote repository that shares a name with the current working branch. git config push.default current Simple pushes to the upstream branch, but will not work if the upstream branch is called something else. git config push.default simple Upstream pushes to t...
This is the basic way to insert data from another table with the SELECT statement. INSERT INTO `tableA` (`field_one`, `field_two`) SELECT `tableB`.`field_one`, `tableB`.`field_two` FROM `tableB` WHERE `tableB`.clmn <> 'someValue' ORDER BY `tableB`.`sorting_clmn`; You can...
git push --tags Pushes all of the git tags in the local repository that are not in the remote one.
Drop Table is used to delete the table from database. Creating Table: Creating a table named tbl and then deleting the created table CREATE TABLE tbl( id INT NOT NULL AUTO_INCREMENT, title VARCHAR(100) NOT NULL, author VARCHAR(40) NOT NULL, submission_date DATE, PRIMARY K...
Each group ends with a line separator. If each item in your menu has its own group you will achieve the desired graphical output. It will work only if your different groups have different android:id. Also, in menu.xml remember to mention android:checkable="true" for single item and android...
When using the interactive interpreter, you might want to reload a module. This can be useful if you're editing a module and want to import the newest version, or if you've monkey-patched an element of an existing module and want to revert your changes. Note that you can't just import the module ag...
Vim macros can also be recursive. This is useful for when you need to act on every line (or other text object) till the end of the file. To record a recursive macro, start with an empty register. (A register can be emptied using q<register>q.) Choose a consistent starting point on each line ...
To hide the blinking caret, you need to override caretRectForPosition of a UITextField and return CGRectZero. Swift 2.3 < public override func caretRectForPosition(position: UITextPosition) -> CGRect { return CGRectZero } Swift 3 override func caretRect(for position: UITextPositio...
We can change the style of the placeholder by setting attributedPlaceholder (a NSAttributedString). var placeholderAttributes = [String: AnyObject]() placeholderAttributes[NSForegroundColorAttributeName] = color placeholderAttributes[NSFontAttributeName] = font if let placeholder = textField.p...
If you need to clean the build: ndk-build clean
Reflection is useful but fragile. Consider this: let mi = typeof<System.String>.GetMethod "StartsWith" The problems with this kind of code are: The code doesn't work because there are several overloads of String.StartsWith Even if there wouldn't be any overloads right now la...
Starting a File Chooser Activity public void showFileChooser() { Intent intent = new Intent(Intent.ACTION_GET_CONTENT); // Update with mime types intent.setType("*/*"); // Update with additional mime types here using a String[]. intent.putExtra(Intent.EXTRA_M...

Page 556 of 1336