When you code an external javascript you identify that it is a javascript using either or both of the language and type parameters on the script tag. The file suffix of .js doesn’t get referenced in determining that the called module is javascript. This means thatr we don’t need to use the .js suffix on […]
Entries Tagged as 'Programming'
Hiding Javascript Source
December 30th, 2006 · No Comments · Java Script
Tags:
Recursive execusion of commands in Linux command prompt
December 6th, 2006 · No Comments · Linux, Shell
When we want to execute any command recursively for a directory, we can use find command for that.
find . -name ‘blah*’ -exec rm -rf {} ;
But some times, it gives the error as Argument list too long. In that kind of situations, we better we go for this.
find . -name ‘blah*’ -print0 | xargs -0 […]
Tags:
Fast Bit Counting Routines
October 17th, 2006 · No Comments · Algorithms, C/C++, Placements
A common problem asked in job interviews is to count the number of bits that are on in an unsigned integer. Here are seven solutions to this problem. Source code in C is available.
Iterated Count
int bitcount (unsigned int n)
{
int count=0;
while (n)
{
count += n & […]
Tags:
ActiveX Data Objects
October 17th, 2006 · No Comments · Visual Basic
The ADO Object Model
ADO is a simple way of making a connection with a database, and issuing commands (such as stored procedures in SQL Server), or retrieving data into so-called RecordSets.
ADO resides on top of OLE-DB (from within Visual Basic, at least). OLE-DB enables you to access datasources of different types, without having to deal […]
Tags:
Python tips
October 6th, 2006 · No Comments · Python
The following statement can be used to evaluate the function get_context_english() ……
eval(’get_context’ + str(context))
Bookmark it!
These icons link to social bookmarking sites where readers can share and discover new web pages.
Tags:
Virtual Functions (C++ Concepts)
October 6th, 2006 · No Comments · C/C++, Placements
Virtual Functions
Design Patterns
Important C/C++ Basic Concepts
Program startup and termination are facilitated by using two functions: main and exit. Other startup and termination code may be executed.
The arguments in the prototype
int main( int argc[ , char *argv[ ] [, char *envp[ ] ] ] );
or
int wmain( int argc[ , wchar_t *argv[ ] [, wchar_t […]
Tags:
Sum two numbers using bits
October 6th, 2006 · No Comments · Algorithms, C/C++
int main(int argc,char *argv[]){
int a=atoi(argv[1]),b=atoi(argv[2]),sum,carry;
sum = a^b;
carry = a&b;
while(carry){
carry = carry
Tags:
Avoid multiple inclusion of header file
October 6th, 2006 · No Comments · C/C++, Placements
Generally, a header (.h) file should have (A header file need not have a .h extension, its just a convention):
1. Macro definitions (preprocessor #defines).
2. Structure, union, and enumeration declarations.
3. Any typedef declarations.
4. External function declarations.
5. Global variable declarations.
Put declarations / definitions in header files if they will be shared between several other files. If some […]
Tags:
Interview questions
October 6th, 2006 · No Comments · C/C++, Placements
Linked Lists
Given only a pointer to a node to be deleted in a singly linked list, how do you delete it?
Write a C program to implement a Generic Linked List.
How would you detect a loop in a linked list? Write a C program to detect a loop in a linked list.
How do you find the […]
Tags:
Bit wise operators
October 6th, 2006 · No Comments · C/C++, Placements
Bit wise operators and % operator cannot be applied to float
fmod() is to find modulus for float as % is for int
but it needs math.h;
This can be used to detect whether a given number is an integer or a float value;
fmod(Var,1.0)==0 ? printf(”Yes it is integer”) : printf(”Not an integer”);
Bit fields
Bit fields can be used […]
Tags:















