« first day (196 days earlier)      last day (2532 days later) » 

2:16 AM
Q: A program that deliberately makes "mistakes"

RakanothI am confused about an assignment question. We are simply asked to code a program which deliberately makes mistakes. The assignment question is as follows: Write a program that deliberately makes the following “mistakes”: 1-)reads a string and an integer value and multiplies them. Print ...

Q: Character Analysis

DonCharacter Analysis If you have downloaded the source code from this book’s companion Web site, you will find a file named text.txt in the Chapter 09 folder. Write a program that reads the file’s contents and determines the following: • The number of uppercase letters in the file • The number of l...

2:29 AM
@Jamal I've edited the tag wiki for (copied content from SO) - still pending approval, what's going on, you're much faster than that usually? :p
2:40 AM
@retailcoder: Sorry, I was too lazy to confirm on SO. :-P I'll do that now.
@Jamal I truncated the excerpt, didn't think it was relevant to CR.
@retailcoder: Good call. I would've rejected it had it been left there.
@Jamal gotta keep that flawless edit history! :)
@retailcoder: Yes, but now with editing privileges, I'll have less opportunity to smite you with a rejection. :-(
@Jamal I still have 449 rep points to go!
2:53 AM
@retailcoder: What are you waiting for, then? Pump out them answers like SO has taught you!
@Jamal LOL! The thing is... it's precisely what I'm doing right now haha! In spite of what came out of Grace Note's post, I'm filling the blanks in some unanswered questions (4-5 done so far).
@retailcoder: Great! I've done what I could do in the past, and I've gotten two Revival badges from it. Now we just need the voting and we're good...
@Jamal hey where's that other semi-revived post you mentioned, so I could go and see if it's worthy of an upvote?
I didn't know you could earn [badge:revival] more than once!
(oops I thought there'd be some formatting for that)
@retailcoder: Give me a moment.
@retailcoder: Actually, it looks like two of them qualify (I might've lost count back then):
A: How could I make this path-finding code dynamic?

JamalI'm going to try to review this in spite of the lack of decent indentation and whitespace (in some places). As such, I won't mention them below. I'd recommended improving on this first, as that will help you improve everything else. The #include <...>s could be in alphabetical order for bette...

A: Print all permutations with repetition of characters

Jamal In case you ever want to just display the string (if you have something like "AAA"): // if a different character from the first is not found if (s.find_first_not_of(s.front()) == std::string::npos) { // display something... } This isn't preferred: int len = s.size(); size() returns an s...

So yeah, determine if they're worthy. If you cannot tell, based on your understanding, then that's fine.
3:17 AM
@Jamal I cracked up at the 2nd one (well the 2nd one I upvoted, i.e. the 1st one you listed here) - you actually sort your #includes alphabetically? Damn I need your Canadian clone on my team!
@Jamal since my tag wiki edits were accepted I'm now above 1050 and can afford to pay a 50pts bounty - do you think I should put one on codereview.stackexchange.com/questions/33035/…, or wait 'till I have another 50 extra rep to make a 100pts bounty? (or no bounty will ever bring attention to this unsalvageable question?)
@retailcoder: How about I just go there? ;-) I've always wanted to visit another country.
@Jamal How does one link to a question and make it look like the links you've posted?
@retailcoder: Just post the question like by itself (even without the @).
The URL.
Q: Revisited IsTypeSafe method implementation for "type-safe" List

retailcoderFollowing up on List<T> implementation for VB6/VBA, I'd like some thoughts about the revisited IsTypeSafe function, below. The previous version pretty much implemented VB.net's Option Strict setting, by only allowing widening numeric type conversions, and preventing implicit conversion between n...

@Jamal Ah-ha!
@retailcoder: Nice! Well, if you have any related Revival answers, I could try to determine if they get my vote. I really want to stay good about this because "vote recommendations" alone, or what have you, aren't good etiquette.
3:34 AM
@Jamal my last 4 answers were all on old (old) unanswered posts - what do you mean "vote recommendations"? The system will reverse our votes if it finds it's a suspicious voting pattern. Izzat what you meant?
A: New to SQLite and am asking for guidance

retailcoderI have never used SQLite either, but something is jumping at me in your code: the addAuthor() procedure owns the connection, which means if you're calling it 10,000 times in a loop you're going to be opening and closing 10,000 connections, which is ..well to be honest, nuts. Looking at the metho...

@Jamal that's funny - your permutation post rang a bell:
A: Generating permutations with repetitions of string

retailcoderI'm not going to rewrite this code right now, but I can highlight a few points: Naming. Identifiers should have a meaningful name. Disemvoweling is evil. Adding a 1 after an identically-named variable is bad. Adding a 2 after an identically-named variable is terrible. Adding 21 instead of a 3...

A: Mapping Query Result with Entity Properties

retailcoderObservations You are reinventing the wheel. Yes, an Object/Relational Mapper such as Entity Framework adds an overhead, but if your queries are select abc from xyz I don't see it being an issue. Using reflection has an overhead and performance hit, too. Projecting R.report_type_code into a full...

@retailcoder: Well, you know me. I'm too humble, although we all need the votes.
Q: What we use volatile keyword here?

Behind D Wallspublic class Singleton { private static volatile Singleton instance = null; public static Singleton getInstance(){ if(null == instance){ synchronized(Singleton.class){ //double check if(null == instance){ instance = new S...

@Jamal Same here, this doesn't quite feel right... although I'm sure I read somewhere (hey did you see the new MSO theme? I think it's just been deployed, wasn't like that earlier today!) - argh can't find it, anyway I'm sure I read on MSO that discussing answers on Chat was one way of getting people to see your posts - and upvote them. Just don't serial-vote please (that would be X upvotes in < Y minutes)!
3:50 AM
@retailcoder: Of course. I think the permutations one, at least, needed more attention. Although much of that is best confirmed by a C++ reviewer, it could also be confirmed with online resources regarding the Standard Template Library.
2 hours later…
5:30 AM
did you guys take off already?
@Malachi: I'm still here.
@jamal Hey. oh dang it is getting late I didn't realize how late it was...
looks like you guys have been busy
@Malachi: It is getting late here, too. Probably also why there's less activity.
@Jamal: we live in the same time zone I think.
@Malachi: Right. I forgot. Anyway, yeah, we were just discussing some answers.
5:41 AM
@Jamal: I opened a couple of your questions and checked them out. I am going to try and grab a few questions while I watch some netflix. my Wife works graves some nights so I am free until I get tired and decide to fall asleep
@Malachi: I should be going to bed, too. I have a weekend full of... homework.
sounds like fun, I am going to learn some more Javascript and answer some questions if I can. and do the same
have a good night
@Jamal: and a good weekend
@Malachi: You, too.
6:13 AM
@Malachi I'm half-asleep, but still here
Q: Call of Duty - We're on a mission

retailcoderThis is a direct reply to Grace Note's recent CR review, more precisely the following part: (emphasis mine) Unanswered Tying in to all of the above is one of the most pressing concerns about the site I had in my own review, which is the gigantic pool of unanswered questions. There are, ...

Q: Call of Duty - We're on a mission

retailcoderThis is a direct reply to Grace Note's recent CR review, more precisely the following part: (emphasis mine) Unanswered Tying in to all of the above is one of the most pressing concerns about the site I had in my own review, which is the gigantic pool of unanswered questions. There are, ...

tss that's late, SE bot :)
6:41 AM
@retailcoder: LOL let me read that post, I was busy looking at your unanswered question. trying to make sense of what it does.
6:51 AM
@retailcoder: good Question
7:11 AM
@Malachi which one?
Side note... now we know who the real CR addicts are! BTW I don't know who starred my comment @Jamal sorting his #includes alphabetically, but that got me a shiny new badge!
7:24 AM
that was me that starred that comment in chat. I liked it
@retailcoder: I was looking at this one codereview.stackexchange.com/questions/33035/…
@retailcoder I was sitting there typing up that nice answer and before I was done someone else answered and it was you!!! LOL we are Addicted lol
Thanks! It's part of a bigger scheme, a List<T> implementation - that function essentially allows the List to determine whether a given value can or cannot be added.
...And LOL!
@Malachi Seriously, no answer for 13 months, and then two answers within a 25-minutes span... if he comes back, the OP is going to think, WTF is up with these two?!
@retailcoder: I know right
@retailcoder: he is active on Stackoverflow. was on there like 22 hours ago
@retailcoder: Wait, did I do that? I haven't clicked on any stars lately. Speaking of which, why aren't we starring truly important messages? Could be useful for others.
@Malachi, @Jamal: I think I'll call it a day - 55pts yesterday and 54 today and I haven't even gone to bed yet.. I don't know about your timezone but it's 2:35AM here!
@Jamal: thought you were going to bed? and second thing, I starred it.
you must be eastern time huh?
7:36 AM
@Malachi yup
it's an hour earlier here
@Malachi: Nope, central. I'm hungry anyway.
@Jamal, @retailcoder: night guys, I am outta here.
@Jamal, @Malachi: 'later!
4 hours later…
11:15 AM
Q: Connect Four in Ruby - trouble with conditional return value

daxI'm writing a 'Connect Four` game in Ruby, and while I've been using Rails for some time, I've never used only Ruby - so you could say I'm a Ruby Noobie. The following method takes an array (the game board as it stands currently - 8 arrays of 8 elements), a column (the user input or drop_locatio...

Q: Why doesn't this refactor work?

daxI have a piece of code that I'm trying to refactor - or I should say I tried to refactor - original: winner = @game.check_win($current_array, player) break if winner == :winner refactored: break if @game.check_win($current_array, player) == :winner @game.check_win($current_array, playe...

12:08 PM
Q: Review my PHP router class

macrossI'm writing yet another mvc framework just for learning purpose and i would like you guys to review my code. Whenever i'm coding i have that feeling that my code is horrible and not the most efficient way to achieve something. And that feeling really bugs me allot! So right now request class tak...

3 hours later…
3:20 PM
Q: c++ automatic function call on scope exit

dannyI need to add logging functionality for an existing code, based on a result of an operation. I was thinking of creating a class that when constructed receives a condition function and a function for execution, and based on the result of the condition, the code will be executed. Example: class ...

2 hours later…
4:59 PM
Q: pretty print braces - Review Request for my source code analyzer

MuratI wrote a simple utility script to process source code files, extract and pretty print braces. It could be very useful for spotting the ugliest files in a code repository. So, I tidied it up a little bit and open-sourced it here. I would very like to have your suggestions and comments on how to ...

Q: a more efficient enqueue algorithm in Java

MandMSo I have this simple code in java. It enqueue (adds) and element to the end of the queue (implemented by an ArrayList) without changing the original queue. The code: public class MyQueue<T>{ private List<T> body; // some constructors and helper functions. //copy constructor public Queue(List<T>...

1 hour later…
6:26 PM
Q: PEG.js grammar for parsing CSS selectors

sqyklyI have a library that's parsing some expressions, part of which is a CSS selector. More accurately, it's a jQuery-compatible selector. The selector itself is opaque to my library - I don't need to pick it apart, and I don't need to verify that tag and attribute names are valid HTML, or that its...

6:45 PM
Q: jQuery plugin to ajaxify forms

YannisThis is my first foray into the wild world of jQuery plugin development. The plugin "ajaxifies" forms, which isn't particularly spectacular: It gets the basics (action, method) from the form itself, serializes the form's fields, and sends the request. Users can provide (via its options) callb...

7:05 PM
Q: Dougles Crockford's alternative to using new in JavaScript

HMRThis is a question about performance and what pattern would be favorable to that. Often there are people who say the module pattern (closures) is perfect (it can be in some situations) and point to Douglas advocating it. It may however be a bad desing if a lot of instances need to be created ...

7:46 PM
Q: Should this question be closed for "not asking for good code"?

JamalTelling the user the number of days it's been since January 1st So far, this question has: 4 total close votes 3 have decided to Close (from the queue) 3 have decided to Leave Open (from the queue) One user has indicated that this question is off-topic because it looks like it violates rule ...

7:59 PM
Q: Validation class to avoid ugly if-else blocks

Ravi KumarI've answered this question on Stack Overflow. The problem is - there are 30 columns in an Excel sheet and I need to validate each of the fields with different validation logic. The code should avoid a lot of if-else blocks. I have used strategy pattern to solve this. I would like to get a revie...

2 hours later…
10:17 PM
Q: Can a "Not your code" default off-topic option be added to the close dialog?

rolflA number of Questions have come up recently where the code is not the asker's own code, prompting a 'close' response. It would be convenient if there was an 'off-topic' close option that included: off-topic because the code you want reviewed is not your code. See the help (item 2) for on-topi...

10:50 PM
Q: How Pythonic is my Project Euler problem 5 solution?

Carl VeazeyI have implemented a solution to Project Euler problem 5: 2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder. What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20? My solution uses Python 2....


« first day (196 days earlier)      last day (2532 days later) »