TRENDING NEWS

POPULAR NEWS

I Need The Exact Code For The Out Put

Analyze the following code segment and write the exact output the code would produce. - Java?

So why can you not do this?

It will not be difficult to place this code into a basic program to see what happens.

Have fun.

My python code keeps outputting NONE?

I have this horoscope python code where I use functions 3 functions to be exact one to get the western zodiac sign, another to get the chinese, and the last one is main. The output results in a NONE and I don't know how to fix it. None of my code uses loops it's all based on if-elif-else statements. Here's a little snippet of my code

elif month == "september" "September" "SEPTEMBER":
if date > 23:
return Libra
else:
return Virgo

So if i type in when my program asks me my birthday September 25 it outputs "your western zodiac sign is None". I also tried printing it instead of returning but that didn't work either

What would be the output of this code below?

I am sorry but the given answers are incorrect. Before answering your question why are you casting integers to pointers? What are you trying to achieve? This isn't standard C. return type of main() should be int not void. Conio.h isn't Standard C header. If you want to perform subtraction of 2 numbers is there any need to use pointers?This isn't valid C program. By default gcc compiles this program successfully as a compiler extension. If you -Wall option then it gives you following warning: [Warning] initialization makes integer from pointer without a cast [enabled by default]If you use -pedantic-errors to remain strict with ISO C then compiler reports following error:[error] initialization makes integer from pointer without a cast [enabled by default].See live demo here C++ Shell when compiled using C++ compiler.

Why does this Java code segment have this output?

This was the code segment:

public class Counter
{
private int value;

public int getValue()
{
return value;
}

public void count()
{
value = value + 1;
}
. . .
}

Counter points = new Counter();
Counter passengers = new Counter();
points.count();
passengers.count();
points.count();
System.out.print(points.getValue() + " " + passengers.getValue());


And it's output is apparently 2 0.
That is the answer and I have no idea why. Please explain!! Thanks.

Deep Learning: I have solved UFLDL "Exercise: Sparse Autoencoders", but have trouble adding G. Hinton's Dropout technique + the maxout activation function. How can I do this?

I am writing this on vacation on my phone, so I can't give you some exact code. However, I have used dropout while fine tuning stacked autoencoders with success. I don't use it during pertaining, however. Anyway, the important thing to note for dropout is that you need to "zero" out both random unit activations/outputs during feedforward (when training), AND the "deltas" (error terms) when backpropagating. If you need more detail, I can dig up a code segment for you.


does not work in my PHP code?

Try this:
echo ($x += 2) . "
";

The reason why it will work that way:

If you do

echo $x += 2 . "
";

PHP first translates this to

$x = $x + 2 . "
";
echo $x;

Since $x is 8 before these lines, the first one amounts to:

$x = 8 + 2 . "
";

This means PHP is adding integer variables, and in that context, appending text isn't defined, so PHP ignores the command.

If you add the parentheses, the calculation takes place first, then text is appended to the result, at which point PHP will turn the integer variable into text first.

What will be the output of the following java code segment:?

int[][] a = {{0, 0, 0, 0, 0},{0, 0, 1, 2, 3}, {0, 1, 3, 5, 7}, {0, 2, 5, 8, 11}};
for (int i = 0; i < a.length; i++) {
for (int j = 0; j < a[i].length; j++) {
System.out.print(a[i][j] + " ");
}
System.out.println();
}

TRENDING NEWS