« first day (2300 days earlier)      last day (2873 days later) » 

00:17
@Mario, I will try to implement :)
where did you learn about this stuff ^^
and what are you currently running ?
internet mostly
but internet doesnt tell you much, so its more figuring out on my own i guess...
currently trying some densely connected convolutional networks
i am trying to change the color of all cars in an image to pink, without loosing the appearance of it beeing a car
collecting training samples was hard :D
heh that's a fun challenge
yea I had my issues with that too....
in the end we went with some academic car dataset
as insurance company... but only for the innovation, never for production
retrained the last layers of inception v3 :)
refining pre trained models is actually a pretty good idea
less prone to overfitting, learns faster, needs less samples to converge...
yea, it's great
I noticed keras put out inception v4 pretrained, a few days ago i think
but I'm not sure if it can do the more "generative" thing
my best model is a generative LSTM on 300k tweets custom dataset
narrowed down to a particular topic
chatbot?
00:28
something like that
i didnt make it have multiple turns though
purely trained on tweets where someone said something, and someone answered, but there was no prior history
ok, so it can generate meaningful messages, but talks random stuff in context
indeed, as is usual for these bots lol
which is how most people talk anyway lol
you're not even guaranteed that it has perfect context between Q and A
haha
01:15
@MarioDekena If everyone in the country drove pink cars, we'd be a pink carnation. :)
Coincidentally, yesterday I walked past a car parts place that had an old car out the front that was completely painted pink. I mean everything was painted including the chrome and the glass.
wow. i cant remember the last time i saw a pink car. I dont even know if i have ever seen a pink car at all.
including the glass???
01:22
Yes!
Not many guys would buy a pink car for themself...
but one for the lovely lady...
01:42
I missed the harmonic mean stuff earlier; I first encountered them in electronics, where they're used to calculate parallel resistance and serial capacitance. As for the average speed thing, one of our high school maths teachers asked: If I drive the 1st mile at 30 MPH, how fast do I have to go on the 2nd mile to average 60 MPH?
01:52
yeah, parallel resistance is still the primary use for it, I think
although that's not exactly the mean, it's just a reciprocal sum
True, but it's close. :)
right:)
02:31
A quadratic version of the harmonic sum arises in Descartes' Theorem. The real version is nice in its own right, but the complex version is wonderful. :)
 
1 hour later…
03:48
@PM2Ring Won't be obvious at first why I am linking this one too, buuuuut... projecteuler.net/problem=444
DSM
DSM
I need to do some refactoring of a bunch of Python code, and I'd like to automate it. Does anyone have a preferred toolkit for ast manipulations?
@DSM the one I can think of is rope, although I don't know how to use it.
DSM
DSM
@davidism: heh. I thought that name sounded familiar. I may give it a harder try this time, though, the edit I need looks a lot like one of their examples..
It's used by some Sublime packages for extended Python support.
@DSM oh, another one, used for some Flask 0.11 migrations: redbaron.
And it's by PyCQA, who maintain a lot of the other code quality tools.
DSM
DSM
Thanks, I'll have a look at that too.
04:07
Wouldn't any refactor tool require an extended knowledge of python? At least the way python tokenizes the code, possibly being able to run the code. But even that won't catch things like getattr()?
Nov 16 '15 at 14:07, by PM 2Ring
Here's an Apollonian gasket produced by a GTK2 program I wrote a few years ago:
PyCharm's refactoring actually does catch string usages in many cases. But you usually do dynamic stuff with the understanding that it's not refactor-friendly.
I'm not sure how rope and redbaron handle them.
nice gasket -- pretty
Guess that refactoring will never be a fire and forget thing. Actually most of my hard to track bugs came from refactoring names in pycharm and not checking everything thoroughly.
I've never had an issue with it, but I don't refactor a lot. Write more straightforward code. ;-)
04:18
Well it's planning + inexperience :P. Often occurs in cases where I add extra layers of indirection in the progress of creating readable code.
Or unwinding a monolith class, and running out of synonyms.
DSM
DSM
04:29
@davidism: thanks a lot! I did some hackery to work around some stuff I'm too lazy to figure out how to do correctly, but I now have the transformation
378 pd.rolling_mean(d.dropna(), 4, min_periods=4)
(d.dropna()).rolling(window=4, min_periods=4, center=False).mean()
automated, which was the goal!
Nice, what did you end up using?
DSM
DSM
RedBaron. There was an example in the Rope docs which was very similar to what I needed to do, but last time I tried to customize something with Rope I got very confused. The RedBaron structure was easy to experiment with at the console, which is a big plus in my books.
What's the standard exception to raise if an object "isn't loaded/initialized". (Class has a 2-tier initialization to remove expensive filereading from the construction).
LookupError?
04:59
Hey @DSM I guess I'm a bit late, but this could make a good interview question: shuffle the letters in a word, preserving the order of the consonants chat.stackoverflow.com/transcript/6?m=35347599#35347599
DSM
DSM
That's actually not too bad an idea. I like questions which have brute force solutions as well as more elegant ones.
Hi all
@DSM I'm a little embarrassed that I spent so much time on the long solution before the short solution occurred to me. But I guess that's fairly normal: once you latch onto a solution it can be hard to see alternatives.
r'''some string here'''
I came across a syntax for multi-line strings..
Greetings, Aseem
05:13
Does using this "r" infront of the quotes serve a different purpose ?
@PM2Ring hey, nice to meet you
@AseemYadav Well, a string that starts with r is a raw string. It works with single-quoted strings as well as with triple-quoted strings.
Raw strings are mentioned early in the tutorial.
Also see stackoverflow.com/questions/2081640/… and the questions linked from that page.
@PM2Ring gr8!!...thats pretty useful
No worries.
never knew there is a separate syntax available to handle raw strings
You should have read the tutorial. ;)
05:27
I googled the topic but, this wasn't available on first page
guess i shud have looked on page 2 as well... :)
"page of the dead"
 
1 hour later…
06:28
morning all
06:54
cbg
07:21
cbg
07:40
cbg
2017/01/31 23:00-ish

YP thinks that perhaps pg_basebackup is being super pedantic about there being an empty data directory, decides to remove the directory. After a second or two he notices he ran it on db1.cluster.gitlab.com, instead of db2.cluster.gitlab.com
2017/01/31 23:27 YP - terminates the removal, but it’s too late. Of around 310 GB only about 4.5 GB is left - Slack
sleepless nights at gitlab
cowboys anyone
Create issue to change terminal PS1 format/colours to make it clear whether you’re using production or staging (red production, yellow staging)
for 6 years I have had blinking red [LIVE!] in prompts on production servers
Yo cabbage!
Someone's asking I don't want python to hash my keys, I already hashed them myself, Can python take it and use it to grab value from dictionary instead of calculating again?
We accidentally deleted production data and might have to restore from backup. Google Doc with live notes https://docs.google.com/document/d/1GCK53YDcBWQveod9kfzW-VCxIABGiryG7_z_6jHdVik/pub
The idea is to save some steps.
@MYGz the object must return the __hash__;
so they might use a wrapper for it.
but not for any arbitrary type of object
08:16
cbg
#roftl
fortunately I've so far migrated only one organization to gitlab
@AndyK i have windows 7 64 bit..now can you tell what software i need for python
Hi @AdityaVyas-Lakhan you need python3
yes
but ...
if I were you
I would download this thing cmder.net
08:28
ok then how to start programming?
which editor?
and from there install the chocolate package chocolatey.org/install
once chocolate is installed, you can just type choco install python
and all packages from python would be installed
even pip
where to type choco install python
huh ok
maybe my approach is a bit too much
install the latest version of Python with the binaries python.org/downloads
i am beginner
and you should be good
for text editor
try sublime text or notepad
or pycharm
I heard pycharm often here
08:31
ok thanks bro
maybe @AnttiHaapalacan share some lights. From what I recall, you are using it, if I'm correct
Cbg :)
08:56
I use pycharm... I've got no complaints
well, I have complaints... but not about pycharm
lol
09:11
Antti Haapala has some complaints about pycharm, but Antti Haapala has some complaints about everything. :)
mornin' cabbage all
Cabbage
@PM2Ring *Rantti Haapala
09:30
@MYGz I did consider dupe-hammering with that target, but I don't think it's a great target for this question, although it does have some relevant info, so it's good to have it linked via your comment.
I do have complaints about pycharm, lots of them
it is supposed to be an IDE but it isn't really tuned for applications.
it "is" but then it isn't
pycharm considers python projects just a bag of loose files...
I am still using pycharm, it is the best there is, but it ain't any good.
it is not as good as Eclipse is with Java - yet so many people seem to bash Eclipse, and its Java tooling, swearing instead in the name of Jetbrains + IDEA...
it would need a major revamp and instead it looks as if it is in "maintenance mode" mostly
@AdityaVyas-Lakhan sublime or notepad++ would be great to start. I'm using both of them on different env
@BhargavRao can I laugh...? :))))
@AndyK it was PM who first named Antti that :D Nopes
lolol
Oct 2 '16 at 16:18, by Antti Haapala
or perhaps I'd change my name to Rantti Happala
09:44
@PM2Ring The wordings were different, but the target had all the information OP was asking. Was it better to just put a link instead of voting for dupe?
@PM2Ring @BhargavRao perhaps gitlab should have hired me :D
I hope nobody saw what blunder I just did
:D
stackoverflow.com/questions/41976232/… Thinks it's good idea to learn Python on SO rather than reading tutorials. :D
@AnttiHaapala yep
@MYGz Oh, it's fine to suggest it as a dupe target, and it has been used to close similar questions before. And just by having that comment in there the two questions now mention each other in their Linked sidebar lists. But I'm not totally happy with the answers in that target, so I'd prefer to dupe-close it with a better target, if one exists.
But there's no rush to close it, since there are only 2 answers, and they're both ok. But if a bunch of crappy answers appear, then we will need to close it.
10:24
wat wat wat? Why can't I see the rendered preview display below the editor?
cbg
is it possible ti scrape google right side
@MYGz I assume you're talking about the editor that's used to edit a question or an answer. Maybe you accidentally activated the mobile mode, which doesn't give you a preview.
@PM2Ring Yeah. But can I activate mobile mode on Desktop?
I'm logged in on my phone let me try to logout and refresh.
@MYGz Certainly.
How do I turn it off? Logged out from phone, no change.
10:31
There's a menu item at the bottom of every page, just before contact us feedback. It will either say mobile or full site
Bah. Silly silly silly. There was show preview button :D
Ah, ok. I rarely try to edit stuff on my phone, so I'm not too familiar with that page.
Yeah I found that at the bottom. But I might have clicked on hide preview previously.
10:51
Yahoo answers still quench my curiosities sometimes.
Cabbage!
cabbage
cabbage
11:01
-o
GitHub topics are pretty nice. Now all I need is a way to categorize my repositories…
-o is like diving head first after signal from Andy and Bhargav :D
nopx it means
i use .replace
think in python
@MYGz #lmao
11:18
cbg
11:28
Hi Antti. What exactly did GitLab trash? I gather it was something large and important, but I'm not clear on the details.
@PM2Ring they had at least a dozen utter failures, each of which would get shouting from me :D
and thus a shitty culture because everyone just keeps trudging forward in shit and not doing the simplest of fixes to avoid total disasters.
11:48
So YP trashed their complete database of every project held on GitLab? Whoa. But if I read that correctly they do have backups, so they've really only lost 6 hours or so worth of updates. Is that correct?
Who is YP?
they had 5 set of backups
none of which work
they're restoring it from the thing that specifically is not a backup :D
lol
A neural network could consist of following layers: input -> 3 x 3 -> output
But what is the different from that and: input ->2 x 2 x 2 -> output
It consists of 6 both places
12:00
Oh, YP dev. I see
@PM2Ring basically how I read it is that they were contemplating about the best place to commit seppuku, when one of them notices that "you know we might be able to somehow restore the data from here..."
@SebastianNielsen first one can make use of more 'features' per layer, while the latter can do more consecutive interactions.
@MarioDekena What do you mean with more consecutive interactions.
What is the pros and cons of the second one: 2x2x2
which of the 2 terminals is connected to the live production server?
@SebastianNielsen In order for data from different nodes to interact which each other, they have to connect to a single node on the next layer. More layers means more of those interactions can occur. This is especially important if the expected output is dependant on all input variables.
Maybe I just don't understand this question... stackoverflow.com/questions/41979025/…
how the hell did amazon figure out that my car needs new oil?!?!
I don't see how several hidden layers every would be beneficial.
Take a look
Do you have a scenario in mind in which it would be better to have more hidden layers of fewer neurons?
take image classification
you use multiple layers to boil down the features of the image until you reach for example a layer with 1024 nodes.
that is the 'essence' of the information in the image.
After that a fully connected takes the 1024 values and build a classification from that.
ahh, I see
12:22
if you boil down too quickly, with not enoug layers, you dont allow the network to make enoug interactions between the various feature stages, thus loosing context information.
But how do I figure out the correct number of neurons and layers
critical thinking and trial and error
12:52
@PM2Ring Somewhat odd question…
So it's not just me then. :)
BTW, I agree that "Shebangs should be #!/usr/bin/env python3.6 for maximum compatibility". I only suggested the non-standard shebang as a possible solution to his weird question.
Yesterday, someone on SE.mathematics asked Is it possible to have a spherical object with only hexagonal faces?. Of course it's impossible, unless you bend the rules a little...
Speaking of stereographic projections, here's a mapping of a hexagonal net onto the Riemann sphere, rendered using POV-Ray: RiemannHexPM 2Ring 7 mins ago
of course its possible
make the faces infinitesimally small
it doesnt even matter that you put the edges together or not. If you dont, you introduce holes, but you can later fill these with more infinitesimally small hexagons until you dont have any holes anymore. It only takes an infinite amount of hexagons to do that.
13:21
Looks like someone beat me to "yes, using exactly six vertices and two faces"
Draw six points equidistantly around the equator. Job's done!
Sure, using coplanar vertices is cheating, but the question is: is it more cheating than using infinity hexagons, or less cheating?
i dont see how a finite amount of vertices could create a perfect sphere
Perhaps they meant to ask "Is it possible to form a solid whose faces are all hexagons and whose vertices inscribe a sphere?"
oh yeah. then your solution would work. its hardly a sphere tho
My solution works depending on whether a flat surface counts as a "solid"
at least its closed :D
or is it?
difficult to tell actually
13:28
I don't know precisely what that term means so I can't help you there
@PM2Ring alas, that will change the behaviour of command if user has activated a Python 3.6 virtualenv
searching for "closed solid" only gets me articles about stuck doors and OOP principles
lol
its closed if it doesnt have any holes. for that you would have to define inside and outside
@AnttiHaapala But if the user has access to a Python 3.6 virtualenv then they wouldn't have this weird problem in the first place, would they?
you said: "for maximum compatibility". Alas, there is no such thing here :D
one has 2 choices: use the system python path everywhere and it works (on that computer)
13:32
My flatahedron doesn't have any interior points unless points resting directly on the face count
or ... use env and it will break if one happens to modify path
@Kevin yep. it intersects iteself everywhere
i dont think its a solid because int not orientable
like the klein bottle
its a 3d surface but since you cant define inside and outise, it cant be a solid
13:58
morning everyone
morning
ok I'll take it as evening. Morning to you.
morning cabbage
Could someone please respond to this comment, I've got to go:
Ok, thanks. So would it be ok to add sys.path.insert(0, '$HOME/git/myproject/') at the top of main.py (and any other files I am executing? Would it be possible to add it in a more general way that didn't limit it to being in the home directory? Is $HOME a robust way of specifying the home directory? It seems to work fine. — Tom 3 mins ago
@WayneWerner Beautiful
14:18
\o cbg
anyone here use vanguard at all?
vanguard the card game or another vanguard?
how do I properly unquote characters from URL? Tried this:
>>> urllib.parse.unquote('%E0%E0%E0%E0%EF%EF%EF%EF')
'��������'
>>> urllib.parse.unquote('%E0%E0%E0%E0%EF%EF%EF%EF', 'utf-8')
'��������'
actually, I have a form, and python script in cgi-bin
vanguard for investments?
14:26
@MaxLunar that is not correct UTF-8
your form is posting latin1 or some other crap instead of UTF-8
when i input cyrillic chars, they're screwed up at output
investments and stuff
... which is caused by your webserver not specifying charset
In [37]: '\xe0'
Out[37]: 'à'

In [38]: '\xef'
Out[38]: 'ï'
@MaxLunar Content-Type: text:html; charset=utf-8
14:27
In [39]: urllib.parse.unquote('%E0%E0%E0%E0%EF%EF%EF%EF', 'latin-1')
Out[39]: 'ààààïïïï'
I should get 'аааапппп'
@MaxLunar koi-8r?
hm lets try
aaaaa? that doesn't seem right at all
not even
>>> urllib.parse.unquote('%E0%E0%E0%E0%EF%EF%EF%EF', 'koi8-r')
'ЮЮЮЮОООО'
@MaxLunar in any case. the correct thing to do is to use charset and that charset is utf-8
everything else is just plain wrong.
14:28
+1
so, koi8-r doesn't seem to be correct either :D
@MaxLunar you got the answer back in cp1251
which is this windows crap...
>>> urllib.parse.unquote('%E0%E0%E0%E0%EF%EF%EF%EF', 'cp1251')
Discussion: Does the Python language specification allow two boolean objects x and y which are equal (x == y) but do not have the same id (x is y)?
@poke no
In other words: Are True and False being singletons backed by the spec?
boolean is not subclassable
>>> class foo(bool): pass
...
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: type 'bool' is not an acceptable base type
14:33
Not talking about CPython btw., just any valid Python implementation
CPython is the reference implementation
21
Q: Why I can't extend bool in Python?

Juanjo Conti>>> class BOOL(bool): ... print "why?" ... why? Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: Error when calling the metaclass bases type 'bool' is not an acceptable base type I thought Python trusted the programmer.

@poke ^ word of god
But it being a reference implementation does not make it the standard behavior other implementations have to implement
Why is this a fail answer to get the counts of 0 and False?
Otherwise, id() returning the memory address would not just be an implementation detail of CPython, but also the required behavior for any Python implementation.
@poke I just linked, where guido says true and false is singleton and bool should not be subclassable.
14:35
0 is served from cache so is boolean object False. So "is" should work. shouldn't it?
@MYGz I’m not sure what you are asking.
Do you think it should behave differently?
Cabbage! I am working on a project and I have a quick question. I have a dataset which I want to store in a Data structure. If I go with 2D array, the size will be approx. 4000x2000 and it is sparse. So, what data structure is generally recommended by python programmers for such cases?
maxlunar.insomnia247.nl here is that forms, and form.py pastebin.com/JKJdGCng . Enter this 'ппппп' into any form and submit. You'll see effect - nothing is helped me. I'm screwed something up?
@Grimlock depending on what you are going to do with that dataset
Is dictionary the best option available or there something better than that?
14:44
Good to know things are consistent: class Foo(None.__class__): ... -> TypeError: type 'NoneType' is not an acceptable base typeWayne Werner 41 secs ago
@Grimlock How do you need to access the data? Is it important that there’s a 2-dimensional structure, so that you need to think in dimensions, or can this just be a point-based lookup?
@MooingRawr All I want to do is extract value of a cell at any given index. But I want most optimal solution as the dataset is huge.
The dataset is, (user x hotel) ratings. So, rows will be users and columns will be hotels. Now, many of the entries will be "0", so dictionary should perform better?
So it’s just a 2d index? And you only want to do single-point lookups?
@MaxLunar It looks like it's the FieldStorage bit reading it as text instead of bytes
Well, since you likely want to query all ratings for a hotel, or all ratings from a certain user, a compound key does not really make much sense.
Why don’t you use a relational database for this?
14:48
@poke Sorry, can you explain what do you mean by single point lookup?
a point would be (user X, hotel Y), so you only want to lookup with that point, never using individual dimensions.
@poke Then no, I might need to search for all points in which the entries are available (not 0) for User X.
so do what Poke said, try a database instead
Then you want to have two indexes for these things. I.e. two (or even three!) individual lookups (e.g. dictionaries)
@poke Ok. Rephrase: Since arr.count(0) and arr.count(False) will both return 5, is that the right method to calculate number of 0 and number of False in arr?
14:52
lookup_by_user[Y], lookup_by_hotel[X], lookup[(X, Y)]
This can be efficiently done by databases; that’s what they are for.
Not allowed to use database in this project. Sorry for not declaring beforehand.
(technically, a dictionary is “a database”)
@poke Oh you meant it that way, I though you are suggesting something like MySQL/Oracle. Then, Dictionary it is! :)
@MYGz Well, it doesn’t work, so the answer would be no? You need to search based on object identity here :/
@poke Can you explain what this code snippet does?
14:54
@Grimlock No, I absolutely meant a dedicated database, I’m just saying that a requirement “no database” is a terrible thing when a database is technically just a store of data… :P
lookup_by_user[Y], lookup_by_hotel[X], lookup[(X, Y)]
Not meant to be a code snippet, but more three dictionaries that offer your individual lookups
@poke Hehe yeah. I can agree to that.
So, I just have to create one dictionary and perform all operations on it, what is the role of these 3 dicts you mentioned?
from collections import defaultdict

ratings_by_hotel = defaultdict(set)
ratings_by_user = defaultdict(set)
ratings = {}

def addRating(rating):
    ratings[(rating.hotel, rating.user)] = rating
    ratings_by_hotel[rating.hotel].add(rating)
    ratings_by_user[rating.user].add(rating)
Now I can query ratings by the hotel, the user, or both
True German efficiency
14:58
That’s more or less how database indexes work… although a lot more efficient :P
@poke But it's returning the correct count. Can it fail for some other case?
Nice implementation, this was very insightful. Thank you very much.

« first day (2300 days earlier)      last day (2873 days later) »