Read from Stdin without Writing to the Console





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

« Previous 1 2 3 Next »
2
Date Submitted Thu. Oct. 20th, 2005 6:22 PM
Revision 1
Coder mattrmiller
Tags "Command Line" | C | Calculator
Comments 4 comments
Command Line Calculato
-7
Date Submitted Wed. Mar. 1st, 2006 3:36 PM
Revision 1
Syntax Master dannyboy
Tags BATCH | C | CMD
Comments 2 comments
Add additional IP to compute
-8
Date Submitted Fri. Mar. 10th, 2006 9:29 AM
Revision 1
Helper ses5909
Tags "ASP.NET 2.0" | C | VB.NET
Comments 2 comments
Databinding in asp.net 2.0 is takes very few lines of code.
-7
Date Submitted Fri. Mar. 10th, 2006 9:32 AM
Revision 1
Helper ses5909
Tags "ASP.NET 2.0" | C | VB.NET
Comments 2 comments
Databinding in asp.net 2.0 takes very few lines of code. This example shows how to bind a CheckBoxList using a SqlDataSource.
6
Date Submitted Mon. Mar. 13th, 2006 11:49 AM
Revision 1
Coder mattrmiller
Tags "MAC Address" | C | Devices | Ethernet
Comments 3 comments
Code snippet that prints MAC addresses for Ethernet type devices.
-5
Date Submitted Tue. May. 2nd, 2006 3:26 PM
Revision 1
Helper gbarendt
Tags C | conversion | hexadecimal
Comments 3 comments
Converts a hexadecimal string to an integer.
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 Wed. Aug. 23rd, 2006 6:07 PM
Revision 1
Beginner billism
Tags ASCII | C | conversion | CPlusPlus | EBCDIC
Comments 2 comments
Convert an ebcdic buffer to an ascii buffer.
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.
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.)
« Previous 1 2 3 Next »