2,322 Reusable Code Snippet Topics
Remove Filter ![]() | |
Many people says 'Don't use the GoTo statement,because your code will be unreadable....'.I say,can be use | |
By calling this function from the header row of your table, you can make your table collapsible. | |
Sometimes, you need to see what properties does that object have and what values are assigned to them. This snippet does that. | |
in the previous snippet i compared two tables having columns as name and value pairs. this new one compares two tables of any number of columns(as long as it is the same number on both tables). | |
Hello friends here i present a simple address diary program that store name, phone number,sunsigh,best moment date of birth and place,and also hobby of a person.... When you run this u must fill password and password is "hello"... I think you will enjoy it.............. | |
Hello friends, I am new participant in daniweb Here is the fantastic coding of SHEEL SORT.. | |
compares to tables and highligthts the changes | |
converts the html tables which are created by string concatenation to dom table objects | |
very simple very powerful tab menu, it can be used as a switch menu or to hide-show associated panels. | |
I saw that in some xml files, child numbers are not the same for the elements which will correspond to our table rows. So i created a more smart version which is error tolerant. | |
| |
I have searched for a tab menu script for a long time but none of them was flexible enough,then i created one for me. The algorithm is nice so the script is not too long although being flexible. your tab menu is in an html table row as follows : | |
Here are 2 pieces of code. The first makes a hidden partition accessible by creating a path to it and assigning a drive letter. The second removes the path definition, effectively rehiding the partition. It is advised that caution be taken in the use of this code. The core to … | |
// Displays a file in either upper- or // lowercase depending upon a user request. #include <fstream> #include <iostream> #include <string> #include <ctype.h> using namespace std; // Display(): display text stream using ToFunc // modification void Display(ifstream &fin, int (*ToFunc)(int c)) { // extract and display characters one-at-a-time char CurrentChar; … | |
Dear all This code is simulate some of math library funcs. Good Luck! | |
C# delegates make it really easy to implement the visitor pattern. Instead of making an abstract class and Visit methods that accept a single argument of that class's type, let your Visit methods accept multiple arguments. So instead of a visitor class with N abstract methods, your Visit methods take … | |
You could implement recursive algorithms in ways that avoid risking stack overflow, i.e. by manually implementing a stack of variables or a stack of states. It is better to implement combinators that take pieces of recursive definitions and do this work for you. It is particularly easy to do in … | |
This is something very simple but very hard to find in google, it took me 30 minutes to solve it out. You have a value of type string and you want to get index number of that value in your enumeration, and now you can use that index number for … | |
This is a sample code snippet of a quicksort that uses templating and function pointers to allow the user to sort an array of anything from numbers to strings to structures. The idea is, that the coder writes a small function thats return type is bool, It should return true … | |
Hi friens Linear search is a way of finding an element in the array that we made it . Binary search is quicker than Linear search . in this code if key was found , it is removed from array and then sorted array is shown again. Good Luck! | |
Dear all This code shows, look for an integer number in the array of this type that we used from Binary search. It was wrote by Borland 5.02 . Good Luck! | |
Here is a binary search program quite simplified | |
This snippet can be used to convert from bases between 2 & 16 to base between 2 & 16. This is an extension on converting decimal to any base snippet found here: [url]http://www.daniweb.com/code/snippet1067.html[/url] (By no means is this the best method of doing this, but provides rather a nice way) | |
It includes Binay tree construction,Inorder,preorder,postorder traversals | |
Pascal's triangle is a geometric arrangement of the binomial coefficients in a triangle. The rows of Pascal's triangle are conventionally enumerated starting with row zero, and the numbers in odd rows are usually staggered relative to the numbers in even rows. A simple construction of the triangle proceeds in the … | |
This is a simple implementation of the Chaos Game to produce a Seirpinski Triangle. | |
Dear entourage Here is a solution that read two matrix of complex numbers ( including imaginary an real ) and add and multiply these together. I wrote it by Borland 5.02 . Do joy !!! | |
Dear all This code first read a string then shows number of repetition of each character . I wrote it by Borland 5.02 . Good Luck ! | |
A brute force method. Finds the FIRST and SHORTEST periodicity in the input list. | |
This program displays all possible permutations of the string entered. say if u enter "abc" as input string the possible permutations would be displayed as ......................... abc acb bca bac cab cba .......................... | |
This class allows you to use the Google AJAX Translation API to translate arbitrary text to the many languages supported by the Google API. Source versioning added to: [url]http://code.google.com/p/php-language-api/[/url] | |
This snippet shows how you can manually split up a sentence using multiple delimiters. In this example, I split up this sentence: [ICODE]"Hello, my name is william!"[/ICODE] into the following: [ICODE]"Hello"[/ICODE] [ICODE]"my"[/ICODE] [ICODE]"name"[/ICODE] [ICODE]"is"[/ICODE] [ICODE]"william"[/ICODE] As you can see, the delimiters are not included ([ICODE]" ,!"[/ICODE]) | |
This snippet defines a cachedProperty decorator. A cached property differs from a property in that it's value is only computed the first time that the property is accessed and then stored in the object's dict for later use. If the object's attribute is explicitely deleted, it will be computed again … | |
This snippet defines a function [icode]patfilter(pattern, rule, sequence)[/icode] which implements filtering a sequence of strings according to various criteria. The output is either a subsequence of strings, or a sequence of match objects. | |
Hi my friends In this part you can see a link list that sort when you add your number. First number set as the first node. next number that you will enter , is compare with first node. if it was less than first , it set as first . … | |
Dear all This program takes from you a alphabetic character and shows all of characters before it .(ascending or descending) I wrote it by Borland 5.02 . DO JOY!!!! | |
Dear my friends This code take base of time details as second , minute and hour . it also take base of date details as day , month and year . Then it take length of time and date details . Finaly these information is process by program and it … | |
This code converts decimal number to hexadecimal number I wrote it by Borland 5.02 . Good Luck | |
Hi Hi Hi this solution is inverse of other solution that changed Decimal number to hexadecimal . It changes hexadecimal number to Decimal ! There is the other way to change characters to numbers. Good Luck! | |
Hi ladies and gentlemen This program is a sample of data structure for information of students . this data structure is Linked List that include public & private filds. Its private has the other class which i named it node. node builds physical structure of linklist class. node class consist … | |
Dear programmer This program get 2 (simply) numbers in 10 radix , then changes them to 16 radix and add together and finally shows result. I wrote it by Borland 5.2 C++ . Good Luck! | |
In for the latest addition to my code snippets, here's one you'll trully appreciate. This validation tools is packed with the W3Cs (x)HTML Markup validator, CSS validator, MobileOK tester and Semantics Extractor. hope you'll enjoy this newest addition of snippets'... | |
Accepts number as input, writes the prime numbers up to that number to the screen. | |
This code snippet will produce strings of numbers (1 thru 49) with no repeated numbers in the same string and no duplicated string of numbers in the list of strings. To change the range of numbers the script generates change 49 in the code to your requirements. Please feel free … |
The End.