« first day (1563 days earlier)      last day (3386 days later) » 

2:02 AM
^ that last one had a terrible "recommendation" answer from me, from before I became enlightened
 
cbg
 
 
1 hour later…
4:05 AM
How do I make a grid based game? (in Minecraft, lol) too broad
 
4:52 AM
Hey @davidism, you still about?
 
yep
 
Wanna team up on a random act of senseless kindness?
 
ok
 
Martijn's two votes off a Great Answer badge on stackoverflow.com/questions/17580289/… ...
 
you mean one vote off ;)
 
4:56 AM
Oh hang on, I already voted. Dammit! Anyone else?
 
lol, and I had a comment ready for when it hit 100 too
 
@davidism ah actually that sqlalchemy question "too verbose" should be deleted, it is totally obsolete
 
@Antti !!! Go on, give Martijn's answer that final nudge ...
 

It's the thought that counts

6 mins ago, 5 minutes total – 9 messages, 2 users, 0 stars

Bookmarked 18 secs ago by davidism

although it won't be relevant for long
...
@ZeroPiraeus I don't know what you're talking about, he's already got 100 ;)
 
5:03 AM
 
if an answer is "use the stdlib module" it is not searching for external resource
 
...yeah, what were we thinking?
 
yes, the python documentation is such bad that no one is thinking about shlex
seriously the guy who taught me python, didnt after 10 years even know that ''.split() works :D
let alone had ever heard of shlex :D
 
Oops, that's my fault, Not having my best ever evening, clearly ...
 
I edit it so that it asks in Python standard library :d
20
Q: Python module to shellquote/unshellquote?

YGAIs there anything in the Python standard library that will properly parse/unparse strings for using in shell commands? I'm looking for the python analog to perl's String::ShellQuote::shell_quote: $ print String::ShellQuote::shell_quote("hello", "stack", "overflow's", "quite", "cool") hello stack...

 
5:20 AM
The Dolphin Emulator has a pretty crazy test buildbot. It can even test changes in the graphics output.
 
5:42 AM
sometimes I think that python room is almost too happy to close all questions
 
Already voted
 
ah and that is also a good question to keep open, suppose Python 2.7 pipes.quote is noticed to be unsafe
 
@AnttiHaapala oblig.
 
I rarely read questions with cv-pls tag :I
 
5:52 AM
I'll always at least speed-read them. Sometimes I defer to greater knowledge - e.g. "Fizzy wants to close a Pandas question? Yeah, he'd know better than me ..."
 
Speaking of knowledge, TIL: I know nothing about Python's import system
 
are cv-pls tags searchable in the tags?
 
No, I meant that I don't read questions that room regulars are asking to close in this chatroom. cv-pls tag doesn't seem to exist outside the chat system.
 
@tilaprimera Not sure what you mean ... are you asking what means?
 
Yea..
 
6:06 AM
Ah :)
 
@tilaprimera Ok, it means "close vote please".
 
@ZeroPiraeus melons for the info.
 
As in, please look at this question and if you agree with me, vote to close it (put it on hold).
 
Or, just follow the link and hit the close button as fast as you can :D
 
@vaultah FCVITW? ;-)
 
6:13 AM
Something like that, yeah :) I hate it when I open a link and see close (4)
I click it and then I see the "The question is now closed" popup
 
... and it's vitally important to have your name on the list of closers, right? ;-) (I know, I get the same impulse)
 
:P
 
6:32 AM
... vitally important to have your name on the list of closers until I pop in the chat and ask for
@vaultah nothing about import system meaning what?
I did need to hack with it quite a bit, especially with jython (though it is not quite the same as with cpython 2.7 but close)
hmm
syriza 2 seats from majority
 
Hahaha:
0
Q: How can I tell if my PHP application has become sentient?

Tim Post's Sock DrawerI've written a fairly extensive application using PHP and lately, I'm concerned that it might have become sentient. Just last night as I was about to run a build and the test suite, the socket server sent this message, which I caught in my browser's console: No, don't - you know that's not go...

 
:D
hmm
 
(for those of us who can't see deleted posts)
 
@AnttiHaapala I got Parent module '' not loaded, cannot perform relative import error. I've found the SO question, read it, but I still have a sense that I'm missing something important
 
you are doing relative import from main module?
 
6:43 AM
Reading the docs now
 
@vaultah you are doing it wrong anyway, if you want to have a runnable mod in python, it should be main in package I guess
 
@AnttiHaapala I'll answer that question after I finish reading the docs xD
 
"unfortunately, this module needs to be inside the package, and it also needs to be runnable as a script, sometimes. Any idea how I could achieve that?"
never run the scripts like that
run them as python -mmodulename
basically I disagree with about everything in ayas answer
so if you're up to writing a new ans then please do and I will +1
that is: Aya's answer is "You cannot shoot yourself in the foot because the gun has safety lever set to the safe position. Now, there are people who say that shooting yourself in the foot is an anti-pattern, but I disagree with them as I often find it useful to shoot whatever is left of my foot. Thus, follow these instructions: 1. set the safety lever to off position, 2. aim at your foot, 3. pull the trigger"
 
7:39 AM
cbg
 
Cbg Jerry
 
7:58 AM
Cbg
@AnttiHaapala :)
 
cbg
 
@CodyPiersall instead of getting Python shipped with Windows, I thought this might be a better bet that would also enable that: windows.uservoice.com/forums/265757-windows-feature-suggestions/…
 
8:15 AM
cbg
why do you want to make windows better?
that would be awful, more and more ppl would be using windows saying "it is good enough", ewww
 
I'm not partisan :)
 
Ahhh... nice cup of tea with toast and marmalade... lazy breakfast :)
 
... if you're actively helping the OS with 98 % user share to gain more users...
 
Mmm, marmalade ...
 
I'd have thought its market share was about 80% now (if that)
@Zero I was going to have marmite, but haven't got much left, and I sometimes like marmite on toast in the evenings for a snack...
 
8:22 AM
on personal computers with mechanical keyboard
 
I've been out of marmite for a couple of months now :-(
 
@ZeroPiraeus oh, okay :)
 
macos .10 + .9 = 5.3 %, others 3.8
 
I might have already mentioned this, but when I first came to Chile, the border guards were very confused by my marmite (which looks exactly like honey to an X-ray machine).
 
8:23 AM
I've heard of Chocolatey, but didn't realise it was getting an official blessing
 
WTH is with XP there! That's... sighs
 
OSX has overtaken Windows Vista now, that's cool
 
when returning 1 time from Vietnam, my hand luggage was packed with coffee, which I think the Frankfurt am Main security guys mistook for plastic explosives...
 
8:41 AM
Never heard of the first proof on here before, but it's very cool: math.stackexchange.com/questions/1108419/…
 
cabbage
 
cbg @IntrepidBrit
 
re-cbg
 
@RobertGrant which one is first?
 
8:50 AM
Oh sorry, the n(n-1)/2 one
 
that's the old one, would have had that in high school already...
the others are like "dunno, dunno, dunno" :D
 
Well, I've forgotten it if I did :)
 
re Python/Windows: 1) Windows is here, people use it, deal with it places sunglasses on. 2) As someone said the other day, putting Python on Windows will help Python a lot more than it will help Windows.
 
What a gif
 
Wow... that doesn't get annoying quickly at all :p
 
8:56 AM
I mean don't get me wrong, Windows is a pain to develop on, I wish I could use OS X and I'm thankful that my PhD doesn't really require me to develop things (like use virtualenvs etc) because then you struggle to use the Christoph Gohlke's .exe releases.
Well talk more so it goes away quicker.
 
What we need right now is a long paste from a 20-rep newcomer ...
 
@ZeroPiraeus Or another picture of Robin Gibb? :P
 
Well, you can never have too many of those ... the man's hair is magnificent.
 
8:59 AM
I'm getting a weird bug on SO lately where I can't open the close box. It just says "You can only open the close box once every 3 seconds." Problem is I'm not sure it's a bug, or whether my PC is so incredibly slow and crap that it just times out in some way.
 
@Ffisegydd yeah exactly. What Python should be worrying about is C# making its way onto other platforms :)
 
@Antti looks like we'll have to re-close it then :P
 
C# :D lol
 
@AnttiHaapala Fixed :-)
 
That maths thing of the car going at 15mph uphill and then how fast does it have to travel to average 30mph blew my mindhole initially
 
9:00 AM
maybe should replace it with "how do I ..."
44
A: What's your favorite proof accessible to a general audience?

AlessandroThere exist irrational $x$ and $y$ such that $x^y$ is rational. proof: if $\sqrt{2}^\sqrt{2}$ is rational we're done, otherwise we consider $(\sqrt{2}^\sqrt{2})^\sqrt{2}$, which evaluates to $2$. edit: simpler to fit any audience, but somewhat related, the proof without words of the irrational...

this is nice and simple
 
Okay, I think I now understand Python's imports
 
@vaultah famous last words? :p
@vaultah in Russia, Python's imports understand you! :)
 
:D
 
@JonClements Great approach! It should be an aswer itself. If you don't mind I'll include it in my answer. — Pablo Francisco Pérez Hidalgo 1 min ago
 
@AnttiHaapala Aya's answer covers the question pretty well, I guess. I don't know what to add
 
what you should answer is what to do instead, that is use setuptools to install scripts and such, and the __main__ etc.
 
Ugh, nearly a 20k user too.
 
ah maybe answerer wants the peer pressure :d
 
Closed now anyway.
 
he has peer pressure already :d
any js syntax coloring editor for python 3 code?
 
9:33 AM
I guess ace works ,but so far didnt find out how to load from cdn
 
@Antti we use Ace on sopython so many have a look there?
 
@Ffisegydd that's cool
 
Heh I almost answered that question with the same answer as fredtantini :P
Luckily he FGITW'd me :3
 
9:49 AM
@AnttiHaapala I think I'll answer it today
 
basically the point being that running random files from random locations and expecting something funny was always a bad idea even in python 2...
in python 2 the relative imports sometimes were relative, sometimes not and so on
 
Writing this just because its been a while since I said something...
 
I struggled a little bit with imports and namespaces.
I've kinda got a good feel for them now. In my packages I use relative imports though, when maybe I should use absolute.
 
no
what you should use is from __future__ import absolute_import and
then do whatever you want
what is discouraged are python 2 relative imports without from __future__ import absolute_import
 
10:00 AM
Pssh. My packages don't support Python 2. Don't be daft.
Python 3 all the way.
 
In my office work, there is a JAVA function which has around 35 lines of validation of inputs (null, empty etc.. you name it, we got it there) and then a comparison which returns a boolean... Sigh...
 
@thefourtheye on the plus side, it'll keep working no matter how much Java changes, which is why we're stuck on Python 2 and they're on Java 8 :)
 
Umm.... reckon it'd be evil to try and get this question turned in as:
 
But reading a long list of validation code is boring and to write its highly time consuming...
 
with open(classno) as fin, open('class11.txt', 'w') as fout:
    for line in (line for line in fin if line.rstrip()):
        name, *nums = line.split()
        print(max(nums, key=int), name, file=fout)
 
10:03 AM
Which is the unclaimed (but very useful) write once, run anywhen property of Java
 
Apart from that we need to write UTs for them also
 
@Ffisegydd so in that case do relative imports to your heart's content
 
@RobertGrant Wait... They didn't mean architecture neutral by that?
 
2
Q: Story with children that have magical powers imbued by wearing stones around their neck

Jon ClementsI believe I first read this in the mid/late 80s. Here what's I can recall: It involved a boy and a girl - I believe 7-10 years old - I don't recall if they were friends or brother and sister They were given a "stone" on a string necklace that enabled magic and protection of some sort from some ...

Shameless plug for my scifi question - but does anyone here recognise the book?
 
@JonClements please see sopython.com/chatroom for the chatroom rules.
Don't make me kickmute you ...
 
10:11 AM
Yeah Jonathan. You're setting a terrible example for the children.
 
@thefourtheye what do you mean?
 
Write once in any machine and run it in any other machine?
 
Yeah, well that's the idea behind write once run anywhere, although if it's a GUI it doesn't generally look nice anywhere :)
 
@Zero @Ffisegydd meanies :(
 
But I was talking about the fact that you can run any compiled Java on any future version of Java, a lack of which is the problem holding back Python 3
 
cel
10:15 AM
stackoverflow.com/questions/28146192/… - maybe try a migration to stats? Not a programming question
very broad, tough
 
@JonClements Couldn't resist ... it's pretty rare to get a chance to threaten to kick a puppy and it actually be funny ...
 
@Zero I don't think the puppy would find it amusing :)
Umm... arghghgh.... globals()!!! - stackoverflow.com/questions/28148154/…
 
Can I list all unique values of a row in all columns in SQLAlchemy without going through each column and checking all value to extract the unique ones?
 
@Wally ha?
 
For eg. I have the following columns
[AP, 53656, 5646]
[AP,6546,546546]
[TG,e434,56655]
[TG,46546,6546456]
[GJ,435646,54646]
I want to get AP,TG,GJ without looping through all the columns @AnttiHaapala
 
10:30 AM
You can copy/paste the code/data and use "fixed width" button.
 
In Sql alchemy
 
you are confusing columns with rows
the horizontal ones are rows...
verticals are columns...
 
Oh sorry! I'm always confused when it comes to rows and colimns
 
and suppose your first column is named .name, you could do
 
Well, this is a little surprising: theguardian.com/world/live/2015/jan/26/…
 
10:33 AM
Is it possible at all to get the unique values without looping and appending them to a list and checking if it already exists in the list. That would take really long on a big database
 
names = [ i[0] for i in session.query(Model.name).distinct().list() ]
hmm?
 
@AnttiHaapala
 
cel
@ZeroPiraeus yea, was really surprised too...
 
Will this be fast and not loop through all the table?
 
it will loop through the table, on the server side.
 
10:39 AM
@ZeroPiraeus wow - that certainly wasn't my guess :)
 
cbg @Martijn
 
cbg :-)
 
So,it will be slow if I have a table with thousnads of values
@AnttiHaapala
 
adsfljasdf
there is no way to make it faster period.
 
10:39 AM
Ok
 
cel
there's always a way to get it faster :P
write it in pure C
or assembler
:P
 
@Wally no it won't, it'll be fine.
 
cel
(sorry for that) :P
 
But it's how fast your database is, not how fast your own code is
 
cel
</trolling>
 
10:41 AM
it will be fine or not, and it is beyond the capabilities of SQLA and this is the fastest way to do it like like you said...
 
Interesting way of putting it: I ran debugger to slow down the program
 
if you have 26 trillion rows with only 'A', 'B' or 'C' there, then hardcoding ['A','B','C'] in python will be faster.
 
It would look like Magic to new posters when their questions get closed within a minute...
 
@AnttiHaapala well normally, the DB should have stats about the cardinality of that column, so I'd be surprised if it can't return 3 immediately
 
@JonClements nope, they don't
they have approximations of distribution, or approximations of cardinality yes
but not exact
 
10:43 AM
pretty sure for low numbers they are exact
 
Indexing might help
 
ofc they can also do index scan... but also insallah
 
I suspect the tag counts didn't update last night. That or I miscounted and am indeed still 1 vote away from my Django tag badge.
 
nope, not exact for low numbers either
 
The latter is the more likely explanation.
 
10:44 AM
it is the zero-one-n problem really...
also, with MVCC you cannot know exactly what is in the table currently without scanning it.
 
This question looks way too broad for Stack Overflow.
 
anw, my point is that even with index, and knowing the cardinality etc, if there is only ['A', 'B', 'C'] in the list there and you know it then hardcode it :D
 
or am I just being cranky here?
 
it is
Can this program be written in less than 500 lines of code (including blank lines and documentation)? Perhaps my problem is that I'm generating AIs that are too simple.
in any case it is more like code review (though it ought to work)
 
Flagged it for moderator attention.
(there is a bounty so I cannot vote to close directly).
 
10:48 AM
Can you tell me more about indexing?
Nevermind I'll lookit up
 
@Martijn yeah - pesky bounties :)
 
stupid to make genetic algortihm to play tic tac toe
the OP obviously didnt see wargames
more like stupid us, should have caught that with nidaba and closed before the bounty
 
@AnttiHaapala The only way to win is not to play? :p
 
yes but the tic tac toe was where the computer realized it is draw always
tic tac toe is such that you can always play it forward to the 9th move, you do not need any stupid genetic algorithm to guess anything
 
I might have to watch that again later... I remember quite enjoying it years ago...
 
10:56 AM
cbg
@MartijnPieters Definitely way too broad, but it does seem a shame to close it as they look like they're having fun. :)
 
@AnttiHaapala my nephew got quite annoyed that he couldn't win a game of tic-tac-toe against me... took a while to explain that really all games should be a draw...
Then we played some four-in-a-row - that didn't make him any happier either...
 
It can be fun writing a program that learns to play tic tac toe, but I agree that using GA for it is a bit silly.
 
I used sliding puzzles, mazes and other such games to practice my genetic algorithm skillz.
 
@Martijn you're so 1337 spelling skillz like that...
 
for GA it needs to be something that has game states that are slightly more expensive to evaluate than what could be done in 70s personal computers in 2 milliseconds.
 
11:01 AM
I hate recruitment websites so much.
 
@AnttiHaapala It all starts with GA for tic-tac-toe, then before you know it, Skynet is upon us :(
 
@Zero I was just looking at that... was wondering if they're coming from a PHP background maybe...
 
11:04 AM
Back in the late 1950s or early 1960s there was a Scientific American Mathematical Games column about a simple tic tac toe learning "machine" that a guy built. The machine consisted of a large set of matchboxes, each with a board diagram on the front and numbered tokens in the box representing moves. To select a move you locate the box representing the current board state & randomly remove a token. To teach the machine you don't replace tokens in later board states that lead to losses.
 
@PM2Ring ooo... only 53 to go until you get 3k... :p
 
Yep. Hopefully, I'll get there before the end of the month. I guess I better go and answer some questions... :)
 
@AnttiHaapala Thanks heaps!!
 
3 more rep...
 
11:16 AM
give some ups to pm 2ring
 
-7 more rep...
 
so that we can close the questions faster :d
 
@PM2Ring GRATZ :-)
 
3 007
 
Yay! Thanks, guys.
 
11:16 AM
how do I indent forward in the edit window of edit question?
 
You mean like a code chunk? If so, select the lines you want indented and press the {} button.
 
... or ctrl-K.
 
@ZeroPiraeus I tried that instinctively, but It opens a sidebar in firefox :(
 
11:32 AM
:)
 
@Ffisegydd What's missing is "why are you hitting yourself" pane.
 
@ReutSharabani Ah, not for me ... some plugin's sidebar?
 
But to be fair, only drunkards and fools lent Greece more than once. :)
 
@GamesBrainiac I guess we close that as off-topic?
 
11:38 AM
@PM2Ring Yea.
 
mmmhmhm
@GamesBrainiac off-topic how :D
cannot be reproduced ...
or it is a support request to pycharm
 
Cannot be reproduced.
 
I really miss "this guy has no idea what he/she is doing"
 
@GamesBrainiac How about "This guy should give up programming and take up something more suited to their skill level, like fingerpainting". ? :)
4
 
Nah, thats a bit too harsh.
 
11:48 AM
Yeah... somewhat denigrating to professional finger painters :)
 
LOL
 
@JonClements My point exactly old chap :P
 
@Games old! :(
 
Which reminds me... this guy has a not reproducible error and still hasn't responded to my request for traceback. Is it close-worthy?
 
should have given the platform, the X clipboard is a tricky one
 
@Zero I admit that it is more complex than a comic can actually reflect, but it amused me. The Guardian article is interesting though.
 
@AnttiHaapala Fair call. I've never used PyCharm; but I know that in Konsole I have to use Shift with Ctrl-C or Ctrl-V.
 
that has a different reason
why would copy with control-C :D
@PM2Ring yeah, cv close as unable to reproduce
stackoverflow.com/questions/28122423/… off-topic / unable to reproduce
 
@ZeroPiraeus not sure it's a useful comparison, but it's an interesting point to debate :)
 
Yeah there are differences between the two (some are outlined in the comments).
 
11:55 AM
I'm not comfortable using "unable to reproduce" when I don't have the software required to potentially reproduce the problem.
 
@PM2Ring also, your fertility shouldn't really be anything to do with it.
 
@RobertGrant facepalm
 
@RobertGrant See xkcd.com/583 :)
 
@Ffisegydd comments by blessed people...
 
@JonClements Sorry, mature :P
 
11:58 AM
Oh yeah. Whenever you enter the comments section of a website you essentially have to take every single thing said with a bucket of salt.
But still...even a crazy person is right twice a day.
 
"Now I am awake, oh noes yet another lucid dream..."
 
@PM2Ring damn Randall and his always getting there first
 

« first day (1563 days earlier)      last day (3386 days later) »