homework

SML - LOST! help please...

In a EIK Bank should I make now an account called Nice Item, all operations seem like a Basic Account, except those payments, which works as follows: At each accrual added 4% (rounded down) of the balance immediately after the last payments, provided that the period remains unclaimed in the account. Has closed the account, attributed to ...

C++, substract certain strings?

Hi, This is a homework, thus I hope you guys dont give me the direct answers/code, but guide me to the solution. My problem is, I have this XXX.html file, inside have thousands of codes. But what I need is to extract this portion: <html> ... <table> <thead> <tr> <th class="xxx">xxx</th> <th>xxx</th...

What does this code do?

function mystery($y, $m, $d) { $a = 0; $b = 0; $c = 0; if($m < 3) { $a = $m + 10; $b = ($y-1) % 100; $c = ($y-1) / 100; } else { $a = $m - 2; $b = $y % 100; $c = $y / 100; } $w = (700 + (((26*$a)-2)/10)+$d+$b+$b/4+$c/4-(2*$c))%7; echo $w; } One of my tutorial questions asks what the functio...

"cannot find symbol" on a wsdl Java Client

This is part of a lab exercise for a course I'm doing, it's not assessable, just a learning exercise. Not sure why but the tut didn't go through it, so I just went through it at home but I'm stuck on the last part. I'm trying to write a java WSDL client to access http://www.nanonull.com/TimeService/TimeService.asmx?WSDL - I should inpu...

Why am I getting a "statement with no effect" warning?

The following is my code /* Initialise default without options input. */ options -> processHiddens = false; options -> timeResolution = DEFAULT_MOD_TIMES; options -> performSync = true; options -> recursive = false; options -> print = false; options -> updateStatus = true; options -> verbose = false; options -> programname = malloc(BUFS...

Pattern matching list of lists

Hi. I have a problem where I have a list like this: [[el1, el2, el3], [el4, el5, el6], [[el7, el8, el9], [el10, el11, el12], ..... , [elxx, elyy, elzz]], [el, el, el]...]] I want to pattern match the inner list of lists, the [el7, el8, el9], [el10, el11, el12], ..... , [elxx, elyy, elzz] How can this be done? As of now I pattern...

C++ Iterate an istream

What is the best way to parse or iterate an istream? I need to create a function that takes an istream, parses it and creates an object so was wondering the easiest way to do this. Even something that could convert it to string would be dandy. ...

List membership in Python without "in"

How to define a function is_member() that takes a value (i.e. a number, string, etc) x and a list of values a, and returns True if x is a member of a, False otherwise. (Note that this is exactly what the in operator does, but for the sake of the exercise I should pretend Python did not have this operator. This is what I've come up with,...

How to pad with n characters in Python

I should define a function pad_with_n_chars(s, n, c) that takes a string 's', an integer 'n', and a character 'c' and returns a string consisting of 's' padded with 'c' to create a string with a centered 's' of length 'n'. For example, pad_with_n_chars(”dog”, 5, ”x”) should return the string "xdogx". ...

question on stack applications by an engg. student

Please tell me any hardware application of stack. as printer is hardware application of queue. ...

how do i switch custom kernels?

hello guys, i have created and installed a new kernel in my ubuntu system, but now i have added a new system call and created a new kernel, how do i set this new kernel as the one the OS should boot from. dpkg -i kernel-image-2.6.deb i tried this on my first kernel and this set the kernel to this one then i added a new system call ...

Prolog GNU - Having a difficult time with this, lists and recursion

So , i still don't completely understand how lists and recursion work in prolog, could be why i am having trouble with this, but i don't even know how to begin this problem. There is a list of friends. f(a,b). f(a,c). f(a,d). f(b,c). f(b,e). f(b,f). f(c,e). f(c,g). f(g,e). etc.. I have to find if someone is a friend through someone e...

why am i getting these syntax errors when trying to implement system call

hello guys, still working on this system call!!! i have added a system call to a kernel, compiled and the OS is running off it. now i am getting syntax error on the compilation of my test application. testmycall.h #include<linux/unistd.h> #define __NR_mycall 244 _syscall1(long, mycall, int, i) testmycall.c #include<stdio.h> #i...

Replace the built-in min functions in python

I should write a function min_in_list(munbers), which takes a list of numbers and returns the smallest one. NOTE: built-in function min is NOT allowed! def min_in_list(numbers): the_smallest = [n for n in numbers if n < n+1] return the_smallest What's wrong? ...

Read multiline text with values separated by whitespaces

I have a following test file : Jon Smith 1980-01-01 Matt Walker 1990-05-12 What is the best way to parse through each line of this file, creating object with (name, surname, birthdate) ? Of course this is just a sample, the real file has many records. ...

3 approaches to work with XML

I need to use different approaches when working with XML - LINQ to XML, streaming, DOM. Can anybody give me examples of this approaches? I just want to see what's the difference between this approaches. ...

Error CS1501: I'm not overloading a Sum() method correctly

Below is draft number 5 for my C# Homework this week. I wrote the program out using Linq first, and it worked fine. Unfortunately, the directions state that I must create my own method instead of using the wonderful Sum() method already found in Linq. The major problem with this source code is that the method overload is incorrect (and i...

Banking functions in SML

I'm working on making functions that'll perform different functions that a bank would need. I'm given this: signature ACCOUNT = sig type account val open : int -> account val trans : account * int -> account option val balance : account -> int val interest : account -> account end; I now need to declare some functions: ope...

Different collections for different data sorting

Hello. I have a task to play with Java Collections framework. I need to obtain a users list from a database, and store it in a collection. (This is finished and users are stored in a HashSet). Each user is an instance of Person class described with name, surname, birth date, join date, and some other parameters which are not important no...

Stuck in a while loop, can you please help?

I am currently writing a program that reads records from a txt file and prints the data on the screen as such: GRADE REPORT NAME COURSE GRADE ----------------------------------------------------------- JOE FRITZ AMERICAN GOVERNMENT B ...