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
suffix
Jul 27, 2013

Wheeee!

Bloody posted:

i want the equivalent of c#'s "using(butt) {}" in c am i a monster if i implement this with a preprocessor macro like
#define USING_BUTTS(X) prepare_butt(); X ; release_butt();

and then later in my code be all like
USING_BUTTS
(
    poorly_written_code;
)

why, just so you don't forget to release_butt()?

it still won't work if you control flow out of it, which is the main reason to use it in C#

Adbot
ADBOT LOVES YOU

Star War Sex Parrot
Oct 2, 2003

hold on to your butts

Bloody
Mar 3, 2013

its predominantly so i dont forget to release butt but its still not perfect because its not impossible for an interrupt to fire during the butt holding situation altho i could bake in a global interrupt disable but uauauaghugh im gonna keep just writing it all out and occasionally forgetting to release butt and then wonder why nothing works for a few hours thatll just be simpler

stoutfish
Oct 8, 2012

by zen death robot

Star War Sex Parrot posted:

hold on to your butts

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
reminder:

code:
/usr/src/cmd/sh/mac.h:
#define IF      if(
#define THEN    ){
#define ELSE    } else {
#define ELIF    } else if (
#define FI      ;}

#define BEGIN   {
#define END     }
#define SWITCH  switch(
#define IN      ){
#define ENDSW   }
#define FOR     for(
#define WHILE   while(
#define DO      ){
#define OD      ;}
#define REP     do{
#define PER     }while(
#define DONE    );
#define LOOP    for(;;){
#define POOL    }

MrMoo
Sep 14, 2000

I wrote this, there must be something better?
Java code:
private class FlaggedHandle {
	private Handle handle;
	private boolean flag;

	public FlaggedHandle (Handle handle) {
		this.handle = handle;
		this.flag = false;
	}

	public Handle getHandle() {
		return this.handle;
	}

	public boolean isFlagged() {
		return this.flag;
	}

	public void setFlag() {
		this.flag = true;
	}
}

Shaggar
Apr 26, 2006
heres the laziest way
Java code:

public class FlaggedHandle extends Handle
{
	private boolean flag;

	public FlaggedHandle()
	{
		this(false);
	}
	

	public FlaggedHandle(boolean flagged)
	{
		super();
		this.flag=flagged;
	}

	public boolean IsFlagged()
	{
		rtuen this.flag;
	}
}

Shaggar
Apr 26, 2006

Bloody posted:

its predominantly so i dont forget to release butt but its still not perfect because its not impossible for an interrupt to fire during the butt holding situation altho i could bake in a global interrupt disable but uauauaghugh im gonna keep just writing it all out and occasionally forgetting to release butt and then wonder why nothing works for a few hours thatll just be simpler

always make sure your using properly prepared butts

Shaggar
Apr 26, 2006
re: flagged handle thing. if you cant alter Handle extending it is probably the best way to go if you want your flagged handle to be usable anywhere normal handle is used. if you can modify handle you have more options depending on what the flag means

double sulk
Jul 2, 2010

Shaggar posted:

always make sure your using properly prepared butts

please don't describe my sex methodologies

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

Shaggar posted:

always make sure your using properly prepared butts

keep in mind that butt preparation varies greatly depending on which part of the south you're in. some prefer a dry rub. in north carolina, you might expect a lot of vinegar. and well, if you've ever had carnitas, you'll know just how crazy butts can get!!1

duTrieux.
Oct 9, 2003

USSMICHELLEBACHMAN posted:

keep in mind that butt preparation varies greatly depending on which part of the south you're in. some prefer a dry rub. in north carolina, you might expect a lot of vinegar. and well, if you've ever had carnitas, you'll know just how crazy butts can get!!1

no wonder anal sex was illegal in the south for so long

Bloody
Mar 3, 2013

they were just really confused about having sex with meat

Deus Rex
Mar 5, 2005

Shaggar posted:

Java code:
	public boolean IsFlagged()
	{
		rtuen this.flag;
	}

Plastic Snake
Mar 2, 2005
For Halloween or scaring people.
#DEFINE rtuen return

coffeetable
Feb 5, 2006

TELL ME AGAIN HOW GREAT BRITAIN WOULD BE IF IT WAS RULED BY THE MERCILESS JACKBOOT OF PRINCE CHARLES

YES I DO TALK TO PLANTS ACTUALLY

code nazi

fritz
Jul 26, 2003

Bloody posted:

they were just really confused about having sex with meat

if this is gonna be that kind of regional cuisine I guess I'm not gonna stick my dick in the mashed potatoes after all

Bloody
Mar 3, 2013

Plastic Snake posted:

#DEFINE rtuen return

putting define in caps breaks certain compilers hth

GameCube
Nov 21, 2006

Malcolm XML posted:

ghetto raii just use cpp

srsly

i was gonna say just use an object but then i remembered there are people who actually program in c still

Bloody
Mar 3, 2013

i dont understand c++ in a context without dynamic memory allocation so im just gonna not

Shaggar
Apr 26, 2006

Plastic Snake posted:

#DEFINE rtuen return

thanks

Nomnom Cookie
Aug 30, 2009



Bloody posted:

putting define in caps breaks certain compilers hth

modern c style is to use as many gcc-isms as possible and if users complain about the difficulty when porting tell them to use linux

it's free marketing

MrMoo
Sep 14, 2000

Shaggar posted:

re: flagged handle thing. if you cant alter Handle extending it is probably the best way to go if you want your flagged handle to be usable anywhere normal handle is used. if you can modify handle you have more options depending on what the flag means

It's an interface from some proprietary API, a gigantic big black hole. Thanks all.

Luigi Thirty
Apr 30, 2006

Emergency confection port.

well hey it took the only place that's ever responded to my resume a month to tell me they're not interested

MeruFM
Jul 27, 2010
if you've got programming skills and are not getting responses, consider redoing your resume and asking knowledgeable computer people, maybe even here, for help

Not me though, i'm an idiot.

coffeetable
Feb 5, 2006

TELL ME AGAIN HOW GREAT BRITAIN WOULD BE IF IT WAS RULED BY THE MERCILESS JACKBOOT OF PRINCE CHARLES

YES I DO TALK TO PLANTS ACTUALLY
yeah i offered up my resume in cjs the other day and got good responses from it. primarily, "more skills, at the top". id previously only given off stuff id done a decent amount of work on, but apparently the vogue for a graduate programmer is to list off as many libraries and tools as can fit on the page

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
the get a job thread in cavern of cobol is pretty decent too for posting resumes

Luigi Thirty
Apr 30, 2006

Emergency confection port.

no i'm afraid of posting there because i made a bunch of shitposts when i was having really bad panic attacks and people are still like "wow i read your posts in there you're a bad poster"

coffeetable
Feb 5, 2006

TELL ME AGAIN HOW GREAT BRITAIN WOULD BE IF IT WAS RULED BY THE MERCILESS JACKBOOT OF PRINCE CHARLES

YES I DO TALK TO PLANTS ACTUALLY

Luigi Thirty posted:

no i'm afraid of posting there because i made a bunch of shitposts when i was having really bad panic attacks and people are still like "wow i read your posts in there you're a bad poster"

namechange and/or new account time

Luigi Thirty
Apr 30, 2006

Emergency confection port.

I have a parachute account but i think it got heartbled

coffeetable
Feb 5, 2006

TELL ME AGAIN HOW GREAT BRITAIN WOULD BE IF IT WAS RULED BY THE MERCILESS JACKBOOT OF PRINCE CHARLES

YES I DO TALK TO PLANTS ACTUALLY
also that thread's survived pollyanna, sulk and 2banks, you'll be fine

gonadic io
Feb 16, 2011

>>=

coffeetable posted:

also that thread's survived pollyanna, sulk and 2banks, you'll be fine

don't forget how!!

coffeetable
Feb 5, 2006

TELL ME AGAIN HOW GREAT BRITAIN WOULD BE IF IT WAS RULED BY THE MERCILESS JACKBOOT OF PRINCE CHARLES

YES I DO TALK TO PLANTS ACTUALLY

AlsoD posted:

don't forget how!!

honestly don't know how i forgot the finest poster these forums have to offer

for the ppl itt who don't follow the newbie thread, here're the fifty five posts it takes to get you banned from CoC

Luigi Thirty
Apr 30, 2006

Emergency confection port.

Is that the guy who wanted to unit test his fizz buzz program

MeruFM
Jul 27, 2010
i stopped at "senior"

MeruFM
Jul 27, 2010
it's me, i've got 10+ years but still ask a forum of nobodies for cover letter advice

Bloody
Mar 3, 2013

didnt read

Valeyard
Mar 30, 2012


Grimey Drawer

coffeetable posted:

honestly don't know how i forgot the finest poster these forums have to offer

for the ppl itt who don't follow the newbie thread, here're the fifty five posts it takes to get you banned from CoC

wait, in his first post about the 2 hour programming test why did he spend 30 minutes setting up a postgresql database when he was using django

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

Luigi Thirty posted:

Is that the guy who wanted to unit test his fizz buzz program

i prepped for interviews by coming up with a complex object oriented version of fizzbuzz that i could write up in the event that someone wanted me to do fizzbuzz. i mean it's kind of a joke questions so why not give a joke answer

Adbot
ADBOT LOVES YOU

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
i'm also so loving bad at doing programming questions on the spot jesus

it's like all my critical thinking skills go out the window

i recently got the 'do a tic tac toe solver' questions which i've seen a bunch but i've just ignored because it's so easy but when i was actually sitting there programming i took forever

  • Locked thread