Tutorial by Examples: l

Detailed instructions on getting serial-port set up or installed.
from Queue import Queue question_queue = Queue() for x in range(1,10): temp_dict = ('key', x) question_queue.put(temp_dict) while(not question_queue.empty()): item = question_queue.get() print(str(item)) Output: ('key', 1) ('key', 2) ('key', 3) ('key', 4) ('key'...
double res[MAX]; int i; #pragma omp parallel { #pragma omp for for (i=0;i< MAX; i++) { res[i] = huge(); } } The for loop will be executed in parallel. huge() is some method which can take too long to get execute. OpenMP supports a shortcut to write the ab...
#include <omp.h> void main () { int i; double ZZ, func(), res=0.0; #pragma omp parallel for reduction(+:res) private(ZZ) for (i=0; i< 1000; i++){ ZZ = func(I); res = res + ZZ; } } In the last line: Actually added to a private ...
Sample Example Taken from one benchmarking import ijson def load_json(filename): with open(filename, 'r') as fd: parser = ijson.parse(fd) ret = {'builders': {}} for prefix, event, value in parser: if (prefix, event) == ('builders', 'map_key'): ...
So the main goal of this function is to : Be standalone because it needs to be written in the main VbScript file and cannot be in an included file (because it defines the include function) Provide enough information if something goes wrong (ie. the file that was being included, the error that oc...
To include a file in another file, just use the one liner : IncludeFile "myOtherFile.vbs"
If our component is not ready and waiting for data from server, then we can add loader using *ngIf. Steps: First declare a boolean: loading: boolean = false; Next, in your component add a lifecycle hook called ngOnInit ngOnInit() { this.loading = true; } and after you get complete dat...
<p class="alert alert-success" *ngIf="names.length > 2">Currently there are more than 2 names!</p>
NgFor provides Some values that can be aliased to local variables index -(variable) position of the current item in the iterable starting at 0 first -(boolean) true if the current item is the first item in the iterable last -(boolean) true if the current item is the last item in the iterable ...
Now let's create a service provider. Let's put it under app/Providers: <?php namespace App\Providers; class HelpersServiceProvider extends ServiceProvider { public function register() { require_once __DIR__ . '/../Helpers/document.php'; } } The above service pr...
To generate schema, view, controller, migration file for the repository, default CRUD templates and test files for a model (like a scaffolding in Rails) one can use phoenix.gen.html mix task like this: mix phoenix.gen.html Book books title note:text pages:integer author_id:references:authors Wh...
Unfortunately Sencha does not directly give you access to Extjs 4. Their download SDK links lead directly to the newer version of Extjs (currently 6). Although you can still find websites that are hosting the library files (I will have to leave you to it since Extjs is under the LGPL license for o...
Detailed instructions on getting perforce set up or installed.
Display the date by itself (custom field is tour_date): <p>Tour Date <?php the_field('tour_date');?></p>
Let's say you want to show a text field (announcement) based on the time (a scheduled notification message for instance). You need two date-time fields. In our example, one is called start_date and the other end_date. <?php $DateNow = date('Y-m-d H:i:s'); $DateStart = get_field('start_date',...
To enable SSH create a file called ssh in the /boot directory of your SD card. Identify the drive letter associated with your SD card. Open a command prompt (press Win+R on your keyboard to open the Run window. Then, type cmd) Enter the following at the command prompt (replacing Drive...
Go to File --> Settings --> click plugins in left hand pane --> Search for cucumber --> Install plugin
This is a quick guide to get Robot Framework 3.0 working on a Windows machine using Python 2.7.11 - It does not go into too much depth on the why and how, it simply gets you up and running. First things are first, let't go and install Python! Download Python 2.7.11 for Windows. (Windows x86-64 ...
At the end of the document add the following: \bibliographystyle{style} \bibliography{file location} Create a file with extension .bib and save the citation as follows: @inproceedings{citation_name, title={Paper Title}, author={List Authors}, pages={45--48}, year={2013}, organizat...

Page 686 of 861