yardbarker

OT: Alex Jones freaks out on CNN

Moderators: moocow007, magnumt, NoLayupRule, Brooklyn_Yards, mrpoetryNmotion, j4remi, Knickstape1214, GONYK, Thugger HBC, Thorn

Post#331 Re: OT: Alex Jones freaks out on CNN
Tue Jan 8, 2013 8:52 pm by J9Starks3

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.
J9Starks3




Starter
User avatar
Posts: 2,003
And1: 59
Joined: May 22, 2007
Location: CT
Top

Post#332 Re: OT: Alex Jones freaks out on CNN
Tue Jan 8, 2013 8:55 pm by AndroidMan

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.
AndroidMan
Veteran
User avatar
Posts: 2,631
And1: 111
Joined: May 6, 2010
Top

Post#333 Re: OT: Alex Jones freaks out on CNN
Tue Jan 8, 2013 8:56 pm by johnnywishbone

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.
johnnywishbone
General Manager
User avatar
Posts: 9,333
And1: 1,128
Joined: Sep 4, 2009
Location: In the land where palm trees sway...
Top

Post#334 Re: OT: Alex Jones freaks out on CNN
Tue Jan 8, 2013 8:57 pm by 21shumpshumpst

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:
21shumpshumpst
Veteran
Posts: 2,655
And1: 36
Joined: Aug 14, 2012
Top

Post#335 Re: OT: Alex Jones freaks out on CNN
Tue Jan 8, 2013 8:58 pm by AndroidMan

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.
AndroidMan
Veteran
User avatar
Posts: 2,631
And1: 111
Joined: May 6, 2010
Top

Post#336 Re: OT: Alex Jones freaks out on CNN
Tue Jan 8, 2013 9:04 pm by johnnywishbone

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.
johnnywishbone
General Manager
User avatar
Posts: 9,333
And1: 1,128
Joined: Sep 4, 2009
Location: In the land where palm trees sway...
Top

Post#337 Re: OT: Alex Jones freaks out on CNN
Tue Jan 8, 2013 9:09 pm by AndroidMan

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
User avatar
Posts: 2,631
And1: 111
Joined: May 6, 2010
Top

Post#338 Re: OT: Alex Jones freaks out on CNN
Tue Jan 8, 2013 9:11 pm by AndroidMan

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.
AndroidMan
Veteran
User avatar
Posts: 2,631
And1: 111
Joined: May 6, 2010
Top

Post#339 Re: OT: Alex Jones freaks out on CNN
Tue Jan 8, 2013 9:13 pm by johnnywishbone

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.
johnnywishbone
General Manager
User avatar
Posts: 9,333
And1: 1,128
Joined: Sep 4, 2009
Location: In the land where palm trees sway...
Top

Post#340 Re: OT: Alex Jones freaks out on CNN
Tue Jan 8, 2013 9:18 pm by AndroidMan

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.
AndroidMan
Veteran
User avatar
Posts: 2,631
And1: 111
Joined: May 6, 2010
Top

Post#341 Re: OT: Alex Jones freaks out on CNN
Tue Jan 8, 2013 9:19 pm by johnnywishbone

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.
johnnywishbone
General Manager
User avatar
Posts: 9,333
And1: 1,128
Joined: Sep 4, 2009
Location: In the land where palm trees sway...
Top

Post#342 Re: OT: Alex Jones freaks out on CNN
Tue Jan 8, 2013 9:23 pm by AndroidMan

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.
AndroidMan
Veteran
User avatar
Posts: 2,631
And1: 111
Joined: May 6, 2010
Top

Post#343 Re: OT: Alex Jones freaks out on CNN
Tue Jan 8, 2013 9:24 pm by johnnywishbone

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.
johnnywishbone
General Manager
User avatar
Posts: 9,333
And1: 1,128
Joined: Sep 4, 2009
Location: In the land where palm trees sway...
Top

Post#344 Re: OT: Alex Jones freaks out on CNN
Tue Jan 8, 2013 9:34 pm by AndroidMan

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;
}
AndroidMan
Veteran
User avatar
Posts: 2,631
And1: 111
Joined: May 6, 2010
Top

Post#345 Re: OT: Alex Jones freaks out on CNN
Tue Jan 8, 2013 9:40 pm by johnnywishbone

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.
johnnywishbone
General Manager
User avatar
Posts: 9,333
And1: 1,128
Joined: Sep 4, 2009
Location: In the land where palm trees sway...
Top

Post#346 Re: OT: Alex Jones freaks out on CNN
Tue Jan 8, 2013 9:44 pm by AndroidMan

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);
}
AndroidMan
Veteran
User avatar
Posts: 2,631
And1: 111
Joined: May 6, 2010
Top

Post#347 Re: OT: Alex Jones freaks out on CNN
Tue Jan 8, 2013 9:50 pm by johnnywishbone

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.
johnnywishbone
General Manager
User avatar
Posts: 9,333
And1: 1,128
Joined: Sep 4, 2009
Location: In the land where palm trees sway...
Top

Post#348 Re: OT: Alex Jones freaks out on CNN
Tue Jan 8, 2013 9:56 pm by AndroidMan

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.
AndroidMan
Veteran
User avatar
Posts: 2,631
And1: 111
Joined: May 6, 2010
Top

Post#349 Re: OT: Alex Jones freaks out on CNN
Tue Jan 8, 2013 10:10 pm by johnnywishbone

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.
johnnywishbone
General Manager
User avatar
Posts: 9,333
And1: 1,128
Joined: Sep 4, 2009
Location: In the land where palm trees sway...
Top

Post#350 Re: OT: Alex Jones freaks out on CNN
Tue Jan 8, 2013 10:20 pm by AndroidMan

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.
AndroidMan
Veteran
User avatar
Posts: 2,631
And1: 111
Joined: May 6, 2010
Top

PreviousNext

Return to New York Knicks


Who is online

Users browsing this forum: Calendorce, Indomitable, Jeffrey, kenneyy88, lliiknicksiill33, nyk97, NYKBaller, Rock Bottom, youngthegiant