This is a more generic solution applicable in system where the user has option to add indexes to the table that he uses:
function createTable(dbName, tableName) {
var request = indexedDB.open(dbName);
request.onsuccess = function (e){
var database = e.target.result;
var version = p...
As it can be seen from the picture above, on a single application we can create:
Multiple databases
Each database can have multiple object stores (tables)
Each object store can have stored multiple objects
Node js code
Sample to start this topic is Node.js server communicating with Arduino via serialport.
npm install express --save
npm install serialport --save
Sample app.js:
const express = require('express');
const app = express();
var SerialPort = require("serialport");
var po...
Suppose we have this source file that we would like to split:
cat -n sourcefile
1 On the Ning Nang Nong
2 Where the Cows go Bong!
3 and the monkeys all say BOO!
4 There's a Nong Nang Ning
5 Where the trees go Ping!
6 And the tea pots jibber jabber joo.
7 On the Nong Ning Nang
Comma...
To install PLY on your machine for python2/3, follow the steps outlined below:
Download the source code from here.
Unzip the downloaded zip file
Navigate into the unzipped ply-3.10 folder
Run the following command in your terminal: python setup.py install
If you completed all the above, you...
Let's demonstrate the power of PLY with a simple example: this program will take an arithmetic expression as a string input, and attempt to solve it.
Open up your favourite editor and copy the following code:
from ply import lex
import ply.yacc as yacc
tokens = (
'PLUS',
'MINUS',
...
There are two steps that the code from example 1 carried out: one was tokenizing the input, which means it looked for symbols that constitute the arithmetic expression, and the second step was parsing, which involves analysing the extracted tokens and evaluating the result.
This section provides a ...
This section explains how the tokenized input from Part 1 is processed - it is done using Context Free Grammars (CFGs). The grammar must be specified, and the tokens are processed according to the grammar. Under the hood, the parser uses an LALR parser.
# Yacc example
import ply.yacc as yacc
...
Resource dictionaries are accessible only inside the context they were declared, so if we intended to reference resources that are declared in one page context from another page they will not be found. So if we need global resources to be defined like the ones that comes with the framework we do it ...
Almost usually things are a little bit more complex and to support scalability we should split things apart. So we can define various files containing different resources dictionaries, i.e. resources for UI controls' themes, resources for texts and so on, then we merge them all together in App.xaml ...
We now need to access to our declared resources, in order to do that from XAML code we use {ThemeResource ResourceKey} or {StaticResource ResourceKey}
to be continued later.
This method extends the jQuery prototype ($.fn) object to provide new custom methods that can be chained to the jQuery() function.
For example:
<div>Hello</div>
<div>World!</div>
<script>
jQuery.fn.extend({
// returns combination of div texts as a result
g...
Use nic to create a new project
Enter this command in your terminal
$THEOS/bin/nic.pl
NIC 2.0 - New Instance Creator
------------------------------
[1.] iphone/activator_event
[2.] iphone/application_modern
[3.] iphone/cydget
[4.] iphone/flipswitch_switch
[5.] iphone/framework
...
You can add custom post type posts on default wordpress search, Add below code in theme functions.php
function my_search_filter($query) {
if ( !is_admin() && $query->is_main_query() ) {
if ($query->is_search) {
$query->set('post_type', array( 'news','post','article' ...
You can use get_results to get multiple rows from database.
global $wpdb;
$userTable =$wpdb->prefix."users";
$selectUser = $wpdb->get_results("SELECT * FROM $userTable");
This will show all users list in array.
You can get specific file using this function.
get_template_part('template-parts/layout');
Include layout.php file from template-parts subdirectory placed in the root of your theme folder.
Ok, so now you have your layer designed! This is how you define it in your .prototxt file:
layer {
name: "LayerName"
type: "Python"
top: "TopBlobName"
bottom: "BottomBlobName"
python_param {
module: "My_Custom_Layer_File"
la...