Tutorial by Examples: er

While using decorator syntax (with the @) is convenient, it also a bit concealing. You can use properties directly, without decorators. The following Python 3.x example shows this: class A: p = 1234 def getX (self): return self._x def setX (self, value): self._x =...
R has a set of built in higher order functions: Map, Reduce, Filter, Find, Position, Negate. Map applies a given function to a list of values: words <- list("this", "is", "an", "example") Map(toupper, words) Reduce successively applies a binary functi...
In Internet Explorer 10+ and Edge, Microsoft provides the -ms-high-contrast media selector to expose the "High Contrast" setting from the browser, which allows the programmer to adjust their site's styles accordingly. The -ms-high-contrast selector has 3 states: active, black-on-white, ...
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----- --...
So, have you ever wondered how to use your PEM RSA key pair that was generated by OpenSSL in Web Cryptography API? If the answers is yes. Great! You are going to find out. NOTE: This process can also be used for public key, you only need to change prefix and suffix to: -----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...
As from version 5.4, PHP comes with built-in server. It can be used to run application without need to install other http server like nginx or apache. Built-in server is designed only in controller environment for development and testing purposes. It can be run with command php -S : To test it cr...
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...
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...
Placeholders can be used in strings to automatically substitute the values in the final string. container = "cup" liquid = "coffee" string = "Filling the #{container} with #{liquid}..." The above String - when printed - will say: Filling the cup with coffee... Yo...
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
CREATE TABLE all_numeric_types( c_tinyint tinyint, c_smallint smallint, c_int int, c_bigint bigint, c_decimal decimal(38,3) ); Minimum and maximum data values: insert into all_numeric_types values (-128,-32768,-2147483648,-9223372036854775808,-99999999999999999999999999999999...
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...
When using interop methods, you can use GetLastError API to get additional information on you API calls. DllImport Attribute SetLastError Attribute SetLastError=true Indicates that the callee will call SetLastError (Win32 API function). SetLastError=false Indicates that the callee will not call...
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...
One of the useful unit when creating a responsive application. Its size depends on its parent container. Equation: ( Parent Container`s width ) * ( Percentage(%) ) = Output For Example: Parent has 100px width while the Child has 50%. On the output, the Child's width will be half(50%) of t...
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="outer"> <div class="inner"> centered </div> </div> </div> CSS: .wrapper { height: 600px; text-align: center; } .outer { display: table; ...
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 220 of 417