64,152 Solved Topics

Remove Filter
Member Avatar for
Member Avatar for nomemory

Hello, I am a python newbie and I am trying to accommodate to the basics. What's the python equivalent for the following Java snippet ? [B]Java:[/B] [CODE]public class Main { public static void main(String args[]){ int a,b,c; a= (int) (Math.random()*100); c=0; while((b=(int)(Math.random()*100))!=a){ c+=1; } System.out.println(c); } }[/CODE] I was trying …

Member Avatar for woooee
1
217
Member Avatar for S.A.H

hi every body , I want to write a program with vb.net about calculating the GPA in my program I'll ask the user to Enter the number of courses then I'll Generate ComboBox(s) by the number of courses ... So How can I do the dynamic Generate of the combobox …

Member Avatar for S.A.H
0
110
Member Avatar for necrolin

What's the difference between (aside from syntax I mean): a) typedef struct MyStruct{....}; b) typedef struct{...}MyStruct; I saw this example in "Thinking in C++", but there's no real explanation as to if they're exactly the same or if there's some real difference in them.

Member Avatar for necrolin
0
96
Member Avatar for metalla_nz

Hi all, XMLDocument.Load("http://ws.audioscrobbler.com/2.0/?method=artist.search&artist=Zlad!); If you open the link in FF it shows the error, IE seems blisfully unaware Its failing due to Last.FM outputting artist names with the wrongly encoded characters into the xml. This causes my C# app to crash. XMLException, invalid character How would I go about making …

Member Avatar for sknake
0
968
Member Avatar for patto78

Hi, the following project is the first small step in an anagram solver that I am coding. I have four letters "a", "b", "c", "d" and the aim of the following code is to produce all possible permutations of these letters, given that the first letter is always "a". (I …

Member Avatar for patto78
0
142
Member Avatar for brando|away

ok i'm working in visual studio. im working on an application with multiple forms, and im trying to access controls in form1, from the form2 class. Heres what im using now: [code] public partial class Form2 : Form { private Button btn1; public Form2(Button _btn1) { InitializeComponent(); btn1 = _btn1; …

Member Avatar for brando|away
0
139
Member Avatar for MattyRobot

I have recently learnt the basics of c++ but I want to advance to making proper GUI's (and games) but I don't know what to use. I think the two most popular libraries are OpenGL and Direct3d but I'm not sure which one to use. could you guide me in …

Member Avatar for MattyRobot
0
121
Member Avatar for papanyquiL

Hi everyone, I'm supposed to make a form with the basic shapes (circle, ellipse, pie, arc, etc...) drawn onto a panel. For each shape one will be hollow and one will be filled ontop of eachother. I can't seem to get the positions correct. All of the images are being …

Member Avatar for papanyquiL
0
309
Member Avatar for C#Beginner

I m a beginner trying to learn Visual C#(Visual Studio 2008). I was able to run a simple Visual C# program without errors. I was trying to look at the values of the variables in the DATA TIP in Break Mode.. by hovering over the variable. I have not been …

Member Avatar for C#Beginner
0
112
Member Avatar for SQL_n00b

What is the best way to update a record when 2 users of my site happen to edit it simultaneously? For example, assume the following scenario: Let's say users John Doe and Jane Doe log into my site and happen to view the below record simultaneously. --------------------------------------------------------------------------------- Bruce Wayne | …

Member Avatar for buddylee17
0
145
Member Avatar for Altairzq

Hello I'm using this code I got from an example: [ICODE] <head> <TITLE>Creating a link</TITLE> <SCRIPT LANGUAGE="JavaScript"> <!-- function createLink() { var szURL = prompt("Enter a URL:", "http://"); if ((szURL != null) && (szURL != "")) { document.execCommand("CreateLink",false,szURL); } } // --> </SCRIPT> </HEAD> <BODY> <H1>Creating a link</H1> Here's some …

Member Avatar for Troy III
0
2K
Member Avatar for SQL_n00b

Not quite sure whether this is a question for the server side programming forum or for SQL forum. Nevertheless, here it is: What is the best way to update a record when 2 users of my site happen to edit it simultaneously? For example, assume the following scenario: Let's say …

Member Avatar for sknake
0
149
Member Avatar for pw_jamison

so there isn't a way to run, say, a single method, as a specified user? where i'm coming from is... i want to create a directoryInfo list for a unc directory. i'm running the app as a non-admin user (eventually will be a service) but it's not finding the directory …

Member Avatar for sknake
0
381
Member Avatar for Loony064

Hey All I'm busy with a program in VB.Net 2008 that performs sales. When a user clicks on the Invoice button, a record with the details of the Transaction is addedd to the Transactions table in the back-end MS Access 2007 database. The Transactions table has the following fields: LogID …

Member Avatar for Loony064
0
99
Member Avatar for Phloxicon

This would be trivial but it comes with a serious catch - I can't edit the Unrelated or Friend class. I can't seem to access a private data member despite the friend relationship between the classes. Code: [url]http://pastie.org/613042[/url] [code=c] class UnrelatedClass { ... private: friend class FriendClass; float m_fNumber; } …

Member Avatar for Tom Gunn
0
285
Member Avatar for terdie

I recently posted a thread here but have different subject so I decided to make another. I have two questions 1.[B]]how can I deploy my application?[/B]there is a function Publish in visual studio but that didnt do the job(of maybe Im just doing it wrong).I have a database in my …

Member Avatar for DdoubleD
0
132
Member Avatar for Mongz

Im passing a query string from 1 page to many pages, the second page accepts the query string and pass it to the next page and so on. On the second page i accept the query string and it appear's on the url bar, that shows that the second page …

Member Avatar for sknake
0
189
Member Avatar for nunos

Hello. I have a (main) list of objects 'feedbacks' which have an 'order_id' and a 'message'. I have another list of simply 'order_id's whose correspondent object in the main list I would like to see removed. For example: main list: [object type 'feedback', object type 'feedback', object type 'feedback'] let's …

Member Avatar for nunos
0
344
Member Avatar for stoymigo

Hi, how can i export code snippets from VS 2008 that i created to a different computer. -Thanks

Member Avatar for stoymigo
0
149
Member Avatar for miac09

Hi all, I'm learning python and hope someone can help me with a sort of tricky search/parse problem. I have a tab deliminited file like this: 2 1 863.8 300.2 0.0131 0.0759 0.1727 0.0879 1.5821 3 1 874.5 289.5 0.0574 0.1292 0.4447 0.2258 1.1846 3 2 874.5 289.5 0.0573 0.0527 …

Member Avatar for jice
0
160
Member Avatar for davidjennings

Hi all, I am new to PHP Do I need to sanitize hidden data values in a form before carrying out the query on MySQL db. If so can someone assist me in the correct format The category_id is an INT and the make is a String. $category_id=$_POST['category_id']; $make=$_POST['make']; Also …

Member Avatar for davidjennings
0
152
Member Avatar for sudharani

Hi, I want to pass cid genarated in selling.aspx to orderform.aspx . How to retrieve the query string in orderform.aspx I gave the code below in selling.aspx [code]SqlConnection con; SqlDataReader dr; con = new SqlConnection("Persist Security Info=False;Uid=sa;Password=q1w2e3/;Initial Catalog=YOGADATA;Data Source=PC-1"); con.Open(); t=0; SqlCommand com = new SqlCommand("select * from Custlogin", con); …

Member Avatar for IdanS
0
144
Member Avatar for turbomen

Dear Sir, Please help me on Delphi. Could you tell me how can I do the following question? Calculate and display the sum of the even numbers from 2 to 20 inclusive. Cheers,

Member Avatar for EdFallon
0
229
Member Avatar for jrosh

I created a jar file using cmd prompt. when i run it using : jar cvfm <filename>.jar manifest.txt *.class gives the error: java.io.IOException : invalid header field.... Please help me to solve this...

Member Avatar for jrosh
0
144
Member Avatar for jrosh

I managed to create a <filename>.bat file using a jar creator . It also creates <filename>.jar file but when i click .bat file it says unsupportedClassVersionError: bad version number in .class file .jar file says could not find the main class... how can I overcome this???

Member Avatar for masijade
0
110
Member Avatar for littlewonder

hi, i get an error - 'incompatible types in assignment' for the following code [CODE] #include<stdio.h> int main() { char name[10]; name="Hello"; printf("%s",name); } [/CODE] Any help will be greatly appreciated...

Member Avatar for littlewonder
0
59
Member Avatar for ubi_ct83

i have loaded the string data from file to double array.this is example: const_array[1][]=a1,b1,c3, const_array[2][]=a2,b1,c3, const_array[3][]=a3,b2,c2, const_array[4][]=a2,b3,c1, const_array[5][]=a3,b2,c1, those data need to be compared to this string: append_test_data.this is also an array and it will be changed randomly by d program.the prob is,my prog just compare to the last data …

Member Avatar for ubi_ct83
0
617
Member Avatar for Diamonddrake

In my project I had been using a set of arrays to hold some data, realized it was a bad design, so then I decided to create an object that holds all the relevant data, and add them to an arraylist, this work great except all the data was information …

Member Avatar for Diamonddrake
0
195
Member Avatar for Frederick2

I have a general question about threads prompted by something strange I'm seeing in an application I developed involving ODBC access to Microsoft Access and SQL Server databases. Let me present the context of the problem first. I have been developing some tutorials on ODBC database access in two different …

Member Avatar for Frederick2
1
597
Member Avatar for KimJack

Hi all, I have a quick question. Is this a proper way of using blackbox testing to test the stringTokenizer class? If not, would you provide a proper example that displays the pass or fail. [code] string = "cat, dog"; StringTokenizer token = new StringTokenizer(string, ","); if (token.countTokens() == 2) …

Member Avatar for BestJewSinceJC
0
126
Member Avatar for sravan953

Hey guys, I am making a program called 'Weather Watch' which basically gets weather updates for any city you type in. For now, it only gets info for a particular city. I don't know how to search for the term entered in [url]www.weather.com[/url] and then get the updates. The code …

Member Avatar for EAnder
0
408
Member Avatar for ggl0rd

i got 5 textbox... 1st i click at textbox1, then i press tab key then he direct go to texbox4.. how i can setting for from textbox1 then press tab key he go to textbox2..

Member Avatar for juliusceasar
0
103
Member Avatar for EvilLinux

Hi, I've been working on this project I'm doing and its killing me because I can't figure why my array\formula's don't want to get along. Here is the general overview of what the project requires: Here the project: Operation • The user enters a score and clicks the Add button …

Member Avatar for EvilLinux
0
2K
Member Avatar for MattyRobot

how can I use a function inside an object? (the code is too long to put here but here's a replica) [code=c++] class example { public: example(); ~example(); void doSomthing() { afunction(); } } void afunction() { //do more things } [/code] in this example i wouldnt [B][U]NEED[/U][/B] to use …

Member Avatar for rughead
0
158
Member Avatar for neutralfox

Hello, Hope everyone fine over here. Well ... actually i am having some difficulties to choose my final year. I want to develop a desktop application. As i am in the network security field, i want to develop a keylogger software. I am new to vb.net and i dont know …

Member Avatar for neutralfox
0
195
Member Avatar for katwalatapan

Hello, I tried to compile a posix mq_send and mq_receive application. The msg is sent on the queue successfully, but during the receive part, an error occurs. I have attached the send and receive part of the code, please do suggest any corrections. mq_send [code=c] #include <mqueue.h> #include <stdlib.h> #include …

Member Avatar for Protuberance
0
1K
Member Avatar for arelius

Hello all, This shouldn't be too hard to answer. I have a bunch of folders, for example WarehouseApp, WarehouseLib, etc, were in each of these folders contains a project. Whenever I try to rename one of these folders that contains a project, I get the following error and the project …

Member Avatar for arelius
0
105
Member Avatar for JETFUSION

Hi there all, Could anybody please help me, as to why my program is not adding the right quantity's? [CODE]// Question 2a #include <iostream> using namespace std; int main ( ) { const int NR_SESSIONS = 3; int nrAttend; int votesForS, votesForR, votesForO; char vote; // Initialise totals votesForS = …

Member Avatar for tux4life
0
127
Member Avatar for valonesal

What I would like to do is return a basic text message if no results are returned from my database. Using the following code can someone tell me how I can accomplish this. Please excuse the code if its sloppy, Im a beginner at php. [CODE]<?php // create short variable …

Member Avatar for valonesal
0
143
Member Avatar for baudday

I would really appreciate help here. I think I'm just missing something small but I just can't figure it out. I have 2 questions about the following code: [CODE=php] <? if(isset($_POST['download'])) { $x = 0; $download_path = dirname(__FILE__).'/'; echo "<b>Downloading from $download_path:</b><br />"; $file = array(); while($x <= $_POST['download']) { …

Member Avatar for baudday
0
130
Member Avatar for marky-b

With the following code, the function only msgbox's "variable declaration" and "before for/each". i put them in there for debugging when i saw that my function wasn't getting all the way through. Any suggestions? [code=vb] Option Explicit Function ArrToCSV(ByVal array) msgbox "variable declaration" Dim strTemp Dim strQuote Dim x strQuote …

Member Avatar for marky-b
0
90
Member Avatar for Moirae

Hello, I've written a class, and I've created an instance. When I try to debug it gives me an error and I really don't understand what that means. I looked at some other web sites but I don't understand what do I have to do. Can somebody please help me? …

Member Avatar for sknake
0
1K
Member Avatar for andym67

This is driving me crazy and should be very easy. I am trying to pre-fill an html form with session data using echo. I can compile and run but the form field contains a / if the session data is blank. How can I get rid of the / Heres …

Member Avatar for andym67
0
17K
Member Avatar for sravan953

Hey guys, I have some code: [code='python'] import urllib2 as url import subprocess import os webs=open("url.txt",'r') read_webs=webs.read() def get_html(): try: req=url.urlopen(read_webs) res=req.read() return True except: print("<Error reading from the website>") def get_command(): if True: for x in res: if(x!='<'): command+=x else: break determine() command="" def determine(): format=command[len(command)-3:] print format get_html() …

Member Avatar for sravan953
0
156
Member Avatar for jonte

Hi, I´m new to Python and right now I´m trying to learn to parse a text. Here is my code (that doesn´t work the way I want) [CODE]text = ['Mary', 'went', 'out', 'at', '7pm', 'to','buy','some','candy'] keyPerson = ['Mary', 'Clark', 'Steven'] keyTime = ['7pm', '6am', '2pm'] keyThing =['candy','eggs','fruit'] list = [] …

Member Avatar for jonte
0
78
Member Avatar for katwalatapan

Hello everyone, I have installed Dev-C++ IDE on my system to run POSIX threads application. The program has compiled correctly. When I try to run the application, I am encountered with the following error Unable to locate component This application has failed to start because pthreadGC2.dll was not found. Re-installing …

Member Avatar for ajay.krish123
0
253
Member Avatar for singoi

Hi friends, i have a textbox where i have a path of the pdf file. now after pressing a cummand button i want this file to be opened. my code is as follows.. [I]Private Sub wazopen_Click() Dim myfol As String Dim myfln As String Dim myfpath As String myfol = …

Member Avatar for riteshbhushan23
0
180
Member Avatar for arelius
Member Avatar for jrosh
Member Avatar for majestic0110
0
122
Member Avatar for Cheeki

Hey guys, im having the weirdest problem with my ajax!! below is the function that is called when ever a if statement evaluates to true. Anyway the problem im having is that this if statement [code] if(xmlHttp.readyState == 4) [/code] with in the ajax functions runs when readyState is equal …

0
61

The End.