Tutorial by Examples: by

ByRef keyword before method parameter says that parameter will be sent in a way allowing the method to change (assign a new value) the variable underlying the parameter. Class SomeClass Public Property Member As Integer End Class Module Program Sub Main() Dim someInstance As ...
ORDER BY clause sorts rows in the returned result set by some column or expression: SELECT * FROM sys.objects ORDER BY create_date
GROUP BY clause groups rows by some value: SELECT type, count(*) as c FROM sys.objects GROUP BY type You can apply some function on each group (aggregate function) to calculate sum or count of the records in the group. typecSQ3S72IT16PK1U5
There are two ways to create object mocked by Mockito: via annotation via mock function Via annotation: With a JUnit test runner: @RunWith(MockitoJUnitRunner.class) public class FooTest { @Mock private Bar barMock; // ... } You can also use Mockito's JUnit @Rule, which...
In most cases all data that is accessed by several threads should be initialized before the threads are created. This ensures that all threads start with a clear state and no race condition occurs. If this is not possible once_flag and call_once can be used #include <threads.h> #include &lt...
Ordering directly on JSONField is not yet supported in Django. But it's possible via RawSQL using PostgreSQL functions for jsonb: from django.db.models.expressions import RawSQL RatebookDataEntry.objects.all().order_by(RawSQL("data->>%s", ("json_objects_key",))) This e...
A common and task of someone using the Linux Command Line (shell) is to search for files/directories with a certain name or containing certain text. There are 2 commands you should familiarise yourself with in order to accomplish this: Find files by name find /var/www -name '*.css' This will...
Let's take a sample class: public class Transaction { public string Category { get; set; } public DateTime Date { get; set; } public decimal Amount { get; set; } } Now, let us consider a list of transactions: var transactions = new List<Transaction> { new Transaction...
// The allocation functions have implementation-defined behavior when the requested size // of the allocation is zero. void *p = malloc(0);
In pass by value of parameter passing to a method, actual parameter value is copied to formal parameter value. So actual parameter value will not change after returning from called function. @interface SwapClass : NSObject -(void) swap:(NSInteger)num1 andNum2:(NSInteger)num2; @end @impleme...
In pass by reference of parameter passing to a method, address of actual parameter is passed to formal parameter. So actual parameter value will be changed after returning from called function. @interface SwapClass : NSObject -(void) swap:(int)num1 andNum2:(int)num2; @end @implementation S...
Ionic uses Gulp, so install gulp-babel and gulp-plumber. npm install --save-dev gulp-babel gulp-plumber Add babel to gulpfile.js like so: //... var babel = require("gulp-babel"); var plumber = require("gulp-plumber"); var paths = { es6: ['./src/es6/*.js'], sass: ...
This pattern will allow you to filter lines depending on its length $cat file AAAAA BBBB CCCC DDDD EEEE $awk 'length($0) > 4 { print $0 }' file AAAAA $ Anyway, the pattern will allow the next code block to be executed, then, as the default action for AWK is printing the current ...
Mage::app()->removeCache($cacheId); Flush all Magento cache entries Mage::app()->cleanCache() or: Mage::app()->getCacheInstance()->flush();
#include <SPI.h> #define CSPIN 1 void setup() { pinMode(CSPIN, OUTPUT); // init chip select pin as an output digitalWrite(CSPIN, 1); // most slaves interpret a high level on CS as "deasserted" SPI.begin(); SPI.beginTransaction(SPISettings(1000000, MSBFIRST, SPI_MO...
When write() is called for a named or unnamed pipe or stream socket whose reading end is closed, two things happen: POSIX.1-2001 SIGPIPE signal is sent to the process that called write() POSIX.1-2004 SIGPIPE signal is sent to the thread that called write() EPIPE error is returned ...
function onButtonClick() { navigator.bluetooth.requestDevice({filters: [{services: ['battery_service']}]}) .then(device => { // Connecting to GATT Server... return device.gatt.connect(); }) .then(server => { // Getting Battery Service... return server.getPri...
function onButtonClick() { navigator.bluetooth.requestDevice({filters: [{services: ['heart_rate']}]}) .then(device => { // Connecting to GATT Server... return device.gatt.connect(); }) .then(server => { // Getting Heart Rate Service... return server.getP...
For complete control over a new Chart and Series object (especially for a dynamic Series name), you must resort to modifying the SERIES formula directly. The process to set up the Range objects is straightforward and the main hurdle is simply the string building for the SERIES formula. The SERIES ...
Code snippet: import java.util.Set; public class ThreadStatus { public static void main(String args[]) throws Exception { for (int i = 0; i < 5; i++){ Thread t = new Thread(new MyThread()); t.setName("MyThread:" + i); t.start(); ...

Page 11 of 23