« first day (220 days earlier)      last day (2171 days later) » 
00:00 - 18:0018:00 - 00:00

6:00 PM
On the other hand, I would still not quite like moderating on SO. Have you seen that close queue?!?
@retailcoder: The first half seemed easy, and the last half hardly seemed doable. I wasn't going to pass this class anyway. Better luck next time (if I take this class again).
 
I don't have 3K on SO yet, but 104.1K looks like a scary queue...
 
0
Q: Matlab Loop not working

user3071257Can someone please tell me why r in downRight is always going up to 5 when I have said to record it's value as soon as downRight is given a value? A = 5 16 18 4 9 9 10 14 3 18 2 7 9 11 21 3 7 2 19 22 4 9 10 13 8 for r = 1:5 if isempty(normal) == 0; normal = s...

 
@Jamal just don't do what I did - I couldn't get calculus through my skull, dropped out. Now I regret it. (and I still couldn't get calculus through my skull)
 
I fear that I were an SO mod and had some spare time, I would be spending all day closing crap. But the queue would still increase in the meantime.
@retailcoder: On the contrary, I love calc. I'm taking III next semester and am looking forward to it.
Another off-topic question?
 
@Jamal Yes I have seen that close queue. A couple of months ago I spent all my close votes every day trying to make it shorter. I've given up on that by now.
 
6:06 PM
Well, they have their issues, and we have theirs (their closing queue and our unanswered questions).
 
They need a serious, coordinated operation close-vote thing à la CoD.
 
@retailcoder Now you're a bit closer to 3k there
 
It'd take many people working on the queue at once to surpass the crap coming in at the same time. Even then, the queue will keep growing since it's such a large site.
 
@retailcoder I believe this is their version of CoD.
Yes, I believe the main problem of StackOverflow is that they are overcrowded. It has simply grown too big.
And so they get a whole lot of crap.
 
Actually, I think they have several CoD posts. :-)
 
6:10 PM
Then they need to lower the number of users for effectively closing a post. No?
 
Heck, they won't even lower the rep requirement. Not that I would meet the lowered one anyway.
 
Certainly over half the posts in the close queue (the oldest ones) should be auto-closed by that Community jerk-bot.
 
@retailcoder: Am I being paranoid, or are we becoming the next Programmers (back when it apparently was a dumping ground for off-topic posts)? Many SO users already have sent off-topic code here, yet we don't do the same.
 
@Jamal I see it as a good sign: more and more people see us as a destination. It's only a matter of time until they realize we're a destination for what exactly.
 
Yes, that is true, at least for the users who would be interested in bringing along working code.
Of all the posts I've migrated, none have been rejected (I think). :-) But I mostly have the flaggers to thank for that.
 
6:20 PM
@Jamal If you are paranoid, then I might be paranoid with you. I also feel like CR has gotten a whole lot of Off-Topic stuff recently. Feels like they are too afraid to post on StackOverflow (or even can't post there because of being question banned) and so they come to the friendly CodeReview community instead, hoping that someone can help them here (before their question gets closed).
 
I do understand the SO thing, but I still don't use it as an excuse to post off-topic questions. I also cannot tell if they're banned on the other site, so I just have to make assumptions based on their posts. We certainly don't have to be arrogant, but we still need to follow the rules. SO may be snarky at times (something I'd reserve for spam or zero effort), but we shouldn't follow suit. Even if the user is disappointed about being sent back, so be it.
 
@SimonAndréForsberg - and apparently I feed these rats, and they keep coming back ?
 
@rolfl Not sure what effect your answers have on those posters. Hard to tell what causes what. But if they get a response once, I guess they are more likely to return.
 
Could possibly be help vampirism.
 
@Jamal here's an example of a question that is off-topic, but was well worth a review none-the-less ... a case where you can still review a broken question:
4
Q: Converting a 32bit number in a proprietary timestamp with PHP

Darren BealeThis is a copy of a posting I made on SO, it was suggested I post it here all I've changed from that post is I'm now doing the bitwise AND using a decimal number rather than using bindec("111") to create the mask. The output is identical. I have a 32 bit number represented as a HEX string that I...

 
6:31 PM
Still looks good in my opinion. Doesn't seem like someone hoping to score free codez.
 
he declares that his code is not producing the result he wants ....
 
I think one of the most common problems is that people on StackOverflow don't exactly know what CodeReview is and send users here.
 
I meant in the way the question is structured, not the state of the code. But yeah, it seemed like a good time to review that code anyway.
@SimonAndréForsberg: I still fail to understand how anyone would recommend another site without first reading that site's Help Center. Imagine if such users one day became moderators, having the ability to migrate questions to any site.
 
@retailcoder, what do you think of this answer, check out the loop he uses as an example at the end.
-3
A: Is it bad practice to increment more than one variable in a for loop declaration?

NobodyAs I see it the question boils down to: Is the code more readable in one of the two versions? IMHO the version where the increment happens in the head of the for is more readable, because that is where you would expect increments to happen. Another bonus is that there is a guarantee that t...

 
@rolfl I don't see anything indicating that that PHP would be off-topic. Is the question really broken? Am I blind?
 
6:38 PM
0
Q: best method to remove element if class is present?

darcherI'm trying to figure out jquery still and in my attempts I'm trying to figure out not only how to use various thing but why, I haven't tested any of this so not even sure it works; however, with jquery it seems like there is an unlimited number of ways to approach everything, so what's the best m...

 
@Jamal I think I suggested someone somewhere asking on programmers, I got a comment by another used saying to read the about page for the site before suggesting something like that. Since then I have learned. Unfortunately, everyone is a beginner some time.
 
@Malachi the only thing I've ever incremented in a for loop was called i. Anything else is plain confusing and hackish IMHO.
 
"with jquery it seems like there is an unlimited number of ways to approach everything" - quote of the day
 
@retailcoder I have used i , j, k and sometimes x y and z but that wasn't in actual code that was in code that was created strictly for learning
 
@Malachi all in the same loop?
My mental rule is: 1 loop, 1 counter.
 
6:41 PM
you can loop on two conditions.
I haven't used it in a real world solution, but I can see where it would be necessary.
if you want one to go up and the other to go down
 
then there's a way to write it so that it's also readable.
But I guess x++, y-- isn't totally unreadable. Surprising, but not unreadable.
 
@Malachi: Regarding your comment on my answer: The rationale to put the increment into the head was exactly for the reason that it is more robust towards changes in the body's control flow
of course this assumes that the increment should in fact be independent of the body's control flow
 
0
Q: Python class - want to improve my code - reviews & tips are welcome

Bmapso this is my code and I just want to improve it, I'm a beginner so I think there are some better and short ways to do what I did here. Any Ideas? The code: class Table: def __init__(self,path,sep): self.path=path self.sep=sep self.g=[] self.count=0 self.headlines=[] ...

 
@Nobody Hi! Welcome to the 2nd monitor!
@SimonAndréForsberg keep those for after I get star power back :)
 
ohh and Hi all btw :)
 
6:53 PM
(that was a failed attempt at whoring an upvote on my meta-answer)
 
@Nobody knows thr trouble I've seen:
 
@Nobody please see my answer. i think I covered it clear enough
0
A: Is it bad practice to increment more than one variable in a for loop declaration?

Malachiyou should not increment a variable that is not declared in the Declaration of the For loop. that said, you could do it like this for(int x = 0, int count = 0; x < max_x_index; x++){ for(int y = 0; y < max_y_index; y++, count++){ { some2DarrayRepresentedBy1D[count] = ...; }...

@Nobody, I didn't read the entire answer, I apologize for that.
@retailcoder, you know there is a way that you can change the name of the room, so that it shows up with that title?
 
@Malachi yes, but my meta-suggestion is on par with "The Duck" :/
(ooh not anymore!)
 
i found where I can change the name on the room that I created
 
@rolfl: why should I know it?
 
7:00 PM
@Nobody it was a joke
 
@Malachi: I thought so but maybe there was more behind it
 
@Nobody I am a really shallow, frivolous person... and I tend to be sarcastic and abrasive... it's just my nature .. ;p (you're not my boss, are you? I've heard she's started checking out SE sites and oneday I am going to make a joke that goes over wrong).
2
 
@rolfl: We'll see that tomorrow in my office.
 
@rolfl that wouldn't be good
 
;)
 
7:05 PM
@Malachi - are you making work for me (with the count++ ) ?
 
@rolfl it's something that I have been trying to understand for a long time, I had a lengthy discussion on Stackoverflow one time about it.
 
There is no 'simple' way to explain in a quick comment ... ;-)
 
@rolfl I know :) but I thought you would be the perfect person to ask about that
@retailcoder POLS?
 
see @retailcoder thats why I did not abbreviate
 
@Nobody oh I feel dumb now
crap and I can't delete now either.
 
7:10 PM
@rol l on floor laughing
 
it is permanent record that I am an idiot
 
just spam the question with high value answers so your crap is less likely to show up
 
guys, I'm out of freakin' stars - stop being funny!
4
(uh, that didn't mean stop posting)
 
@retailcoder Stop upvoting me dammit, I'm reputation capped for today! Save some votes for tomorrow!
 
@SimonAndréForsberg wasn't me I swear!
 
7:19 PM
@SimonAndréForsberg: Thats a problem I'd like to have ...
 
0
Q: Is this a good way to cascade a property?

davidkennedy85I'm trying to write a simple game. I have an Entity object, that has a list of Sprite objects. Each Sprite has a position property where it is drawn on the screen. Sometimes, an entity can contain a lot of Sprites in which case it is much easier to set the position property on the parent Entity. ...

 
@Nobody If you post about four answers per day and that will be taken care of.
 
(and hang around in the chat room)
 
@SimonAndréForsberg: If I post four answers a day then someone else will need to take care of my job.
 
@Nobody just blame the specs
 
7:21 PM
@retailcoder: Does not work so well if you write them
 
o.O
You mean you write the specs and implement them?
 
Yeah sometimes
 
@Jam is delicious on a sandwich. @ret urn this message to sender. No, wait. I am the sender. Doing that would be @Mal iscious intent.
3
 
@SimonAndréForsberg now I am out of stars
 
(triple-ding!)
 
7:26 PM
@Nobody I was talking about the comment what is POLS?
 
lol
 
@Malachi What a surprise :P
 
@Malachi: principle of least surprise
 
well I hope that's clear now :)
 
kiss does not state that you should not write strange code
 
7:27 PM
The principle of least astonishment (POLA/PLA) applies to user interface design, software design, and ergonomics. It is alternatively referred to as the rule or law of least astonishment, or the rule or principle of least surprise (POLS). A textbook formulation is "People are part of the system. The design should match the user's experience, expectations, and mental models." What is least surprising may however depend on the expected audience, e.g. end users, programmers or system administrators. In more practical terms, the principle aims to exploit users' pre-existing knowledge as a way...
 
it only says the code should be simple
 
^^^^ this is SOOO getting a star at 12AM UTC!!
 
@Nobody well the example that I gave is simple. but trying to follow the execution may twist you up
catch you later
 
basically it was just a nitpick on your wording
 
Quote of the day: "KISS does not state that you should not write strange code." - @Nobody
 
7:29 PM
don't take that out of context
 
The best quotes are those taken out of context ==> see the first pinned star from @Jamal :)
16 hours ago, by Jamal
Hey, mine is not the shortest! :D
 
I already saw it when entering the room
there was a 50% chance of driving me off with this
 
lol
 
however "in dubio pro reo"
 
Maybe I should un-pin it then.
 
7:35 PM
somewhat reminds me of this number one bash quote
 
what's that?
 
ok i thought it was ranked higher bash.org/?207373
 
lol!
 
0
Q: How do you select an answer?

davidkennedy85I don't mean what button do you push to select an answer - I know how to do that - but does it even make sense to select an answer to a code review question? Is there even such a thing as a correct answer on this site? From my experience, the nature of a code review (e.g. this site) is completel...

 
7:51 PM
^^ Who's taking it? Can't answer right now, will do later if still unanswered :)
 
@All I took the liberty of adding some of our "personalities" to the list of memes. Feel free to remove yourself if you don't want your identity to be known :P
 
lol
 
8:08 PM
@Malachi - updated answer
 
8:22 PM
meta-zombie down!
@SimonAndréForsberg and what are you known for?
 
@retailcoder I'm not sure :P And even if I was, I can't add that in myself. You will have to decide that for me I guess
Killing baby unicorns? (removed)
 
oooh yeah
Or the anti-C# Java guy.
 
@retailcoder I thought that was me!
 
@rolfl I think that's both of us :)
 
@rolfl you're not anti-C#, you're just unfamiliar with it. And yet you'll still get the [badge:c#] before I do.
and @SimonAndréForsberg you are 11 votes ahead of me this week :)
 
8:32 PM
wtf!? How did that happen?
It's only Tuesday though...
 
0
Q: What is a better approach for operating on an arbitrary map value in Scala?

Jordan ParmerComing from an imperative background, I have written the following code in Scala. I need to attempt to find a value in a map. If the value exists, I need to pass the value to another function and return the result, otherwise I need to return None. def foo(index: Int): Option[FooBar] = { val ...

0
Q: Classes in Python

user3034084I am trying to create a class about birds with a few different methods. This is just theoretical code. Is there anything that is inherently wrong with the code from a syntactical or semantics point of view? If so, please fix. class Bird(object): def __init__(self, Height, Weight, HasFeathe...

 
^^ Create a class about birds in Python? That doesn't fly...
2
 
@retailcoder Lucky for you I still have stars left
 
I need a keyboard macro for "please take a look at our Help Center"
 
0
Q: Trivia Game JAVA code refactoring

sulmanpucitI am trying to re-factor (Improve design of existing working code) with following principals. Switch statements removal. Encapsulate Field Extract Class Extract Interface Extract Method Extract Subclass Extract Super Class Form Template Method - Before Move Method - Before Introduce Null Object...

 
8:41 PM
@retailcoder You know python?
 
Nope
But his indentation looks off.
And whitespace between identifiers and "="
 
Actually, there are a couple of things that looks off with that question. I don't know about the Python-part though
 
looks as if the indentation was not preserved properly
 
@SimonAndréForsberg: LOL at "theoretical compiler." :-)
 
@Jamal I love being creative in off-topic reasons :)
 
8:48 PM
@SimonAndréForsberg I've provided a theoretical answer to the theoretical question.
 
@retailcoder Wouldn't it make sense for this guy to use relative positioning on the inner sprites? Since I'm rep-maxed for today, there's no use for me in posting an answer :P (C# is not my best subject either, as you know...)
 
Just as we were going to kill , an actual refactoring question comes along. It borders on asking for code to be written, though.
 
@SimonAndréForsberg favorited, will address later
 
@200_success: link or it did not happen
 
@retailcoder I could give you a theoretical up-vote, but since I know about as much python as you, it remains a theoretical one.
 
8:51 PM
0
Q: Trivia game refactoring

sulmanpucitI am trying to re-factor (improve design of existing working code) with the following principals: Switch statements removal. Encapsulate Field Extract Class Extract Interface Extract Method Extract Subclass Extract Super Class Form Template Method - Before Move Method - Before Introduce Null Ob...

 
the OP obviously has rules for refactoring and it is useless if you just do it
 
@SimonAndréForsberg the part about birds and feathers is 100% applied animal biology though
 
@200_success I agree. Given his list, it seems like he knows what he should do.
 
the only value one could add would be some more refactoring rules
 
I think it can still be reviewed
 
8:55 PM
@retailcoder: The python code looks right, the var = var assignment would be valid code as well
 
@Nobody That would be a nice answer and definitely not something he would expect :) MVC-pattern anyone?
@retailcoder I know about as much animal biology as I know python. Which is quite a coincidence considering there are pythons in animal biology..
 
@SimonAndréForsberg well at least you know a monkey!
Are we really 10 users in this chatroom? Mark the date, this is a historical milestone!!
 
Now we just need one more (user, not monkey) and we can all get the outspoken badge!
 
I think that particular Python would rather eat the bird than be used as code for it.
 
^^ (theoretical star)
 
9:01 PM
>.<
 
(removed) <-- theoretical killing of a theoretical baby unicorn
 
@rolfl and I can't star that either. thank you
@retailcoder (theoretical star) on your (theoretical star)
 
@Malachi practical star on your (theoretical star) on @retailcoder's (theoretical star)
You have no idea how much I would love that. To be honest, considering I've only ever learned Java in his particular class, I'm very interested to know what I'm being taught versus what I should be being taught. Makes me wonder. — JohnZ 3 mins ago
^^ Good comment about learning code
 
it is shocking how much bad coding style gets taught
3
 
A partial weekly-challenge solution!
0
Q: isStraight evaluation function

tomdemuytThe context is the weekend challenge ( poker hand ). Hand.prototype.isStraight = function() { for( var i = 1 ; i < this.cards.length ; i++ ) if( this.cards[i].value + 1 != this.cards[i-1].value ) return false; return true; } cards is a an array with card objects { suit : "x" , va...

 
9:14 PM
^^ Should we retag it?
Nevermind. Was @Jamalized
 
jamal beat you to it
with his ninja edits
 
1
Q: isStraight evaluation function

tomdemuytThe context is weekend challenge #2 (poker hand evaluation). Hand.prototype.isStraight = function() { for( var i = 1 ; i < this.cards.length ; i++ ) if( this.cards[i].value + 1 != this.cards[i-1].value ) return false; return true; } cards is an array with card objects { suit : "x...

 
Damn it, I want to add an answer but I won't get any rep for it!
@StackExchange If you snooze you lose
 
@Corbin: I think I'm really addicted to editing. ._. looks at total edit count
 
you're definitely addicted to editing
 
9:18 PM
Well for what it's worth, your review was far more helpful than any other feedback I've received in class. I will definitely be using CodeReview more often. — JohnZ 5 mins ago
 
it's good though; someone needs to be :p
 
Never have I thought I could beat palacsint's record. But he still leads with helpful flags.
 
i have an old poker hand evaluator from a programming challenges clas
i should find it... im sure it's shit, but i wonder if it even works correctly
 
@Jamal Added editing to your personality
 
9:21 PM
I'm still taking my sweet time on my Blackjack game. Specifically, I'm working on a more object-oriented version, with my new deck class. My first attempt at the game was bad. I'm tempted to throw out that code.
 
@SimonAndréForsberg (theoretical star)
 
hrmmm interesting
i found my old poker code
the way i checked for a straight was rather odd
 
@Corbin post it!
 
oh god no... it's from when i was complete rubbish at C++, not just bad
 
Post in chat at least
 
9:23 PM
I can guarantee you mine is worse.
 
and it was written for a situation where it had 10 seconds to run and a 16MB memory limit
and it had to rank a few million hands
so it's fairly performance focused
rather than code clarity
 
I'd really like to see your way of figuring out a straight
 
Me too!!
 
idk if it handles high/low ace correctly
 
that is totally a split word:
performance focused code
the managers will pay you double and your coworkers will stay away from you
 
ah... i wrote it to solve this: uva.onlinejudge.org/…
aces were always high
so yeah... mine doesn't apply to the weekend challenge
 
Nevermind about high/low ace, your approach might still give us some new ideas for our code :P
 
@Corbin yeah, see these tests? ^^
 
blerh
well...
it's really... really... bad code
but i'll post it. one second
don't judge too harshly haha
 
@Corbin #2 wasn't very specific - as long as your code evaluates a Poker hand, it could be tagged with it (albeit it's a little late for weekend-challenge)
 
9:27 PM
I've just now put my code into Ideone (ignore the output). I think I've literally made goto look good.
 
gotta love the first line being "using namespace std" lol
i typically did the assignments for this class the night of, and it shows lol
i need to find some recent C++ to post. i'm actually pretty curious to get a review. i have an info retrieval project i might post snippets of when i get a chance to clean them up.
 
I like //TODO: this loop is unnecessary
 
ahahaha
hat is pretty great.
that*
 
replacing a switch with else if cascades
 
hrmm does std::set not have an iterator range ctor, or did i just not know about it....
 
9:29 PM
I would not post my own code there as it could be considered bad code.
 
Dec 6 at 1:08, by Jamal
Well, if it weren't for CR, my code would still look like junk. I'm way too scared to ask questions on SO.
Old code eh?
 
god... getRank makes me cry looking back at this
just one giant chunk of checking each type... lol
 
Haha. Still, I'd rather have my new code reviewed, when it's completed. For this code, I'm okay with getting Loki's WTFs/minute. Let me go find that comic strip...
 
@Corbin That's a good sign. Crying over bad code is a sign that you have developed a nose for code smell.
 
Ooh that's a good one @Jamal
 
9:32 PM
@Jamal I'm sure it's in here: stackoverflow.com/questions/84556/…
user image
2
 
@Corbin I remember the one I made in college, was 5 cards, evaluated all hands in a single function with AND, OR and XOR stuff (was VB6).
 
@SimonAndréForsberg the scary part (or i guess the good part really) is that even code that's only like a month old makes me cry usually.
 
Perfect!
(ironically, that room can resemble our site)
 
both rooms!
 
@Corbin In that case you're either learning a lot each month, or the code that's a month old is hopefully not your code.
 
9:36 PM
Nominee for comment of the day:
Wait a minute, a straight is 5 cards, even if your hand has 7 cards ? — tomdemuyt 9 mins ago
 
@SimonAndréForsberg eh, i think it's a mixture of learning a lot, and that it's much easier to judge code than to write code.
well, and most of the code i write these days is school assignments were schedules don't allow for as much design as i would like... lol
like right now, i have a semester long project i started last night that's due in 16 hours, and i'm still for some reason in here... :D
 
but even then good design should enable you to finish earlier
 
@Corbin: I've unfortunately finished all my C++ classes. My next one is intro to OO, based in Java. I'm scared. :-(
 
@Jamal Welcome to the light side of The Force!
 
gulp
 
9:45 PM
Eh, depends on the project, @Nobody. The longer projects, yes, certainly. But the projects that are one-off algorithmical programs... eh. There's a fine balance of "oh shit! shit shit shit! I have to get this done in 2 hours!" and design.
@Jamal your C++ classes didn't use OO at all? interesting.
 
0
Q: Better or more idiomatic way to apply a sequence of functions in Haskell

itsbruceThis is one of my Haskell solutions to a variation of the N-Queens problem, where the queens can move like knights in addition to their normal moves. It has been optimised somewhat to avoid investigating redundant permutations. place :: Int -> [[Int]] place 0 = [[]] place n = go $ take n $ repe...

 
Java isn't magically more OO than C++. Not sure why people (especially universities) tend to think that.
 
@Corbin: I mean, they didn't emphasize OO. Just plain ol' classes, and barely that. Mostly data structures.
 
Ah
 
@Corbin: Because java has no free function?
 
9:47 PM
haha
 
I've once had to write a whole 20-Questions game with binary trees, and I didn't do a thing. I just couldn't program a tree.
 
@Corbin: The better question is: Why do these same people not want smalltalk?
 
@Nobody Because they've latched onto Java, dammit! :p
@Jamal was it the pointers, or the concept of a tree, or what?
or was it one of those situations where the professor gave you weirdly specific constraints that made no sense....
"your method signature has to look like ____" "wtf?!?!"
 
Mostly the concept. It was quite an overkill assignment for introducing trees anyway.
I literally wrote two lines and turned it in.
Mostly the concept. It was quite an overkill assignment for introducing trees anyway.
 
ah
 
9:51 PM
That was my first F for a college class average, too.
 
ouch
 
And stats will likely be my second...
 
codereview.stackexchange.com/a/37082/7308 that's rather interesting. i tend to have a "eww gross!" reaction any time i see bit ops in anything but low level code, but that's pretty damn clever.
i quite liked states
stats*
but maybe i'm just weird :)
 
10:07 PM
hm I got to go, bye all
 
@Corbin: Yes, yes you are. :-)
 
cya, nobody
i also like economics... i'm one of those :p
 
I had to take two different stats courses - one for my AA (class was mostly business and psychology majors) and one for my BS (the serious version of stats for people in CS and Math).
 
I have the latter. I might still receive credit, or I may end up retaking it.
 
I think universities use Java because there are certain kinds of intrinsically hard-to-debug errors that are more difficult to make in Java (compared to C++).
I've used both and I gotta tell you, debugging memory allocation errors is absolutely no fun at all.
 
10:18 PM
yeah, universities' use of java definitely makes sense. i just hate that's often overhyped as some kind of magical language by universities.
there's definitely a value to getting down in the nitty gritty though for really understanding how computers work. but at the same time, CS degrees can often be highly theoretical and how exactly a computer works at a hardware level might be irrelevant.
 
That's right. Everybody knows the only magical language is either Scala or Elven, depending on your mood.
 
haha
 
I prefer Brainfuck.
 
@Jamal Perhaps, but you can't put that on a resume.
 
I know. :P I can't program in it anyway. But it does look cool.
 
10:21 PM
@Jamal For pure cool (in appearance), nothing that I've seen beats APL.
Only language with a domino operator. :-)
Oooooo, a Scala question! Vote that puppy!
 
0
Q: Is this implementation of importing good enough?

Benjamin HodgsonI need to dynamically import Python source modules from a given directory. I can't just use importlib.import_module or __import__, because it's a black box and I need to do some source-code-rewriting. On the other hand, I feel the PEP 302 Import Hooks to be overkill for what I'm trying to do (th...

 
10:38 PM
@Corbin At least universities doesn't overhype jQuery
@Donald.McLean I think I saw a video where something was made with APL. I think it was Conway's Game Of Life or something similar. Seemed incredibly powerful, if you know how to use it...
 
10:51 PM
@Corbin I know why you like it ..... ;-)
Because you've seen it before:
2
A: Poker Hand Evaluation - Finding a straight

rolflIn this case bit-wise manipulation is your friend .... (as it often is...).... I believe the following solution makes the combination/permutation expense a 1-off setup problem, and using the Integer.bitCount(...) makes it almost trivial ... The code I hacked up appears to have a time-complexity...

 
@rolfl I also thought about that answer. Although the javascript example didn't have wildcards :)
 
0
Q: Using the observer pattern with collision detection

davidkennedy85My Game class has a property of type Player, which inherits from Entity: player = new Player( "knight.png" ); It also has a property of type World, which has a collection of Entities (Robot inherits from Entity): world = new World( new List<Entity> { new Robot( "guy_1.png" ), new Robo...

 
@rolfl Ah :)
@SimonAndréForsberg yet
 
11:09 PM
0
Q: Is this implementation of importing good enough?

Benjamin HodgsonI need to dynamically import Python source modules from a given directory. I can't just use importlib.import_module() or __import__(), because it's a black box and I need to do some source-code-rewriting. On the other hand, I feel the PEP 302 Import Hooks to be overkill for what I'm trying to do...

introduces a new tag.
Should we change it to a more language-generic term like "dynamic-loading" or something?
Or remove the tag altogether?
 
11:37 PM
Cricket, cricket.
 
What!
 
0
Q: chess moves - pythonic

Foo Bar UserI started a chess in python for fun. i learned python on my free time but i've been doing it for a while. The code works but i just want to know if there's anything non-pythonic in my code. The functions calculate all potentially possible moves ( ignoring game state). Any advice is much appreciat...

 
Any C programmers here?
I'm considering posting some code to be reviewed.
 
@syb0rg - is C anything like Java?
Post anyway.
 
@rolfl I will, but I have to make it more readable. It was the code I posted yesterday for that Code Golf challenge, so everything is kinda condensed and hard to understand.
C is like Java in that it is a programming language.
Other than that it's quite different.
 
11:45 PM
@syb0rg you take me too seriously.
2
as for posting the code-golf code, you probably should not.
 
@rolfl Yeah, that's one of my downfalls as a half-robot, half-human. I don't get sarcasm much.
 
3
Q: Are questions about how to further golf a program on-topic here?

John BensinI have a simple algorithm that I'm using for code golf, and I'm hoping to find ways to golf it further. The algorithm is somewhat golfed in Python already, and works flawlessly. I asked on meta.codegolf.SE if a question about it would be on topic there, and per the discussion, the community think...

 
@rolfl The code wouldn't be golfed (it would be easily readable).
 
I'm confused! What questions are on-topic for this site?

Simply ask yourself the following questions. To be on-topic the answer must be yes to all questions:

Does my question contain code? (Please include the code in the question, not a link to it)
Did I write that code?
Is it actual code from a project rather than pseudo-code or example code?
Do I want the code to be good code, (i.e. not code-golfing, obfuscation, or similar)
To the best of my knowledge, does the code work?
Do I want feedback about any or all facets of the code?
 
@rolfl Okay, I guess I won't then since it is considered off-topic.
 
11:53 PM
Bad bad bug, no donut for you! Can't upvote discussions on Area51
 
00:00 - 18:0018:00 - 00:00

« first day (220 days earlier)      last day (2171 days later) »