« first day (1583 days earlier)      last day (3380 days later) » 
01:00 - 15:0015:00 - 23:00

1:03 AM
Help?
never mind
 
 
2 hours later…
2:41 AM
@BenjaminGruenbaum come back when @Ffisegydd is around. :)
Unless you mean ML as in Machine Language / OCaml.
 
 
3 hours later…
5:51 AM
Machine learning
 
6:32 AM
@Brunaldo not like that (and not even in java can you A-Z 0-9,
only A-Z, as 0-9 does not follow A-Z in ASCII
@Brunaldo you could tell exactly what problem you're solving so we can tell you how to solve it better than in java
if you need a loop that loops characters:
import string
for c in string.ascii_uppercase:
this is the same as the java
for (char c = 'A'; c <= 'Z'; c++):
I think the python version is more readable
ofc in Python you can do a thing like:
for c in (chr(i) for i in range(ord('A'), ord('Z') + 1)):
     ...
but that's just plain ugly
 
Django is not working in 3.5 :(
 
IRC suggested me to use 3.4
 
even better
why isn't it working
 
6:47 AM
haha
 
I got that when I did django-admin.py startproject <project name>
 
that looks like more a bug in python3.5
 
But the problem is actually in django utils, no?
 
HTTP status code and messages from http.client and http.server were refactored into a common HTTPStatus enum. The values in http.client and http.server remain available for backwards compatibility. (Contributed by Demian Brecht in issue 21793.)
HTMLParseError
where did this exception class go?
wait
 
I have no idea :( I know only builtin functions in Python
 
6:50 AM
class HTMLParseError(Exception):
    """Exception raised for all parse errors."""

    def __init__(self, msg, position=(None, None)):
        assert msg
        self.msg = msg
        self.lineno = position[0]
        self.offset = position[1]

    def __str__(self):
        result = self.msg
        if self.lineno is not None:
            result = result + ", at line %d" % self.lineno
        if self.offset is not None:
            result = result + ", column %d" % (self.offset + 1)
        return result
this is builtin
see 3.5 html/parser.py
and see how they fubared those exceptions
if they added more, then they should have subclassed from common base
heheeee
it is because html.parser cannot raise any errors anymore
so it is a bug in django
 
But, _html_parser is defined as from django.utils.six.moves import html_parser as _html_parser
 
I know
it is html.parser that is what six does
 
Can you join the django IRC channel, if you dont mind?
I think you can explain this better to them :-)
[12:09] <thefourtheye> I installed django 1.7.4 in Python 3.5
[12:10] <FunkyBob> ok
[12:10] <thefourtheye> and I just executed django-admin.py startproject myproject
[12:11] <thefourtheye> and I got this error gist.github.com/thefourtheye/2205fe8ff7974e2cebf6
[12:12] <FunkyBob> perhaps if you used a python version that's actually released?
[12:12] <FunkyBob> and listed as supported by Django?
[12:12] <Kye`> check mate
[12:12] <thefourtheye> Hmmm, the tutorials page says "This tutorial is written for Django 1.7 and Python 3.2 or later. "
This is the chat history
 
ingenious to use something that is deprecated until it starts causing problems
what do they use it for
 
wtf
PEOPLE LERN PYTHON
 
@AnttiHaapala He asked us to create a ticket. Shall we?
 
you can :D
I do not want my name in django bugtracker, ppl would think I actually use django :D
 
lol, I just started out today... :)
 
haha you write what I put in IR
say that you tested django on 3.5 but it is broken as html.parser.xxx is deprecated as per documentation docs.python.org/3/library/… here and this is the traceback I get
 
I think your name should also be there in the ticket. If they ask questions, I may not be able to handle :(
 
7:00 AM
wtf
their bugtracker is horrible
no wonder django is horrible
I cannot search bug by text
ah I need to go to "search" tab
got alreadyt
fix is in github
 
Cool then :-) We just have to wait for the newer version.
 
meanwhile you could try other web frameworks :P
 
@CurtisMaloney Welcome to the room :-)
@AnttiHaapala For the time being, I am going back to 3.4. Django is huge...
I just want to get the basic idea atleast.
 
7:19 AM
@thefourtheye trypyramid.com
 
The example looks really simple. But even flask was equally simple.
 
yes
but the pyramid is made by folks who worked at Zope corporation and Digital Creations
they made a framework that could underlie a new zope
 
Interesting...
 
I bash django because it is not the best tool for job
I have been doing web apps for 15+ yrs
 
Its really heavyweight :(
 
7:23 AM
I have done more horrible and less horrible
have coded my own frameworks and so on...
django has all parts glued too hard to each other
then you have to tolerate their incompleteness
because you cant really replace any of them
 
Hey look, you and @MartijnPieters have contributed to pyramid :-)
@AnttiHaapala But there are many job openings for a Django developer in India :(
In fact, a Python opening is nothing but a Django opening
 
yes
and that is why I hate django
it is being pushed everywhere even if there is nothing pythonic about it
Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
the django is complex and complicated.
just for fun I was looking into if i could bolt pyramid under django
but ... I just got headache
 
Okay, I am officially scared of django a little bit..
 
stackoverflow.com/questions/28519473/how-i-can-convert-this-code-from-matlab-to-‌​python
@Ffisegydd ^
@thefourtheye ^
soemone in the room was a bit trigger-happy
and put the stone rolling
 
Can you format as link? I'm on my phone :p
 
7:32 AM
Strange, I opened that link with https and I couldn't vote for reopening.
 
Nvm got it
 
not too broad to ask 1 expression of matlab to 1-2 expressions of numpy
 
Oh my bad... I had to whitelist https version of SO in one of the popup blocker plugins...
 
cbg
stackoverflow.com/questions/28523978/… is very unclear; if he doesn't add a code snippet, I suggest close-voting.
 
7:40 AM
ah
@PM2Ring meaning: collections.namedtuple
which uses exec and does all sorts of nasty things
 
@AnttiHaapala Ah. I guess that makes sense
 
    # Fill-in the class template
    class_definition = _class_template.format(
        typename = typename,
        field_names = tuple(field_names),
        num_fields = len(field_names),
        arg_list = repr(tuple(field_names)).replace("'", "")[1:-1],
        repr_fmt = ', '.join(_repr_template.format(name=name)
                             for name in field_names),
        field_defs = '\n'.join(_field_template.format(index=index, name=name)
                               for index, name in enumerate(field_names))
so it means this, but i'd still vote as unclear :D
or should I answer :D
 
I think vaultah answered this recently
 
7
Q: Why doesn't the namedtuple module use a metaclass to create nt class objects?

Rick TeacheyI spent some time investigating the collections.namedtuple module a few weeks ago. The module uses a factory function which populates the dynamic data (the name of the new namedtuple class, and the class attribute names) into a very large string. Then exec is executed with the string (which repre...

that is: not really
 
@AnttiHaapala OP just added a comment; it doesn't help.
 
7:52 AM
Okay, I just started the Unclear voting.
 
answered :D
"You feel you have enhanced your clairvoyance"
0
A: extend Python namedtuple with many @properties?

denisHere's one approach, a little language: turn this into Python text like the above, and exec it. (Expanding text-to-text is easy to do, and easy to test — you can look at the intermediate text.) I'm sure there are similar if not-so-little such, links please ? # example of a little language for d...

what did I just read???
 
@AnttiHaapala I just captured what we did with 3.5 and Django thingy, in this post
 
haha :D now you associated me with django about everywhere, nvm
 
If I am going down, I am taking you with me :D
 
8:07 AM
bc I bash django exactly because they are so boneheaded can't argue with them
everyone who thinks django is best they say "I never used anything else, django is best"
it is not much different from "php is best, I never used anything else"
if I say what kind of problems I have had with django and how could django be done better and blahblah it is like "ah but those are never problems with me, djangodjangodjango"
and then the "instagram is built with django"
yeah, and facebook with php
9
Q: Configuring Django to use SQLAlchemy

nazmul hasanhow we configure django with SQLAlchemy??

it goes so far that if you want to do any other orm with django, you need to fork django on repository level
 
user559633
8:45 AM
@AnttiHaapala from reading some of the closed pull requests on django, i have to agree with you on that perception
 
the "webframework for perfectionists with deadlines" is not very apt slogan
 
user559633
never mind the project being susceptible to idiocy and trolling
 
alex gaynor
I do not like the leader-follower in that
because a leader/follower relationship is not a master/slave relationship :D
 
user559633
yeah...not even that, but it's just so... "really? really."
 
last comment:
Hi, i feel personally offended by racist name of this repo while it associates with tragic story of one american slave. I demand changing its name to "My Web Pony".
 
user559633
8:53 AM
"My" infers ownership. Rejected.
 
Our
collective ownership
Master/slave is a model of communication where one device or process has unidirectional control over one or more other devices. In some systems a master is elected from a group of eligible devices, with the other devices acting in the role of slaves. In other words "The master/slave configuration is basically used for load sharing purposes when 2 identical motors connected to two different drives are coupled to a common load". One drive is defined as the master and is configured for running in the speed-control mode whereas the other defined as slave is configured for running in torque-control...
the primary-replica I do not object to, it is better than master/slave bc it is a term specifically used for replication, while master/slave is used for control hierarchy
 
user559633
I pulled out of most tech communities to avoid such nonsense, but now that I work with django again, it's just disappointing that people aren't just told to hush and go back to coding (i got into tech because it was a break from trivial crap)
 
ah django wsgi handler isnt that bad anymore
now it doesn't do that much stupid things
 
user559633
primary/replica isn't as clear an explanation of the relationship between one set of code that follows everything another set of code tells it to do
 
def get_str_from_wsgi(environ, key, default):
    """
    Get a value from the WSGI environ dictionary as str.

    key and default should be str objects. Under Python 2 they may also be
    unicode objects provided they only contain ASCII characters.
    """
    value = get_bytes_from_wsgi(environ, key, default)
    return value.decode(UTF_8, errors='replace') if six.PY3 else value
 
user559633
9:01 AM
also lol "merged 1 commit into django:master from unknown repository" 1) lol that it's merged into master 2) lol unknown repository...
 
still gems like that.
why does 1 want to have all strings being handled with a function like that
and the UTF_8 errors replace...
 
user559633
i don't really understand why that's in there...good god
 
if six.PY3:
    def get_str_from_wsgi(environ, key, default):
         return get_bytes_from_wsgi(environ, key, default).decode(UTF_8, errors='replace')
maybe their testing framework would report bad coverage for that
or maybe there is a chance that the Python version can be changed when the code is runnin
 
user559633
code.djangoproject.com/ticket/22667 i love how the comments are vastly different from the people actually writing the damn thing
 
user559633
"Making Django's docs more difficult to understand for the people who need them most, for the sake of political correctness, seems like a bad tradeoff." and then a criticism of how it was rushed through because someone was getting favors or was using the project as their soapbox
 
user559633
9:25 AM
Anyway. Flask is a pretty great library.
 
pyramid
D:
 
user559633
Why pyramid? (i haven't looked much into it)
 
hehe running django in pyramid :P
pyramid is written by guys who love python
and have more experience with python than me
the guys have written big webapps when ronacher was 10 yrs old. age's not the issue here but they know how to do big webapps and what kind of framework to do for that
 
user559633
Sure, but as an "end user" of it, how does that help/what do I see as improvements over flask?
 
user559633
as a use case: i have an application i'm hacking on that consists (as far as python is concerned) of a webapp that serves templated user pages and an API to support it (for async calls to geolocation/analytics/data processing)
 
user559633
9:37 AM
(also, i thought that pyramid v. django was more of a relevant comparison. from what i've been reading though, it seems like it would be really easy to use pyramid for my api)
 
in simplest of cases flask vs pyramid does not matter
but pyramid is sort of a metaframework in that it has been built with replaceable batteries
out of box it works mostly like flask but it does not need to
 
user559633
i'm getting the feeling that i should just code in it to really learn the difference?
 
say, someone complained that "pyramid views do not accept query parameters as keyword arguments"
so one says "no, but you can replace the viewmapper to make exactly that"
the request and response are defined in terms of interfaces
you can replace the request and response with your own class that does not need to be extension of the python class - it could be written in C for speed
-> works
 
user559633
so it's capable of generating scaffolding, but also built to be un-opinionated enough to let you replace components?
 
yes
and it still is fast
 
user559633
9:42 AM
awesome, you sold me on it.
 
because most of these "components" do their work on startup
django does lots of ifs on runtime "if debug do this if debug do that"
pyramid approach is: on startup "if not debug then just chain to this function directly"
the only pain point for me is that ... there is no admin interface :D
we are using flask admin now
 
user559633
that's fine -- i'm used to coding my own. i saw flask admin about a week after i had my first pass at my own panel written
 
ah also, pyramid allows you to do test driven development easier
the function decorators on views do not change the results; neither does one ordinarily return a response; instead if your view returns json, you just return {"your": "json"}
and you can import this function, and run it from shell, or in tests assertEquals(response, {"your": "json"})
only on server startup does it map it to a route-view pair that passes the result of that fucntion to the 'json' renderer.
 
user559633
10:22 AM
careers.stackoverflow.com/jobs/78652/… not sure if maybe cool or if working for narcissist
 
10:33 AM
haha :D
that really reads scary
though I love the part "don't need to have your resume ready"
argh django execute from command line re-executes the script
 
10:57 AM
github.com/ztane/pyramid_django run django app in pyramid
 
cbg
 
cbg
stackoverflow.com/questions/2193009/… flagged this as very low quality but it was disputed
 
Lol, how far is Marshall?
 
11:10 AM
@Antti well... it looks like an answer, with some text and a code block... a mod doesn't have to to review it for quality concerning accuracy... If you don't think it's good - that's what a downvote is for...
 
i am reading answers from that user
did already
I am reading answers from that user, I do not understand any of them
 
This would work certainly but it's not the answer that I'm looking for. If I press enter as suggested it will execute the loop and then the next print would be a new statement. The question I guess should be, how do I add an extra statement after a loop on the terminal before executing the loop? — Vinicius Santana 33 secs ago
Dafa?
 
@JonClements does that answer qualify for down vote in your opinion?
 
@AnttiHaapala I only scanned it.. it doesn't make sense though... so yeah
 
11:44 AM
@AnttiHaapala Why a dv on stackoverflow.com/a/28525475/4099593 ?
It actually makes sense
 
dunno
maybe because I said django is horrible I am now targeted :d
 
12:13 PM
0
A: Injected 64 bit shellcode wont execute syscall

Antti HaapalaThe reason might be that the write syscall returns an error code. It could be for many reasons, but maybe rdx is not all zeros, so you should xor %rdx, %rdx before loading 15 there (actually you should load 14 only, for "Hello, World!\n"). Anyway, the error from write would be returned in rax, ...

 
Unknown language ... :(
 
I want to get 15 upvotes from php
but I cannot find any questions I'd bother to read :D
 
Lol, answer some old question with a long blog
Woah! 7th upvote
3 more left
 
grr
you get upvotes by saying "you need to press enter" :D
 
yay!
All my answers are damn simple... My best answer is 2 lines
 
user559633
12:18 PM
(.__.) sigh.
 
Why?
 
user559633
Haha, because I rarely get above 3 points and I always write far more thorough answers. (e.g. 0)
 
That's soo sad. I had written a long answer and got 2 upvotes, then I decided to attempt small ones
 
user559633
I'd say that at least 75% of my answers are more than 3 lines
 
@tristan Indent that docstring in your answer
 
user559633
12:23 PM
cheers, indented
 
stackoverflow.com/questions/28522541/injected-64-bit-shellcode-wont-execute-sysc‌​all/28525811#28525811 updates
 
I just spent close to an hour mucking around with this, and haven't even got a comment on it (yet). But I just did a FGITW on this and already scored 35 points. :) I originally just posted 3 lines, but then added a couple of explanatory paragraphs, but I'd already got an upvote before I submitted the explanation.
 
:D gave you 3rd :D
haha to make you crazy by not getting upvotes to the another
 
:)
 
no accepted answers today
like wtf
I will quit stackoverflow soon
this is not fun at all
 
12:29 PM
Yeah, right
 
why don't the ppl whose problems I solve actually try out what is proposed to them
I have a feeling this is much worse now than 1.5 yrs ago
 
I often get accepts without upvotes. But I guess that's because I answer lots of questions from 1-rep users. But I almost always link them to meta.stackexchange.com/questions/5234/… , especially if they make a positive comment about my answer.
 
all the questions have been answered and only those ppl who are too lazy to use search or google ask questions, and then they are too lazy to comment/upvote/accept
I want my stackoverflow blacklist
 
@AnttiHaapala It's a mystery. To me, coding has always been something you learn by experimenting.
 
Upvoted yours, if I had gold, would have marked it as dupe of stackoverflow.com/a/28243098/4099593
 
12:33 PM
But Question-askers not testing code doesn't bother me as much as question-answerers posting broken code that's obviously untested. Sure, sometimes it's not possible to test things, but surely you can scan such code for obvious syntax & logic errors...
 
i post first then test :d
 
Thanks, @BhargavRao
 
then edit within the 5 minute grace :D
 
The 5 min grace is the saviour of all of us
 
Ah. I see you like skating on thin ice, Antti. :)
 
12:35 PM
I don't upvote 0 voted answers, Just so that they'll be nearer to Unsung Hero
 
yeah, I will never get there :D
 
Lol, same case. Pm2Ring is lucky in this case
 
2 of my friends have unsung hero
one I do not know why, but the other because of
 
user559633
I'm slowly pulling away from unsung -- I was on track for months
 
I'm fond of my Unsung Hero badge... but I wouldn't mind the points, either. :)
 
12:43 PM
I think legendary is more important than Unsung :P
 
Why not both?
 
both cannot be more important than the other
 
Why not get both?
 
bc it would take more time :D
jonskeet doesn't have unsung
 
Yeah, would have got white beards by then
 
12:46 PM
neither does Martijn
 
Did you mean Margin?
 
yeah, margin peters
 
@AnttiHaapala This guy?
 
If Margin sees, he'll kick me out
 
12:59 PM
I starred it :D
 
That's bad, he will come to know
 
@AnttiHaapala hey sorry for the late reply. referring to this msg: chat.stackoverflow.com/transcript/message/21553683#21553683 . Here are some examples of the range types that I need to loop through: pastebin.com/Wdm9MJnS
For now I'm just using a list containing the alphabet (in uppercase) and just looping through that to create the ranges.
 
so these are always A-Z followed by 0-9?
 
yup
and another loop for the numbers*. I know it sounds ugly but I've just started using python :p
 
this is not a very common problem, but I have an idea on how to make a very cool and ugly solution for it :P
 
1:04 PM
I'm all ears!
 
are you using python 2 or 3?
 
or eyes lol
3.4
 
This question stackoverflow.com/q/28514373/4099593 has got two great answers
 
@Brunaldo damnit this is really hard to do as nicely as I want
 
hah! it's fine if it's ugly
 
1:19 PM
so did you ask this on the site?
 
nah, you think I should?
 
digits = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'
digits_2_index = dict((e, i) for i, e in enumerate(digits))

def charrange(frm, to):
    def to_list(s):
        return [digits_2_index[i] for i in s]
    def to_str(l):
        return ''.join([digits[i] for i in l])

    frm = to_list(frm)
    to = to_list(to)
    if not frm:
        raise ValueError("From must have at least 1 element")
    if frm > to or len(frm) > len(to):
        raise ValueError("From greater than to")

    while True:
        yield to_str(frm)
quite big code this ended to be
the problem is python does not convert integers to strings in arbitrary bases
 
wow
very nice!
 
there are some problems, A-Z is followed by 0-9
you can have leading A etc etc...
 
that's fine, I can see what else I can do with it
thank you for your help!
 
1:27 PM
random upvotes to my good answers accepted :D
 
Sorry but can you upvote comments in chat? I'm not sure lol
 
@Brunaldo Well, you can star them, but antti meant that you can upvote his good answers on the main Stack Overflow site.
 
ohhhh
yeah sure XD
 
@Brunaldo Antti meant that you need to upvote this stackoverflow.com/a/28525326/4099593
 
See here
 
1:33 PM
lol @BhargavRao just this once
 
@AnttiHaapala Yeah, that's weird. Base 36 implementations that I've seen in the past always put the letters after the numbers. FWIW, I vaguely remember doing some base36 stuff in C back in the days of FidoNet; IIRC, it was for RipScrip.
@BhargavRao I might refrain from close-voting on that one, since his last question was that one I just won a stack of rep from. :)
 
Yeah, I know, but this is a clear HW
He edited
 
1:49 PM
deleted..
 
@AvinashRaj How did you write this stackoverflow.com/a/28526394/4099593 answer, without REGEX? Did someone hack your account?
 
i know python little bit.
 
But you and RegEx go hand in hand.
 
@BhargavRao True. In fact, it's not just homework, it's for his GCSE. So was his last question, but at least he posted code for that one.
 
if someone provides a regex answer then i'll try to provide an answer without importing re module.
 
1:53 PM
@PM2Ring Then good that it got deleted.
@AvinashRaj Good answer though :)
 
@BhargavRao ROFL
 
if the answers are in a pythonic way then i try to provide a regex solution.
Oh, we won the today's match.
 
*won
@AvinashRaj Let's just congratulate each other. Congrats.
 
yep. poor in Grammar . lol :)
 
There was a bizarre regex question in here a few days ago which antti & I commented on. The guy wasn't using the re module : he was trying to call grep through subprocess() !
 
1:58 PM
@PM2Ring where?
 
deleted my answer
Was too vague an answer
Need to get 10k asap, to delete
 
@AvinashRaj Here in Chat. Sorry, I don't have a link.
 
@AvinashRaj You need to add [tag:delv-pls] before that :)
 
hmmm.
 
2:25 PM
rhubarb
 
2:35 PM
@BhargavRao need 20
@AvinashRaj it was head | grep |tail
+ the grep didnt match anything so the pipeline exited with 1 and check_output threw up
 
could you post the full command?
 
no
:d
cant find
 
head -n1 file
prints the first line.
 
Feb 11 at 10:23, by user1977867
@AnttiHaapala i mistyped the last post. I'm using
subprocess.check_output(cmd,shell=True)
tail: write error: Broken pipe
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/subprocess.py", line 544, in check_output
raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command 'tail --line=+4181 /my/file | head --lines=222 | egrep --regexp="STRING"' returned non-zero exit status 1
 
is this tail --line=+4181 /my/file | head --lines=222 | egrep --regexp="STRING" his command?
 
2:41 PM
yeah,
equally well could have opened the file, line-iterator, then 2 islices and re.search
 
  -n, --lines=K            output the last K lines, instead of the last 10;
                           or use -n +K to output lines starting with the Kth
      --max-unchanged-stats=N
                           with --follow=name, reopen a FILE which has not
                           changed size after N (default 5) iterations
                           to see if it has been unlinked or renamed
                           (this is the usual case of rotated log files).
                           With inotify, this option is rarely useful.
i think it would be --lines
@AnttiHaapala don't know what the actual question is..
 
the actual question was the failure in checl_output
anw ...
not really importatn
 
2:59 PM
@AnttiHaapala Yep, 2 more... :(
 
01:00 - 15:0015:00 - 23:00

« first day (1583 days earlier)      last day (3380 days later) »