homework

questions related to DTD and schema: finding the missing words

This question are part of a quiz. I've finished already but some questions were answered incorrectly. However, the teacher don't upload the solution for those questions. Would you please help me for the solution of such questions? I need to know exactly the answer in order to start revise for the final exam This question related to DTD...

difference between abstraction and encapsulation?

What is the precise difference between encapsulation and abstraction? ...

Algorithm about number combination problem

Write a function that given a string of digits and a target value, prints where to put +'s and *'s between the digits so they combine exactly to the target value. Note there may be more than one answer, it doesn't matter which one you print. Examples: "1231231234",11353 -> "12*3+1+23*123*4" "3456237490",1185 -> "3*4*56+2+3*7+490" "3...

Discrete Event Queuing Simulation

Hello, I'm stuck trying to implement a single server queue. I've adapted some pseudocode from Norm Matloff's Simpy tutorial to Python and the code is here. Now I am struggling to find some way to calculate the mean waiting time of a job/customer. At this point my brain has tied itself into a knot! Any pointers, ideas, tips or pseudoco...

Reliable UDP

How can I develop a Linux kernel module in order to make UDP reliable? This is my college assignment and I don't how to proceed. how to do change the default UDP behaviour in linux kernel by loading a new kernel module? and how to program such kernel module? ...

Reading an input file in C++

I would like to read an input file in C++, for which the structure (or lack of) would be something like a series of lines with text = number, such as input1 = 10 input2 = 4 set1 = 1.2 set2 = 1.e3 I want to get the number out of the line, and throw the rest away. Numbers can be either integers or doubles, but I know when they are one o...

Basic python. Quick question regarding calling a function

Hi All, I've got a basic problem in python, and I would be glad for some help :-) I have two functions. One that convert a text file to a dictionary. And one that splits a sentence into separate words: (This is the functiondoc.txt) def autoparts(): list_of_parts= open('list_of_parts.txt', 'r') for line in list_of_parts: ...

IEBGENER Help

Ok, so I am having some trouble figuring out how to get IEBGENER working in the way that I want it to. I should preface all this by saying that I am running IEBGENER in a z/OS environment on an academic mainframe. Now, I have three JCL procedures (PROC) inline to some COBOL code that I am working with, and I need to stick IEBGENER in a...

Why does my App.Config codebase not help .NET locate my assembly?

I have the following client application and its corresponding config file: namespace Chapter9 { class Program { static void Main(string[] args) { AppDomain.CurrentDomain.ExecuteAssembly("AssemblyPrivate.exe"); } } } <configuration> <runtime> <assemblyBinding xmlns="urn:schemas-micro...

Matlab number to letter swapping

If I have a vector, for example: V = [ 1, 2, 3, 4 ]. Is there a way to change this to the letters [ a,b,c,d ]? ...

Are two int arrays of different size "type equivalent" in C?

I'm reading about Type Equivalence in my Programming Languages class and I've come across a situation in C I'm unsure about. It describes C's "Type Equivalence" as: C uses a form of type equivalence that falls between name and structural equivalence, and which can be loosely described as "name equivalence for structs and unions, st...

C++ Class Serialization Help

Hi, I quite recently learned about the C++ classes friend keyword and the uses in serialization and now I need some help in getting it to work. I have no problem serializing my class to a file, it's working great, however i'm having a hard time trying to read this file into a vector container. I'm sure I need a loop in my code that read...

Is there an alternative way to free dynamically allocated memory in C - not using the free() function?

I am studying for a test, and I was wondering if any of these are equivalent to free(ptr): malloc(NULL); calloc(ptr); realloc(NULL, ptr); calloc(ptr, 0); realloc(ptr, 0); From what I understand, none of these will work because the free() function actually tells C that the memory after ptr is available again for it to use....

Pointer to an array of structs and getting memory - C

A link is a pointer to a node typedef struct node * link; In main(), I have the following code (config->m is just some integer): // array of pointers to structs link heads[config->m]; // make memory for head nodes for(i = 0; i < config->m; i++) heads[i] = malloc(sizeof(struct node)); The code works (which is great). But is ther...

find missing numeric from ALPHANUMERIC - Python

How would I write a function in Python to determine if a list of filenames matches a given pattern and which files are missing from that pattern? For example: Input -> KUMAR.3.txt KUMAR.4.txt KUMAR.6.txt KUMAR.7.txt KUMAR.9.txt KUMAR.10.txt KUMAR.11.txt KUMAR.13.txt KUMAR.15.txt KUMAR.16.txt Desired Output--> KUMAR.5.txt KUMAR.8.txt KU...

Matlab swapping

If I am given a string of letters abcd and I want to convert this to a vector V = [ 1,2,3,4], how can I do this? ...

how to search arguments to find a match to the first argument in c language?

Okay I have to write a program that accepts 2 or more arguments and searches the second and remaining arguments for a matching argument. for example the output would be: ./a 3 h 4 9 3 3 found or ./a hsi and iash me 34 hsi hsi found So far I have this, and I'm pretty sure I've got a lot of junk in here that is useless in the...

Incompatible pointer type in C language?

I keep getting told that in this line of code passing argument from incompatible pointer type. Here's the line of code: if (linear_search (size_of_A, argv[i])) What does this mean and how do I fix it? Here is the whole program: int linear_search ( int size_of_A, char*argv[]){ int i; i = 2; while (i <= size_of_A - 1...

The shortest program that prints its own source code in C#.

I need (preferrably the shortest) program that prints its own source code in C#. I will post it here when I finish it, but if you already have a link your help will be greatly appreciated. I have come with a solution, but then have found it here. Cuddos to Joey Westcott ...

How to create a linux equivalent "nl" command using system calls in C?

I have an exercise to do where I need to code in C, commands equivalent to cat and nl using only system calls. The system calls given to us are open(), close(), read() and write(). I've already done the "cat" equivalent and it seems to be running fine, now I need to do the "nl" one but I'm having trouble with how am I going to write lin...