The following function can be used to get some basic information about the current browser and return it in JSON format.
function getBrowserInfo() {
var
json = "[{",
/* The array containing the browser info */
info = [
navigator.userA...
MySQL offers a number of different numeric types. These can be broken down into
GroupTypesInteger TypesINTEGER, INT, SMALLINT, TINYINT, MEDIUMINT, BIGINTFixed Point TypesDECIMAL, NUMERICFloating Point TypesFLOAT, DOUBLEBit Value TypeBIT
WebSocket provides a duplex/bidirectional communication protocol over a single TCP connection.
the client opens a connection to a server that is listening for a WebSocket request
a client connects to a server using a URI.
A server may listen to requests from multiple clients.
Server Endpoint...
Detailed instructions on excel-formula(s).
There are many formulas that you can choose from. They are divided up into 7 different categories and are on the FORMULAS tab in Excel. The categories are:
Financial
Logical
Text
Date & Time
Lookup & Reference
Math & trig
More Function...
You should not save props into state. It is considered an anti-pattern. For example:
export default class MyComponent extends React.Component {
constructor() {
super();
this.state = {
url: ''
}
this.onChange = this.onChange.bind(this);
...
Because Regular Expressions can do a lot, it is tempting to use them for the simplest operations. But using a regex engine has a cost in memory and processor usage: you need to compile the expression, store the automaton in memory, initialize it and then feed it with the string to run it.
And there...
If you want to extract something from a webpage (or any representation/programming language), a regex is the wrong tool for the task. You should instead use your language's libraries to achieve the task.
If you want to read HTML, or XML, or JSON, just use the library that parses it properly and ser...
UserType belongs to many Users <-> Users have one UserType
One way navigation property with required
public class UserType
{
public int UserTypeId {get; set;}
}
public class User
{
public int UserId {get; set;}
public int UserTypeId {get; set;}
public virtual UserType...
There are two common ways to encode a POST request body: URL encoding (application/x-www-form-urlencoded) and form data (multipart/form-data). Much of the code is similar, but the way you construct the body data is different.
Sending a request using URL encoding
Be it you have a server for your s...
In GSP the <%= %> syntax is rarely used due to the support for GSP expressions.
A GSP expression is similar to a JSP EL expression or a Groovy GString and takes the form ${expr}:
<html>
<body>
Hello ${params.name}
</body>
</html>
However, unlike JSP EL ...
A pointer is declared much like any other variable, except an asterisk (*) is placed between the type and the name of the variable to denote it is a pointer.
int *pointer; /* inside a function, pointer is uninitialized and doesn't point to any valid object yet */
To declare two pointer variables...
The POSIX and C standards explicitly state that using fflush on an input stream is undefined behavior. The fflush is defined only for output streams.
#include <stdio.h>
int main()
{
int i;
char input[4096];
scanf("%i", &i);
fflush(stdin); // <-- unde...
Using alarm, user can schedule SIGALARM signal to be raised after specified interval. In case user did not blocked, ignored or specified explicit signal handler for this signal, the default action for this signal will be performed on arrival. Per specification default action for SIGALARM is to termi...
If a class, enum, inline function, template, or member of a template has external linkage and is defined in multiple translation units, all definitions must be identical or the behavior is undefined according to the One Definition Rule (ODR).
foo.h:
class Foo {
public:
double x;
private...
The complete sample code for this application (Android + Node server) is available in the PayPal Developer Github repository.
The first stage of creating the Android portion of our application is to set up a basic layout and handle responses that come back from the server that we'll set up in Node....
Review Partial Application before proceeding.
In Haskell, a function that can take other functions as arguments or return functions is called a higher-order function.
The following are all higher-order functions:
map :: (a -> b) -> [a] -> [b]
filter :: (a -> Bool) -> [a] ...
Lets say we have a class Classy that has property Propertua
public class Classy
{
public string Propertua {get; set;}
}
to set Propertua using reflection:
var typeOfClassy = typeof (Classy);
var classy = new Classy();
var prop = typeOfClassy.GetProperty("Propertua");
prop.Se...
Every tag has an overview topic. This topic has a special section named "Versions". In that section, different versions can be defined in a table that has that should
have at least 2 columns:
the first one should be the name of the version
the last one should be the release ...
For some tags it makes sense to have multiple version tables. There might be different subsets of a programming language or framework available, say for different device types as in this example.
The different tables should be prefaced with a heading.
This markup:
## desktop development kit ##
...