Hi
I'm trying to work on a homework problem where I have an input date in the format YYYY-MM-DD
I need to import a couple modules and create a function weekday where it splits up the date and returns the weekday.
So far I imported:
from time import *
from datetime import *
I need help in my weekday function where I must use a .spl...
I know to simply run perl in linux you do perl program.pl args .
How do I make convert that for a makefile?
CC=perl
CFLAGS=-O0
TARGET=./problem1
OUTFILE=./log.txt
$(TARGET): problem1.o
$(CC) $(CFLAGS) -o $(TARGET) problem1.o
problem1.o: problem1.cpp
$(CC) $(CFLAGS) -c problem1.perl
clean:
rm -f *.o $(TARGET) $(OUTFILE)
run...
I am trying to implement the RSA algorithm, but for some reason my code below doesn't produce correct results (note that only the relevant code is shown).
BigInteger n = p.multiply(q);
BigInteger totient = (p.subtract(BigInteger.ONE)).multiply(q.subtract(BigInteger.ONE));
Random rand = new Random();
BigInteger e;
do
{
e = new BigInteg...
Write a function spaced(s) that outputs spaces and a dashdot border around a string s.
The sample code, which calls spaced("Hello") would output:
--.-.-.-.-
. .
- Hello -
. .
-.-.-.-.-.
Please help me out with this :D. Im new to programming and im trying to learn this stuff. I dont have any programming ...
As a portion of a first year assignment, I need to create a class which uses a provided linked list implementation to implement a provided stack interface which is then tested by another provided class. I was able to easily complete the assignment using my own LL; however, I was told that I needed to use the one provided.
Exception in ...
Trying to use StackLL method size() is returning a null pointer error. I cannot figure out why this is, as count is initialized to 0. My only guess is that I am not properly creating an instance of LinkedList.java. However, I have no idea what I should do to correct this. Any help would be greatly appreciated.
The following code is a po...
I have spent quite a while trying to write a program to implement Conway's game of life - [Link with more info.][1] . I am following some online guides and was given the majority of the functions. I wrote the "next" and "neighbours" methods shown below. Could anyone tell me if these are good implementations, and how they could be made b...
public class Zoo{
public static void main (String[] args){
Animal animal1 = new Animal ("Giraffe", 5, 'M');
Animal animal2 = new Animal ("Lion", 10, 'F');
System.out.println (animal1.getName () + " " + animal1.getAge () + " " + animal1.getGender ());
System.out.println (animal2.getName () + " " + ani...
My source code (below) is generating Error CS0563 because both of the parameters in my CombinedJobs operator+ (see "//Step 5: ..." in source code) are listed as Job (as opposed to int, double, etc). How can I change this code to eliminate this error? This code is in response to the assignment listed below.
Assignment:
"Design a Job cla...
I have done it till 68th slide of this file
http://webdocs.cs.ualberta.ca/~amaral/courses/329/webslides/Topic5-QuineMcCluskey/Topic5-QuineMcCluskey.PPT
But i don't know how to further implement it and get right answer.
The problem i am facing is how i can do that.
0,1,8,9 -00-
0,2,8,10 -0-0
2,6,10,14 --10
i have ...
I am doing a assignment about this.
For Eaxmple:
I have a message (String), and the length is 302 in dec, 12e in hex.
String message = "THE MESSAGE BODY";
int lengthOfMessage = number.length(); // 302
String lengthOfMessageInHex = Integer.toHexString(lengthOfMessage); // 12e
Now, I need to change the lengthOfMessageInHex from "12e" t...
I have a homework to do that says the following:
Write a program in C that creates a child who will also create a child, make a pipe between the three processes, the fist process(father) will connect the second(child) and the child will connect with the third (child of the child). Our program should display the total number of system u...
Here's the story:
Write a program in C that creates a child process and a granchild process (child of a child process!).
The father process should read the contents of a file which name will take as an argument when you run the program.
The father should send the text read to the child, which takes to convert those characters 'a' found ...
I know there are no pointers in C#, but I am trying to figure out how to do the following, which I would have done with pointers (or better yet, iterators) in C++ (I am taking a course in C#, but I already know C++).
We got an assignment to write a simple "store" program (inventory, transactions, etc.). My first idea (coming from C++) w...
Hello!
I am trying to modify the heapSort algorithm into version with random pivot , and I dont know what to do.
Could any one help me ?
This is the code:
//QuickSort w C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace QuickSort
{
class Program
{
//Zamienia miejscami...
I have the following question here
.data
a: .asciiz "2021"
x: .byte 7,2,12
.text
main: addi $t2, $0, 1
lb $t3, a($t2)
Can someone explain to me, HOW the value of $t3 is 48?
thanks
EDIT this is an another question which is similiar, and is confusing.
.data
a: .word 12,-5,4,0
x: .byte 5
.text
main: addi $t1, $0, 8
lw $t2, a($0)
lw $t3...
Hi, I have below code.
template <class T>
class Test
{
public:
template<class T>
void f(); //If i define function here itself, error is not reported.
};
template <class T>
void Test<T>::f()
{
} //Error here.
int main()
{
Test<float> ob;
ob.f<int>();
}
It produces below error.
error C2244: 'Test<T>::f' : unable t...
pseudocode:
void recursive('k'){ // 'k' and 'i' vertices
sumA = 0;
sumB = 0;
for each non visited 'i' neighbor do{
recursive('i');
sumA = sumA + b['i'];
sumB = sumB + max(a['i'], b['i']);
}
a['k'] = 1 + sumA;
b['k'] = sumB;
}
void main(){
a = b = 0; //initialize tables with 0 (zeros)
recursive('X'); ...
This is a school project:
Objective:
Ask the user to input 2 number
A random number will be print to the user.
Must catch if input isn't Integer.
I have check online source, which i copied the code and use it.
Min + (int)(Math.random() * ((Max - Min) + 1))
The code work fine except if I input any integer less than 10. The Program...
I have a problem with this exercise:
Write a program in C that creates a child and between father and child, there will be two-way communication using pipes. His father would read a file (whose name will be given the user) and will send letters to the child.
The child will count the number of words starting from with 'a'; if the number...