New around here? Register your SA Forums Account here!

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
ryanrs
Jul 12, 2011

big ugly regex doesn't seem so bad now, given these lovely alternatives

Adbot
ADBOT LOVES YOU

BobHoward
Feb 13, 2012

The only thing white people deserve is a bullet to their empty skull

ryanrs posted:

The bytecode is platform-dependent.

not entirely, the man page claims it only cares about the triplet of lua version, platform word size, and platform byte order

which makes sense, as there's no native machine code in luac output, just VM bytecode. guess they chose to define the VM as using the platform's native word size and byte order. which, in turn, also makes sense given the whole theme of easy integration into C

unfortunately you're probably needing to cross compile for a 32-bit LE lua runtime in a 64-bit LE host. i saw some references to patching luac to be a cross compiler but it may well be true that the easiest path is running luac in qemu as jabor suggested

alternatively, if you can get a luac compiled for 32-bit x86 on your dev box, which i presume is an x86 linux, that'd do the job without even needing qemu

ryanrs
Jul 12, 2011

If the endianness is the same, maybe it's sufficient to #define LUA_32BITS 1

That's what I do for the microcontrollers (although maybe it would have picked 32 anyway).


e: but also imagine someone downloading my repo and the build instructions are "First, install qemu..." This is why I'm using Python for the host-side Linux tools, it should already be there.

ryanrs fucked around with this message at 02:55 on Dec 14, 2024

redleader
Aug 18, 2005

Engage according to operational parameters

Powerful Two-Hander posted:

the way to make it "readable" was to replace newlines with spaces then pipes with newlines

then it turns out that every record reported as an error was actually not an error because their process logs attempts as errors but also attempts everything three times regardless of status so attempt one gets logged as an error but succeeds then 2&3 fail.

so in fact there were no errors at all and the error logs were complete bullshit :negative:

"retry on success" is an incredible policy

ryanrs
Jul 12, 2011

"replicate success" got mistranslated

ryanrs
Jul 12, 2011

ha ha, I've been making GBS threads on Lua's memory usage, but I have evidence there's a pretty big memory leak somewhere in my C code...

Carthag Tuek
Oct 15, 2005

altid pamo når du går
veje du burd' kende
overleved' barneår
lig' til livets ende

ryanrs posted:

ha ha, I've been making GBS threads on Lua's memory usage, but I have evidence there's a pretty big memory leak somewhere in my C code...

pro tip dont reserve an object pool and then not use it (from experience, as always)

ryanrs
Jul 12, 2011

I only call malloc in a dozen places (and not because it's hidden behind another allocator function). Most of them could be turned into arrays on the stack.

Anything with convoluted control flow or weird lifetimes has been pushed into Lua-land, so the remaining C is pretty simple.

e: the leak was obvious with one testing bisection and inspection of the code.

ryanrs fucked around with this message at 06:24 on Dec 14, 2024

Powerful Two-Hander
Mar 9, 2004

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



redleader posted:

"retry on success" is an incredible policy

it's not even retry on success it's just hard coded to try three times because the second two fails are "hey I already did this"

Carthag Tuek
Oct 15, 2005

altid pamo når du går
veje du burd' kende
overleved' barneår
lig' til livets ende

Powerful Two-Hander posted:

it's not even retry on success it's just hard coded to try three times because the second two fails are "hey I already did this"

its like hitting the elevator button, but for api calls

Powerful Two-Hander
Mar 9, 2004

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



Carthag Tuek posted:

its like hitting the elevator button, but for api calls

at work they have those annoying ones where you key the floor into a lovely touchscreen with poor response times and it tells you which one to go to and if you press the floor you're on it thinks for a few seconds and gives you a sarcastic "you are already on floor x".

it also lets you put in 99 (which sometimes happens because the POS screen is so bad) and again, sits for a few seconds and goes "there is no floor 99"

Carthag Tuek
Oct 15, 2005

altid pamo når du går
veje du burd' kende
overleved' barneår
lig' til livets ende

Powerful Two-Hander posted:

at work they have those annoying ones where you key the floor into a lovely touchscreen with poor response times and it tells you which one to go to and if you press the floor you're on it thinks for a few seconds and gives you a sarcastic "you are already on floor x".

it also lets you put in 99 (which sometimes happens because the POS screen is so bad) and again, sits for a few seconds and goes "there is no floor 99"

:thunk: the elevator touch screen is idempotent

ryanrs
Jul 12, 2011

yes but the shaft is a twenty story column of steel and concrete

CPColin
Sep 9, 2003

Big ol' smile.
:awesome:

Visions of Valerie
Jun 18, 2023

Come this autumn, we'll be miles away...

idempotent shaft? I hear they have drugs for that now

Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!


Share Bear posted:

this is growing smaller and smaller per python dev survey stats (https://lp.jetbrains.com/python-dev...source=PSF-blog) , but of course that does not catch people who dont fill out the survey

its a boogeyman and i think people who are still raw about it or have those pipelines prob have huge problems or pay anaconda support fees

(or are likely in an academic course that didnt update)

I assure you, as someone who spent his half-of-a-phd working on a theorem prover written in a bespoke object system built in python 2, not only do academics not give a poo poo about filling out developers' surveys but they also do not know that developers' surveys exist

things that they also do not know anything about : virtual environments

Quackles
Aug 11, 2018

Pixels of Light.



as a former academic, this is entirely true

Carthag Tuek
Oct 15, 2005

altid pamo når du går
veje du burd' kende
overleved' barneår
lig' til livets ende

ugh familysearch changed their login flow so now my scraping script is broken :(

ryanrs
Jul 12, 2011

I hope you eventually find them

Carthag Tuek
Oct 15, 2005

altid pamo når du går
veje du burd' kende
overleved' barneår
lig' til livets ende

ryanrs posted:

I hope you eventually find them

lol

i just wanna to download a bunch of digitized microfilm of accounting records from the early 1700s ;_;

Subjunctive
Sep 12, 2006

ask me about nix or tailscale

Carthag Tuek posted:

lol

i just wanna to download a bunch of digitized microfilm of accounting records from the early 1700s ;_;

a tale as old as time

ryanrs
Jul 12, 2011

ryanrs posted:

yeah, there is no real case where mail thieves hack my poo poo. more likely is they learn to skip this building, or come back and kick my rear end or whatever. the real threat is probably getting shot, tbh.

the sensors just detect stuff like someone opening an unused storage closet. If a couple of those go off at 3 AM, it's probably someone systematically going through the complex, and it's super easy for the cops to trap the inside. The grounds do not really have a back exit, though fleeing suspects will spend a few minutes running around before realizing this.

there are a lot of little things that make the system effective

Follow up: two of my sensors monitoring an unused storage space. Wood-grain camouflage to blend in with the surroundings.





6000mAh battery should last a couple months. I can't do firmware updates over LoRa, but I can jump to Nordic's bluetooth bootloader and reflash the microcontroller over Bluetooth LE from my phone. I have to walk near to the sensor to load new firmware, but I don't have to touch it or plug in a cable. I'm still working on the network stack, so I've had to load new firmware a couple times already.

I had to drop the LoRa modulation down to 30 bytes/sec to get full coverage of the property, which seems strange. Furthest distance is 100 meters, but with a lot of concrete and earth. The sensor antennas are little stick-on molex decals. The max distance test was to one of those antennas, flat against concrete, under a car, beneath a California soft-story garage dug into a hill. So that's pretty bad propagation circumstances, but I'm still surprised I needed to drop down to LoRa BW=62,500, SF=11.This is with 1 watt at 915 MHz.

The central server node is on a 12-element yagi, because I happened to have one in the ol' junk box. It's on one side of the property, pointing at the weakest coverage, and nearby nodes live in the sidelobes. This works quite well.

TBH it kinda feels like I'm having to work too hard for reliable coverage. Like maybe I forgot to enable the final tx power amplifier or something. But I run SDRSharp with an Airspy mini for debugging, so I'm pretty sure of what I'm putting on the air. I know 900 MHz really gets its rear end kicked by concrete and earth, but I expected I'd get more mileage out of reflections and such at 100m.

omeg
Sep 3, 2012

Dijkstracula posted:

I assure you, as someone who spent his half-of-a-phd working on a theorem prover written in a bespoke object system built in python 2, not only do academics not give a poo poo about filling out developers' surveys but they also do not know that developers' surveys exist

things that they also do not know anything about : virtual environments

as someone who had the pleasure of working with (bio)chemists writing protein folding ML algorithms in python, yeah

their stuff was apparently pretty good though, they wanted to protect their secrets before deploying for a darpa-sponsored project

it was kinda interesting I guess

Deep Dish Fuckfest
Sep 6, 2006

Advanced
Computer Touching


Toilet Rascal

Carthag Tuek posted:

lol

i just wanna to download a bunch of digitized microfilm of accounting records from the early 1700s ;_;

gently caress are you doing? tracking down some ancient fortune from the dutch golden age left in banks all over the world?

Carthag Tuek
Oct 15, 2005

altid pamo når du går
veje du burd' kende
overleved' barneår
lig' til livets ende

Deep Dish Fuckfest posted:

gently caress are you doing? tracking down some ancient fortune from the dutch golden age left in banks all over the world?

nah its danish royal land accountings, like tenant farmers, taxes & such. when youve exhausted the extant church registers & probates theyre one of the only ways to trace further back

but the familysearch image viewer is slow as balls so i prefer to just download the whole digitized film and go through it offline while annotating the images

Sapozhnik
Jan 2, 2005

Nap Ghost
achewood comic sans comic but it's the guy who invented webp redux helm

his shirt has {{- toYaml . | nindent 8 }} written on it

idk somebody else do it i'm more of what you might call an ideas guy

Carthag Tuek
Oct 15, 2005

altid pamo når du går
veje du burd' kende
overleved' barneår
lig' til livets ende

stop doing computer work on Yule eve tia

The Fool
Oct 16, 2003


Carthag Tuek posted:

stop doing computer work on Yule eve tia

I'm helping my son do a project in scratch right now and it is a little too much like pair programming with a jr engineer

root of all eval
Dec 28, 2002

The Fool posted:

I'm helping my son do a project in scratch right now and it is a little too much like pair programming with a jr engineer

This is my Christmas eve dream family memory, congrats

Powerful Two-Hander
Mar 9, 2004

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



I just get drunk and criticise my own cooking so same I guess

Antigravitas
Dec 8, 2019

Die Rettung fuer die Landwirte:

The Fool posted:

I'm helping my son do a project in scratch right now and it is a little too much like pair programming with a jr engineer

The trick to programming in scratch is to instead write your code in something else and transpile to scratch: https://github.com/aspizu/goboscript

bob dobbs is dead
Oct 8, 2017

Peeps are idiots, Leslie.
Nap Ghost
write in decker because then you can ask questions to ij in the thread. juniors deffo often need a reminder that actual peeps write the underlying libraries and poo poo and you can sometimes talk to em

for the purposes of this conversation child counts as junior

Carthag Tuek
Oct 15, 2005

altid pamo når du går
veje du burd' kende
overleved' barneår
lig' til livets ende

bob dobbs is dead posted:

write in decker because then you can ask questions to ij in the thread. juniors deffo often need a reminder that actual peeps write the underlying libraries and poo poo and you can sometimes talk to em

for the purposes of this conversation child counts as junior

this

Bloody
Mar 3, 2013

junior devs are children yes

The Fool
Oct 16, 2003


root of all eval posted:

This is my Christmas eve dream family memory, congrats

was same but now I find myself saying "How do you think we should add update every item in the list" to my son and I'm not sure anymore

The Fool
Oct 16, 2003


Antigravitas posted:

The trick to programming in scratch is to instead write your code in something else and transpile to scratch: https://github.com/aspizu/goboscript

didnt know about that, that looks cool, will have to try it

bob dobbs is dead posted:

write in decker because then you can ask questions to ij in the thread. juniors deffo often need a reminder that actual peeps write the underlying libraries and poo poo and you can sometimes talk to em

for the purposes of this conversation child counts as junior

is that the hypercard clone? it looks cool

polyester concept
Mar 29, 2017

Antigravitas posted:

The trick to programming in scratch is to instead write your code in something else and transpile to scratch: https://github.com/aspizu/goboscript

whoa this looks neat, gonna give it a try too

The Fool
Oct 16, 2003


The Fool posted:

was same but now I find myself saying "How do you think we should add update every item in the list" to my son and I'm not sure anymore

also, "that's too many comparisons for a single if statement"

bob dobbs is dead
Oct 8, 2017

Peeps are idiots, Leslie.
Nap Ghost
you're advertising the notion of touching puter to the kid, not actually teaching em serious touching, if they're doing scratch

Adbot
ADBOT LOVES YOU

The Fool
Oct 16, 2003


he's a child bob

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