« first day (170 days earlier)      last day (3691 days later) » 

00:00
RELOAD!
[skiwi2/HearthMonitor-LogReader] 1 commits. 0 issues opened and 0 closed
[retailcoder/Rubberduck] 3 commits. 5 issues opened and 0 closed
[rolfl/StackMonkey] 7 commits. 2 issues opened and 1 closed
 
4 hours later…
 
6 hours later…
09:56
hey
Hey
Duga down?
don't know?
I'm not down!
I starred stackmonkey...
But maybe rolfl didn't enable that...
Ah
It also appeared in the 2nd monitor
10:05
oh I just saw...
10:24
I dislike writing the actual parsers
> Made the Builder Map fields final.
> Added FullEntityLogEntry log entry.
11:14
> Added the FullEntityEntryParser class.
> Fixed missing null check in the private constructor using the Builder.
> Added TagChangeLogEntry log entry.
11:43
> Added the TagChangeEntryParser class.
> Capturing of zero-width groups is now allowed in the parsers.
Time to decode this tomorrow...
[Power] GameState.DebugPrintPower() - ACTION_END
[Power] GameState.DebugPrintPower() - TAG_CHANGE Entity=skiwi tag=MULLIGAN_STATE value=DEALING
[Power] GameState.DebugPrintPower() - ACTION_START Entity=skiwi SubType=TRIGGER Index=-1 Target=0
[Power] GameState.DebugPrintPower() -     SHOW_ENTITY - Updating Entity=[id=33 cardId= type=INVALID zone=DECK zonePos=0 player=1] CardID=CS2_062
[Power] GameState.DebugPrintPower() -         tag=COST value=4
[Power] GameState.DebugPrintPower() -         tag=ZONE value=HAND
12:02
This one is actually quite readable
[Power] GameState.DebugPrintPower() - ACTION_START Entity=[name=Faerie Dragon id=57 zone=PLAY zonePos=1 cardId=NEW1_023 player=2] SubType=ATTACK Index=-1 Target=[name=Gul'dan id=4 zone=PLAY zonePos=0 cardId=HERO_07 player=1]
[Power] GameState.DebugPrintPower() -     TAG_CHANGE Entity=GameEntity tag=PROPOSED_ATTACKER value=57
[Power] GameState.DebugPrintPower() -     TAG_CHANGE Entity=GameEntity tag=PROPOSED_DEFENDER value=4
[Power] GameState.DebugPrintPower() -     TAG_CHANGE Entity=[name=Faerie Dragon id=57 zone=PLAY zonePos=1 cardId=NEW1_023 player=2] tag=ATTACKING value=1
 
2 hours later…
13:46
Monking!
hmm...
Exception in thread "Thread-3" com.gistlabs.mechanize.exceptions.MechanizeIOException: java.net.MalformedURLException: no protocol: /users/login?returnurl=%2fusers%2fchat-login
	at com.gistlabs.mechanize.exceptions.MechanizeExceptionFactory.newException(MechanizeExceptionFactory.java:25)
	at com.gistlabs.mechanize.AbstractResource.absoluteUrl(AbstractResource.java:240)
	at com.gistlabs.mechanize.document.documentElements.AbstractDocumentElement.absoluteUrl(AbstractDocumentElement.java:51)
	at com.gistlabs.mechanize.document.html.form.Form.getUri(Form.java:95)
but it works anyway...
Monking!
14:03
hey @SimonAndréForsberg
14:33
hey everyone!
14:53
Monking!
Monking!
Monking!
@Duga Monking to you too!
Monking @Duga!
and hey @Marc-Andre
15:18
hey @bazola
hey @skiwi
how goes HearthMonitor?
Working on it...
Need to parse one more thing and then I have quite some stuff together
The hardest part will be parsing all actions, most importantly the attack action
15:34
yeah their messages look pretty complicated
15:55
How does the attack action look?
4 hours ago, by skiwi
[Power] GameState.DebugPrintPower() - ACTION_START Entity=[name=Faerie Dragon id=57 zone=PLAY zonePos=1 cardId=NEW1_023 player=2] SubType=ATTACK Index=-1 Target=[name=Gul'dan id=4 zone=PLAY zonePos=0 cardId=HERO_07 player=1]
[Power] GameState.DebugPrintPower() -     TAG_CHANGE Entity=GameEntity tag=PROPOSED_ATTACKER value=57
[Power] GameState.DebugPrintPower() -     TAG_CHANGE Entity=GameEntity tag=PROPOSED_DEFENDER value=4
[Power] GameState.DebugPrintPower() -     TAG_CHANGE Entity=[name=Faerie Dragon id=57 zone=PLAY zonePos=1 cardId=NEW1_023 player=2] tag=ATTACKING value=1
Like that ^
Scroll up to see more, it doesn't want to auto-expand
Hmm
it's quite interesting to read, because it reveals a bit about how the game is written
Monking!
@Duga yeah, yeah, I think they got that by now
@SimonAndréForsberg Yup
16:05
@Duga Monking!
Monking!
Monking!
Monking!
Monking!
Monking!
16:32
I'm surprised glad no one has flagged @Duga for spam yet
Well it's a bit annoying but I hope it's only temporary :P And the thing is if we want bot in chat the first thing to do is not to flag as spam the bot :P
2
Thankfully it is only here, if it were doing that in the main room I'm sure they wouldn't put up with it very long!
2
And that ^
17:12
Monking!
@Marc-Andre I am trying to work on a system so that the bot is more easily configurable. So that what it says and where and when can be changed more on the fly
@Marc-Andre are you good with Spring?
@SimonAndréForsberg I'm not the best I've done quite a lot, I could surely help!
@Marc-Andre I'm trying to do some Java-based configuration. Having problems defining filters right now.
I'll try again just now
Monking!
But what do you mean by "on the fly" like without restarting the app ?
17:24
@Marc-Andre yes. at least for some things. of course, some things still needs to be coded into it
Ok is @Duga a Spring web mvc ?
yes
right now I am having this problem:
Invalid CSRF Token 'null' was found on the request parameter '_csrf' or header 'X-CSRF-TOKEN'.
Can you give the link to your configuration classes ?
Monking!
Is there a reason you have csrf protection enable ?
Since the bot is like a REST api
17:34
@Marc-Andre yes, the reason is that I'm not entirely sure what it is, and when I tried to turn it off I got another error :P (bad reason, I know)
Then disable it, and send the other error :P
Monking!
@Marc-Andre I get a 404 error when I access http://127.0.0.1:8080/security-spr/j_spring_security_check, which is accessed after I submit a form... hmmm... wait a minute... <form method="post" action="<c:url value='j_spring_security_check'/>" > that explains it...
I need to figure out more about how this example app is structured
I have cloned this one: github.com/Fruzenshtein/security-spr and tweaked it a bit
@Marc-Andre here is my repository that I am working on: github.com/Zomis/security-spr
but I will investigate things a bit more
@SimonAndréForsberg j_spring_security_check is the default page for login/security. Normally you don't need to point to it directly since it redirect to it automatically.
Monking!
17:46
@Marc-Andre I need something to log me in...
@Marc-Andre when submitting a login form with Spring MVC, where should that form lead to?
Sure you'll need something but it's a normal webapp, you'll probably need some token authentification or something
@SimonAndréForsberg Either the redirect param or the "home" page
a normal webapp? Isn't this security-spr repo a MVC app?
All methods that are supposed to be protected use method=RequestMethod.GET for some reason. but the form submits a POST
Oh you're talking about you're "demo" repo, I was referring to Duga. No all method that are suppose to be protected are englob in HttpSecurity by default I think it maps "/**" has the security target but not sure.
method=RequestMethod.GET -> refer to the type of the request, normally it does not concern security
Monking!
http
.csrf().disable()
.userDetailsService(customUserDetailsService)
.authorizeRequests()

http://docs.spring.io/autorepo/docs/spring-security/3.2.3.RELEASE/apidocs/org/springframework/security/config/annotation/web/builders/HttpSecurity.html#authorizeRequests()
authorizeRequest means that ALL request must be at least ROLE_USER
17:58
@Marc-Andre but not all URLs are protected though, I think.
at least I can access index without problems
You trying to create the user accounts inside Spring?
@SimonAndréForsberg The homepage is normally not protected and some errors related page too
@skiwi haven't added any kind of registration system yet, but ultimately, I guess so
I wish it was easier to authenticate using StackExchange or something
Monking!
@Marc-Andre I thought only these URLs were protected:
.antMatchers("/sec/moderation.html").hasRole("MODERATOR")
.antMatchers("/admin/**").hasRole("ADMIN")
18:03
Ohh you're maybe right
(I just read the code on github a bit harder to understand how the security config is done :P )
18:30
Hmmm... access denied.
Invalid login or password.
did you create a user ?
@Marc-Andre yeah, I have a user in my PostgreSQL database
18:45
I really need to run the application to help you ! But can't at work...
Monking!
just implemented an Undo system for my bejeweled clone, thought it would take less than an hour and it ended up taking like 4
@Marc-Andre that's alright, I will try to figure out things here
@bazola I need to make an Undo system for my ConnBlocks game. Undo systems can be difficult I imagine.
Sounds like yours might be reviewable?
19:02
well, its pretty ugly
I just implemented encoding for my entire game class, and save a game state when a successful move is made
and then in order to undo, it reverts the game to two states previous
saves up to 10 copies on the disk as it goes..
i wanted to only revert the board itself, but it was screwing up the animations and that didn't cover reverting the score
i have to do that all at the scene level, because at the game level you can't do something like self = [self loadGame] because self is not assignable outside of the init method
19:20
my main motivation for building this contraption was that I am seeing some weird behaviors while testing the game, so I need to find the underlying bugs :) Repeating the last move over again was the easiest way to do that
Theoretically for an undo system you need to wrap every action into an predefined action which you can do and then undo
Ugly code inbound!
package solvers.command;

import model.Cell;
import model.Grid;

/**
 *
 * @author Frank van Heeswijk, 0772418, 04-04-2013
 */
public class SetCellSymbolCommand extends Command {
    private final Cell cell;  //cell on which command is applied
    private final int originalSymbol; //original value of cell
    private final int newSymbol;  //new symbol of cell

    /**
     * Constructs a new SetCellSymbolCommand from given grid, coordinates and symbol.
     *
     * @param grid  given grid
     * @param x x-coordinate of cell in grid
Uh oh, it's more code than I thought
Look at the execute() and undo() there
Also for some reason back then I was thinking it was useful to manually put the package name in an exception
And then in another class I was maintaining an undo and redo stack where you could push to and pop from
19:43
@bazola perhaps that object can be encapsulated in another object? So that you do the loading outside?
@skiwi yeah, such an approach can work sometimes, when it is something that is easily undoable.
@SimonAndréForsberg What would be cases that are not that easily undoable?
@SimonAndréForsberg outside the scene you mean?
@skiwi When two connections are merged in my Connecting Blocks game, for example.
@bazola not sure what the scene is but, I guess that's what I mean...? :)
@SimonAndréForsberg Can't you just unmerge them then?
19:59
@skiwi not that easily... one of the connections is entirely removed and the blocks of it merged into the other connection.
@SimonAndréForsberg Hm ok
My approach will be "reset the entire map and repeat all moves except the last"
> Add an Undo button.

Use the approach "reset the entire map and repeat all moves except the last"
its complicated in my case because of the animations. The Board, BoardEvaluator, and Game all have arrays of orbs that are set when a match is made depending on the type of match that it is. Then the Scene will play a different animation for the different arrays of orbs. I tried clearing out all the data when resetting the board, but it was still funky without a complete reloading of the game
 
1 hour later…
21:22
Monking!
@Duga We heard you the first time ;-)
Monking!
one more incoming
Monking!
last try now!
I really don't get it @Marc-Andre...
¤"())¤"=#!((=#$@@£
21:32
java.util.Scanner has got me completely confused o.o
Maybe I shouldn't skip ahead and let the book guide me to it eventually :)
@Phrancis which part confuses you?
Well, this is as far as I've gotten:
import java.util.Scanner;

public class GallonToLiter {
  	Scanner inputGallonOrLiter = new Scanner(System.in);
  	Scanner inputLiquidQuantity = new Scanner(System.in);
   	static final double CONVERSION_RATE = 3.7854;
I was planning to make inputGallonOrLiter a 1-2 int with checks, and inputLiquidQuantity a double
Would it be best to first write my main() and work my way back, or first write member methods with the checks and wrap it all up in main()?
@Phrancis don't use two different scanners. Use the same scanner for all System.in reads.
@Phrancis probably best to start with main
Ah ok
I say this in your friend's question: private static int readInt(Scanner scanner){ is that pretty standard?
@Phrancis nope, it was a suggestion he got from rolfl. It is situation-dependent.
21:41
Ok
@Marc-Andre don't know if it tells you anything but when I try to login I am getting this:
Jan 19, 2015 10:38:47 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [org/springframework/jdbc/support/sql-error-codes.xml]
Jan 19, 2015 10:38:47 PM org.springframework.jdbc.support.SQLErrorCodesFactory <init>
INFO: SQLErrorCodes loaded: [DB2, Derby, H2, HSQL, Informix, MS-SQL, MySQL, Oracle, PostgreSQL, Sybase]
I'll read some more, I'd really want to know how to use scanner. Would a scanner be the kind of thing you would use, taking Cardshifter for example, for the user name, chat room etc?
@Phrancis what kind of software are you wanting to end up creating? i would think that the answer to that question would help you decide where to start the learning process
Just doing exercises right now
I'm sure the book will cover it and I'm just jumping ahead
@Phrancis Scanner is often used when you are reading input from the console. Not from Graphical User Interface text fields.
I think the only parts of Cardshifter using Scanner is cardshifter-console.
21:45
Ah ok :)
@Marc-Andre Nevermind, finally got it to work!!
			.loginPage("/user-login.html")
			.usernameParameter("j_username")
			.passwordParameter("j_password")
Compile error "Illegal start of expression", does that often denote a syntax error?
Ah, I had put a static variable inside main()
22:15
public class GallonToLiterTable {
  public static void main(String args[]) {
    final double CONVERSION_RATE = 3.7854;
    double gallons, liters;
    int insertBlankLineEachTen = 0;

    for(gallons = 1; gallons <= 100; gallons++) {
      liters = gallons * CONVERSION_RATE;
      System.out.println(gallons + " gallons is " +
                         liters + " liters.");
      insertBlankLineEachTen++;
      if(insertBlankLineEachTen == 10) {
        System.out.println();
        insertBlankLineEachTen = 0;
Would it make more sense to put CONVERSION_RATE outside of main() as a static?
inside the main method you want to create a GallonToLiterTable object
then put the actual conversion logic into a public method of that class, and pass in the values for gallons to that method
like this:
if(insertBlankLineEachTen == 10) {
System.out.println();
insertBlankLineEachTen = 0;
}

---->

if (gallons % 10 == 0) {
System.out.println();
}
public static void main(String args[]) {
    GallonToLiterTable converter = new GallonToLiterTable();
    for (int gallons = 1; gallons <= 100; gallons ++) {
        System.out.println(converter.gallonsToLiters(gallons)); //you will need to format the string since its an int
    }
}
22:21
^^ yup
heck, that could be a nice interface even.
interface Converter { double convert(double value); }
GallonToLiterTable implements Converter
and a method that takes a converter and outputs the 1-100 values
and now I've probably lost you :)
I'm trying to follow :)
interfaces is a quite advanced topic though, don't worry too much about that yet
Ok. I'm interested in @bazola's solution, that's taking advantage of OOP I'm guessing? I'll get to interfaces eventually I'm sure
yes, it does.
I noticed my for loop takes a double, "gallons" and declares it an int. Probably not very good design eh?
Well, not mine, his does
22:26
Ping: Half measures are as bad as nothing at all.
i would always declare the counter inside the for loop
there are lots of reasons why, but the one I will say is that you want variables to have the smallest scope possible. if it is only used inside the for loop, then declare it as close to where it is used as possible
So I could start with something along those lines?
for(int gallons = 1; gallons <= 100; gallons++) {
  double liters = gallons * CONVERSION_RATE;
I'm used to declaring all my variables at the top in SQL, I'll have to break the habit :D
i would put all of the logic inside of the Converter class, and just make a method to return liters if that is what you want
So many ways to do the same thing lol.
3
> added correct hibernate auto update schema configuration
> changed hibernate password
> removed form action
> added SecurityConfig parameters for username and password. makes it possible to login
> added logout functionality
22:32
@Phrancis oh yes
@Phrancis you don't Have to do things in an object oriented way, but I would recommend it, especially for a beginner
^^ yup
I really need to make my friend Henrik learn the object-oriented way.
That's exactly what I'm trying to do. Those little exercises haven't really touched OOP much yet though
well its really a completely separate topic from the basic syntax of a language
there are many books written about OOP principles and lots of them are language agnostic
22:51
So using your approach, I would want to create a public GallonToLiterConverter() method where the calculation is made, and then just reference that from main(), right?
more precisely, instantiate objects in main and reference those objects, but yeah
Oh, because, it reads main() first I read that, good to know
Does the order of the objects and the main() matter much? Say, if for clarity I wanted to put main() first, since it instantiates objects, then put the methods for those objects below, will the compiler care?
well the order does matter, and keep in mind that the objects will possibly instantiate their own objects, and on and on forever. the main method is just the starting point
Incomplete code right now, but just something like this, for instance:
public class GallonToLiterTable {

  public static void main(String args[]) {
    GallonToLiterTable converter = new GallonToLiterTable();
    for(double gallons = 1; gallons <= 100; gallons + 1.0) {
      System.out.println(gallons + " gallons is " +
                         liters + " liters.");
    }
  }

  public final double CONVERSION_RATE = 3.7854;

  public GallonToLiterConverter() {
    double liters = gallons * CONVERSION_RATE;
  }
}
@Phrancis public GallonToLiterConverter() is a constructor. don't do the calculation in the constructor.
22:58
the calling order does matter, but the order in the class file does not.
Well TTQW, learning a lot today, my brain feels like mush
Looks like chapter 4 covers OOP basics, just finished chapter 1. Patience, patience; it will all come together soon ;)
23:50
Contributors is on the way need to fix some things but it render correctly (so much <img> not close, and <li> not close )

« first day (170 days earlier)      last day (3691 days later) »