Thread #108264010
HomeIndexCatalogAll ThreadsNew ThreadReply
H
What are you working on, /g/?
Previous: >>108226774
+Showing all 122 replies.
>>
>>108264010
A heterogeneous embedded system
>>
>write 1 line of code to flip pin in any other system
now the fags will tell me that they are not actively trying to kill linux when this is the official example of how to flip a pin
#!/usr/bin/env python3
# SPDX-License-Identifier: GPL-2.0-or-later
# SPDX-FileCopyrightText: 2023 Kent Gibson <warthog618@gmail.com>

"""Minimal example of toggling a single line."""

import gpiod
import time

from gpiod.line import Direction, Value


def toggle_value(value):
if value == Value.INACTIVE:
return Value.ACTIVE
return Value.INACTIVE


def toggle_line_value(chip_path, line_offset):
value_str = {Value.ACTIVE: "Active", Value.INACTIVE: "Inactive"}
value = Value.ACTIVE

with gpiod.request_lines(
chip_path,
consumer="toggle-line-value",
config={
line_offset: gpiod.LineSettings(
direction=Direction.OUTPUT, output_value=value
)
},
) as request:
while True:
print("{}={}".format(line_offset, value_str[value]))
time.sleep(1)
value = toggle_value(value)
request.set_value(line_offset, value)


if __name__ == "__main__":
try:
toggle_line_value("/dev/gpiochip0", 5)
except OSError as ex:
print(ex, "\nCustomise the example configuration to suit your situation")
>>
>>108264045
That's exactly the reason I'm making a HES
Toggling a pin in embedded is literally writing a bit to a register, in linux they made this ioctl mess
>>
speeding up video loading for my youtube client
>>
>>108263982
use Haskell instead
>>
>>108264010
>What are you working on, /g/?
Debugging RTT logging to my debug probe.
>>
>>108264098
>get prototype on my board
>firmware made by some 3rd party that I need to work on
>faggot electronic team didn't wire SWO pin and the firmware uses it for logging
it's such a simple thing, why do they always make it a issue.
>yeah there is also uart tx pin test point where you can solder a wire if you need it
hey thanks fags
>>
Trying to use ESP-IDF for a project, and it seems all the actually useful functions are "deprecated" or "private" so you have to #include "esp_private/..." or write registers directly. I don't know why they're so intent on making you do things "their" way, but it makes life hard if their APIs don't fit your project.
>>
>>108264316
Just use esp-rs
>>
>>108264316
I personally prefer to read the datasheet and make my own firmware, corpo tools often suck
>>
>>108264362
>I personally prefer to read the datasheet and make my own firmware
ain't no client got time / money for that shit.
with esp the datasheets are hard to find and you likely are doing wireless so you have to use their firmware blobs.
Though mostly espressif basics APIs are stable so no idea what >>108264316 is doing
>>
>>108264362
If only, but Espressif's chip documentation is pretty bad and you need their blobs for networking as >>108264397 says.
>>108264397
>Though mostly espressif basics APIs are stable so no idea what 108264316 (You) is doing
Trying to control an unsupported display through one of the I2S cores.
The display vendor's code uses Arduino so I wanted to use ESP-IDF instead, and I'm learning the functions for controlling pin muxing yourself are all deprecated or private. Also enabling and resetting peripheral controllers is limited to private functions only (periph_module_reset, periph_module_enable). What's the point of restricting that?
>>
>>108264492
>Trying to control an unsupported display
I know your pain, just try to get something to work, there usually is no "nice solution".
>>
>>108264522
Thanks, I mostly just want to vent.
I also saw a few third-party projects online that say I2S0 does not support 8-bit output, only I2S1 does, but for the life of me I can't find that in the TRM or datasheet, so who knows. Guess I'll find out.
>>
>>108264569
Which chip in particular are you using
>>
>>108264595
ESP32-WROVER-E which has an ESP32-D0WD-V3
>>
So, apparently my arduino microcontroller has something called "fuses" that change some of the operating parameters of the MCU. How do I set them, and once I do can I then change them later or are they then permanently fused?
>>
>>108264781
How you set them depends on the specific MCU, and they're almost certainly these which are permanent.
https://en.wikipedia.org/wiki/EFuse
>>
>>108264815
Oh. Ok, thanks. The wikipedia article does mention resettable efuses.
So I should try to understand the MCU documentation.
>>
GLORY TO IRAN AND C
>>
>>108265000
Real ones use Zig in memory of Al-Zutt
>>
>>108264010
How do I learn C/C++? I want to become smart like this guy https://www.youtube.com/@dr-Jonas-Birch/videos
>>
>>108265741
Pick up a book and start doing exercises until you feel ready to tackle a project.
>>
>>108265741
BUY AN ADD JONAS
>>
>>108265741
start with bjarne's latest book Programming Principles and Practice in C++ the C++23 edition
it has a reputation of being a bit dry., although it's apparently a bit more streamlined than previous editions, but he made the language and he actually knows how to use it

whatever you do don't do what I did early on which was use a mix of old resources and "university recommended" learning materials before /dpt/ steered me towards some better intermediate level resources
books from before 2011 are from before C++ took the first steps to actually being a worthwhile language and before it fixed the first wave of serious issues with the language and standard library
god help you if you use books from before 98 when it wasn't standardized at all

after that make some shitty GUI applications in Qt or some other framework to get a feel for organizing real projects,, maybe use that time to practice using some baby mode versions of low level features like abstractions over multiple threads before you dip your toes into the real fun stuff like low level multithreading or graphics programming
the isocpp website has some interesting featured blogs that cover topics from beginner to cutting edge

you'll pick up C from working with C++ long enough
learning C first will generally fuck up good C++ habits whereas generally learning C++ will give you over time let you learn to respect and understand C programming habits from having to work with C libraries a lot
the ones that are still popular even in C++ are usually very intentional and well designed so you're getting exposed more to the cream of the crop (as long as you avoid the windows API) and what influence C will have on your habits at that point will be good as opposed to really lazy shitty beginner C++ written by a C programmer
>>
thanks for the anon posting random leet codes. good picks. fun stuff.
>>
>>108265741
I see sloppa thumnails, I click "do not recommend channel", simple as.
>>
>>108266000
Cute wallpaper
>>
>>108266273
>a visual representation of a a linked list but with anime girls
>>
>>108264098
It's working. Now I have separate channels for communication. Basic logging gets a buffer where it skips logs if probe can't catch up(also uses defmt "compression"), and perf data is just plain text with blocking on full so I can transmit larger chunks of statistics without any loss. It also no longer clutters stdout while doing so.
>>
How do I make the company dependent on me so that their choices are either to keep me happy or to spend hundreds of thousands hiring consultants to resume from where I left off?
>>
>>108266306
>all contiguous so no reason to assume linked
>>
>>108266775
Write your stuff in C, but optimized for the local platform (no fopen, no fclose, no malloc, but raw kernel interfaces).
>>
>>108266986
>Cut your own limbs while cutting the company limbs
>>
>>108266775
implement your own array lang thats subtly different from every other array lang in esoteric ways, and then slowly start porting random pieces of code to it via DLLs
>>
>>108267201
>avoiding userspace crap invented for compatibility with the smallest common denominator is "cutting your own limps"
Autist.
>>
>>108267328
Using C is the cutting your own limbs part
>>
>>108264010
>What are you working on, /g/?
https://github.com/orlfman/FFmpeg-Converter-GTK

Got avt-av1, x265, x264, and now vp9 codec tabs working.
>>
>>108267348
Why?
>>
>>108267367
C is bad boomer, sorry to break it for you. We in modern society enjoy higher level languages.
>>
>>108267352
I'm stealing this for my own, thanks
>>
>>108267373
>C IS LE BAD
>BECAUSE
>BECAUSE
>BECAUSE IT JUST IS OK
I can really feel the IQ points zoomers are lacking in your post.
>>
I'm pretty close to building an app, but I don't want to open up anything until I know it can't be easily hacked. How should I go about finding a third party security expert to manually audit the app?
>>
>>108267378
It's amazing how black you sound.
>>
>>108267380
Tell one reason to use it instead of Rust or Go. I'm waiting.
>>
>>108267408
bohoo welcome to the real world kiddo
>>
>>108267435
Decades of code generation optimizations.
>>
>>108267443
>anon steals free stuff in the real world too
Not beating the allegations.
>>
>>108267476
>t.
>>
>>108267378
by all means. i made the license the unlicense. go for it.
>>
>>108267495
I accept your concession.
>>
>>108267486
if its free how can you steal it? check and mate
>>
>>108267507
If it makes you feel better I'm not even the original guy. You lost btw ;)
>>
>>108267508
Like this: >>108267408
>>
>>108267511
i didn't damage you repo stop defamating me
>>
>>108267510
Holy cope.
>>
>>108267516
>>108267507
>>
>>108267514
>>108267378
>>
>>108267522
>>108267516
>>
>regdumper wannabe at it again
>>
Wannabe?
>>
You're obviously not the real one since you're just posting the same old screenshots from a year ago.
>>
>>108267352
quality profiles for quick settings. like, imageboard for this pakistani basket weaving forum
>>
>>108267580
I like that headcanon.
>>
>>108267633
what does console do
>>
>>108267659
Debug. For you can see what actually happened, why something error, etc. You can click the search icon near the trash icon (trash clears the console window) to search the output and such. it also shows the full ffmpeg command that was sent.
You can't actually run anything from it, its all read only output.
>>
>>108267678
And a little tour guide, The information tab shows basic information about both the input file, and the successful converted output file. To compare them.
>>
>>108267688
One thing I am really happy about getting done and working is the "Color Correction" settings. Can really mess around and alter RGB and such. Very easily.
>>
>>108267702
and the trim tab. can scrub, trim out segments, encode them or do a pure copy. the re-encode is connected to the selected codec tabs. so whatever you set in those tabs, the re-encode will use. and obviously general settings too. so you can re-encode, scale the video and all that stuff at the same time. and you can automatically conat all the segments or split them all into individual files.
>>
>>108267729
oh and to try to help get good, clean cuts, and i should make it clear in the tooltips, is it cuts to the nearest keyframe.
>>
>>108267729
nice that looks clean. feature request: a crop tab.
>>
>>108266306
How do you get from head node to the next node when both pointers are pointing to null? I think your list is implemented wrong and you probably have a memory leak.
>>
>>108267258
lol
I was going to suggest using Lisp and use many macros but this way worse.
>>
>>108266306
doubly linked list
>>
>>108269197
>How do you get from head node to the next node when both pointers are pointing to null?
Address arithmetic.
>>
>>108266306
Wow, I hate anime.
>>
>>108264010
Last programming language to be ever written —an unholy Bret Victor (visualise all the things!) mixture of Unison/Kind/Idris for semantics (functional-but-with-effects and the actual syntax is a Merkle tree over AST, all else is projection), Hazel/Lamdu/Luna for editing (niggerfaggot LLMs and humans can't write incorrect code anymore), Glamourous Toolkit for moldable development environments (your domain is your code, your code is your documentation) and Smalltalk/Erlang/Clojure for interactive development experience (fuck you, I'm gonna REPL into production to fix a bug and not break anything).

Very early in the PoC phases, but those little funky visualisation are already defined in the language itself and evaluate dynamically. Eventually, all syntax will end up being defined in the language itself (turtles all way down until you reach core), so you can dynamically scale your view of the language from hardcore bit twiddling to some low code high-level BPM workflow engine view in one language according to your current needs and not get "muh graphical programming" cancer. I guess I could've called it SCAlable LAnguage if that weren't taken something nowhere near as scalable :V

And no, won't be calling it Niggerfaggot no matter how much you insist.
>>
>>108271213
>linked list
>address arithmetic
You're doing it wrong.
>>
>>108268154
I'm on it
>>
>>108272689
>>108268154
I am enhancing the Trim tab to support interactive cropping. Will be released in the next github push when its fully ready. So far, looking really good.
>>
File: coal.png (736.9 KB)
736.9 KB
736.9 KB PNG
>>108264010
Why do people still program by hand? Is there a coal enthsiast group too that mines by hand?
>>
>>108272803
Doing a lot of testing.

I added a safety check that disabled the auto crop option in the general tab if crop only or crop and trim is selected in the crop & trim tab. to prevent conflicts.
>>
File: pepito.png (190 KB)
190 KB
190 KB PNG
>>108266306
>>108271108
This is the correct way to teach coding to kids.
>>
>>108272812
>>
>>108267373
Retard take, you moron.
>>
>>108273097
>>108273083
>>
>>108272998
per segment cropping working quite well
>>
I am too retarded to do today's leetcode question
I understand it
but I cannot code it
>>
>>108273530
Are you filtered again by bit manipulation problems? You should have posted them btw, it would have been more interesting than the other ones maybe.
>>
>>108273545
https://leetcode.com/problems/minimum-swaps-to-arrange-a-binary-grid/
No this is not a bit manipulation problem. It's implementing an efficient sorting algorithm from scratch.
>>
>>108264010
Does anyone know why serde is so fast? It parses this 2gb json file I'm using in around 0.5s. Golang for example takes 9s to do the same work using the json utilities from the stdlib.
>>
>>108273586
Go sucks, simple as. I bet there's some C libraries that would blow serde out of the water.
>>
>>108273530
>>108273552
just realized that I got asked late last year to implement a modified bubble sort algorithm in an OA
of course I couldn't do it, because why the fuck wouldn't you just use .sort() instead
seriously fuck these cocksuckers
>>
>>108273083
?
>>
>>108273641
I agree Go sucks - not having any form of simd as part of the language in the compiler makes it a bit of meme but an 18x slow down is insane. I can do better with 100 lines of code just with a garbage hand rolled parser I whipped up in 30mins that goes through the input character by character running on 1 thread (parses the same input into a slice of float32's in like 2s). These people at google are paid hundreds of thousands a year to work on the language and they could just copy paste an existing library that's not dogshit slow but rewritten in Go.
>>
>>108272812
Because compilers - specially crafted software for exactly that purpose - still fuck up the simplest of optimizations, and that's without the hallucinations that plague LLMs. And unless you - yes, you personally - find out a way to build sub-atomic transistors Moore's Law has run its course and can no longer be used to paper over software incompetence.
>>
>>108273724
Also, now that I'm going over the code again:
>vpxor
>vzeroupper
You just know that those lazy fuckers are not even tracking *what* they're writing into their YMM registers. The moment the function emits ANY AVX instructions at all they go
>we have to clean up the upper YMM registers
>because muh split register file
>>
I hate finishing a project because I never know what to do next
>>
>>108268154
crop is finished and pushed to github
>>
Grew up in a third world shithole to a standard wagecuck family. Always used to cope about how rich elites have assistants, maids, and normie minions doing all their busywork so they can just focus on whatever pet projects they actually want to do.

Unironically, thanks to local LLMs, I feel like I finally have that. I just focus on the fun parts of my stack and offload all the boilerplate formatting and tedious shit to the models. Absolute game changer. If self-hosted local models ever actually reach Opus tier reasoning, it is officially over for code monkeys.
>>
File: 42.png (13.7 KB)
13.7 KB
13.7 KB PNG
>>108274831
... you could have done that from the very beginning. Nothing ever stopped you from reading the sources of random projects to understand how they work.
>and I'm still waiting for that LLM that could've disabled both the gradient and the glitter effects for my maps
>>
File: sui2_sea.png (16.5 KB)
16.5 KB
16.5 KB PNG
>>108274847
... oh, my bad, how silly of me. Of course my project was original enough that an LLM couldn't copy it from somewhere else. Oh well.
>>
File: P2keNqD.png (680.4 KB)
680.4 KB
680.4 KB PNG
>>108274831
With Opus 4.6 it's already getting rather over, thougheverbeit. I'm relatively okay at programming, I just have this retarded executive dysfunction shit. And it makes it hard for me to actually get into developing shit, even if I have skills to do this. Enter Opus 4.6, and with it I can actually write like 4-6 things at once and they all fucking work. And at 1/110 of the prompt/guardrail/workflow effort I had to invest into previous opposi, which was already helpful at fleshing out various shit, but not really at writing good enough shit for you. It was already joever for pajeet-tier programmers, but it's starting to get fucked for actually competent one - you will still need some, until clankers actually learn to think for us, but give it a few weeks for the C-letter retards to realise they can do the same amount of work with 1/4x amount of programmers an it's gonna be a pandemonium. Which is partyl why I'm speedrunning mutliple projects, so that I at least end up getting something out of this retardation, before I get recycled into Swoylent Green.
>>
>>108274831
What programs did you make with LLMs?
>>
>>108273750
and you have personally tried to fix these issues how? until you contribute you are nothing
>>
>>108275251
>victim blaming
And that's why I rather laugh at retards than fix their shit.
>>
>>108275273
(Oh, and for the record: for my own shit I just dump the assembly using -S, run a Perl script through it, and fix the code that way. Still better than having to deal with compiler autists).
>>
>>108275235
what's that
>>
>What are you working on, /g/?
My nextjs imageboard + media tracker. Yesterday I tried setting up a full blown PWA but failed because nextjs 16 uses turbopack and the current implementations work better on webpack.
>>
I give up
>hey claude, here's my code
>here's a screenshot of what the app should look like
>do your best
ill come back in an hour
>>
>>108264010
I got this little fellow recently.
It has a bunch of I/O ports to the pico board
Want to use as a babby's first mini cyber Deck and add some external sensors.
>>
>>108276234
update: 34 compiler errors!!!!!
>>
>>108276571
fell for it again award
>>
>>108264010
>What are you working on, /g/?
I am coding rn. Highly confidential
>>
I know /gedg/ would be more appropriate but the thread is dead.
I'd appreciate if you guys could check >>>/wsr/1558690 I'm missing two videos from Pikuma's 3D Computer Graphics Programming course and can't find them anywhere.
>>
Emulating instantiation in C in structs through function pointers: yay or nay?
>>
>>108276911
Just use a real language.
>>
>>108276911
Do you want to carry function pointers *for every single object*? Do you *actually need that degree of individuality*?

In C++ this concept is implemented via vtables, which are static and created once per class. Not class object. Class.
>>
>>108276911
I use a lot of function pointers, those are fun to make abstract interfaces
>>
>finish today's leetcode daily problem
>it's a bubble sort algorithm
>this is my first exposure to it
>it's slow as shit (n^2)
>every submission takes a few ms even with a low datasize of 200
>there's no way to make it faster
what's the point of learning useless garbage like this?
>>
>>108278045
F U N
U
N

it's just a life long puzzle game. You just gotta memorize where all the fitting pieces are and then if you got a new puzzle you can reuse them
>>
>>108278045
I gave up the problem. I spent a hour or two trying to find fast algorithm and eventually looked up the answer. Fuck this I'm not doing O(n^2) solution, it's boring.

Reply to Thread #108264010


Supported: JPG, PNG, GIF, WebP, WebM, MP4, MP3 (max 4MB)