« first day (2283 days earlier)      last day (2882 days later) » 
03:00 - 17:0017:00 - 21:00

03:43
Does anyone know how to receive a .mov stream over websockets?
I have a html5 client that is taking a video feed through the webcam, and I need it to be streamed as close to realtime as possible to a java server that will process it as a .mov file
I figured that I'd have to use an implementation of webrtc or websockets, atm the server is written with netty-socket.io
 
2 hours later…
05:29
@Hemlata This one is easy. I have seen people have already explained it to you. Let me know if its clear.
 
3 hours later…
08:04
This chat room is much more friendly than some of the other ones.
08:28
Does "Java hash code" have any significant meaning other than the hashCode override-able method?
09:13
@AwalGarg Yes, Java hash based collections (e.g. java.util.HashMap, java.util.concurrent.ConcurrentHashMap, java.util.LinkedHashMap) use objects' hashCode() to store lookup keys space efficiently and retrieve objects by lookup key temporally efficiently.
For this to work well, hashCode() should return results distributed uniformly.
Deterministically implemented hashCode() where objects with identical inner state always return identicalhashCode() can also be used to efficiently determine inequality (NOT equality) of immutable objects.
... due to hashCode() caching possibility with immutables, which e.g. java.lang.String#hashCode() does.
@unserializable Thanks
@AwalGarg You doing Java now?
@MadaraUchiha I have to give a 15 minute presentation on "JAVA 6 HASH CODE" tomorrow at uni
Java 6? Dear god.
09:29
yeah
@AwalGarg Java String hash collision DOS attacks were very effective against several Java based HTTP server implementations 6 years ago, e.g. for Tomcat: web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2011-4858
In fact most HTTP platforms and languages were vulnerable to such DOS attacks: cryptanalysis.eu/blog/2011/12/28/…
For mitigating, hashCode() impls were usually not changed, but servers instead started to enforce a limit on either request size or number of request parameters allowed.
10:01
@dcsohl Hey, thanks for the reply. I solved this by removing the listeners.
 
1 hour later…
11:06
@AwalGarg :o
user6857832
Hi @ItachiUchiha
user6857832
I have a question lol
user6857832
11:19
In the second example of it (The last one) in the link, there is a method called modifyPointer, and in this "int [] a" is passed. So when it says "a = b" that means a is jus referring to b, but the value is not changed cuz int [] a is jus a copy of the variable, so any change inside the method doesnt affect outside the method, right?
user6857832
Cuz it jus a copy of the variable(variable a), but its not the actual object, right?
user6857832
@ItachiUchiha
let me check
user6857832
Um, ok.
Does anyone know the archives for JDK 9 builds?
11:24
@ItachiUchiha openjdk?
no, on the openjdk site?
can't find it.
They do a pretty good job at hiding it
There's a "source code" section in the sidebar of openjdk project site.
I do not need the latest build
JDK 9-ea b153 is easily accessible
11:29
@ItachiUchiha You can find all the builds by going through the tags.
I do not want to copy the source and build my own jdk :)
then get yourself a magic wand and learn the arcane ways.
No. If a company is running an open-source project that is used by millions of people. Its there responsibility to make the builds easily available.
int [] a is jus a copy of the variable
user6857832
Yea.
a is referring to the same memory address as test
user6857832
11:39
Yea
So, when you do a = something else, it starts referring to some other object (memory address). It never changes anything in the object that test is referring to.
But if you change the data inside the underlying object, then test will see the change.
user6857832
Now look at the example above it, it's also the same but it jus does is set a [0] = 9, aren't they both doing the same thing? Or aren't they both copy of variables?
user6857832
@ItachiUchiha Did ya mean that now it is referring to some other address, so any change that will be made to variable "a", will be made to the (new address ). So it doesn't affect outside the method?
No, as I said, a[0] = something is changing the data inside the object.
user6857832
Um, ok.
11:43
@Hemlata a is just a reference. You need to understand the difference between a reference and object.
user6857832
I know that a reference is jus that it store the same address as the original one
Object holds actual data and it can be referenced by multiple variables. For example, test and a were both referring to an object which had {1,2,3,4} stored in it.
Now, if I want, I can make either test or a refer to some other object (a = {9,8,7,6}) and it will not make any difference to our original object (its still stores {1,2,3,4} and is referred by test).
@Hemlata Check the diagrams in this example - javaranch.com/campfire/StoryPassBy.jsp
I so want a paint extension in SO chat right now
user6857832
12:09
@ItachiUchiha Thanks
user6857832
I will make a diagram with those two examples. Let me know if they are right lol.
12:44
@Hemlata sure
 
1 hour later…
13:52
@Hemlata this is an an accurate (but cynical) view of the programming industry: stilldrinking.org/programming-sucks
@MadaraUchiha "Also, the bridge was designed as a suspension bridge, but nobody actually knew how to build a suspension bridge, so they got halfway through it and then just added extra support columns to keep the thing standing"
@Unihedron 😃
I outright lost it, reading this isn't good for my sanity lol, it's too accurate
Morning, Java!
@Unihedron Your first time reading it? :D
13:56
yep
It's brilliant
everyone I've worked with so far either gets their job done and leaves or doesn't know what he's doing but gets it done somehow magically anyway
It's on the level of "The Expert"
"All code is bad" now I'm just sinking
Also The Expert (volume) if you haven't seen it
14:01
@MadaraUchiha No I've never seen it at all, this is amazing
"There's a theory that you can cure this by following standards, except there are more "standards" than there are things computers can actually do, and these standards are all variously improved and maligned by the personal preferences of the people coding them"
this hurts like getting stabbed by a laser blade except the laser is your blood and the blade is the awareness that it's in you
14:23
@Unihedron Also see: xkcd on standards.
14:44
News flash: The real world is complicated. You're the professional. It's your job to muddle through the uncertainty and make the best decisions possible.
Or just not care about it, take the money and be happy, then work on your happy side projects in your free time until you get bored
That too. xD
Except that you come home from work and you're tired and you don't have any motivation to do any side projects.
user6754053
15:19
Is the code at the start of this question Java?
user6754053
0
Q: Need help regarding Assertions in Java

hey hoeI need some help with a Homework regarding Assertions in Java public static String tSubString ( Strings , int x , int y ) { //1 String a = s.substring ( x , y ); //2 return a ; (x must be between 0 and 2*pi) public static double tSin (double x ) { // 3 double d = Math.sin ( x ) ; // 4 return ...

user6754053
I know Java but I'm not an expert
@MarkYisri Looks like Java to me, yeah
It is definitely not COMPILING Java, Java wannabe at best
user6754053
Really?
user6754053
15:21
public static String tSubString ( Strings , int x , int y ) {
user6754053
what is Strings?
Nothing that compiles in Java
@MarkYisri voted to close because it's homework
@MarkYisri probably String s without a space
OakBot Online.
user6110959
15:28
Wow FInally ! We have a JAVA - " only " chat room :)
@Abcd This room is for Java, not JAVA.
user6110959
What's the difference ?
user6110959
Same thing, right ?
user6110959
James Gosling Arthur Van Hoff ANdy Bech.
user6110959
JAVA
15:31
Hello, Can i ask a question about the point of interfaces in java? I dont quite seem to understand the point of them, and where they can be useful.
eh?
'There'?
They are useful with generics
What do you mean, Generics. I'm still a novice to java :P
W-S
W-S
@Colourfit Have you read the tutorial‌​?
Yes, I understand how to use interfaces, But I just dont see the point of them.
In that example in the tutorial, surely you could get rid of the implentation of the bicycle interface and the code would run exactly the same?
W-S
W-S
@Colourfit You can make different objects have the same behaviors when they implement interface.
15:39
@Colourfit You should read about OOP instead of Java. Java has no multiple inheritance (class can inherit only from one superclass, not several), so certain behaviours are hard to model without interfaces.
Oh, So the interface is more of a coding convention, Used to organise code then?
user6110959
State the java concept that is implemented by dividing a long set of instructions into smaller groups or modules
user6110959
I think it should be Functions
user6110959
15:44
But am not sure
user6110959
Can someone correct me please?
Or its just talking about methods
user6110959
There is no other possible answer right?
Wait, Are interfaces used to make objects that implement them have predictable behaviours?, As they would all have to implement the methods of the interface
Yeah I think its just methods
@Abcd functions or methods
15:47
yeah ^
Where methods are function that are "tied" to specific instances
user6110959
Thanks.
@Colourfit interfaces allow to model objects that are many things at once. E.g Person who has a name and is a Worker and is a Programmer and can Calculate and acts as EventListener to the OutsideWorld and #react()s to Events.
Interfaces are Java's hack around the diamond problem
Just sayin' 😉
user6110959
Interfaces allow multiple inheritance in Java
15:52
@unserializable So, the Worker class would implmenent the Person interface? Why not just have the Worker class just Extend a Person master class?
@Colourfit then you are stuck with the single hierarcy and you cannot well model different aspects of the Person.
Ahh, I understand
Thank you :)
Great! People are generally understanding in this chatroom :)
user6110959
How is throws an alternative to try-catch? I dont understand this.
user6110959
Because throws is merely declaring exception and try catch is handling it too
16:01
@Abcd it's alternative, because you can throw it and let someone else (some other part of code more appropriate for that) handle it.
user6110959
Please give an example @unserializable
@Abcd what? this makes no sense
they do different things for different purposes.
user6110959
My concept of throws is extremely weak since an year or more. I just don't get it.
refresh your memory with the java tutorials docs.oracle.com/javase/tutorial/essential/exceptions
user6110959
Refresh probably isn't the right term since I am a beginner. I know java since 2 years only.
16:06
I was already FGITW'ing on SO after learning java for a year and a half so yeah you could do better
exception flow may not seem intuitive at first, but this is what the two does:
user6110959
FGITW ???
93
A: What is FGITW and SCITE?

Alex AngasFGITW - Fastest Gun in the West The fastest reply to a question. Relevant to how Stack Overflow sorted answers until around August 27 2009. The original sorting was 'number of votes' followed by 'oldest answer first'. This meant that the first answerer was given a natural advantage as their answ...

throws exception - stop code execution in method and gobble up until it has a handler, step over everything until it finds:
try block - match exceptions in the catch block and handle (rather, do something and then consider it handled) it, and continue, otherwise
unhandled exception - crash
if that doesn't make sense to you (it should), you should read the entire tutorial I linked
user6110959
But throws doesnt handle it just stops... I am reading it
askForName();
startComputing(); // if there is an exception here, the code beyond this point won't be run, and we float up until we reach a try{} block that handles this, we will not return here afterwards unless seperate code triggers this
printResults();
16:11
@Abcd It does not stop anything, it lets someone else handle the exception. Lets say you have many classes and methods dealing with IO (file IO, net IO). You might make them all as throws IOException and let e.g. a handler in main() take care of them (in the simplest case just telling end-user that some resource was unavaialbe and doing System#exit
askForName();
try {
  startComputing(); // suppose an exception occurs
  printResults(); // will not be run
} catch (Exception ex) {} // DON'T DO THIS. EVER. This is just for demonstration
leave(); // will be run
... then you'd have singel Exception handling strategy in one place (#main()), instead of many minuscule methods classes trying to do their own (often dumb thing, because they don't know good alternatives for recovery).
user6110959
@unserializable @Unihedron Now this is my problem : I write throws InputMismatchException after the function signature but still if I give a String value for an int my program stops and comes back to the code in BlueJ stating InputMismatchException
@Abcd did you handle the exception?
user6110959
How to handle it now.... I have written throws Input MismatchException isn't that enough?
16:15
no, that specifies that the method can throw the exception for the developer using the code to handle, which also means
you need to handle it
unhandled exception = program will not run properly
for example,
user6110959
So how to handle it ?
by not causing it.
don't pass a string value for an int.
@Abcd in single-threaded program NOT HANDLING it at all could be enough, if you are just fine with program exiting upon erroneous input. Stacktrace is then printed on console, if executed from console.
threaded
user6110959
Why not ?? what if someone does !? The program will stop unlike try catch which would give a message
16:17
try catch does not give a message.
user6110959
e.getMessage()
That's in the exception, you could had as well did new Exception().printStackTrace().
"what if someone does" <- congratulate them for crashing the program with garbage input?
This BlueJ IDE @Abcd mentioned homepage says its created by University of Kent and Supported by Oracle -- what a sweet deal :)
"A free Java Development Environment designed for beginners, used by millions worldwide."
I'm worried about said worldwide of people. Are there really that many beginners endorsing it?
Why not a proper IDE?
I prefer Eclipse
user6110959
16:21
BlueJ is best for beginners
user6110959
at least for students
"One of my favourite IDEs out there is BlueJ" — James Gosling, creator of Java.
@Abcd yeah so they get by without having to learn to use a debugger ever
awesome
@unserializable that implies he likes more than one.
user6110959
@Unihedron blueJ has a debugger
user6110959
16:23
an editor
user6110959
a viewer
user6857832
In **A** test is the original reference which points to {1, 2, 3, 4}. Now we've another variable **a** which is also referring to the same object, So any change made to either **test** or **a** would be reflected. That being said, any change made inside the method or outside both would be reflected.
In **B** test is the original reference which points to {1, 2, 3, 4}. Now we've another variable **b** which also referring to the same object. Later we assign **a** = **b**, and here b is a reference variable which is pointing to {9, 9, 9, 9}. Now as **a** is referring to **b**, So any change m
user6857832
user6857832
Please don't laugh on my drawing.
user6857832
I know it's bad.
16:25
@Hemlata I'm more sad than amused.
@Hemlata The concept is right :)
user6857832
But I can't do better on a laptop, cuz it's hard to draw with a mouse
@Hemlata without a mouse?
@Abcd awesome! does it support maven lifecycles?
user6857832
@Unihedron Why?
16:26
@JonahSloan Nah, I am taking Gosling seriously and uninstalling my IDEA in favour of BlueJ, as we speak.
user6857832
@ItachiUchiha Trackpad?
what about integrating with scala support?
user6110959
@Unihedron what's maven lifecycle?
@Hemlata makes more sense
@Abcd I'm fine with gradle
user6857832
16:27
Anyway did I said right or wrong?
geez I mistyped grappa cuz of fge's influence on me
user6110959
@Unihedron what is maven lifecycle and gradle >
user6110959
?
user6857832
@Unihedron Why are you sad?
> Available extensions
Cleaning a BlueJ project
user6857832
16:28
@ItachiUchiha What I said is right or wrong?
yay now I don't need to run git clean anymore
> Grading student projects using INGInious
what a useful extension, you can get stuff graded without help
> A Simple GUI Builder
obviously it's so difficult that everyone needs a GUI to do it
@Hemlata Everything is right except this sentence which most probably has multiple mistypes ?
> In B test is the original reference which points to {1, 2, 3, 4}. Now we've another variable b which also referring to the same object.
@Hemlata because of the quality of your drawing...
b refers to {9, 9, 9, 9}
@Abcd they are tools that everyone uses?
user6110959
16:31
Okay.
user6857832
@ItachiUchiha I accidently wrote that, I mean a not b.
user6857832
@Unihedron Is it really bad?
user6857832
But I can't draw better with a trackpad, cuz it's hard to draw with it.
user6110959
does function signature include name of the function ?
user6110959
or only the number and type of parameters
16:32
@Abcd what is a function signature?
user6857832
So now am I right? @ItachiUchiha
user6110959
Function singature is function name + paramter list in paranthesis as far as i know
user6110959
But am unsure whether function name is a part of it or not
@Abcd then it includes the name of the function, you just answered it yourself.
user6110959
Thanks @Unihedron. One thing I understood about throws : We just inform that an error occurs in the program but we don't eliminate the error
user6110959
16:35
Is this whats exception handling?
no, that's exception throwing
user6110959
What the hell :/ :/ :(
user6110959
I stillll didnt understand
what don't you understand?
user6110959
I need a simple block of code to understand
user6110959
16:36
throws ' use
import comprehension from magic

make_you_understand()
user6110959
No ! Not this way please use throws InputMismatchException
user6110959
Thats one I frequently use
user6110959
without ever understanding its meaning
user6110959
or significance
16:37
why use something you don't understand? get rid of it
or learn it, pick one
@Hemlata yes
@Hemlata why don't you have a mouse?
user6857832
Um, ok.
user6110959
It is necessary to put it after the methods @Unihedron in my exams . Since I use Scanner class, it's essential otherwise marks would be deducted for no exeption handling
user6110959
Even I hate using things I don't understand
@Abcd then learn it?
user6110959
16:39
Please explain using a block of code
it does what it's supposed to do
user6857832
@ItachiUchiha Cuz I don't have one.
@Hemlata buy one :P
@Abcd several blocks at q/a
or you can just let them deduct your score, it's not your problem for not knowing something useless (to you), it's their problem for expecting you to be aware.
user6857832
16:40
@ItachiUchiha I know I won't gonna use it often, cuz in laptop I like to use trackpad instead of a mouse.
user6857832
I would've buy If I had a PC
Can verify, am laptop user satisfied with a trackpad.
I have a wireless mouse sitting in the cable box that I don't bother using.
#trackpadbulletchess
user6110959
@unserializable I know try catch. I wanna understand throws
user6857832
Trackpad is more comfortable with laptop than a mouse.
I am a laptop user and I still <3 my wireless mouse.
16:43
@Abcd then just remove the try-catch and try it out with throws
user6857832
I do have a wireless mouse but not for Mac.
I've grown to believe that anyone who prefers a mouse over a trackpad either has those small buttons around their mouse which would be expensive and a pain to customize properly or doesn't surf the net a lot.
I have a laptop with a touchscreen that I don't ever use.
user6110959
@unserializable but it makes no difference : If I enter a string instead of int my program terminates even if there is a throws InputMismatchException and smae happens without it
@Unihedron I disagree with all of those points
user6857832
16:45
And I agree with itachi lol
user6857832
It's jus a personal preference.
@ItachiUchiha congratulations! you have me interested. now explain.
user6857832
You got four stars on chat.stackoverflow.com/transcript/message/35213596#35213596 @ItachiUchiha Lol
user6110959
SO how is exception handling advantageous ?
user6110959
When same thing is happening in both cases?
16:47
@Abcd who told you it's advantageous?
I like the ease of access that a mouse provides. Its easier and more satisfying to hold a mouse in your palm rather than moving your fingers over a surface.
@ItachiUchiha what does that have to do with what I said?
user6110959
@Unihedron my book
@Abcd which?
> doesn't surf the net a lot
^ I surf a lot of it
user6110959
16:48
It's a class 10 book so not a reputed one @Unihedron
@Abcd which?
> either has those small buttons around their mouse which would be expensive and a pain to customize properly
user6857832
Lol
user6110959
@Unihedron Computer Applications A textbook for Class X by SUmita Arora
^ I disagree. My mouse is a simple mouse with just 2 buttons and a scroll
@Hemlata You accepted the same :P
user6857832
16:49
@ItachiUchiha Yea haha.
user6857832
But that doesn't mean I never have hershey lol, I do have sometimes.
@Abcd Ah, It's already on my list.
user6857832
Cuz I don't eat all the time lol
user6110959
@Unihedron Which list?
@ItachiUchiha that's your entire explanation?
16:51
Yeah :D
@ItachiUchiha technically the scroll wheel is also a button
@JonahSloan Agree. Its self explanatory and shorter to write scroll than "scroll button".
user6857832
Can now ya please explain me this: hastebin.com/ekuguqijoj.java ?
Test
user6857832
Why it outputs "her" "her"?
user6857832
16:54
@ItachiUchiha
@Hemlata Because it's the same person.
Person p = new Person('foo');
people.add(p);
p.setName('bar');

people.get(0); // Person{'bar'}
user6857832
@MadaraUchiha I didn't got.
You need two different people
Call new Person inside the loop, and add this new person to the list.
user6110959
@Unihedron which list?
@Abcd which list?
user6110959
16:57
@Unihedron Please scroll up . you said its already on my list
user6110959
Which list?
A list that already has your book in it, apparently.
user6857832
@MadaraUchiha That means it do add "hem" in the list but when it again loops for int i = 1, and the value is changed to "her", then it change the "hem" to "her". So it outputs "her", "her", right?
@Hemlata You added the same person, twice.
03:00 - 17:0017:00 - 21:00

« first day (2283 days earlier)      last day (2882 days later) »