Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.
madamsmall
Yahoo emails doesn't work. If you need help, please contact me directly. joannavr@gmail.com
Oracle SQL social network queries?
I am working on small relational database queries for school. I have tried several things but these queries aren't working out for me. I can paste what I tried for every one but suggestions are more than welcome at this point as time is running out.
Table: Users
Attributes: Id_pk, Name, Gender
Table: Friends
Attributes: Id1_pk (fk to users.id), Id2_pk (fk to users.id),Startdate
Table: Comments
Attributes: CommentID_pk, Poster (fk to users.id), Recipient (fk to users.id), Text, PostDate
I am currently working on a query to show all pairs of males and females who are friends since this year. So far I am trying this:
Select *
from users a, users b, friends
where id1 = a.id and a.gender = 'M' and id2 = b.id and b.gender = 'F';
intersect
Select *
from users a, users b, friends
where id2 = a.id and a.gender = 'M' and id1 = b.id and b.gender = 'F';
I am trying to form a query that makes sure they are of opposite gender with matching ID's.
1 AnswerProgramming & Design8 years agoformally specify language defined by the following regular expressions?
I am studying for an exam in the morning using a past exam provided by the professor without solutions. Unfortunately I missed the day the exam was solved in class and therefore can't figure out how to do this set. I have spent the past hour searching google for a clear explanation and can't seem to understand. I will list the problem exactly. My main questions are what makes a language definition formal, and why aren't the expressions listed already considered the language? I hope this makes sense, I have been up for way too many hours looking at this.
Formally specify the languages defined by the following regular expressions. If you provide regular expressions, please be sure to reduce them to their simplest forms.
(a) (11|111)*
(b) (ε|φ*1|0φ)+
(c) (0|1)|1
If you could help with any of these and explain the process I can do the rest. Thank a lot.
1 AnswerProgramming & Design8 years agoMathematica help for Newton's Method input - Fixed point iteration?
I am attempting to code a fixed point iteration problem in Mathematica and having a whole lot of trouble. I can do the problem on paper no issues, but am very new to Mathematica. I am repeatedly getting a recursion exceeded error. Would appreciate help from anyone versed in Numerical Methods and Mathematica.
Use Theorem 2.3 to show that g(x) = 2^-x has a unique fixed point on [1/3,1]. Use fixed point iteration to find an approximation to the fixed point accurate to within 10^-4. Use Corollary 2.5 to estimate the number of iterations required to achieve 10^-4 accuracy, and compare this theoretical estimate to the number actually needed. Initial guess Subscript[p, 0]=2/3
well the formatting on copy paste is awful. Where can I put this so others can see it the way it's meant to be displayed?
Theorem 2.3:
(i) If g \[Epsilon] C[a,b] and g(x) \[Epsilon] [a,b], then g has at least one fixed point in [a,b].
(ii) If, in addition, g'(x) exists on (a,b) and a postive constant k<1 exists with |g'(x) <=k, for all x \[Epsilon] (a,b), then there is exactly one fixed point in [a,b].
Corollary 2.5: If g satisfies the hypotheses of Theorem 2.4, then bounds for the error involved in using Subscript[p, n] to approximate p are given by: |Subscript[p, n]-p| <= k^n max {Subscript[p, 0] - a, b - Subscript[p, 0]} and |Subscript[p, n]-p| <= k^n/(1 - k)|Subscript[p, 1]-Subscript[p, 0]|, for all n>=1
g[x_] := 2^-x
\!\(TraditionalForm\`
\*SubscriptBox[\(p\), \(0\)] :=
\*FractionBox[\(2\), \(3\)]\)
n := 0
data = Table[{n, Subscript[p, n]}, {n, 0, 1}]
TableForm[data, TableHeadings -> {{"Fixed Point Iteration"}, {"n", "\!\(\*SubscriptBox[\(p\), \(n\)]\)"}}, TableSpacing -> {3, 5}]
2 AnswersEngineering8 years agoDynamic vs Static Scoping problem?
Yes, this is a class problem. However there was no lecture on this and there are no examples in the book so I don't understand. The professor specifically instructed us to "google it". So:
Consider the following program:
proc main
int a, x, z;
proc A:
proc B;
int x, z;
{ x := 4; call C; print x; } (end B)
proc C;
int a, z; { x := 6; z := 9; a := 2; call D; print x; print a;} (end C)
{ x := 5; z := 7; call B; print x; } (end A)
proc D;
int x, b;
proc E;
int x; { x := 7 ; call F; print x; } (end E)
proc F;
proc G;
{print z; x:= 10 ; a:= 8 ;} (end G)
{print x; call G; x:=9 ; } (end F)
{ x := 8 ; call E; print x; } (end D)
{ a := 4; x:= 3; z := 11 ; call A; print x; print a;} (end main)
(a) What is the program output assuming static scoping rules are employed?
(b) What is the corresponding output when dynamic scoping rules are employed?
(c) List the units that proc G can call (assuming static scoping ).
1 AnswerProgramming & Design8 years agoHelp with Java game animation?
I am in desperate need of some help with my java project. I have been working on it for weeks and it was going pretty well. Unfortunately I have done something that caused a key element to stop working and I simply cannot figure out what happened. The basic problem is that the strips of images I am reading in will not animate properly. The animation starts fine, then stops after a second or so on one of the toons, and the others dont animate at all until they stop moving across the screen then start their animation sequence.
Posting the code here isn't really an option, it's very long. If you're skilled with this I would really appreciate sending someone the code and having you take a look at it. Maybe another pair of eyes will help. Thank you so much. Leave your email or send me a message with your email.
2 AnswersProgramming & Design8 years agoHow to go about finding an artist for video game design?
I am currently working towards a CS degree in university, and there is an event coming up that will have us showcase our video games. We are allowed to form teams with others outside the major, so we can bring in musicians and artists, but I have no idea how to go about finding someone. Our department never interacts with the arts, so I dont know where to begin.
What I need is someone who is communicative, can draw very well using a computer, get the art done on time and not need to be paid for it more than having their name on the game and a copy for themselves. Obviously no money is involved since it's a university event. I don't care about credentials, just throughput.
On one hand I feel like I am asking too much, but on the other hand if an artist asked me to make a game of their art to enter into a contest, I'd think it was awesome.
1 AnswerVideo & Online Games8 years agoHow to go about finding an artist for video game design?
I am currently working towards a CS degree in university, and there is an event coming up that will have us showcase our video games. We are allowed to form teams with others outside the major, so we can bring in musicians and artists, but I have no idea how to go about finding someone. Our department never interacts with the arts, so I dont know where to begin.
What I need is someone who is communicative, can draw very well using a computer, get the art done on time and not need to be paid for it more than having their name on the game and a copy for themselves. Obviously no money is involved since it's a university event.
On one hand I feel like I am asking too much, but on the other hand if an artist asked me to make a game of their art to enter into a contest, I'd think it was awesome.
3 AnswersDrawing & Illustration8 years agoI am trying to design a java game with realistic physics?
Like the title says, I am writing a Java game and trying to include realistic trajectory physics. This sounded pretty easy to me but I think I have managed to make it way more complicated than it needs to be, and it's not working. Basically at this point, I have a guy throwing a ball, and the ball velocity and angle are based on the distance and angle from the guy that the mouse is clicked. The x,y of the mouse click are sent to the ball and the position is updated. This doesn't work *at all*. I can't figure out why not.
Really any pointers in the right direction would help. At this point I click on the screen and the ball simply disappears though it should be bounded by upper and lower max y.
This is the move method.
synchronized public void move(){
if(climbing){
if(newY == upperMax){ // test if can no longer move upwards / hit an obstacle. If hit, change to falling
shootXApex = newX;
falling = true;
climbing = false;
}
if(launchX > newX && climbing){ // shoot target to the right
if(newX< (deltaX) && newX< pWidth - missileHeight) // hasn't reached maximum shot trajectory or hit wall
newX = newX + (deltaX/tempo); // shoot right
newY = newY + yInFlight; // shoot up
}
else if(climbing){
newX = newX - deltaX/tempo; // shoot left
newY = newY - yInFlight; // shoot up
}
if(newX == shootXApex ||newY< upperMax || newY== upperMax){
climbing = false;
falling = true;
}
} // end if shooting
if(falling && newY> lowerMax){
// add line to check for platform landing
if(0<launchVectorAngle && launchVectorAngle<90){
newX = newX + deltaX/tempo; // fall right
newY = newY + yInFlight; // fall downwards
}
else{
newX = newX - deltaX/tempo; // fall left
newY = newY + yInFlight; // fall downwards
}
if(newY> lowerMax|| landed){// player has landed or gone off screen
falling = false;
}
maxHeight = false;
}
}
1 AnswerProgramming & Design8 years agoWeight /dimensions needed for model base?
I am trying to figure out what size base I need to build for a project I am working on. It will essentially be a 12" / 24" sheet of 1/4" cast acrylic standing straight up in a wooden base. I am worried that the model will be top heavy so want to take care of that in the design.
I've designed a base in 1/2" wood, haven't built it yet or chosen the wood type. The base is rectangular with feet sticking out on the front and back in an attempt to stabilize. Here is the design : http://wargoddesses.com/wp-content/uploads/2013/01...
I can add weights into the lower cavity in the base but cannot lower the acrylic any more without losing some of the design that will be printed onto it.
Thanks for any input.
1 AnswerDo It Yourself (DIY)8 years agoMIPs code programming?
am working on a mips program to convert numbers from ascii string into integers, with the parameter that it should accept positive and negative integer decimal strings. I know this is a pretty common a assignment but I wasn't able to resolve my problems online. I was able to get some tips, but still receiving errors when trying to run the program. I haven't been able to fix the errors, I have no idea what to do with them. I am getting bad address exceptions starting with this line "lb $t1, ($t0) # load $t1 = digit character"
This is my first time coding in assembly, please give me some guidance, I am completely lost.
Here is the code I have at this time:
.data
string: .byte '1','2','3','0' # create a 2-element character array
.text
main: # convert string to integer
lw $a0, string
li $t6, 0x00 # $t6 = 0
li $t7, 0x09 # $t7 = 9
li $v0, 0x00 # initialize $v0 = 0
lb $t0, ($a0) # $t0 = pointer to string
lb $t1, ($t0) # load $t1 = digit character
loop:
blt $t1, $t6, Done # check for each char < 0
bgt $t1, $t7, Done # check for each char > 9
subu $t1, $t1, $t6 # convert char to int
mul $v0, $v0, 10 # mult by 10 to shift value
add $v0, $v0, $t1 # add new digit to value
addiu $t0, $t0, 1 # point to next char
lb $t1, ($t0) # load next digit
bne $t1, $0, loop # repeat if not end of string
jr $ra # return integer
Done: #exit program if string not a number
li $v0, -1 # return -1 in $v0
jr $ra
1 AnswerProgramming & Design9 years agoHex to Decimal Conversion?
I am converting numbers from hex to decimal by hand, but just can't seem to understand how to go about it. I understand the basics, 0-9ABCDE, but for some reason this is still confusing me. What do I do with the zeros at the end of my hex number?
What decimal number do the following bit patterns represent if they are floating point numbers using IEEE 754 standard?
Hex: 0x0C000000
Hex: 0xC4630000
I just need to know how to do this by hand so a step by step would be amazing.
4 AnswersProgramming & Design9 years agorearrange this algebraically....?
Rearrange this:
(N+1)^3 + [(N(N+1))/2]^2
to look like this
[((N+1)(N+2))/2]^2
Rearrange this:
(N+2)! - 1
to look like this:
(N+1)! - 1 + (N+1)(N+1)!
Any help?
1 AnswerMathematics9 years agoHeap versus Tree (Java)?
I am having trouble defining the difference between a heap and a tree. I know that a heap IS a complete binary tree...so how do I differentiate? When would I use each?
Thanks.
1 AnswerProgramming & Design9 years agojava recursion definition?
I don't know where to begin on this question. I'm honestly not really sure what it's asking me to do.
public static int p(int x){
if(x < 3){
return x;
}
else {
return p(x - 1) * p(x - 3);
}
}
Let m(x) be the number of multiplication operations that the execution of p(x) performs.
a. write a recursive definition of m(x).
b. prove your answer to part a is correct using mathematical induction.
I don't want the answers, I want to understand how to do this on my own. Can someone give me an example or some help?
2 AnswersProgramming & Design10 years agoWhat would the title be?
I am trying to think of the name of the woman in charge of running a household. She's not the lady of the house, but is the head servant, so to speak.
If it matters, this is for an app I am writing which allows for the delgating of responsibilities. So, if the title I am trying to remember isn't good, please make suggestions!
3 AnswersWords & Wordplay10 years agoJava logic question for a board game?
I am writing a very simple program similar to tic tac toe. I have the entire program completed, except for the ability to look for a cat's game type scenario. I know how to detect whether the entire board has been filled, but want to be able to detect whether there are any options for scoring, without the entire board having to be filled.
For example, if you have this
Let's say you have a 4x4 board, with the following:
x _ o _
o o _ x
_ o x _
_ x _ o
There are still several open spots, but no one could possibly score based on the moves. Rather than spending the next 7 turns proving this by filling up the board I want a method that can detect that there is a cat's game. I need to be able to do this for board sizes up to 7x7. I can't seem to work out a way in my head to do this.
1 AnswerProgramming & Design10 years agoWhy is my array printing twice?
I am trying to print a 2d array, and for some reason it keeps printing twice. I can't figure it out...
Here is the loop i'm using, and what it prints.
{
int[][]gameBoard = {{1,2,3},{4,5,6},{7,8,9}};
{
for(int k = 0; k<gameBoard.length; k++)
{
for(int j = 0; j<gameBoard.length; j++)
{
System.out.print("| " + gameBoard[k][j] + " |");
}
System.out.println();
}
}
| 1 || 2 || 3 |
| 4 || 5 || 6 |
| 7 || 8 || 9 |
| 1 || 2 || 3 |
| 4 || 5 || 6 |
| 7 || 8 || 9 |
2 AnswersProgramming & Design10 years agoCheck values in an array (Java)?
Lets say I have a 3x3 array that looks like this:
1 2 3
4 5 6
7 8 9
Now, the program is running, placing letter values in the array and checking the array in whole every iteration. When the array looks like this:
A 2 3
A 5 6
A 8 9
or
A A A
4 5 6
7 8 9
etc, for any arrangement that has 3 matching values in a row. I need to be able to recognize this and perform an action. I was thinking the compareto method would work, but I haven't figured out a way to do this. I am not sure how to check values in specific array positions against a variable. Any suggestions?
It needs to: check for a tictactoe type conditon. If it exists, reset those positions back to their original values. If it doesn't, continue the method. It also needs to check for a catsgame type condition. Meaning, if all the spaces are filled but no tictactoe exists. Or enough of the spaces are filled that no tictactoe conditon *could* exist.
Please help!
2 AnswersProgramming & Design10 years agoSomething I must have missed in Java...?
So this will probably be a simple answer for most of you, but I guess I somehow never learned this in my first java class, and now it's important.
Lets say I am writing a program for a game. This game has a few different classes in it, and they need to be available to eachother.
We'll say I have a main method in the first class, which prompts the user for inputs, such as the size of the game board.
Now I have another method that creates the game board.
I have a third method that displays the game board.
a fourth method that places pieces etc.
So, what I need to do, is run the main method, take the inputs and run them in the "createboard", then use what I have to run "display board" and finally run the "addpiece" methods, followed by "displayboard" again. After this, addpiece and display board and whatever else is involved will need to be used again and again until the game is over.
Long question shorter....how do I call the other methods, get them to run, and then return to the main method so that I can call the next one?
It seems simple, I must be missing something.
1 AnswerProgramming & Design10 years agoJava coding question?
I am working on writing a text based game program, and am stuck at a few of the logistics. It's pretty clear that the jump in level as far as what I need to understand about java from the last class I took to this one is huge. Some of these things, I simply can't imagine what to do with them.
I am breaking the assignment down into pieces to make them more manageable.
I am at a point in the game where players need to put a piece onto a gameboard which I have created using ascii art and a 2D array. I put numbers into each of the array slots to begin the game to make space selection more intuitive for the user.
It should look like this, or similar, to give you an idea:
| 1 | 2 | 3 | 4 |
| 5 | 6 | 7 | 8 |
| 9 | 10 | 11 | 12 |
| 13 | 14 | 15 | 16 |
The formatting will be better, but you get the idea.
What I am confused about is how to do a check to make sure that the user selects a location that doesn't already have a piece placed on it. If it doesn't, the number gets replaced by a letter representing their name. If it does, they get and error and are told to place again.
How to I check to make sure there isn't a C, or J or whatever, and if there is, to repeat the prompt and check until they enter something valid?
I hope this makes sense lol.
Here is sort of what I have so far. I am using notepad so there may be bugs I have to fix, but I want general form right now.
// method to place a piece for player1
public static placePiece(int [][] gameBoard)
System.out.println( Player1Name + ", please place your piece by choosing a board location");
int addPiece = console.nextInt;
if(addPiece > boardSize*boardSize || addPiece < 1)
{
System.out.println("That is not a valid choice. Please choose an unoccupied space on the game board");
}
else??
{
}
1 AnswerProgramming & Design10 years ago