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
Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope

Wheany posted:

that's a pretty nice and simple web app, just 1 html and 2 js files. i will definitely at least look at it later.

it shouldn't be too difficult to add a service worker to this to make it into an offline web app that can be installed

and done

Adbot
ADBOT LOVES YOU

Phobeste
Apr 9, 2006

never, like, count out Touchdown Tom, man
yeah i agree with PrivateSpeech mostly.

you start with your capability set and your skeleton design based on the requirements of the system. depending on the device, electrical or mechanical concerns can take the top level of structural requirements. i've worked mostly in mechanical-first systems - motion and thermal systems, in my case - where the structure of the device is determined by mechanical needs (this is the size of the gantry, this is its height, this is what the shell wants to look like, so here is the space available for boards, oh and by the way these parts of it are going to be hanging out at 80C while in use) but also a bit of electrical-first (a small portable radio where the only mechanical elements were the case, a lightpipe, and a button). either way, at this initial stage the needs of the embedded system are driven rather than driving. so you decide based on the physical layout and capability set where effectors, sensors, and interfaces are going to physically be. this lets you know what needs to be bussed, what can be integrated, and what's in between. that lets you know (or decide) how/if you want to split up your embedded controls, and therefore what the capability of each control wants to be.

once you know what your embedded controls are going to be and how they need to be split up, you can decide what you want to use. your requirements will also indicate certain capabilities that an individual micro/soc/som will have to have, in terms of kinds and counts of hardware peripherals available for simultaneous use (sometimes a micro might say it has 3 spi busses and 3 can busses, but it actually has 3 generic serial controllers that can be either and you have to choose). if this is a battery powered device, you'll also be thinking about power draws, supported sleep modes, and how the required peripherals interact with the above. your feedback as an embedded dev here is mostly about pointing out capabilities to look for in devices: we need a true scatter/gather dma for this so we can keep the main core slept, we can't push the adc sample clock above this value on this chip without changing clock domains and costing power, we need this kind of clock rate on some timer to drive an interrupt to execute stepper controls at the pace we need

once you've narrowed down the limiting capability set for each device, other preferences come into play. there are categories here: from an embedded perspective, which device you decide to use for a linux-capable system on a chip/system on a module does not have much bearing on what you use for micros or fpgas, there's just not a lot of overlap. everybody gets an input here:
- your ee/supply chain people might have opinions about suppliers injected here - maybe they want to use the same supplier for all programmable parts, maybe they have some suppliers they favor or avoid, maybe your assembly houses have opinions expressed through cost structure about which chips they prefer to do initial flash on.
- your ees will always be pushing for the smallest, cheapest, and simplest to support (in terms of supporting ics like pmics, clocks, ram, flash, number/kind/stability of power rails, pin count and package - stuff like this can determine how many layers the board needs to be which can be a big factor in bom cost, which everybody is always yelling at them to keep low).
- you (the embedded team) might (do) have opinions on which supplier's board support software is the nicest to work with.
- you'll be pushing as hard as you can to get as few different kinds of processors as possible, and quite probably as few processors as possible. every new kind of processor might be a different toolchain and will be a different board support package, compiler options, self-update process, etc etc etc
- you might evaluate a couple different dev kits here, but probably only if the other departments are pushing hard to use something you don't have much direct experience with - you're probably not going to be handed 5 different dev kits and told "ok make it work on all of them and tell us which one is best" (you may do this for other devices though - one time an ee colleague spent months working up a board to evaluate 5 different lcd screens for a demo where the outcome was "oh ok i guess we really should use a 5 inch one instead of a 3.5". he was livid)).

after all that process of half solid engineering and half horse trading based on personal preference is done you'll usually come out with one or two options that everybody's ok with and you'll pick it and be three board revs in before discovering some insanely annoying thing you have to work around but it's too late to change the chip so it'll just be annoying you for years. maybe you'll change it in a midlife refresh but hell nobody's trying to make waves then. hope it goes eol and the manufacturer specifies a dropin replacement before you go insane lol

Private Speech
Mar 30, 2011

I HAVE EVEN MORE WORTHLESS BEANIE BABIES IN MY COLLECTION THAN I HAVE WORTHLESS POSTS IN THE BEANIE BABY THREAD YET I STILL HAVE THE TEMERITY TO CRITICIZE OTHERS' COLLECTIONS

IF YOU SEE ME TALKING ABOUT BEANIE BABIES, PLEASE TELL ME TO

EAT. SHIT.



JS and Java/Kotlin is pretty lmbo

now you can have not just the server written in JS, but the rendering engine too!

it's possible I'm reading wrong because I'm a muppet and that's insane, but it doesn't sound like it to me

Ciaphas
Nov 20, 2005

> BEWARE, COWARD :ovr:


reading all of this explains all-too-clearly a lot about the current state of affairs at work (and makes me feel some sympathy for the embedded team, about some of the shittier parts of the code lol)

Notorious b.s.d.
Jan 25, 2003

by Reene
the first time i ever got burnt really bad on a pr-based workflow applied to an environment that really, really wasn't amenable to prs was a truly horrifying codebase

thousands of global variables. seriously. many, many thousands. maybe tens of thousands. i don't even know. substantially all state in the application was global.

you can guess how often merging multiple PRs had unexpected side effects that were not discovered by the test suite (hint: it was every loving time)

could this have been fixed? sure, if anything in the organization had been sane, the codebase was fixable. but the code was hosed because the org was hosed

was a pr-based workflow working for that team? definitely not

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



Notorious b.s.d. posted:

the first time i ever got burnt really bad on a pr-based workflow applied to an environment that really, really wasn't amenable to prs was a truly horrifying codebase

thousands of global variables. seriously. many, many thousands. maybe tens of thousands. i don't even know. substantially all state in the application was global.

you can guess how often merging multiple PRs had unexpected side effects that were not discovered by the test suite (hint: it was every loving time)

could this have been fixed? sure, if anything in the organization had been sane, the codebase was fixable. but the code was hosed because the org was hosed

was a pr-based workflow working for that team? definitely not

that doesnt sound amenable to fuckin anything

Aramoro
Jun 1, 2012




Notorious b.s.d. posted:

the first time i ever got burnt really bad on a pr-based workflow applied to an environment that really, really wasn't amenable to prs was a truly horrifying codebase

thousands of global variables. seriously. many, many thousands. maybe tens of thousands. i don't even know. substantially all state in the application was global.

you can guess how often merging multiple PRs had unexpected side effects that were not discovered by the test suite (hint: it was every loving time)

could this have been fixed? sure, if anything in the organization had been sane, the codebase was fixable. but the code was hosed because the org was hosed

was a pr-based workflow working for that team? definitely not

Hmm codebase and entire workplace is total dogshit?.....

... The PR process is wrong, that's my take away from this!

Share Bear
Apr 27, 2004

small frequent PRs are really great and CI/CD with jenkins is pretty amazing when you have it block a PR cause it fails tests (assuming there are tests)

works on my machine op, sounds like process is broken elsewhere

Notorious b.s.d.
Jan 25, 2003

by Reene

Aramoro posted:

Hmm codebase and entire workplace is total dogshit?.....

... The PR process is wrong, that's my take away from this!

using the wrong process for the problem at hand is not gonna turn that boat around

Notorious b.s.d.
Jan 25, 2003

by Reene

Carthag Tuek posted:

that doesnt sound amenable to fuckin anything

it was amenable to crying in a bathroom stall

DrPossum
May 15, 2004

i am not a surgeon

Aramoro
Jun 1, 2012




Notorious b.s.d. posted:

using the wrong process for the problem at hand is not gonna turn that boat around

Theres throwing out the baby with the bathwater and then there's what you're doing here which is akin to a home lobotomy to remove all knowledge there was a baby in the first place.

Notorious b.s.d.
Jan 25, 2003

by Reene

Aramoro posted:

Theres throwing out the baby with the bathwater and then there's what you're doing here which is akin to a home lobotomy to remove all knowledge there was a baby in the first place.

if i could self-lobotomize to remove all memories of that job, i totally would

redleader
Aug 18, 2005

Engage according to operational parameters
sounds like you worked at toyota

big shtick energy
May 27, 2004


Private Speech posted:

JS and Java/Kotlin is pretty lmbo

now you can have not just the server written in JS, but the rendering engine too!

it's possible I'm reading wrong because I'm a muppet and that's insane, but it doesn't sound like it to me

i can't totally picture how c++ with garbage collection would look in practice. I guess it would be a new kind of wrapper class around pointers like std::unqiue_ptr is?

Soricidus
Oct 21, 2010
freedom-hating statist shill

Notorious b.s.d. posted:

was a pr-based workflow working for that team? definitely not

it sounds to me like a “nuke it from orbit” codebase, op, so I don’t see how it has much relevance to the question of whether prs are a good default for teams who aren’t already hosed beyond any hope of recovery

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Notorious b.s.d. posted:

thousands of global variables. seriously. many, many thousands. maybe tens of thousands. i don't even know. substantially all state in the application was global.

put each global variable in its own microservice boom done

DuckConference posted:

i can't totally picture how c++ with garbage collection would look in practice. I guess it would be a new kind of wrapper class around pointers like std::unqiue_ptr is?

shared_ptr everywhere is basically garbage collection

Share Bear
Apr 27, 2004

why is the apache foundations docs so bad (parquets)

its like “heres how you build the project now good luck figuring it out”

Nomnom Cookie
Aug 30, 2009



DuckConference posted:

i can't totally picture how c++ with garbage collection would look in practice. I guess it would be a new kind of wrapper class around pointers like std::unqiue_ptr is?

it would be like regular c++ except delete is a noop and occasionally your process halts for GC

Nomnom Cookie
Aug 30, 2009



Share Bear posted:

why is the apache foundations docs so bad (parquets)

its like “heres how you build the project now good luck figuring it out”

you’re not intended to use parquet directly

Share Bear
Apr 27, 2004

Nomnom Cookie posted:

you’re not intended to use parquet directly

i'm attempting to contrast and compare different hadoop storage technologies in terms of my team's use case which necessitates this as far as i know

what am i supposed to do to write in this format? here's the project: https://github.com/apache/parquet-mr

what am i supposed to use here to serialize out some arbitrary data? how? there's no guidance

edit: added "arbitrary data" because common cases of protobufs and other input data types are in the project if you read through the source code, but source code is not documentation

Share Bear fucked around with this message at 02:53 on Jun 2, 2020

big shtick energy
May 27, 2004


pokeyman posted:

shared_ptr everywhere is basically garbage collection

shared_ptr everywhere sounds like the opposite of a good idea

redleader
Aug 18, 2005

Engage according to operational parameters

Share Bear posted:

why is the apache foundations docs so bad (parquets)

its like “heres how you build the project now good luck figuring it out”

you're not intended to use apache foundation projects directly

Cosa Nostra Aetate
Jan 1, 2019

Share Bear posted:

why is the apache foundations docs so bad (parquets)

its like “heres how you build the project now good luck figuring it out”

It's built on thrift compact protocol, which was specified by implementation: https://github.com/apache/thrift/blob/master/doc/specs/thrift-compact-protocol.md#double-encoding

quote:

Values of type double are first converted to an int64 according to the IEEE 754 floating-point "double format" bit layout. Most run-times provide a library to make this conversion. But while the binary protocol encodes the int64 in 8 bytes in big endian order, the compact protocol encodes it in little endian order - this is due to an early implementation bug that finally became the de-facto standard.

Antigravitas
Dec 8, 2019

Die Rettung fuer die Landwirte:

2013 lurker rereg posted:

this is due to an early implementation bug that finally became the de-facto standard.

[muffled screaming intensifies]

Xarn
Jun 26, 2015

NihilCredo
Jun 6, 2011

iram omni possibili modo preme:
plus una illa te diffamabit, quam multæ virtutes commendabunt


quote:

Booleans are encoded differently depending on whether it is a field value (in a struct) or an element value (in a set, list or map). Field values are encoded directly in the field header. Element values of type bool are sent as an int8; true as 1 and false as 0.

quote:

The following field-types can be encoded:

BOOLEAN_TRUE, encoded as 1
BOOLEAN_FALSE, encoded as 2
BYTE, encoded as 3
I16, encoded as 4
(etc.)

distortion park
Apr 25, 2011



lol incredible stuff

e: reading more technically that could be an optimisation, saving a single bit since there are spare values for the field headers, but it's still pretty lol

distortion park fucked around with this message at 13:25 on Jun 2, 2020

Nomnom Cookie
Aug 30, 2009



Share Bear posted:

i'm attempting to contrast and compare different hadoop storage technologies in terms of my team's use case which necessitates this as far as i know

what am i supposed to do to write in this format? here's the project: https://github.com/apache/parquet-mr

what am i supposed to use here to serialize out some arbitrary data? how? there's no guidance

edit: added "arbitrary data" because common cases of protobufs and other input data types are in the project if you read through the source code, but source code is not documentation

you’re supposed to use hive or something else higher level that will
construct the parquet schema (MessageType) for you. it’s a huge pain. seriously. if at all possible use spark, hive, whatever. ParquetOutputFormat is not your friend. but of course you insist, so read and comprehend the markdown at github.com/apache/parquet-format. then you will be able to produce parquet files that other tools have a prayer of consuming

if you’re not comfortable with source instead of documentation, give up now. you will fail

Sapozhnik
Jan 2, 2005

Nap Ghost
Really wish I worked with people who didn't treat the AWS Products page like a goddamn bingo card.

Share Bear
Apr 27, 2004

quote:

you’re supposed to use hive or something else higher level that will
construct the parquet schema (MessageType) for you. it’s a huge pain. seriously. if at all possible use spark, hive, whatever. ParquetOutputFormat is not your friend. but of course you insist, so read and comprehend the markdown at github.com/apache/parquet-format. then you will be able to produce parquet files that other tools have a prayer of consuming

if you’re not comfortable with source instead of documentation, give up now. you will fail

Thank you, I'll look into spark (and arrow, apparently) in this case.

I'm still miffed that they don't have good documentation across all their projects to indicate this and wonder why they don't think making it is worth it.

This is an attitude held by many other programmers and it bugs me.

Powerful Two-Hander
Mar 10, 2004

Mods please change my name to "Tooter Skeleton" TIA.


me coding: haha gently caress yes! I rule!

me testing: poo poo! gently caress! What is going on here?

Ciaphas
Nov 20, 2005

> BEWARE, COWARD :ovr:


Powerful Two-Hander posted:

me testing: poo poo! gently caress! What is going on here?

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat
last couple weeks i've spent time wrapping a callback based serial interface into a message based reactive one to make using it easier. basically i serialize all the events into a queue that runs on a single worker thread, and implements a protocol that the target device does that is basically a frame delimited messaging system with a "message id" to match responses to what originally sent them. even handles things like periodic ping/pong to detect if the serial device is still connected or not ready, etc.

the original driver interface has a callback for receiving data that comes from a random thread and it was chaos. now the code looks like:

code:
serialInterface.getSignalStrength()
  .map { response -> response.strength > 0.5 }
  .onErrorMap(SerialNotConnectedException.class) {
    println("serial device not connected")
    false 
  }
  .onErrorMap(TimeoutException.class) {
    println("message timed out")
    false
  }
  .subscribe { println("status is good: $it") }
and now it's braindead simple for developers to interact with the serial layer without worrying about interleaving threads/etc. basically it's as simple as a HTTP call now.

ended up being quite a bit of code to handle all the proper failover, resuming, assembling of frames, response to request mapping, etc.

anyways it's probably the first time i've written something i can be proud of in the past few months.

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?

Carthag Tuek posted:

lmao this is the worst

code:
if self.exif['Image Compression'].printable == 'JPEG (old-style)':
  a = tifffile.imread(self.imagepath)
  self._image = PIL.Image.fromarray(a) # TODO loses original DPI...
else:
  self._image = PIL.Image.open(self.imagepath)
tiff is such a shitshow

unless you’re working with images over 2GB in size, this isn’t a problem with TIFF, it’s a problem with whatever framework or library you’re using to work with it

if you want to work with the encoded data and file structure, you need to use a library that lets you work at that level, such as libtiff and whatever Python wrappers exist

which is also, incidentally, how you should figure out a file’s encoding if you really do need to know, not by relying on it having some EXIF data to repeat that information filtered through a different lens

if you want to work at an abstract bitmap level, you need to use a higher level library that sits atop something like libtiff at which point you shouldn’t have to care about what type of compression is used, since that should be transparent

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



yeah but tifffile does use libtiff (via imagecodes)
https://pypi.org/project/tifffile/
https://pypi.org/project/imagecodecs/

except it doesnt work for a subset of my tiff files, but for those files, pillow does work

no error messages when it happens, just malformed images

after some spelunking, i identified which images work with the one and which work with the other based on the compression so :shrug:

Phobeste
Apr 9, 2006

never, like, count out Touchdown Tom, man
every time I see the world tifffile I come perilously close to getting stuck in a mental loop counting fs. help

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope

Powerful Two-Hander
Mar 10, 2004

Mods please change my name to "Tooter Skeleton" TIA.


jfc this service is pissing me off. Spent about 4 hours trying to work out why it was failing with some anonymous error about task execution before realising there was one additional async void method I'd missed which has the wonderful effect of hiding where an exception had come from and is a warning not an error and I'd accidentally hidden warnings


sort that out and its a bare null reference exception in a method with no pointer to the cause and I cannot find the loving cause anywhere *and* there is no exception when using debug on the same data to trace it.

this is going to have to be a "spam trace logs everywhere" solution

and its too early to drink

edit: trace spam does it again. There are 3 sequential error checks on whether incoming data is valid but if check 2 fails check 3 shouldn't be performed, if it is then some of the data for it may be missing and you get a null reference.

and this is caused by data inconsistencies between environments so debug doesn't have it but the deployed test does

fffffffuuuucckkkkkkk

Powerful Two-Hander fucked around with this message at 14:25 on Jun 4, 2020

Adbot
ADBOT LOVES YOU

cool av
Mar 2, 2013

null was a mistake

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