43,549 Solved Topics

Remove Filter
Member Avatar for
Member Avatar for sneekula

I need to read in a text file, replace selected words and write the changed text back out to a file. Is there an easy way with Python?

Software Development python
Member Avatar for halamas
0
20K
Member Avatar for cozmo87

Hi guys, I'm making a class for importing a table from a text file with tab delimited data. It works perfectly as long as there are no empty cells in the text file. (see attached example) Any suggestions how to detect an empty cell and what to fill the ArrayList …

Software Development java
Member Avatar for JamesCherrill
0
110
Member Avatar for ktsangop

Hi everyone! I am using a dll to hook keyboard strokes for my application. The hook works fine, but now i want to disable some keystrokes while my application is running. So i did the following : [CODE]_declspec(dllexport) LRESULT CALLBACK KBHookProc(int Code, WPARAM wParam, LPARAM lParam) { if (Code < …

Software Development c++
Member Avatar for ktsangop
0
1K
Member Avatar for mrbungle

So I have a text box in a form. The test box needs to take the value entered and insert it into a column within a row in MySQL. I know it's connecting to the MySQL online, I have a message box telling me so upon a successful connection. I'm …

Software Development mysql vb.net
Member Avatar for mrbungle
0
272
Member Avatar for MagnetoM

I would like to learn java. Can anyone recommend an up to date java book. There seems to be many java versions, if that is the correct term of course, such as jdk 5, jdk 6 etc. Which one is good to learn. I posted this in a different thread …

Software Development java
Member Avatar for pro_learner
0
110
Member Avatar for debasishgang7

Hi all, I am trying to send Binary data using In python raw socketusing socket.send(). For that i will do following. [CODE]s = '\x01\x00\x12\x59' # some binary data sock.send(s) # assuming "sock" is a valid, open socket object[/CODE] i have created a DATAGRAM in HEX in by sniffing a network …

Software Development python
Member Avatar for debasishgang7
0
1K
Member Avatar for SakuraPink

Hi everyone, I have a text file which looks like this: [CODE] ( 3,3,0 ) 0.9984104 0.000503 ( 3,3,1 ) 1.000613 0.000484 ( 3,3,2 ) 1.001192 0.000571 ( 3,3,3 ) 1.002418 0.00063 ( 3,3,4 ) 1.003345 0.000583 ( 3,3,5 ) 1.000215 0.000512 ( 3,3,6 ) 1.000911 0.000537 ( 3,3,7 ) …

Software Development shell-scripting
Member Avatar for Aia
0
319
Member Avatar for mohana88

When I try to add a dll file into my project the following error occurs : A reference to dll could not be added. Please make sure that the file is accessible and that is a valid assembly or COM component. But I have imported the dll file using DLLImport …

Software Development assembly
Member Avatar for mohana88
0
8K
Member Avatar for jadzrev13

Hi, I am making an student registration program as my project in school. But I had some problems making it. Our professor asked us to make an program where there are lists of subjects offered. Then the student will choose what subject/subjects he/she likes, then it will be computed. The …

Software Development c++
Member Avatar for jadzrev13
0
3K
Member Avatar for jemz

Hi, Hello can you help me please how can i make a refresh button so that i will never close the program if there is update in the data to be made in other computer... example if two computers or more..have installed the program and if one computer is making …

Software Development visual-basic
Member Avatar for PinoyDev
0
283
Member Avatar for Fritz.fx

Hi All. I'm hoping somebody could help me out with this little problem I'm having, I've been at it for 8+ hours so far and just can't nail it. The 2 blocks of code below I'm using to log into a fresh install of phpbb forums, and they work just …

Software Development php phpbb
Member Avatar for Fritz.fx
0
453
Member Avatar for thecoolman5

hi, i am writing a program that keeps track of the money in my debit card account. i need the program to be able to pull out a value (such as 1.56356) from a text file, round it to the nearest hundredth, and put it back into the file. any …

Software Development c++
Member Avatar for m4ster_r0shi
0
467
Member Avatar for Graphix

Hi, At the moment I am trying to open a log file with notepad.exe while the original process continues. As I am developing for Windows, fork() is not available for me. I googled alot and found a good reference to opening processes ([url]http://www.yolinux.com/TUTORIALS/ForkExecProcesses.html[/url]), however they all put the original process …

Software Development c ide
Member Avatar for Graphix
0
266
Member Avatar for kapojian

how can you remove the excess width in may datagridview??? after that long blank space theres another field.. as shown in the image.. my code goes something like this [CODE]//create a command builder OleDbCommandBuilder cBuilder = new OleDbCommandBuilder(dAdapter); //create a DataTable to hold the query results DataTable dTable = new …

Software Development
Member Avatar for kapojian
0
211
Member Avatar for gujinni

thus iterators predefined functions? I am confuse between function and predefined functions.

Software Development algorithm c++
Member Avatar for gujinni
0
105
Member Avatar for SakuraPink

Hi there, Here is the problem: I have a Text file with several hundreds of lines and I want to store line 100 to 200 in another text file. I wrote the following piece of code but result is all of the lines not just the ones that I need. …

Software Development shell-scripting
Member Avatar for SakuraPink
0
246
Member Avatar for magnetic rifle

Hello, Is there someway that I can randomly assign an x y and z axis to a geometirical object? Any programming language is fine just need some insight. Thank you, Suhail Rawal

Software Development java
Member Avatar for sirlink99
0
84
Member Avatar for pseudorandom21

Hi, I'm trying to display a message in the compiler output using VS2010. In C/C++ we can use:[icode] #pragma message(">> Win32 <<") [/icode], but for C# I'm not really sure what options are available.

Software Development display
Member Avatar for shajis001
0
157
Member Avatar for magnetic rifle

Why do I get: Traceback (most recent call last): File "./2csvtbl.py", line 31, in <module> print row[k], row[-k] IndexError: list index out of range after running this code: #!/usr/bin/env python import csv import random alpha = 'abcdefghijklmnopqrstuvwxyz' e = range(0,99) x = random.sample(alpha,14) y = random.sample(e,14) c = csv.writer(open("test2.csv", "wb")) …

Software Development python
Member Avatar for griswolf
0
144
Member Avatar for reza.adinata

Hi, I am starting to learn C programming. I recently stumbled across a structure below #include <stdio.h> #include <stdlib.h> [CODE] #include <stdio.h> #include <stdlib.h> typedef struct { int value; } fteid_t; typedef struct { fteid_t *fteid; // Optional Ins 0 } context_t; typedef struct { context_t default_bearer; } send_request; [/code] …

Software Development c
Member Avatar for reza.adinata
0
115
Member Avatar for jemz

Hello,,, Hi,can you help me please i apologize if i post here.I don't know if i get the right forum to post.... Here is my problem in the IBM DB2 i created the database and i have 4 tables,but the problem is i forgot where did i make the foreign …

Software Development
Member Avatar for dnmurphy
0
136
Member Avatar for magnetic rifle

Hello, I have this code [CODE]#!/usr/bin/env python import csv import random alpha = 'abcdefghijklmnopqrstuvwxyz' e = range(0,99) x = random.sample(alpha,14) c = csv.writer(open("test2.csv", "wb")) c.writerow([x]) cr = csv.reader(open("test2.csv","rb")) for row in cr: print ', '.join(row) print "How many rows?" l = input() k = 1 while k < int(l): y …

Software Development python
Member Avatar for magnetic rifle
0
9K
Member Avatar for Jessurider

can anyone tell me how here the count of [B]st[/B] is [B]incrementing[/B] like this[B] 2,4,6,8,10 and not like 1,2,3,4,5 [/B] how could i get the count of [B]st[/B] to increment as [B]1,2,3,4,5[/B] [CODE] PrinterJob printJob = PrinterJob.getPrinterJob(); Book book = new Book(); for(int i=0;i<5;i++) { book.append(new IntroPage(), printJob.defaultPage()); } [/CODE] …

Software Development java
Member Avatar for Jessurider
0
282
Member Avatar for Netcode

Hello everyone! I want to write my connection strings and functions in a class and always call the class when i need to make a connection to my database to avoid code repetition and increase code reuse but i have an error. Here is my code below [ICODE]Public Class ConnectionString …

Software Development vb.net
Member Avatar for Netcode
-1
89
Member Avatar for dangari

My java application has been running smoothly for the last 2 years in one linux server. Recently, we moved it to another linux server and it's then that it started giving the error as shown below: [CODE] java.sql.SQLException: Prepared statement needs to be re-prepared at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:946) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2870) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1573) …

Software Development java
Member Avatar for dangari
0
3K
Member Avatar for DarkPyros

Hey, this code accepts data (type int) into a 4 by 4 array. im using 1234 as an example when entered, the data would be stored as: 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 the code the rotates it once to …

Software Development c
Member Avatar for DarkPyros
0
168
Member Avatar for hughesadam_87

Hey everyone, I'm getting familiar with TkInter, and while it's a cool program, I'm having a hell of a time with keeping all the classes straight. As of now, I'm trying to build a program with a menubar and some other widgets. I can get the program working if I …

Software Development python tkinter
Member Avatar for hughesadam_87
0
217
Member Avatar for Joshua Kidd

Hello, I'd Like to do the Same thing as in this post I posted a while back. But in a Listview Control [url]http://www.daniweb.com/software-development/vbnet/threads/369754[/url] But there is no Selected rows... There is an Item Active But that did not work. And I cant find this anywhere else. Can someone help? Thanks, …

Software Development listview vb.net
Member Avatar for Unhnd_Exception
0
92
Member Avatar for Roy Gourgi

Hi, I have a table with 10,000 records but I only want to read 250 at a time. I know the row number of the 250 records that I have to read and so I want to avoid reading all 100,000 records each time. For example, if I want to …

Software Development open-source
Member Avatar for sknake
0
216
Member Avatar for icehiro

I'm quite new to programming and I've just started Java, I'm not sure about why my program is stuck in a loop - [CODE] import java.util.Scanner; public class Tplayer { static int numplayer; static int startvalue; public static int dice1; public static int dice2; public static int bet = 20; …

Software Development java
Member Avatar for sirlink99
0
167
Member Avatar for Fa3hed

Hello Everybody prop lame i am making a access sql helper and for writing the insert this code [CODE] Dim i As Integer TextBox6.Text &= "Insert Into " & ComboBox2.Text & " (" For i = 0 To ListBox1.Items.Count - 1 TextBox6.Text &= ListBox1.Items.Item(i).ToString() & "," Next TextBox6.Text &= ")"[/CODE] …

Software Development vb.net
Member Avatar for adam_k
0
137
Member Avatar for zifina

is there a way to have the text in a label scroll horizontally,if the text do not fit into the label... please help...

Software Development c#
Member Avatar for zifina
0
3K
Member Avatar for kapojian

in my access database the column "foods" has multiline text..but when i view it in datagridview in my c# form it only has single line text,,, the width and height in datagridview is not the same as in my access database... my access database looks like this [U]|primary key|[/U][U]|foods|[/U][U]|servings|[/U] 00000001 …

Software Development microsoft-access visual-studio
Member Avatar for kapojian
0
152
Member Avatar for Valiantangel

Hi can someone help in in understanding the following code esp the "?".I cant understand how the output 9:10:5 as obtained. Thank You. The code is as followed: [CODE]#include <iostream> using namespace std; int main() { short hour =9, minute =10, second =5; cout << (hour <10 ? "0":"" )<<hour<<":" …

Software Development c++
Member Avatar for Narue
0
168
Member Avatar for NvIs

Ok This is my first post on this forum, and would really appreciate some help on an assignment... I have a 2d array and I need to add up all the numbers within the rows and the columns of the array. I'm really not to familiar with arrays or for …

Software Development c++
Member Avatar for PCSO
0
4K
Member Avatar for Weliaz

Hey there DaniWeb! I have a bit of a problem! I am in need of a way to get the size of a remote file, without download the file itself (so that i can show download status in a status bar) is this even possible? Thank you a lot, Weliaz …

Software Development vb.net
Member Avatar for Weliaz
0
957
Member Avatar for Voldemort2

I need to parse a csv file, whose encoding format is in utf-16 format. Actually the csv file contains the list of directories to the file. for reading i used following code BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(str))); But the output i got is not in the correct format …

Software Development java
Member Avatar for NormR1
0
922
Member Avatar for sandman64

I wrote a program that solves graphing programs. I am still very new to c++ and mt program is very very rough around the edges but my main problem is when the function returns the value to the main function it outputs random numbers in stead of the correct value. …

Software Development c++
Member Avatar for L7Sqr
0
184
Member Avatar for Graphix

Hi, Recently I started working on a project (it's called 'fd') that needs to retrieve the current processes running. It is written in C using the WinAPI. I am running Windows XP SP3 and am using MinGW compiler with Code::Blocks. After much searching I found the PSAPI to provide the …

Software Development api c linked-list
Member Avatar for m4ster_r0shi
0
941
Member Avatar for kapojian

ist possible to have another if statement after the first if statement.. this is just an example [ICODE] private void button_click(object sender, eventargs e) try { if(age>5||age<=10) {massagebox.show("young");} else if(age>10||age<20); messagebox.show("example"); } catch(exception) messagebox.show("error"); //can i have another if statement here??? if(something ==eg) {messagebox.show("thanks"); } [/ICODE]

Software Development
Member Avatar for Momerath
0
108
Member Avatar for piethon

I am a beginner in learning Python and I am currently reading "Learning Python the Hard Way." In one of its exercises, there's a code that says: [CODE]def bear_room(): print "There is a bear here." print "The bear has a bunch of honey." print "The fat bear is in front …

Software Development python
Member Avatar for GreenDay2001
0
1K
Member Avatar for sirlink99

I am going to make a calculator and I am having some Issues arranging the buttons. You should be able to see the layout when you run the code. Some clarification though there will be a blank spot under the "3" for a "+/-" button (switches between positive and negative). …

Software Development java java-swing
Member Avatar for Ezzaral
0
169
Member Avatar for mikedeomon

The code below works but does not loop through each name in the txt file (loops only when i just want to print their names from the text file) , it only returns the details of the last user in the list rather than returning individual user details one by …

Software Development api python
Member Avatar for woooee
0
198
Member Avatar for sirlink99

I am learning C++ and I learned that you can create your own types. I decided to try this in java. I am wondering if there is an easier way to make a bunch of variables private other then typing out private for each of the created variables. for example …

Software Development java
Member Avatar for sirlink99
0
119
Member Avatar for gujinni

anybody know how to explain this??? set_difference(a.begin(), a.end(), b.begin(), b.end(), result.begin()); std::=is this algorithm??? how thus this code work??? vector<char>=how vectors work??? cassert=how thus this work??? back_inserter(setDifference)->i don't know how this code work???

Software Development algorithm c c# c++
Member Avatar for gujinni
0
270
Member Avatar for zifina

I HAVE A PRINT BUTTON IN MAIN FORM. THERE ARE many child forms.when we click the print on the main form, it has to print the details in the form that was open previously (because,when we click the print button,the main form gets focus.So,the form to be printed is actually …

Software Development c#
Member Avatar for zifina
0
133
Member Avatar for jdstone550

Can anyone see why the function "option3" isn't calculating the values for pmt and totalRetirement? The program runs, but I get 0's for those values. If I remove the function and place the code directly into the case option, the calculations work. [CODE]#include <iostream> #include <string> #include <cmath> using namespace …

Software Development c++
Member Avatar for jdstone550
0
100
Member Avatar for gujinni

Anybody know how to remove the duplicate characters in turbo c++. the output is like this: enter string1:abc enter string2:bcd result:ad

Software Development c++
Member Avatar for theguitarist
0
266
Member Avatar for rhuffman8

I am still relatively new to Python and don't think I'm familiar/comfortable enough with my understanding of the datetime functions... I want to take just the current month from the datetime function so I can use the number to send the string of the month (ex, datetime would give me …

Software Development python
Member Avatar for griswolf
0
201
Member Avatar for zifina

hi all, i have forms with 2 or more tab pages in them. i would like to know how can we open or display "tabpage1", when we click a button "btn"in "tabpage2"... please help me..i need a reply soon.. thanks all..

Software Development c#
Member Avatar for zifina
0
94

The End.