« first day (221 days earlier)      last day (3640 days later) » 
00:00 - 23:0023:00 - 00:00

00:08
@Phrancis No Cardshifter web site on the reload :(
Ehehe I'll implement tests tomorrow I think
If I have time!
> trying to address issue #69. Catching RuntimeException which should fix the unexpected stopping of the thread.
> re-added RELOAD to The 2nd Monitor chat room
@Marc-Andre The RubberDucks is beating the crap out of us!
You need a commit to re-add a room to post something. It could use some properties file or something similar
00:18
> This has been a long-planned enhancement but apparently there was no issue from it. It would be nice to make a simple edit to the database and make it add/modify/remove some scheduled tasks. Scheduled tasks should probably be stored in the database as a String, as logic can't really be stored in the database (unless we would want to add Nashorn script support which I don't feel is necessary). The String could be something such as message(8595, "***RELOAD***") or dailyStats(16134),...
etc.. more support for various tasks can be added later. Additionally, it should also have a String cronConfiguration as a String, of course, to modify the time and frequency.
@Marc-Andre I had already planned something like that ^^
I was surprised it was not already done :P
I am only human! I can't do everything!
In fact, @Marc-Andre, I'm not entirely sure how to do it. I think I read some about adding tasks to Spring's cron-schedule-thingy, but is it also possible to remove from it?
Time ! Why can't we separate a part of our brain to code!
We need a third brain-half, dedicated to coding.
00:31
@SimonAndréForsberg I don't know why you could not! I've never worked with the Spring's cron-schedule-thingy but I would be surprised if someone somewhere did not implement this
I'll have to look it up I guess :)
is probably not too hard
the only problem is to make it support different tasks, with different parameters
5
Q: How to conditionally enable or disable scheduled jobs in Spring?

Pierre HenryI am defining scheduled jobs with cron style pattenrs in Spring, using the @Scheduled annotation. The cron pattern is stored in a config properties file. Actually there are two properties files : one default config, and one profile config that is environment dependent (e.g. dev, test, prod custo...

Are you doing something like this ?
Close, but not really.
The accepted answer is bad but another answer mention annotation that could be nice
What are you doing ? Could you show me some code ?
00:35
is your @Scheduled indentation off there ?
@Marc-Andre tabs and spaces...
I would love it if tabs always were shown as 4 spaces instead of 8.
One big messy way would be to have an api to submit, remove existing sets of jobs.
I guess I can use the schedule method on a ThreadPoolTaskScheduler, keep a list of ScheduledFuture and call cancel on (some of) them when I want to change things.
@Marc-Andre at the first step, I plan on doing direct changes in the database, using pgAdmin, and then do some URL request to make the scheduled tasks reload (cancel all existing and then create new ones)
@SimonAndréForsberg I've been working with Camel to integrate different things at my work. It's not fitting here since normally it's for integration, but every task could be a Route and you control it with the console (but it's a bit overkill for what you want).
@Marc-Andre Camel? Route? Control with console?
Tomcat doesn't really have an interactive console AFAIK
sounds interesting, even if I don't understand what it's all is for
but you were right, @Marc-Andre, it definitely looks a bit overkill
Normally, it's use to exchange information between applications. Like System A wants to talk to System B, you talk through Camel. Camel can/will modify the date to talk between system, run scheduled task, and duplicate aggregate messages base on what you need to do
01:58
I think I'm finally broken out of the row/column data structure!
2
 
8 hours later…
09:54
> As an alternative to Nashorn scripts you might want to consider Groovy Script evaluation (at runtime). I imagine pseudocode like:

for (ScheduledTask task : database.getScheduledTasks()) {
if (task.isDue()) {
groovyEngine.run(task.getJob());
}
}
 
3 hours later…
13:22
@SimonAndréForsberg put in one little test method for DataOutputStream and tried to build the html with gradle:
08:18:20.732 [QUIET] [system.out]    Compiling...
08:18:20.883 [QUIET] [system.out]       Compilation completed in 0.15 seconds
08:18:20.946 [QUIET] [system.out]    Added 3626 units to cache since last cleanup.
08:18:20.959 [QUIET] [system.out]    Validating units:
08:18:20.964 [QUIET] [system.out]       [ERROR] Errors in 'file:/Users/baz/Documents/walkaboutMMO/core/src/com/walkaboutMMO/GameModel/MainGame.java'
08:18:20.968 [QUIET] [system.out]          [ERROR] Line 279: No source code is available for type java.io.FileOutputStream; did you forget to inherit a required module?
im not even calling the method in the code
13:46
hey
@bazola what's your code?
@skiwi hey! How are we feeling today?
could be lots better
I'm thinking that most of the stomach and headache issues are gone for now
still have lots of trouble concentrating for a longer period of time
@Phrancis God save the queen @Phrancis!
The real test now is if I can manage to play HearthStone on my laptop... that'd be an improvement
14:07
public void saveDataStream() {
   try {
        DataOutputStream out = new DataOutputStream(new FileOutputStream("test1.txt"));
        try {
            out.writeBytes("test" + "  ,");
        } catch (IOException e) {
            e.printStackTrace();
        }
    } catch (FileNotFoundException e) {
        e.printStackTrace();
    }

    try {
        DataInputStream d = new DataInputStream(new FileInputStream("test1.txt"));
        try {
            System.out.println(d.readLine());
        } catch (IOException e) {
I need to figure out how to use FileHandle though
working hard on your game @bazola?
@skiwi not hard enough! glad you are feeling a bit better skiwi. The chat is not as much fun when you are not working on code!
2
DataInputStream d = new DataInputStream(Gdx.files.external("test1.txt").read());
and for writing:
DataOutputStream out = new DataOutputStream(Gdx.files.external("test1.txt").write(false));
@bazola that makes me sound somewhat important in here!
@skiwi I WANT COMMITS!
3
14:21
I want to understand what my code does :D
wtf at this deck
Eh, why is Dropbox not saving anything
why is Dropbox not around at all?
3x Naturalize, 3x Savage Roar, really?
3x naturalize is dangerous!
Heck, 1x naturalize is dangerous!
@bazola You get it to work now with the code I showed you above?
eh, holy shit?
@SimonAndréForsberg still working on the html test. I forgot to remove the call to the save method before building the html and so it crashed and I have to compile it again
@bazola I don't think Gdx.files.external works in HTML though.
or have they added that local-save-files functionality?
14:32
nope it pops up a message that says that what you did is not supported in the backend if you try to call stuff with Gdx.files
it will still compile though
yup, your code is perfectly compatible with GWT, as long as you don't call it
3
this is insane
without an aggro start you're in trouble though
14:48
Monking
@SimonAndréForsberg your code is now confirmed working on iOS, and it even gave me a helpful error message that I am not explicitly closing the streams
hey @Phrancis
How's it going today?
15:09
@bazola awesome!
@Phrancis I've been doing a bit of work on Pentacolor, now I will have a little break and then work on adding some new features to @Duga
Ah nice :)
are you doing boring data-entry today as well, @Phrancis?
@SimonAndréForsberg so basically I will be using this method to pack up the bytes of all of my objects?
out.write(b, off, len);
not necessarily
@SimonAndréForsberg Not yet, it's been put on hold because there will be a change in the process (hopefully a good one, I could use one of those right now)
15:16
you should be able to use docs.oracle.com/javase/7/docs/api/java/io/… to write one byte
you need to specify exactly what data to read though
make a for-loop on your regions and tiles and write the values they need to save
@Phrancis glad you don't have to do that today :)
@SimonAndréForsberg cool
the hard part will be figuring out when a Tile has a building, and when that Building has objects, and when to save those if they are present, and the same problem when loading them
it seems like one solution is to give the objects the ability to encode themselves but I am not sure.. I don't really want DataOutputStream in every class necessarily
i guess i could inject an object that has the ability to save the data, but it would then need to know about how to encode each object so it breaks encapsulation that way
oh the problems of OOP :)
15:34
hehe :)
15:57
well I came up with this that seems to work:
			byte[] thing = new byte[2];
			thing[0] = 1;
			thing[1] = 2;
			System.out.println(String.valueOf(thing[0]) + String.valueOf(thing[1]));
so I could just have each class have a method that returns a byte array for itself
and then depending on the length of that byte array, it would know whether there are buildings or whatever included
but no, that won't work alone because without write(byte[]) I can't do a variable sized byte array
@bazola that's.... not really optimal.
you don't need to create a byte array for each object you want to save
I would pass around the DataOutputStream and let each object take care of it's own serialization
to read objects, you can use static SomeObject read(DataInputStream in) { ... }
public byte[] customEncode() throws IOException {
    ByteArrayOutputStream byteStream = new ByteArrayOutputStream();
    for (Region region : this.worldMap.values()) {
        byteStream.write(region.customEncode());
    }
    return byteStream.toByteArray();
}
You're creating a lot of unnecessary byte arrays
i guess the static methods that take the stream sound like a good idea
but, then I need to import that into all of my objects
but I guess with the above I was going to have to import something into most of them also, at least any of them that could be variable length
@SimonAndréForsberg No more data entry for me, ever!
3
16:12
@Phrancis yay!
	public void customEncode(DataOutputStream out) throws IOException {
		for (Region region : this.worldMap.values()) {
			region.customEncode(out);
		}
	}
(until they roll out the next crappy program they come up with)
@SimonAndréForsberg so if I'm encoding a string.. how on earth will the decoder know what the length of that string is going to be? do I need to put an integer at the front of the string to tell it the length that the string is going to be? seems like this will get very tedious
@bazola yes, put a length of the string in front of it.
it might feel very tedious, but that's how it is done on the low-level.
I wrote this kind of support for Cardshifter not so long ago
public void customEncode(DataOutputStream out) throws IOException {
    int mapX = this.position.x;
    int mapY = this.position.y;
    int biomeType = this.biomeType.ordinal();
    byte[] name = this.name.getBytes();
    int nameLength = name.length;
    byte[] ownerName = this.ownerName.getBytes();
    int ownerNameLength = ownerName.length;
    out.write(mapX);
    out.write(mapY);
    out.write(biomeType);
    out.write(nameLength);
    out.write(name);
    out.write(ownerNameLength);
    out.write(ownerName);
16:22
okay, that's a bit overly tedious
you don't need to create a local variable for everything
@SimonAndréForsberg i guess I will have to live with it then. I used a shortcut with Objective-C where I didn't have complex objects to deal with
@SimonAndréForsberg more self documenting though?
@bazola out.write(this.position.x); is just as self-documenting
alright
skipping the local variables would make it more readable IMO
really I did it just to make it very specific that i was adding the lengths of the strings
16:24
I think you can also use out.writeChars to avoid having to do the byte[] name conversion
@bazola how about adding a public static method somewhere for serialize(DataOutputStream out, String value) to take care of that?
public void customEncode(DataOutputStream out) throws IOException {
    out.write(this.position.x);
    out.write(this.position.y);
    out.write(this.biomeType.ordinal());
    out.write(this.name.getBytes().length);
    out.write(this.name.getBytes());
    out.write(this.ownerName.getBytes().length);
    out.write(this.ownerName.getBytes());
}
feels better?
@SimonAndréForsberg if the method was going to be static though I would have to pass in the actual instance to get at the contents?
I would just make it StringSerialize.save(out, this.name); instead of the two lines though
@SimonAndréForsberg i don't like the multiple calls to .getBytes() but I doubt it is really a performance ocncern
16:28
@bazola it's not. but it is a slight code duplication for every place you save a string
so then like this:
public void customEncode(DataOutputStream out) throws IOException {
    out.write(this.position.x);
    out.write(this.position.y);
    out.write(this.biomeType.ordinal());
    Region.serializeString(out, this.name);
    Region.serializeString(out, this.ownerName);
}

public static void serializeString(DataOutputStream out, String string) throws IOException {
    out.write(string.getBytes().length);
    out.write(string.getBytes());
}
yes
but in your serializeString method I would save the string.getBytes() to a variable, which avoids the double-call to getBytes
@SimonAndréForsberg ah, good point
@Phrancis Souds like fun
16:54
public Region(DataInputStream in) throws IOException {
    int posX = in.read();
    int posY = in.read();
    this.position = new MapPoint(posX, posY);
    this.biomeType = BiomeType.values()[in.read()];

    int nameLength = in.read();
    byte [] nameBytes = new byte[nameLength];
    in.read(nameBytes, 0, nameLength);
    this.name = nameBytes.toString();

    int ownerNameLength = in.read();
    byte [] ownerNameBytes = new byte[ownerNameLength];
    in.read(ownerNameBytes, 0, ownerNameLength);
Hello World, 2015-03-11T17:00:40.002Z
The time is 2015-03-11T17:01:40Z and @Duga is alive
Duga is alive
@Duga Greetings, program.
The time is 2015-03-11T17:02:40.001Z and @Duga is alive
The time is 2015-03-11T17:05:00Z and @Duga is alive
17:07
I managed to get 5-3 with that Arena deck I showed a couple of hours ago, quite happy with it
I got a question, if I may... I made a package for Vehicles for practice... I have a Terrain enum, and in one instance I declared the Terrain values in the abstract superclass,
while the other I declared in the subclass... Any idea which makes more sense? Also in the first instance I declared two values, it this OK to do when multiple values apply?
@Phrancis What do you plan on using the terrain values for?
One thing is for sure, this does not make much sense:
Terrain terrainRoad = Terrain.ROAD;
Terrain terrainOffroad = Terrain.OFFROAD;
A car can only drive on one terrain at the time, right?
@SimonAndréForsberg So far, I don't really know. I'm mostly just entering stuff as kind of data classes
Terrain.ROAD and Terrain.OFFROAD is already declared in the enum, so if you plan on having copies of these somewhere else just for reference - don't.
@Phrancis I think you need to make a game of some kind!
Let me know if you want some suggestions for a PhrancisChallenge
Oh gosh I wouldn't know where to start for a game lol
I'm more interested in making an application for my business instead
17:19
Doesn't have to be a difficult game.
And what would you like that application to do?
Allow input and tracking of customers, projects and invoices, mostly
Was planning to do it with SQL, but Java may actually make more sense, or combination thereof perhaps
Volume is too small to really take advantage of SQL
and you want something more advanced than Excel, I guess?
Yeah Excel works but not that well, especially for invoicing
1 customer can have 3 projects with different due dates and specs but all going on one invoice
Perhaps Java would be a lot better than doing something like this lol.
select fcn_insert_person (
        -- person table
        prm_role_id := 'Customer',
                /*
                    Staff
                    Partner
                    Customer
                    Vendor
                    Session musician
                */
Could just be a Person interface, a few enums and subclasses no?
<lunch>
@Phrancis not sure. not entirely sure what that code does
No worries
17:32
it sure helps when you are testing your decoding methods to input the correct file name.. otherwise you will get some garbage outputs and think you are encoding things wrong!
3
@bazola lol
17:55
well I think I have it mostly figured out, except for why this is not actually giving me a string:
		int nameLength = in.read();
		byte [] nameBytes = new byte[nameLength];
		in.read(nameBytes);
		this.name = String.valueOf(nameBytes);
[B@1ff0d013 is the value I get for the name
or some other nonsense like that
@bazola the byte array should be twice the size of the nameLength, first of all
and use new String(nameBytes, "UTF-8")
no wait... it shouldn't be twice the size of the nameLength
you just need to use the constructor I showed above
</lunch>
@SimonAndréForsberg awesome :) thank you. it would have taken me a while to figure that one out
18:13
@bazola That's an array of bytes I believe? with the hash code appended
Other than a SQL DB, what's a common way data is stored in a Java environment?
@Phrancis XML, JSON, Java's internal .properties file format
or some kind of binary file format
18:33
OK. Say I was going to store basic demographics, as well as products and invoices that sort of thing... if it were you, which would you choose?
(more importantly, why :)
:(
> <eval>:8 TypeError: Cannot call undefined
I hate design issues, especially when I'm sick.
19 hours ago, by Phrancis
Prediction:
How many items do you expect to store?
How often will they be updated?
Oh JavaScript...
116
Q: How can I convert the "arguments" object to an array in JavaScript?

Andrew ColesonThe arguments object in JavaScript is an odd wart—it acts just like an array in most situations, but it's not actually an array object. Since it's really something else entirely, it doesn't have the useful functions from Array.prototype like forEach, sort, filter, and map. It's trivially easy to...

with "invoices", do you intend to store real Word documents or similar?
@SimonAndréForsberg A few hundreds of various types
18:47
@SimonAndréForsberg Have you had time to play around with Nashorn yet?
Should not be updated very frequently in most cases, other than marking an invoice as paid or a project as completed
@SimonAndréForsberg I was thinking it would be nice to be able to generate or store a human friendly copy, PDF/Word or whatever
@skiwi not since last time.
I don't remember last time
@skiwi since my last commit to Cardshifter
@Phrancis if you want to store the invoice together with the program data, then that's a little challenge. To avoid making it too complicated, I would store that data aside of the program's core data.
I would probably use Jackson, just for how easy it is to use
Got a link to get me started?
18:57
> <eval>:52 TypeError: Can not invoke method [jdk.internal.dynalink.beans.SimpleDynamicMethod List com.cardshifter.core.cardloader.JsEffectsCardLoaderTest.CustomModDSL.pickRandom(‌​List,int)] with the passed arguments; they do not match any of its method signatures.
I'm just hitting errors... lame
Oh crap, forgot one important part
LOL
> java.lang.RuntimeException: com.cardshifter.core.cardloader.CardLoadingException: javax.script.ScriptException: <eval>:57:23 Expected an operand but found return
return return new JSEntities(dslType[methodName](this.getJavaObject(), p1, p2, p3, p4, p5, p6, p7, p8, p9, p10));
^ in <eval> at line number 57 at column number 23
@SimonAndréForsberg I normally invoice with PayPal so I guess a document invoice is a bit redundant
@Phrancis To use Jackson I'd first recommend that you make a Maven project. Handling dependencies are so much easier with Maven (or Gradle)
The time is 2015-03-11T19:00:00.003Z and @Duga is alive
@Duga are you alive?
@Phrancis yes, that is Jackson
19:00
Note to self: Don't use a double return keyword in JavaScript, things get messy
@skiwi found return return return?
@SimonAndréForsberg Yeah... lol
The time is 2015-03-11T19:08:00.003Z and @Duga is alive
Working on this JS loader is harder than I thought
19:15
@Phrancis Good luck with Maven
Sorry for just throwing you into the deep scary Maven pool, @Phrancis
The time is 2015-03-11T19:20:00.003Z and @Duga is alive
@SimonAndréForsberg Well, probably be a while still before I know how to use any of this stuff lol
Question is: Would I be better off just using a DB instead?
@Duga What is @Duga trying to tell us?
So... using Java Reflection using JavaScript from within Nashorn is causing some trouble
19:30
> added task entity, DAO and Service
> added TaskManager
@Phrancis with or without Java?
> added addTask method to TaskService and TaskManager
> extracted the previous tasks to their own Runnable class
> added message task
@SimonAndréForsberg I was thinking with. Like JDBC/Postgres combo
> Stack API results refactoring, added StackUser(s)
@Phrancis If you want to use Java or not also depends on how much you want to learn Java. Also, if you want to learn Java you should perhaps make another project before you get started with your big one.
19:32
> refactored SE API Bean
> added UserRepDiffTask
> enabled log4j
@SimonAndréForsberg Yeah, and should probably get through that book first before I even do a small project
> added task runner to wrap exceptions for tasks
@Phrancis You will need dependencies either way. You can use dependencies without using Maven. Perhaps that is the best option in this case.
> fixed and added test for clearName
@Phrancis I was thinking about recommending you to do a small and simple Tic Tac Toe game
19:33
What the heck is Maven, anyways? It's bad?
@Phrancis It is a build tool. It helps you compile, test, package, etc... your project
JavaScript: You are FREAKING WEIRD!
I see
It's not bad. As long as you don't ask monkey.
@skiwi Congratulations! Was about time you realized that! :)
This isn't evil its final form...
JSGame.prototype.opponent = function() {
    var method = dslType.class.getDeclaredMethod("opponent", Java.type("com.cardshifter.modapi.base.ECSGame").class);
    var argumentsArray = Array.prototype.slice.call(arguments);
    argumentsArray.unshift(this.javaGame);
    return new JSEntity(method.invoke(null, argumentsArray));
}
I do have some progress
time to afk now
19:39
this looks pretty scary:
	public TileCapital(DataInputStream in) throws IOException {
		super(TileType.values()[in.read()], new MapPoint(in.read(), in.read()));
@Phrancis real programmers don't finish books! they only start them
@Phrancis Even I am not sure what I'm doing with maven sometimes. I pray a lot to the gods of programmation and so far it's working!
3
@bazola Use a static factory method
20:01
@SimonAndréForsberg I have yet to do anything you can actually "see" (other than stdout) is that by itself pretty complicated, or does Java have some pretty flexible visual things to make boxes and fields and things like that?
> added unanswered task
> fixed incorrect order of scanned comments. fixes #68
@SimonAndréForsberg any reason why it should be static in this case?
@Phrancis I would say that JavaFX is pretty flexible visual things
@bazola factory methods are always static. Effective Java Item 1: Consider static factory methods
@Phrancis Don't even dare to use Swing :P
3
@bazola Your current TileCapital constructor reads from a stream and can throw an exception. It looks quite ugly, especially when being used inside the super call. I would read the data you need to read and then create a TileCapital from that.
So read first, call constructor later. Therefore: Static factory method.
@Marc-Andre or AWT
20:06
@SimonAndréForsberg ah, okay
20:25
@bazola You have no clue what scary code I write, then
2
Loki Astari vs. user2970555: 35850 diff. Year: +2465. Quarter: +2465. Month: +195. Week: +125. Day: +20.
Mat's Mug vs. user2970555: 29625 diff. Year: +2942. Quarter: +2942. Month: +352. Week: +190. Day: +60.
@Duga Y U WORK NOW?
N' Y I NO REMEMBER MY ID?
It's al mysteries @SimonAndréForsberg
@SimonAndréForsberg Be careful with using Reflection from inside Nashorn... I haven't managed to get it to work and give consistent results yet...
20:42
@skiwi thanks for the warning. Don't think I have planned to do that though...
This exception is rather... interesting
> Caused by: java.lang.IllegalAccessException: Class java.lang.invoke.MethodHandleImpl$BindCaller$T/105374791 can not access a member of class com.cardshifter.core.cardloader.JsEffectsCardLoaderTest$CustomModDSL with modifiers "private static"
at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:101)
The interesting part is that the method is public
Unless it's because ECSGame has some private static stuff, which would make it even weirder
what about the CustomModDSL class?
Implements a marker interface, only has public static methods and I filtered all bridge, synthetic and non-static methods from the reflection object
@skiwi but is the CustomModDSL class itself public?
@SimonAndréForsberg Yep
20:50
then I don't know
This is another error I get sometimes
> java.lang.IllegalArgumentException: argument type mismatch
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.invoke.MethodHandleImpl$BindCaller$T/105374791.invoke_V(MethodHandleImpl.java:941)
It's really weird, to say the least
Well, apparently you are doing something wrong.
Ah... got a hint at the least
> private static boolean com.cardshifter.core.cardloader.JsEffectsCardLoaderTest$CustomModDSL.lambda$characters$1(com.cardshifter.modapi.base.Entity)

java.lang.RuntimeException: java.lang.IllegalAccessException: Class java.lang.invoke.MethodHandleImpl$BindCaller$T/1107024580 can not access a member of class com.cardshifter.core.cardloader.JsEffectsCardLoaderTest$CustomModDSL with modifiers "private static"
Pretty sure I filtered that method out... but okay
21:04
So... I figured even more out
This method is not public as it's a lambda-method, but it's not marked as synthetic/bridge and does not fail the is-public test
and the last point where I can check it's too late to fail
@skiwi that explains a lot, actually
I don't see how it can be explained though
Do you have more of a clue?
Lambdas aren't public.
What more of an explanation do you need?
That the method I call is public
And I have this check up front:
var methods = dslType.class.getDeclaredMethods();
for (var i = 0; i < methods.length; i++) {
    var method = methods[i];
    if (!Modifier.isStatic(method.getModifiers()) || !Modifier.isPublic(method.getModifiers()) || method.isSynthetic() || method.isBridge()) {
        continue;
    }
I don't see how it can pass that if-statement, and then still fail
I give up for today, TTGTB
Actually, no, I seem to be onto something
I think I have a reference here to a Method object that mutates when calling invoke on it if it contains a lambda
Can probably work around it, not sure if it is a real bug or not though
21:41
Whatever I think I'm doing, is not what I am doing
woot, I finally got a game loaded!
nice @bazola
@SimonAndréForsberg If you would see whatever is happening here, you'd also be surprised.. I'll try to clarify it in the coming days once I have more time
My best current attempt at explaining
I loop over all eligible declared methods, there are 3 of them. For all 4 I define a function that gets called later, and then all capture the var method that is local to the for-loop... Now I call one of those functions later, and it's suddenly a method that wasn't there in the first 4 eligible methods!
Ah, I do think I understand that part now, I still assign it in the loop... so it seems like JavaScript "local variables" can be overwritten
JavaScript: Creating headaches and WTF-moments since 1995.
So this is the problem I was facing
10
Q: Arguments to JavaScript Anonymous Function

Phonethicsfor (var i = 0; i < somearray.length; i++) { myclass.foo({'arg1':somearray[i][0]}, function() { console.log(somearray[i][0]); }); } How do I pass somearray or one of its indexes into the anonymous function ? somearray is already in the global scope, but I still get somearray...

22:08
@Phrancis Working on the website at moment
ok cool. About to go home
This question is more understandable
115
A: How do I pass the value (not the reference) of a JS variable to a function?

Andy EYou need to create a separate scope that saves the variable in its current state by passing it as a function parameter: for (var i = 0; i < results.length; i++) { (function (i) { marker = results[i]; google.maps.event.addListener(marker, 'click', function() { change_selection(i...

@Simon If you didn't know that yet, then you really want to know that
@skiwi ah, that. Yeah, I've experienced that too.
Oh, I've experienced it alright.
That explains my WTF moments of a bit ago
That said, it's probably only a matter of time before I will experience it again.
22:16
Sorry @Duga no commit today anymore!
@SimonAndréForsberg AWT is not even an option in my head :P
22:41
@skiwi It's okay. @Simon gave me some commits. Literary
What's wrong with Swing? (other than being kinda old and not particularly attractive looking)
have any of you ever experienced something where it seems like old values for your static constants are being called instead of new ones?
@bazola a static constant cannot have an old value and a new value
something crazy must be happening
22:59
Loki Astari vs. Simon André Forsberg: 4189 diff. Year: -1577. Quarter: -1577. Month: -687. Week: -40. Day: -25.
Simon André Forsberg vs. Mat's Mug: 2036 diff. Year: +1100. Quarter: +1100. Month: +530. Week: -25. Day: -15.
00:00 - 23:0023:00 - 00:00

« first day (221 days earlier)      last day (3640 days later) »