« first day (2064 days earlier)      last day (2893 days later) » 

DSM
12:00 AM
"Arch is all about ripping off that band-aid and python 2.7 is the end of the road for v2." <- congratulations, Natecat, you're the one feeling the pain. :-)
 
> Is there any Python 3 support planned?

> >Not specifically, although it certainly would be nice to get done.
2014
is it supposed to work?
 
kk I'm gonna do the hacky method
 
DSM
Your best bet is to scan the Xen build files/docs and look for variables which reference python & python-config which you could set.
 
That worked
Resymlinking that is
 
DSM
Today I found the first package in a long time which wasn't 3-compatible which I might need: the Tableau sdk doesn't support 3 yet. :-/
@Natecat: you might want to see if you can fool the Xen build by working in a 2.7 venv.
 
12:03 AM
you have to fool the Python of Xen
(see what I did there?)
 
DSM
(Depends on whether they use which python or something hardcoded like /usr/bin/python,)
 
How would I go about doing that
 
DSM
Do you have virtualenv installed? (Does virtualenv --version work?)
 
Are there gonna be any real side effects to resymlinking, (e.g. can I trust programs to use python3 instead of python)?
 
DSM
Probably not. You're likely trading off Xen breaking for other things breaking.
 
12:09 AM
I've never used virtualenv but with my rough understanding I don't see how I could use it for something like Xen
[natecat@ArchCompSSD ~]$ virtualenv2 --version
15.0.2
wait what I just got another compilation error
not python related this time
how broken is xen jesus
And then line giving the error is blank???
wtf
 
DSM
@Natecat: the point is that within a virtualenv, the result of which python is whatever python the virtualenv was created with, with no symlinking. If they correctly used the visible python, then this will allow you to repoint python. However, for all I know, they have an environment variable PYTHON which would allow you to solve the problem with one line. I'm too lazy to read the docs to find that out, though. :-)
 
I mean Xen runs at the kernel level
That's why I don't see how to use a virtualenv
 
DSM
We're talking about the BUILD, not about actually running Xen.
 
Ohh
 
DSM
The error message from before was from running Python. That's the error we're trying to fix.
 
12:48 AM
rhubarb
 
1:14 AM
cbg
 
 
2 hours later…
3:32 AM
cbg
 
cbg
 
Hello guys, can you please look at the question stackoverflow.com/questions/37732564/…
 
4:22 AM
Cabbage :-)
 
4:34 AM
guy says: "I think this is vaguely possible, but please follow this link to a blog about unrelated android shit. Btw, the articles are authored by my namesake" :D
 
I flagged it
 
5:03 AM
damn
 
5:38 AM
@inspectorG4dget yes. When you wake up give me a ping if someone didn't already answer your question
 
6:04 AM
cbg(again)
 
6:47 AM
cbg
It's great to be back at the office.
 
6:59 AM
so guys, this question may not be strictly python, but kind of an asking of feasibility
i want to create a script that is going to be data metrics on googles autocomplete searches, and id like to mimic a user as closely as possible rather than rely on api or backend components
can python be used to open a web browser, go to google, start filling in the search menu, enter characters into the search bar and record every autocomplete result it sees (and their order)
or at least maybe to manage something like a greasemonkey script that does this
 
It could, but whether you should or not is a different matter.
 
why is that?
 
If Google wanted you to use their autocomplete search results programmatically then they'd give you an API.
 
websites get used for purposes beyond their engineering design all the time
 
If they don't give you an API then you should assume they just want people to use them as a human going about their normal business (i.e. using search normally, not scraping their results)
That doesn't mean that they should be though.
 
7:04 AM
and i want to simulate that to study that interaction
 
That just means that people abuse them.
 
you may even be able to do it with their api but the point of this is to simulate a user and see what information google sends their way
 
I've stated my opinion on the subject.
 
so anybody think this should be a python only solution or how else would you handle this
the two parts stumping me is inserting characters into that search bar and how you would record the options for autocompletes
 
I am not sure if it is possible, but have you tried Selenium and the like?
 
7:14 AM
It's possible.
There are Python libraries that could do it.
You should do some research.
 
@Ffisegydd the tricky part is figuring out how to do the research
aka, wth do i actually google to figure out how to access the autocomplete element
 
Trust me, that's not the tricky part in all this.
 
Have you tried google and what it suggests if you start typing "python control browser" :D
 
^
Rather than just googling, I'd suggest you also read the websites that come up as results.
 
SO is first result of course
 
7:17 AM
Have you read the q/a?
 
@IljaEverilä which q/a are you specifically referring to
 
Your results may differ from mine, but I suppose we're both looking at stackoverflow.com/questions/3369073/…
 
yea, were both looking at that
earlier i was looking at this docs.python.org/3.4/library/webbrowser.html but its a bit too barebones
selenium seems interesting tho
 
@Ffisegydd thanks for looking my post VC++ compilation error in pyconfig.h (VS 2008), unfortunately i have got the same problem using MinGW compiler (posix thread)!
 
Wha?
Oh I see. I edited your question. @asimkon I cannot help you, I know nothing about C++.
If you need some help with C++, you could maybe try the C++ room.
But I'd be careful in there, they don't suffer fools.
 
7:29 AM
@Ffisegydd thanks! I will try!
 
morning cabbage
@AnttiHaapala policing Java as well now?
 
hiss
hello?
 
Hello
 
7:44 AM
Is it too early or too late
 
Depends where you are. It's 8:45 am in London and I just started work
 
No work for me today, it's Game Day!
 
cbg
 
@MartijnPieters Are... are you a smurf???
your name is bleu
 
Cabbage!
 
7:52 AM
@VermillionAzure oh come on, you've been around long enough to know about moderators. I'd appreciate it if you didn't troll about in here.
 
@MartijnPieters Sheesh I was hoping you could take a joke :( sorry.
Anyways... I was wondering if anybody had a good resource for intermediate-level Python and working with a state machine/game-engine like thing
 
@VermillionAzure Sorry, text chat doesn't communicate emotions all that well, and we get a fair share of people that do troll here.
 
@MartijnPieters well you probably know I hang around Lounge<C++> so I know the deal heh
 
@VermillionAzure exactly, which is why I am being a little stern! :-)
 
@asimkon Are you on a 64 bit system? This looks helpful. It suggests that you can safely delete that _W64 from that header file.
 
7:54 AM
@MartijnPieters ah.
But then again... anybody? Intermediate-level stuff?
 
Intermediate general Python: Fluent Python by Luciano Ramalho, from O'Reilly
 
@MartijnPieters Thanks.
 
Sorry, no state-machine / game-engine references from me.
 
@MartijnPieters I guess I want more of a design patterns book
 
Disclaimer: Luciano's book mentions me as a source for some of the info in the book (and links to a blog post of mine somewhere too). No, I don't get any royalties. :-)
 
8:03 AM
Perhaps I should look at UC Berkeley and see if they have anything... though I wish Google or a big company would post a blog about that, if it isn't aready out there
Wait a minute
Who are you?
Oh...
@MartijnPieters Wait so what do you work on right now?
 
Right now I'm on a train with intermittent mobile connectivity, so don't hold your breath too long while waiting for responses from me.
I currently work on Mercurial (the distributed source control system).
(next stage involves the tube too)
 
@MartijnPieters What's the "tube?"
 
@PM2Ring Regarding _W64 i have got #ifndef _W64
#define _W64
#endif

/* Define like size_t, omitting the "unsigned" */
#ifdef MS_WIN64
typedef __int64 ssize_t;
#else
typedef _W64 int ssize_t;
#endif in my code and i use win32 bit
 
@MartijnPieters And do you think having a personal website is good? How did you get yours?
@asimkon This is C++ right?
Why are you asking this here?
 
@Vermillion he's trying to build a Python library, I did suggest he try in the Lounge (not sure if he did or not)
 
8:16 AM
@Ffisegydd He did not.
I'm in Lounge
 
We need a name for here D: Like "The Club" or "The Brothel"
Brothel(Python) would work on several levels.
 
@Ffisegydd Should call it "The Circus"
Puns ! :)
~~~~~:>
 
:o
 
8:18 AM
Yeah
Plus we're all a bunch of clowns.
 
And then you can call everyone Monty or Spam
 
@VermillionAzure because someone from here gave me a clever answer
 
@asimkon Meh w/e; okay
\O/
 
@asimkon Your #define _W64 should stop that int followed by int is illegal! error, but I can't guarantee that it will fix everything. Frankly, I would not be confident in compiling source that contains obsolete stuff. And as Ffisegydd said, you really need to ask about this stuff in a C or C++ room.
@Ffisegydd In some places, it's illegal to pay ransom...
 
8:35 AM
Yeah. when ransomware first started occurring, the ransomers wouldn't actually decrypt the contents. They realised quickly that this was a bad idea, and when they started being "honest" they actually started to get more payments.
 
Reading down, the guy who only charged $450 now has a better idea of the market price :p
 
I think it generally depends on the number of PCs/amount of data, but yeah $450 is pretty cheap :P
 
@PM2Ring @Ffisegydd i just discussed it with them and they posted me a comment saying that i should discuss it with python people on stackoverflow.com/questions/37696936/….
 
good morning
 
@PM2Ring i was booked by -3 points asking the wrong question to the wrong people
 
8:42 AM
@asimkon By that, Vermillion means the people who wrote pyconfig.h I assume, and not us.
We really can't help too much with C++, even if you're using it to build something that Python will use.
 
@Ffisegydd Have you got any idea who are they and how can i reach them as i used Activestate python?
 
No, you should do some research by yourself and go and read their website.
 
@VermillionAzure tube == underground / metro.
Sorry, offline until further notice.
 
@MartijnPieters okay
 
searching for a bit , but cant seem to get it working, i want to access a 4d numpy.ndarray( dont know exactly how and if it differs from a tensor).. i want the cube when the 4th dimension has the index 1 for example
i tried something like [:][:][:][1]
 
8:53 AM
@Ffisegydd It’s just like [] is [] returns false in Python…?
(late reply is late, but I just went through the starred list…)
 
@VermillionAzure i used the following link activestate.com/activepython/downloads and VS 2008 if you can help me i would be delighted for win32 thanks
 
@asimkon Stop
 
ZOMG Zorb balls!
 
@asimkon you're starting to become a nuisance now. You've been told that we can't really help you and that you need to contact the package maintainers.
@poke yes, but what I left out of my mini rant is that [] == [] is also false in JS.
 
heh, well, objects are never equal to another in JS ^^"
 
9:02 AM
JS comparisons are just messed up in general. == does can do type conversion, plus "The identity (===) operator behaves identically to the equality (==) operator except no type conversion is done, and the types must be the same to be considered equal." ref
"The identity operator behaves identically to the equality operator..." -____-
 
Sorry guys! Thanks for your assistance too much!
 
Stuff like this can drive a man to typed languages.
 
Well, at least Python is strongly typed; JavaScript certainly isn't.
 
Yeah, I've managed to avoid all parts of JS that are weakly typed, I tend to avoid relying on them.
I should give typescript a shout someday.
 
TypeScript is good, but it will not solve the problems you encounter with JS. It does guard you against it, but you have to keep in mind that it’s still JavaScript that is being executed.
 
9:07 AM
Yeah of course.
It's a helper, not a cure.
 
A lot people seem to forget that when starting with TS though, expecting a full static and sound type system.
Just because it looks like one
 
Or just go whole hog and use typed-coffee-script.
 
What about Dart?
Or other languages enabled by WASM?
 
Dart would be one good alternative if you want to go the route of using a completely different language yeah.
 
I need to start using ES6 too.
I need to do lots of things.
Currently working through Jaynes. So many maths.
 
9:11 AM
But I personally don’t like the fact that it’s a whole different language. I prefer just JavaScript, or a superset of it (i.e. TS)
Btw. this list is pretty amazing: github.com/jashkenas/coffeescript/wiki/…
Gives you an idea about how many people think that JS is inherently broken…
 
@poke Well... I mean, it does have == vs ===...
 
Yes, but that behavior is still clearly specced and working as designed. It may not be intuitive, but it obeys its own rules.
 
what is the meaning of following line?
sys.path.insert(0, os.path.dirname(os.path.realpath(__file__)))
 
@arshpreet what do you think it means?
 
@poke That's not really a feature. That just means JS works as intended, not a large feat.
Even BF has its own rules.
 
9:15 AM
You may call that broken.. I don’t. JS is not the best designed language, of course not, and it has it’s weird parts, but I think you can work with it pretty well if you understand how it works.
 
@poke Again, not a valid argument, as it depends on the particular experience of a particular programmer with a particular language.
 
@Ffisegydd What's a Jaynes?
 
@Ffisegydd really not getting , aka stuck
 
@arshpreet What is sys.path then?
 
I presume not a long list of similarly named women.
Given your sentence.
 
9:18 AM
@VermillionAzure Of course it depends on experience. Or are you trying to say that every language is broken that cannot be picked up instantly by new people?
 
> This is not an ordinary text. It is an unabashed, hard sell of the Bayesian approach to statistics.
 
Tis the Bible of Probability.
 
I approve
 
sys.path returns all packages under /usr/lib/python2.7/
 
9:19 AM
@arshpreet If you go to the python docs you'll find the sys library and you'll be able to tell what sys.path is.
 
@poke I'm saying that there must be a way to objectively compare languages somewhere.
 
You'll then be able to work out what sys.path.insert is doing.
 
@Ffisegydd Interesting - I hadn't come across it. But then I'm sooooo old that I'd finished my undergrad before it was published.
 
And JavaScript might not come out on top once that does happen
 
After that you can start by looking up the os.path library and seeing what dirname and realpath do.
 
9:21 AM
I would refute your premise "must be a way to objectively compare languages somewhere."
 
Then finally you can google for Python __file__ and you'll work out that part.
 
Why must there?
 
Then, after all that, you'll have solved it for yourself.
 
Ok
 
I'm quite tempted to refute the notion of objective comparison in total, for troll-de-roll lols.
 
9:22 AM
thanks
 
Normally I'd sit here and continue to ask you questions until you solved it yourself, but I haven't the patience for that today, so instead I wrote the above in advance.
 
@JRichardSnape I think there's a way to do such a thing.
 
Correct
 
e.g. We can "feel" that Haskell might be a more type-heavy language than C. The "why" is going to be somewhere in how the language is designed.
 
There is indeed a way to refute the notion of objective copmarison.
Anyhow, I'm gonna stop as I should do some work and this could take a long time.
 
9:23 AM
@JRichardSnape I mean, it's not like I can say that a language is automatically better than another just because. Arguments need to start by having values or criteria founded on a common basis.
And that common basis can and should be established somewhere, and probably already has
 
9:36 AM
Probably is a funny word. Seems to soften the most outlandish statements just enough to be acceptable, if you're not paying attention.
Cbg
 
@RobertGrant :) Morning
 
Should is another one. Also surely.
 
@Ffisegydd Thanks for the tip. I have just skimmed the preface and think I may get hold of a copy - I like the style
@RobertGrant Surely your insight should reveal the meaning of life. Probably already does.
 
If it doesn't, it should.
Oh crap my brain missed your should.
 
should pay more attention ;)
 
9:42 AM
@JRichardSnape It was once recommended by the Wise Data Scientist Of The North, known by some as @DSM.
 
Ah, the WDSOTN, he know things.
 
My tests won't run on Windows D:
Stupid scipy, can't you just write all your functions in pure Python!?
Is there some black magic to make __setattr__ test whether you're in the class def'n or not?
Probably Almost definitely not.
 
While I frequently regard "probably" as a prevarication, I tend to associate "should" with a dictatorial attitude that can be expressed benevolently as in "you should wear your raincoat, it's wet out" or malevolently as "you should get back to where you came from." A phrase I rely on more and more is "it seems to me," since that leaves the reader/listener free to express different perceptions without fisticuffs being required
 
It's times like these I wish Python had private attrs on classes.
 
private classmethod/property?
 
9:52 AM
Yeah.
 
Would the names get mangled?
 
Though actually, it wouldn't really solve my problem.
 
bc?
 
My main issue is that I've got properties that I don't want people to accidentally change after instantiation of the object.
But it's not as simple as using @property with getters and setters.
Or rather, it is that simple, it'll just look ugly for my particular uses.
 
@holdenweb yes, "(it seems) to me" tends to be given a pass by the connotation police
 
9:58 AM
for key in defaults:
    setattr(self, key, lambda self: getattr(self, '_' + key))
mhwhahaha.
I think that'll work, unless the lambda will mess up.
 
cabbage
 
I'm a little bit disgusted that only 70% of my tests failed.
 
Thanks for support. Still - i got an answer, even if it was provided in quite a hard way. And thats true, it is hard to find answer when you do not know what to look for. — cure Jun 4 at 9:59
That's a nice OP there
 
10:15 AM
That's better! 100% test fails!
 
Did you delete 30% of your tests?
 
No, I did it the honest way.
I think I'm just going to accept that if people modify the internal attributes, then they'll break the object.
 
Yeah isn't that a dunder thing?
Modify or call at your peril
 
The problem is that they're not made "private" by using _.
And I can't think of a non-hacky way of doing it, without adding loads of @property everywhere.
 
Yeah I know, but I thought that was the python answer to private members
 
10:22 AM
It is.
But if I do that then I've got dozens of property.getter definitions in each class.
 
Oh I see
 
Really what I want to do is make the classes immutable, but then internally I have to use super().__setattr__(name, value) for every assignment.
 
I'm sure I can find a blog post describing why doing that is probably never useful and you should not do it, surely.
 
Oh yeah, I found the same blog posts.
 
HTH kthxbye
 
10:27 AM
I think I've found a hacky way around it.
def __setattr__(self, name, value):
    if name not in {'r', 'x', 'y',}:
    super().__setattr__('_x', None)
    super().__setattr__('_y', None)
    super().__setattr__('_r', None)

super().__setattr__(name, value)
 
Are you calling a Java method exposed by SOAP?
 
I don't know what those words mean.
 
which ones?
 
So I've got scientific functions that return random data based on a given model. For example Normal(mu=1, sigma=0.5, N=1000) will return an object with x and y attributes that correspond to a normal distribution with mean 1, stddev 0.5, and 1000 data points.
Those params are instantiated in __init__, but what I'm trying to fix is if someone comes along and says obj.N = 10 after the fact.
 
(Ask questions then suggest)
 
10:32 AM
Tuple for what?
 
As in do you need methods on it as well as data, once the data's been generated?
 
The data itself is in numpy arrays which are attached to obj.x and obj.y. But also it's useful for the user to be able to access obj.mu to check the mean. This is because you can just rock up and go n = Normal() and the object will do some intelligent guessing and give you a randomised but sane looking normal distribution.
So them then going "Oh I've got this randomised normal distro, but let me check the actual mean" and looking at n.mu is useful.
 
You couldn't have a method that returned (x, y, mu)? Sorry, I can only ask project manager level of questions
 
I could, but some other distributions might also have K, M, m, k, tom, dick, harry.
And that wouldn't really help anyway.
 
I guess it's less extensible
Yeah
 
10:38 AM
I think I've solved it now anyway.
The whole thing isn't helped by the fact that I wrote this on a whim a few years ago and didn't really think of the design. I'm now a better programmer and so can see the deficiencies in it. Unfortunately, I'm still a lazy programmer who doesn't want to spend time re-writing large chunks and instead wants to do the interesting bit like adding new distributions.
The idea behind it being something like this:
from gwydion import Sine
import matplotlib.pyplot as plt

sines = [Sine(xlim=(0,5)) for _ in range(5)]

fig, ax = plt.subplots()

for sine in sines:
    sine.plot(ax=ax)

ax.set_xlabel('Time')
ax.set_ylabel('Intensity')

plt.show()
 
^story of all my code ever
(the lazy bit)
 
forks Gwydion as AngloSaxon
 
Easily generated 5 randomised sine waves. They all have random intensities, frequencies, and phase, but the I, f, and p don't vary too wildly so they all look kinda samey.
 
Yeah that's cool
 
10:41 AM
The main reason for the sameness is I didn't want to have two curves on the same plot, one with 0.01% of the intensity of the other, through fluke.
 
I'm liking "kinda samey" as a descriptor.
P.S. I remember looking at your library a while ago and thinking it was a nice little tool.
 
I wrote this lib for the good old glory days of when I'd answer SO questions, and would be generating random data all the time for answer examples.
 
That's as much praise as you're going to get from me ;)
 
I'll have it inscribed on a plaque in the style of North Korea.
 
seems right.
feel free to refer to me as Glorious Leader whenever you see fit.
 
10:43 AM
"Unicorn descended from skies carrying our Great Leader Hairy McHairface. The Great Leader showed his wisdom in blessing this open source library with his praise."
NK joke: 6/10, not the best.
Coming up with the description "Hairy McHairface" for JRS: priceless.
Pub lunch today too.
 
cabbage
 
cabbage @Andras
 
alters chat profile to include Hairy McHairface
 
Snapey McSnapeface
 
10:50 AM
But you look more like Hagrid :/
 
He might look like a Hagrid, but he's a Snape at heart.
 
re-cbg. Is this too condescending?
@avimatta There's a link to the official python tutorial on the page I linked you to, as well as links to other resources. The official tutorial is primarily designed for people who already know how to program in another language. So if you can't already program well in another language it may not be a good first choice, but you should definitely read it at some stage. — PM 2Ring 3 hours ago
 
@PM2Ring not at all
 
Oh, good. :)
 
10:52 AM
2 months of SQL --> python heh, yeah
 
@PM2Ring Given the context, A Good message.
 
I figure I get a fair bit of leeway when responding to "what is official python tutorial?" :)
 
I think that's a valid comment under all circumstances
no need to sugarcoat things if that would hinder the message
 
We need a "What is a Generator Expression?" post like that "What is a List Comprehension?" post.
 
although I did turn out to be an INTP-a :P
My main issue with that question is that it thinks SO is a tutorial site
"I encountered a language feature, what does it do?"
well, go find out
 
10:59 AM
@AndrasDeak I generally try to be diplomatic, but I find it tricky to be both diplomatic and clear when trying to communicate with people who's English isn't good. :)
 
we need a close reason for this
@PM2Ring diplomacy is overrated
 
@AndrasDeak Too broad sort of covers it; I guess tutorial request is another option.
 
meh
I'll choose one
yeah, tutorial will do, thanks
and epitome of "it doesn't show any research effort"
 
And the code he wants explained isn't fantastic, either. But I guess it could be worse, and at least he's not using LPTHW.
 
:)
LPTHW saving the day
 
11:15 AM
I don't like tutorials that just trot out standard techniques from other languages to Python newbies. Sure, the standard way to do that kind of sum in many traditional languages requires indexing. But in Python for y in range(sequence_length) is rarely a good idea, and iterating directly (without an index) is cleaner, eg sum(u for row in values for u in row) and sum(u for row in values for u in row[:2]), and I suspect that direct iteration is easier for a newbie to learn.
 
yup
 
@BhargavRao LOL. That answer was originally written in C++ :facepalm:
 
Yep :D
 
potatomato
 
11:25 AM
Can anyone explain this please?
589
A: What is the best comment in source code you have ever encountered?

Lance Kidwell// Replaces with spaces the braces in cases where braces in places cause stasis $str = str_replace(array("\{","\}")," ",$str);

 
it sounds like a children's rhyme?
Dr Seuss writes code? +1! — Blorgbeard Apr 22 '09 at 9:29
that's all I see
 
I had to Google to find out who Dr Seuss is... :D
 
11:45 AM
@thefourtheye Yup - they're gone now
How goes your day pups?
 
@JonClements Yay :-)
Learning Scala and Akka... They take a lot of time...
How are you? Long time...
 
cbg
 
cbg
 
@JonClements Here's a humorous Aussie country song for you: Readymix revenge by Johnny Chester.
 
@thefourtheye same old same old :)
@PM2Ring Just listening to some Tiffany at the moment - will check that out in a bit... (although my recommended by PM bookmark list is getting fairly long now - should really do something about that and listen to stuff!)
@idjaw aye aye cap'n
 
11:58 AM
@JonClements hey pup.
 
Please do. I'd like some feedback so I can link you to stuff that you will actually enjoy. :)
 

« first day (2064 days earlier)      last day (2893 days later) »