title: Monitor Process

text: I have some previous posts talking about how to use python to "do something" when a record is inserted or deleted into a postgres database. I finally decided on going with a message queue to handle the "jobs"(beanstalkd). I have everything setup and running with another python process that watches the queue and "does stuff". I am not really a "systems" guy so I am not sure what is a good way to go about monitoring the process to make sure if it fails or dies that it restarts and sends a notification. Google gave some good ideas but I thought asking here I could get some suggestions from people that I am sure have had to do something similar. The process is critical to the system and it just needs to always work and if its not working then it needs to be addressed and other parts of the system "paused" until the problem is fixed. My thoughts were to just have a cronscript run every minute or two that checks to see if the process is running. If not it restarts it. Another script (or maybe just another function of the first) would be to monitor the jobs and if the jobs waiting to be processed hit a specific threshold to also flag that there is a major problem. Specifics about process... The process updates the orders in a legacy system with the qty's of items that are shipped or back ordered from our warehouse. SO if these things are not done then when the order is invoiced it will have incorrect qtys and the people involved wouldn't have a good way to spot this unless they are checking each line. I thought I might also have a flag on the order that says "yes i have been touched" and if its hasn't to just notify the invoice agent. This same method is going to be used for updating orders with shipping information based on when orders are shipped from UPS Worldship. I don't know, i think i have a handle on this but it just feels "kludgy".


title: c++ write own xml parser vs using tinyxml

text: I am currently in a task to generate an XML file for an srt text file containing timestamps and corresponding text. To generate an exe file which accepts file name input and outputs the relevant XML file to be used as part of an automated script. Is it Advisable to use Tinyxml for this? Edit: your comments regarding this are very much appreciated what's the easiest way to generate xml in c++?


title: Etymology of "String"

text: So it's obvious that a string of things is a sequence of things, and so a sequence of characters/bytes/etc. might as well be called a string. But who first called them strings? And when? And in what context such that it stuck around? I've always wondered about this.


title: How do you manage workflow tasks for a distributed team?

text: I work for a small software company which is responsible for delivering roughly a thousand custom software packages for roughly 100 customers. We are struggling at tracking the release process. The entire thing is pretty repeatable but, because of the different distribution processes, there are about 2 dozen steps from the time we sign a contract to the point a product goes out the door. To make matters more complicated, we have a few different 'types' of employees that are involved. We have a sales person who gets all requirements and deal terms. We have developers who do any modifications required by the customer. There is another type of employee which does the work of running the final build, testing and distributing the product. I'm looking for ideas on how people manage these sorts of processes as we look to fix some issues which have been plaguing us for a while. Primarily, we are seeing a lot of issues sequencing the events AND communicating the information associated with each product to the build/distribution team. Currently we use SVN(SCM), Jenkins/Hudson(Build) and Redmine(Feature/Bug Tracker). Are there software solutions or is this just an internal process we have to document and understand? I'd really like to find a way to keep everyone aware of what the status of a particular app is and notify people that they are expected to do something.


title: How should a senior programmer monitor another senior programmer?

text: I'm working with a new senior programmer who has almost the same amount of experience as me. He his own project to work on -- but I have to make sure he does not mess things up. Now, how can I monitor him since he's not junior? Do I examine his code? Cons of this are that I am not as deep into project as himself so it's time consuming for me (have my own project besides this). Do I only do QA from the perspective of another senior? Any advise here is appreciated. I was recently in the same situation where I relied that another senior will handle all tickets properly, and then it took me 3 weeks to fix his oversights. So I do not want to be in the same situation again.


Is there any Boost equivalent library for C?


title: Can the language make us stupid?

text: Do programming languages, that we are mainly coding in, really change the way we are thinking about problems? Sort of programming kind of the Sapir–Whorf hypothesis. And if they do, doesn't it really mean, that there **are** programming languages, which can make us, well, not stupid, but narrow-minded? **UPDATE:** this question is actually not about acknowledging the fact that we all should know at least three or four languages. This goes without saying. But what if there are some "dangerous" languages, which is better not to learn at all?


title: Why do people store shipping and handling in the order header and not a line item

text: I have worked on several ordering systems. Every one of them has tracked the shipping and handling as part of the order header rather then tracking it as a line item. To me, it would make more sense to keep them with the line items, even if the information is not displayed that way to the user. What are the reasons for keeping them in the header?


title: Explaining interfaces to beginning programmers?

text: I've had discussions with other programmers on interfaces (C#). I tried to use the analogy of interfaces being like a contract between programmers. Meaning that when you design to an interface, you are designing to a "thought out plan". This didn't fly. The other programmers (limited experience) couldn't get the concept. Or worse, refused to participate. How do you explain to people like that there **are** reasons to use interfaces? Thanks


title: Appropriate UML diagram

text: What is an appropriate UML diagram if I want to display how user request web page, enters some data, then posts the form (and if the validation has not succeeded, user is redirected back to requested web page)?


title: How do I avoid "Developer's Bad Optimization Intuition"?

text: I saw on a article that put forth this statement: > Developers love to optimize code and with good reason. It is so satisfying > and fun. But knowing when to optimize is far more important. Unfortunately, > developers generally have horrible intuition about where the performance > problems in an application will actually be. How can a developer avoid this bad intuition? Are there good tools to find which parts of your code really need optimization (for Java)? Do you know of some articles, tips, or good reads on this subject?


title: Where can I learn about hardware/software co-design?

text: I'm involved in an embedded software project where we also need to specify the target hardware. I come from a mostly software-only background, and would like to learn more about the simultaneous design of software and hardware. Are there any books/resources/courses out there that you would recommend?


title: When do 'static functions' come into use?

text: OK, I've learned what a static function is, but I still don't see why they are more useful than private member functions. This might be kind of a newb-ish question here, but why not just replace all private member functions with static functions instead?


title: How do you respond to: "Ever since the update..." questions from clients?

text: Ever since the update, people keep calling and saying "Ever since the update X, Y and Z are slow, bad and crashing" This has happened ever since the dawn of updates. What do people expect? Gamma comes after beta, and gamma testing always turns our users into The Incredible Hulks... Perhaps you've never heard this from a client, perhaps you're in college or a FLOSS Dev who can spread the blame around more than 5 or 6 guys, perhaps you unit test your code, perhaps you're not in that interesting situation where customers actually call you requesting the exact time of day you'll be releasing today's patch (I'd love to do that to Microsoft) or perhaps you're a sorry son-of-a-biscuit like me who just shipped a new update and went home and is dreading going back to work tomorrow. Anyway, ya'll are smarter than me anyway. How do you field criticism framed in "You must be a bad programmer because you're making your software worse"?


title: Getting users to write decent and useful bug reports

text: Does anyone know a good way to **_get users to write a semi-decent_** (read: _useful_ ) **_bug report_**? We wanted to put up something that would make sense to most users (be easy to read and understand), yet give useful information to developers as well. _**It does not work when I click the blue button! Ahhh, I just lost a week's work ... make it work._** isn't very useful, as it is. I started to fix about a list, but thought to check up with you guys, whether a similar method already exists.


title: How to make sure that reported issues are not caused by wrong credentials or typos of the client?

text: I have found myself a few times in the situation where a client reports an issue like ' _I can no longer login to my account_ '. Sure enough when trying to login with the client's credentials myself everything works. After that, you start testing in other environments and situations, but still it works every time. After numerous tests you start to wonder if the user is using the right credentials. Some clients get offended when asking this. Others are so sure that they enter the right credentials, they don't even bother trying the credentials that you send them. How can I make sure that the client is using the right credentials?


title: Not enough information in Bugs / Tickets

text: I work in a small team of developers that supports several pieces of software that a large multi-site company uses. We use Spiceworks to raise issues and support requests throughout the IT department not just developers. We constantly get tickets raised with the following or similar: "Function X is broken, please fix it, it is urgent" Now this statement is practically useless to me, and it wastes my time and theirs whilst I try to work out the problem often only to discover it is something they had not realised or that should be assigned to someone else. Now my question is in what ways could I try to get people to write more information in bugs? I have thought of several ideas such as a template but I am pretty sure they would be ignored. The only thing I can think of that would almost certainly work is to refuse to action any tickets not written correctly, but I have my doubts as to whether I would be allowed to do this. Incidentally the people raising the bugs tend to have trouble using basic computer functions so I cant ask them to do anything very technical without a great deal of effort. Thanks all


title: Is using F# good enough for learning the important functional programming concepts of Haskell?

text: I'm coming from Linux and Ruby. I've been interested in learning more functional programming, and in particular the ML-ish style. I've tried reading through the Real World Haskell book and trying some Haskell that way. But it's hard to learn this way for me because Haskell is very weird to me and I don't think I'll manage to really learn it until I try to do something real with it. That's why I'm considering learning F# instead, because I'm guessing that this way I can kill two birds with one stone: learn an ML-style functional language paradigm, and also learn Windows programming APIs (.NET libraries). This seems to be a more productive route than learning the Haskell library counterparts of all the Ruby libraries I've grown to love, but staying within the Linux/OSX universe. My question is, how sound is this reasoning? Is F# an adequate substitute for Haskell if you want to learn the programming ideas and techniques that Haskell teaches you?


title: Cons of working from home

text: I am a software developer for a large corporation, and currently work from home two days a week, and I absolutely love it. However, because of juggling of personnel, my team's office may get shutdown in the next couple of months. I have been asked my thoughts on this, and I'm not entirely sure. I love my two days at home, and wouldn't mind even four; but going to the office I feel is essential. When I'm at the office I have lunch with the other developers, share home cooked goodies, and discuss specifics of work. Because I'm also a fairly new member of the team, I'm still learning a lot, and occasionally one of the other team members have to show me how to do something that would be incredibly difficult to do over the phone or IM. For those of you who work from home full time and don't have an office to meet with your other co-workers, what are some problems that have occurred? How did you deal with them? Side note: I'm not concerned about work/home divide, I've got a spare room setup as my office (with only office stuff in it [standing desk, printer, books, etc]), and I'm in a relationship with no prospects of children, and my partner understands not to disturb me while I'm working).


title: Microsoft Visual Web Developer 2008 Express?

text: I just came across this while searching on Google for HTML/CSS tutorials. Does anyone recommend this software for building websites? Or should I just stick to learning pencil and paper hand coding instead? I just want to put my focus in the right area. Heres the link: http://msdn.microsoft.com/en-us/beginner/bb964635.aspx


title: How should object identification be managed?

text: I have a java/swing application in (hopefully good) MVC structure. Here is a overview of my model classes: ![enter image description here](http://i.stack.imgur.com/egVUN.png) One or more `worker`s may work at one `working location` and one `worker` may work at different `working location`s (not at the same time, of course). A `worker` may have different types of a `date` assigned. The `working location` has a list of all its `worker`s. Each `date` has a reference to its `worker`. All model objects are mutable. For managing purposes I implemented a `Database.java` which is responsible for storing the model classes in java collection classes and at program close saving all objects into an xml file (I use java simple xml framework for this task). It has the following three lists: `List<Working location>`, `List<Worker>` and `List<Date>`. So the procedure is:   1. Load xml file on program start   2. Add/edit/remove model-objects to/in/from database (working with the collections of Database.java   3. Save all model-objects from the Database collections into the xml file on program exit (If there is something bad in my mindset until now, please tell me a better way! I will really appreciate it.) * * * Here is the question:   **What is the proper way of identifying model-objects?** I can think of two possibilities:   1. Use object references      * (+) There is no extra code for handling the generation of new unique ids     * (-) "Everyone" can edit the objects (Because this is a private project "Everyone" means only me)   2. Use unique IDs for every object      * (-) more code     * (+) database may return copies of the model objects to be edited and only when the controller calls the database's methods with the copyied model objects they will be updated * * * **EDIT:** There was an important part which I forgot to mention: Multi-Threading and Multi-User   Both of them can certainly be answered with "No". The application will be some kind of one user planning software to replace the current "pen-and-paper- planning". I would say the main requirement is to avoid budgeting workers who are on holiday or not to forget to budget workers who come back from holiday the next day. Because this are the mistakes that often happen. Also there is no need for deeper analysis of the model objects and therefore no need for complex database queries _at the moment_. Therefore I like the idea of using XML to create a standalone application. Or is there a good reason to blow up the code to fulfill unlikely requirements?


title: any website monitoring library/modules to use in my website?

text: I'm trying to build a site which user can add their websites which should be monitored and can view a detailed report and statistics of it. And also it should be able to monitor local webservices (mainly), 1) is there any popular java library to use for monitoring a website? (in sense to ping a website and load some content etc., or to show whether site is up or not kinda) 2) Also to validate a flow of website (if possible)?   Example: Go to login page, find fields , fill fields and submit form and validate for successful login or not. I know this kinda looks big but any small part done can be helpful, I've found several of monitoring projects, but they only do normal websites but not local/other webservices and also they can't validate flow of website.


title: Have you used Grapple mobile?

text: I'm looking for a way to easily port content driven applications from one mobile platform to another. And recently I've came a cross a grapple mobile that claims that they can compile one code written in js and css to almost all platforms. Have you used it? Are such apps approved by apple? (AFAIK Apple restricted the development to objective-c, c, c++)


title: Collaboratively working with a WebDesigner - Best practices

text: I'm a programmer. I have always worked by myself. I usually do only back-end, but now I have a webproject that I want to hand the "View" part to a designer to make it beautiful. What I'm looking for are suggestions, best practices, recommended literature to make it easy and separate (easy to merge) for both parts. I googled a lot, so what I want is your personal opinion, experience on this subject. 1 - The back-end will be Java. 2 - Besides the back-end I haven't chosen (opinions ???) on what is best (JSF, only HTML (REST)) for the frontend Any help and insight is greatly appreciated Thanks in advance


title: Where do I find collaborators for hobby projects

text: I am one of those people who learn by doing, and I often get a new idea for a project beside work, which could be fun and perhaps later on profitable. I have had quite a few ideas, but I usually burn out, which is often because I am alone on the projects. Most of my collegues have kids, or don't want to use their spare time for hobby projects. Therefore it is often hard to find other people who I can work with on my hobby projects. My question is therefore, if there is a good place to find co-developers for small non-open source projects?


title: A class with extra field

text: Let's say I have an animal class...with fields of name, height and weight. I want to create a bird class which is an animal, but it has also, say, wing size. How can I do that? My general idea is creating the animal class, and the bird class which inherits animal, and has additional field ...but then different kinds of birds would inherit that class. **My Questions:**   * Is my solution an appropriate OO approach to this type of problem?   * Is there a known design pattern for handling data modeling problems of this type?


title: visibility:hidden Vs visibility:collapse

text: In CSS, what is the difference between visibility:hidden and visibility:collapse They are given to be separate in W3Schools, but I see no difference in their output. I have tried it in Google Crome.


title: Should classes, enums and other entities be placed in separate files?

text: My company's team lead\architect argues that a large-scale project is easier to understand if "entities connected by logic" are placed in one .cs file. I quote:   * "The whole structure of the logic and the interface and the class can be seen in one place, this is an argument which can't be refute. To see the same thing but with a bunch of files you need to use the tools, class diagram, R# for navigation, etc."   * "Following the poor theory I might scream that an army of separated files is cool, but when it comes to making changes to the existing code, especially if you were not a writer of this code, it's very difficult to understand plenty of scattered files. So on forums, you can write that "one enum- one file", but in practice this approach should never be used "   * "... As to the separation of code base between developers, nowadays it's not a problem edit simultaneously the same file. The merge is not a problem." I heard and read many times that we have to create one .cs file per enum, class and so on and this is the best practice. But I can't convince him. He says that he don't trust to any well-known programmers such as Jon Skeet. By the way here is Skeet's opinion on this topic: Where is the best place to locate enum types? What do you think? Is there a real problem? Or is it a matter of taste and should be regulated by the coding standard of the organization?


title: Basic premise on counting sort. How is k related to to Big Oh?

text: I am reading (Cormen) on counting sort.   I understand the structure of the algorithm but the statement: > In practice, we usually use counting sort when we have k = O(n), in which > case the running time is Theta(n). Is not clear to my mind. k is just the range of integers expected in the input. Why is the asymptotic notation used in this statement for k? I don't get it.


title: How do you structure unit tests for multiple objects that exhibit the same behavior?

text: In a lot of cases I might have an existing class with some behavior:               class Lion     {         public void Eat(Herbivore herbivore) { ... }     }      ...and I have a unit test...               [TestMethod]     public void Lion_can_eat_herbivore()     {         var herbivore = buildHerbivoreForEating();         var test = BuildLionForTest();         test.Eat(herbivore);         Assert.IsEaten(herbivore);     }      Now, what happens is I need to create a Tiger class with idential behavior to that of the Lion:               class Tiger     {         public void Eat(Herbivore herbivore) { ... }     }      ...and since I want the same behavior, I need to run the same test, I do something like this:               interface IHerbivoreEater     {         void Eat(Herbivore herbivore);     }      ...and I refactor my test:               [TestMethod]     public void Lion_can_eat_herbivore()     {         IHerbivoreEater_can_eat_herbivore(BuildLionForTest);     }               public void IHerbivoreEater_can_eat_herbivore(Func<IHerbivoreEater> builder)     {         var herbivore = buildHerbivoreForEating();         var test = builder();         test.Eat(herbivore);         Assert.IsEaten(herbivore);     }      ...and then I add another test for my new `Tiger` class:               [TestMethod]     public void Tiger_can_eat_herbivore()     {         IHerbivoreEater_can_eat_herbivore(BuildTigerForTest);     }      ...and then I refactor my `Lion` and `Tiger` classes (usually by inheritance, but sometimes by composition):               class Lion : HerbivoreEater { }     class Tiger : HerbivoreEater { }          abstract class HerbivoreEater : IHerbivoreEater     {         public void Eat(Herbivore herbivore) { ... }     }      ...and all is well. However, since the functionality is now in the `HerbivoreEater` class, it now feels like there's something wrong with having tests for each of these behaviors on each subclass. Yet it's the subclasses that are actually being consumed, and it's only an implementation detail that they happen to share overlapping behaviors (`Lions` and `Tigers` may have totally different end-uses, for instance). It seems redundant to test the same code multiple times, but there are cases where the subclass can and does override the functionality of the base class (yes, it might violate the LSP, but lets face it, `IHerbivoreEater` is just a convenient testing interface - it may not matter to the end-user). So these tests do have some value, I think. What do other people do in this situation? Do you just move your test to the base class, or do you test all subclasses for the expected behavior? **EDIT** : Based on the answer from @pdr I think we should consider this: the `IHerbivoreEater` is just a method signature contract; it does not specify behavior. For instance:               [TestMethod]     public void Tiger_eats_herbivore_haunches_first()     {         IHerbivoreEater_eats_herbivore_haunches_first(BuildTigerForTest);     }          [TestMethod]     public void Cheetah_eats_herbivore_haunches_first()     {         IHerbivoreEater_eats_herbivore_haunches_first(BuildCheetahForTest);     }          [TestMethod]     public void Lion_eats_herbivore_head_first()     {         IHerbivoreEater_eats_herbivore_head_first(BuildLionForTest);     }


title: Can Scrum use technical specifications in the Product Backlog rather than user stories?

text: At the company I am currently working for we started to do Scrum projects. It was not so hard to convince the managers to move from waterfall to Scrum. We're doing a project where we rebuild our platform from scratch. So (most) functionality is known and most improvements are rather technical. In this it could be justified to have technical tasks rather than user stories. Our backlog has got all kinds of technical tasks like:   * Rewrite DB class from MySQL to PostgreSQL.   * Implement system logging.   * Rewrite object cache. Things that come up during the stand-ups include that long "research tasks" are wanted, but they are never done. Also, the team members claim in the middle of the sprint that unplanned tasks need to be added. How should a Scrum Master deal with this? Could it be that for this kind of project, Scrum is NOT the way to go?


title: Best practices for caching search queries

text: I am trying to improve performance of my ASP.net Web Api by adding a data cache but I am not sure how exactly to go about it as it seems to be more complex than most caching scenarios. An example is I have a table of Locations and an api to retrieve locations via search, for an autocomplete.               /api/location/Londo      and the query would be something like               SELECT * FROM Locations WHERE Name like 'Londo%'      These locations change very infrequently so I would like to cache them to prevent trips to the database for no real reason and improve the response time. Looking at caching options I am using the Windows Azure Appfabric system, the problem is it's just a key/value cache. Since I can only retrieve items based on keys I couldn't actually use it for this scenario as far as Im aware. Is what I am trying to do bad use of a caching system? Should I try looking into NoSql DB which could possibly run as a cache for something like this to improve performance? Should I just cache the entire table/collection in a single key with a specific data structure which could assist with the searching and then do the search upon retrieval of the data?


title: Does anyone do hardware benchmarks on compiling code?

text: I've seen a bunch of sites that benchmark new hardware on gaming performance, zipping some files, encoding a movie, or whatever. Are there any that test the impact of new hardware (like SSDs, new CPUs, RAM speeds, or whatever) on compile and link speeds, either linux or windows? It'd be really good to find out what mattered the most for compile speed and be able to focus on that, instead of just extrapolating from other benchmarks.


title: Setting $_POST variables as a means of passing data / Not passing parameters in functions

text: I've got a legacy PHP web application wherein almost each and every function makes references to $_POST variables - retrieving their values, AND **setting them (or setting new POST variables)** as a means to communicate with the calling code or other functions. eg:               function addevent()     {     ...     $add_minutes=$_POST['minutes'];          ...     $_POST['event_price']='';      ...     }      I would have thought that the straightforward approach would have been to pass to a function all the values that it needs, and return all what they generate. As an old-school programmer, albeit a bit out of touch now, I find this structure grotesquely unsettling - where data is passed arbitrarily all over the place. What do others think? Is the above approach acceptable now? * * * Edit 1 One conceivably genuine use-case is as follows. This is a function which handles embed tags or an uploaded file.               function brandEvent($edit_id='')     {     ...         switch($_POST['upload_or_embed'])         {             case 'embed':             ...             // uses $_POST['embed_video_code']             ...             break;             case 'upload':             ...             // uses DIFFERENT POST variables             ...         }     }      Is this a sensible code structure?


title: When to mark a user story as done in scrum?

text: There is a notion in scrum that emphasizes **delivery of workable units** at the end of each sprint. Each workable unit also maps directly of indirectly to a user story and when in new sprint PO introduces new PBI (new user stories), this means that practically team can't always go back to previous user stories to do the rest of the job, which in turn means that when you implement a user story, you should do it as complete as it's known to the team in that time, and you shouldn't forget anything (something like "I'm sorry, I've forgotten to implement validation for that input control" or "I didn't know that cross- browser check is part of the user story"). At the other hand, test, backward compatibility, acceptance criteria, deployment and more and more concepts come after each user story. So, when can team members know that the user story is done **completely** , not just for demo, and start a new one?


title: Learning C, C++ and C#

text: I'm sure you guys are tired of this question but after wading through hours of similar posts and questions I've really not made any progress to my specific concerns. I was hoping you guys could shed some light on a couple of questions I have before I decide on a course of action. BACKGROUND: I'm wanting to enroll in some type of program to learn a programming language/get a certificate/degree to work in the field. I've always been interested and bought a book on VB back in high school and dabbled. Now I want to get serious after a huge hiatus. Question 1: I've read it's counter-productive to learn C first, then C++ or C# because you develop bad habits. In a lot of college courses I've looked at, learning C/C++ is mandatory to advance. Should I ever bother learning C? On a related note, I really don't understand the difference between C and C++, or C# for the matter other than it incorporates .NET (which, I understand, is a compilation of tools and libraries that make programming easier and faster). Question 2: Where did you guys learn to program? Where do you recommend? Is it possible to land a job programming being self-taught? Is my best chance an ITT tech or a regular college? I was going to enroll in a JC and go from there but I can't decide what to do. LAST question :) I heard C++ is being "ported" to .NET. True? And if so, is this going to make C++ a solid, in-demand language to learn? Thanks for looking. :)


title: Is learning how to use C (or C++) a requirement in order to be a good (excellent) programmer?

text: When I first started to learn how to program, _real_ programmers could write assembly in their sleep. Any serious schooling in computer science would include a hefty bit of training and practice in programming using assembly. That has since changed, to the point where I see Computer Science degrees with assembly, if included at all, is relegated to one assignment, and one chapter, for a total of two weeks' work out of 4 years' schooling. C/C++ programming seems to have followed a similar path. I'm no longer surprised to interview university graduates who have not spent more than two weeks programming in C++, and have only read of C in a book somewhere. While the most serious CS degrees still seem to include significant time learning and using one or both of the languages, the trend is clearly towards less enforced C/C++ in school. It's clearly possible to make a career producing good work without ever reading or writing a single line of C or C++ code. Given all of that, is learning the two languages worth the effort? Are they at all required to excel? (beyond the obvious, non-language specific advice, such as "a good selection of languages is probably important for a comprehensive education", and "it's probably a good idea to keep trying out and learning new languages throughout a programmers' career, just to stretch the gray cells")


title: Can one can survive in the IT industry without knowledge of C and C++?

text: I am just a graduate from India and I have knowledge of Java, JSP and Servlets, Android application development and some iOS development. I do not have a background in C or C++ and a little weak background in Data Structures and Algorithms. I want to know whether I can make a successful career in the IT industry without knowledge of C or C++ but having a strong grasp on Java and Python (which is what I am thinking of learning next). As for the Data Structures and Algorithms part I am planning to study them again with implementation in Java as I am not fluent in C or C++. Can I go good in future if I know Data Structures through Java?


title: Jenkins to automate deployment of ASP.NET applications

text: Is there any possibility to automate/semi-automate deployments of ASP.NET web applications using Jenkins. It can be under controlled or uncontrolled environments, for uncontrolled user needs to enter userid and password. I am looking out for ways to copy the files from target to destination and run sql scripts in web farm scenario. **Edit** Currently we are using bat files to xcopy/configure app pool/sql cmd, etc to deploy the application. But for this to work, production support team needs to download the source code, build the project and run the bat files to deploy the application. Now, we want to automate the deployment without user downloading the source code and end user just needs to visit a url and fill userid and password parameters and select svn tag and it should get deployed. But Jenkins is running under anonymous login, so the existing bat file will not work since it doesn't have permissions to run the script. So, I would like to know if there exists any alternatives for this kind of situation. It will be good if user context is impersonated by using entered userid and password allowing existing batch file to run without further changes. If it is not possible, we would like to explore other ideas too but we don't have flexibility to choose a automated tool like puppet, etc, we should stick around with these batch files.


title: Custom Alphabetic Sorting of Array in Java

text: I have a requirement to read a text file with lines in tag=value format and then output the file with specific tags listed first and the rest sorted alphabetically. The incoming file is randomly sorted with the exception of the first line. The output needs the first two lines to always be the same. For example, given the following tags:               NAME     AGE     SSN     MARITAL_STATUS     NO_OF_DEPENDENTS      The input will always have NAME first and the remaining tags (there are literally hundreds) sorted randomly. The output needs to have SSN first and NAME second and the rest sorted alphabetically so I would end up with:               SSN     NAME     AGE     MARITAL_STATUS     NO_OF_DEPENDENTS        Note: These are just sample tags. The actual file has 13 fields which need to be listed first and the remaining few hundred listed alphabetically. I'm trying to figure out the best way to do the sorting. Right now my plan is to read the lines in the incoming file and marshal them into two List objects. The first will contain the specific tags which need to be placed first and the second will have everything else. I will then sort the second list and merge it into the first list. This seems complicated and I feel like I'm missing an easier or more elegant approach.


title: What are some good online coding log/management tool?

text: I am looking for an online, free coding management tool, where I could log my coding process, for example, bugs to be fixed and has been fixed. What are some good recommendation?


title: Where should I put my method

text: I am writing a Java program using the MVC design pattern. I have classes `Item` and `Supplier`. In the database they are connected through a `item_supplier` table. I'm writing a method which will give me all suppliers for a specific item (using itemID): `public ArrayList<Supplier> getItemSuppliers(int itemID)` I have a DB layer as well and I have `DBItem` and `DBSupplier`. Where should this method go? I will use it only (mostly) on my `ItemUI` so I am thinking of `DBItem` as the correct place. \-- Usually when we have the SalesLineItem pattern (Sales * - 1 SalesLineItem 1 - * Item) we have a separate class, but in that case, do I need such as my only interaction with that table (`item_supplier`) will be with this printing (and one updating) method? Basically, do I need to do a `ItemSupplier` model layer class and respectively `DBItemSupplier` or can I just have those two methods `getItemSuppliers` and `updateItemSuppliers` on either `DBItem` or `DBSupplier` (and if the latter, where?)


title: Is SRP (Single Responsibility Principle) objective?

text: Consider two UI designers who want to design "user attractive" designs. "User attraction" is a concept that is not objective and only resides in the mind of designers. Thus designer A could for example pick up red color, while designer B picks blue. Designer A create a layout which is entirely different from designer B, and so on. I read about SRP (Single Responsibility Principle) and what I understood was kind of a subjective analysis or break down of responsibilities that can vary from an OO designer to another OO designer. Am I right? In other words, is it possible to have two excellent object oriented analyzer and designer who come up with two different designs for one system based on SRP principal?


title: How can I choose what to use to write my next webservice in C#?

text: I'm about to write some webservices from scratch and I'm a bit confused about the approach to take. The obvious choices were WCF and MVC 4 Web API, but I am having a hard time deciding. The two factors that are important are making it self-describing (eg, MEX etc.) and easy to consume (Maybe RESTful?). I'm struggling to pick which one to discard in favour of the other. The way things are going, I'm hearing more and more about REST so I should probably go in that direction, but apparently that's also possible to implement using WCF. I'm quite torn about how best to proceed, and there isn't a lot of information out there saying "Oh, these days developers always use X because Y" so it's tricky to judge the merits of each, and how easy those merits are to implement.


title: Do donations count as "commercial use"?

text: Lets say I'm building community that uses some webapp. These webapp uses a a modified version a a GPLv2 licensed theme. Additionally the community uses a donation mechanism to fund itself. Donation overheads will be given back to the community in some form, so there is no commercial goal behind it. Questions:   1. Am I required to publish the modified version of the theme if I only use it?   2. Is this "commercial use" in terms of the GPL? (I'm not sure it this is the right SE site)


title: Using a microframework, or rolling your own

text: I really like a microframework in Python called Flask. I have used it for the past 2 months, and I find it excellent. Now, I would like to use it in deployment, but, there are a few things I'm afraid of. Firstly, even though its a microframework, it depends on Werkzeug (a WSGI framework type of thing), which, in case I run into a problem, makes it more difficult to debug stuff. Second, its not extremely popular, which means that support would be difficult to get. So, what I was thinking is I could roll my own microframework in Python that doesn't have all the features of Flask, but, only the ones I need, and I would know it through and through and could fix any problems that I might encounter, I estimate this will take 1000-2000 lines, and about 2-3 weeks for me, and probably a lot less with a team of 2. What do you guys suggest?


title: Programming with Dyslexia

text: I have very severe Dyslexia along with Dysnomia and Dysgraphia. I have known about it since I was a child. My reading and writing skills are pretty crippled, but I have learned to deal with it. However, with today's IDEs, I find it very easy to stay focused and in the zone when I code. But when I write text (like this post) I find it much harder to stay focused. In general, do dyslexics find it easier to read and write code compared to general reading and writing? What types of tricks and tools do dyslexics use to help them master programming better than normal reading and writing?


title: Android game loop in separate thread

text: I am about to port a game that was initially written for iOs and I am having some doubts how certain things should be done. I have been looking many of the examples of the game loops for android, and almost everywhere the game loop is designed to run in separate thread and not in main UI thread which seems fine and logical to me. However, my game scene is combination of OpenGL graphics and standard android views (buttons, labels, etc...) and by design, the primary game logic and OpenGL drawing would be done in separate thread and rest of the standard stuff would be done in main UI thread. In many situations, I will need to call functions that should run in game thread from main UI thread and vice versa. As a very basic, simple example, when user performs touch (which is detected in UI thread) the event should propagated and be processed by the game thread. Do you know some good mechanisms or patterns on how to such cross thread interaction? Is there a simpler solution to a game loop, maybe by not running loop in a separate thread?


title: What are ways I can speed of development time when building applications?

text: I noticed that overtime with experience that the curve of learning shifts from trying to learn a language or technology (the way it works) to how to develop applications faster and with less code. I am very interested to see how other developers have minimized the time it takes to get applications to market. I know for a fact that by learning just one thing it can save you a ton of time. For example I started learning lambda expressions and code that normally took 3 lines now only takes 1 and is alot faster to type. Another angle is shortcuts and tools in an IDE itself. For instance I can't believe I didn't know how to remove unused using statements from my source code so I used to do it manually until I found out there was a tool in VS for removing them. Are there any resources for learing faster ways of developing applications? Keyboard Shortcuts, tools, programs, references? Is there like a reference where one can learn these things? If not can you please share how you learned some of these tips? **NOTE:** This question is geared towards .NET, C# and the Visual Studio IDE


title: How does Javascript code become asynchronous when using callbacks?

text: I've been doing a lot of reading online trying to figure out how to write asynchronous JavaScript code. One of the techniques that has come up a lot in my research is to use callbacks. While I understand the process of how to write and execute a callback function, I'm confused why callbacks seem to automagically make the JavaScript execution asynchronous. So, my question is: how does adding in callback functions to my JavaScript code make said code automagically async?


title: Factory Method: does the Product have to be a different class than the Creator?

text: I want to build three sites in PHP. I'm doing this as slowly, thoughtfully and carefully as I can, to learn as much about things like OOP and software architecture as possible. From past experience I already know there will be a time when I will be glad to have logging functionality. I probably want to have different types of logs, by which I mean that in a `.ini` file, I want to be able to specify if logging should go to a text file (perhaps a tab-delimited or CSV file), a database table, or smoke signals. I'd have (let's say) a Logger class, which would define, for example, an AddEntry() method. For each log type, I'd make a subclass that knows how to log to CSV file, write to a database or kindle a fire, respectively. Since I know I will want to have an instance of a subclass, but I won't know which subclass to instantiate until runtime, I figured I'd use the Factory Method pattern. However, When I look at its Wikipedia article I'm noticing that the `Creator` and `ConcreteCreator` have a different type than the `Product`, if I'm reading the UML correctly. My question comes down to this: I want to have the factory method as a static method of the Logger base class itself. If I do that, am I setting myself up for a trap that I'm not seeing yet? Is there a reason why the `Creator` and `ConcreteCreator` should be of a different type than the `Product`?


title: What's the difference between fault, error and defect?

text: > **Possible Duplicate:**   >  Difference between defect and bug in testing In computer science technical writing, especially in software engineering, what's the difference between fault, error and defect? I want to quote an answer on Stack OverFlow by Daniel Joseph: > To quote the Software Engineering Body of Knowledge > > Typically, where the word “defect” is used, it refers to a “fault” as > defined below. However, different cultures and standards may use somewhat > different meanings for these terms, which have led to attempts to define > them. Partial definitions taken from standard (IEEE610.12-90) are: > > Error: “A difference…between a computed result and the correct result” > > Fault: “An incorrect step, process, or data definition in a computer > program” > > Failure: “The [incorrect] result of a fault” > > Mistake: “A human action that produces an incorrect result” Based on my understanding of above definition, error is the result of fault, i.e., failure. Could someone explain more clearly?


title: Difference between bug, defect and flaw

text: I was reading "Software Security: Building Security In" and in the first chapter I faced with 3 terms: bug, defect and flaw. The author gave a definition for each of them but I couldn't completely understand these. Can someone give me some examples for each term? What is a defect and what is a flaw? I think I know what bug is, a bug is a malfunction of a part of system which produces undesirable result, be it crashing on a wrong input or miscalculating a series of computations. Can someone elaborate more and correct me if I am wrong in this? **UPDATE**   To be more precise in the book I mentioned above, they (the words) are presented in a way to make a distinction, that's why I am asking to know more. In that book there are some examples denoting which sample belongs to what and which category. For example: Buffer overflow is said to be a bug and issues in method overriding (subclassing issues) is being related to flaw category. Again race condition handling issues are considered bugs and Error-handling problems (fails open) are told to be flaws! I want more elaboration on these regards.


title: Would you tell your manager about intent to apply for a growth opportunity elsewhere

text: I like the company I am currently with as a .NET Software Developer - high- tech, great atmosphere, great people and great cause. I also have a fair bit of flexibility and resposibility in that I try to keep us up to date with recent technologies and come up with the architecture for our desktop applications, when we have to design something new, a rare occassion. Overall, it is a great place, albiet with mediocre compensation. It has been almost 4 years and things are getting stagnant in terms of growth and challenges. There is currently a good growth prospect with a previous employer that I am entertaining and will have a good chance with sufficient effort. But I have neither asked for a promotion nor thoroughly expressed my career ambitions to my current manager. So there is this feeling I am putting him at a disadvantage. My current manager is a level headed guy which makes me think I can discusss this challenge with him. After all, he could act as a reference for me in the future. Also, I am sure there are good thing to be said about honesty and professionalism and trying to avoid using the other offer to gain internal promotion. I want to grow professionally but cannot affort to jeopardize relationships or burn any bridges. Would you talk to your manager about entertaining a position somewhere else? If I were a manager, I sure would appreciate if one of my employees came up to me to talk about this. If he were one of my key guys, I sure would do what is neccessary to keep him around.


title: When should I backup files?

text: At our company we are not using a source control so we do backup manually. My habit is like this: I backup only scripts where I removed code snippets, and those scripts where I only added code snippets I don't backup. Is it reasonable to backup each time when you change something, or there are some conditions for file subversion? And when we backup changed files, should we only backup that file or all the project?


What factors should be evaluated when determining a desktop software price?


title: random.choice in other languages

text: Python has a nice function in the standard library `random.choice` which returns a random element from a sequence. But none of the other languages I've developed in have thought to include such a feature. Do other languages provide such a feature? Why not?


title: PCI Compliance, FDMS and TransArmor

text: So, I've been tasked to work on an integration project where we will ask customers for credit card information and send it over to our integration partners, who will process the payment/cc info and process the rest of the order. So, one the tasks for become PCI compliant. However, the partner is also looking to get PCI compliant, and they said that as part of that process, they cannot accept cc info over the internet from an external source. But then I was reading about it, and found out there is some way to become a TPA (Third Party Accepter) that can allow the passing of the credit card to the partner. I also heard the word FDMS thrown around at the first meeting - some research led me to believe this stands for First Data Merchant Services. What I found is that First Data is a merchant processor, who actually contacts the issuing banks to check the credit cards and then collect payment. The partner wants to achieve a level of PCI compliance where they do not store credit cards, so they said when they take credit cards they will send it to FDMS using something called TransArmor, where they send the CC info to FDMS and they send back a token - and that is what they use to access the CC info. I did my research on this, and there is a lot of information out there, and I cannot find a clear and concise place where I can read about all of this - so I have a few questions on this whole process:   1. Is there one place where I can read what exactly it takes to become PCI compliant?   2. Are there different levels of PCI compliance?   3. Where exactly does TPA fall into all this?   4. Is there an example of how TransArmor works? Lots of loaded questions, but thanks all!


title: How to manage your functional documentation?

text: Our functional / business documentation is spread across Word files on our corporate Intranet. It's difficult to find and update information. There has to be a better way. Any ideas? We had thought a Wiki would work great. Would seem to be an easy way to find information and easy for individual developers and analysts to add bits of documentation quickly and easily. We'd be curious to know if other development (or business analysis) teams use Wiki's with success. The target for this documentation is the internal development team: developers, qa, and to a lesser extent business analysts.


title: Do I need to Clean/Rebuild a project before Debugging/Publishing it in Visual Studio?

text: This is probably a stupid question, but do I need to Clean/Rebuild before Debugging or Publishing a Visual Studio project? I see other developers doing it all the time, and at some point I started doing it without even thinking. It seems habit to always go Clean, wait, Rebuild, wait, Publish. I know I didn't always do it.... I think I started to do it after spending a bunch of time debugging an error, only to discover it went away when I Cleaned and Rebuilt the solution. I've had this issue more than once too, so I know it wasn't a one-time thing, but it seems like a huge waste of time to always be cleaning/rebuilding your projects.


title: Why coffeescript instead of javascript?

text: I think somehow building a language which compiles to another language feels like a bad idea from the start, instead of learning javascript properly from the start. Look into Douglas Crockfords Good Parts and then are you hooked. And javascript is not hard - writing good code is hard regardless of language! If you write crappy code in javascript, then you propably will write crappy code in coffeescript or lattescript or what the flavor will be of the day. And to say that coffeescript syntax is beautiful passes me. I like my curly braces and C syntax - and would preferably work in a language which is like that (sorry VB!). And more toys and languages and frameworks for doing the same thing all over again feels not like progress to me anymore!


title: How to handle 'external' dependencies in scrum?

text: If you've planned a number of user stories for a sprint and one candidate story is dependent on some external provider delivering something to your team. For example an online service provider adding a new API call to their system or enabling your test account on their system or suchlike. You know it's coming 'soon'. Do you go ahead and add the story to the sprint hoping they'll deliver what is required in time for you to complete your story **or** do you wait till the next sprint, when you know it will be ready and you can start immediately even if it means not starting the story as early as you could. If the former how do you handle 'unearned' story points lost because of the dependency? partial credit (eek!) or take it on the chin.


I'm trying to make a case for not putting the structure in the parent BaseModule class I've shown below. I'm more for a Strategy Pattern, and minimizing inheritance in favor of has-a relationships, but I am not really sure of what principle of OOAD this pattern is breaking. What principle of OOAD is this pattern breaking? Potential Pattern:               public interface IStringRenderer     {         string Render();     }          public class BaseModel : IRequestor     {         public abstract void  Init();         public abstract void Load();     }          public class BaseModule<TModel> : IStringRenderer where TModel : BaseModel     {         public TModel Model { get; set; }              public override string Render()         {             return             string.Join(                 "",                 new string[]                 {                     "<header/>",                     "<main-container>",                         "<side-nav>",                             "<side-navigation/>",                         "</side-nav>",                         "<main-content>",                             RenderMainContent(),                         "</main-content>"                 });         }              public abstract string RenderMainContent();     }          public class MyModuleModel : BaseModel     {         public List<int> Ints { get; set; }                      ...     }          public class MyModule : BaseModule<MyModuleModel>     {         public override string RenderMainContent()         {             return             string.Join(",", Model.Ints.Select(s => s.ToString()).ToArray());         }     }      Preferred Pattern (duplicated some code to be clear):               public interface IStringRenderer     {         string Render();     }          public class BaseModel : IRequestor     {         public abstract void Init();         public abstract void Load();     }          public class MyModuleModel : BaseModel     {         public List<int> Ints { get; set; }              ...     }          public class MyModule : IStringRenderer     {         public MyModuleModel Model { get; set; }              public MyModule(MyModuleModel model)         {             this.Model = model;         }              public override string Render()         {             return             string.Join(                 "",                 new string[]                 {                     "<header/>",                     "<main-container>",                         "<side-nav>",                             "<side-navigation/>",                         "</side-nav>",                         "<main-content>",                             RenderMainContent(),                         "</main-content>"                 });         }              public string RenderMainContent()         {             return             string.Join(",", Model.Ints.Select(s => s.ToString()).ToArray());         }     }      There are parts of this pattern that I'm not trying to focus on, but instead I am thinking about where the 'structure', or the 'tags' are living. In the first example they live in the parent, but in the second example they have been pushed into the derived class. Right now, the examples are pretty simple, but something like 'side-nav' could potentially get complicated, and may need to be controlled by the child anyway. I feel the principle here is that I don't feel like the 'tag' structure shouldn't be in the parent class as in the first example. There are other things I've removed in my 'preferred version' -- namely the generics. (Any suggested reading on good/bad for that choice is welcome). Proponents of the first example's embedded structure like the fact that they can wield changes to large amounts of child classes. I feel offering the flexibility to derived classes is the way to go, and if there needs to be a parent that parent only offers functionality and cross-cutting features, but does not bottle up canned structure.


title: should you always enter a bug in a bug tracking system

text: > **Possible Duplicate:**   >  Should developers enter bugs into the bug tracking system?   >  Should I log trivial fixes? For a project I'll be doing in school soon I will be working with 6 other people. We will probably be using YouTrack to track our bugs and we can obviously see the value in this system. My question, however, is whether a bug should always be entered in the bug tracking system. In our case, some people will be front-end developers, others will be back-end developers but the complexity of the project will not be of such a high level that back-end developers wouldn't know how to solve a front end bug. By this I don't mean that they will actually solve it but because they (think) they know it's an easy fix, what's stopping them from just letting one of the front-end developers know about the bug by telling him across the table. The main reasons I can come up with are these:   * The bug might at first seem very easy to fix but actually uncover a far larger problem (at this point in time presumably it would be entered, but by the frond-end developer.   * You might take someone of out of the "zone" by just casually mentioning they have a bug somewhere, which might be solved in 10 seconds but then requires them 15 minutes to get back in the zone. On the other hand it does seem silly that you'd have to enter a bug which **could** be fixed in 2 minutes, especially if the part you're working on at the time needs that bug to be fixed. I understand this is probably a bit subjective, but I also feel that other people could give very good reasons for doing it one way or the other which is what I would like to hear.


title: Should I log trivial fixes?

text: I'm in a code shop of two. And while I understand that a bug tracker is useful where the number of programmers is greater or equal to one, I'm not so convinced that logging bugs, changes, and fixes is worth the time when they're trivial. When I find a simple bug, I understand it, fix it, and run it through some testing. And THEN I realized I need to go log it. I know in theory that bug logging should be done somewhere between finding the bug and fixing the bug, but if fixing it is faster than logging it, it seems like a drag. In larger code-shops, the boss pays attention to who is doing what and it's nice to know where others are mucking about. I find myself describing things that I've already fixed and then instantly closing them. I have doubts that anyone will ever look at this closed bug again. Is it time to trim the process fat?


title: regular, average programmer - scared of geeks and their skills

text: Just like in any other field, 90% of workers do trivial routine things and only less than 10% actually do the most difficult things. Most programmers in the industry are average, and so am I. There are lots of smarties/geeks who have been coding/programming since age 10-12. Obviously they have more experience than me -- I started learning software development/programming at age 20, when I first went to university. I realize that to match their level, I would have to spend all my time for years, just solving problems, making my brains work hard and get used to a developer's mindset. With many other things to do in life, I understand that I will most likely be constantly behind geeks - I can't solve TopCoder/Google CodeJam problems, I'm bad with algorithms etc. I should have studied programming since childhood to match the level of other geeks. In other words, I feel guilty, stupid and most of all envious and scared of geeks! No super brainy geek knows everything about programming but: there are guys who are simply 10x better than me. I feel compelled to study all the time, but I can't and don't want to. I'm sure many developers have had this feeling - when you envy someone much smarter than you. How do you deal with this feeling? I'm really confused, I keep thinking they can steal my job, and I can't even compete with them.


title: What is a generic term for name/identifier? (as opposed to label)

text: I need to refer to a number of _things_ that have both an identifier value (used in code and configuration), and a human-readable label. These things include:   * database columns   * dropdown items   * subapplications   * objects stored in a dictionary I want two unambiguous terms. One to refer to the identifier/value/key. One to refer to the label. As you can see, I'm pretty settled on the latter :) For the former, _identifier_ seems best (not everything is strictly a _key_ , and _value_ and _name_ could refer to the label; although, _identifier_ usually refers only to a variable name), but I would prefer to follow an established practice if there is one. Is there an established term for this? (Please provide a source.) If not, are there any examples of a choice from a significant source (Java APIs, MSDN, a big FLOSS project)? _(I wasn't sure if this should be posted here or toEnglish Language & Usage. I thought this was the more appropriate expert audience. Happy to migrate if not.)_


title: Publish/Subscribe/Request for exchange of big, complex, and confidential data?

text: I am working on a project where a website needs to exchange complex and confidential (and thus encrypted) data with other systems. The data includes personal information, technical drawings, public documents etc. We would prefer to avoid the Request-Reply pattern to the dependent systems (and there are a LOT of them), as that would create an awful lot of empty traffic. On the other hand, I am not sure that a pure Publisher/Subscriber pattern would be appropriate -- mainly because of the complex and bulky nature of the data to be exchanged. For that reason we have discussed the possibility of a "publish/subscribe/request" solution. The Publish/Subscribe part would be to publish a message to the dependent systems, that something is ready for pickup. The actual content is then picked up by old-school Request-Reply action. How does this sound to you?


title: Term for an error when code is executed before its ajax response?

text: What's the term for an error caused by executing a block of code before its relevant ajax response has come back? e.g., a timeline: **13:00:01** execute getDataViaAjax(); **13:00:02** execute doSomethingWithMyAjaxData(); **13:00:03** ajax data comes back, too late since I forgot to make the code wait for it... I have a feeling I may say "doh!" when someone tells me the answer, but I can't for the life of me think what type of error it might be called.


title: What is the benefit of 64 bit A7 in iPhone

text: I'm trying to figure out why going to 64 bit processors is such a big deal in an iPhone. I understand that there will be twice as many registers so the processor can work with twice as much data which should increase performance. However I don't see many phones going to more than 4GB of memory any time soon. It seems like overkill and it would negatively impact battery life. Another problem that I see is that most variables now need twice as much memory. This will create problems in a mobile environment with small amounts of memory. I believe that the folks at Apple are intelligent and they probably have great reasons for doing this, I'm just trying to understand them. **EDIT** Don't know much about GPU's but I was told that with 64 bit registers 2 pixels can be loaded into each register and operations can be performed on them individually. Is there a graphical advantage regarding 64 bit?


title: Should my team use some common well-regarded coding standard as a basis for its own?

text: The R&D team I'm in has decided to adopt a coding standard. We have only recently formed, and have too little code and common coding time of our own to base our standards/conventions document on what has developed organically in our team, and on good examples from our own code etc. Now, every one of us has some experience from past workplaces - although none of us is at a state of saying "let's adopt this here comprehensive document I have found to be fitting for the kind of work we do here" (*). Plus, some of us (including myself) only have experience from places with no official coding standard, or writing in different languages in a different setting (high- pressure weekly-release production environment as opposed to more research- oriented development work) So, one of the options I've been thinking about is taking a relatively well- known and well-regarded document, snipping off what we don't care about/care for, and making some modifications based on our preferences. Is this a common practice? Do you believe this is a good idea? If so, what would be a reasonable 'baseline' coding standard (don't tell me which is best, I don't want to start a religious conflict here; just point out what would be comprehensive or 'neutral' enough to build upon.) **Notes:**   * We are expecting to work with C, C++, OpenCL, CUDA, Python.   * We are a team of 4 people + manager, expected to grow to about 5-6 within a year or so.   * In our company, teams are almost entirely autonomous and usually don't interact at all (not even by using each other's code - the work is on entirely different projects); so - no company-wide considerations to make.   * Regarding tools, at the moment what we know is that we're going to be using Eclipse, so its code formatter is going to be one tool at least. Ctrl+Shift+F has long been my friend   * When I write Java, I've adopted the practice of adhering as strictly as possible to Bloch's Effective Java. Now, that's not quite a coding standard, but you could call some bricks, cement and mortar for a coding standard. I was thinking of possibly including something like that as part of the 'mix' (minding that we don't do Java).   * I mean coding standards in the wider sense of the word, e.g. adopting suggestions made in the answers to this P.SE question.   * I've found a big list of C++ coding standards documents; maybe I should mine that our baseline.   * (*) That's not quite true, but I don't want to complicate this question with too many specifics.


title: How to do ab testing

text: Many books on startups/kanban strongly advocate the use of AB testing to validate product features. I haven't had any experience with this but it sounds like a great idea for some projects. My question is, how does one go about AB feature testing in practice? Say you want to test how registered users interact with a specific feature. Do you create tables to set what batches of users see what features? What about non-registered users. ect. Say it's determined the feature isn't needed based on your tests. Do you go back into the code base and cut that code out?


title: In scrum, how do you use "usability testing" in team?

text: I am currently reading some material by Jeff Patton regarding Agile and UX. http://www.agileproductdesign.com/presentations/index.html I was interested to find out from the community what UX design and testing behaviors seemed MOST helpful to their scrum teams to create GREAT and delightful products.   1. hallway usability?   2. paper prototypes?   3. seeing how users actually use the software?   4. others? Thanks!


title: Newbie ASP.NET developer being forced into MVC4 with WebForms

text: I recently got hired on as a new ASP.NET developer (C# code behind). When I arrived, I was told that they were moving to MVC 4, and so I bought two books on that. However, the other day I learned that they are NOT using Razor, but using WebForms. Most of the results via Google returned articles from before the WebForms view engine was apparently selectable as an option instead of Razor, but my question is this:   * Is it possible to learn MVC through WebForms, and not Razor? By possible, I mean is it "worth the time", or should I stick with Razor (as covered in both of my books) and slowly adapt that knowledge to WebForms?   * Are there any drastic changes that need to be understood when learning MVC from the WebForms perspective? Thank you for your time.


title: What were the historical conditions that led to object oriented programming becoming a major programming paradigm?

text: What were some of the economic (and other historical) factors that led to object oriented programming languages becoming influential? I know that _Simula_ started things off, but was the adoption of OOP languages due to the ever increasing needs of business? Or, was the adoption due more to the new things that could be done with OOP languages? **Edit** I'm really most interested in whether there was some factors going on external to the languages themselves that allowed for them to take hold.


title: A Class named Class?

text: This is more of a style question, but it is something I am currently pondering for a project of mine. Assume that you're creating an application which is modeling a school. So there are entities like Student, School, etc. Now this is all fine and intuitive until you get down to Class, as (in most languages) `Class` is a reserved word. So, given that `Class` is a reserved keyword, what would you call such an entity that models a school class?


title: Need interpretation of section in C# specification

text: I am reading the C# specification. I could use clarification on a segment: > C# has a unified type system. All C# types, including primitive types such > as int and double, inherit from a single root object type. Thus, all types > share a set of common operations, and values of any type can be stored, > transported, and operated upon in a consistent manner. Furthermore, C# > supports both user-defined reference types and value types, allowing dynamic > allocation of objects as well as in-line storage of lightweight structures. What does “in-line storage of lightweight structures” mean in this context?


title: What constitutes a good Database System(Java / SQL related)

text: I've given this so much research but still couldn't come to my own conclusion, before continuing this question I would like to give you a rough idea of my current situation. I'm 18 years old and have recently been selected and offered by my school to design and develop a database system for my Psychology department. The system itself is very easy, especially on paper, but after reading so much I'm not sure how to tackle this situation. I've never built a whole system before, I've worked with multiple APIs, game clients, personal programs and small mini projects but never have I done it for someone else. I kindly as for your help to answer my question. I have been coding for a while and Java is my strongest point, I still have alot to learn in regards to other C-Style languages, my school trusts me and I'd feel ashamed to let them down. What constitutes a good Database system? * * * When building a database system what are the first key factors that one ought to consider? I presume it's directly related to the actual skeleton of the system and the layout. That's relatively easy to do or better, not as complicated as the rest to do. This would include a normalized database which is secure and easy to use. This is where my question comes in with Java and SQL joined together. I can obviously(And already have) written a database system entirely in Java, literally no SQL in it, wrote the queries myself and did it all with Java however I don't think that's very satisfactory for most people (I'm not sure why, if someone could clarify would be great). I've read into JDBC and I still have to go a bit more into it as self-teaching it does get a tad tricky every now and then. I however searched more into it and have seen various Java Database Engines, such as: > HypersonicSQL - http://java-source.net/open-source/database-engines \- Open > source Database Engine How good would it be to work with such engines, is there any security risks run with it or should I just scrap off the idea? I know a lot of you here on StackOverflow are VERY knowledgeable in this field and know alot of you have built your own database systems (offline) so I kindly ask to pass on some knowledge that could prove valuable.


title: How to manage styles on a group of websites

text: Up until now the styles were handled by a single CSS file (for each site). I'm customizing it like this:   * opened the site in Firefox   * opened inspector/style editor   * changed CSS values around until I was happy with how the site looks   * copied the generated CSS code and pasted it in the .css file from the server The design is quite outdated, so I decide to upgrade the application that powers the sites and the designs. But now, my developer tells me I'm doing it wrong. He wants to use "less", "compile and cache to css", create themes and allow me to change only basic stuff like colors and fonts through an administration interface. He says that if I want to customize deeper things I would have to learn CSS and edit the "less" files inside a code editor, not Firefox. Is he crazy or what? I don't understand how is this better than what I'm currently doing?


title: ISC license advice

text: Is the ISC license suitable as a MIT or Simplified BSD license replacement? What are the pros and cons of ISC compared to MIT or BSD?


title: DVCS blessed repo replication among geographically distributed teams

text: My company is exploring the move from Perforce to a DVCS and we currently use lots of Perforce proxies because the **software development teams are spread over Germany, China, USA and Mexico** and sometimes bandwidth from one place to another is not that great. Speaking with IT, we started looking for a way to keep things running smooth from the geographically distributed perspective so that everyone gets the latest and greatest without determining what repo server is the source of truth (i.e. **replicating transparently** ). I thought that **maybe we could emulate the DNS mechanism through pre-push and pre-pull hooks**. For example, consider countries A, B, and C. Upon pulling from blessed A, A itself will pull for changes from B, which in turn will pull for changes in C. If B and C have new changes they will fall towards A. Conversely, when there is a push, it could be propagated to all blessed repositories. I'm aware that **generally you only have one blessed repo, however this may not scale globally** and each blessed repository would just be applicable to the teams from a single country. **My question is** : is the conception of DVCS repo replication something used in practice?, has anyone done it succesfully?, if so, what is the correct way to do it?


title: Generate a productive environment when developers have different opinions

text: My question is simple. I'm a developer and work with another developer who's been here for many more years than I have. He has his opinion about implementing stuff; he's more of a do it yourself kind of person. I'm more of a let's not re-invent the wheel kind of person. Recently for example we had a big discussion about how I think we should move to the cloud and how he thinks that we should keep an in-house solution for our servers (to host our websites). Or how I think Java is better suited for what we need, but he likes PHP so that's what we have to use. These are all arguments that people have on the web... some like the cloud, some don't... some like Java, some don't. And I'm totally ok with diverse opinion... however it's come to the point of being unproductive, and without a boss that knows about programming (our boss doesn't know anything about coding, he just manages us) that takes the position of making a decision, it's always a winner towards his opinion, because he's the more experienced developer... which I don't think is productive. Did you ever confront such a team issue? What do you think I should do? What is the best way to create a productive environment?


title: Is it reasonable to use POCO's that inherit from DTO's?

text: I'm designing a tiered .NET application, and I want to use the Code First approach. I'm new to this, so I'm struggling to envision how it ought to be designed. Would the following be a reasonable approach? What problems or limitations might I run into?   * Write DTO classes for my domain. These will be used for data transfer between the server and client over WCF.   * Write a set of POCO classes that inherits from the DTO classes. Use these to generate the database on the server.   * Write another set of POCO classes that inherits from the DTO classes. Use these to generate an SDF database on the client.


title: Transition from engineering to programming

text: I got a degree in Chemical Engineering but held a part time job as a PHP programmer the whole time. This has developed into a full-time job. I was wondering how having a Chem-e degree instead of a CS one will affect me progressing further in this career. Does anyone have experience with this and maybe some hints?


title: What is the point of having every service class have an interface?

text: At the company I work at, every service class has a corresponding interface. Is this necessarily? Most of these interfaces are only used by a single class and we are not creating any sort of public API. With modern mocking libraries able to mock concrete classes and IDEs able to extract an interface from a class with two or so clicks, is this just a holdover from earlier times?


title: Do I need to use an interface when only one class will ever implement it?

text: Isn't the whole point of an interface to for multiple classes to adhere to a set of rules and implementations?


title: Everything has an Interface

text: > **Possible Duplicate:**   >  Do I need to use an interface when only one class will ever implement it? I am taking over a project where every single real class is implementing an Interface. The vast majority of these interfaces are implemented by a single class that share a similar name and the exact same methods (ex: MyCar and MyCarImpl). Almost no 2 classes in the project implement more than the interface that shares its name. I know the general recommendation is to code to an interface rather than an implementation, but isn't this taking it a bit too far? The system might be more flexible in that it is easier to add a new class that behaves very much like an existing class. However, it is significantly harder to parse through the code and method changes now require 2 edits instead of 1. Personally, I normally only create interfaces when there is a need for multiple classes to have the same behavior. I subscribe to YAGNI, so I don't create something unless I see a real need for it. Am I doing it all wrong or is this project going way overboard?


title: How do I prevent unknowningly duplicating code?

text: I work on a rather large code base. Hundreds of classes, tons of different files, lots of functionality, takes more than 15 minutes to pull down a fresh copy, etc. A big problem with such a large code base is that it has quite a few utility methods and such that do the same thing, or has code that doesn't use these utility methods when it could. And also the utility methods aren't just all in one class (because it'd be a huge jumbled mess). I'm rather new to the code base, but the team lead who's been working on it for years appears to have the same problem. It leads to a lot of code and work duplication, and as such, when something breaks, it's usually broken in 4 copies of basically the same code How can we curb this pattern? As with most large projects, not all code is documented(though some is) and not all code is... well, clean. But basically, it'd be really nice if we could work on improving the quality in this respect so that in the future we had less code duplication, and things like utility functions were easier to discover. Also, the utility functions are usually either in some static helper class, in some non-static helper class that works on a single object, or is a static method on the class which it mainly "helps" with. I had one experiment in adding utility functions as Extension methods(I didn't need any internals of the class, and it definitely was only required in very specific scenarios). This had the effect of preventing cluttering up the primary class and such, but it's not really anymore discoverable unless you already know about it


title: How do you structure your shared code so that it is "re-findable" for new developers?

text: I started working at my current job about 8 months ago, and its been one of the best experiences I've had as a young programmer. It's a small company, and both my co-developers are brilliant guys. One of the practices that they both have been encouraging is lots of code- reuse. Our code base is mainly C#, and we're using a centralized revision control system. The way the repository is currently structured, there is a single folder in which all shared class libraries are placed (along with unit tests for each library), and our revision control system allows for sharing or linking those libraries out to other projects. What I'm trying to understand at this point is how the current structure of the folder can be made more conducive for finding those libraries again. I've talked to the other developers about this, and they agree that it's gotten a little messy. I find that I am sometimes "reinventing the wheel" because I didn't realize that there was an existing piece of code that solved a particular problem. The issue is complicated further by the fact that we're sharing some code between ASP.NET MVC2, WinForms, and Windows CE projects, **and** sharing code between applications built against multiple versions of .NET. How do other people approach this? Is the answer in naming the libraries in a certain way or is it preferable to invest in some code-search software? Is the answer in doc comments? Should we be sharing libraries at all or should we simply branch the class libraries for re-use? Thanks for any and all help!


title: Who is responsible for software licensing in ITIL?

text: In a standard ICT Department who is responsible for managing software licenses? I would start by saying that the ICT Manager is accountable for it. But who gets the responsibility, using ITIL as a standard model for an ICT department would the Service Delivery Manager or Development Manager? The Service Delivery Manager needs to keep things running, but when moving forward with new versions of software does the Development Manager get controlling vote in what to purchase? As it's not just about delivering the service it's about improving it.


title: How to define complex business rules using User Stories?

text: A quick and dirty definition of User Story:               "As a <role>, I want <goal/desire> so that <benefit>"      In this commonly accepted definition there is little space for defining business rules, constraints or user input. Trivial example just to illustrate: > >     As a <librarian>, I want to <register new books> so that <students >   > > can find their availability online> In this silly example, where would one define the fields needed when registering a book? Should it be written anywhere? Or should the required business rules be passed as word of mouth by the Product Owner?


title: What do you call a "cell" in database terminology?

text: With "cell" I mean the value of a particular column in a particular row. I'm not sure if its called just "cell" or this is a spreadsheet thing.


title: What are the best monitors for programming?

text: From time to time I have tried some monitors. My main work is coding (work, phd, etc). At work I have an LG Flatron L246WH which I highly recommend. However at home I have an LG W2363V with which I feel pretty uncomfortable when coding. Fonts, subpixels or whatever mess with my minds when using smooth fonts. Currently, what are the best monitors out there, to best fit our needs?


title: Should I change language to stop becoming stale?

text: I'm an ASP.Net/C# programmer using SQL Server as a back end. I am the Technical Director of the company, I'm extremely happy in everything I do and consider the languages and system we use to be perfect for what we do. In the back of my mind though I know that over time programmers can become stale. I remember as a wee youngster that all those "old" developers were past it and couldn't keep up with the youngsters. So considering I'm happy in everything I'm doing. What options are there for keeping up with everything and avoiding becoming stale. One particular idea that I use is to let all the new developers use and showcase the things that they think are cool. If anything catches my eye then absolutely it will be something we all use going forward. Thoughts?


title: Build functionality around the design, or the other way around?

text: When you build an application, is it better to design the UI first (in Photoshop or whatever), then implement the functionality following the UI you just designed, or do the programming and build the design as you go? Advantages I see using UI as reference:   * the app will end up very UI-friendly :)   * like pdr mentioned, if working for a client, he gets exactly what he imagined Disadvantages:   * the programming will get more complicated, so development time increases any others? :D


title: What's the difference between working at a software company and a company whose focus is in another field?

text: Recently, I was approached by a local ad agency with a job opportunity. They are bringing all web/interactive development in-house and adding to their development team. I'm growing sick of my cushy, yet boring corporate job, and am intrigued by the position. Having only worked for software shops where the primary business was making software, I worry that they may not put emphasis on quality software practices, since development is not the focus of their business. Could anyone with experience at both compare/contrast working at a software company with working at a company that just happens to have an in-house software development team or department?


title: Do programmers at non-software companies need the same things as at software companies?

text: There is a lot of evidence that things like offices, multiple screens, administration rights of your own computer, and being allowed whatever software you want is great for productivity while developing. However, the studies I've seen tend toward companies that sell _software_. Therefore, keeping the programmers productive is paramount to the company's profitability. However, at companies that produce software simply to support their primary function, programming is merely a support role. Do the same rules apply at a company that only uses the software they produce to support their business, and a lot of a programmer's work is maintainence?


title: Will working in IT limit your career prospects as a programmer?

text: I took a job working as an IT guy (SQL programming, helpdesk, etc.) because I had need of a job (to pay back student loans accumulated from school). I'm very happy to have a job, but I eventually want to be a c++ programmer. I'm studying my c++ textbooks in my spare time and starting to do some projects with my newly acquired SQL skills. But the question that keeps rolling around in my head is "will I be a SQL programmer for the rest of my life now?" In your experience, will spending a year or two at my current job be a detriment in getting into C++ programming?


title: Is it a bad practice to stop providing support for outdated software if updates are free and easy?

text: Providing support for outdated software is both unexciting and expensive. If people are still using the version which was sold ten years ago, it means that they will find bugs which do not exist in next versions, their software may not work as expected on a new hardware or operating system, etc. The support people must also be trained to use this old version. This is unavoidable in several cases:   * When every next version of the software is paid, you can't force everyone to spend their money every two years to buy the next version. Example: Microsoft has still to support Windows XP, since it is understandable that people don't want to pay hundreds of dollars for Windows Vista, then Seven, then Windows 8.   * When the update is complicated. Example: when you know that installing SP2 of Microsoft SQL Server 2008 may render your server completely unusable, you may want to postpone installing updates and stay with and outdated version which has one strong point: it _works_.   * When legacy systems or security considerations are involved. Example: auto-updating a space shuttle software every week may have some disadvantages. In the same way, you can't update hardware if the legacy software requires the old hardware to run. Now, let's say that the update process is as well done as in Google Chrome. The user doesn't have to bother with the updates; there are no security or legacy reasons to not to update, and the updates are free. In this case, is it a bad practice, for a company, to stop providing any support for the versions outdated for a few months, and ask their customers to update their software first, then contacting the support if the problem persists?


title: How do you diagram global or shared state?

text: Say you're building an FSM for something like a game and you've got states like:   * MainMenu   * Options   * SinglePlayer   * MultiPlayer Your state diagram might look something like this: ![enter image description here](http://i.stack.imgur.com/vjxus.png) Now say you have a shared state, `DevConsole`, (shows the console when tilde is pressed and receives KB input etc. I'm sure you've seen it before) such that no matter what state you're in, this state applies. How do you diagram that? _edit_ * An example of how it would function would be like this:               public class StateMachine     {         protected State sharedState;         protected State previousState;         protected State currentState;              public void Update()         {             if(this.hasSharedState)                 this.sharedState.Update();                  if (this.previousState != null && this.previousState.IsExiting)                 this.previousState.Update();             else                 this.currentState.Update();         }              // called by individual states         public void ChangeState<StateType>()         {             // creates a new state adn sets its state machine owner to this machine             this.previousState = this.currentState;             this.previousState.Exit();             this.currentState = StateBuilder.Build<StateType>(this);         }     }


title: C programming in 2011

text: Many moons ago I cut C code for a living, primarily while maintaining a POP3 server that supported a wide range of OSs (Linux, *BSD, HPUX, VMS ...). I'm planning to polish the rust off my C skills and learn a bit about language implementation by coding a simple FORTH in C. But I'm wondering how (or whether?) have things changed in the C world since 2000. When I think C, I think ...   1. comp.lang.c   2. ANSI C wherever possible (but C89 as C99 isn't that widely supported)   3. `gcc -Wall -ansi -pedantic` in lieu of static analysis tools   4. Emacs   5. Ctags   6. Autoconf + make (and see point 2 for VMS, HP-UX etc. goodness) Can anyone who's been writing in C for the past eleven years let me know what (if anything ;-) ) has changed over the years? (In other news, holy crap, I've been doing this for more than a decade).


title: Protobuf design patterns

text: I am evaluating Google Protocol Buffers for a Java based service (but am expecting language agnostic patterns). I have two questions: The first is a broad general question: > What patterns are we seeing people use? Said patterns being related to class > organization (e.g., messages per .proto file, packaging, and distribution) > and message definition (e.g., repeated fields vs. repeated encapsulated > fields*) etc. There is very little information of this sort on the Google Protobuf Help pages and public blogs while there is a ton of information for established protocols such as XML. I also have specific questions over the following two different patterns:   1. Represent messages in .proto files, package them as a separate jar, and ship it to target consumers of the service --which is basically the default approach I guess.   2. Do the same but also include hand crafted wrappers (not sub-classes!) around each message that implement a contract supporting at least these two methods (T is the wrapper class, V is the message class (using generics but simplified syntax for brevity):              public V toProtobufMessage() {         V.Builder builder = V.newBuilder();         for (Item item : getItemList()) {             builder.addItem(item);         }         return builder.setAmountPayable(getAmountPayable()).                        setShippingAddress(getShippingAddress()).                        build();     }          public static T fromProtobufMessage(V message_) {          return new T(message_.getShippingAddress(),                       message_.getItemList(),                      message_.getAmountPayable());     }      One advantage I see with (2) is that I can hide away the complexities introduced by `V.newBuilder().addField().build()` and add some meaningful methods such as `isOpenForTrade()` or `isAddressInFreeDeliveryZone()` etc. in my wrappers. The second advantage I see with (2) is that my clients deal with immutable objects (something I can enforce in the wrapper class). One disadvantage I see with (2) is that I duplicate code and have to sync up my wrapper classes with .proto files. Does anyone have better techniques or further critiques on any of the two approaches? * * * *By encapsulating a repeated field I mean messages such as this one:               message ItemList {         repeated item = 1;     }          message CustomerInvoice {         required ShippingAddress address = 1;         required ItemList = 2;         required double amountPayable = 3;     }      instead of messages such as this one:               message CustomerInvoice {         required ShippingAddress address = 1;         repeated Item item = 2;         required double amountPayable = 3;     }      I like the latter but am happy to hear arguments against it.


title: WebSockets current state on security and browser support

text: I found many things when searching, but nothing that seemed both updated and complete. In last quarter of 2010 I remember reading what were very sad news for me, as WebSockets were disabled in most (if not all? can't remember) modern browsers that supported it by default due to security concerns in the proxy protocol the WSP uses. I wonder what's the current state of the issue and if there's any known plans from the next version of browsers to start enabling WS by default. I know that in Chrome 13b I get it enabled and I don't think I enabled it myself, but the same does not happen in the other browsers I use. Also, what draft is being used in the current versions? I will be giving a presentation on HTML5 for a group of developers next month and this is the topic I think I'm the least updated on. I need to implement current protocol to at least feel certain I know what I'm talking about and have no problem answering questions :) As many technical and specific details as possible will be greatly appreciated.


title: Marriage of Lisp and LaTeX - has it been done?

text: I like `LaTeX`, but I find its macro system and logic both complex and weak. languages such as Schem/Lisp/Clojure are very good at macros. I imagine the entire document written in a lisp family language, which, when run, would emit LaTeX code and produce a document. Has this been done before? Any links?