Tutorial by Examples: 9

C99 The header <stdint.h> provides several fixed-width integer type definitions. These types are optional and only provided if the platform has an integer type of the corresponding width, and if the corresponding signed type has a two's complement representation of negative values. See the r...
[0-9] and \d are equivalent patterns (unless your Regex engine is unicode-aware and \d also matches things like ②). They will both match a single digit character so you can use whichever notation you find more readable. Create a string of the pattern you wish to match. If using the \d notation, you...
9.0 // Since the anchor system simply returns constraints, you still need to add them somewhere. View.AddConstraints( new[] { someLabel.TopAnchor.ConstraintEqualTo(TopLayoutGuide.GetBottomAnchor()), anotherLabel.TopAnchor.ConstraintEqualTo(someLabel.BottomAnchor, 6), ...
The static method Date.now returns the number of milliseconds that have elapsed since 1 January 1970 00:00:00 UTC. To get the number of milliseconds that have elapsed since that time using an instance of a Date object, use its getTime method. // get milliseconds using static method now of Date co...
The navigation bar (at the bottom of the screen) can be transparent. Here is the way to achieve it. <style name="AppTheme" parent="Theme.AppCompat"> <item name="android:windowTranslucentNavigation">true</item> </style> The Status Bar (t...
9 Patches are stretchable images in which the areas which can be stretched are defined by black markers on a transparent border. There is a great tutorial here. Despite being so old, it's still so valuable and it helped many of us to deeply understand the 9 patch gear. Unfortunately, recently tha...
Configure your app's URLconf to automatically use a URL namespace by setting the app_name attribute: # In <myapp>/urls.py from django.conf.urls import url from .views import overview app_name = 'myapp' urlpatterns = [ url(r'^$', overview, name='overview'), ] This will set t...
Here is a tested code for image and video.It will work for all APIs less than 19 and greater than 19 as well. Image: if (Build.VERSION.SDK_INT <= 19) { Intent i = new Intent(); i.setType("image/*"); i.setAction...
You can place an SKCameraNode into an SKScene to define which part of the scene is shown in the SKView. Think of the SKScene as a 2D world with a camera floating above it: the SKView will show what the camera 'sees'. E.g. the camera could be attached to the main character's sprite to follow the act...
When more than 9 arguments are supplied, the shift [/n] command can be used, where /n means start at the nth argument, n is between zero and eight. Looping through arguments: :args set /a "i+=1" set arg!i!=%~1 call echo arg!i! = %%arg!i!%% shift goto :args Note, in the above exam...
1067 This is probably related to TIMESTAMP defaults, which have changed over time. See TIMESTAMP defaults in the Dates & Times page. (which does not exist yet) 1292/1366 DOUBLE/Integer Check for letters or other syntax errors. Check that the columns align; perhaps you think you are putting i...

139

Error 139 may mean that the number and size of the fields in the table definition exceeds some limit. Workarounds: Re-think the schema Normalize some fields Vertically partition the table
C++98 is the first standardized version of C++. As it was developed as an extension to C, many of the features which set apart C++ from C are added. Language Extensions (in respect to C89/C90) Classes, Derived classes, virtual member functions, const member functions Function overloading, Opera...
The summation 1/1 + 1/4 + 1/9 + 1/16 + ... out to infinity converges to π2 / 6, and therefore any summation of the form 1/1 + 1/4 + 1/9 + 1/16 + ... + 1/n2 is Θ(1).
The TLC5940 is a handy item to have when you run out of PWM ports on the Arduino. It has 16 channels, each individually controllable with 12 bits of resolution (0-4095). An existing library is available at http://playground.arduino.cc/Learning/TLC5940. It is useful for controlling multiple servos or...
Cast your random floating-point number as an int. Input: my $range = 10; # create random integer as low as 0 and as high as 9 my $random = int(rand($range)); # max value is up to but not equal to $range print $random . "\n"; Output: A random integer, like... 0 See also t...
Sometimes we want to use a where query on a a collection of records returned which is not ActiveRecord::Relation.Hence we get the above error as Where clause is know to ActiveRecord and not to Array. There is a precise solution for this by using Joins. EXAMPLE:- Suppose i need to find all user ...
Dim copycars(), cars(2), x Redim copycars(0) x = 0 cars(0) = "Ford" cars(1) = "Audi" cars(2) = "Prius" Do Until x = ubound(cars) copycars(ubound(copycars)) = cars(x) redim preserve copycars(ubound(copycars)+1) x = x + 1 Loop redim preserve copycar...
Encapsulating an OpenGL object in C++98/03 requires obeying the C++ rule of 3. This means adding a copy constructor, copy assignment operator, and destructor. However, copy constructors should logically copy the object. And copying an OpenGL object is a non-trivial undertaking. Equally importantly,...
This guide is explicitly for PostgreSQL 9.1 or higher on linux machines. It uses the postgres extensions-feature that will greatly improve the import of extensions to an existing postgres-installation. If you have to work with an older version of postgres, please refer to the official documentations...

Page 1 of 2