« first day (1138 days earlier)      last day (3844 days later) » 

10:36 AM
+1 for well asked good subjective question — Jimmy Hoffa 8 mins ago
1
Q: Best strategy for code review

gisekMe and my team use feature branches (with git). I'm wondering which is the best strategy for code review before merge to master. I checkout a new branch from master, lets call it fb_#1 I commit a few times and than want to merge it back to master Before I merge someone is supposed to make a cod...

(correct me if I'm wrong in my analysis of that Q, it seems like a good subjective Q to me)
 
10:53 AM
Free sister-site spam flags, for when the taste of P.SE spam flags just aren't doing it for ya!
(verified by mod)
I am henceforth conferring the historical origin of the term "duck-typing" no longer to "walks-like-a-duck quacks-like-a-duck" cliche, but rather to "weighs-like-a-duck therefore floats-like-a-duck"
 
11:40 AM
There isn't enough coffee in Brazil for a 3am load test
 
12:02 PM
@JimmyHoffa not going to lie, when I got on here and saw you chatted last (at 7am CST) I figured something was up ;)
 
 
1 hour later…
user55340
1:22 PM
So, the pm for a project I'm on says there's a webcast at 8am that I should attend. I'm in at 8, she's slightly late but lets say 8 also. Looking... webcast hasn't started yet. Then she remebers its 8am pst - not cst. These are different times.
 
@MichaelT are you normally in at 8am?
 
user55340
nope.
 
bummer. heartless PMs can't tell time... :)
 
@MichaelT Not technically, they're both the same time in UTC.
That's why we always do everything in UTC on the internets, because every timezone is the same in UTC! Yeah, that's how that works! Yep!
Are my comments an incorrect analysis here?
0
Q: Rails/Node.js interaction

lpvnI and my co-worker are developing a web application with rails and node.js and we can't reach a consensus regarding a particular architectural decision. Our setup is basically a rails server working with node.js and redis, when a client makes a http request to our rails API in some cases our rai...

Eesh it's like everyone's just implementing products as a buzzword bingo exercise this morning..
0
Q: REST or a message queue in a multi-tier heterogeneous system?

Victor SergienkoI'm designing a REST API for a three-tier system like: Client application -> Front-end API cloud server -> user's home API server (Home). Home is a home device, and is supposed to maintain connection to Front-end via Websocket or a long poll (this is the first place where we're violating REST. I...

"I have 3 pieces, 2 run locally and the middle one between those two is in the cloud, how should I communicate the cloud piece with the other 2 pieces?" - Uhh, put it locally with the other 2 pieces? Oh I'm sorry what I meant to say was "wu"..I think...
 
1:59 PM
@MichaelT Where did you get that quote about Single Sign-on? Why have I heard of Juniper Networks? How are these two things related?
 
user55340
@JimmyHoffa Which quote? The tag wiki excerpt? I wrote it, then read the wikipedia page and reworded it.
 
user55340
Juniper, Cisco and the like do make SSO products...
 
@MichaelT I smell a conspiracy. Illuminati or Petrotech-CO?
 
 
2 hours later…
user55340
Watching a webcast of a car routing / fleet management system... the presenter uses their own company cars for the webcast rather than faked data... "Oh my God, he was doing 80 in a 40 zone..."
 
4:21 PM
Hahaha should have checked the data before he presented it
 
user55340
The presenter was going through the examples of the different reports. One of the reports is a speeding report (this is the one that was the "OMG" moment)... there's also a report that triggers on lateral movement (someone taking a corner too fast - think semi / delivery van... that can be 'bad' and you want to go talk with the driver).
 
4:39 PM
Im honestly not sure how to feel about that kind of stuff
On one hand, I get it, business owners need to make sure that their drivers are being responsible
on the other hand, if my boss put a gps tracker on me and followed my every moment when I was on the clock I would be a little weirded out
 
user55340
@Sparticus You've got a cleaning company you run. You've got 20 vans and trucks with stuff in them. You can't hire a supervisor for ever crew.
 
you can hire people you trust though
 
user55340
Typically, these aren't the highest paying jobs and such. At a company my mother worked for (cleaning service - she worked in the office, inventory & spanish calls) they had problems with people going where they weren't supposed to in company vehicles.
 
user55340
I've also heard of fun with drivers misusing the company account / email account a device was signed into (resume? sms? and yea... you don't want to think of the pictures sent).
 
user55340
We're not exactly talking about white collar workers with a $1000 laptop... we're talking about $20k trucks and the stuff in the trucks.
 
user55340
4:44 PM
For a delivery company, if the person at the end says "this box was damaged" you want to be able to check to see if the driver was driving in an unsafe manner (taking turns too quick).
 
user55340
 
user55340
> It is better to have 100 functions operate on one data structure than 10 functions on 10 data structures.
 
psr
5:16 PM
I was contacted by a former coworker yesterday. He inherited some of my code so I got the (fairly rare) experience of seeing how a maintainer thought it held up. He said it was some of the best code he'd ever seen and it taught him how to write C# - Woo hoo! (To be fair, the job was square in the bowels of Enterprise hell - software development at a place where not one upper manager understood of even wanted to think about software).
3
 
@psr That is a rare experience.
 
@psr nice. those sorts of comments are great to get!
 
psr
@JimmyHoffa It's been rare for me to get much feedback one way or the other about what later programmers thought of my work. That seems to be the norm, which is quite a shame. I think I could learn so much from that feedback.
 
@psr If I ever got such a contact it would probably be something to the tune of "Ok, your code seems to work pretty well because we haven't had to touch it, but now they want me to add a feature to it and I gotta ask... What does 'c => f => f (() => x)' do??"
 
5:44 PM
-2
Q: Grails vs Ruby on Rails

L_7337I've been using Grails for the past few years and I really like it. I think Groovy is probably one of the best 'Get 'er Done' languages out there. That's part of the reason I favor Grails so much. I've read a little about RoR and it seems similar, but just know quite as easy and intuitive(compl...

Would anyone object to me editting the title of that to just read "Gorilla vs Shark" ?
...kidding...sort of...
 
> I think Groovy is probably one of the best 'Get 'er Done' languages out there.
well then
 
user55340
I think that Groovy is a terrible language and should never be used. I also think that pancakes are delicious and that the Mustang is the de facto all-american muscle car. Edit: Shoot, sorry. I thought we were sharing opinions again. — Sparticus 7 mins ago
 
user55340
@Sparticus You're just a ruby lover...
 
user55340
And everyone knows its the Dodge Charger (General Lee).
 
5:59 PM
@Sparticus pancakes are terrible, french toast is the only answer. At least we can both agree those belgian waffle guys are effing nuts. What a bunch of nut jobs they are! All hail the maple syrupketeers! Seriously though, French toast is far better than Sharks, I mean Pancakes, I mean muscle cars — Jimmy Hoffa 23 secs ago
 
user55340
I'm pro pancake, but good waffles rock.
 
@MichaelT ugh wrong on both points! French toast is the only answer!!
 
You guys are both wrong. Get with it. Pancakes + Mustang + Ruby = Perfection.
How can you look at a '69 fastback mach 1 and still even look at other muscle cars seriously?
 
@Sparticus To that I simply say, Barracuda.
 
@JimmyHoffa I'm sorry, I couldn't hear you over the sound of my 427
(For comparison)
 
6:11 PM
@Sparticus Look I don't care how many digits are in your number, nor do I care about their ordinality, because I'm too busy in a hazy happy-coma of french toast perfection
 
The things I would do for that car.... one of my friend's dad owns one. He bought it in 69 and has been the only owner of the completely numbers matching car
I have contemplated marrying her so that I can inheret the car... multiple times
 
@Sparticus it's the important things in life
like... wait what car she drives? :)
 
not even what car she drives, I'll settle for what car her father owns.
 
@Sparticus Just make sure she makes a mean plate of french toast, nothing else matters.
 
@JimmyHoffa sorry, but french toast is terrible. don't ban me plz!
 
user55340
6:19 PM
ghads... MSO pointed me to this wonderful answer...
 
user55340
16
Q: Regular expression preg_quote symbols are not detected

Prof83I have a dictionary of swear words in the database, and the following works great preg_match_all("/\b".$f."(?:ing|er|es|s)?\b/si",$t,$m,PREG_SET_ORDER); $t is the input text and simply, $f = preg_quote("punk"); "punk" is from the database dictionary, so at this point in the loop the expression...

 
user55340
Lets go with the question link instead.
 
user55340
The answer is rather epic.
 
I just generated a 1500 line error message. weeeee
 
user55340
6:36 PM
Random fun thing to read today - spaceref.com/onorbit/… (how to get a moon rock to the top of Mt. Everest)
 
user55340
> Luckily, both Scott and I just happened to be tool-using primates and we had knives, duct tape, and a pair of surgical retractors I brought with me.
 
6:49 PM
So I solved my problem yesterday by defining some generic functions that do all the heavy lifting
they take in a parameter determining which input to test, and then those get called inside of the named methods
class Input1TestSuite(Tester.TestSuite):

    def Input_1_Pullup_Test(self, device_manager):
        Input_N_Pullup_Test(device_manager, 1)

    def Input_1_Feedback_Test(self, device_manager):
        Input_N_Feedback_Test(device_manager, 1)

    def Input_1_32V_Analog_Test(self, device_manager):
        Input_N_32V_Analog_Test(device_manager, 1)

    def Input_1_5V_Analog_Test(self, device_manager):
        Input_N_5V_Analog_Test(device_manager, 1)
so now it looks like that
unfortunately I have this same thing repeated 4 times for each of the 4 inputs, with the numbers changing to match
I could go and do some meta programming and automatically create these classes and methods, putting in the numbers where appropriate
but I'm afraid that I would loose some of my teammates who have minimal python experiance
I.E. None
and the copy paste code isn't exactly terrible, it is just a violation of dry
thoughts?
One of the reqs on this was that the testing scripts would be easy to read and understand, so I'm leaning towards just spelling it all out
 
user55340
130
Q: If my team has low skill, should I lower the skill of my code?

Florian MargaineFor example, there is a common snippet in JS to get a default value: function f(x) { x = x || 'default_value'; } This kind of snippet is not easily understood by all the members of my team, their JS level being low. Should I not use this trick then? It makes the code less readable by peer...

 
user55340
@Sparticus There's also likely an unwritten req of "easy to maintain"
 
very much so
and it's not a trivial little thing, I mean it would require the maintainer to understand meta programming, which means that theres a knowledge jump from the current method
this one is tedious but super simple to understand
 
user55340
Ask your team "I've got a choice - I can write code that requires you to duplicate things a dozen times, or write code that is at a slightly more complex level than we are used to dealing with now..."
 
well the other problem is that this tester is written in a language we don't use
python
i mean not a hard or obscure language
but we do C, C++
all of our products use those
so forcing them to learn about python meta programming to maintain this one piece of code might be unreasonable
of course this project is my first time programming python and I haven't really had any problems picking up that stuff
im just going to keep it simple for now
 
user55340
6:56 PM
personally I dislike metaprogramming unless the language requires it (and then I dislike the language).
 
yeah, and you know, this is something they have to feel comfortable with
a few lines of repetition of very simple code is going to be ok
 
user55340
Java's reflection makes me go "ug" many times... though when its made a bit safer (annotations), it can be reasonable.
 
(I've never used reflection. Don't be mad)
 
user55340
Its meta programming... it lets you find all the fields and methods in an object, invoke them, change the modifiers (private / protected), alter things, etc...
 
user55340
7:03 PM
As an aside, it makes IDEs slightly easier - because you can use reflection to interrogate the compiled object rather than parsing the code.
 
user55340
11
A: How compilers know about other classes and their properties?

MichaelTDifferent languages (and thus compilers) approach this differently. In the C family, the different modules have a corresponding header file that is used while building the object. The header files provide information on the size of the object and what functions or methods exists that may be inv...

 
Interesting. I've never used Java meta programming
 
user55340
Unless you really need it, java programmers tend to shy away from it.
 
user55340
On the other hand, Ruby programmers tend to always use meta programming when normal things would work just as well.
 
user55340
(You want a Hash? Nah, we'll just make an object and meta-program in fields into it with an auto-response for missing fields...)
 
7:12 PM
@MichaelT I just spent 4 hrs writing some Perl :) I feel weirdly excited and slightly dirty.
 
user55340
@jozefg Its... intresting.
 
user55340
I like to think of Perl as a very pragmatic / practical language.
 
@MichaelT the irony is all the terrible things Perlers say about LISP, but pragmatic/practical is exactly how I think of LISP
 
7:33 PM
@MichaelT I see Perl as very practical for everything that can be done in less than 80 characters
Which for Perl is a lot
But not anything that needs to be read after it is written
 
user55340
> Around 1993 I started reading books about Lisp, and I discovered something
important: Perl is much more like Lisp than it is like C. If you pick up a good
book about Lisp, there will be a section that describes Lisp’s good features.
For example, the book Paradigms of Artificial Intelligence Programming, by Peter
Norvig, includes a section titledWhat Makes Lisp Different? that describes seven
features of Lisp.
 
user55340
> Perl shares six of these features; C shares none of them. These
are big, important features, features like first-class functions, dynamic access to
the symbol table, and automatic storage management. Lisp programmers have
been using these features since 1957. They know a lot about how to use these
language features in powerful ways. If Perl programmers can find out the things
that Lisp programmers already know, they will learn a lot of things that will make
their Perl programming jobs easier.
 
user55340
Still trying to get that next paragraph.
 
@tylerl You just need to think in the terms of Perl my friend, rather than writing it like you'd write another language
 
user55340
7:40 PM
For any language, you need to think in terms of the language.
 
@JimmyHoffa Please explain
specifically how thinking in perl makes perl readable
 
user55340
If you are thinking in Java and writing C#, you're going to have difficulties - no matter how similar the languages at a superficial level.
 
And obviously any code is readable if you stare at it long enough, but perl seems to lend itself more readily to confusion
 
user55340
You need to think in terms of its data types, what it offers, how to put things together.
 
user55340
Many programmers today keep thinking in terms of C++, or C#, or Java patterns... throw those out, they're not applicable.
 
user55340
7:44 PM
(that book I mentioned above - one can read it at hop.perl.plover.com/book )
 
not readable, you have it backwards, thinking in the terms of a language makes it *writeable*. So long as you think in terms of a language you know you're not going to write the language at hand, and then of course what you write is going to be unreadable, it's like speaking german in english.

That good sense does make?
^-- see, german in english is unreadable, just like Java in Perl or vice versa.
 
user55340
@JimmyHoffa I think I understand what you're saying... "If you are writing Java in Perl, you're not going to be writing readable Perl"
 
user55340
And likewise, proper, idiomatic perl won't be something that you understand either as long as you keep trying to translate it into mental-java.
 
user55340
@sorted = map { $_->[0] } sort { $a->[1] <=> $b->[1] } map { [$_, -s $_] } @files; Just doesn't make sense to a Java programmer... but to a Perl (or Lisp) programmer... its quite understandable (though the lisper may think it lacks enough fingernail clippings parens)
 
@MichaelT It's not that it lacks parens, it's that it has other symbols instead... what is this '[' thingy? and this '{' and '@' ?? nonsense characters I say...
 
user55340
7:54 PM
@JimmyHoffa The {} are code blocks. the [] is an anonymous list reference. The @ is the sigil to identify a list.
 
just make them all parens and the world is happy again! (sorted = map ( $_->(0) ) sort ( $a->(1) <=> $b->(1) ) map ( ($_, -s $_) ) (files))
 
The primary problem (IMHO) with perl is that it has surprise features. The most classic of which is variables with side-effects. So $/ = undef is a great example of this. Why does setting a confusingly-named variable change the way some seemingly unrelated operations work.
 
ahhh that's better
 
It's completely itiomatic, and completely silly.
 
user55340
@tylerl $/ is the record input delimiter.
 
7:55 PM
@MichaelT yes, I know exactly what it is. I chose that example because if you know perl, you've probably seen it. And when you first saw it, you said WTF is this about.
 
user55340
It changes how all input operations dealing with records work... remeber perls origin as a reporting language.
 
Because assigning to a variable shouldn't change the way while (<>) works
 
user55340
Its part of the global state of the application. You could instead use an IO::Handle and do IO::Handle->input_record_separator( EXPR )
 
@MichaelT Right, but nobody is going to do that. If you're going to write idiomatic perl, you're going to use $/ = undef, because The Perl Way is all about using confusing bits of 1980s legacy semantics
$/ exists because that's the way it was done in languages that predate perl
it's not the right way by any language-design patterns. But it's the old way.
 
user55340
@tylerl It got that from awk.... but the thing is, you learn it, and you think in it. Its not any more obscure that other idioms in other languages.
 
user55340
8:00 PM
There are scores of questions out there about how to write idiomatic python...
 
@MichaelT It's not obscure because it's known. But it's confusing because all along the way you're doing things that change the operating state of the interpreter. The way your function works depends on state that could have been set anywhere along the way, somewhere that you may not even know to look.
There's a reason why modern languages don't do that.
I'm no Perl hater: it was the first scripting language I learned, and I've been using it for 2 decades. But I recognize problematic semantics when I see them.
 
user55340
Perl is very odd in giving turing complete access to its internals during the compile phase... changing the state of the interpreter isn't too astonishing. And thats the way it works... trying to argue that it shouldn't be isn't productive.
 
What makes perl difficult to read is that if you can't see the whole program, then you can't tell what your function right in front of you actually does.
@MichaelT I'm not saying it shouldn't be; it's an excellent hack. It's waaay better than sed and awk. I use it daily. But there are definite design problems in the language itself.
 
user55340
I've yet to find the perfect language that isn't without its design problems.
 
@MichaelT Nobody [with any sense] said there was a perfect language. I'm not trying to make you feel bad.
 
8:05 PM
@tylerl Then come to the darkside. The semantics are completely consistent, without problem, beautiful and perfect, here in Haskell land.
 
user55340
(once you figure out what a monad and eigenclass and other made up words mean...)
 
in Root Access, 51 secs ago, by Jimmy Hoffa
@allquixotic ...one last point if I may: I took the time to learn Haskell believing identically to you. After learning it, it completely changed my tune. I have met a great many who also know Haskell, and none of them that have made claims of it's impossibility/unusability in industry, quite the opposite actually. The only folks I have so far met who claimed it an inappropriate choice for industry tasks were folks who didn't take the time to learn it. So prove yourself right by learning Haskell :)
(don't ask why I'm in the SU chat, I honestly don't even remember)
 
@JimmyHoffa The problem with Haskell is that once you learn it, you'll be tempted to use it. And then everyone will be like: why the hell did you write this in Haskell?
 
@tylerl I wish you weren't right. God I wish you weren't right.
@tylerl ...on the otherhand, the un-problem with Haskell is that one you learn it, you'll be able to elegantly solve classes of problems in ways you didn't know of before, as well as being able to mentally model some systems you're used to finding very vague and confusing.
 
8:18 PM
@JimmyHoffa On the bright side, Python implements most of the important themes from Haskell if you know where to look.
It's like a functional trojan horse.
Come for the multiple inheritance, stay for map reduce.
 
user55340
Through Linked In, I got a person asking if I wanted my old job at my previous employer...
 
user55340
not realizing that I really don't.
 
@MichaelT LinkedIn is the devil. Since they got hacked, now every spammer in the world knows where I work, and what my position is, and wants to sell me a list of everyone else's email, job, title, company, etc.
 
@tylerl Hah. Try again :P Go learn Haskell and then tell yourself "Yeah, most of these features are in Python... you know...except for STM...and applicative functors...or ADTs...or typeclasses...or monads..... but yeah a lot of this stuff is in Python, like lists, they have those, err but they don't have referential transparancy or quickcheck...but yeah it's like the same thing.."
 
psr
@JimmyHoffa ironically if it had maybe 1/4th of those things I'd probably be using it now.
 
8:27 PM
@JimmyHoffa Python does in fact have STM, applicative functors, ADTs, etc. Like I said, you have to know where to look.
it's not a the way most people use the language, though.
 
def fmap(f, a):
        if isinstance(a, list):
                return [f(x) for x in a]
        else:
                return f(a)

print fmap(int, [1.0, 2.0])                        #[1, 2]
print fmap(int, 1.0)                                 #1
 
user55340
(incidentally, all my old cow-orkers also got the recruiter spam.)
 
That's what google gives me... not really the same as an actual general functor...
 
user55340
I'm really tempted to give the recruiter a "yea" and the manager for the department that is being hired for as a reference to call. Picture the manager expecting a call from the recruiter saying "found someone" and instead getting the call of "I'm calling to see if {former employee} would be a good fit for {job in your department}"
 
user55340
@JimmyHoffa only crazy, naked Americans program in Haskell.
 
8:40 PM
@MichaelT Profunctor! That's what I have to say about that! And don't make me repeat myself!
 
user55340
Btw, @Sparticus did you notice you got the silver chat badge? programmers.stackexchange.com/help/badges/74/outspoken
 
user55340
You know... that recruiter... I wonder if @WorldEngineer wants a job in the North Woods of Wisconsin?
 
psr
10:07 PM
@Sparticus I don't think that's how multiple inheritance works.
 

« first day (1138 days earlier)      last day (3844 days later) »