« first day (457 days earlier)      last day (3551 days later) » 

12:00 AM
Yeah, I must've missed that.
 
Well, we can congratulate each other now ... ;-)
Congratulations!
 
:-)
All three of us earned it, and no other mod (not even Jeff Atwood) has. Hell yeah!
 
Yup ... ;-)
 
Now I just need to put on the meta tag post, and I'll have that tag badge.
 
12:46 AM
@Morwenn Where I went to school, C++ was used for the "Intro to Programming Logic" class. Truly, they should have just used C. You're not doing anything OOP in the class... and you're not necessarily going to use C++ at any point after that class. And while you may not necessarily use C after the class either, several languages seem more closely related to C than to C++ (if you ignore the OOP aspect, which you don't cover in the intro class anyway)
 
0
Q: MySQL UPDATE field to average input?

user3117036So I have a table teams with columns number, score, notes. So I want to have multiple people insert their scores and notes. So for the notes, I would just do like UPDATE teams SET notes = CONCAT(notes, :note) WHERE number = :number But I don't know how I would update the score. I would want it to...

 
@nhgrif Same here. I think my former community college has started doing this with Python instead.
 
 
2 hours later…
2:25 AM
slow .... night
 
I know. :-/
 
Holy sh... What happened here? Still hot days later. codereview.stackexchange.com/q/58747/41243
I've not seen that many votes on anything around here before.
 
Some of the worst-looking code does get more attention from users outside the site.
 
Hmmm yeah. I could see that.
 
And I'm glad that monkey protected it when he did, but it surely would've attracted some trash.
 
2:36 AM
I guess that's why I'm surprised. There isn't that much trash. Hot questions don't stay hot without that traffic.
The changes, comments, etc.
But yeah, it has been a slow weekend.
 
And the question can always become unprotected as soon as it loses steam.
 
I don't think people get this site.
Lots of people do, but more don't.
 
They probably don't see how it's different from SO. On there, it's common to see lazy code dumps everywhere.
 
Yeah. I think that's exactly what it is.
 
2:53 AM
@ckuhn203 wish I had a good answer on that one!
 
That just got crazy @Malachi. That's all there is to it.
I've been seeing lots of names I don't recognize lately though.
And not all of them are new users. Which is cool.
 
@paritosh is one that I have noticed
I think I am heading to bed though
 
3:17 AM
Well, I answered a Python Q, with a brilliant answer..... even if I say so myself.... but, .... slow night
Also, I deleted my answer on that same question that's gone crazy
I'm regretting that, now.
 
20/20 hindsight is a real bugger.
 
I think I did okay today.
 
You did great.
150 on a sunday... is the best this week.
not quite, ckuhn edged you out
 
I was close to rep-cap, though that wasn't my goal. The C++ goldie is still my goal.
 
I am playing with legendary pre-yearling
still.
It's a big undertaking, that one.
 
3:27 AM
And I'm aiming towards 20K by my next Yearling.
 
I have not been pimping, and that's not helping me.
 
Fortunately for the first goal, I won't need Santa; I just need an average of 1-2 upvotes for my remaining six answers.
 
I noticed your absence in one-vote-short this week
 
I attend to it from time to time. I've mostly covered the Nice Questions and various answer badges for my tags of choice. Overall, I've been focusing on site clean-up.
Thanks, Santa!
 
I just got lucky today. Someone was posting particularly bad VB.
I know. I I know. All VB is bad...
 
3:33 AM
^^^ that
Oh, and, not saying it is nice, but it's nice to have to work to the top of the leader charts again
I am on row 4!
TTGTB
 
Goodnight!
 
 
1 hour later…
4:39 AM
0
Q: Google Code Jam - reverse words

Sam ObengAs a sequel from my previous question, I decided to solve the next problem statement from the GCJ dash board. Any thorough critique, this time, with much attention to skill and technicalities would be much appreciated. I have a few questions: According to the problem statement, the number of ...

0
Q: Controlling frame rate

CaesarI'm creating a bunch of threads that need to do work in a frame cycle. I would like to control how many frames are done in a second. I simplified the code I have into this so I can show you what I have wrote // setup the frame timer std::chrono::time_point<std::chrono::system_clock> start = std:...

 
5:19 AM
0
Q: Object-Oriented FizzBuzz in Ruby

cbojarI don't use Ruby on a regular basis, but I felt inspired to write an extensible, object-oriented version of FizzBuzz to sharpen my skills. I welcome all feedback. The main class: class FizzBuzzer def initialize(*tests) @tests = tests end def run(values) result = [] values.eac...

 
Oy vey.
 
0
Q: Optimizing Conway's Game of Life code to run faster

user3113376How could I take this code and optimize it so that I could possibly run Conway's Game of Life on a large grid at 15 frames per second? public partial class MainWindow : Window { Cell[,] activeCells; //List<Cell> nextGenCells; static Timer time; bool onOff = true; int columnNum = 10; int rowNu...

 
"The whole point of the article is about WHY we have to ask people to write FizzBuzz. The mechanical part of writing and solving FizzBuzz is irrelevant." discourse.codinghorror.com/t/why-cant-programmers-program/612/…
 
5:44 AM
morning @all
 
morning @chillworld
 
6:01 AM
0
Q: ASP.NET MVC return early from an action that returns a model

l46kokConsider the following code segment written by a coworker of mine: public ActionResult Index() { DataRetrieveModel dataRetrieveModel = new DataRetrieveModel(); using (spc_web_trunkEntities db = new spc_web_trunkEntities()) { DataRetrieveDAL dataRetrieveD...

 
6:38 AM
Monking
 
Monking @mjolka @skiwi @chillworld
@Donald.McLean Greetings, User
@NicolasMcCurdy Could you please write answers as answers, and not as comments? For more information see "your code looks correct answers"Vogel612 1 min ago
 
7:22 AM
This feels a bit ugly, but there's no other way around it, is there?
@SuppressWarnings("unchecked")
List<Organization> templateOrganizations =
  FileUtils.readSerializableObjectFromFile(path.resolve(Config.FILENAME_ORGANIZATION_TEMPLATE), List.class);
 
0
Q: Demo shopping cart android application

Bunny RabbitI created a small demo cart application for android, It has a product list page and a cart. I've hosted the application source at this location : https://github.com/aashudwivedi/Fookart/ I've tried to use the LoaderManagers instead of managedCursor. It adds a few items in the content provider ...

0
Q: Building tree structure based on flat objects - follow up

HeslacherThis is a follow up on this question I have implemented some changes to the class below and also added the method AddChildRange() to the ArchiveTreeEntry class. I have kept the method as static, as this method is the only purpose of this class, and none of the passed items will be changed. I am ...

 
Would ${java.home}\lib\ext\jfxrt.jar work in Linux, or is ${java.home}/lib/ext/jfxrt.jar absolutely needed?
 
7:39 AM
@skiwi always use forward slashes, even on Windows. In sh, the backslash is an escape character, not a path separator.
 
@amon Okay, I guess I have learned my lesson there from yesterday and today
 
@amon I saw something like C:\\Users\\…. Escaping the backslashes in paths. Weird shit. Oh, Windows. :/
 
Some funny thing I figured out while running some GUI tests that abort while user input is detected: They always detect user input if running over a RDP
@kleinfreund It looks completely normal to me... As Windows user
 
@kleinfreund That's common in (C-like) programming languages where the backslash starts an escape sequence. Some languages therefore have “raw string literals” without any escapes. In Python: r"C:\foo\bar".
 
My parents are on vacation, so I'm currently working on their Mac. The joy of things working, really.
 
7:46 AM
The cool thing about Continuous Integration is that the servers almost always run on Linux, I develop on Windows, hence they're tested on both systems
 
Hey everyone, btw. :)=
 
Hello @kleinfreund btw
 
@amon Doing more git stuff lately: github.com/jekyll/jekyll/pull/2687
My first big code contribution to a repo. :~)
 
No idea what to do here, the explanation covers more ground than the actual answer
 
@kleinfreund oh wow, that's awesome :)
 
7:49 AM
Doing all that forking/cloning/committing in the CLI.
Thank you, @amon for getting me started on this topic.
 
@kleinfreund Looks good!
And Travis CI is awesome, right?
 
As far as I can tell. I’m not using it personally, but the Jekyll guys do.
It is really helpful for projects like this.
 
Just got mine officially working, yes! :)
I hope I'm going too techy here
but the GUI unit tests need a fresh JVM every time they run, and the default was to reuse the old one, even though it ran sequential
Cost me since friday to figure this out
Had to diagnose the issue, fix the issue and fix the fix of the fix all by myself
And I really need to get a new picture on all of my sites... but need to find a picture where I look good and am not eating an ice cream :P
 
Maybe I should cut a smiley in the middle square of my avatar
The edges are all fancy but the middle is just solid and boring
expaaaand
moooar
Oh yeah you do this to show large avatars, I forgot
 
8:30 AM
Yay, 1.5k rep!
 
gratz ;=)
 
Do I want to use Hibernate for a few database calls?
 
@skiwi depends... maybe you rather want Derby..
if you are bound to using a server either way, I'd suggest you use hibernate though..
but don't go for a server if it's only for hibernate.
 
I'm bound to some database server for sure here, it's got to be always available
Yet Hibernate seems like a real beast to set up
 
8:46 AM
nooo stupid bugs
this warrants an MSE meta post
 
@Pimgd what's the problem?
@skiwi in what respect??
 
@Vogel612 I made a tag wiki edit, now my review keeps blinking (1) yet there's nothing to review
and my OCD hates this
 
@Pimgd what is always the answer? Caching.
 
No, that'd be MY tag edit
in the review queue
 
loool#
well I put an approve on it...
dat OCD edit though..
 
8:50 AM
@Vogel612 I've never used it before and it's just a few database calls to stored procs
 
@skiwi why bother java at all then...
you could prob run them via CLI...
or do you need to process the results??
 
but apparently there's questions about it on MSE already
people don't edit tag wikis enough to care
 
@Vogel612 Need to process them, this is all being ran from inside a server part
 
@skiwi sounds like a hassle...
 
Sounds like something relatively normal to me
The legacy java.sql.* is also pretty horrible though
Hey, my SO is first ranked on google for "java finite stream", while it is about infinite streams
 
9:08 AM
Yay, tag wiki editting bronze badge
 
9:32 AM
Yep, I see no real reason to participate in SO any longer after reading even more of their meta hell
Even open source repos tend to be more helpful than SO once you are reasonable comfortable with the language of choice
 
@skiwi well the SO user base is just waay to large to be effectively moderated...
even the idealistic mods over there have stopped giving a shit..
 
Yeah, it's just a mess
 
1
Q: PHP e-mail sending class design

jacky4I'm working on a class, what will be able to send e-mails for our cutomers. I need to help with review of my classes design. I'm trying to do it to be easy extendable in future. I'm thinking about using dependency injection to inject InputReaderInterface. But is it worth to do it? InputReaderIn...

0
Q: Building tree structure based on flat objects - second follow up

HeslacherThis is a follow up on this question which is a follow up on this question This follow up is created, because the class in question contained something, which didn't do what it should do. Based on the suggestion for the RemoveRootArchiveDefinitions() method of the first follow up I have renamed ...

 
it's like you should prune the whole answer base for all negatively scored answers without upvotes, and block the hell out of the heaviest help-vamps.
 
Great, I just remembered I still had an open issue from last week, why is there no issue tracker... :(
 
9:59 AM
0
Q: Possible CrossSS on link_to

Stefanos.IoannouI run brakeman and came back with this warning: Unsafe model attribute in link_to href near line 42: link_to(Portfolio.find_by_slug(params[:id]).website, url_with_protocol(Portfolio.find_by_slug(params[:id]).website), :target => "_blank") Line 42 is actually: <%= link_to portfolio.website, ur...

 
Why is that that things that rely on external libraries never work?
 
damn I ripped that guy to pieces in his design...
0
A: PHP e-mail sending class design

Vogel612Naming Your names are... I miss the word to describe your naming overall... Either way let's start. Some of your names are good. $smtp, $from, $alias, $mailer and so on. Some of your names need improvement. $reader1 for example.. That reader would be better off as $mailReader or $messageReader ...

 
10:17 AM
java.lang.RuntimeException: java.sql.SQLSyntaxErrorException: Unknown table 'inner_set', it is a temporary table for gods sake
Is it a database driver that's never been tested before?
 
@skiwi no... he just prechecks waaay too seriously..
I take you want to write your own driver then? ;)
 
10:32 AM
@Vogel612 Well... maybe not
I got it in a working state now
 
What did you do?
 
Heavy wizardry.
3
 
btw @CaptainObvious broken code.
 
4
Q: Random 6 to 10 digits number

Govind Singh NagarkotiI am generating a random numerical 6-10 digit password. I need some important reviews of yours. Is it OK or are there some needed modifications? val AB = "0123456789669900" val rnd = new Random() def randomNumericalString(): String = { val len = rnd.nextInt(5) + 5 val sb = new StringBu...

Guys sanity check for me
for (i <- 0 to 9)
Is that 9 iterations or 10 iterations?
 
lol that's scala.... no clue
it looks like 10 iterations though.
0, 1, 2, 3, 4, 5, 6, 7, 8, 9
 
-0? Wth is negative zero?
 
fk
 
@ckuhn203 scala assignment operator..
i <- 0
would be (in most sensible languages):
i = 0;
 
I deleted my answer as he was right and wrong at the same time
 
Oh. Ok. Thanks @Vogel612
 
10:37 AM
His edit, nextInt(6)+5 was wrong
 
Or in R: 0 -> i;
 
His for loop was right though
 
Sensible's the key part I guess
 
@Pimgd it still is a code-only answer...
 
@Vogel612 yes, not much I can do about that, I don't know how the code works. All I found strange was that an edit touched the code, so I went looking for the documentation.
 
10:39 AM
@ckuhn203 I regard languages that need more than one character to describe an assignment as not sensible..
@Pimgd yea there was an edit.. I rejected it because it should have been a comment + downvote for incorrect coding...
 
Yeah. Exactly.
 
as well as languages that use more than a single character to "enter" an object...
 
@Vogel612 I improved it and unchecked it as helpful since it introduced a bug
 
*cough* php *cough*
 
that said my improvement was grammar and removal of said bug so yeaaaah
 
10:41 AM
fine by me...
@Pimgd I just didn't know enough about the subject at hand to do that, but I saw it wasn't correct...
 
That'd be my line
 
I think someone needs to add scala to this wiki. wiki.theory.org/YourLanguageSucks
 
definitely.
 
0
Q: Building tree structure based on flat objects - second follow up

HeslacherThis is a follow up on this question which is a follow up on this question This follow up is created, because the class in question contained something, which didn't do what it should do. Based on the suggestion for the RemoveRootArchiveDefinitions() method of the first follow up I have renamed ...

No idea what else could need improving
I also have the feeling he'll keep going until you tell him it's perfect =D
 
I saw a minor naming thing, but it doesn't justify an answer..
        rootArchiveTreeEntries = CreateRootEntries(localEntries);
        localEntries = GetNonRootArchiveDefinitions(localEntries);
create first and then get...
 
10:44 AM
Do it, he'll accept it and post another follow up
 
meh...
 
=D
 
hi there @MikePennington
oh and nice to see you @Morwenn
 
27 secs to edit yeeeeah new record
 
0
Q: MySQL SELECT from two tables with different situations

CIRCLEI'm trying to select two groups of countries with different situations. SELECT cou.id, cou.title FROM continents con RIGHT OUTER JOIN countries cou ON con.id = cou.continents_id WHERE con.deliver = 1 AND con.active = 1 UNION ALL SELECT cou2....

 
10:46 AM
@Vogel612 You took advantage of my abscence to beat me reputation-wise :(
 
@Morwenn well you were out cold for a while, and I had a race with Marc
didn't even go that fast...
I am kinda evening out right now..
 
@Vogel612 Haha. It's nice to see that some of you are still as motivated as ever :p
 
It feels like I either saw all shit, or it's way beyond my comprehension..
 
I know what you mean.
 
for the first I am not motivated to write an answer and the second...
well, can't criticise what you don't understand..
additionally I seem to have less and less time for CR overall..
 
10:48 AM
That's one of the reasons I left for a while. I was tired of always repeating the same things, but not good enough to understand some other things.
 
it's kinda back to asking some questions, to get a grasp of higher level stuff ;)
 
you might want to add that you got val and var keywords and that types are specified after the variable. with a COLON.
and they are optional
bleargh
 
@Vogel612 I fixed the issues I was having
 
11:06 AM
@skiwi review incoming?
 
Review on what?
 
on your fixed code ;)
darn equals sign slipping in everywhere..
 
There's not that much to review I'm afraid
It's working at last
This is why I like encapsulation:
@Override
public void baseAccept(final Path path) {
    @SuppressWarnings("unchecked")
    List<Organization> templateOrganizations =
        FileUtils.readSerializableObjectFromFile(path.resolve(Config.FILENAME_ORGANIZATION_TEMPLATE), List.class);
    LOGGER.info("Searching for templates using the following organizations: " + templateOrganizations);

    Connection connection = Database.getDefaultConnection();
    List<Integer> templateIds = Database.selectTemplateIdsWithOrganizations(connection, templateOrganizations);
 
You return a List<SerializableObject> from the FileUtils#readSerializableObjectFromFile?
 
eww
readSingular returns plural
bad skiwi
 
11:14 AM
 public static <T> <T implements Collection<Serializable>> readSerializableObjectFromFile(Path path, Class<T> clazz);
??
 
@Vogel612 In this it returns a raw List
This is the signature:
public static <T, C extends Class<T>> T readSerializableObjectFromFile(final Path path, final C clazz) {
    Objects.requireNonNull(path);
    Objects.requireNonNull(clazz);
    try (ObjectInputStream objectInputStream = new ObjectInputStream(Files.newInputStream(path))) {
        return clazz.cast(objectInputStream.readObject());
    } catch (IOException ex) {
        throw new UncheckedIOException(ex);
    } catch (ClassNotFoundException ex) {
        throw new RuntimeException(ex);
    }
}
 
That's the method, not the signature
Signatures are like this
 
true
 
not that the difference matters for this case..
 
public static <T, C extends Class<T>> T readSerializableObjectFromFile(final Path path, final C clazz)
 
11:17 AM
if it was 100 lines I wouldn't have copied all ;)
 
@skiwi if it was 100 lines, you'd have it refactored already.
 
I don't like it
 
@Vogel612 Stargreed
 
I'd personally add a newline after Objects.requireNonNull(clazz);
 
"FromFile" but it takes a path
 
11:18 AM
additionally I'd have a default clazz to return, just in case.
 
for this small of a method, I'm unsure, I've tried both ways actually
@Pimgd Java legacy
 
@skiwi the meme lives on ;)
 
additionally, the name for the second parameter
why is it clazz
doesn't it mean something
 
@Pimgd class is a reserved keyword..
 
That's not the answer I'm looking for
 
11:20 AM
it is...
 
would you name it class then?
 
you pass in a class to cast your result to.
 
That's the type
 
I can't...
 
returnType, then
 
11:21 AM
no it isn't
actually the returnType would be Class<?>
and you'd have to pass in X.class either way.
 
I'd rename clazz to returnType
Object object constructs don't help
and neither does Class clazz
 
but it's C clazz.
and that's a different thing..
 
Sometimes you're working at such an abstract layer that you have no choice
 
because your method return type relies on C.
where C is actually <C extends Object>
but as soon as you pass in something other than Object you get integrated return type checking.
 
public static <T, C extends Class<T>> T readSerializableObjectFromFile(final Path path, final C clazz) -> public static <T, C extends Class<T>> T readSerializableObjectFromFile(final Path path, final C returnType)
that's what I'm suggesting
just so you know
 
11:24 AM
It actually isn't even the return type..
it's just specified, that C extends the returnType,.
 
Using returnType won't help anything if 99% of the Java population uses clazz for this construct
 
@skiwi how did you manage to cast to an interface btw...
 
@Vogel612 Is it some kind of black magic?
 
This seems off-topic.
7
Q: Comparing Color objects with ==

Stephen CThis example comes from a code snippet posted on Stack Overflow: private double brickVal(Color c) { if (c == Color.RED) { return 10.0; } else if (c == Color.ORANGE) { return 8.0; } else if (c == Color.YELLOW) { return 6.0; } else if (c == Color.GREEN) { ...

 
`List<Organization> templateOrganizations =
FileUtils.readSerializableObjectFromFile(path.resolve(Config.FILENAME_ORGANIZATION_TEMPLATE), List.class);`
how does that even work then
you put list in and list comes out
 
11:26 AM
@Vogel612 List<String> list = (List<String>)new ArrayList<String>(); this is also completely legal
 
@Pimgd List goes in, list comes out. You can't explain that.
 
@skiwi isn't that implicitly given??
ooooohh
 
@Pimgd List.class is really a Class<List>, and it then returns an object of type List
 
@skiwi so how is it not better to rename it as returnType then? and I mean that as string literal, not some fancy <insert stuff here>
 
@Pimgd it's misleading.
 
11:28 AM
@Vogel612 In what way
 
and everybody else names it clazz, to make sure you don't think it's a variable later on..
because it's not the actual returnType.,
@nhgrif it is... VTC'd
how did this not catch downvotes??
 
It's 3 years old
 
you mean stuff like that was on topic then?
 
throw new PleaseCleanUpException();
 
Maybe. But certainly things were less strict then.
 
11:29 AM
I've only been here for less than a year, no idea
but things were also a lot less strict on SO back then
 
But it still needs to be closed because it just got a new answer, which means new users see this off-topic question open, and think they can ask a similar one.
 
Why is it off-topic?
Because it asks for best-practice?
Would removing the best-practice and instead just ask if correct make the question valid?
... no, because it isn't his code
Good job Pim
Go back to reading the rules
AGAIN AND AGAIN UNTIL YOU KNOW THEM BY HEART =D
 
I think an issue we are having with CR nevertheless is that we occasionally do get questions that contain on-topic code, but are asked in an off-topic way.
3
 
That'd be very true
hmm I gotta post on meta with something because I'm not sure
 
We've also gotten more pedantic and fanatical about killing and dismembering closing off-topic questions.
Greetings, Programs.
 
11:36 AM
I'm not sure why the "not your code" rule exists exactly, but it does.
And if we think that rule should be changed, we change it on the meta--not by leaving open questions that should be closed.
2
 
That rule is there to invest the asker in the question
 
Okay, but why do we have to invest the asker in the question?
 
@Donald.McLean Greetings, Programmer.
 
It's because questions apparently have very little relevance to anyone besides the asker and anyone getting rep from answering it.
 
@Donald.McLean Greetings user.
 
11:38 AM
@nhgrif It's also got to do with licensing
 
There can be code that's free for me to post without it being code I own.
 
While you can certainly post in code that has a free license without violating it, it might be confusing
 
For example, anything posted on SO or CR.
And SO doesn't have this rule.
 
@nhgrif Stargreed.
 
I think @skiwi is right - licensing could be very confusing.
 
11:40 AM
Why? It's not that confusing on SO, is it?
 
But what benefit is there to having code reviewed that you didn't write? What could an OP learn from that?
 
On SO, anyone can post anything and it is up to the owner of the license to contact SO about having it removed.
It's not about the benefit of the OP, that's my point. That's the primary difference between here and SO.
A question asked 3 years ago on SO is still beneficial to me today even if I had no part in asking or answering it.
 
@nhgrif Fair point.
 
Questions asked last week on CR aren't really relevant any more. The OP already has his answer and I already have my rep from answering.
 
I've found many reviews here on code that wasn't mine insightful and educational.
 
11:42 AM
That we only allow code you own and that nothing gets closed as duplicates are two sides of the same problem.
 
I wouldn't agree that questions asked last week aren't relevant anymore, but I don't have time to argue my side of that right now.
 
@nhgrif I still have a backlog of about 100 CR questions that I'm still intending to study.
2
 
I have to leave for work right now, but I'd like this conversation to continue on the meta.
 
Absolutely.
C y'all later.
 
I'm clearing about 10 of those questions on a good day, and opening up 10 new ones.
 
11:48 AM
0
Q: Simple shared pointer in c++

TalzI wrote a simple shared pointer, which i think work pretty well. I would like to see your review of it. This is the header file #pragma once #include <algorithm> template <class T> class SharedPointer { private: T* ptr; int* counter; void swapp(SharedPointer& first, SharedPointer&...

0
Q: Run a WCF server in a background thread on a console app

makerofthings7This app is a P2P client running on Windows using WCF.* I'm spawning the WCF service using Task<T>. The WCF service can be canceled using a Monitor.Wait or, if I get it working, a cancellation token. My biggest question here is how do I "keep the server running" and tell it to cancel, etc? Mon...

 
@CaptainObvious sounds like broken code..
 

« first day (457 days earlier)      last day (3551 days later) »