« first day (2037 days earlier)      last day (2905 days later) » 

1:00 PM
I am 13 years old and 1 year about computer science study. Only that I like many computer science courses (web design, web developer, programming, sysadmin and many more), where should I start?
 
Anonymous
@AnttiHaapala It is continuous. It runs everyday via cronjob.
 
start with learning basic concepts of programming
 
Anonymous
@Rain What do you know, and what do you want to learn?
 
@Rain start from programming.
 
I know HTML5 and CSS only. I'd installed linux 2 week ago about for study it. I would study mainly programming, sysadmin and linux
 
1:04 PM
study programming :d
 
ok @AnttiHaapala
 
@rain you have time on your side, so much time it almost seems unfair haha, just try everything. Programming is probably the easiest to study with the resources online.
 
while you program, do it in linux, and you will get familiar with it.
 
ok, I've ubuntu
 
do not even think about sysadmin.
 
1:05 PM
I will do C -> ASM -> C++, is good?
 
do python.
 
u wont need ASM much
rarely
 
haha in a python chatroom
 
:D
 
ok
 
Anonymous
1:06 PM
learn PHP
 
Anonymous
/s
 
do python, do C, do Java, do something like lisp/haskell/scheme/erlang :D
 
ok thanks :)
 
swings boot
@Rain never ever learn php
 
can u guys look at my ques please ?
 
1:07 PM
PHP is cancer :D
 
<< php dev :(
but yea dont bother with php
 
there is nothing to be learned from PHP
 
if you want to do web dev just learn javascript
 
i go afk for a few time
 
ah yeah javascript
learn the good javascript, the crockford javascript
 
1:08 PM
(i must set up my desktop pc, I am putting w98 on my cancer pc lol)
 
but you can start by learning Python well
 
i go afk, bye lol
 
w98!?
 
Python needs two backslash for regex patterns?
- \d
or
- \\d
?
 
nope
 
1:09 PM
@Shafizadeh ...
the thing is the \d is an unknown escape sequence in strings
so it is still kept as \ and d.
but \n then will make 1 character, the newline
... already in string.
 
@AnttiHaapala u use celery ?
 
no
neva
 
is using gevent instead of simple threads
better ?
 
"Do you use celery?" is like "do you use a wheelchair" :D
 
@AnttiHaapala \d matches one digit. it is nothing to do with strings. All I wanted to know was: how many backslash should I use for python patterns. (I thought it is like java)
thx anyway
 
1:11 PM
@Shafizadeh it is like java
 
@AnttiHaapala so I have to use two backslashes ?
 
but there is the raw string notation:
... except you do not have to use 2 slashes there
because:
>>> '\d'
'\\d'
 
I see
thx
 
but
>>> '\n'
'\n'
 
got it
 
1:16 PM
@AnttiHaapala can u check this please ?
so, im working on a app which gets all the tokens from db and uses them to connect to slack websocket for teams and reads the socket every 1 sec and processes it, so as of now i just get all the rows from db and start a new thread for them , what i want to ask is , is there a better way to do this ? with celery or gevent (im not very much familiar with them, yet)
any idea ?
import time
from slackclient import SlackClient

token = "xoxp-28192348123947234198234"# found at api.slack.com/web#authentication
 
re-cbg
@Prakhar Please do not target people with your questions, unless you are continuing an earlier conversation about the question with them. Just ask your question, and if someone has the knowledge, the time, and the desire to help you, they will do so.
 
sry im new here
 
@Prakhar anw, why'd you sleep
doesn't rtm_read block
@PM2Ring hows python3?
 
1:33 PM
@AnttiHaapala It seems to be working ok. But it will take me a while to get used to certain aspects, like handling raw binary data, as I mentioned a couple of hours ago. I don't like my Python 3 version of my hexdump function... but maybe I'm just doing it wrong. :)
 
of course you're wrong :D
you can do hexdump function into 2-3 polyglot
except, of course in 3 you can iterate ints
 
just reading
 
Ok
 
@AnttiHaapala sleep it 1 sec because i want to read it every sec
 
1:37 PM
I am aware of many of the differences between Python 2 and 3, but I must admit I am a bit hazy on the string / bytes stuff. And I guess the 2to3 program can be of only limited help with stuff like that.
 
it is true
I am just thinking that you've done a rather faithful translation of the py2 verison
especially if speed was a priority, I'd precalculate the chr(u) if lo <= u <= hi else '.' and
format(u, '02x') for u in row if u is not None
parts into a dictionary
@PM2Ring why'd you not use format strings :D
 
@AnttiHaapala Ok. That makes sense, and I've often done that sort of thing, but it wasn't really necessary for the Py2 version.
 
print(f'{count * width:08x}  {hexstr[:24]} {hexstr[24:]}  |{ascstr}|'))
 
@AnttiHaapala Hey, give me time to get used to the older parts of Py3 first! :)
 
it wasn't, but your python code is rather a hack though :d
hmm perhaps you should use a chunking generator instead of izip_longest
note also that you can do:
 
1:45 PM
I was also a bit upset to discover that [chr(i) for i in range(256)] no longer works. But I guess that's one of the sacrifices necessary for Unicode everywhere...
 
cabbage
 
lo, hi = b'\x20\x7e'
in python 2
@PM2Ring for genreating bytes?
bytes has .hex() too
 
@AnttiHaapala I do understand why it doesn't work to make a list of bytes. My Py3 version of that is just data = bytes(range(256))
Hi, Andras.
 
aaand gotta go mop the floor
 
people would go insane if elements of lists of integers were lists of integers :d
 
1:56 PM
Do you mean something like this:
(data[i:i+width] for i in range(0, len(data), width))
 
2:07 PM
> For example, the symbol for ohms (Ω) is usually drawn much like the capital letter omega (Ω) in the Greek alphabet (they may even be the same in some fonts), but these are two different characters that have different meanings.
whaaat
it's about time I read the unicode how-to, then:/
next time they'll tell me that the capital kappa and mu are not actually K and M:P
 
DSM
According to the unicode spec, "The ohm sign is canonically equivalent to the capital omega, and normalization would remove any distinction. Its use is therefore discouraged in favor of capital omega." So I don't think the distinction should be relied on.
Oh, belated morning cabbage, all!
 
@AnttiHaapala Ok. Here's a version with that chunking genny and format strings:
def hexdump(data):
    width = 16
    ww = 3 * width - 1
    lo, hi = 0x20, 0x7e
    chunks = (data[i:i+width] for i in range(0, len(data), width))
    for count, row in enumerate(chunks):
        hexdata, ascdata = zip(*((f"{u:02x}", chr(u) if lo <= u <= hi else '.')
            for u in row))
        hexdata = ' '.join(hexdata).ljust(ww)
        print(f"{count * width:08x}  {hexdata[:24]} {hexdata[24:]}  |{''.join(ascdata)}|")
    print(f"{len(data):08x}")
 
DSM
Wait, len(data) works with f-strings too?!
 
Morning, DSM. (It is actually morning here - 12:16)
 
@DSM I wouldn't know, you need to ask PM, he's the expert with Python 3.6 now
 
2:17 PM
@DSM Sure. And there's a .join call inside an f-string on the previous line.
Although that one didn't work at first, since I was using single quotes on both the f-string and the join. :)
 
@AnttiHaapala LOL
 
DSM
Huh. I haven't used it for anything, so in the back of my head I thought the new evaluation magic only supported name lookup. TIL!
 
@DSM there is no magic
 
@DSM good to know, thanks (I was going to ask if there's a unicode character for joules and kelvins too...), cabbage:)
 
2:20 PM
@PM2Ring you do not really need that zip there
 
@AndrasDeak Speaking of µ, from the xkcd forum Bad science jokes!:
Q: Two cats are making a noise on a steeply-sloped roof. Which one falls off first?
A: The one with the lowest mew.
 
hex_data = map('{:02x}.format, u)
 
@PM2Ring :|
thanks:D
 
@AnttiHaapala Good point. I only did it that way in an earlier version to avoid doing two loops over the data that both had to test that u is not None
 
> Side note: Python 3 also supports using Unicode characters in identifiers:
noooooooooo
első_elem = lst[0] ?????
why would anybody do that?
and it works :|
chinese python code ftw
I'm sorry to see that things like ⌬ are not allowed
In [178]: ಠ_ಠ = 8

In [179]: print(ಠ_ಠ)
8
last one, I promise
 
2:31 PM
ಠ_ಠ = 'Canada'
@BhargavRao ^
 
@AndrasDeak Me too. FWIW, I saw a JavaScript program a while ago that did latitude and longitude calculations that used λ and ϕ as variables. I suppose it looks cute, but it'd be painful to work on if you didn't have the right keymaps.
 
@PM2Ring good deterrent
I'd want λ for lambda functions though
λx: x+5
 
that's Mathematica for you
 
ftw
though...
 
2:33 PM
at least its not Swift
 
perhaps, since -> is not valid syntax in python outside function annotations,
i'd make a source filter for
x->x+5
 
DSM
We could borrow => syntax too. Lots of options.
 
user559633
"This is actually brilliant. It can help teaching programming to young people." yeah not sure using emoji everywhere helps teach young people what they're doing
 
I'd want to add blocks to python
 
user559633
💯
 
2:37 PM
 💩 = eval
 
user559633
DSM: Congrats on the new job at NumberFirm
 
DSM
@tristan: thanks! I'm looking forward to it, it has a much better ratio of stuff I like doing to stuff I hate doing than my former position. So my resignation worked out very well: hope yours does too!
 
user559633
Glad to hear it (and cheers)
 
@AndrasDeak That 💩 can also be used as an abbreviation for PHP.
@tristan Apparently, the name of that album was partly inspired by Miles' wife at the time, model / singer Betty: Nasty Gal. FWIW, Betty introduced Miles to Jimi Hendrix... and Miles was rather suspicious that Betty & Jimi were having an affair.
 
user559633
2:53 PM
Interesting
 
@tristan I suppose it is. That tone of that track's pretty harsh; I only selected it because she uses the word "bitch". Maybe try some of her other stuff before you totally reject her.
 
user559633
That's part of why I edited. I realized that I was judging on a single song (without even bothering to reflect) and it doesn't matter if I like a thing or not. Additionally, I was glossing over the appreciation of you taking the time to teach me a thing
 
user559633
 
Nice comic. :) And thanks for the appreciation. But I'm happy to concede that Betty Davis is an acquired taste. :)
 
@AndrasDeak that doesn't work in python
 
user559633
3:01 PM
Keep in mind that suggesting things to me is like dragging your rural cousin to Cafe Pushkin and watching him get confused when, not only are sodas not listed next to entrees, the entrees aren't all corporate-named hamburgers
 
FWIW, I recently bought a newish Betty Davis tribute album Ooh Yea! made by Mahalia Barnes, daughter of legendary Australian singer Jimmy Barnes, with Joe Bonamassa on guitar.
 
user559633
Yeah, to use the ascii poop as a callable in Python, you'd have to use it in a dispatch dict

>>> dispatch = {'💩': eval}
>>> dispatch['💩']('1+1')
2
 
user559633
Cafe Pushkin does delivery now? What are you guys doing
 
@tristan :) I was a bit surprised that you linked to Bitches Brew. It's a classic album, but I haven't listened to it in ages. OTOH, I was listening to some of Miles' earlier stuff this afternoon.
 
@AnttiHaapala I know:( It was related to the swifty things...
 
user559633
3:09 PM
I'm not big on jazz. i actually think most of the jon benjamin joke album is better than most jazz
 
does anybody have edit privileges on programmers.SE? I spotted a typo in the first sentence of Martijn's top4 post but I'm not even registered
 
user559633
The minor grammar typo?
 
(and I don't want to bother the man with something this minor)
lets -> let's
 
user559633
I'd say leave it. If it came through the queue, I'd probably reject.. Oh, edit privileges. Slow to read this morning.
 
3:15 PM
I know, me too:)
but yeah, it's not important at all
 
user559633
Sorry for misreading you.
 
I just googled dispatch dicts and found that post
@tristan you didn't mislead me at all
 
user559633
;)
 
user559633
interesting: running python procs via uwsgi always results in N+1 processes to what you set in the vassal confs
 
user559633
root@<<project>>:~# grep processes /etc/<<project>>/uwsgi_python3/vassals/<<project>>_api.ini
processes = 10
root@<<project>>:~# ps ax | grep uwsgi | awk '{ print $NF }' | sort | uniq  -c
     11 <<project>>_api.ini
      5 <<project>>.ini
      2 /etc/<<project>>/uwsgi_python3/emperor.ini
      1 uwsgi`
 
3:22 PM
@AndrasDeak He does a few of those, due to the way 's works in Dutch.
 
ah, I had no idea
I always just assume that Dutch are flawless in both German and English:)
seems to be a plausible working hypothesis
 
Contradictory evidence is rarely found :)
 
What JRS said. :)
Anyway, here's my latest Python 3.6 hexdump.
printable = range(0x20, 0x7f)
asclist = [f"{u:c}" if u in printable else "." for u in range(256)]
hexlist = [f"{u:02x}" for u in range(256)]

def hexdump(data):
    width = 16
    ww = 3 * width - 1
    chunks = (data[i:i+width] for i in range(0, len(data), width))
    for count, row in enumerate(chunks):
        hexstr = ' '.join([hexlist[u] for u in row]).ljust(ww)
        ascstr = ''.join([asclist[u] for u in row])
        print(f"{count * width:08x}  {hexstr[:24]} {hexstr[24:]}  |{ascstr}|")
@tristan Odd. Maybe it creates a spare process, just in case... :)
 
if computational power drops, it eliminates that single process to serve as an example to the rest
 
user559633
What's weird is that it doesn't follow that logic for the emperor:
 
user559633
3:36 PM
root@barcopolo:/etc/barcopolo/uwsgi_python3/vassals# grep 'processes' /etc/barcopolo/uwsgi_python3/emperor.ini
processes = 20
root@barcopolo:/etc/barcopolo/uwsgi_python3/vassals# ps ax | grep uwsgi | awk '{ print $NF }' | sort | uniq  -c
      5 barcopolo_api.ini
      5 barcopolo.ini
      2 /etc/barcopolo/uwsgi_python3/emperor.ini
      1 uwsgi
 
user559633
I like it when intellectual curiosity uncovers a configuration issue. I had master set when using emperor, and apparently that's generally a no-no
 
stackoverflow.com/q/37228393/2301450 no MCVE, attracting bad answers
 
@tristan I know nothing about uwsgi (or wsgi for that matter), but I guess having that extra process speeds up respawning a dead vassal.
 
user559633
What's strange is that it goes with a single instance for the "emperor" (managing process)
 
user559633
filed under "go source diving after launch"
 
3:52 PM
Someone doesn't like the way SO works, but they seem to like the info they get here. And if SO is so negative how come they're still active after 5 years?
... and frankly I have witnessed only very little of the positive interactions that you describe ... from my point of view, Stack Overflow is the most negative computer-user forum that I have ever used ... it seems that having given users so much control has resulted in negativity rising to the top .. — dsdsdsdsd 3 hours ago
 
user559633
Because pissing and moaning is cheap; changing things or getting things done is hard.
 
user559633
God this place is terrible I hate them all but need their unpaid help EASIER_THAN I will purposefully help others and go out of my way to create positive interactions or make my own community/site
 
user559633
It's actually my least favorite part of what the internet has started to encourage -- make it easy for anyone to have a voice and they'll use that privilege to complain instead of create
 
user559633
Also, I knew before even snooping that the user making that comment would have far more questions and answers contributed.
 
@tristan I had a strong feeling that'd be the case too.
 
First he says that "Once a question has been marked as a duplicate, there is apparently no recourse for the OP". And when I point out that there is actually several avenues of recourse, he basically replies "yeah, but whinging that my question was closed doesn't automatically open it, therefore SO sucks".
@tristan I might have to listen to that one during daylight hours. I need something a bit smoother at this time of the morning.
 
user559633
You should -- I love LCD Soundsystem
 
guys
who here has some web dev work done?
do we have to learn html and css?
it's. so. boring.
 
4:41 PM
@qaispak Yes, you do.
 
:'(
 
user559633
5:14 PM
"do you have to learn html or css to work in a field in which all your clients expect html and css?" probably.
 
Surprisingly, there doesn't appear to be an SO question about how to create a subclass instance when the parent joined table instance already exists. But I'm probably using all the wrong terms there.
 
DSM
For some reason I'm suddenly interested in the equivalent of America's long-haul trucking culture, but in France.
That's probably a sign it's time to go to the gym, before my brain gets increasingly more random.
 
Good idea. I need to go for a run before it gets sunny out today. Or starts raining. Stupid SD weather.
 
DSM
Eastbound and down rhubarb for all!
 
rbrb
 
user559633
5:27 PM
I wouldn't think that France is large enough to really have "long-haul" trucking.
 
user559633
feature request for jetbrains: change IDE colors/appearance as the day goes on.
 
@davidism One day I'll log into the site! I believe in you!
 
 
1 hour later…
6:34 PM
woooo, wife's just made another 3 kg of strawberry jam!
I helped too, so I feel useful:P
 
That's a lot of jam.
 
not nearly;)
 
@davidism I think last time I got around it (until a fix was done - which I see you have) - was to just manually delete the offending record :p
 
last year she made 10 kg of peach and 1-2 kgs of raspberry, blackberry and pear, each:P
 
In unrelated news, I just discovered this, it looks awesome, Morgan will have to wait to log in.
 
6:38 PM
:D
 
And Uncharted 4 gets here tonight.
 
7:27 PM
@PM2Ring I am not allowed to use those functions
 
7:40 PM
Hi, in flask, does anyone know why not reusing sqlite connections between requests?
At least the documentation tutorial doesnt. It open/close a connection for each request. I wondered why.
 
8:14 PM
cbg
 
Hmm... We've been thinking about using an RPi with 2 HDDs in RAID as a NAS. Has any of you done something like this? Any encouraging/discouraging remarks?
@AnttiHaapala cabbage
 
@AndrasDeak lol
even rpi3 is slooow
everything in rpi is usb...
the ethernet is usb
 
slow how?
I'm planning to wifi it anyway
 
user559633
as in computationally. shared bus for everything
 
of course the wifi is usb as well
 
user559633
8:16 PM
"slow"
 
user559633
did intel ever release their $80 x86 micropc thing?
 
so that you'd not saturate the disk bandwith with that
or happy if you saturate the wifi even...
 
hmm
 
user559633
the rasppi is cool because the GPIO and its price.
 
8:17 PM
how much are 2 hard disks
 
and are there any straightforward solutions that don't involve me buying a pc just for this?
 
user559633
wait, you want to drive 2x HDD with a rasppi in a nas?
 
if you've got non-shitty disks then you could buy a corpse for the box, it'd perform better
that's how i read it
 
disclaimer: I have zero experience in any of the related subjects, and this was just a first guess
 
so you'd need separate power for both 2 harddisks
 
user559633
8:18 PM
i mean, you could go to war against russia in the winter with a sharpened shovel, but i wouldn't
 
which is also why I'm asking about this now
 
so you'd have 3 power connectors :D
and a jungle of cables
 
user559633
well, plus side is you'd also end up with a drink in your hand at several points
 
@AnttiHaapala corpse as in PC salvaged from the dump?
 
user559633
8:19 PM
what are you trying to accomplish?
 
@AndrasDeak exactly
 
lol:D
 
rpi is really nice tho
but not for IO bandwith limited stuff really...
 
user559633
are dells under $100 yet?
 
just a minimally failure-resistant nas for photos and shit
 
8:20 PM
and the rpi3...
MINIMALLY?
raspi3 needs a 2.5 amp usb source,
 
"minimally", I'm unfamiliar with minimality:D
 
otherwise it will be really minimally
 
user559633
what are you trying to spend on this? what parts do you already have? if you were dreaming of a rasppi for the HDDs, you'll also need to add in usb enclosures
 
like it'd crash every 2 minutes.
 
@tristan yeah that's the thing, not too much. I'll try to come up with a numeric value, just a sec
@AnttiHaapala ah
 
8:21 PM
... powered enclosures... :D
I played with rpi3 on tuesday
 
user559633
you might get stable, but there's probably a better tool for the job
 
it really crashes a lot if you do not buy the official usb psu
usb enclosures are something like 30 € apiece
because you need external power
 
~180 USD
 
rpi 35 €
 
user559633
sure, and if you fill a car's fueltank with cheap vodka, it will crash too
 
8:22 PM
so we're at 100 €
 
user559633
does space matter? power consumption?
 
for that price you could get any 5 year old desktop and it'd perform better.
 
user559633
exactly to the point of my questioning
 
you could actually use it for something :d
 
space yes, I'd prefer it to take up little space, power is less of an issue
I never seriously thought about getting a dedicated PC for it:)
 
8:23 PM
180 usd includes disks?
 
user559633
get some reasonably recent intel i3 tower then. decently power thrifty and will power the disks for you
 
@AnttiHaapala yes, preferably:D
 
we're cheap
 
user559633
eh, depends on the country
 
8:24 PM
I guess, saving from the wrong place
 
user559633
why two disks and calling it a NAS? and RAID?
 
1 rpi3 35 €, psu 8 €, 2 usb powered enclosures 30 € apiece
 
user559633
problem statement: i want to store some photos and videos external to my laptop?
 
well that's well over $100
now 2 hdd $40 apiece...
 
~70 USD for a 1TB disk here (the first one I found, anyway), so my first guess might have been a bit too low
 
8:25 PM
in that price range you can get only used ones here.
I bought 2 4tb disks for myself...
they were something like $120 apiece...
 
user559633
this conversation is weirdly stressful
 
@tristan I assume because
7 mins ago, by Andras Deak
disclaimer: I have zero experience in any of the related subjects, and this was just a first guess
 
user559633
@AndrasDeak i'd say figure out what you actually want
 
user559633
how many gigglebytes, what do you actually need/want, etc
 
8:26 PM
cabbage all
 
user559633
cbg JGreenwell
 
@tristan garlic ;)
 
user559633
Haha, yeah, basically.
 
So thing is, I have an external hdd. A previous one has already croaked, so I'm worried about storing photos and theses and whatnot in a single external place. For my limited comprehension it seemed straightforward to have a system with at least 2 disks that store my shit, with the possibility to fix one if the other dies
I've heard of funny things like nas and raid and I like to use funny words when I hear them:P
 
I like setting up old PCs for distributed systems, NAS, and stuff - rather then throwing them in the junk heap
 
8:28 PM
but OK, I get the point, I'll look around first:)
 
also as fish tanks
 
I didn't realize that my original plan was this bad, so I didn't expect to cause this much trouble.
thanks for the input so far:)
 
and once for a hamster
 
user559633
Two disks connected to the same OS and power source does not a backup plan make
 
hmm
Yeah, I guess. My primary (read: only) concern was spontaneous disk failure.
 
user559633
8:30 PM
That's like buying two dozen eggs instead of a dozen in case you drop your shopping bag
 
OK, OK, I think we've already ascertained that I'm stupid:P
 
user559633
That's not my point
 
I know, it's a corollary:D
 
user559633
Anyway. Figure out how many gigglebytes you need and build a cheap PC tower or just get a couple external HDDs.
 
(512/1024 tops, that's one of the things I'm sure about)
 
user559633
 
nice:)
 
lol :d
 
user559633
you could also get some 512gigglebyte external harddrive, then back it up to amazon glacier or something
 
cheapo
how slow is that?
amazon glacier is not very much a backup plan :D
 
user559633
@AnttiHaapala sure it is -- cheap, they deal with the crappiness of hdd failures, and you really only pay on retrieval
 
8:35 PM
it is like peeing your pants
 
user559633
excited for this analogy to work
 
@tristan old finnish saying...
 
user559633
that usb stick is relatively slow, but more than fast enough to stream HD videos, and the other one i have (32 gigglebyte) is more than fast enough for the data processing i'm doing (stage on /tmp and wash out to it)
 
damnit that gigglebyte...
“Once is happenstance; twice is coincidence; the third time it’s enemy action”
 
user559633
Sorry, I meant GiggleByte. Always forget to capitalize.
 

« first day (2037 days earlier)      last day (2905 days later) »