64,152 Solved Topics
Remove Filter ![]() | |
Hello all, I'm pretty new to coding and I'm having a little trouble in reading a list to an array from a txt file. What I'm trying to is write 24 words from a txt file to an array and then use a number to select one at random (It's … | |
I usually make a matrix like this [code] from Numeric import * A=zeros([3,3]) print str(A[0,1]) #access an element [/code] I would like to store a pair of values in each element, that is have a matrix where the (0,0) element is (2.3, 2.4), the (0,1) element is (5.6,6.7), etc. Is … | |
# include <iostream> using namespace std; int main() { char places[3][11]={"London", "Birmingham", "Glasgow"}; char *p; cout<<places[2]<<endl; p=places[0]; cout<<p<<endl; cout<< &p[2]<< endl; <------ cout<< p[11]<< endl; <------- return 0; } the output is the following Glasgow London ndon B what i dont get is how the 3rd and 4th output line … | |
![]() | Hi all! I'm trying to implement a small program to test an API I've been provided, and since it's my first approach to C++ under Windows, I could use some help. I have this type definition: [CODE=CPP]typedef struct { const WCHAR* streetAddress; const WCHAR* city; const WCHAR* state; const WCHAR* … |
[code] struct players { string team_name; string driver; string navigator; double best_time; } world[32]; [/code] I am generating random values for the best time and using a bubble sort in ascending order for the best time. See below. How do I sort for best time but retain my team name, … | |
Hello, I am very new to JSP but I am familiar with Java. I am having an issue with some error messages I don't understand. when I use this syntax: [code=jsp] <jsp:useBean id="search" class="search.SecSearchParams" scope="request"> <jsp:setProperty name="search" property="*"/> </jsp:useBean> [/code] I get this error: The value for the useBean class … | |
pliz help ma have this code but it doesnt delete records ,am tuck what could be the problem,thanks here is the code <?php require_once('Connections/Database.php'); mysql_select_db($database_Database, $Database) or die("Unable to select database"); $aa=$_POST['pnum']; $bb=$_POST['dnum']; mysql_query("DELETE FROM doctor WHERE dID='$aa'"); $checkresult=mysql_query($query) ; if ($checkresult) echo 'delete query succeeded'; else echo 'delete query … | |
Nothing happens when i select a feed.. can you help me figure out what's wrong/missing? [code] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>RSS Reader</title> <script type="text/javascript" src="jquery-1.2.6.min.js" charset="utf-8"> function get_rss_feed() { $("#feedContent").empty(); $.get('http://barbz.0fees.net/proxy.php?url='+$('#diffFeeds').val(), function(d) { $(d).find('item').each(function() { var … | |
Can anybody tell me.How should i get value on the basis of combo box.i simple want when user click one of the productname from the combo box other corresponding fields from the database should come in the text box of the form.Here is the code what i have written.kindly help … | |
Hey Hii .... I am solving this problem from last 2 days.... but unable to find solution. What i am doing is ..... On click of submit button i want to send email and i am taking client to paypal page to do the payment..... i. e. i want to … | |
Hi!! How can i change the field names dynamically? eg i have a radio button depending on whose choice i have to make another field mandatory, if Yes. Field one is mandatory Else Field one is optional. For a mandatory field i have the validation funciton as well, that it … | |
A DELETE statement requires an exclusive lock on a table.If there are a significant number of deletes while simultaneously there is also a lot of SELECT traffic, this may impact performance. One trick that can be used is to turn the delete into an insert! Consider the following example: [B]CREATE … | |
hello . I am trying to simulate the MD5 hashing algo. My code: [CODE] private void jButton1MouseClicked(java.awt.event.MouseEvent evt) { try { MessageDigest object = MessageDigest.getInstance("MD5"); String str = jTextField1.getText(); byte arr [] = str.getBytes(); object.update(arr);//update the md5 object with the message arr = object.digest();//calculate the digest str = IntegerToHex(arr);//convert to … | |
Hi, Can somebody let me know how to check whether particular network drive is mapped or not e.g x:\\share1\share2? Regards, Rana | |
The following is a simple program on 'while ... do': program dowhile; {$APPTYPE CONSOLE} uses SysUtils, Ourcrt; Var my_words: string; begin [COLOR="Green"] my_words:=''; writeln('Enter some words (type "stop" to finish):'); readln(my_words);[/COLOR] while (my_words<>'stop')do begin clrscr; writeln('You typed:'); [COLOR="Red"] writeln(my_words); writeln; writeln('Enter some words (type "stop" to finish):'); readln(my_words);[/COLOR] end; end. … | |
Hello, When the JS file is not working at the time of Ajax files is called. on first time the onmouseover JS is working but , if you call the ajax JS is not working. | |
hi, if I had: [code=C++] char* arr; [/code] and want to add character one by one into [B]arr[/B]. How could I? I don't wanna use vectors! thanks | |
this is giving me an error at the line that says loc = (zip.find("605", 0)); can't tell why?!? [CODE]void calcShippingCharge(string zip, int RATE605, int RATE606, int &chg) { //search zip code for proper prefix int loc = 0; loc = (zip.find("606", 0)); if (loc >= 0) chg = RATE606; else … | |
Hi I will explain what I am trying to do: I have used MYPHP admin to create a database where user booking details will be stored in a table called bookings. Now I need to retrieve all the bookings for a specific date. For achieving this I have created two … | |
I have a very hard programming challenge and i need help... I have nothing so far, so im hoping somebod could help me build it... Im to write a program that uses a structure to store student name, student ID number, pointer to and array of test scores, average test … | |
Hi! I was wondering if there is any way to just include a small part of a file? If I write include("c:\wamp\www\somefile.php"); then the whole file is included. I would like to only include the half of the file or a variable. Is this possible? Thanks in advance! | |
I have a very hard programming challenge and i need help... I have nothing so far, so im hoping somebod could help me build it... Im to write a program that uses a structure to store student name, student ID number, pointer to and array of test scores, average test … | |
first of all i am new here so hi everyone! I am looking for a program that can generate binary patterns like the ones shown below. i know there are generators out there but i cant seem to find any, been searching for hours:( i want to generate code like … | |
I'm trying to install java on my home laptop and it isn't working, i followed all the steps outlined by my lecturer but the javac filename isn't executing properly. Is it setup right by me?? In environmental variables PATH = C:\jre1.6.0_07\bin;C:\Program Files\PC Connectivity Solution\;C:\watcom-1.3\binnt;C:\watcom-1.3\binw;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\Metrowerks\CodeWarrior\Bin;C:\Program Files\Metrowerks\CodeWarrior\Other Metrowerks Tools\Command Line Tools;C:\Program … | |
Hi Guys, I want to ask about these codes, i don't understand clearly. So to understand these codes detail what kind of books i have to read and tutorial i have to learn. Please guide me. [code] #include <windows.h> int WINAPI WinMain (HINSTANCE hThisInstance, HINSTANCE PrevInstance, LPSTR lpszArgument, int nFunsterStil) … | |
Hello friends. I'm working on a program to sort a list object using toArray, Arrays.sort, and Arrays.asList. The problem asks that I then apply Collections.binarySearch directly to the list object. I know what the problem is (which I have stated through comments in my code) but I don't know how … | |
HI, I need help in .htaccess to hide php extension. if someone request [url]www.mysite.com/profilename[/url] , then profile should be open of the particular person. Please help me in this, how can i accomplished this using .htaccess?. Your help in this will be highly appreciated. Thankyou, syed. | |
HI I want to read Excel file from C#,below I menation the coding I use, I add Microsoft Excel 12.0 object library ,but Once I complie the coding it gave me error Meassage.The Error Meassage is 1."Type of Namespace for Application class Doesnt exsits" 2.Excel.Application.Workbook(object) is a method,which not given … | |
Can anyone tell me why i am getting error object invalid or no longer set.here is the code what i have written.any help would be greately appreciated. [code] Private Sub FillVendorList() Dim rs As New ADODB.Recordset, sqlQuery As String, i As Integer sqlQuery = "Select Suppliers.sup_id,Suppliers.Sup_name from Suppliers order by … | |
This is my next question: how to get a document from root? because I have this code: [code] myfile.open ("/home/ws14/Desktop/test.txt"); [/code] But I need to change the path home/ws14 if I change user. Thanks! | |
In a code routine I receive strings like “04242009” and I need to convert it to April 24, 2009. I have played with several of the date conversion routines but I am getting no where. Help would be appreciated. Thanks! WBR | |
Write a program that uses inheritance to create various derived classes of runtime_error . Then show that a catch handler specifying the base class can catch derived-class exceptions? am i doing it rite this is my code : [CODE]#include <stdexcept> #include <exception> using std::runtime_error; class DivideByZeroException : public runtime_error { … | |
i want to populate drop down box values on the basis of other drop down box value dynamically(without refreshing the page) using java script. i tried to search on google, but could not find anything. please can anybody help me in this regards. Thanks | |
So, I have to write a program that calculates the five number summary of a .txt file with 2 columns and n rows. A snippet of the file would be 23 7.8 27 17.8 39 26.5 41 27.2 From this I am trying to input the numbers into a vector … | |
I need to have my program use a function to read in numbers from a file to an array, and pass the array back to my main program to be outputted/used by another function; however, I am getting an error(cannot convert from 'int' to 'int [100]'): Here is the relevant … | |
hi, im looking for a good PHP script to install a forum in my website. i came across phorum,and chipmonk. i also need it to have a PM (private messeges) option. can anyone recommend a good script ? could anyone tell me where can i find instructions regarding installing chipmonk … | |
Can anyone reccomend any good C++ books (available on amazon preferably). Im not a total newb (I know java, php and vb.net), i just dont know that particular language that well. A book which covers data structures and concepts too would be beneficial, as im on a comp/sci course atm, … | |
i am creating a small cpu simulator and i need to parse the assembly instruction which is like "add $s1 $s2 $s3", i need to get these four individual words ignoring the white spaces, if i use string.split(' '), it wont work if user enters more than one space between … | |
hi, im trying to learn python and this is giving me [ICODE]>>> x=input("Enter a value: ") if x % 2 ==0: print ("even") else: print ("odd")[/ICODE] then when i execute: Enter a number: then i enter a number but it does not print even or odd. why? | |
Hi I want to write a program which reads a hexadecimal number and returns an decimal number. I wrote that code(inspired by some code pieces from web): [CODE]#include <stdio.h> int main() { int hexa; scanf("%x", &hexa); printf("%d", hexa); return 0; } [/CODE] but it does't give the answer I want … | |
I am getting the above error when trying to compile.. main.cpp [code=cplusplus] #include <windows.h> #include <string> #include "resource.h" #define GETITEM(item) GetDlgItem(hWndDlg, item) static bool keeprunning = true; static bool keeprunning1 = true; static bool keeprunning2 = true; static void run(); static void breakrun(); static void lunchrun(); static void end(); static … | |
Hello everyone, I'm working on a small assignment where I am supposed to write the code for the itoa function [icode]char* itoa(int Value, int Base);[/icode] without using any built-in functions, and where the returned value is allocated on behalf of the caller. Value being the integer to convert, and base … | |
Hello, I want to total up a variable that changes every time a function is run. [code]import random def flip(): h,t = 0,1 cheads, ctails, = 0,0 cflips = random.choice((0,1)) if cflips == 0: cheads += 1 return 'h' else: ctails += 1 return 't' def repeat(f,n): for i in … | |
Hello, I am trying to write a program that flips a coin until it gets the sequence "heads tails heads" and then stops and says how many flips it took to get that sequence. This is what I have so far: [code]import random import time import string def coinflip(): heads … | |
hey, I got a question regarding functions returning a linked list. Here's the data structure of my linked list (just in case it deviates from the standard way of doing it) [CODE] template <class T> class Link { private: unsigned int size; Link<T> *nextRow; Cell<T> *firstCell; public: Link(); ~Link(); //functions … | |
am doing a classroom project but am stuck with the registering users script it does send the data to the mysql database ppliz help me out thanks here are both the html and php codes . [code=html] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" … | |
Provided the following template: [code=cplusplus] template <class T> class MyTemplate { private: T myData; public: MyTemplate(const T &data) : myData(data) {} bool Contains(const T &); }; [/code] Is there a way to ensure at compile time that the argument T derives from another class? I want T to derive from … | |
Hi All, As you've probably read a million times, I am a newbie to java programming and need some help with uni assignment. I need to know how to numerical update a Textarea by clicking on a button. This would be a lot simplier if I could do it one … | |
I am an infant attempting to learn to crawl through Java. I have been learning for just over four weeks now, and have been doing relatively well. However, I am now on arrays, and find myself not only floundering, but drowning! My text seems extremely difficult to understand, and I … | |
I'm a first semester CINT student and I'd like to add some "bling" to my final project. I want to add blinking text to my final forms clearform button. My code so far: [code]Private Sub orderForm_Load(ByVal sender As System.Object, ByVal e As _ System.EventArgs) Handles MyBase.Load 'disabling the animation on … |
The End.