« first day (1586 days earlier)      last day (3363 days later) » 

4:00 PM
lol
@Gemtastic Are you working in that time?
 
I am getting some errors in spring application context - even number of URIs
 
@SecondRikudo The only thing I have right now is the samples provided with JavaFX. In those samples there are NameOfTheApplicationController.java That's what I want to understand.
 
@sec that was an incomplete answer and you must add more information to it.
 
I have merged several application contexts and have cross checked the URIs and have found that there is no error whatsoever in them.
 
@ItachiUchiha Yes, even gods need to pee though
And as you know, I can't do it while watched.
 
4:05 PM
I'm just asking for some documentation about that because right now I'm launching blind google searches about javafx controllers with not much success
 
The error log is showing me in line 20, column 1620 or something like that. But it is not showing in which application context does this error belong to.
 
Well, you can. MOST immortals walk naked ;)
@deckard looking for documents on jabafx controllers will lead you nowhere, because there aren't any
 
@deckard In MVC and MVC-like paradigm, a control is what directly handles the actions the user takes
In web, that's HTTP requests and form submissions
In GUI that's the user clicking the buttons and interacting with stuff.
The "V (view)" is what handles all of the "visual" logic.
 
Yes, that's what I can understand from the samples
 
@SecondRikudo I hope to be working before then
 
4:09 PM
@Gemtastic Are you working currently?
 
@SecondRikudo No, I have little faith in myself but I was hoping to land a paid internship this summer
 
@Gemtastic You should have more faith in yourself.
Be aware of your weak points, sure.
 
An internship hopefully turning into a job on the side of my studies and better yet; a permanent workplace
@SecondRikudo Did you have a look at my project?
 
@Gemtastic I have it opened in another tab
 
I appreciate every tip or CR you have.
 
4:12 PM
Well, you know, my Java-fu isn't 100% fluent, but I'll do my best.
 
The point I'm at now I think I need to code code code and then just widen my field a little. I'm learning databases atm
 
@deckard well that is more or less what it is. When you write a fxml, for example, you need to map the actions of buttons to methods, you do it inside controllers.
 
Although, have you considered posting it on Code Review?
 
@SecondRikudo I have, but I don't know how to put it as a question and I'd have to make a readme :P
 
@ItachiUchiha Aha
 
4:13 PM
@SecondRikudo Isn't it too extensive for a CR?
 
@Gemtastic For starters, make a readme.
@Gemtastic Nope
Second, post it on codereview
 
I have a VERY detailed project description, but I dunno if it's too much for a readme :P
 
Link to your repo, explain what the app is, and add highlights in the question.
 
You can also define actions to be performed while loading the view inside the initialize method of the controller
 
@SecondRikudo I'll do that tomorrow when I'm not as tired (i've been up since midnight at it's 17:14 now)
I got 0 comments from my teacher but I got the highest grade so, not that it means anything but it looks nice on my grade stats :P
 
4:16 PM
@ItachiUchiha Ok, so one side you have the initialize method when you set up the app. And then you have all the event handlers, is that right?
 
@sec do people perform a whole project review on CR?
 
@ItachiUchiha Yes
@Gemtastic Can you explain in a few lines what's the project?
 
It's a webstore for a toystore
It's only incorporating placing orders by bill, and it's very simple; you can add and remove to cart, empty it and you can send messages to the store
 
@Gemtastic well, first thing I see is you have a singleton.
 
Yes
 
4:18 PM
No.
Singletons are, in 99% of the cases, bad practice.
And you're using Spring, which is a Dependency Injection framework, so that's double the sin :P
 
@deckard well more or less, yes!
 
@SecondRikudo Good points, since the "teacher" taught us to do that
 
Also, to add insult, your singleton is a repository!
 
@ItachiUchiha takes a while though
 
I don't have the slightest idea of how they are supposed to look :P
 
4:20 PM
Do you know what Dependency Injection is?
 
@SecondRikudo yes
 
Do you know why it's a good thing to follow?
 
@Vogel612 Just the fact that they do makes me curious.
 
This project is based on what my "teacher" taught us. I've mainly made it to suit his tastes. I know it's probably shit since I had to make it and learn Spring and thymeleaf and Javascript in one week :P
Everything not vanilla java in that project I learned in one week
 
recent example:
18
Q: Parsing log files of HearthStone: The log reading API

skiwiI'm still working on a parser that can parse log entries from a game called HearthStone, the overall idea is that it will read the log file live when the game is running, parses the log file and show interesting and useful data in real time. For the question the focus is on the API I have create...

 
4:22 PM
@Gemtastic That's fine, Spring, with all its wickedness, has a purpose.
 
Everything you can fit into the 30k character limit of SE posts
 
@SecondRikudo And yes, I love dependency injection
 
Basically, with classical dependency injection, you'd have to manage and wire all those dependencies yourself.
That's a huge pain
 
I was doing it before I knew what it was
 
Spring's original purpose was to alleviate that pain
 
4:23 PM
@SecondRikudo well isn't it somewhat like that with Spring?
 
@SecondRikudo Interesting
 
you define your wired beans in an xml
 
You define things as injectable "beans"
 
and just the actual wiring is done
 
Either in XML or in a Configuration class
And then you just ask for them
 
4:23 PM
I've done it with Java Config
 
@Autowired
public void WhateverConstructor(BeanOne a, BeanTwo b) {
 
well @Autowired is a lie
 
The thing is though, if you don't use a singleton, how do you ensure that there's only one repository?
 
@Vogel612 Yeah, but that's the idea.
 
@Gemtastic you don't
 
4:24 PM
@Gemtastic Why do you need a repository to begin with?
 
^^
 
Because I need to put the wares in a cart
 
Let's talk about the concept, not the implementation.
What kind of problem do you need to solve?
@Gemtastic So you need a Cart, not a Repository
 
One cart for one customer
 
right... a Singleton means: there is only ever one single instance of this class
 
4:25 PM
@Gemtastic How does Repository help you there?
 
@SecondRikudo But I need it to prevent making more than one cart for one user
 
ever
 
@Gemtastic Have a User class with an associated Cart
The User is populated by session
 
@SessionScoped ftw
 
@Vogel612 I assume this becomes problematic because there are in practice gonna be one cart for each person using the site, a singleton would make anyone connecting to the site use the one and the same cart?
 
4:26 PM
fully correct
 
Now, to be fair, my argument is that generally, a shopping cart is not the concern of the server.
 
(See, I'm not stupid, I'm just not very well taught ;P)
 
@SecondRikudo hmm. depends I'd say
If you want a cart to persist between sessions it's definitely server territory
 
@Vogel612 Just the fact that they do makes me curious.
 
@Vogel612 Nope.
When you go to the supermarket, and buy stuff
 
4:27 PM
I agree to that the cart should be client-side
 
You don't take your cart to the register for each item.
And just pay in the end
You take the cart yourself
 
true that...
 
Put shit in it
And then check that out at the register.
This is exactly how it should work.
 
But I have a hard time visualizing the code for putting the item-beans into the JS cart...
 
but if you go to the supermarket, and put your cart into a corner
and come back the next day to grab your cart
is it full or empty?
@Gemtastic assign ids
 
4:29 PM
@Vogel612 The cart is yours.
 
hey guys, is it possible to specify the columns of a csv file you want parsed as arguments in a jar file, and then have the program only produce a new file consisting of those columns (i.e. 0,3,5)? I can't get my head around as to how I'd do this :s
 
localStorage doesn't expire. Ever.
 
hmm... cookie, eh?
 
@Vogel612 nope.
localStorage.
Completely client side key-value store.
 
like... writing to disk?
 
4:29 PM
@SecondRikudo I think that's a beautiful simile. You graba cart when you enter the store (creat a client-side cart) and put your items into it, then you send it to the server when you make your purchase
 
@Vogel612 localstorage is a variable handled by the browser. It is not necessarily short lived.
 
Assuming you use the same browser (which you have to anyway to maintain session), your cart is only yours.
 
TIL
 
And will be yours even in a month when you decide to visit the site again
 
Is that cashed or cookie storage? <-- newb here
 
4:30 PM
Unless your code specifically says otherwise.
@Gemtastic localStorage is not cookies, and it's not exactly a cache.
It's a database of sort that exists in your client. Like redis
You can store a key:value pair in it, and then access the value by the key.
 
@SecondRikudo It's a new concept to me then. Google here I come!
 
@Gemtastic localstorage is a browser thing
it's neither
 
@Unihedro cookies are, too.
 
@Vogel612 Cookies are sent to the server with each request.
 
^
 
4:31 PM
localStorage remains purely client-side unless you specifically send it with AJAX.
And it's not cache, because it doesn't expire with time or server-based modifications.
 
It's different from a cache or a session, as well.
They expire.
 
so it's like writing to disk, but in a controlled environment?
 
The closest thing to describe it would be a per-site, client-side database.
 
And exist for a different reason than localStorage.
 
@Vogel612 Yeah, pretty much.
And you get a nice API to access things too.
 
4:32 PM
Writing to browser? :P
 
@Vogel612 think of it like a volatile database with a ecma api
I mean Java-volatile not actually volatile
 
brb
 
There are exactly two methods to the localStorage API
 
get and put?
 
localStorage.setItem(String key, String value)
localStorage.getItem(String key)
That's it.
Dang rate limitation
 
4:34 PM
a friend of mine gave me a speech about that i MUST destroy every object/variable i dont have use anymore and basically doing all the garbage collection my-self in java if i want to focus on performance and good code.. we had a little conflict, i said it's not fully-true and he said the exact opposite. who is right and is it exactly true?
question that bother me to much for you guys
 
@Vogel612 in short, you save the cart data to localStorage, and when it comes time to checkout, you send all items to the server for checkout (with all logic associated with it).
 
@somefolk it's definitely not true
 
The only difference is that the server does not keep track of what items the user has in its cart, until the very last moment.
 
also it's basically impossible to actually destroy an object
 
@somefolk That's true in C. Not in Java.
Java is garbage collected, once a variable's refcount reaches 0, it's automatically destroyed.
 
4:36 PM
@Vogel612 @SecondRikudo i see, but does it have an of the slighthest of the truth?
 
and if you null out references you may speed up garbage collection
 
@somefolk Not in Java.
 
but that's mostly minor, since java's escape analyisis is quite good
and the GC runs whether your null out references or not
 
@Vogel612 there are a lot of advantages to that approach (clent-side cart). The biggest one: localStorage is fast
 
@Vogel612 @SecondRikudo you guys deserve a medal! when ever i got a question you are always here to quick help
 
4:37 PM
@SecondRikudo hmm... what about stores with fast-changing range of products?
 
Instead of performing extra HTTP requests this way or another (which you have to do, if you want the server to be aware of the cart), you save things locally.
This also saves a crapton of memory server-side if you have a lot of users.
 
sure. so far so good
 
@Vogel612 What about those?
 
again: what about stores where you can't guarantee that the product (in your localStorage cart) will be available the next week?
 
@Vogel612 Let's go from the opposite way
How would you handle it if you had the cart server-side?
 
4:39 PM
I still wonder how I get my server sided beans to the local storage... do I do a GET when the user adds to cart and save that item reference to the local storage?
 
I'd probably check the product in the cart for availability (against a db) and if it isn't available, just throw it out (possibly with a warning to the user)
 
@Vogel612 Great! So I'll do the same, only before checkout.
 
the simplest to do that would be when the customer logs in and once before checkout
 
Or if I really want to, I can detect how long it passed since the user visited (by keeping lastVisitTime in localStorage, for instance), and if it's above a certain threshold, make the check.
@Gemtastic Server is not aware of the cart.
Until you POST to /checkout
Client side has something like this in its localStorage:
 
@Gemtastic what Second wants to say is: you don't
there is no server sided beans involved
 
4:43 PM
Hm, I think I'm a bit dumb; the reference for the item already exist on the page facepalm
 
"cart": "{42: { 'name': 'foo', 'price': 19.95, .... }, ... }"
 
Never mind~
 
All of this calculation is done client side, without the server knowing
You display the price to the user based on the information you store on his machine
Then they submit their cart to the server
Server does sanity checks, validation, price calculation, everything needed
And displays the checkout page to the user, this time with data from the server.
 
@SecondRikudo Yes, I understood that, and it wasn't my question at all
I'm bad at expressing myself >_<
And I was a bit stupid
 
Most of us are. Try again :P
 
4:45 PM
Because my issue was really, really simple
 
(Both bad at expressing ourselves, and a bit stupid)
 
It wasn't even an issue, it's just that I'm so tired I don't know what I know XD
 
ya... if you both could remove the later part
that would be just great
 
@Gemtastic Go to sleep, and let's discuss it when you wake up?
 
@Vogel612 ??
 
4:45 PM
because then I don't have to feel completely retarded
 
@SecondRikudo I will go to sleep when my better half wants to. It's still only afternoon...
 
@Gemtastic vOv
Do you understand the workflow?
 
We try to push it a little so we'll at least go to bed when it's evening
 
It's very similar to the physical example from the supermarket
 
@SecondRikudo I believe I do
I believe I've done it all the time
 
4:47 PM
The user (customer) can theoretically rewrite the price tag on the product with a pen
But once they come to the register, there's an internal database that charges you the right amount.
 
What I was hung up on was a verryy tiny detail that's not a problem at all, I was just dumb
 
:P
!!xkcd efficiency
 
Not that one...
 
4:48 PM
That one
@Gemtastic in fact, regardless of client-side or server side
Singleton is almost always the wrong solution to the wrong problem.
 
When you go to the checkout I'd make an update with the server that would check the current (and up to date) database, which can also alert to if a ware has been sold out
@SecondRikudo Unless you only want one customer to shop at a time ;P
(Very bad business model)
 
@Gemtastic Singleton is often thought of a great solution for app-wide configuration
 
@somefolk Did you already get the answer from the other people in this room? Can I add?
 
Configuration conf = Configuration.getInstance();
conf.get("user")
 
Yeah, I understand the concept. Didn't you see my little explanation of how things seemed to me that week? ;P
 
4:50 PM
@Unihedro i'll be more than happy for you to shed some light on this question
 
Some of the more horrible cases I've seen would be database connection
 
Custom taglet question: In JDK 8, can the taglet name start with a dot? In 7 it definitely can.
(Hi Uni :)
 
DataStore ds = DataStore.getInstance();
Connection conn = ds.getMySQLConnection();
(Or worse, MySQLConnection conn = MySQLConnection.getInstance())
 
What spring and thymeleaf looked to me when I only had 1 week to learn them and make a project:
 
@Gemtastic Still kinda looks like it to me
Because the way they implement things is kinda meh
There's too much magic in Spring
It hides away things I should know
 
4:52 PM
Ok, my stance on any sane take in garbage in Java is that Object construction is not expensive. However, usually it is the field allocation and assignment that makes it difficult for a classloader to unload the methods belonging to the class, which is usually the cause of why people mistaken "objects are expensive" while it's actually not true.
 
What spring and thymeleaf looked to me the very moment I submitted my project:
 
For example, in this class:
class Foo { int bar() { [native code] } }
 
@Gemtastic a framework's job is to reduce complexity and setup
 
@SecondRikudo I agree 100% with that
 
(where [native code] isn't really native code)
 
4:53 PM
I don't want to deal with this, it has nothing to do with my application
But spring makes too many assumptions, and does too many things for you behind your back.
And to add insult, Spring Boot makes even more assumptions
 
By using Foo foo; and having a reference to a Foo object still alive, the dependency is established and the class Foo is forced to be loaded. So as long as any Foo object is still weakly+ referencable, the classloader will have to remember the type.
 
@SecondRikudo Well the thing is, with all that stress and no knowledge, it all seemed so much harder, I had no idea what I was doing or where to look (didn't help that I picked Java configuration which there's even less material to learn from)...
 
Therefore, if a type has many methods, it is important to throw away the objects in time where necessary, especially if your program is huge.
Like Minecraft!
 
We had 8 weeks of "type like this and it'll work, because magic!"
 
@Gemtastic My general approach when getting into a new topic: Go vanilla.
 
4:54 PM
@aliteralmind Hello! :)
 
No frameworks, no libraries.
No fancy tools.
 
Then we had to make a "working" web application...
In one week
@SecondRikudo I don't even know what vanilla is with spring :P
 
Then after a little while, you get bearings, you understand what problems you're facing
And how they're a pain to solve repeatedly
 
The thing is, there was no time
 
And if your types aren't insane to that degree, you should never worry about collecting garbage, because whatever you can do puts a stress for the JVM to ensure that to be done, while if you don't garbage collect and allow the JVM to do it, it gets to be done in the best way depending on the environment.
 
4:55 PM
Without @Ita I might not even have made the extended deadline
 
And it's at that point, that you get a library/framework to abstract that problem from you.
 
in conclusion, it's better not to. unless you need to. which, with your question in mind, implies no such need to.
 
@Gemtastic Yeah, I can totally relate.
My brother, in highschool was learning JavaScript
The code they received as example would fail compilation.
 
Well, some of the things we actually went through in class was the vanilla way of making a web-server, but the course requires at least one framework and JavaScript
 
Unquoted strings, arrays that start with [1]
 
4:57 PM
Ugh, schools... :p please stop reminding me
my holidays are over soon
 
Only my mother's pleading stopped me from going there on parents' day and confronting the offending teacher.
 
I wish
 
I don't mind you teaching outdated things.
I'm fine with it, you don't have much choice, that's the curriculum set by the gov.
 
Wait, you don't?
 
But teaching things that are outright wrong
I can't forgive that.
 
4:58 PM
The thing is, the last two courses my school hired a company to supply us with teachers, only the guys they've sent us are code monkeys who only know copy-paste
 
There are lots of level of wrong
 
But it's like obsolete technologies that's based on a previous version of the software they use that doesn't even work anymore!
 
Varying between "Just use jQuery" through to "document.write is a great idea" and "arr[1] = <br/>"
I've seen the last two in their example code.
 
I'm almost a little amazed that I managed to pull anything together for a project in that course
 
@Second: Please bring Cap to r22091, I have a need to yell at a person
 
4:59 PM
!!summon 22091
 

« first day (1586 days earlier)      last day (3363 days later) »