« first day (395 days earlier)      last day (2339 days later) » 

2:00 PM
^^ i.e. use them as static methods :) not sure the Linq methods can be called like that though (still browsing the System.Linq namespace)
They should be able to.... Although Microsoft does like to write magic code
they are
I'm dumb
I was trying to call a static Enumerable extension from outside a method scope
hah. noice
If you're not Jon Skeet, you're dumb
or Eric Lippert
2:02 PM
@BenVlodgi Now suppose you have both in different packages, and are importing a class via using
To be more clear:
same result
I'll demonstrate
package (namespace?) test.A having class A and Extensions, same for testB
and then in a new class, you want to use both test.A.A and test.B.B
(You do not care about the Extensions provided in those packages)
using can define an alias, too, so you can say using Ext = System.Linq.Enumerable;, and then refer call Enumerable extension methods like this: var isEmpty = !Ext.Any(someArray);
I think you would run into somewhat of a trouble if two system packages would provide conflicting extensions.
(or high-class third-party libraries for that matter)
@skiwi that would be extremely unlikely
2:05 PM
it would be unlikely, but its the same as ever
in C# there like 3 different Point classes, depending on which libraries you import
see you later on maybe and otherwise tomorrow
when you are using those libs, you just have to explicitly specify which one you are using
System.Drawing.Point point = ...
where are the others?
2:07 PM
@BenVlodgi That's why I tend to use more fully qualified names in general.
and yeah, System.Windows has its own, too. And Microsoft.Xna has another I think.
So the only workaround then is fully qualified names, which seems acceptable.
Now I understand how extension methods are implimented then
Didn't they drop XNA recently?
@Mat'sMug I forgot about XNA been a while since I used it
@skiwi they dropped it a while a go
2:10 PM
well, .net 2.0 is dropped the same way XNA is, doesn't mean one can't start a project with it today - my employer started a VB6 project in 2007, maybe even later...
@Mat'sMug why? Why would anyone do that?
Typically $$$
Monking again, all.
I can't imagine the logic behind purposely using an outdated paradigm.
If you define an extension method in your namespace, then ones imported from other libs will not conflict..... example incoming
hey @rolfl
2:12 PM
That's just bad accounting @rofl. It costs more in the long run.
But you're probably right.
@ckuhn203 no idea. they had to interface with a 3rd-party COM API... that came with interop assemblies specifically for that...
@BenVlodgi You cheated a bit there though :P
@BenVlodgi I'd add a Console.Write in the extension method bodies just to be sure where the calls resolve to ;)
By adding the Extensions inner static class in A :p
2:14 PM
I'm not finished
I think the real reason is, because they didn't know better.
and this is how the cookie crumbles
back to work now ;)
its own namespace takes precedence, if it is between 2 other outside namespaces, it doesn't know
@BenVlodgi I see
Looks logical ^^
2:16 PM
@Mat'sMug to be absolutly sure that it isn't some bug, I ran with Console.Write()
@skiwi Truth
Yay, finally I can do GUI tests,
public class ConsoleControllerTest extends GuiTest {
    protected Parent getRootNode() {
        try {
            return FXMLLoader.load(ConsoleController.class.getResource("console.fxml"));
        } catch (IOException ex) {
            throw new UncheckedIOException(ex);

    public void testEmptyTextFieldOnStart() {
        TextField textField = find("#textField");
        assertEquals("", textField.getText());
Argh... My mouse moved by 1 pixel and it broke off automated GUI testing because it detected movement
2:24 PM
hey @Jamal!
@skiwi detect movement, then pause testing
@ckuhn203 I think you should remove that comment:
I corrected it thanks to @Mason11987's answer. Make sure to give him some love. — ckuhn203 2 hours ago
Mason11987's answer isn't visible to people < 2K rep ;)
@skiwi show a dialog, and be like... you can resume or cancel
@Mat'sMug Hey!
@BenVlodgi That's an interesting thought
2:27 PM
Hey @Jamal ;-)
Okay, I've found this edit that I was pinged about.
hey @rolfl !
But damn, automated GUI testing looks cool.
I have locked this post for a bit. There are ways for you to communicate with others in an appropriate way. There is meta for a start, and chat. You can add comments to your own posts as well. If you feel there is something more important or sensitive, you can flag a post for moderator attention. I should point out that Jamal is a moderator as well. — rolfl ♦ 3 hours ago
you guys should check your review queues
2:29 PM
@rolfl what happened?
Check the edit history
Q: How would you count in the Fibonacci Sequence?

Joe CollinsI was wondering if I did this in a remotely acceptable way: var fib = function(params) { var iterations = params; var output = [0]; for(var i = 1, j = 1; j < iterations; j++){ //i is the fibonacci sequence //j counts iterations output.push(i); i = par...

No problem @Mat'sMug. Done.
@rolfl Yeah, this is what I'm afraid of, after reading some info on MSO. The bigger we get, the more users we attract, which means the more drama that can happen. But in any case, I'm glad a mod was around in case it got uglier.
Bahhh ... seeing some of the things I see go through the SO site, ... this was not ugly ....
2:32 PM
@rolfl Holy Macaroni!
True. We have our own problems, just with every other site.
haha I got a [badge:necromancer] for that one!
A: How is this site different from Stack Overflow?

Mat's MugStack Overflow hates fun. We don't. Proof: We take care of our zombies We take code review as a weekend sport We love hats

@rolfl Had a chance to look at my finding max subarray sum implementation (for fun) yet?
I'm unsure whether the code is fully on topic or in a gray area though, as I would never put that code into production. Yet it does qualify the ontopicness constraints of CR.
@skiwi Honestly, .... ? yes
I just skipped it though and looked at an android one ;-)
^^ Good choice :P
I had it as readable three-liner first, but it was less readable as it is now, but I think it looks way more scary now.
2:37 PM
we've grown quite a lot!
True that
and zombie population seems under control: data.stackexchange.com/codereview/query/170999/…
Not looking good :(
No X11 DISPLAY variable was set, but this program performed an operation which requires it.
at java.awt.MouseInfo.getPointerInfo(MouseInfo.java:74)
at org.loadui.testfx.utils.UserInputDetector.run(UserInputDetector.java:25)
at java.lang.Thread.run(Thread.java:744)
X11? Isn't X11 specifically for Linux?
I wonder what the average time to answer figure looks like by now..
2:41 PM
Travis CI runs on Linux...
@Mat'sMug There's a query for that somewhere, isn't it?
the one I linked to gives the best idea, the actual query is the one @GraceNote is referring to in How is Code Review doing right now?
@SimonAndréForsberg docs.travis-ci.com/user/gui-and-headless-browsers I thought it was possible, maybe I should actually read the documentation now.
> Jon Ericson, another Community Manager, ran some numbers on the site and discovered that the average time it takes for a question to receive its first answer is actually several hours (averaging somewhere between 8 and 10 hours). This seemed pretty high, but a quick browse of the questions is pretty enlightening - things are huge here. A lot of questions comprise of gigantic blocks of code that have little guidance as to what should be reviewed.
@skiwi I might be wrong though. It's just that the only times I see X11 is when it's in Linux
@SimonAndréForsberg I'm not familiar with Linux at all unfortunately
> For all that engagement, though, the site itself isn’t keeping people. User retention is less than ideal - there’s almost a thousand users listed as “avid” on Area 51, but according to our traffic metrics less than a hundred of them visit on a regular basis, and less than two hundred were even seen in the last month. These aren’t happy numbers. They are in fact unhappy numbers. Very unhappy numbers.
Look at the 'All/10' data
Oh, that's not what you want.....
@SimonAndréForsberg Appereantly I need to manually start the virtual display which they offer, I'll look into that now
2:45 PM
@rolfl That is not the droids query I am looking for.
@rolfl that's zombie population by breed tag...
This build shall pass.
salut @Morwenn!
Why doesn't the SEDE use Flot for the charts!?
@Mat'sMug Coucou :)
2:47 PM
Even I know how to use Flot. And those of you who know me well probably know what I think about JavaScript...
@SimonAndréForsberg I actually don't know what you think about javascript
looks nice
@skiwi My opinion about JavaScript is that I think there is a reason for why it covers 25% of the "YourLanguageSucks" page.
@SimonAndréForsberg Ah... I didn't have a deep thought right now. I think (on the surface) that javascript is cool
but if you dive into it, it becomes a horror
@skiwi One thing to ask yourself when you do JavaScript is: "In this context, what is this?" and then you often figure out that you have absolutely no clue what this is.
(At least that's how I feel)
But Flot makes things, well... Flot (for those of you who know danish...)
2:54 PM
if (typeof x !== 'undefined') { //do stuff } says enough
@SimonAndréForsberg Without looking it up in a dictionary, I'd translate it to "Vlot", which is roughly equal to "Snel", both Dutch, which in English is "Fast", or rather "Quick"/"Quickly"
Does it make sense?
I don't know Danish
@skiwi Actually, it more means "Beautiful"/"Pretty"
> What's with the name?

First: it's pronounced with a short o, like "plot". Not like "flawed".

So "Flot" rhymes with "plot".

And if you look up "flot" in a Danish-to-English dictionary, some of the words that come up are "good-looking", "attractive", "stylish", "smart", "impressive", "extravagant". One of the main goals with Flot is pretty looks.
@SimonAndréForsberg Then it's different meaning as I thought :P
Hmm, I guess I have progress?
@Mat'sMug Danish girls, being Scandinavian, are of course hot.
Running com.skiwi.gui.simple.console.ConsoleControllerTest
Xlib: extension "RANDR" missing on display ":99.0".
java.lang.NullPointerException: Location is required.
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3223)
2:59 PM
@SimonAndréForsberg have you played with the ExtJS library? It's pretty flot as well ;)
"Support for (headless) CI server testing of JavaFX is not available until JavaFX 8." <- But this is where we are right now!
the day I want to start doing web UI with JS, I'll do ExtJS
@Mat'sMug Never seen that before. It does look flot. I suppose it's 100% JS? (Or is there any C# behind that?)
JS, no C#
works nicely with ASP.NET MVC / AJAX
there's a .net wrapper too, but I haven't used it.
I like the way it supports data binding, somewhat similar to WPF
Great, I'm getting a one-time offer... I can convert my JavaSE project to a JavaFX project automatically... However I can not automatically convert it back ;)
3:08 PM
@skiwi backup and proceed?
@Mat'sMug Pretty much
@BenVlodgi about the NHibernate question... if the mappings aren't correct, then the code doesn't work as intended, ...I find it's a very borderline question, holding back on close vote for now...
wheres that?
Great question, with lots of relevant info! Welcome to Code Review. — BenVlodgi 3 hours ago
and that code makes me love Entity Framework even more!
@Mat'sMug yes
3:12 PM
can't NHibernate work off conventions?
.... but his code does work
Who needs conventions, when you have programmers that (think they are) the best of the world?!
A point you could make is that, you shouldn't write code that fails if the mappings failed, because someone made a minor change in the DB to the tables your are trying to map to
I'd stuff the configuration in NHibernate XML mapping files. Fluent NHibernate is scary.
lets say this, his CODE works.... it may fail with out the perfect environment, which is bad
but his question is good, contains relevant information, and his code does work as intended
3:14 PM
EF code-first [think later] FTW!
(I'm not defending his code)
just his question
I just wonder how many ways there are to map a foreign key.....
like, if it's working code, then the mappings are correct. If it blows up, something's not right.
oh wait, the NHibernate model won't blow up until you run a query that uses a bad mapping is that so?
I didn't think that was the case
I thought his stuff was working
I assume his stuff is working, too.
Then what is the problem
3:18 PM
I don't see what could be said about mapping code, nor what could be improved with mapping code that maps correctly.. but then again, I'm not a fan of NHibernate, I may be missing something.
perhaps some formatting and styling tips could be given I guess
commented-out code should be deleted
@Mat'sMug Then you could point out that he should something besides NHibernate... and say that his code is fine as far as mapping code works, and point out the problems that could come up
those comments may be useful later, if those values still exist in the DB
then when they become useful, fetch the version of the code in your source control, the one just before the commit log that says "removed commented-out foreign key mappings in PatientInfo" ;)
Or maybe it's just because I'm putting up with 80-some of such blocks in the code I'm working on right now:
oops nevermind
I didn't mean to identify any poor-coding companies
there's a whole chapter dedicated to comments in Robert C. Martin's Clean Code, and a section about commented-out code. The recommendation is: delete them. They're rotting code that doesn't belong there and only serves to confuse the reader.
NHibernate is like Hibernate for C#?
for .net actually, yeah
is it code that's meant to be there? is it code that was commented-out for debugging purposes, and then forgotten? is it code that's not meant to be there? commented-out code is bad. With a date it's even worse.
source control tells the code's history, not the code itself ;)
and when the underlying tables change column names, the commented-out code wasn't updated with the new names, and now you have a bug waiting to be uncommented!
(back to work)
Q: SASS grid system improvements

DreibaI've got this own made grid system made in SASS: @import "../mixins/cross-browser-elements/box"; $columns: 12 !default; $gutter-width-px: 20px !default; @function calculate-column-width($index) { @return percentage($index / $columns); } .row { overflow: hidden; max-width: 100%; .colu...

3:30 PM
Q: Are Git workflow questions on-topic?

Matt N.I recently started working part time in our organization's IT department and am working with one other person who has previously been the sole developer on several applications used in the office. We are using Git for version control, but still trying to lock down exactly which branches we're wo...

I like that a number of new faces have been showing up on meta lately :)
Yet, it still seems that there's a small number of us answering Meta questions.
the CR nucleus right
Yeah, and we'll need more than just the nucleus if we are to graduate.
Wow... I'm bad.
3:36 PM
@Jamal well, having new faces posting meta questions is a good start! :)
The continuous integration system seems to need 15 minutes to process a build for some reason (lots of peple building, or maybe it delays me because I have produced errors the last builds), and now it failed again and I remember that I forgot to copy in one line.
Q: Where to protect DB data against XSS injection?

sdespontTo protect my web site against XSS injection, I am using OWASP Encoding Project. Is it a good idea to protect all data retrieved in my DB to avoid XSS by going throuh all the data just returned by the query like this : public function fetchDataBySql($sql,$dataArray = null,$htmlEncode = true) {...

And probably I'm also spamming people who are watching my repo with useless (yet useful to me) commits :D
Incoming PHP OOP (). :-)
A: Are Git workflow questions on-topic?

Mat's MugThat is a good question. My initial thought was "well, no", but then the more I think of it, the more I think a sequence of commands is not too different from any other script (powershell, batch, you-name-it)... There's a batchsvn question that was asked, and downvoted, but not closed: seems lik...

@Jamal what's the tag to use on meta for topicality again?
3:43 PM
Q: Object Oriented PHP-How can this be improved?

steveBKnew to OOP and PHP. I've made an attempt at a a PHP Library file that handles account creations, logins, and file uploads with image resizing on the fly.It works so far. I'd like some help with the Obj Oriented part, namely making the code more efficient/succinct. E.g are there other areas where ...

I put
@Mat'sMug Okay. We still haven't decided what to do with those tags.
@Mat'sMug asked for more VB6 questions, he gets more vb6 questions.
@ckuhn203 there's another one?
@Mat'sMug. I posted it. You don't have to look at it.
3:49 PM
A: Are Git workflow questions on-topic?

skiwiI don't believe that processes are on topic on CodeReview, perhaps they would be on another StackExchange site. However, as soon as you start talking about Bash/Shell/whatever scripts, which are always executed in a determined order, then you are talking about programming (scripting), and then I...

I was just playing with you.
Q: Extending the VBA Extensibility Library

ckuhn203The Microsoft Visual Basic for Applications Extensibility library let's us meta-program VBA, but the way it handles (or rather, doesn't handle) getting to the actual subs and functions is clunky at best. I decided to write a few class modules to make it easier. Considering this can be kind of da...

oh I like this.. here I come!
ugh (keep forgetting)
@ckuhn203 funny, no later than yesterday I was thinking I could write a class to emulate some / ..
My ignorance is showing. I'll be back after I google reflection.
VBE has nothing to do with System.Reflection though ;)
3:54 PM
luckily, that is..
but you could write some code analysis module with VBE, code that inspects your code :)
If I could only figure out how to make Travis CI, Headless, Xvfb and JavaFX work together...
^^ I read "if I could only figure out how to make Foo, Bar, FooBar and BarFoo work together..."
@Mat'sMug what kind of analysis are you thinking?
do you know of MZ-Tools?
you can right-click a method and find callers, for example
or reorder the procedures in a module
4:00 PM
@Mat'sMug @ckuhn203 I took a piece of the cake now:
A: "Scripting.FileSystemObject" Replacement module in VBA

Vogel612Just a thing I wanted to get finished as the other answers didn't mention it yet: Spacing: Be consistent in your usage of newlines: Function Rename(ByVal file_path As String, ByVal new_name As String) As Boolean Debug.Assert BaseName(new_name) = new_name new_name = pJoin(RootName(f...

@Vogel612 nice!
In fact it's just a small point, but the illustrating code samples...
@ckuhn203 I'd probably write something to enforce some naming and whitespace conventions...
Q: how to divide business logic from GUI

oIrCThis is the smallest SSCCE,of my project, that I could implement to show you. I've read that calling the game logic from the Event Dispacth Thread is a bad practice, how can I separate them, because as you can see update() and repaint() are related into loop and how can I separate code in a p...

Q: Asking a user to take money from a checking account and move it to a savings account (Revised)

user1764094I made a few changes to the source code based on several suggestions I received yesterday. The changes I made were: improved the names of methods and variables to better describe what they do, passed the db credentials to a properties file, set a different db user (from 'root' to 'test_user'), ad...

Are you the same user? If so then you should create an account, your reputation score isn't accumulating otherwise :) — Mat's Mug 7 secs ago
@CaptainObvious how do I question looks off-topic /
4:09 PM
@Mat'sMug also is an SSCCE.
@Mat'sMug that's a pretty good idea. I've heard of MZ-Tools, but can't use it at my shop. Which is... Disappointing.
@ckuhn203 not disappointing - time-wasting! You need MZ-Tools in VB6.... it's like working in C# without ReSharper.... I'd cry.
(you also need the VB6 scrollbar fix to enable mousewheel scrolling through the code!)
Nice call out @Vogel612. I forgot to mention it.
It does that?!? Why don't I have this magi-wonderful tool?
@SimonAndréForsberg - what are you smooking?
The link you posted there is not exactly about getting data from the dialog to the calling code, it's more about getting the data from the calling code (the dialog fragment) to the activity hosting the fragment. It is still a helpful link though, as some of the things still apply. You don't need a DialogFragment to show an AlertDialog though (even though it is often recommended to use Fragments). Overall, it's complicated :) — Simon André Forsberg 1 hour ago
4:20 PM
smooking? Java code printouts!
Yeah, Smoking with that additional ooooohhhh factor
Sorry my friend, but just by removing the line mentioning, that this is an SSCCE, you won't make it on-topic. Especially stuff like Foo foo raise flags. Please post the "full code" you have or want reviewed. If you disagree on the reviewability of SSCCEs, why not participate in the already linked meta-discussion? — Vogel612 48 secs ago
FWIW I think it's a reviewable SSCCE, but the OP isn't asking for a review, he's asking for a rewrite.
I'd say it's Stub code..
4:23 PM
Q: Idiomatic way to construct a SQL INSERT query in Python

Charlie SkilbeckI have a bit of code to insert some values in a table. It seems a bit clunky - is there a neater way? words is a list of dictionaries, and the entries contain other fields which I don't want to insert. # add the list of words to the words table time_stamp = datetime.datetime.now().isoformat() s...

Q: Speed up my search

thumbtackthiefI have a django app with search powered by haystack. The general search goes very quickly, but I need to filter the results by their model type. It works but is very slow. I've never really worked on optimizing code so I don't necessarily know the tools to use. def search(request): if 'q'...

@CaptainObvious has to be not like that. fingers crossed. toes too.
@rolfl I know, I know. I'm smoking documentation. And experience. I knew it could be a hard comment to read, that's why I added "Overall, it's complicated".
But, it's wrong... (the comment...).
If user_id and game_id came from the user/UI, would you assemble the sql string that way? — Mat's Mug 6 secs ago
Does anyone have experience with headless servers and running a GUI on them?
@Mat'sMug Would you download a car?
orry, the would you just remembered me too much of something ;)
4:28 PM
I have experience with a headless IT department, I don't know about headless servers.
@skiwi I think the whole point of the headless server is that ther is no GUI running on them.
Also, the headless part only allows a subset of things to work.
@rolfl What's wrong about it? What did I miss?
That whole page is about building, opening, and getting responses from dialogs.
@rolfl I have read though that it is relatively easy to emulate by just using a bunch of physical RAM, the only missing thing is an actual screen then.
The part I linked to, is specifically about passing the dialog data back to the calling program.
which is exactly what the OP is wanting to do....
4:31 PM
In case anyone understands this... /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb +extension RANDR -- :99 -ac, what does the -- before :99 -ac do? I'm having a hard time understanding it
(I added in the +extension RANDR)
@rolfl The part you linked to assumes that there's a DialogFragment in there, i.e. Activity -> DialogFragment -> Dialog. And the part you linked to seemed to mainly be about passing data DialogFragment -> Activity. The OP's code is Activity -> Dialog.
But as I said though, many things still apply.
@rolfl Btw, since when did you become an Android front-end guy? You said yesterday that you're not good in GUIs
^^^ since I read the doumentation.
FWIW, I don't consider the Java game-loop question off-topic. It might be an SSCCE, but it's a reviewable SSCCE.
4:36 PM
@SimonAndréForsberg I think it's still stub-code :( I stand by my opinion...
had teeth pulled so no reviews or questions from me for a day or two....
it is reviewable, but OP isn't asking for a review, he's asking for a rewrite. I stand by my close vote.
@Vogel612 I guess that's just means that it's YAGAOCR. Yet Another Gray Area Of Code Review.
...it is.
I am not so sure.... I am going ot VTC, as the bad guy.
4:39 PM
^^ hammer monkey has spoken :)
"Can you provide me an example on how to make a good game loop," - I have to agree with the Mug here too. You have created a different thing from the original code you have and ask for an example (implying implementation) on "a good game loop". Both is IMO off-topic for this site. If you disagree feel free to visit us in Code Review Chat or ask a question on Code Review MetaVogel612 10 secs ago
are we setting an here?
please hold back on further commenting, people :)
@rolfl I refrained from using my hammer with this one, especially with multiple current off-topic reasons.
I tried not to....
Q: Feedback for a mostly auto-generated generic data layer

Matt SiekerI'm trying to make a reusable data layer that is mostly generated from a database via T4 templates. On top of this data layer, I'd like to have WebAPI endpoints for each repository, with most of the basic CRUD operations generated/from a base class. The generics are somewhat getting out of hand, ...

4:42 PM
but if he gets even more angry then I hope one of our mods will lock the post before I lose it.
@CaptainObvious could be tagged with
@rolfl was deleted
and gone :(
@Mat'sMug I think we might be. I hope though that the OP was not a bear, so that he wasn't killed and therefore can come back another time.
4:45 PM
To the upvoters- How can I interpret your upvote? Are you saying you like my post, or my code, or you think I did well? Is it possible for you to comment/answer indicating your intent? It would be appreciated :) — blaze4218 42 mins ago
Wut, we have to explain our upvotes too now?!
@sim I take the deleting of a closed post as a "well f**k you and have a nice day"... but that might be (hopefully) just my own interpretation.
> +1 nice post
Q: Feedback for a mostly auto-generated generic data layer

Matt SiekerI'm trying to make a reusable data layer that is mostly generated from a database via T4 templates. On top of this data layer, I'd like to have WebAPI endpoints for each repository, with most of the basic CRUD operations generated/from a base class. The generics are somewhat getting out of hand, ...

Doesn't seem like much code + Explicit question to how to design? ^
@Mat'sMug I was thinking the same thing (about the upvotes)
@skiwi I'd first think of why would this question be on-topic, and if I can't find anything, then I'd look for why would this question be off-topic. I think it's ok, but I'd like the truncated bits to be part of the post.
4:52 PM
Just had a not-so-obscure thought ..... I mean seriously, people come here to be criticized ... and then complain when they are .... huh! ;-)
Are you using an ORM? It would be nice to see some implementations, and the truncated bits too (including the class bodies). — Mat's Mug 10 secs ago
@skiwi hmm the more I look at it, the more I wonder what makes it on-topic... but somehow I still believe it is.
It's a good question for a newer user. How are up votes interpreted here? I would think it's by "this is worth taking the time to review". Maybe a meta post is in order?
Why do we upvote questions?

« first day (395 days earlier)      last day (2339 days later) »