« first day (1619 days earlier)      last day (3320 days later) » 

12:20 AM
Shots fired!
 
 
1 hour later…
1:20 AM
@Gemtastic That kinda looks like me... >.>
 
Now I know what you kinda look like! mwuahaha
I should learn how to debugg
 
 
2 hours later…
3:53 AM
Who's around?
 
You.
 
and you!

Can you see what's wrong with my code?
http://pastebin.com/RD2MkGyf

Error - The method Nextint() is undefined for the type java.util.Scanner

I'm sure it's simple, I just can't see what it is!
 
It's nextInt not Nextint
=javadoc Scanner#nextInt
 
Which one do you mean? (type the number)
1. java.util.Scanner#nextInt()
2. java.util.Scanner#nextInt(int)
 
1
 
3:57 AM
@Unihedro int nextInt(): Scans the next token of the input as an int. (1/2)
 
Thanks @Unihedro - bloody capitilisation! :)
I've spent 30 minutes staring at that!
 
@Gemtastic Aww, I thought it was the other way.
@mikeeustace protip: get an IDE that provides autocompletion
 
:P
 
Windows sucks. :P
 
One to recommend Unihedro?
 
4:00 AM
Even Netbeans provides support for that I think
My candidates would be Netbeans, Eclipse and IntelliJ Idea, in ascending order.
 
Okay. I tried Eclipse but couldn't get on with it. I'll install Netbeans. Thanks
 
Eh, do you have a computer from the 80s or something?
 
@Unihedro You don't have to run windows on a windows computer you know
If you love macOS you can run it on a PC
And get all the goods only a lot cheaper
 
OS X can only be installed on an Apple computer, it's how their software works.
 
That is false
 
4:03 AM
I had a machine as a hackintosh a few years ago
They can run on certain CPUs
 
Yes, the OS require a certain hardware, but it's still cheaper to buy said hardware and build it yourself as a hackintosh than to buy it
 
That's 6850 Hackintosh.
4770 Hackintosh and 6850 Hackintosh's aren't derivatives of OS X.
 
As most things are with mac stuff; you have to do it as they dictate. That also goes for their sound format. Mac sound format isn't better, it's just that in order to release a sound file as a mac sound file, you have to master it in a way that's good. You can master it like shit if you want to, it's just that Mac can sue you then
 
... that's irrelevant
I don't use hackintosh or mac either.
 
4:09 AM
are you a nix person Uni?
or windows, but you still hate it!
 
Ubuntu
I'm at a school computer and using windows 7, and it sucks
 
I run Mint (XFCE) on my laptop. If I didn't play games on my proper PC, I don't think I'd run win (8.1)
 
I don't play games. :P
 
that's why you're a far better coder than I am lol
 
No way, I'm a terrible coder.
 
4:13 AM
Modest Uni is modest
 
Truth.
me no liez
 
haha @gem
 
Uni is a big troll whenever he says he's bad at programming.
 
No way, I'm serious :p
 
You can tell because he suddenly starts typing like his age does
Only thing missing is him saying his bae ís better than him
 
4:18 AM
:)

In if / else, can you keep on adding conditions eg, if b <=10 && c > 23 && xyz == 25... ?
 
Yes, as long as it evaluates to boolean.
 
googles 'evaluates to boolean'
 
Unlike C++, Java optimizes away most of those expression into one heap of them (pun intended).
@mikeeustace Wait, you don't know what an expression is?
 
I think so.
 
4:20 AM
depends on how you want it. You can maka many if cases in your if/ else by writing:
if(condition){
    // todo
}else if(otherCondition){
    // todo
}else if (thirdCondition){
    // todo
}else{
    // if all else fails do this
}
 
That's arrow code. :p
 
okay, but isn't that for lots of different outcomes. If there is only a print 'yes' or print 'no
 
or you could add to it like this if you want all conditions to be true:
if(a && !b && c){
// do stuff
}
 
if (a == b && b == c && c == d && d == e && e == f && f == g)
 
outcome, then a longer combination of conditions would be better?
 
4:22 AM
no
If you ever have a long expression, drop it and replace it with a function.
'Cuz single responsibility principal.
 
there's the || as well, it reads as "or".
if(a || b){
   // do stuff
}
 
If you evaluate more than 7 things in one line, you're probably doing it in an unreadable & unmaintainable way.
 
^^
 
1 min ago, by Unihedro
If you ever have a long expression, drop it and replace it with a function.
 
Thanks. Whenever you help me here, I end up with a post-it note list of things to read up on :)
 
4:24 AM
public boolean checkIfTheseNumbersAreInRange(int b, int c, int xyz) {
  return b <= 10 && c > 23 && xyz == 25;
}
@mikeeustace Oh, you're welcome.
 
Why don't you just pick up the oracle trail and read straight through it?
 
The actual code I wanted to write (just messing around, make sure I understand) is

if (boy > 18 && boy < 60 && girl > 18 && girl < 60) {
 
is that your dating range? ;P
 
if (inRange(boy, 18, 60) && inRange(girl, 18, 60))

private static boolean inRange(int val, int min, int max);
 
yep... just don't tell my wife!
 
4:26 AM
Or you could use Math.clamp(boy, 18, 60) != boy
=javadoc Math#clamp
 
@Unihedro Sorry, I can't find that method. :(
 
44
A: Does java have a clamp function?

Matt Ball Is there any built in function for clamping to a range? No.

 
Thanks!
 
Dammit!
 
@Unihedro nothing's stopping you from making one
 
4:28 AM
does inRange need a library imported?
 
@Gemtastic Feels like reinventing the wheel.
@mikeeustace No, that's your job.
Notice I had private static boolean inRange(int val, int min, int max); right after it. Finish that method by taking away the ; and with { [method body] }
 
@Unihedro well, since someone already invented it you can just convert it into java
 
Where do you define the method?
 
Somewhere in the class.
 
4:34 AM
anywhere?
 
Anywhere.
This isn't C++ and ordering of methods aren't important.
 
thanks
 
@Unihedro I was kinda glad when I realized that
 
I need to go in 2 mins, but can you give me a hint as to where this is wrong?

Scanner input = new Scanner(System.in);

int boy, girl;

System.out.println ("Enter boy's age");
boy = input.nextInt();

System.out.println ("Enter girl's age");
girl = input.nextInt();

private static boolean inRange (int val, int min, int max); {
if (inRange(input, 18, 65) && (inRange(input, 18, 65))) {

System.out.println ("You can enter");

}else{

System.out.println ("You can not enter");

}


Thanks
Error - syntax error on token ","
 
private static boolean inRange (int val, int min, int max); <--- you end the method here{
remove it
is all that in a method or have you written it in a plain class?
 
4:42 AM
here's the code
one method, I guess
I was just reading about if / else and think I jumped ahead of myself! running before you can walk etc...
Got to go. Thanks for the help @Gemtastic @Unihedro - as always
 
np
 
 
2 hours later…
6:46 AM
And suddenly my login breaks for no reason O.o
Annnd I fixed it.
 
7:27 AM
@gem gZ!
 
Hi @ItachiUchiha
mvn deploy:deploy-file -DgroupId=java -DartifactId=java-plugin -Dversion=jre-1.5.0_09 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
can you tell me
Durl
DrepositoryId
value means
 
I wrote a boolean method without a return. And that compiled fine. Is it normal?
 
7:42 AM
no.. but if it compiled fine, you probably didn't
 
fge
Moo
 
fge
@reversiblean this won't compile with the comments there are right now, that's for sure
If this does it's not Java you are using
But Groovy or something
 
@AniketDeshmukh google is your friend. the maven documentation is quite extensive
 
no it does. I compiled the exact code with javac
return values are commented out
 
fge
7:48 AM
Sorry but it won't; you probably don't compile that version of the file for some reason
Try that file with ideone.com
 
@Vogel612 right
 
it compiles on ideone aswell
i just tried
 
link pls
 
it compiles.. right?
 
for whatever idiotic reeason...
 
7:58 AM
: )
 
possibly the compiler recognized the infinite loop
fact is: it shouldn't
 
Compilers have become pretty smart ;)
 
fge
@reversiblean uh, OK, I stand corrected, it compiles even here
Why does it, that's a good question
That is worth a question on SO
Even if I uncomment only one return statement it still compiles
 
As suggested by @vog, it is most probably because of the infinite loop.
 
fge
@ItachiUchiha even in this case, javac takes pride in being dumb
 
8:03 AM
@fge The same feature exists in other languages as well stackoverflow.com/questions/16789832/…
 
fge
Ah, OK
 
finally i asked a good question. lol
 
fge
So, the compiler isn't that dumb after all, huh
 
You bet, it isn't! It just follows the command of the Designer ;)
 
Sometime you might want an infinite loop. Netbeans warns you if you make that method.
 
8:09 AM
@Gemtastic You almost never want an infinite loop though
There's a good reason it warns you about that.
 
@SecondRikudo Indeed, but it's legal should you want it
It's not for noobs though
 
fge
Aah, the termination problem
A CS problem which is undecidable for any language which is Turing complete (it has been proven)
That's quite an interesting field of study
 
fge
8:22 AM
fge@alustriel:~/src/perso/grappa$ git diff --shortstat -C -M v1.0.x..
 382 files changed, 8422 insertions(+), 27853 deletions(-)
Woosh
That's some impressive pruning
 
ohh dear
 
hey guys how to output csv file with utf8 +bom
?
 
fge
@NTK88 preferrably you don't; if you have no choice, write '\ufeff' as the first character in the Writer
 
@fge Oooff
 
8:30 AM
private static final String ENCODE_FILENAME = "UTF-8";
private static final String UTF8_BOM = "\uFEFF";
String csvStr = this.createStudentCsv(searchList);
byte[] csv;
csv = csvStr.toString().getBytes(ENCODE_CSV);

StreamBean bean = new StreamBean();bean.setInputStream(new BufferedInputStream(new ByteArrayInputStream(csv)));
bean.setFileName(URLEncoder.encode(csvFileName, ENCODE_FILENAME ));
i have this code where should i write ufeff
 
fge
Wait
You use .getBytes()
 
yes
 
fge
You are aware that this will use the default platform encoding if you don't specify one, right?
 
what do u mean my english is not so good
 
fge
Also, what's that StreamBean stuff?
@NTK88 if you DO NOT specify the encoding to .getBytes(), the default one (which depends on your OS/JRE combination) will be used
Specify it, always
 
8:33 AM
u mean this one private static final String ENCODE_FILENAME = "UTF-8";
private static final String ENCODE_CSV = "UTF-8";
this one
 
fge
Ah, sorry
 
so how can i add bom to utf8
 
fge
But I don't follow your code, sorry
Is it the input stream which "writes"?
That's quite a reversal of logic
 
Hi everyone.. :)
 
8:36 AM
@SecondRikudo ?
 
its creating inputstream from byte array
 
Freaking crappy JSON implementers
 
fge
@NTK88 and why?
 
@deadlydragon00 Yuhooo
 
I usually don't badmouth other devs who've done work
 
fge
8:37 AM
Why do you read the CSV in memory to start with?
 
Hi @ItachiUchiha @fge @SecondRikudo @Gemtastic
 
fge
@NTK88 a solution is to use a StringBuilder
 
But what the fuck were you thinking when you made a 10k line, 0.8MB JavaScript object?!
Without any real structure or form
 
fge
final String contents = new StringBuilder().append('\ufeff').append(theCsvAsAString).build();
 
@sec whom are you cursing?
 
8:39 AM
@SecondRikudo what do you mean?
 
@SecondRikudo probably not much
 
and where to write that one
 
@ItachiUchiha The idiots that let this happen ^
And that's a small one!
 
fge
@SecondRikudo good luck
 
8:40 AM
@SecondRikudo makes me puke-ish
 
where to write this one final String contents = new StringBuilder().append('\ufeff').append(theCsvAsAString).build(); in my code
 
@fge Is this even possible?
Have arbitrary fields on my object without restricting them to their own subobject?
(With Jackson)
 
fge
@SecondRikudo I've never had to do "raw field contents" with Jackson, so...
Oh, but there may be a solution
Not pretty, but a solution
 
@fge I'm ready to implement a JSON serializer myself at this point, what have you got?
 
Whats Taboola.com by the way?
 
fge
8:42 AM
Jackson has a BinaryNode; basically it's a hack over JsonNode which stores a byte array
 
@deadlydragon00 The place where he works
 
Oh , nice
 
fge
So, what you could do is take that arbitrary field content and store is as an encoded bytearray
And you write a custom {de,}serializer to deal with those
After all, it's not like the contents of those arbitrary field had any significance on the Java side, right?
 
@SecondRikudo are you doing android task or a cloud end point?
hi @Unihedro
 
0
Q: How to send data from server to Android?

sanchitsinghI am working on a project where I want my server to send some data to my application (without calling of web service from mobile). It is like a web panel which operates mobile app to add data. So when user add data in website and click add, it should add that data to the mobile app (if mobile is ...

 
8:46 AM
Hiya @deadly!
@sanchitsingh TooBroad
 
@sanchitsingh build a Cloud End Point via POST request, This is Java Exclusive Room better See Android Room
 
fge
@Unihedro guess what I'm waiting for? ;)
 
@fge Oh?
Let me guess... A redo of the mail?
 
fge
Yes sir
 
@sanchitsingh Read Terms and Agreement Upon using GCM you might get shocked when your Developers Account get Blocked
 
fge
8:56 AM
And I can now "offically" work on the web version of the grappa debugger since I have the go for it
Yay!
 
@fge No, no significance on the Java side of things
 
fge
@SecondRikudo well then I think you have a potential solution; also, if I were you I'd use the streaming API
 
@fge Java... fucking... 6
 
fge
No, I mean the Jackson streaming API
Not java.util.stream
 
Why do all the tutorials have to be so crappy? Why do I have no freaking choice but to read source, this pisses me off a lot.
 
fge
8:59 AM
Since your "pseudo JSON" files are big, this will allow not to have all of them into memory
 
I'm seriously considering doing my own implementation at this point. I'm on this piece of crap for over a week now with almost no progress
 
:/
 
fge
Meh, I have been struggling for twice as long before I had a basic working debugger
 
I understand your frustration. stares at my own mess
 
fge
One week is nothing
And it took me two weeks to have a working Sonar language plugin :p
 
9:02 AM
@fge do you experience great headache in your work?
 
fge
@deadlydragon00 yeah; the headache is the utter lack of documentation from SonarQube for writing language plugins
All they are able to say are "look at the examples written" which are overly complex for a basic plugin
Compared to that, parsing the language (which is not easy at all) was easy
 
sounds terrible
 
fge
But in the process I created sonar-sslr-grappa along with a minimal, working language plugin
 
OMG
I accidentally reset the NS records...
 
today is the day of accidents and general crap happening, or what?
 
9:09 AM
affirmative
Welp, fixed it, but TTL was kinda high
 
fge
<-- very persistent; an imbecile, but persistent
 
ASR
9:26 AM
I am getting below error when I execute stored procedure
The user specified as a definer ('root'@'%') does not exist
 
morning
 
@fahdijbeli Mrng. Long time no see
 
yes
:(
 
Morning!
 
:)
I miss SO :'(
 
9:31 AM
Today is going to be the third productive day in a row... -_-
@fahdijbeli Oh come on, I wish I could step away from Stack Overflow. :p
 
hehehe
 
turning a bug into a feature
 
writing
 
ahahhaa
 
waiting for some feedback
also thinking about an update script for old data
 
9:36 AM
I need to take a proper picture with me in it, for my resume.
How can I take a professional selfie with my phone?
To lifehacks.se!
 
@Unihedro impossibru
 
Wear Pleasing Attire
 
@deadlydragon00 I'm in wool shirt and an awesome hoodie with a hat covering my face. I'm also hugging my secondary display, but I can't position my phone.
And no, no one is home to help.
 
You don't have tripod?
 
Nope.
 
I don't have any kind of proper camera.
 
Use Self Timer then Run :D
 
@Vogel612 bait or innocent?
@deadlydragon00 How can I position the thing?..
 
no idea...
guessing innocent.
 
Place your phone at your window then Self timer
 
9:39 AM
assumed good faith; cv'd POB and -1'd
@deadlydragon00 kk thx
 
but there's an answer on the verge of spam, posted like... directly after.
 
You mean 11 hours later?
 
hmm. ya. well I got the answer in the VLQQ
 
I like dat proposal..
 
9:45 AM
Me too!!
 
fge
@Unihedro no need for a picture, but if you insist...
After all, to my employer I was only a Tasmanian devil before we met :p
 
:p
 
fge
And right now you are some pixels with a crab
Meh
 
Muahahahahaha
The pixel person will dominate the world!
 
World of Minecraft
 
9:47 AM
But really, I usually send handcrafted (and wordy) mails to show my candidacy before getting in touch with my potential employers to commute on wages + time + tasks; Then again, I've never been in full time positions before, so.
 
@Unihedro what was your previous position before
 
¯\_(ツ)_/¯
 
what?
 
@deadlydragon00 Currently or previously?
 
prev
so you mean this is your first time?
 
9:50 AM
Freelancing positions negligible, the last professional position would be lead developer at EmberCraft and (non-professional) CTO at Oratio.
 
I see
 
Negligible because I signed NDAs and can't tell you anything about it. -_-
in Tavern on the Meta on Meta Stack Exchange Chat, 31 secs ago, by Bart
Baba has invaded the Minecraft forums http://www.minecraftforum.net/forums/minecraft-discussion/discussion/2393480-91-‌​9928926628-love-voodoo-spells-specialist#c1 :D
GG
 
:D , Soon your NDA will expire HAHAHA
 
@deadlydragon00 hahahaha no
 
NDAs usually don't expire.
 
9:53 AM
The Website looks Cool embercraft.us/staff
 
@Vogel612 The one for Weenside does, it states that any proprietary information are not to be disclosed to anyone for 5 years
 
lol that's interesting
 

« first day (1619 days earlier)      last day (3320 days later) »