« first day (1530 days earlier)      last day (3414 days later) » 

user4202350
 
@ShaU ... You see that just now?
 
user4202350
Oh maaan.....Yesn now
 
user4202350
Hi @Kodharivenkatakoteswararao How are you... what are u doing :{
 
user4202350
guess evry time when he has to write his name....it may take 1 hour to complete
 
7:26 PM
??
 
user4202350
Hi rikudu welcome here
 
@SecondRikudo You're here now? I suppose someone needs a permanent invite suspension?
 
@ShaU Any particular reason you invited me here?
 
user4202350
is it possible to borrow some reputation from you... u have huge repo....
 
user4202350
i will give it bacjk when i have my own
 
7:28 PM
@ShaU Check my profile. Write very high quality canonical questions and earn a bounty for 500 from me.
Other than that, no.
 
user4202350
canonical?
 
@ShaU Very good question/answer that is used by a lot of people as reference
123
A: How to pass variables and data from PHP to JavaScript?

Second RikudoThere are actually several approaches to do this. Some require more overhead than others, and some are considered better than others. In no particular order: Use AJAX to get the data you need from the server. Echo the data into the page somewhere, and use JavaScript to get the information from...

For example ^
Notice how it also has 123 votes
So that's 1230 rep plus the 500 I promise to give you
It's a good deal :)
But you have to work hard for it, the question and answer both need to be really good.
 
user4202350
How to pass variables and data from Javascript to PHP? Is this ok
 
@ShaU If no one wrote about it, sure, why not.
 
fge
You never pass "variables" as is anyway
 
7:33 PM
@fge The entire concept is a joke anyway.
 
fge
You pass the content, hoping that the representation in the source language can be represented equally accurately in the target language
 
That's not even... PHP is the preprocessing. You can pass from PHP to Javascript, but not the other way.
 
@fge Of course, it's noob oriented though, and it's a response to many many questions I've seen (some with that exact wording)
 
fge
And this is why serialization protocols such as JSON, protobuf and others exist (even though JSON was not meant to be used for that in the first place, it can be used for that)
 
Heya guys and girls :D
Have a nice 2015
 
7:35 PM
@fge I'm pretty sure JSON was madee for that purpose
 
@Charlie thanks
 
getting data from server to client that is.
@Charlie Thanks, you too :)
 
Someone invited me here?
 
@BenjaminGruenbaum Was it ShaU?
 
9 mins ago, by Unihedro
@SecondRikudo You're here now? I suppose someone needs a permanent invite suspension?
 
7:36 PM
Oh it's that @ShaU guy? Just do what we did and kick him.
 
@ShaU Justification for inviting everyone?
 
fge
@BenjaminGruenbaum you may be happy in hearing that... I have found an annoying limitation in Java! :p
 
@Unihedro He has none, I kicked him from JS
@fge One?
I found ten just today :P
 
@fge why would I be happy to hear that? Contrary to what it may seem I don't enjoy the fact Java is bad :P
 
fge
@SecondRikudo which I cannot work around
 
7:38 PM
@Unihedro Looks like he just found the "how to invite people" button
 
I have quite some Java experience myself. Probably less than you in Java 8 - but I think overall I have at least 4-5 solid years of experience.
@fge What is it?
 
fge
@BenjaminGruenbaum my bad, then :p But it has to do with what the compiler can infer for you that the user code cannot
 
@BenjaminGruenbaum I don't enjoy the fact that Java is.
 
I haven't even said anything in ages, and the last thin I said to him was "No" yesterday :P
 
@BenjaminGruenbaum Has he already been kicked from rooms two times in 24 hours?
 
7:39 PM
@Unihedro I just kicked him and it said he can't return for one minute
 
We should just flag him instead.
 
So I'm not sure.
 
in Tavern on the Meta on Meta Stack Exchange Chat, yesterday, by hichris123
> If it is the third or more time the user has been kicked within 24 hours, the ban will last for 30 minutes. In addition, the user is automatically banned from creating new rooms and from sending invites. This automatic ban does not expire and can only be removed by a moderator.
 
But regardless, if an automated flag is raised, he fully deserves it.
 
@fge Java generics are both weak and undecidable.
 
fge
7:39 PM
@BenjaminGruenbaum in this case this has nothing to do with generics
But with lambda inference
 
Also - the Java compiler can infer types for you but won't in many cases. That's coming in the next version though if I remember correctly.
 
I don't even know how to invite someone :P
 
@fge how so? I can check C# and Scala if you'd like and let you know if they do a better job
 
fge
Anyway, since I have dropped the subject for now...
@BenjaminGruenbaum I don't care about other languages here (and note that Scala runs on a JVM), it is really only just a story of "the compiler can do it, but in user code you cannot" -- at least not without eerie hacks
And it has all to do with call sites and call site inference
 
@fge the fact you don't care about other languages is again - worrying :D Also - I'm well aware that Scala runs on the JVM - I've been using it quite a bit since it gained stability.
 
fge
7:43 PM
With Java, you just cannot express enough of call sites to solve my problem :/
 
@fge example?
 
Attention Hat Hunters We are aware that the hat exists, and you need to post a message that gets starred. However, do not beg for stars, you can head for the sandbox where you won't upset anyone.
 
fge
@BenjaminGruenbaum see here
 
I'm going to sleep now, ping me if anything escalates that warrants waking up a RO at 3 am.
 
Night Uni
I'll see you in the new year!
 
fge
7:45 PM
@BenjaminGruenbaum as to "not caring about other languages", well, the fact is, I intend to work on Java so I study it to its fullest -- including dark corners
But with Java I get (a lot of) stuff done
Same with C
 
@fge now imagine if you knew C# :P
 
fge
And I'm not a computer scientist to boot
 
@fge I'm not sure what you'd expect the language to help you with there though
 
fge
@BenjaminGruenbaum meh, that's not a closed prospect but right now I just don't see the need to delve into it
@BenjaminGruenbaum that it perform the same coercion to argument parameters as it does to variable assignments
 
Well.. with params in C# this is actually solvable because they're not "special" like varargs in Java (they're even more a shorthand for an array) but given how varargs works in Java I'm not sure what you would expect to be able to do
 
fge
7:48 PM
(though this is an "out of nowhere" demand; there may be problems with it that I'm not aware of just yet)
@BenjaminGruenbaum simply to acknowledge that "oh yeah, varargs so it means the array can have 0 parameters; let's just transform the call site for that"
 
Of course, there is an actual expressive way to write varargs like in your example (with variadic templates) - but neither C# or Java can do it. Scala can emulate it but that's about it. In C++ templates it's trivial.
@fge yeah - that's what C# does in this case but that's not really how people view varargs in Java so I get why it might seem confusing.
 
fge
It is able to do that when assigning to a @FunctionalInterface, so why not to a method argument which is also a @FunctionalInterface?
 
Wait, why the ignored bit? Why not allow the parameters?
@fge now imagine you had first order functions and there wouldn't be a difference between the two :)
 
fge
@BenjaminGruenbaum because otherwise it wouldn't fit a Function
 
@fge oh yeah, in C++ that wouldn't be a problem since you have variadic templates - that's like varargs for generics.
 
fge
7:50 PM
@BenjaminGruenbaum there aren't, I know, I kind of miss them, but meh... The fact is, my package works pretty well but it abuses default methods
 
Page refreshed? :X
 
In C# you just have a ton of overloads to overcome it.
There is another elegant way to solve it - recursive templates, which both C# and Java do with currying which neither does.
 
@SecondRikudo status-no-repro
 
fge
C# is for another place, another type as far as I'm concerned
Well, whatever -- working on grappa cleanup now
(and thank god I have received my book)
 
lol
 
8:14 PM
Seems like fge is booked this newyears then ;P
 
How many hours for new year?
@uni happy new year :)
 
3
well, 2h 45min
 
win a hat by posting at GMT+/- 5
 
But I don't have anything to post :/
 
In chat room :P
 
8:19 PM
Ah
Well, now THAT's a thing I can do ;P
 
It is sad that the community version of IntelliJ doesn't support JavaEE
 
Does C# have ArrayList and HashMap ? I'm kinda addicted to them in Java
 
@ItachiUchiha yeah :/
 
@Charlie yes
 
@ItachiUchiha How are they called ?
 
@Unihedro Just because it is you. Don't automate it though
 
That was a test, it's not time for the hat yet.
 
So I made my own ArrayList and HashMap for nothing ?
 
@Charlie But I have to sleep :(
 
Besides experience
 
8:23 PM
@Ita 4 hours 33 min to UTC 0
 
@Unihedro You need to automate it for me too :P
@Charlie :P
 
Write a script to do it
 
Ahw well, in case someone needs a custom-made ArrayList or HashMap in C# (Even though I am in a Java chat): pastebin.com/bCe1A0k1
 
@uni as in
 
Checks for Type
I'm bored
 
fge
8:27 PM
@Charlie don't say "bored" when I'm here, since if you are bored I have a s*load of problems to submit -- all of them Java
I'm quite the specialist at that
In particular... Hrm... @Unihedro...
Didn't you say you were looking into JNA earlier?
 
message = 'write string here'
setTimeout(function () {
  $.post('rooms/' + window.location.href.match(/\d+/) + '/messages/new', {
    text: message,
    fkey: fkey().fkey
  })
}, 1420070400 - Date.now())
@ita
 
fge
And what is 1420070400?
Let me guess
 
:p
 
fge
The number of seconds from Jan 1st, 1970 GMT to Jan 1st, 2015 GMT
 
Jackpot!
 
fge
8:40 PM
Ooh, my dear sir, you may want to have a good read at the javadoc of the new date/time API in Java 8
 
> Number(new Date('2015-01-01'))
1420070400000
 
fge
What you have here is a Period, my dear sir
 
Dang, ninja'd
 
fge
Not even a Duration
No, that's the reverse
 
@fge I always thought that that was a number.
 
fge
8:41 PM
A Duration and not a Period
 
fge
@SecondRikudo aah, if calendar systems were linear... But they are not ;) Consider DSTs...
 
I mainly consider STDs.
 
fge
This is the object of the most famous (aka, nr of votes) question on SO ever
Hmmno, not the most voted
I was referring to this question:
2961
Q: Why is subtracting these two times (in 1927) giving a strange result?

FreewindIf I run the following program, which parses two date strings referencing times one second apart and compares them: public static void main(String[] args) throws ParseException { SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String str3 = "1927-12-31 23:54:07"; ...

 
@fge That is Jon Skeet's top answer.
It's not otherwise special.
 
fge
8:46 PM
Yeah, but it illustrates nicely the difference between a Period and a Duration
Both concepts were initially introduced by Joda Time and made it into the Java 8 date/time API (aka JSR 310)
 
@SecondRikudo Skeet Skeet!!
 
@Unihedro You heard Skeet and you woke up? :D
 
fge
And, for completeness, since then the JSR did find minor flaws with Joda Time which gave birth to threetenbp
 
Also, you sound like a Pokemon
 
fge
(end of history lesson -- for whatever duration the lesson was)
 
8:49 PM
@fge Or maybe it was a priod?
 
fge
@SecondRikudo meh, who knows
@SecondRikudo but then you understand the difference now, right? ;)
 
What?
Where am I? What is this?
 
fge
Between a Period and a Duration
 
@fge Well, one is a measurement of time elapsed, and the other is what's on the end of this sentence.
 
Now how do I run the script :(
Noobard in JS
 
fge
8:54 PM
@SecondRikudo hmm, I don't understand the second part of your sentence
@ItachiUchiha abandoned java7-fs-more, then? ;)
 
. <- Period.
 
@fge Nope I haven't. Was busy for last few days
 
@ItachiUchiha the script?
 
fge
@SecondRikudo OK, well, if you take it this way I have done all this for nothing :p
 
Finally got Broadband back
Installed Ubuntu
downloading Intellij
I will be ready by tomorrow
 
8:56 PM
@fge throw new Question[]
 
19 mins ago, by Unihedro
message = 'write string here'
setTimeout(function () {
  $.post('rooms/' + window.location.href.match(/\d+/) + '/messages/new', {
    text: message,
    fkey: fkey().fkey
  })
}, 1420070400 - Date.now())
 
@ItachiUchiha Oh, easy. Open your browser console (CTRL+SHIFT+J in chrome) and paste it in.
Just make sure to keep the browser tab open, or the timer will be cleared.
 
@SecondRikudo how about firefox?
 
Change the string first -_-
 
@ItachiUchiha Not sure, but I'm sure an intelligent ninja such as yourself would be able to figure it out :)
 
8:58 PM
F12 -> console @ita
 
F12, right?
Or Alt F4
 
Heyo!
And Happy New Year!
 
hi
 
Heya
Same
 
10x, u 2
 
8:59 PM
2 hours left here though
 
@Unihedro 4925?
 
1 here
 
@oleg happy new year!
 
wait
 
Thread.sleep(-1)
 
9:00 PM
Add three zeros to the magic number
 
Magic number000
 
5493?
what is this output?
 
And delete 'rooms/' + window.location.href.match(/\d+/) +
 
Err...I need to take a crash course in Web Console and JS
message = 'Text For hat'
setTimeout(function () {
  $.post('/messages/new', {
    text: message,
    fkey: fkey().fkey
  })
}, 1420070400000 - Date.now())
 
or stay awake and post the message yourself
much simpler
 
9:04 PM
:(
 
fge
@Unihedro ping
 
@fge pong
 
@uni ping
 
fge
@Unihedro weren't you interested in JNA? If yes I have something for you
 
:O yes I am
 
9:06 PM
@fge throw new JavaProblem[]?
 
fge
@Unihedro an old project of mine -- for some time I wanted to convert it to using JNA instead of JNI like I currently do
@Charlie meh, yeh, it's an array
 
Pseudo: Throw me a bunch of java problems
 
fge
@Unihedro the code is old, and it is far from what I'd be writing right now ;)
 
:p gotcha
 
@fge Pleaseeee I'm bored, give me some problems to solve :(
 
fge
9:17 PM
@Charlie really? Do you really mean it?
 
Yeeesss
Anything with ServerSocket and Socket on your list?
 
fge
No
Nothing like that
 
Trying to learn those, so some practice would be nice
Meh, I'll try a browser
Thanks for the idea though
 
fge
More high level than this, I have this project of mine which is my only website of mine and which sucks horribly; I want to switch technologies and, again, never found the time
But in this project all low-level socket handling is done for you by definition
 
Hmn, I'll try a browser first, not THAT advanced yet
 
fge
9:20 PM
@Charlie if you think a web browser is simple, uh...
Well, let's say, it's more simple to develop a web site than a browser
MUCH more simple
A web site does not have to care about rendering; a browser does
 
Well, own protocol / client / browser stuff
I'll see, thanks anyway
 
Anyone know anything about scaling bitmap images? I'm following a tutorial to load images from gallery in Android but when I load image of large size it won't show in imageview..
 
Night
 
this is the method that loads the image from gallery, hastebin.com/qapiwekago.avrasm
 
Hastepin? You mean pastebin?
No, hmn
 
fge
9:24 PM
@BrianJ so, if the image fails to load you do absolutely nothing?
 
@Charlie nope, Hastebin is a thing too, the guys here told me about it
 
Anyone know how I might crash Java/Jetspeed? I'm planning to do a presentation on why Linux+Docker is so much better than the AS400, and as part of it I want to do something particularly nasty requiring me to rollback the deploy
 
@fge I guess I should have a check in there somewhere
 
wow, hastebin is pretty darn cool
 
fge
@WayneWerner aren't the economics arguments enough to make your case? This is not a room for cracking techniques, you know
@BrianJ from the body of your method it does not look like it -- why check whether the code is 200 for instance? Why check whether you have data at all?
 
9:26 PM
Well, if(1==null) crashes Java nicely
 
fge
@Charlie this will not even compile
Code which does not compile cannot crash, right?
 
@fge To some. Unfortunately where the buck stops there's a bit of a Wormtongue relationship with another employee.
 
@fge its compiled without fail so far
 
throw new Exception();?
 
fge
@BrianJ ah, autoboxing, then
Well, the result is always false in any event
 
9:28 PM
Well, throw is kinda legit
 
fge
@BrianJ or do you mean your method?
@BrianJ I have no doubt that it compiles; what I question is its sanity
 
@fge I managed to solve this problem in another class by setting the bitmap size, but not sure how to apply this to the new method, please see my new hastebin post: hastebin.com/ahocedumej.coffee
@fge valid point
 
fge
@BrianJ for me, some checks done in this method are not meant to be at this level
Another thing
 
int i=(int)(Integer)null; Does this compile? Not running eclispe atm
 
fge
You load an image yet fail to convey that the loading may fail at all
@Charlie it won't; you cannot cast an object type to a primitive type
 
9:30 PM
Well, you get the NPE problem Java doesn't like
 
fge
Again, you can't get NPE on code which does not compile
As to NPEs, they are 100% of the time the programmer's fault, not Java's
 
True, you come with something ;)
 
I tried to scale the image by doing this ` imageView.setImageBitmap(Bitmap.createScaledBitmap(picturePath, 130, 110, false));
`
but picturePath is a string so cannot achieve it like this
 
this doesn't work in chat ;)
Does it?
 
@Charlie yeah I noticed
it doesn't
 
9:34 PM
Well, I'm new here too, so I'n trying out some things
 
fge
@BrianJ don't tell me that picturePath was originally an image?
Well anyway -- first, fix the logic, honestly
 
*Path looks like a String with a filename
 
fge
<-- needs to code
 
filePath, logPath, etc
 
@fge I'll post a revised snippet, the previous is a bit messed up
@fge Is this any clearer? hastebin.com/edahodinep.hs
 
9:40 PM
.hs Haskell?
 
fge
@BrianJ same problem; what happens on failure here? It is very unclear
Why check whether the data is null at all? Why check whether the result code is OK? If it isn't, would you ever reach that method? Why check whether the request code is load? WWhy do you reach that code is the request code is any different?
Too many checks which, imho, have nothing to do in there; if they are meant to be done here then you should think about dispatching
 
@fge I can add in an exception check for that later, at the moment images taken at a lower resolution will load into the image view but anything of a higher resolution will not. The problem is that the image needs to be scaled before its loaded in. Do you know how I can scale the image prgramatically?
 
fge
No, check for anomalous conditions before you start the actual stuff
Adding anomalous conditions checking after the fact is much more complicated
Do it as soon as possible
What is more, such anomalous condition checking is testable
 
@fge fair point, I'll add an exception check first and come back
 
fge
9:52 PM
Hello @Bohemian and a happy new year to you
 
Hi
HNY!
 
@fge fresh off the press with exception checking, now can we get on to scaling the image? hastebin.com/dafujagoya.coffee
 
This question (and answer) could use a couple of upvotes stackoverflow.com/questions/27712087/… :)
 
fge
@BrianJ OK, so, here is a programming syndrome you are falling victim of: if (condition) { /* some very long code here / } else { / some very short code here */ }
@BrianJ replace with: if (!condition) { /* some very short code here /; return; } / some very long code here */
Namely, data is null; if it is, get out immediately
Don't make the reader of the code go through tens of lines of code to see that "oh, so if data is null he exits immediately"
 
BTW I really want to check out your library
 
fge
9:58 PM
This is all too common, and is (sorry for the harsh words) a royal PITA to read
@Bohemian which one, whose?
 
@fge noted
 

« first day (1530 days earlier)      last day (3414 days later) »