« first day (1587 days earlier)      last day (3374 days later) » 

user559633
7:01 PM
i'd un-ironically love to have the ability to remap notation. e.g.:

let('.','♡')
from models♡users import User

user = User♡query...
 
user559633
~~so whimsical~~
 
10 rep more
 
@Ffisegydd @davidism I've moved my email commercial stuff to another domain, so I'm going to set up an email server on sopython.com
 
tnhe I can go watch film
 
I'll downvote .... Then you'll stop at 199 (evil thought)
 
7:03 PM
Writing code that changes how the code is parsed is some deep magic
But somehow I expect that Lisp has had that capability for 30 years.
 
user559633
Does lisp support that?
 
@Jon awesome mate. That'll be free, yes? No Google worries?
 
user559633
I will immediately quit all other languages and start coding exclusively in lisp if I can hotpatch dot with ascii heart
 
@Ffisegydd yup - that'll be free, and we have as many groups/emails as we want
 
Having never written any lisp code, I just assumed that was what "macros" were
 
7:04 PM
I actually let the Google subscription lapse, so chatroom@ etc... won't work anymore
 
@Jon okay cool.
 
and since I'm waiting for an ETL to finish, and something to compile (insert suitable XKCD here)...
 
@JonClements Sorry to interfere Will the email server be restricted to only room owners?
 
cbg
 
cbg
 
7:08 PM
cbg
 
@BhargavRao it'll be at the discretion of the server admins who gets an email addy...
 
I love looking at code after a workout, it all looks so pretty and senseless
 
@JonClements Thanks, hopefully everyone will get a mail ID :D Thanks again
 
@JonClements what are you guys hosting the server on?
Some cloud servers like DigitalOcean?
 
@Vader linode
 
7:12 PM
I see
 
user559633
Break 3 [5]> (defmacro ♡  () (+ 1 1))
♡
Break 3 [5]> (♡)
2
 
user559633
welp, i'll see you guys later, because this is awesome
 
eheheee
@tristan wouldnt it be cool to have macros on python?
 
But does it let you do a♡b instead of a.b? Actually, I'm not sure if lisp has a dot operator in the first place.
 
ofc not, all ops are in the initial position of the s-expr
 
7:15 PM
So, what, it's like dot(a)(b)?
 
sex-pr
no, it would be (. a b)
 
You guys ever watch coding livestreams? They never seem to hold my interest and I'm wondering if that's a typical reaction.
 
I have seen one for coding a video game, it was boring
 
@Kevin, it's watching someone else work. I do enough of that at $client
 
7:17 PM
like someone is coding live something without manuscript?
if there's screenplay it's cool
 
screenplay?
 
244 today
epic here we come
 
I'm guessing in this context, "screenplay" means "a predetermined plan of what in particular the person is going to code"
That does sound like a better idea than firing up Twitch and opening a blank Notepad window
 
it is like "at this minute there is a sudden plot twist" :D
 
user559633
@AnttiHaapala yeah, having macros in python would be cool. i think i'm going to learn some lisp
 
7:19 PM
First twenty minutes is micro-optimizations on their sorting method, then 100 minutes of murder mystery.
 
learning lisp is always helpful or learning scheme :D
 
even a gentle intro lisp warped my brain a little, but I liked it
s/intro/intro to/
 
user559633
I don't know what book I'll use to learn lisp
 
@tristan learn scheme and read the little schemer
 
@tristan try Learn Lisp The Hard Way. It's great. You make role playing games.
 
7:22 PM
so what chess name did you pick?
 
can get it for free somewhere
 
google? :P
 
user559633
what I unironically love about this room: when we're in "normal" mode, the common response to questions is a flavor of "do either! do anything! everything is interesting!"
 
aha here is :D
 
user559633
7:23 PM
I don't know anything about lisp...why scheme over common lisp?
 
meh lisp annoys me ...
(mapcan ( a-list ))
 
@AdamSmith just wanted to let you know, that I am still working on it.
 
@tristan scheme is the common lisp "simplified"
it will teach you lambda wizardry beyond nothing else
@tristan in scheme the let that is used to make new variables, can be a macro that does a lambda...
 
are twisted's threads "different" from regular python threads?
 
I bet they are
 
7:31 PM
hrm
 
hem twisted does not really use threads but the async hackery
 
but I do not understand at all, the example there is as if it was perfect match for multiprocessng
 
twisted's threadpool.py just imports threading
 
7:33 PM
Ok, maybe they aren't different then :-)
 
:)
 
anw rbrb
enough rep for today
soon 20k and then there are no objectives anymore.
except mjölnir in .
@Ffisegydd we should have a competition towards the golden hammer
I see you're ahead of me by 7 votes
 
cbg everyone
 
cbg
 
These question are CVed as dupes of each other, how does that even work?
111
Q: How to get full path of current file's directory in Python?

ShubhamI want to get the current file's directory path. I tried: >>> os.path.abspath(__file__) 'C:\\python27\\test.py' But how can I retrieve the directory's path? For example: 'C:\\python27\\'

 
7:45 PM
I guess it's ok to have cyclic votes in this manner, as long as neither one is actually closed
If one did get closed as a dupe of the other, I expect the open one would not accept the other as a close target
 
I see, these are only someone attempting to CV it
 
It looks like you want us to write some code for you. While many users are willing to produce code for a coder in distress, they usually only help when the poster has already tried to solve the problem on their own. A good way to demonstrate this effort is to include the code you've written so far, example input (if there is any), the expected output, and the output you actually get (console output, stack traces, compiler errors - whatever is applicable). The more detail you provide, the more answers you are likely to receive. — Martijn Pieters 57 mins ago
@Martijn OP has now supplied code – was it your close vote?
Incidentally, if there are twenty people here who fancy getting me the reversal badge, I won't complain ;-)
 
vhttp://meta.stackexchange.com/questions/232442/merged-question-is-closed-as-a-d‌​uplicate-of-itself
 
Noooo, don't upvote the question! It needs to stay at -5 :-(
is not seriously trolling for upvotes. Well, not very seriously ;-)
 
@Zero I gave the question another DV and your answer a UV. Good luck with that badge thing :)
 
DSM
7:57 PM
Aaargh -- so apparently after an all-nighter, I'm supposed to show up at a meeting tomorrow off-site at 9 AM before all sorts of high muckety-mucks, even though no one bothered to mention this to me before and I'm not on the official invite list. This is going to turn out to have been a very unhappy 48-hour period. :-/
 
It will all be over soon.
 
why oh why
@ZeroPiraeus I am annoyed at how inconsistent and stupid python stdlib actually is
 
Consider turning up 45 minutes late, bursting through the door and exclaiming "Pray God I am not too soon!" It would
1. Serve them right, and
2. Be really, really, cool.
 
I wanted to write a cool oneliner for that question
 
DSM
Yeah, but that line needs a good followup, and I'm not sure I have one. #gotthatreference
 
8:00 PM
but can't because collections.Counter would a) read a dictionary, b) read keys
*in update,
 
I got that reference... After googling it
 
Also possibly
3. Get you fired ... you have to weight the costs and benefits there.
 
but it wouldn't accept key-value pairs in an iterable
 
Somehow I don't find Dirk Gently memorable, even after reading the book twice.
The primary reason I read it the second time is because I forgot that I had already read it.
 
@AnttiHaapala Nice! Good that OP now has a "how to do basic debugging" answer and a "how to do it properly" one. Not that they really deserve it, but still :-)
 
8:03 PM
@Joran errr: from itertools import filter ?
 
oops
im an idiot
 
I can give 1 anon downvote if you're worried about it :D
@ZeroPiraeus I'd still doubt it will turn out to be reversal for either, I only have 1 answer ever over +20
omg 2 even :D
 
@JonClements Fixed I think ... :P
(I know in modern python filter is iter anyway but meh
 
Oh, me too, and tbh I'm sure neither of us would choose those particular answers for the honour, given a free choice. One can dream, though ...
 
user559633
@DSM yeah, that's pretty unfair that the muckety-mucks get to be high and they didn't even offer the option to you
 
8:08 PM
+1
 
Besides, what's wrong with somthing like:
r = list(range(10))

d = {}
for i in r:
    d[i % 2] = d.get(i % 2, 0) + i

odd, even = d.get(0, 0), d.get(1, 0)
@Joran much easier than the elaborate partitioning recipe
 
yeah no doubt ... but meh
 
In fact... even change that to:
d = dict.fromkeys([0, 1], 0)
for i in r: d[i % 2] += i
 
I kind of wanted to give an overly complicated answer to a simple question :P
but yeAH that is much better :P
ok I stole that and added it
I wish i would have done that to start with
thats cryptic enough to satisfy my mean alter ego ... while still providing a solution :P
 
Could at least spell my name correctly :)
 
8:21 PM
oh yeah :P
 
else I'll have to start calling you Jhoran or something ;)
 
hehe :P
-2
Q: Python 2.7.9 Environment - Reads comments as multiple lines - How to stop?

SuirouNoJutsuThis is a simple quality of life question that's driving me crazy. I tend to write code in Notepad++, then copy/paste over into the python.exe when its time to run part/all of it. The Python on my old machine had no problem with comments. I could do things like #The next line adds 2 numbers! ...

makes me sad
@JonClements I defined r to head of any confusion early :P
 
@ZeroPiraeus nope, I was staying execution a little.
 
@Zero ahh... nice sneaky edit to add link there :p
 
8:29 PM
@Martijn cool / @Jon :-D
 
Feel obliged to upvote Joran now... can hardly suggest something I'd have answered with and then not upvote :)
 
Oh yeah, also forgot that
 
meh you dont need to :P its your answer really ... :P
 
@Joran too late - I'm sure you can live with it
 
lol
I hate getting messages that user was removed and I lose my upvote ... im always curious what the question and answer was (not that its relevant... just Id like to know :P)
 
8:32 PM
@Joran ahh... do what I do... just don't answer so many questions and then it's less likely to happen :)
Ahh... forgot "Death In Paradise" was on... rbrb for a bit... one of the few shows a week that warrant paying the bloody TV licence
 
uh oh now i should make it i&1 :P
I feel that way about ridiculousness :P
 
does your evil streak know no bounds? :p
 
I hate dealing with broken code when I'm not allowed to fix it
trying to use a Joomla module that allows SQL injection for a client of mine
 
are you sure its broken?
o
y cant you change it?
 
I'm leveraging the SQL injection to give the client the feature they want, but...
 
8:38 PM
solution ... dump php ... get python
 
because it's a small module as part of a larger package and I'm not going to test and re-implement it correctly :)
it basically creates a query from a back-end field that looks like
SELECT [column] FROM [table] WHERE tbl.id IN (<<field text>>);
client wants to be able to blacklist instead of whitelist IDs
so my field text is:
1,2,3,4,5,6,7,8,...for some arbitrary large set...) AND tbl.id NOT IN (<<blacklist>>
is there some way to wildcard the preceding whitelist? WHERE tbl.id in (%) or etc?
 
why not just write a new query again?
where tbl.id in (SELECT id FROM table)
I guess
 
oh that's not a bad idea...
 
but your gonna have some slow queries i think
 
eventually maybe. That table only has 3 records right now
 
8:43 PM
whynot just write a new sqlquery directly?
 
Because it's inside a Joomla module that's already built and paid for (to someone other than me)
 
but its just php ...
 
and they're not going to pay me to make it work the way it should, just the way they want it to.
 
its pretty easy to change IN -> NOT IN
 
I don't think I have access to the source of the module, and if I do I don't know how to get there lol
 
8:44 PM
way easier than some hacky sql injection
is it like minified or whatever?
o you dont know
.... its gonna be in something like
joomla-root/plugins
 
I don't have access to the fileserver, I just have access to the site's admin console
but I could probably request it
 
hmmm i guess you could just write that field thing
the injection
seems wrong though
and dirty
 
And I quote: "I hate dealing with broken code when I'm not allowed to fix it"
Yeah the ...tbl.id IN (SELECT id FROM table) AND tbl.id NOT IN (<<blacklist>>); works
thanks
 
no problem
 
9:02 PM
^^ too lazy to even google the HW solution
 
user559633
Is it midterms already?
 
It does feel like I've seen an awful lot of no-effort homework questions today.
 
Good thing that this says "[read full]" in the title, or else I wouldn't have read the full thing!
Pretty smart move by the OP there. Totally prevents those pesky downvote-without-reading-ers.
 
Why is my error not being caught even though I explicitly catch it?
 
"During handling of the above exception, another exception occurred"
some code inside the except is crashing.
 
9:17 PM
Okay
Thanks
 
yup keep reading :)
 
Lovely, more errors
So the bottom most error trace is that the last trace to the problem?
 
I'm going with "yes", although I generally don't see multiple tracebacks of this nature very often
 
This is the first time for me.
I see the problem
I am iterating over a dir of files
I find files and rename them
problem if that I also rename the renamed files
which doesn't work
I need to create the new files in a new directory
or I could at program start store the list of files to iterate over
 
Both good approaches.
 
9:25 PM
I think the second is better though
Nvm that is not the problem
:(
the list is created only once anyway when I start the for loop
No, worries I will find the bug
 
I have this regular expression \w+(\.?\w+)* which is working in JAVA but not in Python. This basically splits a sentence into tokens ignoring special characters. I have tested this here. fiddle.re/v6y8q
What is wrong here?
 
9:50 PM
@Kevin omg
You will not believe what the problem was
I forgot a single break statement
After it renamed the file it tried to rename it again
 
cbg all
 
cbg
 
would I be correct in understanding that blender creates 3d images?
 
@inspectorG4dget Well 2d images of a 3d world
 
9:54 PM
@inspectorG4dget well, blender is a 3d modelling/etc... environment
 
heya Jon
 
Although I believe it can also do stereoscopy now
 
that's what I was hoping for. Can I therefore create something in blender and send it off to a 3d printer?
 
@inspectorG4dget all well in the world of go go gadget?
 
Yessir
This is tool to check if you object can exist in the real world, e.g is it water proof
 
9:55 PM
@AnimeshPandey Try with a non-capturing group: \w+(?:\.?\w+)*
 
@JonClements Kinda. We're planning a trip to Chicago, to take mom to the Rehab Institute of Chicago (RIC), which is supposed to be a world leader in stroke rehab. They have a one-month aphasia program that Mom is keen on
 
@inspectorG4dget well, if she's in a position to be keen on something - that's most certainly good?
 
@AnimeshPandey Actually the ? is pointless: \w+(?:\.\w+)*
 
@JonClements absolutely. We're working on applications, finding housing, etc. Still very sad that this has befallen her, though
 
DSM
Don't have time to hang -- !@$!@$ unexpected meeting to prepare for -- but many cabbages for @inspectorG4dget.
 
9:57 PM
thanks @DSM. See you around
alright, time to eliminate XY problems. This is why I ask about blender: We (my family) have to make a splint for mom's partially paralyzed right arm
 
@inspectorG4dget you'll be fine mate... things have a way of working themselves out in the end
 
DSM
And rhubarb for everyone else!
 
decent splints are not available for purchase here, because it's friggin India
 
@inspectorG4dget can you get one done while in Chicago?
 
Pro splint makers have let us down, here
@JonClements we most likely will be able to. But Chicago is ~6 weeks away, and we need the splint about 3 weeks ago
So we're trying to 3d print a splint
 
9:59 PM
Like this one?
 

« first day (1587 days earlier)      last day (3374 days later) »