Staying OO and Testable while working with a database

What are some OOP strategies for working with a database but keeping things unit testable? Say I have a User class and my production environment works against MySQL. I see a couple possible approaches, shown here using PHP:   1. Pass in a $data_source with interfaces for `load()` and `save()`, to abstract the backend source of data. When testing, pass a different data store.              $user = new User( $mysql_data_source );     $user->load( 'bob' );     $user->setNickname( 'Robby' );     $user->save();        2. Use a factory that accesses the database and passes the result row to User's constructor. When testing, manually generate the $row parameter, or mock the object in UserFactory::$data_source. (How might I save changes to the record?)              class UserFactory {         static $data_source;              public static function fetch( $username ) {             $row = self::$data_source->get( [params] );                  $user = new User( $row );             return $user;         }     }      I have _Design Patterns_ and _Clean Code_ here next to me, but I'm struggling to find applicable concepts.


Write Unit test for heavily-database application?

I'm currently developing a Spring-based web-application, in which almost every operation create/update/delete something in the database. The logic mostly about checking condition so as to we should create/update records in the database or not. The reason I want to try unit test is that we often meets regression errors when request changes or refactor. Most the bugs comes from Database changes, when I doesn't fully reflect those changes in the code. I have some experience in web-development now, but it seems that's not enough to stop them appear. My controller/service is actually not too complex. I just take the binding object submited from the HttpRequest, **check the condition** & record in DB. Sometimes the system must read the Database, take out some records & manipulate them, then update some other records.Much of the coding effort lies on the interface(HTML/CSS/Javascript) too. I'm investigating unit test, and I heard that when it comes to database operation, it's no longer unit test, since the test will be slow. Is that true? So that if my project is heavily database-operation, I shouldn't use unit test? I also heard about DBUnit & some in-memory database which can quicken the test. Should I use them? And how I can write good unit test for database operation?


What pattern to use for this 'constructor'? Decorator vs Factory?

I'm developing a programme to generate LARP characters in java and I've hit a snag. Initially I had planned to use a decorator to iterate through the potential 'roles' (effectively classes), and then from that work out the costs for each skill depending on the combination of roles and store that in the character. I.e you might be a Java Coder/Nerdfighter, if those are your two roles, or you might just have the SysAdmin role etc. I then prototyped out a way to buy a skill that required looking up skills in a data base that contained their name and cost. Here is the snag: If I've preworked out the costs then I don't ever need to look up the database, so no changes in the db are pushed through (if the skill costs on a SysAdmin go down I'd like to know). As well as this, I may only buy a fraction of the available skills so I'll be storing unnecessary data on skill costs, and besides the character should only know about their skills, not all skills. More over, the decorator would only decorate the skill costs, nothing more. Instead I feel I need a factory that has two options for constructing the character, something like:               public static CharacterFactory multiRolePlayerCharacter(Role firstRole, Role secondRole) {         /*Some code goes here*/     }     public static CharacterFactory singleRolePlayerCharacter(Role role) {         /*Some more code goes here*/         }      But this seems far less extensible compared to the decorator. If the game ever changes so that you can multirole morethan twice (and Java Coder/Nerdfighter/SysAdmin is an allowed role) then I need to rework from the top to add a new factory in. Also I don't quite know how each factory differs besides perhaps a flag to say if it's multirole or not, and another variable to hold the secondRole. Which doesn't seem much. So it seems either way I lose: Decorator adds extensibility for the long run whilst bogging my classes/objects down, and Factory will work to start with but will resist change. So how do I know which one to pick? Is there some way to combine the two?   **Edit** : I'm really interested in learning about the _whys_ and _hows_ of this, so I know next time which option to go for.


iphone application give up rights

Is it possible to give up an iphone application rights to another person or company? I mean, you make an application, you sell it for a while, and then you don't need it anymore and you give or sell it to another person or company to continue develope it. And in this case, how persons who already bought a copy of it can continue to receive next updates? I hope I'm clear.


Should I put extension methods of an interface in the interface.cs file?

Imagine this set up:               public interface IMass{         double Mass {get;}     }          public static class IMassExtension {         public static double ToKg(this IMass massObject) {             return massObject.Mass / 1000.0;         }              public static double CalculateInteractiveGravity(this IMass massObject, IMass otherMassObject)                   {              return blah;         }     }      Is it ok to put the extension class in the same file as the interface (i.e. IMass.cs) or should it be in a separate file (IMassExtension.cs)? * * * A base class is not possible here. Imagine               public class Person : Animal, IMass {}      and               public class House : Building, IMass {}


not checking in from the project root

Whenever I do a check-in, I always check in from the **root** of the project... i.e. check in **all** the files in my working copy, so after the check-in the source control repo contains exactly the same set of files that I just finished testing in my local copy. I also make sure my source control is set to flag local files that are **not** under source control. In general, there are **none** of these files... if there are, I either add them to source control or mark them as "ignored". I also check in all my changes together in one check-in. A lot of colleagues check in much differently. They carefully select each file to check in, as if they are a master jeweler selecting only the very best gemstones to set into the royal crown, and they check in each one as a separate check-in. They rely only on their memory to figure out which files need to be checked in, or especially **added** to source control. The results are quite predictable... frequent broken builds because they forget to add their new files to source control or forget to check in a changed file (especially changed project files). I have mentioned this to them and they never seem to change. When I mentioned it to the team lead he said, "this is just a different way of working". To which I may respond: What if I want to drive my car with my eyes closed? Is that just "a different way of driving"? Am I right in being bothered by this practice?


What can be the cause of new bugs appearing somewhere else when a known bug is solved?

During a discussion, one of my colleagues told that he has some difficulties with his current project while trying to solve bugs. "When I solve one bug, something else stops working elsewhere", he said. I started to think about how this could happen, but can't figure it out.   * I have sometimes similar problems **when I am too tired/sleepy to do the work correctly** and to have an overall view of the part of the code I was working on. Here, the problem seems to be for a few days or weeks, and is not related to the focus of my colleague.   * I can also imagine this problem arising on a **very large project, very badly managed** , where teammates don't have any idea of who does what, and what effect on other's work can have a change they are doing. This is not the case here neither: it's a rather small project with only one developer.   * It can also be an issue with **old, badly maintained and never documented codebase** , where the only developers who can really imagine the consequences of a change had left the company years ago. Here, the project just started, and the developer doesn't use anyone's codebase. So what can be the cause of such issue **on a fresh, small-size codebase written by a single developer who stays focused on his work**? What may help?   * Unit tests (there are none)?   * Proper architecture (I'm pretty sure that the codebase has no architecture at all and was written with no preliminary thinking), requiring the whole refactoring?   * Pair programming?   * Something else?


How to ease the maintenance of event driven code?

When using an event based component I often feel some pain at maintenance phase. Since the executed code is all split around it can be quite hard to figure what will be all the code part that will be involved at runtime. This can lead to subtle and hard to debug problems when someone adds some new event handlers. Edit from comments: Even with some good practices on-board, like having an application wide event bus and handlers delegating business to other part of the app, there is a moment when the code starts to become hard to read because there is a lot of registered handlers from many different places (especially true when there is a bus). Then sequence diagram starts to look over complex, time spend to figure out what is happening is increasing and debugging session becomes messy (breakpoint on the handlers manager while iterating on handlers, especially joyful with async handler and some filtering on top of it). //////////////   Example I have a service that is retrieving some data on the server. On the client we have a basic component that is calling this service using a callback. To provide extension point to the users of the component and to avoid coupling between different components, we are firing some events: one before the query is sent, one when the answer is coming back and another one in case of a failure. We have a basic set of handlers that are pre-registered which provide the default behavior of the component. Now users of the component (and we are user of the component too) can add some handlers to perform some change on the behavior (modify the query, logs, data analysis, data filtering, data massaging, UI fancy animation, chain multiple sequential queries, whatever). So some handlers must be executed before/after some others and they are registered from a lots of different entry point in the application. After a while, it can happens that a dozen or more handlers are registered, and working with that can be tedious and hazardous. This design emerged because using inheritance was starting to be a complete mess. The event system is used at a kind of composition where you don't know yet what will be your composites. End of example   ////////////// So I'm wondering how other people are tackling this kind of code. Both when writing and reading it. Do you have any methods or tools that let you write and maintain such code without to much pain ?


Naming: StartDate or StartDateTime when working with DateTimes

I am using a lot of DateTimes in my application. Now I usually name it like StartDateTime, EndDateTime, etc, to imply there is also a time involved. I am getting a bit tired of this (it is tiresome to read), and _most of the time_ it is quite logical there is a time compartment to it anyway. Now I'm thinking about ditching `StartDateTime` in favor of the shorter `StartDate`, despite that there is also a time part included. **Question** What is better: easier to read _vs_ being more explicit about that there is a time included? (ps: I guess this has a lot to do with C# not having separate objects for `Date` and `DateTime`, so that's where the need for Hungarian comes from)


Can I do a git merge entirely remotely?

My team shares a "work" branch and a "stable" branch. Whenever a particular work branch is approved for further testing/release/etc, we merge it into stable. No code is ever checked directly into the stable branch. Because of this, merge conflicts simply won't happen, and it seems silly to pull down the work branch and the stable branch, merge them, and then push the changes back. Is there a git command to ask a remote git server to commit a merge of two branches that it already knows about?


How should I structure a solution for a long term project?

I'm about to create a do-everything dashboard for my team and am still having second thoughts about my project/solution structure. Since this could be a long ongoing project, I want to get the structure right from the beginning. This is what I had in mind:   1. Create a solution named "doEverythingDashboard"   2. Delete the project named "doEverythingDashboard" under the solution "doEverythingDashboard"   3. Create winform project named "interface"   4. Create console applications projects for each functionality of "doEverythingDashboard"   5. Reference each console application in "interface" Does this make any sense? Would it make more sense to just have one project and create a class per functionality instead of an entire project?


How can I indicate if an object operates with another one in an UML class diagram?

Suppose I want to draw a class diagram of a DAO and an Entity. The DAO is used to load instances of the Entity from the database. How can I represent this relationship on my class diagram? Is this considered one? I think it should be displayed on the diagram somehow: ![enter image description here](http://i.stack.imgur.com/HUL9D.jpg) **TL;DR** : should I draw something between them or not?


Does a webapp need a connection monitoring feature?

I developing a client using Flex and ActionScript that is run in the browser and communicates with our server backend. There has been concern that the application "needs" to have a graphic indicator to show whether the client has a connection to the server or not. Part of the problem of this requirement is that is coming from a high-level perspective that because the interface looks "broken" (i.e. doesn't update properly). I have an idea where the problem is, but that doesn't mean that the error is in the interface. I believe that a connection monitor feature is unnecessary because:   1. Users won't be able to do squat. Our user base is largely non-technical.   2. Flex generates HTTP error events but does not specify what happened. I can't tell what _real_ problem is which could be:      * The user actually has no network connection.     * The application server code is broken in some way.     * The server itself is messed up (i.e. "Oops, I broke the Apache config").     * Server load is too high and becomes unresponsive.     * There is a some other problem (e.g. network or hardware) beyond my or users' control. How do I convince that this feature is not valuable to develop? If it is something worth keeping, what are alternatives to showing a "network status" or server connection problem in the client? I would rather spend the time to dig at the root of the problem and _prevent_ it from happening rather than creating an additional "feature" that doesn't solve anything.


Creating crossplatform TCP proxy/gateway that would handle maximum possible clients simultaneously on 1GB ethernet pipe?

So what I wonder about is preaty simple - having in mind next architecture:                        -> computing unit "A"             /      gateway --> computing unit "B" same as A             \              -> computing unit "C" same as A      We do not care to which unit to forward request so we should forward them one by one to A than to B than to C and than to A, etc. I wonder in what language, using what framework it is possible to create such crossplatform TCP proxy/gateway (not ethernet card dependent) that would redirect incoming requests into internal nodes via simple rool, and would be capable to get as much as possible from ethernet cable load in/out capabilety - receive and send as much as possible? I started to wonder after I read this nice 2003 article...


Who are 'users' in testing?

Having e.g. a system for booking flights, during UAT it is not being tested by real users (customers who will buy tickets) rather than people from the client side who will just simulate this. Are there any more specific terms to distinquish between real users (like end user) and users doing the UAT?


Writing a simple code validator

I know that programming languages can be defined in EBNF which can be converted into regular expressions. Right now I am working on a very simple BASIC interpreter for a project. The code has to be entered in a gui which should validate the syntax to later transfer the code to an embedded system where it is executed. I was googling to find an article or tutorial on writing a validator for this job but I could not really find such a thing. Is it just defining the regular expressions and try to match them? Note: the GUI part is written in Java while the embedded code is written in C++.


Main activity design too busy

I have a main activity that contains many buttons. I don't want to have a list of buttons like this. I know this looks bad, only cause I threw this together to show you what I have. As you can see, I really don't even have enough room. I don't want a `scrollView` in my main Activity. Does anyone have suggestions on building my activity to look sleek and simple? ![enter image description here](http://i.stack.imgur.com/JrZbM.png)


Is there any real benefit to Microsoft's application certification programs?

I'm developing a server application and am looking at Windows 2008 R2 **application** certification located here. Does application certification really make a difference to your application? Has anything tangible ever come from it in your experience? Are there any other certifications I should consider?


What do I need to make a messaging app?

I was wondering how to make a messaging app like whats app? What are the resources I need? What will I need yo know? I want to make it for iPhone's. I know some obj-c but that's really it...


Why is local copy writable by default in SVN, but readonly in Perforce/TFS?

I have some experience with Perforce, SVN, and TFS. For SVN, The source files were by default writable after synchronization. However, they were readonly for Perforce, as well as TFS if memory served me.   Meanwhile, 'checkout' means source sync for SVN but its meaning is quite different for other popular tools. I'm wondering which is more 'correct' behavior and why these tools behave differently.   Thanks.


Trimming script size by using array notation for frequently accessed properties

I noticed some redundancy in a script I ran through Google Closure Compiler.               (function(){function g(a){var k;if(a){if(a.call)a.prototype=j,a.prototype[e]={}}else a=     {};var c=a,b,c=(a=c.call?c:null)?new a(a):c;b=c[e]||{};var f=b.extend;b=b.a;var      d=c.hasOwnProperty("constructor")?c.constructor:b?b:f?g.b(f):new Function;if     (f)b=d.prototype,k=new h(h.prototype=f.prototype),f=k,h.prototype={},d.prototype=f,i     (d.prototype,b);i(d,a);i(d.prototype,c);return d.prototype.constructor=d}function i(a,c)     {for(var b in c)c.hasOwnProperty(b)&&"prototype"!=b&&b!=e&&(a[b]=c[b])}var h=new Function,     e="decl-data",j={extend:function(a){return(this[e].extend=a).prototype},a:function(a)     {return(this[e].a=a).prototype}};g.c=function(a){e=a};return g})().b=function(g){return      function(){g.apply(this,arguments)}};      It looks like a big sea of `prototype` and `constructor`, doesn't it? I was was able to get it to about 6/7 of the size of the original by storing "constructor" and "prototype" strings and using array notation everywhere to access prototypes and constructors. The size savings should grow as the size of the script grows. Here's what it looks like after the change:               (function(b,h){function i(a){a?a.call&&(a[b]=l,a[b][f]={}):a={};var d=a,c,d=(a=d.call?     d:null)?new a(a):d;c=d[f]||{};var g=c.extend;c=c.a;var e=d.hasOwnProperty(h)?d[h]:c?c:g?i.b     (g):new Function;if(g){c=e[b];var m=b,g=new j(j[b]=g[b]);j[b]={};e[m]=g;k(e[b],c)}k(e,a);k(e     [b],d);return e[b][h]=e}function k(a,d){for(var c in d)d.hasOwnProperty(c)&&c!=b&&c!=f&&(a     [c]=d[c])}var j=new Function,f="decl-data",l={extend:function(a){return(this[f].extend=a)     [b]},a:function(a){return(this[f].a=a)[b]}};i.c=function(a){f=a};return i})     ("prototype","constructor").b=function(b){return function(){b.apply(this,arguments)}};      Is it worth it to **damage readability to save a few bytes?** It's hard to know when to stop... `hasOwnProperty` only appears twice, I might use it once more. So, should I replace `.hasOwnProperty` with `[_has]`? Should I just stop here? Or should I put it back the way it was, and not worry about the few extra bytes? On the other hand, **maybe this doesn't damage readability** at all, and could just be looked at as convenient shortcuts. Another alternative would be abstracting the behavior **using macros** ; write `.prototype` and have it converted to `[_p]` at build time, of course declaring `_p` somewhere. But that seems overly complicated for a relatively minor size optimization. Speaking of which, I wonder why closure-compiler doesn't do something like this already? I'm curious what the community thinks about this. * * * For reference, the un-minified source before the size optimization:               var decl = (function(){          var Clone = new Function(), // dummy function for prototypal cloning         /** dataKey                  The name of the property where declaration objects'              metadata will be stored. If you want to pass objects to decl              instead of functions, put the metadata (parent, partial, etc.)              in this property.         */         dataKey = 'decl-data',              /** proto                  This object is used as a prototype for declaration objects,             so all properties are available as properties of `this`             inside the body of each declaration function.              */         proto = {                /** extend                    Perform prototypal inheritance by calling `this.extend(ParentCtor)`               within your decalration function.                    @param {Function} ctor to extend.                    @return {Object} prototype of parent ctor.           */           extend: function (ctor) {              return (this[dataKey].extend=ctor).prototype;            },                /** augment                    Finish a partial declaration.               TODO: test for bugs, possibly retroactively fix child classes when augmenting parent.                    @param {Function} ctor to augment.                    @return {Object} prototype of partial ctor.           */           augment: function (ctor) {              return (this[dataKey].augment=ctor).prototype;            }              };               /** decl              Create a prototype object and return its constructor.              @param {Function|Object} declaration     */     function decl (declaration) {       if (!declaration) {         declaration = {};       }       else if (declaration.call) {         declaration.prototype=proto;         declaration.prototype[dataKey]={};       }       return getCtor(declaration);     }          /** setDataKey              Sets the name of the property where declaration objects'          metadata will be stored. If you want to pass objects to decl          instead of functions, put the metadata (parent, partial, etc.)          in this property.              @param {String} String value to use for dataKey     */     decl.setDataKey = function (value) { dataKey=value; };          /** clone              Create a copy of a simple object.              @param {Object} obj              @return {Object} clone of obj.          */     function clone (object) {       var r=new Clone(Clone.prototype=object);       Clone.prototype={};       return r;     };          /** merge              Merge src object's properties into target object.              @param {Object} target object to merge properties into.              @param {Object} src object to merge properties from.              @return {Object} target for chaining.          */     function merge (target, src) {        for (var k in src) {         if (src.hasOwnProperty(k) && k!='prototype' && k!=dataKey) {             target[k] = src[k];         }       }       return target;     };          /** getCtor              Prepare a constructor to be returned by decl.              @param {Function|Object} declaration              @return {Function} constructor.          */     function getCtor (declaration) {           var oldProto,           declFn = declaration.call ? declaration : null,           declObj = declFn ? new declFn(declFn) : declaration,            data = declObj[dataKey] || {},           parent = data.extend, partial = data.augment,            ctor =  // user-defined ctor                    declObj.hasOwnProperty('constructor') ? declObj.constructor :                    // ctor already defined (partial)                     partial ? partial :                    // generated wrapper for parent ctor                   parent ? decl.wrap(parent) :                    // generated empty function                   new Function();             // If there's a parent constructor, use a clone of its prototype       // and copy the properties from the current prototype.       if (parent) {         oldProto = ctor.prototype;         ctor.prototype = clone(parent.prototype);         merge(ctor.prototype, oldProto);       }            // Merge the declaration function's properties into the constructor.       // This allows adding properties to `this.constructor` in the declaration function       // without defining a constructor, or before defining one.       merge(ctor, declFn);            // Merge the declaration objects's properties into the prototype.       merge(ctor.prototype, declObj);            // Have the constructor reference itself in its prototype, and return it.       return (ctor.prototype.constructor=ctor);     };          return decl;          }());          // This is outside of the main closure so wrapper functions     // will have as short a lookup chain as possible.          /** wrap              Generate wrapper for parent constructor.              @param {Function} parent constructor to wrap.              @return {Function} child constructor.          */     decl.wrap = function (parent) {       return function(){ parent.apply(this, arguments); };     };      And after:               var decl = (function(_p, _c){          var Clone = new Function(), // dummy function for prototypal cloning              /** dataKey                  The name of the property where declaration objects'              metadata will be stored. If you want to pass objects to decl              instead of functions, put the metadata (parent, partial, etc.)              in this property.         */         dataKey = 'decl-data',              /** proto                  This object is used as a prototype for declaration objects,             so all properties are available as properties of `this`             inside the body of each declaration function.              */         proto = {                /** extend                    Perform prototypal inheritance by calling `this.extend(ParentCtor)`               within your decalration function.                    @param {Function} ctor to extend.                    @return {Object} prototype of parent ctor.           */           extend: function (ctor) {              return (this[dataKey].extend=ctor)[_p];            },                /** augment                    Finish a partial declaration.               TODO: test for bugs, possibly retroactively fix child classes when augmenting parent.                    @param {Function} ctor to augment.                    @return {Object} prototype of partial ctor.           */           augment: function (ctor) {              return (this[dataKey].augment=ctor)[_p];            }              };               /** decl              Create a prototype object and return its constructor.              @param {Function|Object} declaration     */     function decl (declaration) {       if (!declaration) {         declaration = {};       }       else if (declaration.call) {         declaration[_p]=proto;         declaration[_p][dataKey]={};       }       return getCtor(declaration);     }          /** setDataKey              Sets the name of the property where declaration objects'          metadata will be stored. If you want to pass objects to decl          instead of functions, put the metadata (parent, partial, etc.)          in this property.              @param {String} String value to use for dataKey     */     decl.setDataKey = function (value) { dataKey=value; };          /** clone              Create a copy of a simple object.              @param {Object} obj              @return {Object} clone of obj.          */     function clone (object) {       var r=new Clone(Clone[_p]=object);       Clone[_p]={};       return r;     };          /** merge              Merge src object's properties into target object.              @param {Object} target object to merge properties into.              @param {Object} src object to merge properties from.              @return {Object} target for chaining.          */     function merge (target, src) {        for (var k in src) {         if (src.hasOwnProperty(k) && k!=_p && k!=dataKey) {             target[k] = src[k];         }       }       return target;     };          /** getCtor              Prepare a constructor to be returned by decl.              @param {Function|Object} declaration              @return {Function} constructor.          */     function getCtor (declaration) {           var oldProto,           declFn = declaration.call ? declaration : null,           declObj = declFn ? new declFn(declFn) : declaration,            data = declObj[dataKey] || {},           parent = data.extend, partial = data.augment,            ctor =  // user-defined ctor                    declObj.hasOwnProperty(_c) ? declObj[_c] :                    // ctor already defined (partial)                     partial ? partial :                    // generated wrapper for parent ctor                   parent ? decl.wrap(parent) :                    // generated empty function                   new Function();             // If there's a parent constructor, use a clone of its prototype       // and copy the properties from the current prototype.       if (parent) {         oldProto = ctor[_p];         ctor[_p] = clone(parent[_p]);         merge(ctor[_p], oldProto);       }            // Merge the declaration function's properties into the constructor.       // This allows adding properties to `this.constructor` in the declaration function       // without defining a constructor, or before defining one.       merge(ctor, declFn);            // Merge the declaration objects's properties into the prototype.       merge(ctor[_p], declObj);            // Have the constructor reference itself in its prototype, and return it.       return (ctor[_p][_c]=ctor);     };          return decl;          }('prototype', 'constructor'));          // This is outside of the main closure so wrapper functions     // will have as short a lookup chain as possible.          /** wrap              Generate wrapper for parent constructor.              @param {Function} parent constructor to wrap.              @return {Function} child constructor.          */     decl.wrap = function (parent) {       return function(){ parent.apply(this, arguments); };     };


Agile for the Solo Developer

How would someone implement Agile process concepts as a solo developer? Agile seems useful for getting applications developed at a faster pace, but it also seems very team oriented...


Using Agile development in a one person team

> **Possible Duplicate:**   >  Agile for the Solo Developer I am going to be starting a project soon and plan to use as much of agile methods as I can (CI, TDD etc.). What have been people's experiences doing agile development when working solo? I want to get good practices in place now while its a one person team so when I scale up to having several people the basics are in place.


Agile methodology for a single developer working on a prototype

> **Possible Duplicate:**   >  Agile for the Solo Developer For my thesis I will be working on a user interface prototype during a 6 month period. I am required to pick a strategy and create a precise planning. While reading through different descriptions of agile methodologies I felt like I'm in buzz-word heaven. Instead of just picking one because it's famous, I was hoping someone could give some insight into which one/or which parts of it might be useful. Are there any agile methodologies specifically suitable (or scalable) for single developers?


How can a single developer make use of Agile Methods?

I am a freelancer and work as a single developer. In all cases, I am the person wearing different hats. I am the Scrum Master and I am the only person in the development. What I am not is the Product Owner? Are there any Agile Methods and free tools that a freelancer can make use of?


How can a single person use agile method? for software application

I am looking to do a personal project on a web application. on my methods section I'm finding it difficult to choose just one Agile Method so here is the list I am trying to combine those or just a few of those to one method that works best for me.   * Scrum (I noticed for this one it requires a team of minimum of seven)   * XP (Extreme Programming)   * Crystal   * FDD (Feature dive n development)   * DSDM (Dynamic System Development Method)   * Adaptive Software Development   * RUP (Rational Unified Process) for example I was thinking something like split from scrum simple design (KISS) from eXtreme Programming only 19 weeks for this project so DSDM and TIMEBOXING USE cases etc.?


Whats the best way to build a HTML/AJAX site that requires login?

Let's say that hypothetically you wanted to build a website that delivered content to the visitors entirely using HTML and Javascript (AJAX to fetch server side data). The site would require login for certain functions. Let's also say, for the sake of discussion, you have the ability to create necessary web service methods that would be called from AJAX (for authenticating a user, getting data from a database, etc). What would be the best way to implement this site? Would there be any advantages / drawbacks compared to building a site using a server side language like ASP.NET or PHP? **EDIT 1** First, thanks to everyone that has replied so far. I didn't properly phrase my question so I'm getting responses that aren't addressing my question. I've built many sites using traditional methods - a database backend and a frontend that was a mix of server side languages (.NET or PHP) and client side scripting JavaScript / jQuery. Let's say I'm going to build an environment that has a database server, a web services server, and a web server. My web services server has all the methods I need to interact with the database (authentication, CRUD operations, reporting, etc). The web server does not support any server side languages (like PHP or ASP.NET). I know it would be possible to build the site entirely in HTML, CSS, and JavaScript (jQuery). A user could be authenticated via AJAX, the authentication token could be stored in a cookie, and then token could be used on all subsequent AJAX requests. My questions are:   1. What would be the advantages / drawbacks of such an approach?   2. What challenges would be faced with authentication and security?   3. Would this solve any of the problems typically faced when building a website?   4. If your boss was asking you to use this environment, would you argue against it? Why or why not?


Tips and Tricks on Web Page Design on ASP.NET MVC (Razor Syntax)

I am a newbie in web development and have started studying ASP.NET MVC. I noticed that cshtml replaces aspx when using Razor syntax and design view is not supported. Now designing ASP.NET MVC webpages is difficult without design view. How do you handle your web page fesigns in your projects without it?


Reading CSV files located on a Linux server and updating the tables in a SQL Server database

I was wondering how we could ingest CSV files located on a Red Hat Linux server into SQL Server database tables. I know we can write a stored procedure/bulk insert to read the files that are located on the same Windows server as SQL Server and update the database, but not sure how to do it when the files are present on a Linux server. Any help would be greatly appreciated.


Good naming convention for named branches in {DVCS} of your choice

We're integrating Mercurial slowly in our office and doing web-development we started using named branches. We haven't quite found a good convention as far as naming our branches though. We tried:   * FeatureName (Can see this causing problem down the line)   * DEVInitial_FeatureName (Could get confusing when developer come and go down the line)   * {uniqueID (int)}_Feature So far the uniqueID_featureName is winning, we are thinking of maintaining it in a small DB just for reference. It would have: branchID(int), featureName(varchar), featureDescription(varchar), date, who etc... This would give us branches like: 1_NewWhizBangFeature, 2_NowWithMoreFoo, ... and we would have an easy reference as to what that branch does without having to check the log. Any better solution out there?


Prefer class members or passing arguments between internal methods?

Suppose within the private portion of a class there is a value which is utilized by multiple private methods. Do people prefer having this defined as a member variable for the class or passing it as an argument to each of the methods - and why? On one hand I could see an argument to be made that reducing state (ie member variables) in a class is generally a good thing, although if the same value is being repeatedly used throughout a class' methods it seems like that would be an ideal candidate for representation as state for the class to make the code visibly cleaner if nothing else. Edit: To clarify some of the comments/questions that were raised, I'm not talking about constants and this isn't relating to any particular case rather just a hypothetical that I was talking to some other people about. Ignoring the OOP angle for a moment, the particular use case that I had in mind was the following (assume pass by reference just to make the pseudocode cleaner)               int x     doSomething(x)     doAnotherThing(x)     doYetAnotherThing(x)     doSomethingElse(x)      So what I mean is that there's some variable that is common between multiple functions - in the case I had in mind it was due to chaining of smaller functions. In an OOP system, if these were all methods of a class (say due to refactoring via extracting methods from a large method), that variable could be passed around them all or it could be a class member.


What is the definition of pointer?

Conceptually a "pointer" is just something that "points" to something else;Is this definition is sufficient to tell exactly what a pointer is in programing languages? Does it need to have any other features? Programmers who come from specific language may have pre-conceived ideas of what constitutes a 'pointer' based on how it is used in the language So let say if he is from **c/c++** language, he say's pointers supports pointer arithmetic.Is pointer arithmetic an essential feature of a pointer? **Go** has pointers and does not support pointer arithmetic. Is the ability to "dereference" the pointer essential to the concept of a pointer? So what is the precise definition of a pointer that I can give as an answer, irrespective of any specific programming language?


When does switching to a framework mid-project make sense?

Some of my friends and I started a PHP project some weeks ago. In the beginning, I suggested we use a PHP framework such as CodeIgniter or Zend. But my friends wanted to start clean and without the overhead or extra complexity. But as time has passed, the project has become more and more complex. At first, we wrote all the code in the view files, in code blocks before the HTML output. Eventually, we changed direction and started to use controllers that did most of the work. But as you can see there is a coding difference here. At this point, we're trying to determine how to proceed before the project becomes more complex. When does it make sense to start over and use a framework? Or is it possible to formulate a simple way to introduce an MVC pattern to our existing code without having to start from scratch?


What should I do when my project manager does not care about implementation details?

My project manager, when providing requirements for specific tasks, does not care about the implementation details. Although he has a programming background and has some knowledge of the MVC framework, he does not consider the perspective of the developer. For example, I was given a task to create a simple form in ASP.NET MVC. This form should be pluggable - that is, the customer should choose which fields do or do not exist and which fields are required. If this were a simple form with validation, I would easily be able to implement it using ASP.NET validations. However, the problem is not simple and requires design and architecture first. The time that I have to implement the solution, which is not well understood, is very restricted. Not having sufficient time will not let me come upwith a solution that meets the requirements, but also benefits myself and any future developers. What should I do in this situation? Do you feel that given requirements in the example can be expected from a single developer?


Should newbies use IDE autocomplete (Intellisense)?

I often encounter this when I am helping out someone who is new to programming and learning it for the first time. I'm talking about really new newbies, still learning about OOness, constructing objects, method calls and stuff like that. Usually, they have the keyboard and I am just offering guidance. On the one hand, the autocomplete feature of the IDEs helps to give them feedback that they are doing it right and they quickly get to like and rely on it. On the other hand, I fear that early dependence on the IDE autocomplete would make them not really understand the concepts or be able to function if they one day find themselves only with a simple editor. Can anyone with more experience in this regard please share their opinion? Which is better for a newbie, autocomplete or manual typing? **Update** Thanks for the input everyone! Many answers seem to focus on the main use of autocomplete, like completing methods, providing methods lookup and documentation etc. But IDEs nowadays do a lot more like.   * When creating an object of List type, an IDE autocompletes to new ArrayList on right hand side. It may not be immediately clear to a newbie why it cannot be new List, but hey it works, so they move on.   * Filling method parameters based on local variables in context.   * Performing object casts   * Automatically adding 'import' or 'using' statements and much more. These are the kinds of things I mean. Remember I'm talking about people who are doing Programming 101, really just starting. I have watched the IDE do these things which they have no idea about, but they just carry on. One could argue that it helps them focus on program flow and getting the hang of things first before going in-depth and understanding the nuances of the language, but I'm not sure.


Forgetting basic language functions due to use of IDE, over reliance?

> **Possible Duplicate:**   >  Should newbies use IDE autocomplete (Intellisense)?   >  Is it wrong or bad to use autocomplete? Having used an IDE for the last 3-4 years, the other day a few of my coworkers and I came to a fairly sad realization that we had forgotten some basic Java methods/functions because we always relied on our IDE (Eclipse/STS/IntelliJ) to complete them for us (such as what a function takes in terms of parameters), is this a sign that our skills are deteriorating, that we're over relying on IDEs? (This whole discussion came about us talking about taking the Oracle Java 7 EE certification test and looking over a few practice questions, questions such as, what parameters does function X take, etc) If so, how do you guys fight off this sort of thing? Just re-read books and stuff? I myself can't imagine not coding with an IDE because in all honesty, it does make me code a lot faster with things such as auto complete, etc while some of my co-workers suggested we code sans IDE for a few months. I do realize that sometimes one doesn't need to know everything about a function, but I do remember a college professor telling us that IDEs are terrible because when the time comes that you need some sort of function, you'll have to waste time looking it up instead of just banging out the code from rote memory.


Is there any evidence that Intellisense reduces productivity?

> **Possible Duplicate:**   >  Should newbies use IDE autocomplete (Intellisense)? I was having a conversation with another developer the other night about the pros and cons of Visual Studio. He was of the opinion that Intellisense reduces productivity. Of course I thought that was insane but I could be wrong. Is there any evidence to support the idea that Intellisense reduces productivity?


Does relying on intellisense and documentation a lot while coding makes you a bad programmer?

Is a programmer required to learn and memorize all syntax, or is it ok to keep handy some documentation? Would it affect the way that managers look at coders? What are the downside of depending on intellisense and auto-complete technologies and pdf documentation?


Do programmers (using an IDE) need to know namespaces?

I got into a discussion with a coworker over an interview question that was asked of a potential employee. "Name some namespaces/what do they do/what namespace is involved with x". I'm of the opinion that programmers don't really need to know that kind of stuff, especially with the use of an IDE and extremely accessible documentation. He feels that a programmer with experience should be able to name namespaces. This is valid, I suppose, especially if you're looking to hire someone into a more experienced position. They don't particularly need to memorize namespaces, but anyone that has experience should be able to rattle off some namespaces and what their purpose is. What are your thoughts on this?


Is it a good idea to generate code with the help of your IDE?

> **Possible Duplicate:**   >  Should newbies use IDE autocomplete (Intellisense)? Since I moved on to actual IDEs for C++, Java and Python, I noticed they automatically try to complete my code. For example if I write `System.out.pr[...]` I am automatically offered a list from which I can select the item I want to use. As a beginner I avoided using this feature as I thought I should learn the syntax by typing. Was I correct in thinking that? From a more experienced programmer's point of view, I'd see no harm in using this feature.


What should I learn in Java SE before proceeding to Java EE?

Currently, I've learned the following in Java SE:   * Logical Operations   * Loops   * Inheritance   * Polymorphism   * Abstract Classes   * Interface I'm currently learning Strings, Characters and Regular Expressions. What are things that I should learn before proceeding to Java EE?


Academic programming languages?

Back in the day, there were a lot of academic programming languages (okay, maybe not a _lot_ , but it seems like there were more than today). I distinctly remember spending time in both high school and college learning languages like Basic, Ada, Pascal, Prolog, Haskell, Scheme, and Turing. While it's unfair to call all those languages solely academic, it's also unfair to say they are industrially equivalent to an enterprise language like Java (or even C or Smalltalk back in the day). My question is, what academic languages are still in use (and still taught today)? It seems like there's a lot of Java schools, and a rising number of Python schools, and even some that teach languages like C as the first programming language - but what would be the modern equivalent to something like Pascal?


What can I gain from examining others code?

I recently downloaded some large code bases and have had light reads through them, but what can I gain from this? How can I be sure what the author is doing is the right way to go about things? (One of the the code bases was the Zeus Trojan source code ;D)


What do employers look for in self-taught applicants?

I'm a self-taught programmer about to enter the job market. What I want to know is what is the best way to show my experience to employers? What do employers want to know about my programming experience? Do employers want to look at code I wrote or could they want to see the software in action? Or do they only care how much my software is being used/how much it has created revenue? Should I write about my design and programming style? My background: I recently graduated from a university where I studied foreign languages, and it was during this time when I found out that programming is the thing I really want to do. Currently I'm a garage programmer, developing a software for a client for commercial use while continuing to self-teach myself, but my aim is to start a "proper" employment and career. As an added twist I live in Finland at the moment, but I'm looking for employment in China or Japan (I learned both languages while studying abroad). Any help is greatly appreciated!


Kind of project for pair programming interview

As discussed in the SO question Pair Programming for a job interview, there are mixed feelings on the usefulness of this approach. For those that have used this approach, what kind of projects are useful? From my limited experience with this as an interviewee, a key seems to be a well chosen task that the candidate can understand quickly and be able to contribute to (and the latter may depend somewhat on the candidate's background). I've gone through a couple days of pairing interviews and found some periods to seem like a few hours were wasted: one because the developer wasn't working on something that lent itself to pairing (messy code that the developer wasn't very familiar with and was already interacting with someone about) and involved a tech I wasn't very familiar with. Another case was because an unexpected build issue prevented much useful work for a long while. One shop trying this approach wasn't sure if they should have someone outside the company work on a customer's project - any thoughts on this? They also worried that explaining the domain and system would take too long, though without that the candidate may not be able to contribute much. So they chose an open source project the employee was working on, though that's likely not an option for everyone. Recently, there have been a lot of folks working on _coding katas_ for various things. I'm wondering if this would be a useful thing to use. Some sites even have them in multiple languages and multiple skill levels (e.g. http://codingkata.org), which could be useful for candidates and/or employees with different backgrounds. [I guess coding katas could be used even for coding exercises in non-pairing interviews - I'll ask a separate question on that: What coding katas are good for interview exercises]


Reading SICP with F#?

I've been meaning to read the SICP book for a while, and am finally about to get around to it (now that I can read it on Kindle :) I'd like to learn a functional language, and I use C# at work so thought it might be a good idea to go through the book with F# in my mind rather than Scheme. (That is, do the exercises in F#.) I wonder though, will there be much mental disjoint between Scheme and F#? Maybe it's better to go through with Scheme on the first pass?


Should a .NET, JavaScript and SQL Web App developer learn Perl?

I'm a front and backend .NET web developer (most solutions use MS SQL Server) and I won't be using any non-MS solutions for a while. Will Perl be useful for situations that require scripting in an MS product environment?


We have a custom program that generates all the stored procs and classes for the Data Tier. Where will I put the generated classes?

This is more of an architectural question regarding MVC and Data Access: We have a custom program that generates all the stored procs and classes for the Data Tier from the MS SQL database. It's pretty nice as it generates a base class with the basic CRUD operations which includes ForeignKey reads. It also generates the plural version of the class to return the collections of objects. For the next phase of our application we are planning on using MVC but we were hoping to continue using this great tool. Where will I put the generated classes in my new MVC application? I have seen people create an Infrastructure folder for their data access logic. Is it a good idea to continue using this tool or should we be converting to the Entity Framework? Also if the DAL is returning my objects and lists of objects what will I put in my Model layer?


Principles of an extensible data proxy

There is a growing industry now with more than 30 companies playing in the Backend-As-A-Service (BaaS) market. The principle is simple: give companies a secure way of exposing data housed on premises and behind the firewall publicly. This can include database data, as well as Legacy PC data through established connectors; SAP for example provides a connector for transacting with their legacy systems. Early attempts were fixed providers for specific systems like SAP, IBM or Oracle, but the new breed is extensible, allowing Channel Partners and Consultants to build robust integration applications that can consume whatever data sources the client wants to expose. I just happen to be close to finishing a Cloud Based HTML5 application platform that provides robust integration services, and I would like to break ground on an extensible data proxy to complete the system. From what I can gather, I need to provide either an installable web service of some kind, or a Cloud service which the client can configure with VPN for interactions. Then I can build in connectors, which can be activated with a service account, and expose those transactions via web services of some kind (JSON, SOAP, etc). I can also provide a framework that allows people to build in their own connectors, and use some kind of schema to hook those connectors into the proxy. The end result is some kind of public facing web service that could securely be consumed by applications to show data through HTML5 on any device. My gut is, this isn't as hard as it sounds. Almost all of the 30+ companies (With more popping up almost weekly) have all come into existence in the last 18 months or so, which tells me either the root technology, or the skillset to create the technology is in abundance right now. Where should I start on this? Are there some open source projects I can leverage? A specific group of developers I can hire? I'm confident someone here can set me on the right path and save me some time. You don't see this many companies spring up this rapidly if they are all starting from scratch with proprietary technology. The Register: WTF is BaaS One Minute Video from Kony on their BaaS


How do you test a data load?

I'm working on a project that involves loading batches of 3000+ files to several dozen tables. There is no user interface, and the tables are simply available for querying. What are the best practices for testing this type of process?   * Loading a small set of data and validating each and every member?   * Loading all the data and validating a subset?   * Loading all the data and validating counts, averages, and other metrics? Are there other types of testing that can be done, or is some combination best?


Diagram that could explain a state machine's code?

We have a lot of concepts in making diagrams like UML and flowcharting or just making up whatever boxes-and-arrows combination works at the time, but I'm looking at doing a visual diagram on something that's actually _really_ complex. State machines like those that parse HTML or regular expressions tend to be very long and complicated bits of code. For example, this is the stateLoop for FireFox 9 beta. It's actually generated by another file, but this is the code that runs. How can I diagram something with the complexity of this in a way that explains flow of the code without taking it to a level where I draw every single line- of-code into it's own box on a flowchart? I don't want to draw "Invoke loop, then return" but I don't want to explain every last detail. What kind of graph is suitable to do this? Is there already something out there similar to this? Just an example of how to do this without going overboard in complexity or too-high-level is really what I want. * * * If you don't feel like looking at the code, basically it's 70 different state flags that could occur, inside an infinite loop that exists to a label based on some conditions, each flag has it's own infinite loop that exists to a label somewhere, and each of those loops has checks for different types of chars, which then runs off into various other methods.


Algorithm to reduce calls to mapping API

A random distribution of points lies on a map. This data lies behind an API, and I want to grab the complete set of points within a given bounding box. I can query the API with the bounding box and the API will return the set of points that fall within that box. The problem is that the API will limit the result set to 10 items, with no pagination and no indication if there are more points that have been omitted. So I made a recursive algorithm that takes a bounding box and requests the points that lie within it. If the result set is exactly 10 items, then I split the bounding box into four quadrants and recurse. It works fine but my question is this: if want to minimize the number of API calls, what is the optimal way to split the bounding box? Splitting it into quadrants was just an arbitrary decision. When there are a lot of points on the map, I have to drill down many levels before I start getting meaningful results. So I imagine it might be faster to split the box into, say, 9, 16, or more sections. But if I do that, then I eventually get to a point where a lot of requests are returning 0 results which isn't so efficient. Also, does the size of the limit on the results set affect the answer? (This is all assuming that I have no prior knowledge of nominal point density in the bounding box)


Should XmlDocument.xml be Included in Source Control

In a Web API 2 project, in the project properties, I have enabled the output of an XML documentation file. By default, Visual Studio 2013 wants to check this into TFS. I'm pretty sure that I'm going to exclude it, but wondered what the general opinion is on this?


Confused about modifying the sprint backlog during a sprint

I've been reading a lot about scrum lately, and I've found what seem to me to be conflicting information about whether or not it's ok to change the sprint backlog during a sprint. The Wikipedia article on scrum says it's not ok, and various other articles say this as well. Also my Software Development professor taught the same thing during an overview of scrum. However, I read Scrum and XP from the Trenches and that describes a section for unplanned items on the taskboard. So then I looked up the Scrum Guide and it says that during the sprint "No changes are made that would affect the Sprint Goal" and in the discussion of the Sprint Goal "If the work turns out to be different than the Development Team expected, then they collaborate with the Product Owner to negotiate the scope of Sprint Backlog within the Sprint." It goes on to say in the discussion of the Sprint Backlog: > The Sprint Backlog is a plan with enough detail that changes in progress can > be understood in the Daily Scrum. The Development Team modifies Sprint > Backlog throughout the Sprint, and the Sprint Backlog emerges during the > Sprint. This emergence occurs as the Development Team works through the plan > and learns more about the work needed to achieve the Sprint Goal. > > As new work is required, the Development Team adds it to the Sprint Backlog. > As work is performed or completed, the estimated remaining work is updated. > When elements of the plan are deemed unnecessary, they are removed. Only the > Development Team can change its Sprint Backlog during a Sprint. The Sprint > Backlog is a highly visible, real-time picture of the work that the > Development Team plans to accomplish during the Sprint, and it belongs > solely to the Development Team. So at this point I'm altogether confused. Thinking about it, it makes more sense to me to take the second approach. The individual, specific items in the backlog don't seem to me to be the most important thing, but rather the sprint goal, so not changing the sprint goal but being able to change the backlog makes sense. For instance if both the product owner and the team thought they were on the same page about a story, but as the sprint progressed they figured out there was a misunderstanding, it seems like it makes sense to change the tasks that make up that story accordingly. Or if there was some story or task that was forgotten about, but is required to reach the sprint goal, I would think it would be best to add the story or task to the backlog during the sprint. However, there are a lot of people who seem quite adamant that any change to the sprint backlog is not ok. Am I misunderstanding that position somehow? Are those folks defining the sprint backlog differently somehow? My understanding of the sprint backlog is that it consists of both the stories and the tasks they're broken down into. Anyway I would really appreciate input on this issue. I'm trying to figure out both what the idealistic scrum approach is to changing the sprint backlog during a sprint, and whether people who use scrum successfully for development allow changing the sprint backlog during a sprint.


Why can't we get anything done?

I work on a small team, in a medium-sized company, most of which isn't involved in software development. I'm the newest and least-experienced developer and had no professional or academic background in software before starting, but I'm quite pleased with how respected my input is and am grateful for being taken seriously at such an early stage in my career. Still, I feel like I should be doing more with this generous amount of airtime. As a team, we seem to have trouble getting things done. I'd like to be able to suggest something to improve the situation, and I think I'd be listened to if it was a good idea, but I'm at a loss for what to suggest. Things I can identify as being issues include:   * Specification of the tasks at hand is sparse. This is partly because management is a bottleneck and we don't have the money or people to commit to working out detailed requirements as much as we'd like. It's also partly because the software we're developing is investigative and the precise method isn't clear until it's demonstrated and used to determine its effectiveness.   * The Lead Dev is very fond of what he calls 'prototyping' to the point that he's lately started insisting that everything is 'prototyped', which to the rest of us looks like writing bad code and giving it to the modellers to play with. It isn't clear what he expects to come out of this exercise in many cases. The 'actual' implementation then suffers because of his insistence that good practice takes too much time from the prototyping. I haven't even begun to be able to untangle this twisted logic and I'm not sure I want to try.   * The modellers are expected to tell us everything about the desired methodology in precise detail, and it's taken on absolute trust that what they come out with is theoretically flawless. This is hardly ever true, but no action is taken to rectify this situation. Nobody on the modelling side raises any concerns in a structured way that is likely to be acted upon, nor do they seek guidance in applying best practices. Nothing is done about their passivity either.   * I've tried to push TDD in the team before, but found it difficult as it's new to me and while those with oversight of my work were willing to tolerate it, no enthusiasm has been forthcoming from anyone else. I can't justify the amount of time I spend wallowing and not finishing features, so the idea has - for the moment - been abandoned. I'm concerned it won't be picked up again, because nobody likes to be told how to do their job.   * We now have a continuous integration server, but it's mostly only being used to run multiple-hour regression tests. It's been left open that it ought to be running full-coverage unit and integration tests as well, but at the moment nobody writes them.   * Every time I raise the issue of quality with the lead dev, I get an answer to the effect of 'Testing feature A is straightforward, feature B is much more important to the user but too difficult to test, therefore we shouldn't test feature A'. Once again I've made no headway in trying to untangle this logic.  ....phew. When I phrase it like that, it looks much worse than I thought. I suppose, as it turns out, this is a cry for help.


What visualization method would you recommend for event driven programs? Are there industry standard diagrams, such as flowcharts?


How to properly understand django framework?

I have decent knowledge of php, i.e., I can take a framework, read its code and if the docs are adequate, understand what its doing. Main reason for that is that php is actually a very easy language which is literally made for web- dev.   I have been trying to learn django for a week now, can knock up a basic app with it, but there are just too many things which go over my head, i.e, look like magic, reason for that , i think is that the whole interaction with the server thing is part of django, which is all handled by your server in php, I want to read more about this part, i.e. what all topics should i cover to 'get' this. please suggest some books too


Identifying languages used by particular industries

> **Possible Duplicate:**   >  What technologies are used for Game development now days? I am new to programming and I don't know the differences between the major languages. I desperately want to get into the gaming industry because I have so many stories I want to tell and so many experiences I want to create. I currently do 3D modeling/animation, so any similarities would be helpful. What steps should I take to investigate an industry (gaming) and the companies within that industry? How do I identify what programming languages they use, so I can study them?


Beginner programmer wants to work his way up to game development

I've taken a course in computer science that covered basics about java and programming from conditionals and loops to inheritance and interfaces. I also got Head First Java from a friend who didn't write in it. After I finish that book, what should I do before I head into developing games? Also, I've been just making command line games and math programs for now. Is that good practice? I'm just worried that I will only be repeating things that I already know, and that I won't be learning anything new.


How relevant is UTF-7 when it comes to parsing emails?

I recently implemented incoming emails for an application and boy, did I open the gates of hell? Since then every other day an email arrives that makes the app fail in a different way. One of those things is emails encoded as UTF-7. Most emails come as ASCII, some of the Latin encodings, or thankfully, UTF-8. Hotmail error messages (like email address doesn't exist or quota exceeded) seem to come as UTF-7. Unfortunately, UTF-7 is not an encoding Ruby understands:               > "hello world".encode("utf-8", "utf-7")     Encoding::ConverterNotFoundError: code converter not found (UTF-7 to UTF-8)          > Encoding::UTF_7      => #<Encoding:UTF-7 (dummy)>       My application doesn't crash, it actually handles the email quite well, but it does send me a notification about the potential error. I spent some time googling and I can't find anyone that implemented the conversion, at least not as a Ruby 1.9.3 Encoding::Converter. So, my question is, since I never got an email with actual content, from an actual person, in UTF-7, how relevant is that encoding? can I safely ignore it?


Is using a bigger buffer useful?

I use buffer for quite a long time when I need to copy a stream or read a file. And every time I set my buffer size to 2048 or 1024, but from my point of view a buffer is like a "bucket" which carries my "sand" (stream) from one part of my land (memory) to an other part. So, increase my bucket capacity will in theory allow me to do less travel? Is this a good things to do in programming?


Are all languages basically the same?

Recently, i had to understand the design of a small program written in a language i had no idea about (ABAP, if you must know). I could figure it out without too much difficulty. I realize that mastering a new language is a completely different ball game, but purely understanding the intent of code (specifically production standard code, which is not necessarily complex) in any language is straight forward, if you already know a couple of languages (preferably one procedural/OO and one functional). Is this generally true? Are all programming languages made up of similar constructs like loops, conditional statements and message passing between functions? Are there non-esoteric languages that a typical Java/Ruby/Haskell programmer would not be able to make sense of? Do all languages have a common origin?


How to correctly write an installation or setup document

I just joined a small start-up as a software engineer after graduation. The start-up is 4 year old, and I am working with the CEO and the COO, even if there are some people abroad. Basically they both used to do almost everything. I am currently on some kind of training phase. I have at my disposition architecture, setup and installation internal documentation. Architecture documentation is like a bible and should contain complete information. The rest are used to give directions in different processes. The issue is that these documents are more or less dated, as they just didn't have the time to change them. I will be in charge of training the next hires, and updating these documents is part of my training. In some there is a lot of hard-coded information like:                Install this_module_which_still_exists          cd this_dir_name_changed          cp this_file_name_changed other_dir_name_changed          ./config_script.sh           ./execute_script.sh      The issues i have faced :   * Either the module installation is completely different (for instance now there is an rpm, or a different OS)   * Either names changed, and i need to switch old names by new names   * Description of the purpose of the current step missing.   * Information about a whole topic is missing Fortunately these guys are around and I get all the information I want and all the explanations I need. I want to bring a design to the next documents so in the future people don't feel like they are completely rewriting a document each time they are updating it. Do you have suggestions? If there is a lightweight design methodology available online you can point me to it's nice too. One thing I will do for sure is set up a versioning repository for the documents alone. There is already one for the source code so I don't know why internal documents deserve a different treatment.


What are the difference between: agent, actor, dataflow based programming?

What are the difference between the following terms?   * agent-based programming   * agent-based programming with microagents   * actor-based programming   * actor-based programming with lightweight actors   * dataflow based programming It is hard to find comparing articles and they are very similar. Afaik they have different constraints and they are implemented on a different abstraction level, but I need some reassurance...


PHP - Repository matrix pattern?

I'm trying really hard to refactor some of my legacy code in the project using best practices and design patterns + DDD so I'd love some feedback on an issue I'm currently having. Let's assume that I have two entity classes:               class Dog     {         protected $name;              function __construct($name)         {             $this->name = $name;         }              /**          * @return mixed          */         public function getName()         {             return $this->name;         }              function bark()         {             echo 'Rawr';         }     }          class Husky extends Dog     {         /**          * @var Sledge          */         protected $sledge;              function __construct($name, Sledge $slegde)         {             parent::__construct($name);             $this->sledge = $slegde;         }              function pull()         {             echo $this->sledge->pull();         }     }      `Dog` is my regular entity and his only responsibility is to map database fields. `Husky` on the other hand has same responsibilities as dog but also delegates `Sledge` pulling. Normally, both entities would have different repositories (should they? Since one inherits from one another) to call for, however business requirement implies that client does not have to specify dog's type (so it can either be a "basic" `Dog` or special `Husky`), just its name `http://localhost/animal/fluffy`. What is more, currently they both reside in the same database table (recognized by `type` field) and right now there are no technical plans to change that (performance and time reasons). What is the best way to do it?   * Should I create some `AnimalRepository`, pull the data and treat it as DTO, detect it's type and then create appropriate class?   * Should I create some kind of higher abstraction level mapper? How should it look like?


What are the advantages and disadvantages of splitting teams by architecture tier rather than by product?

As the title states; what are the advantages and disadvantages of splitting teams by architecture tier rather than by product? **_For example:_** **Organization A** has three teams:   * Team Web and Front End   * Team APIs, Web-Services and Data Stuffs   * Team Embedded Stuffs _Organization A_ teams, over time, have become more specialized in their work rather than being truly full-stack developers. **Organization B** has three teams:   * Team Product Alpha   * Team Product Beta   * Team Product Charlie _Organization B_ has fostered an environment of full-stack developers that are all fairly interchangeable among one-another. What will **Organization A** be able to do better (and not so better) than **Organization B** , and vice versa? You don't necessarily need to take the examples to heart, as they were just to get the point of my question across.


What does "because IL offers no instructions to manipulate registers, it is easy for people to create new languages" mean?

I am reading CLR via C# and came across this sentence in the first chapter and I did not understand what exactly it meant. Full line here: > because IL offers no instructions to manipulate registers, it is easy for > people to create new languages and compilers that produce code targeting the > CLR. What does it mean? I ventured a guess that it means IL is a bit low level, but not too low so that it is easy to create languages on top of it.


Creating alien symbols or signs that look natural

I was reading some Cthulhu Mythos stuff and started to think about those various signs and symbols that are used in the texts. Of course those are made by humans but point is that they look natural to human eyes. So, what kind of algorithm would be needed to create natural looking symbols and signs? How this problem could be approached? I guess Golden ratio and Fibonacci numbers are in key role.


What is the best approach for deploying apps to companies

What is the best approach for the following scenario: 1) A publicly available app (available in app stores) which is used by end users to make use of services offered by multiple companies. 2) These companies maintain their services also using a mobile app. I'm not sure on how to solve the second part. Having one app for both enduser and admin functionality, secured by username/password doesn't sound like a good idea. This would leave the only option of developing a separate admin application for the companies. What is the best approach to deploy "admin" like mobile apps to companies only, for Android, iOS and Windows Phone? Some additional information: > Public App ----> Servers -----> Multiple Company Apps The public app shows all companies offering their services. An end user uses the public app to order something from a specific company. The order is sent to our servers. Our servers send the order to the associated company. This order is displayed on the company's admin app and given the option to accept the order.


What do you think about the Joel Test?

The Joel Test is a well known test for determining how good your team is. What do you think about the points? Do you disagree with any of them? Is there anything that you would add?


Good approaches for packaging PHP web applications for Debian

Many PHP web applications follow this model for installation and upgrade:   1. Un-tar a source tar ball.   2. Point Apache at the source.   3. Navigate a web browser to the home page.   4. Go through several web pages of set-up (e.g., checks for existence of libraries, asks for database connection information, creates or updates database schema, etc.).   5. User renames an `install/` directory to something else so that application knows it has been installed. I don't see any (simple) way to create a Debian package out of this without making the user installing the package go through many of the above manual steps. Note that I am not a developer on the application so I am not in a position to make direct change to how the application installation works. What is the typical approach to packaging such an application?


Variable declaration versus assignment syntax

Working on a statically typed language with type inference and streamlined syntax, and need to make final decision about syntax for variable declaration versus assignment. Specifically I'm trying to choose between:               // Option 1. Create new local variable with :=, assign with =     foo := 1     foo = 2          // Option 2. Create new local variable with =, assign with :=     foo = 1     foo := 2      Creating functions will use `=` regardless:               // Indentation delimits blocks     square x =         x * x      And assignment to compound objects will do likewise:               sky.color = blue     a[i] = 0      Which of options 1 or 2 would people find most convenient/least surprising/otherwise best?


Assigning development work effectively to enable parallel development

I am currently doing my 1st accademic project where we have to work in groups of 4 to develop an application (java ...). Anyways, how might work be assigned so that there is less dependencies on each other and we can work separately instead of waiting on one another? I suggested 1 person develop 1 layer: Model, View, Controller, Data Access. I am working on Data Access but I find I need Model classes: For example My `EventsDataAccess` has a `findEventByName(String name)` that returns an `Event`, which is developed by another person. How should I proceed? Here `Event` is a very small class so it shouldn't take long, but suppose its big, it might be a long wait? How is work usually split up for developers in a small to medium sized team? Its so much easier to work in say a very small familiar team with, say 2 persons only


Multiple burndown charts on TFS project page

we work with Scrum in TFS2013, with one main project and multiple teams. What I want to do is make the homepage for the project display each teams burndown chart, so management can easily see all teams progress. Currently it rolls up all the burndown charts into a single burndown, and if I create charts I can only get line / bar / pie charts that are far less effective at displaying the same information. Is it possible to pin burn down charts to home pages? Thanks.


Functional document from code

I am a Sr java Developer and have recently joined a new team. Here I have been asked to create a functional document looking at the code of a legacy application. This application was written about 8-10 years back, which is currently running in live environment but due to lack of documentation it is difficult to be setup and run on local development box. I consulted some of the old team members who support it, but none was able to run it on their dev boxes. Now I have to create a functional document out of it (with running it only looking at the code) which will act as a base to re-write this application with new technology and some enhancements. Kindly suggest what would be the best way to move forward? I tried to find out from testers and found that there is no tester currently allocated to this application as it's an old running app on live. There are not much enhancements or bugs coming up. Ans as this re-write project is already queued up, the management is looking into aligning any coming bugs to this new app.


C++ : Association, Aggregation and Composition

I'm beginning to study OOAD and I'm having difficulty finding a `C++` code example that'd illustrate how `Association`, `Aggregation` and `Composition` are implemented programmatically. (There are several posts everywhere but they relate to C# or java). I did find an example or two, but they all conflict with my instructor's instructions and I'm confused. My understanding is that in:   * **Association:** Foo has a pointer to Bar object as a data member    * **Aggregation:** Foo has a pointer to Bar object and data of Bar is deep copied in that pointer.    * **Composition:** Foo has a Bar object as data member. And this is how I've implemented it:               //ASSOCIATION     class Bar     {         Baz baz;     };     class Foo     {         Bar* bar;         void setBar(Bar* _bar)         {             bar=_bar;         }     };          //AGGREGATION     class Bar     {         Baz baz;     };     class Foo     {         Bar* bar;         void setBar(Bar* _bar)         {             bar = new Bar;             bar->baz=_bar->baz;         }     };               //COMPOSTION     class Bar     {         Baz baz;     };     class Foo     {         Bar bar;         Foo(Baz baz)         {             bar.baz=baz;         }     };      Is this correct? If not, then how should it be done instead? It'd be appreciated if you also give me a reference of a code from a book (so that I can discuss with my instructor)


Entity design for a blackjack game - should I make Card an entity?

I am creating a simple blackjack game backed by database In my Card is               public class Card{      private Face face;      private Suit suit;           //setters.. getters     }      where `face` and `suit` are enums I have an entity `Bet` with the following               @Entity     public class Bet{        private Player player;        private String cards;        //...     }      Currently when I'm dealing cards I parse the suit and face to string and concatenate them in the cards field and then parse the cards if I want to calculate the score. I find this cumbersome so I want to change my field "cards" to List in the Bet Entity. Now, if that's the case I would have to make the Card class an entity as well. But my `cardService`, which is where I get my cards, does not rely on the database, it just creates random cards so it does not make sense to make card an entity - am I right?


How secure (or insecure) is it to install Node packages globally?

Should I be concerned with security when installing Node packages globally? Why or why not?


Javascript Ternary Operator vs. ||

I was taking a look at some node.js code earlier, and I noticed that the guy who wrote it seemed to favour the following syntax:               var fn = function (param) {         var paramWithDefault = null == param ? 'Default Value' : param;     }      Over what I consider to be the more concise:               var fn = function (param) {         var paramWithDefault = param || 'Default Value';     }      I was wondering if the second form is actually more socially acceptable JavaScript syntax, I've seen it out in the wild more times than the ternary operator for this purpose. I note that in the first example he's using the double equals (not the triple equals) which means it will count "undefined" as null, which would reduce one impact that I could think of. However, I've read in numerous places that == is a rather evil operator in JavaScript (JSLint is very much against it, IIRC).


Is it unethical to track app usage through REST API calls?

I am building an app that communicates with my website with ASIHTTPRequest to a PHP-based REST API on the server side. Naturally, in my app I have different endpoints on the server side, and usually return JSON data. Is it unethical to log counters on how many times each endpoint was hit? I'd like to capture how the app was used capturing what endpoint was hit, the user agent, time of day, possibly their IP (to group visits etc). Should I ask permission to do this?


Why aren't VM languages compiled just once?

(First of all, I should make clear that compilers and virtual machines (aka) are a completely unknown field for me) As I understand it, every time a Java/C#/... application is run, a VM is invoked and translates intermediate code (bytecode, CIL, etc) to machine instructions. But why can't this operation done only once - at install time?


"Gödel, Escher, Bach" still valid today?

I have just completed a course on computability and logic which was an interesting course. The lecturer recommend a few books on his slides, which include "Gödel, Escher, Bach". I can see the book is quite famous, and looks very interesting. But I have a few questions to ask regarding its content.   1. Is the content still valid today? I guess most theoretical stuff doesn't change over night, but are there any major points which no longer hold today that I should be aware of?   2. I assume we actually HAVE made some progress in the last 30 years or so. Can any of you recommend a book on the subject which includes this progress (logic, AI, computability)? _Another question:_ Do I have to know about Escher and Bach?


iPad app architecture with very large files

I am working on an iPad app. It needs to contain some very large files. I could put them into the app, but they would push it well over 20MB, which means that it would not be downloadable over the air -- only via iTunes. Is there a way around this without too much pain for me? I don't have a server or anything like that.


Studentworker - being a superhero?

A couple of weeks ago I got a new job as a studentworker for a webagency. The job is 15-20 hours of week. Even though I am new in the company, I feel right at home and I enjoy working with my co-workers. To start of with, I was assigned to work on an internal tool in the company, in order to learn their systems and their development platform. The deadline for this project is this week, and I am right on time. But today (wednesday at noon) I received an email from my boss, asking me to do a new project that has a deadline at friday morning. The new assignment alone will be hard to finish on time, and on top of that I need to finish the other assignment on time. My question is: How do I handle my boss expecting me to be a superhero? **EDIT:** I will talk to my boss about delaying one of the projects. But another problem is that the new assignment will be hard to do on time (friday morning). I didn't have a say on the deadline - I just got a mail telling me the deadline. I am new in the company and want to stay, but I don't want to start off on the wrong foot with the boss.


Structuring the XML Response

I'm designing an XML response for a consuming application to take in, and I'm weighing two different designs. Currently I have a design as follows (where the Product element can repeat):               <Response>         <AccountType>         <ProductType>         <Products>            <Product>                <ProductID />                <ProductStatus />                <ProductName />            </Product>            <Product>                <ProductID />                <ProductStatus />                <ProductName />            </Product>         </Products>     </Response>      An alternate design is:               <Response>         <AccountType>         <ProductType>         <Product>             <ProductID />             <ProductStatus />             <ProductName />         </Product>         <Product>             <ProductID />             <ProductStatus />             <ProductName />         </Product>     </Response>      In the first design I have a master element called Products, under which each Product element exists and can repeat within Products. The second design is a little flatter - where Product exists under the main Response node. Which one of the two is more optimal for a consuming application to read from and process?


Why Object.clone() is able to "see" fields defined in subclasses?

I was wandering how can Object.Clone() access field fields that are actually defined in the subclasses, and not the actual implementation of this feature. What is bothering me is that I cannot see the logic to allow base class (even if it is "special") to access the fields defined in the subclasses - doesn't this breaks whole object inheritance concept? Consider this:               class Test implements Cloneable     {         private String test_field;              public Test()         {         }              public Test clone() throws CloneNotSupportedException         {            return (Test)super.clone();         }     }      Here, calling `Test.clone()` will copy the `test_field` also. Things are even getting weirder for me when it comes to the situation where `Test` is declared as an abstract class - calling `clone()` will allow me (in some way) to get the instance of the abstract class.


Using a DAO to abstract our ORM from the rest of the application

We're using MySQL with Sequelize.js as the ORM. What we're wondering is whether a DOA layer of abstraction is worthwhile. Here are our options:   1. To use the Sequelize models throughout the application.   2. To abstract Sequelize by building a layer that converts Sequelize models to Backbone models so that we're using Backbone throughout the rest of the application instead. Is abstraction important in this case or is it normal to use Models from the ORM throughout the other layers?


How to test a program in an efficient way?

I know that a writing test case is one of the way to do some programming level testing, but how to test some careless mistake? or how to reduce? For example, a `buttonA`, should perform `ActionA`, but sometime, just human mistake, the `buttonA` perform `ActionB`. And it requires the human test, it seems can't automatic the testing process, any hints to do so? Thanks.


Why is it you never get as much done as you'd planned?

I always start the day thinking "I'll easily get this done by the end of the day" and set what looks like a realistic target. So why do I never hit it? The task always ends up taking 3x longer due to unforeseen bugs, last minute changes etc. Is it just me? I don't seem to be getting any better predicting what can be done in a day.


Is there a canonical resource on ERP?

For a while I've been wanting to learn ERP. What I would like to do is set up a system, and then practice running a business doing things like generating invoices, raising purchase orders, producing monthly accounts, and keeping track of fixed assets. Then look at enhancing the system further by adding custom code. Is there a book out there that's the de-facto standard for describing best practices, design methodologies, and other helpful information on ERP? What about that book makes it special?


Tips for working fast

What are some tips for helping to design and construct applications faster?


Term for a Class with Multiple Interfaces

Say I have a class that implements multiple interfaces. I pass the same instance around using a different interface, depending on what the consumer is interested in. I am trying to remember what this is called. I know there is a fancy name for it - I thought it was "interface partitioning", but I'm not finding any hits. The official name and perhaps a link to a site explaining what it is would be handy. In case I haven't explained myself well enough, here is a real world example. I have a class, call it `ContextManager`, that is responsible for providing access to configuration settings, session variables, user information and other utilities. Instead of passing the object around as a `ContextManager`, I might pass it around as an `IConfigurationManager` in one spot and as a `IUserManager` in another. This prevents the client from accessing things they shouldn't care about and allows me to reuse code within the class. I just want to know what it is called?


What programming language is most suitable for handling unstructured data?

I'm trying to automate the application of metadata to huge amount of text, but I'm not sure what language would make this task easier (if there is one). What programming language is most suitable for handling unstructured text? Why? If the answer is "it depends", what are a few examples of why you would use one language over another?


How to store data in Gujarati language in SQLite?

I am developing an Android application for Gujarat's farmers. So this app should be in Gujarati also. Is there any way so that I can store my data in Gujarati in SQLite?


Do you estimate all user stories in iteration zero?

After our product backlog is created and prioritized, are we meant to briefly estimate all the stories in the product backlog? I assume they have to be in order to create a product burndown chart, however if you have a lot of stories this could take a long time initially. Additionally, should a user story have acceptance criteria when added to the backlog or are those criteria added when the story transfers from the product backlog to the sprint backlog? It would be harder to estimate without them.


Common to use linear programming?

I have read about linear programming and its content and I wonder if this way of programming is common to use in the market? I often hear about object oriented programming but not linear programming. I would like to hear a discussion about it.


adding data gathering to a utility app and publish it to partners?

I've been working on a utility app for a while, and when we're in the final phases the boss is asking for adding user behavior and location tracking and was explicit about publishing them to 3rd party developers to make use of them. He seems to have set his mind about it, is there anything I can/should do about it? Clarify: if you are an app developer who's asked to add data gathering of the app users and publishing it, is there anything you should say against it ?


Should I make public my implementation of a published algorithm?

My company has problem A, lets say, face recognition. We find a nice algorithm like this one. We implement it and go home happy. Problem is, once home I cant sleep because I wonder if we should make the implementation public. After all the algorithm was public. Someone did intensive research and did half ( or more ) the work for us. I feel like we should help back and make our efforts public too. But then our commercial product would not be very _commercial_ , just image our banner: > Hey customer please buy our grunt master 6000 software, its only $1,000.00 ! > Oh by and by the way, you can download the main algorithms here for free ! Is there some sort of licence of derivative work from these academic research papers ? Is it my duty to make my implementations public ? Or is it up to me ? Can I make money from the algorithm ?


What does "automated build" mean?

I'm trying to add Continuous Integration to a project. According to Wikipedia, one major piece of CI is automated builds. However, I'm confused about what, exactly, that means, as the CI and build automation articles seem to disagree. **Specific points of confusion: what does "automated build" mean _in the context of:_**   * a project using an interpreted language, such as Python or Perl?   * building from source on an end-user's machine?   * an application that has dependencies that cannot be simply pre-compiled and distributed, such as a database in an RDBMS local to the user's machine?