« first day (1640 days earlier)      last day (3300 days later) » 
00:00 - 11:0011:00 - 23:00

12:49 AM
Wow...
Google really does suck :/
"Here's a folder, by clicking the link in this mail you will gain access without logging in"
*clicks link*
LOGIN OR FUCK OFF*

*Not the exact quote
 
 
1 hour later…
1:59 AM
\o/ praise the moon
 
2:33 AM
hello :D
Im looking for someone i can program with :D java obviously
 
hello
 
erro cx
 
3:15 AM
@LuisAverhoff One what per hour? Souls? What are measurements without units?
 
@Unihedro one twinkie per hour.
Hey I never said he wasn't cheap.
 
What's that?
 
Something for you too while you're programminh our doomsday device
programming* damn
Wouldn't want you to go hungry
 
What are you smoking?
 
Not much. Just have fun with you.
 
3:28 AM
hello :D
 
\o hello
 
@Phoenix Hiya!
 
hello Luis!!!! im new to this chat thing just got past my 20 reputation today
hello uni :D
 
Congrats!
 
good job
 
3:30 AM
anyways i see you guys are in a java chat and im pretty new to java so i was wondering if one of you 2 would like to help me out with some of it? maybe teach me some new stuff?
 
in Teenage Programmers Chatroom, 10 hours ago, by Unihedro
If you think some random teenagers could teach you more than a book, you're messed up
 
i have a book...
 
Go to this page, it has free resources for learning to code. sayhelloworld.webs.com/list-of-free-resources
 
i just wanted someone i could program with...
 
How far have you gotten into the book?
 
3:32 AM
Oh, cool!
Pick up an open source project or something. ;)
Or you can try code challenges on a site that provides it.
 
got that one..
got it off barnsanobel
uh i say im "ok" for a begginer its just some of the stuff can be confusing
 
@try some of the questions from project Euler if you're into math problems
 
Jul 22 '14 at 1:29, by aliteralmind
http://codingbat.com
 
@Unihedro that too
 
@LuisAverhoff Those are math problems, they're also too challenging on logic over programming fundamentals.
I recommend codingbat.com and codewars.com
If you sign up for CodeWars, use "Stack Exchange" as your clan so you can complete with us
 
3:34 AM
yea i write alota math problems in my code ill also make up some fake applications for like work or something when i wana practice with my strings and all that stuff
 
True but I'm just giving him options
 
@Phoenix Fake stuff is fake :p
 
what are you suggesting?
 
50 secs ago, by Unihedro
I recommend http://codingbat.com and http://codewars.com
2 mins ago, by Unihedro
Pick up an open source project or something. ;)
I just said...
@LuisAverhoff I'm just comparing your options so the better decision can be chosen.
 
No i ment when you said "fake stuff is fake stuff"
 
3:35 AM
Time is limited. :P
42 secs ago, by Unihedro
2 mins ago, by Unihedro
Pick up an open source project or something. ;)
 
hm....sounds like something i might do
 
You could try java light game if you're into that
 
Mocking up scenarios are not productive.
 
well im learning java so i can eventuly learn how to code android applications
 
How many times will you be hired by a car development company anyway? (spoiler alert: possibly never)
 
3:36 AM
Yea never
 
So do something that you have use for. Like a tool for browsing the web easier, managing your personal accounting, or something like that.
 
If you're going for android applications, it wouldn't hurt to learn XML.
 
im gona learn that sometime later
 
Or just give up.
 
thats a bit rude...
 
3:37 AM
@Unihedro too soon
 
@LuisAverhoff Once a coder forever a coder. :P
 
@Unihedro you're statement got me thinking of that video "we be coding hard in our cubicles."
your* damn it
 
Eh, you can always edit a message by selecting it with your up arrow key.
 
Will watch that when I'm at home.
 
3:43 AM
I think I'm going to go and create skynet. Cya guys.
 
=javadoc Stream
 
@Unihedro java.util.stream.Stream: A sequence of elements supporting sequential and parallel aggregate operations. The following example illustrates an aggregate operation using Stream and IntStream: (1/12)
 
=javadoc Integer
 
@Unihedro java.lang.Integer: The Integer class wraps a value of the primitive type int in an object. An object of type Integer contains a single field whose type is int. (1/3)
 
4:05 AM
@OakBot :)
 
@LuisAverhoff Type =help to see all my commands.
 
 
1 hour later…
5:34 AM
is having set/get methods in a class an example of breaking encapsulation?
 
Hello everyone ...
 
HI when does sessionCreated() will be called in the HttpSessionListener interface
 
Greeting from Bulgaria
 
anyone??
 
5:52 AM
Hello Strangers!
@cp101020304 nope
 
@ItachiUchiha Are there varying opinions on this topic? Because my lecturer at uni thinks that it is an example of breaking encapsulation and I do not agree at all. I can understand that if you have private fields, and then go on to create public get/set methods, then you might as well have public fields.
However, in my code, I have private fields but have only created "get" methods. This would just allow for value fetching as opposed to fetching and setting values. Does that sound like good encapsulation to you?
 
6:08 AM
I mean to me it makes sense
 
6:25 AM
Is there a difference between arrays in C and arrays in Java?
 
@ItachiUchiha Hello stranger!
@cp101020304 Yes, definitely.
 
@Unihedro what are the difference(s)?
 
Arrays in Java are abstractions of a mutable object type - They're not real arrays in that you can manipulate with them like one.
They're also not guaranteed to have a sequential address in memory, especially when you convert a StringBuffer to byte[].
You can verify this by accessing Unsafe.
For example, in C++, a byte[] can be converted to a byte[]* and then long*.
 
what do you mean by mutable object type?
 
Do you know what Object types in Java are?
 
6:27 AM
yes
 
There are stateful objects and non-stateful objects. Stateful objects can be either mutable or immutable.
!!google immutable vs mutable java
 
oohhhh a mutable object is one that can have its fields changed
 
Yes.
Arrays allows you to specify an index with [index] and therefore read / write.
 
Do you mind if i just keep asking a lot of questions? I have a test coming up soon
 
6:31 AM
You better not rely on what I say as reliable material for academic usage.
 
of course not
 
Schools follow a deprecated academic set of knowledge that you should reply with instead.
Just note that Java arrays are like C++ arrays except that multi-dimensional Java arrays are ragged, where C++ multi-dimensional arrays are regular.
Of course, Java arrays are again not really arrays, just representations of arrays. You can however use them like one with utility methods from the Java API, which will manipulate with them like one. So it all lines up behind the Java API.
@cp101020304 I don't really mind, I'm just killing time until I can go home. :)
You can implement 0x5f3759df using Float.toLongBits(), for example.
Fast inverse square root (sometimes referred to as Fast InvSqrt() or by the hexadecimal constant 0x5f3759df) is a method of calculating x−½, the reciprocal (or multiplicative inverse) of a square root for a 32-bit floating point number in IEEE 754 floating point format. The algorithm was probably developed at Silicon Graphics in the early 1990s, and an implementation appeared in 1999 in the Quake III Arena source code, but the method did not appear on public forums such as Usenet until 2002 or 2003. At the time, the primary advantage of the algorithm came from avoiding computationally expensive...
 
Cool, thanks. The thing is, the questions that are gonna be in the test are multi-choice. Not just any multi-choice though. They ask what option is "most true" and "most false" which is quite annoying
 
Heh, I love those.
After each of those tests in my class I rant a minute each about how wrong the sample answers are, and the teacher gives up and give me the points anyway.
 
wish I could do that, but unfortunately I don't know shit
or pretty close to not knowing shit
@Unihedro what did you think about my question regarding encapsulation earlier?
 
6:43 AM
Your lecturer's stance is ridiculous.
 
He also cited this as justification:
http://www.javaworld.com/article/2073723/core-java/why-getter-and-setter-methods-are-evil.html
 
2003?
This article also compares the Java design with that of the C design, which is premature.
 
my thoughts exactly when I read the date
I guess i've been cursed hahahah
 
Hello Java!
 
Which of the following statements is most true regarding the difference
between some features of C and Java?
(a) The if statements are different.
(b) The while statements are different.
(c) The for statements are different.
(d) All of the above.
d?
 
6:47 AM
"Bear in mind that I haven't actually put any UI code into the business logic. I've written the UI layer in terms of AWT (Abstract Window Toolkit) or Swing, which are both abstraction layers."
^ I'm opening a bounty. Whoever that murders the author of this article gets five cookie points.
(If you collect 10 cookie points you can exchange them with me for a cookie.)
 
im thinking d because Java requires conditionals to be boolean?
 
I'm not sure what this asks for, but it's either none or d.
 
fge
Moo
@cp101020304 that's a strange question but on syntax alone they are of course different, since statements and expressions are different; logically they do exactly the same though
 
7:15 AM
Could be also referring to the enhanced for loops. A terrible question in any case
 
I'm not surprised. Schools suck.
 
7:56 AM
What good is a lambda expression?
 
it invokes the metafactory with an indy instruction
the expression is spinned up as an instance of the functionalinterface through linkage and is more efficient than creating and constructing an anonymous class.
 
Is this syntactic sugar or more?
 
8:14 AM
far more
 
for example...
 
17 mins ago, by Unihedro
the expression is spinned up as an instance of the functionalinterface through linkage and is more efficient than creating and constructing an anonymous class.
 
8:30 AM
good morning and Bonjour
 
what is the "protected" modifier actually useful for?
 
@cp101020304 subclasses?
 
"The protected modifier specifies that the member can only be accessed within its own package (as with package-private) and, in addition, by a subclass of its class in another package."
Does that mean that the declaration is visible to other classes?
 
stuff like shared functionality in abstract classes
sure it is, but only for subclasses
 
8:43 AM
ah i see. thanks @Vogel612
 
abstract class Example {
     public abstract void toImplement();
     protected final sharedFunctionality(){
           // do some cool stuff here
     }
 }
and then you have a class implementing it:
 
"protected" useful when creating unit tests
 
  public class Implementation extends Example {
       @Override
       public void toImplement(){
             sharedFunctionality();
       }
 }
 
@Vogel612 so "Implementation" is a sub-class of Example?
 
yep
because it extends example
 
8:46 AM
cool, that makes sense :)
oh
 
new Implementation() instanceof Example should return true
 
and does the same thing apply to interfaces?
if you're implementing an interface?
 
yes, but interfaces usually don't have final methods..
 
why not?
 
mostly because interface methods aren't allowed to have method bodies for non-static methods (aside from default methods, but eh)
 
fge
8:48 AM
And even then default methods can't be final
 
mostly because that'd be idiotic, right?
 
fge
Indeed :p And in this case that wouldn't be an interface but an abstract class anyway
 
RIP
 
@cp101020304 All interface methods are implicitly public and abstract. In other words,
you do not need to actually type the public or abstract modifiers in the
method declaration, but the method is still always public and abstract.
@cp101020304 All variables defined in an interface must be public, static, and final—
in other words, interfaces can declare only constants, not instance variables.
 
9:09 AM
Can you have two methods that share the same name?
but different parameters?
 
yes
different parameters types
 
it's called "overloading"
 
or different count parameters
 
public void hello (String[] lol)
and
public void hello(String hi)

in the same class?
is that valid
 
yes
 
9:11 AM
and when the "hello" method is invoked onto an object, java will choose which method depending on what I pass in as the parameter?
 
fge
Well, that's the principle of overloading
 
will probably have to read up on that, i was just asking out of curiosity
 
@Mikhail cheers, will have a look
 
wait
you cannot declare the same methode twice in the same class
we say overload when we have an hiritence
even with differents type of parameters
@cp101020304 public void hello (String[] lol)
and
public void hello(String hi)
thats false
 
9:22 AM
@fahdijbeli the document that Mikhail linked has an example that does exactly the same thing I tried to do
 
@fahdijbeli um... get your facts straight
you're confusing "overload" with "override"
 
but if Class A has public void hello (String[] lol)
and class B extends A you can Overlod or override
 
override
and only override
but not if the method's declared final
 
^ with the exception of super crazy power runtime mock
 
Fields are variables that are accessible from code anywhere in a class
◦ the scope of the fields is the entire class, from the opening “{“ to the
closing “}” (fields can be used “before” their declaration)
"(fields can be used “before” their declaration)"

^^ what does that mean?
 
9:30 AM
It means that they can be used before they're declared as long as it's declared.
 
that is the most confusing thing i've ever read
example pls??
 
Then you've never seen confusing things.
 
public class Example {
     public void doSomething(){
          myField = value;
    }
    public Object myField;
}
 
class Foo {
  {
    System.out.println(MEH);
  }
  private static final String MEH = "meh";
}
 
what the f
okk..
 
are private,public and protected the only modifiers that you can "assign" to fields?
 
There's also package-private. You get it by not having an access modifier.
 
Packages contain a bunch of classes right? and if a field has the "package-private" modifier then you can access that field from any of the classes in that particular package?
 
yes
 
@cp101020304 or method, or type
==src/com/unihedro/Test.java
public class Test {}
class Foo{}
==src/com/unihedro/Bar.java
public class Bar {
  static {
    Foo foo = new Foo();
  }
}
 
9:42 AM
ooooooo kewl
ta
are public fields really as bad as everyone makes it out to be?
 
who said public fields are bad?
If you really want absolutely everybody messing with the internal state of your class that's great
 
well my notes say that they are almost always bad
probably for the exact same reason
if you're trying to encapsulate then you wouldn't want fields being changed by random code
 
thinking about it like that makes it obvious, right?
 
very
why can't everything be this easy
LOL
 
@cp101020304 "Almost always" -> for what?
You can't just say "this design is bad" without pointing out that you're worrying about efficiency / accessibility / maintainability / essence / formatting / conventions / insert concern here.
If using public is bad, Java is bad.
 
9:56 AM
bad for accessibility i guess
 
10:18 AM
@AniketDeshmukh I'm trying to transcribe Turk Tech's remix of The Last Samurai. In F#. Minor.
 
Woot, Photoshop Commercial License GET!
 
anyone here have experience in writing game hacks?
 
Hi @XianyiYe! Nice to see one from Beijing!
@cp101020304 Say what now?
You're aware a "game hack" has nothing to do with programming?
 
yes, but im pretty sure it requires a little bit of code?
 
10:30 AM
Nope.
Does life hacks require code now too?
You're mixing up cheats with hacks.
That's like claiming hackers are crackers.
 
well I guess I meant cheats then?
 
gaming.stackexchange.com/questions/ask label it with [cheats] and see if anyone responds about your query
 
i dont have a specific query though
i was just curious LOL
 
@Gemtastic ping
Need your advice wrt a Sweden query :P
 
10:47 AM
if you refer to a static field from a non-static method, it will not compile, correct?
 
@cp101020304 It will.
The other way around will not.
 
will that compile?
 
(i.e. calling an instance method/variable from a static method/variable)
!!tell cp101020304 format
lol
 
i pressed ctrl K
 
10:50 AM
@cp101020304 Copy code from source (with spaces and everything), then press CTRL+K
 
Just don't dump code. :p
@cp101020304 False, it does compile.
And it works, actually.
 
is a gyazo screenshot of the code ok?
 
No because we're bots, not humans. We can't recognize code from pictures.
 
@Test
public void testBakeThrowsIfMandatoryParametersMissing() throws Exception {
    final LoaderBaker baker = new LoaderBaker("", "", null);
    try {
        baker.bake(new HashMap<String, Object>());
        fail("baker.bake() should have thrown but didn't.");
    } catch (RuntimeException e) {
        assertEquals("parameters map must contain the following elements: " +
                "globalConf, clientConf, styleConf, locale, publisher and version.", e.getCause().getMessage());
    }
}
@cp101020304 It should look similar to this, with indentation and everything ^
Copy, Paste, CTRL+K, Enter
 
im not copying from a source though, its from a PDF so wont have the indentation
 
fge
10:52 AM
Aah, Java 8 is really nice
 
js beautifier
 
!!tell cp101020304 google Java beautifier online
 
@SecondRikudo Command java does not exist. (note that /tell works on commands, it's not an echo.)
@SecondRikudo Don't be annoying, drop the @, nobody likes a double-ping.
 
@CapricaSix ffs
 
10:54 AM
public class Card {
	private static int code;
	public static void setCode(int c) {
		code = c;
	}
	private int getRank() {
		if (code <= 0 || code > 52) {
			return -1;
		}
		int rank = code % 13;
		if (rank == 0) {
			return 13;
		} else {
			return rank;
		}
	}
}
better?
 
Yup
@cp101020304 That looks like it should work without a problem.
 
Since "code" is a static field, won't it throw an error when you try and use it in getRank()?
because getRank() isn't static?
 
nope
you'll access it just fine
 
@cp101020304 non-static can access static.
 
the instance references its static field because static fields are "global" in this sense.
 
10:56 AM
static cannot access non-static.
 
static int ids = 0;
int id = ++ids;
 
@Unihedro ++ids?
 
id = 1 for first instance, id = 2 for second instance, etc. *assuming no race conditions
@SecondRikudo I blame my keyboard ;D
Thanks!
 
@Unihedro I blame what's between it and the chair.
 
madara pls
 
10:58 AM
cp pls
 
y u do dis
 
00:00 - 11:0011:00 - 23:00

« first day (1640 days earlier)      last day (3300 days later) »