« first day (1647 days earlier)      last day (3306 days later) » 
02:00 - 18:0018:00 - 21:00

2:34 AM
G'mornin'
 
Morning
 
Hello
 
beep beep
 
Happy birthday (yesterday) @Mr.777
 
@mikeeustace Thanks
 
2:47 AM
Anyone got a good resource for java 'problems'? (beginner)

I've been working my way through exercise books and tutorials so understand various methods and how to use them.

Don't know what to do from there though.
For example, one of my courseworks had a quesiton "write a compound interest code..."

another had a 'write a code that converts the user inputted time to 24 hour time"...
 
@mikeeustace May be implement a tic tac toe (command line based)?
 
I'm trying to simulate a robots movement to store some arraylist objects in two, 2-d arrays. Basically a robot going down an isle handing off the object to the correct bin... anyone have good idea how to implement this?
 
What's wrong so far? @well
 
I created an Robot object class for all the tasks performed by the robot. Just feel like my code is getting rather lengthy!
 
That sounds like an interesting thing to try... thanks Mr.777
 
2:52 AM
lol I can think of so many things -- mainly the end of semester and brain fried!
 
Be back later when I'm stuck :)
 
@mikeeustace Sure
@wellington Is it multithreaded application?
 
I've created an arraylist of inventory items in the main class -- the robot needs to grab an item from the list and decide on where to place it based on type of item number it has.
 
@wellington By the way, what's the question? Is a lengthy code your problem or you stuck in some other problem?
 
I think I'm just looking for some reassurance that I'm not getting too far off track.
The first part of the problem states that we should place the inventory at position evenRow[0][0] and grab the next available item before dispatching the robot.
In order to do this, I created an Inventory class that build the data from a file and stores it into an ArrayList. I think thought storing the object at position [0][0] would be a good idea, now I'm not so sure.
 
3:01 AM
@wellington Why at position [0][0]?
 
It seems pointless to do it this as it serves no real purpose.
per the assignment
 
There can be more than one items, right?
 
Yes, there are 56 in total.
 
user3208640
 
4:38 AM
I have code which draws a circle - or should. Instead it's an oval. I can't see a problem with the code. Can Windows do it or must it be a problem with my code.
http://pastebin.com/056yGWnK

the width and height are both set to the same variable - a variable changed by the slider.
Thanks
 
5:13 AM
I don't know swing :/
 
Alright - thanks anyway.
I can't see why it would happen. I guess it's not too important as the lesson was about learning the slider anyway.
 
fge
Moo
 
5:39 AM
I've written some data to a file within my main class -- is there any practical use for reading that data directly back from the main class?
 
Morning:)
 
good evening
 
 
1 hour later…
6:48 AM
hello geeks, i want to stop submitting the form when i press the F5 or refresh the JSP
 
7:13 AM
@greenhorn Look up POST-redirect-GET.
 
@MadaraUchiha on struts i prevented this using redirect="true" but i was looking now for individual servlet
 
2 mins ago, by Madara Uchiha
@greenhorn Look up POST-redirect-GET.
 
7:26 AM
good morning
 
7:42 AM
 
some people...
better agree with myself in the internet, so I can get this warm feeling??
 
@Vogel612 I know right?
@MadaraUchiha I agree.
@MadaraUchiha me too bro.
 
this looks even more retarded here...
 
beep beep
 
8:17 AM
nyan-coin.org omg cool :D
 
java morning
 
mava jorning.
 
mavi jornang.
 
stahp
 
mari jovnang
 
8:23 AM
Why can't I telnet into the address for nyan cat anymore??
 
I can
@Unihedron nyancat.dakko.us 23
 
Awesome! :D Thanks!
I forgot the "23".
 
ermagherd..
 
<- seizure
 
of joy or hatred?
 
8:27 AM
Joy.
 
Pure joy.
 
Apr 22 at 15:21, by Unihedron
@fge I bless you from the tainted sands of eternal unforgiving hate.
 
@Unihedron @Vogel612 telnet towel.blinkenlights.nl
 
that's the starwars movie, right?
 
So cool :D
 
8:51 AM
if i got my List<Object> mm printed as >>> []
does that satisfy this condition?
mm != null
?
 
... what?
 
or that is only satisfy isEmpty() ?
i'm following through a server log.
I have a sysout for mm : []
 
fge
null would print null, so yes it means the list is empty
 
^^^
 
Thank you
 
8:56 AM
isEmpty is actually just a shorthand for size() == 0
 
Yes, it is.
 
in both cases, if the collection is actually null, you'll get a NPE
 
(Un)fortunately, Java doesn't support ints as conditional expressions, so return size(); as a boolean like in C++ or JS doesn't work.
[0, 1, 2, 3].map((value) => Boolean(value))
// false, true, true, true
 
@Unihedron If you reduce to an array, you're doing it wrong.
Use .map()
!!> [0, 1, 2, 3].map(Boolean)
 
8:59 AM
@MadaraUchiha [false,true,true,true]
 
:D
 
@Unihedron ^
Boolean is a function that accepts one parameter.
You can pass it directly.
 
Awesome!
 
Very useful with .filter(Boolean)
 
!!> [0, 1, 1, 0, 2].filter(Boolean)
 
9:00 AM
@Unihedron [1,1,2]
 
Filter out all the falsy values.
 
dis is gr8 m8 8/8
 
@MadaraUchiha what if you want to keep 0, but filter the rest??
 
!!> var not = fn => (...args) => !fn(...args); [0,1,2,3].filter(not(Boolean));
 
@MadaraUchiha "SyntaxError: expected expression, got keyword 'return'"
@MadaraUchiha [0]
 
9:02 AM
var not = fn => (...args) => !fn(...args);
 
!!> var not = fn => (...args) => !fn(...args); [0,1,undefined, undefined,2,3].filter(not(Boolean));
 
@Unihedron [0,"undefined","undefined"]
 
Takes a function that takes any number of arguments, and returns a function that returns the opposite boolean for any given argument set.
function not(fn) {
    return function(...args) {
        return !fn(...args);
    }
}
 
Is there a jQuery function?
 
@Unihedron Yes, jQuery is a function (with methods)
So you most definitely can have
 
9:04 AM
I mean, for inverting a function.
 
Ah, not likely.
lodash or backbone may have one.
@Unihedron things I really like to do
var selectors  = ['#id', '.class', 'span', 'span#with.complex.selector'];
var elements = selectors.map(document.querySelector.bind(document)); // Now has elements
 
Oh?
I can imagine this being immensely helpful when used together with Immutable.JS. xD
 
fge
@MadaraUchiha I thought functions were first class citizens... How come you can't do var notFn = !fn? :p
 
@Unihedron functional programming is extremely helpful.
@fge You can
But all functions are truthy, so by definition, !fn will always return false.
 
@fge !fn gives false. Because fn is a function.
 
9:07 AM
Which isn't very helpful.
 
In fact, you can polyfill with:
if (!Array.isArray)
  // implement isArray for IE users
 
@fge This: var not = fn => (...args) => !fn(...args); in how many lines can you implement this in Java? :P
 
fge
I don't care, I don't need that in Java :p
 
@fge Sure you do.
 
fge
Well, no, not me
 
9:09 AM
@fge You do, you just don't know it :P
 
Like oh so many lines 'cuz you also would have to extend and overload for the many types of FI's
 
I thought the same until I discovered how powerful this stuff is. And with Java8 you can (kind of) do that as well.
 
fge
Meh, I use boolean expressions or, where applicable, a Predicate
 
@fge Here's an example
 
fge
Meh, functional programming is overhyped
 
9:10 AM
public static void <T> Predicate<T> not(Predicate<T> tester) {
    return value -> !tester.test(value);
}
 
You want to make sure that all the elements in the stream are found in a Set
@Unihedron -> ?
 
fge
It's just another paradigm and Xxx zealots seem to happily forget about this
(where Xxx == Scala in particular)
 
@MadaraUchiha Whoops
I don't get why Java 8 lambda expressions has to use -> instead of =>. xD
 
@fge You want to make sure that all the elements in the stream are found in a Set, and if they don't, throw an exception with the elements of the stream that are missing from the Set.
 
fge
@MadaraUchiha stream.allMatch(setCopy::remove) -- job done
 
9:11 AM
Though, Predicates in Java comes with not in a default function:
=javadoc Predicate#negate
 
Did you mean this one? (type the number)
1. java.util.function.Predicate#negate()
 
YES
1
 
@Unihedron Predicate negate(): Returns a predicate that represents the logical negation of this predicate.
 
> and if they don't, throw an exception with the elements of the stream that are missing from the Set
 
That would make it (Predicate<T>) Clazz::someBooleanFunctionOfT).negate()
 
9:13 AM
@Unihedron Ew. Interface methods.
 
Can someone help me in understanding an answer? In the scenario given here why is it fine for println() to invoke toString() but not for user code?
 
fge
@MadaraUchiha easy
I don't need advanced features for that -- heck, I don't need lambdas
 
@KshitizSharma "why is it fine for println() to invoke toString() but not for user code" <- what?
 
fge
Shorter code and better are not synonyms :p
 
If you look into the JDK implementation, println(Object) invokes Object.toString.
 
9:15 AM
@fge Of course you don't, you can do it pretty simply with a loop
But I think the following is a lot nicer than a loop:
 
morning
 
Loops indicate behaviour fighting against the implementation. I find lambda forms clearer, but that's just me.
@Nisk Good morning.
 
@Unihedron how do you do
 
if (!params.every(foundIn(mySet)) {
    throw new MissingFromCollectionError(params.filter(not(foundIn(mySet))));
}
 
@KshitizSharma What is "the user code"?
 
9:17 AM
@Unihedron test.get(0).toString()
 
fge
<--- struggling with InterSystems at the moment
 
@KshitizSharma Because .get(0).toString() resolves to Quod.toString(). When .get(0) is called. an Object is loaded. get(0).toString attempts to cast the Object at index 0 into a Quod to invoke toString(), which throws an exception.
 
Java Pattern class needs serious bug fix regarding integer overflow behavior...
 
@Unihedron .get(0) should also return an Object. I don't see any code for a cast in JDK.
 
Whereas .get(0) resolves to Quod. Its only matching signature for println() is Object, hence the JVM instance calls Object.toString and there is no casting.
@KshitizSharma .get(0) returns Quod because test is ArrayList<Quod>.
 
fge
9:21 AM
NPAPI is dead
Yay
 
@fge source?
 
@Unihedron But <Quod> is erased at runtime. Effectively making it ArrayList<Object> does it not?
 
@KshitizSharma <Quod> is not erased at runtime.
Only if obj.get(0) is used will it be, but test.get(0) is called instead.
 
Still not understood. But I'll go read some documentation. Thanks for your help Unihedron
 
Anyway, using rawtypes with generics is a ticket for guarranteed failure, just take the question as a counter-example, lol.
=javadoc Predicate#isEqual
 
9:26 AM
Did you mean this one? (type the number)
1. java.util.function.Predicate#isEqual(Object)
 
@Unihedron Predicate isEqual(Object targetRef): Returns a predicate that tests if two arguments are equal according to Object).
 
Am I the only one who thinks this method should be renamed to isEqualTo()?
 
no you aren't
 
Can the bot return anything for private methods? (Meh, probably not, seeing as it links to docs)
 
9:29 AM
> We offer:

Multi display setup, new computer, you choose OS.
Fridge stocked with fruits, soft drinks.
Flexible working hours
5 day work week
Informal environment
attractive
@nhahtdh The bot stores the javadocs of the Oracle docs, as well as a few libraries like Guava. If it's generated in the docs, you can look it up.
 
"you choose OS"... if it's like at my current company you'll just get strange looks for coming with a linux system
 
I think the default visibility level is protected+.
@Vogel612 what about solaris? :)
 
meh...
 
> Experience using Git, *n?x and Docker is appreciated.
 
it's like... 50% windows, 50% mac and me
 
9:31 AM
But hey say what now like you're a real programmer if you have no experience with git wtf?
 
@Vogel612 at my current company you get funny looks if you don't :D
 
and everybody was like: "Ohmigawd you be using Linux"
Better use Mac instead
 
LOL
Mac IS linux
 
(nobody suggested Windows ;))
 
@Unihedron is Unix
small difference, but meh
 
9:32 AM
Oh right
 
well actually it's a POSIX system...
 
the kernal is different
 
Macs are shite
 
*n?x
 
I have one, I can't do real work on it
 
9:32 AM
> Skills & Requirements

You need to be a real programmer.
I should apply.
 
lol
 
5 hours sleep. what is real life
can't drink any more coffee until I rehydrate
 
9:48 AM
@Unihedron "I heard it pays to code and it's the future and stuff, but what is this"
 
 
2 hours later…
11:21 AM
ohh just great..
 
there once was somebody who though it was a good idea to represent a Yes/No choice with a mandatory pair of Radio buttons
but the mandatory part was not enforced on client-side, no
it was enforced server-sided.
and instead of assuming a reasonable default value (namely false) they thought it a good idea to just stop the whole damn process
 
LOL made me giggle
 
yea you..
now the customer decided "remove that retarded server sided check"
(buried in thousands of LoC)
and my CEO interpreted that as: "Hey let's remove the whole form field and just send a false there"
so that's what I did.
 
Uh oh. Ho ho ho, that's not good.
 
11:27 AM
now the customer tested and said: "Why did you remove it, I wanted to keep these Radio Buttons"
 
blame the CEO :D
 
Luckily nobody said it's my fault yet
 
WHY did TheLostMind not just instaclose this piece of crap?
 
@MadaraUchiha You mean del vote?
 
11:29 AM
@Vogel612 known rep-wh0r3
 
20k user adding an answer to question??
that's at least three of the 10 greatest sins of programming!
 
it was like that since rev 1
 
beep beep
 
please del-vote it, just to not have that guy get 30 rep.
 
^^^^
 
11:31 AM
thank you ;)
 
@nhahtdh your generosity of investing the del-vote helps generations
 
@Unihedron I'm extremely generous with my del votes, though the queue doesn't allow me to spend all of it :P
 
@Vogel612 lucky yew..
 
1
Q: How can I get rid of the tiny fish-bone stuck in my throat upon eating fish?

deadlydragon00My dinner is a fried Milkfish. While I am eating a portion of this fish I feel a tiny bone is stuck near my throat.

wow on hold next to close :D
 
well, you better clarify that...
 
11:40 AM
hmmm , Im not sure how to elaborate it more
 
Ugh, I still can't get the unity hotcorners right. It only works on my secondary display, but not on primary.
 
@Vogel612 never delete anything the client asks you to delete - because this happens
 
@Nisk wrong idea
use version-control
you can always roll back"!
 
11:42 AM
+
 
and if you delete: do it right
 
I broke my 100+ consecutive days streak yesterday..
only because I am home :(
 
monst0r blocks of comments don't help anyone
 
until the product is shipped, I comment out though, because I can't be arsed searching for revision numbers
 
@ItachiUchiha so sorry :(
 
11:42 AM
it saved me a lot of time
 
but hey, the gold badge is in a better place now.
 
yeah it is, but I kinda like seeing the number of days when I use to visit my profile :P
 
> visited 345 days, 66 consecutive
OMG I MISSED A DAY
~do { rage++; } while (!(rage-100));
 
tnx for the comment @Vogel612
@uni it looks like a holiday :D
 
It was a holiday. I took a break from SO 'cuz too much crap
However I got this so it's ok :D
 
11:49 AM
@Unihedron hehe
 
Hi all, i am doing a project on "online payments", the payment process are handled by the payment gateway i am just calling and passing the value to the web service so should i use only JSP or servlets for this simple work
 
Both of them are a bad idea, but for academic purposes, they'll do.
Roll a dice to pick a random one of them.
 
@Unihedron are you saying this to me?
 
Yes.
Wait no, your chair.
 
@Unihedron what was again the cheap VPS hosting you mention before?
 
11:52 AM
@deadlydragon00 VPSNodes mentioned by @MadaraUchiha?
 
Ah alright!
 
ok
 
but where is OakBot hosted?
 
fge
~maven--
 
@deadlydragon00 on Michael's AWS
 
11:54 AM
okie
 
fge
Meh, subprojects with gradle: one line in settings.gradle; with maven: uh, no real subproject support
 
i hate people who does sarcasm:(
 
@greenhorn Sarcasm is the spice of conversations.
Not everyone likes spicy food. I don't blame you.
 
i don't like too...
@fge can you give some suggestions on this?
 
fge
Sorry, I have no idea -- and I'm working right now
 
@Unihedron what is this?
 
@greenhorn This is me trashing your duplicate messages.
 
@greenhorn He trashed your duplicated message
 
12:20 PM
Hiya folks!
 
yawns
@GamesBrainiac Hey
 
@GamesBrainiac Hello, hello! We meet again!
 
@Mr.777 I need a little bit of help regarding java, or rather dealing with jars. I wish to get the runtime of a program without the overhead of the jvm start-time. Now, I know you can do this by changing the program itself, and importing a few magical stdlib methods. However, is there any way to do this without changing the program itself?
@Unihedron Hello my friend! How are you doing this fine day?
 
terribad
tired
 
@GamesBrainiac Sorry, I don't know how to do this. But may be @Uni @Vog or @fge can help
 
12:25 PM
@Unihedron What happened?
 
skool iz a pita
 
I see.
 
@GamesBrainiac You mean loading the runtime directly with an argument?
 
So this is how i get the runtime of a program time <program> args
However, with a java jar file, if all you're doing is printing something out to the console it takes time, for example, printing two lines to the console took 1 second.
So, how do I get the runtime without the jvm-startup time and do that without changing the original program
 
Ohhh, I don't think you can
 
12:29 PM
@GamesBrainiac stupid solution: run an empty java program and subtract its runtime to your program's runtime
;P
 
The JVM has to be started up to run bytecodes because that's kinda the entire point to Java
 
i wonder if you can have a compile server somehwere that just gives you the run time for the jar file
 
You can run Java as a script through an execution engine, I guess.
 
Probably running an agent and let it time your stuffs?
Anyway, I might be talking non-sense, since I haven't written one myself
 
12:31 PM
I was thinking that. But no idea where to even start doing that.
 
ummm 1 sec
maybe this will help? github.com/rolfl/MicroBench
Eh, never mind.
I really don't think this is possible.
 
Conceptually, you will need to inject timing right before and right after main function executes
 
Benchmarking Java code is not easy anyway, since the JIT warms up and computes faster over time,
 
I think it is possible with external library (which will likely do some magic via instrumentation API)
 
Hey, Can you hadle keys without using swing components ?
 
12:39 PM
@10101101 Which keys?
 
Any like escape for example or F3 4 etc
 
But it must be user dependent... is it ?
 
@10101101 Someone will have to press the key, right? Or may be you can mock and press the keys from program too.
 
The redesigned Youtube player at /testtube looks so beautiful.
 
Abi
12:42 PM
Hey, May I possibly ask a very elementary question : What is the difference between a multidimensional array in java and an array of arrays? ( I seem to be confused especially between the declaration of a matrix and say int [][] b = new int [5][])
 
Unfortunately robot is not to be used here
 
@Abi none
Java "multidimensional" arrays are rigged arrays - arrays of arrays.
 
The program is meant to have no gui, only few keys to handle what it does there is
 
Abi
then why is int[][] triangle = new int[5][] a one dimensional array?
 
I mean it would be best, but if it is impossible then I will have no option...
 
12:45 PM
@Abi It's a one-dimensional array of arrays.
 
Abi
@Unihedron I mean how do i then write a rectangular array with 5 rows and say undecided (yet) number of columns?
 
Use [5][], but swap rows with columns?
 
Abi
hehe, or rather a better question (or more stupid ) is what is an array of arrays :P help me
would this be : say int[][] triangle = { {1,2}, {2,3,4}, {3,5,6}}
 
valid
 
an array, where the individual elements are arrays themselves
 
12:52 PM
there you go
 
Abi
then int[5][] means ? {{{1},{2},{3},{4},{5}}, {}}
aahhh got that @Unihedron thank you for the drawing :D :D :D
 
int[5][] creates {null, null, null, null, null} where each spot can be an int[].
 
Abi
OH i see.. perfect !!
 
You're welcome ^-^
 
Abi
Thank you !!
 
1:03 PM
hi
how can I modify a jar file??
 
@hossein touch filename
 
??
 
rightclick -> rename
 
no name?
I want to modify css filein a jar file
how can i do that?
 
unzip it
 
1:06 PM
I want to hack into the Pentagon so they order me free pizza.
 
it's a zip file
@Unihedron let's
 
I do this but when i zip that again some file losed
 
u'll need to provide more details... ask a question...
 
fge
@hossein open the zip as a FileSystem, copy the file somewhere, modify it, copy it back
 
Which really just boils down to "modify it". xD
 
fge
1:52 PM
Grr, I hate raw JDBC
 
@fge I'm sure raw JDBC hates you as well.
 
2:18 PM
@fge What is raw JDBC?
 
@Mr.777 look it up online.
 
@Unihedron I have looked but I am now confused in two things:
I get it the first one is Raw data-type. Pardon me for my lack of knowledge about oracle database
 
.....
 
2:56 PM
Hacker Implants NFC Chip In His Hand To Bypass Security Scans And Exploit Android Phones http://www.forbes.com/sites/thomasbrewster/2015/04/27/implant-android-attack/
 
 
3 hours later…
5:55 PM
http://www.commitstrip.com/en/2015/04/27/the-eye-opener-commit/
CommitStrip - Blog relating the daily life of web agencies developers
The eye-opener commit
CommitStrip
1430157094
 
02:00 - 18:0018:00 - 21:00

« first day (1647 days earlier)      last day (3306 days later) »