« first day (278 days earlier)      last day (3283 days later) » 

12:00 AM
RELOAD!
 
@Marc-Andre ah, well, for that part I think there's no way we could show unofficial mods on the website. So it would only show for official mods, I guess. (or do you have some other proposal?)
 
[Cardshifter/Cardshifter] 29 commits. 3 opened issues. 4 closed issues. 10 issue comments.
[retailcoder/Rubberduck] 2 commits. 1 opened issue.
[Zomis/Duga] 1 opened issue. 1 issue comment.
 
@Duga Hey nice!
 
@SimonAndréForsberg I don't which is why I should use some "static" data to construct the page. The thing is I see no safe way to grab some data from the clients and host it on a website without going over some technical limit that could potentially be too hard. Let's start with showing the cards we have the moment and worry when people would start modding and hosting servers.
 
@Marc-Andre agreed. And for the current cards, I'd go with either reading exported XML, or reading data from Java memory. I don't think reading the "JSON data" will be a good solution.
 
12:08 AM
@SimonAndréForsberg What would reading from Java memory imply?
 
@Marc-Andre add the actual Cardshifter "engine" as a Maven dependency to the webserver, start a game with the mod(s), and read the data.
 
@SimonAndréForsberg Doing this for every request to the actual page, or doing this once at the start of the server and caching it seems a bit over the top to me. It's not simple, I need to manage a dependency, the web site will be more tied to the game logic, and I'm "wasting" time. I think I would prefer reading a static source of data. Would be easier to maintain I think
 
^ I tend to agree, at least for the time being, since changes (releases) to the game are fairly unfrequent
It would be a breeze, comparatively, to just dump some XML (or other) data when a new release is published, methinks
 
@Marc-Andre Agreed. So exporting data, then? Can be fairly easy done with XML, as I have a XML export feature already ready (can easily change it to JSON if you prefer that more) (using the Jackson library)
@Phrancis a simple invocation of the /export command, me thinks.
 
In the far future I think this perhaps this could be done via a DB? Maybe not, but just a thought. For right now, the scale is very small so I think KISS is probably best
 
12:17 AM
@SimonAndréForsberg Lately I tend to prefer JSON, but if the code for the xml conversion is already working this would be fine too.
 
12:35 AM
@Marc-Andre It's Jackson, you know how easy it is to swap between JSON and XML, right?
 
Lately, I've been an enemy of anything that is related to Jackson and JAXB so, yeah I know it should be easy, but I've learned the hard way that most of the time it's not
 
Night @SimonAndréForsberg!
 
Night @Simon :)
@Marc-Andre next release, you need to play a few games of Cardshifter with us :)
 
@Phrancis Ehehe yeah sure
 
12:45 AM
It's actually quite fun, if you don't mind the pretty plain graphics for now
 
if the mods were written with the same XML format, the makers of a mod could package it along with the images and submit it to us, and we could feed that to the java server that is parsing our mods to create a website for it
 
I really want to start talking about images for 0.7, I think the time will be ripe then
 
Well I must say that I do mind the graphics, but the thing I didn't like at the time was the UX.
@bazola That is one clean way to do it. I think that at one point, we could offer to "host" custom site for the mods, like we did for cyborg-chronicles.
 
it wouldnt cost much bandwidth or disk space i don't think, especially since we would already have the infrastructure there for our own mods
 
Not at all ! And it would give me a bit of work to do ahaha :P
 
12:58 AM
@Marc-Andre Yeah I had that in the back of my mind for a long time
Would be easy to fork our templates and adapt them to a new mod
@Marc-Andre Mind you, there's plenty to work on, on the back end ;)
 
I don't have the interest to perfect my skills on back end. I work all day on doing back end things so... What I really want to do is some web site/ web application
 
Fair enough :)
 
I need time too! And I have the feelings that in less than 1 or 2 years I will not have more time, but way less :P
I feel like my girlfriend is talking a lot more about kids ;) So I think I need to prepare myself :P
 
Feel you, @Marc-Andre
My wife brought up kids lately too... Not too sure how to feel about it lol.
 
Ehehe well, my sister has already one kid and is going to have a second in september. So it's hard to not think about it. A lot of responsibility, but they are a true wonder.
On my end, I know I want kids it just the when.
 
1:12 AM
Yeah
 
I don't know if I will ever be ready to have kids until I have one, but I sure do know I want one and this make things easier for me. I don't know what you think about this (and it's personal so I don't want to ask) but the it sure is a big decision. I see a lot of people who have made that decision too lightly
 
I agree it is a really big decision. I have a few friends who have had kids, and their life certainly is changed as a consequence.
I do think it's considered too lightly in especially younger adults/teenagers, many of which find themselves insanely busy and broke because of it, though happy nonetheless
I have to say, being over 30 myself now (wife 28), it feels like a "now or never" thing a bit. Haven't decided how to feel about that yet.
 
Well it sure looks like it, but I do know a collegue and one of my uncle who had a kids at 40, so it's not too late. I find 30 it's the closing period on the best time for having kids based on age. The real best time to have kids is when you're ready
 
1:29 AM
Words of wisdom
@Marc-Andre want to hear the latest music I've been working on? If so just ping me your email address on Skype (or here)
 
Skype it is
 
1:46 AM
@Marc-Andre Sent. Please don't share, work-in-progress :)
 
I will not! Be sure !
 
I think it's a pretty nice blend of electronic and orchestral music
 
That was the first comment I wanted to make
@Phrancis I don't like self-promotion, but could you check that answer, not sure my thought make sense in the post (codereview.stackexchange.com/questions/90011/random-letter-test/…)
 
@Marc-Andre I like the answer, I made a few grammar corrections :)
 
Nice song @Phrancis ! I really like it! good rythms and I listen to the end!
@Phrancis thanks a lot !
 
 
2 hours later…
3:24 AM
[Cardshifter/Cardshifter] Phrancis pushed commit 1bc32426 to js: Added filters
[Cardshifter/Cardshifter] build #930 for commit 1bc32426 on branch js passed
 
4:11 AM
[Cardshifter/Cardshifter] Phrancis pushed commit 62859649 to js: MOAR DOCUMENTATION
 
@Simon ^^ I think I got the effects documented pretty well, although certainly open for improvements. Please let me know what you think.
 
[Cardshifter/Cardshifter] Phrancis pushed commit 08530efb to js: fixed a few typos and errors
[Cardshifter/Cardshifter] build #931 for commit 62859649 on branch js passed
[Cardshifter/Cardshifter] build #932 for commit 08530efb on branch js passed
 
4:39 AM
[Cardshifter/Cardshifter] Phrancis pushed commit c0355977 to js: clarification about creature filter
[Cardshifter/Cardshifter] build #933 for commit c0355977 on branch js passed
[Cardshifter/Cardshifter] Phrancis pushed commit 27ecec70 to js: small but meaningful corrections to examples
[Cardshifter/Cardshifter] build #934 for commit 27ecec70 on branch js passed
> I think the latest commits provide "good enough" documentation for the time being, although new documentations should be written as new things are implemented.
> I'm not a big fan of the "PhrancisThings" in the current code base, just because... Well, it's not my game, it's the Cardshifter game. It was good as a naming pattern for a good while, but I think a PhrancisThing should be refactored to a CardshifterThing throughout.
 
 
3 hours later…
8:29 AM
hey
 
 
3 hours later…
11:55 AM
> Or even better: CyborgChroniclesThing, as that is the official name of that mod AFAIK.
 
@skiwi hi
@Phrancis I have found some incorrect statements in your documentation. Should I inform you in chat, add comments on your commit, make some edits myself, or create a github issue?
 
12:19 PM
HEY :D
 
 
1 hour later…
1:38 PM
@SimonAndréForsberg I think I prefer comments on the commits, generally. Allows me to learn the logic better as I go along. But, if you prefer to edit directly, that's also OK
 
hey @Phrancis!
 
TTQW!!
 
Hey @Marc-Andre :)
 
> "an array of whilePresent must be used for each resource that is modified" is not correct. a MODIFIER object is required for each resource that is modified.
> That would work as well, since it looks like all the PhrancisThings are mod-related
> it's not really "sent to the server's resource map". And I'm not sure it's worth explaining the inner workings of things here. It should either be a single EFFECT object or an array of EFFECT. Not MODIFIER (modifier is for the whilePresent stuff only)
> again, I don't think the "sent to the server's resource map" is relevant here (and is also not a correct description of how it works behind the screens)
> these examples of afterPlay effects are invalid. This is a MODIFIER, this is not an EFFECT.
> a creature filter is only a true/false value, not a string.
 
2:01 PM
@Duga Wow, glad Simon has taken time to look at that!
 
> This is called "owner", not "self" (might be confusing as it then would be owner: "owner", perhaps owner: "samePlayer" would be better?)
 
@Duga @Simon I think "self" would actually be the most "natural"
I'll fix the documentation though, but I think we might want to change that
 
> This is NOT equal to "self". Consider for example the following MODIFIER: { res: ATTACK, change: 1, priority: 1, filter: { owner: "active", creature: true } } This means that the active player has +1 attack on each creature, no matter who 'controls' this modifier. If it is your turn, all your creatures have +1 attack. Compare this to: { res: ATTACK, change: 1, priority: 1, filter: { owner: "owner", creature: true } } This means that if you play the card (and you therefore 'control' the...
modifier), your creatures will have +1 attack, no matter who's turn it is.
> See the note to "active". This is NOT a synonym for "opponent", this is just the opposite of "active".
> "All available cards" makes it sound like it affects all cards in Battlefield, all cards in Hand, all cards in Deck, etc... (there's missing a "Deck" description here btw). The "Cards" zone is where the model of all cards is stored, when you summon a card for example, the card is looked up from this zone and copied. So changing cards in this zone can change the newly summoned cards.
> Might be good to add an example for how to use priority. I think I had an example in chat that could get included here. Using for example the modifiers "All your creatures have attack +3" and "All your creatures have attack set to 0" will end up with all your creatures have either 0 or 3 attack, depending on the modifier priorities.
 
@Phrancis I think of "self" as "only applies to the same card", so I think I'd prefer "samePlayer"
@Phrancis Also note that @Duga "missed a spot", she did not inform about this comment: github.com/Cardshifter/Cardshifter/commit/…
 
2:18 PM
this code is taking 10+ minutes to run
private void createMapImageForRegions(Map<MapPoint, String>regions) {
    int regionWidth = 60;
    int numRegions = 60; //need to know this ahead of time
    BufferedImage img = new BufferedImage(numRegions*regionWidth, numRegions*regionWidth, BufferedImage.TYPE_INT_RGB);

    for (MapPoint point : regions.keySet()) {
        int i = point.x * regionWidth;
        int j = point.y * regionWidth;

        int color = this.getColorForBiomeType(this.getBiomeTypeForRegion(regions.get(point)));
        for (int x = 0; x < regionWidth; x++) {
 
@bazola img.setRGB is a slow way of drawing. You should also be able to avoid flipVertical by getting the mathematics right while drawing in the first place.
 
thats what i get for just adapting code from stack overflow i guess :)
 
@SimonAndréForsberg OK, samePlayer would be less ambiguous indeed
 
@bazola You should instead use img.getGraphics() and on that call setColor and fillRect
Your inner double for loop of x and y will be useless with that method. You will only draw once per region instead.
as from what I can see, a whole region has the same color.
 
@SimonAndréForsberg that sounds a whole lot cleaner than what i am doing
 
2:26 PM
it should increase the speed drastically.
 
the x and y for loop is because i am drawing 1 pixel at a time :)
 
and drawing 1 pixel at a time is sloooooow
 
Oh yikes, that's only 786432 pixels on a puny little 1024*768 display
 
and i was doing 3600 by 3600 just to really make things difficult
its amazing that it actually works
 
HOLY CARP
<meeting> <!-- yay. -->
 
2:44 PM
@bazola From a BufferedImage you can also get the underlying byte buffer that's in a specific format (defined by the BufferedImage) and directly work upon that
 
thats pretty much the same as flipping individual pixels though isn't it?
 
@bazola Not sure about that, haven't followed all conversation here :p
 
I don't think there's a reason to work with the byte buffer here.
 
the printouts for the colors are valid and yet it draws white
Color color = new Color(this.getColorForBiomeType(this.getBiomeTypeForRegion(regions.get(point))));
//System.out.println("blue = " + color.getBlue());
if (this.topOwnersAndRanks.containsKey(ownerName)) {
    color = new Color(this.getColorForRank(this.topOwnersAndRanks.get(ownerName)));
    //System.out.println("player color = " + color.getBlue());
}

img.getGraphics().setColor(color);
img.getGraphics().drawRect(i, j, regionWidth, regionWidth);
img.getGraphics().fillRect(i, j, regionWidth, regionWidth);
aha
Graphics graphics = img.getGraphics();
graphics.setColor(color);
graphics.drawRect(i, j, regionWidth, regionWidth);
graphics.fillRect(i, j, regionWidth, regionWidth);
11
A: BufferedImage draw white when I say red

MeBigFatGuyEach time you call getGraphics() on a BufferedImage you get a new Graphics object, so setting the color on one, doesn't set it on the next one. So cache the graphics object. BufferedImage bi = new BufferedImage(800, 600, BufferedImage.TYPE_INT_RGB); Graphics g = bi.getGraphics(); g.setColor(Colo...

and i solved the flipping problem using math also by remembering simple algebra
for (MapPoint point : regions.keySet()) {
    int i = point.x * regionWidth;
    int j = (60 - point.y) * regionWidth;
because this time i remembered this answer:
91
A: Returning the other argument of 2 possible arguments without using conditions

Simon André ForsbergSimple arithmetic: return 7 - input + 5; (which can be simplified as return 12 - input;) Let's say the input is 7: return 7 - 7 + 5 --> return 5 Or if the input is 5: return 7 - 5 + 5 --> return 7

 
3:28 PM
@bazola Wow, never expected that answer to be able to help with something like this :)
 
arithmetic has far reaching consequences :)
 
3:52 PM
you may find this interesting, network stats after posting my question:
 
4:15 PM
thanks for the help @SimonAndréForsberg, images are being created near instantly now
some guy has taken over the bottom left part of the world
 
 
1 hour later…
5:28 PM
</meeting>
 
@Phrancis <hey>
 
hey @skiwi! how is your project going ?
 
Busy busy, learning loads of new things
We got our development environment pretty much set up now, tomorrow meeting with customer to discuss and get approval of the URD, then it's design&implementation time
 
Nice seems to be going fine ! Glad for you ! Having fun ? Do you have a good team ?
 
Having a quite good team, I feel there's some outliers, but there's still a lot of hope!
It's fun for sure
How familiar are you with web technologies @Marc-Andre?
 
5:32 PM
Not that much, but I'm not a noob ! And I catch up real quickly on things
Why?
 
Because this is all we use right now, it's really grown a lot
 
I know the basics, but this is not my main domain of expertise
 
For the backend we use Django which gives us Models (that are backed by a database) and a REST API
For the frontend we are using React together with Bootstrap, and also using Webpack (which means nodejs and npm)
In our development environment we run the Django server (which also hosts our frontend) and an extra Webpack server that allows us to do hot reloading on Javascript (actually JSX) files
Webpack also takes all JSX files and bundles them into a big bundle.js file
For production/staging we pregenerate the bundle.js file and the Webpack (dev) server is no longer needed
And as tools we are using GitLab and Jenkins, and we made our own "tools" that run on top of an Apache server:
1) On every commit to develop of the docs repository we compile all LaTeX files and generate pdfs, put those online
2) On every commit to develop of the code repository, we update the code on our staging environment that's also reachable online
And then there's still that on every commit we can run tests (Continiuous Integration), and we made a system where the notifications get pushed to a Pushbullet channel
 
Nice setup you got there!
 
Currently we're still using Django's default SQlite database, but in the coming days we'll be migrating that to PostgreSQL at least on the staging environment and we're also looking into using Flux for React, I believe Flux reduces tries to store state of the REST API whenever possible, such that the backend doesn't get hit that much and faster loading times
Our client had as requirement that everything should run in one Django application, that made it a bit more complicated
I'm thinking if I'm to set this up to my wishes: Would then an Apache server at www.domain.com to host the frontend and another Apache server at api.domain.com for the backend be the way to go?
As Django is an MVC application, we are currently using a single Template index.html that loads the React code, etc.
 
5:42 PM
Well unless you really got a lot of hit, I would run only one apache that would distribute between server. But don't trust me too much on that, my job is not to setup the network infrstucture ;)
 
How many of these technologies do you recognize? :P I thought you knew quite something as you're working on the Cardshifter server ;)
@Marc-Andre I pretty much did the whole server setup with another guy, as both new guys, was a mix of having fun and being excruciated
 
@skiwi Django, Js framework (not the one you're talking but they do share some ressemblance between all of them) node.js, Working with REST API Boostrap, never heard of webpack but I understand what his job is
@skiwi Yeah I know quite something it's just not my day job :P I'm a back end guy on some entreprise services nothing web application related
 
I'm also mainly backend :P
Right now there's still code smell which I want to solve, but not sure how yet
We have a bunch of components in React, which we want to be able to include from any place
That's possible right now... but ugly
var React = require('react');
var Router = require('react-router');
var Link = Router.Link;
var MessageBox = require('../components/MessageBox');
The react and react-router are real dependencies (like in Maven you can add dependencies)
That MessageBox is our own, but you need to use relative paths and that sucks :|
 
Isn't there a way to manage dependacy in js ? Something like require.js
?
 
@Marc-Andre That up there is require.js :)
 
5:51 PM
Can't you build that code as a lib and publish it somewhere and require it like the rest of your dependencies ?
 
That may be a possibility, but not sure if we want to add that as well right now
What I do notice is that the whole JavaScript language has been hacked en masse in order to provide functionality it doesn't provide
 
Like ?
 
Like this file
/**
 * Created by Frank van Heeswijk on 6-5-2015.
 */

var React = require('react');

var MessageBox = React.createClass({
    getInitialState: function() {
        return {
            message: ""
        }
    },
    componentDidMount: function() {
        $.getJSON(this.props.source, function(data) {
            if (this.isMounted()) {
                this.setState({
                    message: data.message
                });
            }
        }.bind(this))
    },
    render: function() {
React also has their own pseudo-class-like-format
 
And what functionnality are you talking about ?
 
@Marc-Andre Like here with React.createClass() you create a "class" with methods, it can even have mixins, etc. While in reality it doesn't exist, because you are just passing a JS object around
Same for the require, JS doesn't supports imports, yet people managed to get it working
 
6:10 PM
Well people like to create what they need
 
2349
Q: Why does HTML think “chucknorris” is a color?

user456584How come certain random strings produce various colors when entered as background colors in HTML? For example: <body bgcolor="chucknorris"> test </body> ...produces a document with a red background across all browsers and platforms. Interestingly, while chucknorri produces a red back...

Made me LOL ^^
 
@Phrancis Yeah, know that one already ;)
 
 
1 hour later…
7:40 PM
</afk>
 
hey @SimonAndréForsberg
 
@SimonAndréForsberg WB, and thanks for all the comments, I'll be sure and fix that doc soon
 
@Phrancis No rush!
 
Is it a pretty simple ordeal to convert JS object to actual JSON?
 
@Phrancis JSON.stringify exists. Haven't tried it that much though. Not sure if it will produce desired results.
 
7:53 PM
Hmm, looks like it would be a pretty simple matter to just load replays into a PostgreSQL table as JSON data, and query it directly
(to crunch player/game/card stats and such)
 
<sleep>
 
Night @skiwi!
 
That is pretty cool, @Phrancis
 
@Phrancis <thanks />!
 
SELECT *
FROM replays
WHERE data->>'playerNames' = 'Phrancis'
  AND data->>'playerNames' = 'Zomis';
 
8:04 PM
@Phrancis data->>playerNames cannot be both Phrancis and Zomis at the same time though. And I'm not sure how to do such lookups in JSON Arrays in PSQL.
either way, there's a lot that might need to be re-vamped one day.
 
Yeah. I'll experiment with it on my local Postgres DB and try to put a few replays in there and see if I could make it work
 
spot the bug:
public PlayerGaveMessage(MapPoint regionPosition, MapPoint position, int amount) {
    this.setType(MessageType.PLAYER_TOOK_MESSAGE);
    this.regionPosition = regionPosition;
    this.position = position;
    this.amount = amount;
}
 
Would be pretty cool if it did though, then we could just have the Java game server open a connection after a game is done and insert the replay as a new record in the DB. Then just write a few DB functions to crunch data in useful ways.
 
8:20 PM
@bazola this.setType(MessageType.PLAYER_TOOK_MESSAGE); -- lovely!
 
hehe
 
8:34 PM
TTGH bye guys!
 
Seeya later!
 
8:49 PM
select * from json_each('{"a":"foo", "b":"bar"}')
>
 key | value
-----+-------
 a   | "foo"
 b   | "bar"
^^ Freaking cool
 
8:59 PM
are those pipes and dashes and the plus sign something that sql outputs by default? or are you formatting it that way?
 
It's just formatted that way, although I'm pretty sure it's possible to set SQL to output that
Standard output is just flat table like an Excel sheet
Turns out you can do lots of stuff with JSON data type!
select *
from json_populate_recordset(
  null::x,
  '[{"a":1,"b":2},{"a":3,"b":4}]'
);
>
 a | b
---+---
 1 | 2
 3 | 4
^^ We could probably break down game action types like that and count() each type of action for a game, or for all games, or whatever
 
9:22 PM
@Phrancis technically, we can do that already (from Java though, not from SQL)
 
Doing it in SQL would be a lot less work for you though :)
(might perform faster too, if we index the data intelligently)
 
10:07 PM
some things can definitely be done in SQL, but I don't think SQL will be able to do everything
 
 
1 hour later…
11:11 PM
@SimonAndréForsberg Agreed. I realized some time ago that SQL is quite limited in scope as to what it can do
(but what it does do, it does extremely well)
(except MySQL; that does very few things well)
@SimonAndréForsberg do you have some replay JSON files on hand somewhere on your server?
 
@Phrancis true that :)
@Phrancis I do, I'll get you one you can inspect...
 
OK
 
@Phrancis This is an old one that I have been using to play around with extracting statistics from inside Java: cardshifter.com/extract-replay.json
And @Marc-Andre, this is for you: cardshifter.com/game-1.json
 
[Cardshifter/Cardshifter] Zomis pushed commit 5584b6d9 to js-load: added some filter checks to throw errors earlier
[Cardshifter/Cardshifter] Zomis pushed commit 5e7d7df0 to js-load: added serialization of Attributes and Effect description to the Jackson EntitySerializer
[Cardshifter/Cardshifter] Zomis pushed commit 1037252b to js-load: reworked DataExportCommand, now exports to pretty-printed JSON format.
 
11:27 PM
This is kinda cool
 
[Cardshifter/Cardshifter] build #935 for commit 1037252b on branch js-load broken
@SimonAndr, your build reported bad status: Broken!
[Cardshifter/Cardshifter] Zomis pushed commit e39d4969 to js-load: renamed PhrancisThings to CardshifterThings, fixes #214
> There's a part of the JavaFX project that's not being used as well, that was refactored away a while ago (when the JavaFX code started to use the same view for both server-based and local-based games)
[Cardshifter/Cardshifter] Zomis pushed commit 68b11e12 to js-load: fixed an incredibly stupid NPE in a test #oops
[Cardshifter/Cardshifter] build #936 for commit e39d4969 on branch js-load still failing
@SimonAndr, your build reported bad status: Still Failing!
200_success vs. rolfl: 337 diff. Year: -368. Quarter: -211. Month: +168. Week: +116. Day: -44.
Loki Astari vs. Simon André Forsberg: 3789 diff. Year: -1977. Quarter: -678. Month: -295. Week: -275. Day: -80.
 
11:49 PM
So far, so good :D
 
[Cardshifter/Cardshifter] build #937 for commit 68b11e12 on branch js-load fixed
 

« first day (278 days earlier)      last day (3283 days later) »