2,322 Reusable Code Snippet Topics
Remove Filter ![]() | |
This demonstrates how to get a list of your computer's logical drive letters under the MS-Windows operating system. | |
Can someone help me with this problem here about Binary Trees. I was given this code... and I am required to write a function void count_nodes(?) to determine the total number of nodes in a Binary Tree. | |
I am in the process of learning PHP with JS and Ajax and have the foll. problems. I have created a class to generate master data entry screens. (1) Javascript code that works when I run master.class.php independently does not work when I run users.php. I came across this problem … | |
This is one simple way to emulate a singleton class on behalf of a normal class. (A singleton class is a class with at most one instance.) The implementation does not emulate a class 100% (for example it lacks the special attributes lile __dict__ or __bases__), but it should be … | |
Sample code for taking input from Shell demonstrating string and int input For simple programs or testing purpose its not always required to take input thru GUI. | |
A function that takes a string and returns the number of words in the string. An example of using pointers in Pascal. | |
Type BITMAPFILEHEADER bfType As Integer bfsize As Long bfReserved1 As Integer bfReserved2 As Integer bfoffbits As Long End Type Type BMPInfoHeader biSize As Long biwidth As Long biheight As Long biPlanes As Integer bibitcount As Integer biCompression As Long bisizeimage As Long biXPelsPerMeter As Long biYPelsPerMeter As Long biClrUsed As … | |
need to replace all occurences if substring by new string. below code replace first occurence but not other substrings present in input string. | |
Python can use its COM support and the OCX of the WindowsMediaPlayer to play mp3 music files. Make sure that your Python installation has the win32com folder. Check [url]http://starship.python.net/crew/mhammond/win32/Downloads.html[/url] for the latest win32com support. [COLOR="Red"]This code relies on file WMPlayer.OCX which MS has removed on newer versions of Windows. See … | |
A simple way to check if the current C# program is the only instance of itself running. | |
Hi, I tried to direct the output from a thread into a log file using fstream, but it dosent seem to work. If I use ostream then it works fine. Can you please let me know why fstream is not working. Thanks in advance | |
i run vb6.0 code in xp for getting hdd physical id and it run ok. but when i run same programme in vista it does not display any hdd physical id. please solve the problem | |
Easily allows temporary message to be displayed on any label for a programmable length of time. This is a very simple way to display a temporary message on an existing label (or textbox)without doing a lot of coding. | |
I'm new to perl and I'm writing a script to parse multiple Gaussian03 output files and extract certain pieces of data from them. Ideally the script needs to print out the name of each file, look for (the last) SCF Energy, the Zero-point Energy and check if the job has … | |
This small program shows that how we can arrange strings by alphabet in a vector.By FlamingClaw | |
This shows how to create, load and access a ListBox. BCX was used to create the original code which was then modified to work with the Dev C++ (really GCC/G++) compiler, compile as a Windows Application. | |
Here's a function that manually converts an integer to any base between 2 and 36, the parameter list is: [CODE]void toBase( int value, // Integer value to convert char *target, // Pointer to a large enough buffer int base, // Base (from 2 to 36) int fixedDigitCount // The minimum … | |
Just another way to check if a word is palindromic or not. In my country (Greece) if a word is palindromic we say it is "καρκινική" that's why i named the fuction in the code kark(). -What it does? If we would say that word has n letters,then this compares … | |
I am very poor in calculating complexities. Please some one let me know what is the complexity of the below program. I actually want to write a program for finding the nth last element with 0(n) complexity. but unable write, please give me some idea. the below code works perfectly … | |
This code is just handling the SIGCHLD signal, but as you can see, the parent process should ignore this SIGCHLD signal according to the signal function. But in fact, the parent process will omit the signal function, and handling the child process using "wait". I wonder why the parent do … | |
The xor operator allows you to switch the values of two integer variables without the need for a third, temporary variable. | |
{-='Reads ten integers and prints the first and the last on one line using Dev-C LaNGuaGe'=-} | |
Let you choose between all printers available on your pc or network. Download zip and enjoy. Royal free. | |
Printing a convenient [url=http://en.wikipedia.org/wiki/ANSI_escape_sequence]ansi escape sequence[/url] clears the terminal (if you're running python from a terminal). Similar techniques could be used to print in colors. | |
Hello friends i made a small program like a scanner it will scan an image file to a Rich Text Box. My friend helped me in providing the code to access the pixels of an image.Hope you will like the code. Try it .... This need : Reference files : … | |
This is code for Encrypt and Decrypt. this a simple logic of encryption. Please leave comment or feedback if this code helps you. Thanks. Jery. :) the encrypt function place in a module. This Code needed : 1 Module 1 combo box (For input before encryption) text1 in this program … | |
I wont describe whats here, just figure it out yerself, enjoy =) | |
This is a nice and easy table editer. Use it to add and delete cells, rows, and a caption | |
Note that the angle is in 1/10 of degrees. Any attempt to manipulate font.size or font.color will reset the angle to zero degrees. | |
![]() | This code snippet allows you to know whether a word/sentence you have entered is a 'Magic Word' or not. A 'Magic Word' is a word which has at any position two consecutive letters. This can be achieved by taking the ASCII values of the characters. For example, if I enter … |
A small Windows Application to show you how to play a wave (.wav) sound file. I am using the C# IDE from SharpDevelop and the runtime dotnetfx 1.1 from Microsoft, both free downloads. This forms a small and fast student system to write and debug C# programs. From there you … | |
This program asks for integers from the user and stores them into a multidimensional array that adjusts its size. | |
Use this to encrypt your passwords, for login fields and password protection. | |
This code is to split a Microsoft Access database and re-connect it on launch so that you can use Access on a multi user network...After Splitting the database manually, place the following code in the form that launches when the database is launched... | |
![]() | A simple function to return the number of occurances of a letter in a text. An easier way to implement this would be by using a dictionary :) P.S sorry if there already is a code snipped like that somewhere. |
This snippet shows a fast and efficient way to cut strings in substrings with a fixed length (note that the last substring may be smaller). | |
I created this code because i was bored and wanted to try something with some code and i ended up creating this little code snip. [B] Code from: [URL]http://www.iportalx.net[/URL][/B] | |
This is a small function that will block the specific IP from viewing the certain page, and it will redirect the user to the main page or noaccess page. | |
This is a scheduling algo based on round robin scheduling. | |
A small function which reverses a c-string by just swapping the elements :) ... Usage:: [CODE=C++] char[] str = "hello"; reverse(str); // str now contains "olleh" [/CODE] | |
Displays which partitions are on which physical hard drives and shows partition starting offset and length. Developed and tested under XP using a Borland C++ compiler. Code is not provided for the private includes, but changes to make to code work are trival. References to werrtxt() and format() can be … | |
This is a program I wrote for my x86 assembly class which computes the sum of n numbers. It uses Irvine32.inc which came with the textbook. | |
Python has some powerful functions, like the math expression evaluator eval(). You can embed this function and others in your Development C++ code. All you need to do, is to download and install the free Python Development Pak and feed the Python code in the form of a string to … | |
hi enjoy it and give feedback | |
Hello... This is my naval battle game so far.. Just search i t if you're unfamiliar with the game it is only player vs computer.. can you adjust/fix my code so that: -the player is able to place his ships by means of dragging the JLabel ships at the left … | |
![]() | this is my version of the popular snake game. The snake is controlled by the mouse so be careful when you start :) it grows infinitely long...you should download the apple.jpg file for the game, or graw one of your own just name it apple.jpg and place it in the … |
Code written and tested using the Borland C++ compiler. Code uses access() to determine if an input string exists either as a directory name or as a file name. If access() fails, the string is neither a file or directory and the function terminates. If it does exist, the name … | |
The End.