« first day (264 days earlier)      last day (3748 days later) » 

12:04 AM
Reload!!!
 
12:55 AM
Ooh yeah!
 
Catching up on your backlog?
@lol.upvote - Syborg is taking the race-to-electorate very seriously.
40 votes a day, all to questions ;-)
 
that's good for everyone!
and yeah, catching up :)
 
Well, yes... I am also doing my 40 per day, but to answers as well.
I have just realized though, that I have to do average of 35 per day to questions for the next 5 days, otherwise syborg wins.
 
he needs at least another 3-4 days to tie
 
Nope, he's only 100 behind me.
the votes have to be on Questions....
Sorry, he's at 387 question votes, I am at 435 ... so only 48 votes different.
 
1:11 AM
but he's not the only one voting... right?
 
Correct, but he is only voting for questions....
So, in order to win, I essentially have to vote for questions only as well.
 
I thought the system warned you after a couple question votes, that answers deserve upvotes too... or is it the other way around?
 
I've never seen that warning.
 
I did, but I can't remember if it was about questions or answers. Said something like "you've voted on answers for a while, give questions some lovin' too!"
 
1:39 AM
shameless plug:
0
A: Preserving DRY while using an interface, abstract class and delegate

lol.upvoteI think QueryBuilder can use constructor parameters, and that its auto-properties can be changed to be { get; private set; }. Otherwise the public setters seem to make an opportunity for some trouble. Actually I'd drop the auto-properties and initialize private readonly fields, exposed by get-onl...

 
"You haven't voted on a question in a while. Questions need votes too."
@rolfl You wouldn't have, because you already vote on questions.
 
@ChrisW yeah that :)
damn 40 votes isn't enough!!
 
2:02 AM
0
Q: A class for form data validation

www.arcmarks.comI don't want any feedback on the regexes as I know what needs to be updated here. Also, don't need any feedback on naming conventions. I'm looking for feedback on the structure and correctness of the class. /**************************************************************************************...

 
Am I pushing it?
But you're reassigning that dictionary everytime the constructor runs; whether it's static or not wouldn't make a difference then... unless you're reusing the same instance and calling these setters. I think it makes more sense for these values to be per-instance, so you can't accidentally miss a property and drag a value from another use. Don't give different meanings to the same variable; this applies to a string, just as it applies to a QueryBuilder IMHO. Feel free to upvote if any helpful - this isn't StackOverflow, we're a beta site trying to build a hi-rep user base and graduate :) — lol.upvote 2 mins ago
(user has 127 SO rep and 3 votes total across his 4 SE accounts)
 
0
Q: A class for remember me

www.arcmarks.comLooking for feedback on correctness and code structure. Follow up to: SStorage (remember) - v0 Note that b.c. the user can only change the storage type when logging in, there is no need to copy back and forth between storage types. /************************************************************...

 
2:20 AM
0
Q: A class for dynamic inputs

www.arcmarks.comThis class creates dynamic input labels. You give it a pair of elements and it sets up the event listeners and CSS toggles to accomplish this. Looking for feedback on code structure and correctness. Toggle classes do what they say, they toggle one class on and another class off. /************...

 
@lol.upvote He has only asked 3 questions, one on each site. He accepted an answer on SO, after a comment reminded him too.
@user2018761 Thanks for your feedback. You can "accept" this answer, by clicking on the checkmark in the margin near the top of this question: for details see Accepting Answers: How does it work?ChrisW 13 hours ago
 
So I guess I'm not pushing it then.
 
^ I posted that comment, earlier, after the OP said thanks without accepting the answer. That worked.
 
Oh, the question is still young, I'm not going to start begging for a checkmark just yet - especially since I haven't grasped everything that code does and I think other reviewers could pick up stuff I haven't.
 
@lol.upvote You are a bit: "not SO", "beta site", "high-rep user base", and "graduate" might be over the head of a new user.
 
2:27 AM
right.
guy thinks "well that's a cool site, but dang, they're nutz!"
 
or not. throw him in at the deep end.
thanks!
4
Q: Educational "Library" project

Hagbart CelineThe assignment is very open and we have only 4 things it needs to cover: File write and read Use a Struct Export into HTML format use a common sorting algorithm so I've decided to create a little "Library" with following features: read the input file "Library.dat" List the books on the cons...

^ There's a lot more meat on this bone: lots to criticize, the one current answer barely scratched the surface.
 
I wish I remembered anything from my C class some 15 years ago...
Actually I do. A bit. But I'm not confident enough to tackle a C review :)
 
checks lol.upvote's tags
I expect you can read it, even if not write it happily. I've been reading Java questions.
 
2:43 AM
I can sort of read simple Java code, but I would never attempt to write it at this time.
 
Ugh. that was some nasty code!
0
A: Review of a state machine alike method

lol.upvoteBindingModelToHtmlEh - really, an Eh suffix for a delegate? public delegate object BindingModelToHtmlEh(object sender, BindingModelToHtmlArgs args); Wait a minute. This looks like an event handler, it's got the sender and EventArgs-derived args parameters, but it returns an object. This is r...

@ChrisW I can read it - it's well written and commented too - but not happily :)
Wow. It's amazing all the plumbing C# & .NET abstract away!
 
3:08 AM
@ChrisW nicely put:
Please read What makes a good question? I hope this code might get better review answers, if you added some introduction to the question to say what the code is supposed to do (what problem you are trying to solve). — ChrisW 12 mins ago
 
3:21 AM
Hot question !!
10
Q: Code indentation for declaring inputs/outputs in an array

dwjohnstonI'm writing a list of inputs and outputs for to be compared in unit tests. var equals = [ //input //output ["name:(John Smith)", "name:(John~ Smith~)" ], ["name:Jon~0.1", "name:Jon~0.1" ],...

 
Yay! I found some spam on SO to flag. :-)
 
3:39 AM
you get a badge for that?
 
Nah. I just hate spam and love to flag it.
But spam iz evil!!!
 
I don't get spammers. What's their goal in life?
 
Maybe they get paid to post crap on SE sites.
 
unbelievable
 
Aaaaaaaaaand it's gone.
 
3:50 AM
@Jamal Don't you ?
 
Don't I what?
 
Get paid to post crap on SE sites .... no, you're a student... you don't get paid.
People with real jobs, who post to SE sites, like CR, get paid to post crap here ;-)
People like me, and Malachi, and retailcoder... or lol.upvote ... ;-)
 
Lucky!
 
that's a nice one (PCG):
10
A: Draw the Heart Shape

VisioNJavaScript [160 bytes] The following code seems to be 160 bytes unformatted. ('l2v2l6v2'+ 'e1l1v3l2'+ 'v3e1v7e1v7e1v7e1l2v6e1l4v5'+ 'e1l6v4e1l8v3e1l7l3v2e1l9l3v1') .replace(/[lve]\d/g,function (c){return Array(-~c[1]). join({l:' ',v:'Love' ,e:'\n'}[c[0 ]])})...

@Jamal what's wrong with SEDE?
 
4:07 AM
@lol.upvote: I just put the whole name so everyone knows what it is.
 
I thought people might say "WTF is this SEDE thing?" and click the link out of curiosity. You ruined it! :p
(kidding)
 
4:39 AM
0
A: Logging Entity Framework Changes - improve performance

lol.upvoteNot a big deal, but this: var currentVal = property.CurrentValue == null ? "" : property.CurrentValue.ToString(); var originalVal = property.OriginalValue == null ? "" : property.OriginalValue.ToString(); Can be shortened to this: var currentVal = (property.CurrentValue ?? string.Empty).ToS...

Wow I'm on fire!
 
@lol.upvote Quick put him out!
 
3 answers tonight :)
not exactly @rolfl-grade, but for me 3 answers is a feat!
 
I think I have 0 today. So you're ahead of me! ;)
 
I'm still at -3 rep for the week (bounties), gotta keep answering!
 
For that last answer of yours: could the if (entry.Entity.GetType().Name.Contains("PropetyPair")) not go two code blocks up?
 
4:47 AM
@lol.upvote you're FOS.... you're in the black .... ;-)
 
@JamesKhoury the exact same thought occurred to me, but he needs to check the property's modified state before he can run it, so no. ...unless I missed it!
@rolfl thanks!
@rolfl Factory Outlet Store?
 
French Onion Soup?
lol
 
@lol.upvote *She? ... I'm not 100% certain what its supposed to do. But I don't see any functional difference.
 
@lol.upvote - just FYI, I only answer about 3, maybe 4 Q's a day.
 
4:51 AM
lol! Yeah Kirsten is a she ...I admittedly didn't look at the OP's name, went by statistical probability...
@JamesKhoury she takes var property = entry.Property(o);
and from that, gets the original and new values
and if the two are different, then... you're right.
@JamesKhoury can I steal that or you're leaving a comment?
 
@lol.upvote Steal it. You';re the one who understands it. I'd personally go with something already cooked up like: auditdbcontext.codeplex.com
I'm sure whe already thought of that and has some "enterprisey" reason for it.
 
5:09 AM
you never know...
 
I'd upvote twice if i could.
 
5:22 AM
:)
 
5:40 AM
1
Q: One page website - general review

kitsu333I am fairly new to web development, and would like some feedback. It is HTML/CSS, with some JS (button hovers, anchor scrolling and image sliders) from elsewhere. Comments on best practices and any other suggestions would be great as I feel I'm probably doing a lot wrong, but specifically: I us...

 
 
2 hours later…
8:08 AM
0
Q: Refactoring calculator expression

test2000I was doing a simple exercise to calculate the amount based on an expression. For example: (((2*2)+(3*5/5)+(2*5))) outputs 17 ((2*2)(3*5/5)(2*5)) output 120 etc I have written the code, but I am not satisfied with what I've done. Could you please help me to review the code and suggest the bes...

 
 
2 hours later…
10:06 AM
0
Q: Can't convert buffer to struct

Kutluhan MetinI get no syntax or compiler error and code looks logically true to me. But I get wrong values. Any help appreciated. #include <iostream> #include <string> #include <boost\asio.hpp> #include <boost\lexical_cast.hpp> #include <conio.h> #include <algorithm> using boost::asio::ip::udp; using namesp...

 
10:43 AM
0
Q: How to write unit tests, using PHPUnit

masp LOG_DEBUG)) { self::$error_message = 'Invalid log level'; return false; } self::$log_level = $log_level; return true; } public static function logMessage($filename, $message, $log_level = LOG_NOTICE, $destination = self::DAILY_LOG) ...

 
11:16 AM
@lol.upvote "Ugh. that was some nasty code!" ChrisWue has taken another stab at it.
1
A: Review of a state machine alike method

ChrisWueApart from the comments provided by @lol.upvote: The code as you have posted it does not compile for two reasons: htmlList is a private member of HtmlViewContext so HtmlViewResult cannot access it. I can only assume that HtmlViewResult is actually a nested class within HtmlViewContext (oin whi...

 
12:16 PM
0
Q: boost multi-index based orderbook

javapoweredAs suggested here http://stackoverflow.com/questions/21278204/stdunordered-map-how-to-track-max-min-key-at-any-time i'm using boost multi-index to implement orderbook. So far my code looks this: "CommonsNative.h" contains typedef int64_t myDecimal; and enum Side { Buy, Sell }; #pragma once #in...

 
12:34 PM
0
Q: First Revealing Module Implementation, want to see what improvements can be made

Brian OgdenI have a little js I call a "jqGrid Factory" to encapsulate common settings and functionality across my web app: var jqGridReportFactory = (function () { var config = { datatype: 'json', mtype: 'GET', height: 'auto', autowidth: true, shrinkToFit: true...

 
 
1 hour later…
1:48 PM
8 people deemed it a good question for it's length but only 2 people upvoted it???
3
Q: One page website with JS functionality

kitsu333I am fairly new to web development, and would like some feedback. It is HTML/CSS, with some JS (button hovers, anchor scrolling and image sliders) from elsewhere. Comments on best practices and any other suggestions would be great as I feel I'm probably doing a lot wrong, but specifically: I us...

 
4 people
;)
Also, 8 people deemed it not a bad question, which does not equal a good question necessarily
 
8 people said being too long was not a reason to delete it.... but I doubt those 8 people read the whole thing to determine whether it was good.....
2
 
"not bad" => no votes.
Personally I feel disinclined to upvote because IMO there could (theoretically or in future) be such a thing as too many "review my HTML+CSS web site please" questions -- so, I tolerate but don't encourage it: 'not my cup of tea'.
 
2:13 PM
hello!
Yay! I'm back on the week's front page! codereview.stackexchange.com/…
 
@ChrisW there can never be too many of these questions. too many people are writing bad HTML/CSS it should be a webdesigner's priority to help others learn the right way to write HTML/CSS before letting them Learn Javascript to mess it all up, IMO.
 
2
A: Game map tiles generation with php

bumperboxI had a look through the code, if it runs slow then it is most likely a network issue from what I can tell. I think you are caching the wrong thing. A better solution might be to change the design of the tiles and remove the coordinates from them. You have 6 types of tiles Sea, sTone, Mountai...

4
A: Logging Entity Framework Changes - improve performance

lol.upvoteNot a big deal, but this: var currentVal = property.CurrentValue == null ? "" : property.CurrentValue.ToString(); var originalVal = property.OriginalValue == null ? "" : property.OriginalValue.ToString(); Can be shortened to this: var currentVal = (property.CurrentValue ?? string.Empty).ToS...

3
A: One page website with JS functionality

AlienArraysCSS Instead of having 5 different rules all saying the same thing for 5 selectors. You can group them like this. h1.light, h2.light, .darkgrey a, .darkestgrey a, .button.light { color: #fff; } body, .underline.light { background-color: #fff; } Use one line for margins. h1 { mar...

0
A: Record Cataloging Program

Joel CornettHere's an example of how to implement with sqlite3. You'll need to import the following: import sqlite3 from contextlib import contextmanager And define the following constants: DATABASE_PATH = '/tmp/my_database.db' SCHEMA = '''\ DROP TABLE IF EXISTS records; CREATE TABLE records ( id IN...

1
A: Ruby and cyclomatic complexity

toklandI've taken the code labeled as "final revision" in your question. Some notes: data = something and then data = another_thing. So data holds two different values, that's confusing (use another variable name). Spaces between lines: Vertical space is very valuable, don't insert blank lines without...

5
A: Coding style in Ruby format in an method and variable assign

toklandCase 1_a. Don't mix pure functions (sub) with destructive functions (sub!). Whenever possible use pure methods: zip_file = file.sub(directory, '').sub(/^\//, '') zipfile.add(zip_file, file) But can't you write simply? zip_file = File.basename(file) Case 1_b: I prefer to set variables. Givin...

2
A: Review of a state machine alike method

ChrisWueApart from the comments provided by @lol.upvote: The code as you have posted it does not compile for two reasons: htmlList is a private member of HtmlViewContext so HtmlViewResult cannot access it. I can only assume that HtmlViewResult is actually a nested class within HtmlViewContext (oin whi...

9
A: Type system for different representations of angle value

ChrisWueI don't think you should treat the units as disjoint entities between which you convert. You have started your post by saying Angle can be represented using following types But actually what you meant is "units". So the entity you are trying to measure is an angle. And code using it shoul...

3
A: Educational "Library" project

JacksonYou don't need the two definitions of book: typedef struct {..} book ; struct book {..} ; What I would normally do is: typedef struct Book { ... } Book ; This allows you to write either: struct Book b1 ; Book b1 ; and in both cases get a Book structure. it also means i can refer to a Boo...

15
A: Code indentation for declaring inputs/outputs in an array

Wayne ConradAn argument against table-style alignment in code Except when the editor/IDE helps maintain alignment with little work from the programmer, and all those who work with the code have that same facility, horizontal, table-like alignment in code is more trouble than it's worth, for these reasons: ...

0
A: Preserving DRY while using an interface, abstract class and delegate

ChrisWueIn addition to what @lol.upvote already said: I don't really think the way you pass the column names and values around for several reasons: You basically pass them as a string which means that whoever provides and very likely already has a list of them need to concatenate them together and the...

1
A: Testing whether characters of a string are unique

TemplateRexHere's a two-line solution using some of the standard algorithms: first sort a copy of the string, then use adjacent_find to determine if any adjacent characters are identical. If there aren't, adjacent_find will return the end() iterator of the string copy, so you simply compare against that bo...

0
A: Educational "Library" project

ChrisW#define MAX_STR_LEN 256 #define MAX_BOOKS 10 #define DATE_LEN 8 How do you choose these numbers? Does you code ensure that data in the file doesn't exceed these numbers? In fact your readBookFile function has a bug: if the title of a book is nearly MAX_STR_LEN then the length of the whole file...

That's it!
 
Discussion -> Aggressive Tagging : One of the requirements for badge:Generalist is that the top 40 tags have to have more than 200 questions.... Now, not everyone is thinking in terms of Generalist, I know, but the tag frequency means more than just that.
When editing/viewing/voting on questions, I want to encourage people to study the tags more closely.
2
Page 2 of the tags ^^^^^^
The top row of this page needs > 200 questions.
 
@rolfl it will all come in due time, no?
 
Yes, but, it works both ways.
People look for things with a certain tag.....
 
2:24 PM
true
 
The CSS/Javascript/HTML discussion was interesting... (and is what prompted my outburst).
But I look at it more from the java/android perspective.
If there's an android question with Java code, but not tagged with both, then tag it.
3
If there's a Java question that's for android, but not tagged android, then do it.
 
android is fun, but it is more about several languages working together isn't it?
 
"Generalist: Provided non-wiki answers of 15 total score in 20 of top 40 tags"
 
@rolfl I endorse this message
 
2:26 PM
by more than one language, I mean a little bit of XML and a little bit of Java. but I guess that is the same with any application
 
Look below the list of tags.
Here's an interesting search:
CSS is 42 short of 200.
Gotta run... meeting.
 
@rolfl some of those don't have any CSS code in them
 
2:56 PM
0
Q: Determine a charcters attributes

AcornsI have got to determine a characters attributes on python and this is the code I have for it but I do not ifit is correct. Each attribute is set to 10, strength and skill. Please help dieOne = random.randint(1,4) DieTwo = random.randint(1,12) characterOneStrength = 10 characterOneSkill =...

 
3:15 PM
2
Q: Can this HTML code be improved?

Akshat TripathiHTML <!Doctype html> <html> <head> <title>Welcome To DPS Raipur</title> <link rel="icon" type="image/png" href="logo.gif" /> <link rel="stylesheet" type="text/css" href="index.css"> </head> <body> <div class="wrapper" id="wrapper"> <div cla...

low votes on this one^^
 
^^^ I'll even add: 1 more upvote on the question and we have a new upvote-capable OP :)
1
A: One page website with JS functionality

ANevesHere are some quick and non-exhaustive comments: Wrong usage of br Your use of br is wrong, you should use margin or padding for that. For example, to have a fixed menu just put the other content on a div, and give that div margin-top. (Or you could hack it with header+* { margin-top: 40px; },...

1
A: Filtering a dictionary by subject of definitions

ShlomiUpdated answer: Thanks for clarifying the question, the examples helped. Here is my new attempt: (defn update-subjects [dict subj] (map (fn [[k {val :definitions}]] [k {:definitions (filter (fn [{s :subject}] ((into #{} (flatten [s])) subj)) val)}...

0
A: Search an element/item in an n-ary tree

BhaskarI am taking a very broad stab at this, answering your questions along the way but with additional comments on the code in general. public SearchInANAryTree(T[] items, int nary) { if (nary <= 0) throw new NullPointerException("The branching factor : " + nary + ", should be greater...

 
1
Q: Are these file handling functions safe?

2013AskerI'm using these 2 functions to handle file input/output and would like to know if there's anything that should be changed. For content retrieval, enough space is allocated and the file content is copied. To make sure saving a file either saves all or nothing, I'm writing to a buffer then renamin...

 
3:32 PM
hello @SimonAndréForsberg
 
@monkey (that's you, @rolfl): You know any good program to determine application metrics without being an Eclipse plugin?
I would love to find out the metrics for this crap I'm dealing with, to compete with @lol.upvote
 
haha
 
Hi @lol.upvote, do you have any automated tests on your code?
 
tests? you're kidding, right?
 
0
Q: php home-grown web service - need help with design, robustness

Mike S.I needed to build a one-way web service for a mobile app I developed. It's only goal is to receive incoming json data and insert it into the correct tables. It works. But it looks very "kludgy" and cobbled together (happens alot with solo development). I'd like another pair of eyes to see where...

 
3:34 PM
So we're suffering the same pain there I guess...
@lol.upvote You're dealing with databases of any kind?
 
TBH I never worked in a project with automated tests, other than code I had written myself.
SQL Server
queried with inline concatenated SQL strings
 
@lol.upvote Ha! PostgreSQL here, mine's worse!
 
If the code is any good, it shouldn't even matter what the RDBMS is
 
@lol.upvote Ouch, alright... well, this project uses Hibernate mostly...
@lol.upvote code any good? you're kidding, right?
 
yeah, well.. any not-too-stupidly-ignorant-of-the-advancements-of-the-last-20-years I meant.
 
3:37 PM
not-too-stupidly-ignorant-of-the-advancements-of-the-last-20-years? you're kidding, right?
(when was Java itself invented btw?)
 
Nope. I had C# code written as if it were VB6. Literally.
Strategy pattern? Why? Just ElseIf over 300 lines!
 
This is written like well... I don't know what...
300? Come back when you have 758!
@lol.upvote Are your database tables normalized?
 
Didn't count, really.. but yeah I feel your pain!
 
Any SQL gurus around here? What if I want to do a INSERT INTO a SELECT * FROM a, but I want to exclude a couple of fields and use other values for them instead?
 
Isn't that a query that's playing with itself? o.O
I mean.. nevermind
drop the * and name your fields?
 
3:50 PM
@lol.upvote I understand your concerns, but I think I know what I am doing based on the requirements I've got.
Of course I'm using a very detailed WHERE in the select also
 
case when x then y end?
 
0
Q: Calculate query coverage from blast output

user3224522I have a blast output file and want to calculate query coverage after appending the query lengths as additional line to the output,lets say I have i.e 2 7 15 f=open('file.txt', 'r') lines=f.readlines() import re for line in lines: new_list=re.split(r'\t+',line.strip()) q_start=new_lis...

 
@lol.upvote yup, naming the fields worked
@lol.upvote and using non-fieldnames where I want the new data
this feels horrible, but... if that's the way they want it...
@lol.upvote Again I have to ask: Is your database normalized? :)
 
In my dreams, yeah! Tables & column names are sometimes Spanish, sometimes English, other times French, no FK whatsoever, CustomerId can relate to a field named Codigo and there's no way of knowing other than... knowing.
 
@lol.upvote Only a naming problem? Sounds like paradise! Here I have a "searchablename" column which is only used for specific "model"-rows. On the rest of the rows it's empty!
 
3:58 PM
Most of my interesting/useful data is trapped in redundant XML fields that have to be queried WITH XMLNAMESPACES (xxx)
0
A: Refactor jQuery code to use fewer selectors

Kevin BYou could use jQuery.fn.serializeArray to get all of the values from your inputs at once (giving them all a common class), thus removing the need to select each one while generating the new row html. // build new table row from line item inputs var newRow = "<tr>"; newRow += $(".line-items tfoot...

0
A: First "Revealing Module" Implementation

konijnI like your code, good use of the Revealing Module pattern. In only have minor observations: mtype could use a better name ( I know, jqGrid uses it ) autowidth -> autoWidth ( lowerCamelCasing ) gridview -> gridView rowList: [50, 100, 200] could use a comment as to what it does viewrecords -> v...

 
I am quite fond of my legacy single column table with 9 bits of comma delimited values :)
super easy to get values out
 
4:13 PM
I just retagged all with . I think should burn, SO doesn't have it anyway.
..and I only found out after putting in SO's tag wiki for .
 
Hmmm, just gave Loki Astari a hard time, I hope he is not a vengeful down voter :P
 
has anyone notices a lot of codereview stuff making it's way onto codecrap.com?
Personally i think it's bad form
 
@apieceoffruit what? There's CR content ending up on CodeCrap?
 
yup. a few of the anonymous posts are direct questions from here
 
do they link here?
 
4:27 PM
just one example but i saw a few others last week
might be worth putting something in the meta to discourage people from doing this
 
@apieceoffruit go ahead!
 
0
Q: Ruby module namespacing advice

byterussianin my current project have: module Stats class Site ... end class Product ... end class Profile ... end end now in my Product class have methods to get/set product views(day, week, month) and methods to get/set product sales(day, week, months) is better to namespa...

 
0
A: node.js passport wrapper

konijnFrom a once over: Your indenting is a mix of 4 space and 8 space tabbing, please stick at all times to either 4 or 2 spaces. Looking at deserializeUser is aneurysm inducing. You have a ton of comments, which I like, authentication can always use tons of comment data[0] and data[1] both use a cr...

 
0
Q: Posting CodeReview on code shaming sites

apieceoffruitI recently noticed a number of articles from here ending up on a popular code shaming website: codecrap.com Now, I imagine no harm is meant, but I would just like to urge people against doing this. The purpose of this SE is to let people (who have a willingness to improve) show their code and a...

done
 
lol.upvoted
 
4:42 PM
2
Q: Posting CodeReview on code shaming sites

apieceoffruitI recently noticed a number of articles from here ending up on a popular code shaming website: codecrap.com Now, I imagine no harm is meant, but I would just like to urge people against doing this. The purpose of this SE is to let people (who have a willingness to improve) show their code and a...

 
@StackExchange you'll never learn eh?
 
@SimonAndréForsberg Nope, no good ideas on Java metrics system....
 
I dont like this question, the code is too clean because it doesnt do anything really : codereview.stackexchange.com/q/21202/14625
and the OP has not fixed the question ( per the comment ) since a month.
 
0
Q: Lua C API: How can I improve this runtime expression autocompletion?

electroLuxI've written a function that can be used at runtime to suggest how the provided incomplete Lua expression can be completed so that it would make sense (that is, it would evaluate to a non-nil value). For example, this can be used with an application console that can evaluate Lua expressions at ru...

0
Q: Burninate [tpl] tag

lol.upvoteI have retagged the 4 questions that had the tpl tag, to use task-parallel-library instead - Stack Overflow doesn't have a tpl tag. Burninate? Synonymize?

 
5:05 PM
I literally did a double take,

I would change the word Synonymize.....
 
0
Q: passing another variable to a function breaks QuickSort [C++]

Ahmet TaspinarSo I have written a code for QuickSort in C++. Testing it with a few cases showed me that it really works. Here is the code: int Partition(int *myarray, int left, int right) { int p = myarray[left+1]; int ii = left +1; for (int jj = left+1; jj < right+1; jj++) { printArray(myarray,1...

 
3
Q: Refactor a Lazy Loaded Query to an Eager Loaded Query

Chase FlorellI'm having a problem Eager Loading my data using Linq to SQL First I've got a basic Repository Read() Repository Public Class EventRepository Public Function Read() As System.Linq.IQueryable(Of [Event]) Implements IEventRepository.Read Dim events = (From e In dc.Events ...

Needs closing ^^^
 
close vote in
 
ok I will slow down on the Edits now for a little bit....
trying to get up to 200 questions...
SQL tagged questions could go up some too I think
 
5:25 PM
@ChrisW just noticed you haven't had an answer yet:
3
Q: Thread-safe wrapper around WCF ServiceModel.ClientBase subclass

ChrisWI have an ASP.NET application which uses a Service Reference to a (third-party, offsite) payment processor. The service reference class is generated automatically. Its implementation is a subclass of ServiceModel.ClientBase, which MSDN documents as, "Any instance members are not guaranteed to b...

I favorited, will check it out tonight
 
@lol.upvote I suspect I have found what the answer is. Should I close the question to save you the trouble of answering?
 
better yet, answer it yourself?
(I think you get a badge for your first self-answer)
 
@ChrisW I agree with @retail....ahhh I mean @lol.upvote Answer it yourself! and maybe @lol.upvote comes up with a review that you hadn't thought about.
 
I didn't even know whether it belonged here or on SO; because it's more a question about how to use an API, than how to use a language. Eventually decided, "here", because it's more about how to improve an implementation rather than about how to make it work at all.
 
And not "here", because "I'll get downvoted to oblivion on SO", right? :p
 
5:32 PM
0
Q: Improve page-specific CSS for different color schemes

kleinfreundAssume a website with four pages: Blog, About, Work and Contact. For these four pages there are four different color schemes. The colors are used for things like headings and links. Of course using different color schemes on pages results in bloated CSS. I'm now trying to reduce the bloat. I've ...

 
when reviewing code Two heads are better than one, but the Internet (Code Review) is better than two heads.
2
 
0
A: node.js + Express code critique

konijnYour code looks fine. However, you are not showing us much to review, definitely come back when there is more to review. Some minor comments: Having your db connection config through ./config/db is good You probably want to throw an exception if ( typeof cb !== "function" ) instead of silentl...

 
@lol.upvote I posted a related question on SO, which is why I think I know the answer now.
OTOH I also posted a boring question on SO recently labelled asp.net which earned me my first "tumbleweed" badge (no-one even looked at it).
 
1
Q: Recursive reverse function

Ionut Grt. Write a recursive version of the function reverse(s), which reverses the string s in place. Here is my solution: void reverse(char a[], int i, int j) { char tmp; if(i >= j) { return; } reverse(a, i + 1, j - 1); tmp = a[i]; a[i] = a[j]; a[j] = tmp; } T...

 
There are so many questions posted to SO now, that people don't even look at them all, let alone answer them?
2
 
5:40 PM
@ChrisW Wouldn't surprise me at all.
 
@ChrisW it's sad really
2 suggested edits that I can't see????
 
@ChrisW I've had a feeling for a while that SO has been going in that direction. Either questions get closed or goes unanswered mostly.
 
Nevermind my last comment. they were tag wikis that I suggested...lol
Jamal will have fun cleaning up that mess. almost got bloody....lol jk
2
Q: Improve page-specific CSS for different color schemes

kleinfreundAssume a website with four pages: Blog, About, Work and Contact. For these four pages there are four different color schemes. The colors are used for things like headings and links. Of course using different color schemes on pages results in bloated CSS. I'm now trying to reduce the bloat. I've ...

0
Q: Should each Syntax of SASS be given it's own tag?

Malachifrom the SASS Documentation Syntax There are two syntaxes available for Sass. The first, known as SCSS (Sassy CSS) and used throughout this reference, is an extension of the syntax of CSS3. This means that every valid CSS3 stylesheet is a valid SCSS file with the same meaning. In additio...

 
5:56 PM
0
Q: Should each Syntax of SASS be given it's own tag?

Malachifrom the SASS Documentation Syntax There are two syntaxes available for Sass. The first, known as SCSS (Sassy CSS) and used throughout this reference, is an extension of the syntax of CSS3. This means that every valid CSS3 stylesheet is a valid SCSS file with the same meaning. In additio...

 
I am a glorified janitor, after all. :-P
 
lol
 
@Malachi Shouldn't you credit sass-lang.com instead of the SO question?
 
I credited the SO question because the question was asking what the difference between the two is. and that is what the argument is about, not about what it is. does that even make sense?
 
Actually the text is from sass-lang.com/documentation
 
5:59 PM
and the site changed I couldn't find that info on the page that was linked. but I did add some text to the meta question from the Documentation so I will do that too
 
The SASS web site content seems to be MIT licensed. Is that license compatible with our quoting it?
 
VB isn't C# $*Expletive*$ - it
@ChrisW IDK
 
1
A: Recursive reverse function

JosayIt looks ok to me. As a few comments in a random order: I guess I don't have to tell you that writing a non-recursive function for this is quite straightforward. You could give tmp its final value as you define it : char tmp = a[i];. You could make it a tail call recursion by doing reverse(a, ...

 
So for politeness sake, just give credit to sass-lang.com/documentation for the text.
IMO. Then the wiki edit would pass my review for what that's worth.
 
6:15 PM
0
Q: How to partition a 2D map consisting of elevation data into individual basins?

AnkitSablokI am trying to solve the following problem - http://codegolf.stackexchange.com/questions/19188/partition-a-map-of-water-flows , and I have written the following code to solve this problem #include<map> #include<set> #include<cstdio> #include<vector> #include<cstdlib> #include<iostream> #include<...

 
@lol.upvote is there a different word for that which means the same thing?
2
 
@ChrisW oh that is what you were talking about I thought you were talking about the meta post. give me a second
is this a fair response???
@kleinfreund one uses indentation and the other uses brackets. your argument would be like saying that VB and C# are the same because they are both .NET and the only difference is the way a block of code is specified, brackets or indentation. — Malachi 40 secs ago
 
@rolfl "We couldn't find direct synonyms for the term synonymize." synonyms.net/synonym/synonymize
1
A: Recursive string reverse function

UselessSimple worked example of Anton's suggestion: void reverse_rec(char *begin, char *end) { if (begin < end) { char swp = *begin; *begin = *end; *end = swp; reverse_rec(begin+1, end-1); } } void reverse(char s[]) { if (s) reverse_rec(s, s+strlen(s...

 
6:31 PM
to make the same
 
1
A: Preserving DRY while using an interface, abstract class and delegate

ChrisWueIn addition to what @lol.upvote already said: I don't really like the way you pass the column names and values around for several reasons: You basically pass them as a string which means that whoever provides them very likely already has a list and needs to concatenate them together and then y...

0
A: How to refactor C# class to meet SOLID priniciple

vmichaelWhen ever you encounter multiple conditions that you see growing, that should be a clear indication that a strategy pattern could help. You start by doing the following. Create a simple enum for your status codes. public enum MessageStatusCodes{ case12= 12, case13= 13, case22 =...

0
A: Calculate query coverage from blast output

200_successOne serious bug is that you open results.txt for each line of input. It's almost always better to open files in a with block. Then, you won't have to worry about closing your filehandles, even if the code exits abnormally. The with block would have made your results.txt mistake obvious as well...

^^ vote!
2
A: Review of a state machine alike method

ChrisWueApart from the comments provided by @lol.upvote: The code as you have posted it does not compile for two reasons: htmlList is a private member of HtmlViewContext so HtmlViewResult cannot access it. I can only assume that HtmlViewResult is actually a nested class within HtmlViewContext (oin whi...

^^ vote!
 
0
Q: Finding maximum Collatz sequence between 1-1000000

jasonI'm trying to find maximum the Collatz sequence between 1 and 1000000. I wrote the following code below. I guess it is correct but it is extremely slow. Can you give me a few hints to make it faster? Thanks. #include <iostream> #include <vector> #include <algorithm> using namespace std; bool myf...

 
7:20 PM
@lol.upvote
1
A: How to reduce this RadioGroup Code?

Simon André ForsbergThe easiest way would be to define a constant integer array holding the ids: private static final int[] ids = { R.id.kn1_radio_group, R.id.kn2_radio_group, R.id.pr1_radio_group, /* and so on... */}; And then using the same method as in my answer to your previous question. However, your naming...

^^ vote!
 
@SimonAndréForsberg - @lol.upvote is useless, he burns through his votes before the day has hardly started..... and you already have my +1
 
@rolfl Yeah, he said yesterday that he would vote when he had ammo, I guess he "forgot" that ^^
 
Theck the bottom-right of his profile page: codereview.stackexchange.com/users/23788/lol-upvote
All his votes are gone.... twit.... there's a bunch of my stuff he should vote for too.
 
Speaking of votes, I just noticed my downvote/upvote ratio on StackOverflow: 1155 down, 3247 up. That's more than 25% downvotes!
 
0
Q: Making CSS rules for links in header more DRY

JGallardoI want to implement the cleanest amount of CSS through proper use of inheritance. All links need to be a shade of white, so lets say #fff HTML <div class="header"> <div class="headerLogo"> <a href="/">BruxZir</a> </div> <div class="headerMenu"> <a href="#">&equiv;</a> <!-- other ...

0
Q: Reducing nested while statements for building a grid?

chum of chanceI have the following grid shape: __ __ __ |__|__|__| |__|__|__| I have the following 3 types of shapes to fill it (they cannot rotate): __ |__| __ |__| |__| (6x6 one above, or full size) I have also 3 "shape lists" that need to fill it in priority, as in: ShapeList1 = all types S...

 
7:40 PM
@SimonAndréForsberg I rarely down vote.
 
@Donald.McLean On CR my ration is approximately 10% down-votes. Apparently I down-vote every now and then, but not nearly as much as on SO. I think some down-voting is healthy.
 
Luckily CR tends to be at least decent quality. SO has a lot of wrong/spam posts that get automatic downvotes from me. Not to mention the terrible questions that plague SO.... I would say 1/3 questions is complete rubbish there.
 
8:16 PM
@Corbin Unfortunately I have to agree. Add the fastest gun in the west and you'll have my reason for migrating to CR.
 
@rolfl 40 votes isn't enough.
 
11 points for mortarboard, just sayin'
2
 
@konijn How much you said?
2
 
0
 
lol
2
 
8:25 PM
Thanks!
 
@lol.upvote Oops you did it again...
 
@konijn Not so long ago, someone upvoted me to 4k level (was it @Corbin or who was it?), that someone said that he (I'm quite sure it was a he, but we need more females around here!) also had got upvoted by someone. I'm continuing to pay it forward. Unfortunately, you won't reach it until tomorrow...
 
no worries
I am planning to pay forward by setting some bounties once I have 4150
2
 
night folks. Finally Friday tomorrow! I hope to be able to do some real coding this weekend and post a question up for review.
 
8:38 PM
Good night!
 
0
Q: A class for messenging

www.arcmarks.comThis class provides animation messages to the user. Looking for general feedback. I've posted the library I use as well if you have time to look that over. /*************************************************************************************************** SMessenger - messaging system to prov...

 
0
A: Testing whether characters of a string are unique

DimaGood code. Consider converting a const std::string& parameter into an iterator pair: no reason to not support std::vector<unsigned char>, std::deque-s, etc. You could add a template helper function to have the code run when passed a string s itself, not begin(s), end(s). On a pedantic note, if ...

1
A: Quickly fixing unmaintainable SCSS code in Rails

cimmanonYou may want to look at Compass for generating your font-face information. Your media queries are a bit excessive here. Other than your font-face block, there's not a spec of code that exists outside of a media query. The absence of support for media queries is in fact the first media query....

1
A: Finding maximum Collatz sequence between 1-1000000

200_successThe key insight is that if you already know, for example, the value of collatz(37), then collatz(74) is just 1 + collatz(74 / 2), and you can reuse the previously computed result. Therefore, your collatz() function should have access to the results vector — either pass it in by reference, or m...

1
A: Reading from a serial port

William MorrisI would modify your serial reading function in a few ways, firstly by changing its name to reflect what it does. I would also move the accumulation buffer into the function, making it and its position counter static (which means they stick around without losing their value between calls) . Also...

2
A: Reducing nested while statements for building a grid?

unholysamplerThere is a fair amount of common code that can be extracted into a function. There is a common check in the while clause and the if clause. boolean CanAdd(LargeContentBlock largeContentBlock, ShapeList shapes) { return largeContentBlock.CanAddBlock(shapes.Peek().Size) && !la...

0
A: Making CSS rules for links in header more DRY

MalachiKleinFreund is right. if you want all the links the same throughout the header .header a { color: #fff; text-decoration: none; } and if you want the links throughout the entire page to be the same color than you want something like this a { color: #fff; text-decoration: none;...

 
8:55 PM
0
Q: A package for the DOM

www.arcmarks.comConcerned with the length of this and the organization. Looking to organize it better if possible. If anyone knows the jQuery equivalent of these methods I would like to put them in the comments. /*************************************************************************************************...

 
@konijn - you know, that in 38rep's time, you don't get +2 for wiki edits ;-)
32 ... not 38.
 
1
A: Making CSS rules for links in header more DRY

cimmanonThe worst aspect of your code is the markup, not the CSS. Unless you need the div as an actual styling hook, you can safely discard it. After all, you're not styling it in any meaningful way (what you do have can just as easily be applied to the descendant tags). <div class="header"> <a hr...

6
A: Coding style in Ruby format in an method and variable assign

toklandCase 1_a. Don't mix pure functions (sub) with destructive functions (sub!). Whenever possible use pure methods: zip_file = file.sub(directory, '').sub(/^\//, '') zipfile.add(zip_file, file) But can't you write simply? zip_file = File.basename(file) Case 1_b: I prefer to set variables. Givin...

 
9:16 PM
We've missed our birthday by 5 days! D:
2
Q: Happy birthday, ELL!

snailplaneOne year ago today, English Language Learners entered private beta. A week later, it opened to the public, and since then the questions and answers have been rolling in! So, what have we accomplished? We're getting 19.4 questions per day. Early on, this statistic hovered around the 15 mark, ...

 
oops?
47 points for mortarboard, just sayin' (what?)
^^ joke. I already got the badge (thanks @rolfl!)
 
Here's the 34 (+2 for some reason) people with mortarboard ... ;-)
 
9:32 PM
Show-off. ;-)
2
 
0
A: Testing whether characters of a string are unique

DimaGood code. Consider converting a const std::string& parameter into an iterator pair: no reason to not support std::vector<unsigned char>, std::deque-s, etc. You could add a template helper function to have the code run when passed a string s itself, not begin(s), end(s). On a pedantic note, if ...

0
A: Thread-safe wrapper around WCF ServiceModel.ClientBase subclass

ChrisWThe code in the OP seems thread-safe to me, but may not be the best solution. If the channel has many concurrent users, and if using the channel takes for example 100 msec, then 100 concurrent users would queue for up to 10 seconds before being able to use the (single) channel one after the othe...

 
There's only one site that I've ever managed a mortarboard on.
 
I got it on SO when I earned a +350 bounty on a weird Excel question. Only time I ever rep-capped on SO. Here? Got some help :)
 
damn, 245 points, what a waste now
 
10:09 PM
0
Q: A package for sort algorithms - v3

www.arcmarks.comAddressed both issues in this codereview post. Looking for perfect code. Hope this is the last rev. /*************************************************************************************************** **ALGORITHMS ********************************************************************...

 
@lol.upvote "Self-Learner", only if it's upvoted three times.
 
Stupid question: mortarboard?
Ah, never mind :). Should have googled first. Thought it was just a phrase and not an actual badge.
 
17
Q: Is Facebook coming to an end?

LessFaceMoreBookRecently, this paper has received a lot of attention (e.g. from WSJ) since the authors claim that Facebook will lose 80% of its members by 2017. The authors based their claims in an extrapolation of the SIR model. They based their conclusions on the amount of Google searchs for "Facebook", and ...

not CodeReview ^^^^
 
Interesting, but I'm pretty surprised anyone is taking that paper seriously. I saw it on reddit too.
1 Department of Mechanical and Aerospace Engineering, Princeton University

Mech and Aerospace engr are analyzing the downfall of a website? That seems rather..... Odd. I do find it incredibly amusing that they're using a pandemic model though. facebook is rather infectious.
 
10:27 PM
@Corbin LOL
 
10:55 PM
Conundrum:
0
Q: Logic inside class properties setters & getters

JBecktonTrying to build a case against this as we have a developer that likes to use class properties in place of methods. I think it's a bad idea. In some cases he is accessing the data layer inside the setter and getter. here is a snippet of code, what are your thoughts on this? private Dictionary<st...

^^^ Just been migrated, but likely not the OP's code..... consensus?
 
Close it: it's our policy not to use CR to build a case against the original developer.
10
A: Why is only my own written code on-topic?

lol.upvoteProof by [extreme] example. (based on a true story) Not too long ago, someone posted one of their employees' code and asked for it to be reviewed by the community. The OP wrote that based on the feedback we would give him, that he would decide whether to keep or to fire that employee. Would yo...

^ 10 upvotes.
And vote to close.
 
Not to mention the legal concerns.... :D
 
11:17 PM
0
Q: miniGame can you make it better?

user35471import random class MiniGame(): def init(self, name): self._name = name self._Skill = 10 self._Strength = 10 self.twelve = random.randint(1,12) self.four = random.randint(1,4) self.points = Points= float(self.twelve) / float(self.four) self.answer = round(self.p...

0
Q: Commenting in simple programs

Please Delete MeI am struggling with commenting and variable-naming. My teacher said I need to add comments to my code which is below. I am not sure where I could add comments (I feel it is self explanatory) or what I should say in comments. Could go through my code, and add in comments where you feel I should...

0
Q: Scrabble Algorithm review and Performance Suggest

kllrshrkAfter finishing Project Euler 24, I decided to make a scrabble type of application using /usr/lib/dict as my dictionary what I cat that into a word file. It does take a few seconds, and the dictionary selection isn't that great. Is there anyway I could make it faster, more effective, and with a b...

 
Is this Java? Or C#?
0
Q: Scrabble algorithm review and performance suggestions

kllrshrkAfter finishing Project Euler 24, I decided to make a scrabble type of application using /usr/lib/dict as my dictionary what I cat that into a word file. It does take a few seconds, and the dictionary selection isn't that great. Is there any way I could make it faster, more effective, and with a...

 
I'd say Java
 
Java: variables and methods are lowercase
 
Okay. I suppose could be replaced.
 
Java
 
11:54 PM
definitely.... and we have a nice, new, and active Java reviewer it seems.... ;-)
 
I wonder who that is...
 
Done a few, been around 10 days.
 
There are many Java questions, which is good. Not too many C++ questions, so I guess we're good with a few C++ reviewers right now.
 
and around SO for 2+ years
 
Seems the scrabble question is particularly appropriate given that website she has in her profile..... electrotank.com
 
11:59 PM
the company she works for does a Scrabble-like game.
 

« first day (264 days earlier)      last day (3748 days later) »