132,726 Archived Topics
Remove Filter ![]() | |
Code to Execute an SQL Script in JDBC. The SQL Script should have comments starting with - or -- only on new lines and each command should end with a ; . Reading a sql file and putting all of it in a string variable and feeding to the execute … | |
Hi everyone, Ive been asked to do an assignment to test the randomness of a linear congruential generator..We've been given the code implemented in c..the problem is i dont really see how this code relates to the theoretical LCG equation i.e X[n+1] = (aX[n] + c) mod m..So i would … Software Development c | |
Looking at the First In First Out (FIFO) data situation. Just like a line at the grocery store check-out. Its counterpart FILO would be like a stack of dinner plates. | |
What I need to do is using classes, design an online address book to keep track of the names, address, phone numbers, and birthdays of family members. The program should be able to handle a maximum of 500 entries. a. Define the class Address that can store a street address, … | |
Hello guys! At school we were given a homework to read some info from web page and display it. While surfing over net for some infos how to approach to this a came across at HTML Agility Pack. I decided to use it. But I have some problems with parsing … Software Development html-css | |
There seems to be a lot of shuffling going around here lately. So I looked [url=http://en.wikipedia.org/wiki/Shuffling]here[/url] to learn about the Fisher-Yates shuffle etc. But unless my English is not good enough I did not find anything about the way we shuffle a card deck here. Take a deck in your … Software Development | |
We take a look at the various functions of module time, counting seconds and milliseconds, measuring the time a simple for-loop takes, inspect a list of time data and ways to display it in a useful manner. An attempt is made to find the day of the week, given a … Software Development python | |
Memo.h: [CODE=cpp] #ifndef _MEMO_H #define _MEMO_H #include <stdlib.h> #include <string> #include <typeinfo> #include <iostream> #include "Date.h" #include <map> #include <vector> using namespace std; class Memo { public: map<Date, vector<string> > Appointment; //void delMemo(int x); void addMemo(Date myDate,string x); }; #endif /* _MEMO_H * [/CODE] Memo.cc [CODE=cpp] #include <stdlib.h> #include <string> … Software Development c++ ide linux-kernel os-x storage | |
Lets say that you are working on a program such like Notepad, for instance. You want to make a Ctrl+S key event to save your work. This is the ONLY way I have found out that does not cause any conflictions at all. In the KeyUp Sub of, leys say, … Software Development vb.net | |
I'm a bit of a novice when it comes to programming, wanting to learn. I'm trying to write a program that has a while loop in it, or preferrably a do..while loop but I can't seem to call methods within a nested if statement in the while loop. How is … Software Development | |
[code] // Windows Programming Tutorial Series #include "stdafx.h" #include <windows.h> int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { MessageBox (NULL, "Hello World! This is my first WIN32 program", "Lesson 1", MB_OK); return 0; }[/code] 2 errors: Linking... LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main Debug/a.exe : … Software Development c++ | |
A couple things to mention: 1.) This program uses system("PAUSE"); in the main function, if you are not using Windows, you might have to pull it. 2.) There are a couple lines in there that are not needed, I'm just using them to test the size of the array. My … Software Development c++ | |
Some things you need to know: [LIST] [*]This code is not efficient, if you want a more efficient solution, then turn to the STL algorithm [URL="http://www.cplusplus.com/reference/algorithm/next_permutation/"]next_permutation[/URL]. [*]When there are double characters (i.e. characters which occur multiple times) in the string to permute then some permutations will be generated multiple times. … | |
Alright, this is the best text based RPG I have created, and I have refined all the bugs and such. I have gotten a few questions on whether it is beatable without dying, and it IS beatable without dying, but be aware that you most likely will die quite a … Software Development c++ | |
Hi everyone, new to the DaniWeb community, i have always used it for homework help in the past, but i'm about to rip my hair out if i stare at this code for another hour. basically the project is to write a code that reads data from a file, gets … | |
I want to find the determinant of a square 4x4 matrix using a minor and cofactor. And I want those in three seperate functions where i is the number of rows and j is the number of columns: [CODE]double minor(double a[][4], int row, int column);[/CODE] Done by removing a row … Software Development c++ | |
Hi I'm writing a client/server remote viewer application where screenshots of the desktop are sent across the network over a socket. I'd like to reduce the size of the transfer by getting [I]the difference between the two images and then sending the difference[/I]. The difference would be at least a … Software Development client-server image java | |
Ever wondered how to calculate the date of easter? Well here is how to do it in C# Software Development mathematics | |
Hey guys, I am brand spanking new to C# and am not only wondering about the syntax, but also the logic of how to do this, my professor just threw us to the wolves with this problem and we haven't gone over any of the syntax or anything, I am … Software Development mathematics | |
Hi programmers, I want read line by line a Unicode (UTF-8) text file created by Notepad, i don't want display the Unicode string in the screen, i want just read and compare the strings!. This code read ANSI file line by line, and compare the strings [B]What i want[/B] Read … Software Development c engineering file-system | |
This is the first big program I'm gonna do and so far, i have really no idea on how to go about it. Basically, I aim to create a C++ program that:- [LIST=1][*]Takes expressions of the form... [TEX](3+4(5*2)+(3/(sin 62))-4)[/TEX] or similar ones and evaluates them [*]Takes equations of the form … Software Development c++ | |
The idea for this came from another thread in the C++ forum that wanted to duplicate the _getdelim() function that is supported by GNU compilers g++. I made one major change in that this version does not allocate new memory every time it is called, which is grossly inefficient. Instead, … Software Development c | |
This snippet provides 2 functions to create in memory a gziped archive of a sequence of files and directories, and to extract files from this archive. These functions are similar in effect to the linux commands [icode]tar czf[/icode] and [icode]tar xzf[/icode] but instead of writing an archive file on disk, … Software Development motherboards-cpu-ram python | |
Hello, im trying to implement a template matching algorithm with the use of Python + PIL and I'm trying to follow the code that wikipedia gives for template matching -> [URL="http://en.wikipedia.org/wiki/Template_matching"]http://en.wikipedia.org/wiki/Template_matching[/URL] Basically it loops through all pixels of a search image, and all pixels of a template. The sum of … | |
Is there a way to use a progress bar on a message box? Software Development visual-basic | |
hey i have a problem with adding an is numeric checker to my code for my class when i hit a snag just wondering if i could get some help this is my first program so help is appreciated [CODE]// fun with physics.cpp : Defines the entry point for the … Software Development c++ visual-studio | |
Convert a decimal (denary) integer to a binary string. An exercise in do ... while and while loops. Software Development c | |
Some background. We all used the string class, but some of you might not know that string is just a typedef of basic_string. In fact here is the typedef you might find when looking in the XString library. [code] typedef basic_string<char, char_traits<char>, allocator<char> > string; [/code] This code snippet shows … Software Development c++ | |
Hi, I have the problem that a char ch2 = '\u0041' is confirmed as a character and also printed as "A", but the char ch3 = '\u00c6' , which is also confirmed as a character, is not printed only as a "?" where it is supposed to be a "æ". … Software Development | |
Hi Guys, Firstly, Happy New Year!! Second, here my first query of the new year: I am using a stored proceedure to retrieve records from a database that match a number of search parameters. I now want to show a subset of those records in my Datagridview. I [B]don't[/B], however, … Software Development | |
I have asked the same Question on C++. So far I have moderately mastered PHP a little and more of Python. I want now to add up Java/C++ So what I need to know to be Java expert in Web and Desktop Applications? Are they two different beasts? Thanks Guys Software Development java | |
Does anyone have an idea why these console colors aren't coming out properly? Some of them work and some come out as junk. [code] using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace daniweb.capp { class Program { static void Main(string[] args) { const string s = "0020002000200020007c007c003a003a007c003a007c007c002000200020002e" + "002d002d002d002d002d002d002d002d002c000d000a0020002000200020007c" … Software Development | |
So this is a homework question, but i've been doing endless reading and am really clouded over!! I have to use an Object Oriented approach to gain the higher marks for this but I can't work out whether i'm going about this all wrong. Is it possible to have just … Software Development oop | |
In the simplest of terms, a Class is like a cookie cutter. It describes what members and methods an object should have. You use the cookie cutter (class) to make (instantiate) one or more cookies that are all the same shape. The cookies are called objects. The same way that … Software Development | |
I'm adding about 25,000 objects to a vector and it's taking too long so I wanted to try and speed it up. Currently I'm adding them in the format: [CODE]vector<MyClass> MyVector; MyVector.push_back(MyClass(Param1, Param2, Parm3, Param4));[/CODE] As I understand this would involve creating two instances of the object and copying one … Software Development c++ | |
i run the below code and surprised to see the o/p . take a look and let me know whats happenning there. [CODE]#define print(x) printf(#x"=%d\n",x) int main(){ int a[10]; print(a); print(*a); print(*a+1); print(*a+3); print(*a+1-*a+3); return 0; } [/CODE] Out Put: [QUOTE] [Zonnie@telnet CPz]$gcc funny.c [Zonnie@telnet CPz]$ ./a.out a=-1073745776 *a=1 *a+1=2 … Software Development c | |
Whenever you hear the word recursion, factorials or Towers of Hanoi are never far away. Well here they get mentioned, because we are not going to talk about these guys at all! Iteration and recursion are in fact quite similar: they both loop until a certain condition is met. As … Software Development mathematics programming-construct | |
Unfortunately in c++, there is really no good way go locate lines in your file without reading the entire file 'character at a time.' So, if you [I]have[/I] to read only a single line from a file, we know we are at some point going to have to be inefficient... … Software Development c++ file-system ios | |
I'm writing a program that is supposed to be able to bubble sort data by name and by average. The data I'm given is student last name followed by 3 scores, all put into a text document. I'm to read the names and scores into their respective parallel arrays, and … | |
This program was written and tested in unix/linux environment (in EMacs editor )with a GCC compiler. | |
I am designing a module to perform some actions for a library database application. The methods are not implemented yet but I was wondering what you all think about nested classes in this situation. Design One [CODE=Python] #!/usr/bin/env python # File: .py # Author: shadytyrant@gmail.com # Date: 2009-11-25 # Notes: … Software Development database-design python | |
Hi. I am new to Java and am trying to figure out a homework problem. It is a password verifier with the following criteria: [LIST] [*]at least 6 characters long [*]conatin at least one uppercase and one lowercase letter [*]should have at least one digit [/LIST] This is what I … Software Development java | |
Hi All, Let me explain the problem. I have multiple include files as in class1.inc, class2.inc, class3.inc etc. Contents of an include file will be like class1.inc [code=c] { "john", 12, 68, "steve", 12, 98, "mat", 12, 95, }; [/code] This will basically serve as a static array of structures. … Software Development c | |
I am writing a program that sorts an array of either floats or doubles -- this is specified at compile time via a command to the compiler. I also must use void pointers. My program compiles, but when I try to run it with floats I get a "segmentation fault" … Software Development c | |
This code snippet shows you how to sort more complicated objects like a list of lists (or tuples) by selecting an index of the item to sort by. Software Development python | |
Hi, i am making a program that contains an integer array of an unknown size.The user is prompted to enter numbers into the array,and press 'x' to exit. What i am going to do then,is to pass the array from the main into a class which contains another array,but before … Software Development c++ | |
Hello daniweb peeps, been learning c++ from a beginners book for the past week or two but have got myself a bit confused, follows is the code that compiles but isn't doing what i want it to (Im hoping the fault is obvious!) [code] #include <iostream> using namespace std; int … Software Development c++ | |
Hello :-)! [quote]SUMMARY: How to run pocketsphinx_continuous on mobile phone with Symbian, and how to do it with simulator of mobile phone with Symbian. PocketSphinx can be downloaded for free here, for both Linux and Windows: [url]http://cmusphinx.sourceforge.net/html/download.php[/url] .[/quote] ------------------------------------------------------------------------------------------------------------ SHORT EXPLANATION I'd like to create application for mobile phone and … Software Development audio c++ developer-tools open-source ubuntu | |
Suppose in my one particular piece of code, I am avoiding loops. ie instead of providing 'for' loop to do the task , I am copying and pasting a part three or four times to make it simple (?)to code. In this case what are the consequences of my action? … Software Development | |
Hi, would someone please help me with the following: I would like to implement the Round-Robin scheduling algorith for the below code. I am really facing a problem whenever i try to implement Round-Robin scheduling algorith in this code. Your prompt action and support is highly appreciated and I am … |
The End.