Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
cinci zoo sniper
Mar 15, 2013




compuserved posted:

it's easy to heap more poo poo onto the pile when R is already pretty bad to begin with

also, you reminded me of some tef posts:

ehh, ill dispute the masterpieces of code bit, also copy and paste because of the consistency hell

Adbot
ADBOT LOVES YOU

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS
i deleted ~2500 lines of bad provisioning code over the past few days and now our cassandra cookbook is actually idempotent instead of being a special snowflake

feels good

akadajet
Sep 14, 2003

idempotent is a cool word

toiletbrush
May 17, 2010
its really hard to say though

cinci zoo sniper
Mar 15, 2013




akadajet posted:

idempotent is a cool word

an idempotent appurtenance

Luigi Thirty
Apr 30, 2006

Emergency confection port.

pokeyman posted:

you can drop the .init and just call the type name like a constructor directly if you want it even tidier

oh ok cool

anyway my goal here is to produce Motorola6502.framework and use it as the core of whatever else I want to emulate (and release it on github so i can have something to point to when people ask what my experience is with swift)

my ios game, meanwhile, i'm going to submit for review tonight :toot:

Notorious b.s.d.
Jan 25, 2003

by Reene

Sapozhnik posted:

uint8_t *heap;

void *malloc(size_t nbytes)
{
return (heap += nbytes);
}

void free(void *ptr)
{
printf("lol\n");
}

now cut out the middleman and do it with a macro instead :getin:

Deacon of Delicious
Aug 20, 2007

I bet the twist ending is Dracula's dick-babies

Luigi Thirty posted:

oh ok cool

anyway my goal here is to produce Motorola6502.framework and use it as the core of whatever else I want to emulate (and release it on github so i can have something to point to when people ask what my experience is with swift)

my ios game, meanwhile, i'm going to submit for review tonight :toot:

that's cool as hell, luigi

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
i've spent a few days loving around with writing a version of memcached in rust that uses capnproto for storage and transport and it suddenly occurred to me that making the cache aware of the protocol serves absolutely no purpose whatsoever.

Sapozhnik
Jan 2, 2005

Nap Ghost
malloc is easy

free is the hard part

Luigi Thirty
Apr 30, 2006

Emergency confection port.

I guess tomorrow's adventure is figuring out how to bind CPUState.accumulator to an NSTextField so my 6502 debugger automatically updates when I click the Step Once button

The_Franz
Aug 8, 2003

Sapozhnik posted:

malloc is easy

free is the hard part

free is easier than a non-naive realloc implementation

Luigi Thirty
Apr 30, 2006

Emergency confection port.



disassembler status: disassembles the instructions I support

emulator status: supports 40 opcodes lol

Fergus Mac Roich
Nov 5, 2008

Soiled Meat
i feel like i finally solved the puzzle of C++ memory management: std::weak_ptr, everywhere, all the time.

just don't assume the lock() method will throw an exception if the pointer is null. it doesn't.

Sweeper
Nov 29, 2007
The Joe Buck of Posting
Dinosaur Gum

Fergus Mac Roich posted:

i feel like i finally solved the puzzle of C++ memory management: std::weak_ptr, everywhere, all the time.

just don't assume the lock() method will throw an exception if the pointer is null. it doesn't.

i think you mean unique_ptr

Fergus Mac Roich
Nov 5, 2008

Soiled Meat
unique_ptr is miserly. shared_ptr and weak_ptr are in the spirit of giving.

giving access to the objects which some other object owns, i mean.

Fergus Mac Roich fucked around with this message at 14:15 on Jul 23, 2017

cinci zoo sniper
Mar 15, 2013




https://github.com/raxod502/TerraFrame

gonadic io
Feb 16, 2011

>>=

holy poo poo

Like at what point do you realise that it's gotten away from you?

And even then it'd be easy to insert some line breaks and un-global a few things

gonadic io
Feb 16, 2011

>>=

gonadic io posted:

holy poo poo

Like at what point do you realise that it's gotten away from you?

And even then it'd be easy to insert some line breaks and un-global a few things

everything #1
Open HarveyD opened this issue an hour ago · 1 comment Comments
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
2 participants
@HarveyD @wilhelmeek
@HarveyD
HarveyD commented an hour ago
No description provided.

Mr SuperAwesome
Apr 6, 2011

im from the bad post police, and i'm afraid i have bad news

apparently the original terraria is just as bad

except in C# instead of java

aardvaard
Mar 4, 2013

you belong in the bog of eternal stench

modding terraria was how i got into c#

all i remember about the terraria source code is that the key to encrypt save games was something like h3yguy5

Doom Mathematic
Sep 2, 2008

gonadic io posted:

everything #1
Open HarveyD opened this issue an hour ago · 1 comment Comments
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
2 participants
@HarveyD @wilhelmeek
@HarveyD
HarveyD commented an hour ago
No description provided.

"Pull requests welcome"

hackbunny
Jul 22, 2007

I haven't been on SA for years but the person who gave me my previous av as a joke felt guilty for doing so and decided to get me a non-shitty av

Fergus Mac Roich posted:

just don't assume the lock() method will throw an exception if the pointer is null. it doesn't.

it doesn't because a null shared pointer (what lock() returns) is legal, and because the lock and check idiom is if (auto ptr = weakptr.lock) { // ... which runs much faster than throwing and catching an exception

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

im confused about how theyre able to speak competently about what went wrong while also having produced that monster

gonadic io
Feb 16, 2011

>>=
i decided to contribute
https://github.com/raxod502/TerraFrame/pull/4

Fergus Mac Roich
Nov 5, 2008

Soiled Meat

hackbunny posted:

it doesn't because a null shared pointer (what lock() returns) is legal, and because the lock and check idiom is if (auto ptr = weakptr.lock) { // ... which runs much faster than throwing and catching an exception

it hadn't occurred to me to declare the variable in the if statement like that. i still had to change all my locks to shared_ptr constructors though because i never expect to actually throw the exception in practice, so from my understanding that's the right way to go for performance.

of course performance would be even better if i didnt construct the weak ptr at all and relied on my knowledge of how the program currently works to guarantee the memory wouldn't get deleted, but i get hives thinking about that.

Fergus Mac Roich fucked around with this message at 19:41 on Jul 23, 2017

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.

MALE SHOEGAZE posted:

im confused about how theyre able to speak competently about what went wrong while also having produced that monster

you're telling us you were never a bad programmer? you're in the wrong thread friend.

Jabor
Jul 16, 2010

#1 Loser at SpaceChem

Maluco Marinero posted:

you're telling us you were never a bad programmer? you're in the wrong thread friend.

Or maybe he's dunning-krugered his way into the right one

akadajet
Sep 14, 2003

The only good code that exists is Quake 3
https://github.com/id-Software/Quake-III-Arena

AWWNAW
Dec 30, 2008

akadajet posted:

The only good code that exists is Quake 3
https://github.com/id-Software/Quake-III-Arena

https://github.com/id-Software/Quake-III-Arena/blob/master/code/renderer/tr_bsp.c#L155

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

Maluco Marinero posted:

you're telling us you were never a bad programmer? you're in the wrong thread friend.

i didn't look closely but i didn't get a sense of a passage of time. it seemed like they coded it up and then turned around and said "look at this turd!"

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
in other news i just specified a binary protocol for my lovely custom memcache and then implemented a streaming, multiplexed client to handle it. i don't even really understand what i've done. rust is cool.

futures in rust are insanely hard compared to scala. holy poo poo.

Quebec Bagnet
Apr 28, 2009

mess with the honk
you get the bonk
Lipstick Apathy

akadajet posted:

The only good code that exists is Quake 3
https://github.com/id-Software/Quake-III-Arena

i learned to program by modding quake, it was a good teacher :3:

JewKiller 3000
Nov 28, 2006

by Lowtax
here is the secret to programming: smoke weed until you're out of weed

Workaday Wizard
Oct 23, 2009

by Pragmatica

MALE SHOEGAZE posted:

in other news i just specified a binary protocol for my lovely custom memcache and then implemented a streaming, multiplexed client to handle it. i don't even really understand what i've done. rust is cool.

futures in rust are insanely hard compared to scala. holy poo poo.

i used rust but not scala. whats the difference between their futures? i find futures confusing too myself (error handling :shudder:)

Luigi Thirty
Apr 30, 2006

Emergency confection port.

me 10 minutes ago: goddammit how am i going to decipher all these obsolete swift stackoverflow posts to figure out how to make this debugger instruction visible when we jump to another address

me: oh wait

code:
debuggerTableView.scrollRowToVisible(index+10)
debuggerTableView.scrollRowToVisible(index-5)

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope

goon project time: let's fix this game (but for serious, no joke "delete all code" contributions please)

i'll make the wiki



well i say that but i'm not actually going to do it.

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope
but i'm legit curious what improvements you could do using the refactoring tools in an ide and how much effort would it take.

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope
That could actually be excellent teaching material. "please don't do this" but also "at some point you will have to maintain code like this"

Adbot
ADBOT LOVES YOU

gonadic io
Feb 16, 2011

>>=

MALE SHOEGAZE posted:


futures in rust are insanely hard compared to scala. holy poo poo.

Seconding that I'd like a trip report, I've used them a bunch in Scala but never rust

  • Locked thread