ImageImageImageImageImage

OT: Alex Jones freaks out on CNN

Moderators: dakomish23, Capn'O, j4remi, Deeeez Knicks, NoLayupRule, GONYK, mpharris36, HerSports85, Jeff Van Gully

J9Starks3
Assistant Coach
Posts: 3,897
And1: 1,195
Joined: May 22, 2007
Location: CT
       

Re: OT: Alex Jones freaks out on CNN 

Post#331 » by J9Starks3 » Wed Jan 9, 2013 1:52 am

21shumpshumpst wrote:A simple question here. If we eradicate guns from the hands of citizens would there be no more gun murders committed by citizens yes or no?


No - even in the UK there is still gun violence and gun murders. Is it less than in the US, of course, but it is not 0.
AndroidMan
Veteran
Posts: 2,953
And1: 262
Joined: May 06, 2010
   

Re: OT: Alex Jones freaks out on CNN 

Post#332 » by AndroidMan » Wed Jan 9, 2013 1:55 am

What about using MapReduce. I apologize, but I was having difficulty understanding this. Please take a few minutes and explain it to me. It may be harder to explain then your 2 cent code piece, but give it a shot, I have faith in you.
User avatar
johnnywishbone
General Manager
Posts: 9,698
And1: 1,361
Joined: Sep 04, 2009
Location: In the land where palm trees sway...

Re: OT: Alex Jones freaks out on CNN 

Post#333 » by johnnywishbone » Wed Jan 9, 2013 1:56 am

AndroidMan wrote:^^^^^

Nice. I'd probably join Android and Man together as AndroidMan otherwise your main won't be functionally correct, boy.


Here you go:

public static void main(String args[]) {
if(args[0].equalsIgnoreCase("Andoid Man".replaceAll("\\s",""))) {
System.out.println("BULL **** COMING -- SHUTTING DOWN SYSTEM.");
System.exit(0);
}
}
Play time is over.
21shumpshumpst
Banned User
Posts: 2,654
And1: 36
Joined: Aug 14, 2012

Re: OT: Alex Jones freaks out on CNN 

Post#334 » by 21shumpshumpst » Wed Jan 9, 2013 1:57 am

johnnywishbone wrote:
AndroidMan wrote:^^^^^

Nice. I'd probably join Android and Man together as AndroidMan otherwise your main won't be functionally correct, boy.


Here you go:

public static void main(String args[]) {
if(args[0].equalsIgnoreCase("Andoid Man".replaceAll("\\s",""))) {
System.out.println("BULL **** COMING -- SHUTTING DOWN SYSTEM.");
System.exit(0);
}
}

:rofl: :rofl: :rofl: :rofl:
AndroidMan
Veteran
Posts: 2,953
And1: 262
Joined: May 06, 2010
   

Re: OT: Alex Jones freaks out on CNN 

Post#335 » by AndroidMan » Wed Jan 9, 2013 1:58 am

johnnywishbone wrote:
AndroidMan wrote:^^^^^

Nice. I'd probably join Android and Man together as AndroidMan otherwise your main won't be functionally correct, boy.


Here you go:

public static void main(String args[]) {
if(args[0].equalsIgnoreCase("Andoid Man".replaceAll("\\s",""))) {
System.out.println("BULL **** COMING -- SHUTTING DOWN SYSTEM.");
System.exit(0);
}
}


or you could just write it efficiently and not waste a call to replaceAll(). Why not just equalsIgnoreCase("AndoidMan") and be efficient.
User avatar
johnnywishbone
General Manager
Posts: 9,698
And1: 1,361
Joined: Sep 04, 2009
Location: In the land where palm trees sway...

Re: OT: Alex Jones freaks out on CNN 

Post#336 » by johnnywishbone » Wed Jan 9, 2013 2:04 am

AndroidMan wrote:What about using MapReduce. I apologize, but I was having difficulty understanding this. Please take a few minutes and explain it to me. It may be harder to explain then your 2 cent code piece, but give it a shot, I have faith in you.


I've never had to use it professionally. And i've been out of school for 20 years. But looking at the wikipedia page it looks like a system for analyzing large sets of data to see repeating patterns. The fact that Google uses it in there search is probably a function of them processing large amount of web pages to see reoccurring patterns of keywords.
Play time is over.
AndroidMan
Veteran
Posts: 2,953
And1: 262
Joined: May 06, 2010
   

Re: OT: Alex Jones freaks out on CNN 

Post#337 » by AndroidMan » Wed Jan 9, 2013 2:09 am

johnnywishbone wrote:
AndroidMan wrote:What about using MapReduce. I apologize, but I was having difficulty understanding this. Please take a few minutes and explain it to me. It may be harder to explain then your 2 cent code piece, but give it a shot, I have faith in you.


I've never had to use it professionally. And i've been out of school for 20 years. But looking at the wikipedia page it looks like a system for analyzing large sets of data to see repeating patterns. The fact that Google uses it in there search is probably a function of them processing large amount of web pages to see reoccurring patterns of keywords.


Ya that's the basics. Much tougher in practice, but Google definitely employs it while scanning the web. Getting it setup in a distributed environment is a bitch. You passed the Basic computer science test. I'd be a dick and ask you some astrophysics concept I don't even know about, but I'll leave it at that.
AndroidMan
Veteran
Posts: 2,953
And1: 262
Joined: May 06, 2010
   

Re: OT: Alex Jones freaks out on CNN 

Post#338 » by AndroidMan » Wed Jan 9, 2013 2:11 am

AndroidMan wrote:
johnnywishbone wrote:
AndroidMan wrote:^^^^^

Nice. I'd probably join Android and Man together as AndroidMan otherwise your main won't be functionally correct, boy.


Here you go:

public static void main(String args[]) {
if(args[0].equalsIgnoreCase("Andoid Man".replaceAll("\\s",""))) {
System.out.println("BULL **** COMING -- SHUTTING DOWN SYSTEM.");
System.exit(0);
}
}


or you could just write it efficiently and not waste a call to replaceAll(). Why not just equalsIgnoreCase("AndoidMan") and be efficient.


neither your code or my suggestion would work. We both left out the R in AndroidMan. Fail on both of us.
User avatar
johnnywishbone
General Manager
Posts: 9,698
And1: 1,361
Joined: Sep 04, 2009
Location: In the land where palm trees sway...

Re: OT: Alex Jones freaks out on CNN 

Post#339 » by johnnywishbone » Wed Jan 9, 2013 2:13 am

AndroidMan wrote:
johnnywishbone wrote:
AndroidMan wrote:What about using MapReduce. I apologize, but I was having difficulty understanding this. Please take a few minutes and explain it to me. It may be harder to explain then your 2 cent code piece, but give it a shot, I have faith in you.


I've never had to use it professionally. And i've been out of school for 20 years. But looking at the wikipedia page it looks like a system for analyzing large sets of data to see repeating patterns. The fact that Google uses it in there search is probably a function of them processing large amount of web pages to see reoccurring patterns of keywords.


Ya that's the basics. Much tougher in practice, but Google definitely employs it while scanning the web. Getting it setup in a distributed environment is a bitch. You passed the Basic computer science test. I'd be a dick and ask you some astrophysics concept I don't even know about, but I'll leave it at that.


Now my turn. Please describe the difference between inheritance and interface and when you would use one over the other.
Play time is over.
AndroidMan
Veteran
Posts: 2,953
And1: 262
Joined: May 06, 2010
   

Re: OT: Alex Jones freaks out on CNN 

Post#340 » by AndroidMan » Wed Jan 9, 2013 2:18 am

johnnywishbone wrote:
Now my turn. Please describe the difference between inheritance and interface and when you would use one over the other.


I believe inheritance you have to initialize some variables and methods, while interfaces are implemented, rather then instantiated. As for their usage, I believe interfaces are used when you don't know what the values of certain variables or parameters may be until runtime. Thereby you kind of implement on the fly.

You can also simulate multiple inheritance while using interfaces.
User avatar
johnnywishbone
General Manager
Posts: 9,698
And1: 1,361
Joined: Sep 04, 2009
Location: In the land where palm trees sway...

Re: OT: Alex Jones freaks out on CNN 

Post#341 » by johnnywishbone » Wed Jan 9, 2013 2:19 am

AndroidMan wrote:
neither your code or my suggestion would work. We both left out the R in AndroidMan. Fail on both of us.


You can't pass Object[] args to the main method. I didn't think you could but I was looking for an easy way to show reflection.

And that's why when you get out of school you should avoid string literals. a better way would have been:

if(args[0].equalsIgnoreCase(AndroidMan.class.getName())
Play time is over.
AndroidMan
Veteran
Posts: 2,953
And1: 262
Joined: May 06, 2010
   

Re: OT: Alex Jones freaks out on CNN 

Post#342 » by AndroidMan » Wed Jan 9, 2013 2:23 am

johnnywishbone wrote:
AndroidMan wrote:
neither your code or my suggestion would work. We both left out the R in AndroidMan. Fail on both of us.


You can't pass Object[] args to the main method. I didn't think you could but I was looking for an easy way to show reflection.

And that's why when you get out of school you should avoid string literals. a better way would have been:

if(args[0].equalsIgnoreCase(AndroidMan.class.getName())


well that's making the assumption we are even doing a search for AndroidMan which isn't even evident in your code. Silly piece of code, which I even laughed at for the humor, only noticed the R later missing on.
User avatar
johnnywishbone
General Manager
Posts: 9,698
And1: 1,361
Joined: Sep 04, 2009
Location: In the land where palm trees sway...

Re: OT: Alex Jones freaks out on CNN 

Post#343 » by johnnywishbone » Wed Jan 9, 2013 2:24 am

AndroidMan wrote:
johnnywishbone wrote:
Now my turn. Please describe the difference between inheritance and interface and when you would use one over the other.


I believe inheritance you have to initialize some variables and methods, while interfaces are implemented, rather then instantiated. As for their usage, I believe interfaces are used when you don't know what the values of certain variables or parameters may be until runtime. Thereby you kind of implement on the fly.


An object can only inherit from one class but an object can implement many interfaces. Interfaces only define the methods that an object has to implement. You can inherit an instance variable from your super class but not from an interface. Interfaces are often used in delegation.

You get a C on that. Show a method in any language where two instance variable swap their values.
Play time is over.
AndroidMan
Veteran
Posts: 2,953
And1: 262
Joined: May 06, 2010
   

Re: OT: Alex Jones freaks out on CNN 

Post#344 » by AndroidMan » Wed Jan 9, 2013 2:34 am

johnnywishbone wrote:
AndroidMan wrote:
johnnywishbone wrote:
Now my turn. Please describe the difference between inheritance and interface and when you would use one over the other.


I believe inheritance you have to initialize some variables and methods, while interfaces are implemented, rather then instantiated. As for their usage, I believe interfaces are used when you don't know what the values of certain variables or parameters may be until runtime. Thereby you kind of implement on the fly.


An object can only inherit from one class but an object can implement many interfaces. Interfaces only define the methods that an object has to implement. You can inherit an instance variable from your super class but not from an interface. Interfaces are often used in delegation.

You get a C on that. Show a method in any language where two instance variable swap their values.


Damn, I was really trying to ace this internet pop quiz as well. i didn't even bother google the info. Damn it.

swap(int a, int b)
{
int temp = a;
a = b;
b = temp;
}
User avatar
johnnywishbone
General Manager
Posts: 9,698
And1: 1,361
Joined: Sep 04, 2009
Location: In the land where palm trees sway...

Re: OT: Alex Jones freaks out on CNN 

Post#345 » by johnnywishbone » Wed Jan 9, 2013 2:40 am

AndroidMan wrote:
Damn, I was really trying to ace this internet pop quiz as well. i didn't even bother google the info. Damn it.

swap(int a, int b)
{
int temp = a;
a = b;
b = temp;
}


Sure you didn't? http://stackoverflow.com/questions/1039 ... es-in-java

:lol: :lol: :lol: :lol:
Play time is over.
AndroidMan
Veteran
Posts: 2,953
And1: 262
Joined: May 06, 2010
   

Re: OT: Alex Jones freaks out on CNN 

Post#346 » by AndroidMan » Wed Jan 9, 2013 2:44 am

johnnywishbone wrote:
AndroidMan wrote:
Damn, I was really trying to ace this internet pop quiz as well. i didn't even bother google the info. Damn it.

swap(int a, int b)
{
int temp = a;
a = b;
b = temp;
}


Sure you didn't? http://stackoverflow.com/questions/1039 ... es-in-java

:lol: :lol: :lol: :lol:


certainly didn't google for inheritance and interfaces, but most def did for swap function. Even better if using instance variables for classes, assuming there are appropriate setter and getter methods contained in the skeleton of the class as required, which I'm not writing out.

public void swap( AndroidMan a, AndroidMan b ) {
int JInt;

JInt; = a.getJInt();
a.setJInt(b.getGetJInt());
b.setJInt(JInt);
}
User avatar
johnnywishbone
General Manager
Posts: 9,698
And1: 1,361
Joined: Sep 04, 2009
Location: In the land where palm trees sway...

Re: OT: Alex Jones freaks out on CNN 

Post#347 » by johnnywishbone » Wed Jan 9, 2013 2:50 am

AndroidMan wrote:
certainly didn't google for inheritance and interfaces, but most def did for swap function. Even better if using instance variables for classes, assuming there are appropriate setter and getter methods contained in the skeleton of the class as required, which I'm not writing out.

public void swap( AndroidMan a, AndroidMan b ) {
int JInt;

JInt; = a.getJInt();
a.setJInt(b.getGetJInt());
b.setJInt(JInt);
}


That code makes no sense. And it certainly wouldn't compile.

if you want to swap the values of two AndroidMan objects it would have to be

void swap(AndroidMan a, AndroidMan b) {
AndroidMan x = a;
a=b;
b=x;
}
Play time is over.
AndroidMan
Veteran
Posts: 2,953
And1: 262
Joined: May 06, 2010
   

Re: OT: Alex Jones freaks out on CNN 

Post#348 » by AndroidMan » Wed Jan 9, 2013 2:56 am

johnnywishbone wrote:
AndroidMan wrote:
certainly didn't google for inheritance and interfaces, but most def did for swap function. Even better if using instance variables for classes, assuming there are appropriate setter and getter methods contained in the skeleton of the class as required, which I'm not writing out.

public void swap( AndroidMan a, AndroidMan b ) {
int JInt;

JInt; = a.getJInt();
a.setJInt(b.getGetJInt());
b.setJInt(JInt);
}


That code makes no sense. And it certainly wouldn't compile.

if you want to swap the values of two AndroidMan objects it would have to be

void swap(AndroidMan a, AndroidMan b) {
AndroidMan x = a;
a=b;
b=x;
}



wouldn't that just swap the class instances of AndroidMan themselves and all of its memeber values? If we just wanted to swap an instance variables from 2 separate androidMan instances my code is applied for that, as I assumed we were speaking of specific instance variables inside of a class to swap.
User avatar
johnnywishbone
General Manager
Posts: 9,698
And1: 1,361
Joined: Sep 04, 2009
Location: In the land where palm trees sway...

Re: OT: Alex Jones freaks out on CNN 

Post#349 » by johnnywishbone » Wed Jan 9, 2013 3:10 am

AndroidMan wrote:
wouldn't that just swap the class instances of AndroidMan themselves and all of its memeber values? If we just wanted to swap an instance variables from 2 separate androidMan instances my code is applied for that, as I assumed we were speaking of specific instance variables inside of a class to swap.


FIrst there are a bunch of compilation problems - I'll overlook those as typing into a text box.

Second, the test was to swap the value of two instance variables. Objects can be instance variables, just like a primitive. So I don't know why you are trying to show two objects swapping values of a specific attribute? Really the answer I was looking for (if you were going to use Java) was something like this:

void swap(Object a, Object b) {
Object x = a;
Object b = a;
Object a = b;
}

Then you could use the same method to swap values of different types (provided it's not a primitive)...

GTG - can't believe how much time I spent in here today.
Play time is over.
AndroidMan
Veteran
Posts: 2,953
And1: 262
Joined: May 06, 2010
   

Re: OT: Alex Jones freaks out on CNN 

Post#350 » by AndroidMan » Wed Jan 9, 2013 3:20 am

johnnywishbone wrote:GTG - can't believe how much time I spent in here today.


Yep, way too much time spent here myself as well. Till next time.

Return to New York Knicks