« first day (2526 days earlier)      last day (2426 days later) » 
00:00 - 17:0017:00 - 23:00

5:09 PM
I was going to make an image depicting Andras as a green rectangle with a Garfield-esque cartoon face, maybe holding a cup of coffee and saying "working hard or hardly working?", as a humorous juxtaposition to the fearsome musclebird knight already shown.
 
@Rawing that might or might not be an accurate representation of my meatspace form
 
I wanted to tilt the avatar's square into a trapezoid, y'know to get the proper vanishing point, but paint.net's built in "rotate" function can only do orthographic transformations in three dimensions, so it would be a mere parallelogram. Google suggested that a perspective plugin existed, but seconds before clicking on the executable I noticed it was being downloaded from "paint dot net dot com dot amIHotOrNot dot com dot au"
So there's a pretty good chance that's not an official paint dot net repository.
 
wow
maybe that's normal Down Under
 
Their official forums say "All reputable Paint.NET plugins are released via this forum. Either get them from here, or from links posted here. DO NOT TRUST PLUGINS FROM ANYWHERE ELSE." So I'm raising that chance to 100%
I banish thee, link that turned out to be malware, to the land of wind and spirits
 
DSM
(nods in satisfaction) The air spirits will take care of that link proper quick.
 
5:26 PM
I found a satisfactory trapezoiderizer. Now to figure out how to draw one circle on top of another circle.
 
@Kevin who'd've thunk
Should we flag that message for a mod to sanitize?
or are the knives an adults-only room?
 
user image
6
Before you say anything, yes I still have commission slots open.
 
5:42 PM
@Kevin Another click bait showed a triangle with several horizontal dividing lines, and some additional lines from the top vertex to the base, asking "how many triangles in the diagram?" My answer was: None, this is actually drawn in perspective with a distant vanishing point, all the vertical-ish lines are really parallel, and the shapes are all rectangles.
 
worth every trojan installed on your system
 
If the trapezoid plugin is a trojan, at least they went to the effort of making it work properly
Good production values, would infect self again. A++
 
in today's market you need to get your act together if you want a sustainable infection
 
Was GIMP too hard to use?
 
gimp on windows?
 
5:44 PM
If it's installed on my computer, I couldn't find it.
I have installed gimp on at least three computers but I guess this wasn't one of them
 
Yes, [The]Gimp runs on Windows
 
I remember the days when gnu meant something!
 
Whatever it is, it ain't unix
 
@AndrasDeak Hmm, if I knew I wouldn't get in trouble for posting it unwittingly...
 
You most certainly won't, I only meant as a safety measure.
we can wait until a friendly neighbourhood mod shows up and ask him
 
5:50 PM
GNU software runs on windows because they believe offering windows users a "taste of freedom" could entice them to use more free software
Heck, even Stallman said steam coming to linux was a good thing even though it's proprietary
 
emancipate, entice, end user license agreement damn, I forgot what I was going for
 
DSM
@PaulMcG: heh
 
developers, developers, developers, developers, uh, maybe that wasn't it
 
awwwww, dmesg tells me that my python segfaulted
[686542.929247] python[16916]: segfault at 7fcf647f1ff0 ip 00007fcfe18429ae sp 00007ffe3ddf9328 error 7 in QtCore.x86_64-linux-gnu.so[7fcfe17b8000+22f000]
now I feel all fuzzy and warm inside
 
Every time you seg fault, imagine that I posted the paperclip image again.
 
5:53 PM
lemme find that again
ah, yes
good old VoiChEntrateException
I'm not terribly concerned about the segfault, because I'm using mayavi using vtk using opengl among other things so there's plenty of room for stuff dying in C
 
Ah, that's OK then. third party libs can segfault. It's when your program segfaults on a print() call that you need to worry.
 
yeah, I'll swap my coffee for schnapps when that happens
I'm also starting to recall that I only built vtk with python 3 bindings, so whatever I have installed for python 2 might be borked
 
6:16 PM
hello i'm making my first python lib with python modules, what do you suggest pypy or Cpy ?
eventhough i dont know how to pip with pypy
 
Stick with cpython if it's your first time.
 
no further explanations ? about why this choice balanced over this other ?
 
cpython is the reference implementation
 
The only reason to use pypy is for performance. And that's an optimization. And you shouldn't optimize until you're ready to.
 
or if you like to write py more than usual and once is not enough
 
6:26 PM
ok
 
The best reason to not use pypy is that you don't know how to use pip with pypy, and presumably you do know how to use pip with CPython. Use the tools you're most comfortable with.
All other things being equal, writing code now is better than writing code ten hours from now when you've finally slogged through all the documentation you needed to get the more exotic alternative working
 
i didnt find it, even when i type python -m , nothing significant !
last question (not very python)
if i take some features from a licensed git
what should i do ? just credit ?
 
If you mean "from a project on github that has a license", then the license itself should tell you what you need to do.
 
6:45 PM
In a networkx digraph, does it matter what order you add edges in? Seems like order shouldn't matter, semantically... should it?
 
My uninformed opinion is that it shouldn't matter.
 
which makes me ask why the code I'm looking at uses a reverse sort before doing just that...
 
Wild guess: maybe every time you add an edge, it performs some intermediary processing steps, as an eager way of generally preparing for whatever queries you might ask of it. Maybe the processing is faster if you add the edges in a particular order.
 
removed the reverse, swapped the variables (so 0 comes before 1) and tests still pass!
 
Contrived example: counting the number of connected components in a graph every time you add an edge is fastest if the number always stays at 1. Compare to adding edges basically at random, and the component count balloons to a theoretical maximum of num_nodes/2 before falling back down to 1
 
6:53 PM
I'm cleaning up some code at work, which Im trying to understand - so I make it more "readable" while I do. Probably to my coworkers' annoyance.
If it stores the edges in a list... and digraph.edges() returns the list, I may have messed up the order...
to the source... sigh
 
you might want to look at timings in case that matters, assuming that both versions are semantically the same
 
I'm not sure they are semantically the same.
tests could be weak...
 
possible
if you assume that coworker is not a moron, it's likely that they went out of their way for an existing reason
whether or not it's a good reason is another matter
 
Although looking in the source it appears to be storing the edges in a dict.
 
Depending on the specific ordering of edges() makes me nervous
 
7:05 PM
no append, just assigning via lookups in what seems to be several dicts... in networkx/classes/digraph.py
 
semantically, a graph is defined by its adjacency matrix, which doesn't care at all about the order of insertions into it
assuming a spherical programmer in a vacuum, etc.
7
 
7:34 PM
Looks like networkx changed the API - edges are a method in the code I'm looking at, but a property in the source on github...
Does Python 3 let us call property decorated methods now?
no, they return an object that's apparently a callable from the property decorated method...
And that's a view...
 
# I have just see this in a SO answer.
>>> def main(): pass
...
>>> foo = main
>>> def main(): pass
...
>>> foo is main
False
>>> foo
<function main at 0x1004ca500>
>>> main
<function main at 0x1005778c0>
# Why they are different and not the same? That isn't a waste of memory?
 
because main is a new function
def main(): pass and another def main(): pass are two different function definitions
 
But they are the same, why python not use only one?
 
They aren't the same.
 
They have the same code, so they do the same.
 
7:47 PM
doing the same thing does not mean the same thing as being the same
you could have a twin
that has the same DNA
and looks like you
and talks like you
 
@WayneWerner I have a twin :)
 
he's even got a twin like you
but that doesn't mean you are literally the same person
that would just be weird
@EnderLook identical (i.e. same DNA) or fraternal?
 
But this isn't real life, this is a computer. Why not save space memory?
@WayneWerner I born 2 minutes before my brother!
 
how would you tell the computer that it's the same function?
 
Because they're not the same. How do we know that some code doesn't rely on them being different later on?
a = object()
b = object()
I can't think of any time I would want these to be the same.
 
7:50 PM
They could be the same at first, but in the moment you change one of them, the computer duplicate the object and modifiy one.
 
So are you just going to keep coming up with rebuttals, or are you going to trust what we say at some point?
I don't really feel like continuing if it's option A.
 
@davidism I trust you, but I want to know why python doesn't do my idea. Maybe could produce lag?
 
the processing power you'd waste on checking if you have to copy an object every time it's modified is worse than the memory used by the 2nd function
 
Because it doesn't benefit any real world code and would complicate the implementation.
Also, you could only know equivalence of trivial functions where the bytecode is the same. Function equivalence in general is unprovable.
 
I recall answering a question where a user found code where a noop function was used as a namespace (via dotted assignment and lookup of data stored in its __dict__).
Anyways, Python is smart enough to avoid wasting space (to an extent) if you are smart enough to dereference unneeded objects.
By keeping a reference to the old main with foo, you said you wanted it, and Python said, "ok."
 
8:00 PM
mmm, if I do:
while True:
     def a(): pass
That is creating an endless amount of new objects, no?
Would that one day (It would take some time...) full my ram?
 
There's only a reference to the most recent, so garbage collection would handle it.
 
In fact Python may be smart enough to immediately reuse the old object's space.
 
while True:
    create_new_a()
    throw_away_a()
    # will never fill your memory
 
You have right, I have that code worknig for a minute and python didn't increase its size even 1 KB.
 
DSM
In [2]: while True:
   ...:      def a(): pass
   ...:      print(id(a))
   ...:      input()
   ...:
140115886958656

140115886957704

140115886958656

140115886957704
 
8:02 PM
If it did reuse the address, it would reuse it because it was freed, not because the objects are "equivalent".
 
@davidism I know, I have read a little about garbage collection.
 
for i in range(3): print(id(lambda: i))
 
@DSM What means In [2]:?
 
^^ reuses the same space.
 
DSM
8:06 PM
^ it's just the prefix that ipython uses (to number inputs and outputs) instead of >>> like in the standard console.
 
And why you use IPython instead of the "traditional" python?
 
I think the space reuse is useful - e.g. setdefault in a tight loop.
 
@EnderLook did you even do a cursory glance at the page linked? It describes why you would choose it right there at the top.
 
@davidism Sorry, I'll read that
 
There's an even better list on the front page of the documentation: ipython.readthedocs.io/en/stable
Which is linked from the home page.
 
8:12 PM
That kind of special pythons like IPython, CPython (or cython?) and IronPython use the same libraries as normal python or they aren't compatible?
 
IPython is an interactive shell, CPython and IronPython are different interpreters for the Python language.
 
@davidism ups. CPython and IronPython are compatible with Python libaries?
 
Python-only libraries are usable across interpreters, assuming the interpreter implements all required modules. Libraries with extensions may not be.
 
wim
****!!!
so if you start sublime text from a terminal with a venv activated, the build runs with that python env too
this just screwed me around big time. handy to know though!
 
That's just the unix process environment model, nothing special about sublime in that regard
 
8:23 PM
That's odd. So you mean the editor itself, not the project you open?
Oh, you mean the "Build" command uses the venv. That's kinda nice.
 
DSM
raise RhubarbDeparture
 
recbg, I'm glad I wasn't here
also rbrb, DSM
 
so...no sudo pip + typos?
 
Not typos. Intentionally similarly named packages. (e.g. setup-tools versus setuptools)
 
8:34 PM
typos when installing I mean
 
Ah, one's a typo
In the except block of the malicious code:
  # Welcome Here! 🙂
   # just toy, no harm 🙂
Ah, I feel much better
 
yeah, benign malware is best malware
benware?
 
itsbeenware
 
8:54 PM
Opinions requested: say you have a library, module.py - what do you think about a main like this:
def main():
    from tests.unittests.module import main
    main()
 
?
 
where tests.unittests.module is where the unittests for the module are.
that way, you execute the module, you run the tests.
 
oh , main fetched from elsewhere ... sorry
 
assuming tests are in your python path.
On another matter, and also a request for opinions: say you run into code at work that passes around a DataFrame and always calls it the same variable name (even though in some cases it's None instead of the DataFrame) - do you put that DataFrame into a custom object of that type? Say the variable name is "manifest" - create a class Manifest: object?
and then do you either subclass DataFrame to make the class definition or delegate to a DataFrame?
 
looks odd to me. In the spirit of "there should be only one obvious way to do it", running the tests should be done by running the tests, not by running the module. If you want an easy way to run your tests, surely you can configure your IDE to run your tests at the press of a button, or keep a terminal open to run your tests from? But then again, who am I to judge a professional programmer?
 
9:02 PM
I shouldn't have the overhead of unit tests be present when using a module in prod. Heck, depending upon how it's packaged, I wouldn't even want the tests present in prod.
 
@Rawing I'm trying to iterate fast and I keep forgetting to save before restarting my interpreter and running the test file. Paths pretty much stay the same, so we have access to all our tests anyways. But Kevin's got a point - I think I'll leave it out just to avoid the extra function, even if it's not public API. Use __all__ in just about every module
Anyways, on the other matter, that Dataframe has a module named after it and has functions like union, equals, diff, and isSuperset ... shouldn't it be using the datamodel?
The dude who wrote this knows about the datamodel... is there some room for nuance that I'm missing?
 
9:49 PM
so...turns out pdb doesn't catch segfaults :(
OK, it's fine; import mayavi is killing my program :D
 
recbg
 
cbg
 
@AndrasDeak mind blown:
-3
Q: How do i loop this python code?

Ali GAs you can see that this following and unfollowing users on instagram which are famous, the question is how do i get it to loop. ###start the loop here driver.get("https://www.instagram.com/ladbible/") sleep(15) following2 = driver.find_element_by_xpath('//section/main/article/header/div/div/s...

 
do I want to see that?
 
is it true, guy's like how to do an infinite loop in python?
 
9:59 PM
:|
I like the 107k-rep suggestion of white True: [sic] :D
my man Ali G needs to read a tutorial or at least try to google the simplest of problems
 
Don't be ridiculous, python doesn't have loops. Haven't you seen an uroboros? It doesn't end well.
 
*ouroboros (sorry)
 
what did the google search for "repeat the same thing over and over again in python" give as results? — Antti Haapala 9 secs ago
@KevinMGranger should I tell him that:
funroll loops!
 
everyone knows you can't have more than 1000 iterations in python
 
bwaah can't find an answerable question
 
10:06 PM
try this
(I know, a rickroll would've been more humane)
 
wim
pfff, Martijn closed my meta feature request for a newer syntax highlighter as dupe of "what is syntax highlighting" roll eyes
 
perhaps he didn't realize that it's a FR?
probably not
if it makes you feel any better, we had been whining for years until they accepted a stripped-down highlighter for MATLAB, and a regular user had to augment google-prettify first
 
wim
you would think the top python answerer would want a highlighter that's not 2 years outdated for his favourite language ...
yeah i saw your whining on the meta se
I don't really get their argument there, doesn't the CDN cache those .js files fairly well?
even the browser should cache them
 
I have literally no idea
All I know is that they were first complaining that it's not their code, then they were complaining that the awesome highlighter that Amro wrote was "too large", and eventually they added a "lite" version which only does the most essentials. It mostly handles the most annoying thing with MATLAB: .' vs string highlighting
 
wim
10:26 PM
it's static content. afaik it should be handled the same way as stuff like their apple-touch-icon and all those sponsored tags
 
I think the library was much larger
found it!
comment 1 comment 2 by Oded: 50 kB minified whereas the other languages need only 1-4 kB
@Raphael - and the CDN. This is a file that is loaded for every page load, so yes. Being on the CDN doesn't mean there isn't a cost (both in download speed and $$$). — Oded ♦ Jan 11 at 9:35
 
is this an accurate representation/explanation of what this program does?
# assigned a string called 'apple' to the variable fruit
fruit = 'apple'
#assigned length of the fruit variable to the length variable
length = len(fruit)
#assigned the index value of fruit to the last variable
last = fruit[length-1]
#prints the last variable that contains the return value of the fruit
#variable which is e which also represents the string index value 5
print(last)
 
@faceless not length of the fruit variable.
 
suggestion: fruit[length-1] --> fruit[-1]
 
len(fruit) is the length of the object pointed to by the name fruit.
fruit[-1] evaluates to the last item (i.e. here one-character string) of the object pointed to by fruit.
 
10:34 PM
okay, let me think about this. Thank you guys
 
this tim is really strange :D
 
okay , so @AnttiHaapala the len(fruit) is the length of the 'string' object pointed to by the variable name 'fruit'
that is more accurate?
 
yea better
 
:D yaya <3
It feels good. Ive been a lot more persistent in my programming. Been doing at least an hour of study a day for the past 3 weeks
It used to be study 4 hours one day and then stop for 3 days and the nstudy for another 4 hours, etc
the latter method is not very good for training
 
00:00 - 17:0017:00 - 23:00

« first day (2526 days earlier)      last day (2426 days later) »