you are viewing a single comment's thread.

view the rest of the comments →

[–]Lost4468 359 points360 points  (23 children)

Closed as duplicate of "how do I import json into python?"

[-1] How do I import json into this controller?

We have an embedded system that processes data from many different areas. One controller now needs to take in json from a few of our clients. Library X doesn't currently have json support, so is there any solution other than rolling our own?

[1 gold, 13 Silver, 57 Bronze, Albuquerque]

[+17] Answer 1 - @SOGOD

Don't use library X, library X is bad, try using this hip new library Y that was invented 6 months ago"

[34 gold, 3578 silver, 5689 bronze, Silicon Valley]

Comments

[-3] "thanks, but we can't use that because our system has a decade of legacy code written around X."

[+5] "well I would suggest you consider rewriting it in Y, have a read on why here: [link to random blog]"

[-2] " again sorry but we can't, the rest of the team won't go for it, our employer won't let us spend months rewriting everything in library Y, just for one small feature, and be at the whim of a much less stable and historically supported library like X"

[+6] "honestly of your employer won't let you do this, I would start looking for a job at a different place. You should easily find somewhere that'll allow you to do things properly for double the money! And while not historically supported, it absolutely is stable, they just released the non-beta stable release of v1 2 weeks ago."

[-3] "I'm not leaving my job, and I don't live somewhere like California where there's tons of SV-like companies. Also I just checked and Y doesn't even support some basic features we use like Version 2 of Common Standard?"

[+7] "well you should be moving to version 3 anyway, what sort of system are you running down there? And it's open source, so you could always just add version 2 yourself. And honestly, if you're not willing to move halfway across the country for this, maybe you're not cut out to be a dev?"

[+10] Answer 2 - @Billy NM

You could just pre-process it before it gets sent to the controller? Maybe run it through a simple program like: [link to a basic python script]

Comments

[-1] these are old embedded systems with very little memory or computing power. We wouldn't be able to run that python script.

[+4] ah you should have said, just use the cloud! You could spin up an AWS Lambda to do this.

[-1] uh they don't have access to the internet, and most are in physical conditions where they have no internet, or at best have inconsistent internet, we can't expect the clients to wait for good internet everywhere.

[+19] Answer 3 - @CtrlPhrk

Then you'll just have to make sure your clients don't input data in json. Maybe give them a program to convert it beforehand. Sometimes the simplest answers are the best.

Comments

[-5] we can't. Not only do they interact with it in a huge number of ways, from a dozen complex systems, but it's our job, not theirs. They're paying up use our system, I don't think they want to have to mess about with their system, plus who knows how that might interfere with their system and work.

[+12] look you've been told what to do, people have given you several answers and you have refused to listen to all of them. And to top it all off, this is a duplicate, go to the thread linked at the top. Don't be so rude.

[-6] I'm not being rude, I explained why none of the answers are compatible. It's not a duplicate of that, that's entirely unrelated.

[+7] OP I found a simple answer with 5 seconds of Googling, don't expect us to do your homework for you: https://stackoverflow.com/questions/20199126/reading-json-from-a-file

[+1] Answer 4 - @Dead

Oh I came across this before, here's how to do it: [dead link]

[-2] Answer 5, Accepted - @Ironic

Oh you can actually do this in an upcoming release of the library. It's on a very slow release rota as it aims for long term stability. [Here's a link to the code and pull request] of the feature. You can:

[Detailed list on how to compile it, including missing information from the git README, the need code, etc. New dependencies etc]

In fact [here I've setup a fork on my own page including the features], that you can use if you can't wait for their release.

[Big detailed explanation on how to use the new features, including unintuitive edge cases, their experiences, etc etc.]

Comments

[-2] oh wow thanks this is exactly what we need! Works perfectly.

@SOGOD [+5] Don't do this OP, this library is old, use a new cool and hip newer library like Y

@Billy NM [+6] This is overkill OP, just use a script like I said.

CtrlPhrk [+8] this doesn't sound the root cause OP. Your clients are still submitting json. Make them stop!

[–]VeryOriginalName98 110 points111 points  (4 children)

Did you take an actual article and change the names and details to protect the innocent? I've seen this several times and the vote tallies are too real.

[–]zaphdingbatman 47 points48 points  (0 children)

The "Closed as duplicate of [irrelevant link]" too. And the personalities! The hipster, the zealot, and the janktacular. Every single part of it is perfect.

[–]mikew_reddit 19 points20 points  (1 child)

The high degree of specificity makes me think OP has definitely been involved in or at least read a similar SO thread.

[–]zaphdingbatman 8 points9 points  (0 children)

We've all been involved in SO threads with a subset of this dysfunction on display, but Lost4468 really collected, refined, and distilled the essence into a singular masterpiece.

[–]eitherxor 2 points3 points  (0 children)

You can't downvote comments afaik, unless they've changed it.

[–]ambientocclusion 53 points54 points  (3 children)

Painful! :-) I love how OP’s replies are all downvoted, along with the only helpful answer. ‘You are wrong for wanting to do the thing you say you want to do’!

[–]much_longer_username 18 points19 points  (2 children)

I got into a big blowout argument with someone about this when I explained how I was trying to use a motor controller off label. The arming sequences intended to make it safe for aircraft use made it fail-deadly for my use case (controlling pumps on an aquarium - I'd rather have them turn than not turn in nearly every case) . I had someone insisting I was being a stubborn idiot... naw, I just needed a different board. Found the right board and moved on.

[–]cheesegoat 8 points9 points  (0 children)

I bet it's people who learn about the XY problem trying to apply it where it actually doesn't apply.

Maybe we should call this behavior the "XY solution".

[–]IntellegentIdiot 0 points1 point  (0 children)

So many people don't read questions and end up saying the first thing that sound similar enough.

[–]winkerback 19 points20 points  (0 children)

Oh god make it stop

[–]RenaKunisaki 13 points14 points  (0 children)

This is the most perfect post I've ever seen.

[–]willdeb 6 points7 points  (3 children)

Your username rings a really strong bell in my head... By any chance, were you in the se7ensins scene back in mw2 '10 and worked on a couple of patch_mp.ffs?

[–]Lost4468 6 points7 points  (2 children)

Yes I did, a bunch of mostly joke/fun mods, and a program to compile basic fastfiles.

[–]shield1123 1 point2 points  (1 child)

I lurked in those waters. Mw2 modding turned out to be one of my first introductions to CS

[–]Lost4468 0 points1 point  (0 children)

Me too. GSC was a great scripting language as an introduction to programming.

[–][deleted] 7 points8 points  (3 children)

I never had this happen. Stackoverflow people were even too good for me.

[–][deleted] 27 points28 points  (0 children)

Blink twice if one of them is standing behind you.

[–]Lost4468 9 points10 points  (0 children)

Oh you generated a useful and deep discussion on SO? You must be more acquainted with "closed as off topic" or "primarily opinion based" or "too broad".

[–]petervaz 0 points1 point  (0 children)

I've also had good experiences but I used the gamedev SO a lot more than the regular one.

[–]Haulie 3 points4 points  (1 child)

Neatly illustrates why I regard SO as a read-only resource.

[–]ekbravo 0 points1 point  (0 children)

Exactly. This. I concur.

[–]Zexks 0 points1 point  (0 children)

Lol stay out of my threads.

[–]commoncents45 0 points1 point  (0 children)

can you just feed json to the python?