« first day (218 days earlier)      last day (3815 days later) » 

12:05 AM
@retailcoder My code is about 300 lines + 165 lines of testing :)
 
@SimonAndréForsberg if anyone finds 1 single edge case that breaks your code, I'll laugh my brains out :)
 
@retailcoder Lol, that's why I have plenty of tests. And still planning on adding some more as there are some edge cases I haven't accounted for yet.
 
But I'm sure your code can show a [some?] monkey some new tricks :)
 
Depends on the monkey
 
<cough>cobol</cough>
 
12:09 AM
rolfl is best monkey. :-)
 
I'm sure @rolfl knows all the Java tricks already, whether he uses them or not though, that's a whole different story. I guess my approach will be quite different from his.
 
0
Q: Join of two databases

JavaDeveloperThis is the most basic code to join two tables in a database. For tables it uses a simple list. Solved this using brute force, sorting and using hashtable. final class SportsMan { private final String name; private final int rank; private final String sport; public SportsMan (S...

 
12:27 AM
0
Q: Drawing stars around the center of the screen

RakanothI have an homework as follows: Write a program where you enter from the keyboard a number n. Then n stars are drawn onto the screen, circling around the center of your screen. You can assume that 1 < n < 20. The solution I came up with is below. import turtle window=turtle.Screen() wi...

 
12:37 AM
@rolfl In case you're interested, I somewhat updated my answer.
7
A: Speech processing on the Raspberry Pi

syb0rgThis is the main project my Raspberry Pi is dedicated to right now, so I figure I can add my two cents. Keep in mind this project is still very much a work in progress. I chose to use the C programming language for this project exclusively on the Raspbian OS, and that may have affected some of ...

 
Goodnight for now
@retailcoder Will post my code tomorrow.
 
 
1 hour later…
1:47 AM
@syb0rg bizarrely enough, just last week I got text-to-speech working on rpi behind a mock-up of the HAL9000 'eye'..... We are considering voice recognition next, but the others in the gorup are planning face recognition first.
 
@rolfl Interesting. Out of curiosity, what speech synthesis engine are you using?
Voice recognition is way easier to do than face recognition right now on the Raspberry Pi. The problem is a combination of new hardware (the Raspberry Pi CSI camera compared to slow USB cameras) and new software (no API's to access the Raspberry Pi camera, OpenCV support is limited, etc.).
 
2:20 AM
@rolfl if all your top tags are among the site's top 40 tags, you have 15 tags with 15 total score for non-wiki answers. You need 5 more of such tags to earn the site's first awarded [badge:generalist] - 2 of your tags are only missing 1 point, homework needs 2 more, and our next strongest tags have 11 and 10 points. I predict you earn [Generalist] by your 100th day :)
 
@syb0rg - espeak and google translate ... ;-)
 
[badge:generalist]: Provided non-wiki answers of 15 total score in 20 of top 40 tags
 
@retailcoder - I have not done the math....
 
And I doubt is at the top. :/
 
lol
 
2:22 AM
Not sure I understand the generalist
 
(but I think there should be a rolfl-only badge for that tag)
 
[badge:uniquest]
 
@syb0rg - I work in an interesting part of a big company.
 
Wait. If Jon Skeet has his own MSO tag, how come he doesn't have his own badge?
 
We hve a 'mascot', the HAL9000..... and I built it a few weeks ago.
 
2:23 AM
@rolfl on your profile page, under the Tags section, each tag has a score. Roughly, if 20 of these tags have a score of 15 or more, you win.
 
@rolfl Research and development? They can basically do whatever they want.
 
@syb0rg he's also working on some revolutionary project, code name Skynet.
 
@syb0rg well, yeah, right now I am working with 'watson'.
 
Yeah, Skynet
 
and also various toys from various companies that, in some cases, don't even have code names.
 
2:26 AM
Is SkyNet on this list?
Kinda makes me think of Stuxnet.
 
@rolfl's work makes Google search look like it was written by a 4-year old.
 
@retailcoder I'm not sure if your are joking or serious now...
 
 
AHHHHHHHHH!!!!
 
So, I built that ... (That's my kitchen).
 
2:29 AM
It's your fridge?
 
I messed up when installing the webcam... and 'dimpled' the wood around it.
Almost drilled through it.
Anyway, it has an rpi behind it, and speakers.... etc. (and 720p webcam and microphone).
With the network I can hook it up to millions of dollars of resources if I want... ;-)
 
Wait, the thing is like 4 inches high right?
 
@rolfl Ohhhhh
So what function does it serve?
Besides talking of coarse.
 
It's a small fridge
 
The lens you see is 12cm (4.5 inches?).
The entire box is 18" by 6"
 
2:31 AM
cm is good enough
 
It is currently stuck to the side of a rack in our lab
And it is an open play-thing for the team to experiment with.
It has voice, vision, brains, and sound.... what it needs is tactile and motion ... hmmm.
 
@rolfl Cool. I wish I had some sort of development team.
 
I just do the Java ... and I know how to use a saw .... I'm not the smart one
 
@rolfl Quadrocopter?
 
It has to be contained within the lab (and meet health-safety regulations).
 
2:34 AM
Like, no edible parts?
 
But, voice recognition would be seriously cool.
 
Can you make me a R2-D2?
 
@retailcoder - I got challenged because the box is wood.... flammable.
 
@rolfl I developed a voice recognition library in C. Efficianized for speed.
 
@retailcoder one of the guys printed himself one ... (at a 'public' hackerspace).
@syb0rg efficient enough to not overwhelm the rpi?
 
2:36 AM
@rolfl Going off of the quadrocopter idea: this autonomous helicopter drone!
Easily.
I had some of the code reviewed here.
But only parts.
 
We have decided we need to offload the video to a full server .... but sound processing may stay.
@retailcoder whatever we do has to be directed toward profit ... ;-)
 
@rolfl The only downside to my library is that is has to be online for accurate recognition :/
I'm working on that.
 
OK, online is a problem.... but, I imagine the online component can be duplicated on a local server? Anyway, it's a bit moot at the moment....
We have to be super careful about legal and compliance.
 
@rolfl I mean one with voice recognition in any human-understood language, with IR vision (hacked-up Kinect?), built-in Wi-Fi and a projector. Don't tell the receptionist just yet, but she's losing her job. Can still answer the phone and silently dispatch calls while projecting a PowerPoint presentation in a meeting.
^^^ Profitable?
Can make you an espresso, too.
 
@retailcoder given a choice between good R2D2 and a good secretary, the CEO's money will go to the seretary every time ... ;-) They already have a smart phone to do the R2D2 things,.
 
2:44 AM
lol
 
OK, I got Java processing a large file from 3 hours to 2 minutes ... ;-)
 
@rolfl Large file of what?
 
Amazing what a difference memory-mapped IO can make.
It is a profile/trace of a long-running system generating up to 1000 events every second.
(and it runs for 30 minutes).
Now I need to graph out the millions of events and figure out why my 'big' computer (128 cores) is not fully utilized.
 
And you are using Java for this?
 
Sounds like SSRS report queries we're stumbling upon at work - someone made them and they work. Execs run a report for 45 minutes and find it normal. Then you look at the query and after a couple "WTF?!!" you hit F5 and it runs in 17 seconds.
 
2:47 AM
Yes.
 
@syb0rg, Welcome to the Ready room!!!
 
@syb0rg written properly Java is fast.....
 
@syb0rg or the ammo room
 
@Malachi Hey welcome back!
 
thanks
 
2:48 AM
The 2nd Monitor
 
@Malachi you get jet lag from texas?
wuss
 
got some friends over this weekend too @rolfl
 
@rolfl That's true. Unfortunately, Java is rarely written properly.
@Malachi Hello.
 
Ooohhhh .... look at him showing off ... he has ** Friends ** !!!
2
 
just thought I would show up and say hi.....only 1
 
2:49 AM
2
Q: What should be the name of our main chatroom?

retailcoderOur main chat room is currently called Code Review General Room, with "General discussion about Code Review." for a description. I propose The Zombie Hunters' Lounge, but I'd like the community to post their ideas here (1 per post, include why it's the best name), the one with the highest number...

 
@rolfl @Malachi It sounds like you guys know each other IRL.
 
Naahhh, I just invade people's private space ... ;-)
(I have huge resources linked up to the world networks, I tracked his flight ...).
 
NSA much?
 
Sorry, can't talk about it ... ;-)
 
@syb0rg he asked Watson "Malachi" and it said "What is geek with friends?"
 
2:54 AM
I'm about to answer an unanswered C++ question. Hopefully this review won't suck.
 
@rolfl You live in Canada according to your profile, and @Malachi lives in South Dakota. So you are part of the NSA...
@Jamal Link to it when you post it. I'll read over it and see if any part makes sense to me :)
(Laughing at my own skills in C++, not yours)
 
Alright. I don't feel I can tackle the entire problem (mostly brought up in the comments), so I'm just reviewing the flaws in the code itself.
 
@Jamal consensus is "that's fine, makes more room for more answers and brings the answers/question ratio up!" :)
 
If my answer doesn't suck, then I can get another Revival. Moreover, I'd really like to see what others can contribute to this, but I can wait.
 
@syb0rg - nope, not sure about Malachi .. but I'm with 'big blue'.
(and why would you think any Canadian works for the NSA ?
 
3:02 AM
@rolfl BECAUSE THEY ARE EVERYWHERE
 
lol
 
Haha
 
@retailcoder - you have suffenly made me want to participate in two more ways .... (well, one more, really).
i am goin go EDIT my way to generalist....
 
All those good answers of mine on uestions that were badly tagged are now going to be COBOL questions ....
 
3:04 AM
@rolfl is the new @jamalizer!
 
Make COBOL really popular ... ;-)
 
lol
 
0
Q: Fail-proof AJAX

Jarolin VargasIm working on a page using AJAX that will get an entire .php page when the navigation button is clicked. I have that set up and working right but this is my first time using AJAX, so im not sure what the best practices are and what i can do to prevent failures and display error messages. Here is ...

 
Top 24 users scored > 100 rep last week :)
Top 15 users scored > 100 rep the week before
2 months ago: Top 9 users scored > 100 rep during the week. Reputation distribution is increasing.
^^ i.e. @rolfl isn't taking everything
 
@retailcoder Are you just calculating these yourself, or do you have a source for your information?
 
@retailcoder Ohhh, me likey.
 
Okay, here it is:
0
A: Rounding decimals

JamalI agree with the comments regarding the use of floating-point with money (it's also not used in banking for those reasons). Nonetheless, I'll point out some general flaws I've found in your code. There should be a std:: in front of pow(10.0, pos) since you're not using using namespace std. Th...

 
@Jamal Looked good to me, using my limited skills.
 
The return stuff, at least, is related to C. :-) The casting is C++, or at least the one I've given.
Revival #5! :-) I'll see if I can find other zombies I might've missed.
 
@Malachi got your poker hand eval under way?
 
3:33 AM
@Jamal Yeah, I got that. Casting I kinda got, but it was more vague to me.
Anyways, I just reviewed this question (just a few notes).
0
A: Join of two databases

syb0rgJust some simple notes: Right now you aren't using generics: Map hashMap; // no generics Map<String, Object> hashMap; // generics The variable result can only be null in the function innerJoinHash(): result.add(new Result(sportsMan.getName(), sportsMan.getRank(), sportsMan.getSport(), spor...

 
0
Q: Critique of FilterInputStream and FilterOutputStream classes

weare138I'm working my way through The Java Programming Language, Fourth Edition - The Java Series. This is Exercise Exercise 20.3: Create a pair of Filter stream classes that encrypt bytes using any algorithm you choose—such as XORing the bytes with some value—with your DecryptInputStream abl...

 
 
2 hours later…
5:19 AM
codesparkle is next ... about to reel in both the moderators!
well, except sepp2k...
 
5:55 AM
@rolfl changed my code to be able to compare 2 players' pokerhands. Getting uglier everytime I look at it.
 
@retailcoder no i won't have time to do one this weekend
 
@Malachi just posted a revision of mine, turns out RPLSL was way, way easier than that!
 
@retailcoder I will have to check it out later
 
Going to bed, brain fried.
 
Heh, how about renaming the Weekend CRChallenge to "Weekend Warriors".
(the chat room, that is)
 
6:11 AM
@rolfl: What about moderators?
 
Well, I have more rep than them....
I am 18 behind codesparkle...
THat's like farting distance, let alone spitting distance.
And, what's with spee2k?
 
What about sepp2k?
 
6:26 AM
Absent?
 
He does seem to be around, based on his "seen" time. But there probably isn't much to do around here when there are no active flags.
 
 
2 hours later…
8:09 AM
0
Q: Determining common divisors of two numbers

Razor1692Can i make this code shorten?or is there a better algorithm to find the common divisors of two numbers than this? import java.util.*; public class Testing1 { public static void main (String args[]){ Scanner x=new Scanner(System.in); System.out.print("Enter the 1st number(larger number) ...

 
8:21 AM
0
Q: Gets JSON from a remote api sometimes hangs. Can I make this any faster?

devsTesting on localhost, it likes to take a bit longer then I would like to get the results, and then would give me the Fatal error: Maximum execution time of 30 seconds exceeded PHP error. I am wondering if there is any way to stop that error from happening, as well as making my class faster to fe...

 
 
3 hours later…
10:58 AM
0
Q: Trying to procedurally create a universe

CaimenBasically I'm trying to do something like Dwarf Fortress style world generation and compute a history of a small universe as an experiment all in javascript. I have some of the basics setup now and would like to know if anyone has any tips on what I should re-do or think about for the future. I...

 
 
1 hour later…
11:58 AM
0
Q: read a file and write it in matrix form

rami want to read a file which contains data given below and write some values in the matrix form 0 1 1 2 3 4 i want to write the last 3 values in each line as a 1*4 matrix like given below: 1 2 3 4 i also want to name the matrix as R and use it for matrix multiplications

 
 
1 hour later…
1:17 PM
0
Q: Reading a certain pixels color from a window

JohanI'm currently reading a certain pixels color from a process window like this: [DllImport("gdi32.dll")] private static extern int BitBlt(IntPtr srchDc, int srcX, int srcY, int srcW, int srcH, IntPtr desthDc, int destX, int destY, int op); public static ...

 
 
2 hours later…
3:05 PM
0
Q: Review of approach to inheriting from std::exception

John FitzpatrickI would like a review and recommendations for improvement of my approach to resuing std::exception. Just a quick justification for the four constructor arguments: I want to force myself to always provide the origin of the exception when throwing an exception. class ExceptionCyclOps : public st...

1
Q: Looking for a better way to handle this growing array used for preg_replace

Charlie74first time visiting Code Review. I figured this was a more appropriate spot than SO for this question. Here goes... Currently, I have a php function that converts bbcode format text in to HTML (among other things). A code snippet is as follows... function bbcode_format ($str) { $simple...

 
3:29 PM
0
Q: Is it bad practice to increment more than one variable in a for loop?

afuzzyllamaWhile coding today, I came across the following loop in C#: for(int x = 0; < max_x_index; x++){ for(int y = 0; max_y_index; y++, count++){ { some2Darray[count] = ...; } } Would this be consider bad practice? Would the following be a better way to achieve the same result:...

 
4:11 PM
0
Q: Python Script to Search PirateBay

BenI've written a very basic Python 3 script to search ThePirateBay. Since the tracker doesn't have an API, I had to parse the HTML using BeautifulSoup. I'd like to get some reviews, I'm pretty sure the code is crap, so fire away. I'm also interested in projects I could read to improve my Python. H...

 
4:41 PM
0
Q: Detecting misuse of Async/Await: Prevent blocking calls

thesaintI am working on a scalable game server system and trying to use await/async excessively for this new project. Up till now I managed to run into several pitfalls. I have figured out most of the solutions and developed a "common practice" of how to write async methods such that those pitfalls are e...

 
 
1 hour later…
5:48 PM
0
Q: Poker Hand Evaluation - Finding a straight

Simon André ForsbergWeekend Challenge #2 - Poker Hand Evaluation Because of a size limit on Code Review I have to split my weekly challenge result in two, and here is a part where I think there is some room for speed optimization. I started writing this method in another approach, but after several hours it still d...

0
Q: Weekend Challenge - Poker Hand Evaluation

Simon André ForsbergWeekend Challenge #2 - Poker Hand Evaluation Very early I decided to support the usage of wild jokers, even though I knew that this was going to lead to trouble more work. I also wanted to support big collection of cards, for example if you have 7 cards and choose the best 5-card poker hand of t...

 
Because someone (@retailcoder) tends to confuse with , I have suggested a synonym.
@rolfl I think you might be able to find a way to optimize this method: codereview.stackexchange.com/questions/36915/…
 
Does anyone already have a tag score of 5 or more in ?
 
@Jamal Yup, I got 10 score.
 
Okay. You should be able to vote it up, then.
 
6:05 PM
I can't upvote my own tag-synonym. Or my own posts. What should I be able to vote up exactly, @Jamal?
 
@SimonAndréForsberg: Oh yeah, that's right. Anyway, with synonyms, anyone with sufficient rep and tag score can vote up a particular proposed synonym. After enough upvotes, it will be implemented.
 
True. I think a tag-synonym for that can be useful, since it is easy to mix up weekly with weekend. ( * coughs * @retailcoder )
Speaking of @retailcoder, here might be a target for you to shoot at. I have no idea if this is a good question/answer: codereview.stackexchange.com/questions/21537/…
 
I can't quite see what's wrong with this.
 
Here's another C# answer without upvotes: codereview.stackexchange.com/questions/3544/…
 
Yeah, it should receive better answers. I can remove the "thanks", thereby bumping up the question.
 
6:18 PM
Here's an Objective-C question with two answers that look good, I think they need more upvotes: codereview.stackexchange.com/questions/19880/…
 
@rolfl I like your answer codereview.stackexchange.com/a/36910, but you seem to be catching some flak. Would it bother you if I edited your answer to suggest using Debug.Assert(count == max_x_index * max_y_index) at the end? Or would you prefer that I post that as a separate answer?
 
Objective-C, you say? I do also see that it doesn't have a language tag.
 
Let's give this one a necro-badge, shall we? codereview.stackexchange.com/questions/13591/…
@Jamal It has the , there's not much choice then besides objective-c, but it could surely use an objective-c tag as well. Me fix.
 
0
Q: Pi to the Nth Digit

Jacob2471I'm trying to teach myself Objective-C/Cocoa for eventual iPhone development but I figured I would start with a terminal app. It takes a user input, strips everything but numerics, then displays PI to the number that is left over. Could anyone have a quick look over my code and see if there's an...

 
@200_success ... I don't see any flak ... ? Am I missing something?
 
6:25 PM
@SimonAndréForsberg Do you mean we should close it as non-working code?
 
@200_success No, I was more thinking "give him upvotes"
 
As for editing, In this case, I have never used Debug.assert ... so, no .... and, since no other indications are given what the array looks like, it is introducing constraints which may not exist.
 
@rolfl I'll post a separate answer, then.
 
7:11 PM
0
Q: Python regex either or case

Jesse TravisI have a small module that gets the lemma of a word and its plural form. It then searches through sentences looking for a sentence that contains both words (singular or plural) in either order. I have it working but i was wondering if there is a more elegant way to build this expression. Thanks! ...

 
7:41 PM
0
Q: Code refactoring in PHP

user3068907I'm new to code refactoring in PHP and was wondering if anyone could provide ideas on the basics. I've got sample code shown below provided to me at work for learning purposes. Any ideas are appreciated <?php class Film { public function __construct($title, $priceCode) { $t...

 
8:24 PM
0
Q: Football Elo Rankings

LazySloth13I have created the following code: class Club(object): def __init__(self, name, points=1000): self.name = name self.points = points def __eq__(self, other): return self.name == other.name def __gt__(self, other): return self.points > other.points ...

 
 
2 hours later…
10:24 PM
It's oh.... so ... quiet!
 
@rolfl DING! (when you least expect it)
Song of the moment: youtube.com/watch?v=g9ztHc7kULI (thanks to @rolfl's comment)
 
10:40 PM
yeah.... I was listening to that in the car just now.
@SimonAndréForsberg - I have edited my answer, added comments.
 
@rolfl Great. Will have a look soon. Working on a meta question
 
OK... I am hoping someone goes through an shoots some targets at some point....
 
Posted on meta: (StackExchange bot will probably tell you about it soon as well)
0
Q: Code should include a description of what the code does

Simon André ForsbergRelated: What criteria do you use to upvote a question? What makes a good question? I feel that it is currently too easy to copy some code that you have written and put it up for review here on Code Review. My opinion is that if you want a review of your code, then you should also be able to ...

 
I am tantalizingly close to another max-out.
 
I scanned the list of questions without an upvoted answer trying to find some answers to upvote, I did manage to find some, and also some questions which I might attempt answer later also.
 
10:49 PM
@SimonAndréForsberg - Oh, you accepting it already??? did you figure out what it does?
Hey @JamesKhoury
 
0
Q: Code should include a description of what the code does

Simon André ForsbergRelated: What criteria do you use to upvote a question? What makes a good question? I feel that it is currently too easy to copy some code that you have written and put it up for review here on Code Review. My opinion is that if you want a review of your code, then you should also be able to ...

 
@rolfl Yup, I managed to figure most of it out at least. And I have also tested it and it works fine. It wasn't nearly the approach I expected though.
Plus, I thought you could use a push towards the 200 rep limit for today :)
 
@rolfl Hey!
 
Yeah, just 10 to go now .. I do appreciate it... twice in the past couple of weeks I hit 190 .... nevermind, the 10 came in, plus more ... thanks all. : 200 today
Also passed 3.5K and have extended edit privs
 
Good job!
 
11:00 PM
0
Q: Making an array whose elements are defined by a struct

user33187This might be a basic question for C. I'm making a struct called "check_t" and I want to make an array whose elements are of type "check_t". This array is called "enqueued". The struct check_t contains an integer x and a lock (for multi-threading). Here's what I have! typedef struct _check_t{ ...

 
Congratulations! One day I'll join you in the 3.5K+ range.
@rolfl Have you had any chance of looking at the rest of my code for the challenge?
 
I have been going through it ....
There is a lot.
And it also means that I will not be doing a solution this week.....
 
Yeah, I know. I guess my solution will be the one with the most code at least. Not sure if that's a good sign or not...
It's alright, there are no deadlines for the weekend challenges AFAIK :)
 

« first day (218 days earlier)      last day (3815 days later) »