« first day (625 days earlier)      last day (3392 days later) » 

11:00 PM
7 hours ago, by Jeroen Vannevel
Man it would be useful if my teacher could program better.
(and subsequent messages)
 
it's very comparable to photoshop, still I prefer photoshop :D
:p
 
I can't afford photoshop.
 
@JeroenVannevel why? What does he do wrong?
 
@janos perhaps I should have said "powerful". I don't know what you thought was so terrible about it though
 
teachers can be so un-fun sometimes
 
11:01 PM
PHP folks might be interested in this:
 
@DJanssens subsequent messages!
 
Paint.net ftw!
 
0
A: PHP application configuration

Mike BrantI would perhaps use a JSON string for configuration purposes. The JSON might look like this: { "DB_URL":"mysql://root:password@localhost:3306/database", "APP_URL", "[::1]", ... } And reading it into constants might look like this: $config_file = '/path/to/config.json'; if(is_file...

 
@janos That's why they are called teachers.
 
I personally think it is a bad suggestion
 
11:01 PM
aha didn't know I could click on that @JeroenVannevel, let's see
 
2
Q: C# static class holding list of member class instances

mondemoI was wondering if such a design was a bad idea in C#. Here I have a static class EventLog which holds a list of instances of Event class. This is a simple event log of actions players can do in a game. What can I be doing in a better way? public class EventLog { private const int maxEventsI...

 
@JeroenVannevel WOW... sorry to hear that man. :\
 
@Mat'sMug just like a C#'er, loves anything as long as it has ".net" in it.
 
(Answered)
 
@SimonAndréForsberg in't modifying a json file more user-friendly than aditing the php file?
 
11:03 PM
in the Coursera course for Android, I converted all the homeworks to Gradle + Android Studio and published it on GitHub, offered the teacher to copy it for himself to give to his students, and he asked me to take the repo down (and he didn't use it)
(the course was using Android + Eclipse, which was really crappy back then, today might be better, I don't know)
 
@DJanssens it's a configuration file containing database connection information. Is it supposed to be user-friendly?
 
I'd only consider what is more programmer-friendly.
 
@janos was it from Adam Porter?
 
yup
 
11:05 PM
@JeroenVannevel that teacher is indeed quite incompetent.
 
@DJanssens having a configuration file is useful. But I don't see why it should be in JSON instead of PHP.
 
@SimonAndréForsberg true, but isn't it a common habbit, I've seen quite some XML files that are used to store configs.
 
@DJanssens in PHP, I think it is most common to use PHP files.
 
You can hotswap your config with json/xml if you support it in your code
which is nice and kinky
 
For Java and other languages, it is better to use XML or something
 
11:08 PM
I agree on the argument of @JeroenVannevel, often you can add a default.json and actual.json, and only push the default to your repo, while using the actual
 
@DJanssens and you can't do the same if it is in a PHP file on its own...?
 
if the code is running, you have to redeploy with a PHP config
you won't with a json/xml config
 
now that is the best argument I have heard so far ^^
 
there's nothing in the question to warrant loading configuration from anywhere else then a simple settings.php file with native code
 
although technically, it's just a matter of which file you include, isn't it?
 
11:12 PM
that's what I meant with the hotswapping!
 
database settings are also not something you hotswap in running code
 
^^ also true
 
I also don't see why a running php code couldn't re-include settings.php if it wanted to
 
oh I didn't actually look at the question. Then again: if you can do it hotswapping, why not?
 
11:13 PM
can you just change settings.php while it's running?
without redeploying?
 
no, but you can if (something) include 'settings.php';
which is pretty much the same as changing json file
 
yeah but that's not hotswapping
 
it can be
most PHP scripts are not long-running though, so why hotswap?
 
maybe read the question first ;-)
 
hotswapping should just be: making a modification to the settings file without stopping the service and have it propagate immediately
ehhhh
No, I shouldn't
It'll get me sleepy
 
11:17 PM
you could hotswap settings.php just as easily as settings.json
in fact easier
 
@JeroenVannevel it's PHP... it's parsed. There's rarely the need to stop the service.
 
never heard of stopping a service for redeploying php files
What is easier about changing a JSON file compared to a settings.php file with define statements as in the question? — janos 18 secs ago
it's a rhetorical question
anyway, TTGTB, see you all tomorrow, probably
 
bye :)
 
    Open up your browser's console and paste this into the input place:

 var msgs = document.getElementsByClassName("messages");
    for(var i = 0; i < msgs.length; i++) {
    	var msg = msgs[i].getElementsByClassName("message");
    	for(var j = 0; j < msg.length; j++) {
    		var cont = msg[j].getElementsByClassName("content")[0];
    		cont.innerHTML = cont.innerHTML.split("").reverse().join("");
    	}
    }
 
11:40 PM
Why would I do that, @SirPython?
 
I don't know. I just made it for people's enjoyment - if they find that stuff enjoyable.
@Hosch250 Are you asking because you don't know what it will do to your browser?
Or because you find it pointless?
 
Yeah.
Not that I don't trust you, but I'd ask the same of Jon Skeet.
 
I completely understand - all it does it reverse the text in every chat message sent that is on your page.
So, for example, your message, "Yeah." would become, ".haeY"
 
Done.
Oh, it doesn't continually reverse, though.
 
No.
You'd have to run it every time. But, if you do it more than once, it will reverse previously reversed text.
 
11:48 PM
I saw that.
 
11:58 PM
I hate not being able to think.
 
RELOAD!
 
Who unplugged you?
 

« first day (625 days earlier)      last day (3392 days later) »