Replace Function in Javascript
JavaScript lacks a Replace() function. This functionality can only be achieved in Javascript using RegularExpression, though not all browsers support it. The code below is for replace and can work
JavaScript lacks a Replace() function. This functionality can only be achieved in Javascript using RegularExpression, though not all browsers support it. The code below is for replace and can work
Although most people have JavaScript enabled on their browsers, there are still a lot of people who don’t. This is why you should always make your pages as backward compatible
This code will retrieve the employee details with a salary-wise ranking from each dept.EMP table with different departments and different salaries. If two employees in the same department have the
Sometimes you may want to check whether a particular file is available while working with the file system in T-SQL. You can check this by using “xp_fileexist “, Sql Server
he Web application with which I am currently involved, relies heavily on external data abstractions to control both functionality, as well as the UI appearance. These external data repositories are
COM doesn’t have a built in security mechanism, but relies on Windows authentication services (Security Service Providers). When you access a resource or invoke a method in a remote DCOM
CreateInstance was necessary in COM to provide a COM object activation mechanism that could be hooked by the MTS runtime before the activation request reached the COM runtime. So that
There is quite a lot of misunderstanding among COM newbies about what really happens when a COM interface is passed as a method parameter. As in most of the cases,
What I describe for COM+, applies to MTS with some slight differences as well. Registering COM objects remotely has been quite a pain before MTS showed up (remember the VBR
Among the different COM details that VB hides to the programmers, one of the most problematic one is that it doesn’t let you take control on interface GUIDs. Binary compatibility
If you don’t take specific actions, you get an Access Denied Error when you try to raise an event from an MTS component into a client. This happens because the
Suppose you have a table: select * from tblTestName Amount— ——A 10B 20c 40D 50E 30 The following single SELECT query can be used to calculate cumulative totals: –//////////////////////////////////////SELECT t1.Name,
There may be certain situations where you have to sort character-based columns in a particular order.For example, Let us consider a table: –///////////////////////////////////SID Subject Marks— —— —–1 Physics 801 Chemistry
The following code is bad: char* charpointer= new char[SOMECONSTANT];delete charpointer; // should have been delete [] charpointer; new and new[] are allowed to use different memory pools. The default new/delete
The most common example where ‘open’ date is used is in the expiration_date for an entry. It could be set for a particular date, or be NULL if the expiration
A temporary object is destroyed at the end of the full expression in which it was created. Consider the following example: #include #include // for strlen()string s1, s2;int len=(s1+s2).c_str(); //
After all component settings, create an ImageIcon object with your desired image. Using this object, create a JLabel. Add the Jalbel to the lowest LayeredPane of the JFrame. Finally, add
A default ResultSet object is not updateable and has a cursor that moves forward only. Thus, it is possible to iterate through it only once and only from the first
Normally, you should not check for null after creating an object. MyObject o = new MyObject(); This check is not required in Java because ‘new’ is not allowed to return
A rule of thumb in class design says that if a class has at least one virtual function, it should have a virtual destructor, too. This is because the presence
I have a much simpler form for the IsAlphaNum function: Public Function IsAlphaNum(ByVal sString _As String) As BooleanIf Not sString Like “*[!0-9A-Za-z]*” _Then IsAlphaNum = TrueEnd Function You can modify
Although VB has an IsNumeric function, it has no IsAlpha function. Use this routine whenever you want to determine whether a character or string of characters is alphabetic (A-Z or
This can be done by using ResultSetMetaData. For example, to get the number of columns you can use: /* get the meta-information about the result set */ResultSetMetaData metaData = rs.getMetaData();
This routine performs the standard column sorting on a ListView control found in many commercial applications, such as Windows Explorer and Outlook. Using this routine, the ListView sorts itself automatically
Traditional testing for alphabetic characters Related Posts T-SQL Performance Tip: Stored Procedure NamesStarlink brings challenges to Marubo tribeChinese universities overhaul majors for hi-tech fieldsTip: T-SQL Performance–NOT IN vs NOT EXISTSSpider
Blank finals are fields that are declared as final, but are not given an initialization value. Java allows the creation of blank finals, but, in all cases, the blank final
Sometimes you need to know the number of bits set in a word. I often see code to count the number set bits written as a loop, processing one bit
When you need to add the same member function to several classes, you can use a template class, derived from its template argument. template class T : public P {public:
These days, many enterprises exchange data using a request/response approach. This data typically contains the date and time information regarding when a request was generated/received or a response generated/received. If
In DOM compliant browsers (IE5 & NS6), you can handle attributes of all similar elements with the getElementByTagName() function. For example, to change the background color of all the cells