Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
C

Chad3F

@Chad3F
About
Posts
80
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Pi-hole and ISP-provided routers...
    C Chad3F

    If no one else has suggested it, how about this possibility: Configure your router as a bridge (WAN<->LAN), instead of NAT. Block all DHCP traffic from their router and do your own DHCP server with compatible address pool settings. So all devices will still route through their device, but you fully control the DHCP settings.

    The Lounge question sysadmin linux algorithms workspace

  • Pi-hole and ISP-provided routers...
    C Chad3F

    Your router doesn't support bridge mode, or theirs doesn't? Are you limited to OEM firmware on your router, or can you install open source firmware (e.g. OpenWRT) to expand its functionality?

    The Lounge question sysadmin linux algorithms workspace

  • MicroSD cards...suitable for a wallet?
    C Chad3F

    If you felt like using those worthless (and probably very unreliable) SD cards to mess with people, here is a thought: - Create several empty bitcoin addresses/wallets (make sure the addresses have never been seen publicly and is an old format). - Encrypt the wallet contents (but not the filesystem, so filenames are visible). - Put the wallet file on the SD card with some obvious name (e.g. bitcoin_wallet.xxxx) and make the file date from the early bitcoin days (say, around 2011). Be sure all directory timestamps are almost as old. - "Lose" the SD card in some parking lot where it will likely be found. Now when someone finds it, they might look at it, see a very old bitcoin wallet and think "a lost wallet from the early bitcoin days might be worth a HUGE amount today".. Then waste a bunch of time trying to decrypt it, only to find it empty if they succeed. I don't know.. too sadistic? :laugh: :doh:

    The Lounge question mobile docker help discussion

  • Pi-hole and ISP-provided routers...
    C Chad3F

    Just to throw my 2 cents in.. I would advise to avoid using a modem/router combo device, especially an ISP provided one. When possible, always use independent modem and router devices. Reasons: - You don't want the ISP to have direct access to your internal network. This also includes anyone unauthorized who accesses the device due to the ISP's lack of security. - These things hit EoL far too quickly. Why pay twice the money to replace a device if it no longer gets security updates, or you just want better features. Also installing an opensource firmware to get extra life out of an older device isn't going to support many, if any, combo devices. - Technology lock-in. If you have a cable modem/router and want to move to an ISP with DSL, fiber, satellite, etc, you'll have to start from scratch with router setup. But with a separate device, you just plug your old configured router into the new modem and you're done. - Better hardware selection. Why be limited to a much smaller set of combo device choices when shopping for specific features, e.g. USB/NAS, detachable WiFi antennas, gigabit ethernet ports, PoE ports. - [Often] better customization (the issue behind the OP).

    The Lounge question sysadmin linux algorithms workspace

  • Does it make sense to defrag a SSD?
    C Chad3F

    Short answer: No. Long answer: Unlike mechanical drives, data blocks aren't stored physically in the same order as they are logically. Blocks are physically fragmented internally in most cases, regardless (including what order the OS believes them to be in). But this doesn't matter, since all blocks are accessed at the same speed (**), eliminating any speed advantage of sequential access (++). ** Hypothetically, a high end drive could read/write multiple physical flash chips simultaneously, allowing a block to be accessed without waiting for a prior one to finish, if stored on a different chip. ++ Some Flash Translation Layer (FTL) structures may have a slight speed advantage from accessing co-located logical blocks (such as unfragmented reads). But the speed improvement would be trivial compared to the speed increase of sequential access of mechanical drives. While a given manufacture's implementation may vary, the mapping of blocks generally works something like describe on one of these pages: Overview of SSD Structure and Basic Working Principle(2) Coding for SSDs – Part 3: Pages, Blocks, and the Flash Translation Layer | Code Capsule

    The Lounge question

  • A future without x86?
    C Chad3F

    ARM is sooo last year. I hear RISC-V is the new ARM.

    The Lounge design mobile com graphics hardware

  • "Forced win11" - It's happening.
    C Chad3F

    I don't know if it would work for sure, but disabling TPM in the BIOS/UEFI might be an option.. assuming you didn't need it for anything in Windows 10. Since Windows 11 requires TPM, it should refuse to upgrade, even if you tried.

    The Lounge help

  • What is your language feature wish list?
    C Chad3F

    C: - A standard (and simple) way to declare a parameter (or local variable) as not-nullable. Clang supports such an extension, as does gcc (but in a less clean way). It would be better to have a portable tag to do it defined in the language standards. Honestly, this should have been done in back in C99, and would have probably stopped many bugs over the last decade or two. - Variable value bound declarations. So if a parameter is declared unsigned int, but really only has a meaningful range of 0-100, it could flag it during compile time that it is an error. Probably more useful to set reasonable bounds on items which could cause integer overflows (or static buffer overflows when still used due to legacy code).. For example:

    typedef struct
    {
    int id;
    char name[20];
    } myrecord_t;

    myrecord_t * alloc_list(__bound__(0, 10000000) unsigned int size)
    {
    /* size > 178956970 on 32-bit ===> overflow */
    return malloc(size * sizeof(myrecord_t));
    }

    void safecaller(__bound__(1, 100000) unsigned int size)
    {
    /* Okay - [1-1000000] with-in [0, 10000000] bounds */
    myrecord_t * list = alloc_list(size);

    /* ... */
    }

    void badcaller(unsigned int size)
    {
    /* Compile ERROR - default (32-bit) unsigned int not with-in [0, 10000000] bounds */
    myrecord_t * list = alloc_list(size);

    /* ... */
    }

    The Lounge c++ question csharp wpf ai-coding

  • Lights on your PC, love or hate them?
    C Chad3F

    When my previous laptop was on its last legs and I was finally forced to replace it, I wanted something higher spec so it would last a few years. I ended up getting one targeting gamers. This, of course, came with an RGB backlight keyboard, which out of the box was configured to constantly change colors. And even when in sleep mode, the entire keyboard would pulsate on and off, not just the power light. So I had to put a stop to all of that nonsense with in the first couple days of using it. It's hard enough to sleep when a device is lighting up half the room, and crazy when it feels like there's a christmas tree in the room with light levels flickering and/or changing colors. Maybe the best way to fight this trend is to get the eco activists in a frenzy about all the extra electricity wasted on unnecessary lighting. :laugh: FYI - When devices that are on at night come with super bright LED indicators built in, a Sharpie is your friend to tone down the brightness it gives off.

    The Lounge java regex performance tutorial question

  • How hard is it to implement a 1984 "simple" hardware communication protocol?
    C Chad3F

    Assuming you haven't already figured it out, if using a MIDI specific breakout board, are all the pins wired (with appropriate resistors), as show in https://www.midi.org/specifications-old/item/midi-din-electrical-specification ? It also notes that pin 2 must be grounded only on the transmitter (which may or may not make a difference, if the breakout was made for a receiver).

    The Lounge hardware question

  • Why am I having such a hard time learning Rust?
    C Chad3F

    Rust might be best described as taking the traditional coding paradigm and turning it on its head. ... then chucking it into a blender and setting it on puree.

    The Lounge visual-studio docker help question learning

  • I hate linux. I hate SSL more.
    C Chad3F

    Just wondering how/if this is a linux specific problem, and not just a certbot problem (or something else)? Would the same [equivalent] steps have worked any better on Windows? Pictures of error messages, please "or it didn't happen ™". :-D Its been awhile, but I think I has a horrible experience with the certbot script and just set it up manually (using instructions similar to, if not the same as: https://ivopetkov.com/b/let-s-encrypt-on-ec2/, and never looked back. However, the referenced github repo doesn't seem to exist as-such anymore (and redirects to the certbot repo). But that does still includes the letsencrypt-auto script (for now).

    The Lounge linux security help question learning

  • DNS : totally stumped
    C Chad3F

    In case that stale record causes other problems down the road.. Is the serial number of the newer DNS update greater than the stale record's? If you manually control the DNS entry (i.e. it's not managed), make sure it was updated too. Also, make sure it is greater than the old one, not just different. If you switch DNS servers and it uses a different encoding scheme than the old one did, it could be using smaller serial numbers. Ignore this if someone else had already suggested it, as I did not read each reply.

    The Lounge csharp com sysadmin testing beta-testing

  • New code in C? Where and why, versus C++?
    C Chad3F

    I can't really advise you to use one over the other (as it's your personal preference), but I can tell you that I generally avoid doing C++ code over C for my own stuff. Why? Perhaps I've been burned/annoyed by C++ too much over the decades (some of which may not be relevant anymore, but still has left a bitter taste).. [rant-begin] -- Mangling inconsistencies between compilers. -- No unified naming conventions. Camel Case vs Pascal Case vs Snake Case. -- Too much hungarian notation crap seen. -- Headers with .hpp extension vs just .h (or worse, "standard" headers with no extension, causing pointless dummy files that include the real .h file in some implementations). -- Overloading abused to non-intuitive things way too often. -- Bloated / over-complex standard libraries. -- The "new" C++ really should have been called something other than C++, since it has radically changed from early C++. -- A bunch of translating back and forth needed when dealing with C APIs (most often C strings), which adds extra overhead. -- .cpp files extensions. Always makes me think "C Pre-Processor", which predated C++. I mean, what where they thinking?! Though, .hpp files annoy me more. I use .cc when I must do C++ for my own projects. -- Wrapping everything in "new" C++ (for memory/cleanup safety). Sure, it helps, but at what cost of hidden overhead, and is still no substitute for avoiding sloppy/undisciplined coding. -- Bloated / over-complex standard libraries.. "I know that, technically, that’s only one drawback, but it was such a big one I thought I’d mention it twice." --Kryten/Red Dwarf [rant-end] In some cases I will still write a C++ wrapper for my C code, if it's a library, just for people who prefer using an OO API. Now don't get me wrong.. some of the features of C++ are nice (like function grouping, protected methods, polymorphism), but often not worth the price of all the negatives.

    The Lounge c++ question data-structures oop tutorial

  • So my little arduino clone is fun but I was wondering something
    C Chad3F

    Assuming it's protocol compatible with HD44780, hardwiring the command 0b00001111 and then toggling the clock/enable bit should turn the display on, show the cursor, and make the cursor blink. Also, make sure RS & R/W are set to 0/GND, obviously VCC and GND are connected, and the backlight power is connected, if applicable (pins 15/16). Of course, the assumes it powers on in 8-bit mode. If it powers up in 4-bit mode, it becomes messier. This wikipedia page gives a command sequence that will ensure the mode is consistent: Hitachi HD44780 LCD controller. Note: I haven't actually tried this, but based on the wiki and datasheet, it should be the minimum needed to wire up (if manually toggling the clock with a button or wire touch, no arduino needed).

    The Lounge hardware help question

  • Multithreaded code is ridiculous
    C Chad3F

    I know the java UI (Swing) tries to simplify the UI thread sync issue by having everything run in the event dispatcher thread (using SwingUtilities.invokeLater() or SwingUtilities.invokeAndWait()), so all the UI updates are done in the same thread. I don't know if using something similar would apply in your case.

    The Lounge design algorithms regex tutorial question

  • Why does most C/C++ developer prefers char *c instead of char* c?
    C Chad3F

    To me, char* c looks badly formatted, same as if someone did x+ 3. :wtf: Traditionally, I would use char *c, but after using java for several years, I prefer to use char * c now.

    The Lounge question c++

  • When to use dependency injection?
    C Chad3F

    Has everyone written their Y2.038K unit tests yet? We don't want to wait till the last minute, like Y2K, when the legacy 32-bit time_t range is about to run out. :)

    The Lounge csharp ruby com graphics game-dev

  • Try....Catch
    C Chad3F

    Perhaps you just need a programing language with layman's syntax:

    fish
    {
    ...
    }
    catch(e)
    {
    // Cleanup
    ...

    // Propagate error
    e.release()
    }

    :)

    The Lounge csharp

  • PNG Problem
    C Chad3F

    Just curious, did you try using +'s instead of %20's in the URLs? While they *should* be decoded to the same thing, maybe the server was treating them different.

    The Lounge html com help question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups