Tutorial by Examples

In django, there is a url mapper which maps URLs to specific functions (views) which return responses. This strict separation between the file system layout and the URL layout allows great flexibility when writing applications. All url patterns are stored in one or more urls.py files, and there is ...
add_shortcode is wp keyword. // recent-posts is going to be our shortcode. add_shortcode('recent-posts', 'recent_posts_function'); // This function is taking action when recent post shortcode is called. function recent_posts_function() { query_posts(array('orderby' => 'date', 'order' =&...
This functions takes parameter for how many recent posts you want to display. Ex : you want to display only five recent posts. Just passed the arguments with posts="5" (you can pass any number of recent posts that you want to display). Function fetch only five recent posts from database....
ASP.NET Core provides the status code pages middleware, that supports several different extension methods, but we are interesting in UseStatusCodePages and UseStatusCodePagesWithRedirects: UseStatusCodePages adds a StatusCodePages middleware with the given options that checks for responses with...
<a data-bind="attr: { href: myUrl }">link with dynamic href</a> ko.applyBindings({ myUrl: ko.observable("http://www.stackoverflow.com") }); Since there is no native href binding in KnockoutJS, you need to use a different feature to get dynamic links. The abo...
href binding is not native to KnockoutJS, so to get dynamic links use a custom binding handler: <a data-bind="href: myUrl">link with dynamic href</a> ko.bindingHandlers['href'] = { update: function(element, valueAccessor) { element.href = ko.utils.unwrapObservable(v...
public class MyPage : ContentPage { RelativeLayout _layout; Label MiddleText; public MyPage() { _layout = new RelativeLayout(); MiddleText = new Label { Text = "Middle Text" }; MiddleText.SizeChanged += ...
public class MyPage : ContentPage { RelativeLayout _layout; BoxView centerBox; BoxView rightBox; BoxView leftBox; BoxView topBox; BoxView bottomBox; const int spacing = 10; const int boxSize = 50; public MyPage() { _layout = new Rel...
/* SD card test This example shows how use the utility libraries on which the' SD library is based in order to get info about your SD card. Very useful for testing a card when you're not sure whether its working or not. The circuit: * SD card attached to SPI bus as follows: ** MOS...
/* SD card datalogger This example shows how to log data from three analog sensors to an SD card using the SD library. The circuit: * analog sensors on analog ins 0, 1, and 2 * SD card attached to SPI bus as follows: ** MOSI - pin 11 ** MISO - pin 12 ** CLK - pin 13 ** CS - ...
/* SD card file dump This example shows how to read a file from the SD card using the SD library and send it over the serial port. The circuit: * SD card attached to SPI bus as follows: ** MOSI - pin 11 ** MISO - pin 12 ** CLK - pin 13 ** CS - pin 4 created 22 December 20...
/* SD card basic file example This example shows how to create and destroy an SD card file The circuit: * SD card attached to SPI bus as follows: ** MOSI - pin 11 ** MISO - pin 12 ** CLK - pin 13 ** CS - pin 4 created Nov 2010 by David A. Mellis modified 9 Apr 2012 by ...
/* Listfiles This example shows how print out the files in a directory on a SD card The circuit: * SD card attached to SPI bus as follows: ** MOSI - pin 11 ** MISO - pin 12 ** CLK - pin 13 ** CS - pin 4 created Nov 2010 by David A. Mellis modified 9 Apr 2012 ...
/* SD card read/write This example shows how to read and write data to and from an SD card file The circuit: * SD card attached to SPI bus as follows: ** MOSI - pin 11 ** MISO - pin 12 ** CLK - pin 13 ** CS - pin 4 created Nov 2010 by David A. Mellis modified 9 Apr 2012 ...
> library(ggplot2) > ggplot(iris,aes(Sepal.Width)) + geom_density() + xlim(1,3.5) Using xlim or ylim the plot is not cutted, ggplot subsets the data before calling the stat function (stat_density in this case). You can see it in the warning message. Warning message: Removed 19 rows cont...
ggplot(iris[iris$Species == "setosa",],aes(Sepal.Width)) + geom_density() Here, we are subsetting the dataframe before passing it to ggplot. It is a very useful tool derived from the data frame data structure. To make the code more readable, one can also use dplyr's filter: libr...
When testing with Google App Engine's testing library the challenges of eventual consistency are present in the same manner they will be in production. Therefore in order to write something into the datastore to test retrieval you have to create a context which is strongly consistent. type Foo str...
This example shows how to find circular blobs in an grayscale image. The evaluation of the circularity of a blob is done using the area and the perimeter (arc length) of the contour. The center point gets evaluated using the moments of the contour. #include "opencv/cv.h" #include &quot...
By default, mix new <projectname> will generate a .gitignore file in the project root that is suitable for Elixir. # The directory Mix will write compiled artifacts to. /_build # If you run "mix test --cover", coverage assets end up here. /cover # The directory Mix downloads...
install loaders npm install --save-dev ts-loader source-map-loader tsconfig.json { "compilerOptions": { "sourceMap": true, "noImplicitAny": true, "module": "commonjs", "target": "es5", "jsx&quo...

Page 900 of 1336