Teacher: "You can't do spaces in HTML. If you see spaces on web pages, then they must be using java to override basic HTML. Java saved the Internet, because it removes limitations of HTML, but it's beyond the scope of this course to show you how to do it."
While working on a programming project in highschool with a friend, I mentioned to him that if he really wants to name his variables things like x, xx, and xx2, he should at least put comments saying what they're used for.
The next time I looked over his shoulder, I saw this:
int x; // x is an int
At my previous job, we were porting a UNIX system to Windows NT using Microsoft VC++. A colleague of mine, that was in the process of porting his portion of the code, came to me, looking really upset.
* Colleague: "Hey! I hate these Microsoft guys! What a rotten compiler! It only accepts 16,384 local variables in a function!"
The functions are sitting in a bar, chatting (how fast they go to zero at infinity etc.). Suddenly, one cries "Beware! Derivation is coming!"
All immediately hide themselves under the tables, only the exponential sits calmly on the chair.
The derivation comes in, sees a function and says "Hey, you don't fear me?"
"No, I am e to the x", says the exponential self-confidently.
"Well" replies the derivation "but who says I differentiate along x?"
Some people say the glass is half full, others say it's half empty. Engineers say the glass is twice as large as it needs to be.
There are three engineers in a car; an electrical engineer, a chemical engineer and a Microsoft engineer. Suddenly the car just stops by the side of the road, and the three engineers look at each other wondering what could be wrong.
The electrical engineer suggests stripping down the electronics of the car and trying to trace where a fault might have occurred.
The chemical engineer, not knowing much about cars, suggests that maybe the fuel is becoming emulsified and getting blocked somewhere.
Then, the Microsoft engineer, not knowing much about anything, comes up with a suggestion, 'Why don't we close all the windows, get out, get back in, open the windows again, and maybe it'll work !?'
QuoteThere are three engineers in a car; an electrical engineer, a chemical engineer and a Microsoft engineer. Suddenly the car just stops by the side of the road, and the three engineers look at each other wondering what could be wrong.
The electrical engineer suggests stripping down the electronics of the car and trying to trace where a fault might have occurred.
The chemical engineer, not knowing much about cars, suggests that maybe the fuel is becoming emulsified and getting blocked somewhere.
Then, the Microsoft engineer, not knowing much about anything, comes up with a suggestion, 'Why don't we close all the windows, get out, get back in, open the windows again, and maybe it'll work !?'
really? spoiler boxes are really screwing up today, it said 404th post.
more:
1-800-404 : The subscriber you are trying to call does not exist
1-800-403 : Access to that subscriber was denied
An infinite amount of mathematicians walk into a barNo, no, no, NO! The bartender is wrong! Two pints is not the correct answer; he must pour a fraction less than two pints that may or may not be subjected to a floating point rounding error that makes 1.999999999999999999999999999999999... = 2. :P
The first walks up the the bartender and orders a pint of bear
The second walks up and orders a half pint
The third walks up and orders a fourth of a pint
The bartender interrupts and says "I understand" and pours two pints!
mhmm... what kind of easter egg? ???more:
1-800-404 : The subscriber you are trying to call does not exist
1-800-403 : Access to that subscriber was denied
Um, missing final four digits?
EDIT: DJ ... You should make that an OmnomIRC easter egg...
An infinite amount of mathematicians walk into a barNo, no, no, NO! The bartender is wrong! Two pints is not the correct answer; he must pour a fraction less than two pints that may or may not be subjected to a floating point rounding error that makes 1.999999999999999999999999999999999... = 2. :P
The first walks up the the bartender and orders a pint of bear
The second walks up and orders a half pint
The third walks up and orders a fourth of a pint
The bartender interrupts and says "I understand" and pours two pints!
mhmm... what kind of easter egg? ???more:
1-800-404 : The subscriber you are trying to call does not exist
1-800-403 : Access to that subscriber was denied
Um, missing final four digits?
EDIT: DJ ... You should make that an OmnomIRC easter egg...
No need for an Easter Egg, it happens on it's own. :Pmhmm... what kind of easter egg? ???more:
1-800-404 : The subscriber you are trying to call does not exist
1-800-403 : Access to that subscriber was denied
Um, missing final four digits?
EDIT: DJ ... You should make that an OmnomIRC easter egg...
No, no, no, NO! The bartender is wrong! Two pints is not the correct answer; he must pour a fraction less than two pints that may or may not be subjected to a floating point rounding error that makes 1.999999999999999999999999999999999... = 2. :P
Technically there is an asymptote at Y=2, so the bartender never gets all the way there. However, the calc would round it to 2 after a while. :PNo, no, no, NO! The bartender is wrong! Two pints is not the correct answer; he must pour a fraction less than two pints that may or may not be subjected to a floating point rounding error that makes 1.999999999999999999999999999999999... = 2. :P
Lol wait are you saying that he needs to pour less because there is no rounding error or because there is? XD
Exactly... I.L.
One of the deadly mistake of programming(At least, I think...)
I.L... Infinite Loop.
I meant mine.I.L... Infinite Loop.
It's not infinite, though...
Btw, Apple's headquarters is located at 1 Infinite Loop :D I'm serious.
import java.awt.*;
import javax.swing.*;
import java.util.Random;
import java.awt.Graphics;
public class Test
{
public static void main(String[] args)
{
int b = 1;
JFrame frame = new JFrame("Cause why not?");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(300,50);
Container pane = frame.getContentPane();
DrawingPanel panel = new DrawingPanel("LOL");
pane.add(panel);
frame.setVisible(true);
while(2*b==1 || 2*b!=1) // that is the question...
panel.repaint();
}
}
class DrawingPanel extends JPanel
{
private String str;
public DrawingPanel(String s)
{
str = s;
}
public void paintComponent(Graphics g)
{
super.paintComponent(g);
Random rand = new Random();
g.setColor(new Color(rand.nextInt(256),rand.nextInt(256),rand.nextInt(256)));
g.drawString(str,4,30);
}
}
No!!! :O
EDIT: Of coure I tried
Ok. Because of kyllopardiun, I won't risk trying.Code: ( "Cause why not?") [Select]import java.awt.*;
import javax.swing.*;
import java.util.Random;
import java.awt.Graphics;
public class Test
{
public static void main(String[] args)
{
int b = 1;
JFrame frame = new JFrame("Cause why not?");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(300,50);
Container pane = frame.getContentPane();
DrawingPanel panel = new DrawingPanel("LOL");
pane.add(panel);
frame.setVisible(true);
while(2*b==1 || 2*b!=1) // that is the question...
panel.repaint();
}
}
class DrawingPanel extends JPanel
{
private String str;
public DrawingPanel(String s)
{
str = s;
}
public void paintComponent(Graphics g)
{
super.paintComponent(g);
Random rand = new Random();
g.setColor(new Color(rand.nextInt(256),rand.nextInt(256),rand.nextInt(256)));
g.drawString(str,4,30);
}
}
i had to :p
haha well you need to compile it first... and it really wouldn't do much harm. it DOES create an infinite loop, but you can press ctrl+b to break out of it. it displays a window and then displays the string "LOL" over and over, each time in a different color. but the colors change so fast you can't really tell
Use BlueJ, right?
haha well you need to compile it first... and it really wouldn't do much harm. it DOES create an infinite loop, but you can press ctrl+b to break out of it. it displays a window and then displays the string "LOL" over and over, each time in a different color. but the colors change so fast you can't really tell
CTRL+C, right?
man, I love the "prevent additional dialogue option for Chrome. :PIn opera it's also safe to try the code which I've posted...
It scrolls?
interface IMadness
{
void Method()
{
// There is a method to my madness.
}
}
#define true false // Happy debugging!
I like this one: 1f u c4n r34d th1s u r34lly n33d t0 g37 l41dCode: [Select]#define true false // Happy debugging!
Or #define if whilelol :P
"WHY ARE MY IFs LOOPING?!?!"