Tutorial by Examples: c

The simple way to implement multi-threaded applications is to use Java's built-in synchronization and locking primitives; e.g. the synchronized keyword. The following example shows how we might use synchronized to accumulate counts. public class Counters { private final int[] counters; ...
Flexbox or flexible box is a layout method for arranging content on a page in a predictable manner. Flexbox provides an improvement over traditional block model positioning using floats or even table like positioning for content on the page. At its core, Flexbox can be broken down into a parent ele...
Open Visual Studio and Select File -> New Project Select AWS Lambda Project with Tests (.NET Core) Next the Select Blueprint screen will display. Select Empty Function and Click the Finish button: Go to Tools -> NuGet Package Manager -> Package Manager Console. In the console win...
Open Function.cs and replace the class code with the following: public class Function { /// <summary> /// A simple function that takes a birth date and returns Age in years /// </summary> /// <param name="input"></param> /// <returns>Age is years&...
Right Click your project and select Publish to AWS Lambda... The Upload to AWS Lambda screen will appear. Make sure the correct region is selected. Keep all of the defaults. Then only enter the Function Name: AWSLambdaFunctionAgeInYears and then click next. On the next page, sele...
After Step 3 above, Visual Studio will open the View Function window with your function loaded. On the bottom left of this screen, enter the following json into the Sample Input box: { "month": "10", "day": "28", "year": "1979" } ...
This example assumes you have a servo with the following characteristics, which happen to be typical: movement between 0 and 180 degrees pulse period of 20 ms minimum pulse length of 0.5 ms maximum pulse length of 2.5 ms You need to check if those values match your hardware, since forcing i...
Instances of Integer_IO have a settings variable Default_Width which the number of characters that each output number will take. with Ada.Text_IO; use Ada.Text_IO; procedure Print_Integer is subtype Count is Integer range -1_000_000 .. 1_000_000; package Count_IO is new Integer_IO ...
A settings variable Default_Base is set on the instance of Ada.Text_IO.Integer_IO; also, Default_Width is set so that output cannot have leading space. with Ada.Text_IO; use Ada.Text_IO; procedure Print_Hex is subtype Count is Integer range -1_000_000 .. 1_000_000; package Count_IO...
Ada.Text_IO.Editing offers formatting decimal fixed point values using “picture strings”. These describe output using “magical” characters for separators, currency signs, etc. with Ada.Text_IO.Editing; use Ada.Text_IO; procedure Print_Value is Max_Count : constant := 1_000_000; ...
A simple sports2000 example: FIND FIRST Customer NO-LOCK WHERE CustNum = 1 NO-ERROR. IF AVAILABLE Customer THEN DO: DISPLAY Customer.NAME. END. ELSE DO: MESSAGE "No record available". END. FIRST - find the first record that matches the query NO-LOCK - don't lock the r...
Paste this snippet somewhere in the http {} Block; or place it in it's own file in the /etc/nginx/conf.d/ folder. Also see the official docs for logging to syslog. # # Access Log # log_format fmt_syslog '[$time_local] $status $remote_addr $http_host "$request" $body_bytes_sent $reque...
Coding method used: Hybrid/Spongy It has been forever a myth that div's can not be used in emails. There are email clients (unlike outlook) that can render div's properly. The example below will illustrate how an email can be coded that will work on Gmail app (with updates not rolled out yet), Sams...
The create-* commands in Grails automatically create unit or integration tests for you within the src/test/groovy directory. It is of course up to you to populate these tests with valid test logic, information on which can be found in the section on Unit and integration tests. To execute tests you ...
If you prefer to keep the declaration of the URL mapping in your UrlMappings.groovy file then simply removing the uri attribute of the Resource transformation and adding the following line to UrlMappings.groovy will suffice: "/books"(resources:"book") Extending your API to in...
# for use in npm scripts npm install electron-packager --save-dev # for use from cli npm install electron-packager -g
electron-packager C:/my-app MyApp
var packager = require('electron-packager'); packager({ dir: '/', }, function(err, path){ if(err) throw err; // Application has been packaged });
The Icomoon App is a web based tool that's especially useful for creating custom icon fonts on a per project basis. The Icomoon App allows you to do each of the following : Get one or more icons from several popular icon fonts Upload other fonts, which may be icon fonts but also regular fonts ...
To include an icon font in your CSS, you can include the following code : @font-face { font-family: 'myfont'; src:url('fonts/myfont.eot?-td2xif'); src:url('fonts/myfont.eot?#iefix-td2xif') format('embedded-opentype'), url('fonts/myfont.woff?-td2xif') format('woff'), ...

Page 698 of 826