« first day (2191 days earlier)      last day (2758 days later) » 
00:00 - 18:0018:00 - 00:00

12:36 AM
can somebody help? I want to make online Python interpreter with interface in vk.com for private use, so only few trusted people would have access to this feature
I dont sure how to implement a REPL into it, or use the code module
 
 
1 hour later…
1:52 AM
and... have you tried anything @MaxLunar?
you also might look into Jupyter notebook, because that might do what you want
 
2:41 AM
@RobertGrant hah, nice. I'm guessing what, 2 years ago?
 
 
1 hour later…
4:01 AM
cbg
pycharm sucks again
 
4:11 AM
howw
 
4:27 AM
autocomplete doesn't work anywhere, misses "add type hint for this variable", "find anywhere" doesn't accept module names (I don't care for asdfsdf/asdfdfsadf/sadfdsafdsaf/__init__.py, all I care for is sadfdsafdsaf.SadfClass)
then randomly it refuses to add automatic imports, imports completely wrong stuff, like sys from datetime, refuses to find definitions for my typehinted attributes so it says "well, I can't find your a.b.C", even though F3 takes me there... oh wait, now it doesn't.
if this was a Java IDE everyone would say that it is unacceptable, but since it is a Python IDE it is like "well, it's the best we've got so STFU"
 
5:03 AM
I swear there was a way to do auto imports in pycharm
 
of course there is
it just doesn't work 33 % of time so it always cuts my flow
see, usually now I copy paste a module, then use ctrl-shift-o to remove unused imports...
so really the failures are all that I now meet :D
so if I used vim, nano, emacs, I'd be "shit I need to go to top of the file and import func from sqlalchemy.sql"
but now with pycharm I am like... "oh we have this autoimport feature", *types func, presses all the magic buttons, nothing found, ah now it found, import this name yess yess", "from frobnicator import func" appears on top of the module. Then I am like ... wtf? Then go there, then ... but why doesn't it work for sqlalchemy, oh it works, oh wait now it auto-imports func... oh wait that's frobnicator.func again... tshii... what was I doing, ah I need more coffee (goes... This message is too long.
 
stop using ambiguous names then
 
do you want to be kicked?
have you ever worked on a porject with more than 2 files?!
if I autocomplete Request, there are 20 matches
There is this thing called namespaces
 
5:21 AM
Yeah but if you don't specify which one your want how should pycharm know?
Like if 20 matches come up on Request, then no autocomplete program could ever always autocomplete Request correctly
 
You didn't read above
the list doesn't include the one that I am searching
if I have from sqlalchemy import Text, it doesn't seem to suggest importing anything from sqlalchemy any longer, instead it happily proposes everything else.
it is as if they themselves have never programmed python beyond one-file projects
 
ohhh
I see what you mean
 
no one who just writes one-file projects does need
 
 
2 hours later…
7:05 AM
Hi everyone ! How do I find the maximum distance between any two points in 2D convex hull ?
 
7:49 AM
scipy.spatial.distance.pdist -> max
Unless the convhull bits have a method for that
brief cbg
 
Cabbage
I'm just catching up with the transcript & noticed Kevin's puzzle. I have a solution which I'll post if nobody else has thought of the same thing.
Oh well. It looks like Kevin found the same thing... but my version's slightly shorter. :)
foo=type('F',(),{'__getitem__':lambda s,i:s})();print(foo[4][8][15][16][23][42])
 
I want a process to be running in the background which utilizes around ~5-10% of my CPU all the time in Linux.
I tried a simple python program but it takes 100% of the cpu..
Any idea how to do it? Can I write a program that limits the usage to the said limit?
 
8:05 AM
Maybe ulimit -t can do that, on the OS side
 
8:22 AM
Ugh I didn't get you
 
Google ulimit...
Even if something like sleep will turn your program to idle, I'd be surprised if this could be done reliably from within python
 
Another option to try is renice, which you can do with the renice command itself, with ulimit -e, or interactively with top.
 
That will still take 100 if nothing else runs, right?
I've never used huge nicenesses
rhubarb
 
For some reason, I want my cpu usage to be kept above 5% all the time..
I don't want it go idle
ulimit applies to all the processes. Am i right?
Ok if not Python, what other ways can we do it?
 
@johnsmith It looks like you have a nice answer to your question, but in future please don't link your fresh SO questions here; see the room rules for details. BTW, there's a slightly more efficient way to calculate the max_dist:
max_dist = max(d(L[i], L[j]) for i in range(0, len(L)-1) for j in range(i+1, len(L)))
Of course this is still O(n^2), so it doesn't answer your question.
 
8:37 AM
@vinwin really, the question is still why
keeping cpu level above 5, 100 % is above 5 for sure, but it wasn't ok either
 
@vinwin It applies to all processes run in that particular shell.
 
@AnttiHaapala: Okay.. the process should limit itself to ~5-10% , not more
 
the other question is: why
 
@PM2Ring - What if i want to limit to a particular PID
 
since it affects the possible solutions that can be generated
it is different to do 50 ms and then sleep 950
you could call setitimer, busyloop in while until signal is delivered then sleep 900ms
 
8:43 AM
I have a system with 8 CPUs right now... For a while, I won't be utilizing it much. So the usage will go below 1%.
So the IT guys will downgrade my system to 4CPus if usage goes below 5% which I don't want to happen
 
@vinwin The simplest way to do what you want that I can think of is to use the top command, and modify the niceness of your process by trial & error until you get it doing what you want. But of course the amount of CPU that it chews up will vary as the load caused by other processes varies.
 
yeah
the nice process is just ok :D
lol
 
nice process looks nice
 
if you nice it to the lowest level it will consume 100 % of one cpu and electricity but will not interfere with any real work really.
or...
just as easy
 
Hi
 
8:48 AM
to sleep in the process
 
One question. I often see test functions inside of huge code files. How do you use this test cases?
 
test functions
 
they start with def test_xxxx
 
nice process only sets priority but not the the usage?
 
not usage
 
8:50 AM
ugh crud
 
?
 
@vinwin there is usually no point in setting usage
@kame you have separate tests files?
 
Is there a module where I can all my python files?
yes
 
@AnttiHaapala yes
 
8:51 AM
you run these with a test harness program, possibly with tox, py.test, unittests, nosetests or so
often though the project itself has a configuration for just one of these
unittests is in Python 3 core
 
@PM2Ring why are you posting those links here? Any significance?
 
@vinwin room rules
 
@vinwin sopython.com/pages/chatroom linked under heading cv-pls
 
Oh people with more than 3000 rep can do that. So, basically not for me.
 
8:55 AM
@vinwin you can send cv pls...
 
@AnttiHaapala So no way to do it? Keep running a particular process at certain % (not 100) all the time?
 
to the room
 
@vinwin If you see questions that really need to be closed you can certainly link them here with a [tag:cv-pls] and those with the power to vote on them will consider your suggestion.
 
vinwin: you can run a command until 50 miliseconds have passed (use time.time); then sleep for 950 milliseconds, say
@vinwin like that question above.
if you read it, how can it help anyone else?
if they google for syntax errors, they wouldn't find that one...
 
Hmm
 
8:58 AM
@vinwin actaully it is a dupe
@PM2Ring
2
Q: Invalid character in identifier

user2052898I am working on the letter distribution problem from HP code wars 2012. I keep getting an error message that says invalid character in identifier. What does this mean and how can it be fixed. here is the page with the information. hpcodewars.org/past/cw15/problems/2012ProblemsFinalForPrinting.pdf...

I guess we should make a canonical question for that
 
@AnttiHaapala Ah. I didn't bother looking for a dupe. Actually, (IIRC) the consensus is that typos should be closed as typos so they can be Roomba'd, not dupe-hammered.
But I'll link to that Q with a comment.
rbrb (dinner time)
 
user6568562
9:21 AM
@PM2Ring Hey [ :
 
user6568562
Cbg everyone [ :
 
9:33 AM
Hi, random.
 
 
3 hours later…
12:20 PM
this is fun
simpsons data stats. And code available on GH
cbg
 
user6568562
Hey idjaw [ :
 
hey
 
user6568562
That's really impressive (both the article and the whole website)
 
user6568562
12:40 PM
 
user6568562
This is brilliancy : D
 
those are nand gates right?
trying to remember by digital circuits, it's been a while
that's really funny
 
user6568562
Yeah ! It's from this article : toddwschneider.com/posts/…
 
oh neat. I actually didn't go to other articles. That's awesome
 
re-cbg
 
12:46 PM
hey @PM2Ring
 
@idjaw Yep. They're NAND gates. And a NAND gate with its inputs merged is just an inverter, i.e,. NAND(x, x) == NOT(x)
 
yep. Takes me way back. :)
 
user6568562
@PM2Ring Weekend friendly material Slide away from Sitting here in silence performance
 
Had to review my truth table knowledge
0 0 1
0 1 1
1 0 1
1 1 0
that was it right?
makes sense
 
Correct
 
12:50 PM
this takes me back to the few courses I liked in University...VLSI, VHDL and digital circuits
oh and computer architecture....but the professor wasn't enjoyable. The material was good
it would be incredible if that title was deliberate: stackoverflow.com/questions/40059251/…
but I'm sure it wasn't
 
When I was first learning computer stuff it was pretty standard to learn about low-level topics like logic gates. I spent many hours as a kid drawing adder circuits, etc. :) In the early 90s I got back into it, making simple circuits with CMOS chips; I still have all that stuff, packed away.
 
^^ I've always wanted to buy myself a kit, but never got around to it.
 
Mar 9 at 17:48, by PM 2Ring
I keep gettign snytax errers in my Pyhton progrmas and I don't know why.
 
I'm going to keep my dream alive by thinking OP was doing this all on purpose
 
user6568562
1:05 PM
My future user prompts will only be Y/N questions to be filled with 1/0 answers
 
@idjaw In more recent years I've had great fun building logic / arithmetic circuits in Conway's Game of Life. You can use a periodic stream of gliders to represent a stream of bits, with a glider representing a 1 bit and a gap in the stream representing a 0.
If you position 2 streams so that their gliders destroy each other when they collide, you get a pair of logic functions. Call the two streams A and B. On the other side of the collision zone, the A stream is now (A & ~B) and the B stream is now (B & ~A), where ~ is NOT.
 
user6568562
It will be rather complicated for name and city information requests, among others. I'll resort to alphabetical order, I'm sure some library is available for that. Is your name Abigail ? Yes enter 1, No enter 0
 
user6568562
Downside, user experience will be a bit slow. Upside, it will diagnose short attention span issues.
 
:)
It only takes 5 binary questions to determine a letter, since 26 < 2**5. And 6 bits is enough to encode upper & lower case, digits, a space, and one more character (which could be a control character allowing you to map special symbols). Still, I'd hate to enter complicated data through such an interface.
 
user6568562
Haha : D ! Your solution to determine by letter is brilliant
 
1:28 PM
@randomhopeful Not really, it's just a simple binary search. It could be made nicer by doing what phones do: use a smaller space of input symbols (the phone buttons) and use a dictionary to map button presses to probable words, allowing the user to intervene in case the dictionary lookup guesses the wrong word.
 
user6568562
@PM2Ring I see ! It is impressive and brilliant to me. Also this mapping good stuff seems to come in handy in almost everything
 
user6568562
Laters everybody [ :
 
@randomhopeful You should take a look at the Bloom filter. In retrospect, it's a fairly simple idea, but nobody thought of doing it before Bloom did in 1970.
 
@PM2Ring you're pushing my motivation forward
 
1:44 PM
I guess that's a good thing. :)
 
Definitely. :)
 
 
1 hour later…
3:00 PM
re-cbg.
:)
 
user559633
3:16 PM
stackoverflow.com/questions/40060655/… too broad/library request/whatever reason really
 
whaddup tristan
 
user559633
nothin'. writing javascript. had a "hehehe" at the idea of twitter being "one of the top revenue generating internet companies of the world"
 
haha
scroll up a bit for a funny chart about twitter
made with NAND gates
 
user559633
yeah, that's the thing that made me "hehehe"
 
heheh
 
user559633
3:19 PM
even if we're talking revenue (because you can't talk profit for them ;)), i still doubt it
 
user559633
what's up with you?
 
nothing much. Came back from the kid's swimming class. They are off playing with cousins. Having a quiet morning.
 
user559633
I think their current corporate strategy is "amplify the right egomaniacs and silence the right ideas and hopefully someone will buy us out"
 
hey, hey...remember that company Yahoo that kept saying no to being bought out? And now no one wants them?
I wonder if that will happen to tweeter
 
user559633
no, tw*tter has the opposite issue - they want to say yes to being bought out, but no one wants them
 
3:24 PM
yes
 
user559633
i imagine they'll go the myspace way
 
haha..."hey guys..remember when we were cool? Wanna find us cool again? no? oh...ok"
 
user559633
oh you guys are going to...go somewhere else..okay.
 
user559633
remember when yahoo bought tumblr for a billion dollars?
 
ha..yeah...oh boy.
I haven't checked the financials on that whole outcome in a while
let's see what's happening
 
user559633
3:30 PM
yahoo! is about to sell off most of its core to verizon for <$5bb
 
Haven't updated myself in a while about Yahoo it seems, because I didn't know Verizon was interested at all.
 
user559633
yahoo wanted tumblr because it was having a lack-of-users problem, but they seemingly didn't fully realize how worthless a neu-Xanga/livejournal would be for business
 
user559633
based on the language and meaningfully stating "material" change from a GC. wow
 
stories.avvo.com/technology/… just for the last line in that article:
> If all goes well, Yahoo will attract the younger demographic they’re after with the purchase of Tumblr. CFO Ken Goldman is optimistic that Yahoo will see good results from the acquisition as early as 2014
 
user559633
I wonder if they have a relatively high break fee ($ paid if buying party walks away without material reason or malconduct) that they're trying to get out of
 
user559633
3:38 PM
oh.lol. article states that too "Analysts say that could trigger an escape clause in the agreement to allow the telecom company to back out of the deal."
 
smart lawyers are smart
 
user559633
I don't understand the motivation in these deals. For $1.1bb, you could start a dozen well-funded tech companies all in the "microblogging/micro-offense/buffet for attention-hungry" space
 
grumble grumble answered two minutes before someone and provide an explanation and they get the upvote giving the same answer I gave.. </whining_like_a_baby>
 
user559633
Similar with Verizon and Yahoo. $5bb for what's come to be known as a fading joke
 
I don't even have a smart ass answer for what you just said, because it boggles my mind too
There seriously is so much more that can be done with that money that will benefit your company than to just buy something that is really going nowhere.
 
user559633
3:42 PM
Hopefully I can put my money where my mouth is on this setup some day.
 
user559633
$1.1bb for a livejournal clone...$5bb for a company with the tagline "News, email and search are just the beginning. Discover more every day. Find your yodel."
 
user559633
just realized that I had to Google for Yahoo
 
If it weren't for my short stint with fantasy hockey leagues, my Yahoo usage would have been close to zero.
excluding the random links that take me tumblr
 
user559633
sure, yeah, tumblr is decently reliable for hotlinking directly to gifs
 
user559633
anyway. what do you have planned for today?
 
3:50 PM
@idjaw such as Stack Overflow? *drive-by insight*
(be back later though)
 
user559633
StackOverflow acquired something?
 
no, I just meant that huge investment thingy you told me about
*actual insight not guaranteed
 
user559633
Oh. I think they're just trying to play house with business-ey sounding ideas (what's related to our core competency that sounds like it could be b2b/profitable)
 
DSM
Waiting-for-phone-to-charge cabbage.
 
user559633
3:56 PM
3 hours of sleep after a night of drinking writing javascript cabbage to you
 
here you go @wim. Because you hate lambda's so much, thought I'd share this: stackoverflow.com/questions/40061106/…
 
DSM
@idjaw: I'm too lazy to write it up myself, but I think the code's original author was taking advantage of the binding of the default argument, so that he could assemble a collection of functions which print the various keys.
Probably just for pedagogical reasons.
 
@DSM that does make sense. It just seemed like an odd little piece of code without adding that type of context to it :)
 
Hello Everyone,
Can anyone assist me in this?
what is the meaning of this code?
mean = np.mean(data_train, axis=(0,2,3))
specifically the axis part. the image is from this dataset here (https://www.cs.toronto.edu/~kriz/cifar.html , 32x32 color images).
hence there should be 0,1,2 right? what is the meaning of such axis?
apart from that, what is the non-vectorized version of that command?
and my second question :
what is the meaning of this snippet of code here :
`for i in range(3):
print i
data_train[:, i, :, :] = data_train[:, i, :, :] - mean[i]
 
: is slicing syntax
i is the index in the loop
 
4:11 PM
grr...I'm drawing a complete blank. I want to analyze what is happening in a small piece of code...it's not pdb trace, it's something else and the name (and my google-fu is failing) is just not coming to me. It pretty much breaks down what is happening at a lower level.
mcve fail...
 
DSM
data_train is a multidimensional object with four dimensions. Looks like it's image number, colour channel, x, and y. mean(...axis=(0,2,3)) will average over all images and all locations to give the net mean colour.
 
so i would denote the color channel right? if so? what other other dimensions? there should be two should it not?
I'm completely lost in these weird array manipulation!!
 
DSM
@idjaw: low-level? Do you mean dis?
 
@DSM Yes!!! Thank you...I just could not get the name for the life of me...
thanks
 
that's the worst :P
 
4:14 PM
Thanks, it makes sense, but what is the meaning of 0,2 and 3?
does zero mean all images , 2 means x, and 3 means y? as you mentioned before?
 
DSM
0, 2, and 3 are the numbers of the axes. I'm just guessing about the assignments, but since it's 50000 x 3 x 28 x 28 it's a reasonable one. 0 doesn't mean all images, it's the axis which gives the image numbers. The first image would be in data_train[0]. The second in data_train[1], and so on. You should probably work through the numpy tutorial, this isn't a good forum for basic tutorials.
 
@DSM Thank you very much . I really appreciate it ;)
 
Cabbage
 
4:36 PM
Cbg
 
o/
 
4:48 PM
Well, what I was doing was not helpful for what I was looking to see, then I found this by Mr. Pieters. stackoverflow.com/a/28156733/1832539
Thanks @MartijnPieters :P
 
DSM
Looks like it might have been fixed in 3.5.
 
I love how the load times for my router page are like 100x longer than anywhere else
it's literally in the next room, and it takes several seconds-minutes to load pages
because apparently it's stupid.
 
@DSM My curiosity was about the order of evaluation. There was a question being asked earlier today and the dictionary was invalid, but I was curious to know how a dictionary literal handled duplicate keys being defined in a dictionary
and it lead me to all that
ugh...it's right there in the documentation...
slap
for some reason I thought a dictionary literal might behave differently
 
5:06 PM
@idjaw :-)
 
haha this will probably never happen again. The old days of SO
wow and the answer after that answered four years later accumulated 28 upvotes
 
can we delete that?:D
people upvote the worst shit
 
did you just downvote that?
 
haha
 
5:18 PM
<people. what a bunch of bastards.gif>
don't forget that I'm also people
 
@WayneWerner wow, python in the votey!
although python 2
 
Well, that is Python2 for you ;)
 
There we have the last piece of code Antti wrote before quitting his job and swearing to never use Python 2 again.
awww...it's just not the same when he's not here to read that :( .... @AnttiHaapala piiinged ^^
 
just ping him:P
 
5:21 PM
yeah I guess ... done :P
 
mmmm,I have chips and salsa available for lunch
 
user6568562
 
user6568562
Now it's Antti friendly
 
chips and salsa rhubarb. And now I'm wondering if there is a way to make delicious rhubarb salsa.
 
user6568562
@WayneWerner Cheese dip siding that salsa : P
 
5:32 PM
cbg
@AndrasDeak please remove that abomination
oh wait, I'll do it myself
thanks :D
 
user6568562
Hey come on ! We made one only for you
 
what which one?
lalalallallllalllallalaaa
 
@AnttiHaapala lol:D
 
user6568562
@WayneWerner Ouh ! Or guacamole. Worth every blocked artery and this double ping
 
@AnttiHaapala my nipples explode with delight!
 
5:35 PM
I still didn't find a good trappist glass, so I need to choose between a red wine glass and a margarita glass.
 
user6568562
That's a sign of delight, alright
 
hahahah yaaaay welcome @AnttiHaapala :)
 
Anggri Haapala is here
 
user6568562
@AnttiHaapala All you need is a brain responsive to alcohol. That being checked, you don't have to choose your graal wisely
 
If I delete my answer and no more answers are in the question, can OP delete their question?
 
5:38 PM
yup
 
oh wait. They can delete as long as I don't have an upvote right?
 
but yours has to be unaccepted
 
right
 
@idjaw was there upvote limit?
 
@idjaw yup
asker can self-delete if there are no accepted or >0 score answers; answerer can self-delete if it's not accepted
 
5:39 PM
I just suggested they deleted it
 
and if asker self-deletes after getting answers, they get a paddlin'
 
they created their list incorrectly and realized that they just needed to change how it was structured.
 
so don't suggest deleting a Q where you have an A
always delete first
 
oh ok. so I dlete my answer first
 
otherwise you'll polite the asker into a question ban:P
 
5:40 PM
then ask them to delete q
oh ok
 
hopefully deleted answers don't count
 
ergh
someone else just answered
 
DSM
has 28 questions associated with it. :-/
 
almost as good as scrapping
> MA! Ping my computer please!
 
DSM
M! Aping [the CIA isn't going to work. We need our own plans!]
 
5:54 PM
@DSM can I change all those to mapping?
for the greater good?
 
only if you clean up those questions, and don't bump crap
 
good point
too much work for a lazy Saturday
 
DSM
The reason I didn't go fix them is that Meta custom seems to be "don't just fix one thing in bulk".. I don't happen to agree with that policy, but it seems to be the one in place.
 
....and so that is how the maping tag grew to its own thing. No one wanted to deal with it, and it just mutated.
 
@DSM I'd say it can be fine for 28 questions
the real reason is that brainless edits bump crap to the front page
 
user6568562
5:56 PM
@idjaw Survival of the undesired
 
it's better to close/delete the crap and edit the rest
actually, we should just synonymize maping with mapping
anybody got the rep?
 
DSM
Synonymize a typo? Do they really do that?
 
Machiavelli approves:P
I don't know, probably not
I guess we could flag for a merger by mod
we should ask on meta, but the result would be "meh, Joe already edited them"
 
that's actually a better idea
I think a lot of the typos that come up for mapping and maping are probably non-english speakers
but...that is then promoting the incorrect usage of a word that doesn't exist :P
DILEMMA!!!
 
00:00 - 18:0018:00 - 00:00

« first day (2191 days earlier)      last day (2758 days later) »