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/
We're funding a new Acquisitions Incorporated series on Kickstarter right now! Check it out at https://www.kickstarter.com/projects/pennyarcade/acquisitions-incorporated-the-series-2

Git Merge Squashing [Programming] Thread : Filesystems logging stuff

17879818384100

Posts

  • Jimmy KingJimmy King Registered User regular
    an_alt wrote: »
    Jimmy King wrote: »
    Damn it. Just got assigned to a project doing medical stuff.

    We need the "bro?" button back. It had many different meanings depending on context, but here it would clearly indicate a grimace, shake of the head, and hand on the shoulder.

    I'm so sorry, bro.
    It "may" not be too bad, actually. If everything I have been told since then turns out to be true and continues to stay true. All Python/Django stuff. I do not have to be concerned with hipaa - the client is dealing with everything related to that and we are just staying out of it. So, so far, the only potential nasty bit seems to be that I have to make Django auth against Active Directory. I assume there's probably a handy auth backend already available to do that via ldap and I can't imagine it being any worse than when I made apache on a unix server do http basic auth to active directory many years ago.

  • urahonkyurahonky Registered User regular
    Has anyone here done any sort of LDAP programming? What was it like?

  • urahonkyurahonky Registered User regular
    Guess not. :P Oh well. Phone interview with that dude in NY in 15 minutes.

  • Jimmy KingJimmy King Registered User regular
    Nothing serious, just the apache http basic auth against LDAP servers years ago. It was just a matter of getting all of the container/OU stuff right for finding the users and setting the right options on mod_auth_ldap. In fact, I didn't really "program" anything for that. I configured, after that the user was in my http environment variables.

    Evigilant
  • urahonkyurahonky Registered User regular
    Yeah it seems there's not much "programming" for LDAP. It look very similar to JDBC and stuff.

    According to one of the guys who had the interview already the guy specifically states that it's a "little to no programming involved" job.

  • Jimmy KingJimmy King Registered User regular
    Yeah, it's just a protocol for authenticating/authorizing users, managing access to objects, etc. Unless you're writing a client or server which implements ldap and are writing the code for the implementation yourself, there's really no programming specific to it. An app might import a library and have a couple of simple function/method calls. If it's a systems admin type thing, then it's mostly just setting permissions, configuring groups/permissions, adding/managing "objects" which could be servers, printers, shared directories, users, and so on, from what I remember.

  • InfidelInfidel Heretic Registered User regular
    LDAP is just doing very boring database stuff.

    OrokosPA.png
    bowen
  • urahonkyurahonky Registered User regular
    Well I went in expecting to hate it. But by the end I felt a lot more comfortable with it. It may not have much programming related to it but it seemed interesting enough. Plus it's remote. I kinda blew it by running my big mouth about it at first though.

    Two minutes in he asked if I was interested in the job and, instead of being a smart person, I spoke my mind and said "Well it seems like I don't really have a choice right now with all the hardships our office is having at the moment." As I was saying it I was like "WTF shut up!" But I did apologize and say that I misspoke and whatever and that I just wasn't sure, but after talking with them it seems like it'll be alright. We'll see how it goes. I asked how long they've been on that project and one of them has been doing it for 16 years and the other is at 7 years. This contract is set to renew in September so I'll at least have some money coming in until then.

  • urahonkyurahonky Registered User regular
    I have this problem with being TOO honest when people ask me questions. I don't like to sugar coat anything. If someone asks I'll tell them whatever they want.

  • KakodaimonosKakodaimonos Code fondler Helping the 1% get richerRegistered User regular
    Hah. This bug has been causing problems all over the place. And it was a pain to track down.
    foobar = ((uint)bar4) << 24 | ((uint)bar3 << 16) | ((uint)bar3 << 8) | (uint)bar1;
    

  • DelmainDelmain Registered User regular
    Hah. This bug has been causing problems all over the place. And it was a pain to track down.
    foobar = ((uint)bar4) << 24 | ((uint)bar3 << 16) | ((uint)bar3 << 8) | (uint)bar1;
    

    Oof.

    InfidelThe Anonymous
  • urahonkyurahonky Registered User regular
    So I'm updating my commitments. Commitments are basically things you'll do in the next year, and these are directly tied to your raise. For example:

    "Improve code base to reduce the amount of bugs that reach production down to at most 3." and when you're having your review they look at that, and you get a number 1-5. 3 basically means you succeeded in doing your commitment. 4 means you exceeded and did more, and 5 means you exceeded and went above and beyond. All 3's gives you a small raise, and all 5's gives you a large raise.

    So the idea is to make one that is quantifiable. This is my problem. I have a commit I need to update and I'm not sure how to quantify it:

    "Complete assigned projects and/or tasks within the established project schedule." The problem is that if I complete the task then I'll get a 3. There's almost no hope of getting a 4 or 5 because I didn't quantify it. Does anyone have any suggestions?

  • mightyjongyomightyjongyo Sour Crrm East Bay, CaliforniaRegistered User regular
    Still sounds like a 5 if you complete ahead of schedule? Not sure if that's feasible at your workplace though.

  • urahonkyurahonky Registered User regular
    It would if the environment wasn't so volatile. :) But you're right finishing it before the release date would qualify... The problem is that even if I finish early there's no real way to "push it" through. Our apps have scheduled release dates so our deployment team doesn't get swamped.

  • DelmainDelmain Registered User regular
    You could point out times when you finished early and then either had more time to polish or got more bug fixes in before deployment.

  • Jimmy KingJimmy King Registered User regular
    I realize frequently performance metrics are fucking retarded, but if you had the code done, working, and ready for deployment and it's waiting on another team to deploy or other things that are completely outside of your control, I don't see why that counts against you. You got your shit done early.

    Code that is approved ready for deployment not getting deployed fast enough should be on the deployment team.

    bowen
  • templewulftemplewulf The Team Chump USARegistered User regular
    I've never seen an application development department that had satisfactory metrics. Usually, they're oriented to things you can quantify in stats. Like the sales department moving 10% more widgets, or opening 15% more accounts, or whatever.

    Since my departments usually don't have any notice of what we'll be working on after the next 2 months, there's no way we can write metrics a year ahead of time.

    If anyone figures out how to write these well, you need to release a goddamn thesis on it so the rest of us can look good too.

    Twitch.tv/FiercePunchStudios | PSN | Steam | Discord | SFV CFN: templewulf
  • EvigilantEvigilant VARegistered User regular
    urahonky wrote: »
    It would if the environment wasn't so volatile. :) But you're right finishing it before the release date would qualify... The problem is that even if I finish early there's no real way to "push it" through. Our apps have scheduled release dates so our deployment team doesn't get swamped.
    I just don't think that "Complete assigned projects and/or tasks within the established project schedule" is a commitment you need to put down because it's already an understanding between the business, your lead, the team and yourself. You're already going to attempt this and only when certain occasions occur is when you can't finish something within a timeline. Not only that, but it's either you did or didn't meet the commitment. Did you sort of reach it, so you sort of completed it during the project schedule? What's the sort of, what went wrong, what's missing? Did you overwhelmingly always meet it? Where you always ahead? Did you pull in more stories/tasks to do? It doesn't really lead itself to easily quantifiable metrics.

    It seems more like "remembered to wear pants 260 days of the year".

    Perhaps replace that with "x% of code refactored" or "x% of technical debt corrected in code base". Those are quantifiable and measurable.

    XBL\PSN\Steam\Origin: Evigilant
  • mightyjongyomightyjongyo Sour Crrm East Bay, CaliforniaRegistered User regular
    My coworker has been complaining about code updates breaking his build.

    He's over a thousand revisions behind trunk. What was he expecting? Jesus Christ. I told him that keeping up to date would make his life easier and his response was that he didn't want to deal with rebasing against trunk.

    His solution was that we should make a new target for his product build so everyone else knows that their changes broke his build.

    ....okay guy.

    bowen
  • KakodaimonosKakodaimonos Code fondler Helping the 1% get richerRegistered User regular
    Oh, we have a good one today.

    Got an email forwarded to me by our support people. The client was bitching about how crappy our system was and how it doesn't work.

    He's not been able to connect to our database.

    The issue? He isn't linking in the MySQL lib into his program.

    I'm going to ask our support team just how valuable this customer is. Then I'll reply with a "Do you even know what the fuck you are doing?" email.

    I would have thought the fact that his program won't even fucking run would be a sign that it's on his end. Plus the wad of link errors.

  • Jimmy KingJimmy King Registered User regular
    At least 50% of my support time when I had to write and support stuff which outside customers then wrote code to interact with was spent showing them that the problem was not on our end, and frequently spent digging through their code to find the bugs and fix them for them.

    Oh, so you've got 40 websites which integrate with our API with some javascript ajax calls and dom manipulation you developed. 39 of them work perfectly every time and 1 is not working... and you think the problem is probably our API and not that you fucked up the code on that one site? Really? Hold on while I go through a few of your sites with Firebug and find the difference in the code for you.

    It's working perfectly, every time, for 50 other clients making several requests per second, but it's failing for you every time because of a DNS error. You still don't think maybe the problem is configuration on your end after I've informed you of that and you've resolved the dns properly yourself with a different server?

    And those were both examples from one of the more competent customers that I actually liked.

  • urahonkyurahonky Registered User regular
    Ugh, looks like one of the guys that sit next to me was let go. I think he was on overhead for a few weeks more than I have been... But he is a level 4 or 5 software engineer whereas I'm still an Asc (less than 1 I think?) so he was making a ton more than I was.

  • urahonkyurahonky Registered User regular
    Well I got the Owego job. It's remote so I don't have to move so I guess that's good. And I have a charge number now so I don't have to worry about losing my job.

    Mr_RoseLD50oldmankenJimmy KingmightyjongyoMahnmutNightslyrDelmainecco the dolphingavindelEvigilantRawkking GoodguyThe AnonymousTofystedethVegemyteSporkAndrewbowentemplewulfIncindium
  • MahnmutMahnmut Registered User regular
    So here's a C++ problem -- I've done something with vectors and pointers that is legal and does perform as expected, but is so ugly and weird that I really doubt it's the proper idiom. I would love to know what saner approach you'd use if you were, for example, more comfortable with the STL.
    So I wrote this dumb little tic-tac-toe vs. AI game. You've got a GameBoard that's composed of nine color-changing Tiles. These are stored in a std::vector<Tile>.

    For the purpose of analysis, I wanted to break the board down into rows, columns, and diagonals. So I made these vectors of pointers to Tiles:
    std::vector<mots::Tile*> columnA;
    std::vector<mots::Tile*> columnB;
    std::vector<mots::Tile*> columnC;
    std::vector<mots::Tile*> rowA;
    std::vector<mots::Tile*> rowB;
    std::vector<mots::Tile*> rowC;
    std::vector<mots::Tile*> diagonalA;
    std::vector<mots::Tile*> diagonalB;
    

    And then, because I knew I'd want to ask things like, "Are any of these rows/columns/diagonals completely claimed by the player?" I made this even more ridiculous vector of pointers to vectors of pointers to Tiles:
    std::vector<std::vector<mots::Tile*>*> allTheLanes;
    

    So when the computer goes to make its move, it calls a series of functions a like this guy:
    bool mots::GameBoard::tryWin(){
    //Win: Do you have 2 in a row? Is there an empty space in that row? Pick it.
    
    
    	//In each lane,
    	for (int i = 0; i < 8; i ++){
    		std::vector<mots::Tile*> * currentLane = (allTheLanes[i]);
    
    		//in the lane we're looking at, could we win on this turn?
    		if ((numberOfComputerTiles(*currentLane) == 2) && (numberOfUnclaimedTiles(*currentLane) != 0)){
    			//If so, find and claim the empty space:
    			for (int j = 0; j < 3; j++){
    				if (((allTheLanes[i])->at(j))->getOwner() == mots::Tile::Owner::Nobody){
    					((allTheLanes[i])->at(j))->setOwner(mots::Tile::Owner::Computer);
    					return true;
    				}
    			}
    		}
    	}
    	//If you didn't find anything, return false.
    	return false;
    };
    

    Full code here, but that's basically the gist of it.
    So ummm yes. It's not a smart or scalable algorithm for solving Tic-Tac-Toe, but that's secondary to my main concern -- all this vector-pointer-reference-dereference spaghetti looks absurd to my novice eye (and also makes refactoring potentially really intimidating).

    Steam/LoL: Jericho89
  • mightyjongyomightyjongyo Sour Crrm East Bay, CaliforniaRegistered User regular
    vectors aren't great for what you're trying to do, in my opinion... I'd prefer something like:
    typedef enum {
      empty = 0,
      player,
      AI,
    } state;
    
    state board[3][3];
    
    bool checkDiag() {
      if (board[0][0] == AI && board[1][1] == AI && board[2][2] == AI) return true;
    }
    

    board doesn't need to be an enum or int, you can make your own Tile class still.

  • GnomeTankGnomeTank What the what? Portland, OregonRegistered User regular
    If this is modern C++, use enum classes. It's a good habit to get in to and doesn't pollute your namespace.
    enum class state {
       empty = 0,
       player,
       AI
    };
    
    state board[3][3]
    
    if(board[0][0] == state.AI) ...
    

    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
    mightyjongyoecco the dolphinbowen
  • khainkhain Registered User regular
    Evigilant wrote: »
    urahonky wrote: »
    It would if the environment wasn't so volatile. :) But you're right finishing it before the release date would qualify... The problem is that even if I finish early there's no real way to "push it" through. Our apps have scheduled release dates so our deployment team doesn't get swamped.
    I just don't think that "Complete assigned projects and/or tasks within the established project schedule" is a commitment you need to put down because it's already an understanding between the business, your lead, the team and yourself. You're already going to attempt this and only when certain occasions occur is when you can't finish something within a timeline. Not only that, but it's either you did or didn't meet the commitment. Did you sort of reach it, so you sort of completed it during the project schedule? What's the sort of, what went wrong, what's missing? Did you overwhelmingly always meet it? Where you always ahead? Did you pull in more stories/tasks to do? It doesn't really lead itself to easily quantifiable metrics.

    It seems more like "remembered to wear pants 260 days of the year".

    Perhaps replace that with "x% of code refactored" or "x% of technical debt corrected in code base". Those are quantifiable and measurable.

    If schedule and cost are not easily quantifiable metrics then I'd be really curious how the company functions as those metrics seem required. I also don't agree that you shouldn't put something in a performance review because it's already understood. If anything, I think it's the opposite. A major part of a software engineers job is to deliver software, with relatively few or no bugs, under time and cost constraints and thus you should be evaluated against that.

    This also may be a difference in workplaces, but where I work refactoring the code would basically be a project and an employee couldn't just decide to do it. Thus I would be hesitant to put something in a performance review that you don't have control over.

    Delmain
  • MahnmutMahnmut Registered User regular
    Aha, thanks! I think there was a reason I rejected a 2d array of objects, but it was a dumb reason -- like coming from just a wee bit of Java I was spooked about how memory works. Using one will def. simplify those expressions, and I don't need any of a vector's special properties. I'll make another pass at it with this approach. :^:

    Steam/LoL: Jericho89
  • PhyphorPhyphor Building Planet Busters Tasting FruitRegistered User regular
    edited February 2014
    Hmm, in C++ there's no way to have classes: T, T<x>, T<x,y>... is there

    Phyphor on
  • PhyphorPhyphor Building Planet Busters Tasting FruitRegistered User regular
    edited February 2014
    (*(std::function<void(std::vector<type>)>*)voidptr)(list)

    I am going to C++ hell aren't I?

    Phyphor on
    undergroundmonorailecco the dolphinmightyjongyoMahnmutThe AnonymousASimPersongavindelbowen
  • SmasherSmasher Starting to get dizzy Registered User regular
    edited February 2014
    So you want a class template that can take an arbitrary number of members of arbitrary types? What is the purpose of the class? I have to imagine there's a better way of doing whatever you're trying to do.

    Smasher on
  • PhyphorPhyphor Building Planet Busters Tasting FruitRegistered User regular
    edited February 2014
    Partially bound closures.

    Let's say you have f(int, int, float) and want to be able to create objects that can be called with 0, 1, 2 or 3 bound values and the rest supplied at call time. It works fine until you want a fully bound version, then you can't have any template args and have to use a different class for it, which causes annoying aliasing issues and just looks weird

    std::function/bind with friendlier syntax basically. std::bind is especially ugly with member functions and having to use std::placeholder::_X to bind the missing args.

    Variadic templates could probably get me what I want, but they're not universally supported yet

    Phyphor on
  • GnomeTankGnomeTank What the what? Portland, OregonRegistered User regular
    Variadic templates is basically what you want, but yeah, they are only supported in the latest compilers.

    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
  • ecco the dolphinecco the dolphin Registered User regular
    edited February 2014
    Calendar hax!

    February* - when giving one calendar month's notice is the same as the same as 4 weeks' notice.

    * On a non-leap year.


    Edit: Praise be to the honky!

    ecco the dolphin on
    Penny Arcade Developers at PADev.net.
  • InfidelInfidel Heretic Registered User regular
    Calendar hax!

    February* - when giving one calendar month's notice is the same as the same as 4 weeks' notice.

    * On a non-leap year.


    Edit: Praise be to the honky!

    New job for you???

    OrokosPA.png
  • ecco the dolphinecco the dolphin Registered User regular
    Infidel wrote: »
    Calendar hax!

    February* - when giving one calendar month's notice is the same as the same as 4 weeks' notice.

    * On a non-leap year.


    Edit: Praise be to the honky!

    New job for you???

    Yuuuuuuuuup!

    Going to a smaller team - have more responsibilities, a wider technical skill base, higher pay...

    Yaaaaaaaaaaay!

    Penny Arcade Developers at PADev.net.
    mightyjongyoEvigilantundergroundmonorailInfidelurahonkyan_altTofystedeth
  • gavindelgavindel The reason all your software is brokenRegistered User regular
    Is anyone familiar with how to pull a formatted string out of an HTML text area and turn it into JSON?

    I have a text box into which I need to dump code of the format
    {
    {"a": String, "b":int,"c":int},
    {"a": String, "b":int,"c":int},
    ...
    {"a": String, "b":int,"c":int},
    }
    

    This needs to get broken into a JSON array. I'm trying to access the text box with getDocumentById("textbox").value() plus JSON.parse(textboxstring) and I'm getting a silent crash.

    Angels, innovations, and the hubris of tiny things: my book now free on Royal Road! Seraphim
  • EndEnd Registered User regular
    is 'getDocumentById("textbox").value()' actually what you have? I don't work with the DOM directly often, but shouldn't that be "document.getElementById("textbox").value", assuming your element id is actually "textbox"?

    (also, I assume the {} on line 1 and 6 are a typo, and that you meant [])

    I wish that someway, somehow, that I could save every one of us
    zaleiria-by-lexxy-sig.jpgsteam~tinythumb.png
  • gavindelgavindel The reason all your software is brokenRegistered User regular
    i'm literally using "document.getDocumentById("textbox").value()". As for the {} on 1 and 6, no, that's what i have. Does it need to be [] for JSON?

    Angels, innovations, and the hubris of tiny things: my book now free on Royal Road! Seraphim
  • SaerisSaeris Borb Enthusiast flapflapflapflapRegistered User regular
    edited February 2014
    document.getDocumentById doesn't exist. You want document.getElementById.
    Javascript uses [] syntax for array literals and {} syntax for object (map / dictionary) literals. JSON is based on Javascript (JavaScript Object Notation) and uses the same syntax. It looks like you have a list of items there, so you need []. Each item itself is an object{}, and you have an array[] of those object{}s.
    DOM elements like your textbox there do not have a method called element.value(). Instead, you access the value directly with element.value (no parentheses).

    Also, when you say you get a "silent crash", do you mean nothing is reported in the console? There should be some error in there. Which browser are you using to test this?

    Saeris on
    borb_sig.png
    Delmain
This discussion has been closed.