659 Topics

Member Avatar for
Member Avatar for TrustyTony

Gribouillis has allready posted code similar to this in his snippets, but here version for input suitable for for expressions, generators and list comprehensions. Need to add robustness by some try...except blocks for real world use.

Member Avatar for vegaseat
0
540
Member Avatar for stephen_UK

I would be great if someone could spot the problem with this code please. I have a MySQL table that was populates an Options list which works well when adding new records to another database table. The code is: $query="SELECT id, types FROM $table ORDER BY types ASC"; $result = …

Member Avatar for moonknight33
0
207
Member Avatar for sonicx2218

import java.util.*; import java.io.IOException; import java.util.Scanner; import java.util.Random; public class LinkedListProgram { public static void main(String[] args) throws IOException { int i,number, ran; Scanner sc = new Scanner(System.in); LinkedList<Integer> list = new LinkedList<Integer>(); ListIterator li; String line; Random random = new Random(); int pick = random.nextInt(150); System.out.println("Enter # of nodes"); …

Member Avatar for sonicx2218
0
3K
Member Avatar for sonicx2218

So my java class is a joke, and we're expected to learn how to do our assignments via the web...I'm a hard worker, but I'm just not good at this. [Assignment pic](http://oi50.tinypic.com/aw3zx2.jpg) There's the assignment image. I think i got how to do the first part with the adding random …

Member Avatar for sonicx2218
0
543
Member Avatar for AndradaK

I need implementation of this problem using ADT List. It should have at least 3 modules( classes). Help me please! A math teacher needs a program in order to help students to test different properties of numbers. The program manages a list of numbers and also allows students to repeatedly …

Member Avatar for TrustyTony
0
477
Member Avatar for sonicx2218

Hey bros. I made a program that prints out random numbers in a linked list. I want to have the index number next to each of the random numbers in the list. I guess for example like: 1 25 2 123 3 56 ect. Here's m program so far, and …

Member Avatar for NormR1
0
329
Member Avatar for sonicx2218

hello everyone. I can't figure out how to create a random int that gets placed into a linked list. import java.util.*; import java.io.IOException; import java.util.Scanner; import java.util.Random; public class LinkedListProgram { public static void main(String[] args) throws IOException { int i,number, ran; Scanner sc = new Scanner(System.in); LinkedList<String> list = …

Member Avatar for sonicx2218
0
2K
Member Avatar for sonicx2218

Hey everyone. As always I'm sorry for my noobness when it comes to java, but I got a question I can't seem to find answered anywhere else on the web. I'm trying to make a simple program that takes whatever number the user types in, and makes a linked linked …

Member Avatar for sonicx2218
0
120
Member Avatar for aprilcrash

Hi. I´m writing my first python program - a text adventure game. I want to have a list of possible things a dog could eat, what´s bad about them, how bad they are. So, I thought I´d do this: badfoods = [] keys = ['Food','Problem','Imminent death'] food1 = ['alcohol', 'alcohol …

Member Avatar for TrustyTony
0
288
Member Avatar for blaaam

Hi! I have started learn about Query and PHP, and i don't know what to do next. I have made table with query help i can show in table records from my Database, so far i have well, but next what i want to do is every record in table …

Member Avatar for Biiim
0
320
Member Avatar for bgx90

I have not found anything that addresses these questions. Any help is appreciated. If I have a class that has pointers to objects of a user-defined class as members, is there any problem with initializing those pointers with the initialization list of the constructor? For example, where A, B, and …

Member Avatar for bgx90
0
3K
Member Avatar for hwoarang69

*i am trying to copy the value of ar2[10] //in main. has the value 1,2,3,4,5 in ar[10] //(in struct node). empty array so to copy the value iam not sure if i could use a strcpy for ex, strcpy(head->ar, ar2); //here is my code struct node { int ar[10]; //empty …

Member Avatar for hwoarang69
0
146
Member Avatar for hwoarang69

iam trying to store all the data in to a struct so i can change it later. //this data is in file abc 1 11 22 def 2 33 ghi 0 22 11 33 asd 2 i was planing on making a array of structs. so 1st line will have …

Member Avatar for hwoarang69
0
220
Member Avatar for strongguy12345

Hello to all, haven't been on here in a while but recently been having major problems with trying to finish this second problem set my teacher has given me and the other students for the gr. 12 ics college coarse, currently im gr. 11 but this coarse had to be …

Member Avatar for strongguy12345
0
326
Member Avatar for jhamill

okay, i am trying to implement a program that cycles through a circularlly linked list to find different strings "assassins" and then eliminate the next person in the list. I believe that most of my code is correct with the exception of how I set up my linked list as …

Member Avatar for jhamill
0
259
Member Avatar for hwoarang69

trying to create a insert method thats takes a char *name and int age. after than iam trying to insert in linked list. its seem to be working fine but if i have a linked lets say [1 2 3 4 5] and if i try to insert(2). i shoudl …

Member Avatar for zeroliken
0
177
Member Avatar for pendo826

There's something wrong with the curly brace's can anyone see where please. //****************************************************************************************** //Header file for LinkedList.cpp. //****************************************************************************************** #ifndef LINKEDLIST_H #define LINKEDLIST_H //****************************************************************************************** //Declaring templates for classes. //****************************************************************************************** template<class Datatype> class LinkedListNode; template<class Datatype> class LinkedList; template<class Datatype> class LinkedListIterator; //****************************************************************************************** //Class: LinkedListNode. //Description: This is a class for the …

Member Avatar for TrustyTony
0
398
Member Avatar for pce369

I am having trouble figuring out how to get a user inputted value into a structure I've created to make a linked list of stacks. The structure and pointer info before main() are: struct inforec { int item; }; struct node; typedef node *PT_NODE; struct node { inforec info; PT_NODE …

Member Avatar for pce369
0
121
Member Avatar for Ahmed2

Hi guys, I'm trying to read data from an excel "csv" file and save it in a list. the problem is that I want to have a copy of this list named "list1" that will not change during the manipulations and claculations, because when I copied the contents of "list1" …

Member Avatar for mike_2000_17
0
229
Member Avatar for Eagles36

I have the program working up to the point where at the end of every test it fails and get. where do I need to look to start fixing the failed tests.(files are attached at the bottom) This is my output: START OF TEST 1: Testing insert, attach, and the …

Member Avatar for uzairrahim
-1
2K
Member Avatar for ogrishmania

I want to delete the first element from a list. this is my list: struct dlist { int liber; //it translates as "free" don't know what this is int nmax; //maximum number of elements DATA *pv; //a pointer with which i can move in list, also DATA is int }; …

Member Avatar for Ancient Dragon
0
132
Member Avatar for xpstyle36

Hey guys, My name is Dane and I am an 18 year old I.T Apprentice based in Blackpool. Our I.T manager has gone on holiday and I have had a call giving a deadline on getting a form on our intranet working, I look and it is all ColdFusion! I …

Member Avatar for xpstyle36
0
967
Member Avatar for jnewman3

So I've been working on a Hash Table that uses nodes to store data. I'm having issues figuring out the copy constructor and assignment operator overloader. In my main I instantiate 3 hash tables. 1 default(size 10), 1 size 7 and another one that copies hashtable size 7 to it. …

Member Avatar for raptr_dflo
0
338
Member Avatar for Anonymous123

I have an assignment to write a program in Java to implement the Natural Correspondence Algorithm for converting a linear list into a binary tree. The program should process its inputs in two steps: (a) It first builds a tree for a given input list (b) It then traverses the …

Member Avatar for Anonymous123
0
273
Member Avatar for webstart

I have a list as alist = [[], [(u'0.77',)], [(u'0.34',)], [(u'0.12',)], [(u'0',)], [(u'0.0',)], [(u'0',)]] I'm trying to get it as like this [0.77, 0.34, 0.12, 0, 0.0, 0] using the statement rlist= map(lambda a: int(a), alist) but got an error as, TypeError: int() argument must be a string or a …

Member Avatar for vegaseat
0
6K
Member Avatar for garu525

Hello, I'm working on an assignment right now and I need some feedback. My project is to implement a graph that uses an adjacency list like an Edge list. I'm fairly new with these and I would apprecite if anyone can see my code if I'm on the right track. …

Member Avatar for mrnutty
0
279
Member Avatar for cryonize

I have a bit a of a problem because I have no idea what's going on in my code. Could someone guide me with this? **It has to swap the nodes themselves. ** #include <iostream> #include <iomanip> using namespace std; typedef struct node { int DATA; node *NEXT; }; node …

Member Avatar for raptr_dflo
0
960
Member Avatar for while(!success)

Hey guys, I am writing a program which uploads a text file into a linked list then displays a menu prompt to the user. All of my functions work fine except when I try to exit the menu/program. The program crashes and I don't see where it is coming from. …

Member Avatar for while(!success)
0
239
Member Avatar for Sawamura
Member Avatar for PuQimX

i have problem with my code to search node in link list. can anybody help me? sorry for my english.. node *temp1; // create a temporary node temp1 = (node*)malloc(sizeof(node)); // allocate space for node temp1 = head; // transfer the address of 'head' to 'temp1' bool find = false; …

Member Avatar for deceptikon
0
223

The End.