199,114 Archived Topics
Remove Filter ![]() | |
Text fragment extractor (usage: fragment /pattern/[n] [/pattern/[n]] file), similar to the print command in ed and vi, with pattern range. If the second pattern is omitted, prints to the end of file. Use quotation marks when there are spaces in the argument. Finds the first pattern, then the second pattern, … | |
The code shows you how to create a window without a titlebar that can be dragged with the mouse. Set the FormStyle property to fsStayOnTop. The form contains a small 18 button calculator. When you create the form and calculator components, try to make it tiny, it is cute that … | |
Chargen is a program created entirely by mahen of Mauritius. The simple task of Chargen is to generate characters, but the most important aspect of this particular program is it's abillity to process user input. Due to the way the program was programmed, any input that the user will make … | |
![]() | Unlike a balanced skip list, a probabilistic skip list uses random numbers to determine the height of each node rather than deterministic logic. The only real advantage of using a linked structure instead of an array based structure is in code maintainability. |
![]() | Array based skip lists are a pain to work with. They are error prone and difficult to follow. Worse, they are difficult to extend so that the data structure is deterministic rather than probabilistic (a desirable property). The following implementation uses a linked structure instead of arrays for the levels. |
A program that reads in two integers and determines an prints if the first is a multiple of the second. | |
A program used to calculate each employee's pay based on that employee's paycode. | |
A program that inputs three integers from the keyboard and prints the sum, average, product, smallest and largest of these numbers. | |
Find all Pythagorean triples for side1, side2 and hypotenuse in which all sides are no larger than 500. Use a triple nested for loop that tries all possibilites. | |
A program that asks the user to enter two numbers, obtains the two numbers from the user and prints the sum,product,difference, and quotient of the two numbers. | |
Uses only integers for monetary values to calculate compound interest. | |
Uses the string comparision functions and the techniques for sorting arrays to alphabetize a list of strings. Uses the names of 10 or 15 towns in your area as data for the program. | |
A test program that will call the PROC findGCD, passing in the integer values input by the user and then it will display the results to the screen. | |
A program that will test the Nonrecursive Factorial procedure using a value passed in by the program user and will also do a time comparision of the Nonrecursive and Recursive Factorial functions. | |
Additional features will be added to this section of code such as fixing window size proportial to monitors resolution and subclassing the single edit control of this program. You'll notice I don't call ShowWindow here as WS_VISIBLE in windows style is defined. | |
A program that plays a MIDI file and stops it, and than starts a different MIDI file. The same concept applies to .wav files mciSendString("play the_file",NULL,0,NULL); starts playing it, and as expected mciSendString("stop the_file",NULL,0,NULL); stops playing it. | |
I've often wondered why M$ didn't make creating a window a simple as registering a class in that only one 32 bit value need be passed to calling routine. Although this is not ground breaking code design it does facilitate calling code only set EBX to point to all values … | |
I prefer to use this method as it doesn't clutter a windows procedure with dozens of conditionals and it address my primary objective of coding as tight as possible [28 bytes]. If you think my method can be improved upon in size and/or speed please post your solution. Note: I … | |
The next few posts will be what's required to get a window to display on the monitor. The code between Main & Pump will probably change as time goes on, but for now this is all that is required. I choose this method or placement because only 28 bytes of … | |
These are a pair of routine I use quite often. I know MemSet is virtualy the same as ZeroMemory in kernel32.dll, but there may be a time I want to use these in an embedded system where this dll won't be avaliable. | |
As part of a larger hobby project that I'm undertaking being a doubly linked list for 95/98/XP, this is the first in a series that I will be posting. Upon completion, I will have a complete application written in assembly for the Windows platform. Compiled with NASM | |
Many moons ago I wrote a Delphi program that could tell the exact character in a ListBox, as you clicked on it with a mouse. I found a little info on the NET that lets you get at least the item in a ListBox using C#. I made it work … | |
You can look at a selected file's date and time stamp and change it with this Delphi program. XP files need a little extra TLC, but it's taken care of too. | |
Swap two images as you move your mouse in and out of the image field. Uses onMouseOver, onMouseOut and a short javascript code. | |
A data stream is used to load a bitmap image and convert it to a jpeg image. The converted image is displayed and saved to a .jpg file. | |
When this program is run it asks for the coordinate grid points, then it processes that and the result is the run rise and slope. | |
A simple demostration of how to clear the console screen in at least Dev-C++ 4.9.8.0 (I don't know about the other since I've only tried it on this one, but may and probably works,, with few if at all minor adjustments), what more can I say, other than it's not … | |
Setcolor was entirely programmed by Mahen of Mauritius. Who have never wished of changing the Font colors of the Command Prompt on the fly. Well this is where Setcolor comes in handy. The main function of this program is to change the default Font color of your Command Prompt. The … | |
Shows a basic way to create a form with a wallpaper image on it. Also shows how to add a transparent label to blend in with the wallpaper. Getting the label to be transparent wasn't all that commodious! The wallpaper is generated using a texture brush and bitmap image. The … | |
[b]1. mod_rewrite se friendly pages for vBulletin[/b] Here is a seo hack for vBulletin developed by Danielle Horowitz. You can find original text at [url="http://www.daniweb.com/techtalkforums/thread9379.html"]http://www.daniweb.com/techtalkforums/thread9379.html[/url] I have remade her instructions in the phpBB mod like format. You can read them here [url="http://www.daniweb.com/techtalkforums/post87148.html#post87148"]http://www.daniweb.com/techtalkforums/post87148.html#post87148[/url] You can download text file here [b]2. Meta … | |
Use layers to create plots within a browser. Each point to be plotted is rendered via a layer (using the DIV tag). Mozilla/Firefox/IE seem to handle thousands of layers without any problem. Can attach event handler to each point for additional interactivity. Snippet example is housed within a JSP at … | |
Okay, this introduces two new things into the widget. The first thing you need is a picture file (.jpg, .png, .bmp etc...). The new code makes the picture into the button with the text "Hello, World" on the side. In the parentheses next to File.open you would put the file … | |
This is kind of an extension to my previous code snippet. This language is really fun to use. I find it pretty easy to use and understand. This will create a window with a button. | |
This is a basic window coded in Ruby. To download Ruby go to [url]www.ruby-lang.org[/url] and download the latest version. The latest version includes the FX toolkit that is needed to create this window. | |
One more look at BCX basic code to show the qbasic programmers how they can modernize. This shows a function that converts an integer value to a binary string. Notice that with BCX basic you need to declare your variables. Makes the code a little easier to read too. Variable, … | |
In [url=http://www.daniweb.com/code/snippet149.html]Part 2[/url], you may have noticed that the bits representing the [i]value[/i] of an [font=courier new]unsigned int[/font] did not appear to match the bits representing the [i]object[/i]. This is because of the [i][url=http://en.wikipedia.org/wiki/Endianness]endianness[/url][/i] of my implementation. When it comes to displaying the bits of objects that take more space … | |
In [url=http://www.daniweb.com/code/snippet148.html]Part 1[/url], I chose [font=courier new]unsigned int[/font] as the type to use for displaying the bits of a value. The same general procedure can be done with other types as well. The biggest issue really is the expression which generates the most significant bit, for which there are a … | |
It is often instructive to display the bits of a value. (This is similar to 'converting' an integer to binary.) The way I have done this in this snippet is to start at the most significant bit and work your way through all the rest of the bits. (Continued in … | |
Yep. I have no life. Here's the simplest and stupidest form of C++ coding ever known to man kind...the change counter. What does it do? Count change :-) | |
This shows you how to create a Windows GUI program in BCX basic and embed the Media Player in the form. It will give you a fully functional player with a 30k executable size for your MP3 files. The needed header files and library files are included in the BCX … | |
New to me, but MS InternetExplorer does have COM support you can access from basic code. I had to test this out and make it work. We are using BCX basic, one of the successors to Qbasic. | |
Another look at BCX basic. Here we use COM support to manipulate Excel. In other words, from within the basic code we are entering a few numbers into the Excel spreadsheet and add them up. Of course you can do much more powerful stuff. With COM support you can also … | |
This is a very common task for a beginner programmer. Unfortunately many beginners do not seem to understand the question. First, know that binary, decimal, octal, hexadecimal, and others are simply [i]representations[/i] of values. The value of 123 (decimal) still has the same [i]value[/i] if it represented in hexadecimal (7B), … | |
I just had to do this to see how it would look like in the code field. This small prime number generator is written in BCX basic, a mildy more modern basic than Qbasic. With BCX basic you can throw in C and assembler code and it would actually compile … | |
This is a little program in QBasic which counts the number of characters in a string. Made by Buff - two errors removed by me. Thanks Buff. | |
You probably have seen those message snakes following the cursor on a web page. Well, the javascript code is not too complex, so let's look at it ... | |
Sooner or later a Csharp snippet had to appear. This one builds a form containing a set of buttons. A bitmap drawing area is used to draw a series of circles with random color, radius and center location. Your creation can be saved as a jpeg image file. You can … | |
Many of you know how I like to use sound to make the old computer box more interesting. The midi file packs a lot of neat instrumental music. It is very simple to play, even in a console application, using the winmm.lib file that comes with just about any Windows … | |
Log files are useful things. They are used in programs to display the values or variables or other useful information such as what the program is doing. This is useful is the program crashes at some point or is not behaving as it should. By writing values and events to … |
The End.