title: What language/framework/workflow sets do you recomend for a small office?

text: I work in a small office (only 1 designer, me and plus 1 programmer). We have a solid background in classic ASP development and some sort of a small proprietary framework/cms based on ASP + MySQL + Javascript written line by line in here and the projects aren't so big until now and we want to step up with something more fast and secure way to develop without reinventing the wheel (again). I have a little knowledge in PHP and .Net (C#) from some particular projects and personal learning. We have researched various languages and frameworks, as well as some new (to us) methodologies like TDD and some version control oriented workflows with GIT, etc. Until now we have thought in PHP with some framework like CodeIgniter or Kohana and ASP.net (C#) with MVC 3, since I can start from some knowledge I already have and maybe adopting GIT as our version control system for the bigger projects. We need some advice in getting a new set of skills and tools that work the best for us before getting 1 by 1 and trying. **EDIT: What we need to change(maybe)**   As you can imagine, we don't have a testing process like TDD or BDD and the testing is done very breafly (We have luck with so little problems after release) nor a real idea of how to use it (need more study and clarification). We use Dreamweaver most of the time to code and need a more fast and robust development environment with an autocomplete feature like MS Intelisense and nice highlighting (I personally like to write code and have used the notepad to write almost all of my first apps, but in a profitable work with a short deadline we can't go this way. Not that Dreamweaver is bad, but it's too general and lacks some features). I know that security is a thing to see at the programmer side, but there's plenty of frameworks with features that helps in this case and now we have a very basic and limited set of tools written by us to do this (poor SQL injection protection, etc). Our "version control" is purely based on a network share and our machines. The final version is always the one in our file server and most of the time, when we have to make some changes, we change the files directly and upload them again. A backup of this share is made each 2 or 3 months. We are growing up and expect to hire someone soon. Its hard to find a VBScript programmer for ASP and when we find one, the salary is to high for us by now because nobody is learning it in this days and who knows already have a job with a good one. **Final concerns:** We've decided to use ASP.Net(C#)/MVC as our primary framework and use CodeIgniter as an alternative to linux servers and other projects. Thinking in joining some MS program for startups and small business to help with some costs. We're getting Git as our vcs in our private file server for the origin and instances in each develop machine for us to clone, work and push back. We also considering a service like Bitbucket to maintain a copy on the cloud. If some of you have any more advice or other thoughts about this I'll follow- up. I would like to thank you all and mark many of the answers as right but I can't. I think this question may be a base of reference for small offices like us to get some points and help on the same decisions.


title: Name of my software similar to name of an other program

text: I am going to write some software. I'd like to call my software X-former (from XML + transformer). But there is already Xformer emulator. (My software is not related to emulators.) Taking this into account, is calling my software X-former: a. legal; b. ethical?


title: Is there a way to avoid type-checking in this scenario?

text: I have a class `SuperClass` with two subclasses `SubClassA` and `SubClassB`. I have a method in a different class which takes a `SuperClass` parameter. The method should do different things depending on the type of the object it receives. To illustrate:               public void doStuff(SuperClass object){         // if the object is of type SubClassA, do something.         // if it's of type SubClassB, do something else.     }      I want to avoid type-checking (i.e. `instanceof`) because it doesn't feel like proper OO design. But I can't figure out how to employ Polymorphism to elegantly solve this problem. How can I solve this problem elegantly?


title: Algorithm to match items be value into sets base on total

text: Given n sets of items. Each item has a value. The items in a set have similar values but vary by a small amount. The goal is to create new sets containing three items selected from the original sets such that the total of the values is within a given range. Only one item a source set can be selected. For example: If we have the following starting sets:   * Set A - { 4.0, 3.8, 4.2 }   * Set B - { 7.0, 6.8, 7.2 }   * Set C - { 1.0, 0.9, 1.1 }   * Set D - { 6.5, 6.4, 6.6 }   * Set E - { 2.5, 2.4, 2.6 } Goal is to create sets containing three elements such that the total is between 11.9 and 12.1.     * For example { 3.8, 7.2, 1.0 }   There can be unused elements. Can someone suggest an algorithm for this problem?


title: Over normalization in database

text: Currently I am working on creating a new database schema as part of a major new product. Our previous customer address records (in a previous product) look something like this in our current schema (not all columns shown):               AddressID, AddressLine1, AddressLine2, City, State. Zip, Country, Etc.      I want to normalize this so that an address actually breaks down to:   * 1 address to many address lines    * 1 address to a zip/postal code So, I sent out a communication saying that zip code will now be in its own table and that each "address" corresponds to one zip/postal code. Also addresses would be broken out so that we could support more than 2 address lines with a 1 to many relationship. Some people in my group are now saying that I am over normalizing the database. Am I? Note, I am not a DBA but I feel that this is more logical and more efficient than the previous schema. **UPDATE** Thx to everyone for thier input. I'm not going to break out the address or zips to thier own tables. My original plan was to have a zip code lookup and re-use for the addresses so I would only have to have one set of zips, but I'll just drop everything on the record itself, and have a separate table for zip lookups.


title: MVC to create desktop and mobile webapps?

text: I'm planning the creation of a webapp with a dedicated mobile web interface and a dedicated desktop/tablet interface. I am considering ASP.NET MVC, but it is clear to me that MVC is for separation of concerns as explained here, anyway in my case i'd like to minimize the code and to support elegantly phones and desktop (may be landscape tablet can be "desktop" too). So is MVC a wise choice in this case or which is the 1st stop for this kind of xdevice web app?


title: Image strategy on Android

text: I am creating an application with lots of photos. They will take `> 100 mb` on memory. So far I have 3 ideas: >   1. Place it in `@drawable` \- app will be heavy >   2. Download by JSON and place in java array - caching - How long it can be > there? >   3. Download by JSON, place it on phone memory/SD card and read in the > application from memory. User can Remove pictures. > The best option will be to give possibility to user if he want to have a pictures or not. What strategy is most efficient and recommended?


title: "Pretty good" WPF/Winforms programmer interviewing for ASP.NET job

text: I have 5 years of experience writing WPF and WinForms applications. I solo wrote the software and thing always turned out well, and the company I work for has happy customers. Plenty of SQL, EF, LINQ, etc along the way. Things look nice to boot. I know zero ASP.NET. Neither my job nor personal projects have let me to work with it. Tomorrow I have an interview for a job that is for an ASP.NET/MVC/WPF/WinForms developer, though I gather from my recruiter that they like to ask about ASP.NET specifically. Now my question is, what exactly are my strengths here? I know I have a good amount of skills, but will they translate well going to ASP.NEt, in that I should act confident that I could pick it up quick on the job since I learned the other technologies? Any other advice? For comparison's sake, while I feel that I have a good handle on and am "pretty good" at WPF programming, it took me a while to get the hang of it coming from WinForms. I feel that if an employer had kept a close eye on me during that time, they wouldn't have been impressed. Any thought? Thanks!


title: Looking for a book, blog or feed about anti-patterns

text: In my experience, being familiar with anti-patterns is as vital as knowing patterns themselves. Despite an abundance of literature on patterns, there is a surprising lack of literature on anti-patterns. Browsing the web usually reveals advises that are either too vague (e.g. " _do not use global variables_ "), too specific (e.g. " _java.lang.Boolean.getBoolean doesn't do what you think it does_ ") or obviously wrong to begin with (e.g. _God object_ ). What I am looking for are anti-patterns that appear to be good solutions at first glance, but tend to lead to issues further down the line. Do you know any good source of such anti-patterns? (the only good example I know is SQL Antipatterns)


title: confusion understanding the fluid 2 column navigation layout

text: I'm trying to understand the following cross-browser layout: http://matthewjamestaylor.com/blog/perfect-2-column-left-menu.htm but I'm having some confusion with some of its parts and there isn't enough information on the page or in the css comments to help me.     * What is the purpose of the .colleft div? Why can't the 2 columns be directly under the .colmask container?   * Why does the .colleft div have a right 75%? I don't understand its purpose/benefit.   * Why don't the widths of .col1 and .col2 add up to 100%?   * How was left:102% calculated for .col1 and left:6% for .col2? The comments for this are not very clear to me. How is it any different from not even specifiying a left/right css property?


title: Should ** bind more tightly than !, ~?

text: Designing a programming language, I'm including the `**` exponentiation operator. In Fortran and Python, the two languages I know of which have this operator, it binds more tightly than unary minus, which makes sense for practicality as well as tradition. It should bind more loosely than the prefix increment operator `++` because the other way wouldn't make sense. Thus the usual single precedence level for the prefix unary operators gets split in two, which is fine as far as it goes. I'm also including the logical and bitwise _not_ operators `!` and `~`. Which side of the split should they fall on? Should they bind more loosely or tightly than `**`? I haven't been able to find either objective reason or relevant precedent for either choice. Is there any of either that I'm missing? Failing that, which would people find less surprising?


title: Add a second developer to the team

text: In my company, I'm the only developer, but we plan on expanding the team by hiring a second programmer. I know there are a lot of implications to that (especially around source control). I've Googled a lot, but haven't found a good tutorial/article on how to grow the team from one to many developers. Do you have any resources that we could make use of?


title: Why are most websites optimized for viewing in portrait mode?

text: I simply cannot figure this out. Almost all monitors have an aspect ratio where width is much bigger than the height and yet almost all websites are designed exactly for the other way round? I am not really a web developer and am just experimenting stuff at the moment but this madness baffles me!!! Edit: The point is not that I would like to limit the height of a website. The point is that I'd wat it to somehow fill all available space when I have my 1920x1080 in landscape mode. Edit 2: See this to understand what I am saying ![enter image description here](http://i.stack.imgur.com/t6tGR.png)


title: What is the development process like at Google?

text: What tools do they use? What processes? What rules do they have regarding code? How do they test their code?


title: Writing unit test only for applications that requires them

text: Bit of a rant, but bear with me. People call me purist. I do not code in any way other than TDD. When I try to push TDD as a company policy, the following conversation: company owner: "we'll do TDD when the project warrants it"   me: "if you can't do TDD on even small/simple projects, you won't suddenly know how to do it for big projects. Also if a project is small/simple. the so- called cost of unit test should be negligible".   company owner: "all the devs here know how to do TDD, they'll do it when required". That last sentence struck me as complete B(each) S(and). My argument is if a dev "choose to do TDD when he's told it's required". He's doing it wrong and he has no clue about unit test/TDD. Unit testing is like my left hand and my code is like my right hand. Yeah sure I can just use my right hand. It'll just do things wonky and slower. Do I have my head too far up my @$$? I just have a hard time believing a dev who does TDD fluently would prefer not to do it. (For a whole application) Edit- I'm not talking about whether TDD/Unit testing is/if/how/when required and its benefit. It's a dead horse. I'm talking about now that I do it day in and day out, I feel uncomfortable NOT doing it. I just want to know if it is a healthy mentality.


title: Apply filter only if not null

text: My function takes an optional parameter, `type`, which is used to filter through a collection. However, the filter should only apply if the parameter is passed in (in other words, non-null). If the filter is not passed in, it should not be applied. How can I write my logic to reflect this? What I have now is -               if( other conditions && ( Type == null || (Type != null && Order.Type == Type ) ) )         return val += Order;      But this feels clunky and wrong. Is there a way I can simplify my logic here?


title: What is the significance of the Salesforce platform to a developer?

text: I decided to learn Salesforce (without any knowledge of this platform) and so far it just seems that I can simply store JSON objects into the cloud... similar to OData + Microsoft SQL or Azure Table storage.   * Link to Salesforce REST API Is my understanding over-simplified, or what additional value does Salesforce provide to the developer?


title: Integrate NuGet Package Restore feature into checkout process

text: There are some situations where I have no internet connection and so I am forced to work offline. Usually it would look like this: I get connected, do a checkout from source control server, and move out of office. The NuGet packages stay on the server, because I have enabled Package Restore and should have opened Visual Studio and fired a build at least once, to download them. Before using NuGet we had the package management integrated using SVN externals. The required assemblies were automatically downloaded during checkout. But this system has some limitations, I'd like to get rid off. The prefered way to use Package Restore would be to execute it on checkout or update. Is there a way doing so, using hooks for SVN (TortoiseSVN) or GIT (TortoiseGIT, Github for Windows) as version control system?


title: Simple straight-line path algorithm

text: I need a simple pathfinding algorithmn to go from point A to point B. A* seems like an overkill because It doesn't matter wheather I hit walls or not and there's no terrain. I was wondering if there was a simpler one which would find a direct path(a straight line) from point A to B.


title: cakephp admin panel, different controller for different group of tasks or one for all?

text: I am writing an admin panel in cakephp I got a question the panel will have the functionality to add items to the main website (images specifically) so I am wondering if I should put all the functionality (add,edit,view,delete) to the main admin controller or should I make a different controller for that? As the admin panel will most likely be extended with more features such as adding new users, modifying them etc. What do you recommend?


title: What is a good code practice of when to make a function/method for small repetitive code segments?

text: Many times throughout writing larger programs I have questioned after how many copy and pastes does it make sense to put the code into a function or method and what is a good rule of thumb? I have been using a rule of thumb of four lines or greater and appearing more then twice, then I make a simple function / method containing that code. Can you think of a better practice or offer any pointers? This is more of a general design pattern question rather then a language specific question.


title: Is return-type-(only)-polymorphism in Haskell a good thing?

text: One thing that I've never quite come to terms with in Haskell is how you can have polymorphic constants and functions whose return type cannot be determined by their input type, like               class Foo a where         foo::Int -> a      Some of the reasons that I do not like this: **Referential transparency:** "In Haskell, given the same input, a function will always return the same output", but is that really true? `read "3"` return 3 when used in an `Int` context, but throws an error when used in a, say, `(Int,Int)` context. Yes, you can argue that `read` is also taking a type parameter, but the implicitness of the type parameter makes it lose some of its beauty in my opinion. **Monomorphism restriction:** One of the most annoying things about Haskell. Correct me if I'm wrong, but the whole reason for the MR is that computation that looks shared might not be because the type parameter is implicit. **Type defaulting:** Again one of the most annoying things about Haskell. Happens e.g. if you pass the result of functions polymorphic in their output to functions polymorphic in their input. Again, correct me if I'm wrong, but this would not be necessary without functions whose return type cannot be determined by their input type (and polymorphic constants). So my question is (running the risk of being stamped as a "discussion quesion"): _Would it be possible to create a Haskell-like language where the type checker disallows these kinds of definitions? If so, what would be the benefits/disadvantages of that restriction?_ I can see some immediate problems: If, say, `2` only had the type `Integer`, `2/3` wouldn't type check anymore with the current definition of `/`. But in this case, I think type classes with functional dependencies could come to the rescue (yes, I know that this is an extension). Furthermore, I think it is a lot more intuitive to have functions that can take different input types, than to have functions that are restricted in their input types, but we just pass polymorphic values to them. The typing of values like `[]` and `Nothing` seems to me like a tougher nut to crack. I haven't thought of a good way to handle them. I doubt I am the first person to have had thoughts like these. Does anybody have links to good discussions about this Haskell design decision and the pros/cons of it?


title: Breaking down a complex story at project start

text: I'm trying to get to grips with agile project management (with Pivotal Tracker) but keep finding myself running into walls when trying to define the first few stories of a project. Take for example this very simple story: "A user should be able to tag a product" Assuming I've already defined "product" elsewhere, this story would possibly involve writing a polymorphic tagging system under the hood, on completion of that system id be able to finally add the ability to tag a product. My problem is with the amount of work hidden in this story. I can define tasks to get the story done but stories as a whole are supposed to be 1-2 days work? I don't feel right about the story just revealing the tip of the iceberg but that's the only part that relates to the User. How do you overcome this kind of thing? What are the best practices? **UPDATE 25/08** Thanks to everyone for your guidance, I've taken all advice onboard on how to define stories. I am now switching to Jira Grasshopper which has better support for tasks within stories (assignment, estimates etc) and tracking of development tasks once the sprint has began.


title: What database structure is suitable for tracking File audits?

text: I need to track permissions and access requests to a file server in a database. I'm given the full path of the folder and am considering parsing the path (splitting on the "/" character) and creating a self-referential link to the table... in addition to a column intended to store the full file path. What is the ideal approach for dealing with such a system that can have a tree of folders and having a database schema suited for that purpose? Is self-referential columns overkill?


title: What is a *slightly* less extreme equivalent to being "fluent" in a language?

text: tl;dr: What is a less extreme (but still noticeable) alternative to the word "fluent", when saying e.g. "I am fluent in C++/Python/whatever?" * * * I think I can call myself "fluent" in C#, because I know the language and runtime very well, and I'm very familiar with the .NET framework's APIs and classes, etc. I would _like_ to claim the same thing for Python and C++. But while I _can_ program in Python (I did so for an entire summer, making a website with Django), for example, I would not call myself _fluent_ because **my code isn't always "Pythonic"** (e.g. using `map`/`filter` vs. list comprehensions), and I'm not too intimate with some aspects of the language and standard library yet (e.g. the introspection API, etc.). Is there a word or phrase I can use on e.g. a resume to describe what I know? I can think of "very familiar with", but is there a better word/phrase I can use?


title: How long can a programmer concentrate in a day?

text: There is this question ( which is now closed as _not constructive_ ) that asked about the average productivity per day. My question is, is there any scientific study on the productivity of programmers? I can't help but feel that doing 8 hours of quality programming work from Monday to Friday consistently is very hard. And if yes, is there any literature that investigates this?


title: Is there a guide for software development to design efficient hotkeys for actions?

text: I don't know how to word this easily but basically the software I am writing has a ton of actions and I want to assign hotkeys to every one of them so power users can work super fast. First off they are not actions related to the application itself, i.e. Quit, Maximize Window, About, Preferences, etc. But rather actual operations you perform on the data set. It's not exactly the same but closest example I can give is the Nuke compositor, where each action is represented by a node. So things like Blur, Sharpen, Add, Color Correction, Keylight, etc. But since the number of nodes are over 500, I don't know how to create easy to remember hotkeys that do not use every modifier key combination. Is using 2 key combo, i.e. CC for Color Correction the best way? Are there resources on this subject? Basically maximizing the use of hotkeys to take working speed to the max without having to remember 1000s of key combinations. ![enter image description here](http://i.stack.imgur.com/icbaH.png)


title: Lowercase in Linux file names

text: As I find that UpperCase are really readable for first letter word separation in long complex names, I tend to give some of my Linux files names with some UpperCase. Mostly executables, some directories too. But it's been a few weeks I have remarked that the huge majority off all file names in my linux distrib are lowercase... So I made some googling a moment ago, and I found this article: Linux File Names, that states one should _always_ use lowercase in the unix world, > ...It's best to _always_ use lowercase in Linux unless you can think of a > good reason to use uppercase or mixed case. Most Unix people use lowercase > almost exclusively, but aside from this "cultural" point, there's another > good reason to use lowercase. If you're sharing or accessing a DOS file > system with Linux, DOS will not be able to see the files that have uppercase > or mixed-case file names... Is that really the case?


title: Universal means of describing what functions a library should expose

text: I am busy with a hobby OS and I am planning on making the project open-source and eventually have support for multiple platforms. With this in mind I have taken the approach of putting all hardware specific code in a separate Hardware Abstraction Layer (HAL) library so that the kernel does not need to know how the specific hardware handles things such as memory and interrupts. The kernel will just call the HAL function asking for some memory or to hook an interrupt by calling `hal_memory_malloc(...);` and `hal_interrupts_hook(...);` respectively. My question is, I would like to know if there are any universal means of describing what functions the library has to expose if a developer wants to port the HAL to another platform. Seeing the Kernel knows the name of the function because it's in the kernel's header files the library just needs to have a function with that specific name in it. As the kernel I don't care how your function works as long as its there and I can call it. _**Edit_** My kernel and library is written in C so the library will be a normal statically linked libray At the moment I have a Word Document that has a diagram showing the different functions but this is going to become a mess soon. Any advice would be greatly appreciated.


title: Should I store "system b" password in "system a"?

text: I am developing a system for mailing which has a account id/password to login and I need to store the smtp server account and password for sending mail. Since the mail is auto send I can't request the user input password/id each time when sending. Therefore, is storing the user account id/password (system b password) in my system (system a) insecure design? How can I improve this?


title: Does this implementation of the state pattern make sense?

text: I have the task to implement the state pattern in one of my classes. The assignment referenced a suggested implementation, and upon reviewing that implementation I was confused since I believed it to be nonsensical for most applications and frankly simply bad from a design point of view, since it completely dismisses some very basic design principles of software code. This is the class diagram of the suggested implementation: ![enter image description here](http://i.stack.imgur.com/mexgp.png) I wonder: What is the use of this implementation? It (imo) clearly violates the two main design principles of software engineering: Make things easily maintainable, and easily extensible. In my eyes, this implementation has zero easy extensibility(you have to change the source of at least two classes, for example, to implement a new state that you forgot about when first implementing it). The coupling between this code and client code seems to be huge. If you remove anything in this pattern, all client code will break. If you want to add anything, you have to change all client code in order to adapt, for example, a new state, because new states can only be entered via the enter() method of the concrete state, or by directing injecting them into the Controller using the changeState() method. As a bonus, you can only have one garage door in the entire world, since the states are practically singletons. The enter() method in the concrete states was given as this:               public static State enter(Controller c) {     if(m_instance == null) m_instance = new <<concreteStateName>>(c);     return m_instance;     }      Or you can have multiple garage doors, which all open simultaneously if you open one. Why would you put all methods in the abstract State class? Where's the polymorpy? Why do concrete states have either empty or exception throwing versions of methods that have nothing to do with their state (for example, the resulting interface of Opened will have a "lock()" method, even though you can't directly lock the garage door when it's open. You have to close it first). Why not choose a single method and implement it differently in the concrete States, making the thing easily extensible again? It is also (again, as far as I can see) not really maintainable without a lot of troubles. What if you, after a couple of months of using the garage, decide that one state is in fact not only obsolete but wrong? You're going to have to take it out, and the according method in State() with it, breaking the entire code base that uses this implementation. This is a garage door with four states. I wouldn't want to work on that thing if it had any more states. The situation gets more confusing when I look around the internet: The pattern actually seems to be implemented exactly this way a lot of times (for example it is implemented like this way in our national Wikipedia (German)). The actual question: Am I missing anything or is this simply bad? Since this is so widespread, I'm thinking that I might be missing something obvious here.


title: Is it fine to use logs in the Helper Methods?

text: I have been doubting for a long time whether or not to have a logger in methods (usually helper methods) like the one below. Whether we can print it in the method or print the response where the method is called.               public String getAddNewUserUrl()     {         String url      =   null;         String mode     =   null;         try         {             log.info("Inside getAddNewUserUrl "); // Can u use logs like this.             mode        =   new ModeUtil().getMode();                  if("local".equalsIgnoreCase(mode) || "staging".equalsIgnoreCase(mode))             {                 url     =   ResourceBundle.getBundle("ApplicationResources").getString("staging.url");             }             else             {                 url     =   ResourceBundle.getBundle("ApplicationResources").getString("staging.url");               }             log.info("The url is  : " + url);  // Can u use logs like this              }         catch(Exception e)         {             e.printStackTrace();             log.info("Exception in the method getMode ::"+e.getMessage());         }         return url;


title: Should data be stored to local database in Android when heavily using REST services?

text: Let's say I have an application that has constantly changing data. Changes are so frequent that you basically need to refresh data every time you open some screen and keep refreshing it. Is it worth implementing local database for such application? Implementing database in such application seems redundant because:   * Data structure might be complex (arrays, optional parameters and etc) and so using cursors is not a very efficient way to pass it around   * Data does not need to be stored for long time   * If optimized to request filtered data in certain screens (to reduce data traffic), must make sure to filter database updates in such way that unfiltered data (which might be used by other screens) is not affected. Not that hard but still something to develop (and test) However, implementing local database might mean faster navigation. But again, that's not true if service requests are highly optimized to avoid sending redundant data. Do applications like Play Store, Facebook, Google+ use local database to replicate data structures stored in remote database? **I just wanna know what is the common practice for developing applications heavily based on web services.**


title: Erlang web frameworks survey

text: (Inspired by similar question on Haskel) There are several web frameworks for Erlang like Nitrogen, Chicago Boss, and Zotonic, and a few more. In what aspects do they differ from each other? For example:   1. features (e.g. server only, or also client scripting, easy support for different kinds of database)   2. maturity (e.g. stability, documentation quality)   3. scalability (e.g. performance, handy abstraction) main targets Also, what are examples of real-world sites / web apps using these frameworks? EDIT: Starting a bounty in hopes that it will get some conversation going


title: JUnit Testing in Multithread Application

text: This is a problem me and my team faces in almost all of the projects. Testing certain parts of the application with JUnit is not easy and you need to start early and to stick to it, but that's not the question I'm asking. The actual problem is that with n-Threads, locking, possible exceptions within the threads and shared objects the task of testing is not as simple as testing the class, but testing them under endless possible situations within threading. To be more precise, let me tell you about the design of one of our applications: When a user makes a request several threads are started that each analyse a part of the data to complete the analysis, these threads run a certain time depending on the size of the chunk of data (which are endless and of uncertain quality) to analyse, or they may fail if the data was insufficient/lacking quality. After each completed its analysis they call upon a handler which decides after each thread terminates if the collected analysis-data is sufficient to deliver an answer to the request. All of these analysers share certain parts of the applications (some parts because the instances are very big and only a certain number can be loaded into memory and those instances are reusable, some parts because they have a standing connection, where connecting takes time, ex.gr. sql connections) so locking is very common (done with reentrant-locks). While the applications runs very efficient and fast, it's not very easy to test it under real-world conditions. What we do right now is test each class and it's predefined conditions, but there are no automated tests for interlocking and synchronization, which in my opionion is not very good for quality insurances. Given this example how would you handle testing the threading, interlocking and synchronization?


title: How to start a Software Company

text: I've always been interested in wondering how software companies happen. I find it extremely difficult once you're tied down with car, house, life etc. Funding is always the biggest concern. To make this a bit more specific, I see two types. Those offering a _product/service_ or those offering a _consultancy_ company. One things that bugs me about the product/service kind is that we all know how burning the candle at both ends is extremely exhausting. Coding for 8-10 hours in the day and then code in the evenings on your own stuff, doesn't last long. No matter how passionate you are about your idea, simply put, coding day and night is a recipe for burn out. Is this a defeatist attitude though? Can it be balanced? A consultancy kind isn't as tricky in my honest opinion. I think once you have spent years and years in the industry building up relationships, contacts from contracting or moving around, and of course, being involved in the community, then landing your first project as a consultant I'm sure is easier than the product/service kind. I'd imagine friends then could join you as you take on bigger company projects, like an Agile implementation or TDD training, then off you go gaining bigger things. Could you please specify which company type you're answering if you can't contribute to both. I'd like to hear everyone's experiences or ideas on any level for software company start-ups.


title: annual goal for programmers in IT company

text: As IT manager what goals would you set for your programmers in your team. These goals would be used in the annual performance review. Any recommendations? How would you create goals that actually measure programmers technical abilities.


title: Posting High Salary in Job Ad for Programmer

text: Would posting a high salary on a programmer job advertisement encourage strong candidates and weed out lesser candidates? The salary would be relative to the position. Edit: Maybe it wouldn't alter your application, but would you have any concerns or does this raise any red flags? It wouldn't make them seem desperate?


title: What is the best way to scale a CQRS system?

text: In the previous months I have been asking a lot of questions concerning the architecture of an application I'm working on. Thanks to the answers the architectural design has changed - in fact, it has really been simplified as shown in the following graph: ![architecture](http://i.stack.imgur.com/ELCA8.png) Internally I have a two services ( **NOT WCF!** ) that follow CQS principles. It means that the query service simply returns database views; while the command service has a full domain model that contains all business logic, and repositories to access the database (no event mechanism or other complex pattern here). Both services use the same database. These services are class libraries, NO WCF services, because they are used only internally so I don't need the overhead of WCF (don't distribute your objects, Martin Fowler's first law). These internal operations are used by the ASP.NET MVC site and the PartnerService. This PartnerService is a WCF service, which exposes the functionality I would like to be exposed to partners. If I ever need to scale because of high traffic, I could add web servers and/or migrate parts to a full CQRS system (my contracts are already designed for it). Does anyone see any problems with this? One thing I see is that if the query or command service changes, this impacts both the web site and partner service directly, so I have to deploy the changes to both. But I don't know if this is an issue...? Any feedback is appreciated! Thanks!


title: How do I manage multiple relationships from a software design perspective?

text: How do I go about managing projects when there are two fundamental relationships that need to be maintained? The most obvious example that I can think of would be a firm doing some kind of location-based consulting. I've been wracking my brain on how to explain this, in essence, this is the bullet point version:   * Each client that has multiple locations   * There are several projects that relate to specific client locations   * There are deliverables for these projects      * Each deliverable my only relate to a few locations the project is linked to The system seems to break down when you overlay these two main relationships; a client with multiple locations which have projects assigned to them, and deliverables that link back to individual locations. You just end up with too many many-to-many relationships that are difficult to manage. The problem is then visualizing this in a system. You have a client record with location sub-records. Each location record has many project records associated with it. Each Project record has deliverable records, and then those deliverables relate to specific loations. I realize that this seems a bit estoeric, but is there a way to simplify this so that it is visually understandable?


title: clojure/erlang/go for high volume server

text: I have a project that will need to handle 1000s of requests a second with a decent amount of processing for each. For the most part, the processing will be done on a list of items, basically filtering it and returning a smaller list. This process can be done in parallel fairly easily and I should also say, speed is important. I've narrowed my language of choice for the project down to clojure, erlang, and go, and have researched them all to a moderate degree. My question is, what factors should I be looking at in my decision? What language is better for what (examples would be great)? Because it's a little difficult for me to tell.


title: Cheerp -- C++ for web: advance or regression?

text: Recently I've run into Cheerp, a C++ to Javascript compiler, which uses a modified version of clang to generate Javascript code from C++ sources. That makes me wonder: why in the seven kingdoms would someone do this in their right mind? I mean: why would you take a language that is not designed for web at all, that is far more convoluted and bureaucratic, write your code and then compile it into Javascript itself? Can anybody see any advantages in doing so? We surely can discard performance as a reason, because in the end it generates pure Javascript code. Is there anyone here that have real experience with this? P.S.: I'm not sure if this is an on topic question, but this is the most general forum about programming that I could find in the StackExchange network. ## Edit Although this seems like a subjective question, it is not. I am asking for reasons why this tool could be useful. I got interested at first, but started wondering why would someone use it.


I am a solo developer working on a decently small project with about 3 other people (non-developers). These other people are involved in the project in non-development ways and one is also my manager. Everyone is pretty open to ad hoc discussions, too. My manager just gave me what seems like a dream come true - I was tasked with determining what meeting structure would work best for the project. This seems like a wonderful way to deal with meeting overload and/or pointless meetings. With great power comes great responsibility, as now, if I suggest something which ultimately results in much wasted time it's my fault. I have never had such a blank slate to think how I would structure meetings. My thoughts are:   * Daily "touch base/status update" meeting for 15min or less (similar to standup meetings) to communicate daily objectives and review previous day. Or, it seems I could just get a whiteboard and put it at my desk to communicate this info.   * As needed meetings to make specific decisions or address questions any of the team has ... I don't see the need for a weekly "status" project meeting. I'm also not sure the second bullet would require many formally scheduled meetings. My concern is these "developer focused" (ie me) might cause alienation with others or make my manager feel a loss of control on the project, as this structure would be considerably different than most projects are run. What project meeting structure should a single developer choose? * * * Addressing comments: > What are the other people contributing? Are they the intended users of this > project? Working on non-development aspects of it (such as website themes & > images or a DBA, or QA testing)? Other levels of management/administration? They are some of the eventual users and are interested in the overall workflow. They are also contributing to several areas of forms/documents (the format of which will not affect any development work). > Are you able to get feedback from the other two members? Some managers need > to have a regularly scheduled meeting or they'll never be able to fit it > into their schedule. Getting time does not seem to be a problem going forward.


title: How to mitigate security risks when deploying a database to the web via automated migrations?

text: I'm looking at using built in database migrations frameworks (such as the migration framework included in EF Code First or migratordotnet) but I have concerns about the implications of allowing a production website to have permissions to execute DDL statements. In the past when working with web apps I would migrate database objects manually which would allow me to restrict the permissions the web application's database user was given. This mean even in the case of a SQL Injection attack, a stolen web.config or some other attack on the web site it would be more difficult for an attacker to do serious damage (though obviously not impossible). It seems to me by performing migrations via the application (as seems to be almost required when using a PaaS like AppHarbor) you your application up to more threats. So, the heart of my question is:   1. Are my concerns unwarranted?   2. Are there any steps I can take to mitigate those threats while still taking advantage of automated deployments?


title: Sleeping Web Server?

text: Are there any languages or even servers that instead of running a script on page load, (Apache/PHP, Ruby on Rails, ...) actually keep the code loaded and running forever, and when it receives a connection it calls a function of that code? (Like a PageLoad event basically?) I didn't really know how to call this so I went for Passive Web Server because the code is basically sleeping till an event occurs, instead of fully unloaded or just cached.


title: Is the synchronized keyword,still used/needed in java?

text: Is the synchronised keyword still required (ignore backwards compatibility, I'm thinking in terms of writing new code, today) or should we all be using the features available in the Concurrent and Collection packages?


What does "branching is free" mean in Git? I hear this a lot whenever Git is mentioned in comparison to other version control systems. I haven't had the opportunity (?) to deal with others (SVN, etc.), so how is branching "expensive" in others?


title: APIs that deal with logins

text: I have been asked to make a mobile app for a friends website. The website is a Multi level marketing site that sells products and franchises. A client logs in in to the website and can view his or her dashboard ( user can view team members, business volume, commissions, invoices, etc.) The app is supposed to bring the dashboard to user's mobile devices (w/ some added features). The company does not have any APIs that deal with interaction or authentication, and I am new to the whole secure login side of app development. My questions is this, how do I let the users gain access to their information via my app from the secure website when there is no API?


title: Why nginx's http parser doesnt use regular expressions?

text: I see the http parser written by Igor Sysoev for nginx does not use regular expressions https://github.com/joyent/http-parser What could be the main reason for such design decision? I guess I could write few regular expressions to parse HTTP req & res this would be a lot less complex than Igor's version of the parser. What am I missing here?


title: what is sharding in MongoDB

text: i have just reading MongoDB.came across sharding but not getting what exactly is it .watever i understood is its better to have more small servers than a huge one for data storage and when data exceeds capacity of one server you can use another machine to store data.can anyone give soem more idea about sharding?


title: SOA: should I always consider it?

text: While I think how to direct the future development: ### Mini-introduction As a fixed rule, I start with SOA (and REST as protocol) then I work on the interfaces (and that interface is a customer of my service, and usually is a separate project). I assume my _deviation_ is because I'm first of all a back- end developer ( _with poor drawing skills_ ). ### Considering:   1. The BIGs are making a great effort in making quick and easy to use tools for creating interfaces. _(I am referring to projects such as the bootstrap, angular, android studio, and many others)_ ; This is a relief for those who develop platforms, opens the door to many new applications for their platforms.   2. MV*, JSON, Javascript are becoming a standard in building (even) complex applications; It does not matter if the interfaces are all the same, the boilerplate today have reached a level that can be considered viral.   3. The increasingly common repository of modules (ex. NPM), enable even novice programmers _the use_ and _implementation_ of external APIs with great ease.    4. _fate_ can always kiss our products and this maybe become the new facebook (with this I am referring to the fact that a product, even if required as a standalone, it can easily attract the interest of many, and it is very likely that new interfaces are required out of the initial planning). ### Questions:   1. Is SOA an approach that architects (and programmers) should **encourage** and **consider** starting new design?   2. Is SOA the **most suitable architecture** to react to **unplanned expansion**?


title: Do you use code names for your projects?

text: Pretty much every CPU has some internal code name before it is released to the public (and even after it hangs on). But what about software projects? Are those usually code named? Do you code name your projects?


title: Is programming experience useful to become a Business Analyst?

text: Is programming experience important to become a BA? I have an opportunity to switch from programming to BA in IT, but I am not sure what to do. In the future, I want to proceed as BA only. Does programming experience really matter in such a role? I have graduated in Computer Science, but have just 6 month of programming experience


title: Beyond Syntax Highlighting - What other code representations are possible today?

text: Despite GUI applications having been around for 30ish years, software is still written as lines of text instructions, for various valid reasons. But we've also found that manipulating these text instructions is mind-blowingly difficult unless we apply a layer of coloring on different words to represent their syntax, thus allowing us to quickly parse through these text files without having to read the whole words. But besides the Sublime Text minimap feature, I've yet to see any innovation in visual representation of code since colors came around on CRT monitors. I can think of one obviously essential representation that modern graphics technology allows: visual hierarchies for nested structures. If we make nested text slightly smaller than its outer context, and zoom on it when the cursor is focused on the line, then we will be able to browse huge files of nested statements very quickly. This becomes even more essential as languages based on closures and anonymous functions become filled with deep statements. Has anyone attempted to implement this in a text editor? Do you know of any otherwise useful improvements in representing code text graphically?


title: What should I name this helper class?

text: Usually when writing unit tests I create a helper class with extension methods. I use these methods exclusively for generating generic data for things that I am too lazy to type out. I usually name these classes something relevant to the class under test - for example, I'll follow a pattern like TestHelper.cs. I've read that helper classes don't promote good design; however I know SOLID principles pretty well and I don't see how using "helpers" in the way described is violating any principles. I think the issue I'm having is with the name of my "TestHelper" ... Should I simply come up with a new naming scheme or am I really violating a SOLID Principle by utilizing these helpers?


title: Web framework for iPad and common desktop browsers?

text: We are developing a web-based, commercial point-of-sale application. We'd like the same web site to work well on an Ipad as well a desktop browsers. We're looking for a web framework that makes the site look good on an iPad, but also makes the site work well in a desktop browser such as Chrome, IE, or Firefox on Windows or a Mac. I found quite a few at 18 mobile frameworks and development tools for creating iPhone Apps Most of them, such as jQTouch, help a web site look and act more like a native iPhone application but they don't emphasize the cross platform/browser experience. The exception seems to be Sproutcore, which seems to be a full-fledged JavaScript MVC application framework. I did have trouble getting some of the demos to work under Chrome, but what did work looks good. What framework(s) have you actually used to develop web sites to work on an iPad and desktop browser? If you didn't use a framework, how did you get it to work well under both environments?


title: Analysing Group & Individual Member Performance -RUP

text: I am writing a report which requires the analysis of performance of each individual team member. This is for a software development project developed using the Unified Process (UP). I was just wondering if there are any existing group & individual appraisal metrics used so I don't have to reinvent the wheel... EDIT This is by no means correct but something like: Individual Contribution (IC) = time spent (individual) / time spent (total) => Performance = ? (should use individual contribution (IC) combined with something to gain a measure of overall performance).... Maybe I am talking complete hash and I know generally its really difficult to analyse performance with numbers but any mathematicians out there that can lend a hand or know a somewhat more accurate method of analysing performance than arbitrary marking (e.g. 8 out 10)


title: Are there any A.I. resources that explain the concepts and present source code?

text: Are there any A.I. resources that explain the concepts and present source code, similarly to AI Horizon? I've read books and research papers but they generally present a conceptual approach, without really delving into the source code of it.


title: Learning python functions and parameters

text: def printMax(a, b):        if a > b:        print(a, 'is maximum')        elif a == b:        print(a, 'is equal to', b)        else:        print(b, 'is maximum')          printMax(3, 4) # directly give literal values     x = 5     y = 7     printMax(x, y) # give variables as arguments      I'm learning python via the byte of python book, and the author uses this example to introduce us to functions. When the author calls the function printMax, he does not use quotation for the numbers 3,4 i.e. he does not use printMax("3","4") which I thought was fine. However, later on he defines a function like so               def say(message, times = 1)        print(message * times)          say("hello", 3)      why does he use the quotations for the message (i.e. why does he use say("hello", 3) instead of say(hello, 3)? How does python notice the difference?


title: How do I evaluate if writing a book, article, or presenting at conference is worth it?

text: I'm trying to understand how I should evaluate writing a book, article, or conference presentation. Writing a book is a lot of work. Same for writing an article in a magazine or presenting in a conference. They need time and you may even make a mistake here and there that back fires (bad reviews, people calling you an idiot..) Also you do it for free (at least for magazine articles and conference presentations. For books you get something like a $5K deposit and you rarely get any additional sales royalties after that). So how should I evaluate the benefits? I would appreciate answers that call out if you have done this before. I may not write a book because it's way beyond what I'd like to commit time-wise, but should I bother giving conference presentations or writing shorter articles in magazines?


title: How to get out of supporting deadend sales pitches?

text: As part of being a programmer, you often are asked to provide estimates/ make slideware / do technical demos for Sales teams to present to end-clients. Sometimes we go along for the 'technical' discussions or 'strategic capability planning' or some similar mumbo-jumbo. Sometimes, you kind of know which ones are totally going to fail and are not worth pursuing but the Sales guys present fake optimism and extract 'few more slides' out of you or the 'last conference call'. These don't lead to anywhere and are just a waste of time from other tasks for the week. My question is how do you get out of these situations without coming across as non-cooperative. **Updated afterKate Gregory's answer:** The problem is related to projects we know are doomed (from the technical feedback we've received) But Sales ain't convinced since they've just had a call higher up the management chain - so it's definitely going ahead !


title: Preferred Scala code style for several embedded brace sets

text: I was wondering the correct way to format a situation such as this, where I have a def, a foreach and an if clause all nested, requiring braces. Currently I find it hard to read, and there is no obvious place to put the 'x =>' bit. Thank you.               def getAnswer(): String =     {       var sum = 0       (0 until 1000).foreach        { x =>          if (x % 3 == 0 || x % 5 == 0)         {           sum += x         }       }       sum.toString     }


title: How to get on the ladder - Java Development jobs

text: Ok so I've been out of university now for 7 years and in the same job as an application developer for a company that uses their own in house development languages/products. I've learnt a lot here but I should definitely be moving on now! In my time here I've dealt with hands on support, on site installation, training of customers, development of POC's (having to use a mix of technologies including Java and Python) and many other tasks. My main job however has NOT been Java oriented, although I'd say I do have a good deal of experience in it from my own personal projects. I am aware that this might reflect badly on my CV so I have spent a number of months adding professional certs to my resume, these include.   * Sun Certified Java Programmer 6   * Oracle Certified Expert, Java EE 6 JSP and Servlets Developer   * Oracle Certified Exper, Java EE 6 Enterprise JavaBeans Developer I also plan to take the core spring training, shortly followed by taking the springsource certified spring professional exam. I'm not entirely sure how to structure my CV? Restricting myself to two pages is quite difficult especially seeing as mentioning my career history is obviously a big part (I currently have 3/4 of a page which mentions, job title, brief description of company I work for, what my duties include and some of my achievements, Java has a brief mention). Any advice for what I should do? Ideally if I get my foot in the door for an interview I'd be looking to start on a salary of about 35k (I'm in the UK) which is only a few k more than I'm earning currently. I'm posting this as anon because I'm aware of leaving a trail for potential employers, plus I'm disappointed in myself for staying here so long. EDIT: Forgot to mention I was in the UK, so that's £35k not $35k so in USD that's closer to $55k Edit2: Not in London, Bristol


title: Secure cloud based code storage and syncing across multiple computers

text: I've been thinking recently about how and where I keep my code - I work across multiple locations, with at least three different computers and I'm considering how I manage my code across these machines. I've got a dropbox account, which I use. For non sensitive files this is fine, and I do keep some sensitive files in there, but in a TrueCrypt file - this won't work large scale as the entire TrueCrypt file would need to be uploaded for any change. I don't feel safe putting my, or my employers, code on DropBox because of several security issues and news that they can access everyones' files. I have a github account where I store my code (open and closed source), but I don't want to have to always push up to GitHub, also I work a lot on the train so I can't push as I don't have a stable data connection and chances are that I'll forget to push or grab data at some point and then I'll be stuck! So - with that in mind, I'd like a discussion about storing code in the cloud:   1. Is keeping source code in the cloud dangerous?      * I understand the implications of keeping employers code in the cloud, but are there alternatives, given that a good number of VPN/RDC solutions that I've used are slow to the point of unusable? (this may be a point against my/my employers network speeds rather than the actual programs - but it's a impediment)   2. Is there a good cloud based service with good encryption, good uptime, diff, auto sync?      * Is there one aimed solely at developers? If not, does anyone want to start one with me? (joking but at the same time, it could be a good business venture - drop me a line if interested)   3. What do you use? Does it work? how would you change it?


title: Why have a method that returns a bool/int and has the actual object as an output parameter?

text: I see the following code pattern all over the place in my company's codebase (.NET 3.5 application):               bool Foo(int barID, out Baz bazObject) {          try {                  // do stuff                 bazObject = someResponseObject;                      return true;         }         catch (Exception ex) {              // log error             return false;         }     }          // calling code     BazObject baz = new BazObject();     fooObject.Foo(barID, out baz);          if (baz != null) {          // do stuff with baz     }      I'm trying to wrap my head around why you would do this instead of having the `Foo` method simply take the ID and return a `Baz` object, instead of returning a value that isn't used and having the actual object be a ref or output parameter. Is there some hidden benefit of this coding style that I'm missing?


title: How to fetch commit messages from bitbucket for project manager to see

text: Is it possible to fetch commit messages from bitbucket via json or something so that a project manager can see what the changes are without having to look at the code. If it's possible can you give me some ideas on how to do it.


title: Good practices for packaging Python programs

text: I've been using Python for a while now, both in the context of personal and professional projects. One thing that occured to me recently is that I had never thought about a good way to deploy Python programs. Basically, since it's mostly a bunch of scripts, I usually just copy them to the machine where I want it deployed and _voila_ ! But I believe there should be some good practices as to how you should deploy Python projects. I've heard about Python Eggs but not familiar enough with it to see if it's a good choice. Or a plain old _tarball_ with a bunch of Shell scripts to run the core module scripts? Basically I'd like to be able to do a nice, elegant and self-contained deployment, and not just copying files here and there, as it doesn't allow version tracking easily and it's quite messy.


title: How does agile work when replacing a working system?

text: In an ideal Agile world, you quickly build a small, but useful subset of the desired end system, and give it to users. They're excited, because it's useful, they start using it and give feedback. You then work out what to add on to it, build that, and repeat until you run out of time. I've had a couple of projects recently that involved replacing some kind of working system. The above model just didn't work at all: until you'd built a system that included virtually all the functionality of the existing system, users had no interest at all. They wouldn't use it. How do you apply Agile when "the smallest useful subset" is "all of it"?


I have to run certain number of statements (which are executing .exe) in a loop.                ForEach(object obj in ListOfVersions)         {           Step 1: call Exe1 Args=obj.somevalues           Log Step 1 completed for obj                Step 2: call Exe2 Args=obj.somevalues           Log Step 2 completed for obj                Step 3: call Exe3 Args=obj.somevalues           Log step 3 completed for obj         }          Step 4: call Exe4      Is there any specific design pattern available to use for above situation.


title: Typical agreements for freelance development?

text: I am just starting out my programming career and I have a chance to bid on a freelance job. I have looked over the specifications for the app and believe I am capable of meeting the requirements satisfactorily. I have worked on a team developing 2 different apps for the same platform , as well as one app I wrote for a friends business (for pay but it was informal) and all of the stuff I have done for personal use/school so I believe I can estimate fairly accurately how long it will take me. However I have no clue about how these things work in the real world. I have only been finished school for less then a year and I have only had 2 short- term developer contracts. Specifically:   1. Payment: what is usual? Payment on delivery? Payment upfront? Percentage upfront?   2. Sourcecode: I understand that I would need to give them the source code but what about previous librarys which I have made. If I use those in the project would they then belong to the client as well?    3. How detailed should the initial contract be? What if the client changes their mind about details part way through.    4. I'm not really certain how to set a price (I would appreciate suggestions formulas). I assume that there must be some sort of industry standards for this sort of thing I'm just not sure what they are/ where to find them? I would really appreciate any advice on the subject, even if it is just links to other resources. If it matters both myself and the potential client are located in Canada.


title: Good practices to write Tags at SVN

text: Tags are a vital part at Version Controlling for example SVN.   * When should i write Tags at SVN?   * What information should have a Tags?


title: How to detect two moving shapes overlapped?

text: Given a list of circles with its coordinates (x and y) that are moving every second in different direction (South-East, South-West, North-East and North- West), and the circle will change direction if it hits the wall sort of like bouncing, so how do we detect if any of them collide or overlap with each other ? I am not sure if we can use some data structures like a `Binary Search Tree` because since all the coordinates vary every seconds, so the tree will have to re-build accordingly. Or can we use Vertical Sweep Line Algorithm each time ? Any ideas on how to do this in a efficient way ?


title: How easy is it to alter a browser fingerprint?

text: I am researching this question for a possible paper. Given the exploitation of user identities for risk management and market tracking, how easy is it to alter a browser enough to throw off fingerprinting techniques? My current sources are:   * EFF Panopticlick project   * Peter Eckersly's follow-up presentation at Def Con 18.


title: Cheat notes for telephone interview (.NET /DBs, OO)

text: I am preparing for a telephone interview. I am thinking that instead of trying to memorize SOLID or ACID for example I could have some cheat notes ready. So:   1. Any tips on how to organize them?   2. Where to find material for .NET, OO, DB (Both Oracle and SQL Server). It should be easy to find/read the information by looking at the paper/screen, also I need some way to look it up. (Cheat Sheets in IT context seems usually to be something else - like condensed information to keep next to you while you are working.)


title: Is it possible to get formal recognition of self-taught knowledge?

text: I like many others have spent a few of my High School years teaching myself software development and various languages.   * I'm fluent in C++/C#   * Have a fairly solid understanding of Computer Science and Computing Techniques.   * I _don't_ have any worthy projects to display because I have a bad habit of stopping them before they're presentable in pursuit of newer, more exciting projects; **But if you asked me to sit down and solve a problem I could do it easy.** * * * **Is there any way to get formal recognition of all the time I've spent watching online lectures / tutorials, actually coding, and researching?** * * * It would be nice to have something I can actually put on my college application!   _I just want to show that I havn't just been sitting around playing Video- Games all day._


title: Polymorphism and passing

text: I am writing a text based RPG, and I have three classes that inherit from a super class, they all have special attacks that they can perform, at the same time I have a class that holds the function which handles battles in my game. Now how do I get the unique special abilities functions for whatever role the player chooses into the battle function? Also I am using the vector.push_back method to handle how my sub classes are referenced.


title: What is a good Scrum management software for a Scrum newbie?

text: I want to practice Scrum on a personal project and I'm looking for Scrum management software. I've tried Jira + GreenHopper, but it has some limitations - limited nesting of user stories in particular. It's also a bug tracker at its core. I'm looking for something built for Scrum from the ground up so I don't go down too many blind alleys. As a newbie to Scrum and as a learning exercise, what software would you recommend?


title: Best practices when managing long running asynchronous jobs

text: I am in the design phase of a project where the end user will submit a request from a web page that will spawn a long running asynchronous processed job. Is there a "best practice" for this problem? Are web services and service brokers a good way to go? Is Microsoft messaging queue applicable here?


title: switch statement - handling default case when it can't be reached

text: If I'm using a switch statement to handle values from an enum (which is owned by my class) and I have a case for each possible value - is it worth adding code to handle the "default" case?               enum MyEnum     {         MyFoo,         MyBar,         MyBat     }          MyEnum myEnum = GetMyEnum();     switch (myEnum)     {         case MyFoo:             DoFoo();             break;         case MyBar:             DoBar();             break;         case MyBat:             DoBat();             break;         default:             Log("Unexpected value");             throw new ArgumentException()      }      I don't think it is because this code can never be reached (even with unit tests). My co-worker disagrees and thinks this protects us against unexpected behavior caused by new values being added to MyEnum. What say you, community?


title: What do you want to see in a job offer?

text: Which information do you want to see in a job offer for programmers? In which order? What are the most important points for you?


title: Is it possible to access .NET APIs with JRuby?

text: I know that JRuby can access COM APIs, but can it interface with .NET?


title: What development process encourages frequent releases (rolling code to a live site), as well as developer individuality

text: Some quick background - we don't have PMs or upper management breathing down our necks about status of features, etc, as we almost always deliver ahead of time and have built up a high level of trust with them. In other words, we have a huge amount of flexibility as far as process goes. We do very well with our current process, but we feel there can be some improvement. We have a small team (3 devs, 1 tester) and everyone on the team is senior level and can deliver large pieces of functionality, and usually does so on an individual basis. Sometimes two people work on the same story/task, but since we are all very familiar with the codebase(s), we typically handle things by ourselves and consult/collaborate when needed. We roll to a live site and have the ability to roll on a daily basis, which someone on our team typically does. On average, I'd say an individual developer rolls his own code 3 times a week. We have been doing scrum with 2 week sprints, but from my experience scrum was more advantageous when we needed the majority of the team to work on the same features at the same time (swarm-type stuff), and when needing to communicate out to external teams. We currently don't have either of those needs, so we're re-evaluating our process. What it seems like we're moving toward is a model where each team member exists in his/her own sprint (with optional teammates being less common), which lasts anywhere from 1-3 days. We don't have a requirement that all sprints have to end on the same days, etc, so in theory we could pull this off. My question is, is there something better than scrum that models this type of development process? Oh, I almost forgot. We're moving away from TFS to use Git, and while I have experience with Git, most of the team members don't. Since it's a paradigm shift for some on the team, I'm wondering if we can use the change to our advantage somehow process-wise. Thoughts?


title: Should classes from the same namespace be kept in the same assembly?

text: For example, `ISerializable` and the `Serializable` Attribute are both in the `System.Runtime.Serialization` namespace, but not the assembly of the same name. On the other hand, `DataContract` attributes are in the namespace/assembly `System.Runtime.Serialization`. This causes confusion when a class can have `using System.Runtime.Serialization` but still not have reference to the `System.Runtime.Serialization` assembly, meaning `DataContract` cannot be found. Should this be avoided in practice, or is it common for namespaces to be split over multiple assemblies? What other issues should one be careful of when doing this?


title: Application that provides unique keys to multiple threads

text: Thanks all for your help before. So, this is what I came up with so far, the requirements are, application has two or more threads and each thread requires a unique session/transaction ID. is the below considered thread safe? thread 1 will register itself with get_id by sending it's pid thread 2 will do the same then thread 1 & 2 will call the function to get a unique ID               function get_id(bool choice/*register thread or get id*/, pid_t pid)     {          static int pid[15][1]={0};//not sure if this work, anyway considor any it's been set to 0 by any other way than this     static int total_threads = 0;      static int i = 0;     int x=0,y=0;              if (choice) // thread registeration part          {             for(x=0;x<15;x++)             {                 if (pid[x][0]==0);                 {                 pid[x][0] = (int) pid;                 pid[x][1] = (x & pidx[x][1]) << 24;//initiate counter for this PID by shifting x to the 25th bit, it could be any other bit, it's just to set a range.                 //so the range will be between 0x0000000 and 0x0ffffff, the second one              will be 0x1000000 and 0x1ffffff,                  break;                 }             total_threads++;             }          }          //search if pid exist or not, if yes return transaction id              for(x=0;x<15;x++)             {                 if (pid[x][0]==pid);                 {                 pid[x][1]++;//put some test here to reset the number to 0 if it reaches 0x0ffffff                 return pid[x][1];                 break;                 }                  }           }


title: Have there been attempts to make object containers that search for valid programs by auto wiring compatible components?

text: I hope this post isn't too "Fringe" - I'm sure someone will just kill it if it is :) Three things made me want to reach out about this now:   1. Decoupling is so in the forefront of design.   2. TDD inspires the idea that it doesn't matter how a program comes to exist as long as it works.   3. Seeing how often the adapter pattern is applied to achieve (1). I'm almost sure this has been tried from a memory of reading about it around the year 2000 or so. If I had to guess, it was maybe about and earlier version of the Java Spring framework. At this time we were not so far from days when the belief was that computer programs could exhibit useful emergent behavior. I think the article said it didn't work, but it didn't say it was impossible. I wonder if since then it has been deemed impossible or simply an illusion due to a false assumption of similarity between a brain and a CPU. I know this illusion existed because I had an internship in 1996 where I programmed neural nets that were supposedly going to exhibit "brain damage". STILL, after all that, I'm sitting around this morning and not able to shake the idea that it _should_ be possible to have a method of programming to allow autonomous components to find each other, attempt to collaborate and their outputs evaluated against a set desired results.


title: On a queue, which end is the "head"?

text: I had always thought that the "head" of a queue as the next element to be read, and never really questioned that usage. So a linked-list library I wrote, which is used for maintaining queues, codified that terminology: we have a `list1_head` macro that retrieves the first element; when using this library in a queue, this will be the first element to be removed. But a new developer on the team was used to having queues implemented the other way around. He described a queue as behaving like a dog: you insert at the head, and remove at the tail. This is a clever enough description that I feel like his usage must be more widespread, and I don't have a similarly evocative description of my preferred usage. So, I guess, there are two related questions: 1, what does the "head" of a queue mean to you? and 2, why do we use the word "head" to describe that concept?


title: Any success stories about using slicing tools to help debugging

text: Program slicing is one of those software technologies where there is much more activity in the research community than in the industry community. Does anybody outside of the research community using slicing tools on production code to help with debugging or other tasks? If so, what tools did you use?


title: WPF more dynamic views and DataAnnotations

text: Comparing WPF and Asp.Net Razor/HtmlHelper I find WPF/Xaml to be somewhat lacking in creating views. With HtmlHelpers you could define in one place how you wan't to represent specific type of data and include elements set from the DataAnnotations of the property. In WPF you can also define DataTemplates for data but it seems much more limited then EditorTemplates. It doesn't use information from DataAnnotations. Also the layout of elements can be bothersome. I hate having to constantly add RowDefinitions and update the Grid.Row attribute of lot of elements when I add a new property somewhere in line. I understand that GUI programming can be a lot of grunt work like this but as Asp.Net MVC has shown there are ways around that. What solutions are out there to make view creation in WPF a little bit cleaner, maintainable and more dynamic?


title: Creating A News Feed with Relevant Data for App

text: I'm creating an app that currently allows users to create topics, vote in topics, follow topics, and chat in topics. Currently working on creating a News Feed like Facebook or Twitter that brings users topics that are related to what they've interacted with in the past. I understand this a complex topic, but I would appreciate any answers anyone might have to working towards a solution. Current solution: Point system where topics will be added +1 to +1000 points for user activity. For example: > If user creates topic, then add +50 points to topic. Topic is more likely to > show up on the user's news feed. Another example: > If user "follows" topic, then add +25 points to topic. Topic is more likely > to show up on the user's news feed. Another example: > If topic was created in the past 24 hours, add +24 -(number of hours since > creation) to the topic. Hoping to learn if there's a more practical approach to figuring this out.


title: Patterns for Versioning Relational Data in a MySQL database?

text: I am trying to find an approach for a project, where A user can edit records, and be able to see past versions of those records. Here is a simlified example schema, using a list:               TABLE list (       id int auto_increment primary key,       user_id int,        title varchar(255)     );          TABLE list_tasks (       id int auto_increment primary key,       list_id int,       title varchar(255),       order int,       is_complete tinyint     );      So a user may come in, and make several edits to the list, (i.e., add or remove tasks, re-order tasks, mark some complete, rename some, etc.), Then save them. At this point, I'd like to generate a 'version 2' of the list and tasks, and have them be able to view previous versions, but when they access the list, always get the latest version. Is there a common approach / design pattern for dealing with versioning data in this way in a MySQL database?


title: Coming from a Windows keyboard background and still using a generic keyboard, how can I transition to Mac for development?

text: I got a new MacMini a little while ago because I already had a monitor, keyboard, mouse, etc so I just wanted something cheap I could play with for Apple development where I could just change plugs to the computer I want to use. The biggest problem is that my keyboard is a standard (or not so standard being a DasKeyboard) keyboard in regards to the Control-Windows-Alt key setup. As all good developers should, I have trained my fingers' muscle memory to work well with common Windows-based (and Linux for that matter) keyboard shortcuts. I've actually instinctively hit `Control-Shift-B` to "compile" a Word document before (/facepalm). I tried remapping the `Command` key to be my keyboard's `Control` key, and that alone takes care of most of my problems. `End` and `Home` buttons are another issue altogether, and trying to highlight words using `Control` (aka the `Command`) causes frustration as well. I've considered just getting myself a wireless Apple keyboard just for the MacMini and forcing myself to learn things their way. Or perhaps resetting my current key mappings and trying to force learn everything in an Apple-ish way on my standard keyboard (so I just need to get used to using `Alt` instead of `Control`). Has anyone else run into this problem? How did you go about solving it?


title: Is it a must for every programmer to learn regular expressions?

text: I am new to programming, and at an interview I got a question on regular expressions; needless to say I couldn't answer. So I was wondering whether I should learn regular expression? Is it a must for every programmer of all fields? Or it is a must for programming for some particular fields? Related questions:   * Why are regular expressions so morbidly attractive?   * When you should NOT use Regular Expressions?


title: normal order evaluation -vs- applicative order evaluation

text: I am going through Abelson and Sussman (Structure and Interpretation of Computer Programs) and I am a little confused about when normal order evaluation is used and when applicative order evaluation is used. This sentence throws me off: > _**Lisp uses applicative-order evaluation_** partly because of the > additional efficiency obtained from avoiding multiple evaluations of > expressions suich as those illustrated with (+5 1) and (*5 2) above and, > more significantly, because normal-order evaluation becomes much more > complicated to deal with when we leave the realm of procedures that can be > modeled by substitution. [emphasis added] on page 17 paragraph 1. However, in exercise 1.6, the implication is that Lisp uses normal order evaluation for primitives but applicative order evaluation for complex procedures. Could someone clarify?


title: How should one pay for employees' publications?

text: Suppose a company wants to encourage employees to publish articles, blogposts, participate in community discussions. Let us not consider the pure-rhetorical ways of encouragement ("Guys, you'll be so respected!"). What could be a sensible strategy to encourage publications by money? Many things come to mind, such as "pay for word count", "pay for audience size", "pay for view count", "pay for number of reactions or citations of the publication" etc, but most of them fall apart as unfair in trivial corner cases.


title: Architecture of interaction modes ("paint tools") for a 3D paint program

text: We are developing a Qt-based application to navigate through and paint on a volume treated as a 3D pixel graphic. The layout of the app consists of three orthogonal slice views on which the user may paint stuff like dots, circles etc. and also erase already painted pixels. Think of a 3D Gimp or MS Paint. _How would you design the the architecture for the different interaction modes (i.e. paint tools)?_ My idea is:   * use the MVC pattern   * have a separate controler for every interaction mode   * install an event filter on all three slice views to collect all incoming user interaction events (mouse, keyboard)   * redirect the events to the currently active interaction controler I would appreciate critical comments on that idea.


title: Effective handling of variables in non-object oriented programming

text: What is the best method to use and share variables between functions in non object-oriented program languages? Let's say that I use 10 parameters from DB, ID and 9 other values linked to it. I need to work with all 10 parameters in many functions. I can do it next ways: **1\. call functions only with using ID and in every function get the other parameters from DB.** Advantage: local variables are clear visible, there is only one input parameter to function Disadvantage: it's slow and there are the same rows for getting parameters in every function, which makes function longer and not so clear **2\. call functions with all 10 parameters** Advantage: working with local variables, clear function code Disadvantage: many input parameters, what is not nice **3\. getting parameters as global variables once and using them everywhere** Advantage - clearer code, shorter functions, faster processing Disadvantage - global variables - loosing control of them, possibility of unwanted overwriting (Especially when some functions should change their values) Maybe there is some another way how to implement this and make program cleaner and more effective. Can you say which way is the best for solving this issue?


title: Something similar to Objective-C categories in other languages?

text: I understand Objective-C categories and how they become useful, but I always have a hard time explaining the concept to other programmers that are not familiar with Objective C. Maybe I'm just bad at explaining things, but I was thinking at another way to explain it by comparing to similar features offered by other (more popular) languages. (ex : I can explain the similarities between Objective C protocols and Java Interfaces) Any examples similar to Categories ?


title: Is Creative-Commons license compatible with Apache License?

text: For example if I have code that contains parts of code rewritten from code found here or on Stack Overflow or other Creative-Commons licensed code, can my final code be licensed with an Apache License?


title: Why is (Ogg) Vorbis not automatically supported by Windows?

text: 1. Vorbis was never threatened by MPEG LA, so it is undoubtedly completely patent free.   (MPEG LA never misses a chance to spread patent FUD)   2. Windows supports mp3, so it isn’t because they want to push their crappy wma.   3. The GPL allows distribution alongside commercial products, and   4. Even if they fear to ship GPL software, they can still load it automatically, like they do with XviD So why can’t a windows customer not simply drop a ogg vorbis file into his/her music library and listen to it via WMP? PS: To counter misconceptions: They already download the GPL’d XviD codec on demand, so they already have 99% of what it takes to do the same with Vorbis. It would take me about 5 minutes to do this, if I were familiar with the WMP code base and directshow filter system. PSS: I was told to ask this here rather than on stackoverflow, so i do.


title: How to verify the Liskov substitution principle in an inheritance hierarchy?

text: Inspired by this answer: > Liskov Substitution Principle requires that > >   * Preconditions cannot be strengthened in a subtype. >   * Postconditions cannot be weakened in a subtype. >   * Invariants of the supertype must be preserved in a subtype. >   * History constraint (the "history rule"). Objects are regarded as being > modifiable only through their methods (encapsulation). Since subtypes may > introduce methods that are not present in the supertype, the introduction of > these methods may allow state changes in the subtype that are not > permissible in the supertype. The history constraint prohibits this. > I was hoping if someone would post a class hierarchy that violates these 4 points and how to solve them accordingly.   I'm looking for an elaborate explanation for educational purposes on how to identify each of the 4 points in the hierarchy and the best way to fix it. **Note:**   I was hoping to post a code sample for people to work on, but the question itself is about how to identify the faulty hierarchies :)


title: Is requiring attribution GPL-compatible?

text: Can code licensed under a clause like this:               Redistribution of this work, with or without modification, is permitted if     Bob Joe is attributed as the original author or licensor of     this work, but not in any way that suggests that Bob Joe endorses     you or your use of the work.      be used in a project using GPL, or does this make it incompatible with the GPL?


title: Improvements to Joshua Bloch's Builder Design Pattern?

text: Back in 2007, I read an article about Joshua Blochs take on the "builder pattern" and how it could be modified to improve the overuse of constructors and setters, especially when an object has a large number of properties, most of which are optional. A brief summary of this design pattern is articled here. I liked the idea, and have been using it since. The problem with it, while it is very clean and nice to use from the client perspective, implementing it can be a pain in the bum! There are so many different places in the object where a single property is reference, and thus creating the object, and adding a new property takes a lot of time. So...I had an idea. First, an example object in Joshua Bloch's style: Josh Bloch Style:               public class OptionsJoshBlochStyle {              private final String option1;         private final int option2;         // ...other options here  <<<<              public String getOption1() {             return option1;         }              public int getOption2() {             return option2;         }              public static class Builder {                  private String option1;             private int option2;             // other options here <<<<<                  public Builder option1(String option1) {                 this.option1 = option1;                 return this;             }                  public Builder option2(int option2) {                 this.option2 = option2;                 return this;             }                  public OptionsJoshBlochStyle build() {                 return new OptionsJoshBlochStyle(this);             }         }              private OptionsJoshBlochStyle(Builder builder) {             this.option1 = builder.option1;             this.option2 = builder.option2;             // other options here <<<<<<         }              public static void main(String[] args) {             OptionsJoshBlochStyle optionsVariation1 = new OptionsJoshBlochStyle.Builder().option1("firefox").option2(1).build();             OptionsJoshBlochStyle optionsVariation2 = new OptionsJoshBlochStyle.Builder().option1("chrome").option2(2).build();         }     }      Now my "improved" version:               public class Options {              // note that these are not final         private String option1;         private int option2;         // ...other options here              public String getOption1() {             return option1;         }              public int getOption2() {             return option2;         }              public static class Builder {                  private final Options options = new Options();                  public Builder option1(String option1) {                 this.options.option1 = option1;                 return this;             }                  public Builder option2(int option2) {                 this.options.option2 = option2;                 return this;             }                  public Options build() {                 return options;             }         }              private Options() {         }              public static void main(String[] args) {             Options optionsVariation1 = new Options.Builder().option1("firefox").option2(1).build();             Options optionsVariation2 = new Options.Builder().option1("chrome").option2(2).build();              }     }      As you can see in my "improved version", there are 2 less places in which we need to add code about any addition properties (or options, in this case)! The only negative that I can see is that the instance variables of the outer class are not able to be final. But, the class is still immutable without this. Is there really any downside to this improvement in maintainability? There has to be a reason which he repeated the properties within the nested class that I'm not seeing?


title: Charging for Open-Source

text: **Is it viable to charge for an open-source product?** Both legally and financially, it seems like a very strange thing to do. However, I keep hearing people say that it's possible. Are there even any real-world examples for this sort of thing?


title: Based on what I read in "Inside the Machine", is this approach to branches more optimal?

text: So I have been reading Inside the Machine by Jon Stokes. It is a FANTASTIC book, and it has got me thinking about the effects of programming on processors... Given a branch unit in a CPU and a complex conditional statement that involves a procedure call (If IsTodayAHoliday( Now ) > 0 Then), is it faster to stick the results of that procedure call in a variable just before the IF statement? In terms of static and dynamic branch prediction, it seems logical that having the decision value before the branch unit has to evaluate causes the prediction algorithms to execute flawlessly. Is this true?


title: Is it possible to have an effective VIM environment for both C++ and Python?

text: I have recently moved to a VIM environment for Python development. I learned the setup from John Anderson's outstanding web page on the subject. I am about to try and set up another VIM environment for C++. Is this even possible to do effectively? Or should I really have two accounts on my Linux box, one for Python, one for C++ development? If anyone could outline their setup, either way, I would appreciate it greatly. To further clarify the question, I am not asking "what is best way?" which is unanswerable. I am asking those VIM users who program both C++ and Python if they use one VIM environment, or two (perhaps on different accounts), and how they accomplish it either way. (For Java, I am sticking with NetBeans and am pretty sure that is the right decision due to how well the build and Swing development tools are built into it, but am open to the idea of a VIM environment for all 3 languages if anyone has had success with it.) Thanks much


title: What is the intention behind asking weight of plane?

text: I was asked this question "How would you find weight of Aeroplane" in an interview and I am not sure why this question was one of the two question asked in the interview. I tried to answer it using all possible ways but could not give the correct answer.(found the correct answer after google search) How much such questions decide your selection in the interview? Here was my approach: 1\. If measurement of plane is given then i will calculate volume and multiply by density, will consider fuel weight plus other dead weight. 2\. Using water displacement method if i can put plane in water and somehow measure how much water is displaced. But found using google search that right approach was to put place on a ship and mark the level of water on the hull, then remove plane and then ship will go up. And start putting weight on the ship till marked hull reaches the water level.


title: What's the best way to move to linux from windows for web development?

text: I am primarily a programmer developing on windows based OS using C# as my primary language. I am evaluating Ubuntu Linux as an alternate platform and would like to know the best stack for doing web development on this. I had gone through this thread but it doesn't answer my questions fully. Some of the points I am interested are:   * PHP/Ruby/Python (What would you recommend?)   * Is Mono mature enough for any large scale development? Has anyone any real experience using Mono.   * IDE (including debugging support, intellisense, source control integration,Unit testing)   * Unit testing framework based on the language recommended   * Web framework if any.    * Load Testing tools   * Web server (I know there are many webservers, but would like to know which one is primarily used by most people)


title: What standard superseded 830-1998?

text: I have been looking into how to document software projects more formally, and I have learned about IEEE 830-1998: Recommended Practice for Software Requirements Specifications. However, as you can see from that link, it has been superseded. I know that 830-1998, and probably even 830-1993, are probably just fine for use. However, if nothing else, I would like to know what standard has superseded it. In this case it may not matter, but if other standards are superseded for more technical things, I think it would be a good idea to link somewhere what standard superseded another (if it is not another one in the same line (830, in this case)). It is worth mentioning that:   1. The most recent standard when searching for "Software Requirements Specifications" or "Software Requirements" on the IEEE Standards Association website is 830-1993,   2. The 2004 (current) version of SWEBOK references 830-1993 (paragraph 2.5),   3. The document's Wikipedia article doesn't mention that the standard was superseded.  TLDR: How do you find what standard superseded another, and which one took 830-1998's place?