« first day (267 days earlier)      last day (2500 days later) » 

12:03 AM
@Jamal Did you choose to mark it as "disputed" or was that an automatic effect of having 1 actual flag and 5 invalid flags?
@SimonAndréForsberg: That's automatic, due to the invalid flags that were raised. Moderators have no power over that.
Interesting that the invalid flag I put on Malachi's flag to this answer was marked as "helpful"
Q: Optimizing numpy gmean calculation

Slater TyranusI'm trying to come up with an alternative to the gmean implementation in scipy, because it is awkwardly slow. To that end I've been looking into alternate calculation methods and implementing them in numpy. My only issue is that a method that in the two methods I'm implementing, the one that I fe...

Q: Using keywords async/await in database queries (Windows Phone 8)

AlexandrI have a local database in Windows Phone 8 app. The app includes a lot of queries to the database and I don't want bad effect on the responsiveness of UI. For example I have a table of users and method to get a user from database by id. Current variant public class CacheDataContext : DataCont...

A: Repository pattern review, question about when dispose the Context

ChrisW My question is about why I am not embracing each method implementation with a using and disposing the Context as soon as the query is done. Some of my methods, as Find and GetAll return collections. I would want to be able to iterate through them using LINQ, only this is not possible if the ...

A: MVP of Game of Life in C#

palacsintJust a few random notes: Instead of i and j the variables could be called as rowNumber and columnNumber. cellGrid[j, i, 0] 0 here is a magic number. A named constant would be better. Comments like this are unnecessary: cell.BackColor = Color.White; // Color It says nothing more than the ...

A: Refactoring asynchronous JS pre-rendering code

Dan AbramovTwo more points to complement konijn's answer to my question: I'm moving from window.st.* madness to using require.js with Almond (I wish I did this before); Instead of hand-rolled cancellation mechanism, I'm moving from Q to bluebird which already supports opt-in cancellation.

A: Rounding a date to a dynamic unit of time, using only JDK 6

palacsintJust a few random notes: Comments like this are unnecessary: * @param date * @param unit It says nothing more than the code already does, it's rather noise. (Clean Code by Robert C. Martin: Chapter 4: Comments, Noise Comments) I'd split the unit test to smaller test methods. Too many asser...

@SimonAndréForsberg I'm done with my answer:
A: MVP of Game of Life in C#

ChrisWI don't see why depth is 3: you're only using 2. Instead of storing cell-state as an array of strings, define a class (or perhaps a struct): enum State { Alive, Dead } class CellState { internal State State { get; set; } internal int Neighbours { get; set; } internal CellSta...

12:11 AM
@SimonAndréForsberg: It might just be different because I dismissed it as helpful. I just have to dismiss flags appropriately, and the system will do whatever it does.
@ChrisW: With 5 votes on the kNN answer, you may get Necromancer. :-) The badge description doesn't mention a first answer criterion.
A: How can I make my ant simulation faster?

palacsintPEP-8 suggest the following about function names: Function names should be lowercase, with words separated by underscores as necessary to improve readability. check_distance_between_ants_and_food would follow this guidance and would be easier to read.

@ChrisW I only have one thing to say to that: @lol.upvote applied.
A: Specific PHP Data Access Class review

palacsintJust a few random notes: Correct me if I'm wrong but if you throw an exception the statements after the throw statements won't be run. So here return FALSE never runs, therefore it's unnecessary: throw new Exception('Database connection not available.'); return FALSE; The query_db function co...

Looks like an old 10K-er has awakened.
And he's editing again. :-)
@ChrisW lol.upvoted (@SimonAndréForsberg that's my line!)
12:15 AM
@lol.upvote Maybe he realized that 200 is caching up with him. (And I think that means both @200_success specifically, and 200 users generally)
haha maybe!
@Jamal I did! Spooky! And the OP thought it was helpful/acceptable.
I'm gone, was just flyin' by :)
@ChrisW: I'm very glad you got the accept, too. You did, after all, answer his main question. Congrats!
Just remembered that three letters is enough, @lol
@Jamal So you can dismiss as helpful, without taking any action?
12:19 AM
@SimonAndréForsberg: Yes. Some automatic actions (usually closing or deleting) clears it right away, but manual dismissal is always an option.
12:56 AM
OK, now I believe my classes are well-documented, now I just gotta write an explanation of "the big picture", i.e. what these classes are meant for..
@Jamal He seems to preface all his answers with "A few random notes", and then not do a thorough review. You said (or joked?) it would be your policy too to not do a thorough review. I think that's a bit :-(
@ChrisW: I was serious when I mentioned that, but it's a personal decision. As long as it constitutes a review, it should be okay.
Disappointing to the OP maybe.
Q: Help defining a function for Newton's Method in MATLAB

jbtarasoffI am a beginner to coding and I need to write a function.m file. I am having trouble defining the function $f(theta) = ((r^2)/2)*((2*pi*p)-(theta - sin(theta)*p))$ where radius $r = 30cm$ and density $p = 0.82 grams per cm^3$ So far, I have written: function y = function(theta) r = 0...

^^ CVA
I wonder if I at any point in the future will run out of close-votes on Code Review. In that case I would have to use my theoretical close-votes.
1:05 AM
@SimonAndréForsberg: Probably unlikely at this level of activity, but if it does happen, it just takes someone else to vote on it to put it in the queue.
I need to leave for a bit, but I'll be back sometime. Later!
I <3 Unit-tests
You have no idea how good it is to work with crap for a week, and then do some real coding on the weekend.
1:20 AM
Hey all.
Hi monkey!
Why are you still awake?
Because it's Sunday tomorrow, I suppose.
And I'm cooooooooooooooding
I have a full day's worth of stuff to catch up on .... more than that.... I see there have been new faces in here.
Yup, feels like Code Review is growing a bit every day.
1:23 AM
What are you working on that has you so excited?
Preparing code for review
And right now: Debugging an infinite loop. Which I have just found out why it happens
Ahh . something Java'ish?
Although it's not directly related to the code I wanted reviewed, I just can't let an infinite loop stay.
Of course it's Java, is there anything else?
Well, there is COBOL
Well, not in my knowledge base :)
Even though I know several languages, COBOL is one of those I don't know.
1:30 AM
I have been sick for the past day.... running a fever. Feeling like crap... feels good to be back online...
but man, even this is tiring...
Q: Rich Text on multiple iFrames

ElitisHaving so many loops running concurrently obviously can't be good, and the code seems overly complicated. There has to be a simpler, more efficient way to Turn the designMode of all iFrames on Find the three "buttons" ('a' link elements) - that when clicked affect its corresponding iFrame - dep...

Oops. Plus and minus is apparently not the same thing.
@rolfl Even monkeys need to rest sometimes.
Got to bed at 9 last night, woke up at 10 this morning.... and slept more thjrough the day.....
It's 8:35 now, and i'm about ready for sleep again.
Thank you a lot for your help! Sorry about the format. still learning. is there an MLA style guide equivalent for code? — Reverend_Dude 35 mins ago
@rolfl If you're tired, you're tired :) Go to sleep, monkey!
1:38 AM
Indeed.... jut have some votes to cast.
Or get some exercise? Or a juice?
Finished after 87.149 seconds
Runs: 60/60 (3 ignored) Errors: 0 Failures: 0
I can live with that, good night!
@rolfl I hope you'll get better, monkey!
@SimonAndréForsberg I don't like unit tests: stackoverflow.com/questions/856115/… I prefer automated system tests.
2:20 AM
Q: PHP Authentication Security

ndm13Can someone look over this? This is the entire authentication file. It's referenced at the beginning of all my catalog editing files to make sure only the specified user is logged in. I want to make sure it's secure. Thanks in advance! <?php // pageauth.php // Asks for a username a...

2 hours later…
4:49 AM
Q: How to make builder pattern thread safe in the multithreading environment?

user2809564I am working on a project in which I need to have synchronous and asynchronous method of my java client. Some customer will call synchronous and some customer will call asynchronous method of my java client depending on there requirement. Below is my java client which has synchronous and asynchr...

3 hours later…
7:52 AM
Q: How to avoid GSON deserialization if I am aware of error response from the server?

user2809564I am working on a project in which I am making a call to one of my servers using RestTemplate which is running a restful service and getting the response back from them. The response that I will be getting from my server can be either of these error responses (that's all I have for error respon...

Good morning, folks.
8:24 AM
Q: Basic TCP server application in C# using async / await

TobiasI'm trying to get started with network and parallell programming in C#. I'm almost a complete novice in programming so im looking for feedback on a small script im writing. The goal of the programming if to: 1. Accept incomming connections, store them as users which are sent into Rooms. Users ...

1 hour later…
9:46 AM
Q: Flatten an array - loop or reduce?

Erel Segal HaleviPROBLEM: Concat all sub-arrays of a given array. EXAMPLE INPUT: [[0, 1], [2, 3], [4, 5]] EXAMPLE OUTPUT: [0, 1, 2, 3, 4, 5] SOLUTION A - use a loop: var flattened=[]; for (var i=0; i<input.length; ++i) { var current = input[i]; for (var j=0; j<current.length; ++j) flattened....

Q: code review request for logic and design for my first git command

sanThis is my first attempt a for git command i can use to push the latest commit and email the diff. import argparse import subprocess import os import re import send import sys class INVALIDEMAIL(Exception): pass def main(): parser = argparse.ArgumentParser(prog='ipush', description='U...

3 hours later…
12:29 PM
@ChrisW Yeah, OK... "unit tests" isn't really what I am doing. I more use "package tests" perhaps. Making sure that a bunch of classes behave correctly together. I didn't think of the difference.
Q: how should the ideal folders be for MVC architectural web applications?

Serdar BuyuktemizI'm thinking on folder structure for small size web applications, And wanted to hear other peoples ideas. I come to this... What is missing for you? What is much for you? What can be named better?

I think, it's offtopic @SimonAndréForsberg
It is. I already close-voted on it.
1:20 PM
@SimonAndréForsberg What do you think about adding the "Jekyll" tag to this question? codereview.stackexchange.com/questions/1268/…
It doesn't exist. That's why I'm asking.
@kleinfreund since the post is three years old and the tag doesn't exists, there's absolutely no need to add a tag to it.
Also never heard about Jekyll before. And it is only mentioned in one other post, an answer, across entire CR.
Alright. But how could this be handled in the future? There will be a need for this tag as the community grows. So if the demand is high enough, someone is going to add the tag, right?
If someone adds the jekyll tag to a question some day in the future then we'll see after a while if the tag makes sense or not.
2:08 PM
Q: Optimize a synchronization with remote web service

Sebastian WrambaI am writing a method to synchronize the local Core Data entities with a remote web service (in this case Parse.com). To update changed or created objects, I fetch all where the "updatedAt" date property is larger than the last local sync date. So far, so good. But I am struggling with the dele...

2:27 PM
Q: Allow changing the properties of a mutable controller in a thread safe way

dialerI have a (control engineering) controller. These controllers usually need several parameters to do their thing, and in my application it is desirable that these parameters can be changed while the controller is running - in a thread safe and well defined manner. I came up with this design (extre...

2:52 PM
Q: Javascript, number format

VjyWhat’s the best way to format a number? If decimal is less than 2 digits, add zero to make it 2 decimals, if more than 4, truncate to 4 decimals, if 3 decimals, keep it to 3 decimals 14 => 14.00 14.1 => 14.10 14.123 => 14.123 14.12347 => 14.1234 I don't want rounding to happen if (number !...

3:16 PM
Q: Spherical coordinate vector (based on OGRE3D graphic engine maths code)

KlaimIn my project I need to position things around other things in a spherical way, so I figured I needed a spherical coordinate representation. I'm using Ogre3D graphic rendering engine which provide some maths constructs which at the moment I use everywhere in my project. The source code of Ogre is...

3:47 PM
Q: A package for sort algorithms - v4

www.arcmarks.comAddressed both issues in this codereview post. Cached an expression and commented that removing a function call would increase performance but chose not to do so to keep the code DRY. This is just for learning as internal sort algorithms will be faster. This is the last revision for a good lon...

4:37 PM
Q: Java method - levels of abstraction

prometh07Robert C. Martin in his Clean code states that functions should do only one thing and one should not mix different levels of abstraction. So I started wondering whether the code below meets these requirements (I assume the answer is negative). Which one is better? public void run() { isRunni...

5:08 PM
Q: Using a BaseController in MVC asp.net to reuse the repository

Stone Temple AviatorsI have a repository class that impliments a repository Interface. In my Controllers I want a way to access the repository without creating constructors each time in the controller. So now all my Controllers have to do is inherit from Base. Any pitfalls to this, or how I can write it differently. ...

5:26 PM
Q: Option class, needs a portable exception

Walle CyrilI created a class named Options. It works fine but not not with Python 2. And I want it to work on both Python 2 and 3. The problem is identified: FileNotFoundError doesn t exist in Python 2. But if I use IOError it doesn t work in Python 3 Changed in version 3.3: EnvironmentError, IOError, Wind...

Q: Understanding basic code profiling

ComputernerdI am trying to learn about profiling and followed this guide hence i tried profiling the following piece of code on MS VS 2010 on windows 7 . I am not sure if this is the correct place to ask this #include <iostream> using namespace std; int add(int,int); int main() { int x [100]; for ...

6:17 PM
Q: A package for communications between packages - v3 - final

www.arcmarks.comUpdate to this CR Post. Used a more concise expression for adding an event. Decided against style change. Added comments. /*************************************************************************************************** **COMMS The goal is to reduce dependencies between packages by providi...

Q: A library/stystem for package development

www.arcmarks.comThis is the library/system I use to develop code for use in my application. Or better the comments describing it, with 3 example packages. Here are 3 of the packages I've developed so far. A package for utility methods - v2 - final A package for communications between packages - v3 - final A...

The use is very limited you say? Our Area 51 stats beg to differ. — Simon André Forsberg 18 secs ago
6:36 PM
just a user thinking that Code Review wasn't very useful since we don't help in fixing errors.
That's not the purpose of this site. That's SO.
Yet, he has 22K rep on SO. Why doesn't he... ask this over there?
Good evening everyone, btw.
Q: jQuery + PHP Dynamically Created Content

iamgraemeI am working on an ecommerce site and the products are being dynamically generated with foreach loop, within each product there are product options, when the product option is selected I my intended behaviour is for the price to update. I have this working, however jQuery is updating every instan...

It's just past noon in the good ol' US of A. :-)
6:42 PM
@konijn has his work cut out for him with @www.arcmarks.com running around here posting 5 posts every day.... lol
@Jamal I'm wondering the same thing, I'm adding another comment...
Jekyl tag?
It states in our help center that you should Don't ask about "How to add a feature to or solve a problem with your code". I see you are a common visitor to Stack Overflow, so you should know that Stack Overflow is the site for fixing problems in code. What are you expecting from us? — Simon André Forsberg 33 secs ago
@Malachi: This one can be closed: codereview.stackexchange.com/questions/40110/…. Apparently he forgot to include the code...
His questions are basically like "Have some code. Make it better.". :/
6:55 PM
Okay, he deleted it. Looks like there was no code after all.
How are you guys doing? Everything alright?
Q: Efficient mixing of sync and async methods within a single method?

WillOkay, it sounds odd, but the code is very simple and explains the situation well. public async Task SynchronousAsynchronousOperation() { var state = await GetInitialState(); UpdateInitialStateToFinalState(state); await SaveFinalState(state); } I'm encountering this pattern more a...

7:10 PM
@kleinfreund: Yes! Unfortunately, it's Sunday, which means school tomorrow. On the bright side, I'm gonna take a look at some fencing gear today that I may buy.
Sunday is nice. I guess it's the monday which sucks? :p
That, too. Not looking forward to it.
Added a link to Code Review to my website... Obviously, since I already linked to SO.
See you guys later. Sunday ritual: Watching a German crime series.
@kleinfreund should send me a link to your site one of these days.
7:23 PM
@Malachi alternatively, you could view his profile which happens to have an entry in the “website” field.
Q: Type safe program uniform manipulation in OpenGL

mebobI've made an attempt at writing class wrappers around basic OpenGL objects to make managing them easier and more intuitive. Writing a generic one for program uniforms proved to require a little bit more effort than the other objects, due to there being different OpenGL functions for manipulating ...

I'm reading the German on your website, and I'm surprised I can still read a good amount of it (I took three years of it in high school).
^^ me too :)
Well look who woke up from the... downvotes? @lol
7:34 PM
Well hello/bye, @Malachi!
So, what's going on over here?
I'm considering disconnecting and preparing for another day of work. The code I wanted to have reviewed will have to wait for next week.
He has a 'real' job, apparently.... needs his beauty sleep
Hey @rolfl! Haven't seen you in a while!
7:39 PM
Been (still am) sick.
I think you've caught up with @syb0rg
8:40 pm here
You got me at one of my half-waking moments
@SimonAndréForsberg so have you found out what you are?
(looking at starred posts and still lol'ing at that one)
Q: Efficient mixing of sync and async methods within a single method?

WillOkay, it sounds odd, but the code is very simple and explains the situation well. public async Task SynchronousAsynchronousOperation() { var state = await GetInitialState(); UpdateInitialStateToFinalState(state); await SaveFinalState(state); } I'm encountering this pattern more a...

I think this is a better fit for Programmers
It's sample code
I'm a creator. That's what I am. I create things.
7:42 PM
I'm a bad-ass, sick monkey! That's what I am!
Oh gosh. So the next thing you're coding will include a Pray() method too?
@rolfl we knew you were some sick monkey
Grrr. freakin' VPN client won't connect. Can't work. ...is that a sign?
@lol.upvote Actually, he's almost caught up with me...
I have been voting for answers too...
@rolfl You have 537 Q votes, 16 votes spent; he has 534 Q votes, 28 votes spent.
Just keep voting and he'll never catch up!
@lol.upvote Me? Well, even though I am a Christian, I doubt my code will include a pray-method.
I wonder if your MSO bounty will have been paid in the air
7:47 PM
@lol.upvote - just did the math... I have 24 votes left today.... and in 4:15 I can cast another 40, that's 64 votes.... and I currently have 537.
I can do it before I go to bed.
That's IFF I only vote questions.
@rolfl I'm sure you can do that
@lol.upvote We'll see, in worst case I guess I'll just have to put a bounty on it again at a later point in time when I have more MSO rep (which is said to not be very hard to earn)
@rolfl You're sick, don't you have better things to care about than beating @syb0rg in a voting contest?
11 votes on my last MSO answer. Yup. Pretty easy!
@SimonAndréForsberg what's more important than voting?
@lol.upvote Being healthy, for one thing.
I'm in bed, with a cup of water, and a laptop. I expect to be asleep again soon (woke up about a half-hour ago).
7:51 PM
We'll know @rolfl is asleep when he posts a message like..
oewjrfgofdshgoa;sdiohr;e92rhqgt a
This is part of the keep me sane process
(Been in bed since Friday night, basically).
(I... think I gave that poison banana to the wrong monkey...)
> This question appears to be off-topic because it is about short "example" code, not asking for actual code to be peer reviewed. It could be a better fit for Programmers.SE, or could be edited to include actual code to be reviewed.
^^ post?
Q: Efficient mixing of sync and async methods within a single method?

WillOkay, it sounds odd, but the code is very simple and explains the situation well. public async Task SynchronousAsynchronousOperation() { var state = await GetInitialState(); UpdateInitialStateToFinalState(state); await SaveFinalState(state); } I'm encountering this pattern more a...

Or am I becoming a "close-vote nazi"?
@lol.upvote Technically, you're right so I'm also close-voting.
7:58 PM
@SimonAndréForsberg and non-technically?
@lol.upvote You're also right.
ooh. Say it again.
@Jamal The factorial of binary number 01010100101011010101 ? Now you have to calculate that, in binary.
@lol.upvote Sure, next time you're right.
8:00 PM
Do we have a consensus here? Is there a meta post about that kind of questions? They're among the "edge cases" of reviewable code questions we get.. ought to be FAQ'd
^^ FAQ'd doesn't sound too nice
@lol.upvote: You may also post your own FAQ entry with a self-answer.
@lol.upvote I think there is a meta post about it somewhere.
Close votes got that response:
@lol.upvote it is actual code, just obfuscated. — Will 1 min ago
> Please note, the sample code is actual code, just with the names replaced. Pinkie swears.
8:17 PM
@SimonAndréForsberg I don't think he got the theoretical joke :)
It would be nice if he reviewed some posts over here though, Will is a great StackOverflow critter, it's nice to see SO'ers around here.
Don't get me wrong: it is a nice question, well formulated and all - it's just I find it falls in the high-level architecture and design questions category, which has been off-topic since day 1. To be made on-topic you would have to include the methods you're calling, as it stands it's too specifically focused on async/await, leaving very little room for many answers /"reviews" as we call 'em here. CR is Q&A, in its own special way :) — lol.upvote 1 min ago
@lol.upvote He probably didn't, but it was fun to make it anyway :)
I laughed :)
Good, then I have done my job :)
I'll say good night for now, see you next week (or later this week, depending on if a Sunday is the first or last day of the week for you)
Next week would be in 7 days :)
See ya!
8:46 PM
Hello all!
Hey! Look who's here!!
A: How can I improve this version of the board game Mastermind?

FlambinoThe first thing I notice is that you're "manually" handling both color and position. This isn't actually necessary if you set everything up using simple arrays. An array is, by definition, an indexed list of values. So if you use a simple array for your code and the pegs, then positions are the ...

First the fencing vendor thought I was the loading crew, then he said a mask would cost $81, cash only...
A: php home-grown web service - need help with design, robustness

bumperboxThere are some big holes in your security Authenticate the data source. (Is it a legitimate source, username/password/etc) Sanitize the user data. Check $trackCols against a list of valid column names you are expecting, to stop me doing things like I have below. $valid_cols = array('id', 'u...

A: PHP Authentication Security

bumperboxBasic authentication is very basic. It is not really designed to allow responses, such as Wrong Username/Wrong Password. If a login attempt fails it will prompt you for the username/password again and again, (usually the browsers allow 3 attempts before failing) Once the login fails you get 1 er...

A: How to make builder pattern thread safe in the multithreading environment?

ChrisWueIf I haven't missed anything then ClientKey should be thread safe. Once you have build the ClientKey object, the parameterMap is only ever read and never modified. However it relies on the fact that no malicious or buggy client isn't trying to modify in the meantime. Therefor I would consider c...

A: Specific PHP Data Access Class review

bumperbox I've been researching when to use self:: and $this-> and I'd like to know if I'm using those right. self:: is for referencing static variables, etc $this-> is for dynamic variables Eg your constants are static so self::ASSOC_ARRAY_RETURN_METHOD is correct Whereas calling a method from ...

A: Minimal Game of Life in C#

palacsintJust a few random notes: Instead of i and j the variables could be called as rowNumber and columnNumber. Update for Thomas's comment: Reading (and understanding) code usually takes time but it's usually not because of long variable or method names. I'd not optimize for character number. There ...

A: What might be another way to test if int is 32 bits wide at compile time?

MassimilianoTo check if the fundamental type int is 32 bits wide I would do the following: #include<limits> #include<cstdint> static_assert( std::numeric_limits<int>::max() == std::numeric_limits<int32_t>::max() , "int is not 32 bits wide"); which should be (to the best of my understanding) safer than wh...

A: How to avoid GSON deserialization if I am aware of error response from the server?

ChrisWueIf you have indeed identified the json deserialization to be a performance problem (by profiling it) then you can Try using a different json serializer (GSon was reported at least in the past to be a fair bit slower than for example Jackson) Don't deserialize and check the string manually. F...

Am I the only one that can't see GSON without thinking "WTF"?
I almost edited the title as a typo => "JSON"
A: Improve page-specific CSS for different color schemes

kleinfreundSome days passed and I feel like I should share the changes I have made so far. Naming I started using page names instead of color names on classes and variables. This leaves me with the benefit of being able to change the color scheme of an entire page only by changing the value of the color v...

^^ Nicely formatted non-voted answer here
A: Tabulate text with javascript

200_successI recommend splitting your function into a DOM-and-event-handling function and a text-analysis function. function alignTextColumns( text, delimiter ) { … } button.addEventListener( 'click' , function( event ) { output.value = alignTextColumns( editor.value, token.value ); //Make su...

A: Flatten an array - loop or reduce?

AmmarHere is the performance test for these two and couple more approaches (one suggested by @elclanrs in the comments). The performance differences will vary significantly across different browsers, and even different version on same browser, as browser these days try to optimize javascript very agg...

A: Minimal Game of Life in C#

ChrisWYou defined depth as 3, but, you're only using 2 strings (one for the alive-or-dead, and the second for the neighbours-count). Instead of storing cell-state as an array of strings, define a class (or perhaps a struct): enum State { Alive, Dead } class CellState { internal State Stat...

A: Monopoly game cards

EltonAt the start cardCount = { chest: [0], chance: [0]}; Create Cards function createCards(){ cards = { chance: [ { title: 'Advance to go', type: 'move', position: 40 }, { title: "Advance to London", type: "m...

I'm back. ;)
A: Monopoly game cards

200_successCard representation I offer three important tips to improve the representation of the cards: The draw-a-card-from-the-deck functions should have nothing to do with updating balances, moving pieces, etc. (In technical terms, chanceCard() and chestCard() violate the Single Responsibility Princi...

Welcome back @kleinfreund
8:53 PM
Hello @kleinfreund
A: Read text from stream char by char

Jack P.Your first F# code isn't too bad. I've made some small simplifications to streamline your code a bit and take advantage of some built-in F# functions: type internal CsvReader(source : Stream) = // input stream let stream = source // reader let mutable reader : StreamReader = n...

Are you new?
Hello everyone. :)
A: Removing unnecessary floats, height, widths

kleinfreundHTML: For prototyping, you should include the # for links to actually trigger link behavior in browsers: <a href="#">Link</a> Instead of placing <span>&gt;&gt;</span> in your HTML, you should use… CSS: …the :after pseudo element: .rmLink:after { /* puts a space and two `&gt;` after rmL...

Or have we just never met?
8:53 PM
Yes, I'm quite new to CR.
@syb0rg you've been away for too long!
Plus we never met. But that's just a formality I guess?
A: Are my forms a danger towards code injection?

Liam SorsbyThe Short answer is yes you are vulnerable to injection. XSS to be precise which you can read more about here https://www.owasp.org/index.php/XSS_(Cross_Site_Scripting)_Prevention_Cheat_Sheet Explaination: All user input should be sanatized for example: if you input <script>alert("This will al...

I guess.
ok I'm done with the answers feed :)
8:53 PM
@lol.upvote I agree. It's been way too long.
Only because I answered my own question, does it mean I need to accept it?
@kleinfreund You should. It helps out the CR site stats.
@kleinfreund you may accept it (I think there's a delay), or wait for more answers to come - you decide!
@kleinfreund I would go through all of your answers and up-vote them, but myself and rolfl are having a contest to try to get a badge.
But yeah like the robot said, try to put a checkmark on every question you ask!
8:55 PM
That makes sense. I think I wait a day or two and accept it. I still can pass the check mark to another answer if it's better.
@lol.upvote I would not leave it unaccepted of course. I was just asking in the direction of getting a few extra answers.
@syb0rg Just go on with your contest. If my answers deserve upvotes, they will get it. I'm not in a hurry.
@kleinfreund You'll get my up-votes soon enough.
Top voter this year.
@kleinfreund how was the “Tatort”?
Ah ;) It was okay. Not really bad nor good.
I'm watching it every Sunday with my parents. xD
I'm gone, see y'all later!
@lol.upvote Bye!
9:07 PM
@syb0rg feel free to upvote meta-answers here:
A: How to train your growing community to self-moderate?

retailcoderHow active is your chatroom? This may sound like a weird answer, but on Code Review we managed to get a core nucleus into the main chatroom. With the @StackExchange bot posting questions (and ideally answers too), it's very easy for everyone to spot off-topic questions, and, with an answers feed...

Oops I meant here:
Q: How to train your growing community to self-moderate?

RaphaelTwo years ago I accepted the post of pro-tem moderators on Computer Science. At that time, and that's true for any new beta SE site, there were little to no users with enough reputation to moderate. So, what did we do? Edit, close, migrate, whatever the situation called for. I used to read, edit...

@lol.upvote Done, I like the graphs and all!
@lol.upvote Also, why did you change your name?
I'm late, but goodnight @lol.upvote
Q: fontawesome icons not loading when placed in a combined css file

Nazeer BhamjiI am using Joomla 2.5 with a ready made template based on the T3 framework. I have tested this on Firefox but not other browsers. I am using scriptmerge to combine css files and have managed to get most of it working. The only problem is fontawesome icons which I cannot get to work. Without com...

Q: VLC media player daemon

JB0x2D1I'm looking for bugs, ways to make it more portable or standardized, improvements of any kind. Seems to do what it is supposed to on my Ubuntu 12.04 PC. /* VLC-Watchdog * * A fix for stopped VLC Media Player inhibiting the power management * daemon and preventing screen saver and/or monitor ...

Yeah, what SE said (the first one).
9:18 PM
Q: Review on a PHP login/authentication system

Marcus MøllerI am currently working on a small website for my scuba diving club, and it needs a "simple" login system to allow members-only features etc. I've been using the php-login-minimal as the base for the PHP login: https://github.com/panique/php-login-minimal It works by creating a session cookie if ...

Hello @Jamal
Long time no see.
Good night, guys. See you tomorrow. :)
@kleinfreund Bye!
9:21 PM
Hmmm, I can't ping 200_
I need to ask him about some comments on one of my answers.
@syb0rg had to come back to answer this..
I don't know what brain fart caused this
but I'm stuck with that name for 30 days
I like though, that I can now comment and say "lol.upvoted"!
9:31 PM
@lol.upvote So it's not a permanent change?
I'm still @retailcoder everywhere else on SE
I think I'll revert back to @retailcoder when I can
I can edit it, but it's probably best I only do it for moderation reasons.
@Jamal I thought about asking you that, ...but it wouldn't be fair to all other brainfarters who don't hang around a chatroom with a mod.
also I like that I can be pinged with @lol :)
Right. It would only be warranted if your name was offensive or something.
like @lol.downvote would be
9:35 PM
Probably not even that. Something like racism.
:) nevermind
all right, I'm gone for real now :)
Bye (again)!
10:22 PM
@amon that site is in German @kleinfreund how am i supposed to read it? lol
I gotta take off again.
10:48 PM
Hi everyone!
@EOF Hello there!
Hi @amon.
So, @syb0rg, you wanted to talk to me?
11:04 PM
@syb0rg - you and me .... : Before:
A: Stack Exchange Data Explorer is up. What now, Wonderland?

rolflIt was asked: Anyone know how to formulate the voting data as a pivot: Here is a first stab at the critical voting factors for CodeReview since 1 Jan 2013. This does a pivot-table on the voting data, and plots the results as a graph over time.

@EOF Yes, about my Buffer Overflow?
Baahhhh .... sick for a few days, and I drop the ball:

member for 2 months
visited 72 days, 1 consecutive
@syb0rg Yeah, I just thought it's a bit dangerous as an example for beginners to follow.
@EOF What would you recommend instead, where I can check if the input is a number only?
At least I di dnot drop the ball on CR ... still 88 days consecutive.
11:12 PM
@rolfl I did the same of RPi SE :(
Yeah, feeling pretty bummed already, this is salt in the wound.... :(
@rolfl I may have been up-voting questions exclusively recently.
@syb0rg - I am aware of that ... ;-)
I did some math earlier ..... about the race.
In theory I can hit 600 before I go to bed (I can hit 601).
If I miss it today, it will become a race as to whether you can upvote more in the first bit of the next day, or I can.
@syb0rg What's wrong with int nr and scanf("%i", &nr);
Q: How do I make this duplicate sort algorithm run faster?

puretppcHere is my full code (updated as of question post time). It is working fine but the performance time is approximately 5 minutes and 29 seconds. I am dealing with 1090 images. This algorithm is supposed to organize and visually duplicated images. So what I do is compare 2 images at a time; 1 the ...

11:17 PM
@EOF What happens if a char is input?
@syb0rg well, int scanf() returns the number of arguments successfully assigned, so you could check that for 0...
On success, the total number of characters written is returned.

If a writing error occurs, the error indicator (ferror) is set and a negative number is returned.

If a multibyte character encoding error occurs while writing wide characters, errno is set to EILSEQ and a negative number is returned.
@syb0rg that's printf(), I was suggesting scanf(): en.cppreference.com/w/c/io/fscanf
@EOF And that would explain my confusion.
An edit is now in the works.
@syb0rg - no wonder you're messed up, your robot part needs to fix it's scanf references.
Also, I managed to cheat, somehow:
1,074 up 564 question 699 43 43
43 votes today.
11:31 PM
So that's what a Canadian monkey looks like. :-)
11:48 PM
@EOF Answer is fixed, thanks.
A: Fibonacci sequence in C

syb0rgWhat you did well on: Your program is easy to read. You are allocating memory, even though it is unsafe in certain cases (other answers have addressed this, so I won't cover it). You prepare for some corner cases. Things you could improve: You are returning 0 when your program runs into a...

I should now create a non-recursive function and do a time-test...
@syb0rg I'm actually not sure scanf() will return zero when invalid input (or no input) is supplied, it might return EOF (how appropriate...). I'd try something like: do {int a = scanf("%i", &nr);} while(a<=0); It should probably give a message to the user too, but I haven't thought of a good way to include that in a single line...
@EOF If no input is supplied, or a space is supplied, it continues to scan for input from the user.
If something invalid is input, the current code I have now rejects it.
@Jamal - this monkey is surprisingly symmetrical..... 1128 votes cast, 564 questions, 564 answers
For example, the letter 'b' would be invalid input.
@syb0rg cppreference says: "Return value

Number of receiving arguments successfully assigned, or EOF if read failure occurs before the first receiving argument was assigned. " Could return EOF?

« first day (267 days earlier)      last day (2500 days later) »