199,114 Archived Topics
Remove Filter ![]() | |
Commonly strings consist of ASCII characters, some are printable, some are in the backgrounds like the bell, carriage return, linefeed, tab and so forth. This code displays a table of ASCII characters and the corresponding decimal value. As always, you are encouraged to learn here. | |
Python uses C syntax to perform bitwise operations. Take a look at code that introduces you to bitwise operations at the binary level. | |
This snippet asks the user to fill in a structure and saves each record to the file. It uses append mode to add each new record to the end of the file. After all input is taken, it prints out the contents of the file. [i]Disclaimer: [font=courier new]fread[/font] and [font=courier … | |
Some issues, such as leading whitespace and trailing characters that cannot be part of a number, were not handled in [url=http://www.daniweb.com/code/showsnippet.php?codeid=266]Read an Integer from the User, Part 1[/url]. Here such issues receive lip service. | |
My first experience with pointers. Learned how to spell a string foreward and backward using pointers. I hope you can learn too! | |
A simple experiment with the ever so popular Mandelbrot fractal graphics, call it mathematical art, nice to look at. This set of experiments loops through a number of colors to make the whole thing more exciting. | |
I was looking for a somewhat meaningful and interesting example to explain the Python class to beginners. A room full of multilingual students makes this phrase translator a good choice. You can experiment with it and add more languages and phrases. | |
A common way to represent an inventory is with a list of tuples. Each tuple represents the item name and the item count. You can sort this inventory list by item name or item count. Here is an example to pick a sort key. It's your summer job to run … | |
This code uses field level validation to check for data in fields in an Access form, and instead of using message boxes (as the "Validation Rule" and "Validation Text" properties of a field (in the table design window) do, it turns the associated label and control (textbox/listbox/combobox) background color to … | |
Many of the code samples on the internet are written in Turbo C. The clrscr() function litters these samples, and even to this day people want to wipe your screen. You can use system("CLS"), but that uses a DOS command. DOS commands are with us only at the whim of … | |
Quick and dirty way to change your console program colors using DOS command "Color BackgroundForeground" where Background is hex 0 = black to F = white, dito for Foreground. | |
Using wxPython and the Boa Constructor, a VB/Delphi like IDE and Visual Builder, this little calculator was a breeze to make. Boa did 90% of the code generation, and I simply added code to each button click event to make the calculations work. I wish every project would go that … | |
The WinBGI package allows you to do some of the Borland BGI graphics in a specially created window form. So don't throw out the old Borland manuals, you can still use them to do some fancy graphing! Yes, you can gotoxy() again! This code was modified for Dev-C++, a real … | |
There are some pretty fancy things you can do with strings in Python. You can append, convert, justify, join, split, slice, and list selected files of a folder. I just give you a small sample here. | |
With the help of BCX I managed to create some C++ code that will allow you to send text to your printer and specify the font and other things. Play around with the options to suit your own needs. I have to admire the genius behind BCX, even though it … | |
Short little sound files of chicken, horses, dogs, cars, trains and other annoying things is the realm of the wave file (.wav). These are easy to play and guaranteed to confuse grandpapa. Again, we are using Windows' sound workhorse winmm.lib file. Ze function this time is PlaySound(). Here is ze … | |
The Standard Template Library (STL) vector is tempting. The burden of dimensioning an array is removed, and there are many wonderful functions to explore. The learning curve is a little steep, it will make your head swell, but in the end it's all worthwhile. Take a look at some of … | |
Let's expand the decimal to binary converter to include, amongst others, octal and hexadecimal conversions. Also shows how to exert some input control. Simple stuff! | |
Another experiment with the Standard Template Library (STL). This time we are taking a look at map. Map is a Sorted Pair Associative Container (a mouthful). The pair is -- const Key, Data --, where Key has to be unique. It is Key that is sorted. In this code sample … | |
Insertion sort, Selection sort, Bubble sort, Shell sort, Quicksort, and Heapsot. All optimized and ready to be experimented with. This is the framework for a Java application that speed tests various sorting algorithms (because there's usually little need to write one's own in production programs). Several popular algorithms were left … | |
This quicksort implements the basic recursive algorithm with three improvements. The first improvement is choosing the pivot based on the median of three values in the list to be sorted. This minimizes the chances of a worst case scenario. The second improvement speeds up the algorithm by termination when subfiles … | |
Clearing Controls & Forms in Access (VBA) | |
A program similar to ComputeMortgage.java utilizing a mathematical formula and multiple methods to calculate a loan payment. | |
I've just finished my homework program and I'm looking for any critiques. Whether they be about my methods, format of how the code is spaced and such, or anything of the sort. Also some ideas on decent commenting would be helpful. In summary I'm trying to learn some good programming … | |
ok guys my reputation altering power is 7, i will add to your reputation during ten days if you help me name the product dynamically from the command line using windows installer (.msi) setup project. Thanks in advance. | |
i'm thinking how to do this since last week. i can make a rps game in java, BUT not in OO way. just the simple ones. what i want to do is a rps game - the OO way. i planning this program to have two options, play with player … | |
ListViewItemCollection class has no constructor, so i cant create an instance. the listview in compact framework does not have SelectedItems property, so i want to create it. I want to iterate through all the items and if they are selected i want to add that item to the instance of … | |
Hello! First post so I'd like to say hello to everyone :) So I've got this code here, I am very new to C++ and going through the basics, and I am creating a program that will tell the user when he/she is born. So the user puts his/her age … | |
I was thinking of a new project for making a bot that scans daniweb for information and enters useful information into a database then people can ask the website questions and php+mysql will provide answers in paragraph form for the user to read. Is this ok on the legal side … | |
Could you please help me with something I am trying to acheive. I am using Java 6 and Eclipse 3.5.0. I am new to programming generally and have created two java files. Driver loads the UserForm and will go on to control a number of other files eventually. UserForm is … | |
Hi, I am getting errors with RTTI. In this program I have an Abstract base class with virtual function area() and two derived classes. I defined a polymorphic function and passed the derived object as argument to it which has reference to the base class as argument. I used typeid … | |
![]() | Hey. I've written a bit of c++ code to move columns of data from similarly named files (file20.txt, file40.txt, file60.txt etc) into a single file. Unfortunately there seems to be at least 1-2 errors (which I cannot seem to fix :S). I'm trying to take data from a list of … ![]() |
I am using Named Pipes to transfer data from a client (C++) to a server (C#), the client does the following: [Code] struct MESSAGE { char cCommand[8]; string sParameter; }; MESSAGE msg; strcpy(msg.cCommand, "COMMAND"); strcpy(msg.sParameter, "DO SOMETHING"); DWORD dwWrote = 0; WriteFile (hpipe, &msg, sizeof(msg), dwWrote, NULL); [/Code] Then, at … | |
Hey so basically as the title suggests I want to develop a PHP website on my Mac, the site will not be hosted on my laptop but will be hosted on an Irish web hosting server. Anyway I am wondering what is needed to develop on the Mac? I just … | |
Hi all, I was wondering why the following code compiles, with or without extra komma? My feeling is it should not be there, but apparently it does not matter. Any comments would be more then welcome. [CODE=c#]namespace ConsoleApplication1 { class Program { public enum months { jan = 1, feb … | |
Hello everyone. I have a question regarding those mp4 video files.. Is there any library easy to use to convert mp4 files to mp3 files? I have lots of mp4 videos which I want to be able to programmatically convert to mp3 files. I tried searching google for a very … | |
I'm adding really big numbers (a lot of them). I'm supposed to detect overflow errors. I did it years ago in Assembly by checking bits, but I've never done it in C++. [code] long long a = pow (2, 62.0); long long b = pow (2, 62.0); a += b; … | |
Hello. I'm new here, and new to Python. I have a little experience with C++, and assembly, and just started learning Python about 2 weeks ago. I'm trying to write a program that will control servo motors in sync with an audio file (probably .wav). So far I've written programs … | |
Hello, I google and search through about the 2 dimension array and I still not really understand how to do it.. for example: I got a file input called namelist.txt with following thing John Jason Leonard Kelly Kate Ash and I got the following code: #include <stdio.h> int main () … | |
Hi i have this login script which works. it will work for passwords that i have directly entered into the database through phpmyadmin but wont login for the passwords that i have entered through the registeration script for which i have used md5. Understandable ! But as soon as i … | |
Its my 1st time posting here... Do tell me if I am doing anything wrong. [code=c] cout << "Please specify a question that has a yes answer for your object and a no answer for my guess:" << endl; getline(cin, qtn); foundyq = qtn.find_first_not_of("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ "); while(int(foundyq) != -1) { if(noTry … | |
Hi, I am new to the forum. I am in the learning process and I will stick around until I learn everything from you. I try to create count down starting at 15 seconds. But when I compile, "clock identifier not found." I am !ondering the same thing, too. Perhaps … | |
Hi everyone! This code runs without throwing exceptions and stuff, but it doesn't exactly run when I click the "Submit" button -- what is supposed to happen is that I click it and it generates a random number. What happens is either nothing or if I get lucky and click … | |
I know there's loads of these threads already and the norm is to [URL="http://www.google.co.uk/search?hl=en&client=firefox-a&rls=org.mozilla%3Aen-GB%3Aofficial&q=null+exception+error+java+method&btnG=Search&meta="]Google it[/URL], but I can't seem to find the solution. Anyway I keep getting this darned error and need to know how to fix it ASAP, since the Servlet project is due in this Wednesday. Code is … | |
Hi everyone. I heard that it is possible to code up a small program to randomly change windows desktop bg pic. I havent got any code (as i dont know how to do it) so could some plz tell me, or direct me to a site or something. Btw this … | |
![]() | Quick background: I'm working on Project Euler and made a palindrome checker. I needed to convert integers to strings. itoa() kept giving random values (9 gave 9 or 90, etc...), so I decided to make my own, and ran into a problem. [I]I have fixed it, but could somebody explain … ![]() |
Hello all, I am in the process of teaching myself c++. I wrote one program successfully and I'm trying to write my second. I have run into a problem that I can not seem to figure out at all. I understand that this seems trivial, but I really need to … | |
Hey I am trying to build this application, but I am having trouble as error messages keep appearing. Using Visual Studio 2008... [code] using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.IO; using Opc; using OpcCom; using Opc.Da; using Opc.Hda; namespace ConsoleApplication3 { class Program { public static void … | |
This is a very important issue to consider when you're using form/url variables in databases. A user can cleverly put in SQL statements and manipulate your db server as he sees fit if you don't take the necessary precautions. I get the feeling that there are several people that aren't … | |
I'm still relatively new to these forums. I just like to put out a query regarding threads and their solvability. For Daniweb forums, is it considered good practice for OPs to flag threads that they have started as being solved if they have received appropriate posts that have answered their … |
The End.