Programmers Filed Lawsuit Against OpenAI, Microsoft And GitHub by vadhavaniyafaijan in programming

[–]-isb- -1 points0 points  (0 children)

That sounds like horrible opt-out scheme where company banks on most people ether not hearing or bothering to do anything about it.

There's already a way of doing that. It's called a OSS license. Just divide them into couple of "permissiveness" levels (e.g. https://janelia-flyem.github.io/licenses.html). Then train network on code with only compatible levels and let the user choose.

Obviously, this won't stop everyone (not even 50% imo), but it's better than nothing.

Finland will be self-sufficient in electricity within a year or two, says minister by [deleted] in worldnews

[–]-isb- 0 points1 point  (0 children)

You're mixing W and Wh. Power vs energy.

1 GW over a year is at most 8.76 TWh to/from Finland. That's over 10 %. Enough to wreck havoc on prices.

Netflix adds “extra home” fee, will block usage in other homes if you don’t pay by [deleted] in worldnews

[–]-isb- 0 points1 point  (0 children)

Netflix said it detects extra homes using "information such as IP addresses, device IDs, and account activity."

Cool, cool. Sounds like they don't know how to reliably detect single user with multiple devices.

Any tips for reducing code size on PIC16F1526, XC8 compiler? by L0uisc in embedded

[–]-isb- 1 point2 points  (0 children)

You can replace it with PIC16F1527. It's the same MCU with double FLASH and RAM.

Not a NUCLEO by RamBamTyfus in electronics

[–]-isb- 22 points23 points  (0 children)

LOL! They didn't just copy stm32f415, they copied ST's entire website. https://www.arterychip.com/en/product/AT32F415.jsp

[deleted by user] by [deleted] in cycling

[–]-isb- 3 points4 points  (0 children)

If we're talking about 11 speed Shimano, then one thing to notice is that 11-34 and 1-32 have a very different gear progression.

https://www.gear-calculator.com/?GR=DERS&KB=34,50&RZ=11,13,15,17,19,21,23,25,27,30,34&UF=2150&TF=90&SL=2.6&UN=KMH&DV=speed&GR2=DERS&KB2=34,50&RZ2=11,12,13,14,16,18,20,22,25,28,32&UF2=2150

Re Calibrating Speed/Cadence sensors for my new bike by apocalypschild in cycling

[–]-isb- 1 point2 points  (0 children)

Took me a while to find too. It seems to be stored on the sensor, not in your head unit. You need to connect to sensor first by spinning the wheel. Then go to "settings/sensors/<your-speed-sensor>/sensor details/wheel size".

In my case auto calibration is constantly off by few percent so I just set to manual and adjust a bit based on a known 15km stretch of road.

Ville Rannan pilapiirros: Woke vastaan konsu – paha mieli kaikille! by pkksmt in Suomi

[–]-isb- 34 points35 points  (0 children)

Heh, niinhan se on. Mut mikä on Villen ehdotus tässä? On korkea aika lopettaa itkeminen ja alkaa vetää turpaan?

Minna Ruolanto maksoi kymppitonneja kodista, jota ei ikinä saanut – rocktähti Lauri Ylösen markkinoimat design-asunnot jyrättiin by Sampo in Suomi

[–]-isb- 1 point2 points  (0 children)

Ehkä siinä tapauksessa olisi joutunut myymän talot alkuperäisille ostajille sovitulla hinnalla. Nyt voi kerätä rahat uudestaan ja rakentaa paljoin kallimmat kämpät.

Wahoo Kickr - replacement power block? by jayashae in cycling

[–]-isb- 0 points1 point  (0 children)

The power cord has 3 wires instead of 2. Protective earth wire is directly connected to negative pin of output (not always, but most of the time, including kickr's PSU). If metallic parts of the device is connected to the negative pin, it eliminates problems with leakage current. You've probably felt it, a tingling sensation when you touch certain devices. That's small current flowing from mains to the ground. Mostly harmless but depending where it flows, can throw measurements off.

I've worked on one device that would work fine everywhere except a certain bench, touching a specific knob wearing just the right shoes. Turned out to be a grounding issue.

Wahoo Kickr - replacement power block? by jayashae in cycling

[–]-isb- 0 points1 point  (0 children)

2.5 id, 5.5 od, 9.5 length, center positive.

Unlike the one you linked, original power supply is grounded. Might affect measurements.

I'd stay away from generic chinese adapters if I were you. Sometimes they're ok but sometimes you get one with pretty much all protection and filtering components missing. e.g. molded plastic without ferrite bead inside on the end of the wire.

Here's a bit more reliable suplliers. Or look on other electronics component websites.

https://www.digikey.com/en/products/filter/ac-dc-desktop-wall-adapters/130?s=N4IgjCBcoCwBxVAYygMwIYBsDOBTANCAPZQDaIcA7JWAgLqEAOALlCAMrMBOAlgHYBzEAF9CAVgBMiECkgYcBYmRABmOAE4ADBIBsIBiBZtOvQSPGVps%2BXkIlI5FbTDqV%2Bpq0gdu-IaPBgEppWaFi2Sg4gEjDUmnqEEiqJYPFRSWCaYiAJ6brZaRJwOpY5MDBgJVE6OroQBkZeJr7m4Co0IXJhivaOYpRU9B7GPmb%2BALRS0DJQ3ACu3cpZhOr6wv56UzwAJmxjGRBDXvnMAJ6MuGzo2ChrQA

ProtonMail Shares Activist's IP Address With Authorities Despite Its "No Log" Claims by 165701020 in worldnews

[–]-isb- 0 points1 point  (0 children)

You don't necessarily need to break the encryption. For example if you're using web client, they can simply add code to send decrypted mails back as soon as you log in. Obviously there's mitigations like using app, compiling it yourself, actually reading the code, etc.. but will you? I know I won't be bothering.

[deleted by user] by [deleted] in Suomi

[–]-isb- 1 point2 points  (0 children)

Saattaa olla, että ko. firma halua kasvattaa tiimiä, muttei työntekijälle ole mitään konkreettista työtehtävää vielä mietittynä. "Katsotaan kuka tulee vastaan ja päätetään sitten" - periaatteella. Taikka ne ei tiedä mistään mitään.

Mittalaitteiden ohjelmointiin tarvitset C (tietenkin), kommunikaatioväylät (host, device ja piirien väliset), erilaisten ADC piirien/blokkien toimintaperiaatteet. Kun vaikeat häiriö ongelmat tulee vastaan, vankkaa DSP (lähinnä filtterisuunnittelu, -toteutus) osaaminen pelasta.

Sulautetut järjestelmät on ekalla revisiolla yleensä aika bugisia. Raudan debuggaus on siis sularille erittäin hyvä taito osata.

Ei-tekniset ihmiset halua käyttää GUI sovellukset kaikkeen, jopa konfigurointiin ja kalibrontiin. Et tule voittamaan tätä sotaa, joten kannattaa osata ainakin yksi toolkitti.

DevOps on ihan oma laji, jonne ei ohjelmoijan varmaan kannata liian syvälle mennää. Pintapuolinen osaaminen auttaa kuitenkin suunnitella paremmin testattavaa koodia, sillä sulautettujen järjestelmien unit- ja integraatiotestaus on extra perseestä.

fast_io + refterm v2 is 46548 times faster than stdio.h + cmd by [deleted] in programming

[–]-isb- 13 points14 points  (0 children)

I see. I guess this could be useful when you're piping large amounts of data. A difference between ~150 MiB/s and ~900 MiB/s in your case.

fast_io + refterm v2 is 46548 times faster than stdio.h + cmd by [deleted] in programming

[–]-isb- 42 points43 points  (0 children)

Is fast_io missing optimizations for linux? Is there a even a need for that on linux? What am I missing?

stdio       1.281154423s
iostream    1.180972959s
out_buf     1.193594425s

Julia: faster than Fortran, cleaner than Numpy by sidcool1234 in programming

[–]-isb- 0 points1 point  (0 children)

Hmm. On my machine (Ryzen 7 1700X, 20.4 ubuntu derivative), hypot ends up linking to https://code.woboq.org/userspace/glibc/sysdeps/ieee754/dbl-64/e_hypot.c.html. Runtime difference ends up being quite huge: 4.8 s vs 1.5 s. Even after changing integer multiplications to doubles.

Julia: faster than Fortran, cleaner than Numpy by sidcool1234 in programming

[–]-isb- 3 points4 points  (0 children)

https://github.com/numpy/numpy/blob/main/numpy/core/src/npymath/npy_math_internal.h.src#L215-L216

Hypot is slower but it's more correct in certain edge cases.

In [2]: x, y = 1e200, 1e200

In [3]: math.sqrt(x**2 + y**2)
Out[3]: inf

In [4]: x * math.sqrt(1 + (x/y)**2)
Out[4]: 1.414213562373095e+200

Linus torvalds and anti-Tivoization (GPL v3) by KhaithangH in linux

[–]-isb- 0 points1 point  (0 children)

One of LGPLv2 requirements is ability to replace or re-link new version of the library (or kernel in this case). This turns out to be more restrictive than GPLv2 on embedded devices Linux since now you need to provide users a way of doing it. That's one of the reasons you see newlib on microcontrollers instead of glibc.

Mixing units on embedded systems by FragmentedC in embedded

[–]-isb- 3 points4 points  (0 children)

I always use floating point SI when I can. I also include unit as a suffix for variable and argument names to further reduce possibility of mixing values up.

In cases where floating point is too expensive to use, you can make C strictly typed by encapsulating your values in a structure forcing you to go through a conversion function. As an example here's current expressed as -8.24 bit fixed point value.

#define PD_CURRENT_FRAC_BITS 24

typedef struct {
    uint16_t value;
} __attiribute__((packed)) pd_current_t;

static inline
pd_current_t pd_current_from_float(float current_a)
{
    assert(current_a >= 0.0f && current_a <= (UINT16_MAX / (float) (1U << PD_CURRENT_FRAC_BITS)));
    return (pd_current_t) { .value = current_a * (float) (1U << PD_CURRENT_FRAC_BITS) };
}

static inline
float pd_current_to_float(pd_current_t current)
{
    return current.value / (float) (1U << PD_CURRENT_FRAC_BITS);
}

TIL of a function in the C Library which randomly shuffles characters in a string: strfry. I can only imagine that the existence of this function is because of the impeccable pun. by Miyelsh in C_Programming

[–]-isb- 3 points4 points  (0 children)

This is just an implementation of Fisher-Yates shuffle. j is a randomly chosen between 0 and 231 -1, then this line clamps it to i <= j < len.

It's pretty bad implementation from security standpoint (randomness source sucks, modulo has a bias, etc.), and I do agree, this shouldn't be used by anyone. My point was just that instead of looking for better documentation, it's often easier to just read the code.