Tutorial by Examples: ad

function openDatabase(dbName) { var request = indexedDB.open(dbName); request.onsuccess = function (e) { var database = request.result; if (database) { console.log("Database initialized."); } else { console.error("Database is not initialized!");...
#include <threads.h> #include <stdio.h> int run(void *arg) { printf("Hello world of C11 threads."); return 0; } int main(int argc, const char *argv[]) { thrd_t thread; int result; thrd_create(&thread, run, NULL); thrd_join(&...
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...
The following steps need to be done in the app.ionic.io Create an account or login into your ionic account Click "New App" in the Dashboard and give name for your app I named my app as 'MyIonicApp' In the overview section of this newly created app, there will be a ID...
At first initilize the firebase sdk and admin SDK const functions = require('firebase-functions'); const admin = require('firebase-admin'); admin.initializeApp({ credential: admin.credential.cert({ //your admin credential certificate generated from the console. Follow this [link][1]...
import threading import time class StoppableThread(threading.Thread): """Thread class with a stop() method. The thread itself has to check regularly for the stopped() condition.""" def __init__(self): super(StoppableThread, self).__init__()...
page.includeCSS { bootstrap = fileadmin/css/bootstrap.min.css fonts = fileadmin/css/font-awesome.min.css owl = fileadmin/css/owl.carousel.css style = fileadmin/css/docs.css } page.includeJSFooter{ bootstrapmin = fileadmin/js/bootstrap.min.js lightbox = fileadmin/js/...
In the following example, we create an Activity to display a single TextView. The TextView will use a SpannableString as its content, which will illustrate some of the available styles. Here' what we're gonna do with the text : Make it larger Bold Underline Italicize Strike-through Colored...
In memory, an image can be seen as a matrix of pixel (color). However, when an image being stored in a permanent storage, it may be stored as is (RAW format), Bitmap or other image formats with particular compression algorithm for saving storage space, e.g. PNG, JPEG, GIF, etc. When loading an image...
VsCode is unable to create the ionic project because it is a code editor.So you can create your ionic project by CLI or cmd. create your project by below command $ ionic start appName blank Above command use to create blank template ionic application. Ionic2 provide three type of templates blank...
The arguments passed from the console can be received in the Kotlin program and it can be used as an input. You can pass N (1 2 3 and so on) numbers of arguments from the command prompt. A simple example of a command-line argument in Kotlin. fun main(args: Array<String>) { println(&qu...
The advantage of immutability comes with concurrency. It is difficult to maintain correctness in mutable objects, as multiple threads could be trying to change the state of the same object, leading to some threads seeing a different state of the same object, depending on the timing of the reads and ...
The most effective way to resolve curl to a different server is to use the --resolve option. This option will insert the address into curl's DNS cache, so it will effectively make curl believe that's the address it got when it resolved the name. Like so: curl --resolve eaxmple.com:80:1.2.3.4 http:...
The "Host:" header is a normal way an HTTP client tells the HTTP server which server it speaks to. By passing custom modified "Host:" header you can have the server respond with the content of the site, even if you didn't actually connect to the host name. For example, if you ha...
from django.contrib.auth.models import User class UserAdmin(admin.ModelAdmin): list_display = ('email', 'first_name', 'last_name') list_filter = ('is_staff', 'is_superuser') admin.site.unregister(User) admin.site.register(User, UserAdmin) We need to unregister before regis...
Here we will create a rest APi which will take file object as a multipart parameter from front end and upload it to S3 bucket using java rest API. Requirement :- secrete key and Access key for s3 bucket where you wanna upload your file. code:- DocumentController.java @RestController @Requ...
A typical example of the implementation of a Looper thread given by the official documentation uses Looper.prepare() and Looper.loop() and associates a Handler with the loop between these calls. class LooperThread extends Thread { public Handler mHandler; public void run() { Lo...
A HandlerThread can be used to start a thread with a Looper. This looper then can be used to create a Handler for communications with it. HandlerThread thread = new HandlerThread("thread-name"); thread.start(); Handler handler = new Handler(thread.getLooper());
It was most frequent question that can a same thread can be run twice. The answer for this is know one thread can run only once . if you try to run the same thread twice it will execute for the first time but will give error for second time and the error will be IllegalThreadStateException . exam...
A simple OGL 4.0 GLSL shader program with vertex position and color attribute. The program is executed with a phyton script. To run the script, PyOpenGL must be installed. A shader program consists at least of a vertex shader and a fragmant shader (exception of computer shaders). The 1st shader s...

Page 110 of 114