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!"

1679111299

Posts

  • GnomeTankGnomeTank What the what? Portland, OregonRegistered User regular
    edited October 2012
    *mutter*mutter*legacy support*mutter*mutter*

    We've got some cross compiling tools which only install on versions of VS up to 2005, which means that I split my C++ dev time between various flavours of Visual Studio (potentially combined with various versions of Qt).

    *mutter*legacy*mutter*

    I'm torn, because I'd love to try out 2012, but I swear, if I have to install Yet Another Version of Visual Studio on this computer...

    VS 2012 can do everything 2010 did, fully backwards compatible. So if you're currently using 2010, you can in theory replace it with 2012. Yes, even the C++ compiler has a VC10 compat mode.

    GnomeTank on
    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
  • InfidelInfidel Heretic Registered User regular
    Yeah, you can even open VS2010 projects in VS2012 without converting, which means you can actually open it back up in 2010!

    It is not the usual ohgodsidebyside.

    OrokosPA.png
  • ecco the dolphinecco the dolphin Registered User regular
    edited October 2012
    agoaj wrote: »
    agoaj wrote: »
    Microsoft just needs to realize that different things will require a different type of UI approach.

    Hopefully they learn this before they release touch only Visual Studio 2013.

    "Visual Studio 2014 : Our feedback indicated touch only was bad, so now we've removed touch completely. We've instead replaced it with voice recognition to help programmers reduce RSI!"
    int main bracket [[ brace delete delete back parent thee this (( back no stupid computer what the fark enter enter
    return
    return
    

    Edit:
    GnomeTank wrote: »
    *mutter*mutter*legacy support*mutter*mutter*

    We've got some cross compiling tools which only install on versions of VS up to 2005, which means that I split my C++ dev time between various flavours of Visual Studio (potentially combined with various versions of Qt).

    *mutter*legacy*mutter*

    I'm torn, because I'd love to try out 2012, but I swear, if I have to install Yet Another Version of Visual Studio on this computer...

    VS 2012 can do everything 2010 did, fully backwards compatible. So if you're currently using 2010, you can in theory replace it with 2012. Yes, even the C++ compiler has a VC10 compat mode.
    Infidel wrote: »
    Yeah, you can even open VS2010 projects in VS2012 without converting, which means you can actually open it back up in 2010!

    It is not the usual ohgodsidebyside.

    Very well gentlemen! Your words and fancy screencaps have convinced me to dig into this deeper.

    ecco the dolphin on
    Penny Arcade Developers at PADev.net.
  • PhyphorPhyphor Building Planet Busters Tasting FruitRegistered User regular
    Look what your careless words have wrought.
    Select your pistol, then select your program

  • acidlacedpenguinacidlacedpenguin Institutionalized Safe in jail.Registered User regular
    GnomeTank wrote: »
    GnomeTank wrote: »
    Microsoft's UI design is almost entirely data/focus driven these days, so that's why the decisions are going to seem odd to most "computer people". I read an article the other day about how Blizzard has gone to an entirely data driven development process, and I think it applies equally well to Microsoft. To us, it's going to seem like they replaced their UI people with a potato, because it wasn't designed for us. It was designed for what Microsoft's data shows to be 85% of computer users, or whatever their data shows (completely random internet number).

    That said, I'll never understand the Windows 8 hate. I use it daily at home and I find it works swimmingly, and I've learned to even *gasp* like the new Start Area.

    That and we're generally the people smart paranoid enough to uncheck the "allow this program to spy collect usage data" button.

    GT: Acidboogie PSNid: AcidLacedPenguiN
  • JasconiusJasconius sword criminal mad onlineRegistered User regular
    I'll be a happy camper when XNA gets supported in VS2012

  • GnomeTankGnomeTank What the what? Portland, OregonRegistered User regular
    Since XNA is basically a dead product, I am going to guess "never" on that happening.

    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
  • GnomeTankGnomeTank What the what? Portland, OregonRegistered User regular
    Choices choices...do I use Sublime Text on my new Mac, or do I go back to the Original and use TextMate?

    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
    Why the fuck do so many people struggle with XML? Not even the fancy bits like separate namespaces and whatnot, just plain old <elem1><elem2>blah</elem2></elem1>

  • JasconiusJasconius sword criminal mad onlineRegistered User regular
    GnomeTank wrote: »
    GnomeTank wrote: »
    Choices choices...do I use Sublime Text on my new Mac, or do I go back to the Original and use TextMate?

    well TextMate is basically a dead product so...

  • GnomeTankGnomeTank What the what? Portland, OregonRegistered User regular
    Sublime Text it is then.

    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
  • acidlacedpenguinacidlacedpenguin Institutionalized Safe in jail.Registered User regular
    Jimmy King wrote: »
    Why the fuck do so many people struggle with XML? Not even the fancy bits like separate namespaces and whatnot, just plain old <elem1><elem2>blah</elem2></elem1>
    it's probably that "Oh I'm doing something quick, I'll come back later and fix it up!" and then they never do.

    GT: Acidboogie PSNid: AcidLacedPenguiN
  • Jimmy KingJimmy King Registered User regular
    Jimmy King wrote: »
    Why the fuck do so many people struggle with XML? Not even the fancy bits like separate namespaces and whatnot, just plain old <elem1><elem2>blah</elem2></elem1>
    it's probably that "Oh I'm doing something quick, I'll come back later and fix it up!" and then they never do.
    I wish that was it.

    I'm trying to write some code to export data from our system to a specific format for another system. it's xml, which contains html (ugh) and they are getting themselves confused about what the fields in their own xml are for and which ones need CDATA and which don't and confusing problems with one element with a different element and blah blah blah. Just getting totally confused.

  • Joe KJoe K Registered User regular
    Jimmy King wrote: »
    Why the fuck do so many people struggle with XML? Not even the fancy bits like separate namespaces and whatnot, just plain old <elem1><elem2>blah</elem2></elem1>

    honestly, it's because xml is overly-verbose and frigging hard to read by sight. it should be burned in a fire. also, most implimentations of XML are overly verbose .ini files.

    plain old .ini files are better

    YAML is better

    JSON is better (and my favorite serialization method)

    mostly because they're all human-readable, less verbose, and not reliant on schema and other crap.

  • electricitylikesmeelectricitylikesme Registered User regular
    Jimmy King wrote: »
    Jimmy King wrote: »
    Why the fuck do so many people struggle with XML? Not even the fancy bits like separate namespaces and whatnot, just plain old <elem1><elem2>blah</elem2></elem1>
    it's probably that "Oh I'm doing something quick, I'll come back later and fix it up!" and then they never do.
    I wish that was it.

    I'm trying to write some code to export data from our system to a specific format for another system. it's xml, which contains html (ugh) and they are getting themselves confused about what the fields in their own xml are for and which ones need CDATA and which don't and confusing problems with one element with a different element and blah blah blah. Just getting totally confused.

    Because XML is syntactically horrible, using a whole bunch of characters which are difficult to hit on a keyboard and have to repeated endlessly?

    In my experience XML usually sounds like a good idea, but in practice I end up wanting to claw out my eyeballs.

  • Jimmy KingJimmy King Registered User regular
    Oh, I'm in no way defending XML. I just find people get way more confused by it way more often than they should. XML is tedious, not difficult. When you're the one who decided to use XML in the first place, then you should understand your schema better than I understand your schema.

  • GnomeTankGnomeTank What the what? Portland, OregonRegistered User regular
    XML is fine for most things. Human readability is rarely something I care about if I am using XML, I am almost always worried about simple interchange. It's ubiquitous nature makes it a great interchange format between systems (surprise, surprise, it's intended purpose), and a decent enough simple storage format.

    Even the simple INI isn't a ubiquitous thing, requiring me to find or write a parser library on a lot of platforms (not that parsing INI's is tough, but having very recently written an INI parser with multi-values, it's not 5 lines of code and done either), and if I am doing true multiplatform, with different base libraries and languages but shared model schema, XML is a very easy to spool up choice.

    JSON would be my format of choice all things being equal, but I work across so many platforms that XML is just simple (JSON is horribly represented in the .NET world, for example).

    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
  • admanbadmanb unionize your workplace Seattle, WARegistered User regular
    edited October 2012
    Jasconius wrote: »
    GnomeTank wrote: »
    GnomeTank wrote: »
    Choices choices...do I use Sublime Text on my new Mac, or do I go back to the Original and use TextMate?

    well TextMate is basically a dead product so...

    TextMate may not actually be dead! The 2.0 alpha has had some pretty substantial updates since getting open-sourced. I would (and do) still use Sublime, but it's worth keeping an eye on TM.

    admanb on
  • EchoEcho ski-bap ba-dapModerator mod
    Joe K wrote: »
    honestly, it's because xml is overly-verbose and frigging hard to read by sight. it should be burned in a fire. also, most implimentations of XML are overly verbose .ini files.

    On that note, I got done writing a doodad for convering CSS into TextMate XML themes because fuck writing XML by hand.

  • zeenyzeeny Registered User regular
    edited October 2012
    Seems like I may be jumping the PHP ship and moving to Ruby in the near future. I WILL MISS IT, FUCK YA ALL!
    JSON would be my format of choice all things being equal, but I work across so many platforms that XML is just simple (JSON is horribly represented in the .NET world, for example).

    I've recently had to do a lot of work with converting/parsing raw data into/from xml/ini/json.
    XML for anything related to customers(export, conversions etc). You can structure it, you can style it, errors are very easy to notice.
    JSON for everything else.(settings, configurations etc)
    INI, if you hate yourself with a passion.

    zeeny on
  • admanbadmanb unionize your workplace Seattle, WARegistered User regular
    No you won't.

  • zeenyzeeny Registered User regular
    admanb wrote: »
    No you won't.

    I will never forget my first fatal error!

  • GnomeTankGnomeTank What the what? Portland, OregonRegistered User regular
    zeeny wrote: »
    Seems like I may be jumping the PHP ship and moving to Ruby in the near future. I WILL MISS IT, FUCK YA ALL!
    JSON would be my format of choice all things being equal, but I work across so many platforms that XML is just simple (JSON is horribly represented in the .NET world, for example).

    I've recently had to do a lot of work with converting/parsing raw data into/from xml/ini/json.
    XML for anything related to customers(export, conversions etc). You can structure it, you can style it, errors are very easy to notice.
    JSON for everything else.(settings, configurations etc)
    INI, if you hate yourself with a passion.

    Until Microsoft makes JSON part of the official framework, I'll stick to XML for most things in .NET, simply because of it's integration to the system. I don't need my own JSON based configuration or settings formats when .NET supports those as App.config natively.

    I hope that someday MS does allow App.config to be JSON, that would be awesome.

    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
  • JasconiusJasconius sword criminal mad onlineRegistered User regular

    admanb wrote: »
    Jasconius wrote: »
    GnomeTank wrote: »
    GnomeTank wrote: »
    Choices choices...do I use Sublime Text on my new Mac, or do I go back to the Original and use TextMate?

    well TextMate is basically a dead product so...

    TextMate may not actually be dead! The 3.0 alpha has had some pretty substantial updates since getting open-sourced. I would (and do) still use Sublime, but it's worth keeping an eye on TM.

    yeahhhh, I read an interview with the guy who writes textmate and he sounds like a whack job

    Sublime 2 consumes everything that makes Textmate worthwhile with relative ease, and works on all platforms

  • urahonkyurahonky Registered User regular
    So I have a folder with about 10,000 files in it. I want to search through all of these files and find a certain letter, if that file has that letter then I want to copy that to a separate folder. What should I do this in? I'm on Windows. A batch file will be a pain in the ass right?

  • PhyphorPhyphor Building Planet Busters Tasting FruitRegistered User regular
    Is this letter in the filename or contents?

  • Monkey Ball WarriorMonkey Ball Warrior A collection of mediocre hats Seattle, WARegistered User regular
    edited October 2012
    Writing a disk benchmarker (in theory to eventually to make it more like the workloads our software actually cause, in practice just so I can get better integrated with how they do thing around here in learn C++ at the same time)

    So they wanted to be able to set up the benchmark configuration in a file, say, "Oh I want to bench doing operations on /dev/sda, /dev/sdb, /dev/sdc, and /dev/sdd"

    My boss suggested I use XML because they already have an XML parser in the codebase.

    I was like "please no."

    Instead I just used JsonCPP, and it worked beautifully and took almost no time.

    edit: Damnit I can't type today at all. :|

    Monkey Ball Warrior on
    "I resent the entire notion of a body as an ante and then raise you a generalized dissatisfaction with physicality itself" -- Tycho
  • ecco the dolphinecco the dolphin Registered User regular
    urahonky wrote: »
    So I have a folder with about 10,000 files in it. I want to search through all of these files and find a certain letter, if that file has that letter then I want to copy that to a separate folder. What should I do this in? I'm on Windows. A batch file will be a pain in the ass right?

    Won't Explorer's search interface let you do this?

    Just go "Search", and Explorer will pop up the results.

    Failing that, here's a batch file assuming that you're looking for a letter inside a file:
    :: Add a @ at the start of the echo (don't want to page Echo again)
    echo off
    setlocal enableextensions enabledelayedexpansion
    
    :: Set the TEXT_TO_FIND to be whatever you want found inside a file
    set TEXT_TO_FIND="2"
    
    :: usebackq executes the findstr command
    :: delims= removes the default delimiters of space, so that spaces in filenames
    :: get passed properly
    for /F "usebackq delims=" %%i in (`findstr /M %TEXT_TO_FIND% *`) do (
        echo File: %%~fi
    )
    

    Penny Arcade Developers at PADev.net.
  • quietjayquietjay Indianapolis, INRegistered User regular
    urahonky wrote: »
    So I have a folder with about 10,000 files in it. I want to search through all of these files and find a certain letter, if that file has that letter then I want to copy that to a separate folder. What should I do this in? I'm on Windows. A batch file will be a pain in the ass right?

    Assuming you want to copy files containing the letter z from c:\sourcedir to c:\targetdir:
    for /f "usebackq tokens=2,3 delims=: " %a in (`find /c "z" c:\sourcedir\*.*`) do if not %b==0 copy %fa c:\targetdir
    

    Become a Star Citizen
  • ecco the dolphinecco the dolphin Registered User regular
    quietjay wrote: »
    urahonky wrote: »
    So I have a folder with about 10,000 files in it. I want to search through all of these files and find a certain letter, if that file has that letter then I want to copy that to a separate folder. What should I do this in? I'm on Windows. A batch file will be a pain in the ass right?

    Assuming you want to copy files containing the letter z from c:\sourcedir to c:\targetdir:
    for /f "usebackq tokens=2,3 delims=: " %a in (`find /c "z" c:\sourcedir\*.*`) do if not %b==0 copy %fa c:\targetdir
    

    Windows command line.

    We do it because we must, not because we like it.

    Penny Arcade Developers at PADev.net.
  • quietjayquietjay Indianapolis, INRegistered User regular
    quietjay wrote: »
    urahonky wrote: »
    So I have a folder with about 10,000 files in it. I want to search through all of these files and find a certain letter, if that file has that letter then I want to copy that to a separate folder. What should I do this in? I'm on Windows. A batch file will be a pain in the ass right?

    Assuming you want to copy files containing the letter z from c:\sourcedir to c:\targetdir:
    for /f "usebackq tokens=2,3 delims=: " %a in (`find /c "z" c:\sourcedir\*.*`) do if not %b==0 copy %fa c:\targetdir
    

    Windows command line.

    We do it because we must, not because we like it.

    I guess it's a little sexier in PowerShell:
    get-childitem c:\sourcedir | select-string "z" | %{copy-item $_.path c:\targetdir}
    

    Become a Star Citizen
  • urahonkyurahonky Registered User regular
    The letter is in the filename. Sorry... I'll give that a shot later @quietjay, if it works I owe you a beer.

  • agoajagoaj Top Tier One FearRegistered User regular
    edited October 2012
    In C++ inheritance, I should get all the methods of the base class right? I can access them if I cast it, but not if I handle it as it's actual descendant class.
    //Not technically an interface, implements some methods and members
    	class ICollision
    	{
    		
    		//Stores a data of all collision objects this has collided with
    		std::vector<Data> collisions;
    		int propertyMask;
    	protected:
    		bool hasCollided;
    		Manager* manager;
    		void AddCollisionData(ICollision* c);
    	public:
    		std::map<Property, int> propertyList;
    		enum Type{
    			POINT,LINE,RECTANGLE
    		}type;
    		//Mask is used to know which id's to ignore for collisions
    		//So id will be one Mask bit, while mask will by OR'd flags
    		Mask id, mask;
    		virtual ~ICollision();
    		virtual bool Test(ICollision* b)=0;
    		virtual void Display(float x, float y)=0;
    		//Test against collision manager collection
    		void Test();
    		//Once a property has been added, it cannot be removed
    		void SetProperty(Property p, int val);
    		int GetProperty(Property p);
    		//Check the propertyMask to know which properties are available
    		int GetPropertyMask();
    		//Note: this resets the collision data, if you call it twice you'll get an empty vector
    		std::vector<Data> GetCollisionData();
    	};
    class Rectangle : public ICollision
    	{public:
    		Position a,b,size;
    		Rectangle(float x = 0, float y = 0, float width = 0 ,float height = 0, bool isUnregistered = false);
    		Rectangle(const Rectangle& r);
    		void SetPosition(Position p);
    		void SetSize(Position p);
    		float Width();
    		float Height();
    		bool Test(ICollision* c);
    		static bool UnitTest();
    		void Display(float x, float y);
    		Rectangle& operator=(const Rectangle& r);
    	};
    

    Is something wrong in my setup, or do I need to make copies of these base functions for all descendant classes?

    I'm trying to access Test() from Rectangle, which has it's own Test(ICollision* c), but it's overloaded for a pointer.

    agoaj on
    ujav5b9gwj1s.png
  • PhyphorPhyphor Building Planet Busters Tasting FruitRegistered User regular
    edited October 2012
    There's Test() - which you should be able to access directly and then there's Test(ICollision*) which is virtual, meaning that the derived implementation overwrites the base one. What errors are you getting?

    Phyphor on
  • NightslyrNightslyr Registered User regular
    edited October 2012
    It's sad that even on Stack Overflow PHP devs suck. No, having a presentation layer class derive straight from MySQLi or PDO is not good design.

    EDIT: Stupid PS3 browser won't let me pick emoticons

    Nightslyr on
  • InfidelInfidel Heretic Registered User regular
    Yeah, can you explain further agoaj? Overloading and overriding are different things and combined just fine.

    OrokosPA.png
  • agoajagoaj Top Tier One FearRegistered User regular
    Phyphor wrote: »
    There's Test() - which you should be able to access directly and then there's Test(ICollision*) which is virtual, meaning that the derived implementation overwrites the base one. What errors are you getting?

    Yes, there are two functions named Test, one is virtual, one is not. The virtual one takes a pointer, the base takes nothing.
    I'm overriding the virtual one, it's abstract so I have to.

    I'm getting the error
    'Collision::Rectangle::Test' : function does not take 0 arguments

    ujav5b9gwj1s.png
  • PhyphorPhyphor Building Planet Busters Tasting FruitRegistered User regular
    Oh right, new class decls hide all duplicated names. You can put a "using ICollision::Test;" to make sure it pulls it in right

  • InfidelInfidel Heretic Registered User regular
    Phyphor wrote: »
    Oh right, new class decls hide all duplicated names. You can put a "using ICollision::Test;" to make sure it pulls it in right

    Oops, missed that he didn't reference it yeah.

    Supposedly it is to keep new base overloads from changing how your derived class functions, but I've never seen people design or run into this in the wild that I recall.

    Something like: Foo class defines print(Object), you inherit but add your own print(Fruit) in a derived Bar class, but then someone adds print(Apple) to the base and your existing derived class and code are now using the base implementation of print(Apple) instead of your print(Fruit) when you call print on your appleObject. OMG they took control from my Bar object and code without me changing anything!!!1

    But uhh, that is contrived and if I'm designing sensible classes then adding print(Apple) better do something reasonable and that I would want to inherit. Otherwise what the fuck is going on in your project that you're sabotaging each other like that?

    Instead, you need to declare explicitly that you wish to inherit everything for better or worse. Using the "using base::method;" form which means inherit all overloads named method. Fugly stuff imo YAY C++ OOP!

    OrokosPA.png
  • EchoEcho ski-bap ba-dapModerator mod
    edited October 2012
    Nightslyr wrote: »
    It's sad that even on Stack Overflow PHP devs suck. No, having a presentation layer class derive straight from MySQLi or PDO is not good design.

    EDIT: Stupid PS3 browser won't let me pick emoticons

    I was happy when I saw that CodeIgniter had an ActiveRecord class.

    That lasted all the way until I actually looked at the class.

    Yeah, replacing the SQL syntax with identically named PHP methods? That's a silly thing.

    I ended up abstracting it away by making assorted methods like get_user_by_email() etc in my User model.

    edit: shit like this. Ugh.
    $this->db->select('username, firstname, lastname');
    $this->db->where('username', $user);
    $query = $this->db->get('user', 1);
    

    Echo on
This discussion has been closed.