« first day (1497 days earlier)      last day (3450 days later) » 

12:00 PM
the other way around, hopefully
 
@kiheru Huh?
 
Object fields and arrays actually stores references only. (un)?boxing during arithmetic operations actually makes the performance worse.
Even more unfortunate when you use numbers outside the cached range, as you'd be creating new objects in runtime without knowing.
And a lot of them. :O
 
Additionally managing an object[] is much more address-keeping...
 
Sorry but what is the cache range? :O
 
Primitives are more performant, unless there are other constraints (like, other parts o the code requires boxed variables, so that using primitives in certain place would result in a lot of boxing and unboxing)
 
12:03 PM
for a primitive array you can easily get the address by using *[] + sizeof(type) * index
 
And don't argue about the need of mutable integers, either. They're horrible. No way to cache them properly, additional need to ensure thread safety... Ugh.
 
Mutable integers... ouch! That sounds so horrible that the idea had never crossed my head.
 
Quick, drop it! Don't let the insanity cross your mind!
But seriously, int[1] > MutableInteger.
Don't ask, it just is.
/**
 * Returns an {@code Integer} instance representing the specified
 * {@code int} value.  If a new {@code Integer} instance is not
 * required, this method should generally be used in preference to
 * the constructor {@link #Integer(int)}, as this method is likely
 * to yield significantly better space and time performance by
 * caching frequently requested values.
 *
 * This method will always cache values in the range -128 to 127,
 * inclusive, and may cache other values outside of this range.
@Mr.777 ^ That's the Integer.valueOf() method.
Whenever a primitive int is casted or boxed into an Integer, that happens. Notice the use of a cache for smaller values.
The IntegerCache.high value is usually 128, unless sun.misc.VM.getSavedProperty("java.lang.Integer.IntegerCache.high"); returns a positive value. Then it will be used instead.
 
Okay that's awesome, thanks.
 
I think the JIT is trained to optimize almost all classes in the Java API. There are ones that purform poorly though.
Like URL.
 
fge
12:10 PM
Well, anyway, boxing and unboxing have a cost; this is why there are IntStream, DoubleStream, LongStream alongside Stream (and also IntFunction, IntUnaryOperator etc)
 
@Unihedron BTW, do you have all the source code of java api?
@fge :O OMG, never heard & never even used
 
java is open source (almost)
 
@Mr.777 It's open source. Download it to your computer, and set up your IDE to use it.
 
I'm closed for source!
 
@Unihedron lol, I know it's open source :D
 
12:11 PM
For Eclipse, that's system libraries > java-se-8 > link source... then find the source zip and select it.
Then you can shift-click on Java API methods and classes to jump to their source code!
 
lol, i use eclipse and I know this much ;)
 
Oh, so you actually meant if I have it? Of course I do. ;P
@fge There's also one of each primitive array in Arrays utility methods, alongside T[].
 
@777 you can always follow openJDK
 
fge
Well yeah, but arrays are as old as Java itself so it's no wonder they did that
 
@ItachiUchiha follow openjdk, what do you mean?
 
12:14 PM
I dislike how arrays work in Java. They really should be first class citizens.
 
this is the relation between container and component in awt class hierarchy
 
They are non-iterable (can't forEach), expensive for resizing, and underpowered compared to lists and sets.
There's Arrays.stream(), but it doesn't make up for that.
 
fge
@Unihedron eh? You can use a foreach loop on an array
 
Really?
:O
 
my question, i could not understand the operation() method in this diagram
 
12:16 PM
I was actually waiting for your explaination and thanks for this @Uni
and yes, you can use foreach on array
 
@Mr.777 Oh? On what?
Yeah, I guess I should just use arrays more before I rant about how underpowered they are. :P
 
On how you dislike the arrays
 
fge
Well, I don't disklike them but I don't care much for them either
Also, there's the trap that unlike generics, arrays are covariant
 
Arrays are powerful in C++ because they are always assigned like that order in memory, and you can bithack longs into byte arrays.
 
What is the difference between a List & Set in terms of performance?
 
12:18 PM
@Unihedron I have now sent Carlsen an SMS that I won over you in Chess
 
Which carlsen? The one who beat anand?
 
ye
<- Norway you know
It's my brother
 
I thought you were from some other place :P
 
which one ? :P
 
somewhere close to amsterdam. I don't remember the exact location
 
12:25 PM
it's in Europe atlas :P
at least*
 
Phew, I was rather confused by that sentence
 
He's not actually my brother though, but he's kind of a hero in the chess community
 
Not really, he's the grandmaster, he won as the grand champion for last years' international chess tournament.
 
why not a hero?
 
Because "hero" is for military veterans. "grandmaster" is for chess players, and "jedi" and "ninja" are for prorammers.
#lrn2vocab
 
12:34 PM
and sexy is for me
:)
 
thinks miniHessel sucks but doesn't say it, for diplomatic reasons
 
chess?
suck in what?
 
Sucking can, depending on preferences, be considered sexy.
:-P
 
Hi
 
12:37 PM
@uni explain
 
can anyone please tell me how to remove the project name from url
in am using spring3
 
@miniHessel Explain what?
 
i am having a project name AuthenticationManageAngularJS
 
@AlexMan Change the deployment descriptor
 
the url is localhost/AuthenticationManageAngularJS/user/auth/logout
i want to make it as localhost/user/auth/logout
 
12:38 PM
what I suck in @Unihedron
 
@Mr.777 how can we do that in deployment descriptor
 
@AlexMan Yes deploy your application as ROOT
 
@miniHessel Say what?
 
What's your war file name?
 
"thinks miniHessel sucks but doesn't say it, for diplomatic reasons"
 
12:40 PM
@Mr.777 AuthenticationManageAngularJS.war
 
@AlexMan So, did you get any idea frm it?
 
@Mr.777 no... :(
 
@uni if you say something, you better stand up for yourself and explain.
 
@miniHessel I didn't say anything.
 
Rename your war with ROOT and deploy it
 
12:42 PM
@Mr.777 do i need to change anything within deployment descriptor
 
you thought something, and pronounced it in text, which basically means that you said it.
And if you think I suck at something man the f. and tell it to my face?
 
@Mr.777...but how when i am running through eclipse...
 
I have a method, getPost(id) Which should take post id as input and return corresponding row. I know i can return resultset but i want to closed the statement object inside the method itself. How should i return the row
 
@Unihedron
 
@Mr.777 any idea??
 
12:45 PM
@AlexMan yes hold on
 
okay
 
Can anyone suggest idea how to do that, In PHP i know there was a function to get row as array
 
Right click on your project and select Properties
Then select Web Project Settings @Alex
 
okay
 
What do you see in the Context Root box/
 
12:47 PM
yes
do i need to clear that
 
@AlexMan What's written over there?
 
AuthenticationManageAngularJS
 
Okay remove it
 
okay
Context root cannot be empty
 
But removing won't let you apply
Are you using tomcat?
 
12:48 PM
yes
 
Double click on the tomcat in Servers tab
Then select Modules Tab
You will see your web module there
click on it, then select Edit and just change it to /
And it's better to disable the auto reload
 
document base or path
 
Ofcourse path man
 
no need to change anything
 
I don';t think if you can edit the document path
@AlexMan What do you mean?
 
12:51 PM
sorry i cant edit the document base
 
Yes, I didn't ask you to edit document base
 
but path i can edit
 
I asked you to edit the path
 
okay
 
and change it to /
now restart tomcat if it's already started
 
12:51 PM
and need to uncheck the auto reloading enabled right
 
yes, it's better but not necessary
 
what is use of that checkbox
 
Whenever you change something in your document base, it won't auto reload unless you restart the tomcat
othewise it will build the whole application and will try to hot deploy it to tomcat
 
ok
 
which mostly can fail
 
12:58 PM
@Mr.777 now i am getting 404
do need to change the context path
under properties
 
What if you do localhost:8080/
 
no only localhost
without port
 
yeah it says 404?
right click on project-> properties, web project settings & set context path to /
 
@Unihedron next time you are being rude, stick to it, don't bail out
 
@miniHessel ?
 
1:04 PM
@Mr.777 still 404
 
Alright, in your eclipse do Ctrl+Shift+R
and try to open the file .component
 
okay
<?xml version="1.0" encoding="UTF-8"?>
<project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="AuthenticationManageAngularJS">
<wb-resource deploy-path="/" source-path="/WebContent" tag="defaultRootSource"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src"/>
<property name="java-output-path" value="/AuthenticationManageAngularJS/build/classes"/>
<property name="context-root" value="/"/>
</wb-module>
</project-modules>
 
Can you hit localhost/AuthenticationManageAngularJS?
 
@Unihedron First of all, there were no point in being rude, I wasn't rude against you. Secondly, when you throw out something like that, you gotta stick to it, don't bail out and ignore my answers.
 
nope that too 404
 
1:08 PM
<?xml version="1.0" encoding="UTF-8"?>
<project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="AuthenticationManageAngularJS">
<wb-resource deploy-path="/" source-path="/WebContent" tag="defaultRootSource"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src"/>
<property name="java-output-path" value="/build/classes"/>
<property name="context-root" value="/"/>
</wb-module>
</project-modules>
save this one
 
ok
 
And now build the application, then Run As-> Run On Server & remove already deployed module form tomcat
 
okay
hey @Mr.777 got worked.....
thanks a lot
 
@AlexMan okay
 
hey one more doubt if you dont mind
@Mr.777 can we change the localhost name
 
1:12 PM
use 127.0.0.1
:D
 
i mean some dummy name
or the project name
 
I think, you can
You just need to play with server.xml somehow
and your OS hosts file too
 
Now I know what was "wrong" with the chatroom.. I had color-inversion disabled
 
ooh
@Mr.777 based on projects
 
Didn't do that and not sure if you can tweak it for different projects. May be a system administrator can help you.
@Vog LOL
 
1:16 PM
hmm....
@Mr.777 :)
 
1:51 PM
@AlexMan Yes. Contact your sysadmin.
You can't do stuff like making backups yourself.
 
okay
 
 
2 hours later…
3:46 PM
Greetings!
 
Greetings..
@Unihedron tell me what you think about the stuff I did to the StackExchangeChat
 
Greetings!
 
greetings!
 
ok comparing with git diff plugin
 
I need to clean up what I linked just now, but that's how it'd work with my changes..
 
3:50 PM
@Unihedron Tuesday, Asus sent my board overnight!
 
It's probably gonna be quite a lot..
since I almost completely reimplemented with a different way of describing chats...
 
Well, did the forms, has not given it to the shipping company yet!
 
anyways I'll be out until tomorrow, so take your time ;)
 
Gotcha :)
 
until then ;)
 
3:51 PM
The old interface is deprecated :(
 
Hi Everyone!
 
Hello!
 
Hi
I have kind of stupid question.
Does it matter if I store some big objects in a list or small objects?
List will only store the reference to those objects no matter what kinbd they are, right?
 
Why would it matter? Recall that in Java, all Object fields store references to the location.
If you're really going for the good code, avoid using large objects where smaller objects will do it, to begin with.
 
Even if it is int or double?
 
3:57 PM
Hello!!!
 
Other than memory, is there any other issue with large objects? my objects has about 30-40 methods. Should I try dividing such objects into smaller ones?
Hi!
 
@LifeH2O Those are primitive types, they're not objects.
 
@Unihedron In java there is also Integer for int, Float for float etc.
So they are definitely not the primitive types, but objects for those primitive types to perform other functions.
 
those are objects.. @LifeH2O you usually use them for some other special purposes.. like placing primitives inside lists
 
Yup, got that. C# made me dumb. Java wants me to learn how to code well.
 
4:03 PM
@LeeJeong That's called a dimension, it's not really a special purpose.
 
but java does it already for you, they wrap your primitives with those Object'd primitives so that they can get in the ilist..
 
That's called autoboxing, and it's really not all that convenient.
 
@Unihedron yeah, why would i even tell that as something special
 
If I cast something as (Object)something can I get back its original type?
 
Integer something;
((Object)something) instanceof Integer
 
4:05 PM
no need to.. its already taken care of by Java :)
AFAIK.. or im wrong. xD, trust @Unihedron
 
@LifeH2O You possibly won't want to do that though. Try casting it to Number, you can do like .intValue() to get a casted value.
Java takes care of autoboxing for you:
 
im just taking guesses if im also knowing it right. ahaha
 
Integer x;
// This is same as x = Integer.valueOf(4);
x = 4;
 
But there I already know it is an int. What if I don't?
 
What if you what? What do you have?
Eh... I don't get it.
 
4:08 PM
What if I have something casted as Object. Now I want to know what it actually was.
 
This sounds like an XY Problem, but hey:
Use instanceof if you can expect the object to be of specific types. If you don't, the only other way is through reflection: .getClass()
 
CookieManager cookieManager = CookieManager.getInstance();
 
Oh I missed that. So I should cast with instanceof. Got it.
 
but error is cannot resolve getInstance() method , is there any lib need importing before using it? , can you someone show me?
 
@sile What's CookieManager? Never heard of that class.
 
4:12 PM
it is on Android
 
I do realize, as you've cross posted the exact same message in my other room.
 
@sile What is the package name of CookieManager?
 
@Unihedron So star is public and the room owner can unstar on will
 
Yes, but the process is not easy, and oftentimes users spamming stars are to troll the room, which results in a need for intervention.
 
I can see gotcha starred on right panel. That's not fair
 
4:15 PM
It's not gotcha, it's gotcha.
 
@Unihedron lol what?
 
@Mr.777 hmm?
 
Gotcha & gotcha whats different?
 
It's not "Gotcha" either, it's the word "gotcha" in <em>.
 
It is part of some code
 
4:17 PM
Ohhh i am on mobile, so dont know the context @ all
 
I should have been able to star something only for myself.
 
My friend invited me in his office & now he isnt in office :p
 
@LifeH2O I agree. That proposed feature request has been sitting for an entire year.
 
And i am waiting outside with the heavy bag containing two laptops on my shoulders
 
4:19 PM
Yeah! Because I am not interested in your gotcha I want my very own gotcha
 
I got rid of it anyway, kind of wondered why I didn't unstar it the last time it got on the transcript. I think it was like 3 am that time lol. Wasn't awake.
 
Which exception is most evil of all in java?
 
@Mr.777 Do you really want to know?
Ok, ... Unexpected exceptions
 
@Uni that's why i even asked
Lol give me an example
 
But no I don't believe there is an exception of all exceptions.
 
4:22 PM
Nah i mean java's own exceptions, not custom ones
 
I meant "unexpected exceptions" as in generally unexpected exceptions that comes out of nowhere, undocumented :P
 
Hahaha no exception is undocumented, i guess
 
Lol i love this chatroom, see i am on the road and have nothing to do but still in this room
 
I wish I had something better to do with my life than chatting here.
Like attending jobs of a software development company doing absolutely nothing~
 
4:25 PM
Thats taunt @Uni ?
 
No, I'm serious. Guess what I'm doing right now?
 
Chatting
@Uni do u freelance?
 
You may or may not know, but I have dual monitors. Right now my hovering monitor accesses this chat room among others on chat.SO and chat.MSE, and I'm doing a calcudoku while coding the chat bot.
@Mr.777 No, unfortunately. Freelancing isn't that easy.
 
Who said? I do freelancing & u r way better than many
Well, i wont be ashamed ti admit that u r thousand times better than me
 
I'm not really better than many.
 
4:28 PM
Trust me u r, or perhaps millions? :p i underestimated u :D
 
Hmm... I've written at most compilers and script engines. I've never dealt with systems and websockets.
And mathematical modelling, considering I suck at maths.
 
And u still think u r not good?
 
Well... Maybe. But I'm still no way better than many others.
 
U r being modest
Well thats good too
 
Mediocre at best.
 
4:32 PM
Jon Skeet
 
Skeet's C# book is amazing.
 
I read first chapter. It was about history of how C# is evolving.
 
Yeah.
Puts the Microsoft books to shame. :)
 
Yeah! MSDN at times is HORRIBLE ... gave me chills while trying to learn MVC ASP.net
 
Haha, I have to agree. My eyes bleed with MSDN. I have no idea why they haven't deprecated the series and sell Skeet books altogether.
 
4:42 PM
 
4:53 PM
LOL. to @Unihedron anything that is related with Microsoft i think is just ugh disgusting..
 
Hey, watch what you say. Some people actually write "great microsoft office skills" in their resume.
xD
 
@Mr.777 i do also agree that @Unihedron is a good/great one that can do freelance
@Unihedron BUT I DO! coz that's what the Idiot HR people knows.. :/ they became a standard like fvck
 
He is probably doing better than freelance
 
I wish.
 
I wish I had that multiscreen setup like your's :p
 
5:00 PM
Hehe, it took me three days engineering that monitor, I love it. ;)
 
5:16 PM
@Unihedron me too :)
One is never enough. I can imagine doing different things on different screens. It would be Awesome!
 
I know, I'll write more packages and decorate my github so I have stuff to show on my CV. :P
 
5:39 PM
Write enough packages for christmas~~
 
:)
A box is divided into 4 boxes which is further subdivided into 4 boxes and so on. What is the best Data structure suitable for this scenario?
 
6:07 PM
@uni
 
um...
 
That's how I sort my images
 
sounds a bit like a quadtree
 
I think there's a quadtree...
or maybe there's not...
 
.. asdfhakwje
 
6:33 PM
Unihedron has made a change to the feeds posted into this room
Unihedron has made a change to the feeds posted into this room
posted on November 28, 2014 by Unihedron

Regarding previous blog post Phones, a rhetorical question was asked: Why can’t we just have free internet? Nowadays, the Internet is economically accessible by most users, given that you’re not looking forward to getting the best connection, ADSLs or Cable Modems supplies you with mostly stable Internet access where you can even stream music and watch a … →

 
Good night!
 
HELLLO!!
OMG!
 
Oh?
 
wtf is this error, TLTG : Non-terminating decimal expansion; no exact representable decimal result.
actually im googling right now
i just want to hear your practical approach to this
 
No bedtime for Uni
 
6:41 PM
Never heard of it. :o
 
im basically crunching with financial amounts.. dividing things... and then BAM
 
I wanna go to bed too >_<
Did you divide by 0?
 
@Gemtastic go to bed now then. its good for your head! :D
 
it's only 7pm though
 
Im not sure, i didnt directly put the numbers... ill check..
 
6:42 PM
Anyone here who has done or do android development?
 
@Mr.777 me
 
Wow so I am trying to implement a filter on ListView via EditText
It only works for the element at index 0
 
@Gemtastic i think its ok to sleep that early.. haha.. if you feel sleepy go!
@Unihedron you dont do much Big operations? Dealing with financial computations right now...
 
@LeeJeong Can't sleep without my better half
 
@Gemtastic awwww! :D
 
6:46 PM
Sure hope my neighbour won't wake us up like he did this morning >_<
 
how old are you sir?
 
What difference is financial computation different from typical operations? And no I don't use Big* objects, I invent my own types when I need em
 
25
 
in the Philippines, we dont usually get kicked out of the family house at 18... but i live with my half too at age 23. wahahah
@Unihedron wow, you really are something! :D
 
6:50 PM
Never really dealt with EditText though... sorrys
 
I moved away from home when I was 18½ years old. best thing I ever did
 
@Gemtastic you live in? Is it required?
never mentioned, me and my half also live separately from the family. hehe. really cooll... well awkward at first, people here are all like "WTF, you livin alone now with a mate?"
 
@LeeJeong no it's not required, but I lived very far from my senior high, so I moved out to live nearby my school.
 
you live where btw
 
Normally people will llive at home until they are at least 19 or 20.
Sweden (it says on my profile too ;P)
 
6:57 PM
<- the lazy guy... and ATM this financial shitty thing is cranking me up like mad. its 3AM already here... this is soooo ugh
im not as smart as @Unihedron to create my own datatypes.. xD
 
I want to learn how to create my own data types
It sounds fun
Amusingly enough though, I only lived alone for a year, then I met my better half :3
 

« first day (1497 days earlier)      last day (3450 days later) »