Tutorial by Examples: ed

The below example uses Android.Runtime.InputStreamInvoker and Android.Runtime.OutputStreamInvoker types obtain Java.IO.InputStream and Java.IO.OutputStream. Once we have a Java.IO.InputStream instance, we can use its .Available() method to get the number of available response bytes which we can use...
Defined within Another Class C++ Nested Class[ref] (needs a reference to enclosing class) class Outer { class Inner { public: Inner(Outer* o) :outer(o) {} private: Outer* outer; }; }; Java [non-static] Nested Class (aka Inner Class or Member Class...
data.service.ts: import { Injectable } from '@angular/core'; import { Http } from '@angular/http'; import 'rxjs/add/operator/map'; @Injectable() export class DataService { constructor(private http: Http) { } fetchData(){ return this.http.get('https://dinstruct-d4b62.firebaseio....
This is continuation of previous example. Cascading DropDown for country's city name. This method will be called by Jquery when user is done with country selection in parent dropdown. I have followed MVC concept and provided the basic approach for cascading dropdown. Ajax will call GetCityName met...
Design of Nested-GridView (HTML Code): <asp:GridView ID="gvParent" runat="server" AutoGenerateColumns="false" OnRowDataBound="gvParent_RowDataBound"> <Columns> <asp:TemplateField HeaderText="Parent Column"> ...
Code Group group = new Group(); group.setId(1); group.setName("Ke"); User user1 = new User(); user1.setId(2); user1.setName("Liu"); User user2 = new User(); user2.setId(3); user2.setName("Yue"); ...
public class BaseViewModel extends ViewModel { private static final int TAG_SEGMENT_INDEX = 2; private static final int VIDEOS_LIMIT = 100; // We save input params here private final MutableLiveData<Pair<String, String>> urlWithReferrerLiveData = new MutableLiveData...
You may write custom LiveData, if you need custom logic. Don't write custom class, if you only need to transform data (use Transformations class) public class LocationLiveData extends LiveData<Location> { private LocationManager locationManager; private LocationListener liste...
1 2 3 <public publicId="-//OASIS//DTD DocBook XML V4.5//EN" 4 uri="docbook45/docbookx.dtd"/> <system systemId="http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" 5 uri="docbook45/docbookx.dtd"/> <system ...
datepicker-overview-example.html: <md-input-container> <input mdInput [mdDatepicker]="picker" placeholder="Choose a date" [(ngModel)]="value"> <button mdSuffix [mdDatepickerToggle]="picker"></button> </md-input-container&...
This example requires MdDialogRef and MD_DIALOG_DATA. Please import them in the component module. import {MdDialog, MdDialogRef, MD_DIALOG_DATA} from '@angular/material'; input-overview-example.html: <md-input-container> <input mdInput [(ngModel)]="id" ...
Batch file does not come with a built-in method for replacing nth line of a file except replace and append(> and >>). Using for loops, we can emulate this kind of function. @echo off set file=new2.txt call :replaceLine "%file%" 3 "stringResult" type "%file...
Consider Kotlin's Null Type system and WeakReference<T>. So let's say we have to save some sort of reference and we wanted to avoid memory leaks, here is where WeakReference comes in. take for example this: class MyMemoryExpensiveClass { companion object { var reference: WeakR...
/***************************** @return all events ****************************/ public function getallevents(){ //get data from model $events = array( array('Event 1', '2015-04-03'), array('Event 2', '2015-04-03'), array('Event 3', '2015-06-16'), array('Event 4', '2015-0...
/***************************** login user @required : username and password via post method only @return user data if login successfull otherwise error message ****************************/ public function login(){ $username=$this->input->post('username'); $password=$this->input-...
/*************************** 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...
This code creates the table: begin execute immediate 'create table my_table (id number, column_value varchar2(100))'; end; /
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...

Page 144 of 145