132,726 Archived Topics
Remove Filter ![]() | |
Let's say we want to free the total memory used by a linked list in a program, I generally do it like this [CODE]typedef struct linked_list { int some_data; struct linked_list *link; }NODE; int free_memory(NODE * head) { NODE * temp = NULL; if(head == NULL) return 0; // FAILURE … Software Development c linked-list | |
Hi there, I'm putting together a simple client and server to receive packets containing video data. Here is the part where data is read. The data packets contain typically around 1000 - 1500 bytes of data. [CODE] int getNoPackets = 0; int packetsWrittenToFile = 0; for (i=0; i<NPACK; i++) { … Software Development c client-server file-system | |
hi, with this code fragment: [CODE] #include <stdio.h> void print_bit_string(char x) { int s = 128; for (int i = 0;i < 8;i++) { printf("%d",x & s? 1: 0); s >>= 1; } printf("\n"); } char abs(char x) { if (x < 0) { x = -x; } return x; … Software Development c | |
Hi friends, This is not java technical question. I am doing project java thats why i am posting here. I am doing project for SUMMARIZATION OF DOCUMENT. I finished 90 percent of my project. To test my project i need Data Set ( That means, Document with summarization ) . … Software Development java | |
Hi, unsurprisingly this is my first post :) I want to learn C# mainly to support work in Excel and I was wondering what development tools I need. There are so many variations from MSDN to Visual Studio Standard and others. I am a competant programmer in other (some odd) … Software Development c# visual-studio | |
Hello I'm making an GUI app to open a image and zoom it. This function is used to open the image & display it: [CODE] def file_open(self): filename =askopenfilename(filetypes=imageTypes) image1 = ImageTk.PhotoImage(Image.open(filename)) self.canvas.config(height=image1.height(), width=image1.width()) self.canvas.create_image(2, 2, image=image1, anchor=NW) self.image = image1 self.img_zoom(image1) # passing image1 to img_zoom function[/CODE] The image … | |
i coding these line ... it is working fine.... but what i need is compress that [COLOR="Red"]Bufferedimage [/COLOR] before getting it as [COLOR="Green"]Raster[/COLOR] i tried jpeg compreesion but it return bytestream instead of int.. so i got exception "can't cast BufferdByte as BufferedInt"... [CODE] [COLOR="Red"]Bufferedimage [/COLOR]image=robot.createScreenCapture(new Rectangle(width, height)); ////here i … Software Development java | |
Hi, I'm writing a small program to simulate a projectile moving through air in a gravitational field. I have several classes for vectors, the gravitational field, and the projectile itsself. However, when constructing any of these objects in the main method, I get a "cannot find symbol" error, despite the … Software Development java | |
Once again, I'm stuck on a wx.python issue with regards to the floatcanvas. So... I have a script that erases and redraws an image in the canvas, based on changes made to two slider widgets (sldMFI, sldIDT). Before it redraws, I'm trying to define the current zoomed view as the … Software Development python | |
For reading from an xml file, [CODE] char s[6]; ifstream x("output.xml"); x.getline(s,34); [/CODE] char s[6]; I don't want to specify the maximum number of characters in 's'.So,I tried to use string s instead,but getline only takes character arrays. When I used char*,it said,The variable 's' is being used without being … | |
| |
is it possible to write a program for selected files copying to CD using VB6 Software Development visual-basic | |
Dear ALL, Hi. Long time no see. How are you? I have come back to Programming class already. Could you tell me how can I start to VCL Forms Application if I use Delphi6? Cheers, turbomen Software Development pascal | |
hi !!! I am making a window application in which I want tree view in left panel .For each nodes (the nodes here are outlook messages stored in a vault,) click I want the corresponding outlook message to be displayed in right panel . The outlook message in the right … Software Development | |
When I debug my program, I get this error: Unhandled exception at 0x004d2776 in engine.exe: 0xC0000005: Access violation reading location 0xccccccd0. This is the stack trace: [code]> engine.exe!CEntityController::SpawnEntities() Line 18 + 0x24 bytes C++ engine.exe!CEntityController::Start() Line 50 C++ engine.exe!DarkGDK() Line 21 C++ engine.exe!_WinMain@16() + 0x13 bytes C++ engine.exe!__tmainCRTStartup() Line 263 … Software Development c++ | |
Hi All, I am working on application where i need to read flatfile and then i need to transform using XSLT to another flatfile.How can i achieve this. I am also thinking when we use XSLT 1.0 we can load XML in DOM and validate in SOM aganist schema and … Software Development xml | |
Hi all, In my program I need to create 2 log files, success and error. But I need to create either one of them, depending on the out come of the program execution. In other words, if program fails for any reason, I need to create the error log file … Software Development java | |
Hello! I am about to load details from a file and save it to a node. I am having an error regarding to a certain code. Here's the code:: [CODE]boolean loadFromFile(String filename) throws Exception{ boolean b = false; try{ FileInputStream myfile = new FileInputStream(filename); ObjectInputStream in = new ObjectInputStream(myfile); do{ … Software Development java | |
Hello here i am posting the non recursive or no recursion implementation of outputting [B]Permutations of a string [/B]as compared to the recursive implementations previously posted. Any feedback, constructive criticism or comments are most welcome. Software Development c | |
Could somebody please help me with this program. This is my first time working with an EOF loop. This program simply adds up all the input numbers. My task is to have the last wanted input terminated by an EOF. However, when I run my program, my loop is infinite. … Software Development c | |
HI, Can any one know how to convert byte array into char array. For example : byte buf[]=teststr.getBytes(); Note: buf is byte array. I need to convert this into char array. Software Development java | |
Here's a code from the C# Windows Form [CODE] SpeechSynthesizer audio = new SpeechSynthesizer(); audio.Speak(textBox1.Text);[/CODE] - This will read anything that is in the textbox [B]Problem in trying to implement the pause and stop feature.Any button or menuitem doesnt get clicked when the code reads something [/B] [CODE]public void button1_Click(object … Software Development audio | |
Hello I am learning Java at my spare time as a hobby. It only been a week and at the moment I am trying to get my head around the following things fields, constructor, accessors etc. There is an exercise which I ma having trouble with: [U]Human [/U] 1. Create … Software Development java | |
i have a problem with a program which gets a matrix[3][3] (with values 1-20.) i want to print the index of cells whose surrounding cells all have lower values. in a matrix 0 0 0 0 1 0 0 0 0 it supposed to print only [1][1]. can someone look … Software Development c | |
Hello, I am still a newbie in python. I am trying to slice a string, but I don't know how. [code] def start(): exp = "1+2"; string1 = exp.split("+"); print exp; print "Operator 1 is : " , op1; print "Operator 2 is : " , op2; [/code] I want … Software Development python | |
I Use visual Basic 8.0 and Mysql 5.0 I have one Table1: Table1: RecordID , Integer = primary key auto_increment NOT NULL Articlenr , Integer Articlename, Char(20) Table1: has nine records: RecordID, Articlenr ,Articlename 1 , 1100, Hamer Big Red 2 , 1110, Hamer Big Blue 3 , 1120, Hamer … Software Development vb.net visual-basic | |
I am trying to figure out how to check for carriage returns in a string. I am reading file contents into a string variable, and need to check if x0D is present (carriage return). I have tried indexOf and matcher so far with no results. Any input would be helpful. … Software Development java | |
Hello, following decription is very easy. I have a class UC_Main with constructor where I create EventHandler for SelectionChanged event in MainUCGrid control which is standard DataGridView. MainUCGrid control is part of UC_Main class. [code=c] public class UC_Main : UserControl { public UC_Main(Evidence.Nodik nod, DataView columns) { Initialize(); MainUCGrid.SelectionChanged += … Software Development | |
I'm currently working on a project that requires me to store usernames and passwords into a text file, what i've got so far is that i'm able to write to the text file by using this [CODE] //string path = "C:\\Documents and Settings\\100000001791\\My Documents\\Visual Studio 2008\\Projects\\SmartDeviceProject1\\SmartDeviceProject1\\bin\\Debug\\usernames.txt"; string path = "\\Temp\\users.txt"; … Software Development visual-studio | |
Hi Experts, I use Visual Studio 2005. I want to retreive data into textboxes providing inputs at runtime. I used the following code.It works when if i provide input at design time but while providing the input at run time the following error message gets displayed. "Syntax error converting the … Software Development c# dataset display visual-studio | |
can anyone help me initialize this array with nested for loops? [CODE] char board[3][3]; board[0][0] = '1'; board[0][1] = '2'; board[0][2] = '3'; board[1][0] = '4'; board[1][1] = '5'; board[1][2] = '6'; board[2][0] = '7'; board[2][1] = '8'; board[2][2] = '9'; [/CODE] Software Development c++ | |
So I have to create a method that creates a custom arrow object and then returns it. No drawing is to be done in the method, it will be drawn once it's returned. I think I'm utilizing GeneralPath the correct way and then casting it to a shape properly but … Software Development java | |
Has anybody ever used py2exe and wxPython together? I have no idea what i'm doing (as usual) and would appreciate it if anyone could walk me through the process or point me to a tutorial online. All the tutorials I've seen (which isn't many) don't make much sense to me. … Software Development python | |
I am trying to insert elements in a binary search tree.I am getting the following errors: In member function 'void bst::insert(char*)': error: cannot convert 'char*' to 'node*' in assignment error: cannot convert 'node*' to 'const char*' for argument '1' to 'int strcmp(const char*, const char*)' In function 'int main()': error: … Software Development c++ | |
Hey all, I'm trying to read through a code written by a colleague last year in which he used the BioPython package. The package is no longer on my computer, and I have to wait for the systems admin to update it; thus, I'm forced to merely read the code. … Software Development python | |
hi all... how can i use TestChanged event of a text box in vb.net... do i need to use any javascript or some other scripting language for same? thanks Software Development vb.net | |
Does anyone know how to do this: I need to read data from a .txt file into a multidimensional array that is dynamically allocated from memory. How would one do that? Thanks to whoever can help me! Software Development c | |
Hello i'm getting a segmentation fault in my is_validport() function and could somebody people point out what i'm doing wrong please? [CODE]#include <stdio.h> #include <stdlib.h> #include <stddef.h> #include <ctype.h> #include <string.h> /* Function definitions. */ //char *is_uid(char *s); char *is_destportseq(char *s); char *is_destport(char *s); char *is_validport(char *s); char *trimwhitespacestartandend(char *str); … Software Development c | |
I want to take infinite number of strings using string class. Why string operator is not working in the following program? it is showing... error: no match for 'operator!=' in 'str != -0x000000001'| [CODE] #include<iostream> #include<vector> #include<string> using namespace std; int main() { vector<string> s_v; string str; for( ; ;) … Software Development c++ | |
Hi, I would like to get the following script to work. The script should search for file that are bigger then 200 and that have been created or modified today! The problem is the comparator == does not work! when i compare the ( $6 == $dat ) i don't … Software Development shell-scripting | |
[CODE] Imports HR.EZTwainLibrary Imports System.Runtime.InteropServices Public Class frmNewScan Private Sub btnSource_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSource.Click If EZTwain.IsAvailable Then 'if TWain services are available EZTwain.SelectTwainsource(Me.Handle) 'select Twain source Exit Sub Else MsgBox("Twain not avaialble.", MsgBoxStyle.Critical) End If End Sub Private Sub btnAcquire_Click(ByVal sender As System.Object, ByVal … Software Development vb.net | |
i would like to ask how to change the row color in datagrid. this is my codes. that if my stock is < 10 the row with < 10 stock will turn in RED color. [code] If Val(medstocks.Text) < 10 Then MessageBox.Show("Medicine is running out of Stocks!", "WARNING", MessageBoxButtons.OK, MessageBoxIcon.Warning) … Software Development | |
[CODE]#include <iostream> #include <ctime> using namespace std; class Fraction { private: int Num; int Denom; public: void Reduce(); //will reduce the fraction to lowest terms void AddFraction(); //will add the two fractions together void print(); //will print the fraction in the form: numerator / denominator }; void Reduce(int &Num, int … Software Development c++ | |
I have two ever evolving variables that I want to compare. Call them x and checksum. If the two variables are within 100 of one another for example, everything is fine. But if the margin is greater than 100 I would want it to throw up an error. How would … Software Development c++ | |
How is it possible that my program asked to cout a bool variable writes 104 on the display? Even if the variable wasn't initialized, it should display 0 or 1 I thought? Another thing is that it seems to be initialized and to go wild at one moment. Software Development c++ | |
Hi all, I am pretty much new to Java (I've had experience in C++) and have been working on a "simple" FTP client. I pretty much ended up with the code below. Problem is I get a lot of errors mostly related to the IOException in each method. The errors … Software Development apache client-server java | |
hey guys, i am trying to create a simple menu using canvas for example [CODE] class Name extends Canvas{ MenuItem menuitem; public Name(){ JPanel panel = (JPanel) container.getContentPane(); panel.setPreferredSize(new Dimension(800,620)); panel.setLayout(null); setBounds(0,0,900,600); panel.add(this); setLocation( 0, 20 ); MenuBar menuBar = new MenuBar( ); Menu menuFarm = new Menu( "About" ); … Software Development java | |
hey guys..ok so i did this problem about 80% but i cnt figure out the last part[I] which is sort the characters in order of increasing size. [/I] [B]Question:[/B] Input: 4 words (strings with no spaces) and the order in which they are to be displayed, forward alphabetical, reverse alphabetical … Software Development c++ |
The End.