var json = "{\"Name\":\"Joe Smith\",\"Age\":21}";
var person = JsonConvert.DeserializeObject<Person>(json);
This yields a Person object with Name "Joe Smith" and Age 21.
Let A and B be two matrices of same dimension. The operators +,-,/,*,^ when used with matrices of same dimension perform the required operations on the corresponding elements of the matrices and return a new matrix of the same dimension. These operations are usually referred to as element-wise opera...
Example:
s = "Hello" # s is a string
Then we find out something about s. Lets begin:
So you want to know what is the class of s at run time?
irb(main):055:0* s.class
=> String
Ohh, good. But what are the methods of s?
irb(main):002:0> s.methods
=> [:unicode_normalize,...
SET @searchTerm= 'Database Programming';
SELECT MATCH (Title) AGAINST (@searchTerm IN NATURAL LANGUAGE MODE) Score,
ISBN, Author, Title
FROM book
WHERE MATCH (Title) AGAINST (@searchTerm IN NATURAL LANGUAGE MODE)
ORDER BY MATCH (Title) AGAINST (@searchTerm IN NATURAL LANGUA...
SET @searchTerm= 'Date Database Programming';
SELECT MATCH (Title, Author) AGAINST (@searchTerm IN NATURAL LANGUAGE MODE) Score,
ISBN, Author, Title
FROM book
WHERE MATCH (Title, Author) AGAINST (@searchTerm IN NATURAL LANGUAGE MODE)
ORDER BY MATCH (Title, Author) AGAINST (...
You can only extract portions of lines, not reorder or repeat fields.
$ cut -d, -f2,1 <<<'John,Smith,USA' ## Just like -f1,2
John,Smith
$ cut -d, -f2,2 <<<'John,Smith,USA' ## Just like -f2
Smith
In order to create an use a custome tag,we need to follow couple of steps:
Create a tag file,defining the attributes used by it and any variables which will be used by the tag
a. The attributes need to have a name,their type and and required field with a boolean value
b. The variables will be...
Sometimes it is useful to print a current binding directly from markup. A neat trick which allows that is to use an additional DOM element with a non-existing binding (KO < 3.0), custom binding or a binding that is not relevant such as uniqueName.
Consider this example:
<tbody data-bind=&quo...
Once it's done, you can find your archive in the Xcode organizer. This is where all your previous versions and archive builds are saved and organized in case you do not delete them. You will immediately notice a large blue button saying "Upload to App Store..." however in 9/10 cases this w...
The break instruction:
Using break we can leave a loop even if the condition for its end is not fulfilled. It can be used to end an infinite loop, or to force it to end before its natural end
The syntax is
break;
Example:
we often use break in switch cases,ie once a case i switch is satisfied...
A Reference in C++ is just an Alias or another name of a variable. Just like most of us can be referred using our passport name and nick name.
References doesn't exist literally and they don't occupy any memory. If we print the address of reference variable it will print the same address as that of...
' How To Seek Past VBA's 2GB File Limit
' Source: https://support.microsoft.com/en-us/kb/189981 (Archived)
' This must be in a Class Module
Option Explicit
Public Enum W32F_Errors
W32F_UNKNOWN_ERROR = 45600
W32F_FILE_ALREADY_OPEN
W32F_PROBLEM_OPENING_FILE
W32F_FILE_ALREAD...
Let's say we have the following 4 by 4 grid:
Let's assume that this is a maze. There are no walls/obstacles, though. We only have a starting point (the green square), and an ending point (the red square).
Let's also assume that in order to get from green to red, we cannot move diagonally.
So, s...
JMeter also enables you to manually configure your workspace. It’s more complex, but you can make the scripts fit your exact needs.
Configure your browser proxy
Configure your browser, as described in chapter 1.
Configure JMeter
The “WorkBench” branch can be used as a temporary workspace for...
So far we’ve covered the basic ways to record test scenarios. But one of the fastest and easiest ways to record your performance scripts, which is also free, is to use the BlazeMeter Recorder Chrome extension. These recordings can be run in JMeter or in BlazeMeter.
The reason the extension is so us...
import spock.lang.*
class HelloWorldSpec extends Specification {
@Shared message = 'Hello world!'
def "The world can say hello using when and then"() {
when:
def newMessage = message
then:
newMessage == 'Hello world!'
}
...
This example will show you how to use Dependency Inject to use other services registered in the Drupal environment.
Imagine you have an SVG image file that changes colors depending on some random CSS/Javascript thing in your project. To be able to target the SVG with CSS you have to actually have t...
The pygame.mixer module helps control the music used in pygame programs. As of now, there are 15 different functions for the mixer module.
Initializing
Similar to how you have to initialize pygame with pygame.init(), you must initialize pygame.mixer as well.
By using the first option, we initiali...
var passport = require('passport');
var LocalStrategy = require('passport-local').Strategy;
passport.serializeUser(function(user, done) { //In serialize user you decide what to store in the session. Here I'm storing the user id only.
done(null, user.id);
});
passport.deserializeUser(funct...