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
Surprise T Rex
Apr 9, 2008

Dinosaur Gum
I handed over a project to a client recently along with a bunch of “here’s some common problems and here’s how we diagnose issues” pointing out everywhere that everything useful is logged or alerted.

they got in touch with us a few weeks ago for some help debugging a live incident, and I asked them to show me what they’ve found so far by following the documented process, and just got blank stares in response. cool cool ty.

Adbot
ADBOT LOVES YOU

bob dobbs is dead
Oct 8, 2017

Peeps are idiots, Leslie.
Nap Ghost
"client" "them doing things" smh smh

defmacro
Sep 27, 2005
cacio e ping pong

Ihmemies posted:

Is there an advent of code thread this year or a need for one? I am afraid to make threads myself

i'd post in it

Antigravitas
Dec 8, 2019

Die Rettung fuer die Landwirte:

polyester concept posted:

i'm the dev that just skims past all your hard work and then sends u a DM asking how it works

Don't lie. You are in a timezone +8h from me and your message is, in full:

polyester concept posted:

Hi

gonadic io
Feb 16, 2011

>>=
since there's no aoc thread I'll just have to post this here. i got real nostalgic about haskell since i haven't done any in years

code:
d1a :: [(Int, Int)] -> Int
d1a = sum . uncurry (zipWith (((.).(.)) abs (-))) . both sort . unzip

Visions of Valerie
Jun 18, 2023

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

gonadic io posted:

code:
((.).(.))

The Fool
Oct 16, 2003


I started this years aoc with python and pandas because I've never finished one before and want to actually get through it all this year and thought that would be the easiest

mystes
May 31, 2006

I've never finished aoc because I feel like it tends to get pretty repetitive and boring after ~2 weeks

It's still enjoyable to start especially if you are doing it in a new language that you want to learn or something like that

toiletbrush
May 17, 2010
I always give up because I seem to spend more time writing code to parse the input than working on the puzzle

Ihmemies
Oct 6, 2012

A hero actually made a thread for this years aoc https://forums.somethingawful.com/showthread.php?threadid=4076611 :sludgepal:

The Fool
Oct 16, 2003


that's part of why im just using pandas

Sagacity
May 2, 2003
Hopefully my epitaph will be funnier than my custom title.

mystes posted:

I've never finished aoc because I feel like it tends to get pretty repetitive and boring after ~2 weeks
yeah, usually about 2 weeks in the puzzles seem to revolve around knowing the right algorithm to use and then apply, instead of being somewhat creative and haphazard

mystes
May 31, 2006

toiletbrush posted:

I always give up because I seem to spend more time writing code to parse the input than working on the puzzle
I think that's actually not terrible if you're using it to learn a new language, compared to something where you just spend all the time on algorithms or whatever

well-read undead
Dec 13, 2022

Sapozhnik posted:

Needless to say, the absolute last thing anybody in this position wants to see is ninja robot zombie pirate monkeycheese bacon humor. A snarky corporate-friendly dig at some lovely third-party tool can be a nice touch to lighten the mood if used sparingly.

i eschew the humor entirely in docs i write these days and try to achieve a brevity that makes sparing use of multi-sentence paragraphs even. when i was younger i'd try to use humor to make the docs less boring but i now think there's nothing more boring than docs that are a single word longer than they need to be

ryanrs
Jul 12, 2011

wait, what's advent of code? can I still post unrelated awful code, or would that be disruptive?

mystes
May 31, 2006

ryanrs posted:

wait, what's advent of code?
An annual coding puzzle thing that has a new problem every day in December (until Christmas I think?)

quote:

can I still post unrelated awful code, or would that be disruptive?
I guess it would potentially be disruptive if you posted it in the advent of code thread which is not this thread

gonadic io
Feb 16, 2011

>>=
yes there's a dedicated thread now. It's just some annual puzzle thing. it's like work but you don't get paid
ive never finished sooner or later it gets too tedious, plus I generally "cheat" and manually convert the text input into hard coded data structures with regex

abraham linksys
Sep 6, 2010

:darksouls:
AoC is really good for interview prep for actually good interviews. unfortunately actually good interviews are about 3% of all coding interviews

ryanrs
Jul 12, 2011

I wrote a Python script to turn my Lua code into C code.

(lol that sounds more impressive than it actually is)

ryanrs
Jul 12, 2011

code:
#ifndef PACKED_FILES_H
#define PACKED_FILES_H

#include <stddef.h>

#ifdef __cplusplus
extern "C" {
#endif

struct Packed_File_t {
    const char* path;
    const char* name;
    size_t size;
    const char* data;
};

extern const struct Packed_File_t File_Loader_cmd;
extern const struct Packed_File_t File_main_lua;
extern const struct Packed_File_t File_chunk_bin;

#ifdef __cplusplus
}
#endif
#endif




#include "packed_files.h"

const struct Packed_File_t File_Loader_cmd = {
    "Loader.cmd", /* path */
    "Loader", /* name */
    187, /* size */
    "lib/luatt/lua/lib/lpriorityqueue/PriorityQueue.lua\nlib/luatt/lua/l"
    "ib/json.lua/json.lua\nlib/luatt/lua/src/scheduler.lua\nlib/luatt/lu"
    "a/src/MQ.lua\nlua/lua-struct/src/struct.lua\nlua/main.lua\n"
};

const struct Packed_File_t File_main_lua = {
    "lua/main.lua", /* path */
    "main", /* name */
    2111, /* size */
    "local scheduler = Luatt.pkgs.scheduler\nlocal struct = Luatt.pkgs.s"
    "truct\nlocal rgb = Luatt.periphs.rgb\nlocal radio = Luatt.periphs.r"
    "adio\nlocal crypto = Luatt.crypto\nlocal time = Luatt.time\n\nfunct"
    "ion from_hex(s)\n    return s:gsub(\"(%x%x)\",function (x) return s"
    "tring.char(tonumber(x,16)) end)\nend\n\nlocal function task_gps_sle"
    "ep()\n    coroutine.yield(3000)\n    local interval_ms = 300 * 1000"

ryanrs
Jul 12, 2011

The microcontroller doesn't have a file system, and I want it to be fully autonomous. This shoves my Lua files into flash as char arrays. It's awful...ly effective.

ryanrs
Jul 12, 2011

Or maybe just awful?

This board has an extra 2 MB external flash chip. Maybe I should just put a real filesystem on it?

pseudorandom name
May 6, 2007

no #embed?

Bloody
Mar 3, 2013

there’s a fat(16? 32? don’t recall) impl that fits in approximately nothing at all (I think I used it on the notoriously incapable msp430)

ryanrs
Jul 12, 2011

look out zfs, fat128 gonna take over

this time it's not just talk; doing a defrag really will boil the oceans

Powerful Two-Hander
Mar 9, 2004

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




don't forget the abs!

akadajet
Sep 14, 2003

ryanrs posted:

wait, what's advent of code? can I still post unrelated awful code, or would that be disruptive?

it's recreational leetcode, I think

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope

Sapozhnik posted:

Basically assume that whoever is reading is currently on a bridge for a P1 outage and various execs are breathing down their neck. Needless to say, the absolute last thing anybody in this position wants to see is ninja robot zombie pirate monkeycheese bacon humor.

this is exactly why "oopsy-woopsy we did a little fucky-wucky" error messages suck so much. "you just lost 4 hours of work, isn't that wacky, lol!"

Antigravitas
Dec 8, 2019

Die Rettung fuer die Landwirte:

ryanrs posted:

this time it's not just talk; doing a defrag really will boil the oceans

Ah, adding "AI" to file systems?


e:



There is beauty in the horrors I find on the Internet during my lunch break sometimes.

Antigravitas fucked around with this message at 11:22 on Dec 2, 2024

Captain Foo
May 11, 2004

we vibin'
we slidin'
we breathin'
we dyin'

Antigravitas posted:

Ah, adding "AI" to file systems?


e:



There is beauty in the horrors I find on the Internet during my lunch break sometimes.

Aaagaaagg

ryanrs
Jul 12, 2011

how do I try this without an $ANTHROPIC_API_KEY?

someone paste the output

bob dobbs is dead
Oct 8, 2017

Peeps are idiots, Leslie.
Nap Ghost
says to do a curl pipe, which is also lol

ryanrs
Jul 12, 2011

it's like they're not even trying to keep the AI from escaping

Plorkyeran
Mar 21, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
needs to tell the ai to wrap the body in a function in a curl-pipe safe manner

ExcessBLarg!
Aug 31, 2001

ryanrs posted:

Oh wow, I think I figured it out! AES CCM uses ECB encrypt, but not ECB decrypt (not even during CCM decryption).
I wrote up a snarky reply based on your earlier post, but then saw this.

Yes, the modes of AES you should be using in 2024 (CTR, CCM, GCM, etc.) only require block encryption, not decryption.

MrMoo
Sep 14, 2000

Doesn't AES verification require decryption, which then would be happier with acceleration?

ryanrs
Jul 12, 2011

Which immediately suggests the following scheme:

- Encrypt using slow software AES ECB decryption.
- Decrypt, using the fast hardware AES ECB encryption.

Yeah, that's right: I'm flipping the AES primitives around, using AES ECB decrypt to produce cipher text, and AES ECB encrypt to decrypt it. I think this is ok for AES, and maybe for all secure block ciphers? What's the name of this property so I can google it?

Running AES backwards suits my application because it is very decrypt-heavy (since it doesn't know who sent the packet before decrypting it, so many trial decryptions that fail).

e:

MrMoo posted:

Doesn't AES verification require decryption, which then would be happier with acceleration?

No, AES CCM uses CTR mode for encryption (so just XOR again to decrypt). For authentication, it uses CBC-MAC, which uses AES encrypt only. You don't have to do AES decrypt to verify the mac.

ryanrs fucked around with this message at 22:20 on Dec 3, 2024

ryanrs
Jul 12, 2011

But that's just for short update packets (sensor updates, basically). Network management packets are properly encrypted with ChaCha20(key[32], nonce[24], mac[16]). The nonces and AES session keys are also generated by ChaCha20, seeded with data from the SoC's hwrng.

Captain Foo
May 11, 2004

we vibin'
we slidin'
we breathin'
we dyin'

what radio bands are we doing here

Adbot
ADBOT LOVES YOU

ryanrs
Jul 12, 2011

The unlicensed jungle of 915 MHz ISM!

Though I also have a bunch of pin-compatible radio modules for 70cm. The SX1276 can ID in morse code if you switch it to FSK modulation.

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