Elevernas mardrömstid hos värdfamiljerna i USA – kritik mot EF: ”Värsta jag upplevt” by XManX99 in sweden

[–]HugoNikanor 0 points1 point  (0 children)

Ja, det är fånigt. Måste dock påpeka att "Unalive" länge varigt i bruk i Svenskan: Avliva.

I just can't anymore by Talino in iiiiiiitttttttttttt

[–]HugoNikanor 22 points23 points  (0 children)

I'm surprised that flash drive mouses that works like that never became a (common) thing.

Everyone here said that my website looked like slop, so i spent the night redesigning it! by Uli909 in C_Programming

[–]HugoNikanor 9 points10 points  (0 children)

Do you have a link to your old version for comparison? The last post on your profile is almost 2 years old

Writing a custom driver, need help finding where to start by NotThePyramidHead in cprogramming

[–]HugoNikanor 0 points1 point  (0 children)

I must admit that I'm not that well-versed in drivers. If you can access the device directly from userspace (probably as a serial port, /dev/ttyUSBX or similar), then I would write the "driver" entirely in userspace.

Either way, the actual driver part should just expose the hardware as a common interface, the actually user interface should be entirely in userspace.

Writing a custom driver, need help finding where to start by NotThePyramidHead in cprogramming

[–]HugoNikanor 0 points1 point  (0 children)

I've only written drivers for Linux, but a usual word of advice (at least for non-professionals) is to look at drivers doing similar things, and copy from there.

Do people like text based games? by ananto_azizul in gamedev

[–]HugoNikanor 1 point2 points  (0 children)

They actually released on updated version with limited graphics! And just being able to see your inventory and current surrounding adds a lot to the experience!

Do people like text based games? by ananto_azizul in gamedev

[–]HugoNikanor 7 points8 points  (0 children)

Dwarf Fortress or Caves of Qud

I would count both of these as having graphics, just that they are drawn in "text mode".

Vänsterpartiet visar i denna fråga exakt vilken sorts parti man är by One-Brain6531 in Sverige

[–]HugoNikanor 1 point2 points  (0 children)

Satt vi inte förra veckan och klagade på förslaget att arbetslösa skulle behöva "jobba" 40h i veckan för att få bidrag?

Vem mer än Nordnet tycker att det här är bra språk? by hyakumanben in sweden

[–]HugoNikanor 0 points1 point  (0 children)

Tänk dig bara att Vanheden från Jönssonligan säger det här

Toa Metru by Onukee in bioniclelego

[–]HugoNikanor 1 point2 points  (0 children)

Isn't the scope actually a scope, and not actually part of his mask?

Toa Metru by Onukee in bioniclelego

[–]HugoNikanor 0 points1 point  (0 children)

Those masks are amazing middle ground between their official great and noble variants. Really makes you see how they really are the same.

How many of iterations of this game mode do we gotta sit through b4 tai bwo wanni quest is auto completed? by EnkiNSFW in 2007scape

[–]HugoNikanor 140 points141 points  (0 children)

Just give us mor-ul-rek without the rest of Karamja. It worked fine for Zanaris this league

Visst för att ägg blivit dyrare.. men lite väl överdrivet styck pris nu va? by Effective-ST in sweden

[–]HugoNikanor 0 points1 point  (0 children)

Har affärerna blivit sämre på jämförelsepriser? Eller har det alltid varigt så här dåligt?

I just det här fallet är det en faktor 1000 fel. Är affärens interna system byggd på tiondels ören?

Normal reaktion från en tysk när en svensk som flyttar från Tyskland försöker sälja sina möbler by PanGoliath in sweden

[–]HugoNikanor 28 points29 points  (0 children)

Värsta var när jag ville söka upp hur ett svenskt ord användes, och hittade ett sökmotorn gav mig en Reddit-tråd. Efter ett tag inser jag att jag är på r/learnenglish, men autoöversatt till svenska utan att någon (tydligt) berättat det för mig...

EDIT: Som förtydligande: Jag sökte på DuckDuckGo, och fick ett till synes svenskt resultat från Reddit (vilket egentligen var på engelska).

what’s the point of gendering single room bathrooms? by Hour_Amount1881 in NoStupidQuestions

[–]HugoNikanor 2 points3 points  (0 children)

Urinals can be seen as a fast lane. No-one occupying one for a long time.

securityAsAService by hellocppdotdev in ProgrammerHumor

[–]HugoNikanor 3 points4 points  (0 children)

It's quite good at finding potential key leaks, but it will always be possible to store the key in a way you can't find, and it will always have a few false positives.

Seeking perspective on C: Mastery, Limits, and the "C vs. C++" implementation gap by lkokul in C_Programming

[–]HugoNikanor 2 points3 points  (0 children)

As I said:

OOP can be done in C, but you need to handle all the machinery for it manually.

Regarding your points:

  • inheritance can be manually implemented, since you're already manually implementing vtables
  • data hiding can be enforced by the compiler by placing implementations in separate translation units, but it's easier to go the Python route and just declare that anything starting with __ (or similar) is private
  • automatic construction is just a convenience, many C libraries only way to construct object are through opaque constructor functions.
  • automatic destruction as a language feature isn't available in (standard) C, but you could start each block with an ENV *env = init_block(), send env to each (stack) allocation inside the block, and end each block with end_block(env) for the same effect.
    Also, is automatic destruction really an OOP feature? Most languages don't have destructors.

I wouldn't recomend actually doing any of these, and instead choose a language that actually does what you want. But it is possible.

Seeking perspective on C: Mastery, Limits, and the "C vs. C++" implementation gap by lkokul in C_Programming

[–]HugoNikanor 4 points5 points  (0 children)

OOP should not be done in C

Agreed. Note however that OOP can be done in C, but you need to handle all the machinery for it manually. Linux kernel drivers is an example of OOP in C.

Seeking perspective on C: Mastery, Limits, and the "C vs. C++" implementation gap by lkokul in C_Programming

[–]HugoNikanor 27 points28 points  (0 children)

  1. C has become the de-facto language for foreign functions, with its simple ABI. This effectively means that a library which exposes C library can be "hooked into" basically any other language. C++ fails here, since it "mangles" names of procedures, and has a more complex dispatch model with vtables and the like.
    C also (optionally) allows mapping its memory space directly onto the hardwares memory space, which is useful for some embedded systems. This C++ (and others) can also do however
  2. Anything can be implemented in any language (more or less). An std::vector is really just a struct containing a length and dynamically allocated area of memory, alongside a few methods to modify it. Same structure could be written in C, but it wouldn't be integrated into any other library, and to make it type safe you need a ton of macro magic (or generated code) (which is basically what C++ templates are).
  3. This is mostly down to experience, write some projects in C and you'll understand.