Tutorial by Examples: sin

The System.Web.SessionState.HttpSessionState object provides a way to persist values between HTTP requests. In the example below, a user's preference for warnings is being saved in the session. Later on, while serving another request to the user, the application can read this preference from session...
If you find that you have multiple servers that need to share session state, storing it in the ASP.NET process memory will not work. For example you may deploy into a web-farm environment with a load balancer that distributes requests in a round-robin fashion. In this environment a single user's req...
If you don't want to use SQL server you can use Amazon's hosted Dynamo DB nosql database as a session store. You'll need the AWS SDK. To install this from the Visual Studio nuget package manager console use the following command Install-Package AWSSDK You can then configure your sessionState p...
SELECT department, COUNT(*) AS "Man_Power" FROM employees GROUP BY department;
SELECT department, COUNT(*) AS "Man_Power" FROM employees GROUP BY department HAVING COUNT(*) >= 10; Using GROUP BY ... HAVING to filter aggregate records is analogous to using SELECT ... WHERE to filter individual records. You could also say HAVING Man_Power >= 10 since HAVIN...
For enabling Proguard configurations for your application you need to enable it in your module-level gradle file. You need to set the value of minifyEnabled to true. buildTypes { release { minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android.t...
There are times when an include file has to generate different output from the preprocessor depending on whether the compiler is a C compiler or a C++ compiler due to language differences. For example a function or other external is defined in a C source file but is used in a C++ source file. Since...
When allocating multidimensional arrays with malloc, calloc, and realloc, a common pattern is to allocate the inner arrays with multiple calls (even if the call only appears once, it may be in a loop): /* Could also be `int **` with malloc used to allocate outer array. */ int *array[4]; int i; ...
<plugin> <groupId>org.apache.tomcat.maven</groupId> <artifactId>tomcat7-maven-plugin</artifactId> <version>2.1</version> <executions> <execution> <...
com.google.gson library needs to be added to use this code. Here is the example string: String companyDetails = {"companyName":"abcd","address":"abcdefg"} JSON strings can be parsed using below syntax in Java: JsonParser parser = new JsonParser(); Json...
To create a parallel collection from a sequential collection, call the par method. To create a sequential collection from a parallel collection, call the seq method. This example shows how you turn a regular Vector into a ParVector, and then back again: scala> val vect = (1 to 5).toVector vect:...
PyPar is a library that uses the message passing interface (MPI) to provide parallelism in Python. A simple example in PyPar (as seen at https://github.com/daleroberts/pypar) looks like this: import pypar as pp ncpus = pp.size() rank = pp.rank() node = pp.get_processor_name() print 'I am r...
There are several scopes that are available only in a web-aware application context: request - new bean instance is created per HTTP request session - new bean instance is created per HTTP session application - new bean instance is created per ServletContext globalSession - new bean instance i...
You can also use line-height to center vertically a single line of text inside a container : CSS div { height: 200px; line-height: 200px; } That's quite ugly, but can be useful inside an <input /> element. The line-height property works only when the text to be centered spans ...
Note the use of {{.}} to output the item within the template. package main import ( "fmt" "os" "text/template" ) func main() { const ( letter = `Dear {{.}}, How are you?` ) tmpl, err := template.New("letter").Pa...
A condition variable is a primitive used in conjunction with a mutex to orchestrate communication between threads. While it is neither the exclusive or most efficient way to accomplish this, it can be among the simplest to those familiar with the pattern. One waits on a std::condition_variable with...
int main (void) { const int foo_readonly = 10; int *foo_ptr; foo_ptr = (int *)&foo_readonly; /* (1) This casts away the const qualifier */ *foo_ptr = 20; /* This is undefined behavior */ return 0; } Quoting ISO/IEC 9899:201x, section 6.7.3 §2: If an attempt i...
installing npm install web-component-tester --save-dev setting up wct.conf.js module.exports = { verbose: true, plugins: { local: { browsers: ['chrome'] } } }; running node node_modules/web-component-tester/bin/wct test/index.html <html...
The format of the struct statement is this: struct [structure tag] { member definition; member definition; ... member definition; } [one or more structure variables]; Example: declare the ThreeFloats structure: typedef struct { float x, y, z; } ThreeFloats; @inter...
The pause() method is one of the easiest solution Protractor provides you to debug the code, in order to use it you have to add it in your code where you want to pause the execution.Once the execution is in paused state: You can use C (type C) to move forward. Be careful while using it, you hav...

Page 61 of 161