32 Discussion / Question Topics
Remove Filter Hey guys, I am playing with the .NET 4.0's new class Parallel. I tried to open files in a directory and calculate the total bytes of them. However when I run the code, I get a different result every time. Can you explain me the problem I have? [CODE]using System; … | |
Hey, I am developing a game in C#. I have some question marks in my mind about properties. -Should I return reference in a get, or should I clone the reference and return a clone? If I return a reference then in another part of the program, it will be … | |
Hey; I am learning some javascript. I tried to write a trivial code to validate email but my code does not seem to work it should. It should turn the background color of text box green when mail contains both '@' and '.' characters and red otherwise. However what the … | |
I have developed a program where I do some database connections and send some queries with JDBC to MySQL database called ANU. I have used NetBeans 6.9 under Ubuntu 11.04 as platform. When I run the app from NetBeans, it works perfectly but when I try to run it from … | |
Hey; I'm trying to change the mode of a file in Linux system. I know I must use chmod(const char* path, mode_t mode) but I don't really know how to handle the mode. How can I manipulate mode_t variable to apply my own mode? | |
Hey; I have an assignment. My assignment includes the following tasks to be implemented under Linux: – Display a list of all available files (with their types) in the working directory, – Display a list of only regular files in the working directory, – Display a list of only directories … | |
Hey; I am trying to handle the SIGCHLD and therefore prevent zombie processes walking around .) The program does not work the way it should however. I am counting how many times the ZombieHandler is called and at the end of the program it says zero. What might be causing … | |
Hey; I am following CoreJava and came to Event Handling chapter. I am trying to show a popup menu when the red button is clicked, but not works. Background color changes but no popup menu is shown. What is the problem? [CODE]/* * To change this template, choose Tools | … | |
Hey; I am wondering if there is a way of tracking ftp packets of a webserver ? This webserver is not a part of my LAN. If so, how does it work ? I can keep track of my own LAN traffic but how about seperate networks maybe behind a … | |
Hey; I am currently busy with multiprocessing and multithreading. There I saw a signal SIGCHLD which is an excellent zombie process cleaner by handling that signal. But when we are writing our handler function why we declaring it with an signal number arguement ? Is this arguement is automatically passed … | |
Hey; I'm trying to do a hang man game in Java. I newly learned some stuff about programming some GUI using Swing and AWT, but I'm not still clear with it. The problem is that all the drawing is done by a single function paintComponent() from the JPanel that I … | |
Hey; I'm getting into Java. I'm coming from C++ base and I wonder how can we use "const" parameters in Java? For example if I don't want the function to be able to change the value of a parameter, what do I do? [CODE]void modify(RefObject parameter) { parameter.set(new RefObject); //should … | |
Hey there; I'm having trouble with fork() and wait() functions. In the code below I'm trying to create a child process and first let the child process do its work then parent process finish execution. I use wait() function in the parent process but the output shows that child process … | |
Hey; I am trying to keep a data file but I'm getting confused with the sizeof(char) = 2 bytes. I understand that it is a unicode char but why does class BinaryReader's function ReadChars(int count) function just increases the streams position by count bytes ? If that is not clear … | |
Hey; I am developing a console game in C#. I wanted to create a file called "accounts.bin" to hold players accounts information. So when I try to create or access the file the program halts and throws an exception called "UnauthroizedAccessException". I tried to put the file into the "C:\" … | |
Hey; In my application I want to count number of seconds while the application is waiting for the user input. I think I should use another thread but I never worked with multithreading. Is there an easier way ? | |
Hey; I want to store string, ConsoleColor pairs like [CODE]dataStructure.Add(new KeyValuePair<string, ConsoleColor>("Red", ConsoleColor.Red))[/CODE] I tried List but it did not seem to work; [CODE] List<KeyValuePair<string, ConsoleColor>> colorList; colorList.Add(new KeyValuePair<string, ConsoleColor>("Red", ConsoleColor.Red)); colorList.Add(new KeyValuePair<string, ConsoleColor>("Yellow", ConsoleColor.Yellow)); colorList.Add(new KeyValuePair<string, ConsoleColor>("Green", ConsoleColor.Green)); colorList.Add(new KeyValuePair<string, ConsoleColor>("Blue", ConsoleColor.Blue)); colorList.Add(new KeyValuePair<string, ConsoleColor>("White", ConsoleColor.White));[/CODE] with the error … | |
Hey; I want to get into some game programming just for fun and to improve my C++ and software development experience. For now I developed some Console Applications as anyone would do. Now the question is this; do I need to know how to use WinApi or POSIX in order … | |
Hey; I want to be able to use VS2010 and still pass command line arguments to it somehow. When I am building an application that needs to use argv[], I need to compile it and run it from the command line. That is becoming boring sometimes especially when I want … | |
Hey; I am having problem with the read and write functions in fstream. They need to have a const char * to read or write from/to buffer. I need to work with integers. Here what happens: [CODE]for(int i = 0; i < numberOfValues; i++) { int random = rand() % … | |
Hey; I have an assignment but I'm having trouble because I don't know almost any assembly. I have figured out something but please help me if I have mistakes, and with the 3rd formula. Using knowledge from previous weeks, write assembly programs which calculate the given formulas: a)Sum (i=1 to … | |
Hey; I'm practicing with template classes. When I declare a user-typed destructor for this template class, the program freezes and needs to be closed explicitly. Obviously, in the destructor, I am trying to release the memory allocated to hold the coordinates[3] array. What is the problem with declaring a user-typed … | |
How is it possible to delete a byte ( char, int, double .. ) from a text file ? Suppose that the file.txt contains :"110Hello". And I want to delete "110" from the file leaving only the "Hello" part. How to do this without reading the whole file into the … | |
I want to write and read a Student struct to/from a file. The program works weird . Sometimes reads 52 elements, sometimes 1 element. I couuld not see what the problem is. Help please. [CODE]int main() { FILE *deneme = openBinaryFile("C:\\text\\text.txt"); Student me = {"Mert","Akcakaya",200611004, 0}; Student you = {"Default", … | |
Hello, I really wonder that is it possible to open any file and play with the data inside it using C/C++ FILE pointer. I'm taking a lecture called Data Management and File Structures and there we are working with text and binary files. So I decided to research and work … | |
I have a details view and SQL data source. In the details view i can fill the form and add the data to the database and then view this database in another page. I have a "Date" row in the details view where must insert the date info. I want … | |
I've been developing console applications using C/C++. I now want to move on and create some GUI applications. For that i saw some libraries to create GUI. I think those libraries are OS dependent. How can we create GUI applications compatible with Linux, Windows and Mac, or is it even … | |
I wonder why the following code work. In the debugger i see that every thing works fine but after the "root = createNode(item);" statement I can't see the new node assigned to root? [CODE]Node *insert( Node *root, int item ) { if(root==NULL) root = createNode(item); if(root->data>item) insert(root->left,item); else if(root->data<item) insert(root->right,item); … | |
I got some linker error, couldnt find the mistake. What is wrong? [CODE]#include "myStack.h" //Imports the Stack header file containing the declaration of the member functions myStack::myStack() /*The stack is initialized as empty */ { count=0; } //end of Stack::Stack constructor Error_code myStack::push(const Stack_entry &item) /*If the stack is full … | |
I have tried to implement a stack class but i got stupid errors. There is a stupid error i know but i couldnt find it. [CODE]#ifndef STACK_H #define STACK_H /*Manual implementation of Stack class. By this way it will be possible to learn the advantages of Stack data structure over … | |
Hello everyone, i was just trying something when i got the error. I debugged and it says string password <Bad Ptr> and that password string have more than lets say 100000 childs of characters in it. I used the string::resize() member function but it doesnt seemed to solve the problem. … | |
I cannot assign my rawWord value to the string array. The program reads a value from testText.txt and then edits it. Then this manipulated char rawWord[20]'s value must be assigned to the string array word[i]. When i debug i see that rawWord is edited correctly, but when it comes to … |
The End.