homework

Most efficient way to select 1st and last element, SQLite?

What is the most efficient way to select the first and last element only, from a column in SQLite? Thanks. ...

Please can I get a hint on where to focus... formatting help

The program is supposed to calculate the number of arguments, iterate over the list of arguments, for each argument convert the argument to an integer and copy it to an array, iterate over the elements of the array, adding the value of each one to a variable (this computes the sum of elements), and print the sum. There will not be more t...

Steps for PostBack

I come to you this time with a question to do with .NET. I was given the challenge of finding out the four steps involved with postback. The exact challenge is: "There are four methods executed each time there is a postback. Describe and identify each." From what I can tell (this is a challenge for a .NET class), postback is what oc...

DIV with Image and Text

Hello, I want to create a DIV with a header of 6px height and inside the div body, I want to align an Image and Text next to each other. The height of the DIV body should be fixed. Please help with CSS. ...

What is the difference between Linear search and Binary search?

What is the difference between Linear search and Binary search? ...

Subtraction without minus sign

How can i do subtraction of integers in C without using either the unary or binary '-' operator? Or can we do the same for other data types like float/double? ...

How can I create a directory if one doesn't exist using Perl?

Currently, my Perl output is hard-coded to dump into the following UNIX directory: my $stat_dir = "/home/courses/".**NEED DIR VAR HERE**; The filename is built as such: $stat_file = $stat_dir . "/".$sess.substr($yr, 2, 2)."_COURSES.csv"; I need a similar approach to building UNIX directories, but need to check if they exist first b...

How do I compare multiple array entries simultaneously, in Java?

I have problem with comparing the value of array elements. e.g. I wanted to compare the value of index 0 and index 2, and index 1 to index 3 and so on. With the code below I suppose to get the result of numOfdifferentShape is 2 but I get 3. How can I solve this problem? :-( int numOfdifferentShape=0; myArray = {40.0, 40.0, 40.0, 40.0,...

Pure Virtual Function Call

I obviously do not 'grok' C++. On this programming assignment, I have hit a dead end. A runtime error occurs at this line of code: else if (grid[i][j]->getType() == WILDEBEEST) { ... with the message "Runtime Error - pure virtual function call." From my understanding, this error occurs if the function reference attempts to call the...

MIPs Assembly Pig Latin

In my MIPs Assembly Programming class I've been tasked with writing a program that converts a string into simplified pig latin. Simplified pig latin assumes all words in the string are at least 2 characters long, and every word has its first letter shifted to the end followed by "ay". Also, assume there are no punctuation marks of any k...

read text file into class object type array ( C++ )

So i have a class object type, myClass classType as a global. whats not happeing is that would prefer to have // MyClass.h { private: char FirstName; char LastName; char MiddleName; int ID; int Age; }; // Globals const int myIndex = 256; myClass classType[ myIndex ]; int main() { // assume preprocessors are ...

How to multiply a given number by 2 without using arithmetic operators in c?

How to multiply a given number by 2 without using arithmetic operators in c language? ...

Using threads and recursion in Java to calculate Fibonacci numbers

I'm relatively new in the Java world and I have a problem which I don't understand. I have a Class (to get the fibonacci row): class Fib { public static int f(int x){ if ( x < 2 ) return 1; else return f(x-1)+ f(x-2); } } The task now is to start f(x-1) and f(x-2) each in a separate Thread. One tim...

Real time system concept proof idea to be done in 3 months

I'm taking an introductory course about real time systems design, but any implementation. I would like to build something that let me understand better what I'll learn in theory, but since I have never done any real time system I can't estimate how long will take any project. It would be a concept proof project, or something like that, ...

Smooth movement to ascend through the atmosphere

I'm moving through the atmosphere with Microsoft Virtual Earth 3D and I can descend smoothly, but I don't know the math to ascend smoothly. I'm descending like this: for(int curAlt = startAlt; curAlt < endAlt; curAlt--){ //do something curAlt -= curAlt/150 } This works by decreasing the size of the jump the closer I get to th...

How can I write my context-free grammar?

I'm trying to write a CFG over the alphabet Σ = {a,b} for all words starting and ending with the same number of a's, with at least one b in the middle. Now I understand the basic concept of CFG, variables, production rules, etc. Unfortunately I've run out of ideas for writing the aforementioned CFG. All I've got so far is S → aYXYa X →...

How would I go about reading/writing a Structs contents to a file in C++ ?

I'm working on a homework project and i'm trying to store inventory data into a file. The inventory data size shouldn't be too large cause technically no one is going to really use it. I need to write these contents to a file: • Item Description • Quantity on Hand • Wholesale Cost • Retail Cost • Date Added to Inventory I am g...

I'm trying to read/write the size of multiple structs to a .dat file. I am getting compile errors, what am I doing wrong? (C++)

I've already asked 2 questions kind of related to this project, and i've reached this conclusion. Writing the size of the Struct to the file , and then reading it back is the best way to do this. I'm creating a program for a homework assignment that will allow me to maintain inventory. I need to read / write multiple structs of the same...

xmodem protocol in java

Hi, i'm implementing x modem protocol for reciveing file form external device using trough serialport using java ,i'm getting 133 bytes from sender after sending C to sender then i'll get 133 bytes i'e first packet afetrthat i've to send acklowledgment i have done that part but i'm not getting second packet and i've sent ack within tim...

I'm getting a C++ compiler error with the '<<' operator. Anyone know why?

I've been working on getting this program complete where it saves multiple structs to a file, can read them back and edit them, then save them all back to a file. I've been working on the logic of this not to mention lots of help from others and a ton of googling hours... now I am getting a compile error. Any help would be very appreciat...