1,916 Reusable Code Snippet Topics
Remove Filter ![]() | |
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. Software Development c++ | |
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 … Software Development python | |
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. Software Development 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 … Software Development image visual-basic | |
need to replace all occurences if substring by new string. below code replace first occurence but not other substrings present in input string. Software Development c | |
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 … Software Development python | |
A simple way to check if the current C# program is the only instance of itself running. Software Development | |
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 Software Development c++ | |
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 Software Development visual-basic | |
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. Software Development visual-basic | |
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 … Software Development perl | |
This small program shows that how we can arrange strings by alphabet in a vector.By FlamingClaw Software Development pascal | |
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. Software Development c++ | |
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 … Software Development c++ | |
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 … Software Development c | |
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 … Software Development c | |
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 … Software Development c | |
The xor operator allows you to switch the values of two integer variables without the need for a third, temporary variable. Software Development | |
{-='Reads ten integers and prints the first and the last on one line using Dev-C LaNGuaGe'=-} Software Development c | |
Let you choose between all printers available on your pc or network. Download zip and enjoy. Royal free. Software Development printer visual-basic | |
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. Software Development python | |
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 : … Software Development image visual-basic | |
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 … Software Development encryption visual-basic | |
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. Software Development pascal | |
![]() | 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 … Software Development java |
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. Software Development c++ motherboards-cpu-ram | |
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... Software Development microsoft-access visual-basic | |
![]() | 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. Software Development python |
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). Software Development python | |
This is a scheduling algo based on round robin scheduling. Software Development c | |
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. Software Development assembly | |
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 … Software Development java | |
![]() | 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 … Software Development c file-stream | |
HEy:) Buddies in early morning i want to calculate that exchange during download & you very well known that it is shown in byte so just i am g with c++ and play a game for writing this. thanks enjoy it. It's very easy and handy with simple logic. Software Development c++ | |
The code below captures the screen and saves it. Depending on your need, you can modify it to do just what you want [code] import java.awt.AWTException; import java.awt.Robot; import java.awt.Rectangle; import java.awt.Toolkit; import java.awt.image.BufferedImage; import java.io.*; import javax.imageio.ImageIO; class ScreenCapture { public static void main(String args[]) throws AWTException, IOException { … | |
/* difference between %i ad %d %i reads the value and it recognizes the value as what base it is when we read the value as 023 (base 8) it is 19 (base 10) and 0xa(base 16) it is 10 in (base 10). */ OUTPUT: /* Enter a number:023 Out … Software Development c | |
The source of my COPYRIGHTED tictactoe java game. It shows how to use multiple classes, methods, etc. Software Development java | |
Here's possibly the single most useful function that I use. It simply takes an ADO record set and dumps the column names and row values into an Excel worksheet. To use it make sure you have Excel marked in your project references. Software Development visual-basic | |
This is somewhat a simple project I wrote by getting help from google groups I always recommend. assemble this code using this command: [QUOTE]nasm -o 1.com 1.asm[/QUOTE] Software Development assembly | |
This code draws different shapes to the screen,(in this version, only a square or a cross. It will be updated soon!!). This code was written by a beginner, for the beginners!! Software Development c++ | |
[I]The FileSystemWatcher class is phenomenally powerful—and staggeringly simple.[/I] Start up a new Windows Forms application. Then drop FolderBrowserDialog, FileSystemWatcher, label, listbox, and button controls onto the form. [B]Setting up Properties:[/B] Set up the name properties of the controls; the button is called chooseButton, the label is folderLabel, the list box … Software Development |
The End.