Tutorial by Examples: ect

>>> import sys >>> a = object() >>> sys.getrefcount(a) 2 >>> b = a >>> sys.getrefcount(a) 3 >>> del b >>> sys.getrefcount(a) 2
var myData = [ { name: "test1", value: "ok" }, { name: "test2", value: "nok" } ] // We have to select elements (here div.samples) // and assign data. The second parameter of data() is really important, // it will determine the "key" t...
Projection refers to the operations of transforming an object into a new form. Select Projects values that are based on a transform function. Method Syntax // Select var numbers = new int[] { 1, 2, 3, 4, 5 }; var strings = numbers.Select(n => n.ToString()); // strings = { "1...
<rect> represents rectangle, apart from aesthetic properties like stroke and fill, rectangle shall be defined by location and size. As for the location, it is determined by the x and y attributes. The location is relative to the rectangle’s parent. And if you don’t specify the x or y attribut...
In iTunesConnect, select the app which you want to add an IAP to. Click on features and you will see this: Click the plus. You will then need to select which type of IAP you want to make. Then you will need to fill out all of the information for your IAP. If you have any trouble you can cons...
Let's say you have a table called person: CREATE TABLE person ( person_id BIGINT NOT NULL, last_name VARCHAR(255) NOT NULL, first_name VARCHAR(255), age INT NOT NULL, PRIMARY KEY (person_id) ); You can create a new table of people over 30 like this: CREATE TABLE p...
You can insert data in a table as the result of a select statement: INSERT INTO person SELECT * FROM tmp_person WHERE age < 30; Note that the projection of the select must match the columns required for the insert. In this case, the tmp_person table has the same columns as person.
Add the following pom to the dependencies section of your gradle build file : project.dependencies { compile 'org.roboguice:roboguice:3.+' provided 'org.roboguice:roboblender:3.+' }
You can inject any type of resource, Strings, Animations, Drawables, etc. To inject your first resource into an activity, you'll need to: Inherit from RoboActivity Annotate your resources with @InjectResource Example @InjectResource(R.string.app_name) String name; @InjectResource(R.drawa...
You can inject any view using the @InjectView annotation: You'll need to: Inherit from RoboActivity Set your content view Annotate your views with @InjectView Example @InjectView(R.id.textView1) TextView textView1; @InjectView(R.id.textView2) TextView textView2; @InjectView(R.id.imag...
Using SELECT, you can update multiple variables at once. DECLARE @Variable1 INT, @Variable2 VARCHAR(10) SELECT @Variable1 = 1, @Variable2 = 'Hello' PRINT @Variable1 PRINT @Variable2 1 Hello When using SELECT to update a variable from a table column, if there are multiple values, it wi...
(let [v [1 2 3]] (match [v] [[1 1 1]] :a0 [[1 _ 1]] :a1 [[1 2 _]] :a2)) ;; _ is used for wildcard matching ;=> :a2
Use 403 Forbidden when a client has requested a resource that is inaccessible due to existing access controls. For example, if your app has an /admin route that should only be accessible to users with administrative rights, you can use 403 when a normal user requests the page. GET /admin HTTP/1.1 ...
1. Target a device by serial number Use the -s option followed by a device name to select on which device the adb command should run. The -s options should be first in line, before the command. adb -s <device> <command> Example: adb devices List of devices attached emulator-55...
NSError *e = nil; NSString *jsonString = @"[{\"id\": \"1\", \"name\":\"sam\"}]"; NSData *data = [jsonString dataUsingEncoding:NSUTF8StringEncoding]; NSArray *jsonArray = [NSJSONSerialization JSONObjectWithData: data options: NSJSONReadingMutabl...
We can optimize a simple xor function for only architectures that support unaligned reads/writes by creating two files that define the function and prefixing them with a build constraint (for an actual example of the xor code which is out of scope here, see crypto/cipher/xor.go in the standard libra...
This is a simple but robust core-data set-up for iOS 10+. There are exactly two way to access core-data: viewContext. The viewContext can only be used from the main thread, and only for reading. strong enqueueCoreDataBlock. All writing should be done using enqueueCoreDataBlock. There is no ne...
Just some methods of an object can be mocked using spy() of mockito. For example, imagine that method class requires some web service to work. public class UserManager { List<User> users; public UserManager() { user = new LinkedLisk<User>(); } ...
This method looks for the existence of browser specific things. This would be more difficult to spoof, but is not guaranteed to be future proof. // Opera 8.0+ var isOpera = (!!window.opr && !!opr.addons) || !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0; // Firefox 1.0+ ...
This method gets the user agent and parses it to find the browser. The browser name and version are extracted from the user agent through a regex. Based on these two, the <browser name> <version> is returned. The four conditional blocks following the user agent matching code are meant t...

Page 24 of 99