« first day (722 days earlier)      last day (3594 days later) » 

18:00
Uh, there's still one bug when running it from command-line, lol
> $ python calculator_application.py 5 * 2
RuntimeError: unsupported operator: R
Eh, what?
> $ python calculator_application.py 5 * 2
['calculator_application.py', '5', 'README.md', 'calculator', 'calculator_application.py', '2']
Those are the sys.argv
@Mast boom instant review..
kind of...
@skiwi I had a similar problem with my Java calculator...
c:\Users\Simon\Documents\workspace\javafx\Calculator\target>java -jar calculator-0.1-SNAPSHOT.jar 4*2
8.0

c:\Users\Simon\Documents\workspace\javafx\Calculator\target>java -jar calculator-0.1-SNAPSHOT.jar 4 * 2
Exception in thread "main" net.zomis.calculator.model.CalculationException: Not sure what to do with expression: '4 calculator'
@SimonAndréForsberg Apparently the shell is rewriting an asterik
@skiwi try python calculator_application.py "5 * 2" instead...
c:\Users\Simon\Documents\workspace\javafx\Calculator\target>java -jar calculator-0.1-SNAPSHOT.jar 4+2
6.0

c:\Users\Simon\Documents\workspace\javafx\Calculator\target>java -jar calculator-0.1-SNAPSHOT.jar 4 + 2
6.0
18:06
@Vogel612 Nice, that works indeed
@Vogel612 solved my problem at least.
Why does it do that? And what does it actually do? (and Where would a SE question about that be on-topic?)
rewrites don't kick in on strings, soo..
it might be possible to run python calculator_application.py 5 "*" 2 instead
@SimonAndréForsberg I have no clue, actually.
@Vogel612 indeed that seems to work as well
It's not really about code review, more about web scraping techniques and/or libraries people who don't do this professionally might not be aware of. As it's a bit of an open question and it doesn't look like there is a definite answer, I'll accept one of the answers I received. — makhan 57 secs ago
@SimonAndréForsberg Maybe it's only in Git Bash? or also on normal cmd
18:08
but the star is interpreted as a ./* in directory terms..
@skiwi I'm using windows cmd
0
Q: python behaviour when passed an asterisk

user857990I'm writing a small script, that should be able to handle multiple files. So I've added that files can be passed comma seperated, and do a arg.split(',') and then handle each one. Now I've wanted to add asterisk as input possibility like python myPythonScript.py -i folder/* If I print the the...

Found something about it there
Related:
14
Q: Stop shell wildcard character expansion?

hotpaw2Is there any way for a compiled command-line program to tell bash or csh that it does not want any wildcard characters in its parameters expanded? For instance, one might want a shell command like: foo * to simply return the numeric ASCII value of that character.

39
Q: How do I escape the wildcard/asterisk character in bash?

andyukeg. me$ FOO="BAR * BAR" me$ echo $FOO BAR file1 file2 file3 file4 BAR and using the "\" escape character: me$ FOO="BAR \* BAR" me$ echo $FOO BAR \* BAR I'm obviously doing something stupid. How do I get the output "BAR * BAR" ?

My newborn is here!
0
Q: Newborn pythonic calculator

skiwiLet me start off by saying that I have several years of experience in Java, but now I need to learn Python, so I decided to make a calculator as it also is a community challenge. Please review the code looking for beginner mistakes, though I do intend the code to look professional. This is my fi...

This explains it best I think:
42
A: How do I escape the wildcard/asterisk character in bash?

mithuSHORT ANSWER Like others have said - you should always quote the variables to prevent strange behaviour. So use echo "$foo" in instead of just echo $foo. LONG ANSWER I do think this example warrants further explanation because there is more going on than it might seem on the face of it. I ca...

def __eq__(self, other):
    if type(self) != type(other):
        return False
    return True
Oh, come on!
18:13
0
Q: Newborn pythonic calculator

skiwiLet me start off by saying that I have several years of experience in Java, but now I need to learn Python, so I decided to make a calculator as it also is a community challenge. Please review the code looking for beginner mistakes, though I do intend the code to look professional. This is my fi...

@SimonAndréForsberg What's with that? ^^
@skiwi How about return type(self) == type(other) ?
@SimonAndréForsberg It's... an option
your __ne__ whatever that is is copy-pasted 4 times
doesn't Python have inheritance?
@JeroenVannevel It does
But I didn't want to over-engineer my code here
18:21
For once when you could use some of your Java practices
I'm trying to stay sane here
And then the chat suddenly got quiet
well..
@skiwi The boat crossing the peninsula is only one of the things that concerns me about that video.
@nhgrif What are the other things?
How come pollution only shows up on the grass but not on the sand?
Who built the road/bridges that go out the chain of islands? That's really lumpy
I like those bridges
look way better than mine still
The bridge in a vacuum looks fine. It's the transition from road to bridge that bugs me.
And that city... holy straight-line griddyness batman!
18:48
I'm surprised how far it goes
Don't you have only 9 tiles?
My biggest city has.. 6 or so
And it's god aweful
0
Q: Is there a proper way to load data from a slide out menu in an iOS app?

ChrisI want to know if there is a proper way to load data from a slide-out menu in an iOS app. I recently read this tutorial, and incorporated the slide-out menu using the hamburger menu in my app. Should I create a separate viewcontroller (VC) for each element / item in the table view? And ideally...

As a disclaimer, I've not played the game... it won't run on my machine, but...
a) By default, you have 9 tiles--though there's a DLL that allows all 25
b) That person has built the port on the coast... the abitrary straight line he's placed isn't at the edge of any of his tiles...
@CaptainObvious -ly off topic.
I don't even know what game it is
Cities: Skylines
This, by the way, needs easy close votes: No code in the question even:
-1
Q: Is there a proper way to load data from a slide out menu in an iOS app?

ChrisI want to know if there is a proper way to load data from a slide-out menu in an iOS app. I recently read this tutorial, and incorporated the slide-out menu using the hamburger menu in my app. Should I create a separate viewcontroller (VC) for each element / item in the table view? And ideally...

19:04
1
Q: Association count in single query for ActiveRecord

AlbinThis is a small gem that gives the possibility to include counts of reflections when fetching active record objects. What do you think of the code? Any improvements or other (similar) use cases where it might be useful? require 'active_record' ActiveRecord::Base.extend AssociationCount module A...

Is there a reason that this question should still be closed?
-2
Q: Need advice from senior developers to develop code writing skills

Kalpa PereraI would appreciate if you could give me some advice about the code below. I am a student learning PHP programming and programming fundamentals. I have learned a lot from Stack Overflow but there are lot of things I don't know. I would like a senior developer's opinion on improving my codes overal...

@nhgrif Other than the terrible title? ;D
Right.
I edited title and VTR
@nhgrif used to have no code. Reopen-Completed
19:11
I understood why it was closed originally.
I thought the code had been added before your comment though, and I wasn't sure if your comment was implying it might still have problems? I don't PHP at all.
it was added, which was why I commented
but I didn't even VTC in the first place
I know.
19:39
from data transfer format to programming language
J-Sonnet? Do you have to write your code in iambic pentameter?
3
You'll have to start each file in v. 18 with "Shall I compare thee to a summer's day"
19:54
Okay... how does this even happen? I never ever remember seeing any questions with "OBJECTIVE-C" or "OBJC" or any such all-caps language description in the title for Objective-C. But I definitely saw it regularly for Java... and now it's happening for Swift.
@nhgrif now if anybody knew that...
0
Q: Uses game API to post stats about user when requested on Reddit

vtestingFirst Python script, so my code is pretty laughable. Sensitive information has been redacted. One thing that I'd like to point out is that there is an inconsistent use of '' and "". This is an old habit that I really need to break. import traceback import sys, os import praw import time import ...

@nhgrif Not so SWIFT users?
SLOW users.
Aw, no Python review yet, I thought Python was the most reviewest language :p
20:14
0
Q: Modern C++ compliant selection sort

Francisco AguileraI am writing, as review, Modern C++ compliant versions of sorting algorithms I previously have seen. This post is about selection sort, and selection sort only. I wanted to know if there were any ways to improve upon my implementation, especially in terms of performance: // Orders a list of val...

Hmm... I was thinking my next blog post would be a rudimentary tutorial on the absolute basics of debugging...
I will definitely do that at some point, but now I'm thinking my next blog may instead actually be about breaking big problems down into small problems.
after the code is "fixed", please do post it on codereview.stackexchange.comKaroly Horvath 44 secs ago
That's one thing I really see people struggle with as new programmers. They're asking a question which in plain English doesn't sound like much, but to a programmer, you say "Whoa, that's about 10 different problems that all needs to be solved one by one by one."
Thanks for the review there @janos ;)
Hadn't actually thought about the while len(stack) > 0 thing
I sensed you noticed ;)
20:17
Python is surprisingly easy to catch up to
that's what I felt too
Now I still need to get familiar with Django in a week and be ready to write production-ready code
I hope @jonrsharpe and @Josay would take a look too, because I didn't go too deep with that review
I'm really thinking about some sort of code reviews for my university project (with 8 people)
what do you mean?
20:19
Also preliminarily because I have the power (together with a classmate) as only we can actualy merge stuff into the develop branch
Well, nobody of us has ever written Python, so if nobody controls it, it might become horrible
We're using Scrum though, so I don't want to slow down development too much
The benefits of setting up the server for projects where everyone is equal si that you get the power to call yourself an admin ;-)
@nhgrif The ability to break down problems is definitely something that some new programmers are lacking. Seems like sometimes they want to do all things at once.
the sub-compartmentalizing of larger problems in to smaller ones is always a problem for beginners.
functional extraction is also one of the key lessons to teach, becuase it teaches exactly that: that problems should be broken down to smaller tasks, and then solved indepenednelty, then brought together to build a solution from the parts.
6
@skiwi if you make sure that it's always somebody other than the author merges a branch, that might already do a lot of good
I just saw a question (which now seems deleted)... "How do I add a picture to my screen and change it randomly after a specific time period?"
In plain English, that actually seems really simple.
But assuming the user doesn't even know where to begin, there are several tasks to resolve.
@janos I'm not quite sure what to do if I see code I'm unhappy with, do I add comments to the PR, sit down with the person and make him improve the code (thus slowing down development), or do I fix the code myself in an additional commit before merging it and only slowing down myself?
20:23
the author should solve
otherwise he will not grow and slow everyone else down forever
Yep.
Yep
@janos Okay, I get that, though we're just with 5x 1-week sprints and then the project is over
I really feel like stressing improving on mistakes though, rather than getting sloppy code into production
if you read the first chapters of Code Complete, it seems clear that being strict from the start will be worth the investment
the cost of fixing sloppy code quickly becomes higher than doing it right from the start
Yep
20:29
time wasted on chasing weird bugs, doing the proper fix later when the topic is not so fresh in your or anybody's head anymore, typically somebody else having to debug the problem than the guy who caused it, re-delivering, .... seriously, not worth it
cascading issues because a fix in core code causes a failure in other code....
btw, I have a few new guys on my team who send in mostly crap these days. PR cycles are long and exhausting. Code review doesn't seem effective enough to get them up to speed quickly. I plan to try something new I really didn't want: pair programming. I hope it will work
And... the thing is, taking 30 minutes out of Task X to go solve Problem Y doesn't mean you lost 30 minutes on Task X. You lost more.
The only small issue I have with that approach is that I'm not worth more than my classmates, what I'm saying is that if you are a manager of them, telling them to do things is really easy, now it's not really easy
Uh, what are you working on? You're working with classmates?
If this is homework, I'd probably just do it all myself.
And do whatever I could to avoid group stuff in classes... it's pretty well always pointless.
20:39
It's a project that takes 9 weeks of which 2 weeks are planning, documentation, client meetings, etc. then 5x 1-week sprints and 1 week for testing/presentations and there are like 6 national holidays
0
Q: Graph representation using adjacency list for bfs, dfs and karger's algorithm.

OrestisI want to implement some graph algorithms for learning purposes(e.g bfs, dfs, karger's min-cut algo) and before diving into them I want to make sure I have got the graph representation right (using an adjacency list). I want to keep things minimum to exactly what I need to implement these algorit...

You work at it with 8 people (Bachelor 3rd years) and 2 master students that are there to supervise your group mostly regarding the Scrum process
@skiwi I know, it will be really hard to pull off to keep the code solid without being a pain in the ass and appearing to be slowing work down.
At least in Python I feel like having consistent indentation won't be an issue
(Pun intended)
Following the full PEP8 doesn't seem to be that hard, except for continuing things on multiple lines
I recently participated in a programming contest and I couldn't really bring my teammates on board in terms of baseline quality. I couldn't even get them to please let's use indentation width = 4, even though they used PyCharm as their IDE like me, where that's the default setting (!@#!@#)
20:46
Whoa.
Is that the Google one you were drumming up recruits for?
So, how did you do?
but we were all complete strangers and we only met for 3 sessions, and a crazy timeframe, so I hope you'll have better luck
@janos Wow... that's depressing
I've never participated in a contest.
yup, that was. we finished 16th in the finals
Is it something I should plan on doing?
20:48
it's fun to do, and pushes your limits
I can't do my best thinking under stress.
But, I doubt many people can.
you can train for that
I am training - I've been taking a zillion quizzes in college.
I don't usually do bad unless there is a really tight timeframe and I don't know the material automatically, but I still don't like being timed.
I'm usually programming in a timed way, I want to get as much as possible done before I go to bed!
I'm terrible under time pressure. But practice helps
20:50
The only caveat is that you can keep on pushing the time you go to bed
This question is really more suited to Stack Overflow Code Review. Please move it here: codereview.stackexchange.comMike 49 secs ago
@Mike No, this does not belong on Code Review. Please read Be careful when recommending Code Review to askersSimon André Forsberg 17 secs ago
@skiwi Only noticed your Python question now (was afk), I hope to give it a review soon. Looks pretty neat for somebody who just started.
> Please can you help me out to find out what is wrong?
That comment is wrong!
@SimonAndréForsberg - Thank you for that link. After suggesting this and clicking submit, I started looking for just this type of information. Reading now. — Mike 28 secs ago
usersEducated++;
8
0
Q: To do tree application with undo/redo functionality (PySide)

neuronetI am making a to-do tree application in Python that will show checkable tasks/subtasks in a tree view, with higher-level groups of tasks grouped into blocks (e.g., Work block, Home block) that do not have checkboxes. It looks like this: I'm calling it Earlybird. The application has two main ...

@Mast Thanks, I hope you still think the same way after having reviewed it ;)
20:57
@SimonAndréForsberg Stop farming our stars with comments like that
It's a trap
@skiwi I looked through it, and it appears you bypassed most of the beginner mistakes.
Not sure why this gets more stars than the previous one:
2 days ago, by Simon André Forsberg
usersEducated++;
3
More people in the room?
People in a jollier, less stressful mood?
Today is Sunday - people are relaxed; 2 days ago was Friday - people were looking forward to being relaxed.
NOPE
People tend to be more star-happy on Fridays though.
20:59
Did I miss a star-fest?
4
@nhgrif No.
@nhgrif didn't miss the star-fest - he is the star-fest.
Stars? What are those?
Supposedly what babies are made of.
No.
Everything is made from star-stuff.
2
21:15
@nhgrif Is that Carl Sagan?
Uhm, probably. Neil deGrasse Tyson says it regularly, but I'm pretty sure he got it from Sagan.
(I've trimmed the question slightly to ask about one thing - I think it is OK for Stack Overflow now. The original rather sounded like a request for code review, which is rather too broad here). — halfer 48 secs ago
I think you should give it a try in Core Reviewɐuıɥɔɐɯ 13 secs ago
@ɐuıɥɔɐɯ This question doesn't look like it would be a very good fit for Code Review. This question appears to be asking for an explanation or verification of the code's time complexity. The asker doesn't appear to be seeking out a review of the code. — nhgrif 22 secs ago
21:32
@nhgrif Yeah I've heard deGrasse Tyson say it too, I do think it was in the original Cosmos series, from memory
By the way, @sᴉɔuɐɹɥԀ, I found your SO cousin.
Look at the commenter I just replied to.
21:48
-1
Q: Is this script correct

Jerime McCastleWrite a program to prompt for a score between 0.0 and 1.0. If the score is out of range, print an error. If the score is between 0.0 and 1.0, print a grade using the following table: Score Grade >= 0.9 A >= 0.8 B >= 0.7 C >= 0.6 D < 0.6 F If the user enters a value out of range, print a suitable ...

Terrible question
Anyway, I'm out for the day
@CaptainObvious This just became one of the most down-voted questions on Code Review
> I'm closing this because it does not work. It does not handle the specific requirement for values >= 0.0/ When I run it, and enter -1, it grades it as an F.
Was about to put that... but then decided mod hammer not appropriate
22:06
@rolfl Is there a way to tell exactly when I rewarded a specific bounty?
Or alternatively, when a specific answer received a bounty?
SEDE is fine.
@nhgrif Yes, there is.... ... let me check
Perfect.
6
Q: I'm fairly new here, but it seems like many question askers only want the line of code, not how to understand how to solve their problem

Valerie AsensioIt's a challenge, in general, to debug someone's code problem remotely, especially when a question is vague or ambiguous. But sometimes I have a pretty good idea where the issue lies, and how to ferret out the problem, so I suggest debugging / problem solving steps. These are typically for questi...

This is a little annoying.
> For the test, enter a score of 0.85.
From that question you almost closed but then answered.
I know that comes from his teacher or the assignment or whatever.
But someone at some point decided it'd be acceptable to write this program that does all this, but then indicate to the novice programmer that testing a single input is an acceptable level of testing.
And that's probably part of what leads to:
I tested on my end and executes fine, just needing you'll feedback. — Jerime McCastle 46 mins ago
plus your answer.
22:29
I am sure you're right...
I was uncertain what to do, but part of what happened is the other answer, which is good.
I'm not saying the question should be closed.
It would be a shame if I had closed the question the moment before that happened
Then I was at a loss because that other answer, while good, was also wrong.
I'd like to review the book or website he got this exercise from.
Finally, hopefully my answer will make that more explicit, but, I wrote it in a rush, I should make it better. Let me do that.
At a minimum, that program should be tested with a negative number, a number larger than 1.0, and then at least one number in all of the defined ranges plus numbers that fall right on the borders of the ranges.
22:32
That question does seem to show OP's "bare minimum" attempt meeting the requirements of that exercise. Which is OK, but that's about it
The sad thing is, if this were for a class, a bad teacher would probably give this an A.
I can see that.
A good teacher probably writes a test app and grades all of the student's assignments more completely and in less total time. A bad teacher just runs the projects one by one and sees if entering 85 returns a B
Someone once said that if programming teachers were good at programming, they would be programmers instead. In fact I think it was you.
There we go, edited the answer.
Someone is trying to tell me that DOM is better than JDOM.
They work at IBM....
Some of us would say you really, really should be using DOM rather than any version of JDOM ... — keshlam 28 mins ago
@keshlam - that may be, but, as the maintainer of JDOM, you likely won't hear me saying that. Don't get me wrong, there are reasons to use DOM, but in this case, compare the logic above with what you would have to do in DOM. — rolfl 25 mins ago
Most of the examples I've seen that make jdom look better were clearly written by someone who didn't know how to use the DOM effectively. I haven't worked thru this one, but it looks like DOM level 2 can do it just about as easily, and more portably. — keshlam 8 mins ago
Then, his profile:
> CLAIMER:

I'm a long-time IBMer, having worked on the IBM and Apache XML/XPath/XSLT code and been involved in some of the W3C efforts (DOM Working group primarily but that interacted with some of the others).
> Feel free to consider me biased in favor of IBM -- and even more biased in favor of industry standards, whenever possible -- but I make every attempt to be fair and honest.
I think I should point out that last phrase.
22:42
Is it to where perhaps Bias meets Bias? ;)
That's the thing .... yeah.
So, I will be pragmatic, and walk away....
if they push it, I will look them up at work ;-).
If he really is part of the Liberty profile, then the odds are that he's in Toronto too.
LOL. Just walk away :)
IBM is > 400,000 people.... but it always ends up being a small place.
@rolfl Bringing your homies for a beatdown?
I'm in. Let's get this sucker.
Yeah, but I am not sure you will really be on my side ;-)
22:46
What, and risk being banned from this chatroom?
haha....
I'm too curious....
I just created 2 downvotes and 2 upvotes via the meta effect.
He claims his name is unique.....
Is his name 15f128c7-c1c2-4bfd-8638-f700371ccde4?
That's the only way I'd believe him
22:52
Well, I found him, was not so hard. His real name is not his username.
@rolfl I work for a large company too (though not as large, more like 100K) so I kind of get the feeling
he's not in my country... so, no coffee and banter with him.
OK, time to find a way to get exactly +1 rep.
Accept + DV?
hmmm... that would mean accepting your answer ;-) so, no ;-)
Wow. Burn.
22:58
No, my answer isn't good enough to be accepted, but everything looks pretty good.
@rolfl Or what about we DV you twice, and then one person up votes a question?
Delete an answer that you previously downvoted.
you have the power to do that..
^^^ ohh... nasty...
I was looking for a previous downvoted answer that has been edited to be better
Except, I don't like how the number button functions are almost identical.
BTW, someone upvoted a answer - now I'm just one vote away from Generalist.
Thanks, whoever did it.
@Hosch250 I have suspicions that the voter is located somewhere in the North Pole...
23:02
Hmm, why?
Just a hunch.
Oh, Santa, lol.
Didn't get the reference at first.
Snuck in ;-)
user image
2
@rolfl Did you accept an answer and give a down vote?
No, he didn't.
23:04
0
Q: How to optimize the performance of SQLite to MySQL transformation in Java?

RoflcoptrExceptionI have a Java program that loops over all rows in a SQLite Database, does some processing and the writes back the results in a remote MySQL Database: private static long parseAndUploadData(Connection sqliteConnection, Connection connection, String part) throws SQLException { Date star...

.ijaweofjawifhaeuwdhiwedjaw'
If only SO were so strict on answer-invalidating-edits as Code Review is...
I need to learn how to write malware so I can get the $$$ MS pays for security exploits in beta software.
Lol, was that allowed through?!
@SirPython I found an answer from last year that I downvoted, and the it had been later edited, and improved, so I removed my downvote
Going for dinner.
@rolfl Ah, that's smart
23:33
0
Q: Modern C++ compliant insertion sort

Francisco AguileraThis is a kind of follow up to my previous sort implementation question with specific questions to insertion sort, and Modern C++ idioms. Anybody seeing this post can see how I got to this modern equivalent of a typical C-style sort you can find everywhere on the web by visiting my prior sorting ...

0
Q: Just started coding in C and having trouble with a really simple code

TKRexI'm learning how to code with wibit.net and am having trouble getting this code to execute. I'm assuming it's just user error, but some input would help. Any input is appreciated. #include <stdio.h> int main i = -1; while (i < 5) { i++; if ((i % 2 == 1) || (i == 0)) continue; pr...


« first day (722 days earlier)      last day (3594 days later) »