Tutorial by Examples: am

For an executable file or command exec, running this will list all system calls: $ ptrace exec To display specific system calls use -e option: $ strace -e open exec To save the output to a file use the -o option: $ strace -o output exec To find the system calls an active program uses, us...
import csv #------ We will write to CSV in this function ------------ def csv_writer(data, path): #Open CSV file whose path we passed. with open(path, "wb") as csv_file: writer = csv.writer(csv_file, delimiter=',') for line in data: ...
For most of the scenarios involving entities from service layer,we can make do with the default service calls,with some help from the finders as well.For simple scenarios involving multiple entities,we move towards using Dynamic query API.This is a wrapper API for the Criteria API used in Hibernate....
JSON data { "name" : { "first" : "Joe", "last" : "Sixpack" }, "gender" : "MALE", "verified" : false, "userImage" : "keliuyue" } It takes two lines of Java to turn it into a User insta...
Generating simple blog engine rails plugin new [engine name] --mountable Famous engines examples are Device (authentication gem for rails) Spree (Ecommerce)
AVPlayer *avPlayer = [AVPlayer playerWithURL:[NSURL URLWithString:@"YOUR URL"]]; AVPlayerViewController *avPlayerCtrl = [[AVPlayerViewController alloc] init]; avPlayerCtrl.view.frame = self.view.frame; avPlayerCtrl.player = avPlayer; avPlayerCtrl.delegate = self; [...
Use Spring REST Docs to document your services. It's a powerful framework which makes sure that the Service logic is always inline with the documentation. In order to do so, you would have to write integration tests for your services. If there is any mismatch in the documentation & service beha...
Encoded URL http%3A%2F%2Fwww.foo.com%2Findex.php%3Fid%3Dqwerty Use this command to decode the URL echo "http%3A%2F%2Fwww.foo.com%2Findex.php%3Fid%3Dqwerty" | sed -e "s/%\([0-9A-F][0-9A-F]\)/\\\\\x\1/g" | xargs -0 echo -e Decoded URL (result of command) http://www.foo...
This example grabs the Node.gitignore file from GitHub's gitignore repository, downloads it to your current working directory and renames it to .gitignore - all very typical actions for someone starting a new node.js project. $ curl http://github.com/github/gitignore/raw/master/Node.gitignore -o .g...
<?php defined('BASEPATH') OR exit('No direct script access allowed'); class Api extends CI_Controller { //default value private $login_credential; function __construct() { parent::__construct(); //for user authentication $this->load->library('session'); ...
Let's say a user wants to select data from different tables. A table is specified by the user. function get_value(p_table_name varchar2, p_id number) return varchar2 is value varchar2(100); begin execute immediate 'select column_value from ' || p_table_name || ...
Example below inserts value into the table from the previous example: declare query_text varchar2(1000) := 'insert into my_table(id, column_value) values (:P_ID, :P_VAL)'; id number := 2; value varchar2(100) := 'Bonjour!'; begin execute immediate query_text using id, value; end; / ...
Let's update table from the first example: declare query_text varchar2(1000) := 'update my_table set column_value = :P_VAL where id = :P_ID'; id number := 2; value varchar2(100) := 'Bonjour le monde!'; begin execute immediate query_text using value, id; end; /
$a = 5; $b = 10; $a <=> $a; // 0, because $a == $a $a <=> $b; // -1, because $a < $b $b <=> $a; // 1, because $b > $a
ArrayList<String> fontNames = new ArrayList<String>(); File temp = new File("/system/fonts/"); String fontSuffix = ".ttf"; for(File font : temp.listFiles()) { String fontName = font.getName(); if(fontName.endsWith(fontSuffix)) { fontNames.add(f...
In the example below, the calculateShippingPrice method calculates shipping cost, which takes some processing time. In a real world example, this would e.g. be contacting another server which returns the price based on the weight of the product and the shipping method. By modeling this in an async ...
In the next example, let's use Dojo features and understand what AMD ( Asynchronous Module Definition) means. <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Tutorial: Hello Dojo!</title> </head> <body> <h1 ...
REM Truncate table (for testing) SQLCMD -Q "TRUNCATE TABLE TestDatabase.dbo.myNative;" REM Import data bcp TestDatabase.dbo.myNative IN D:\BCP\myNative.bcp -T -n REM Review results SQLCMD -Q "SELECT * FROM TestDatabase.dbo.myNative;"
To make the use of the adapter pattern and the kind of situation when it may be applied more imaginable, a small, simple and very concrete example is given here. There will be no code in here, just UML and a description of the example situation and its problem. Admittedly, the UML content is writte...
To develop applications for iOS, you need to have a Mac, an Apple developer account (to publish to the App Store; costs $100 annually), the free XCode application on your Mac, and ideally some iOS devices to test with. Experience with either of the programming languages Swift or Objective-C is necc...

Page 128 of 129