title: Variable naming conventions?

text: I've just started using ReSharper (for C#) and I kind of like its code smells finder, it shows me some things about my writing that I meant to fix a long time ago (mainly variable naming conventions). It caused me to reconsider some of my naming conventions for methods and instance variables. ReSharper suggests that instance variable be lower camel case and begin with an underscore. For a while I meant to make all my local variables lower camel case but is the underscore necessary? Do you find it comfortable? I don't like this convention but I also haven't tried it yet, what is you opinion of it? The second thing it prompted me to re-evaluate is my naming conventions for GUI event handlers. I usually use the VS standard of ControlName_Action and my controls usually use hungarian notation (as a suffix, to help clarify in code what is visible to the user and what isn't when dealing with similarly named variable) so I end up with OK_btn_Click(), what is your opinion of that? Should I succumb to the ReSharper convention or there are other equally valid options?


title: What's the best setup for a development machine (when you have multiple clients)?

text: I have my development machine (a laptop, since I do often go onsite to a client) setup like this:   1. Windows 7 x64 - it's a great OS, and the 64 bit version let's me put in a lot of RAM   2. 8 GB RAM   3. VMWare - I used to use Virtual PC, but VM Ware has so many features that I prefer, like support for USB etc. I develop primarily in .NET and I setup the development environment like this:   1. Very little (if any at all) developer tools on the host. Mostly I just have Office, Photoshop, etc. things that are independent from actual development   2. I have a different VM for every client. This allows me to configure the VM to their evironment, and in fact I have several clients where my VM is actually joined to their domain. Every client's VM runs _on its own external drive_! Putting a VM on it's own drive makes your VM run much faster. I use laptop hard drives in small drive cases, very easy to put in my laptop bag, and each drive has a sticker with the client's name so I can easily grab the right external drive. I usually allocate about 3.5 - 4 GB of RAM to each VM.   3. On the VM I have all the tools I need to work for that particular client, including VPN software, developer tools (SQL Server, VS), etc.   4. I have a few VM's that are "client agnostic", and these run server software (Wink2k, Win2k3, Win2k8) with IIS etc. for testing deployment, etc.   5. I have GoToMyPC set up so I can access the laptop from a remote location in extreme emergencies. In the past I have been set up differently, with the development environment set up on a beefy server running everything, and I just RDP in, so the laptop doesn't have to be that robust (it's basically just painting the screen), and I can access from anywhere. There are pluses and minuses to this, mostly that sometimes I like to develop when I am not able to connect to the internet, and my development is hindered anytime my internet connection speed is slow or lagging. How do you set up your development machine? Feel free to take this in any direction you want. . . **Note:** The only thing I would change about this is more RAM, and for multiple hard drives in my laptop so I don't have to carry around so many external hard drives.


title: Is there any logical reason to auto-generate code documentation?

text: Automatic documentation generation can be done with a variety of tools, GhostDoc being one of the more prominent. However, by definition, everything it generates is redundant. It takes a look at names of methods, classes, etc. and outputs English that _might_ explain them more verbosely. In the best case, it does what the reader could already do in their head (examples taken from here):               /// <summary>     /// Initializes a new instance of the <see cref="Person"/> class.     /// </summary>     public Person() ...      In the worst, it can actually end up generating bizarre documentation that is actually misleading in its attempt to heuristically figure out the meaning of names:               /// <summary>     /// Riches the text selection changed.     /// </summary>     /// <param name="richTextBox">The rich text box.</param>     private void RichTextSelection_Changed(System.Windows.Controls.RichTextBox richTextBox) ...      It seems that the attitude with GhostDoc is, "it's intrinsically better to have _some kind of_ formal XML documentation", but when that documentation is 100% redundant, why? Isn't it just wasting a ton of space at best? At my workplace, we have to document everything, and almost always with GhostDoc's auto-generated docs. Do you do this, and are there any rational reasons not to simply leave code undocumented if you aren't going to actually write the documentation yourself?


title: How not to forget new and interesting information

text: The thing is that I read a lot of things over a period of time because it is interesting and I like to know it and secondly it will be helpful in my future job interviews. For example I read about data structures: association, aggregation and composition; about 2 months ago with great interest and I thought I had it all but struggled big time recalling the information at a recent job interview. How do you people handle these things? How can I make my reading meaningful without worrying about forgetting about it in the future.


title: How do I convince my fellow devs to WANT to add comments to source code commits?

text: I know that Subversion (what we're using at work) can be configured to require comments on commits, however I'm not in a position of power to simply turn this on. I know that _my_ reason for commenting my commits is because it is useful, if only as a memory-jogger, to quickly understand the reason behind the commit. However, this doesn't seem to be enough to combat the two responses I always get:   1. It takes too long and I just want to get my changes into the repo.   2. It's easy enough to just look at the diffs. I even show them the value of simply putting in a JIRA issue ID and how it automatically gets tied to the issue, but still no dice with them. Worst of all, the person who _can_ make the call is in the same camp: doesn't want to bother and is fine with looking at diffs. I know it's the right thing to do, but how can I make them see the light? Even if I can't convince my fellow devs, how can I convince management that it's the right thing to do for the business?


title: Auto update for application hosted on multiple servers on cloud

text: I'm working on an application which will run on multiple Amazon EC2 instances. I wish to incorporate auto update feature for my application. The updater should update all the Ec2 instances. Also, there is a central server which governs the creation/termination of EC2 instances as per load. The central server creates a EC2 new instance from a pre-configured custom AMI (custom image which has our application pre-installed). Also, once there is an update, the pre-configured AMI needs to be updated too else it would create new instances which are not updated. Should the central server notify all the ec2 instances for an update and then the instances update themselves?Or should the application on Ec2 instance have a check for periodically updating themselves? Also how should the Amazon custom AMI be updated? Should a new instance be created from it, updated and then a new AMI be re-created and then new images be created from this AMI? What is the best way to incorporate an auto update feature for this architecture? The central server is written in Java and the application running on the cloud is written in C++. Is there a good framework available that can be used for this architecture? Please let me know on what I could be missing in the design and how it would help me to have a nice, extensible and fail safe auto update architecture. Thanks


title: Is listing developer's full names in splash screen or about box still a widely spread and desirable practice?

text: Just like in the closing credits of movies, some software vendors list the **full names of the team** that worked on the piece of software you are using. They are usually displayed in the **splash screen** (Photoshop) ![Adobe Photoshop Vintage Splash Screen](http://i.stack.imgur.com/qq1U8.png) ... or in the about box (Traktor). ![Traktor Famous DJ Software About Box](http://i.stack.imgur.com/ICNPI.png) In the demoscene, it is a mandatory practice, like in the movie industry. > How do you see that in your own software? Is there any reason why not doing > it? Is there any reason encouraging companies to do it?


title: When is cloud database right for me?

text: Some say that DBaaS (database as a service) -- aka cloud database -- is not suitable for Business Intelligence (BI), analytics (OLAP) or archiving. Is this true? More generally, when DBaaS is the most effective technical choice?


title: Efficient "Object with weights" structure

text: I need to find an "efficient" data structure / set of algorithms to do the following things: I have a list of objects. I need to assign them weights and later on increase or decrease these weights. For instance: We have the hashmaps `{o1}, {o2}, {o3}`. The `{o}`'s don't have any particullar structure, just random json. I am looking for a way of saying: Increase the weight of o1 by 1. Increase the weight of o2 by 1. Increase the weight of o1 by 1. Now give me the results sorted by their weight. I am using Python. So far I have tried using a normal hashmap to store them, but the problem is that I can't just hash the `{o}`'s. I thought of hashing the pointer of the `{o}`'s in memory, but it seems I don't have access to it in Python.


title: How to create business layer objects out of input parameters properly?

text: **Application description** I have an application of the following structure, simplified:                   Http request              ↓      +-----------------+     |  RequestParser |     +-----------------+              ↓     Business layer request object      **Problem code** The request parser layer accepts the input parameters, validates them and builds the business-layer request object. The code looks like that:               public function processMyRequest()     {         validationForm =             Form::create()                 .addIntegerValidator('order_id')                 .addStringValidator('external_id')         ;              if (validationForm.hasErrors()) {             throw new Exception();         }              return             BusinessRulessObject::create()                 .setOrderId(validationForm.getParameter('order_id'))                 .setExternalId(validationForm.getParameter('external_id'))         ;     }      **Some prerequisites** The form can be huge, so does the business layer object. Unfortunately, the Form class belongs to framework and it is final, so I can not inherit the concrete form from the base one where I could specify all the validators. The agreed solutions was to create this forms via Factory classes (this is not the Factory template though as it is not needed here: no mocks in tests, no polymorphism in client code). The RequestParser class can handle several requests. **Better version** So now the code looks like this:               public function processMyRequest()     {         validationForm = FormFactory.createSomeForm();              if (validationForm.hasErrors()) {             throw new Exception();         }              return             BusinessRulessObject::create()                 .setOrderId(validationForm.getParameter('order_id'))                 .setExternalId(validationForm.getParameter('external_id'))         ;     }      **How can I make it better? Version 1** But how should I create my object? Should I have some factory that creates it from form? I.e.,               public function processMyRequest()     {         ...         return BusinessRulessObjectFactory::createMyConcreteObject(form);     }      **Version 2** Or should BusinessRulessObject class have some method like `createFromForm()`, i.e.               public function processMyRequest()     {         ...         return BusinessRulessObject::createMyConcreteObject(form);     }      **Version 3** Or RequestParser's method `createFromForm()` would be enough, i.e.               public function processMyRequest()     {         ...         return createMyConcreteObject(form);     }          private function createMyConcreteObject(Form validationForm)     {         return             BusinessRulessObject::create()                 .setOrderId(validationForm.getParameter('order_id'))                 .setExternalId(validationForm.getParameter('external_id'))         ;     }      **So?...** I guess I should choose between the first and the second option, but what aspects should I take into consideration when choosing the way object should be created? And, actually, what way is preferable in my case?


title: Is it necessary for Java programmers to learn some C/System programming?

text: I've read a blog(in Chinese only) in which the author had jeered at Java programmers who know little about C and system programming. The author illustrated how he had found the deep reason of a Java NIO Selector exception using his knownledge of C and Windows/Linux system API. The IOException is thrown with message "Unable to establish loopback connection" when calling java.nio.channels.Selector.open() too many times. What he had found was that for each opening of Selector, a pair of TCP connections were created in Windows and a pair of pipes were created in Linux. In another blog, he also mentioned that GNU Java compiler was a clever implementation than Sun Java. What he said seems completely new and interesting to me. But I am not sure if C/system knowledge is the only way to figure out such problems quickly. Is it really worth spending much time on learning those knowledges for Java programmers?


title: Creating a websocket server on Linux

text: I want to create a websocket server and I've found a great article here. However C# will output an exe file. I'd like to have it run on a linux box. What I want to do is to connect to the server, and when something happens on the filesystem to retrieve a message from the server (using the `FileSystemWatcher` on Windows or the `iNotify` daemon on linux) and the program will run the corresponding code. So, how can such daemon for linux (in C#) or any other way to achieve this?


title: Inventory Consignment Flow

text: Not sure whether this is the right place to ask this question, but here goes.. Currently I have requirement to add support for consignment transaction in our inventory module. I have a very limited understanding of what consignment means in inventory, i.e. > Customer get stocks/products from Seller without actually buying them, the > product just resides in the Customer's inventory and it's still owned by the > Seller. Only when the Customer actually buy the stocks then only will the > ownership of the stock is transferred. The issue is i can't imagine how the data will be presented to both the Customer and the Seller. What i know is that i would need to deduct the stock from the Seller's inventory when the Customer raise a request to get the stock through consignment, but what about the 'ownership' of the stocks/products? Does that mean i would need to create another column in my table to state that for each inventory it is owned by who? Anywhere i can get information on how i should work out an inventory module like this? Thanks.


title: Duplication of code (backend and javascript - knockout)

text: We have a new developer on our team. He seems to be a smart guy (he just came in so I cannot really judge). He started with implementing some small enhancements on the project (MVC3 web application using Javascript with jQuery and Knockout). Let's say we have two values:               A - quite complex calculation         C - constant         B = A + C      On the screen there is value B and user can change it (normal texbox). When B changes, A changes as well because C is constant. So there is linear dependency between A and B. Now, all the calculations are done in the back-end, but we need to recalculate A as user changes B (in Javascript, I would use knockout). I thought about storing old A and B and when B changes by 10 then we know that new A will be `old A + 10`. He says this is dirty, because it's duplication of code (we make use of the fact that they are dependent and according to him that should be only in one place in our app). I understand it's not ideal, but making AJAX request after every key press seems a bit too much. It's a really small thing and I would not post if we haven't had long discussion about it. How do you deal with such problems? Also I can imagine that using knockout implies lots of calculations on the client side, which very often leads to duplication of the same calculations from the back-end. Does anyone have links to some articles/thoughts on this topic?


title: Replacing static classes with global state to a series of POJOs, beginning to feel like an anti-pattern

text: I'm trying to refactor some code, and one of the major changes is to remove the (ab)use of static classes to give global state. I've tried to split up some of the 'global state' functionality with POJOs that can be passed around. But the further down the rabbit hole I go the more and more I feel like this is an Anti-Pattern. Is holding state in POJOs and then passing them around bad form? It means the outline of my methods often look like this:               public MyPojo makeReport(int myInt, String pathToInput, MyPojo myPojo){         ...         if(myPojo.whatKindOfReport()==Reports.reportTypes){             ...         }         ...         myPojo.isWritingReportToFileSuccessful(true);         ....         return myPojo;     }      Where the POJO 'state' is set from the GUI that the user interacts with. For instance with tickboxes for report types etc. But this blocks other return types, and seems overly complicated. * * * I've taken this approach because the application has several 'paths' (see `whatAmIDoing`) the user can take in running it, each of which has several stages. What options the user has depends heavily on what path they pick and then from there, the result of that choice (normally, success or failure, see `myPojo.isSomethingSuccessful(true)`). I'm trying to encode that information in a POJO rather than a Global State Class. Is this an anti-pattern? How can I get round this? * * * Edit: I think what I'm after is _something_ like Chain of Responsibility. After looking at this answer I'm not sure.


title: What were the "core" API packages of Java 1.0?

text: Reading about the Google v Oracle case, I came across these questions (apparently from the presiding Judge) > ...   >  Is it agreed that the following is true, at least as of 1996? > > The following were the core Java Application Programming Interface: > java.lang, java.util and java.io. > > Does the Java programming language refer to or require any method, class or > package outside the above three?   >  ... source: Groklaw There are obviously lots of legal ramifications, Google and Oracle probably disagree on some points, and **I don't care**. Leave law to the lawyers. However, I suspect there's an interesting bit of history in here. My question is (as someone who first did any Java coding around 2001 in version 1.3), in version 1.0 of Java was anything required outside of `java.lang`, `java.util`, and `java.io` to compile a valid Java program? As an example (using C# 5.0), the `await` keyword is dependent upon ~~`Task<T>`~~ `GetAwaiter()` (amongst other things). The compiler couldn't function to spec without that class. Equivalently, were there any core runtime features (like ClassLoader*) that were dependent on other packages? I'll admit I ask out of curiosity, exactly what is necessary for minimum- viable Java (the language, ignoring all the legal bits around it) is interesting. *I am assuming that ClassLoader was even a feature in Java 1.0, it's part of the spec in 7.0 and presumably many earlier versions.


title: What is an "abstraction layer"?

text: I need a very simple explanation because I'm not a professional programmer. I found the terminology "abstraction layer" reading the documentation of mysqli extension where is described the difference among mysql, mysqli and PDO extensions in PHP. The article is this, that's where I met "abstraction layer" for the first time (referred to PDO). Now, trying to elaborate my question, we could speak of PDO abstraction layer against mysqli extension in php. So, for example, why mysqli is not defined as abstraction layer? How an abstraction layer acts? (like PDO in php) I would like to understand in a general way what is an"abstraction layer", I will not do particular questions about php or mysqli and PDO extensions. So, what is an abstraction layer? And what is its difference from a common application's extension?


title: Putting together Data Mappers and Domain Objects inheritance

text: Currently, I have a system with a Data Mapper and multiple Domain Objects which inherit from the same class, let's say B and C that inherit from abstract class A. In order to retrieve data, I need to pass a parameter to the data interface (getObject('a'), getObject('b')), based on which data for class B or class C will be returned. Then, the Data Mapper uses a Factory class to create the correct object based on some parameters (coming from the data itself). Class B and class C only differ in the implementation of one method, the rest is inherited from class A. I have a few doubts on this, it seems flawed but I can't really figure out a better way of doing it. The points are:   1. Is inheritance a good way to go about the implementation of different entities that differ in concept but only very slightly?   2. Is the factory class a good way to return the correct Domain Object?   3. Consuming the data mapper with a parameter feels wrong, is there a better way to do this? Would the use of abstraction be any better? I hope I have explained it clearly enough, if not I'd be happy to clarify.


title: What does it mean that "language A is written in language B"?

text: I often hear the term that language A is written in language B. For example, **PHP** has been written **C** , **C#** is written in **C++**. Can someone please explain what does that mean and if it is even correct? Does that have anything to do with the compiler of interpreter used by the language? In addition what are the factors on which the choice of the implementing language is built upon?


title: Why do you have to manually type variable names while debugging?

text: I've seen this in a lot of IDEs (even in the most popular and heavily used ones, like Visual Studio): if you want to watch a variable's value, you have to manually type its name in the Watches section of the debugger. Why can't there just be a list of all of them with checkboxes next to them ? The developer can then just check the box next to the one he wants to watch and that's it. Variables with identical names can probably be numbered in some way (for example `a`, `b`, `x(1)`, `x(2)`, `c`, etc. I've seen some exceptions to this (NetBeans or BlueJ), but there are exceptions to everything, right ? Maybe it's a stupid question, maybe not, but I've always wondered why this is so.


title: What is your code review and approval process, and what are its advantages/disadvantages?

text: Does your team rely on code reviews for approval of work? Is it simply QA that signs off your features and fixes? Do you have a lead programmer (or architect) that reviews code design and implementation? Or is it simply a Works on My Machine paradigm? What would you recommend or have seen that works well?


title: Bug Report System - Getting people to use it

text: I've built already a bug report system. It looks like this: ![enter image description here](http://i.stack.imgur.com/Hl6ZE.png) It is accessed using a secret key combination detected by the JavaScript code. Not hard. It has everything - sends the standard emails to management and testers, logs the Javascript variables and current DOM HTML. We are also improving the backend of the system to act as a full bug report system. Previously, it was only via email. The problem is, unfortunately, the bug reporters _still_ preferred email. Even when I refused to answer their queries until they sent a bug report, they would not consistently send them. I don't understand it, because, for them it should be easy, but they act like it was a big deal. (The appearance was slightly more complex before, but still, all they had to do, minimally, was type a subject and press SUBMIT). I can't ask them, because they really have no idea. The second issue, more difficult, is to create a way to manage these issues that will be suitable to us developers. I actually have been satisfied managing new issues and bugs via Gmail inbox but my co-worker would like to use a system. He gets more mail than I do and has other reasons. I am completely at a loss for what to do. My problem is solved as much as I need it to be. When I look at other bug report systems, they both look terrible and are often expensive. Moreover, if even one person reports a bug via email, it will be a disaster! We can't refuse every bug via email and then will have two bug reporting systems. Sorry to put out all these complaints here, but maybe someone has some insightful advice that hasn't already been said.


title: Recommend a design pattern/approach to exposing/tolerating/recovering from system errors, Exception handling (e.g.s in Java, C++, Perl, PHP)

text: Can you recommend a design pattern/approach to exposing/tolerating/recovering from system errors, Exception handling (Java, C++, Perl, PHP)? Some errors need to be reported. Some errors can be handled internally (by a retry or are inconsequential (can be ignored). How do you structure the code to catch them? But all errors need to be logged. What best practises are there? And for simulating them to be able to fully test components that are impacted by them? General non-programming-language specific question applicable to several modern programming languages but would welcome example illustrations of patterns, approaches and philosophies in Java, C++, PHP and Perl. (Also asked in stackoverflow: http://stackoverflow.com/questions/7432596/recommend-a-design-pattern- approach-to-exposing-tolerating-recovering-from-system but I thought it should be asked on programmers too because I think the programmers Q&A covers wider software/programming issues whereas stackoverflow is more about technical implementation IMHO).


title: Is it allowed to make multiple instances of a singleton class?

text: I am confused when I read this (regarding singleton design pattern): > How do we ensure that a class has only one instance and that the instance is > easily accessible? A global variable makes an object accessible, but it > doesn't keep you from instantiating multiple objects. So what is the use of singleton pattern if we can create multiple instances? **SOURCE:** Design Patterns - Elements Of Reusable Object Oriented Software (1995) - Gamma, Helm, Johnson, Vl


title: Moving from a traditional waterfall methodology to an agile one

text: My development team is in the process of 'going agile' and lot of people are looking at each other blankly, not really too sure what it means. All management are saying is 'start working agile' without suggesting any particular methodology so they're waiting to see if we can come up with something ourselves. Has anyone been in this situation before and how did you handle it? Any do's and don'ts? I'm one of the senior members of the team so there's an expectation to show some initiative. I know that what works for one won't necessarily work for another so I'm more interested in the approach not so much the end result because I think the result will come naturally with the right approach.


title: Escaping language pigeon hole

text: I have spend the last 5 or so years doing PHP, and I have to say it is far from my favorite language. I would like to move to a position doing something else (say Erlang) but how do I get people to look at me. It seems despite everything on my CV (including an upcoming book from O'Reilly) I keep getting pigeon holed into PHP type positions.


title: Is coding and unit testing violating the DRY principle

text: The dry principle states: > "Every piece of knowledge must have a single, unambiguous, authoritative > representation within a system." However when writing tests for code you are describing the expected behavior for the system twice (once in the code and once in the test). I know both descriptions are from a different perspective but share a great deal of the underlying idea. Any thoughts on this? In general I think both unit tests and the DRY principle are good ideas and I try to apply them as much a possible. This question is more on a philosophical level, but I wondered if anyone had also thought of this.


title: Is it possible to combine XPath and CSS selectors?

text: Just came through XPath. I got curious about this. Why is there a different way to select tags in XPath and CSS(selectors). Why cant there be a common way in both XPath and CSS?


title: Can a neural network provide more than "yes" or "no" answers?

text: Every example neural network for image recognition I've read about produces a simple "yes" or "no" answer. One exit node corresponds to "Yes, this is a human face," and one corresponds to "No, this is not a human face." I understand that this is likely for simplicity of explanation, but I'm wondering how such a neural network could be programmed to give a more specific output. For example, let's say I was classifying animals. Instead of it saying "Animal" or "Not an animal", I would want responses like "Dog", "Fish", "Bird", "Snake", etc., with one final exit node being "Not an animal/I don't recognize this". I'm sure this must be possible, but I'm having trouble understanding how. It seems like due to the training algorithm of backpropogation of error, as you train up one exit node (i.e., "This is a dog") and the weights of the neurons are changed, then the ideal state for another exit node that you previously trained (i.e., "This is a bird") will begin to deviate, and vice versa. So training the network to recognize one category would sabotage any training done for another category, thus limiting us to a simple "Yes" or "No" design. Does this make such a recognizer impossible? Or am I misunderstanding the algorithm? The only two things I can think of are that:   * Either we could train one neural network for each thing we want classified and somehow use those to construct a greater, super-network (so for example, a network for "dog", a network for "bird", etc., which we somehow add together to create the super-network for "animals"); or,   * Create some kind of ridiculously complicated training methodology which would require incredibly advanced mathematics and would somehow produce an ideal neuron-weight-state for all possible outputs (in other words, `insert math magic here`). (Side note 1: I am specifically looking at multilayer perceptrons as a kind of neural network.) (Side note 2: For the first bulleted "possible solution", having each specific neural network and iterating through them until we receive a "Yes" response is not good enough. I know this could be done fairly easily, but that is simple functional programming rather than machine learning. I want to know if it's possible to have _one_ neural network to feed the information to and receive the appropriate response.)


title: Direct database manipulation an anti-pattern?

text: Recently I learned that some teams have moved all their database manipulation to the actual database through the use of stored procedures. I thought that was pretty clever, since the database becomes a black box and any change to how the data is stored and manipulated won't affect application code. Is it accurate to conclude that manipulating the database in application code is an anti-pattern, since it unnecessarily couples application and storage code, or are there circumstances that would make decoupling sql queries from the application a disadvantage?


title: Software for prioritising issues / tasks in an ordered list/queue (ideally in Github)?

text: It seems to me that the best way to manage priority for programming tasks in a backlog is to simply put them in order. Do the top task first, second one next. If priority changes, re-order the queue. I thought this was exactly how things were supposed to work in Agile. I have yet to find an online open-source team task manager that supports custom ordering of tasks this way - although I might be out of date. Assembla definitely doesn't. Jira doesn't seem to. When we used Agilo in my previous company, it didn't seem to either. The only service I've found that implements this simple concept well is Google Tasks, but that's hardly suitable for managing software projects. I don't understand why this isn't the standard way to manage priority. My ideal way to track issues would be through Github. As far as I can tell Github Issues also doesn't support custom ordering of tasks. Does anyone know if there's any way to implement this on top of Github Issues somehow? Is there any way I can suggest it as a feature?


title: Is there a useful correlation between choice of web-browser/search engine and good quality programmers?

text: After a round of interviews earlier this year, which included some practical questions with access to a computer, I noticed that, at least for the applicants we were seeing, there was a high inverse correlation between quality of applicant and the explicit choice of Bing/IE as the stack for search/browsing the web. That is, a large number of applicants specifically searched for IE to use as a browser when browsing the web, and specifically used Bing as the search engine (even typing in Bing in the Google search box, before starting a search) Is this just an outlier, a fluke, or is there some sort of information I can obtain from this observation? So far, my best candidates are:   * Yes, there is a high correlation between good programmers and choice of web browser/search engine   * There is some training program, or community, which advises using IE/Bing during interviews, and I just happened to run into a poor selection from that group   * Something else is going on, that I don't know about, but someone here might know. So, to repeat, the question is: is there more than coincidence at work here, and, if there is, what's going on?


title: Rearranging Cartons Algorithm

text: **Problem Statement -** ![Problem Statement](http://i.stack.imgur.com/pbK2U.png) The task is to find the minimum number of swaps required in the given arrangement of cartons to get the desired arrangement of cartons. Only adjacent cartons can be swapped. I have tried an ad hoc approach, but it proved inefficient towards the upper limit of the data range. Here it is for reference -               Traversing through the given arrangement of cartons      if position of carton>than the desired position       swap back       go to previous iteration      What would be a pragmatic approach to the problem? Test Data Range - N<=105 Source - INOI 2009 Q Paper


title: Is tracking Android OS.Buid/Manufacturer info a privacy issue?

text: On the Android operating system details about the phone are available via the `Android.OS.Build` class. These details include things such as the phone manufacturer, model, version, etc. The customer may want us to collect this data and save it to our database for analytics and tracking. I think this raises some privacy concerns for the end user. Are we obligated to inform the user that we are collecting this information (similar to how the use of the device's capabilities, such as camera or microphone, are presented in the Play Store) and what we intend to use it for? If we are not required to do so, is this something that we should, from an ethical perspective, inform the user that we are doing?


title: What pattern should one use to dynamically add multiple small views to one big main view?

text: Imagine a small calculator GUI, with basic operations (`+,-,/,*`), and in the menu we can check for example scientific calculator and a small new view with the extra functions appears beside. I was thinking that the decorator pattern is the solution but after reading some documentation on it, I am confused now. Which pattern would be more suitable for doing such things?


title: What happens if you're unable to solve a problem?

text: I'm a year away from graduating from university, and I'm really looking forward to solving practical problems. Especially non-trivial ones which require a bit of research and a lot of thinking. But at the same time, that is also my greatest fear - being faced with a problem that I'm unable to solve, no matter how hard I try. And with pressure to deliver code on impending deadlines just around the corner, it does look a bit scary when viewing it from the safe playgrounds on uni (where the worst thing that can happen is that you have to redo a course or exam). So for those who have been in industry for any longer length of time, what would happen if you were told to solve a problem that you couldn't? Has it happened, and if so, what did happen? Did they just drop it and said "Oh well, guess we can make do with something else"? Were there consequences? Were you reprimanded, or even fired?


title: How practical is it to build your very own social network?

text: A friend of mine wants to create his own niche social network for a specific target audience. I want to give my friend an idea about how practical this is on the software side. What kind of work would go into this? Is this a practical undertaking?


title: Best practices in versioning

text: I develop some scripts for data analysis in a small team. For the moment we use SVN, but not in a very structured way. We haven't even looked how to use branches even though we need this functionality. What do you suggest as the best practice to setup the following system:   * two code bases (core and plugins)   * versions can be incompatible to previous scripts   * sometimes individual features are being developed and not yet finished, while other fixes have to be done urgently to the code In the end we don't deliver the code as a package, but rather place the Python scripts in some directory (with version names?). Some other python script which serves as a configuration choses the desired version, sets the path to these libraries and then starts to import the modules. I saw stable releases to be named "trunk" so I did the same. However, no version numbers yet. Core and plugins are different repositories, however we have to match versions for compatibility. Can you suggest some best practices or reference to ease development and reduce chaos? :) Some suggested GIT. I haven't heard about it, but I'm free to change.


title: Can you recommend a good release notes template?

text: I am looking for a good release notes template. Possibly in a plain text or HTML form. What do you guy use? **EDIT:** I forgot to mention that these notes will be used internally in our company for other developers using our libraries. I am interested in what you believe a release note should and should not contain. E.g. do you list all open issues or just issues closed in this release? Do you maintain all previous release notes in the same file (possibly in reversed chronological order), or have separate documents for each release? A couple of examples that I have found on Apache web site:   * TXT: Apache Commons Net   * HTML: Maven


title: Is it possible to develop a web application entirely in Javascript today (client and server) including a RESTful API exposing PostgreSQL data?

text: Where I work we have over a dozen internal SW systems that we have developed in-house using a variety of technologies, frameworks, and languages. Those include various from Microsoft (ASP.NET Web Forms, WebAPI, WinForms, SharePoint, Office Automation, Win8 Native Apps, SQL Server, SSRS) and others not from Microsoft (plain-old JS/HTML/CSS, PHP, Lithium, PostgreSQL, MySQL). Our SW dev team has grown and shrunk again to where it's just me and one other dev now. I love trying shiny new tech and taking advantage of different tools to get things done, which partly explains the huge span of different technologies we've chosen over the years, but we're suffering from the "jack of all trades, master of none" syndrome. Now we've been told that the company is expecting significant new growth and that the two of us will need to produce a number of new applications over the next year. I'm ready to consolidate our skill sets and tool sets so that we can master the tools and focus more on the business problems we will face without having the slowdown of context switching between technologies. The two of us have been doing a lot of "plain old" JS/HTML5/CSS3 development recently and I would like to focus on that technology set moving forward. We will be primarily using PostgreSQL as our data store on the back end (possibly augmenting with some NoSQL for very specific uses, and probably needing to find an advanced full-text search tool to integrate in). Our primary user interfaces will be a combination of traditional web apps and Single Page Apps (50%-50% mix), but there is the hope for native mobile apps down the line. Therefore I would like to expose our business data via a RESTful API so that it's easy to consume by various clients. And **the most important factor in all of this is that I want to be able to code exclusively in Javascript from front to back** (with the exception of writing SQL as necessary for the DB layer, and HTML5/CSS3 for the presentation). This leaves me with the following questions:   1. Is it possible today to code all these layers/components exclusively in Javascript without resorting, for example, to PHP on the server, or C# for the RESTful API (i.e., WebAPI)?   2. Is node.js required to make this a reality, or can I use a non-node web server and still achieve the "Javascript-only" ideal? (related...would node.js just make more sense in a JS-only paradigm?)   3. Are there any frameworks for building JS-only RESTful APIs that can talk to PostgreSQL?   4. Are there any advanced full-text search tools (such as Lucene) that allow you to program against them with a JS-only approach?


title: "Standard" format for using a timestamp as part of a filename

text: I searched for a standard format for using a date/time as part of a file name and was unable to come up with anything. My question is two parts: **Is using time stamps ~~to enforce unique~~ in file names a poor practice?** I could get the time from the creation date and serialize the file names (file0001.bak, file0002.bak, etc) but just including the time stamp lets perform file operations such as `mv 2011-01* somewhere/`. Is there a downside to using this type of naming system? The format I am using is `YYYY-mm-dd_HH-MM-SS`. **Is there a better format I should be using?** With this format should i be concerned with file system compatibility, str_to_date_parsing concerns, etc? Thanks! edit: I might have wanted to leave out the **enforce** uniqueness bit since it's a single user generating backup using a cronjob (there shouldn't be any concurrency problems).


title: Do I have to include full gpl v2 license information in my commercial project if I use another author's work?

text: I would like to use another author's work in my commercial project. That author's work is licensed under GPL v2. I'm not using full code. I'm using only part of the code. Also I modified it as per my project needs. Now i'm confused about what kind of license information I should include. This is the full license text. I'm using multiple author's work in functions.php file. Some works are licensed under MIT. 1) Do I have to include full license text in my php file as a comment? 2) Do I have to create separate php file for each author's work.?


title: How to implement two different web services running the same business logic?

text: We are developing a ReSTful HTTP API with Servicestack(.NET). Some of the API clients, which have a subset of the actions, demand a service which could be easily added with all the entities, like with the "Add Service Reference" with Visual Studio. We are thinking about creating a simple asmx web service, but our thoughts on how to do it divide to two:   1. The asmx WS will call the ServiceStack service with an HTTP client.   2. The asmx WS will reference the same BL that the main service references and will call it directly. **Which is the preffered way?** **Is there any other way you would recommend?**


title: How does customized executable generation work?

text: One of the things that Valve's Steam distribution platform is known for is its Custom Executable Generation system, which creates a unique copy of a program for each person that buys it. I'm sure that Valve isn't the only company or person to have implemented or thought of implementing such a system, however. If I wanted to try and roll my own system that generated executable files on the server side that are unique to the downloader or their account, what would I need to know how to do? What are the basics of such a system in the first place?


title: Is Python Cookbook for python 2.4 applicable to python 2.7.5?

text: My college has a course on Introduction to programming using python and we are using Python 2.7.5. I would like to know if it will be helpful to read Python Cookbook which is for python 2.4? There are no separate cookbooks for python 2.7.x, to my knowledge. But, are there any similar books? There is a later edition to python cookbook for Python 3, but it turns out that python 3 and python 2 are quite different.


title: Using Paypal (or similar) to log into my site?

text: I have a web site and I want to offer a few levels of service - one free, one for a one-off payment, and one for a subscription. My first inclination is to use Paypal for the payment options. I understand that I can make some login page on my site where you create an account or login to an existing account, and then I can make an API call to Paypal to see what they've paid for and give them the appropriate level of access, and redirect to Paypal for them to pay for the access they want. I'm not sure yet if the free service will require a login or not. But having read Joel Spolsky's and Bruce Schnier's blogs, I'm conscious of how hard it is to do authentication right, and what a pain it is for users to have to create an account or login to my site, and then create an account or login to Paypal. Is there a way to use Paypal's login system directly, so they login to Paypal and Paypal sends me back a token saying who they are and what they've paid for? That kind of sounds like almost an OpenID, or something similar?


title: When should i learn a php framework?

text: I am working on a project , a mobile hybrid application , that combines native code , html5 - jquery mobile (for the frond end) and php - mysql (for the back end). The server side , is responsible for things like registering new users to a database , updating users , subscribing users to events etc. Basically is simple php code with mysql queries. Lately i started to read a lot about php frameworks. I started to wonder when is really time to use any and basically why? From my understanding the framework only helps in the back end of a service and usually all the back end i ve build till now is described roughly above. In general i am interested a lot on building mobile services which include both back end and frond end development. By learning/using a framework do i earn something special in my case? I dont understand how my 100line php scripts could get any easier if they were written with a framework. Yes i ve read a 100 times that is better to use something tested and bug free than use your own things but i dont understand what exactly they are talking about. What could go wrong by quering a database and fetching/saving/editing data that a framework would solve it? What i am asking here is maybe for some examples when a php framework should be preferred.


title: Should a PHP beginner use a framework?

text: > **Possible Duplicate:**   >  When should I start learning a PHP Framework I am an absolute beginner programmer. I've got lots of theoretical understanding from university a decade ago but no practical experience. I want to remedy that with a hobby project that would be similar to a real-world sellable web app. I've chosen PHP in order to avoid OS specifics, build process, etc. **Should I start out using a framework, or coding everything by hand? What would the benefits of using a framework be?** I have briefly looked at PHP Code Ignition and it does a good job of praising its own benefits. I am sure that is true for an experienced developer, but does it also apply to a beginner?


title: How should I specify a grammar for a parser?

text: I have been programming for many years, but one task that still takes me inordinately long is to specify a grammar for a parser, and even after this excessive effort, I'm never sure that the grammar I've come up with is good (by any reasonable measure of "good"). I don't expect that there is an algorithm for automating the process of specifying a grammar, but I hope that there are ways to structure the problem that eliminate much of the guesswork and trial-and-error of my current approach. My first thought has been to read about parsers, and I've done some of this, but everything I've read on this subject takes the grammar as a given (or trivial enough that one can specify it by inspection), and focuses on the problem of translating this grammar into a parser. I'm interested in the problem immediately before: how to specify the grammar in the first place. I'm primarily interested in the problem of specifying a _grammar_ that formally represents a collection of concrete examples (positive and negative). This is different from the problem of designing a new _syntax_. Thanks to Macneil for pointing out this distinction. I had never really appreciated the distinction between a grammar and a syntax, but now that I'm beginning to see it, I could sharpen my first clarification by saying that I'm primarily interested in the problem of specifying a grammar that will enforce a predefined syntax: it just so happens that in my case, the basis for this syntax is usually a collection of positive and negative examples. How is the grammar specified for a parser? Is there a book or reference out there that's the de-facto standard for describing best practices, design methodologies, and other helpful information about specifying a grammar for a parser? What points, when reading about parser grammar, should I be focusing on?


title: What's the best way to store documentation associated with a code project?

text: We have a lot of documents associated with our software development. These include things like requirements, design documents, external PDFs, customer files, testing instructions, etc. Currently, these documents are scattered all over the place (wiki, "some place on the network", a local developers hard drive(!), and even worse places). What's the best way to keep track of them? Since we use visual studio (2010) for our development, and we don't really have any non-developers on the project, I thought it'd be a great idea to store them within the VS "solution", which would allow them to be source controlled, and universally accessible by all the developers. However, VS really doesn't seem to be built to do this. If you edit any document file, even one that is setup with the build properties "None", "Do not copy", VS must will rebuild the software before it will run again. There is no way to create a "Documentation Project" within the solution. (We use an Empty C# project for this). Visual Studio and Word/Excel flat do not do source control well. You can't view a checked-in file, and then decide to make a change without first closing the file, going to the project, and manually checking it out before making the change. It's slow and tedious at best. Anyway this is the best our team has come up with, but I really wish I had a better (free) solution.


title: Lowering barriers to entry into new programming endeavors

text: What things do you do to lower the barrier to beginning new projects? How long does it take to get into something new from when the idea hits to when you start making enough code to play with? In general, I'm referring to toy projects, but the concept still stands for more substantial FOSS projects upon which work is desired to be done. For example, I would like to stop being afraid of image file formats, and to that end I'd like to be able to create an app that leverages OpenGL for viewing arbitrary image formats. Or, I'd like to explore how to handle very large image files. Maybe these kinds of projects are not casual enough for me to dive into and out of. Other examples are things like, wow this FOSS program is great! But I'd like to fix some functionality. Oh look, if I'm going to build this on windows I have to find these million dependencies and compile them myself. Or, dang, this code is written in python. Oh wait, 2.6, now I need to make sure I install that version as well, and remember which version I'm writing for. Do you find it more conducive to work in linux? Is the idea of a casual programming endeavor just a myth? In what ways have you lowered your barrier to getting started? Thanks


title: Best resources for learning Play! Framework

text: Awhile back I discussed the possibility of moving to a startup that is going to be using Java, more specifically the Play! Framework; well, I'm going to go for it! I have been a .NET guy for a long time now and haven't really been in the Java game except for the occasional Android tinkering or messing around with Scala a little bit. I have looked at the Play! Framework before but only on a cursory level. I think I will be fine with Java as a language, as I've been given great advice before on learning materials. My question, is aside from the very great site for the Play! Framework I haven't found much else out there except a few blogs. Does anyone know of any other good resources for the Play! Framework like books? An Amazon search turned up zero results. I know there is an eBook floating around out there but it seems a little outdated at this point. Anyway, thanks for your input.


title: Creating Objects

text: I have a general coding standard question. Is it bad practice to initialize and create an object in multiple methods depending on the outcome of a users choice. So for example if the user quits a poker game, create the poker hand with the cards the user has received, even if < 5, and if the user played till the end create object to show completed hand to show outcome of the game. The key is that the object will only be created once in actuality, there are just different paths and parameters is will receive depending on if the user folded, or played on to the showdown.


title: External repository moved from Sourceforge (SVN) to GitHub, now what?

text: We've been getting the head revision of the JEDI Code library for a while, we only use it a tiny bit so never have bothered to manage which version we're getting. The problem is they appear to be totally untethered from SVN now and we'd been including it in our repository as an external and now my build server it kaput. The obvious thing to do would be to just download zip and make a new repository on my SVN server and use that instead, updating when I feel like it. But is there a better solution? We use Tortoise SVN as an SVN client. (BTW, it's pretty strange that the JCL changed to Git with the great integration in the Delphi IDE isn't it?)


title: Steps towards TDD

text: I need some advice to take the steps for TDD. How do we think in terms of interfaces for everything when we are writing code? Most of the testing books tell you how to write tests. But I want a book which tells whats the good way to write code in terms of TDD


title: Is it possible to write an operating system in C?

text: A while back I saw a comment on a Stack Overflow question that surprised me: > No one can write an operating system in C. It is not possible. What one can > do is write an operating system in a C-based/C-like language that > adds/defines a considerable amount of non-standard capabilities on top of C > core. Is it useful to define C so narrowly? People say Linux, or a GPU driver, or an embedded system was "written in C", not "written in C-with-some-extensions-to- accommodate-the-hardware." Is it incorrect to do so?


title: 3-Tier Object-Oriented Design Flaw?

text: I am going through training at my new job to use good object-oriented design with a 3-tier programming style. My supervisor says I have a design problem with my code:               class Program     {         public static void Main()         {             UserInputValidator Validater = new UserInputValidator();             int logSelected = -2;             Console.Write("\nFilepath: ");             string filePath = Console.ReadLine();             while (logSelected != -1)             {                 Console.WriteLine("\n" + "SELECT AN OPTION MENU");                 Console.WriteLine("-----------------------");                 Console.Write("\n" +                 /* Display option menu here with several options */                 "9 ) Exit\n\n");                 Console.WriteLine("-----------------------");                 logSelected = Convert.ToInt32(Console.ReadLine());                 Validater.ValidateOptionsMenu(logSelected, filePath);             }         }              public void DisplayMessage(string message)         {             Console.WriteLine(message);         }     }      Validator.ValidateOptionsMenu() handles the logic for starting a process depending on the option that was selected. This is a 3-layer application with Presentation, Business, and Data Access layer. Program is in the Presentation layer, and other layers use code similar to the following to display a message:               Program program = new Program();     program.DisplayMessage(message);      I need to understand why this is bad practice - my supervisor says the class Program only starts the application, like App class in WPF. It has to have only 1 responsibility. The interaction with user (my option menu) is delegated to another class. I am having a hard time understanding my supervisor, and I'm not sure how to fix it. Can anyone help me understand?


title: How can I overcome a badly structured software development model?

text: I joined the company currently I am working on as a fresher. Due to the limited number of skilled people in GIS software development, and since I was among one of them I was directly recruited as a Project Manager. I was quite conversant with Java and GIS, and I have done self motivated research on location based services, but not with project management and structured software development. It was one year after my graduation as a Geology special and during the previous year I was working as an academic in a University. Thanks to the interest I was having at work, an opportunity shown up, and eventually I was made responsible for the Business Intelligence department of the company as well. The company believed in me. I myself studied data warehousing and BI concepts and was successful in combining GIS with BI as well. Also I am currently working with two developers on our BI tool in C# WPF, where I also play the role of a developer at times (which I like). I tried extremely hard to adopt good software development methodologies with agile project management, but it was not very successful. Also, though I believe in well designed code as far as a product is concerned, due to the lack of technical knowledge my CEO has (who is directly above me), I normally do not get the amount of time needed to do it. The time taken is greatly enhanced by the lack of expertise we have in the specific coding language as a whole too (for instance WPF opposed to Java). Also there is no version controlling system in place as well. I am extremely fed up with the way things are going as it is not structured and I find most of my time thinking than working as to how to get things structured. I hope you guys with good professional experience will be able to help me overcome this situation.


title: How many programming languages is a programmer expected to be an expert at?

text: Do most programmers specialize on a single stack, leaving other things be, or are they expert at multiple languages at the same time? If it's more than one, how many is standard? By expert, I mean more than simply knowing the syntax of a language - an expert knows enough of standard libraries, tools, environments and syntax to be able to write non-trivial programs without having to constantly look things up or read books/tutorials.


title: Splitting up a Rails/Ruby app onto multiple servers

text: We recently moved a large application to two machines, both running the same codebase. I. Machine A   * Web server for public facing application   * Receives web hook call backs from our ESP   * Handles a few large, list-processing jobs (uploaded spreadsheets with data) II. Machine B   * Manages a massive set of (background) jobs but, primarily, focuses on building and assembling newsletters   * Runs all integration with our NetSuite platform   * Runs all system maintenance (read: DB) jobs  To me, having these two apps running the same codebase (a large, monolithic Rails application) seems 'wrong'. I am wondering if anyone has advice on how to better break up the code for these two apps. While they both need the same DB and, ultimately, the same model code, Machine B has no need for Controllers and Views and it feels wasteful running a full-stack Rails app for its tasks. A couple things came to mind but I'm not sure if I'm trying to solve a problem that doesn't exist:   * Break the models out into a sub-module on git and include into both apps   * Build out the Mahcine B app in plain Ruby or a lighter framework like Sinatra (where I could use ActiveRecord with Sinatra in combo with a sub-module for the model folder).  I'm new to this scenario and appreciate any and all feedback or direction! Thank you.


title: how complex a constructor should be

text: I am having a discussion with my co-worker on how much work a constructor can do. I have a class, B that internally requires another object A. Object A is one of a few members that class B needs to do its job. All of its public methods depends on the internal object A. Information about object A is stored in the DB so I try to validate and get it by looking it up on the DB in the constructor. My co-worker pointed out that the constructor should not do much work other than capture the constructor parameters. Since all of public methods would fail anyway if object A is not found using the inputs to the constructor, I argued that instead of allowing an instance to be created and later fail, it is actually better to throw early in constructor. Not all classes do this but i found that StreamWriter constructor also throws if it has problem opening a file and doesn't delay the validation until the first call to Write. What others think? I am using C# if that makes any difference. Reading Is there ever a reason to do all an object's work in a constructor? i wonder fetching object A by going to DB is part of "any other initialization necessary to make the object ready to use" because if user passed in wrong values to the constructor, i wouldn't be able to use any of its public methods. > Constructors should instantiate the fields of an object and do any other > initialization necessary to make the object ready to use. This is generally > means constructors are small, but there are scenarios where this would be a > substantial amount of work.


title: What is the benefit of having the assignment operator return a value?

text: I'm developing a language which I intend to replace both Javascript and PHP. (I can't see any problem with this. It's not like either of these languages have a large install base.) One of the things I wanted to change was to turn the assignment operator into an assignment command, removing the ability to make use of the returned value.               x=1;          /* Assignment. */     if (x==1) {}  /* Comparison. */     x==1;         /* Error or warning, I've not decided yet. */     if (x=1) {}   /* Error. */      I know that this would mean that those one-line functions that C people love so much would no longer work. I figured (with little evidence beyond my personal experience) that the vast majority of times this happened, it was really intended to be comparison operation. Or is it? Are there any practical uses of the assignment operator's return value that could not be trivially rewritten? (For any language that has such a concept.)


title: iOS App Signing and Certificates

text: In order to sign an application for the Apple App Store, we need to create a certificate by saving a certificate request file from `keychain` and then upload it to the Apple store. I was wondering, what does this certificate request file contain?   Does the certificate contain any information (like a finger print) about the OS or hardware?


title: How do you track third party services SSL certificates?

text: Recently Windows Azure Storage SSL certificate unexpectedly expired and since a lot of dependent services defaulted to "refuse to connect to a site with expired SSL certificate" that became a serious problem. Now the SSL certificate of any web service can be retrieved by anyone at any time for validation. The picture is from the linked to question: ![cert expired](http://i.stack.imgur.com/xebIt.png) So it means that the information was available at all times to "anyone it might concern" and any user of the service could have noticed the upcoming expiration and for example post a message on Microsoft forums before it was too late. However I can't find any information about how such cases are typically handled except this question for doing that in code. Is there any kind of best practice for validating third party services SSL certificates? What tools are typically used?


title: Testing Git competence

text: I hire a lot of programmers for tiny tasks. I very clearly specify that the tasks can only be completed by making a pull request on GitHub. Unfortunatelly, so many programmers do not know Git and often the programmers cannot complete the project due to not understanding/being willing to learn Git, even after they have undertaken the programming of the task. This is bad both for me and for the programmers. Sometimes I end up arguing for why it is inefficient that they just send me a zip file containing the code. Therefore, I am looking for an online service to certify that the programmers know how to make a pull request so I do not waste their nor my time. The certificate should be free for the coders, but may cost me. It is important that the course just focuses on exactly what is needed to make a clean pull request so it should not take more than 5 minutes to go through. Does such a thing exist?


title: What is the difference between Times and Dup in Assembly Language?

text: In a bootloader, the second last line is : > TIMES 510-($-$$) db 0 Now, will this command also do the same : > db 510-($-$$) DUP (0) If not why? I know what `TIMES` does, but its not mentioned in my x86 book by Mazidi (Pearson Publication). Any idea why? And what is the meaning of the `$` sign exactly? Different sites have different information about `$`. And is the line `TIMES 510-($-$$) db 0` absolutely necessary even if my bootloader code is of 512 bytes in size? So can anyone help me with these questions?


How do I correctly include copyright statements for included libraries? I have a program that uses libraries which are licensed under the GPL and MIT (either jointly under both, just only MIT) licences. How do I specify this at the top of a combined and minified file? I have this currently:               My Program (GPL)     Copyright 2009-2013, Me          jQuery (GPL/MIT)     Copyright 2005, 2012 jQuery Foundation, Inc. and other contributors          Some other library (MIT)     Copyright 2013, Some other person          This file is part of My Program.          My Program is free software: you can redistribute it and/or modify     it under the terms of the GNU General Public License as published by     the Free Software Foundation, either version 3 of the License, or     (at your option) any later version.          My Program is distributed in the hope that it will be useful,     but WITHOUT ANY WARRANTY; without even the implied warranty of     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the     GNU General Public License for more details.          You should have received a copy of the GNU General Public License     along with My Program.  If not, see <http://www.gnu.org/licenses/>.          ...jQuery's code...     ...my code...     ...some other libraries code...


title: How can I cleanly separate first open tutorial code from my regular display code under OOP?

text: I have a MVC architecture, and I have the basic views completed. I now need to add the first user tutorial mode into the project. I don't want to add checks for first user state in all the views that need it, but the only alternative I can think of is to subclass everything and use those subclasses on first open. Is there a standard or widely-used practice for adding support for tutorials, etc. without making a mess of everything? EDIT: I was unclear in my question. I'm talking about tutorials that a user encounters when first using the app -- in our case we want to add visual effects to direct their attention to key UI elements. I wrote "first user state" to mean we store state about the number of uses on a local machine and use that to determine if display is necessary. Usually I would add some kind of edge case code to the views, say, if User.firstUse() arrowView.show();, but I was wondering if there's a cleaner way to partition that kind of code from regular code.


title: How to train yourself to avoid writing “clever” code?

text: Do you know that feeling when you just _need_ to show off that new trick with `Expression`s or generalize three different procedures? This does not have to be on Architecture Astronaut scale and in fact may be helpful but I can't help but notice someone else would implement the same class or package in a more clear, straightforward (and sometimes boring) manner. I noticed I often design programs by **oversolving the problem** , sometimes deliberately and sometimes out of boredom. In either case, I usually honestly believe my solution is crystal clear and elegant, until I see evidence to the contrary but it's usually too late. There is also a part of me that _prefers_ undocumented assumptions to code duplication, and cleverness to simplicity. > What can I do to **resist the urge to write “cleverish” code** and when > should the bell ring that **I am Doing It Wrong**? The problem is getting even more pushing as I'm now working with a team of experienced developers, and sometimes my attempts at writing smart code seem foolish even to myself after time dispels the illusion of elegance.


title: Technology for atoms animation

text: I would like to make an animation of Molecular diffusion. I have some CSV or binary file with data to create 3D scene with atoms. It has to be fast animation with diffrent camera views and transparency vary depends on atom's energy. Since I code in C# on a regular basis I am going to pick up XNA (later Mono.XNA). Is it the best fit? Is there anything good that reduce the amout of code? Has anyone had problem with porting XNA animation to Mono.XNA?


title: Detailed C++ book for a programmer already familiar with C and object-oriented programming?

text: I know (to some extent) a few languages, including C, Java and Python. I'm also (somewhat) familiar with Scala and Scheme, plus I can read (but not write) x86 Assembly. Say I want to learn C++, what is a good book which doesn't try to teach me what a class is, teach me inheritance, polymorphism or loosely coupled classes again, nor does try to teach me other basics, just the C++ language (as well as how to write _idiomatic_ C++ code, not e.g. Java with C++ syntax) and its standard library? **Note:** "Detailed" as used in the title means that it doesn't try to cover C++ in 100 pages, I want to know the details of the language. Of course, mastery comes from practice, but I don't want to learn just a little bit of C++ from the book, but learn it quite thoroughly.


title: What does it mean to expose a C++ code publicly as a C API and what are the advantages of doing it?

text: I often hear people say that C++ programmers should expose their library's/product's public API as a C API. What does that mean and what are the advantages of that?


title: Recursion without factorial, Fibonacci numbers etc

text: Almost every article I can find about recursion includes the examples of factorial or Fibonacci Numbers, which are:   1. Math   2. Useless in real life Are there some interesting non-math _code_ examples to teach recursion? I'm thinking divide-and-conquer algorithms but they usually involve complex data structures.


title: Testing: deterministic or non-deterministic?

text: Is it better to have either a   * Deterministic test suite, that results in the same tests succeeding   * Non-deterministic test suite, which potentially possibly covers more cases ? **Example:** You write a test suite to test controller functionality in an MVC application. The controller requires application data from a database as input during the test. There are two options to do this:   * You hardcode which row(s) from the test database are selected as input (e.g. the 10th and 412th row)   * You use a random number generator to pseudorandomly pick the data from the database (two rows selected by a random number generator) The first is deterministic: every run of the test for the same revision of code should yield the same result. The second is non-deterministic: every run of the test suite has the possibility to yield a different result. The randomly picked data might however be a better representation of data edge cases. It might simulate a user feeding our controllers with unpredictable data better? What are reasons to choose one over the other?


title: How Immutable Sets are Manipulated

text: When working with an immutable set or map, like the ones found in many functional programming languages, operations that would otherwise modify the container generate a new container instead. I know that most list operations in functional languages do not result in a copy of the list and just rearrange pointers. This is why working with lists is extremely efficient. I am curious whether immutable maps are similar or if an entirely new map is created after each operation. I am asking because a library I wrote manipulates a lot of maps and I am curious whether I will see a performance boost if I switch over to immutable maps. Currently, I am just looping over my map adding or throwing away key/value pairs as I go.


title: MVVM Reporting App Approach ? Data Access Layer?

text: I'm trying to follow the MVVM pattern in a reporting / statistics application that I'm making in C# / WPF. I have made many model classes to hold properties as a starting point. Some of these models are made to encapsulate different statistics so that I can present data that can be cross refrenced. I'm thinking the next step is to create a data access layer with classes and methods to connect to a database and grab the values to populate these models. I was thinking of creating a connection and query passing class. Then other classes for each specific set of data that I will need for the models. (constructing queries to pass) From what I understand I will be calling these data access layer methods from the view model to populate instances of my models. Which I will present with the view. Is my approach in theory the correct standard way to approach this problem? Any suggestions? Or Reference Material?


title: Warranty or guarantee clause for code breaking

text: Should I guarantee or add a warranty clause to my contract in the event code breaks or an anomaly occurs outside the client's hand or act of God? If so, what should that language say?


title: How do I improve my ability to manipulate code quickly, not wpm?

text: I have seen several questions on here about touch typing and words per minute but not about improving ones ability to manipulate text using keyboard shortcuts, bindings etc. I have tried putting a **cheat sheet of keyboard shortcuts** next to my monitor but I can never incorporate them in my 'flow'. I have also tried the **'just use vi and don't touch the mouse'** method but that only helps me with navigating code and not editing. I would prefer to use some application (or game) to learn text manipulation. But it looks like nothing like that exists (app idea?). I'm open to other suggestions too.


title: Using some kind of version control when working alone and with small projects?

text: Very often I'm working on small projects only for myself. I'm working on one machine, but recently I thought about using some kind of version control nevertheless. This would have some benefits as for example:   * I don't have to care anymore for local backup   * Mistakes can easily made undone   * History can be maintained But on the other hand it has also some drawbacks like for example:   * Additional resources required   * Time to setup, get used to it, etc. From your experience, is it a good thing to use revision control when your working alone?


title: How long does a Comp Sci degree last?

text: I keep hearing from people that if I don't become a programmer soon after graduation my degree will be a useless piece of paper, they claim it will become outdated. I kind of find this hard to believe considering what I was taught at a fairly good school has been standard practice for some time. So is this a true belief in industry? That somehow I become less desirable after a year or two, even though the graduates who comes after me pretty much get the same identical education.


title: C# Unit Testing In A Single Project

text: Alright, so I'm doing my first "real" C# project. I'm chugging along, enjoying myself, nice little language I've got here, fairly easy to use, la ti da. Then I get to the point that I realize there's no simple way of setting up friend classes for unit testing. Well. This is unfortunate. I dig around and find that I can jump through some burning hoops and expose everything to another assembly with:               [assembly: InternalsVisibleTo("AssemblyName")]      But... this is a fairly minor in-house app that I've just going to a single binary and doesn't really warrant multiple assemblies. What other options - if any - does C# offer?


title: How many different configurations are used for software tests?

text: This article shows that for Android apps, software developers use between 30 and 50 different devices for compatibility tests. I tried to find information about tests of applications on "classic" computers, for example PC games or graphics-oriented business applications: how many different hardware configurations are typically tested in this area?


title: Separating roles authorization and database

text: Something really bothers me about the way authorization tends to be done with roles in ASP.NET MVC. The way it is normally done is that you have a Users table and a Roles table. A User can have many Roles. Then you decorate your controllers/actions with an authorize attribute saying which roles you want to allow access to the controller/action:               [Authorize(Roles = "Admin")]     public ActionResult AdminOnlyAction()     {     }      The problem with this is that your code is reliant on data within the database. Obviously you could, at application start, seed your database with the roles needed if they're not present but there's still a fragile dependency on the data in the database (e.g. it could be deleted, renamed, etc. etc.). Having an enum or similar with the Role levels in instead of storing them in the database seems reasonable but still leaves me with a sour feeling. Is there an elegant alternative which I've not hit upon?


title: How and what should I be (unit) testing for in this method?

text: I am relatively new to unit testing and have a query about what/how I should be testing a certain method. For the following (psudo-c#) method I have created (not a real-life example) what would you test for? Initially, my thoughts would be to test the output with variations on the dictionary of form fields, e.g. valid, invalid, missing values. However I also wonder how you would test to make sure the object values have been changed to the correct value and that the correct email message was attempted to be sent (obviously both services could/would be mocked). I hope what I am asking makes sense, I appreciate this is a subjective question and the answers may be 'it depends' ;)               public bool ProcessInput(Dictionary<string, string> formFields, ObjService objService, EmailService emailService)         {             try             {                        // Get my object id                        int objId;                        if(!int.TryParse(formField["objId"], out objId)                        {                           return false;                        }                             // Update my object - would you validate the save against a DB or a mocked inmemory db?                        var myObj = objService.Find(objId);                        myObj.Name = formField["objName"];                        objService.Save(myObj);                             // Send an email - how would you test to make sure content, recipient, etc was correct?                         emailService.SendEmail(formField("email"), "Hello World");                             return true;                 }             catch(Exception ex)             {             return false;             }         }


title: What to do with bugs that do not repro?

text: I have a tester that while testing will have an error occur (ok so far), but then he frequently reports it right away. We (the developers) then later find that the tester has not tried to reproduce the issue and (when asked) cannot find a way to make it happen again. Now these are still bugs, I don't want to ignore them. But without repro steps I am kind of stuck. Sometimes there is a stack trace (though frequently it is not useful because this is compact framework and there are no line numbers). But when there is one I can take the stack trace and crack open the code and start guessing, but that does not lead to testable "fixes". What do you do in scenarios like this?


title: Programming During a Crisis

text: I'm having difficulty turning this into a proper question, but here goes... Some of you may have heard about the flooding happening in Queensland, Australia. Well, I'm in the inner suburbs of Brisbane right now; the river has been slowly creeping toward my house since Tuesday. When I left for work this morning it was twenty meters down the road when it is normally kilometers away. Within hours of the distater striking, the government already had some pretty good web applications available for people to get information about what was happening and where the flood was predicted to rise. They also set up a database for people to search for the whereabouts of relatives or could register their location for others to see. Has anyone been involved in the development of these kinds of projects before? It's interesting that they could churn out this software in what appeared to be less than a day when the average development house could take weeks at best. In what ways did it differ from a 'normal' project? Any other thoughts?


title: Is it legal for me to contribute to open source software while employed?

text: I work for a large corporation and I want to keep my skills fresh. I think contributing to an open source project would help, especially if I ever want a job at a startup. I have heard that large companies often own any development employees do outside of work. Could I face legal consequences by contributing to an open source project without notifying my employer? Could I be putting an open source project at risk if I contributed to it while employed? If refrained from contributing due to legal reasons and I applied to another company where open source development experience is expected, would they understand or would my application go in the trash bin?


title: Programming Language most relevant to the Financial sector?

text: I am a freshman in college and doing a software engineering/ finance double major. I've been learning programming on my own and have a good bit of familiarity with php by now. I was wondering what you guys think the most relevant programming language is for financial/investment banking use? I have read this thread: Books on developing software for financial markets/investment banks I want to start learning/reading up on a language (the basics not financial/quant stuff) to set a foundation for the future financial/quant stuff.


title: Is Rails 3 ready for use in production?

text: I'm looking to get a snapshot of Rails 3 at this point in time. We're about to start a new long term project, and I'm wondering if R3 is ready for real use. Or, if there are still a lot of bumps to be worked out. E.g. I saw questions about its compatibility with Passenger. (?) Thanks!


title: Why we need Throw-away Prototyping?

text: What is throw-away prototyping model and why do we need it? How does it differentiate from Evolutionary Prototyping?


title: How does the MongoDb licence define "commercial" and "non-commercial" use?

text: I have a question about "commercial" and "non-commercial" usage, also with the usage of MongoDb. Lets imagine we got a website without a business model, the site grows in popularity but still no incomming money. Are we talking about non-commercial at this point? And once the website starts making money, is it allowed to decide at that point to get a commercial license? Thanks for help.


title: Cookie access within a HTTP Class

text: I have a HTTP class that has a Get, and Post, method. It's a simple class I created to encapsulate Post and Get requests so I don't have to repeat the get/post code throughout the application. In C#:               class HTTP     {         private CookieContainer cookieJar;         private String userAgent = "...";              public HTTP()         {             this.cookieJar = new CookieContainer();         }              public String get(String url)         {             // Make get request. Return the JSON         }              public String post(String url, String postData)         {             // Make post request. Return the JSON         }     }      I've made the CookieJar a property because I want to preserve the cookie values throughout the session. If the user is logged into Twitter with my application, each request I make (be it get or post) I want to use the cookies so they remain logged in. That's the basics of it anyway. But, I don't want to return a string in all instances. Sometimes I may want the cookie, or a header value, or something else from the request. Ideally I'd like to be able to do this in my code:               Cookie cookie = http.get("http://google.com").cookie("g_user");     String g_user = cookie.value;      or               String source = http.get("http://google.com").body;      _My question_ - To do this, would I need to have a Get class, and a Post class, that are included within the HTTP class and are accessible via accessors? Within the Get and Post class I would then have the Cookie method, and the body property, and whatever else is needed.   Should I also use an interface, or create a Request class and have Post and Get extend it so that common methods and properties are available to both classes? Or, am I thinking totally wrong?


title: JavaScript client for talking with WCF server with WebSockets binding

text: I'm excited about the possibilities for duplex communication with WebSockets between a web browser and web server. I see that WCF for .NET 4.5 supports a WebSockets binding now, and I know there's a JavaScript API for using WebSockets. However, what I don't understand is how these are supposed to interoperate. Yes, you can deal with raw message passing with the JS API, but there doesn't seem to be any JS library for doing SOAP-based RPC compatible with WCF. Do any of you know if there are any libraries to enable a web browser to call a WCF service using WebSockets?


title: Do all functional languages use garbage collection?

text: Is there a functional language which allows to use stack semantics - automatic deterministic destruction at the end of the scope?


title: Is there a good example of Python code for unit testing an api?

text: Do you know any good example of Python unit testing code for testing an API? Thanks! **Update** :   * Found this very interesting question: http://stackoverflow.com/questions/7336101/testing-rest-api-with-database-backend   * I am especially looking for examples to test a CRUD API


title: Asymptotic running time of for-loops

text: I have this question which I need answered: > What is the asymptotic running time for the following piece of code? >   >   >     if (N < 1000) >       for (int i = 0; i < N; i++) >         for (int j = 0; j < N; j++) >           A[i] = j; >     else >       for (int i = 0; i < N; i++) >         A[i] = i; >   > >   1. logarithmic in N >   2. linear in N () >   3. linearithmic in N >   4. quadratic in N > And the correct result is “ _2. linear in N_ ” which I can't figure out why, since that as far as I've understood, we want to accept the worst case>best case. The worst case here is that the if statement is run and the time would then be quadratic in N. I am aware that we're trying to find some kind of average of more attempts, but how can I know what the value of N is? If N is really high (10000), it's obviously the else statement that is run most of the times. But can we assume this or have I misunderstood something?


title: Implementing a modern web application with Web API on top of old services

text: My company has many WCF services which may or may not be replaced in the near future. The old web application is written in WebForms and communicates straight with these services via SOAP and returns `DataTables`. Now I am designing a new modern web application in a modern style, an AngularJS client which communicates with an ASP.NET Web API via JSON. The Web API then communicates with the WCF services via SOAP. In the future I want to let the Web API handle all requests and go straight to the database, but because the business logic implemented in the WCF services is complicated it's going to take some time to rewrite and replace it. **Now to the problem:** I'm trying to make it easy in the near future to replace the WCF services with some other data storage, e.g. another endpoint, database or whatever. I also want to make it easy to unit test the business logic. That's why I have structured the Web API with a `repository layer` and a `service layer`. The repository layer has a straight communication with the data storage (WCF service, database, or whatever) and the service layer then uses the repository (`Dependency Injection`) to get the data. It doesn't care where it gets the data from. Later on I can be in control and structure the data returned from the data storage (DataTable to POCO) and be able to test the logic in the service layer with some mock repository (using Dependency Injection). Below is some code to explain where I'm going with this. But my question is, does this all make sense? Am I making this overly complicated and could this be simplified in any way possible? Does this simplicity make this too complicated to maintain? **My main goal** is to make it as easy as possible to switch to another data storage later on, e.g. an ORM and be able to test the logic in the service layer. And because the majority of the business logic is implemented in these WCF services (and they return DataTables), I want to be in control of the data and the structure returned to the client. Any advice is greatly appreciated. **Update 20/08/14** I created a repository factory, so services would all share repositories. Now it's easy to mock a repository, add it to the factory and create a provider using that factory. Any advice is much appreciated. **I want to know if I'm making things more complicated than they should be.** So it looks like this: **1. Repository Factory**               public class RepositoryFactory     {         private Dictionary<Type, IServiceRepository> repositories;              public RepositoryFactory()         {             this.repositories = new Dictionary<Type, IServiceRepository>();         }              public void AddRepository<T>(IServiceRepository repo) where T : class         {             if (this.repositories.ContainsKey(typeof(T)))             {                 this.repositories.Remove(typeof(T));             }                  this.repositories.Add(typeof(T), repo);         }              public dynamic GetRepository<T>()         {             if (this.repositories.ContainsKey(typeof(T)))             {                 return this.repositories[typeof(T)];             }                  throw new RepositoryNotFoundException("No repository found for " + typeof(T).Name);         }     }      _I'm not very fond of`dynamic` but I don't know how to retrieve that repository otherwise._ **2. Repository and service**               // Service repository interface     // All repository interfaces extend this     public interface IServiceRepository     {     }          // Invoice repository interface     // Makes it easy to mock the repository later on     public interface IInvoiceServiceRepository : IServiceRepository     {         List<Invoice> GetInvoices();     }          // Invoice repository     // Connects to some data storage to retrieve invoices     public class InvoiceServiceRepository : IInvoiceServiceRepository     {         public List<Invoice> GetInvoices()         {             // Get the invoices from somewhere             // This could be a WCF, a database, or whatever             using(InvoiceServiceClient proxy = new InvoiceServiceClient())             {                 return proxy.GetInvoices();             }         }     }          // Invoice service     // Service that handles talking to a real or a mock repository     public class InvoiceService     {         // Repository factory         RepositoryFactory repoFactory;              // Default constructor         // Default connects to the real repository         public InvoiceService(RepositoryFactory repo)         {             repoFactory = repo;         }              // Service function that gets all invoices from some repository (mock or real)         public List<Invoice> GetInvoices()         {             // Query the repository             return repoFactory.GetRepository<IInvoiceServiceRepository>().GetInvoices();         }     }


title: Common header file for C++ and JavaScipt

text: I have an app that runs a C++ server backend and Javascript on the client. I would like to define certain strings once only, for both pieces of code. For example, I might have a CSS class "row-hover" - I want to define this class name in one place only in case I change it later. Is there an easy way to include, or read, some sort of common definitions file into both C++ and JavaScript? Ideally as a compile / preprocessing step but any neat approach good.


title: Asking people to disable Java for security - what's next for developer?

text: I don't know what best to give as title to this so pardon me if it sounds weird. I saw this question asked on IT Security and another site asking people to disable Java from their system or browser because it's vulnerable. As a lover of Java, though currently doing C#, I would love to still do more Java in future, but this news is giving a bad name to the good old Java. Wouldn't this drive developers like me away from Java? Wouldn't it spell a bad name for Java among developers and prospective clients?


title: What does the term "fast follower" mean?

text: In the last few days, I've heard the term "fast follower" mentioned several times. It's used in the context of an unresolved bug/issue that (supposedly) will be quickly fixed and implemented. Is this some new corporate jargon? I'm aware of a fast follower strategy, or second mover strategy (as described in this wikipedia article), but that doesn't apply in the context.


title: Automatically propagating changes

text: When working on multiple similar projects there are often changes that can't be extracted into a library, but should be applied to most of the projects. I mean changes like a modified directory structure, some common configuration, similar ui code, etc. The most basic strategy is to copy a new project from the last finished one and throw out the business logic. The problem is that the improvements to the newest project won't move back to the older ones. A slightly better strategy is to set up a boilerplate repository, clone every new project from it. Then the reusable bits can be extracted form the newest project into the boilerplate and then pulled to the older projects. Of course, merging might be complicated, but I've had this strategy work quite well for me. Pushing the changes is still too much work though. Is there a strategy to automate propagation of _some_ changes across multiple projects?