Tutorial by Examples: v

Changing some CSS attribute will trigger the browser to synchronously calculate the style and layout, which is a bad thing when you need to animate at 60fps. DON'T Animate with left and top trigger layout. #box { left: 0; top: 0; transition: left 0.5s, top 0.5s; position: absolute; ...
HTML comments (optionally preceded by whitespace) will cause code (on the same line) to be ignored by the browser also, though this is considered bad practice. One-line comments with the HTML comment opening sequence (<!--): Note: the JavaScript interpreter ignores the closing characters of H...
When developing several applications on one machine, it becomes useful to separate out dependencies into virtual environments. With the use of virtualenv, these environments are sourced into your shell so that when you run a command, it comes from that virtual environment. This is most commonly in...
Activity is the root UserInterface in Android and have it's own life-cycle. MainActivity.java public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Toast.makeText(this, "Activ...
There are two ways to define functions with multiple parameters in F#, Curried functions and Tupled functions. let curriedAdd x y = x + y // Signature: x:int -> y:int -> int let tupledAdd (x, y) = x + y // Signature: x:int * y:int -> int All functions defined from outside F# (such as ...
A std::string containing a number can be converted into an integer type, or a floating point type, using conversion functions. Note that all of these functions stop parsing the input string as soon as they encounter a non-numeric character, so "123abc" will be converted into 123. The s...
There are various methods available for explicitly converting a string to an integer, such as: Convert.ToInt16(); Convert.ToInt32(); Convert.ToInt64(); int.Parse(); But all these methods will throw a FormatException, if the input string contains non-numeric characters. For t...
Objective-C NSString *textToShare = @"StackOverflow Documentation!! Together, we can do for Documentation what we did for Q&A."; NSURL *documentationURL = [NSURL URLWithString:@"http://stackoverflow.com/tour/documentation"]; NSArray *objectsToShare = @[textToShare, docum...
You can remove any of the conventions defined in the System.Data.Entity.ModelConfiguration.Conventions namespace, by overriding OnModelCreating method. The following example removes PluralizingTableNameConvention. public class EshopContext : DbContext { public DbSet<Product> Products...
rvest is a package for web scraping and parsing by Hadley Wickham inspired by Python's Beautiful Soup. It leverages Hadley's xml2 package's libxml2 bindings for HTML parsing. As part of the tidyverse, rvest is piped. It uses xml2::read_html to scrape the HTML of a webpage, which can then be sub...
Comparing string in a case insensitive way seems like something that's trivial, but it's not. This section only considers unicode strings (the default in Python 3). Note that Python 2 may have subtle weaknesses relative to Python 3 - the later's unicode handling is much more complete. The first thi...
If the file does not contain a header row, File: 1;str_data;12;1.4 3;str_data;22;42.33 4;str_data;2;3.44 2;str_data;43;43.34 7; str_data; 25; 23.32 you can use the keyword names to provide column names: df = pandas.read_csv('data_file.csv', sep=';', index_col=0, ski...
generate sample data frames: In [57]: df3 = pd.DataFrame({'col1':[211,212,213], 'col2': [221,222,223]}) In [58]: df1 = pd.DataFrame({'col1':[11,12,13], 'col2': [21,22,23]}) In [59]: df2 = pd.DataFrame({'col1':[111,112,113], 'col2': [121,122,123]}) In [60]: df3 = pd.DataFrame({'col1':[211,2...
Given this object: var obj = { a: "hello", b: "this is", c: "javascript!", }; You can convert its values to an array by doing: var array = Object.keys(obj) .map(function(key) { return obj[key]; }); console.log(array); // [&quot...
On CLiki, a Wiki for Common Lisp and free Common Lisp software, a list of Proposed ANSI Revisions and Clarifications is being maintained. Since the Common Lisp standard has not changed since 1994, users have found several problems with the specification document. These are documented on the CLiki p...
From the official documentation: If you want to get advanced, you can also open up the project file for a specific platform by opening the required XCode or Android Eclipse project in platforms/PLATFORM inside the root of your project. Then, you can build and test from inside the platform-specifi...
Tuples are useful to swap values between 2 (or more) variables without using temporary variables. Example with 2 variables Given 2 variables var a = "Marty McFly" var b = "Emmett Brown" we can easily swap the values (a, b) = (b, a) Result: print(a) // "Emmett Bro...
To get the previous element you can use the .prev() method. <ul> <li>Mark</li> <li class="anna">Anna</li> <li>Paul</li> </ul> If you are standing on the "Anna" element and you want to get the previous element, &q...
On Debian-based distributions, including Ubuntu, the most straightforward way is to use the .deb installation file. Go to the Scala website. Choose the version you want to install then scroll down and look for scala-x.x.x.deb. You can install the scala deb from command line: sudo dpkg -i scala-x.x...
Collections in Java only work for objects. I.e. there is no Map<int, int> in Java. Instead, primitive values need to be boxed into objects, as in Map<Integer, Integer>. Java auto-boxing will enable transparent use of these collections: Map<Integer, Integer> map = new HashMap<&g...

Page 77 of 296