EBCDIC to ASCII





ranking Sort Sort   |   date Sort Sort   |   member Sort Sort
Syndication

« Previous 1 2 3 4 5 Next »
12
Date Submitted Thu. Oct. 12th, 2006 5:34 PM
Revision 1
Scripter wiz1705
Tags C | stdin | termios
Comments 0 comments
Using the Termios library, we can have the user enter a character on the keyboard, without it being displayed on the screen.
10
Date Submitted Thu. Aug. 3rd, 2006 11:54 AM
Revision 1
Helper bobbyrward
Tags boost | CPlusPlus | preprocessor | shared_ptr
Comments 0 comments
template function to create a boost::shared_ptr in the form

boost::shared_ptr classPtr = new_ptr(Arg1, Arg2);

You can also make new_ptr_access a friend of className and make the constructor and destructor private.

This keeps the end user from:

Creating an instance manually on the heap
Creating an instance manually on the stack
Deleting a shared_ptr manually using "delete get()"
10
Date Submitted Tue. Aug. 8th, 2006 1:19 AM
Revision 1
Beginner ciorga
Tags CPlusPlus | float | int | toString
Comments 1 comments
Transform any basic type to string. Very handy for log messages

Usage:

int i(12);
float j(3.14);
cout
9
Date Submitted Mon. Oct. 9th, 2006 6:57 AM
Revision 1
Helper shell
Tags C | CPlusPlus
Comments 6 comments
I was coding a project that used arrays when the lack of a standard foreach in C/C++ got to me. So, I coded this little function to help me. It applies a function that returns int to each element of the array.
9
Date Submitted Fri. Aug. 25th, 2006 7:46 PM
Revision 1
Helper psykoprogrammer
Tags .Net | C | drag | drop | treeview
Comments 2 comments
Below is a bit of code which sets up drag and drop in a treeview. This is handy for if you have a list of items that can be sorted by the user.

Here is a bit of code to demonstrate how to do this. First create a new Windows executable project. Drop a TreeView component on the form, and let's name it 'myTree' for this demonstration. Go ahead and populate it with some dummy data; enough data to see the dragging and dropping in action. You will need a variable global to the form's scope.

private TreeNode sourceNode;

This is used to track the item we are dragging in our TreeView. Then define the event handlers listed below.
9
Date Submitted Wed. Oct. 25th, 2006 9:57 AM
Revision 1
Helper fastmike
Tags C | File | Java | String
Comments 12 comments
What is Dijkstra Algorithm? click on the link above and first understand what the algorithm is all about. in short it calculates the shortest path from A to F or vise versa. This code i can guarantee is the simplest and easiest code to understand. just search on google and try to compare this code and other dijkstra code and you will see what i am talking about. i spent alot of time myself and my instructor to guide me on the rite path.
http://en.wikipedia.org/wiki/Dijkstra%27s_algorithm(Description)
to see how the algorithm really works go on this website it tells you step by step how to update the cost and which path to choose.
http://renaud.waldura.com/doc/java/dijkstra/
Please give some time to understand the algorithm first and then you can see my code. if you done understand the algorithm it is very useless. i know alot of people need Dijkstra algorithm in java for their HW assignment or Test. i am giving you the solution step by step. anyone who wants to understand please go to the url i have posted above and once you have understand then run the code and for those people who just want to copy so that they can get 90% in their test No Problem Here it is .
First open a notepad and name that file anything like data.txt or datas.txt and make sure the file looks something like this and in this format.
0 3 100 5 100 100 (100 represents infinity)
3 0 6 7 7 100
100 6 0 5 5 3
5 7 5 0 1 100
100 7 5 1 0 2
100 100 3 100 2 0
i name this file as a data.txt file. i have 6 nodes. and A is always the starting node which has the cost of 0 so by looking at the first line i
know that A to A have distance 0, A to B is 3, A to c is Infinity, A to D is 5, A to E is Infinity(means no edge connected with A), A to F is Infinity.
for second line(B to A is 3, and then vise versa) and for the 3rd line it starts for C and etc..
save the txt file by any name and then copy the code which i have posted and then to run type this:
javac routing.java
java routing data.txt
you will get the output. i will say this one more time understand how the algorithm works or ......................
9
Date Submitted Mon. Oct. 9th, 2006 8:29 AM
Revision 1
Beginner dean
Tags C | Convert | unicode | utf8
Comments 2 comments
Convert Unicode To UTF8
8
Date Submitted Fri. Sep. 22nd, 2006 12:16 AM
Revision 1
Scripter sehrgut
Tags C | CGI
Comments 0 comments
The best way I've found to keep a suite of CGI environment variables in my C CGI programs is actually just to read them as name-value pairs into a stack. It simplifies parsing and makes the code cleaner and less fragile than using a specialized structure or an ordered array of strings (as well, empty variables are simply not push()ed onto the stack, so memory doesn't have to be allocated for empty strings). Plus, since there are never a huge number of environment variables, and they are all unique (by definition), a search through the stack for a given name takes minimal time. In fact, retrieval of environment variables beats a PHP-like hash-table implementation by a good deal.

In the code below, all you have to keep in mind is that the NVStk is a name/value pair stack (implemented as a singly-linked list with each node containing two char*s). Variable retrieval times can be minimized by adjusting the order of variable names in the char**s passed to sgcgi_getenv(). In fact, the ones below are just about backwards from how they ought to be, since I forgot I was using a stack instead of a queue . . . *blush*

Of course, there are more environment variables you can get, but you have to draw the line between exhaustion and efficiency, and that depends on the project. The variables included here are pretty much overkill for any program you're likely to need.

A nice way to use these types of functions is to wrap them in an accessor function that gets the environment once and keeps it as a static variable, and then on subsequent calls just looks up values in its stack. (If you want to see the NVStk, I can put it up, but it's pretty much a basic linked list.)
8
Date Submitted Wed. Aug. 9th, 2006 6:12 AM
Revision 1
Helper bobbyrward
Tags C | conversion | CPlusPlus | hexadecimal
Comments 3 comments
Converts a string representation of a number with any base(binary, octal, decimal, hexadecimal, up to base 36) to a long int.
8
Date Submitted Mon. Oct. 9th, 2006 6:38 AM
Revision 1
Helper shell
Tags 3D | CPlusPlus | GLUT | OpenGL
Comments 0 comments
This little function puts a string of a specified color and (centered) location. However, keep the word simple in mind. I purposfully not made it capable of supporting newlines.

By the way, this is my first snippet
« Previous 1 2 3 4 5 Next »