title: Scrum: How much can the Product Owner shake up the Product Backlog?

text: For the last 3 sprints or so, I've observed our Product Owner suddenly shoving new stories -- stories not previously in the Product Backlog -- at the top of the Product Backlog. Because of this, the existing items in the backlog never get worked on. New stories continuously take over the helm and make into our Sprint Backlog. My question is - how much can the Product Owner really shake up the Product Backlog? Is it really fair game to ignore what's already in the backlog and keep on shoving new stories at the top? I've tried to argue that this is hogwash, but I often hear counter-arguments such as "adapting to frequently changing business needs," "we're moving so fast - we're super agile" and I don't know what to say to those arguments, although I feel it is not how Scrum was meant to be. EDIT: I understand that the product owner owns the product backlog. What I am observing at my team though, is that the PO constantly puts new items at the top of the backlog, ignoring the existing backlog items completely. For instance, say we're building a car and PO creates 10 stories to make it happen. We decide to take on 3 stories in our sprint backlog - thus 7 stories still remain in the product backlog. Everything is good so far. At the next sprint planning, however, the PO now claims that we need to build a baseball bat and creates 5 stories around that - which are then placed at the top of our backlog (i.e. highest priority); nevermind those car stories we already had in the backlog.


title: Which style to use for repetitive code (in java)

text: I have a project written in Java that required some repetitive code. Basically the gist of it is that I'm taking one object and copying it into two different objects -- Which I would just use clone() for but it involves moving some exterior mappings. My question is, in a language like Java, if you are doing a long series of similar actions on two objects, which of the following ways (or perhaps another way) is more desirable: Either grouping by the ACTION being performed...                   UnitStack usStart = new UnitStack(type, (int)Math.ceil(str / 2d), owner);         UnitStack usStop  = new UnitStack(type, str / 2, owner);              Map<String, Cloneable> logStart = usStart.getActionLog();         Map<String, Cloneable> logStop  = usStop.getActionLog();              logStart.putAll(usOrig.getActionLog());         logStop .putAll(usOrig.getActionLog());              MoveFlags mfStop = (MoveFlags) logStop.get("move");         mfStop = ((mfStop == null) ? new MoveFlags(usStop) : mfStop.clone());         mfStop.addMoves(b.distanceBetween(begin, end, owner));         logStop.put("move", mfStop);              hcStart.setUnit(usStart);         hcStop .setUnit(usStop);      Or should I group by the object being worked on?                   UnitStack usStart = new UnitStack(type, (int)Math.ceil(str / 2d), owner);         Map<String, Cloneable> logStart = usStart.getActionLog();         logStart.putAll(usOrig.getActionLog());         hcStart.setUnit(usStart);              UnitStack usStop  = new UnitStack(type, str / 2, owner);         Map<String, Cloneable> logStop  = usStop.getActionLog();         logStop.putAll(usOrig.getActionLog());         hcStop.setUnit(usStop);              // Reflect that the move took place...         MoveFlags mfStop = (MoveFlags) logStop.get("move");         mfStop = ((mfStop == null) ? new MoveFlags(usStop) : mfStop.clone());         mfStop.addMoves(b.distanceBetween(begin, end, owner));         logStop.put("move", mfStop);      Obviously I could contrive some way to write a loop, or maybe extract it into a method but in a case like this, I don't really feel like those would be good solutions. (I have removed many things from both of these -- comments mostly, as well as context, since neither are relevant to the question)


title: Lexical Analysis without regular expressions

text: I've been looking at a few lexers in various higher level langauges (Python, PHP, Javascript among others) and they all seem to use regular expressions in one form or another. While I'm sure regex's are probably the best way to do this, I was wondering if there was any way to achieve basic lexing without regular expressions, maybe some sort of direct string parsing or something. So yeah, is it possible to implement some sort of basic lexing in a higher level language* without using regular expressions in any form? *Higher level languages being things like Perl/PHP/Python/Javascript etc. I'm sure there is a way to do it in C


title: What is meant by Scope of a variable?

text: I think of the scope of a variable as - "The scope of a particular variable is the range within a program's source code in which that variable is recognized by the compiler". That statement is from "Scope and Lifetime of Variables in C++", which I read many months ago. Recently I came across this in _LeMoyne-Owen College_ courses: ![http://sankofa.loc.edu/CHU/WEB/Courses/Cosi350/Ch4/scope.13.gif](http://i.stack.imgur.com/Krcsi.gif) What exactly is the difference between the scope of variables in C# and (C99, C++, Java) when > However a variable still must be declared before it can be used


title: Why can't an AVL tree be recreated using pre-order traversal?

text: Given a binary search tree, I understand why I can use breadth-first and pre- order traversal to list the entries of the tree in such a way as to reconstruct the tree in the order in which its traversed. However if we now consider an AVL tree and we want to traverse the tree in such a way as to recreate the same AVL tree (similar as to what we did with the plain binary tree) then why does breadth first traversal always work and why does pre-order not work with this case given that it works for standard binary trees?


title: Why shouldn't an object reference have access to a static member in C#

text: Context of my question:   1. I am reading C#.   2. Trying to understand Static keyword.   3. I understand that when Static is applied to a member of a class, it can only be modified by the class and not the class object references. I will take an example here.               public class BluePrint     {        public static string BluePrintCreatorName;     }      If I need to know the BluePrintCreator's Name, I can call               BluePrint.BluePrintCreatorName;      But if a house that is created from the blueprint wants to know the BluePrintCreator's Name, it does not have access.               BluePrint NewHouse = new BluePrint();     NewHouse.BluePrintCreatorName; //This is not accessible      Compiler error says:               Member 'AccessModifier.BluePrint.BluePrintCreatorName' cannot be accessed with an instance reference; qualify it with a type name instead         I understand this is the way it works. But I want to know the basic concept to why Static keyword was required at all? What will go wrong if a class object reference would have access to the static member?


title: Which NoSQL repository is most suitable for a Twitter-type architecture?

text: In an upcoming project I need to create a Twitter like web application where the basic idea is to read / write short messages and status updates (similar to tweets) and group these messages (just like hashtags) Also users can have followers and can see their status updates. I'm estimating between 10 - 50 million message writes in a span of 1 - 2 months, and for reads it could be anything in the millions. Reads will surely be higher than writes. **I already decided that some kind of NoSQL is probably the best approach to storing this data, but I don't know which one would be the best fit for my needs.** **I looked at Hadoop / Cassandra / HBase but it seems a little bit of overkill. I'm also considering MongoDB.** The whole web app will be setup on Nginx, PHP with a RESTful architecture (front-end only on mobile phones)


title: Dealing with the customer / developer culture mismatch on an agile project

text: One of the tenets of agile is ... _Customer collaboration over contract negotiation_ ... another one is ... _Individuals and interactions over processes and tools_ But the way I see it, at least when it comes to interaction with the customer, there is a fundamental problem: _How the customer thinks is different to how a software engineer thinks_ That may be a bit of a generalisation, yes. Arguably, there _are_ business domains where this is not necessarily true---these are few and far between though. In many domains though, the typical customer is:   1. Interested in daily operational concerns--short-range tactics ... not necessarily strategy;   2. Understandably, only concerned with the immediate solution;   3. Practical thinkers, not abstract thinkers;   4. Much more interested in "getting the job done" than considering how the solution will support future concerns. On the other hand, _in the ideal_ , software engineers who practice agile are:   1. People who think alot about quality;   2. Individuals who appreciate how a little bit of upfront work can save a ton in effort down the line;   3. Experienced, analytical thinkers. So there seems to be a culture discrepancy that tends to inhibit "customer collaboration". What's the best way to address this?


title: Eclipse teaching: on new projects, which mode: debug or release?

text: I'm asked to teach to my students Eclipse. The lectures are already done, and I see that the teacher asks the students to **always** start a new project in "Release" mode. ![enter image description here](http://i.stack.imgur.com/p8mqk.jpg) Is that normal? If "yes", or if "no", why?


title: two approaches to database modeling - which one to use when

text: recently I have noticed a new approach to data modeling vs what I have used so far. This seems to be a way to address modeling of an entity that has a very large set of fields and quite often many of them are empty. First approach - the one I used previously:   * Main table for the main set of fields (a,b=1,c=2)   * Additional table with a subset of fields (a,e='foo',f='bar',...) - linked to Main one by a 1-1 relation   * Yet another Additional table with a subset of fields (a,j=3,k='baz',...) - linked to Main one by a 1-1 relation   * And one more with the rest of the fields (a,n=12.4, o='foobarbar', ...) - linked to main one by a 1-1 relation The one I have seen recently is:   * Main table with almost no data except for an ID (a)   * Table that lists all the fields possible (b,'this is parameter b')    * a table that links the Main one with all the fields it has (a,b,1) and (a,c,2) and (a,e,'foo') and so on.  I understand you can query same results from both models, but I do not understand what is the rationale for the second one - are there clear cases where one of those should be used vs other? Thanks for your advice. PS. The second one is being used on Oracle 11 - my last real life experiences with SQL were in the times of Postgres 7.x might be things changed meanwhile :)


title: From TFS to Git

text: I'm a .NET developer and I've used TFS (team foundation server) as my source control software many times. Good features of TFS are:   1. Good integration with Visual Studio (so I do almost everything visually; no console commands)   2. Easy check-out, check-in process   3. Easy merging and conflict resolution   4. Easy automated builds   5. Branching Now, I want to use Git as the backbone, repository, and source control of my open source projects. My projects are in C#, JavaScript, or PHP language with MySQL, or SQL Server databases as the storage mechanism. I just used github.com's help for this purpose and I created a profile there, and downloaded a GUI for Git. Up to this part was so easy. But I'm almost stuck at going along any further. I just want to do some simple (really simple) operations, including:   1. Creating a project on Git and mapping it to a folder on my laptop   2. Checking out/checking in files and folders   3. Resolving conflicts That's all I need to do now. But it seems that the GUI is not that user friendly. I expect the GUI to have a `Connect To...` or something like that, and then I expect a list of projects to be shown, and when I choose one, I expect to see the list of files and folders of that project, just like exploring your TFS project in Visual Studio. Then I want to be able to right click a file and select `check-in...` or `check-out` and stuff like that. Do I expect much? What should I do to easily use Git just like TFS? What am I missing here?


title: MVC seems to create dependencies that just "don't feel right"

text: I might be misunderstanding MVC, so forgive me if that is the case. This is my program structure (Java/Swing): I have a JTable (View) that is pointed to by a custom linked list (Model). When the user tries to add something to the JTable, the action listener (Controller) updates the linked list (Model) which updates the JTable (View). Here's my issue: The linked list should be able to function independently of the JTable, but it doesn't. Let's say I decided to get rid of the user interface and just use the linked list for internal stuff within the program (The linked list has other properties and functions outside the scope of MVC). That should be able to work, because the linked list's FUNCTION is independent of the JTable's function, yet I would have to edit a lot of code to do so (or have a bunch of code that no longer does anything) because of MVC. So am I misunderstanding MVC completely, just a little bit, or are the dependencies a price I have to pay? NOTE: This is a simplified view of my project. In real life, there are other objects in the model and more than just a JTable in my interface. Also, the linked list has other thigns that get updates other than the number of objects.


title: is there a formal algebra method to analyze programs?

text: Is there a formal/academic connection between an imperative program and algebra, and if so where would I learn about it? The example I'm thinking of is:               if(C1) { A1(); A2(); }     if(C2) { A1(); A2(); }      Represented as a sum of terms:               (C1)(A1) + (C1)(A2) + (C2)(A1) + (C2)(A2) = (C1+C2)(A1+A2)       The idea being that manipulation could lead to programatic refactoring - "factoring" being the common concept in this example.


title: How easy it is to update Entity Model from database when enough code has already been written?

text: I am new to Entity Framework. I know there is an option to update model from the database, but I want to know how easy and successful is this task. I may need to update my model in a few weeks but till that time many lines of code has already been pushed inside. Is it difficult to track changes and make code work?


title: Is it possible to check that MS word file is hand written or auto generated by using some converter?

text: I got one project with some requirements. Basically my client provide data entry work. In that he converts image files(scan copy of articles, forms etc) to document file (MS word) by typing manually. For maintaining quality of that work he set some roles on documents text formatting like specific font, font size, paper size etc., and he compare image files with specific document for proofreading which is very time consuming task, and his some **smart employ** use some image to word converter for that conversion rather then typing manually. He pays a lot in the Data entry and he don't want automated converted files using some conversion software. So basically he want two functionality in his project that,   1. to automate standard format proofreading process and    2. to automatically reject image to word converted files. this is the all scenario and now **my question** is that   1. Is it possible to find out which file is manually type by employ and which is converted by using some conversion software?   2. Is it possible that we can check file for specific standard format?


title: Why was dependency injection pattern not included in the Gang of four?

text: Why was the dependency injection pattern not incluided in the gang of four? Did GOF pre-date widespread automated testing? Is dependency injection now considered a core pattern?


title: Why "programmer" is defined as designers and "developer" as creator?

text: While I was looking to the definition of some common terms in _en.wiktionary.org_ , I was surprised to what I found. It define the **programmer** as > One who designs software. - _wiktionary.org_ and **developer** as > A software developer; a person or company who creates or modifies computer > software. - _wiktionary.org_ I have a bachelors degree in IT and has a professional work in an IT department for almost a year, and I do always thought that their definitions are opposite. Is this the real definition of a programmer and a developer or is it just because it is shortly-defined _(but still, it seems to me like it should be the opposite)_?


title: C# class architecture for REST services

text: I am integrating with a set of REST services exposed by our partner. The unit of integration is at the project level meaning that for each project created on our partners side of the fence they will expose a unique set of REST services. To be more clear, assume there are two projects - project1 and project2. The REST services available to access the project data would then be:   /project1/search/getstuff?etc...   /project1/analysis/getstuff?etc...   /project1/cluster/getstuff?etc... /project2/search/getstuff?etc...   /project2/analysis/getstuff?etc...   /project2/cluster/getstuff?etc... My task is to wrap these services in a C# class to be used by our app developer. I want to make it simple for the app developer and am thinking of providing something like the following class.               class ProjectClient       {         SearchClient _searchclient;         AnalysisClient _analysisclient;         ClusterClient _clusterclient;              string Project {get; set;}         ProjectClient(string _project)         {           Project = _project;         }       }      SearchClient, AnalysisClient and ClusterClient are my classes to support the respective services shown above. The problem with this approach is that ProjectClient will need to provide public methods for each of the API's exposed by SearchClient, etc...               public void SearchGetStuff()     {       _searchclient.getStuff();     }      Any suggestions how I can architect this better?


title: Binary Search seems superior, why did the committee of C++ still have Find in the algorithm library?

text: I wish to search for an integer in a vector of integer. I have two candidates for the job:   1. Binary Search   2. Find It seems that **Binary Search** is the best candidate for the job as although I have to sort the vector, the total running time will be `O(NLog2N)` assuming quicksort take `O(NLog2N)` and searching takes `O(Log2N)`. The running time for **Find** will be `O(N)`. It seems such clear cut that **Binary Search** is superior to **Find** , why did the committee of C++ still have Find in the algorithm library? I am sure the C++ committee had their reasons for including **Find** , what benefits of **Find** am I missing or how is **Find** superior to **Binary Search**? EDITED : Changed running time of quicksort to NLog2N


title: How do I hire testers by giving them a buggy app for testing their efficiency?

text: My boss wants to recruit testers based on their testing efficiency (number of bugs identified). So, he's shortlisted 5 people and I need to give them an app full of bugs and see how they fare in reporting obvious bugs, and hidden bugs. I know.... it kind of sounds weird. I guess, this is just like the coding world, where you hire a programmer by assessing his/her programming ability (which is a little easier). Once hired, these testers would be testing a java swing app, so their familiarity of testing frameworks/tools is not really required. So, my question here is - How do I go about finding buggy apps (web/non-web), preferably java ones, that I can have the shortlisted testers have a go at? How would you go about this task if your boss asks you to do so? I am kind of clueless at this point - I googled a bit, thought about finding new apps on sourceforge with lots of bugs, but both approaches didn't work for me.


title: How are Java ByteBuffer's limit and position variable's updated?

text: There are two scenarios: writing and reading   **Writing** :   Whenever I write something to the ByteBuffer by calling its `put(byte[])` method the `position` variable is incremented as: `current position + size of byte[]` and `limit` stays at the max.   If, however, I put the data in a view buffer then I will have to, manually, calculate and update the `position`   Before I call the `write(ByteBuffer)` method of the channel to write something, I will have to `flip()` the Bytebuffer so that   `position` points to zero and `limit` points to the last byte that was written to the ByteBuffer.   **Reading** :   Whenever I call the `read(ByteBuffer)` method of a channel to read something, the `position` variable stays at 0 and the `limit` variable of the ByteBuffer points to the last byte that was read. So, if the ByteBuffer is smaller than the file being read, the `limit` variable is pushed to max   This means that the ByteBuffer is already flipped and I can proceed to extracting the values from the ByteBuffer.   **Please, correct me where I am wrong** :)


title: Is it possible to outsource design properly?

text: I work in a company going through a downsizing process. It is assumed that a lot of "let go" developers jobs will eventually be outsourced. Some of those programmers had some design to do. Is it possible to outsource both design and creation/coding properly? I feel that by outsourcing design, we lose any in-house capability of really "owning" the code. It will be very difficult to maintain. Also we'll have a hard time ensuring a proper development. How can I address those issues?


title: What am I missing about PHP?

text: It's like this mythical thing that a dominating portion of developers say is just the best option for back-end development, a part of development about which I know virtually nothing beyond the absolute basics. So I've looked up PHP tutorials a bunch of times, trying to figure out why it's so powerful and common, but it's annoying as hell-- all the tutorials treat you like a new programmer. You know, this is how you make an If Else statement, here's a for loop, etc. The "Advanced Topics" show you how to make POST and GET statements and whatnot. But there must be more to it! I don't get it! That's practically no different from JavaScript. What am I missing about this language? What else can it do? Where's the power and versatility? I've heard it called a function soup; where are all the functions? Please chide me. I'm clearly missing something.


title: handling a GET error properly

text: I have a website that takes two primary get strings:               ?type=GAME&id=SomeGameID     ?type=SCENARIO&id=SomeScenarioID      for reasons unknown, I have recently begun receiving requests for erroneous get strings from both Yandex and Baidu. They are always in the form of:               ?type=GAME&id=SomeScenarioID      None of my users are triggering these errors, so I am (sort of) confident that this is not due to an HTML template error somewhere on my part. There is also no HTTP_REFER showing up in the $_SERVER array, so I'm guessing these are direct requests from bad dbase data on their part. I see two options for dealing with these bad requests, and would like to know which is recommended... or if there are other, better options I have not thought of:   1. simply 404 the request, since it is incorrect   2. redirect the request to `?type=SCENARIO&id=SomeScenarioID` because the scenario IDs are always valid, the breakage is due to asking for the wrong type.


title: Why does XCode convert PNGs to CgBI format?

text: According to the research done here http://imageoptim.com/tweetbot.html, Xcode's conversion of PNGs to the proprietary Apple CgBI format does not create a noticeable performance improvement. Their claim is that the conversion only reduces PNG loading speed by 1 nanosecond. If this is true, why does apple bother with the CgBI format at all? Has anyone else benchmarked loading CgBI images vs regular PNG images on iOS devices to see if they perform differently?


title: Senior Engineers: Go Back to Coding?

text: This is a question regarding engineers with 20+ years experience, but it is a question for everybody, as it has to do with career development. I'm in a surprisingly long job hunt, and the problem seems to be that employers will not accept me as a coder. Yes, I have done lots of things, had my own company, sold it too early, etc. But the world always needs productive workers, and my skills are current and sharp. The market I am in has fewer openings for senior people, and I don't mind taking a step or two back if I can find a place to contribute. What are your thoughts about career management that prepares the 40, 50 year-old for a sudden career disruption?


title: Dependencies between services in pipeline

text: I am working on creating a new data processing system, where there are multiple steps each fulfilled by different services. For example, there is a scheduling service that kicks of something, an analysis service that does the processing, and a notification service that summarizes and emails out results. Data flows through in that order My main question which design would be better, should the analysis service have to know about the notification service? Or should the notification service have to know about the analysis? My initial thought is that by using a service bus, the notification service can simply be subscribed to any analysis results that get broadcast. That way if the notification service is replaced or changed there wouldn't need to be any change to the analysis service. This also means a client that wants to start an analysis and get a notification would have to call the notification service first to tell it how to handle the result it will eventually get before kicking off the actual analysis. The opposing idea is that the analysis service should simply call directly into the notification service, so the analysis service needs to know what to do to create a call into notification. This means the client would have to bundle up notification specific instructions that get passed into the analysis service for it to later look at to know what to pass to the notification call. It seems like the service bus approach of the notification service getting and processing analysis results would be better because we could also add other services in the future that then do something with a result without having to change the analysis service to call it explicitly. Can anyone provide some insight on which approach would work better to be both easier to develop, maintain, support?


title: Is JavaScript interpreted by design?

text: I am cautious of asking this question because it might appear overly fastidious. I just opened up JavaScript: The Definitive Guide, and it states of the first page of chapter 1 > "JavaScript is a high-level, dynamic, untyped interpreted programming > language” So am I to take it that the interpreted part is a requirement in the language specification, or is it misleading to say that the language is an interpreted programming language when respecting the difference between a language and its many implementations? There are no static compilers for JavaScript apparently - Is there a native machine code compiler for JavaScript? so maybe it's just a reflection of this.


title: What are the restrictions on derived works of EPL licensed software?

text: I am contemplating paying a software consulting firm to provide my company with some enhancements to a piece of software that is licensed under the Eclipse Public License (EPL). I'm wondering what rights we will have to what they produce, and whether they can tie us to paying them royalties forever.   * What rights we will have to modify and redistribute what they provide us?   * Can they insist on a royalty payment when we distribute it to 3rd parties? Before I start negotiating, I need to understand what we're getting - and ideally get this sort of thing explicitly agreed in the contract. I know I should consult a lawyer.


title: What's the difference between "Add to home screen" safari HTML5 webapp vs HTML5 webapp wrapped in UIWebView?

text: Someone asked me this. The answer he gave was HTML5 in `UIWebView` can cache the app data so it can run offline. I thought the same thing can be achieved using safari add to home screen, no?


title: Using GPL code with MPL code

text: I've done a spot of Googling, and all I can find is information on using code under the MPL in a larger GPL licensed project. What I really want to know is: can I included GPL(v3) licensed code(/binaries) in a larger MPL(2.0) licensed project? My understanding so far is that I can't, and that any project which uses GPL software must also be released under the GPL. Is this correct? If this is correct, can I write software and release it under the MPL, even if it depends on a GPL library, as long as I don't distribute the GPL licensed parts with my MPL licensed parts? And, if I then want to distribute both parts as a "larger work", how would the overarching GPL affect my MPL code?


title: Writing Large Portions Of Code Then Debugging?

text: Lately I have been writing a game engine, and I have been writing a lot of "foundation stuff" (standard interfaces, modules, a message system ect.), but I have noticed a pattern, a lot of the stuff is interdependent and I can not debug until everything is done, hence I do not debug for about 3 to 5 hours at a time. I am wondering if this is an acceptable practice for this part of the project, and if not, if anyone can give me some advice? \-----Update-----: I downloaded some code metrics tools, and my programs cyclomatic complexity is 1.52 which as I understand it is good, and should correlate to high cohesion, if I am wrong please correct me/


title: Contract Billing - How would you handle 'learning time'?

text: So you take a contract where you have solid experience with 75% of the technology necessary. How do you handle your time to learn the other 25%? Work it into the billing time? Expose the 25% in the contract as 'research'? Do the learning on my own time (not billed)? Not take the contract (too large of an unknown for me _and_ the customer)? On the extreme end of this, I keep hearing a story about Mark Cuban (Dallas billionaire who started broadcast.com and sold it to Yahoo!) when he was at Indiana University. Someone asked him if he could build a business app for them and he immediately said "Yes"... he had no idea how. So he bought a book, stayed up nights, studied and coded... He finished it (I'm sure it was ugly), it worked and he kept going. I'm not suggesting doing contracts this way (the stress!), but there's a middle ground. What is it, and how would you (or would you?) bill for the unknown?


title: Implementing Syncing between localStorage and SQL database?

text: I have made a simple web app, which runs completely offline - all data is saved in HTML5's localStorage. Now, I want the data to get synced with the server, so that the user is able to use the app on multiple devices at a time. What I have done so far is:   1. For each operation the user performs, a log entry is added.   2. When the user is online, all logs are transferred from localStorage to PHP through AJAX.   3. Corresponding changes are made in the SQL Database.   4. All logs are deleted from the localStorage. So, all the localStorage data is getting "backed up" on the server properly. Anyhow, changes made from one device is not being reflected to the other device and vice-versa, to do this, we would have to get some data from SQL to the localStorage. Now, my question is as to what will be the appropriate and best way to do this? After the four steps above, do I   1. Clear all localStorage data and save the SQL data into localStorage.   2. Keep a log of changes made in the database, and do them on the localStorage.   3. Any other approach. Also, what about timestamps? What if there are conflicts?


title: How can I be prepared to join a company?

text: There's more to it than that, but this title was the best way I could think of to sum it up. I'm a senior in a good computer science program, and I'm graduating early. About to start interviews and all whatnot. I'm not a super-experienced programmer, not one of those people who started in middle school. I'm decent at this, but I'm not among the best, not nearly. I have to do an awful lot of googling. So today I'm meeting some fellow for lunch at a campus cafe to discuss some front-end details when this tall, good-looking guy begs pardon, says he's new to campus, says he's wondering if we know where he can go to sign up for recruiting developers. Quickly evolves into long conversation: he's the CEO of a seems-to-be-doing-well start-up. Hiring passionate interns and full-times. Sounds great! I take one look at his site on my own computer later, immediately spot a major bug. No idea how to fix it, but I see it. I go over to the page code, and good god. It's the standard amount of code you would expect from a full-scale web application, a couple dozen pages of HTML and scripts. I don't even know where to start reading it. I've built sites from scratch, but obviously never on that scale, nor have I ever worked on one of that scale. I have no idea which bit might generate the bug. But that sets me thinking: How could someone like me possibly settle into an environment like that? A start-up is a very high-pressure working environment. I don't know if I can work at that pace under those constraints-- I would hate to let people down. And with only 10 employees, it's not like anyone has much time to help you get your bearings. Somewhere in there is a question. Can you see it? I'm asking for general advice here. Maybe even anecdotal advice. Is joining a start-up right out of college a scary process? Am I overestimating what it would take to figure out the mass of code behind this site? What's the likelihood a decent but only moderately-experienced coder could earn his pay at such a place? For instance, I know nothing of server-side/back-end programming. Never touched it. That scares me.


title: Pythonic use of the isinstance function?

text: Whenever I find myself wanting to use the isinstance() function I usually know that I'm doing something wrong and end up changing my ways. However, in this case I think I have a valid use for it. I will use shapes to illustrate my point although I am not actually working with shapes. I am parsing XML configuration files that look like the following:               <square>       <width>7</width>     </square>     <rectangle>       <width>5</width>       <height>7</height>     </rectangle>     <circle>       <radius>4</radius>     </circle>      For each element I create an instance of the Shape class and build up a list of Shape objects in a class called the ShapeContainer. Different parts of the rest of my application need to refer to the ShapeContainer to get certain shapes. Depending on what the code is doing it might need just rectangles, or it might operate on all quadrangles, or it might operate on all shapes. I have created the following function in the ShapeContainer class (the actual function uses a list comprehension but I have expanded it here for readability):               def locate(self, shapeClass):       result = []       for shape in self.__shapes:         if isinstance(shape,shapeClass):           result.append(shape)       return result      Is this a valid use of the isinstance function? Is there another way I can do this which might be more pythonic?


title: Adding a Short-Term Developer to a Rework of an Old Project

text: ## Background I work in the Language Resource Center on my campus. It's a relatively small lab, and our job is to help students, not code software. Being a Computer Science student, I took the initiative to start coding useful utilities to make our jobs as lab assistants easier. Recently, Google declared a shut-down of our data storage mechanism, so I decided that it was time to completely rework the entire system that I've built (alone) over the past year. I have more experience now, and I want to do it correctly with the ( _better_ ) tools that are now available to us. There is another CS student that works with me in this lab, who will continue working with me for **one more semester** (e.g. a 4-month period). I never asked him to contribute to the **original** project because I started it last summer when he wasn't scheduled to work. The goal of this project is to build an integrated 'manager' application for our staff and my boss; the utility is a web service built using HTML/CSS/JavaScript. My coworker doesn't have any experience with JavaScript, HTML nor CSS. This developer also has no experience with the code base that I built previously (purely JavaScript), which would need to be re-worked (albeit slightly) to work with the new system. Again, this is **not a required duty in our positions**. I enjoy coding things to automate menial tasks, and to make our jobs easier. _It was never a requirement._ ## Deadlines There is a hard deadline of mid-August, when faculty will start submitting requests to us again. The old system has to be rebuilt (some parts retrofitted) before then. ## Why ask? My boss suggested that this coworker of mine contribute to the new project to speed up development. I worry that my coworker (and boss, for that matter) might take it as a slight if he doesn't help develop this system. On the other hand, there was a 9-month period where he could have contributed to the previous project, and a 4-month period that he could have taken over management of said project (I was in France) - he has never shown interest in actively contributing to the previous project, and I have no problem with that. I'm concerned because I feel that helping him learn HTML, CSS and JS, as well as Google's API and toolset will _really_ slow things down. We essentially have two months to re-construct the old system, and I feel that the time it would take to get him acquainted with the tools and languages used in this project, I could have built it myself. ## Is there a protocol? I've come up with the following as my options in this situation:   1. Just start working on the new project alone, assuming that my coworker does not want and/or never wanted to contribute.   2. Ask my coworker if he wants me to help him learn HTML/CSS/JS and start showing him the previous code base as well as the current project's plan.   3. Ask my coworker if he has any interest in helping with the new project (he doesn't _need_ to have an interest, but would he take that as _You **must** work on this!_?) ## The question Is it worth the time/effort, given the deadline, to have my coworker work on this project with me? Or would I detriment progress by having him co-develop?


title: MVVM - child windows and data contexts

text: Should a child window have it's own data context (View-Model) or use the data context of the parent? More broadly, should each View have its own View-Model? Are there are any rules to guide making that decision? What if the various View-Models will be accessing the same Model? I haven't been able to find any consistent guidance on my question. The MS definition of MVVM appears to be silent on child windows. For one example, I have created a warning message notification View. It really didn't need a data context since it was passed the message to display. But if I needed to fancy it up a bit, I would have tapped the parent's data context. I have run into another scenario that needs a child window and is more complicated than the notification box. The parent's View-Model is already getting cluttered, so I had planned on generating a dedicated VM for the child window. But I can't find any guidance on whether this is a good idea or what the potential consequences may be. FWIW, I happen to be working in Silverlight, but I don't know that this question is strictly a Silverlight issue.


title: Design Patterns for creating tasks

text: I am developing software where each action in my entities need create tasks that will be execute in my infrastructure. When I create a task it is only records in the database. Afterwards, a windows service will execute it. Actually, I use a Service and my Entities are Anemic, then when I change the state of my entity I also create my tasks to infrastructure.                   public void CreateMachine(string name){           var machine = new Machine(){                               Name = name,                               Status = Status.Releasing;     };           var tasks = new List<Task>(){                        new Task("CreateMachine", machine.Name),                       //infrastructure task                        new Task("ChangeMachineSize", machine.Name, machine.Foo),      //infrastructure task                        new Task("ActivateMachine", machine.Bar),                      //infrastructure task                          new Task("SetMachineEntityStatusToReleased", machine.Name)     //business task (go to my database)           _db.Task.Add(tasks);           _db.Msachine.Update(machine);           _db.SaveChanges();          }        }      But I want use rich domain, because my services are getting too complex.                   Public Class Machine{                  public Machine(string name)             {                 Name = name;                Status = Status.Releasing;               //Can I Create Tasks for create machine here?             }                  public void Stop(){               Status = Status.Releasing               //Can I create Tasks for stop machine here?             }                       [Required]             [StringLength(50)]             public string Name { get; set; }                  public Status Status { get; protected set; }        }      Is there a design pattern or best practice for this design? I am violating the Single Responsibility Principle if I add the task creation inside my entity?


title: Intentionally incorrect use of language features, specifically "ref" in C#, as a hint to colleagues

text: I recently came across a piece of code something like this (roughly C#):               public bool ValidateStuff(ref ArrayList listOfErrors, Stuff thingsToValidate)     {         if (!thingsToValidate.isValid() )         {             errors.add("New error!");         }     }          ArrayList errors = [];     bool valid = ValidateStuff(ref errors, stuffToValidate);      The key thing is the "ref" keyword - there is no need to use that keyword given the functionality here, and when I asked why it was there I was told that it had only been added as a kind of warning that the _errors_ parameter is manipulated by the method, it's not purely used as input. This immediately seemed wrong to me ( _ref_ has a purpose, and here it is not being used according to its purpose), but the idea of forcing (since you **have** to use _ref_ when calling the method) a reminder of slightly counter- intuitive usage seemed reasonable, and I couldn't immediately think of a better way, apart from liberal use of comments. What do you think? Extra credit: how could this method be better? Perhaps by simply returning a new List of errors which is added to the main List in the calling code? By providing two methods, one for the test and one for the errors? Or is it fine as it is?


title: IllegalStateException vs. IllegalArgumentException

text: In have written a function which expects the caller to pass in a configuration file like XML. Then I parse this given file and extract something which i then return. In this function (at least) two "bad" things can happen:   1. The given file does not exist or is not accessible in any way   2. While parsing/validating the file some unexpected content is found The first thing is clearly an `IllegalArgumentException`. I am however not sure what kind of exception the second case would be. Is that also an `IllegalArgumentException` because i expect (by documentation-contract) that the input is in a valid form? Or is it rather an `IllegalStateException` as the given parameter is formal correct but only after parsing I can't do any further steps as it would result in unwanted behaviour? Or is it even something else?


title: Is it faster to query using linq-to-entities or a data adapter?

text: I'm creating an MVC application in VS2012 and I reverse-engineered the models from existing Oracle tables. The tables are part of a MASSIVE database. Besides the main tables that I need to insert, update and delete from I also (on a whim) selected a few tables and views that my application only needs to read from. Now I am doubting my decision and considering deleting the less- important models. It is definitely neater to query using linq-to-entities instead of creating an oracle connection, creating an adapter, filling a dataset and reading what I need, but which is faster?


title: Preparation for Ph.D

text: I am going to start Ph.D (software security research) very soon. How can I prepare for that. Please recommend any tools or softwares that I need to familiarize with before stating the Ph.D. Any advices other than softwares?


title: Guidelines for using BOOST

text: I am planning to use boost libraries, as it is quiet rich, and will save lots of time. But my question is, what are the guidelines i have to follow, so that   1. I can replace some part of boost with standard C++ as and when they are supported, considering so many new features are coming in C++11.   2. Also, how to encapsulate them in a way so that i have to change least when i change platform/compiler/boost version.   3. Also is there a category which suggest, which portion of the library to use and avoid, considering stability and standard.


title: Notification service for software version updates

text: There are a lot of (open source) projects that I'm interested in - dozens at least. I'd like to get a notification whenever a new version is released. Is there a service that does this?


title: How do I licence my OS project, which uses other (differently-licenced) projects?

text: I've got a library up on GitHub, with some of the binaries also distributed on NuGet: https://github.com/relentless/Http.fs I'd ignored licencing up until now, but somebody's asking about it so I though I should put something on. I want to keep it permissive, and having done a little research MIT seems like a good one to use. However, my library references/uses three other libraries, all with different licences, so I'm not quite sure what I need to do. It includes the binaries of:   * FsUnit, which has it's own licence (similar to the BSD 3-clause): https://github.com/fsharp/FsUnit/blob/master/license.txt   * NancyFx, which uses MIT: https://github.com/NancyFx/Nancy/blob/master/license.txt And a source file from:   * FSharpX, which uses Apache 2.0: https://github.com/fsprojects/fsharpx/blob/master/LICENSE.md The MIT of Nancy doesn't seem to be a problem. The Apache of fsharpx and the FsUnit one both say I need to include the licence text in my project. So my questions are:   1. What do I do with the other licences, just copy the files into the root of my source? I assume I can rename them and add a comment specifying which part of my project this licence refers to.   2. Assuming I go for MIT, could I reasonably describe my project as having an MIT licence? Or is the reality that it's a mixed MIT/Apache 2.0/Random licence?


title: Architecture for dashboard

text: I'd like to know if my Architecture idea, is the best approach following some pattern. I'll create a Dashboard for my company, and I never will delete or update data in my database, just read the data from database. Nowadays we just work with our SQL Server database, but I want a solution that will provide a easy way to implement a new feature, like a new database compatibility. **THE APPLICATION** This is a dashboard for all my clients, where I'll get the data from my database server making a filter for his company, and then plot some charts and show informations about her rentability, financial information, etc. Will be web-based and must work in any screen size (smarthphones, TV's, desktop, etc). I want to use NHibernate as ORM **IDEA** My idea was in the user interface, use MVC 4 Web Application and all request from the User Interface to my Business Layer will be through REST. My Business Layer it's a MVC Web API, to desacouple the User Interface from my Business Layer. The Business Layer will access Repository (Repository Pattern), with CRUD operation (in my case it's just 'SELECTS' because I just need show the data, never update, never insert). It's a DDD approach, working with NHibernate. Sometimes I think it's to much for a dashboard, where we can't insert nor update data. I'd like to know what are common architectural pattern for this problem. I said some pattern's here, but maybe someone with more experience then me could see a better approach to this kind of application.


title: Pattern matching in Clojure vs Scala

text: What are the key differences between pattern matching in these two languages? I am not referring to syntax, but capability, implementation details, range of use cases and necessity. Scala applications (eg. Lift and Play) speak proudly about the languages pattern matching prowess. Clojure, on the other hand has a library, core.match, and built in destructuring, which also seems powerful. *note: The reason I was inspired to ask this question is because of a blog post I saw in which a programmer, as an experiment, built a lisp interpreter using both Scala and Clojure. He said that the Clojure matches broke after a certain length, but could not explain why, but I am really curious to know. You can find this post here: http://www.janvsmachine.net/2013/09/writing-simple-lisp-interpreter-in-clojure.html


title: How to decouple simple factory and default implementation?

text: I have a simple factory ~~class~~ (`FileResources`) with static factory methods providing a default implementation (`DefaultFileResource`).               public final class FileResources {         private FileResources() {}         public static FileResource get(Path path) {             return new DefaultFileResource(path);         }     }      The problem with this class is that it is tightly coupled with the default implementation (`DefaultFileResource`). Given a new requirement that classes part of the API (`FileResources`) cannot directly depend on classes not part of the API (`DefaultFileResource`) I figured that the only solution is inversion of control, either dependency injection or a ~~service provider~~ service locator. Is it possible to decouple FileResources from the default implementation (`DefaultFileResource`)? As far as I know this is only doable by injecting the dependency into FileResources through a constructor, field or setter method.   The main problem is that the constructor of FileResources is private, furthermore it only has static factory methods. The alternative is the factory method pattern. There would be an abstract factory (an API class), and there would be concrete factories (non-API classes) that could be even injected to decouple the API and non-API classes. Either way a dependency container is necessary to handle the wiring. What do you think? Am I overthinking this?


title: Heuristic Approach for Flexible DIFF Implementation

text: I have created a DIFF implementation to compare document revisions at work. It is based on _An O(ND) Difference Algorithm and Its Variations_. One thing that has become important is to take the list of changes and interpret them into human readable text. While the current algorithm is very efficient, it is so much so that it is difficult to expand upon. ## Short Question I was thinking about trying to use A* and a heuristic that adds penalties for "turns". The idea being to _smooth out_ unnecessary "add, delete, add, delete, add, delete" so that it is easier to parse into something a human can read. Basically, turn my _shortest path_ problem into a _simplest path_ problem. And of course not create output that is always "Delete _everything_ , Add _everything_ " Does this sound reasonable? Is there any precedence for using a heuristic in a DIFF implementation? What is the heuristic? ## The Problem: If a long sentence is deleted and another long sentence removed, but they do share at least one word, say "with". Leaving the common word alone (by not both adding and deleting it) will create the shortest path. However, this really just obfuscates the context of the change to a human trying to read a print out of the changes. Example with current DIFF:   * **Old text:** Clean: Powerwash and blow dry with shop air.   * **New text:** Clean: Wipe with acetone and a lint free cloth.   * **Change Note List:**       * Change "Powerwash and blow dry" to "Wipe with acetone"     * Change "shop air" to "acetone and a lint free cloth" _Note: "Change" is used instead of_ "delete 'shop air', add 'acetone'" As you can see, the second note loses ALL context and without still looking at the full old and new text sets of text you cannot understand what it means. ## Note about Punctuation: I have delimited punctuation as separate "words" so that I would get   * Add "(" instead of   * Change "Repair" to "(Repair" because this was obnoxious. However, that means that if there is even a comma in both texts (as opposed to the word "with" in the previous example) the same thing happens. ## Possible Solution: I think I could use a different path finding algorithm instead that can give me the flexibility to add weight to different change "paths" that might make more sense to a person. Maybe, I could even make traveling to nodes containing punctuation have little weight (not sure how this would effect other things). Then I could get the previous example to list the following:   * **Change Note List:**       * Change "Powerwash and blow dry with shop air" to "Wipe with acetone and a lint free cloth" _See! Much clearer!_ I know I would take a performance hit, and I might have to do a fairly major overhaul of my program, but it's more important to have the final result I want. ## Bottom Line: Again, is there any precedence for using a heuristic in a DIFF implementation, and what is it? Other thoughts? A reasonable time investment? Other ideas? Other algorithms? Thanks in advance! **EDIT:** I tried to clarify/solidify my question and generalize my question to adding a heuristic to my algorithm, rather than using A*. Basically the same thing in this instance, but I still think more accurate now. This post was insightful.


title: How do you make a service stateless?

text: When doing Domain Driven Design it is advised that services should be stateless. There are several kinds of services when doing DDD:   * Application services.   * Domain services.   * Infrastructure services.   * Factories, Repositories, Specifications,...etc. How exactly do I make a service stateless? Does that mean I shouldn't have any instance variables in a class? Is there any guidelines on making a service/class stateless? I could really use a code sample that illustrate the difference between a stateful and stateless service. Example: (Is this class stateful or not?)               Class DataToCsvFileGenerator{              private String filePath;         private ResultSet data;              public String createCsv(ResultSet data){            this.data=data;                 this.createLocalFile();            this.loadDataIntoFile();                 return this.filePath;         }              private void createLocalFile(){                 this.filePath=//... logic to create file             }              private void loadDataIntoFile(){                 //function uses this.filePath to load data             }     }      Notice that any successive calls to `createCsv()` won't be affected by any prior invocation.


title: How to pick a great working team?

text: I've just finished my master and I'm starting to dig into the laboral world, i.e. learning how programming teams and technology companies work in the real world. I'm starting to design the idea of my own service or product based on free software, and I will require a well coupled, enthusiast and fluid team to build and the idea. My problem is that I'm not sure which would be the best skills to ask for a programming team of 4-5 members. I have many friends and acquaintances, with whom I've worked during my studies. Must of those ones I have in mind are very capable and smart people, with a good logic and programming base, although some of them have some characteristics that I believe that could influtiate negatively in the group: lack of communication, fear to debate ideas, hard to give when debating, lack of structured programming (testing, good commenting, previous design and analysis). Some of them have this negative characteristics, but must of them have a lot of enthusiasm, nice working skills (from an individual point of view), and ability to see the whole picture. The question is: how to pick the best team for a large scale project, with a lot of programming? Which of these negative skills do you think are just too influential? Which can be softened with good leadership? Wich good skills are to be expected? And any other opinion about social and programming skills of a programming team.


What are the best practices for exception handling in n-tier applications? The application is a fat client based on MVVM pattern with .NET framework.


title: Is LinqPad site quote "Tired of querying in antiquated SQL?" accurate?

text: I was struck by the heading > Tired of querying in antiquated SQL? on http://www.linqpad.net/. I am a N-Tier application developer and learnt my trade in a company that worked with a lot of data, so became fluent with SQL, but mostly for DALs. My finacée is a SQL developer so I've had an exposure of the SS/SSAS/SSRS/SSIS suite too. Other than the LinqPad team writing antiquated SQL themselves, or only using PROCs for application DALs rather then data heavy tasks, I can't think why the the LinqPad team think SQL is antiquated?


title: How does a website become hackable?

text: I know websites are hacked because of loose ends but how are they hacked via a form? Is it because the website owners didn't validate the form and the way they structured?


title: Is browser fingerprinting a viable technique for identifying anonymous users?

text: Is browser fingerprinting a sufficient method for uniquely identifying anonymous users? What if you incorporate biometric data like mouse gestures or typing patterns? The other day I ran into the Panopticlick experiment EFF is running on browser fingerprints. Of course I immediately thought of the privacy repercussions and how it could be used for evil. But on the other hand, this could be used for great good and, at the very least, it's a tempting problem to work on. While researching the topic I found a few companies using browser fingerprinting to attack fraud. And after sending out a few emails I can confirm at least one major dating site is using browser fingerprinting as but one mechanism to detect fake accounts. (Note: They have found it's not unique enough to act as an identity when scaling up to millions of users. But, my programmer brain doesn't want to believe them). Here is one company using browser fingerprints for fraud detection and prevention:   http://www.bluecava.com/ Here is a pretty comprehensive list of stuff you can use as unique identifiers in a browser:   http://browserspy.dk/


title: What's the point of initializing a variable with the same value twice?

text: I was reading Ben Cherry's "JavaScript Module Pattern: In-Depth", and he had some example code that I didn't quite understand. Under the _Cross-File Private State_ heading, there is some example code that has the following:               var _private = my._private = my._private || {}      This doesn't seem to be different from writing something like this:               var _private = my._private || {}      What's happening here and how are these two declarations different?


title: is a new change request on a user story a different user story

text: We have completed a user story for a sprint. Near the end of the sprint there was a new functional addition requested for the same user story. Here the user story will remain the same. ie As a i want to <> so that <> will remain the same. Only difference is that there is a new value add that is to be done. So should this be taken as a new user story for the next sprint or should this be taken as a backlog? We have met the done definition we had for the user story and this new feature is a new requirement which wont have any change in the user story definition. I am adding an example to make it more clear take a feature say create profile, in that user can update his name,address, phone no, photo etc and its done. now if the customer wants to have facebook link or add country code to phone number, is that change request a new user story


title: Planning a 3d file viewer using qt. Please suggest a 3d engine

text: I am planning a 3d file viewer with option to view 3d files (both geometry and mesh viewer). I would also like to put an option to convert between geometry and mesh. I am well versed with c++/qt. But novice in the field of 3d programming. What would be the ideal 3d engine, any open source projects already existing, matching my details? And why it would be a good example of what I plan to do?


title: What if you don't have code samples to give a prospective employer?

text: What do you do when you don't have any good code samples available when asked by a prospective employer? I like to consider myself a fairly capable developer but I can't share any of the software I've been writing for my company the last few years. Unfortunately, I haven't been able to find the time to put much work in my personal projects either. Basically, I don't think I can find any code samples that are a good representative of my skills that I can share. Any ideas? Thanks in advance.


title: Would the concept of source code layers be of any use?

text: I'm talking about something like layers in photoshop, except they apply directly to the source code. For example, in pseudo-code... inventing what some project might look like - say a computational fluid dynamics program: [base layer]               cfdTime runTime(0);          fieldVariable U;     fieldVariable p;     U.initialize();     p.initialize();          while (runTime.run())     {         U.solve();         p.solve()         runTime++;     }      [turbulence layer]               turbulenceModel turbulence;     scalar nu(readScalar(turbulence.dictionary("nu"));          while (runTime.run())     {         turbulence.update();     }      [base layer + turbulence layer]               cfdTime runTime(0);          fieldVariable U;     fieldVariable p;     U.initialize();     p.initialize();          turbulenceModel turbulence;     scalar nu(readScalar(turbulence.dictionary("nu"));          while (runTime.run())     {         U.solve();         p.solve()         turbulence.update();         runTime++;     }      You get the idea. Obviously a lot of things would need to be worked out. I'm all over object-oriented programming (OOP). This idea strikes me as an awkward alternative to OOP... and I don't think it's worth much... but I thought I'd toss it to the community... there just might be something useful in it that I'm not quite seeing. It may be useful from a GUI-only perspective - creating layers in the GUI for complex functional programming... while the underlying code is always the same. Or it may be useful for code optimisation, perhaps an alternative to #ifdef that developers won't run screaming from. Or, it may be an entire alternative to OOP. Your thoughts?


title: What type of interview questions should you ask for "legacy" programmers?

text: We have recently been receiving lots of applicants for our open developer positions from people who I like to refer to as "legacy" programmers. I don't like the term "old" because it seems a little prejudiced (especially to HR!) and it doesn't accurately reflect what I mean. We are a company that does primarily .NET development using TDD in an Agile environment, we use Git as a source control system, we make heavy use of OSS tools and projects and we contribute to them as well, we have a strong bias towards adhering to strong Object-Oriented principles, SOLID, etc, etc, etc... Now, the normal list of questions that we ask doesn't really seem to apply to applicants that are fresh out of school, nor does it seem to apply to these "legacy" programmers. Here is how I (loosely) define a "legacy" programmer.   * Spent a significant amount of their career working almost exclusively with Assembly/Machine Languages.   * Primary accomplishments include work done with TANDEM systems.   * Has extensive experience with technologies like FoxPro and ColdFusion It's not that we somehow think that what we do is "better" than what they do, on the contrary, we respect these types of applicants and we are scared that we may be missing a good candidate. It is just very difficult to get a good read on someone who is essentially speaking a different language than you. To someone like this, it seems a little strange to ask a question like: > What is the difference between an abstract class and an interface? Because, I would think that they would almost never know the answer or even what I'm talking about. However, I don't want to eliminate someone who could be a very good candidate in their own right and could be able to eventually learn the stuff that we do. But, I also don't want to just ask a bunch of behavioral questions, because I want to know about their technical background as well. Am I being too naive? Should "legacy" programmers like this already know about things like TDD, source control strategies, and best practices for object- oriented programming? If not, what questions should we ask to get a good representation about whether or not they are still able to learn them and be able to keep up in our fast-paced environment? **EDIT** : I'm not concerned with whether or not applicants that meet these criteria are in general capable or incapable, as I have already stated that I believe that they can be 100% capable. I am more interested in figuring out how to evaluate their talents, as I am having a hard time figuring out how to determine if they are an A+ "legacy" programmer or if they are a D- "legacy" programmer. I've worked with both.


title: Document overall business architecture

text: I’m looking to document my business’ overall system architecture. I want to capture what system/s everything starts in, what systems it flows into and why, and where everything ends up. As part of this I also want to identify the processes that allow the data to flow from one system to another including why and how. Being unfamiliar with documenting on this level, I really don’t know where to start. I want it to be easy to read but detailed as well. To give a little bit more information, I’m not really concerned with what happens to the data inside each system, just the inputs and outputs. How can I document this?


title: Where is this from (originally)?: "80% of the lifetime cost of a piece of software goes to maintenance"

text: In the Sun Java coding conventions document (here: http://www.oracle.com/technetwork/java/codeconv-138413.html), it states: "80% of the lifetime cost of a piece of software goes to maintenance" Does anyone know where this statistic is sourced from? I don't doubt the assertion, but I can make up statistics without attribution as well and I'd like to know where this came from before I start using it as a basis for other statements.


title: Difference between various Collection Generic Interfaces in C#

text: I have been playing around with C# for Windows and ASP.net MVC development for some time now. But I am still unclear on a few areas. I am trying to understand the basic difference between and performance issues with using and interchanging similar kinds of Generic Collection Interfaces. What is the basic difference between `IEnumerable<T>`, `ICollection<T>`, `List<T>(Class)`? I seem to use and interchange them without seeing any problem in my applications. Also, are there any more similar generic collections like these that can be interchanged with those three?


title: How effective are "game programs" in interviews?

text: I write business applications for a living. Often, for whatever reason, an interviewer asks me to write up a program to solve some kind of game like problem. I find this to be an inappropriate question for two main reasons:   1. Games often deal with constructs that are rarely used in business dev. E.G. Multi-dimensional arrays. Store player locations on a checkerboard for instance. (Maybe it's just me, but I never use these things in biz)   2. My usual tools like BL/DL, ORMs and even designing the entities themselves don't translate well. So I often end up with some goofy lookin code to start. This is especially awkward if the interviewer is looking over your should to determine how "well you code". Horribly uncomfortable, because...well I don't code like that...I don't write games for a living either. Do you folks use them in your interviews and have they been effective for learning about a business apps dev?


title: C/C++ Best indentation length?

text: I was reading a Vim tutorial ( http://www.oualline.com/vim-cook.html#drawing ), and came across this: > This is very useful if you use a 4 space indentation for your C or C++ > programs. (Studies at Rice University have shown this to be the best > indentation size.) Is there any truth in these studies? Note-- i didn't mean for a flame war in indentation -- just whether anyone else has come across tis study before? **EDIT: @MaR I made a poll** http://poll.fm/3d5kg


title: Code Correctness (?) Annotations for Java (and other languages)?

text: After writing my billionth null check in Java code, I started wondering why the ability to null check method arguments wasn't already built in to Java. For example, for some methods, I want to throw an IllegalArgumentException if some (or all) of the arguments are null. It would be great if I could mark up the code, and have the compiler generate the validation which throws an informative Exception if the validation fails. Is there anything already in Java where you can specify some correctness parameters for method arguments (e.g. _int_ has to be within certain range, or _Object_ has to be not null), and have the Compiler auto-generate the code? In Java it seems like this should be handled with annotations. (I guess in C/C++ you could define some nice macros to do this for you.) In searching the web on this issue, I saw reference to JSR 305, but this seems targeted toward use with IDE tools, and not with the Java compiler. I'm guessing this already exists in other programming languages. So I would be interested to hear about how this may work in these languages, as well as what might exist (or be coming up) in Java.


title: Build one to throw away vs Second-system effect

text: On one hand there is an advice that says "Build one to throw away". Only after finishing a software system and seeing the end product we realize what went wrong in the design phase and understand how we should have really done it. On the other hand there is the "second-system effect" which says that the second system of the same kind that is designed is usually worse than the first one; there are many features that did not fit in the first project and were pushed into the second version usually leading to overly complex and overly engineered. Isn't here some contradiction between these principles? What is the correct view over the problems and where is the border between these two? I believe that these "good practices" are were firstly promoted in the seminal book _The Mythical Man-Month_ by Fred Brooks. I know that some of these issues are solved by Agile methodologies, but deep down, the problem is still the principles still stand; for example we would not make important design changes 3 sprints before going live.


title: MVC shared model different required fields on different type

text: I have a model called Car and depending on what type of Car the user select the view is presented differently. For example the user selects from a grid of different cars and depending if it is a Volvo or a Kia or a Ford the view must allow different fields to be editable. For example with a Volvo the color is editable and is mandatory but with a Kia it is not. I would like to use the one Car class to bind the view but want the client side validation to pick up the required fields based on what type of car. I want to go only to one Action method for the Update what is a good way to approach this problem...? create a base class and inherit from it? will this give me binding problems..?


title: Is there such a concept as "pseudo implementation" in software development?

text: I'm looking for a label to describe the practice of using human-based computation methods or other means of "faking" an algorithm for the sake of getting a product or demo off the ground quickly without spending the time to develop an technical/scalable/analytical solution? Eg: using Amazon Turk to count the number of empty tables in a restaurant. I'm also looking to learn more about this subject, but not sure what to search for. Human-based computation is only one method, I'm interested in the general idea of pseudo-implementation. Any ideas, recommended reading? Thanks


title: Should code review be performed before or after unit tests

text: I am debating with my colleague on when to perform code review - before or after unit tests. What is the best practice? Some factors we might need to take into account (there may be more):   * Size of code change - a big change means more changes will result from the code review. If these changes are big than, if UT was before code review, you'll need to repeat most of your UTs again.   * Time required to perform unit test   * Is it new functionality or a bug fix


title: How to correctly chain overloaded functions?

text: Assuming you have functions which take an increasing number of optional parameters (and a pseudo language which does not allow optional parameters and an arbitrary number of parameters) like this:               function doStuff(Param a)     function doStuff(Param a, Param b)     function doStuff(Param a, Param b, Param c)      What is a good way to unify them to a single call? I can imagine two designs: Fall through everything:               function doStuff(Param a)         doStuff(a, defaultB)          function doStuff(Param a, Param b)         doStuff(a, b, defaultC)          function doStuff(Param a, Param b, Param c)         // magic goes here        * The Upside: Not much code duplication, easy changing of a single default parameter.   * The Downside: Many function calls, might render Stacktraces harder to read or useless. Or directly call the 'last' function:               function doStuff(Param a)         doStuff(a, defaultB, defaultC)          function doStuff(Param a, Param b)         doStuff(a, b, defaultC)          function doStuff(Param a, Param b, Param c)         // magic goes here        * The Upside: Not many function calls, not worries if a new function is added into the chain.   * The Downside: Much code duplication, especially the default values. What did I not think of?


title: Help choosing between two C# books

text: > **Possible Duplicate:**   >  What books would you recommend to someone who wants to learn C# > programming? I'm getting into .Net development, I'm pretty much a beginner programmer, except for an intro class I took in college and just playing around at home. I intend to watch videos online to go along with the book. I have decided on two books, **Learning C# 3.0** by O'Reilly or **Beginning Visual C# 2010** by Wrox. I like the O'Reilly book better, it just has a friedlier and nicer style of writing but it only covers C# 3.0, and the Wrox book obviously covers C# 4.0. Is it a bad idea to go with C# 3.0? I will I be missing out on a lot of stuff? Any advice will be greatly appreciated.


title: What did Bill Gosper mean by saying a data structure is just a stupid programming language?

text: There's a quotation by Ralph William Gosper, Jr that says: > A data structure is just a stupid programming language. What did he mean by this? Alas, all I can find in Google about it is relentless copy/pastes of the quotation itself, without any context.


title: Is there a way to handle nested Collections more elegantly?

text: My question is rather a design question. In my program I got to a data structure that looks something like this:               private ConcurrentHashMap<A, ConcurrentHashMap<B, ConcurrentHashMap<Integer, C>>> services  = new ConcurrentHashMap<A, ConcurrentHashMap<B, ConcurrentHashMap<Integer, C>>>();      Is there a way to handle such a data structure more elegantly? Thanks! **edit** : A, B and C are business classes. An A instance "can have" (as association) many Bs and a B "can have" many mappings Integer-C.


title: Is it possible to have a single code base for a desktop GUI and a web application?

text: The required user interface is fairly simple; basically, two tables that "interact with each other", e.g. certain rows in one table get highlighted when a row in the other is clicked, plus maybe a panel with charts. Is it possible to have a (largely) single code base for a desktop app and a web app implementing this interface? For a few reasons, it would be good to have both versions, but I would hate to implement the GUI twice. The details of my particular case are as follows:   1. This is an academic research problem, so I don't have strict constraints in terms of tools and the coding style (or users!). On the other hand, I do have quite some time constraints.   2. It has to run on bare JVM, but any language/framework would be welcome (Java, Groovy, Scala, Clojure, etc.).   3. There is no persistent state, i.e. no strict need in a shared DB or any server part whatsoever.   4. I would be willing to go through some design hoops to make it work (by design hoops I mean some unconventional application architecture). Is it completely crazy to even think about something like that? If no, what would be the tools to pull it off?


title: Looking to create website that can have custom GUI and database per user

text: I have developed an MS Access database for a company to track data in regards to production of a certain commodity. It has many many tables, forms, reports, etc. These were all done as the user requested, and resemble the users previously used system, mostly printed worksheets and excel workbooks. This has created a central location for all information and has allowed the company to compare data in a new way. I am now looking to do this for other companies, but would like to switch it to a web application. Here is my question. What is the best way to create unique solutions for individual companies that can have around 100 users each? I would love to create one site that would serve all parties, but that would ruin the customizable nature of what I am developing. I love the ability to create reports, excel sheets, pdf, graphs, etc with access, but am tired of relying on my customers software, servers, etc. I have some experience with WAMP, but I am far better at VBA. I was okay at PHP, and was getting a grasp on JavaScript a few years back. I am also trying to decide whether to go with WAMP or LAMP, if web is the best choice. Also, should I try set up one site for all users that after log-in goes to company specific pages, or individual sites for each company? Should I host or use a service?


title: When to act on impediments?

text: During the meeting, each team member answers three questions:   1. What have you done since yesterday?   2. What are you planning to do today?   3. Any impediments/stumbling blocks? Any impediment/stumbling block identified in this meeting is documented by the Scrum Master and worked towards resolution outside of this meeting. No detailed discussions shall happen in this meeting. In the last question, it states that "Any impediment/stumbling block identified in this meeting is documented and worked towards resolution outside of this meeting". From my experience, just about every "impediment" results to slippage. So how would you, the average Scrum Master respond to such slippage? Do you assume that only a day slippage in a two or three week sprint is normal and hope for the best? Do you assume that a three day slippage is reason to assign help? What would 'your' tolerance level for slippage normally be? Do you have a formula you stick to (ie: if the slippage is 20% late you automatically assign someone to help)? I'd just like to get a better understanding of this third rule.


title: How to word user stories which have been split from a larger epic

text: I have an epic which involves creating a mobile application which retrieves a user's data they have previously created in a web application and act on it locally. It seems logical to split the epic as follows;   1. Mobile app which acts on local, mocked up data   2. Mobile app which downloads data from the web app's api but with no authentication   3. Mobile app which downloads data from the web app's api _with_ authentication I'm struggling to word these stories. 1 is a scenario which would never happen for the end user, he wouldn't have any local data if it hadn't already been retrieved previously. How would I word this? If 2 is 'As a user I want my mobile device to act on the [entities] which I previously created via the web interface' then what would 3 be? 'As a user I want my mobile device to act on the [entities] which I previously created via the web interface _trusting they have been retrieved securely_ '??


title: Patterns for Integrating search (ex. Lucene) into a .NET desktop application

text: I am making a .NET desktop application (WinForms+Local PostgreSQL Server) for managing sales in a small store. I wish to integrate Lucene search facilities into the 'Product Search' module of my software. Are there any good patterns for integrating such Information Retrieval Libraries into existing applications? Note : The application is still in development and I can always modify the architecture to integrate Lucene. Note : I know how to use Lucene and have created a simple demo app to test it's capabilities. I am only looking for patterns that integrate such search functionality into Desktop Applications. Note : Also the main requirement of the integration is to enable the user to quickly search for products/brands/etc and provide a google autocomplete'esque system in the UI.


title: Create a database for database tables

text: I'm working on a project where I have to give users the ability to build their own tables, each user can create more than one table. (the type of all data is string). The user can create a table and specify what columns he wants inside it. What is the best way to do that:   1. to create databases dynamically   2. to have a table for tables (key,value ...).   3. something else Another issue is: is it better to separate my database into two, so one is for the internal use (users, accounts,....) and the other is for the tables of the users (or for the table of tables)?


title: longest list of words with matching start and end letters

text: My friend gave me a problem that he says is easy, but I can't figure out a good algorithm to use to do it. You are given an input of 100 random English words. You have to find the longest string of words where the last letter in one word matches the first letter in the next word. You can only use each word once. For example, if you were given the words "cat", "dog", "that", the longest string you could make would be "cat -> that". If you were given the words "mouse", "moose", "unicorn", the longest string you could make would just be one word (since none of those words link). If you were given the words "bird", "dish", "harb", the longest string you could make would be "harb -> bird -> dish" (or "dish -> harb -> bird" or "bird -> dish -> harb"). I came up with the idea of modeling this as a directed cyclic graph. Each node would just be a word, with vertices going to each word/node that started with the letter this word ended with.               +-------+         \ +------+     |  cat  |-----------| that |     +-------+         / +------+         |                  |        \|/                 |     +-------+ /            |     |  the  |--------------+     +-------+ \      This problem appears to be a longest path search, which is NP-Hard. Is there a better way to do it? Or even some sort of approximation algorithm that could be used? Or some way to exploit qualities of English to reduce the search space?


title: Web Framework for Education Management System

text: _Please note that I'm moving my original question from StackOverflow to here, because I think it's more on-topic here_ So, I'm working on an idea and I'll go into a brief overview of that but my question is, What are some good web frameworks for this situation? I have some experience in the following languages:   * C#    * Python I have considerably more experience in C# than Python, however I am expecting to learn new things. My idea is this, a completely web-based community-oriented Education Management System that focuses on making students and teachers day-to-day lives easier. For students it will provide a centralized place for them to do homework, study for tests, and reinforce concepts learned previously in class. For teachers it will give them a centralized place to handle assignments, attendance, homework, tests, and all other major parts of classroom management. All of that, but in a community-oriented fashion. Everything a teacher does is shared and open to constructive criticism, allowing other teachers to use their assignments/tests and for students or other teachers to comment, rate and criticize their assignments. This encourages an environment of openness that will allow teacher's to focus on teaching and student's to focus on learning. And that community wouldn't be limited to one school or school-district, this system would be completely school-independent. _Also note that I have no problem with hearing constructive criticism on this idea, however I would prefer if this post was more focused on my question._ I have somewhat explored about the following options:   1. Django    2. ASP.NET    3. Ruby on Rails   4. Silverlight (1) I have Django installed and I played with it for a little bit, I really like how easy setting up databases are and how it handles the database completely for you. I don't really know how to use it very well and I don't quite understand the Model-View-Controller paradigm(?) for it yet but I haven't thought about it much. I also like the fact that it uses Python. (2) I don't really like Visual Studio for developing in ASP.NET, I hate the way the web-designer works and it just feels clunky and old. I like the server-side development part though. I don't like how expensive ASP.NET and overall Visual Studio is, even if I do get it for free for now using DreamSpark (3) I haven't been able to explore much with this, I could not get Rails (or maybe Ruby) properly installed. I first installed it within RadRails and that didn't work so I uninstalled RadRails and then installed the latest version of Ruby off the official Windows Installer and then installed Ruby on Rails through gem and even after all that it still didn't work, so I installed Netbeans and attempted to use it there but it still did not work (4) I like Silverlight in some extents, I've played with this one the most, it's very similar to WPF (which I've used the most) in a lot of ways but I don't like how database connectivity works, at least in comparison to Django. I also dislike how expensive everything with Microsoft is, even if I get it for free for now with DreamSpark. **I would like to hear some suggestions from experienced web-developers as to what I should use and why, or at least what some good options are for my scenario**


title: Create Offline Demo Environment Database Substitute

text: I would like to know if there is a best practice for creating demo environments that substitutes database interaction into other forms of resource i.e. creating .json files containing the data that was supposedly returned from a webservice call. I wanted to know if there is already a standard way of obtaining the same result. Thanks


title: More elegant way to avoid hard coding the format of a a CSV file?

text: I know this is trivial issue, but I just feel this can be more elegant. So I need to write/read data files for my program, lets say they are CSV for now. I can implement the format as I see fit, but I may have need to change that format later. The simply thing to do is something like               out.write(For.getValue()+","+bar.getMinValue()+","+fi.toString());      This is easy to write, but obviously is guilty of hard coding and the general 'magic number' issue. The format is hard-coded, requires parsing of the code to figure out the file format, and changing the format requires changing multiple methods. I could instead have my constants specifying the location that I want each variable to be saved in the CSV file to remove some of the 'magic numbers'; then save/load into the an array at the location specified by the constants:               int FOO_LOCATION=0;     int BAR_MIN_VAL_LOCATION=1;     int FI_LOCATION=2     int NUM_ARGUMENTS=3;          String[] outputArguments=new String[NUM_ARGUMENTS];     outputArguments[FOO_LOCATION] = foo.getValue();     outputArgumetns[BAR_MIN_VAL_LOCATION] = bar.getMinValue();     outptArguments[FI_LOCATOIN==fi.toString();          writeAsCSV(outputArguments);      But this is...extremely verbose and still a bit ugly. It makes it easy to see the format of existing CSV and to swap the location of variables within the file easily. However, if I decide to add an extra value to the csv I need to not only add a new constant, but also modify the read and write methods to add the logic that actually saves/reads the argument from the array; I still have to hunt down every method using these variables and change them by hand! If I use Java enums I can clean this up slightly, but the real issue is still present. Short of some sort of functional programming (and java's inner classes are too ugly to be considered functional) I still have no obvious way of clearly expressing what variable is associated with each constant short of writing (and maintaining) it in the read/write methods. For instance I still need to write somewhere that the FOO_LOCATION specifies the location of foo.getValue(). It seems as if there should be a prettier, easier to maintain, manner for approaching this? Incidentally, I'm working in java at the moment, however, I am interested conceptually about the design approach regardless of language. Some library in java that does all the work for me is definitely welcome (though it may prove more hassle to get permission to add it to the codebase then to just write something by hand quickly), but what I'm really asking is more about how to write elegant code if you had to do this by hand.


title: Anonymous function performance - setTimeout

text: According to Gregory Baker & Erik Arvidsson (Google), creating a named function and then passing that to setTimeout is actually faster than creating an anonymous function (reference: Optimizing JavaScript code -> Avoiding pitfalls with closures): > Creating a closure is significantly slower then creating an inner function > without a closure, and much slower than reusing a static function. For > example: > > <snip>                   function alertMsg() {           var msg = 'Message to alert';           alert(msg);         }      > is slower than:                   function setupAlertTimeout() {           window.setTimeout(alertMsg, 100);         }      In my testing, there does not appear to be any significant difference (jsPerf here), so why do they claim that creating a whole named function is faster than simply making an anonymous function? EDIT: note that I am specifically referring to the last two examples, the first one has been removed for clarity.


title: How can I bootstrap a software development community at my school?

text: I'm a student at the University of South Florida who's frustrated with the educational environment in the Computer Science program. Right now, I'm taking "Program Design." I should be learning how to organize my source code into functions and modules in order to make my programs readable and maintainable; instead, I'm learning about arrays and recursion in C. Next semester, I have to take "Object-Oriented Design," which is taught through C++ ( _shudder_.) Two years ago, I fell in love with programming, and I've been learning as much as I could since then. The prospect of taking another C++ class bores me almost to tears. For that reason, I thought I would start a programming club in order to meet similarly ambitious students, learn new languages, discuss software development topics, and work with other students developers. However, I'm beginning to realize that there may not be any other students who share my software development experience. It's not because of a lack of motivation but a lack of opportunity: I know of only one other programming class ("Programming Languages") and no classes on real-world software development. Everybody else only has experience writing trivial scripts in C and C++. I've realized that if I want to work with other student software developers, I'm going to have to train them myself. Now, I'm planning to make the club a software development bootcamp, teaching members how to develop software with modern tools and languages. Obviously, starting an unofficial software development course is a monumental task with many possible approaches. My question to you, dear reader, is **What's my plan of attack?** Should I   * lecture the club myself, trying to balance club work with homework?   * ask the CS faculty to teach on topics within their expertise which may be less than relevant to members?   * try to find a sympathetic, experienced developer inside or outside the school who can share my workload?   * show video lectures (from MIT OpenCourseWare, Google Tech Talks, etc)?   * hold hands-on programming workshops?   * assign homework?   * do something else?


title: Function locals: variable used in just one function

text: In OOP, **static scope** means the scope is linked to the class, and **instance scope** is linked to a specific instance of the class. Some languages support **static locals** , which allow a value to be retained from one call of a function to another, however still in static scope. As you might conclude from some other posts by me here, you can tell I'm a big fan of **encapsulation**. Sometimes I use a certain **instance** variable within a class, **only within one method**. E.g. a flag indicating whether a certain method has already been called. My convention (following good standards) is to place these variables right before the function, close to their usage. Ideally, I would be able to place them **within the function scope**. Following the naming scheme of static locals, let's call this hypothetical scope **function locals**. Darien reworded this very clearly in a comment: > Ah, so what you really want is something beyond even private protection, > which is so closely protected that it is only visible to a single method > within a single instance. Now I know you could say, following the Single Responsibility Principle, this method and the associated variables should most likely be split into a separate class. To verify this - and I challenge you to do the same - I looked into some random code files and quickly found source files (even < 100 lines) where such a 'function local' could be used. Actually, C# offers a solution to this for one common scenario out of the box. Auto-implemented properties hide the backing field. This idea might be far-fetched, but somehow I feel it would make sense. Does anybody know of any language which supports this?


title: I don't understand the Halting Problem

text: I just ran across an answer to another question that references the Halting Problem. He starts with this snippet:               def halts( code_block ):         # Some magical code          def whistler():         while halts(whistler):              sys.whistle( 1 )      and then explains how the routine `halts` cannot be defined correctly because it essentially ends up being logically equivalent to "this sentence is false". Aside from the Python-style syntax, this is basically the standard explanation of the halting problem, and I've never understood the concept. Every time I look at that type of example, I think "but why in the world would anyone approach the problem in that way in the first place?" If I wanted to determine a difficult property of a piece of code, such as answering the question of whether or not it halts, there's no way I would put the analysis _inside the code to be analyzed!_ First off, that leads to contradictions like this example, and second, adding analysis code changes the nature of the thing being analyzed. I would almost certainly go about looking for the answer to the question with external tools, not internal ones. So yes, I understand that there's no way to write a correct implementation of `halts` in the example above. But let's restrict ourselves solely to the realm of code that actually can be written correctly, instead of hypotheticals. What's an example of code that can actually be written and executed, for which it is impossible to determine by external analysis whether the code will end up in an infinite loop or whether it will terminate?