title: Multiple handlers of an exception, and handling exceptions in the UI

text: Related to: Is onError handler better than exceptions? **Premise** I am writing a piece of library code that performs certain tasks, to separate concerns, we decided it should not write to a log or write to the display directly, but instead provide an event registration mechanism that allows interested client code to listen to events of its life-cycle. So far so good. We have an event handler for log, and and event handler for display, they are informed when an event occurs and they write to the log / display independently. So we have so far (pseudo code)               class MyLib(List<MYLibEventHandler> listeners)           class Display implements MYLibEventHandler          class Log implements MYLibEventHandler      **Question** The question that was raised was - how to inform the clients of exceptions? One way of looking at it is that an exception can be looked as just another event. It is something external that happens, and the clients are interested in knowing when it occurs. So we can simply add another event for exceptions that receives the exception object. (we can re-throw the exception to allow any other try / catch constructs to handle it, but the log / display are not really _handling_ the exception, they are just being notified it happened so they can do whatever they want with it. They can't really recover from it) On the other hand, it smells wrong. An exception is not a normal event, it's a break in the flow, so we can say that our "main" will catch any exceptions and pass it to the `Display` and `Log` instances explicitly, outside of the event dispatch mechanism. This smells also, because we already have a list of listeners, yet we explicitly call the log and the display to handle the exception. (Perhaps I should not be alarmed that the code is doing something "exceptional" when handing an "exception". but it still smells that I need to keep track of clients twice) So I'm stuck with a code smell no matter what I choose. Is there a design pattern to handle multiple listeners / handlers for the same exception? try catch is very "single listener" / "hierarchical" structure, it doesn't seem the right tool for a wide "dispatch" like scenario. Perhaps some sort of an AOP pattern? My attempt to answer this is that if I have a remote server, with multiple clients, and the server needs to communicate that a server exception occurred, there would be no question since the client can't really "try / catch" the exception. It will be more likely be sent as an event (e.g. in Akka as a Try object). Even in RMI, the exception is sent more as an "event" and only then triggers a `RemoteException` locally. Is there a known design pattern to handle multiple, independent, read-only listeners for an exception (e.g. listeners that can't and won't recover from the exception, they just need to know it happened) Perhaps in this case, sending the exception as an event (and then rethrowing it) is the right way to go?


title: Is it true: use Agile methodology results less planning?

text: I am kind of new in agile environment since I always participated in projects before which was only said to be agile while it wasn't. Now I am really in an agile project and I see a setback - if it is setback - of agile methodology, the lack of pre-planning. I see that our BA talks to key users, collects data, which are pretty much just a sketch what they really want. Then we first need to refactor many of things because the real needs are a little bit different. Then there is a second phase when we realize they need a bigger system we expected, following that we need to make bigger refactor and generalize everything afterwards. My questions are: **Is this the way it should be? Given by the information are we doing it in the good way? And if the answer yes, then does the low planning costs match with the higher refactoring and rewriting costs? So to say: profitable?**


title: Should I devise a FileHandler interface to deal with different Files?

text: My background has largely been manual testing and I started learning core java to be able to work with Selenium. I am wanting to write couple of reusable method, like reading/writing data from csv, excel, word etc. I created a class named - FileHandler and created method for this. Hence this class deals with all sorts of files - csv, excel etc. But going by the OOPs concepts (and if I have understood them right) I should be creating an Interface and implementations for this Interface, and instead of directly dealing with specific implementation I should be working with reference of type interface. i.e.               public interface FileHandler {     }          public class ExcelHandler implements FileHandler {     }          public class WordHandler implements FileHandler  {     }      My question - is this right approach in my scenario should I just create one class to handle all file input/output operations? Though I am yet to figure out what goes in interface as methods like -               getExcelData(String filePath, String workSheet, String row, String column)      would be specific to only reference of type - ExcelHandler and does not make much sense keeping them in interface.


title: How to avoid huge functions with made up of enums and if-else or switch case when dealing with server response in iOS?

text: in my application, I have a request type associated with variety of API calls I make to the REST server. when the response from server comes in the same delegate method for web engine's response, I have to check the API type in the request object passed as a parameter to the delegate method and then take the corresponding action. The problem is there are around 10-12 different API request types. So the switch case that checks the different enums associated with API Types, takes action based on it. How to get rid of this switch 'tower' ?


title: How to work in an environment with a 'character assasin'

text: This is hard to explain, so I will start with my background. I have been in development for about 8 years (6 commercial), have a MSc in OO Info Systems, have a true passion for development and up until a year ago would spend most of my time learning new things and creating helpful applications for the team. I work at a large investment banking company and this new developer who used to work for one of the larger investment banks joins the team, lots more experience than me, more professional etc... etc... Initially I helped him out when he started (ALOT), my attitude up until recently is a team effort everyone helping each other out, but I think he saw this as a weakness. I was the big cheese up until he arrived, and in hindsight and in present time he now is. We clashed because I take the object-oriented route and focus on good design / documentation etc... whereas he prefers not to do documentation and sort of hates OO prinicples, he would rather create a nice interface than good code, next to no comments, doesn't like unit tests, doesn't like interfaces/abstract/inheritance etc. The problem is what he is good at is pleasing management and I have to give credit where credit is due. Now after 6 months he tried to always surpass me, take my code ideas and call them himself, snipe behind my back etc.. and eventually won favour with the developers and increasingly began criticsing me. I'm now at the point where I am very stressed out because everyone has become hyper-critical of my code but when he or someone else makes a mistake or an error its quickly forgotten. Ergo the pressure is very much with me. I'm not used to this situation and wondered if someone out there has come across this and has advice on how to tackle this situation? Or can share a similar experience that might be useful


title: Is it better to have one method that takes a bool as a parameter or two methods with different names?

text: I'm writing a factory class for a Selenium Web Driver and I came across a choice that I couldn't figure out which is cleaner. Having two methods with the same parameter.               GetWebDriver(string browser)     GetRemoteWebDriver(string browser)      or adding a boolean parameter               GetWebDriver(string browser, bool isRemote)      I would think in this case the first option might be better because there is very likely no reason I need to extend it to more than a boolean of choices and hence two methods. On the other hand, I can see the second one to better for when there is more than two choices or likely many extensions in the second parameter in the future. Which would you choose for Cleaner Code and why?


title: Best approach for near real time message passing from server to client across router?

text: I am developing an application which must run on up to thousands of client systems that I control (Linux) which are connected behind common NAT devices to public Internet. Each of these client devices must receive infrequent messages from a cloud service (1 or 2 per day) and on average, must receive these messages in less than a 500ms. I have full control of both server and client systems to install any operating system, programming languages or applications. However I will not have control of the router and network in between. Otherwise, I could just call a web service running on the "client" devices in order to send the messages. I have considered running Node.js on the cloud service, with javascript sockets on the client kept open 24x7. From what I am told Node can handle tens of thousands of open connections, making it an ideal server for this. NAT devices will time out open connections, so dummy keep alive data could be sent. And if the connection is dropped, the client just renews the socket. Other options include Erlang or even a simple c socket with long polling. However I am having a difficult time researching this problem for other approaches. What would be the best approach? Given no restrictions on language or programming.


title: Working in a multi-disciplinary team; with a specific skill set - time management?

text: I thought I'd post this here for the anonymity of someone I was speaking too recently at a social event for developers. Amongst the trading of _"war stories"_ , he presented the following dilemma.. (Specific questions below) > At the moment I'm working at a start-up - with a handful of developers. I > only really come in to contact with a front-end developer, my manager. This > is perfect when I'm doing front-end specific development - but I'm generally > more suited to back-end work, thus I get called upon to do back-end > development at times. > > I recently undertook a project where the requirements weren't made very > clear, there was no management as per se as my usual manager was on leave > during the development phase - and certain stumbling blocks appeared. > (Technical ones; file parsing and formats etc) There was an intention for > the front-end dev to be completed by my manager upon his return. > > Despite the stumbling blocks, the project was completed. A few bugs were > found, but these were largely ironed out before a handover late on a Friday > evening. My manager came back with several suggestions, some of which he had > made, and requested they be done for 11am on the Monday. The work required > for these changes include: > >   * Database Restructuring (To accomodate new data) >   * Code refactoring (To accomodate the above + a more complex file parser ) > > > To include testing, I'd estimate this was a good 12 hours or so of work. > Brainstorming, development, assorted fixes (was a list of 7 or so points) > and then testing. Now I had commitments over the weekend, so I'm stuck on a > Sunday night working in to the early hours to get this done. > > There are plans to bring on a project manager, but this is just one example > where I've taken my work home (often voluntarily, I will admit.) - and it's > actually eating in to my personal development, and also sucking some of the > satisfaction out of what I do. In my opinion too, it leads to spaghetti code > and bugs - which I've witnessed before.   * **Realistically speaking, how is a work/life balance meant to thrive in a set of circumstances such as the above?**   * **Is the lack of satisfaction possibly a productivity issue in the end?**   * **What can you do when you've been given an unrealistic task, but the situation is such that it's 'do or die'?** (Perhaps when the task was assigned by someone without a complete technical understanding?) I'd really like to hear other peoples views on this, as I'm going to guess it can be quite a interesting (and common) problem. One which involves a fair amount of diplomacy. (Will post my response as an answer, **I will not accept it however** )


title: Agile bug fixing - what's the preferred process for testing?

text: When a bug is fixed, the dev set its status to "resolved" and the bug is reassigned back to the person that created it. In our case this is usually the product owner - we don't have dedicated testers. But what's a good process for controlling how/when the PO tests the software? Should he be given the latest build after each bug is resolved/checked-in? Or what about every morning? Or should he only receive a build at (or close to) the end of the iteration, to include all of that iteration's new functionality and bug fixes? We are using TFS by the way.


title: How to loosely couple modules in service oriented architecture

text: We're developing a total solution, and we've chosen service-oriented architecture to loosen subsystems. However, now we have a problem. When customer orders something, **Order Subsystem** is responsible to get that order, and register it. However, there are some other modules which are responsible too, in order registration process, and each module should do something on it:   1. Customer Accounting module should check customer's balance, and prevent order registration if there is not enough money in customer's account.   2. Asset Management module should increase/decrease customer's assets   3. Rule Engine should apply some business rules dynamically on it (like preventing a specific customer, or notifying an operator, etc.)   4. CRM should view customer's history, and give good customers some discount   5. ... Right now, we're doing it this way:               public void RegisterOrder(Order order)      {         RuleEngineService.ApplyBusinessRules(order);         // some code here         CrmService.GiveDiscountIfApplicable(order);         // some code here         CustomerAccountingService.CheckBalance(order);         // some code here         AssetManagementService.ChangeAssetCount(order);         // some code here     }      This means that if we add another subsystem (module) that needs to do something on order, we have to **recompile** the code of our OMS (Order Management System) to support it. Also we're coupled to some extent to other subsystems here, and if one of them fail, this registration process fails. One way of making this piece of code dynamic and loosely coupled is to use **interfaces** or **contracts** , like:               public void RegisterOrder(Order order)     {        // Finding a list of all IOrderProcessors.        // Looping over each, calling orderProcessor.Process(order);     }      However, it has two problems:   1. We can't use interfaces over SOAP and HTTP (we don't have access to other subsystems' DLL files)   2. Those need to run in a specified order (rule engine the first one) What should we do here? What are the known patterns and practices?


title: Selecting an appropriate design for Month/Date Selection

text: I have a requirement what seemingly looks very simple (and perhaps strange) but some minor details are giving me troubles. Perhaps I'm overthinking this. I'm building a scheduler application (on WPF) for an embedded device that runs everyday. The scheduler controls when the device can be turned on and off. For example, the embedded device can be scheduled to shut off every weekends and on any holidays, such as July 4th. So I went ahead and designed my datastructure to hold a datetime collection for holidays. Firstly, I don't need to store the time but apparently in C#, there's no other appropriate class that holds just dates. Second, I also don't need to store years but then I have no way of knowing whether it is a leap year or not. (For example, I can schedule the device to be shut off on every February 29th, but that date may not be available on a particular year.) I also need a way for the users to select a month/date. As far as I know, there's no appropriate UI control available to handle my problem. I think I need to look for something like this (Below is photoshopped from a standard calendar control): ![enter image description here](http://i.stack.imgur.com/XHyeW.jpg) What datastructure/design would you use to handle problems like this? What's a good UI design to have users intuitively select a month/date?


title: In Objective C, what English words can I conceptually associate to the symbols?

text: I'm learning Objective C (from a C# background) and am having difficulty understanding the unusual method signatures and am looking for a shortcut to make the learning curve less steep.   * When reading Objective C code, what English words or phrases can I associate with the symbols? For example, calling a method looks like this:                 @implementation Calculator            -(int) add:(int)a and:(int)b {       }       @end      I would write this code:               Calculator *calculator = [[Calculator alloc] init]];     int sum = [calculator add:10 and:20];      So far in my learning cheat sheet I wrote: `"[" means "do"` I don't know what curves or bumps I'll run into as I proceed, but I am looking for a conceptual reference handy for a Objective C newbie.


title: What is the typical career path for a Software Development Manager?

text: What does the career path of a Software Development Manager typically look like, in terms of years of experience, education, professional background, and so on?


title: Migrating from python 2 to 3

text: It is easy to find questions asking if one should start with python 2 or python 3, and it is a consensus that python 2 is the way to go as it is has more libraries and thus better supported. Python 3 was launched back on 2008 and this question already addressed a migration. As it was too soon, the solution was to wait. 5 years have passed now and a good bunch of libraries already support python 3. At the time I write this question, according to this page 244 packages on pypi support python 3 while 156 does not. On the top 30 most downloaded packages, 24 support python 3 Following this I feel safe enough to start migrating from python 2 to 3 and also avoiding telling people to start on python 2 My reasons explained, the question is: **What concerns should I have when migrating from python 2 to 3?** Not just code syntax and replacements, as its easy to find a conversion tool to do the 80% of the job, but general concerns, like:   * Do virtual environments mechanism changes?   * Building, packaging and distribution differences   * Will I have only cPython? (Looks like Jython has a long way to go to reach python 3)   * Multi threading/processing programming. Always a delicate subject   * Testing. Any changes?   * What common things that I can still do like in python 2 but I should stop and start doing in an other way? I feel that a code replacement tool will change the code to make it just "runnable", but it will not use the correct or better option if the option itself involves big changes ps: This question was asked on stack overflow, but was closed as too broad. Anyway, I felt that the correct place is here


title: How to ensure a single coding standard in .NET with tool support

text: Probably, the basic situation is familiar to everyone. You have agreed on certain coding standards in your team and now it is time to make sure that everybody follows them. Some do it via heavy paired programming, others maintain a list of coding standards and do a manual review. Others even use the static code analysis tool from Visual Studio to make sure that coding standards are enforced. What are your best practices to ensure coding standards? Which tools do you use - are there some essential tools every dev should know? How do you integrate the standardisation of your code in your development tools? Thank you! Stefan


title: Are there open-source JavaScript libraries addressing multiple browser tabs and client state for newer browsers?

text: There are a few new HTML5 features that have made it into recent browsers that allow sharing state among tabs, browser windows, same domain windows, etc. So it's probably gotten a little easier to write a web application that keeps a lot of state on the client and also manages state intelligently between tabs and/or windows. There are currently libraries like Backbone.js that can help manage state in a single tab or a single window. Is there anything out there yet that helps with multiple tabs (or windows) managing global state, tab specific state, and cross-tab eventing without relying on the server to sync them all up?


title: data maintenance/migrations in image based sytems

text: Web applications usually have a database. The code and the database work hand in hand together. Therefore Frameworks like Ruby on Rails and Django create migration files Sure there are also servers written in Self or Smalltalk or other image-based systems that face the same problem: Code is not written on the server but in a separate image of the programmer. How do these systems deal with a changing schema, changing classes/prototypes. Which way do the migrations go? Example: What is the process of a new attribute going from programmer's idea to the server code and all objects? I found the Gemstone/S manual chapter 8 but it does not really talk about the process of shipping code to the server.


title: When should I *not* use Unicode?

text: Unicode seems that its becoming more and more ubiquitous these days if it's not already, but I have to wonder if there are any domains were Unicode isn't the best implementation choice. Are there any languages or scripts that Unicode will not work well or won't work at all? Are there any technical reasons to use a different system entirely (other than working with legacy systems)? Naturally, I would assume that the answer is to always use Unicode. Am I wrong?


title: When is it beneficial to not use utf-8?

text: When is it beneficial to use encodings other than UTF-8? Aside from dealing with pre-unicode documents, that is. And more importantly, why isn't UTF-8 the default in most languages? That is, why do I often need to explicitly set it?


title: JSON or XML for parsing for a Windows Store 8 applicaiton?

text: I am getting some data from Gov tracker (http://www.govtrack.us/developers/api) and creating a Windows 8 Store application.. I started out trying to use the HttpClient to get the JSON and then use Json2Charp.com to convert it to classes... But then I had no idea what to do with this giant class and the line                 var contacts = JsonArray.Parse(data);      would not work.. So now I requested it as XML and I am using XML to LINQ to slowly get what I need ..for example..                   var things = from x in xdoc.Descendants("person")                          select new Person                          {                              firstname = x.Element("firstname").Value                          };      But in this case and in general what is the easiest way? Is it using XML for this windows 8 application and using JSON to javascript applications? (since I always hear about how JSON fits so well with javascript) At the moment since I could not get the JSON deserialization to work I guess XML is easier in this case?


title: Is "WinForms" a widely-known and acceptable substitute for "Windows Forms" on a résumé?

text: I'm always trying to hone my résumé to the bare-bones essentials -- no fluff. I want to keep as many points as possible to a single line, and to this end I have used the term _WinForms_ in several places. I wanted to check my capitalization against other examples, but this term is not used on the official http://www.windowsclient.net site; it doesn't even appear in the Wikipedia entry. Can I reasonably expect someone looking for a .NET developer to _get_ that? Even if they're looking for web developers? Would you write it as I have (WinForms)?


title: How to transfer teams to an Agile programming methodology

text: My group has recently grown in size with the addition of several teams from different projects. We work using an Agile programming methodology: 2 week sprints, deliverable every sprint, 2-3 pushes to production every sprint for each team. How do I "convert" the newly added teams to this methodology and way of thinking with as little trauma and resistance from the members of these teams?         Note: I'm not asking if they want to change their methodology, they will have to operate this way to be in sync with the rest of the group. This is a different question than this one as all other teams already work using Agile programming.


title: Decouple GUI & Program logic

text: I have some windows c++ code (pure winapi c++, no MFC etc) that I would like to build a GUI for. My code does not know about windows GUI, it is completely decoupled from any type of UI. The question: How could I build a UI around the existing code. Ideally, I am imagining something like this: GUI <\--> Mediator <\--> MyExistingCode For example, `MyExistingCode.showmsg(char* msg)` would call `Mediator.MessageBox(0, 0, msg, 0);` I'm stuck at how to design the Mediator class (If that is the correct way of going about this). Is the Mediator an Interface?, Abstract Class?, Other? Is an MVC model the best way to go?


title: Learning Scala, feeling discouraged

text: I'm coming from a Java background and trying to learn Scala. At the moment I'm feeling pretty overwhelmed, there seems to be so much more to learn with Scala, so many different ways of doing the same thing. I was wondering if anyone has any advice on where to start, and how long it took them to feel reasonably competent in the language? Even little things like for loop comprehensions seem really powerful but it's just another piece of syntax you need to remember!


title: How Stack and Heap is allocated for threads under the same process in Windows?

text: Stack for different thread is different.but what about Heap. If Heap is different for different threads, then how they share objects?


title: Would using rainbow tables to detect weak user passwords feasible?

text: As I understand in most security breach where the list of hashed password are compromised, attackers do use brute-force to try to find weak password and, invariably, they always find quite some (like in the recent Github breach). If I'm not mistaken in most cases when a user creates an account, the password is sent, encrypted (due to TLS / SSL), to the website which then adds some salt and stores the hash + salt. Even in most sophisticated cases (like when bcrypt is used), upon account creation there's one point in time at which the server does have the password in cleartext. My question is: couldn't you use, at that very moment when you have the password in the clear that the user is trying to use for his new account, a gigantic rainbow-table on the server side to check for billions and billions of weak passwords in a split-nanosecond? Then if you detect that a weak password is used, you'd simply tell to the user that his password is too simple and that, no, using "edcrfvtgb1" isn't smart. I mean: if attackers manage to brute-force weak-password _even though they have to deal with the problem of the salt_ , couldn't servers benefit from the fact that, when the users creates a new account, they do know the password in the clear to simply look it up in a big rainbow table when the user creates his account? This doesn't seem hard to implement and seen harddisk sizes these days, it's probably not problematic to store a big rainbow table on the server side. Am I missing something obvious or would this help catch a _lot_ of weak passwords and, hence, mitigate the endless accounts compromise we keep seeing on a nearly daily basis?


title: asp.net mvc vs angular.js model binding

text: So I've noticed a trend lately of .net web developers using angular.js on the client side of applications and I've become more curious as I play around with angular and compare it to how I would do things in asp.net mvc. I'll give a quick example of what really got me thinking. I recently came across a situation at work (I work in a .net environment) where I needed to create a table bound to a collection of objects that had the ability to add and remove rows/items from the collection. I had an add button that created a new object and appended a row to the end of the table, and a remove button in each row to remove a particular object/row. Using asp.net mvc, I first found myself making an ajax call to the server for each operation, updating the server side model, and refreshing part of the page to show the result in the table. This worked but I didn't really like the idea of calling the server to update the model each time, so I tried to come up with a solution to do this on the client side. It turned out to be quite a task, as I had to generate the html on add with validation and all and the correct indexing for the model binding to work. It got worse on remove, as I ended up with a crazy string replace function to recreate the indexes on each item to satisfy the binding requirements (if an item other than the last is removed, the indexes are no longer correct). Now out of curiosity, I tried to recreate this at home in angular (which I had no experience with) and it took me all of about 10 minutes with simple functions to add and remove items from the client side model. This is just one example, but it seems to me that I'm able to achieve the same results with far fewer calls to the server in angular because of the fact that it binds to a client side model. So my question is, is this a distinct advantage of using a javascript mvc framework or am I somehow under utilizing the power of asp.net mvc and am I right in thinking that these operations should be done on the client and have no business requiring calls to the server?


title: Placing arguments on their own lines

text: This question applies to both parameters and arguments, since I've seen this style used in both. I usually write parameters like this               someFunction(arg0, arg1, arg2)      but I've recently noticed that many people write theirs like this               someFunction(     arg0,     arg1,     arg2     ) // the bracket doesn't have to be on its own line      I have a multi-faceted question here: 1) Is it standard practice, good practice, or negligible to put each argument on their own lines?   2) Are their exceptions to this style, like when there is only one argument?   3) What are the pros and cons of such a design?


title: Wrapping a map with instance or static method

text: I have a `java.util.Map<String, Object>` object which different types of values in it. I don't want to cast whereever I do a get operation over this. To do this, I created different classes wrapping this map and these classes provide different get methods which return values for different keys. There are two options for this:               public class Wrapper1 {         private final Map<String, Object> map;              public Wrapper1(Map<String, Object> map) {             this.map=map;         }              public MyObject getMyObject() {             return (MyObject)this.map.get("someKey");         }     }                       public class Wrapper2 {         private Wrapper2() {         }              public static MyObject getMyObject(Map<String, Object> map) {             return (MyObject)map.get("someKey");         }     }      As you see, in first one I'm creating an instance of Wrapper1 and access MyObject instance by instance method. In second, I give the map to a static method and access same MyObject instance. Which one will you prefer more and why? Also if this is a bad practice, please let me know. Thank you.


title: What is the point of the prototype method?

text: I am reading through _Javascript: The Good Parts_ , and struggled to get my head around the section on _prototypes_. After a little google, I came to the conclusion that it is to add properties to objects _after_ the objects declaration. Using this script gleamed from w3schools, I noticed that removing the line adding the prototype property had **no effect**. So what is the point? * * *               //Prototyping          function employee(name,jobtitle,born)     {     this.name=name;     this.jobtitle=jobtitle;     this.born=born;     }          var fred=new employee("Fred Flintstone","Caveman",1970);     employee.prototype.salary=null; //  <---  try removing this line     fred.salary=20000;      document.write(fred.salary);


title: Can you write a (dynamic) website using only XHTML and CSS?

text: I am more of a desktop developer that a web developer. Therefore I only know XHTML and CSS when it comes to the web (and C#, if that is in any way useful). I have a _little_ experience with ASP.NET with C# but I am in no ways an expert in it. Say I want to write a small website to give a preview to any new software I make. Is XHTML and CSS enough to make it? Will I _need_ to learn some server- side language? (or web development framework?) If so any suggestions? I don't want to create something as awesome as Facebook or Stack-overflow. Just a normal website, kind of like http://thenewboston.com.


title: Choosing colors for application

text: What is the best way to choose colors for LoB app, i need to style TreeView, dropdown's, textboxes and a pivot grid, so i need a bunch of colors, tried Kuler but it gives only 6 colors. So the question is how to do it without designer? PS. It's a silverlight app.


title: Who becomes the product owner?

text: A business has five requirements streams, with a "stream leader" (called _Product Manager_ , but this is an in-house term) per-stream and a backlog per-stream. If we wanted to follow Scrum more closely, as I understand it, best practise would dictate the identification of a single product owner managing a single backlog containing requirements from all five streams (it's all just stuff to be done, right?), from which work is pulled by a self-organizing development team. Can anyone lend any insight into how best identify the person to be the product owner and how best to explain and "sell" the modified approach to the existing stream leaders? NB: I realize this is a very difficult question.


title: How does package naming affects Android application once deployed

text: Are there conventions to follow when naming an application package for an Android application? I'm coding in Xamarin Studio, using .Net, so I feel far from this "com.myapp.etc" naming convention. Are there rules to follow when naming a package?


title: Is there a canonical book on dynamic programming?

text: At the moment in college I'm studying dynamic programming and I'm really interested in it. I want to go deeper and fully understand the topic so I can write good dynamic code. Is there a book out there that's the de-facto standard for describing best practices, design methodologies, and other helpful information about dynamic programming? What about that book makes it special?


title: Function before design, or a little of both?

text: When creating data-driven web pages, do you generally work on: A) functionality first B) presentation first? C) both at the same time I'm learning how to build css sites and wasn't sure of the best approach. There will be ajax calls and updates but that is pretty easy to implement. Thanks for your time and feedback.


title: Any tips to learn how to program with severe ADHD?

text: I have a difficult time trying to learn how to program from straight text- books. Video training seems to work well for me in my past experiences with PHP. I am trying my hardest to stay focussed and push through. Specifically I am looking to start indie game development. Over the last two weeks I have been trying to pick the "right" language and framework to develop with. I started going through Python, but I am not really enjoying the language so far. I am constantly looking through this website to compare this language to that, and keep getting distracted. Aside from all of this, is it possible to become a programmer when you have trouble focussing? Has anyone been through this that can recommend some advice?


title: maven release candidate builds

text: We build Java applications and use Maven to create snapshot and release builds (via Hudson). Normally, we build/deploy snapshot versions to our lab environment and when we're happy, we do release build and deploy that to prod. We've been wondering if we should also be doing release candidate builds. I'm not sure how a release candidate build actually differs from the snapshot builds. I've read about the release:stage goal in Maven, but not it didn't really answer the question. Do you use release candidate builds? What do you use them for and how do you go from snapshot to release candidate to release?


title: What are the disadvantages of using stored procedures, SSIS, and SSRS to implement business applications?

text: Recently, it was suggested that many projects (where I work) should be implemented using some combination of stored procedures (on SQL Sever / T-SQL), SSIS, and SSRS. In one specific project, SSIS would get a file from a SFTP server. The file contains the daily price of ten stocks. A data warehouse will store the daily price of each stock since inception. As of now, the prices go back twenty-five years. Stored procedures will have the business logic to calculate various performance numbers (i.e. return %) during arbitrary time periods such as the 5 year return at 31 December 2012. These stored procedures would be used by SSRS to create reports for the end users. What are the problems/issues using this approach? I feel that vendor (Microsoft) lock is an issue but I don't see that (unfortunately) being enough to change direction. Also, I have a concern about all the business logic being stored procedures. What are the arguments against/for putting this business logic (i.e. calculation of performance numbers) in stored procedures versus using Java (or some other OO programming language) with ORM (such as myBatis)?


title: DDD: How to reconcile a BoundedContext with REST/WebService DTO's?

text: I'm just starting to learn about DDD, and I'm trying to understand how Bounded Contexts can be reconciled with client facing API's like REST/WebServices that use DTO's. For example: your system exposes it's API to the public with a standard WebService, with CRUD style operations for DTO objects with many fields defined via a WSDL. You create a Bounded Context to handle your Domain's business logic, using a "non-anemic" domain model - so that your domain objects don't simply have a bunch of setters and getters - instead they have methods defined using vocabulary from your ubiqitious language. How would one reconcile the difference between their web service DTO and the Bounded Context? It seems to me this could add a huge amount of complexity, and I'm wondering if there are some well defined ways to solve this.


title: Using uniqueness types to implement safe parallelism

text: I've been interested in uniqueness types as an alternative to monads in pure functional languages for some time; unfortunately, this is kind of an esoteric area of CS research and online resources about programming with uniqueness types are few and far between. It's obvious how uniqueness types may be used to implement stateful data structures like references ("boxes") and arrays, though it escapes me how you might implement other common stateful data structures with them. Is it possible to implement, for example, locking with unique types? Can uniqueness types be used to share mutable data across threads? Is it possible to use unique types to build synchronization primitives (like mutexes), or is message passing necessary?


Is it dangerous to substitute unit tests for user testing? A co-worker believes we can reduce the manual user testing we need to do by adding more unit tests. Is this dangerous? Unit tests seem to have a very different purpose than user testing. Aren't unit tests to inform design and allow breaking changes to be caught early? Isn't that fundamentally different than determining if an aspect of the system is correct as a whole of the system? Is this a case of substituting apples for oranges?


title: How to refactor code that has 2 concerns

text: Say I have this code:                       if ($this->ship == "e") {                 $this->price->addLine($this->price->base * $this->price->e, 0, "Export");                 $this->price->total += $this->price->base * $this->price->e;                  } elseif ($this->ship == "d") {                 $this->price->addLine($this->price->base * $this->price->d, 0, "Domestic");                 $this->price->total += $this->price->base * $this->price->d;             }      I have multiple identical blocks of code like the above. I also have other code (other than `$this->ship`) that is similar in structure. Basically, this code adds a `Line` to a PDF, where the line says "Domestic" or "Export" along with other options. The code above also computes price for that line and adds it to the total. **My thoughts on refactoring this:** I want to remove duplication. I also want to abide by SOLID principles, i.e. separation of concerns. I see that code above does two things (computes price and adds a line item to PDF). I can surely split this code into two separate functions, but then I still end up with duplicated code -- I need to check if `$this->ship` equals `e` or `d` in both places. That is no good. If I need to add a 3rd option, I have to change code in two places. So then I can move my check for `e` or `d` into the main body of code, but still I have duplication because I will have               switch($this->ship)     {         case 'd': $cost = $this->getShippingCost($this->price->base, $this->price->d);break;         case 'e': $cost = $this->getShippingCost($this->price->base, $this->price->e);break;          }      I get these two long lines of code for basically a single character change. While maybe it is kind of acceptable, I am not quite liking it. If I need to change the number of parameters for example, or base parameter or etc, I will need to change it in more than one place. Basically, so far no matter what way I spin this code, I end up with some duplication somewhere. I mean if it is unavoidable, I guess it's okay. But here I come for advice on seeing if there is a way to separate the concerns, and remove duplication and have minimal number of places (ideally `one`) when I do need to change something. can this be done?


title: How bad is to have many directories where to save uploaded data instead of one?

text: I am using the following structure to save the images that users are uploading for their items:   * Images      * User_dir1        * Item_dir1          * Picture_file1         * Picture_file2     * User_dir2        * Item_dir2          * Picture_file3       * Item_dir3          * Picture_file4 Can I go on with this if I am going to have thousants of users and hundrets of items per user? Talking about performance will the Linux dedicated server have trouble in the future? Thanks!


title: Do employers prefer software engineering over CS majors?

text: I'm in grad school at a university that was one of the first to have a software engineering accredited program. My undergrad is in CS. An employer recently recruited at our university and hired 5 SE majors. None of them were CS. Do employers prefer software engineering majors? The reason I ask is because I can focus on many different areas during my graduate studies and really want to take the classes that will help me land a great job. Right now I'm either going to use CUDA and parallelize an advanced ray-tracer for a graduate project or do research on non-photo-realistic rendering in augmented reality. Pursuing these would leave very little SE classes in my schedule. If I went the software engineering route, I would probably either do research into data-oriented programming or software design complexity. Sometimes I think when I'm 40 and look back will it matter at all? For some reason I'm thinking not.


title: What benefits for the developer does the Ruby language offer that C# does not have?

text: What benefits for the developer does the Ruby language have that are not available in C# (preferably with code examples)?


title: MVC: What is the difference between a model and a service?

text: Why in some frameworks the logic layer is called "Model" whereas in some it is called "Service". Are they different from each other or just different by naming conventions? * * * UPDATE 1 The reason I'm asking is because in Zend Framework, a classical MVC framework, everybody uses the concept of Model. Now I'm learning AngularJS and it seems that the word Model disappeared and was replaced by the word service. What I noticed is that a service is more like a singleton that can be reused again and again (example: a REST client) whereas a model is more related to the data manipulations coming from the controller in the MVC pattern.


title: Difficulties for functional managers in Scrum

text: I am a Test/QA manager in an organization that gradually moves to Scrum. I don't appear in daily Scrum meetings because I don't want to interfere with the self-organization of the team. The problem with this is that I am becoming too disconnected with what the 5 testers who report to me do in the day to day. How can I coach and evaluate these testers? What if they don't do good work, or do too little work, how can I know this in a timely basis and act on it?


title: What is the benefit of offloading email to a transactional mail service?

text: Why do so many people recommend offloading email to a transactional service such as Mandrill, Postmark or Sendgrid? Is sending email via smtp really that much slower than sending a request out to said service? I imagine it has something to do with the rendering of the actual message, but I'd like a more informed reason.


title: Should I worry about 'Javascript piracy'?

text: If I write a client-side Javascript app (with a little bit of server interaction), how can I prevent people from copying the Javascript files to their own site? Should I, at all?


title: How can I practice implementing data structures and algorithms?

text: I just finished learning the basics on data structures and algorithms using Python and C, completing some of the exercises from the book I read. I feel that it is necessary to implement some of these data structures and algorithms to enhance my understanding about the material that I just learned, such as the red-black tree and priority queue. Are there any good websites with material for me to use when practicing?


title: Is it realistic to ask your team to take on a 100% automated test coverage goal as a stretch task?

text: In a financial services environment - is it realistic to ask your team of ten programmers to take on a 100% automated unit and integration test coverage goal as a stretch task for a legacy java system (>1.5M SLOC)? [as a two year goal in increments]


title: Is it more difficult to maintain moral ethics in IT industry..?

text: is it more difficult to maintain moral ethics in IT industry? or it is just that this industry has its own code of conduct?. I have another profile with karmas close to a thousand. This posting is something personal, so I am posting it as anonymous. I am a software engineer.I quit my job in a service-based IT company nearly 4 months back. I have some mood disorder problem. I worked there for over an year. Worked on one project from kick-off to sign-off and worked on one phase of next very similar project. I quit the job because I needed flexibility in work timings and be able to work from home say once a week or now and then (to cope up with my health issue). This job was very low salary paying for my resume and work was very chaotic and unsatisfying in my project (on which I worked end to end) and had lost hope for better work. I didn't find any mentors or role models in the team.This being service based company, I felt like I was to give status on each day. It is true that I have to struggle to meet deadlines because of my problem. But by working on weekends/late nights, I was meeting these. But people didn't perceive it in that light.And I feel that with time, I am only growing and learning in terms of discipline and my problem is like any other health problem for which people need accommodation at work, but qualify for job. I was sincere in my work. and given this flexibility I can do my job. If not excel then at least meet expectation. I quit it, because when being on the job, my mind was always stressed and I couldn't think of what would be better job for me as a next job move, so I needed time to figure it out. Near the end, I was also feeling burned out from the project and I wanted to work on my health. For 2 months, as planned I took a break (break from career worries and career planning, but I spent my time reading things basic things which I wanted to learn like about country,culture,religion,spirituality etc) makes basis for long term peace. May be I have some degree of attention deficit disorder and I would feel blanked out on such issues. and I wanted to spend one month from my life imprinting such knowledge in my brain. then I studied for a month.(I prepared for Google,took onsite interviews,(and got rejected) so focussed on data structures,algorithms preparation along with general OS concepts) and took my focus off from applying to other places etc. Now, gradually before I realized its been a 4 months gap. When job consultants call me, they ask me why I left my previous company without any job offer in hand. I give them 3 true reasons that I wanted to work for product based company, project was over, and I was looking for a break of 2 months. They don't like these reasons. and some don't even send my resume to HR, I think. it is putting me off. What is code of conduct in IT industry? People don't do their share of work sincerely, leave project in between. get careless in work in their notice period. Is this acceptable? or may be I am surrounding by people who give me such tricks and it makes me feel that in general this is how people think. like a friend joined a company, worked there for 1 month, didnt like it and left it and didn't show it his resume and had other company waiting for him with their offer. I am thinking if I should start working on some open source project, which might count as work.or if I should recourse to a lie (and update my resume accordingly) like I had a fracture when I was about to join a new company and so had to take break and that job offer elapsed or some other health issue (which is not long term like mental health or sth) or a problem in my family consultants openly ask me if I am single or married. and some dont show interest because I am single(and of marriageable age as in India ,going by when I did undergrad) and so they think that soon I will get married and being a female is likely to relocate.some consultants openly ask if I have any other job offer in hand. Some say that companies give and set salary depending on if I am employed or not working. I listen to people saying that it becomes easy to negotiate salary once I have other job offers in hand. Is that more ethical that what I have done? I mean , salary should be set on the basis of ones experience,compatency etc rather than competing offers. I feel its difficult to maintain ones ethics during job hopping, career advancement etc in this industry. I am beginning to feel frustrated and am seeking advice from people who have undergone something similar. I think software professionals all over the world may relate it to some degree. I am based in India, so if somebody also wants to chip in with India specific advice, please feel free.


title: What does HATEOAS offer for discoverability and decoupling besides ability to change your URL structure more or less freely?

text: Lately I've been reading about Hypermedia as the Engine of Application State (HATEOAS), the constraint that is claimed to make a web API "truly RESTful". It boils down to basically including links with every response to the possible transitions you can make from the current state. Let me illustrate what HATEOAS is based on my understanding - and please do correct me if I missed something.               /         GET: {             "_links": {                 "child": [                     { "href": "http://myapi.com/articles", "title": "articles" }                 ]             }         }          /articles?contains=HATEOAS         GET: {             "_items": [                 { "uri": "http://myapi.com/articles/0", "title": "Why Should I Care About HATEOAS?" },                 { "uri": "http://myapi.com/articles/1", "title": "HATEOAS: Problem or Solution?" }             ],             "_links": {                 "self": { "href": "http://myapi.com/articles", "title": "articles" },                 "parent": { "href": "http://myapi.com/", "title": "home" }             }         }              POST: {             "title": "A New Article",             "body": "Article body",             "tags": [ "tag1", "tag2" ]         }          /articles/0         GET: {             "title": "Why Should I Care About HATEOAS?",             "body": "Blah blah blah"             "tags": [ "REST", "HATEOAS" ],             "_links": {                 "self": { "href": "http://myapi.com/articles/0", "title": "article" },                 "parent": { "href": "http://myapi.com/articles", "title": "articles" }             }         }      HATEOAS is claimed to provide two major benefits:   1. The entire service is discoverable starting form the root URI, documentation is no longer needed.   2. The client is decoupled from the server which can now change the URI structure freely. This eliminates the need for API versioning. But in my view, a service is a lot more than its URI structure. To use it effectively, you also need to know:   * what query parameters you can use and their possible values   * the structure of the JSON/XML/whatever documents you need to send in your POST/PATCH/etc requests   * the structure of the response sent by the server   * the possible errors that might occur   * ... Based on the above, HATEOAS only solves a tiny fraction of the discoverability and coupling problems. You still need to document the above four aspects and clients will still be strongly coupled to the server because of them. To avoid breaking clients, you still need to version your API. The only benefit it provides is that you can change your URL structure more or less freely (by the way, what happened to the principle "Cool URIs don't change"?). Is my understanding correct?


title: URIs and Resource vs Resource representation

text: URL is an URI which identifies a resource by location. _Resource representation_ is a view of resource's state. This view is encoded in one or more transferable formats, such as XHTML, Atom, XML, MP3 ... URIs associate resource representations with their resources a) So I assume URI identifies a _resource_ and not _resource representation_? b) I've read that relationship between an URI and _resource representation_ is _one to many_. Assuming we're talking about URL, how can a single URL address more than one _resource representation_? thank you


title: When and how a programmer should start own business?

text: The title says it all but here's some explanation of what I want to know: Let's suppose a programmer has around 5 years of experience in multiple, mainstream languages. Also suppose that the programmer has worked in different positions from junior developer to senior s/w engineer to a team lead. How would he know this is the time to stop working for others and start his/her own business. How important the technical skills and requirements are in addition to of-course financial requirements. The second part of question is, if he decides to role own company, how he should take a start? Ok, here's some more info: I am single, have no expenses other than my own mobile bills and university dues. Also there's no house rent for me since we have a joint family system (this is not only common but also appreciable in my culture and community). I noted that most people have supposed that I want to build a new _product_ or _web site_. While I appreciate getting your ideas on this, can you people also throw some light on another aspect? What if I would like to build a new, small software shop (or software house as we call it here)?


title: How to maintain encapsulation with composition in C++?

text: I am designing a class `Master` that is composed from multiple other classes, `A`, `Base`, `C` and `D`. These four classes have absolutely no use outside of `Master` and are meant to split up its functionality into manageable and logically divided packages. They also provide extensible functionality as in the case of `Base`, which can be inherited from by clients. _But, how do I maintain encapsulation of`Master` with this design?_ * * * So far, I've got two approaches, which are both far from perfect: ## 1\. Replicate all accessors: Just write accessor-methods for all accessor-methods of all classes that `Master` is composed of. This leads to perfect encapsulation, because no implementation detail of `Master` is visible, but is extremely tedious and makes the class definition monstrous, which is exactly what the composition should prevent. Also, adding functionality to one of the composees (is that even a word?) would require to re-write all those methods in `Master`. An additional problem is that inheritors of `Base` could only alter, but not add functionality. ## 2\. Use non-assignable, non-copyable member-accessors: Having a class `accessor<T>` that can not be copied, moved or assigned to, but overrides the `operator->` to access an underlying `shared_ptr`, so that calls like               Master->A()->niceFunction();      are made possible. My problem with this is that it kind of breaks encapsulation as I would now be unable to change my implementation of `Master` to use a different class for the functionality of `niceFunction()`. Still, it is the closest I've gotten without using the ugly first approach. It also fixes the inheritance issue quite nicely. A small side question would be if such a class already existed in `std` or `boost`. * * * # EDIT: Wall of code I will now post the code of the header files of the classes discussed. It may be a bit hard to understand, but I'll give my best in explaining all of it. ## 1\. GameTree.h The foundation of it all. This basically is a doubly-linked tree, holding `GameObject`-instances, which we'll later get to. It also has it's own custom iterator `GTIterator`, but I left that out for brevity. `WResult` is an enum with the values `SUCCESS` and `FAILED`, but it's not really important.               class GameTree     {     public:         //Static methods for the root. Only one root is allowed to exist at a time!         static void ConstructRoot(seed_type seed, unsigned int depth);         inline static bool rootExists(){ return static_cast<bool>(rootObject_); }         inline static weak_ptr<GameTree> root(){ return rootObject_; }              //delta is in ms, this is used for velocity, collision and such         void tick(unsigned int delta);                   //Interaction with the tree         inline weak_ptr<GameTree> parent() const { return parent_; }              inline unsigned int numChildren() const{ return static_cast<unsigned int>(children_.size()); }         weak_ptr<GameTree> getChild(unsigned int index) const;         template<typename GOType>         weak_ptr<GameTree> addChild(seed_type seed, unsigned int depth = 9001){             GOType object{ new GOType(seed) };             return addChildObject(unique_ptr<GameTree>(new GameTree(std::move(object), depth)));         }                                                    WResult moveTo(weak_ptr<GameTree> newParent);         WResult erase();              //Iterators for for( : ) loop         GTIterator& begin(){             return *(beginIter_ = std::move(make_unique<GTIterator>(children_.begin())));         }         GTIterator& end(){             return *(endIter_ = std::move(make_unique<GTIterator>(children_.end())));         }              //unloading should be used when objects are far away         WResult unloadChildren(unsigned int newDepth = 0);         WResult loadChildren(unsigned int newDepth = 1);              inline const RenderObject& renderObject() const{ return gameObject_->renderObject(); }              //Getter for the underlying GameObject (I have not tested the template version)         weak_ptr<GameObject> gameObject(){             return gameObject_;         }         template<typename GOType>         weak_ptr<GOType> gameObject(){             return dynamic_cast<weak_ptr<GOType>>(gameObject_);         }              weak_ptr<PhysicsObject> physicsObject() {             return gameObject_->physicsObject();         }          private:         GameTree(const GameTree&); //copying is only allowed internally         GameTree(shared_ptr<GameObject> object, unsigned int depth = 9001);              //pointer to root         static shared_ptr<GameTree> rootObject_;              //internal management of a child         weak_ptr<GameTree> addChildObject(shared_ptr<GameTree>);         WResult removeChild(unsigned int index);              //private members         shared_ptr<GameObject> gameObject_;         shared_ptr<GTIterator> beginIter_;         shared_ptr<GTIterator> endIter_;              //tree stuff         vector<shared_ptr<GameTree>> children_;         weak_ptr<GameTree> parent_;         unsigned int selfIndex_; //used for deletion, this isn't necessary         void initChildren(unsigned int depth); //constructs children     };      ## 2\. GameObject.h This is a bit hard to grasp, but `GameObject` basically works like this: When constructing a `GameObject`, you construct its basic attributes and a `CResult`-instance, which contains a `vector<unique_ptr<Construction>>`. The `Construction`-struct contains all information that is needed to construct a `GameObject`, which is a seed and a function-object that is applied at construction by a factory. This enables dynamic loading and unloading of `GameObject`s as done by `GameTree`. It also means that you have to define that factory if you inherit `GameObject`. This inheritance is also the reason why `GameTree` has a template-function `gameObject<GOType>`. `GameObject` can contain a `RenderObject` and a `PhysicsObject`, which we'll later get to. Anyway, here's the code.               class GameObject;     typedef unsigned long seed_type;               //this declaration magic means that all GameObjectFactorys inherit from GameObjectFactory<GameObject>     template<typename GOType>     struct GameObjectFactory;          template<>     struct GameObjectFactory<GameObject>{         virtual unique_ptr<GameObject> construct(seed_type seed) const = 0;     };          template<typename GOType>     struct GameObjectFactory : GameObjectFactory<GameObject>{         GameObjectFactory() : GameObjectFactory<GameObject>(){}         unique_ptr<GameObject> construct(seed_type seed) const{             return unique_ptr<GOType>(new GOType(seed));         }     };          //same as with the factories. this is important for storing them in vectors     template<typename GOType>     struct Construction;          template<>     struct Construction<GameObject>{         virtual unique_ptr<GameObject> construct() const = 0;     };          template<typename GOType>     struct Construction : Construction<GameObject>{         Construction(seed_type seed, function<void(GOType*)> func = [](GOType* null){}) :             Construction<GameObject>(),             seed_(seed),             func_(func)         {}              unique_ptr<GameObject> construct() const{             unique_ptr<GameObject> gameObject{ GOType::factory.construct(seed_) };             func_(dynamic_cast<GOType*>(gameObject.get()));             return std::move(gameObject);         }              seed_type seed_;         function<void(GOType*)> func_;     };               typedef struct CResult     {         CResult() :             constructions{}         {}              CResult(CResult && o) :             constructions(std::move(o.constructions))         {}              CResult& operator= (CResult& other){             if (this != &other){                 for (unique_ptr<Construction<GameObject>>& child : other.constructions){                     constructions.push_back(std::move(child));                 }             }             return *this;     }              template<typename GOType>         void push_back(seed_type seed, function<void(GOType*)> func = [](GOType* null){}){             constructions.push_back(make_unique<Construction<GOType>>(seed, func));         }              vector<unique_ptr<Construction<GameObject>>> constructions;     } CResult;                    //finally, the GameObject     class GameObject     {     public:         GameObject(seed_type seed);         GameObject(const GameObject&);              virtual void tick(unsigned int delta);              inline Matrix4f trafoMatrix(){ return physicsObject_->transformationMatrix(); }                   //getter         inline seed_type seed() const{ return seed_; }         inline CResult& properties(){ return properties_; }         inline const RenderObject& renderObject() const{ return *renderObject_; }         inline weak_ptr<PhysicsObject> physicsObject() { return physicsObject_; }          protected:         virtual CResult construct_(seed_type seed) = 0;              CResult properties_;         shared_ptr<RenderObject> renderObject_;         shared_ptr<PhysicsObject> physicsObject_;         seed_type seed_;     };      ## 3\. PhysicsObject That's a bit easier. It is responsible for position, velocity and acceleration. It will also handle collisions in the future. It contains three Transformation objects, two of which are optional. I'm not going to include the accessors on the `PhysicsObject` class because I tried my first approach on it and it's just pure madness (way over 30 functions). Also missing: the named constructors that construct `PhysicsObject`s with different behaviour.               class Transformation{         Vector3f translation_;         Vector3f rotation_;         Vector3f scaling_;     public:         Transformation() :             translation_{ 0, 0, 0 },             rotation_{ 0, 0, 0 },             scaling_{ 1, 1, 1 }         {};         Transformation(Vector3f translation, Vector3f rotation, Vector3f scaling);              inline Vector3f translation(){ return translation_; }         inline void translation(float x, float y, float z){ translation(Vector3f(x, y, z)); }         inline void translation(Vector3f newTranslation){             translation_ = newTranslation;         }         inline void translate(float x, float y, float z){ translate(Vector3f(x, y, z)); }         inline void translate(Vector3f summand){             translation_ += summand;         }              inline Vector3f rotation(){ return rotation_; }         inline void rotation(float pitch, float yaw, float roll){ rotation(Vector3f(pitch, yaw, roll)); }         inline void rotation(Vector3f newRotation){             rotation_ = newRotation;         }         inline void rotate(float pitch, float yaw, float roll){ rotate(Vector3f(pitch, yaw, roll)); }         inline void rotate(Vector3f summand){             rotation_ += summand;         }              inline Vector3f scaling(){ return scaling_; }         inline void scaling(float x, float y, float z){ scaling(Vector3f(x, y, z)); }         inline void scaling(Vector3f newScaling){             scaling_ = newScaling;         }         inline void scale(float x, float y, float z){ scale(Vector3f(x, y, z)); }         void scale(Vector3f factor){             scaling_(0) *= factor(0);             scaling_(1) *= factor(1);             scaling_(2) *= factor(2);         }              Matrix4f matrix(){             return WMatrix::Translation(translation_) * WMatrix::Rotation(rotation_) * WMatrix::Scale(scaling_);         }     };          class PhysicsObject;          typedef void tickFunction(PhysicsObject& self, unsigned int delta);          class PhysicsObject{         PhysicsObject(const Transformation& trafo) :             transformation_(trafo),             transformationVelocity_(nullptr),             transformationAcceleration_(nullptr),             tick_(nullptr)         {}         PhysicsObject(PhysicsObject&& other) :             transformation_(other.transformation_),             transformationVelocity_(std::move(other.transformationVelocity_)),             transformationAcceleration_(std::move(other.transformationAcceleration_)),             tick_(other.tick_)         {}              Transformation transformation_;         unique_ptr<Transformation> transformationVelocity_;         unique_ptr<Transformation> transformationAcceleration_;              tickFunction* tick_;          public:         void tick(unsigned int delta){ tick_ ? tick_(*this, delta) : 0; }              inline Matrix4f transformationMatrix(){ return transformation_.matrix(); }     }      ## 4\. RenderObject `RenderObject` is a base class for different types of things that could be rendered, i.e. Meshes, Light Sources or Sprites. _DISCLAIMER:_ I did not write this code, I'm working on this project with someone else.               class RenderObject     {     public:         RenderObject(float renderDistance);         virtual ~RenderObject();              float renderDistance() const { return renderDistance_; }         void setRenderDistance(float rD) { renderDistance_ = rD; }               protected:         float renderDistance_;     };          struct NullRenderObject : public RenderObject{         NullRenderObject() : RenderObject(0.f){};     };          class Light : public RenderObject{     public:         Light() : RenderObject(30.f){};     };          class Mesh : public RenderObject{     public:         Mesh(unsigned int seed) :             RenderObject(20.f)         {             meshID_ = 0;             textureID_ = 0;             if (seed == 1)                 meshID_ = Model::getMeshID("EM-208_heavy");             else                 meshID_ = Model::getMeshID("cube");         };              unsigned int getMeshID() const { return meshID_; }         unsigned int getTextureID() const { return textureID_; }          private:         unsigned int meshID_;         unsigned int textureID_;     };      I guess this shows my issue quite nicely: You see a few accessors in `GameObject` which return `weak_ptr`s to access members of members, but that is not really what I want. Also please keep in mind that this is **NOT** , by any means, finished or production code! It is merely a prototype and there may be inconsistencies, unnecessary `public` parts of classes and such.


title: Should a special version of a website be developed for tablet users?

text: Does the desktop browser version of a web site always suffice for the tablet version(assuming no flash)? or is it common for websites to have a special tablet version that is different from both desktop and phone?


title: Has research been done on the effectiveness of Planning Poker as an estimation technique?

text: Although it is a commonly held opinion that planning poker improves the accuracy of project estimations (a small sample of which demonstrated on this question), has any defined research been done on the subject? More specifically, I am looking for non-circumstantial information showing that planning poker would be an improvement over traditional estimation techniques.


title: Can I run both .Net and Java framework in one computer?

text: I have .NET 2.5 installed in my computer unit, as a beginner I used VB.net As I went along I've also installed new .dlls that would help me with my VB.net programming Now, I want to study java as well, leading to Android programming. If I install the JDK 7.0, can I still be able to program in VB.net? Will installing JDK overwrite .dlls essential to the .NET framework? Should I get a new developing PC that focuses with JAVA/Android development?


title: Requirements specification for Multi-Channel website

text: The company I'm working on has a RUP-like software development process, with very heavy documentation. Right now we're doing a Multi-Channel web site -it's intended to be seen in Desktop, Tablets and Smartphones- and every version of the site has a particular flow of events and content. I don't see in RUP an artifact were this differences are documented. I'm aware that Uses Cases must be implementation agnostic -we can't mention any device specific terms- so maybe there's something in the Design discipline that serves that purpose. If there's nothing like that in RUP, It would be nice to know how another Software Process document requirements for Multi-Channel sites.


title: When is it appropriate to start using the next revision of a tool when dogfooding?

text: Specifically, I am working on a tool that integrates a DVCS and build system, but I image the challenge I am facing would arise for anyone developing a "meta" tool (compiler, VCS, build system, test runner, etc.) that they wish to develop through "dogfooding". **My question is:** in a scrum-style release process using the branching workflow, at what point do I start using a newer version of the tool in the development cycle of the tool? I'm looking for a process to create balance between:   * constantly use the `develop` version of the tool: I find I am breaking my own development as changes get incorporated.   * constantly use the `master` version of the tool: any issues I uncover through dogfooding are issues that have already been released.


title: How to practice ATDD if design is not yet emerged from TDD?

text: Despite being very stakeholders friendly, ATDD aimed to provide a "stop" line when a feature has just been done. This avoids wasting time to add non-focused (and sometimes useless) code. That's why some teams start by establishing a walking skeleton of the application, and directly specifying with an acceptance test the first required feature. Let's suppose this first acceptance test (not representing a relevant first acceptance test, just being an example): _**Given Michael has just been created in the application, his status should be left to non-activated._** I want to write my acceptances tests focusing on business logic directly (use- cases), not dealing with GUI for business rules. Thus my question would be...how to write it? since I don't even already know what is a "User", what is a status etc... Indeed, shouldn't it be the role of TDD to emerge the design and therefore these components? But if I firstly practice TDD in order to emerge them, the benefit of ATDD (as a stop line) would disappear. I imagine that it would be more consistent to write some acceptance tests (before entering TDD cycle) when the project has well progressed, since all main components would already be designed. To sum up, should I always write my acceptances test BEFORE my TDD cycle?


title: Read-only class properties

text: When is recommended to use `read-only` properties -- if the language allows me? Are _public_ read-only properties meant to replace `getter` methods or at least the _Magic Methods_ like what is available as __get() in PHP for example? What is the use of a _private_ read-only property?


title: Is it possible to analyse the API surface of a set of class libraries to automatically determine inter-assembly dependencies?

text: I'm sure we've all been in the situation where we've inherited code that was "overly public", becomes obsolete or needs to be refactored. In these situations, it is easy to spend many days analysing the API surface to see where methods or classes are consumed; with the .Net runtime, it seems logical that it should be relatively trivial to map these inter-assembly dependencies, but there doesn't seem to be any tools out there that do this already? For example, let's suggest that we have a CRM class library that encapsulates the interface to all the customer data; it's not unreasonable that a quotations application may rely on this, but it seems non-trivial to identify on _which bits_. A naive approach would be to say that the public interfaces (types, etc.) is the API surface, but it may be the case that some of these interfaces are only public for consumption in a particular use case, that may become invalid. Is it possible to automatically determine and map the inter-assembly dependencies for a given set of assemblies?


title: Soft Real Time Internet Aplication

text: I am building a tutoring application that multiple students can sign into the same session with a tutor. My question is, for example, if I sent out a command to draw a line, do I need to wait to see that all connected students propagated the command. Now, it relies that requests will be processed in order. But consider this. If I draw one point, drag and draw another point, it will draw a line. But if I don't wait to see if each step propagated to all students' screens successfully, a student might receive an instruction of drag, draw, draw. However, waiting for each connected user's input seems to be a very slow approach. Is there any way I can solve this efficiently? Or is this a problem at all?


title: Real-time stock market application

text: I'm an amateur programmer. I'd like to develop a software application (like Tradestation), to analyse real-time market data. Please teach me if the following approach is correct, ie the procedures, knowledge or software needed etc:   1. Use a DB to read the real-time feed from data provider: what should be the right DB to use? I know it should be a time serious one. Can I use SQL, Mysql, or others? What database can receive real-time data feed? Do I need to configure the DB to do this?   2. If the real-time data is in ASCII form, how can it be converted to those that can be read by the DB and my application? Should I have to write codes or just use some add-ins? What kind of add-in are needed?   3. How should I code the program to retrieve the changing data from the DB so that the analysis software screen data can also change asynchronously? (like the RTD in excel)   4. Which aspects of programming do I need to learn to develop the above? Are there web resources/ books I can refer to for more information?


title: What is the difference between string.c_str() and &string[0]?

text: What are the differences between `string.c_str()` and `&string[0]`? Regarding performance my guess is that `&string[0]` is a little faster than string.c_str() as it doesn't require a function call. Regarding safety and stability common sense tells me that `string.c_str()` should have some checks implemented, but I don't know, that's why I'm asking.


title: Our version of Agile isn't working. Tips?

text: I work on a small team of 4 developers. We are implementing a version of Agile that seems to continuously provide us with the same difficulties, week after week, and I'm looking for suggestions that can help us improve our process. The background: We generally do 2 week sprints, and each sprint we tend to underestimate our work, and we get in trouble with our manager because we're behind schedule. We start off each sprint by tasking out the stories that our manager creates for us. Sometimes he throws in the tasks too and we estimate them. We don't use story points. We use the software Urban Turtle to "manage our sprints", which is essentially just stories and tasks, and the associated burn down. We don't plan for a release at the end of a sprint. The most common issue that occurs is that we plan for a task in the beginning of a sprint only to discover it's much larger in scope, but still high in the priority, so we need to work additional hours on it. The second most common issue is that one of us runs into a technical problem that slows down the hours burned, causing a roadblock. The only suggestion provided to us is to be more proactive in adjusting our estimates and providing updates during standups in the morning so we can adjust for the extra time needed. However, there seems to be something fundamentally wrong with the way we're doing things. Perhaps there's a disconnect between the expectations of the manager on a project level and the expectations on a sprint level. Because we're making these sprint iterations according to a project plan, and therefore extending a sprint or deferring items screws up the project plan. So as developers we are being encouraged to perform Agile by extending estimates when necessary but also complete the sprint on time, which is confusing. This can't be an uncommon problem, so I'm hoping those wiser than I out there have a suggestion or two on how we can stop running into this same problem every sprint. It's frustrating.


title: Coming up with tokens for a lexer

text: I'm writing a parser for a markup language that I have created (writing in python, but that's not really relevant to this question -- in fact if this seems like a bad idea, I'd love a suggestion for a better path). I'm reading about parsers here: http://www.ferg.org/parsing/index.html, and I'm working on writing the lexer which should, if I understand correctly, split the content into tokens. What I'm having trouble understanding is what token types I should use or how to create them. For example, the token types in the example I linked to are:   * STRING   * IDENTIFIER   * NUMBER   * WHITESPACE   * COMMENT   * EOF   * Many symbols such as { and ( count as their own token type The problem I'm having is that the more general token types seem a bit arbitrary to me. For example, why is STRING its own separate token type vs. IDENTIFIER. A string could be represented as STRING_START + (IDENTIFIER | WHITESPACE) + STRING_START. This may also have to do with the difficulties of my language. For example, variable declarations are written as `{var-name var value}` and deployed with `{var-name}`. It seems like `'{'` and `'}'` should be their own tokens, but are VAR_NAME and VAR_VALUE eligible token types, or would these both fall under IDENTIFIER? What's more is that the VAR_VALUE can actually contain whitespace. The whitespace after `var-name` is used to signify the start of the value in the declaration .. any other whitespace is part of the value. Does this whitespace become its own token? Whitespace only has that meaning in this context. Moreover, `{` may not be the start of a variable declaration .. it depends on the context (there's that word again!). `{:` starts a name declaration, and `{` can even be used as part of some value. My language is similar to Python in that blocks are created with indentation. I was reading about how Python uses the lexer to create INDENT and DEDENT tokens (that serve more or less as what `{` and `}` would do in a lot of other languages). Python claims to be context-free which means to me that at least the lexer shouldn't care about where it is in the stream while creating tokens. How does Python's lexer know it's building an INDENT token of a specific length without knowing about previous characters (e.g. that the previous line was a newline, so start creating the spaces for INDENT)? I ask because I need to know this too. My final question is the stupidest one: why is a lexer even necessary? It seems to me that the parser could go character-by-character and figure out where it is and what it expects. Does the lexer add the benefit of simplicity?


title: Where should tests' log files go?

text: My application has a rather non-trivial, yet standard, log configuration.   It includes a console appender and a rolling size-based file appender. When I'm running the tests, thru the IDE or with maven, where is the least surprising place to save the log files?


title: Under which circumstances will development advance faster with many contributors compared to few?

text: I saw an interview with Joel Spolsky, where he says that Fog Creek Software intentionally keep their teams small (I believe as in four-five guys). The reason for this is to avoid a lot of the communication needed between the team members if the teams are larger. If one compares this to open source projects, where there can be hundreds (or thousands?) of contributors. Whether they are a team, is, though, arguable. There are probably also examples of something in between, with team sizes of 20 developers. My question is: What kind of software is most suited for getting developed by small teams, and what kind of software is suited for large teams?


title: How to level up as a PHP developer

text: I've been doing PHP for 4 years now. 2 years at school and 2 years at work. But I feel like I'm stagnating. Here are some things that I currently know about PHP:   * Basics (variables, control structures, arrays, loops, sessions, cookies, file manipulation)   * Database Integration (MySQL)   * OOP - I only know of the basics (creating classes, inheritance, objects, private, public and protected class variables)   * MVC   * A few frameworks (CodeIgniter, Laravel)    * PHPUnit (Assertions)   * Templating (Smarty)   * Using PHP with AJAX   * Building Wordpress plugins   * API Integration That's pretty much it. My question is what's next? What do I do to level up my skills as a PHP developer. What are the things that you can recommend that I would do in order to improve (Books, tutorials, etc.). What other PHP tools you can recommend that I should try and use. Thanks in advance!


title: Legal concern over "borrowed" code

text: A company my friend works for (let's call him Me) recently unveiled a new face for their internal "networking" website. This new face looks remarkably like Facebook, and indeed, examination of the source code reveals that it's almost identical: The code, class names, and even the fonts are the same. There is also no indication that Facebook is in any way involved or aware. I know this is unethical, but is it illegal? I can't find anything concrete about this to help Me decide what to do about it. EDIT: We're talking front-end code. It does not appear to be linking to Facebook in any way.


title: "Forgot Password" - How to handle this?

text: I read this answer and found a comment insisting not to send password by email: > passwords should not be able to be retrieved by email, I hate that. It means > my password is stored in plain text somewhere. it should be reset only. This raises me the question of handling Forgot Password option? At any cost the raw password must be displayed in any UI so that user will be able to read it. So what would be the way to handle "Forgot Password"


title: Real-time collaborative text editing (ie gdocs) - is it a viable software development tool?

text: "Google Docs" allows for real-time, collaborative document editing. Multiple document viewers are able to simultaneously read and change a document's content so that one user's updates are instantly applied and visible to all other viewers.   * Are there any software/web-app IDEs that facilitate this type of collaboration for writing code?   * Which processes (ie pair programming) stand to benefit from a system like this and which don't?    * Does this model for collaborative editing present a viable alternative to the current source control systems generally used by teams of software developers working on a single code base? Related but less general


title: What to do with old programming books?

text: I have about 1000 or so programming books, but a good selection are on languages/frameworks that are dated, like Django 1.1, Symfony 1.3, or HTML 4 and CSS 2. I just got them all back from storage and was sorting through what ones are of no use to me. So, I was wondering. Dated programming books are unlikey to be of any value to go through the hassle of selling them. Ideally I'd like to give them away but I can't find anywhere online to distribute them. Any ideas on what to do with them?


I've seen a lot of offices with sticky notes on whiteboards or even all over the walls. We don't use them in our company, I am currently considering starting using them, but I don't know how. How are sticky notes used by developers as a project management aid?


title: What implementation do you use when dealing with operators in .Net?

text: My question is in a sense a follow up of this post on Time Series in .Net. Ideally, you would like to expand the basic `TimeSeries<T>` class by something like `NumericTimeSeries<T>`, where you would want to make sure that the type `T` implements the common numerical operators `+`, `-`, `*`, `/', ... I am not sure what would be the most intelligent way to do this. My first idea is to create an abstract class `Number`, with abstract methods `Add(Number n1,Number n2)`, `Multiply(Number n1,Number n2)`, `Subtract(Number n1,Number n2)`, `Divide(Number n1,Number n2)` (and so on). I would then call these methods in the operator overloads. I can then create concrete classes such as `IntNumber`, `DoubleNumber`, `MatrixNumber`, `ComplexNumber` (and so on). The problem is that in the methods implementation, I would have to make an awful `switch` to determine what the class of each parameter is, and it's not very elegant. Would you have done it the same way? Has something already be done? In F# I would use and inline functions, or pattern matching using discriminated unions. But what should I do in C#? **EDIT** : There was an awesome answer by Olivier Jacot-Descombes. However, I would like to specify a feature. The numbers can apply the operator between them (you can multiply a matrix with a scalar for example). The problem with this is that you cannot know in advance the type of the result; multiplying a vector (transposed) and a vector returns a double...


title: good c++ editor

text: I'm going to teach teenagers some C++ code. I need an editor which is simple and has built in compiler. We tried CodeBlocks but when we installed it in the machines, the text got reversed, I'm not sure what the reaoson is. I would be great if the file size of the editor will not be large. We need just simple features: **-Text highlight.** **-Compile and run.** **-easy to use** **-Should run on Windows XP.**


title: Product Owner Role in Scrum

text: I am learning about Agile Methodology i.e. Scrum. I have a very basic knowledge of Scrum. Please guide following:   1. What is role of `Product Owner` in daily Scrum, if he/she is part of this meeting?    2. In real world scenario `Product Owner` is the person who is customer. A team member can be nominated as `Proxy` of product owner?    3. Can we say that `Project Manager` who directly interacts with customer is nominated as proxy of `Product Owner`?    4. When we use term `External Stakeholders Engagement`, are we referring to `Product Owner` or else?


title: How does using a LGPL gem affect my MIT licensed application?

text: I am developing an open source ruby application under the MIT license. I am using this license because I don't want to place any restrictions on the users of the application. Also I can actually read and understand this license. I recently started using another ruby gem in my project (require "somegem"). This ruby gem is under the LGPL license. Do I have to change anything about my project because I am using this other ruby gem that is licensed with LGPL? My project does not contain the source code for the other gem and it is not shipped with my project. It is simply listed as a dependency so that ruby gems will install it and my project will call into it from my code. Additionally, it would be helpful to know if there are any licenses I need to "watch out for" because using them would affect the license of my project. There are some other post about this topic but phrased in different ways. Since I find this license stuff tricky I am hoping to get a answer directed at my situation. Thank you,   Corsen


title: Designing software functions which are both pausable and restartable

text: Consider the following situation: One hardware device, two applications (1 C# application, 1 Firmware). The C# application sends frames to the firmware and the firmware executes scripts.   * C# -> transmit frame[x]    * FW -> receive frame[x]    * FW -> execute script relating to frame[x]    * FW -> before finished, a FW event is triggered forcing moving parts to stop (safety precaution). C# requirement after such events are raised:   * Poll FW for status, if status == stopped, send a resume fame.   * Caveat: the C# logic therefore needs to adjust itself to being "restarted". ### So this is the situation I have; but what I'm seeking advice with is how I should design a class which can handle the pausing and restarting of tasks an unlimited number of times. While I can write convoluted methods which are hard to maintain through a chain of logical statements, I'm struggling with finding a design which is reusable and clean. Such scenarios are true for ~50 unique tasks, so finding a solution I can apply everytime would save a lot of headache. Anytime a script is restarted or resumed, a physical user can easily cause a safety trigger stop, therefore a solution needs to be robust. While I'm sure recursion would be a first good step, I'm worried that the stack limits has the potential to introduce errors. ### Clarification: In my bid to simplify things, I seem to have omitted too much. Apologies. **Firmware:** Software running on a physical device which controls the hardware. I have no control over this code-base and it was designed independently while allowing USB communication. **Synchronization:** There is very little or no synchronization between the C# application and the firmware. My C# code will send a frame of bytes which match up to a specification document for the firmware, and if the frame is valid, the firmware will reply saying it received the frame and will begin the work. After that, there is no direct synchronization. A task described by a frame typically has two attributes: the time it takes to execute (need to manually observe) and an end target status (complete with status identifiers). Currently I poll the firmware for the status until the target status is reached or until time-out. **Recursion:** What I meant by that was (`if not complete` -> `callSelfAgain()`) **Pause:** User has done something to the device, wait here until they fix (can happen at ANY time during the time the firmware is running its jobs). **Restart:** The user has amended the state, now start the job from the beginning (or where we left off [task dependent]).


title: Getting my younger brother started on programming

text: My younger brother is 13 years old, I started programming when I started to develop Android applications when I was 15, last year my brother gained an interest in it and he would always pestering me about letting him make something himself, so I wrote him a few tutorials and he built himself a small application that had a few buttons that did something, I think you put in your dob and it would tell you what day you were born on, he took a couple of days building up to his final application, maybe even a week, learning everything he needed. Since then he hasn't really done much more because I have been engulfed in work and such where I have my own programming problems to sort out. I told him that when he was my age (I am 17) that he should be better then me, he was a bit sceptical about this however. I dont think he has as much logical reasoning as I would think he needs to solve more complex problems, but shouldnt that just develop over time as it did with me? He has been pestering me for the past week or something to write him more tutorials, but I didn't have time. All I had with me was a playlist I had downloaded from `the new boston` from youtube for C++, it's about 73 videos. He is currently about 20-30 videos in, he has come to ask me a few questions about it and thats it. Should I have really properly started him with C++? Should I stop him now and start him again on python or ruby? I know that C++ shouldn't really be a beginners language, especially for someone who is only 13, by the time this question is answered will probably be up to learning about inheritance or something. * * * Some people may see this as not a real question, but it is, and should be used as a reference for others. I want to know, should I start him on a different language whch is more easy? What language then? And would it be better for me to teach him myself (I would make time) or just continue him with `the new boston`? There are a few more questions throughout this question but these are the main ones. * * * Part of the question people seem to be neglecting is me asking whether I should change what language he is learning to another, or since he is already pretty far through the tutorials should I just leave him with C++ and he can learn the other languages freely by himself?