Tutorial by Examples: ch

SWITCH and COND offer a special form of conditional program flow. Unlike IF and CASE, they respresent different values based on an expression rather than executing statements. That's why they count as functional. COND Whenever multiple conditions have to be considered, COND can do the job. The syn...
// Token from another example. This token is expired var tokenString = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmb28iOiJiYXIiLCJleHAiOjE1MDAwLCJpc3MiOiJ0ZXN0In0.HE7fK0xOQwFEr4WDgRWj4teRPZ6i3GLwD5YCm6Pwu_c" token, err := jwt.Parse(tokenString, func(token *jwt.Token) (interface{}, error...
Atom is versatile and flexible text editor and has hundreds of community-made, open-source packages that can compile and run source files, for many languages. This guide will show how easy it is to code Python with the Atom editor. This guide assumes you do not have Python nor Atom installed in you...
Prepare helloworld.go (find below) package main import "fmt" func main(){ fmt.Println("hello world") } Run GOOS=linux GOARCH=arm go build helloworld.go Copy generated helloworld (arm executable) file to your target machine.
Nokogiri is somewhat like a browser, in that it will attempt to provide something useful even if the incoming HTML or XML is malformed. Unfortunately it usually does it silently, but we can ask for a list of the errors using errors: require 'nokogiri' doc = Nokogiri::XML('<node><foo/&gt...
Recent versions of Delphi ships with the TStopwatch record which is for time interval measurement. Example usage: uses System.Diagnostics; var StopWatch: TStopwatch; ElapsedMillseconds: Int64; begin StopWatch := TStopwatch.StartNew; // do something that requires measurement El...
When the active property gets toggled, the component will notify the camera system to change the current camera used by the renderer: var secondCameraEl = document.querySelector('#second-camera'); secondCameraEl.setAttribute('camera', 'active', true);
Let's assume we have a search results page that displays a user's search query back to them. The code below is an example of how this could be done in PHP: Results for "<?php echo $_GET['query'] ?>" For this to work, you would access the page with a URL like: https://yoursite.te...
Many custom views need to accept user interaction in the form of touch events. You can get access to touch events by overriding onTouchEvent. There are a number of actions you can filter out. The main ones are ACTION_DOWN: This is triggered once when your finger first touches the view. ACTION_MO...
As it can be seen from the picture above, on a single application we can create: Multiple databases Each database can have multiple object stores (tables) Each object store can have stored multiple objects
You can add custom post type posts on default wordpress search, Add below code in theme functions.php function my_search_filter($query) { if ( !is_admin() && $query->is_main_query() ) { if ($query->is_search) { $query->set('post_type', array( 'news','post','article' ...
public void setCardColorTran(View view) { ColorDrawable[] color = {new ColorDrawable(Color.BLUE), new ColorDrawable(Color.RED)}; TransitionDrawable trans = new TransitionDrawable(color); if(Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.JELLY_BEAN) { view.setBackgrou...
Gui, +AlwaysOnTop +Disabled -SysMenu +Owner ; +Owner avoids a taskbar button. Gui, Add, Text,, Some text to display. Gui, Show, NoActivate, Title of Window ; NoActivate avoids deactivating the currently active window.
CHMOD Calculation CHMOD is binary. _ / _ _ _ / _ _ _ / _ _ _ = _/4+2+1/4+2+1/4+2+1 = 777 = _/rwx/rwx/rwx = 777 Therefore _rwx = _/4+2+1 = 7 D / _ _ _ / _ _ _ / _ _ _ (‘D’ = directory, another use is L = Link) So e.g. _rwxr_xr_x = _/rwx/rx/r_x = 755
To change own:group you use command chown user:group e.g. chown owner:group or if owner and group are same you can use chown owner: (because linus assumes owner:group are same).
For the most printing clients, is extremely useful to know if a print job has finished or failed. The Java Print Service API provide some functionalities to get informed about these scenarios. All we have to do is: provide an implementation for PrintJobListener interface and register this impl...
1.1.2 (This content is only relavant for versions 1.1.2 and up) From versions 1.1.2 and up, you can set the delay to select a new chip before refocusing on the input. Use the md-chip-append-delay attribute to set it (in milliseconds): Example: <md-chips md-chip-append-delay="500" n...
In the following example echo on will take effect after the end of the brackets context is reached: @echo off ( echo on echo ## ) echo $$ In order to "activate" echo on in a brackets context (including FOR and IF commands) you can use FOR /f macro : @echo off setlocal ...
Anonymous functions technique uses the fact that CALL command uses internally GOTO when subroutine is called and abusing help message printing with variable double expansion: @echo off setlocal set "anonymous=/?" call :%%anonymous%% a b c 3>&1 >nul if "%0" == ...
Lets have the following file called library.cmd : @echo off echo -/-/- Batch Functions Library -/-/- :function1 echo argument1 - %1 goto :eof To execute only the :function1 without the code of the rest of the file you should put a label :function1 in the caller bat and use it lik...

Page 103 of 109