homework

What is "tagged memory"?

What is "tagged memory" and how does it help in reducing program size? ...

How can I store a timestamp in a DBM database?

I am implemening simple file-sharing service. Currently I use a file-based database (as it suits my needs). # somewhere in my cgi script sub first_run { my $dbh = DBI->connect('dbi:DBM:'); $dbh = DBI->connect("dbi:DBM:", "", "",{ AutoCommit => 1, RaiseError => 1, f_dir=>$DATABASE_DIR} ); unless ($dbh) {...

how to read() write() into pipe() via dup2() with stdin and stdout

I need to simulated a Linux command line utility "cal -3" where it will displays three calendar side by side. What I need right now is to get my pipe working. I've been told that I can't use fork(), rather using dup2() and write(), read(), close() to call system("myCustomCommand") tree times. Right now my program does not display calenda...

Plain, linked and double linked lists: When and Why?

In what situations should I use each kind of list? What are the advantages of each one? ...

Compare hexadecimal values with decimal in Java

hi,i have byte array stored by both hexadecimal and decimal value,i want to search for hexadecimal 1 i'e SOH in the how can i do this in java,plz give a sample code. int SOH=0X01; if(SOH==1) is showing true.is it correct or not. thaks in advance. ...

How to remove an arbitrary element from a JavaScript array?

In my Google Maps application I can place markers on the map, and I keep a reference to each of the markers placed, along with some extra information in an array called markers. Adding markers is easy, I just push() the newly created object onto the array (markers.push(marker)); However, when it comes to removing an arbitrary marker fr...

matrix of integers

I need to write a function that pick out the greatest number from the matrix of integers. The matrix is passed to the function through pointer type argument. The number of rows and columns are also passed to the function through arguments. The function should return the greatest number of the matrix elements. I need to use this func...

How to include Castle ActiveRecord assemblies with a C# project

I've run into what could be a potential problem with the professor getting a C# program to run. The documentation for Castle ActiveRecord says: If you are using Visual Studio .Net, add references to the following assemblies: Castle.ActiveRecord.dll Castle.Core.dll Castle.Components.Validator.dll Castle.DynamicProxy....

UML Diagrams

Hi , Where I can Find UML diagrams , is there a website or a place to find . I Need a UML for a university. thanx & Have a nice day ...

How do I pass by reference through multiple functions in C?

Hey all. I'm working on a project for school where I need to pass a few parameters by reference through multiple functions. I understand how I can pass by reference from where the variables are declared to another function, like this: main() { int x = 0; int y = 0; int z = 0; foo_function(&x, &y, &z); } int foo_function(int* x, int* ...

How can you find the polynomial for a decimated LFSR?

I know that it if you decimate the series generated by a linear feedback shift register, you get a new series and a new polynomial. For example, if you sample every fifth element in the series generated by a LFSR with polynomial x^4+x+1, you get the series generated by x^2+x+1. I can find the second polynomial (x^2+x+1) by brute force,...

Fortran 90 OPEN file

Hi everyone. I've been working on my project about bank account transactions (withdraw, deposit, check cashed, and balance inquiry) using "account.txt". My TA said that I have to use temporary file. This temporary file will read line by line to find what the user is looking for. However, I did not understand this temporary OPEN file at a...

Date arithmetic in Java

My program is about generating (producing) a Kurosawa and making the customers produce it. Every time we generate a Kurosawa, we have to print its id, its production date and expiration date, which is 3 months from the production date. My problem is: How can I calculate the date after 3 months? Thank you. ...

What are the coolest Ruby on Rails features, why choose it?

Before I asked this question I had a look through the search results for 'Ruby on Rails' here on SO. Couldn't find much, but the following (found on this page) amused me Personally, I started using .html, moved onto php, tried ruby (hated it), discovered Python / DJango.. and have been happy ever since. Now here's the deal. I have ...

How can I write my program without so many if statements?

I have the following program so far: using System; namespace ParkingTicket { class Program { static void Main() { int speed; int yrInSchool; double fine; char choice = ' '; do { Console.Clear(); speed = GetSpee...

Need some help reading file

Hi, I am having lots of troubles trying to read a file in C++. The main problem I'm having is reading properly the first line of the stream since it is different from all the other lines. A sample file would be: #Newbie 101|Exam 1|3 Person One|10 Person Two|20 Person Three|30 the first line starts with a # and declares the class nam...

How to write a C program using the fork() system call that generates the Fibonacci sequence in the child process.

The problem I am having is that when say for instance the user enters 7, then the display shows: 0 11 2 3 5 8 13 21 child ends. I cannot seem to figure out how to fix the 11 and why is it displaying that many numbers in the sequence! Can anyone help? The number of the sequence will be provided in the command line. For example, if 5 i...

Please help me define a language in EBNF

Give the EBNF specification for the language L that is made up of the chars a, b and c such that sentences in the language have the form L : sqsR -s is a string of any combination of the characters a and b -sR is that same string s reversed -q is an odd number of c's followed by either an odd number of b's or an even number ...

3D modeling for programmers

Hi, I'm studying Computer Graphics as part of my curriculum at my university. The course focuses on scene modeling, rather than rendering or other aspects of computer graphics. We're learning the math behind it and OpenSceneGraph to actually run something. As part of the HW, and also out of sheer interest, I need to create a 3D model,...

copy one file content to another using "sed" editor

I am using shell script. How to copy one file content to another file using "sed". I have to use only sed to complete this copy. can anyone help me? Thanks in advance Sudha ...