homework

Xcode project setup for GLFW library reference problem.

Hi, I'm working on an assignment which is to simulate the beginning of the universe using C and OpenGL/GLFW. I'm pretty new to C and also to Xcode, which is not helping at all. I've overcome my silly compilation problems and the code is finding GL/glfw.h ok. When I compile and run I receive a "Visualisation [name of the project] has ...

Setting up java3d on os x leopard

I have recently installed OS X on my MBP and am wanting to set up java3d on it. I have set this up on windows which proved a lot easier with the installer provided. the mac install instructions can be found here: http://inverse.chi.googlepages.com/README-unzip.html I have placed both the j3d and jogl libs in my home directory /Users/ma...

Java: How can I feed commandline input into an array?

I'm working on a Bruce Eckel exercise on how to take a keyboard command line input and put it into an array. It's supposed to take 3 separate inputs and place them into an array and print them back out. Here is the code I have so far: //: object/PushtoArray import java.io.*; import java.util.*; class PushtoArray { public stati...

Need help solving Project Euler problem 200

I am trying to formulate an algorithm to solve Project Euler's Problem 200. We shall define a sqube to be a number of the form, p2q3, where p and q are distinct primes. For example, 200 = 5223 or 120072949 = 232613. The first five squbes are 72, 108, 200, 392, and 500. Interestingly, 200 is also the first number f...

How do I use C++ in flex and bison?

I have a project for school where we need to use flex and bison. I want to use C++ so that I have access to STL and my own classes that I wrote. We were provided with the following Makefile: CC = gcc CFLAGS = -g OBJs = parse.tab.o symtab.o attr.o lex.yy.o default: parser parser: ${OBJs} ${CC} ${CFLAGS} ${OBJs} -o parser -lfl ...

how get last number in range in python

there is a way to get the last number in range i need to get the last number in fibonacci sequence for first 20 terms or can to do with a list instead range? ...

'Quick' Shell Scripting Help

I need help with this shell script. Must use a loop of some sort. Must use input data exactly as shown. Output redirection should be accomplished within the script, not on the command line. Here's the input files I have: http://pastebin.com/m3f783597 Here's what the output needs to be: http://pastebin.com/m2c53b25a Here's my failed...

pointer in recurrence Fun

Hello to every body I hope every one keep in best state. I want to help me in solve this problem in my Sheet . I use recurrence functions in like list.( with ADT file ) by modify the search function and adding Printing function in a Reverse Manner. template <class TYPE, class KTYPE> bool List<TYPE, KTYPE> :: _search (NODE<TYPE> **pP...

How to define a Copy constructor with pointers in it?

I have recently discovered that when I have pointers within a class, I need to specify a Copy constructor. To learn that, I have made the following simple code. It compiles, but gives me runtime error when performing the copy constructor. I am trying to copy just the value from the pointer of the copied object, but avoiding assigning t...

Java3D simulation assignment

I have been assigned the task of simulating the start of the universe using java3D (particles etc) and must consist of 5 different sections... each of a minimal length of 15 seconds. Stages like the particle soup stage - basically 5 distinguishable visualizations. It doesn't have to be complicated, merely spheres moving around with set p...

How to calculate VAT in SQL query?

How do you write a SQL query to calculate the VAT and then add it to Total? Thank You ...

Using arrays with recursion

Now that I am using recursion to calcuate the sum of numbers, I want to do something slightly different. The following is my code that will sum the numbers 1,2,3,4,5. How would I modify my code to place the numbers 1, 2, 3, 4, 5 into an array and then use it in the recursion method? I have tried so many different attempts and I am app...

Java: my method wants the double type instead of float?

In another Bruce Eckel exercise, the code I've written takes a method and changes value in another class. Here is my code: class Big { float b; } public class PassObject { static void f(Letter y) { y.c = 'z'; } //end f() static void g(Big z) { z.b = 2.2; } public static void main(String[] args ) { Big t = new ...

Java: dividing 2 ints makes an int?

In another Bruce Eckels exercise in calculating velocity, v = s / t where s and t are integers. How do I make it so the division cranks out a float? class CalcV { float v; float calcV(int s, int t) { v = s / t; return v; } //end calcV } public class PassObject { public static void main (String[] args ) { int dista...

Make image upside down in c++

I am trying to write a c++ program in linux.In which i want to make a 3D image upside down. where i have the coordinates (x,y,z) of the image . Example: ^ | | to | | V How to do it? ...

ASP.NET MVC Image Parameter Caching

I have a controller action which retuns a ImageResult (extending ActionResult). When this action method is called the first time with parameter value N, other consequent calls will ALL have the same parameter value N, while their parameters differ. I guess this is somehow related to parameter caching in ASP.NET MVC. As result, return i...

finding substrings in python

hi, Can you please help me to get the substrings between two characters at each occurrence For example to get all the substrings between "Q" and "E" in the given example sequence in all occurrences: ex: QUWESEADFQDFSAEDFS and to find the substring with minimum length. ...

Pthreads as a standard solution for simultaneous console input in UNIX?

I got an assessment to write a simple chat client for Linux using ncurses. The chat has two windows: one displays what the other client says, the other handles user input. What confuses me here is how to handle data that constantly comes from the socket and waits for the user's input at the same time. The only one solution that comes in...

Remove element from linked list JAVA

OK here is my problem. I have a linked list of card objects. I have the following method public void removeCard(Card card){ cards.remove(card); } if I create Card c = new Card(5,C); for example and there is a card with the exact same values 2, and C in the linked list (cards). If I call the method CardPile.remove(car...

Place a movie clip on the stage via Actionscript

I have an assignment where at one point, I have to put a movieclip on the stage. I can't just drag it and place it and set it to visible at some point in time, I have to use Actionscript to pull it from the library and make it appear on the stage at certain X/Y coordinates. My assignment says that the function attachMovie() would be use...