43,549 Solved Topics

Remove Filter
Member Avatar for
Member Avatar for patto78

The following is a recursive function designed to return the factorial of a number. [CODE] def factorial(number, target): if number == 1: return target else: target = target*number factorial((number-1), target) print factorial(7, 1) [/CODE] As you'll see if you run it however it doesn't return my 'target' variable (the factorial …

Software Development python
Member Avatar for patto78
0
205
Member Avatar for knan

I have dictionary with single element lists. [CODE]dictionary={'a':['A'], 'b':['B'], 'c':['C']} [/CODE] How can i change it to [CODE]{'a':'A', 'b':'B','c':'C'}[/CODE]

Software Development python
Member Avatar for TrustyTony
0
150
Member Avatar for Enders_Game

I have a class with a button, it runs the command automatically when the gui is constructed (which i dont want it to do) but then doesnt work again after. What am I doing wrong? Builtin commands such as endcommand work as they should. relevant excerpts (ignore the indent problem …

Software Development gui python queue tkinter
0
106
Member Avatar for ricardo.crudo

I have this: [B]foo(cons char *p);[/B] foo not is my function, and I don't have access to your source code. I'm trying use foo so: [B]char val[32]; foo(val);[/B] The result of foo is zero and not the desired string. Other tries: This work: [B]foo("something here");[/B] This don't work: [B]foo((cons char …

Software Development c
Member Avatar for Ancient Dragon
0
175
Member Avatar for Shlaa

Okay, I started learning Python last weekend on Saturday with some tutorials and a book. With this being my first programming language my program won't amaze you :P The program I made is a calculator for working out how much turf a person would need given the length and the …

Software Development python
Member Avatar for Shlaa
0
138
Member Avatar for myk45

Hello, Well, this is not a question directly related to programming, so kindly excuse me for that. i have a small doubt regarding endianess and dereferencing of elements This is what i tried: [CODE]#include <stdio.h> int main(void) { int s = 0xFFFFFAFF - 1; int *p = &s; unsigned char …

Software Development c
Member Avatar for Ancient Dragon
0
100
Member Avatar for chris evans

Hi guys! I created a simple code to add records into an SQL database as shown below. It seemed to be working but then the next time i tried running it, i got no output. actually on clicking the button nothing happens at all. no warnings or error messages at …

Software Development open-source vb.net
Member Avatar for AndreRet
0
150
Member Avatar for chris evans

Hi, could someone please show me how or direct me to a source where i can learn how to connect and manipulate SQL Server 2008 database with VB.NET. I have created a database in SQL Server 2008 and i've created forms for viewing data on VB.NET but i dont know …

Software Development vb.net
Member Avatar for AndreRet
0
214
Member Avatar for Sunshineserene

Hi. I have a 2D array in a particular class file. Now, I want to equate a 2D array from another class to it. May I know how to do it? So far, this is what I've done: Example: [CODE]private double[][] residuescores = MatchApplet.mydouble;[/CODE] residuescores is from a class itself, …

Software Development java
Member Avatar for JamesCherrill
0
160
Member Avatar for ryan400

Here is my code, for some reason it goes to an infinite loop when i try and adjust the highest and lowest values for the Math.Random() method. The code works fine if i do not try to change those values based on if the guess was higher or lower than …

Software Development java mathematics
Member Avatar for ryan400
0
1K
Member Avatar for umamahesh2020

[CODE]i want out put as: * * * * m a h e s * * * * * * *[/CODE]

Software Development
Member Avatar for pranav.falcon
0
106
Member Avatar for wolfcode

Hi, I have to write a simple Java code real quick and was wondering how to write the following macro in Java: [CODE]#define BUF 256[/CODE]

Software Development java
Member Avatar for alwinnjavaroor
0
391
Member Avatar for CompSci_Guy

Here is my assignment: [url]https://docs.google.com/document/edit?id=1lf2t8LOqKmXK8tu8lW7ghDOd1IJw9BXBRi_PDXFtPQo&authkey=CLnyu7UE&hl=en#[/url] Here are the other classes I am using: [url]https://docs.google.com/leaf?id=0B_UHOsQPEyMBNDBhMWExNTgtMTJmNy00MTQxLWI1ZGItMDZiZjM3YTZiZjRi&authkey=CP2ujcoM&hl=en[/url] I am receiving a NullPointer on line 53: regularNumbers.enqueue(i); But, I am not sure why. Additionally, I need to display my results 12 primes per line, and a space between each. Suggestions? Thanks all for taking …

Software Development algorithm java queue
Member Avatar for haranaboy
0
160
Member Avatar for pharoah85

Im new to c++, Ive been plowing through books,web,etc. Many of the things im learning seems redundant but being new as I am I figure that it stems from lack of knowledge. Now finally my questions...Whats the significance of using pointers to reference variables when i could just flat out …

Software Development c++
Member Avatar for pharoah85
0
186
Member Avatar for arun_l

We are getting these constraint errors wherver OSAF calls like m_NCS_SEL_OBJ_ZERO(&nSelObjSet) is called in our code. This is while cross compiling using tilera compiler - tile-g++. With g++ it always compiles fine. Any pointers would be helpful. Sample Code: 102 // initialise and set selection object set 103 m_NCS_SEL_OBJ_ZERO(&nSelObjSet); 104 …

Software Development c++
Member Avatar for arun_l
0
156
Member Avatar for sahil1991

hi to all, i was looking for some objective type questions on c++ on the internet............ i got few but some with wrong answers and some with no answers at all....... i would love to hav some e-book on it or a larger question bank with answers........suggest me some links …

Software Development c++ objective-c
Member Avatar for Ancient Dragon
0
173
Member Avatar for Nathaniel10

OK. I thought I understood pointers and such but this exercise is revealing that I do not. The task is to read characters into an array created on free store memory (heap), then print them out using the reference and dereference operators. My code (below) compiles and runs but does …

Software Development c++
Member Avatar for Nathaniel10
0
126
Member Avatar for Maxprotect

Hey guys. Before I describe my problem, I'd just like to say that I'm completely new to programming, and I'm currently in the first year of my program. I have an assignment to create a "Lottery winning program". The program generates a random seven digit number, and matches it to …

Software Development java
Member Avatar for Maxprotect
0
2K
Member Avatar for glfnute

This is the usual "I'm new to XSLT and need help" plea ... I am trying to parse an XML document and create a "like" structure as output while performing some mapping functions. In trying to produce the output structure, I cannot seem to figure out how to get at …

Software Development xml
Member Avatar for fpmurphy
0
126
Member Avatar for matt4682

What I am trying to do is test the values of two variables, and if one is lower than the other then it will display an error message. When the user clicks okay it should return from the error pop-up back to the previous form... When I enter System.exit(0); or …

Software Development java
Member Avatar for matt4682
0
132
Member Avatar for soccer13

Hey, What I need to do is read a file- it will have a name and several numbers after, with -1 as a sentinel number to signal the end of line, ex: Rogers 15 22 6 12 -1 Myers 23 10 4 22 34 -1 ... .... ..... What I …

Software Development file-system java
Member Avatar for soccer13
0
120
Member Avatar for j855

In python it will give a decimal like 52.2 and I was wondering if there was a way to make it round all decimals up to the next number like 53.

Software Development python
Member Avatar for Shlaa
0
91
Member Avatar for myk45

Hello, i have a small doubt regarding the FILE structure. i looked it up in the header file (i have VC++ 2008). In this implementation, it was declared as: [CODE]struct _iobuf { char *_ptr; int _cnt; char *_base; int _flag; int _file; int _charbuf; int _bufsiz; char *_tmpfname; }; typedef …

Software Development c file-system
Member Avatar for myk45
0
212
Member Avatar for Avner .H.

Hello fellows... Is there something like static function variables in python? I know there are static attributes of a class, but what if i want to use a static variable inside a function? somthing like this (stupid) code in c++ for example: [code]int static_num() { static int x = 0; …

Software Development python
Member Avatar for zaghaghi
0
9K
Member Avatar for achava

Have I got a problem. I am quite new to xslt, and I have the following situation. I am presented with an xml file. I only want to extract the text in four of the tags present in the document. My first approach was to create a template for each …

Software Development xml
Member Avatar for iceandrews
0
153
Member Avatar for ahaykal

I have this homework in which I have been working on it: but I dont know what im doing wrong :( Could anyone help me: [code]#include <iostream> #include <cstring> using namespace std; class Account { private: char number[8]; char type; char owner[31]; double balance; double interestRate; public: Account() { number[0] …

Software Development c c# c++
Member Avatar for ahaykal
0
246
Member Avatar for Jesi523

I need help and I am not sure if this is even the right forum. I am new to n-tier programming. So I have developed a DAL using datasets, a BLL that is probably not very robust because I really do not know 100% what I am doing, and I …

Software Development asp.net
Member Avatar for Jesi523
0
233
Member Avatar for Jesi523

I need help. I have a gridview that updates certain fields. Once those fields are updated a button is clicked and an email needs to be sent to different areas depending on certain conditions but only if there is an email address for that row. There could be only 2 …

Software Development
Member Avatar for Jesi523
0
120
Member Avatar for Jesi523

I have a SQL query where I need to pull email addresses if there is one associated with that row in my table. Depending on how many email addresses are returned could be 1 all the way up to 5 I need to send an email to each of those …

Software Development c c# c++
Member Avatar for Jesi523
0
6K
Member Avatar for titan_550

Is it possible to be unable to put two "physical addresses" with a distance of less than 256k in a segment? My assembly professor asked me this. Is this the right answer:"it depends on how you set the align type(BYTE,WORD,PARA,PAGE), if you set it to BYTE the answer is NO …

Software Development assembly
Member Avatar for titan_550
0
124
Member Avatar for angel6969

Write a program that will read in a sentence of up to 100 characters and output the sentence with spacing corrected and with letters corrected for capitalization. In other words, int the output sentence all strings of two or more blanks should be compressed to a single blank. The sentence …

Software Development c++
Member Avatar for cbsinc
0
2K
Member Avatar for SoftwareGuy

Hello. Is there a way to modify a UIElement's contents? I have something like this: [CODE] System.IO.FileStream rdr = System.IO.File.OpenRead(xamlFilePath); System.Windows.UIElement uie = (System.Windows.UIElement)System.Windows.Markup.XamlReader.Load(rdr); [/CODE] And when I run the debugger and add uie to the "Watch" window, it gives me the following: [CODE] [-]uie [-]System.Windows.Controls.Textbox {System.Windows.Controls.Textbox:Title} <some stuff...> Text …

Software Development
Member Avatar for SoftwareGuy
0
270
Member Avatar for NewOrder

[CODE]import java.awt.Color; import java.awt.DisplayMode; import java.awt.Font; import javax.swing.JFrame; class GameStation extends JFrame{ public static void main(String [] args){ DisplayMode dm=new DisplayMode(800, 600, 16, DisplayMode.REFRESH_RATE_UNKNOWN); GameStation game=new GameStation(); game.run(dm); } public void run(DisplayMode dm) { setBackground(Color.PINK); setForeground(Color.WHITE); setFont(new Font("Arial", Font.PLAIN, 24)); Ex7 s=new Ex7(); try{ s.setFullScreen(dm, this); try{ Thread.sleep(5000); }catch(Exception ez){} …

Software Development java java-swing
Member Avatar for NewOrder
0
341
Member Avatar for Learning_Curve

[B]Question:[/B] Is it possible to [B]restrict the number of times an element can have a certain value[/B] through XSD? [B]Scenario:[/B] I have an element <ITEM> which has three child elements: <ITEM_BOOLEAN> <NAME_ELEMENT> <ITEM_MEMO_ELEMENT> <ITEM_BOOLEAN> [B]is restricted[/B] to only allow the values of "Y" or "N" is XSD I would like …

Software Development xml
Member Avatar for Learning_Curve
0
204
Member Avatar for dakaboguy

I am using VS2010 and SQL Server 2005. I have a query to search between dates. Depending on which date I select on the datetimepicker I get no results or limited results, but mostly not all the dates between the two dates I specify. For example, if i select 10/9/2010 …

Software Development seo sql vb.net
Member Avatar for dakaboguy
0
216
Member Avatar for Arturo32

It is possible to compare background images of a pictureBox? This piece of code works?: [CODE] pictureBox8.BackgroundImage == pictureBox9.BackgroundImage [/CODE] I ask bcause apparently, if used as this: [CODE]if(pictureBox8.BackgroundImage == pictureBox9.BackgroundImage)[/CODE] the result of that IF sentence is always false

Software Development html-css image
Member Avatar for Arturo32
0
109
Member Avatar for tiramisu10

I've tried everything I know ( and that's really little ) and read everything I found, but I still don't know what's wrong here... Short version... If I must write more details, please tell me I have small program with only one class. All it has to do is to …

Software Development
Member Avatar for tiramisu10
0
112
Member Avatar for Sara Tech

I want to retrive data from table into combobox ..when the user click combobox items it's corresponding data will be show. [B]In details :[/B] I have PERSON table , my program allow to the user search by : Person Name When the user enters the name into TextBox the combobox …

Software Development dataset vb.net
Member Avatar for Sara Tech
0
189
Member Avatar for BryantFury

hello, so im designing a simple prgram which calculates the cost of a ticket you buy. there are only 3 ticket options, namely a b and c. here is my code. [CODE] #include <iostream> using namespace std; const int PRICE = 3; int find(int [PRICE]); int main() { int nums[PRICE] …

Software Development c++
Member Avatar for Tom83B
0
107
Member Avatar for da_navigata24

Hi, I'm fighting a battle with a linked list and I am currently losing. I am using the toolkit, pointers, nodes and a class. My code is still buggy because after building it, it just runs for a while then stops. Please help. Here is what I have, an implementation …

Software Development c linked-list
Member Avatar for Eagles36
0
271
Member Avatar for nonshatter

Hi all, I'm relatively new to Perl and particularly new to regular expressions. This is really simple script I've just mocked up. All it does is to take the input string and check if it's in the correct format or not. Here are some examples of correct format (will always …

Software Development perl regex
Member Avatar for k_manimuthu
0
197
Member Avatar for LianaN

Hi! So, my question is how could I compare two objects. The code is shown below. The problem is that the first "if" statement is always true, even if it should be false. For instance, let's say childHierarchy[i] and hierarchy[0] are equal to 'Contract'. In this case "if (childHierarchy[i].toString() != …

Software Development java
Member Avatar for Taywin
0
106
Member Avatar for knan

I have a list of lists [CODE]x=[['a', 'b', 'c', 'd'], ['e', 'f'], ['g', 'h']][/CODE] I need the following output. [CODE]a-b a-c a-d b-c b-d c-d e-f g-h[/CODE] How can i do this? Can a regular expression be used here??

Software Development display python
Member Avatar for Gribouillis
0
152
Member Avatar for digan

Hi, ive only started programming recently and as my second assignment i have to write a program that can convert uppercase letters to lowercase letters and visa-versa. i also have to make it stop when a full-stop is entered and count the number of times the program changed letter case. …

Software Development c++
Member Avatar for digan
0
112
Member Avatar for TechSupportGeek

Hello world of DaniWeb, it's been months since I last visited this forum but here I am asking for your help again :) I've been developing a text editing application and my problem is that the RichTextBox control will "lose" all special formatting (like font, color etc.) when enabling WordWrap. …

Software Development vb.net visual-basic
Member Avatar for TechSupportGeek
0
205
Member Avatar for bejfake

Hi, I've got such class template: [CODE=c]template <class Type> class Stack{ private: struct Element{ Type value; Element *prev; } *end; public: Stack(){ end = NULL; } void push(Type value){ struct Element *element = new Element; element->value = value; element->prev = end; end = element; } Type pop(){ if(end != NULL){ …

Software Development c++
Member Avatar for alwaysLearning0
0
3K
Member Avatar for swathys

hi, i'm getting error of [COLOR="Red"]data source object is invalid[/COLOR] when i try to load a transaction report from sql database. [COLOR="Red"]Error 4 Overload resolution failed because no accessible 'Fill' can be called with these arguments: 'Public Function Fill(startRecord As Integer, maxRecords As Integer, ParamArray dataTables() As System.Data.DataTable) As Integer': …

Software Development dataset vb.net
Member Avatar for swathys
0
909
Member Avatar for outbackandy

[COLOR=#555555]Hello everyone! [/COLOR] [COLOR=#555555][COLOR=#555555]Any help would be much appreciated![/COLOR][/COLOR] [COLOR=#555555]My problem: [/COLOR] [COLOR=#555555]I want to break up a string into separate objects.[/COLOR] [COLOR=#555555]Scenario: [/COLOR] [COLOR=#555555]I am reading a txt file into my program and I want to[/COLOR] [COLOR=#555555]separate the String in to separate categories. [/COLOR] [COLOR=#555555]String line = "BATHROOM TOI …

Software Development java
Member Avatar for masijade
0
172
Member Avatar for syd_master

when i run my code...this error come out [QUOTE]"data type mismatch in criteria expression"[/QUOTE] here my code: [CODE]Private Sub Text2_Change() TXT1 = "" TXT1 = "SELECT * FROM Profile WHERE sID =' " & Text2 & "'" If RS.State = 1 Then RS.Close End If RS.Open TXT1, Conn, adOpenKeyset, adLockOptimistic …

Software Development visual-basic
Member Avatar for AndreRet
0
328
Member Avatar for sravi.pearl

haiii Do anyone know how to convert array like this ['26','18','20'] into [26 18 20] because i have to plot graph for these value, ['26','18','20] array is not allow me to do that ,i got ['26','18','20'] from database table with data type varchar....problem is i shouldnot change the datatype .... …

Software Development python
Member Avatar for TrustyTony
0
95

The End.