Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
NtotheTC
Dec 31, 2007


Suspicious Dish posted:

I'm actually curious, is there a good public API to get those? It seems like it should be an API provided by some government agency somewhere.

There are several good ones that require a subscription to use. I had a hell of a time trying to find a decent free one to just do a quick on-the-fly exchange rate calculation.

I ended up using google's exchange rate calculator but even that isn't ideal. Annoyingly the response it returns isn't valid JSON. I'm struggling to think of a reason why, but all I can come up with is that google don't particularly want people using it in this way, so made it deliberately annoying.

NtotheTC fucked around with this message at 09:38 on Oct 19, 2012

Adbot
ADBOT LOVES YOU

NtotheTC
Dec 31, 2007


Otto Skorzeny posted:

I need* to...

I hate when people do this and forget to add the other *. I spend hours of my life searching for it.

NtotheTC
Dec 31, 2007


http://stackoverflow.com/questions/14790550/i-want-to-write-an-app-for-my-gf-any-suggestions

Maybe not a coding horror in the traditional sense (or maybe it is) but it sure made me pull the :cry: face

VVV Ah, basically the thread title was "I want to write an app for my gf any suggestions"

And the first line was "Well, she's my ex actually. I wanted to write an app for her to show her how much I missed her"

NtotheTC fucked around with this message at 20:30 on Feb 9, 2013

NtotheTC
Dec 31, 2007


yaoi prophet posted:

I mean, your posting's already in it.

Also, I wonder if you could write stacksort for other things, like fizzbuzz.

I think the next step is "stacklang" a new programming language where you string google search questions together and have it compile the result.

code:
"How do I make a loop from 1 to 100?";

"How do I check if a number is divisible by 3 and 5?";
"How do I print 'FizzBuzz'?";

"How do I check if a number is divisible by 3?";
"How do I print 'Fizz'?";

"How do I else?";
"How do I print 'buzz'?";

NtotheTC fucked around with this message at 15:10 on Mar 19, 2013

NtotheTC
Dec 31, 2007


Zombywuf posted:

Threaded code bug update, it now appears to depend on day of the week.

I recommend reading though TheDailyWtf until you find the made up story that mirrors this problem, then work backwards from there.

NtotheTC
Dec 31, 2007


Whoops.

Still at least the software was well tested apparently.

E: my friend sold this to me as a Java horror. I'm not too clued up on Java but by the looks of it it could have been easily avoided.

NtotheTC fucked around with this message at 11:42 on Aug 16, 2013

NtotheTC
Dec 31, 2007


Zombywuf posted:

It's more likely that it introduces a slight delay making the race less likely to manifest than any synchronising effect.

Python code:
if True: # a % 128 == 0:
    time.sleep(1) # Making application more RESTful

NtotheTC
Dec 31, 2007


bucketmouse posted:

That lead me indirectly to this.

https://github.com/jloughry/BANCStar/blob/master/README.md

:psyduck:

e: if nothing else, ctrl-f "Interesting features" on that page


You've linked to the same page there.

NtotheTC
Dec 31, 2007


fritz posted:

It could be cant won't or don't.

Or "shouldn't".

NtotheTC
Dec 31, 2007


Thermopyle posted:

I'm not sure what this means exactly.

For example, you can easily refactor the method arguments in Python, I don't know what that guy was thinking when he used a dict for method arguments.

Is it not just a similar way of doing:

Python code:
def funct(val='default'):
    print val

funct('not default')     # prints 'not default'
funct()                  # prints 'default'
Which when you compare it to the example above makes it look stupid and verbose, but it does have its place. I've used it for classes when there have been a lot of optional keyword arguments and needed a bit more flexibility.

The other way I've used it is similar to:

Python code:
class SomeClass(AnotherClass):
    def __init__(*args, **kwargs):
        some_var = kwargs.pop('some_var', 'default')
        super(SomeClass, self).__init__(*args, **kwargs)

NtotheTC fucked around with this message at 17:29 on Sep 30, 2013

NtotheTC
Dec 31, 2007


Hammerite posted:

??? Why would you do it this way instead of just using default argument values? (Also you missed out self.)

Like I said, it's a stylistic thing. With a lot of kwargs I personally think it starts to look less readable the way you did it. And yes I did forget self.

VVV Yes that works too. As an aside, would it be too highbrow for goons if I suggested we all use Lewis Caroll references in our code now instead of foo bar or fart butts? I'm a huge fan of the mome raths.

Python code:
class Wabe(object):
    def __init__(self, *slithy_toves, brillig=True, **kwargs):
        if brillig:
            for slithy_tove in slithy_toves:
                slithy_tove.gyre()
                slithy_tove.gimbal()

NtotheTC fucked around with this message at 22:05 on Sep 30, 2013

NtotheTC
Dec 31, 2007


"If we argue about this for just a few pages more, we're bound to find out what the one true programming language is!"

there is no one true programming language

Just use the right tool for the right job and remember that that tool is never PHP and you're all set.

NtotheTC
Dec 31, 2007


Hammerite posted:

I didn't know what a "conditional loop" was until just now when I read your post and looked it up. I mean, I knew what a loop was and what a conditional was, but had never heard the phrase "conditional loop" before. Turns out it more or less means the same thing as "loop".

Agreed, call a spade a spade.

NtotheTC
Dec 31, 2007


Pollyanna posted:

What in god's name is the reason for keeping this crap?

Come now, you have python background. How is:

Python code:
if __name__ == "__main__":
    # code 
In any way less obtuse for a new programmer.

NtotheTC
Dec 31, 2007


Edison was a dick posted:

It's not mandatory, you only have to do that if you're doing weird stuff, like having a python script be both a library and the application executable. I prefer keeping those two concepts separate and as a consequence, never have to do it.

Maybe you don't, but it's prolific enough that it's shoved down the throats of most new python programmers at some stage, and isn't intuitive enough to prevent them having to go and specifically look up (or be told) what it does. Which is why it was odd to me that a python programmer would take exception to public static void main as being too hard to grasp and a reason why Java was a poor language for newcomers.

NtotheTC
Dec 31, 2007


It took me a moment to realise the first method wasn't actually ejactulate()

NtotheTC
Dec 31, 2007


Opinion Haver posted:

We've all seen PHP advocates defend PHP before. But have you seen them in the comments section of MLP fanart?

:smug: "PHP is way more secure than Java or C"

:v: "Uh, I'm not sure that's true"

:smug: "Well unless you can provide me with hundreds of specific sources proving your point then your argument is indefensible"


Outstanding.

NtotheTC
Dec 31, 2007


Suspicious Dish posted:

Interesting links

thanks for these. one underlying theme im spotting is that hardware developers seem to hate software. and not in an ironic "haha software sucks, coding horrors amirite?" way- but a proper "everything should be hardware" way. is that actually a thing?

NtotheTC
Dec 31, 2007


Jewel posted:

So, the installer for the "Send to Kindle" app on Mac won't install on Mac 10.10.0. The app says "Send to Kindle is only supported on Mac OSX version 10.6.0 and above". What's the problem?

code:
if [[ "$currentVersion" < "$MIN_SUPPORTED_OS_VERSION" ]];
Oh :yum:

Lexical comparisons of version numbers is super smart and definitely what you should be doing in this scenario yes.

I thought version tuples (or the bash equivilent) were a thing everywhere. Or is this just my spoiled python background?

NtotheTC fucked around with this message at 12:10 on Oct 25, 2014

NtotheTC
Dec 31, 2007


The whole JS / no-JS thing was embodied for me by that "joke" best-site-ever that was just text on a page. Then someone made a response to the page that used proper web fonts and better spacing etc and the whole thing devolved into a slow-motion passive agressive slap fight over what was "needed" and what wasn't.

My life as a developer was infinitely easier when the backend was where the logic went and the front end just handled displaying content. But as a user I've gotta say I much prefer it when a site pre-warns me that a form field is invalid before I send it.

NtotheTC
Dec 31, 2007


Volguus posted:

Why can't you have both? Why having in the frontend is that much harder?

It's not harder in terms of difficulty, you just have to use javascript to do it. And unless you enjoy pain you're probably going to want to use at least one framework rather than write your own and then it's too late, you're in the JS ecosystem and there's no turning back.

NtotheTC
Dec 31, 2007


Looks like the nomx site is hammered right now. What did the response say?

That's loving amazing. Like... I couldn't even creatively come up with something that terrible as an April fools joke. And these guys are trying to ship it as an actual product.

And of course they're involved in bitcoins. Jesus christ. Gotta admit I laughed hard at the part where will@nomx claimed to be sending emails but they weren't getting though. It's entirely possible he was just using the product.

NtotheTC
Dec 31, 2007


"Our users could just check the logs regularly to see if they'd been hacked anyway so it's not like it would even be secret. CHECK MATE BLOGGER"

NtotheTC
Dec 31, 2007


My database experience is strictly non-enterprise, mostly postgres. The idea of not allowing nullable fields seems crazy to me. But then I barely do anything with raw sql and high performance queries. Why are nullable fields bad?

NtotheTC
Dec 31, 2007


Doctor w-rw-rw- posted:

Note also that Microsoft's APIs are broken and horrible. Async stuff everywhere for apparently small atomic operations, their own custom not-quite-C++-but-not-Managed-C++ implementation, insane workarounds everywhere.

Sure, they have backwards-compatibility, to a point, but it results in poor docs, a platform nobody wants to target directly, and layers in between with quality according to their developers' API knowledge.

Electron Shell, ugh.

I know it's a Joel on Software story but I was always fascinated by the lengths Microsoft went to for backwards compatibility

quote:

I first heard about this from one of the developers of the hit game SimCity, who told me that there was a critical bug in his application: it used memory right after freeing it, a major no-no that happened to work OK on DOS but would not work under Windows where memory that is freed is likely to be snatched up by another running application right away. The testers on the Windows team were going through various popular applications, testing them to make sure they worked OK, but SimCity kept crashing. They reported this to the Windows developers, who disassembled SimCity, stepped through it in a debugger, found the bug, and added special code that checked if SimCity was running, and if it did, ran the memory allocator in a special mode in which you could still use memory after freeing it.

NtotheTC fucked around with this message at 11:19 on May 3, 2017

NtotheTC
Dec 31, 2007


canis minor posted:

So I registered my Dell computer:



I'll never understand how this happens, what do you have to do to a web/email app that turns off template rendering, and is subtle enough that you can do it accidently?

Whatever the answer I'm sure it boils down to PHP.

NtotheTC
Dec 31, 2007


I just wish people would stop innovating (as much) and start improving. If you develop something cool in the JS ecosystem stop and make it better, more stable, and more generic. Don't try and develop the next esoteric cool thing.

NtotheTC
Dec 31, 2007


Munkeymon posted:

If 1/4 of your job is talking to Japanese people who don't know English, it's still good advice if you're at all interested in doing your job better.

What if your company has a translator and you can just give him the plain English version and he will translate it for the Japanese people and 99.9% of the time this is fine but just occasionally you need the translations urgently and so have to write it out yourself?

:itisanORManalogy:

NtotheTC
Dec 31, 2007


Hughlander posted:

Unfortunately then you’ll need to start over and rewrite the book he was translating from scratch when he starts taking months to translate when he translated in a few hours before.
:itsanORManalogy:

Wait is this really a thing? To be fair I've only worked with one translator before and ok gently caress the analogy is dumb as hell.

But yeah I work with the django ORM and it's pretty much solid for day to day use, on the rare occasions where I do need to do a certain query in raw SQL it makes it pretty easy to drop down for that one query and you don't have to throw out the entire ORM...

NtotheTC
Dec 31, 2007


https://twitter.com/DevsenseCorp/status/1067410510289747968

Lol. Their stable release is going to suck then and a loooot of people are going to ask for their money back

Guess someone snatched the twitter account away from the intern who'd read too many Wendy's tweets

NtotheTC fucked around with this message at 19:56 on Nov 27, 2018

NtotheTC
Dec 31, 2007


https://github.com/dylanbeattie/rockstar

Actually this isn't a horror it is unbelievably cool and good.

quote:

Comments

The use of comments in Rockstar programs is strongly discouraged. This is rock'n'roll; it's up to the audience to find their own meaning.
If you absolutely insist on commenting your Rockstar programs, comments should be contained in parentheses ().
Yes, this means you can't use brackets in arithmetic expressions and may need to decompose complex expressions into multiple evaluations and assignments.

Rockstar developers are not into that whole brevity thing.

code:
Tommy was a lean mean wrecking machine.  (initialises Tommy with the value 14487) 

NtotheTC
Dec 31, 2007


Linear Zoetrope posted:

code:

bool TRUE = true
bool FALSE = false

bool x_is_not_y = x != y;

if (x_is_not_y == TRUE) {
    return FALSE;
} else if (x_is_not_y == FALSE) {
    return TRUE;
} else {
    throw "Boolean value is not true or false!";
}

Requirements change in the real world guys jesus

NtotheTC
Dec 31, 2007


Ola posted:

Just imagine how many times this head has been scratched:



Enough to wear away most of his hair

NtotheTC
Dec 31, 2007


Why don't we just push the earth towards the sun a tiny bit so we get 360 days a year? Then this problem goes away.

NtotheTC
Dec 31, 2007


Ah yes Andrew Ng the creator of AngularJS

NtotheTC
Dec 31, 2007


Absurd Alhazred posted:

I don't understand what I'm seeing here.

tabs instead of spaces

NtotheTC
Dec 31, 2007


JawnV6 posted:

why would i, cursed with knowledge, bother to help when you've got such luminaries in the thread unfettered by such vagaries

Are you from the EVE thread or something

NtotheTC
Dec 31, 2007


Guys, guys this can all be achieved with regex if you use lookaheads. It's a regular language unlike html!

NtotheTC
Dec 31, 2007


The real takeaway from all this is that if enough of these bloody top-tier tech companies need brackets parsed so desperately there's a decent usecase for a domain-specific language. So just write one of those and then smugly produce the source code in your interview.

Adbot
ADBOT LOVES YOU

NtotheTC
Dec 31, 2007


Jazerus posted:

one day he'll destroy it all and every node program on the planet will collapse simultaneously

the tragedy is it will go unnoticed for months "yeah don't worry about the build server errors it always does that"

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply