199,114 Archived Topics

Remove Filter
Member Avatar for
Member Avatar for bumsfeld

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.

Member Avatar for bofarull
1
164
Member Avatar for vegaseat

Python uses C syntax to perform bitwise operations. Take a look at code that introduces you to bitwise operations at the binary level.

1
307
Member Avatar for Dave Sinkula

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 …

1
492
Member Avatar for Dave Sinkula

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.

Member Avatar for drxs33
1
471
Member Avatar for bumsfeld

My first experience with pointers. Learned how to spell a string foreward and backward using pointers. I hope you can learn too!

1
119
Member Avatar for vegaseat

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.

Member Avatar for bumsfeld
1
181
Member Avatar for vegaseat

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.

Member Avatar for vartotojas
1
208
Member Avatar for vegaseat

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 …

1
586
Member Avatar for rhenerlau

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 …

1
127
Member Avatar for vegaseat

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 …

1
741
Member Avatar for vegaseat

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.

1
291
Member Avatar for vegaseat

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 …

Member Avatar for vegaseat
1
486
Member Avatar for vegaseat

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 …

1
574
Member Avatar for vegaseat

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.

Member Avatar for vegaseat
1
378
Member Avatar for vegaseat

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 …

Member Avatar for cybercode
1
329
Member Avatar for vegaseat

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 …

Member Avatar for danibootstrap
1
226
Member Avatar for vegaseat

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 …

Member Avatar for vegaseat
1
178
Member Avatar for vegaseat

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!

1
186
Member Avatar for vegaseat

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 …

1
169
Member Avatar for Narue

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 …

Member Avatar for majestic0110
1
361
Member Avatar for Narue

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 …

Member Avatar for Matt Labbé
1
1K
Member Avatar for Paladine
Member Avatar for Dani

A program similar to ComputeMortgage.java utilizing a mathematical formula and multiple methods to calculate a loan payment.

1
200
Member Avatar for grihalo

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 …

Member Avatar for VernonDozier
1
170
Member Avatar for serkan sendur

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.

Member Avatar for serkan sendur
1
74
Member Avatar for scias23

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 …

Member Avatar for TheWhite
1
605
Member Avatar for serkan sendur

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 …

Member Avatar for DdoubleD
1
846
Member Avatar for DavidDan

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 …

Member Avatar for tux4life
1
226
Member Avatar for cwarn23

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 …

Member Avatar for cwarn23
1
303
Member Avatar for philjava

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 …

Member Avatar for philjava
1
148
Member Avatar for vvinayk

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 …

Member Avatar for kvprajapati
1
119
Member Avatar for Phasespace

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 …

Member Avatar for Phasespace
1
81
Member Avatar for Shaitan00

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 …

Member Avatar for DdoubleD
1
496
Member Avatar for IrishHenshin

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 …

Member Avatar for IrishHenshin
1
118
Member Avatar for ddanbe

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 …

Member Avatar for DdoubleD
1
121
Member Avatar for Kekke

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 …

Member Avatar for serkan sendur
1
334
Member Avatar for VernonDozier

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; …

Member Avatar for Dave Sinkula
1
202
Member Avatar for Hagbard_Durden

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 …

Member Avatar for Hagbard_Durden
1
248
Member Avatar for jasonjinct

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 () …

Member Avatar for vali82
1
123
Member Avatar for Newbi

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 …

Member Avatar for tiger86
1
152
Member Avatar for charis89

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 …

Member Avatar for Salem
1
164
Member Avatar for jeezcak3++

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 …

Member Avatar for mrnutty
1
783
Member Avatar for kvass

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 …

Member Avatar for kvass
1
136
Member Avatar for helplessSoul

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 …

Member Avatar for helplessSoul
1
133
Member Avatar for marceta

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 …

Member Avatar for marco93
1
587
Member Avatar for NeoFryBoy

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 …

Member Avatar for NeoFryBoy
1
132
Member Avatar for dgr231

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 …

Member Avatar for dgr231
1
157
Member Avatar for si01

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 …

Member Avatar for si01
1
153
Member Avatar for samaru

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 …

Member Avatar for cgyrob
1
530
Member Avatar for yellowSnow

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 …

Member Avatar for yellowSnow
1
288

The End.