As was foretold, we've added advertisements to the forums! If you have questions, or if you encounter any bugs, please visit this thread: https://forums.penny-arcade.com/discussion/240191/forum-advertisement-faq-and-reports-thread/

cmd /v:on /c "set TITLE=Programming Thread & echo !TITLE!"

13468999

Posts

  • PhyphorPhyphor Building Planet Busters Tasting FruitRegistered User regular
    Each cast has a purpose!

  • GnomeTankGnomeTank What the what? Portland, OregonRegistered User regular
    To be fair, the *_cast operators are really just meant to be programmer self documentation. They add context to the cast, sometthing "(foo) bar" doesn't have (why are you casting it? Is it to remove constness? Is it to turn a void* in to a concrete type? Is it to do a simple polymorphic down cast, or a more complex polymorphic upcast?)

    Sagroth wrote: »
    Oh c'mon FyreWulff, no one's gonna pay to visit Uranus.
    Steam: Brainling, XBL / PSN: GnomeTank, NintendoID: Brainling, FF14: Zillius Rosh SFV: Brainling
  • PhyphorPhyphor Building Planet Busters Tasting FruitRegistered User regular
    Basically, but they will also error out if you try to do something else (though there is no trivial way to replace dynamic with regular casts)

  • GnomeTankGnomeTank What the what? Portland, OregonRegistered User regular
    Yeah, dynamic_cast is the real mold breaker, because it lets you do something that wasn't safe to do using classic C style casts.

    Sagroth wrote: »
    Oh c'mon FyreWulff, no one's gonna pay to visit Uranus.
    Steam: Brainling, XBL / PSN: GnomeTank, NintendoID: Brainling, FF14: Zillius Rosh SFV: Brainling
  • ystaelystael Registered User regular
    Jimmy King wrote: »
    I wish I could figure out which factors in the combination of Aptana, Ubuntu, and VirtualBox make my dev environment a piece of shit where Aptana randomly just loses the project on occasion. I'll close Aptana with no errors, shut down the vm with no errors, then start up the vm and open aptana and all of my open tabs are just blank and nothing is in the package explorer and I have to go re-set a bunch of shit up.

    When I used Aptana, it could easily have carried the "piece of shit" part by itself. Installing their all-in-one distribution gave better results than trying to put the plugin into Eclipse, but either way I was lucky if my settings stuck for a week at a time. I switched to RubyMine, which greatly improved my life.

    (Then I switched to Clojure, which improved it even more, but that's a separate issue.)

  • GnomeTankGnomeTank What the what? Portland, OregonRegistered User regular
    Why do you need all of Eclipse for Python development? Sublime Text + shell, bam, way better than Aptana.

    Sagroth wrote: »
    Oh c'mon FyreWulff, no one's gonna pay to visit Uranus.
    Steam: Brainling, XBL / PSN: GnomeTank, NintendoID: Brainling, FF14: Zillius Rosh SFV: Brainling
  • Jimmy KingJimmy King Registered User regular
    I'm lazy and like being able to easily use the debugger with django. That's really the only use I have for a Aptana over ST. I really do like being able to just right click to add dots and click "debug" rather than adding pdb imports and set_trace() to code that normally wouldn't have it which I then have to remember to remove.

    Looks like RubyMine is by the same people that develop PyCharm, which is the other Python IDE I tried to use which turned out to be a piece of shit.

    I'll probably end up just using ST2 or just plain old emacs like I do for almost all of my personal projects since I work on them via ssh in a shell on a remote server anyway.

  • bowenbowen How you doin'? Registered User regular
    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • Jimmy KingJimmy King Registered User regular
    Just got back from a semi-interview with another local mobile and web dev shop. This one sounds really promising. They are aware I can't start until early next year and are fine with that. Initial pay that was budgeted is way low, but they're going to try to get it bumped up so that I at least break even and hopefully get a small raise, plus work from home so I'll save gas money.

    I'll get to work with a little of everything, Java/Android, iOS, Python (which I will try to make my main focus, I'd love to be their "django guy"), PHP, and probably anything else that makes sense for a project. I kind of even like the idea of using PHP there. It's a shit language and I'd never choose to use it on my own. Being forced for work (and they have good reasoning for why, I asked) means I'll use it and get that experience anyway, which at best makes me more qualified for the huge number of php jobs out there and at worst means I can make more coherent arguments based on actual experience for why it's a piece of shit.

    They're small, privately owned, intend to stay privately owned, and are working on a profit sharing thing for the employees. The guy I talked to assures me that they actually give raises, too.

  • bowenbowen How you doin'? Registered User regular
    I'd get that one in writing.

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • Jimmy KingJimmy King Registered User regular
    Well, it was not a "we will definitely give you a raise". So it's no more guaranteed than anywhere else in reality, but I trust this guy far more than I trust random corporate douchebag to at least try to make good on his word. I know multiple people who have known this guy for years as friends, they all tell me he's good, one does contract work for him sometimes as well and another is also considering a job with the company.

    He said their raises are based on performance. If your clients are happy and/or you're getting shit done fast and so the company collects money sooner, gets to take on more projects, etc. then you get raises. Not little 3%, "here, go buy yourself a cheeseburger" raises, but proper raises that you'll notice. Assuming they come through on that, I'm cool with it. I've never been told my work is anything but high quality and done faster than expected. If they don't come through for me, but can get my pay where it is now, then I get good experience and don't get shoved into tier 1 phone support for people that can't remember their password like they are trying to do at this job. I'm also going to talk to them about tuition reimbursement, because that's a significant expense for me every couple of months. It seems like a better deal than that other place I talked to a couple weeks ago at the very least, because they seem to honestly want to hire me.

    And we're talking 3-4 months, so I'll of course continue talking to other places.

  • bowenbowen How you doin'? Registered User regular
    I guess another sign of my old age, guaranteed raises with inflation into my contract at the least + more based on performance or I walk.

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • Jimmy KingJimmy King Registered User regular
    edited September 2012
    I wish I was in an area where I could be so demanding (and guaranteed small cost of living raise isn't exactly demanding). Maybe after I get the degree. Right now I'll take "won't start failing and laying everyone off after 6 months and expecting me to pick up the slack for the same pay" since that seems to be the current MO after hiring me.

    When the time comes for actual job offers, I may still try to work that in. I am going to at least push for having my classes and books paid for if I don't get a nice bump up in my pay. Perhaps this is why I keep ending up getting abused in the long run, but I get these shitty jobs and end up looking for something that's just not openly abusive... actually treating me extra good can come later.

    Jimmy King on
  • EchoEcho ski-bap ba-dapModerator mod
    So, here's an e-book about Sublime Text 2. https://leanpub.com/sublime-productivity

    I've had loots of "ooh!" moments with ST2 lately, so an entire book that tells me about the stuff I can do is a no-brainer.

    I'd buy it right this second except I'm not wearing pants. Because reasons.

  • DehumanizedDehumanized Registered User regular
    I might have just used a call me maybe joke in a comment... feeling only a little bit of shame, at least until someone else sees the comment.

  • agoajagoaj Top Tier One FearRegistered User regular
    I might have just used a call me maybe joke in a comment... feeling only a little bit of shame, at least until someone else sees the comment.

    I put a Still Alive reference in my programming homework.
    At least it was the day after Portal had come out.

    ujav5b9gwj1s.png
  • DehumanizedDehumanized Registered User regular
    agoaj wrote: »
    I might have just used a call me maybe joke in a comment... feeling only a little bit of shame, at least until someone else sees the comment.

    I put a Still Alive reference in my programming homework.
    At least it was the day after Portal had come out.

    Some names changed to protect the guilty
    // HACK: Test this out if the software gets updated. It's not officially supported or anything.
     
      // So, you probably just got here, and this is crazy, 
                // but [third party] hooked the LineFillBeforeOriginal event and canceled the default events, so call
                // Microsoft.Dexterity.Applications.ThirdParty.Procedures.TcsSoppR00043LineScrollScrollFill.InvokeBeforeOriginal, maybe?
                Microsoft.Dexterity.Applications.ThirdParty.Procedures.TcsSoppR00043LineScrollScrollFill.InvokeBeforeOriginal += new TcsSoppR00043LineScrollScrollFillProcedure.InvokeEventHandler(TcsSoppR00043LineScrollScrollFill_InvokeBeforeOriginal);
    
                // This is the call we'd make instead, were this a just and good world
                //SopInquiryScrollingWindow.LineFillAfterOriginal += new EventHandler(SopInquiryScrollingWindow_LineFillAfterOriginal);
    

    The interfaces I'm working with are not known for being concise or pretty.

  • agoajagoaj Top Tier One FearRegistered User regular
    Next project will be entirely done in rhyme.
    The following program will be a bunch of haikus.

    ujav5b9gwj1s.png
  • bowenbowen How you doin'? Registered User regular
    You guys are terrible people.

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • ecco the dolphinecco the dolphin Registered User regular
    edited September 2012
    bowen wrote: »
    You guys are terrible people.
    if( this->wasTriumph )
      return new tNote( HUGE_SUCCESS );
    

    Infidel:
    if( Wabadabadaba() )
      return Huh;
    

    ecco the dolphin on
    Penny Arcade Developers at PADev.net.
  • bowenbowen How you doin'? Registered User regular
    I'll cut you.

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • admanbadmanb unionize your workplace Seattle, WARegistered User regular
    edited September 2012
    Thread t = new Thread():
    t.stop() // hammertime
    

    admanb on
  • agoajagoaj Top Tier One FearRegistered User regular
    while(drivingInTown)
    {
         if(you->with == thatGuyIKnow)
         {
         delete(you)
         }
    }
    

    ujav5b9gwj1s.png
  • bowenbowen How you doin'? Registered User regular
    Your indents!

    I mean as long as they're not hanging out of the passenger's side of their best friends ride, it's fine.

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
    ASimPerson
  • urahonkyurahonky Registered User regular
    Did my review.

    Yeahh... I didn't see that coming. In a good way. Let's just say that it was WELL above what I had expected and I am quite pleased now.

  • agoajagoaj Top Tier One FearRegistered User regular
    Yay! I wrote my first abuse of templates!
    class IEntityList{ // Not technically an interface
    	virtual void Remove(Entity* ent)=0;
    public:
    	//List of entity lists
    	static std::vector<IEntityList*> entityLists; //Lets us iterate over all lists created through EntityList template class
    	static void RemoveFromAll(Entity* ent);
    };
    std::vector<IEntityList*> IEntityList::entityLists;
    template <class T>
    class EntityList : public IEntityList{
    	static EntityList<T>* singleton;
    	std::vector<T*> list;
    
    	//Implements IEntityList's interface so that all EntityList classes can be iterated over for a massive remove
    	void Remove(Entity* ent)
    	{
    		EntityList<T>::Remove((T*)ent);
    	}
    	EntityList<T>()
    	{
    		//Triggers a compiler error if you use a type that isn't derived from Entity
    		std::enable_if<std::is_base_of<Entity, T>::value && std::is_convertible<T&, Entity&>::value,T>::type;
    		entityLists.push_back(this);
    	}
    	//Must be called at the start of any other static functions
    	static void MakeSingleton()
    	{
    		if(singleton == NULL)
    			singleton = new EntityList<T>;
    	}
    public:
    
    	
    	static const std::vector<T*>* GetList()
    	{
    		MakeSingleton();
    		return (const std::vector<T*>*)&singleton->list;
    	}
    	static void Add(T* ent)
    	{
    		MakeSingleton();
    		singleton->list.push_back(ent);
    	}
    	static void Remove(T* ent)
    	{
    		MakeSingleton();
    		for(std::vector<T*>::iterator it = singleton->list.begin(); it != singleton->list.end(); it++)
    		{
    			if(*it == ent)
    			{
    				singleton->list.erase(it);
    				return;
    			}
    		}
    	}
    };
    template <class T>
    EntityList<T>* EntityList<T>::singleton = NULL;
    
    And my IOS app got approved on the first try!

    ujav5b9gwj1s.png
  • ArchsorcererArchsorcerer Registered User regular
    As a guy who had a modest college education here in Mexico, I'm gonna follow Scott Young's example:

    http://www.youtube.com/watch?v=WIU-79QlKa4

    XBL - ArchSilversmith

    "We have years of struggle ahead, mostly within ourselves." - Made in USA
  • Alistair HuttonAlistair Hutton Dr EdinburghRegistered User regular
    I hate date and times. I hate them because it appears that every other programmer in the universe is apparently completely shit at dealing with them.

    No, you cannot just add 24 fucking hours in milliseconds onto this date at midnight to get midnight next day.
    Parsing a UTC date string and sticking the values into the local time field on an object is not how you get fucking UTC date.

    Aaaaaaaargh.

    I have a thoughtful and infrequently updated blog about games http://whatithinkaboutwhenithinkaboutgames.wordpress.com/

    I made a game, it has penguins in it. It's pay what you like on Gumroad.

    Currently Ebaying Nothing at all but I might do in the future.
  • FodderFodder Registered User regular
    Anyone in the UK that could tell me if it's some sort of faux pas here to negotiate on job offers? I've just finished my MSc and have two offers through two different recruiters, and the one with the lower offer is basically trying to tell me the other place is shit and I should definitely take his and not to bother, they'll give me performance based raises soon enough and so on.

    Which seems like an absolutely crazy idea. I should definitely negotiate, right?

    steam_sig.png
  • DrunkMcDrunkMc Registered User regular
    I hate date and times. I hate them because it appears that every other programmer in the universe is apparently completely shit at dealing with them.

    No, you cannot just add 24 fucking hours in milliseconds onto this date at midnight to get midnight next day.
    Parsing a UTC date string and sticking the values into the local time field on an object is not how you get fucking UTC date.

    Aaaaaaaargh.

    Supposedly time is getting a huge over haul in the next or the next-next Java release. Thank god, its AWFUL now. I fucking hate time. Especially when dealing with multiple timezones. AHHHHHHHHHHHH

  • SporkAndrewSporkAndrew Registered User, ClubPA regular
    Fodder wrote: »
    Anyone in the UK that could tell me if it's some sort of faux pas here to negotiate on job offers? I've just finished my MSc and have two offers through two different recruiters, and the one with the lower offer is basically trying to tell me the other place is shit and I should definitely take his and not to bother, they'll give me performance based raises soon enough and so on.

    Which seems like an absolutely crazy idea. I should definitely negotiate, right?

    Recruiters are scum and only out for their own signing bonus. Most operate on a policy of 15-20% of your salary as an upfront finders fee, so they'll both be doing their damndest to bullshit you into signing with the company that they are representing, regardless of whether you think it's a good fit.

    Sometimes companies take into account the recruiters fee, so will low-ball you an offer then jack your wage up in 6 months if they like how you operate (this is what happened to me with my most recent job).

    There's no harm in negotiating. The recruiter is meant to be on your side, even if they are just the worst.

    The one about the fucking space hairdresser and the cowboy. He's got a tinfoil pal and a pedal bin
    bowen
  • Alistair HuttonAlistair Hutton Dr EdinburghRegistered User regular
    DrunkMc wrote: »
    I hate date and times. I hate them because it appears that every other programmer in the universe is apparently completely shit at dealing with them.

    No, you cannot just add 24 fucking hours in milliseconds onto this date at midnight to get midnight next day.
    Parsing a UTC date string and sticking the values into the local time field on an object is not how you get fucking UTC date.

    Aaaaaaaargh.

    Supposedly time is getting a huge over haul in the next or the next-next Java release. Thank god, its AWFUL now. I fucking hate time. Especially when dealing with multiple timezones. AHHHHHHHHHHHH

    Java's date/time handling is like a nirvana compared to Actionscript's weak arsed attempt.

    I have a thoughtful and infrequently updated blog about games http://whatithinkaboutwhenithinkaboutgames.wordpress.com/

    I made a game, it has penguins in it. It's pay what you like on Gumroad.

    Currently Ebaying Nothing at all but I might do in the future.
  • bowenbowen How you doin'? Registered User regular
    I add 24 hours to get the next day, weeeeee.

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • Jimmy KingJimmy King Registered User regular
    datetime.datetime + datetime.timedelta + pytz makes my life so much easier

  • JasconiusJasconius sword criminal mad onlineRegistered User regular
    one of my favorite learnings ever was when I discovered there are languages where you can add times to other times to get new times

  • bowenbowen How you doin'? Registered User regular
    Jasconius wrote: »
    one of my favorite learnings ever was when I discovered there are languages where you can add times to other times to get new times
    DateTime.Today.Add(new TimeSpan(1,0,0,0));
    

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • bowenbowen How you doin'? Registered User regular
    I like doing negative time too, that's fun.

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • PhyphorPhyphor Building Planet Busters Tasting FruitRegistered User regular
    Time is hard

  • bowenbowen How you doin'? Registered User regular
    I like the culture changes I can slap on the beginning of a project and change the way datetime gives me values, that's fun.

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • bowenbowen How you doin'? Registered User regular
    CultureInfo culture = (CultureInfo)CultureInfo.CurrentCulture.Clone();
    culture.DateTimeFormat.ShortDatePattern = "yyyy-MM-dd";
    culture.DateTimeFormat.LongDatePattern = "yyyy-MM-dd HH:mm:ss";
    culture.DateTimeFormat.FullDateTimePattern = "yyyy-MM-dd HH:mm:ss";
    culture.DateTimeFormat.ShortTimePattern = "HH:mm";
    culture.DateTimeFormat.LongTimePattern = "HH:mm:ss";
    Thread.CurrentThread.CurrentCulture = culture;
    

    At least MySql won't bitch when I give it a datetime.now for a record.

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
This discussion has been closed.