Tutorial by Examples: f

class Tutorial extends Game { public ScreenNumberOne screenNumberOne; public void create(){ screenNumberOne = new ScreenNumberOne(this); this.setScreen(screenNumberOne); } public void render() { super.render(); } } That is the basic...
<script type="text/javascript" src="URL" async></script>
Progress bars can be styled with the progress[value] selector. This example gives a progress bar a width of 250px and a height of 20px progress[value] { width: 250px; height: 20px; } Progress bars can be especially difficult to style. Chrome / Safari / Opera These browsers use the -web...
For browsers that do not support the progress element, you can use this as a workaround. <progress max="100" value="20"> <div class="progress-bar"> <span style="width: 20%;">Progress: 20%</span> </div> </pr...
sqoop import \ --connect <rdbms-jdbc-url> \ --username <username> \ --password <password> \ --table <table-name> Example with Mysql: sqoop import \ --connect jdbc:mysql://mysql.example.com/testdb \ --username root \ --password root \ --table employees CSV file ...
Using --where tag sqoop import \ --connect <rdbms-jdbc-url> \ --username <username> \ --password <password> \ --table <table-name> \ --where "<condition>" Example with Mysql: sqoop import \ --connect jdbc:mysql://mysql.example.com/testdb \ --userna...
In this example you will learn how to generate RSA-OAEP key pair and how to convert private key from this key pair to base64 so you can use it with OpenSSL etc. Please note that this process can also be used for public key you just have to use prefix and suffix below: -----BEGIN PUBLIC KEY----- --...
In the light of the latest httpoxy vulnerabilities, there is another variable, that is widely misused. HTTP_X_FORWARDED_FOR is often used to detect the client IP address, but without any additional checks, this can lead to security issues, especially when this IP is later used for authentication or...
C99 Since C99, C has variable length arrays, VLA, that model arrays with bounds that are only known at initialization time. While you have to be careful not to allocate too large VLA (they might smash your stack), using pointers to VLA and using them in sizeof expressions is fine. double sumAll(si...
The following example creates a FileSystemWatcher to watch the directory specified at run time. The component is set to watch for changes in LastWrite and LastAccess time, the creation, deletion, or renaming of text files in the directory. If a file is changed, created, or deleted, the path to the f...
A common mistake a lot of people starting out with FileSystemWatcher does is not taking into account That the FileWatcher event is raised as soon as the file is created. However, it may take some time for the file to be finished . Example: Take a file size of 1 GB for example . The file apr ask c...
Dependencies can be added for specific configuration like test/androidTest androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.1' testCompile 'junit:junit:3.8.1' Alternatively create your own configuration configurations { myconfig } And then download dependency fo...
Suppose we have an array of integers and we want to figure out the maximum value without holding the whole array in memory all at once. This approach can be adapted to handle a variety of other situations in which data needs to be processed while being deserialized instead of after. extern crate se...
Selecting only the attribute value of a link:href will return the relative URL. String bodyFragment = "<div><a href=\"/documentation\">Stack Overflow Documentation</a></div>"; Document doc = Jsoup.parseBodyFragment(bodyFragment); ...
CoffeeScriptJavaScriptis, =====isnt, !=!==not!and&&or||true, yes, ontruefalse, no, offfalse@, thisthisofininNo equivalenta ** bMath.pow(a, b)a // bMath.floor(a / b)a %% b(a % b + b) % b
Many bugs in knockout data binds are caused by undefined properties in a viewmodel. Knockout has two handy methods to retrieve the binding context of an HTML element: // Returns the binding context to which an HTMLElement is bound ko.contextFor(element); // Returns the viewmodel to which ...
CREATE TABLE all_floating_numeric_types( c_float float, c_double double ); Minimum and maximum data values: insert into all_floating_numeric_types values (-3.4028235E38,-1.7976931348623157E308); insert into all_floating_numeric_types values (-1.4E-45,-4.9E-324); insert into all_floatin...
Do not allocate new objects in onDraw @Override protected void onDraw(Canvas canvas) { super.onDraw(canvas); Paint paint = new Paint(); //Do not allocate here } Instead of drawing drawables in canvas... drawable.setBounds(boundsRect); drawable.draw(canvas); Use a B...
img{ float:left; width:100px; margin:0 10px; } .div1{ background:#f1f1f1; /* does not create block formatting context */ } .div2{ background:#f1f1f1; overflow:hidden; /* creates block formatting context */ } https://jsfiddle.net/MadalinaTn/qkwwmu6m/2/ Using the o...
HTML: <div class="wrapper"> <div class="centered"> centered </div> </div> CSS: .wrapper { position: relative; height: 600px; } .centered { position: absolute; z-index: 999; transform: translate(-50%, -50%); top:...

Page 232 of 457