« first day (1712 days earlier)      last day (3231 days later) » 
00:00 - 13:0013:00 - 00:00

1:03 PM
@MadaraUchiha XD
 
1:19 PM
Mornin, java
 
Morning/afternoon
 
How are you, Gem?
 
Fine but tired
It's too sunny for me to stay awake
 
It's cloudy as crap here, probably gonna storm. Again.
Not that it matters because I'm in a center office of my building =( I never see the sun
 
I sit by the window
 
1:23 PM
I can see a corner of a window from my desk
I'm a lucky guy
 
I can go out on the veranda whenever I want to; I just have to bring the computer
 
Jealous
So tired Q.Q
 
Well, me too but I'm at the end of my day kinda
 
Giving up soda is rough on my energy levels. Will ultimately help but man this sucks.
 
It evens out when you've detoxed
When you've detoxed properly, soda will kinda gross you out a bit.
 
1:29 PM
Yeah, it's already kinda starting to
 
First you will be tired because you're body is used to working on overdrive with sugar, then your blood sugar will stabilize and you'll recover from the harm sugar caused you
And you'll actually feel rested
 
until I find a substitute for coffee, I can't give up on it
I love coffee more than I love most people
2
 
Energy levels are gonna raise and you'll get back to how humans are supposed to
It works the same with coffee
Stop drinking coffee and even the caffeine in black tea will do it for you
 
I don't like tea :(
 
Tea is amazing
 
1:33 PM
so is bungee jumping they say, and still won't do it
 
@Tavo You don't have to drink it, it was just an example :P
 
I know, but I love the taste, the texture and the warmth of the coffee
 
That's how heroin addicts feel
 
not so sure about the texture of heroine though
or the taste
 
You never know women until you've felt wonder woman
poking fun at myself for misspelling it
 
1:35 PM
checks to see if still in Java
 
well, I have plenty of comic books of her at home, so I can say I've felt her :D
 
Well, point in case; addicts gonna love their drug
 
Oooh, new Eclipse version
 
Be it sugar, coffee, cigarettes or heroin ;P
Ewww eclipse
 
tried them all except heroin. I'll stick to coffee :D
 
1:38 PM
I've only had coffee out of that list
 
It's the least harmful one actually
I'm pretty sure you had sugar @uni
 
I don't.
 
you eat pockys
 
@Unihedron O.o
 
you have
or pokis
or however they are called
 
1:39 PM
Yeah, pocky has a lot of sugar
 
@Tavo pockys aren't sugar
 
I'm sorry but anything containing sugar is sugar
 
that's like saying a latte is not coffee
 
You're not less of a marihuana user just because you have it in brownies...,
 
@Gemtastic damn it! I knew it! :P
 
1:41 PM
XD
 
1:51 PM
Hi guys
Java 8 has removeIf for collections
I want to do something like changeIf
How can I do that without using extra space?
 
fge
sigh again with that "I want shorter because I think it's better"
And how do you intend to change anyway?
 
I don't know
at the moment I'm thinking of using iterator but that's ugly
 
fge
If you really intend to change elements of a collection inline you're doing it wrong to start with; just create a new collection with the altered elements
Especially if that collection is a Set
But then again you don't tell what your problem is, so...
 
^^
Normally I say modifying collections inline is okay, but never remove from a collection inline.
 
Oh it's a coding thing where I have to use constant memory
 
1:58 PM
Still not very specific lol
 
"I have this house I wanna make changes to. How do I do that? I found this hammer, how do I use it to change my house?"
 
Which one is better to hammer a nail, a glass bottle or an old shoe?
 
I'm doing this
A.removeIf(i -> i < 1 || i > A.size());
I want to do one liner solution with constant memory without having to do this:

ListIterator<Integer> it = A.listIterator();
while (it.hasNext()) {
if (it.next() > arrSize) it.set(0);
}
 
fge
"have to use constant memory" --> who said you had to do that?
 
the question
 
2:02 PM
"I'm doing this: hammer on the wall. Will it change my house the way I want it?"
 
fge
OK, I'll repeat again: less code does not mean better code
 
Java 8 stuff was going to be faster
 
fge
Fallacy
 
what I'm asking is is there a Java 8 way of doing it
 
fge
This may, or may not, be the case
 
2:02 PM
which is supposed to work faster (or same speed) and look cleaner
 
fge
Fallacy on both accounts
Java 8 streams and lambdas are like any new and shiny functionality $f: using $f for the sake of using $f is not the correct way of using $f
In fact, if what you want to do is to remove the first and last elements of a List, you're much better off using a ListIterato<?> because it's dead simple: if (it.hasNext()) it.next().remove(); if (it.hasPrevious()) it.previous().remove();
Done
Stop being obsessed by one liners; you'll only get hurt
 
Lambda's and closures are cool and all, but they should really be used sparingly. Especially since they're a Java 8 feature, for others trying to modify your code later, it might not be the best from a maintenance standpoint.
Never code for yourself. Code for the sorry sap that has to maintain your code in 5 years.
 
2:18 PM
@Nexion you probably know that it's illusionary to think like that when your boss is breathing down your neck to get the next feature finished
 
Arguably another reason for my case - don't try and over fancify your code by using new Java 8 features, code to standards and get it done in a timely fashion
And I know its not the most feasible thing in the world some times, I'm speaking in general
Also I hate bitching about coworkers to supervisors, but one of our interns/new guys is one of those guys that insists on chiming in on EVERY SINGLE conversation around him, makes it super hard to focus on the conversation I'm having with the person that I asked a question to in the first place. Finally had enough, had to say something.
 
Maybe your discussions distract him? (Why not use a chat?)
 
@Nexion I'd read that as a sign of interest.
 
<-- gets distracted by conversations around me when I'm not 100% focused on what I'm doing
 
and I'd talk to them about it before going to your superior
 
2:31 PM
I know it's not distracting him because it happens EVERY SINGLE time. And in this case I was having a conversation with a coworker about something unrelated, then the topic switched to a work question.
It's not just about work things, either.
I more just find him to be a grating person, in general. So when he does crap like that I get more irritated.
 
@Nexion advice still applies
I am also one of that kind of person
and I do this out of genuine interest and the desire to belong with the group
 
He does it out of a desire to be right about everything. Which I can't stand.
He argues against personal opinion and interests, and insults you if you disagree with him.
 
@Nexion that's a problem...
still I'd first talk to them personally without pulling the superior card
 
I've tried.
 
okay then go for it
 
2:41 PM
He stops for like two weeks then keeps doing it.
Other people have had issue too
ANYWAY
Enough bitching about coworkers, back to bitching about Java =P
 
good, that gets us to the room topic :D
 
We should create a room "JAVA" and reserve your enlightening conversations there instead.
 
This room would never get used =P
 
@Nexion I know exactly how you feel.
I had the same kind of colleague and I was happy when he wasn't around :)
No one had the guts to talk to the boss about it
 
2:55 PM
Does anyone know how to specify a foreign key in JPA?
@wonderb0lt Even worse that he's an intern, and the youngest one here lol
 
fge
<-- does not use JPA
 
I'm just gonna use liquibase to do it, you can't add ForeignKey constrains in base JPA, have to use the Hibernate Impl, and while we're using Hibernate, we code to JPA.
Because reasons.
 
3:12 PM
@Unihedron this is exactly what happened just now in the 2nd monitor
drama of the finest sort
 
...
@Nexion ikr
 
Two days after I stop drinking soda they put Baja blast in the vending machine.
That's just... not fair
 
muahahahaha
 
home again
 
what would be the most efficient way of determining combinations for a lock with 4 digits, and numbers 0 - 9? I was thinking of using Math.Random for each digit, but I feel like a more efficient way would be to lock in the first digit, which would be 0, and run all possible combinations with 0 as the first digit. Would that be more efficient than using Random?
@Unihedron the shoe.
 
3:22 PM
@JohnnyCoder wrong
 
@JohnnyCoder do you want to generate all combinations? Or just get the total number?
 
fge
Just use Random
 
Isn't the likelihood the same for random choices and sequential?
 
With a 4 digit length combination, there are 5040 possiblities, I want to generate every single possiblity. In groups of 10, the groups I can handle easily, I just want a relatively efficient way of doing it
 
fge
Don't ping people at random
That is considered rude
 
3:27 PM
yall replied
 
fge
Then what? It doesn't mean that we will reply in the future
 
I figured that I should tag you in my response, but I wont do it again
 
3 messages moved to bin
@JohnnyCoder Thanks for promising. If I catch you doing that again, I'll throw you out of this dimension.
 
Aight
 
for (int i = 0; i < 10000; i++) { array.add(i); }
taaadaa
:P
 
3:29 PM
About my question wonderbolt?
 
not really an answer
 
I figured, because it doesnt do anything important, or at least that is how it looks
 
that was just what I thought when I read get all possible combinations of a 4-digit number
 
fge
final List<String> list = new ArrayList<>();
IntStream.range(0, 10_000).mapToObj(i -> String.format("%04d", i))
    .forEach(list::add);
Collections.shuffle(list);
// play with list
And yes, I don't use Collectors.toList() for a reason
(which is clear when you read its documentation)
 
@fge 10_000?
confused
 
3:33 PM
Java 8 7 syntax for large numbers iirc
 
Thanks fge
 
fge
@Unihedron the upper bound in IntStream.range() is exclusive
If you want it inclusive you must use .rangeClosed()
 
@fge What (the hell) is 10_000?
 
fge
As @wonderb0lt said
Since Java 7 you can use _ to split numeric literals into "more manageable" groups
 
Oh! A magic number
 
3:37 PM
oh my god we're actually talking about java I feel so excited
2
 
huh
no way, I didn't know that
Is that why underscores are deprecated as variable names?
in java 9
 
fge
Erm, no
You still cannot make a numeric literal begin with an underscore
 
that sucks, that's a useless feature then
 
fge
?
 
int x = _1;
what would you gain from that?!
 
fge
3:39 PM
OK, then what is _1? Is it a variable named _1 or literal 1?
Heh, beaten to it
 
both!
 
int one = 1; - 1 character more
 
4:00 PM
:D
 
I feel every one of those.
 
The first one is a bit so-so, but the other ones, first place indeed! ;P
I almost killed a lot of my friends as a kid. They weren't as awesome as me at physical stuff :(
 
Hello all
 
hi
 
Big hitters for me are Pasta and Puns
 
4:07 PM
Morning all !
 
Oh wow... a national newspaper just wrote the most disgusting header for an article... In swedish there's a word called "sibling love" (syskonkärlek) and it's referring to the rough but strong love in between siblings (hitting each other but getting super mad if someone else hits the sibling you know) but they used it refferring to couples: "Double up sibling love that lasts for 25 year" pictures two couples embracing
 
hah. They hit each other too hard :P
 
More like they hit each other with the wrong limbs >_>
 
lel
 
@Gemtastic Happens to me all the time
 
4:22 PM
@wonderb0lt I hope you don't mean that with your siblings...
 
@wonderb0lt that's a comment @Dustiny would do
 
Or if you do, for the love of everything sane, let it not be your biological ones...
 
too much GoT
 
@Gemtastic I don't have siblings, but I do "accidentally" "hit" people with the "wrong" limbs
@Tavo Sometimes we're all @Dustiny
 
@wonderb0lt don't get anywhere near me :P
 
4:24 PM
@Tavo :(
 
I don't think you are my type, sorry
 
wrong set of genitalia for a starter
 
@wonderb0lt Yeah.. just like the newspaper, pay attention to what you're writing
 
4:44 PM
gnight all
see you tomorrow
 
see ya
 
5:13 PM
FUCKING JOOOOOOOOQQQQQ!!!!!!!
throws everything around
 
mostly Throwables I hope?
 
IT DELETED MY ENTIRE PROJECT!!!!
 
I do hope you use version control?
 
I do, but I hadn't had the chance to push everything. I was just gonna make a tiny test file and it deleted everything!!!
 
no need to push with git...
just. ... git reset --hard HEAD
as long as you commited before JOOQ killed it all you should be good to go...
 
5:17 PM
I DIDN'T
The only thing it didn't kill were my FXML files.
The only thing I had committed to git Q_Q
Well, that and main but main is gone too and reset head didn't fix it O.o
 
:O
what?!
how is that even possible?
 
The line vogel gave didn't work
So I googled it and it's back to what's on the repo, and everything I've done today and yesterday is gone.
 
5:39 PM
FXML? Fucking XML?
@Gemtastic =( I'm sorry, that sucks so hard
 
JavaFXML
Now I'm back to this rotten issue that it can't find the main function in my other main function that isn't the app main... >:(
 
http://www.commitstrip.com/en/2015/07/01/an-ounce-of-cure-is-worth-a-pound-of-prevention/
CommitStrip - Blog relating the daily life of web agencies developers
An ounce of cure is worth a pound of prevention
CommitStrip
1435772646
 
6:01 PM
pushing like mad
At least I got this thing working now
 
6:16 PM
Anyone here experienced with JavaFX?
I'm finding the text being used could benefit from supplemental materials.
 
Text?
I think you need to rephrase your question. I know some JavaFX (making an app in it as we speak) but I don't understand what you mean
 
Oh, yes, ProJavaFX.
Well, I'm experienced with Java, but making my way into JavaFX for interface building has proven challenging with only the aforementioned book at my side.
 
Why are you reading that book? Oracle has its own tutorials
 
So, I'm wondering if there's a tried and true approach for someone in my situation.
Ah, that's a good point.
Well, I'm reading it due to recommendations, but also because I enjoy using printed books to be honest.
I'll pursue Oracles tuts. Thanks.
 
Hi..
Anybody there ?
 
6:29 PM
Yes.
 
How do website like example Facebook have a faster authentication system ?
I just need to know what technology do they user, despite their database being very large
Any ideas ?
 
I'm sorry, that is an area I'm very unfamiliar with. Hmm...
 
Authentication meaning - user logging into the system
Oh ok thanks !
 
Could it have anything to do with geographic partitioning?
servers for regions, etc.?
 
Hmm might be I guess.
 
6:31 PM
Good question.
 
But still it is a large databas
 
Facebook has most of their servers in Kiruna sweden so I dunno about that
 
Hmm ok
 
Fast internet + powerful servers == fast authentication I suppose
 
Could they partition them locally somehow? That is, organizing the flow by geography?
Not knowing much about how networks are constructed that's just a hopeful guess.
 
6:40 PM
Hmm
 
6:59 PM
    private Properties getProperties() {
        Properties database = new Properties();

        try (FileInputStream in = new FileInputStream("src/main/resources/configurations/database.properties");) {
            database.load(in);
        } catch (FileNotFoundException e) {
            System.out.println("File not found :(");
        } catch (IOException ex) {
            Logger.getLogger(ConnectionService.class.getName()).log(Level.SEVERE, null, ex);
        }
        return database;
    }
@Gemtastic Inject!
Also, getSomething() is a naming convention that should be reserved to getters
Database service has no business fiddling with the filesystem
 
Inject?
 
@Gemtastic Why not
 
I don't get it?
 
public ConnectionService(String database, String username, String password) {
    this.DATABASE = database;
    this.PASSWORD = password;
    this.USERNAME = username;
    System.out.println(DATABASE + ", " + USERNAME + ", " + PASSWORD);
}
Why not this? ^
 
I refactored it to loadProperties() instead
Because I want to connect through the properties :P
 
7:03 PM
@Gemtastic Do it from another class.
 
Allright
 
Your ConnectionService is to be aware of one thing, and one thing only
Which is providing with database connections
Input: credentials, output: connections
Currently, your input is nothing, and you output connections
 
The main part is that the loading of the properties is working as it should. I had some issues with that when I worked with spring.
 
This implies side effects, which is a Bad Thingâ„¢
 
nods
 
7:04 PM
Here's a tip from functional programming: Always have input, and always return output.
The only exceptions are the true edges of your application where side effects cannot be avoided
(Logging, for example)
 
Would it be appropriate to make a loader service for loading the properties into a bean and have that class deliver that?
that = the bean
 
Sure, ServiceLoaderService (unfortunately named, but you get it)
 
PropertiesReaderService maybe?
 
Could be.
Abide by the Law of Demeter as much as possible
Ask for what you need, and only what you need.
 
Input; path to properties; output bean
DatabaseLoaderService?
Sounds wrong too
 
7:07 PM
ServiceFactory
But be careful, the distance from ServiceFactory and ServiceLocator is very short
 
Hmm... I don't want a factory for this super simple thing...
 
You should never inject that ServiceFactory into your controllers.
@Gemtastic It accepts an input and outputs a POJO. It's a factory.
 
...But I also want good code...
A path isn't a pojo
 
@Gemtastic A bean is.
How do you currently create a connection service?
main()?
 
But the input in my mind was the path to the properties
Currently I don't create it at all since I haven't gotten that far.
I have a test file that tests it manually
Hmm.. I suppose I could make a factory after all.. have the path in the bean I give the service...
 
7:12 PM
Hmm
That would be an abstract factory though, which isn't generally a good thing...
Sec
 
Feels a bit overkill when a service would have done the properties reading just fine...
 
@Gemtastic Yes, and no.
 
This is a super tiny application
 
A connection service abstracts the getting of database connections
 
All it does is a few readings from a db
Note: A service, not ConnectionService
 
7:16 PM
@Gemtastic Alright, make the constructor accept the three arguments, and have a static factory method that accepts either a path or an InputStream, and returns a new instance of the service.
 
Ok :)
 
I feel it has the best ratio of "get things done" to "make it look good"
Also, you should look into the using pattern
Also called the "disposable" pattern
Basically, you write code like this:
connService.with(connectionn -> { ... });
ConnectionService#with then handles the closing of connections/connection pooling, etc
public void with(Consumer<DSLContext> consumer) {
    try (DSLContext context = getItSomehow()) {
        consumer.accept(context);
    } catch (whatever) { ... }
}
Then you don't need to worry about forgetting try-with-resources or catch mundane exceptions (You can even handle logging there)
(If there's one thing I've waited to have from JS to JavaScript, it's the disposer pattern :D)
(Of course it doesn't have to be a void etc, just an example)
 
I don't really get what you want me to do there; I forgot most things about lambdas >_>
 
Never mind for now
For now, static factory method
 
trying to figure where the path to the prop-file even belongs in all this XD
Also, I'm gonna have to explain all of this to a n00b
An even n00bier n00b than myself that is. A lazy one that's just gonna copy it straight off...
 
7:28 PM
@Gemtastic if you want, I'll explain the disposable pattern in depth later
 
I do want!
 
I love learning from you ^^
 
You're really good at explaining as well so I really appreciate your help :)
But now; bedtime
 
7:31 PM
Early
 
 
1 hour later…
8:57 PM
@SotiriosDelimanolis hey are you around?
 
9:19 PM
I am
 
 
1 hour later…
10:27 PM
Got a question bout the Javas
Whenever I need to store something, I use ArrayLists, every single time, unless otherwise specified in instructions. Is there any possible issue with constantly using ArrayLists? Are there are other, better objects to use?
 
11:10 PM
@JohnnyCoder "Is there any possible issue with constantly using ArrayLists" -> Yes. "Are there are other, better objects to use?" -> Yes.
 
Uni I have a question related to ubuntu, do you think you can be of some help?
 
I'm never of any help really.
Go ahead.
 
@SotiriosDelimanolis hey sorry was away for a while. I wanted to check with you on one of my question related to Spring RestTemplate. I know you helped me in the past and I don't see anyone here who has more knowledge on Spring RestTemplate apart from you.
so wanted to get an idea to see whether I am doing it right or not. If you have some time, and you can help me out then it will be of great help.
1
Q: How to efficiently use RestTemplate in multithreading application?

davidI am using RestTemplate as my HttpClient in one of my library. I am not sure whether I am using it correctly in multithreading environment as my library will be used under very heavy load in multithreading environment so it has to be very fast. Below is my DataClient class: public class DataCli...

 
@Unihedron Wifi keeps disconnecting after few minutes, this is happening since last two days
This is not happening to anyone else on the network
 
Renew your NIC network interface card
 
11:17 PM
You mean update?
 
We're not in the technology where you can "update" hardware.
 
But why upgrade hardware? While it was working fine until yesterday?
 
... What?
 
Why upgrade the hardware when it was working fine till two days ago?
 
Because it doesn't connect properly?
How long have your NIC been at use anyway?
 
11:29 PM
It's been two years or three at max
 
fge
@Mr.777 is your wifi an Intel by any chance?
 
It's been two years or three at max
It connects for few minutes then gets disconnected and keeps doing this
@fge I am not sure but I think so.
 
fge
Well, if it is it may be the same problem that I've encountered
3
Q: Wifi connection troubles solved; why does my "fix" work?

fgeI have a Samsung laptop, with Ubuntu 15.04 installed, upgraded all the way down from 13.10 but that's not the problem. I have connected to countless wifi networks over time without trouble... That is, until a few days ago. I am temporarily working at a client's place and wasn't able to connect t...

^^^ try this
 
Host bridge: Intel Corporation 3rd Gen Core processor DRAM Controller (rev 09)
 
fge
That's not the wifi card
 
11:32 PM
07:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 07)
08:00.0 Network controller: Intel Corporation Centrino Wireless-N 2230 (rev c4)
I have executed lspci
 
fge
Then maybe it's the same problem
 
00:00 - 13:0013:00 - 00:00

« first day (1712 days earlier)      last day (3231 days later) »