« first day (1991 days earlier)      last day (2940 days later) » 

4:00 AM
yeah just read the comments.
 
wim
thx -6 now
 
def column_conflict(board,c):
	if c>=0 and c<len(board):
		return True in board[c]
	return False
This passes all tests except this one... why? [True,False,False][False, False, True][False,False,False],2] should be True but returns false?
 
Indexing is zero based. The third list, index 2, doesn't contain True.
 
the 2 is referring to the column number tho
This is a test to see if there is a True value in the column indicated (which is 2 in this case)
 
4:12 AM
I had posted a question more than 2 days, but couldn't get a decent answer. In case you guys know about port-forwarding in python. Please check:
1
Q: Port forwarding in python to allow socket connections

Abhishek BhatiaI start a server using sockets and want to allow clients to connect to it. self.sock.bind(('0.0.0.0',0)) # 0.0.0.0 will allow all connections and port 0 -> os chooses a open port. stroke_port=self.sock.getsockname()[1] self.sock.listen(75) self.open_port_popup(stroke_port) Now, for other clien...

 
@Jessica Um, that code tests row c in board, not column c. But you can use the zip function to transpose rows & columns.
 
@PM2Ring we're not allowed to use zip function, we haven't even covered it :P any other fix?
 
@Jessica try exploring your code and trying to debug what's happening. Use an interpreter to look at the values and manipulate them and you'll be able to solve this yourself.
if this is an assignment, go ask your teacher if you're having trouble
 
@Jessica Well, yes. However, not being allowed to use Python's built-in functions is a little cruel, IMHO, especially such an important one like zip. Banning zip is a recipe for un-Pythonic code.
And since I've already coded an example using zip, I'm going to post it anyway. :)
a = [[1,2,3], [4,5,6], [7,8,9]]
ta = zip(*a)
for col in ta:
    print(col)
prints
(1, 4, 7)
(2, 5, 8)
(3, 6, 9)
 
@PM2Ring I'll note it for future use, thanks! we're not even allowed to use print actually :P only return
 
4:24 AM
Your teacher is very lucky that Elaine Roberts isn't in the class. :) xkcd.com/341
 
@PM2Ring o well I think I'll move on to the next problem. Kind of weird how even though code tests for rows it passes 6/7 tests
 
@Jessica Here's a little function for you. But I'd like you to try to understand how it works.
def get_column(board, c):
    return [row[c] for row in board]
 
@PM2Ring fails all the tests with "1positional argument but 2 were given
 
Perhaps you misunderstand what my function does. Test it with that a list-of-lists I posted a bit earlier.
Rhubarb. Time to do some gardening...
 
 
2 hours later…
6:59 AM
CBG all.
 
7:43 AM
cbg
 
8:04 AM
Cbg
 
8:24 AM
Cabbage!
 
8:51 AM
have you guys ever used celery?
 
@khajvah to scoop up hummus? ;p
 
wow, never tried hummus with celery
 
9:11 AM
sorry if this was already covered here, quick search of the room history showed no hits. meta.stackoverflow.com/questions/319930/… is asking for a good canonical for object not callable -- there's a decent suggested question but perhaps this would deserve attention from you gentlepeople
the only hit on "callable" at sopython.com/canon/?q=callable is for a more specific problem
 
@tripleee: I'd search my own answers but it looks like one was already found.. ;-)
 
@MartijnPieters indeed!
 
I don’t think we have a perfect canonincal for that one. Most of the ones are just rather specific solutions (which may give others an idea about the source of the problem) but don’t necessarily help perfectly.
 
hi guys i am python developer but i haven't written any web application using python.
I need to write a web api using python so i need your help to choose web framework and web server
I think nginx + flask fits my requiretments
 
Go for that then, sounds like a solid choice
 
9:22 AM
my app have to work with 100k user at the same time
so can i estimate what will be my hardware requiretnments for those stuittion
and i will use mongodb
i will serve not more than 10 kb data for a user
 
@RockOnGom hard to say - depends what data you're serving and how often
 
yes i know, the transfer data size will be nearly 5kb
and user will be authenticate, and i will serve her/his data to them
there is no process except crud
i just wonder if i reach 100k user, whether server will be fall down or not
:)
if yes i must increase hardware specially memory and cpu
 
How often does the data change? Can you cache it to reduce back-end load for instance... so many, many variables... ;)
 
i can't estimate it but because this api will be a game service
but if user finishes the game app sends 1kb data to service
 
@PM2Ring Thanks git branch :)
 
9:32 AM
and service as you know insert it
 
@RockOnGom why mongodb?
 
because i know mongodb
if you have offer what is it
 
fair enough
I don't know what your application is
 
do you know trivial crack game]
 
so obviously can't make architectural suggestions
btw, 100k users at the same time is huge traffic
 
9:35 AM
yes i know
that is why i am getting insane
@khajvah do you know trivial crack
 
nO
I can't even decide on my own architecture
 
we need a person who have know-how
thanks @khajvah
 
Is 100k users a realistic expectation, or based on your personal desire?
 
@RockOnGom Just one note: chances are, the web framework won't even matter that much.
it will mostly depend on other variables.
 
It is realistic, because we will immigrate an existing api to python
and nearly they have 80k user
s
 
9:46 AM
@RockOnGom so the current stuff handles 80k simultaneous users?
 
no :)
16 gb 8 core
and thet have a cache proxy it is 32 gb 8 core
 
anyways, this is impossible to answer. First, I would even question your choice of PL.
 
10:07 AM
@axiac: Indeed. This is a very simple example and not meant to be exhaustive. Nobody copies code from StackOverflow and pastes it straight into a terminal window, do they? ;) — Johnsyweb 3 mins ago
RIGHT.
 
Hi, everybody. How often are you using python non-optimised code-writing to get your life simpler? I am using python almost for this reason - it is very fast even if I am writing code completely by myself.
 
What is “python non-optimised code-writing”?
 
it is using a lot of cycles and if functions
 
Writing code that runs slowly isn't a problem (unless it's too slow). Writing code that is hard for someone else (including future you) to read just because you can't be bothered to think of the best way to structure your approach, is a problem.
 
protip: if it is fast enough for the requirements, it is optimized enough
 
10:11 AM
When I write code for long-therm use - now I ALWAYS comment almost every line.
 
@XuMuK That's bad
please don't do that
 
Comments are good, but making sure your code is readable and structured correctly for the problem is better.
Both is best.
 
as uncle Bob says: "The proper use of comments is to compensate for our failure to express ourself in code"
 
I use a lot of one-use scripts which are just for time-saving, and I am sinking using cycles (it is for school turbo Pascal)
 
Hi guys, any openCV experts here?
 
10:15 AM
@RobertGrant there is nothing more unreadable than too many comments.
 
@Käsebrot Just ask. Don't ask if anyone knows X.
 
I am using python 2.7.5 for openCV. The docs say I can do FastFeatureDetection with cv2.FastFeatureDetector
 
and?
 
but I only have cv2.FastFeatureDetector_create()
 
@khajvah Uncle Bob is a nice person.
 
10:19 AM
fast = cv2.FastFeatureDetector_create()
 
@Käsebrot mine doesn't
 
here fast has no method getInt or getBool
 
python 2.7.6, cv2 2.4.8
Help on built-in function FastFeatureDetector in module cv2:

FastFeatureDetector(...)
    FastFeatureDetector([, threshold[, nonmaxSuppression]]) -> <FastFeatureDetector object>
 
import sys

print sys.version
gives me "2.7.5"
 
the python version is probably irrelevant as long as it's python 2
what's cv2.__version__?
 
10:22 AM
3.0.0
 
Create seems to be the proper way to create it? docs.opencv.org/3.1.0/df/d74/…
 
yup, that's too new then
 
The constructor that was in 2.x is no longer there: docs.opencv.org/2.4/modules/features2d/doc/…
 
@poke I started reading Clean Code. He seems to be smart. Most stuff makes perfect sense.
of course there were stuff that I didn't agree with like "functions with more than 2-3 arguments are bad"
 
Oh, Robert Martin?
 
10:28 AM
yea
 
Good book :)
 
Considering that that’s “OpenCV-Python Tutorials”, I wouldn’t put too much authority on that.
 
oh, right
sorry
 
@poke that is what I was using
 
10:32 AM
I love it when documentation is hard to find
 
This page maybe explains how close the C++ implementation and the Python interfaces would be.
 
I mean, why would anyone want to know how to use it, if you've implemented it?
 
(tl;dr: very close)
 
stupid android SO app
I thought I was writing a comment, hit ok, it said "answer posted"
then... it turned out the app does not allow me to delete.
I thought I will navigate to the answer with web browser.
thanks to android intents the answer itself opened in the stackoverflow app again.
 
It's over Antti. Too late.
 
user2743227
10:34 AM
Hey, when you write a function in python, do you put the docstring in the line above the function or on the first line inside a funciton?
 
@user1375469 inside
 
@AnttiHaapala :S
 
@user1375469 it works better inside
 
user2743227
even for init? cuz i'm looking at some code here that puts doc string on the line above the init
 
I've looked at the app, didn't like it
 
10:35 AM
so I needed to get up from my hospital bed, go to the locker and take my laptop so that I can delete the answer
 
though I haven't tried posting...
but I don't like my hands being tied
@AnttiHaapala can't you just remove the app?:P
 
@AnttiHaapala damn.
 
can, or I can remove the intent mapping...
but just couldn't care
 
or remove the app from the default apps to open list? or is that android intents thing automatic?
ah
 
the intents work so that for each intent there are url mappings or mimetypes or so...
so android asks "once or always", it will map that for that intent...
 
10:37 AM
@AnttiHaapala Use the mobile website instead?
Just reset the default binding
 
user2743227
ty for da help
 
there is no mobile website
so.com is adapted for mobile
that is utterly flawed design
with intents
same with wikipedia. I installed a wikipedia app but damn it is so bad...
 
everything is an intent on Android. It’s not the website’s fault
 
harder to navigate than wikipedia in mobile browser
it could be so that a mobile website be intented
and if you navigate to normal url it'd ask if you want to visit the mobile
that way you would get what you want.
 
@AnttiHaapala that is what it does I think. First, it asks you to choose the default app for opening something.
 
10:40 AM
Just uninstall apps. All of them.
 
if you have it installed
 
anw the foremost problem is that why can't they implement delete in the damn app
or how can they not have implemented it there
 
I don't get the point of even developing app for wikipedia
 
app isn’t targeted to power users but to casuals
to consumers
 
so no delete for own questions :D
 
10:42 AM
I'm once again having the conversation about scrum and points
 
and..?
 
It's going the same way it always goes
Nowhere
 
@AnttiHaapala can't you tell your browser to use a desktop user agent?
 
"but we need hours"
 
or the intent's still around?
 
10:43 AM
@AndrasDeak yep
 
"Points are a magical concept we can't explain, but they work really well."
 
need to remove the binding.
 
"How are they different from time in the end?"
"Shut up!"
 
@AndrasDeak Everything is an intent. If you click a link in a browser, a VIEW intent is raised with the new URL as the target. If there’s an app registered that matches the intent, it will offer itself.
@Robert Which side are you on?
 
10:46 AM
what is scrum?
I see that thing in all job descriptions
 
@poke thanks
I don't have site-specific apps, so everything is handled by my browser
 
Dude, that's a super basic question (and not python), Google's thataway.... >>>
(Re: scrums.) Google scrum management & agile development. :/
 
@AndrasDeak same thing: you open a pdf.
mimetype based intent
the idea is basically good...
but half-assed apps are the problem
 
Why was my question starred? It was a serious question? :(
 
i starred it
unstarred :d
 
10:49 AM
._.
 
@AnttiHaapala yeah, I guess
 
@Withnail A project management strategy. It works with user stories that match the requirements and the work is separated in time “sprints”. Before each sprint, the user stories are rated with imaginary complexity points which gives you an idea of how difficult something is. After the sprint, you can see how many complexity points you managed to get done, which gives you a “team velocity” as an indicator on how fast you can get through complexity.
 
@poke I'm the first one
Kidding. Second one :)
 
Problem is that “complexity points” is a super useless thing for the management and for any business purpose, and it’s also rather arbitrary, so it is often (intentional or not) linked to actual work hours – which makes most people happy but is against the concept of the whole thing.
Bottom line is: It’s still the same, and you can’t do one without matching it to the other.
 
well, the problem is that the management wants the impossible
they want to fix the scope, the budget and the time.
 
10:54 AM
@poke so you basically have a choice of rating the work based on the time it took and based on some predefined complexity points
 
We had “fun” examples in our project where writing down thousand lines of configuration has a complexity of kind-of 0 but is super time consuming. So the rated complexity was worthless, and we had to use the time as an indicator instead.
 
and you are saying the latter is useless
 
@poke that's my exact point; surely it all boils down to time
 
@RobertGrant what if a smarter guy does the work in less time ?
 
In theory, complexity points are great to talk about the user stories. But they don’t matter at all, since nobody works “in complexity points”.
 
10:55 AM
then it should be remembered that scrum is for new product development
not for "writing configuration"
 
@khajvah then it's fewer points because it'd take less time
 
@khajvah That would generally improve the team velocity
 
writing configuration in itself has nothing to do with new product development
you're writing configuration for an old product, presumably
 
@AnttiHaapala that doesn't matter; any simple but timeconsuming task will work. Config was just an example.
 
@Antti I was giving a stupid example, you don’t have to take it literally.
 
10:56 AM
well it should not be "complexity" points
 
@RobertGrant in the end, you wouldn't know which programmer did more work
 
Also, Scrum actually isn’t limited to “product development”.
 
but of course a time estimate
 
but time estimate isn’t Scrum…
 
of course everyone wants to use scrum for everything because scrum is a buzzword
 
10:58 AM
It’s terrible.
 
the best point of scrum is that it does not speak about time...
for new product development...
 
Except that you work in sprints, which have a fixed time..
 
just counting in gummibears
yeah
 
And in the real life, you always have a time constraint…
 
that is then for a reason that you have to demonstrate an increment
 
11:00 AM
btw, who decides which task should take how much tie?
 
Nobody. Scrum doesn’t look at times
 
but actually to me the gummibears and so are besides the point of agile and scrum.
 
Scrum isn’t agile.
imho.
 
sure it is
 
So DON'T EVEN TRY
@poke you definitely can't just figure how long a point is by doing total_hours_in_sprint / velocity
 
11:03 AM
"Agile software development is a set of principles for software development in which requirements and solutions evolve through collaboration between self-organizing, cross-functional teams. It promotes adaptive planning, evolutionary development, early delivery, and continuous improvement, and it encourages rapid and flexible response to change"
 
@Robert psst, we’re not supposed to do that!
 
you can totally do scrum that is not agile
 
Yeah but isn't that "bad scrum"
Pretty sure scrum is meant to be an implementation of agile principles
 
@poke I know :) my point was in relation to someone else's question.
I have definitely been in scrums that were so un-agile they frequently fell over. :)
 
I went to an event at a Nokia unit, they told how they do scrum there
 
11:05 AM
@Withnail Oh sorry, I meant to reply to khajvah there.
 
I was like ... "oh wow... now that's bad"
 
Hehe, np.
 
well, it was before that unit was sold to microsoft as well, and everyone there sacked
 
Maybe this isn’t done in every scrum process, but usually you set in stone how and what is done at the beginning of a sprint. So during the sprint, you cannot react to changes in an agile matter (as that would invalidate the sprint planning and the estimated complexity, and as such break the velocity)
 
exactly
this is because it is a new product development game...
 
11:07 AM
i was at a talk a couple of weeks ago, and the guy went off on a tangent and said "Y'know, it's really easy to be critical of MS, the way they come in and buy up young companies and transform them into lifeless bureacracies." And then stopped. Guy in the audience says "What's the 'but'"? "Oh, there's no but. It's just a statement of fact." then went on with his talk.
 
@Withnail microsoft didn't turn nokia mobile phones into a lifeless bureaucracy
it just killed the zombie :D
 
haha, quite. :D
 
@AnttiHaapala I’m very sure that it’s not limited to “new” or even “product development”. I’m pretty sure that you can apply Scrum to any kind of project. And even so, I don’t see how that would change anything
Or are you trying to say that in “new product developments”, requirements don’t change?
 
no, i don't say that.
I just say that in new product development you can have a sprint of 1-2 or even 4 weeks for which the requirements in that iteration do not change.
you can prioritize the backlog by change risk
I do not believe in the kanban stuff at all
 
You can do that, but it’s not guaranteed. And if they change, you cannot react within that time frame, so you’re not really agile.
 
11:11 AM
of course new info can go to the sprint
but you cannot say "lets not do x"
because the team might as well have been doing just x
let me find that slashdot post :d
 
My point is that I’ve been often enough in a situation where we planned to build X according to plan Y, and then during the sprint, requirement Z changes, which has an impact on X, so we should rather do it according to plan Y2 but we cannot do that since we already agreed to do Y even if that means we have to throw it away later (and even if we didn’t start with Y yet).
 
"The problem is not in "Agile" methodology.

The problem is in "Mongolian Clusterfuck" methodology, called "Agile" by managers who think "Mongolian Clusterfuck" isn't catchy enough.

Agile sets short reachable targets, and reiterates and modifies them upon reaching them. The cycle is 2-4 weeks.

Mongolian Clusterfuck is similar, but the cycle is 2-4 hours and the targets that haven't been reached are abandonned half-finished.

Agile has specs that accept modifications when the customer requests them. Mongolian Clusterfuck has specs that change every time your boss stops by.
 
“Agile sets short reachable targets […] The cycle is 2-4 weeks.” – [citation needed]
Agile doesn’t say anything about cycles. Agile is only about reacting to changes.
It seems like we should s/Agile/Scrum/g in that quote.
– Anyway, project management is terrible and so often only gets in the way. Just let me do my work please :(
 
I have no idea what you're all talking about, but the definition includes "holistic" which is enough for me to hate it
 
@AndrasDeak the holistic part isn't that bad...
 
11:19 AM
:)
 
I'm just waiting for someone to chuck in 'homeopathic' project management and then we're done
shut down the internet.
Peak Project Management.
Although
could be a good excuse to waterboard some PMs?
 
Using water that once flowed over a Scrum Master
 
'let's run that up the flagpole and see who salutes.'
sploosh
I'm not procrastinating from what I'm supposed to be doing, honest.
 
We have a training here with the goal of becoming a certified scrum master. I refuse to take that training. I don’t want such a “title”.
 
are there certified scrum slaves?
 
11:24 AM
Thanks for that @khajvah literally just snorted into my tea
 
@poke you can still do the training, just don't call yourself the title
 
No, I refuse.
I don’t want anything to do with it.
 
Cabbage
 
Lol okay
 
It will probably try to kill me from the inside otherwise.
I’m not giving it that chance!
 
11:26 AM
I've done a 2 day course which wasn't amazing, but wasn't the worst thing ever
 
Imagine what else you could have done in two days though!
@PM2Ring cabbage!
 
I think you overestimate my average two days
 
@user1375469 Docstrings should be at the start of the entity that they belong to. So the docstring of a class should be on the line after class MyClass:, i.e. before the __init__ method. There's (probably) not much point giving the __init__ method its own docstring.
 
@RobertGrant How many complexity points is that? ;P
 
cabbage
 
11:36 AM
cbg
 
Holiday tomorrow \o/
 
Is it too bad to not close the db cursor?
 
@poke I can't tell you yet until I've got my velocity sorted! I'll do that by figuring out how many points that is.
 
11:51 AM
The leader of the governmental anti-corruption committee in my country lives in a huge 4 floor house. The irony is pretty damn strong
his official salary is $1k/month
 

« first day (1991 days earlier)      last day (2940 days later) »