« first day (1553 days earlier)      last day (3402 days later) » 

12:20 AM
goooooooooooooodmorning
 
morning
 
Fev
hi good morning
 
12:37 AM
Feels good when you figure out the bugs in a framework you have no real clue on how it works ^^
 
check it out
this is the thing i've been working on for a week now
spring mvc, ORM, websockets, with apache camel and mysql
 
I'll check it out when I'm done with this stuff... This needs to be turned in sometime today >_>
 
 
1 hour later…
2:10 AM
Heya
 
Hey ita ^^
 
hey gem
 
Do you know anything about iterating through hashmaps with thymeleaf? I can't get mine to work >_>
I've come kinda far though. But I dunno if I'll be done in time..
 
iterating through hashmap?
 
if you need to iterate through a hashmap you're using the wrong data structure
not that you care if you're working on a deadline but just saying
 
2:23 AM
I'm trying to use the same datastructure as my teacher used
@ItachiUchiha I don't really understand how I'm supposed to write that in my case. What is InstanceMap in my case? >_<
 
your isntanceMap would be your hashmap's entryset
 
I can't identify what that would be i'm super tired
 
hashmap.entrySet()
returns it
it returns a list containing your key,value pairs
 
The controller has this:
model.addObject("cartcontent", cart.getCartContent());
The cart has this:
    private final Map<Product, Integer> cart;

    public Cart(){
        cart = new HashMap<>();
    }
    @ModelAttribute("cartcontent")
    public List<CartContent> getCartContent(){
        ArrayList<CartContent> basket = new ArrayList<>();
        for(Product p : cart.keySet()){
            basket.add(new CartContent(p, cart.get(p)));
        }
        return basket;
    }
The hashmap contains this:
I just don't know what text to put instead of instanceMap and Key >_>
 
cart.entrySet() would return a set (basically an array) of your key,value which would be product,amount
 
2:31 AM
<tr th:each="instance : ${cartcontent.instanceMap}">
    <td th:text="${instance.key}">.</td>
    <td th:text="${instance.key}">.</td>
</tr>
 
unfortunately i don't really know hwo thymeleaf works
so i don't know how to get what you want into that variable
 
:/
 
but i know that you want cart.entryset() :)
 
Yes, but what is it I write instead of instanceMap (which symbolize the entrySet())
 
if you make a method that returns the entryset, give it a modelattribute("entryset")
you should just be able to do th:each="instance : ${entryset}">
maybe
 
2:35 AM
Well, at least the page loads when I only type "cartcontent"
 
out of interest, what grade / year are you in
 
@gem the example I gave you has a Map inside an object
 
@ItachiUchiha Well then, it makes sense that I couldn't identify what instance map should be >_>
gotta hardcode some stuff into the cart now to se if it works
 
I will write a simple example
HashMap<String,String> test = new HashMap<>();
test.put("Key1", "Value1");
test.put("Key2", "Value2");
context.setVariable("test", test);


On my HTML page:

<p th:each="entry: ${test}">
  <span th:text="'Key: ' + ${entry.key} + ', Value: ' + ${entry.value}"></span>
</p>


Resulting in:

<p>
  <span>Key: Key2, Value: Value2</span>
</p>
<p>
  <span>Key: Key1, Value: Value1</span>
</p>
^^ Hope this makes things clear :)
 
Well, kinda except it isn't working for me
It doesn't even print the <td> for me :/
 
2:47 AM
Can you drop in your code?
 
your product is an object
it likely doesn't know what to do with it
 
does your Product class have a toString
 
It does now
 
did that help ?
 
2:51 AM
@gem html code
 
No, It doesn't understand
<table border="1px">
                                    <tr>
                                        <th th:text="#{cart.product}">Produkt</th>
                                        <th th:text="#{cart.amount}">Antal</th>
                                        <th th:text="#{cart.price}">Pris</th>
                                    </tr>
                                    <tr th:each="instance : ${cartcontent}">
                                        <td th:text="${instance.product.toString}">.</td>
 
product.toString()?
 
You don't use that in thymeleaf I think
 
3
A: Thymeleaf calling method on object

per_janssonI found the problem, since I'm passing in something to this method it's not a getter method so I have to provide the full method name: getValue not just value: <table> <tr th:each="row : ${table.rows}"> <td th:each="column : ${table.columns}"> <span th:text="...

this seems to suggest otherwise
 
well, this works:
<table border="1px">
<tr>
<th th:text="#{cart.product}">Produkt</th>
<th th:text="#{cart.amount}">Antal</th>
<th th:text="#{cart.price}">Pris</th>
</tr>
<tr th:each="instance : ${cartcontent}">
<td th:text="${instance}">.</td>
<td th:text="${instance}">.</td>
</tr>
</table>
Kinda...
 
2:54 AM
@gem you are returning an ArrayList
in cartcontent
There is no HashMap returned to the view
 
Ah, that's true
@_@
No wonder it wasn't working. I got it working now :')
 
Should I say FaceDesk? :P
 
You know I'm just pushing it to be done with it
I'm so tired :')
 
You need some REST
 
I need to figure out how to get my JS to find the elements :P
Oh, wait!
gotta try something
Nope.. .didn't work :(
My JS can't find the ID of my button :(
 
3:06 AM
use jquery
 
No it's thymeleaf messing with it. I am using jQuery
The idea is to have jQuery post the buying action to the backend
Because I have to use JavaScript >_>
 
javascript owns
 
well, yes, but I find it hard to combine Javascript and Thymeleaf
 
in my project i've just made all data access via REST API's
because fuck MVC in java
i'd much rather do presentation etc clientside via jquery etc than have the server do mass calculations on how to present shit
in ugly JSP code
 
Yeah
But I have to use at least one framework
AND JS
Q_Q
 
3:18 AM
what grade/year are you
i just graduated uni and we never learnt spring @_@
 
I'm not in uni, I'm at a career school I've only been programming since fall
 
stares into space
I don't know what to do. Should I redo the project with only spring and javascript, or should I keep trying to figure out how javascript works/don't work with this sh*t?
 
keep plugging on
having a thing thats msotly done is better than having nothing
tbh thymeleaf shouldnt affect JS at all
 
It does
 
3:30 AM
thymeleaf renders views, spits it to the client and thats that
 
But it does
The JS can't find the elements
 
whats the element and what are you calling to try get it
 
That works in the fiddle but when I try to run it in my code, it says that it's null
 
document.getElementById('buybutton') returns null?
 
Yup
 
3:43 AM
have you tried inspecting with a debugger your buy button element itself?
the ID of the button i mean...
 
Well, it works in the JS fiddle
 
hmm... do you use frames?
 
nope
 
can i possibly see your whole html?
 
3:51 AM
hmmm, thats weird... getting your code over the jsfiddle works, haha. hence a question, does your javascript run in the same scope as your document?
 
Well, I don't know, it's Thymeleaf in the mix
 
<a href="#" id="buybutton" th:id="'buybutton'" th:text="#{cart.buy}">Buy</a>

Change this to:

<a href="#" id="buybutton" th:id="buybutton" th:text="#{cart.buy}">Buy</a>
removed the extra quotation mark in the th:id
 
Makes no difference. I added it to test thymeleaf
:/
 
this is just to test that retrieving actually works, add the same element, name it buybutton2 but without the th:id and try retrieving that element
 
It didn't work without the th:id either
 
4:05 AM
therefore because of thymeleaf, there is a certain encapsulation happening. You really might want to try inspecting elements and making sure that the javascript you are writing is in the same scope as the page.
 
null :/
It shows up
I don't know how to make sure it's in the same scope
 
since you are using jquery, try:

console.log($('body').html());
if jquery sees the same page then you are in the same scope. :)
 
@gem still up?
 
Yep
 
Still struggling?
 
4:11 AM
looks like it..
 
Hehe
Hi @kyerie
 
hi @ItachiUchiha :)
 
@ItachiUchiha Well, yes, with the JS since it doesn't work
 
What is with the JS now. I thought I solved the bottleneck! ;)
@kye welcome to the room!
 
@ItachiUchiha Bottleneck? The JS can't find the elements in the document
Oh the irony when a new person joins Java and we're talking JavaScript
 
4:14 AM
Haha
Yeah, but I am not a new user :-P
 
No but I haven't seen @Kyerie before
 
JS can't find elements? Are you trying via id or class?
 
Id
It works in this fiddle: jsfiddle.net/oyw5yaLh
 
Why js without jquery?
 
Because that's what I knew >_>
 
4:21 AM
So you are saying that it runs on jsfiddle and not when you run the server?
 
yes
 
Can you view the source in the browser and check what it says..?
 
it says that button is null
or to be precise: TypeError: document.getElementById(...) is null
 
Do you know how to check the source of a page in browser?
Right click -> View source
I want to check what has thymeleaf rendered the page into
 
@ItachiUchiha This is the source: pastebin.com/CDPzUtvK
links to both of the JS files just fine
 
4:30 AM
 <a href="#" id="buybutton">Köp</a>
 
Yes
So there shouldn't be a problem :/
 
Well yes there shouldn't be
 
Time to ask on SO?
 
My wild guess will be to check if <a> accepts a eventListener or not
an*
Or replace <a> with button
 
it didn't work with the button
I already tried :/
 
4:45 AM
Well then I'll have to check the code myself, but that can take some time since I am travelling..
You can try SO
Permission Granted
 
lol
fuuu
entity managers and JPA
are the bane of my existence
 
@ben i have been struggling with hibernate myself
 
i decided to try an alternative to hibernate, and used openJPA
opinion so far: stick with hibernate
my problem with java at this level is there's too many moving bits - too hard to wrap my head around
i'm injecting an entitymanagerfactory, using that to getEntityManager
except I'm not using spring transactional, trying to manually handle transactions
except my entitymanager is somehow closing the connection while i'm trying to use it
when i try to use spring transactional the entire thing breaks
too hard to learn best practice for java
 
@ItachiUchiha not really a new user, been a lurker of stackoverflow for years though...
 
@ben too many things
@kye well saw you fir the first time in the room
 
4:55 AM
hehe
yes, too many things
sums up my J2EE/spring experience quite well
 
@ItachiUchiha yup, first time here, first time actually investing time in learning how to use this site properly, haha.
@BenHarris its always a pain in the behind...
 
java.lang.ClassNotFoundException: org.springframework.cglib.transform.impl.MemorySafeUndeclaredThrowableStrategy
added a @Transactional annotation and now this
 
@ben something similar happened to me yesterday when adding another annotation resolved the issue
 
its a dependency hell issue - some spring dependencies including an old version of spring-aop
 
from 4.0.2 need to upgrade to 4.0.4
 
5:03 AM
@Ben I am still struggling with Hibernate not able to find my table :P
 
have you tried setting the auto.ddl or whatever so it creates your table?
or are you trying to reverse engineer
 
Well I haven't tried anything to create table scripts for me
I created a table in PostGreSql
and then created a Model and annotated it with @Table and bla bla stuffs..
 
if you let hibernate create the table it will behave :)
 
Is that a maven plugin?
 
no
it's a property in your hibernate configuration
 
5:15 AM
Ahh, Now I remember
 
if you're using Spring, take a look at this
line 48
 
So this will always create my tables whenever the project starts?
How does it work?
 
there's different options - you can have it create once
there's update, so if there's any changes to your hibernate mapping it will update the table
etc.
 
What about the data in the table?
 
wouldn't be able to tell you - i haven't used it in any scenarios where the data is important :p
 
5:24 AM
hmm
Anyways, I will test some more tonight and check if can make my thing work. Else I'll delete the tables from DB and use this technique!
 
but trying to manually create a table to match up with hibernates weird options is crazy tbh
 
Yeah, I am going through the crazy bitch right now!
BTW, does it just create tables or insert some static data as well?
 
Good luck Ita ^^
 
it just creates tables
 
@Gemtastic Did you resolve the issue?
 
5:32 AM
@ItachiUchiha Nope :(
 
@BenHarris This is insane, how will I test my application without data. This is just for testing I guess
@Gemtastic If you have checked in the changes, I can test it
 
@ItachiUchiha Checked in?
 
commited
 
@ItachiUchiha, create table, insert data, test!
 
I think it might have to do with something someone did answer on my question; it may be that the JS loads before the document is ready
Yes! that was it!
 
5:39 AM
jquery
$(document).ready(function() {
// do stuff here
});
 
I already fixed it with that code
 
i shoulda realised that - sorry :(
 
Now that's one of the things you don't know as a n00b :(
 
haha
and its one of the things thats so easy to look over when you've used jquery for so long
 
I've only started learning JavaScript 2 weeks ago
 
5:42 AM
Well it is jquery and you said you don't want to use jQuery :(
@BenHarris How do you insert data ?
 
@ItachiUchiha I don't know if there's a vanilla way of doing it
 
There is.. Jquery is just a javascript library
$(window).bind("load", function() {
   // code here
});
 
depends how you're doing it @ItachiUchiha, if you're using spring you can use the spring-orm library
 
@ItachiUchiha I'm gonna try and learn as much vanilla as I can, but for this assignment, I'll have to use whatever is the easiest to google :P
 
fuck learning vanilla JS
 
5:46 AM
She is not talking about vanilla JS :P
 
+ I don't like to include Spring dependencies in the VIEW :P
 
I wasn't?
 
if you're talking about vanilla js - don't bother
it's like saying you're going to use a stick to eat your food as much as possible before moving onto a fork
 
I still wanna learn what's happening behind the scenes before I use the shortcuts
well, bedtime!
Night!
 
5:53 AM
peace out~
 
Night!
though it is already time for Sun to show up
 
1 more hour till the weekend for me
._.
 
@BenHarris Just I more hour? Guess you are from australia :P
 
you got it
 
Hell Yeah! I was never happier before on guessing something right!
 
6:05 AM
Man, jQuery sucks.
 
and Uni starts again :P
 
Still at school.
 
Heya All xD
 
jquery is awesome you take that back
 
fge
Moo
 
6:22 AM
@BenHarris Nope, jQuery is a riduculous framework that bloats handle objects.
I never used jQuery across my times on web development.
I never used jQuery across my times on web development.
 
what'd you use ?
just vanilla js?
 
fge
Eh, I kind of like jquery
 
Well, once, then immediately ditched it.
Argh, this school internet is seriously slow.
@BenHarris Yes.
 
Well, I like jQuery as well
 
fuck that
vanilla js is painful to use for the stuff you'd use jquery for
it is bloated - but who cares?
we aren't using compy 386's
 
7:06 AM
Good morning, Java
@BenHarris Yes, but when I use my mobile devices, I want to kick ass of developers who bloat their pages with 1+ MB of JS and other "bells and whistles"
 
user4202350
7:26 AM
GOOD MORNING OLEG
 
@ShaU Heyo!
 
user4202350
Pure Double Standards. -
 
user4202350
I once said why girls don't participate in chat rooms? and i was Kicked for 24 hours.
 
user4202350
But some people use "F" word here and some people in JavaScript room post S#* videos and they are not kicked.!!
 
fge
Grrr, another rendering bug!
I'm getting quite sick of those
 
7:37 AM
And I'm sick of random JVM crashes [which don't influence at anything, but make testers sad] :(
 
 
1 hour later…
9:07 AM
@ShaU This is clearly not the Javascript room. If you have a problem about the way we moderate, then that's your problem - You don't set the rules. You live with them.
Every room has different standards. This is by design. Every room is its own community hideout, and no specialized exists because chat remains that way. Python people are harsher. ASP.NET and Javascript people are more talkative and uses colloquial topics because they are like that.
This room is a professional place. Because you actively disrupt the conversations with unrelated and off-topic + unconstructive speeches, Kylar kicked you. And I would had, too, if only I was quick enough.
 
fge
Hello @Unihedro
In a good mood, I see :p
 
@fge Hiya :)
in Low Quality Posts HQ on Meta Stack Exchange Chat, 8 mins ago, by Unihedro
I have a decent schedule today! // hopes to be productive
 
fge
Interview of yesterday went well, answer next week
 
:O
So it has come to this...
Dammit, https's won't wonbox.
 
@Unihedro yep
 
9:20 AM
lolz
 
user4202350
@Unihedro I agree Every room has its own guidelines and rules. In that sense Is it Ok to use "F" Word here !??.
 
@ShaU Use whatever you want, just don't be a Jerk!
 
user4202350
Fuck Yeah.,
 
@ShaU Of course not! Nor is it to greet five people in a row, nor to ping randomly. Nor talking to themselves or others in disruptive ways. Which is why any of such messages gets trashed.
This is not IRC, instead a chat room for professional and enthusiast programmers. Behave like a professional or enthusiast programmer. That is all.
 
user4202350
9:31 AM
Oh fuck!
 
Oh Lord, grant me the power to kick mute this Jerk!
 
user4202350
Yes
 
user4202350
This is what i called Double Standards
 
user4202350
Ben Harris wrote "fuck that". Nobody cares. I wrote, everyone gone mad!!!!!
 
Air
Reason: Invalid JDK version in profile 'doclint-java8-disable': Unbounded range: [1.8, for project com.google.code.gson:gson
:(((((((
new2java lol
 
9:35 AM
@ShaU You write it again and write it in short sentences. Get into the conversation and talk to people instead of disrupting in.
 
I wonder what standard Shau lie in ?
 
@ShaU: Uni is a grumpy person. Don't challenge his paitence.
 
user4202350
@TheLittleNaruto @Nordehinu Be Specific. Rules should be same for all.
 
@ShaU Rules are the same for all, was in the past, still is, and will be. Punishments vary per person. If it's unlikely one will improve after education, simple harsh punishments can be handed out for whatever reason the room owners are able to justify to the mods, or for no reason at all.
 
9:48 AM
@fge I like!
 
fge
This is what the debugger looks like now
Still a lot to do!
 
Wow!
I see you added an underline after I pointed out about decorating the text :p
 
fge
Yep
I also highlight newlines
(that is, I replace them with "\\n\n"
Same for \r
 
10:17 AM
Let Me Duck Duck Go That For You confirmed
 
10:33 AM
@Unihedro open an issue... I think this is interesting for me to do ;)
 
@ItachiUchiha LOL
 
fge
11:06 AM
Unicode matchers!
 
You application seems to have integrated a lot of functionality :)
 
:D
 
fge
@ItachiUchiha I'm far from being done
parboiled couldn't do Unicode, grappa can
 
Oh, JavaFX controls are not horrible... [probably, I'll pick it up for my next project...]
And it looks much better than Nimbus <_<
 
fge
@OlegKuznetsov yeah, well, good for me since I'm no graphics artist at all :p
Do you happen to know whether it is possible to determine whether a JavaFX Font object has a glyph for a given code point?
 
11:15 AM
[On aesthetic side, SeaGlass LaF (for Swing) is still #1 for me, but too bad it had bugs :( ]
 
 
1 hour later…
12:34 PM
Can anyone help me parse all the integers from an input like:
A = [-1, 5, 6, -4, 9, -2, 0]
 
@reversiblean Huh?
 
i've been stuck with this for so long
@Unihedro input is given in a file. I want to parse all the numbers and assign it to an new array
 
fge
Hmm
You can use grappa + largetext
 
@reversiblean So for every digit sequence, you want a number stuck in a collection?
 
fge
And what about the A?
 
12:38 PM
^
 
fge
<-- writing a grammar; this will be a simple one
 
@Unihedro yup, actually i'm trying to solve this problem: hackerrank.com/contests/pankaj-test/challenges/… .. run 'run code' to see the input given
 
Oh, contest problem. No wonder why it sounds silly.
 
f-a
Hey, anyone here work with Spring security at all? I'm replacing a Glassfish container auth impl with spring security. So far auth is working but I'm having problems getting JSR 250 annotations to be handled by spring.
 
@Unihedro just can't figure out how to parse the input properly
 
f-a
12:41 PM
I assume the problem is due to the JSR annotated beans not being managed by spring
 
C++ or Java?
 
java
 
Hold on my IDE is dead.
 
okay, thanks : )
 
fge
A full grappa grammar which solves your problem, at least given the input you have given so far
Hmm, fixed, I had forgotten to collect the integers, heh
Anyway --> with this, done
Or you can use event based parsing
(actually it's simpler with event based parsing
 
12:51 PM
@fge it's a contest problem, no dependencies can be loaded :p
 
@Unihedro right, i was wondering that too
 
You can read with a scanner (hinted by the use of import java.io.*) and then parse with regex
 
@Unihedro could you spare a few minutes to parse the first line of input with scanner? .. i've searched a lot, but cannot figure out how to
i'm very new to this btw
 
Scanner scanner = new Scanner(System.in);
String firstLine = scanner.readln();
Pattern pattern = Pattern.compile("\\d+( \\d+)+);
List<Integer> listOfIntegers = new ArrayList<Integer>();

Matcher matcher = pattern.matcher(firstLine);
matcher.find();
for (String each : matcher.group())
  listOfIntegers.add(Integer.parseInt(each));
 
Thank you ever so much! i'll test it out
 

« first day (1553 days earlier)      last day (3402 days later) »