There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

programmer_humor

This magazine is from a federated server and may be incomplete. Browse more on the original instance.

TunaCowboy , (edited ) in Brace Style

What if I prefer this?


<span style="color:#323232;">#define CURLYOPENRIGHTCLOSEDLEFTBRACKET {
</span><span style="color:#323232;">#define CURLYOPENLEFTCLOSEDRIGHTBRACKET }
</span><span style="color:#323232;">#define CURVYOPENRIGHTCLOSEDLEFTBRACKET (
</span><span style="color:#323232;">#define CURVYOPENLEFTCLOSEDRIGHTBRACKET )
</span><span style="color:#323232;">#define PERIODWITHPERIODONTOP :
</span><span style="color:#323232;">#define COMMAWITHPERIODONTOP ;
</span><span style="color:#323232;">
</span><span style="color:#323232;">int main CURVYOPENRIGHTCLOSEDLEFTBRACKET CURVYOPENLEFTCLOSEDRIGHTBRACKET CURLYOPENRIGHTCLOSEDLEFTBRACKET
</span><span style="color:#323232;">  if CURVYOPENRIGHTCLOSEDLEFTBRACKET 1 CURVYOPENLEFTCLOSEDRIGHTBRACKET CURLYOPENRIGHTCLOSEDLEFTBRACKET
</span><span style="color:#323232;">    asm volatile CURVYOPENRIGHTCLOSEDLEFTBRACKET
</span><span style="color:#323232;">      "mov $1, %%raxn"
</span><span style="color:#323232;">      "mov $1, %%rdin"
</span><span style="color:#323232;">      "lea message(%%rip), %%rsin"
</span><span style="color:#323232;">      "mov $4, %%edxn"
</span><span style="color:#323232;">      "syscalln"
</span><span style="color:#323232;">      PERIODWITHPERIODONTOP
</span><span style="color:#323232;">      PERIODWITHPERIODONTOP
</span><span style="color:#323232;">      PERIODWITHPERIODONTOP "%rax", "%rdi", "%rsi", "%rdx"
</span><span style="color:#323232;">    CURVYOPENLEFTCLOSEDRIGHTBRACKET COMMAWITHPERIODONTOP
</span><span style="color:#323232;">  CURLYOPENLEFTCLOSEDRIGHTBRACKET
</span><span style="color:#323232;">  return 0 COMMAWITHPERIODONTOP
</span><span style="color:#323232;">CURLYOPENLEFTCLOSEDRIGHTBRACKET
</span><span style="color:#323232;">
</span><span style="color:#323232;">asm CURVYOPENRIGHTCLOSEDLEFTBRACKET ".section .datan"
</span><span style="color:#323232;">  "message: .ascii "wut\n"n"
</span><span style="color:#323232;">  ".section .textn" CURVYOPENLEFTCLOSEDRIGHTBRACKET COMMAWITHPERIODONTOP
</span>
humbletightband ,

You can’t be helped, sorry. We will put you to an asylum for people like you

milicent_bystandr ,

Asylum? We have the electric chair for this.

humbletightband ,

Yeah, now I see why you want him dead. He used mov after lea

uis ,

Pack him, boys: youtu.be/hHuLZFuugTQ

MajorHavoc ,

Thanks. I hate it.

z500 ,
@z500@startrek.website avatar

You win a free trip to the Hague

SkyezOpen ,

They don’t even deserve the trial. Straight to gulag.

uis ,

Still need at least troyka to send to gulag. Or regular court outside of stalinism.

lud ,

The taxi chauffeur can be judge and do it on the way to the gulag.

Obviously the sentence is predetermined.

dariusj18 ,

Can this be done with emoji?

brbposting ,

😫

xmunk ,

Acceptable, just FYI I added a pre-commit git hook, please rebase your changes.

demizerone , in Brace Style

Auto formatter as part of the expected language tooling is Go’s greatest move, even if their formatter doesn’t go far enough.

PlexSheep ,

Rust does this too I think (or just everyone uses rustfmt).

JackbyDev ,

But I want my bike shed blue…

JimVanDeventer , in Brace Style

Don’t threaten me with a good time.

zbyte64 ,

Python Black for Java. Just a thought…

MystikIncarnate , in Brace Style

I’m not a coder, and… Well… Thanks, I hate it.

Even I know this is horrific. Where the fuck does this statement end? Which of these brackets refer to this section of other brackets. Idfk.

I could give a shit less if it was just for a single block per or something but “;}}}” hurts me.

velvetThunder ,

Well the code indentation explains that, like python. The issue is not reading it. You would rather quit your job than edit this.

hglman ,

tooling would have to do it all after the fact or something

motor_spirit , in *pulls up custom glittery myspace page from 2006*

true shit! That and theming live journal for some ladies was a good racket in HS

dosuser123456 ,
@dosuser123456@lemmy.sdf.org avatar

making a website didnt work for me :'(

ssm , in True?
@ssm@lemmy.sdf.org avatar

Apparently Windows users have a very accurate perception of how I use Linux

ZarkleFarkle ,

Generally I think people that use Linux on their home PCs are more likely to have stuff like multiple screens or loads of gadgets attached to their computer. A lot of Linux users think it’s really cool or like to imagine themselves as someone that does things like lots of complicated data analysis or being an “epic hacker” in their spare time at home. Extra shit on your desk can be genuinely useful if you actually do those kinds of things and add to the aesthetic if you like them.

dosuser123456 ,
@dosuser123456@lemmy.sdf.org avatar

apparently mac users made a very accurate description of my experiences with windows

TechieDamien , in Average CSS

Client: “Can you switch these two colours, you have 1 minute to fix it or you’re fired!”

Result:

dosuser123456 ,
@dosuser123456@lemmy.sdf.org avatar

my eyes

dosuser123456 , in <br>
@dosuser123456@lemmy.sdf.org avatar

&NewLine; go <br>

Treczoks , in Brace Style

Python programmer encountering a real programming language for the first time.

Reddfugee42 ,
NutWrench ,
@NutWrench@lemmy.ml avatar

Or a former BASIC programmer who really hates braces . . .

dosuser123456 ,
@dosuser123456@lemmy.sdf.org avatar

@dosuser123456 codes in basic intensifies]

kamen , in Brace Style

What amazes me is that someone either did that manually or wrote a formatter to do that - I doubt that any standard style config would do this.

OhStopYellingAtMe , in Brace Style
@OhStopYellingAtMe@lemmy.world avatar

Damn. That’s tidy to the point of inconvenience.

dosuser123456 , (edited ) in *pulls up custom glittery myspace page from 2006*
@dosuser123456@lemmy.sdf.org avatar

i know HyperText Markup Language but not How To Meet Ladies

GissaMittJobb , in Brace Style

Automatically enforced deterministic formatting is the best, there’s nothing that beats it. The productivity in just being able to format on save knowing that the code will be in the ideally formatted state, along with the anti-bikeshedding properties of this strategy, makes it unbeatable.

h0bbl3s ,
@h0bbl3s@lemmy.world avatar

gofumpt and gofmt are the best. One of the reasons if I have a choice I’ll code in go. I heard rumblings that rust was working towards having rustfmt be a standard crate.

GissaMittJobb ,

Go is in a good position, yeah. JavaScript has prettier, which is nice. Java has google-java-format. Python has ruff, which is quite good. Kotlin has ktfmt, which I believe made a mistake with their standards by not following the standard formatting guidelines for the language, but whatever. Uniform and deterministic for the win.

Username ,

What do you mean? rustfmt is the de facto standard and is easily run using cargo fmt. Most projects use it along with clippy, the standard linter.

h0bbl3s ,
@h0bbl3s@lemmy.world avatar

I had no idea it was standard. I had heard they had issues with it not being able to handle certain constructs so they were working on getting it to a place it would perform better. Has this changed? I’m not a rust person, but I intend to be. I’ve barely made it 1/4th way into the book (just started in the past month and I’ve been busy), but I have a good background in programming and so far it’s been super easy. I’m really enjoying how specific the compiler is, and the binary sizes vs Go.

CeeBee_Eh , (edited ) in JSON Query Language

JSON data within a database is perfectly fine and has completely justified use cases. JSON is just a way to structure data. If it’s bespoke data or something that doesn’t need to be structured in a table, a JSON string can keep all that organized.

We use it for intake questionnaire data. It’s something that needs to be on file for record purposes, but it doesn’t need to be queried aside from simply being loaded with the rest of the record.

Edit: and just to add, even MS SQL/Azure SQL has the ability to both query and even index within a JSON object. Of course Postgres’ JSONB data type is far better suited for that.

technom ,

While I understand your point, there’s a mistake that I see far too often in the industry. Using Relational DBs where the data model is better suited to other sorts of DBs. For example, JSON documents are better stored in document DBs like mongo. I realize that your use case doesn’t involve querying json - in which it can be simply stored as text. Similar mistakes are made for time series data, key-value data and directory type data.

I’m not particularly angry at such (ab)uses of RDB. But you’ll probably get better results with NoSQL DBs. Even in cases that involve multiple data models, you could combine multiple DB software to achieve the best results. Or even better, there are adaptors for RDBMS that make it behave like different types at the same time. For example, ferretdb makes it behave like mongodb, postgis for geographic db, etc.

CeeBee_Eh ,

Using Relational DBs where the data model is better suited to other sorts of DBs.

This is true if most or all of your data is such. But when you have only a few bits of data here and there, it’s still better to use the RDB.

For example, in a surveillance system (think Blue Iris, Zone Minder, or Shinobi) you want to use an RDB, but you’re going to have to store JSON data from alerts as well as other objects within the frame when alerts come in. Something like this:


<span style="color:#323232;">{
</span><span style="color:#323232;">  "detection":{
</span><span style="color:#323232;">    "object":"person",
</span><span style="color:#323232;">    "time":"2024-07-29 11:12:50.123",
</span><span style="color:#323232;">    "camera":"LemmyCam",
</span><span style="color:#323232;">    "coords": {
</span><span style="color:#323232;">    	"x":"23",
</span><span style="color:#323232;">    	"y":"100",
</span><span style="color:#323232;">    	"w":"50",
</span><span style="color:#323232;">    	"h":"75"
</span><span style="color:#323232;">    	}
</span><span style="color:#323232;">    }
</span><span style="color:#323232;">  },
</span><span style="color:#323232;">  "other_ojects":{
</span><span style="color:#323232;">     <repeat above format multipl times>
</span><span style="color:#323232;">  }
</span><span style="color:#323232;">}
</span>

While it’s possible to store this in a flat format in a table. The question is why would you want to. Postgres’ JSONB datatype will store the data as efficiently as anything else, while also making it queryable. This gives you the advantage of not having to rework the the table structure if you need to expand the type of data points used in the detection software.

It definitely isn’t a solution for most things, but it’s 100% valid to use.

There’s also the consideration that you just want to store JSON data as it’s generated by whatever source without translating it in any way. Just store the actual data in it’s “raw” form. This allows you to do that also.

Edit: just to add to the example JSON, the other advantage is that it allows a variable number of objects within the array without having to accommodate it in the table. I can’t count how many times I’ve seen tables with “extra1, extra2, extra3, extra4, …” because they knew there would be extra data at some point, but no idea what it would be.

pkill , in Gravediggers [Forrest Brazeal]

Why does it have to always be a hype that is a literal kick in the eye of gamers? Previously it was shitcoins, now it’s hallucination engines… I’m afraid what’s up next.

cryptiod137 ,

I think the torment nexus is next, but no one would ever build that so we are fine

pewgar_seemsimandroid ,

there’s always amd.

zagaberoo ,

Turns out massively parallel computation has applications beyond video rendering.

technom ,

That makes me wonder! All these new GPU uses are enormous energy hogs. Is gaming like that too?

  • All
  • Subscribed
  • Moderated
  • Favorites
  • [email protected]
  • random
  • lifeLocal
  • goranko
  • All magazines