2,322 Reusable Code Snippet Topics

Remove Filter
Member Avatar for
Member Avatar for mypicturefaded

I wanted to make something for beginners, to show and easy way of creating and using a class and it's methods. So here is a customer class, and a Console application that takes advantage of the class. It is mainly set, and get methods, with one or two extra methods …

Member Avatar for ddanbe
1
141
Member Avatar for sravan953

The program accepts a sentence, stores each word in it as a separate element in an array, then asks you for a word, and return whether or not the word is present in the sentence you entered.

Member Avatar for sravan953
0
246
Member Avatar for athlon32

Example of how to get a random number in the range of six and return a value based upon it. Please Rate/Comment/Report Bugs

Member Avatar for MosaicFuneral
0
135
Member Avatar for Ramy Mahrous

If you need to execute SQL Statements\Stored Procedures\UDFs which return\don't return results, Here I've developed this class to be used in Data Access Layer.

0
476
Member Avatar for Gabarieko

This is a javascript code to fix any element in any browser. Simply add "fixed" to the classes of the desired element. Examples: [icode] <div class="fixed">FIXED</div> <div class="someClass fixed">FIXED</div> [/icode] Though it's a little rough when scrolling I hope it will do the job. The way it works: - By …

0
347
Member Avatar for sravan953

A code snippet which accepts a word or a sentence from a user, and then sorts it, and displays the sorted list.

0
163
Member Avatar for sravan953

The user enters their first, middle and last names and the program prints their full name.

0
117
Member Avatar for Ramy Mahrous

Here's I wrote some code to say binding not means control and data from database, it may be class holds some data

Member Avatar for Ramy Mahrous
0
2K
Member Avatar for Ramy Mahrous

Here's I wrote some code to create login on SQL Server. 1- Add references (Microsoft.SqlServer.Smo, Microsoft.SqlServer.SqlEnum and Microsoft.SqlServer.ConnectionInfo) to your project. 2- Call method CreateLogin which takes to some arguments (documented)

Member Avatar for Ramy Mahrous
0
436
Member Avatar for Ramy Mahrous

Here's I wrote some code to backup your database 1- Add references (Microsoft.SqlServer.Smo and Microsoft.SqlServer.ConnectionInfo) to your project. 2- Call method BackupDatabase which takes to arguments database name and backup file path with extension .bak (preferable)

0
250
Member Avatar for tux4life

This is a portable implementation for converting a character or an integer to its binary text equivalent. It makes use of the [B]CHAR_BIT[/B] constant (which is defined in the header file [B]climits[/B]) to get the number of bits a byte consists of on the implementation where you compile this code …

Member Avatar for MosaicFuneral
0
244
Member Avatar for ddanbe

The matrix class in .NET is not a full featured matrix class as mathematicians would like to see it, still you can do amazing things with it. Create a new windows form application. Fill in the code and you are ready to experiment. In the code I do something with …

0
898
Member Avatar for Ramesh S

Sometimes you might need to have checkboxes for each row in a GridView control (like Inbox in Gmail). This code snippet helps to select/unselect all checkboxes in the GridView control by clicking the header checkbox. The selectUnselectCheckboxes() javascript function handles this fuctionality. This function is called in the CheckBox in …

0
319
Member Avatar for tux4life

I didn't know what to do and I thought: why not try writing an interpreter, I've never done this before and it seemed quite challenging, so I started writing code.... The code which you can find below is only a simple base upon which you can start implementing your own …

Member Avatar for tux4life
0
839
Member Avatar for sknake

This is a query aggregator that stacks up queries and parameters until you hit the hard limit of 2010 set by the SQL Server/Driver, or you call .RunQuery() Scott Knake [URL="http://www.apexsoftware.com"]Custom Software[/URL] Apex Software

Member Avatar for serkan sendur
0
195
Member Avatar for srvstv.prnc

This is another sorting algorithm called heap sort that I wrote using Java programming language. The heap sort code is quiete complex but i tried my best to write it

1
196
Member Avatar for rhoit
Member Avatar for Intrade

I'm sure this has already been done, but to practice understanding Data Structures better I decided to try making one of my own, given only an idea of what type of functionality I want, a pencil and some paper (as well as .txt file, modified into a .java file =p …

Member Avatar for Intrade
0
129
Member Avatar for serkan sendur
Member Avatar for essential

A simple tool that provides easy navigation in your site using a Combo box. It lets you jump to different location on the Web and also included with text display, which provides short details about the site. If you have comments, suggestions or request &#8212; don't hesitate to post back …

Member Avatar for DealthRune
0
184
Member Avatar for wavsyntax
Member Avatar for killdude69

This is the Dialogs.h part from the WGCL C++ Compiler Library I created. This creates classes for dialogs, it could cut the amount of code for dialogs you need to write in half, while still having the same amount of functionality. This library is licensed under the GNU General Public …

Member Avatar for killdude69
0
215
Member Avatar for MosaicFuneral
Member Avatar for Airshow

[B]INTRODUCTION[/B] The W3C's [URL=http://www.w3.org/TR/Window]Window Object 1.0[/URL] specification (Working Draft dated 07 April 2006 at the time of writing) defines in it's [URL=http://www.w3.org/TR/Window/#location-attributes]Location Interface[/URL] section a set of attributes (or fragments) by which a Location object may be addressed. Despite the draft status of this document, many implementations of javascript have …

0
955
Member Avatar for MosaicFuneral
Member Avatar for MosaicFuneral
Member Avatar for amrith92

My implementation of the [ICODE]strcmp[/ICODE] and [ICODE]strncmp[/ICODE] functions. I don't think that it is very efficient, but have managed to get both the functions' execution times to [ICODE]0.01 s[/ICODE] (At least, this is the value my profiler gives me). Enjoy! :)

Member Avatar for amrith92
0
620
Member Avatar for itsjareds

I answered a question a few days ago on Yahoo! Answers where I helped (did all the work for) the question asker. They were asking for a way to parse text from a <textarea> and search for HTML-like elements that were named in a database (or an array, in my …

Member Avatar for itsjareds
0
151
Member Avatar for tux4life

This snippet allows you to convert a text representation(*) of a [B]binary[/B] number [B]to[/B] a [B]decimal[/B] number :) (*): With 'text representation' I mean for example a string containing "1001" or "10001110011", etc. ...

Member Avatar for tux4life
0
213
Member Avatar for essential

This script simply preload's images inside (x)HTML document. [b]<<<INSTRUCTION>>>[/b] — Simply attached these preloader.js in your document, were you want your images to be preloaded. — You can simply referenced it using [icode]<script type="text/javascript" src="path/preloader.js"></script>[/icode] block. — if you have any suggestions, comments or request, please feel free to post …

0
202
Member Avatar for essential

This script is capable of handling multiple iframes inside your page. Which allow you to specify [b]fixed[/b] [color=red]Width[/color]/[color=red]Height[/color] with your iframes' to ensure layout stability in your page and also it comes with an auto-fit feature. [b]<<<INSTRUCTION>>>[/b] &#8212; [color=green]The[/color] iframeFixer.js [color=green]must be included in your[/color] iframe page [color=green]including all pages …

Member Avatar for essential
0
206
Member Avatar for tux4life

[U]Usage::[/U] [ICODE][B]ir_strcpy[/B]( [I]destination[/I], [I]source[/I], [I]range_begin[/I], [I]range_end[/I]);[/ICODE] [U]example:[/U] [CODE=c] char test[] = "Hello World!!!"; char test2[20]; ir_strcpy(test2, test, 1, 3); /* test2 now contains 'ell' */ [/CODE]

0
277
Member Avatar for tux4life

This is how mine [B]strlen[/B] function would look like if I'd to implement it from scratch :)

0
245
Member Avatar for JugglerDrummer

Make regex creation easier! Enter regex, test string, select from various function to run, then see the output.

Member Avatar for JugglerDrummer
0
212
Member Avatar for amrith92

These functions, to some, may seem trivial, but many people have queried in the forums on this topic numerous times. The functions are templated, so that it can accommodate any data-type that the user wishes to use (For example, the same function can be used for converting variables of type …

Member Avatar for tux4life
0
390
Member Avatar for tux4life

This is how mine [B]strcat[/B] would look like if I'd have to write it from scratch :)

Member Avatar for tux4life
0
387
Member Avatar for tux4life

This is how mine [B]strcpy[/B] would look like if I'd have to write it from scratch :)

Member Avatar for tux4life
0
210
Member Avatar for tux4life

This prime number generator is based on Eratosthenes' sieve, the found prime numbers are written to a file (you can specify it's name as a command line argument, as well you can specify the prime number upper bound (e.g: if you specify 500 as upper bound, the program will find …

0
184
Member Avatar for essential

This version is more precise and accurate compared to my first posted version of this script.

0
187
Member Avatar for serkan sendur

Instead of creating a new folder in users application folder under program files and putting there some visible resources, embedding those resources to single executable is better. in this snippet i will show playing an embedded sound file.

0
170
Member Avatar for clarence_cool03
-1
108
Member Avatar for clarence_cool03
0
166
Member Avatar for clarence_cool03
0
220
Member Avatar for clarence_cool03
0
123
Member Avatar for clarence_cool03
0
146
Member Avatar for clarence_cool03
0
172
Member Avatar for clarence_cool03
0
225
Member Avatar for clarence_cool03
0
151
Member Avatar for clarence_cool03
Member Avatar for clarence_cool03
0
168

The End.