Tutorial by Examples: a

/*************************** log out user ***************************/ public function logout(){ //delete all session session_destroy(); $this->output->set_output(json_encode(array('status'=>true,'msg'=>'log Out successfully'))); }
This API not accessible for public user, authentication is required /*************************** this is protected api this is not accessible if you are not loged in ***************************/ public function protectedapi(){ if($this->session->userdata('logged_in')){ //this secti...
ng-repeat is the built-in directive provided by AngularJS, mostly used for listing the array elements on UI dynamically as per the changes in our model. Official "ng-repeat" docs can be found at : https://docs.angularjs.org/api/ng/directive/ngRepeat Also the most common error faced whil...
There are times when the framework's Random() class may not be considered random enough, given that it is based on a psuedo-random number generator. The framework's Crypto classes do, however, provide something more robust in the form of RNGCryptoServiceProvider. The following code samples demonstr...
Let's say a user wants to select data from different tables. A table is specified by the user. function get_value(p_table_name varchar2, p_id number) return varchar2 is value varchar2(100); begin execute immediate 'select column_value from ' || p_table_name || ...
Example below inserts value into the table from the previous example: declare query_text varchar2(1000) := 'insert into my_table(id, column_value) values (:P_ID, :P_VAL)'; id number := 2; value varchar2(100) := 'Bonjour!'; begin execute immediate query_text using id, value; end; / ...
Let's update table from the first example: declare query_text varchar2(1000) := 'update my_table set column_value = :P_VAL where id = :P_ID'; id number := 2; value varchar2(100) := 'Bonjour le monde!'; begin execute immediate query_text using value, id; end; /
This code creates the table: begin execute immediate 'create table my_table (id number, column_value varchar2(100))'; end; /
You can execute anonymous block. This example shows also how to return value from dynamic SQL: declare query_text varchar2(1000) := 'begin :P_OUT := cos(:P_IN); end;'; in_value number := 0; out_value number; begin execute immediate query_text using out out_value, in in_value; dbms_o...
It's very easy to install nedb. npm install nedb --save # Put latest version in your package.json For bower loving people, bower install nedb
While building electron apps, usually the backend is in separate folder (js files) and front end is in a separate folder (html files). In the backend, in order to use the database, we have to include the nedb package with the require statement as follows. var Datastore = require('nedb'),db = new Da...
Basically, in order to insert records to nedb, the data is stored in the form of json with the key being the column names and the value for those names will be the values for that record. var rec = { name: 'bigbounty',age:16}; db.insert(rec, function (err, newrec) { // Callback is optional ...
In order to search for records in nedb, again we need to just pass the json containing the search criteria as a parameter to the find function of db object. db.find({ name: 'bigbounty' }, function (err, docs) { // docs is an array containing documents that have name as bigbounty // If no docu...
Commands are used for handling Events in WPF while respecting the MVVM-Pattern. A normal EventHandler would look like this (located in Code-Behind): public MainWindow() { _dataGrid.CollectionChanged += DataGrid_CollectionChanged; } private void DataGrid_CollectionChanged(object sender, S...
How comp, comp-1 ... comp-5 are implemented is implementation dependent. Format Normal Implementation Comp Big endian binary integer Comp-1 4 byte floating point Comp-2 8 byte floating point Comp-3 Packed decimal 123 is stored as x'123c' Comp-5 Binary In...
The default style files generated and compiled by @angular/cli are css. If you want to use scss instead, generate your project with: ng new project_name --style=scss If you want to use sass, generate your project with: ng new project_name --style=sass
Yarn is an alternative for npm, the default package manager on @angular/cli. If you want to use yarn as package manager for @angular/cli follow this steps: Requirements yarn (npm install --global yarn or see the installation page) @angular/cli (npm install -g @angular/cli or yarn global add @an...
Let's write a small program which will open a window, and write "Hello World" on the screen. #include <SFML\Graphics.hpp> #include <cassert> int main() { sf::RenderWindow sfmlWin(sf::VideoMode(600, 360), "Hello World SFML Window"); sf::Font font; /...
This example shows an efficient way of calculating power using template metaprogramming. template <int base, unsigned int exponent> struct power { static const int halfvalue = power<base, exponent / 2>::value; static const int value = halfvalue * halfvalue * power<base, e...
.container has one fixed width for each screen size in bootstrap (xs,sm,md,lg); .container-fluid expands to fill the available width. @media (min-width: 568px) { .container { width: 550px; } } @media (min-width: 992px) { .container { width: 970px; } } @media (min-width: 1...

Page 1093 of 1099