Creating and Using Thread-Scoped Variables
Sometimes you need variables scoped by thread so that each thread has an independent copy. There’s an easy way to create and manage such variables.The java.lang.ThreadLocal class provides a wrapper
Sometimes you need variables scoped by thread so that each thread has an independent copy. There’s an easy way to create and manage such variables.The java.lang.ThreadLocal class provides a wrapper
All AWT component classes have a setCursor() method that allows for dynamically setting the cursor for a particular component and any subcomponents.For example, if you set the cursor for a
If class B uses only pointers or references of class A, you don’t have to include A.h. You can simply forward declare class A as shown below. //File B.hclass A;
Suppose you want to pass a Boolean system property, -DDEBUG=true or -DDEBUG=false, from the command line. Normally, you’d probably use the following in source code to retrieve it: boolean b
The new ANSI C++ standard specifies that variables declared as in for(int i=1; …) have a scope local to the for statement. Unfortunately, older compilers (like Visual C++ 5.0) use
// Quickly zero out a struct. This can be applied// To an array of structs also, since// memset() initializes memory regions#include struct sample {int a;short int b;int c;};struct sample s;//
Use the following code: select *,right(field1,4) as Col1 from [Tablename]order by col1 You can do it by using substring: SELECT *, substring(field1, 3, 5) as col1from [tablename]order by col1
‘*********************************************************************’Text files Reading’You can use Microsoft Text Driver’*********************************************************************Public Function Read_Text_File() As ADODB.Recordset Dim rs As ADODB.Recordset Set rs = New ADODB.Recordset Dim conn As ADODB.Connection Set conn = New ADODB.Connection
This code will do the trick: ABCDEFGHIJKLMNOPQRSTUVWXYZ