« first day (1717 days earlier)      last day (3225 days later) » 

user774340
4:06 PM
think silicon valley did that joke already, with the car getting confused over the day, as they built arallon on the international date line
 
user774340
I wonder how many years it will be before "drone wins lawsuit ... "
 
cbg @Benjamin
 
cbg, what's up?
 
SSDD... how's your stuff going?
 
4:15 PM
@gecko Since drones are property and property can be sued accused?, (see civil foreiture) it could happen any day now...
 
@JonClements working hard, have a test tomorrow, io.js small docs pr, paper to finish writing, lots of smaller stuff.
 
user774340
If there is ever a robot revolution, both sides will hate programmers.
 
@Benjamin still keeping yourself busy then :)
 
user559633
"Legal experts say that shooting down a drone with a gun should technically be a federal felony offense...which carries a maximum sentence of 20 years in prison." good god.
 
4:20 PM
@JonClements without interfering, what would you close stackoverflow.com/questions/31120083/… as?
 
user774340
is that aviation law?
 
No "too specific" reason I'm aware of.
 
user774340
i am guessing they are classed as aircraft and that is where that law comes from
 
user559633
Reading the rest of that link though, I think paying just for the damage on the drone was letting the defendant off easy.
 
user559633
The plaintiff's house has been hit by bullets three times.
 
4:22 PM
There's more information in the reddit thread the guy posted when it happened: np.reddit.com/r/legaladvice/comments/38sxp1/…
 
@Benjamin well, the Q is unclear (not quite sure what they're trying to state) - the answer doesn't help clarify, and the other attempted answer is warranting comments about additional info... closest is unclear
 
user559633
"No criminal charges came of the police report we filed, but that's fine." I would keep down this path and figure out who the neighbor is friends with in the police department.
 
@JonClements thanks, that's what I'll do.
 
Wild guess: the neighbor was using ammunition powerful enough to destroy a drone but not a person.
At least one of the prior incidents was with "pellets" used for skeet shooting rather than proper bullets, so perhaps that's why the cops aren't terribly interested.
 
From reading the reddit threads, it seems that even pellet guns might be illegal in this situation.
 
4:32 PM
"Just some good old boys shooting each other with BB guns", they hypothetically think
 
Birdshot might be the size of BB's, but it's using a minor explosion to propel the projectiles, not compressed air.
 
How do I convert a Vector object in sympy into a function?
 
What kind of function?
Like, a mathy function? f(x) = mx + b?
 
For example i have (-R_y - 1)*R.z which is a vector object, and i need to convert it dynamically to a function which i can plot.
yeah
 
hmmm... sympy looks cool
 
4:37 PM
I'm assuming a "Vector" is just an object that has x and y attributes and nothing else, in which case
def make_into_function(vec):
    slope = vec.y / vec.x
    #or, if this is Python 2.7 and both attributes are ints
    slope = float(vec.y) / vec.x
    def f(x):
        return x * slope
    return f
 
and it comes in anaconda!
 
this raises an exception when x = 0, since a perfectly vertical line can't be a function
 
cbg all
 
heya @shuttle87 - how goes it?
 
going well, back on some Python code at work now which is awesome
 
4:48 PM
Check out this: Python integrates
 
just looking at someone's Python 3 code, I see some stuff like class abc(): and I want to change this to class abc:which is preferred/more readable?
 
cabbage, everybody
 
user774340
why would he put empty parens?
 
@shuttle87 I didn't even know class abc(): was valid syntax. Defineitely don't do it.
 
4:52 PM
Ok, I figured that was the case and hence why I didn't like the look of it. I might have to make an edit to my companies coding standards document.
FWIW it appears to work ok with the Python 3.4 we have set up here, but that doesn't make me feel good about it.
 
In the new python you can exclude inheriting from Object, correct?
 
I think it's a matter of style, like exceptions with no arguments (message) get instantiated. You can explicitly add parens, but it doesn't add anything to the code. People might differ, I'd come down on not using them if I were writing a style guide that addressed the issue, but I would never reject that code.
 
@GarrettKadillak yes, everything is a "new-style", inherit from object, class in py3
 
I don't see any guidelines in PEP 8, so there's no "official" stance, but looking at the tutorial, I see they use class abc:
 
user774340
corect, in python you just do "class foo:" or "class foo(bar)" to inherit.
 
user774340
4:55 PM
s/python/python3
 
You don't exclude it, you just get it implicitly, if that's what you're asking, @GarrettKadillak
 
makes sense, @AaronHall
 
user774340
i think python 2 has the new object model as well?
 
Thanks.
 
Python has both new and old style classes if that's what you mean
 
4:57 PM
cbg @Zero
 
cbg @Jon :-)
 
@AaronHall I guess the main reason I brought it up here was that I wasn't entirely sure that it was fine. Definitely a minor point though and not something that I'd reject code over.
 
it's a good idea to adhere to a standard so that there isn't any confusion
 
user774340
I do not like the idea of empty parens after a class name. It makes me wonder why they did it, and whether I can trust some other parts of the code.
 
If people would just learn to parse Python in their heads they wouldn't be confused.
 
5:00 PM
Think I'd just chalk it up to not being extremely experienced with Python
@AaronHall maybe I should go suggest that to the new developers :P
 
Some of the best advice I've seen about commenting code is to assume that a reader knows the language better than you do, but isn't familiar with the context. Then the Extreme Programming school says to use such good names that you don't need comments. But we also know that naming is one of the two hardest problems in programming.
 
what's the other, @aaronhall?
 
Cache invalidation and off-by-one errors.
You set me up. :D
 
user774340
I agree. I comment to explain -why- I did something, not what it does (unless that's not obvious).
 
so I did :p
 
5:06 PM
I usually keep "deep magic" like multiply nested list comps out of my code, unless I have a really clear and descriptive name to go with it.
If the maintainer sees def get_all_fuzzled_widgets() followed by some dense algorithm, they don't necessarily need to understand the function in order to use it.
They just need to know what "widgets" are and what "fuzzled" means
 
Did you guys see that sympy link I posted? Isn't that the coolest stuff you've ever seen? I'm super excited about it.
 
I clicked the link but nothing interesting happened. I blame Firefox.
 
It didn't work? I just tried it in an anonymous firefox, it worked for me.
:(
 
Definitely cool stuff! I remember looking at sympy a few years ago but the project wasn't quite as mature at the time.
 
Sympy is amazing these days
 
5:12 PM
Or maybe they just didn't have the demo's working so well? I remember being excited about it a while back, but I couldn't get anything out of it (although only looking out of passing interest, I didn't try very hard).
 
OK, definitely got some topics to cover in the "birds of a feather" gathering at PyGotham...
 
There we go, it's doing a thing in Chrome
 
@davidism That's a "let's see if we can get five different (valid) close reasons" Q if ever I saw one :-)
 
It was probably just NoScript being over-paranoid
 
5:19 PM
@ZeroPiraeus we are at 3/5 now
 
@ZeroPiraeus this is the same user who posted the earlier "how do I use variables in Flask" question that I was complaining about. Rather than getting closed, it got two upvotes. :(
 
some people's kids...
 
I always find it unsettling hearing people make comments about security like that
in particular this "authentication isnt something im worried about. this only works over a local network anyway and all 3g provides disable any incoming http requests as standard." is somewhat scary
 
@GarrettKadillak some people skids: duckduckgo.com/?q=skis&t=canonical&iax=1&ia=images
 
those are some nice skis, @davidism
 
5:25 PM
I was on the fence about the flask variables Q, and eventually did nothing. On re-reading, I can't see a close reason I'm happy with, but have downvoted.
 
please, skis is such an overused term: people skids is much more interesting
 
give the people the skids they deserve en.wikipedia.org/wiki/Skids_(band)
 
Ok, really don't want to dogpile but:
If you have solved your problem, post it as an answer, rather than linking to an off-site resource that may disappear at some point. — Zero Piraeus 50 secs ago
Thing is, OP has obviously been learning bad habits by not getting corrected :-/
 
Cabbage, all, bugrit
 
5:33 PM
cbg @holdenweb :-)
 
heya Steve
 
Happy to say I ended up with the job I wanted. Start July 6!
 
@holdenweb congrats!
 
Pineapple!
 
5:35 PM
Melons, everyone. In a week's time I shall be the Senior Developer Advocate for Duedil
 
Nice :-)
 
Is there a junior developer advocate?
 
@davidism Not yet. I suggested "old geezer" as my job title, since I appear to be at least 15 years older than anyone else I have met in the company. Not too concerned about titles - everything else seems right
 
Are you an advocate for senior developers, or a senior advocate for all developers?
 
@Kevin Are you a deliberate pedant, or can't you help it? ;-) The latter, in truth
 
5:38 PM
Have you ever shot an elephant in your pajamas?
 
Yes @Kevin, take my joke and make it actually comprehensible.
 
@davidism But still no funnier than my average joke
 
Assistant Senior Developer Advocate would be a nice job title. Especially if there was a chance of that position having a subordinate with the title Trainee Engineering Systems Co-ordination Operative.
 
@davidism Anything for the sake of pedantry :-D
Try to work your way up to Senior Developer Senior Advocate.
 
@Kevin That doesn't sound much like world domination
 
5:40 PM
(I'm getting flashbacks to Catch-22 and Major Major Major Major)
 
Hi guys
 
Greetings, @Unknown one.
 
@holdenweb congrats!
 
Do you know, how to automaticly convert a radians calculation to a degrees calculation? Like setting deg() around every number in a string?
 
@Unknown Just multiply by 57.2957795
 
5:43 PM
@Unknown Try math.degrees(x)
 
@Unknown you're going to have to be more specific, what actual problem are you having?
 
Which I have just now discovered exists. I've been multiplying by 180 and dividing by math.pi all this time.
 
And Kevin for the win.
 
... Unless by "automatically" he doesn't even want to call a function.
 
@martijn thought you'd know how to spell lambda by now :p
 
5:44 PM
In which case you'd need some crazy AST manipulating magic
 
Yeah... I'm looking for a function, that automatically sets a deg(..) around every single number inside a string
 
[math.degrees(int(digit)) for digit in str]
... Unless you mean the string contains a mix of digits and non-digits, and you want to separate the digits from the non-digits, convert consecutive runs into separate integers, and then convert them to degrees
In which case you'd need either regex magic or groupby magic
 
the string might look like "asin(sin(115+12))" so I'd like it around "115" and "12"
 
This is screaming XY Problem ...
 
And as I'm almost don't know regex, I need your guys help ^^
 
5:50 PM
Anyone know what happened with Ashton Tate and dBase?
 
This question amuses me so I will attempt a solution.
 
@Unknown check out the link I just posted ... it sounds to me like it could apply to you.
 
Yeah..
 
Yes agree, this does sound a whole lot like a XY problem
 
So - I'd like to code a Calculator, that allows a switch between rad and deg. I'm testing it all the time with asin(sin(5))and in the end I want it to return "5"
 
5:52 PM
import itertools
import math
s = "asin(sin(115+12))"
seq = []
for k,v in itertools.groupby(s, str.isdigit):
    v = "".join(v)
    if k:
        v = int(v)
        v = math.degrees(v)
        v = str(v)
    seq.append(v)
print "".join(seq)

#result:
#asin(sin(6589.014644+687.549354157))
 
Does that sound like an X
 
... Unless you want it to also work on non-integers, like "1.5". In which case I give up.
 
Ill try, thank you!
 
Oh, if you want a calculator, you should really write a proper parser
This is a high-intermediate skill level project
(or low-intermediate if you don't mind copy-pasting from tutorials you find on google ;-) )
 
My Calculator is done. I just need to change a string, if the user switched to deg
 
5:54 PM
@Unknown Do you mean something like this?

import re

numbers = re.compile(r'([0-9]+)')
a = "asin(sin(115+12))"
a = numbers.sub(r'deg(\1)', a)
print a
 
This is the first thing I'm copying and pasting, Sir
 
No, what you actually want to do is change what sin(), asin() etc. do when you're in "degrees" mode.
 
Rather than changing the string, how about you change how sin works depending on whether deg is selected
 
Yeah, you need to change the mode of your "calculator" rather than changing the input.
 
5:54 PM
def sin(x): return math.sin(x) if using_radians else math.sin(math.radians(x))
 
exactly :)
 
What you NEED TO DO is change how the calculator works.
 
Guys. What if he changes how the calculator works?
 
IKR.
 
@Unknown you say "exactly", but what we're all telling you to do is completely different from what you're asking how to do.
 
5:55 PM
An XY problem perhaps, but still a fun regex exercise.
 
Incorrect. There is no such thing as fun regex.
 
It's done! Thank you, and bye -.-
 
I'm 70% sure we helped. Not bad for a Monday.
 
Well, another satisfied customer who definitely isn't going to have more problems down the line then ;-)
 
Experience is a better teacher than we are :-)
 
5:57 PM
That was my last problem. The app is almost working
 
Must ... resist ... Zawinski ... quote ...
 
So - If you could stop talking like this...?
 
The <blue>House of Leaves</blue> guy?
 
doesn't work :P Try to use BB-Code?!
[blue]test[/blue]
 
No, that's Danielewski, never mind.
 
5:58 PM
Ok- not my problem anyway
 
Yeah, there's no way to do colored text in here
Other than the color it usually is. (And hyperlinks if you want to get technical)
 
You should probably change the mode of your calculator chat instead.
 
@JonClements :-P
 
@Kevin It suddenly occurs to me that maybe the quote isn't as universally well-known as I assumed, so:
> Some people, when confronted with a problem, think "I know, I'll use regular expressions." Now they have two problems.
— Jamie Zawinski
Seemed particularly apposite given that their use had been suggested, and in short order the magical phrase "That was my last problem" was uttered.
 
Reminds me of "A programmer had a problem. He thought to himself, 'I know, I'll solve it with threads!' has Now problems. two he"
 
6:05 PM
Ah yes. I know that quote but could not readily recall the speaker.
Or rather, I could not readily recall the quote, given the speaker.
 
And the logo's back... be interesting to see if that calms down meta and some of the more opinionated users :)
 
And waste a good argument?
 
It's amazing how worked up people got about that.
 
They should don the Invincible Shield of Total Apathy, like me.
Or not, I don't care.
 
I don't know why I bother going back to the Triage queue. Two users have marked this "should be improved" so far: stackoverflow.com/review/triage/8619721
And now one "looks ok". How does that look ok?!
 
6:11 PM
It's nearly a complete problem description...
Not that that is in the same league as "complete SO question" ofc
 
cbg…
 
That is my second use of "that that" today. I need to work on my sentence structure.
 
Or perhaps it's a more general problem with your English, but you are XY'ing it?
 
I'm not sure that that "that that" that you dislike is as bad as all ... that.
 
But you probably disliked that 'that "that that" that' that last person wrote
 
6:14 PM
I think I have an overinflated aversion to word repetitions. I winced when I noticed I used "optimal" twice in a message this morning.
 
That was sub-optimal
 
@holdenweb I actually think (cough) that one reads better with an extra "that" :-)
 
I was just about to say that :-)
 
Just keep thatting away, I have to eat now
 
Semantic satiation achieved. "that" is no longer a word.
Incidentally I am annoyed when I'm reading manga and the dialogue is like 'I have no choice... I'll have to use "that"' because I'm pretty sure it's an idiom in the native language but it's just so awkward in English
 
6:19 PM
@Kevin watch "Crouching Tiger, Hidden Dragon" with subtitles - it's errr interesting
 
I guess there usually isn't enough room in the speech bubble to write "my secret weapon"
 
The lengths they go to to not actually name things is incredibly frustrating. I get it, but there's probably a better way to write it.
The stupidest one is "oh that person who's famous in that place" to try to add detail to the world without actually accomplishing anything.
 
@davidism If you notice a really bad reviewer on your journey through the review queues - users can be manually be suspended if needs be
 
@JonClements they're all bad
 
If you meet a bad reviewer on the road, kill him.
 
6:24 PM
I once killed a reviewer just to watch him die.
 
I think they must have unusual trademark laws... Same reason they bleep out words like "Let's go to the hobby shop and buy a Gund●m model". Like that's fooling anyone
 
Past Fizzy bought Milkybar Giant Buttons. I like Past Fizzy, he's a good sort.
 
Sometimes I miss the UK. Finding out that Milkybar Giant Buttons are now a thing is one of those moments.
 
:D come back to us Zero...
 
Here's another shining example: stackoverflow.com/review/triage/8619836. "I'm looking for a resource": "should be improved", "looks ok"
 
6:28 PM
Googling... What the heck are these things.
 
Is that adapted from buddhism, @zero?
 
They're white chocolate buttons Kevin.
 
oh, chocolate. I thought they were... dough, or something.
 
"The milkybar kid is strong and tough..."
 
strikes @JRichardSnape with his staff
 
6:30 PM
@davidism Umm... not quite sure how that made it past the first post queue as okay :p
 
Pretty much everything in the triage queue is unsalvageable. You don't need people custom flagging bad reviewers, you can litterally just dive in randomly and find them everywhere.
 
@ZeroPiraeus Now do the same reference tomorrow, and when the acolyte doesn't ask the question, strike them with your staff.
5
 
is smote
 
Happily, my last review at least was a unanimous "looks ok".
 
6:32 PM
Presumably the third acolyte will hear of this and just stay in bed on the third day, and achieve enlightenment.
 
I have a new least favorite method of debugging: "Phone Debugging. Listening to a co-worker who doesn't know Python read you stacktraces over the phone".
 
Cbg @antti
 
cbg @Antti :-)
 
@MorganThrapp Sounds profoundly unpleasant.
 
6:34 PM
or in case @tristan is around, СБГ
 
@davidism We generally only get involved with people approving spam/etc... for my own sanity - I tend to avoid it as much as I can :p
 
@Kevin It's painful. Especially because today is my day off.
 
maybe it should be shortened КПСТ though
 
"It says, space space file quote C colon slash users slash kevin slash desktop slash test dot py, line 1..."
 
6:35 PM
wb @Morgan
 
@JonClements Thanks. :)
 
@Kevin in Finnish there's the extra problem that ppl don't know how to call / and \ :D so it is like "scusi?"
 
I can never remember which one is back slash :-(
 
ΛΧΝ (solidarity with Greece)
 
cbg
 
6:36 PM
what is cabbage in greek?
I am too tired :D
 
λάχανο
 
@Kevin Specifially, it's "backslash, backslash-Should there be two backslashes, that's not a valid window's path".
 
@AnttiHaapala probably really cheap/really expensive now :p
 
Now I get to explain escape chars.
 
λάχανο
@JonClements it would be very cheap, iff you had cash :P
 
6:42 PM
Greece looks awesome if you're willing to carry a copious amount of euros with you - people will bite your arm off for it
 
@MorganThrapp I understand Windows can read Unix-style paths now (at least from Python). Why not use slashes?
 
@AaronHall They're dynamically generated paths from os.path.join.
 
ok, well shouldn't that be even less problematic?
 
Oh the paths weren't the issue.
The issue was that GPG's key server died for reasons unknown.
 
6:49 PM
@JonClements Unless your name is Lagarde or Schäuble, in which case they'll just rip your arm off and use it to club you to death ;-)
 
The only saving grace of phone debugging is that I was smart enough to bring my bluetooth headset home, so I can keep playing video games while I debug.
 
that's some impressive multitasking
 
I've spent far too much time on these ~600 LoC. I know them like the back of my hand.
 
Lines of Code.
 
6:54 PM
what does the code do?
 
[ENTER] is coming.
 
It's a wrapper around a library I wrote to generate wire transfer files to send to the banks.
 
always use unix style path seperators in python.
 
Everything is a call to os.path.join. Plus, this code will only ever be run in windows.
 
you wrote a wrapper to your own library?
 
6:57 PM
always use unix style path seperators in python ...
 
I haven't been in the industry too long. Is that common?
 
Sounds like a good way to get encapsulation with Python.
 
well if your library is not written in python you will almost guaranteed need to write a wrapper if you want to use python :P
 
Wrapper might be the wrong term. The script just collections info from our database and feeds it to the library. The library does most of the heavy lifting.
 
nothing like hours spent trying to debug something stupid like os.path.join("C:\SomeFolder","someFile")
 

« first day (1717 days earlier)      last day (3225 days later) »