title: What should I learn to be backend web developer?

text: I want to be a web developer and because I don't want to get into designing (and stuff like that) so I thought I should become a backend developer (also more suited because of my course i.e. b.tech in computer science). So I have been searching the internet for a lot of things. But I am confused as what should I choose?   1. Python (attended a workshop on django looked easy but I think is a dying language as adoption of Python 3 is very slow)   2. Ruby   3. node.js   4. Java (Play framework)   5. .Net I am currently in my second year which means I have a whole 3 years to learn a language till I apply for a job. I want to learn something which helps me to build things on my own (to fulfill my creative mind's appetite) and something which gets a me good job also. So please guide. I am ready to do the hard work so it doesn't matter if the language is not very easy :)


title: Is it correct/useful to define Computational Complexity in this way?

text: I analyzed my algorithm and I deduced that in the best case it requires n^3 iterations while in the worst case it requires n^4 iterations. Then I asserted that my algorithm is in \Omega(n^3) and in \BigO(n^4). Is this assertion correct and useful? (sorry for the format but I'm not able to add LaTeX text, so if you can please tell me how to format this I will edit soon, thanks)


title: Does being a Senior Developer using one language qualify you to be a Senior Developer using another language?

text: If I work as a Developer in one language (e.g. Java) and work my way up to Senior Developer, would that qualify me to be a Senior Developer for a position using another language (e.g. Ruby)?


title: How can I compare and contrast open source licenses?

text: My company has given permission for me to open source some internal tools I've built. The first step is to choose an open source license. How do I do this? I know about the GPL, the Apache license, and others. Are there any resources out there that compare and contrast the different licenses? I'd rather not have to read every single candidate until I've narrowed the field.


title: How should a non-IT manager secure the long-term maintenance and development of essential legacy software?

text: We are a small, very specialized, benefits administration firm with an extremely useful, robust collection of software, some written in COBOL but most in BASIC. Two full-time consultants have ably maintained and improved this system over more than 30 years. Needless to say they will soon retire. (One of them has been desperate to retire for several years but is loyal to a fault and so hangs on despite her husband's insistence that golf should take priority.) We started down the path of converting to a system developed by one of only three firms in the country that offer the type of software we use. We now feel that although this this firm is theoretically capable of completing the conversion process, they don't have the resources to do so timely, and we have come to believe that they will be unable to offer the kind of service we need to run our business. (There's nothing like being able to set one's own priorities and having the authority to allocate one's resources as one sees fit.) Hardware is not a problem--we are able to emulate very effectively on modern servers. If COBOL and BASIC were modern languages, we'd be willing to take the risk that we could find replacements for our current consultants going forward. It seems like there ought to be a business model for an IT support firm that concentrates on legacy platforms like this and provides the programming and software development talent to support a system like ours, removing from our backs the risks of finding the right programming talent and the job of convincing younger programmers that they can have a productive, rewarding career, in part in an old, non-sexy language like BASIC. **In short, as non-IT managers, how can we best manage this transition?**


title: Why are strong names optional?

text: Why the c# allows project not to be strongly signed when they are build? They may be signed by some automatic name file if programmer do not choose his(hers) own sign file. Where is the advantage of not signed .dll file? What the strong names are? I am working on project which uses C# .dll files in Microsoft Dynamics AX. If the .dll file has the strong name it is easy to use. If not the fun begin. If the .dll do not have strong name   1. You can not easy install it to gacutil    2. You can not use it as a reference when you build a project with strong name.   3. It can leads to DLL Hell I see only disadvantages of project without strong names so I want to know if I miss see something or there is some tricky historical consequences why they are still allowed. I want to know if there is some advantage of using them. It should be possible to add strong name to .dll file without compiling but I was not able to use this because I end after I try to use ILASM.exe with "The program can't start because fusion.dll is missing from your computer, Try reinstalling the program to fix this problem." even if the fusion.dll is in the system (We decided to use different approach so I don't have time for more tries on this solution.)


title: Are there any benefits to checking in commented out code into version control?

text: I've found, what I personally believe to be a bad habit that a lot of developers seem to have adopted. Code in various places in the applications I have seen are commented out (lots of it) and checked into the mainline. Now, I don't have a problem with people doing this with their own branches, but is it a good idea to comment out 60 or so lines of code and check it into trunk? A colleague of mines has unearthed a lot of this and had spend half a day removing the commented out code just to tidy things up. Is there any benefit in checking in commented out code and leaving it for another developer to have to tidy up after you? After all, version control does have a history, so you can easy pull back any code that's been removed.


title: Can commented-out code be valuable documentation?

text: I wrote the following code:               if (boutique == null) {         boutique = new Boutique();              boutique.setSite(site);         boutique.setUrlLogo(CmsProperties.URL_FLUX_BOUTIQUE+fluxBoutique.getLogo());         boutique.setUrlBoutique(CmsProperties.URL_FLUX_BOUTIQUE+fluxBoutique.getUrl());         boutique.setNom(fluxBoutique.getNom());         boutique.setSelected(false);         boutique.setIdWebSC(fluxBoutique.getId());         boutique.setDateModification(new Date());              boutiqueDao.persist(boutique);     } else {         boutique.setSite(site);         boutique.setUrlLogo(CmsProperties.URL_FLUX_BOUTIQUE+fluxBoutique.getLogo());         boutique.setUrlBoutique(CmsProperties.URL_FLUX_BOUTIQUE+fluxBoutique.getUrl());         boutique.setNom(fluxBoutique.getNom());         //boutique.setSelected(false);         boutique.setIdWebSC(fluxBoutique.getId());         boutique.setDateModification(new Date());              boutiqueDao.merge(boutique);     }      There is a commented-out line here. But I think it makes the code clearer, by making obvious what the difference is between `if` and `else`. The difference is even more noticeable with color highlighting . Can commenting out code like this ever be a good idea?


title: good replacement for commenting out code?

text: It bothers me to see commented out code and it seems often-times a symptom of developers not being proficient in advanced source control features, but on the other hand source control does not really go all the way in solving the problem that commenting out is intended for. I've occasionally seen requirements flip-flop in such a way that code that would have been deleted suddenly is needed again. If the code is really deleted, there doesn't seem to be a clear procedure for locating exactly where to find that deleted code in source control. Is there a better way out there to save developer work that may be needed again besides the tried-and-true "commenting out"?


title: Organizations that encourage kids to program

text: Since my son started going to school, I've been noticing a very serious lack of organizations to encourage kids to program or at least letting them know how to get involved in programming. Are there any groups that you know of to help kids out this area?? And I'm not referring to tools to help kids learn, I'm referring to groups that will help in getting kids interested in programming. Here are a few that I know of:   * Dreamspark   * Lego First Robotics   * Imagine Cup Are there anymore out there? And are there any that work at the elementary - high school levels?? Also are there any other parents that have noticed the same thing, or is this local to my area?? Edit: Also I'm looking for groups that encourage kids who don't have programmers for parents. I've got no problem teaching my own son, I'm more worried about the other kids.


title: Finding the balance between the important and the interesting

text: Sometimes I go for what I find interesting instead of what is considered important. Having this attitude has been educational and it has let me produce work that I'm exceptionally proud of but it has also made me miss deadlines and disappoint people. Sometimes I think that I do this because I don't want to _break_ my curiosity. I'm afraid that if I ignore it I may gradually lose it. Do you have any advice? * * * Meta: How can I make this a community wiki?


title: Is Flash really superior to Java applets?

text: I'm still a student, without much real life experience in programming. I've never written anything bigger than ~5k lines of code. I've written code in both Flash and Java, and I just can't understand why people are writing web applications like video players (YouTube etc.) in Flash, and not as Java applets. So I want to ask you, programmers with hands on experience, for some wise words on the subject. I see no real benefit of Flash over applets, while on the other hand, at least to me, it seems buggy as hell. I understand it is faster to make something in Flash, and I can see why it would be a good thing for fast prototyping, but in general, is it worth it? Every time a YouTube goes berserk, i curse the developers for writing it in Flash. And if you are using Linux with Opera, this happens all the time. So, basically, why are people using flash, and not applets?


I been reading a few things about using libraries and stuff but they all talk about not using it for commercial purposes. Does commercial mean when you earn money by putting a ad to support you or is it something else like for a big company?


title: Is hierarchical product backlog a good idea in TFS 2012-2013?

text: I'd like to validate I'm not in the wrong way. My team project is using Visual Studio Scrum 2.x. Since each area/product has a lot of kind of requirements (security, user interface, HTTP/REST services...), I tried to manage this creating "parent backlogs" which are "open forever" and they contain generic requirements. Those parent backlogs have other "open forever" backlogs, and/or sprint backlogs. For example:   * HTTP/REST Services (forever)      * Profiles API (forever) *POST profile (forever)        * We need a basic HTTP/REST profiles' API to register new user profiles (sprint backlog) **Is it the right way of organizing the product backlog?** _Note: I know there're different points of view and that would be right for some and wrong for others. I'm looking for validation about if this is a possible good practice on TFS with Visual Studio Scrum._


title: Is there any logical relation between different types of UML diagrams?

text: I'm trying to find out ,that is there any relation between different types of UML diagrams, for example, once you developed a use case, should it be an event for each of them in a sequence diagram, or is there any exact relation between the use case and class diagrams. By the way my main focus is on the below diagrams:   * Use case    * class diagram   * activity   * sequence   * event if you think I need any extra diagram to be included so it can be used to connecting the above diagrams to each other, please mention it too. Thanks In Advance


title: HG: fork web app project to separate API code from app code

text: I have a web app thats been in active development for about 8 months now and its becoming apparent that the project has a need to maintain a separation between app specific code and our OO Javascript API. What I would like to do is have another repository with the following general structure of the js API code.               repo_name        |        +---build        |        +---build_tools        |        +---doc        |        +---src             |             +---js      Of course this structure is different from the original web app directory structure. If I make changes to this new repository how could I pull in those changes to the web app repository without unintentionally removing files or modifying the directory structure of the web app repository?


title: Factors to be Considered for Software Risk Management

text: What are the risk factors that we need to consider while planning for a software project.


title: Do some interpreted languages only load the scripts once?

text: The benefit of a compiled application was that all the libraries and classes are loaded one time and sit waiting for input right? I come from a background working with PHP and the resources/classes that used are loaded each page request which puts an bad load on the server memory. For example, given the PHP core uses 1MB of memory, and a wordpress loads another 7MB of objects - you end up with 8MB being loaded _every request_. I assumed this was the same process for other scripting languages like Python and Ruby also. However, I have started looking at node.js (because JavaScript is so beautiful) and it seems that it is loaded _once_ (and whatever memory needed is only taken once) and then sits around waiting for requests sharing the classes it has loaded among any new threads (is that the right term?) so they don't have to re-load them. So PHP would take `8MB process * 10 requests = 80MB` for ten concurrent requests to wordpress. This sounds like node.js would take `8MB process + 10 requests = ~14MB`. **Is this really true? Are there any other scripting languages that do this?**


title: IIS for beginner

text: I have a problem understanding some functionalities in IIS. Per example I want to know when do I use "Add application", "add virtual directory" or "add website". Currently I have around 10 websites which are located in my wwwroot/websitename directory and they automatically appear under sites in IIS. What is the best approach?


title: Why learn git when there are GUI apps for GitHub?

text: Given that GitHub provides GUI apps for both Mac and Windows, what are the benefits of learning to use git from the command line? Currently I'm using their mac app to update my repositories, and so far it seems to cover my needs. What might I be missing out on?


title: What are the key terms rvalue and lvalue?

text: Many of the times my compiler shows errors like Lvalue or Rvalue Required. What are the **Lvalues** and **Rvalues** in **C or any programming languages**? Is a pointer constant a rvalue?


title: Sending exactly one notification n seconds after the event

text: I have a system that checks the status of a number of systems, such as, is http up, does the system respond to ping, that sort of thing. I check all of these systems every 5 minutes. If something is broken, I send out an e-mail with a notice. If the problem is cleared I send out an "all clear, problem resolved" notice too. I want to send out a notice 30 minutes after a problem is detected and the problem is still ongoing and then at failure +1h, +2h, +4h, etc. I do not want to flood the user with messages every time the event "problem still ongoing" occurs which is every 5 minutes. I could store a "last notification sent at" somewhere and just work with that but I would rather just solve it in the code itself. Am I missing something very obvious or is this the only feasible way?


title: Under what conditions should I rebase rather than merge?

text: Here is, roughly, our structure of work using git, for web development. We have a master branch, and individual or groups of work are done seperately in branches, then merged in.   1. A ticket (or several) comes in.   2. We create a branch on our local development repository, and push it to origin.   3. We fix the tickets in code, commit the work and push to origin.   4. Once we're happy with our work, we pull the branch down to a repository on our UAT / Staging server and check it out for the client to review.   5. The client approves the work.   6. We go back to our local development repository, we check out master, merge the branch, and push to origin.   7. We create a tag from master afterwards.   8. We then go on the live server, pull master and move/update the tag to the new one. There are 7 of us, working on about 15 projects or so throughout the year. Generally, one person is sufficient to work on a project at any one time, but sometimes two people might work in separate branches with a view to merging into the master branch around the same time. Generally we think merging is best because it, as I understand, preserves a development history with regard to what was merged and when. Whereas rebase seems to completely destroy this and linearize the master log. Why would, if this assumption is correct, someone want to use rebase? Is it only for extremely busy projects that are constantly being branched and merged and there needs to be a guarantee that merges are successful - so developers can test out adding master to their work and resolve conflicts before merging back in?


title: Rewriting software using Agile methodologies

text: Suppose you have to rewrite an entire application using Agile methodologies, how would you do it? I guess you could write a big bunch of user stories based in the behavior of your current system. And then implement them in small iterations. But this wouldn't mean that we have the requirements **UP FRONT**?? Also, when would you start releasing? Agile says we should release early and often, but it doesn't make much sense to release before the complete rewrite has been completed.


title: what receives an ajax call?

text: I'm making a site which should (a) take information from the user in the form of files and forms, (b) take that data to the server to be run on a C application, and (c) take the result back and show it to the user. I was told to look for AJAX for the communication with the server. BTW, I'm using rails. I'm trying to understand how AJAX works. From what I understand so far, with rails is pretty easy to make the call. What I can't figure out is, what waits for that call? what process the call? If I understand correctly, with rails I could make a function in ruby and make it so it's called through AJAX, which means -or so I understand- that it gets executed on the server. If I were using PHP, would I need to make an http server to wait for the AJAX calls? I just don't find information about what waits for the call, and that information is processed. Any links, comments or books are welcome!


title: Making subclass more type-specific with accessors

text: I have a super class: `TriggerManager` with a subclass `TimedTriggerManager`. NOTE: I'm working in java `TimedTriggerManager` only deals with `TimedTrigger` s, a subclass of `Trigger`. `TriggerManager` references all `Trigger` objects. To modify the subclass (`TimedTriggerManager`) to only accept `TimedTriggers` into its accessors and mutators (getters and setters) I have the following questions: 1) I have in `TriggerManager` the following `public void addTrigger(Trigger t)`. In `TimedTriggerManager` should I just override the method to throw an error if the argument (`t`) is not a `TimedTrigger`. If so, What error should I throw? If not, what should I do? 2) Should I add another method `getTimedTrigger` to work alongside the supper class's `getTrigger` so that I don't have to keep type casting? (Since the latter would return a `Trigger` object) 3) Is there anything else I'm forgetting, or some common practice that I'm not doing?


title: Pattern to use for different Stages in a software

text: I am developing a software for a laboratory to test some devices. To test each device there are multi subtests which should be done to reach to the final result.To perform a complete test, the software must pass Stage1 then automatically goes to Stage2 then Stage3 and so on until the whole test is finished. meanwhile the user can select to just have the Stage3 or Stage2 or any other Stages independently to be performed (which she selects that at runtime). this is the thing I have done so far: ![enter image description here](http://i.stack.imgur.com/UTpiF.png)               public class IronTestWorkFlow:ITestWorkFlow         {             private readonly List<ITestStages> _testStageses;                  public IronTestWorkFlow(List<ITestStages> testStageses )             {                 if (testStageses == null)                 {                     throw new ArgumentNullException("testStageses");                 }                 _testStageses = testStageses;             }         }      I am useing a DI container. But I don't know how to change the list of Stages in `ITestWorkFlow` at runtime. **Questions:** 1- Am I designing this right? 2- If yes which pattern shall I follow to obey the principles and change the stages at runtime? and how can I do that?


title: Capitalization convention for C# protected fields

text: What is the capitalization conventions for protected field names in C#? Is it _myVar (like private field) or MyVar (like properties)?


title: I am trying to figure out the best way to understand how to cache domain objects

text: I've always done this wrong, I'm sure a lot of others have too, hold a reference via a map and write through to DB etc.. I need to do this right, and I just don't know how to go about it. I know how I want my objects to be cached but not sure on how to achieve it. What complicates things is that I need to do this for a legacy system where the DB can change without notice to my application. So in the context of a web application, let's say I have a `WidgetService` which has several methods:               Widget getWidget();     Collection<Widget> getAllWidgets();     Collection<Widget> getWidgetsByCategory(String categoryCode);     Collection<Widget> getWidgetsByContainer(Integer parentContainer);     Collection<Widget> getWidgetsByStatus(String status);      Given this, I could decide to cache by method signature, i.e. `getWidgetsByCategory("AA")` would have a single cache entry, or I could cache widgets individually, which would be difficult I believe; OR, a call to any method would then first cache ALL widgets with a call to `getAllWidgets()` but `getAllWidgets()` would produce caches that match all the keys for the other method invocations. For example, take the following untested theoretical code.               Collection<Widget> getAllWidgets() {         Entity entity = cache.get("ALL_WIDGETS");         Collection<Widget> res;         if (entity == null) {             res = loadCache();         } else {             res = (Collection<Widget>) entity.getValue();         }         return res     }          Collection<Widget> loadCache() {         // Get widgets from underlying DB         Collection<Widget> res = db.getAllWidgets();         cache.put("ALL_WIDGETS", res);         Map<String, List<Widget>> byCat = new HashMap<>();         for (Widget w : res) {             // cache by different types of method calls, i.e. by category             if (!byCat.containsKey(widget.getCategory()) {                 byCat.put(widget.getCategory(), new ArrayList<Widget>);             }             byCat.get(widget.getCatgory(), widget);         }         cacheCategories(byCat);         return res;     }          Collection<Widget> getWidgetsByCategory(String categoryCode) {         CategoryCacheKey key = new CategoryCacheKey(categoryCode);         Entity ent = cache.get(key);         if (entity == null) {             loadCache();         }         ent = cache.get(key);         return ent == null ? Collections.emptyList() : (Collection<Widget>)ent.getValue();     }      _NOTE_ : I have not worked with a cache manager, the above code illustrates `cache` as some object that may hold caches by key/value pairs, though it's not modelled on any specific implementation. Using this I have the benefit of being able to cache all objects in the different ways they will be called with only single objects on the heap, whereas if I were to cache the method call invocation via say Spring It would (I believe) cache multiple copies of the objects. I really wish to try and understand the best ways to cache domain objects before I go down the wrong path and make it harder for myself later. I have read the documentation on the Ehcache website and found various articles of interest, but nothing to give a good solid technique. Since I'm working with an ERP system, some DB calls are very complicated, not that the DB is slow, but the business representation of the domain objects makes it very clumsy, coupled with the fact that there are actually 11 different DB's where information can be contained that this application is consolidating in a single view, this makes caching quite important.


title: Is Clojure, Scala and other restrained by the JVM vs CLR

text: The Java implementors seem slow to adopt language improvements, for example compare C# with full closures, expression trees, LINQ etc.. to Java, and even the push back of some stuff to Java 8 will still leave it behind the current implementation of C#. However since I dont intend to use either Java or C# that particular language war isnt of interest too much, im more concerned with the JVM vs CLR. Is this lagging-behind also applicable to the JVM? Will Scala, Clojure etc.. will they be able to continue to innovate or score optimal performance in the face of slowly progressing underlying VM such as JVM? Is Clojure/Scala restrained at present by JVM limitations?


title: What's the difference between SocketAddress and ServerSocket in Java?

text: Learning how to develop a small embedded HTTP server for a class assignment, and the examples given on how to use `com.sun.net.httpserver.HttpServer` use an `InetSocketAddress` which extends `SocketAddress` as the link between client and server. However, all of my previous network programming assignments used `Socket` and `ServerSocket` to create raw connections between a server and client to send custom protocols back and forth. Clearly these two classes are different as they don't share any common ancestor other than `java.lang.Object`. What is inherently special about each that makes them fundamentally different?


title: Data Model for selling groups of products as one product

text: Say I have an e-commerce with a data model like the following, which allows a `Sale` to describe how a single `Product` is sold. This division allows a product to be sold multiple times in different ways (different pricing, or offered at a different point in time). This works great when a sale is selling a single product. **Sale**   * product_id (sale belongs to product)   * other offer details like price, sale expiry date, marketing content, etc **Product**   * product has many sales   * factual product details like name, photo, manufacturers description, etc * * * **The problem:** How can this data model be improved to allow a sale to have many products? For example, to create a bundle of 1 of product A, and 1 of product B. So if a customer wants quantity=3 of those bundles, they would receive a total of 3 A's and 3 B's. Or a sale could be for multiples of a single product. In this case the sale would be for 5 of product C. So if a customer wants quantity=3 of those bundles, they would receive 15 product C's. * * * The best idea I have so far is add a new table. This would allow a sale to reference many orderables, which describe what's in the bundle. **Orderables**   * belongs to product   * belongs to sale   * qty in the bundle But a refactoring of this magnitude is a monumental task. The number times `sale.product` appears in the codebase for a variety of reasons is enormous. And every single case need to be fixed in code, and probably presentation as well. So before we commit too heavily to this approach, I'm wondering if there is a glimmer of hope I've not yet seen, or if my future is fraught with the pain and peril of this epic refactoring.


title: Does CTRL+C works in the whole world

text: I would like to know if CTRL+C (copy) keyboard shortcut works on all Windows versions above '98, all Non-English Windows and on all keyboards (English, German, Chinese...)?


title: Algorithm for defragmenting cross-pipe issues in a network for routing signals through?

text: I have a network I'm responsible for routing signals through. You can think of the network as a directed graph of nodes (hardware) but each edge is really a pipe capable of fitting a specific bandwidth, I can route signals to any index on that pipe and may have multiple signals of different 'size' going across the pipe. For what it's worth the signals are predetermined sizes and will not always be simple multiple of twos. I know how to defragment a single 'pipe' easily enough. However, it's theoretically possible that I could have to move signals around across multiple pipes to create enough room to fit a new signal. In a trivial example I could have two edges from A to B with enough space to fit a signal of size '4' available, and a signal of size '8'. To fit the signal across I would have to move some signals from pipe 2 to 1 so that 1 is completely freed, living a full '8' slots available for my new signal to routed in. **How to detect and properly defragment these sort of cross-pipe issues?** Of course in the real world I may have to route signals through completely different devices, perhaps having signals take less-direct routes, to free up enough space for my new signal on any given pipe. So in short across an entire system of these networks I want to   1. find a method to get a signal from input to destination in a crowded environment where I may have to move multiple signals to take a different path to their destination in order to free up sufficient space on a given pipe   2. figure out how to do the above with the minimum number of signals physically moved   3. have an approach that minimizes the need of running the above steps by minimizing fragmentation as much as possible. This is a complicated series of requirements on their own, and I'm not looking for an answer on how to do it all, though such an answer is welcome.


title: How do you find the most optimized way to write code?

text: In my programming career, I have written Java and PHP, Javascript and a little Ruby. I am not a CS major but got into web development from a more broad Internet Professional associates degree, which focused on Design, User Experience, and Development. I started out as Front-end Developer and quickly got great jobs working on complex applications which once I mastered the front-end world, I had the opportunity to become a Software Engineer on the projects because I understood the system and could figure out how to engineer it to do what I want. Obviously I work with most other who have CS degrees and while I may be faster at figuring out how to make the application we are working on do something, they usually understand basic concepts better than I. That being said, there are obviously language docs out there for Java and PHP but what resources are out there that tell you the best practices of writing good optimized code. Reading those docs aren't good enough to be able to write code and then show people like some of you and not get a bunch of "why didn't you do this" or "I can't believe he didn't do that. " There are a lot of blogs out there but you only find an article here and there by a person that focuses on explaining how to write better code. Or maybe I am wrong, I don't even think I am explaining this question all that clear. My main problem is, I can write code get it to work, think that it is written well but I'm not really sure. Besides just getting your code to work how do you know you have written it the preferred way that when others look at it, they say to themselve, this guy knows what he is doing :). If anyone has any specific language resources right now I would prefer PHP ones, since that is what I am working on.


title: Project Management Techniques (high level)

text: Our software dev team is currently using kanban for our development lifecycles, and, from the reasonably short experience of a few months, I think it's going quite well (certainly compared to a few months ago when we didn't really have a methodology). Our team, however, is directed to do work defined by project managers (not software project managers, just general business), and they're using the PMBOK methodology. Question is, how does a traditional methodology like PMBOK, Prince2 etc fit with a lean software development methodology like kanban or scrum? Is it just wasting everyone's time as all the requirements are effectively drawn up to start with (although inevitably changed along the way)?


title: Save database changes in service layer or controller mvc .net

text: I have recently been using a service layer to abstract away alot of the business logic of my application. However I've come into an issue where I'm not sure what is best practice on doing the actual persist of any changes I may make to my models. 1) Is it best to implement a SaveChanges() on my Service layer and so inject the IUnitOfWork into each one I use.                   public class BaseService : IService         {            private readonly IUnitOfWork _unitOfWork;                 protected BaseService(IUnitOfWork unitOfWork)            {               _unitOfWork = unitOfWork;            }                 public void SaveChanges()             {                 _dbContext.SaveChanges();            }         }      Hence my controllers would only ever be injected with my various services and I would call SaveChanges on these. 2) Or, is it best to let my controller, or service user contain the IUnitOfWork reference and let it call the save directly.                   public class MyController         {            private readonly IUnitOfWork _unitOfWork;            private readonly IMyService _myService;                 protected MyController(               IUnitOfWork unitOfWork,               IMyService myService)            {               _unitOfWork = unitOfWork;               _myService = myService;            }                 public void MyAction()             {               // do stuff with service layer                    _unitOfWork.SaveChanges();            }          }      **Note** : I would use a DI framework like Autofac, Ninject, Unity etc to manage the UnitOfWork creation via a InstancePerHttpRequest lifetime. 3) Or could I leverage action filters and persist the changes on ActionExecuted.                   public class UnitOfWorkActionAttribute : ActionFilterAttribute         {             public IUnitOfWork UnitOfWork { get; set; }                  public override void OnActionExecuted(ActionExecutedContext filterContext)             {                 UnitOfWork.SaveChangesAsync().WaitAndUnwrapException();             }         }


title: Measuring performance of a network simulator?

text: I have written a python program to test a new network routing algorithm, that uses a Content Centric Network Approach for handling requests (CCN), where the CCN router keeps 3 data structures:   * A PIT or Pending Interest Table, that holds requests for which a router has not yet received a response.    * A FIB or Forwarding Interest Base, which maps requests to the next router to which the request can be forwarded.    * A Content store to which the router can cache content from previous requests. The Simulator is simple: \- It follows the Event-Based design where 'Dummy Packets' are sent from server object to other server objects containing data of what content is being requested and the destination of where the content object is. **Specifically** , how could I design my simulator or tests to get a birds eye view of how my new algorithm matches up against standard IP routing? My hunch is that I will need to test speed, which I believe can be done by timing the round trip time for a request. But I don't know how I would test other aspects of this algorithm. I have little to no networking experience so any advice or direction is appreciated.


title: API providing function to be run in a thread vs. thread that runs this function

text: I'm writing a Python library which exposes a certain event listener interface. The user can register callbacks to handle different types of events. There is also a function which handles the actual events. This function does something like this:               def get_event():         while(1):             event = wait_for_event() # blocking call             process_event(event)      This function is meant to be run in its own thread. So really, the way to use it is               def start_listening():         thread = threading.Thread(target=get_event)         thread.start()      For simplicity I'm ignoring locking mechanisms and such. In the module API, I can either expose `get_event` or `start_listening`. What are the pros and cons of doing one versus the other? Is there a "pythonic" way of doing this?


title: Is it bad to use the same class or idiom names as in a third-party API that you're using?

text: FlashPunk is a third-party graphics API for simple game development in AS3, and they take what are effectively sprites or display objects of some sort and refer to them as "Entities". `Entity` is the actual class name, and it's the predominant class to use to animate something such as a character moving on the screen. There's a bit of a convention right now in which you refer to things like barriers, enemies, characters, etc. as "entities". So that being said, if you're using FlashPunk for your graphics, is it bad to create a base class to represent such things and name it `Entity` as well? (In particular, does this violate a widely-held coding convention?) Obviously it would be in a different package, and most people would probably separate the graphics from the game's actual state, so there's not a lot of overlap there. It's just using the same title. What about scenarios like this in general with programming? _Is there a particular convention?_


title: Implement RPC via SIP

text: Look at the following use case. I have a client (Java) application, which wants to get/set the state of another, remote application (C). The communication between them is done via SIP, which is run in another thread. The SIP interface can do the following: sendMessage onRequest I have two ideas for the architecture: **RPC (JSON-RPC)** Define a class which does the marshalling/unmarshalling for JSONRPCRequests and JSONRPCResponse (http://software.dzhuvinov.com/json-rpc-2.0-base.html) Define a Invoker class, which has something like a **call(server, name, arguments)** method. In the Invoker class, the name and arguments are put into a JSONRPCRequest and sent via the SIP layer sendMessage Now comes my problem. How do i actually get the right back to the caller? The control flow is now: The onRequest method is called, but I do now know whether it is the answer to my previous call. What i do is putting all responses reaching my server into a Map, and just poll that list in the Invoker. A rough sketch might be; **Invoker (provides API to client)**               class Invoker {              private Channel channel;              public Invoker(Channel channel) { this.channel = channel; }              public Object call(String server, String name, Object .. args) {             JSONRPCRequest req = ...;             channel.sendMessage(server, req.toString());             while( ! channel.hasResponse(req.id()) {                 Thread.sleep(42);             }             return channel.getResponse(req.id()).result();                 }          }      **Channel (interface to messenger):**               class Channel {              private Map<Object, JSONRPCResponse> responses = new //;              private Sip sip = new Sip() {             public void onRequest(String msg) {                 JSONRPCResponse response = JSONRPCResponse.parse(msg);                 responses.put(msg.id(), response);             }         };              public void sendMessage(String server, String message) {             sip.sendMessage();         }              public boolean hasResponse onRequest(Object id) {             responses.hasKey(id);         }              public JSONRPCResponse getResponse(Object id) {             responses.get(id);             responses.delete(id);         }          }      **SIP (messenger itself):**               abstract class Sip {              public void sendMessage(String msg) {             // SIP magic         }              public abstract void onRequest(String msg);         }      Is there a better way to do that? My biggest problems/code smells are:   * the blocking in Invoker    * the protocol is in Invoker, maybe I want to switch marshalling to something else   * the map as mean to get the correct response for a request   * the SIP abstract method looks strange   * No error handling   * No timeout **Message Passing** Is there an easy way to get rid of RPC, and implement something like RPC with just message passing? Any hints for pattern are welcome. I do not need the code itself, I am totally fine with just architecture. I tried to google for message passing implementations, and how they actually change state with it, but I did not find anything useful. How to implement timeout/ error handling? Any good books/literature on that topic is also welcome, as I never programmed such distributed stuff. Any other ideas on which protocol to use inside SIP to change state is welcome, too, as RPC was my initial thought, and I did not find anything other useful. The code will not compile, I guess, it was just to visualize my idea.


title: JavaScript...what to unit test

text: I would like to hear other people's opinion on what to unit test in JavaScript. I've been thinking about it and experimenting and let me present what seems to me the right thing. First of all, in order to be able to unit test your production code you need to divide the productin code into three layers: (1) DOM/jQuery, (2) Logic, and (3) AJAX. Refer to the attached image. ![enter image description here](http://i.stack.imgur.com/XkqwX.png) The Logic layer sits between the DOM/jQuery layer and the AJAX layer, that is, the DOM/jQuery layer is not tied to the AJAX layer. So, in my opinion the only layer that should be unit tested is the Logic. Writing unit tests should be easy, otherwise programmers will not write them. What is the use of writing unit tests for the DOM/jQuery layer - ok, you've added an li element to an ul element, why do I need to assert that, there should be no if statements there. About the AJAX layer, what's there to assert...the URL that was used was "blah", I know it was "blah". Whatever the data that was obtained in the AJAX layer should be given to the Logic layer. Now, the Logic layer is a different story, for example, in a unit test it can be given data that suppossedly came from an AJAX call, and use a mock DOM/jQuery layer to verify that the data was displayed correctly. Let me know what you think.


title: Where should libraries be placed, in windows?

text: I have just moved from Linux to Windows, and I have to use the Zend Framework library. Where should the library be placed?   * Directly on C drive   * Create a lib folder like C:/lib/    * Create a lib folder in my user folder I am wondering if there is a classic folder where these kind of libraries are placed. **Update** :I am asking about the location on my own standpoint. The Zend Framework library is a PHP framework.


What's the difference between MariaDB and MySQL? I'm not very familiar with both. I'm primarily a front end developer for the most part. Are they syntactically similar? Where do these two query languages differ? Wikipedia only mentions the difference between licensing: > MariaDB is a community-developed branch of the MySQL database, the impetus > being the community maintenance of its free status under GPL, as opposed to > any uncertainty of MySQL license status under its current ownership by > Oracle.


title: Open sourcing an internal project that has confidential information in the old revisions.

text: > **Possible Duplicate:**   >  How to open-source a project whose git repository has copyrighted media in > the history? Our company has spent a year working on an internal web application and has decided to open source the project and host on github. The application was originally versioned with Bazaar and we are going to preserve the commit history when converting it to git. There is some confidential information within the commit history, such as internal database information. **Question:**   Is there a way to preserve the commit history while removing or hiding all traces of confidential information? The big reason being that we have had employees that have worked on the project that have moved on to ~~higher-paying~~ other jobs and we want to maintain recognition of their hard work.


title: Best practice for organizing third-party integration code in ruby

text: I have a rails app. I'm writing code to integrate it with a third-party service, "Foo Bar". The integration affects many parts of the system -- models, controllers, and an API wrapper. Thus far I've been putting the integration stuff into the modules of each model and controller. So inside **app/models/user/foo_bar.rb** is `User::FooBar`, which I then include into my user model. I have the API wrapper inside **lib/foo_bar_api.rb**. It occurred to me today that perhaps I should have all my integration code in **lib**. So **lib/foo_bar/user.rb** would contain `FooBar::User`, which I then include in my user model. Is there a particularly standard way of doing this, or is it 6 of one, half- dozen of another? (p.s., this is my first programmers.stackexchange.com question -- it's appropriate for here, right?)


title: Basic Database Relationship Advice?

text: I am finding it difficult to get together in a single place the different types of relationships used for different things and would like to find out which I have correct and incorrect and the proper "technical" terms for the different types of relationships. An example:               In database we have:     One to One     One to Many     Many to Many      I beleive (although I may be wrong hense the question) that these types of relationships are collectively termed "Multiplicity" relationships. Is this correct, and if so, are there other names for it.               In programming we have:     Ihneritance     Encapulslation     Polymorphism      I beleive (and may be very wrong here) that these are different types of "Compound" relationships. If they are all the same type of compound relationship then is there other names for it. If they are different, how are they named. I would also like to know if there are other relationship types in general database / programming world that would be used to some degree without going into obscurity like some sort of unused sci-fi "molocular mumbo jumbo bumbo" relationship. Just keeping to what would be generally useful in the real world. I think I have a good understanding of the different relationship types, its more the terms used to describe them, and comming up with a brief 2 or 3 line description that really sums it up (assuming someone has allready got a fair understaiding). Knowing the technical terms properly and clearly will help me should I need to advise others on what to look for elsewhere. Can anyone offer suggestions on this for me without getting overly technical. Thanks in advance.


title: Why (not) segmentation?

text: I am studying operating systems and the x86 architecture, and while I was reading about segmentation and paging I naturally was curious how modern OSes handle memory management. From what I found Linux and most other operating systems essentially shun segmentation in favor of paging. A few of the reasons for this that I found were simplicity and portability. What practical uses are there for segmentation (x86 or otherwise) and will we ever see robust operating systems using it or will they continue to favor a paging based system. Now I know this is a loaded question but I am curious how segmentation would be handled with newly developed operating systems. Does it make so much sense to favor paging that no one will consider a more 'segmented' approach? If so, why? * * * And when I say 'shun' segmentation I am implying that Linux only uses it as far as it has to. Only 4 segments for user and kernel code/data segments. While reading the Intel documentation I just got the feeling that segmentation was designed with more robust solutions in mind. Then again I was told on many occasions how over complicated the x86 can be. * * * I found this interesting anecdote after being linked to Linux Torvald's original 'announcement' for Linux. He said this a few posts later: > Simply, I'd say that porting is impossible. It's mostly in C, but most > people wouldn't call what I write C. It uses every conceivable feature of > the 386 I could find, as it was also a project to teach me about the 386\. > As already mentioned, it uses a MMU, for both paging (not to disk yet) and > segmentation. It's the segmentation that makes it REALLY 386 dependent > (every task has a 64Mb segment for code & data - max 64 tasks in 4Gb. > Anybody who needs more than 64Mb/task - tough cookies). I guess my own experimentation with x86 led me to ask this question. Linus didn't have StackOverflow, so he just implemented it to try it out.


title: where do you track team Decisions

text: I have been on many development teams and as the team matures decisions about direction are made. These decisions often come back up over and over. Like why don't we fill in this field why didn't we use memcache over a custom solutions. These decisions add up over time and become a significant part of style guides coding standards and unit tests. My question is I have never run into a good way of tracking these decisions or the discovery that went into making them. Does anyone have a best practice.


title: What technology is used to build "Visual Studio 11"?

text: A preview of the new "Visual Studio 11" was recently shown at Microsoft's BUILD conference. Out of interest, what technology is being used to create it? I assume it's not WinRT (which I've been led to believe is only for Metro style apps in the new Windows 8 touch-first environment) Is it still using WPF (like 2010)? Is it built on .NET 4.5? Are there any new technologies going into it? Do we know?


title: Ensuring non conflicting components in a modular system

text: So lets say we are creating a simple "modular system" framework. The bare bones might be the user management. But we want things like the Page Manager, the Blog, the Image Gallery to all be "optional" components. So a developer could install the Page Manager to allow their client to add a static home page and about page with content they can easily edit with a wysiwyg editor. The developer could then also install the Blog component to allow the client to add blog entries. The developer could then also install the Gallery component to allow the client to show off a bunch of images. The thing is, all these components are designed to be independent, so how do we go about ensuring they don't clash? E.g. ensuring the client doesn't create a /gallery page with the Page Manager and then wonder why the gallery stopped working, or the same issue with the Blog component, assuming we allow the users to customize the URL structure of the blog (because remember, the Page Manager doesn't necessarily have to be there, so we might not wan't our blog posts to be Date/Title formatted), likewise our clients aren't always going to be happy to have their pages under pages/title formatting. My core question here is, when building a modular system how to we ensure that the modules don't conflict without restricting functionality? Do we just leave it up to the clients/developer using the modules to ensure they get setup in a way that does not conflict?


title: How do you identify a problem as being suitable for dynamic programming?

text: I have been reading up on dynamic programming lately. Would like to hear from someone who started from scratch and now is pretty good at identifying and solving DP problems. I am struggling in identifying these problems as DP and framing a concise solution. I have gone through most of the beginner DP problems and MIT resources etc


title: Unit test DAO code using SQL Lite when the application database is Oracle

text: We have an application with Oracle backend. The DAO layer is written in C# and uses nHibernet to perform the data operations. To unit test our DAO code, we use SQL Lite which creates the database based on our existing mapping in the project. Some of our nHibernate queries that go to oracle use (+) for outer joins. Now SQL Lite doesn't understand (+). There can be some more syntax from Oracle that SQL Lite doesn't understand. How do we fix problems like these? What are the other database systems that can be used for unit testing the application code.


title: Using a closure to avoid code duplication in Python

text: Sometimes I find myself wanting to run the same code from a few different spots in the same function. Say I have some function func1, and I want to do the same thing from a few different spots in func1. Normally the way to do this would be to write another function, call it "func2", and call func2 from several different places in func1. But what about when it's convenient to have func2 access variables that are local to func1? I find myself writing a closure. Here's a contrived example:               import random     import string          def func1 (param1, param2):         def func2(foo, bar):             print "{0} {1} {2:0.2f} {3} {4} {0}".format('*'*a, b, c, foo, bar)              a = random.randrange(10)         b = ''.join(random.choice(string.letters) for i in xrange(10))         c = random.gauss(0, 1)         if param1:             func2(a*c, param1)         else:             if param2 > 0:                 func2(param2, param2)      Is this the Pythonic way to handle this problem? A closure feels like pretty heavy machinery to be rolling out here, especially given that I have to construct a new function every time func1 is called, even though that function is going to be basically the same every time. But it does avoid the duplicated code and in practice the overhead of repeatedly creating func2 doesn't matter to me.


title: What do I benchmark before updating a web site?

text: I am volunteering my time to update a website for a local business. The current website they have is not up to date and it fails quite a few "web tests". For example, the pages are too large, the images are not compressed, and the site is not mobile friendly. All of these things are measurable - eg. the time taken to load (in seconds), bandwidth (in kb), and a list of the devices the site displays correctly on. It is my intention to note these benchmarks before starting the project, and upon completion. My question is: what benchmarks do web developers present to their clients?


title: Help me with random access file without using a database in vb6.0

text: I'm an IT student and we have to make a project about random access file without using a database, using only text files. So I was wondering if anybody here that could help me with it. I want to have an example so I can study it. A simple random access file program will do. An example of it is a phonebook in which you can save a name and a phonenumber. And you can edit it and delete. And also search names or phonenumbers and also can browse all the files randomly. If you know how it's done or if you have any samples that I can study, please answer. Your help is really appreciated. And I'll give you credits if I make my program. I'll thank you in advance....


title: Software developer interview questions: is speed everything?

text: Maybe I'm just less smart than other people but for once I'd like to say that all the puzzles, riddles, code questions and code-on-paper exercises seem just a bit hard to me. I've always thought of myself as a above-average smart guy, but in an interview when they ask me to solve something or write code on paper in order to ask something, I think I'm just not suited to that. Maybe I'm not as productive as someone who is totally reactive and a fast- thinker, but I repute myself a creative thinker, someone who is able to solve every problem if he's given enough time (which is not EONS, just some time more than a fast'n'furious minded applicant). In my opinion is not guaranteed that a fast thinker is smarter than a less-fast thinker (not slow, just LESS fast). Is speed everything in face-to-face-with-paper interviews?


title: Obtaining the best of both worlds: MVC and WebForms

text: Rather than asking a general question about WebForms vs MVC (such as in ASP.NET v/s ASP.NET MVC), I have a specific quesiton. It appears the main differences between the two approaches are   1. WebForms is Event Driven and uses pre built components   2. MVC has a built in layer that WebForms does not: the Model   3. MVC has the Controllers in a separate folder than the Views while the WebForms Controller is the CodeBehind One could easily add a folder to a WebForm project called "Model" that stores all the business logic which used in the Code Behind (decoupling the two). The main argument against WebForms is that it's "easy" to write business logic in the CodeBehind. But you could easily add business logic in your MVC controller completely violating the separation of concerns. Now for the question: Isn't it the case that you could write a WebForms project in such a way that the business logic is separate from the Controller/Code Behind which would have all the benefits of MVC (separation of concerns) while keeping the benefits of WebForms: rich controls, Event driven (if you like events)?


title: Can someone explain the behind-the-scenes process of connecting an app account to a Facebook account?

text: I am developing an app that will use the Twitter and Facebook login APIs exclusively. Suppose a new user downloads the apps and is presented with the option to log in through Facebook or Twitter. The user chooses Facebook. I think the procedure at this point is to a) create an auto-generated user ID in my Users table   b) store the Facebook credentials against the auto-generated user ID I am confused about part b. Does Facebook return a unique ID when their API is called that I can store against my user ID or is there some alternate process? In other words, what exactly does it mean to store the Facebook credentials?


title: Are security exploits a fatality?

text: _I'm asking this here and not on the security related site because this one is a question about "software architecture" and "development methodologies", which are both covered by the FAQ._ **EDIT** : I'm talking about purely remote root / admin software exploits. Not about insider physically breaking into labs / companies / houses / networks / machines. Everytime there's a blog entry or article about a new security exploit there are lots and lots of people basically writing that: _"No software shall ever be secure, every single software out there can be exploited. Give any pirate sufficient time and he'll eventually exploit any high-target software."_ This is a constant. These type of comments always get modded like crazy and most people seems to accept it as a fact. And it really gets me wondering: can any software architecture and development methodologies be used to ever come up with secure software or is there something technical that prevents us from writing secure systems/programs/OSes/servers? The more I think about it, the more I don't understand why we couldn't, technically, build 100% secure software. All the way down from the OS and then up: browsers, plugins... Note that I'm not interested in a discussion here: I want to know if technically there is something or not that can prevent, say, an OS, to be written in a 100% secure way and why it's that way. Now if there's nothing technically that prevents us from writing a 100% secure OS and from then writing a 100% secure server, why hasn't it been done? Does it means our architecture and development methodologies (and tools?) are deeply flawed?


title: CUDA Loop Question - Worthy of Unwinding?

text: It's a known fact that branching is bad for CUDA. The question I have is a little more specific. I have a (static) loop. Static here means that it follows the exact same path every time, and executes the same number of times. Inside the loop are branches, but in a given iteration, the same branch is followed every time. So, if we unwind/unroll this loop, and flatten out obvious branches, it will be plain-old sequential code. Is it worth it to unwind this loop for execution on a CUDA device, or will branch prediction work well enough and execute only one branch per thread? Because otherwise, there are about 34 paths through the code that can be taken, and I'm trying to avoid each thread taking each path. Example loop:               for (int i = 0; i < 33; i++)     {         if (i % 3 == 0)             ...         if (i % 3 == 1)             ...         if (i % 3 == 2)             ...     }


title: Story points for bug fixing tasks: Is it suitable for Scrum?

text: I'm just wondering if we should assign story points to bug fixing tasks or not. JIRA, our issues-tracking software, does not have story point field for _Bug_ type issues (it's only for _Story_ s and _Epic_ s). Should we add the _Bug_ issue type to the applicable issue types of the _Story Points_ field? What are the pros and cons? Would it be suitable for Scrum?


title: Why don't relational databases support returning information in a nested format?

text: Suppose I'm building a blog that I want to have posts and comments. So I create two tables, a 'posts' table with an autoincrementing integer 'id' column, and a 'comments' table that has a foreign key 'post_id'. Then I want to run what will probably be my most common query, which is to retrieve a post and all of its comments. Being rather new to relational databases, the approach that appears most obvious to me is to write a query that would look something like:               SELECT id, content, (SELECT * FROM comments WHERE post_id = 7) AS comments     FROM posts     WHERE id = 7      Which would give me the id and content of the post that I want, along with all the relevant comment rows packaged neatly in an array (a nested representation like you'd use in JSON). Of course, SQL and relational databases don't work like this, and the closest they can get is to do a join between 'posts' and 'comments' that will return a lot of unnecessary duplication of data (with the same post information repeated in every row), which means processing time is spent both on the database to put it all together and on my ORM to parse and undo it all. Even if I instruct my ORM to eagerly load the post's comments, the best it'll do is to dispatch one query for the post, and then a second query to retrieve all of the comments, and then put them together client-side, which is also inefficient. I understand that relational databases are proven technology (hell, they're older than I am), and that there's been a ton of research put into them over the decades, and I'm sure there's a really good reason why they (and the SQL standard) are designed to function the way they do, but I'm not sure why the approach I outlined above isn't possible. It seems to me to be the most simple and obvious way to implement one of the most basic relationships between records. Why don't relational databases offer something like this? (Disclaimer: I mostly write webapps using Rails and NoSQL datastores, but recently I've been trying out Postgres, and I actually like it a lot. I don't mean to attack relational databases, I'm just perplexed.) **EDIT:** Since a few people seem to be confused, I'm not asking how to optimize a Rails app, or how to hack my way around this problem in a particular database. I'm asking why the SQL standard works this way when it seems counterintuitive and wasteful to me. There must be some historical reason why the original designers of SQL wanted their results to look like this. I also think that the people saying "just run two queries" are missing the point too - I may not know the post's id when I'm making a query. I may not have to eager load one relationship, but dozens. I used a concrete example not because it's a particular problem I'm trying to solve, but because it illustrates my point. For the people below who say that it's not the database's job to return data ready for display, it seems to me that joins and database views perform basically the same functionality - they make the denormalized data in your db easier to put together and use (not necessarily display, but use). I think that what I proposed above is basically equivalent to a join, just simpler for the developer to parse and make use of.


title: WPF, MVVM, EF, POCO guidance required on simple architecture

text: (sorry for my poor english) I am developing a application using WPF, EF Code First using MVVM (Caliburn.Micro). It should be used mostly to CRUD work. I created a `BaseViewModel<T>` class from wich all other ViewModels inherit and exposed a `T Selected` property to bind to the View. I know it is not recomended to expose a Model to the View but it just make things simple to get the app running. Problem is I do not want to pollute my Models (EF POCO classes) with `INotifyPropertyChanged`, `IDataErrorInfo`, `IEditableObject`, etc... So, there is something that I can do here or do I have to really duplicate all Model properties to the ViewModel and give up trying to bind the model directly? I would like to use the attribute validation too, since all models have them already. I used this approach on the past with Silverlight/RIA but in this case RIA Services generated the classes for me, with all the plumbing code. I can get the validation errros using Validator class but I also need to indicate the component that has the error no the UI and I think I need to implement `IDataErrorInfo` on my model for this to happen, right? For `INotifyPropertyChanged` I can use something like NotifyPropertyWeaver but my problem is `IEditableObject` and something to be able to use the attribute validation. It would be nice something like `MagicBusinessBaseClassThatImplementAllThoseInterfaces<Model>` to encapsulate the model so I can just bind it and move on. I know I can make this work implementing manually the interfaces on each VM - but just think on all the "duplicated" code make me cringe :( How WPF developers are doing those kind of things today? There some secret ninja technique that I am not aware of?


title: Best way to approach a partner business to understand the need for B2B web-services

text: We currently work with a company that has a fairly simplistic web system for processing warranty information. The only way to get data out of it is through excel exporting. Compilation of this data and correlation with our systems has to be manual and makes us be reactive in our response. The ideal situation would be setting up a web service on their side and automatically mash it up with our data so that we can have good and timely information without human overhead or the weekly bottleneck. However, when we mentioned this same argument to them, their IT department creeped out from us wanting to access their systems "directly", since they have other information for other vendors which are our competition. **In other words, they seem to think it is something weird and insecure**. My question is: how would you make them understand the need to modernize their systems?, have you had any experience convincing the company you want the web- service from?, and, would you go convince them yourselves as a company with the need, or hire a consultant to assess this and speak with them instead? Edit: We supply custom made electronic devices for our clients which then sell it to end users. End users deal with our clients and, depending on the case, then the client deals with us if they require software/hardware fixes for the next revision.


title: Semantic versioning for desktop applications

text: I can easily follow the Semantic Versioning recommendations if I develop a library or API, but what if the developed product is a website or a desktop application? When would you increment a `major` component in that case? In case of a complete UI redesign? Or something else? Thoughts?


title: How important is an SSL certificate for a internal website?

text: I know many people have asked the same question but I think it really depends on the type of the website. So that's why I am asking the question about my website. I am developing a PHP web application for an insurance company. the application contains all information about the customers but this app is only used by the admins and salesman of the company. The admin creates a user then that user can add customers or renew their insurance. the address will be something like example.com/manage/ and the login is only for the users that admin person has created. Of course I will be using validation, salt, encryption, etc. But do I need SSL certificate?


title: What can Go chan do that a list cannot?

text: I want to know in which situation Go chan makes code much simpler than using list or queue or array that is usually available in all languages. As it was stated by Rob Pike in one of his speeches about Go lexer, Go channels help to organize data flow between structures that are not homomorphic. I am interested in a simple Go code sample with chan that becomes MUCH more complicated in another language (for example C#) where chan is not available. I am not interested in samples that use chan just to increase performance by avoiding waiting of data between generating list and consuming the list (which can be solved by chunking) or as a way to organize thread safe queue or thread-safe communication (which can be easily solved by locking primitives). I am interested in a sample that makes code simpler structurally disregarding size of data. If such sample does not exist then sample where size of data matters. I guess desired sample would contain bi-directional communication between generator and consumer. Also if someone could add tag [channel] to the list of available tags, that would be great.


title: Which one of these implementations is more appropriate for my REST api?

text: ### Background So I have a REST API that allows for client applications to access and manipulate users' data. I'm in the process of writing an Objective-C class for simple utilization of this REST API, but I'm stuck between two methods of implementation. ### Method 1               class MYClient         string username         string password         methods for using GET, PUT, POST, DELETE on questions         // questions are dictionaries with 'title' and 'body' strings      ### Method 2               class MYUser         string username         string password         array  tokens     class MYToken         string title         string body          // classes inherently sync themselves to the server in their initializers, setters, and getters      ### Questions   * Is there one that is more appropriate for use in (for example) iOS apps?   * Is there one that is more appropriate in general?   * What are the distinct benefits of Method 1 over Method 2 and vice versa?


title: Ways to modularize blocks of code in ASP Classic

text: I have one huge file.asp with all my reports. I have modularized the page using querystring, so this creates a lot of "virtual pages" with Report #1, Report #2, and so on. I have some blocks of code I use more than once in the page. Actually I am repeating the code, but I already started to use Function to, for example format the date. But the block of codes are like panels with some selects in databases, tables, and so on... I mean, one panel can have more than 200 lines of code. I would like to create some kind of function to reuse the code, instead of replicate it everytime. With classic asp, how many options I have? One that I have discarted is create one asp file per panel and in a master file include the panel where is necessary. I am really out of this approach. Is the Function the best approach?


title: Best practice/Patterns for two way data synchronisation

text: Quite often in my work the idea of 2-way data synchronisation between database systems crops up. The classic example is two slightly different CRM systems (say, Raiser's Edge and Salesforce) and the need to have a two-way sync of Contact data between them. API considerations aside, assuming you have a shared key to sync on, and purely thinking of the algorithm/pattern to be employed, this is a task that is often underestimated by non-techies. For example, you have to watch out for:   * Can you easily detect which records have changed in both systems (or will you have to compare all records between the systems to detect changes)   * If you're going for a once-every-N-hours sync, how to deal with conflicts where the same record changes at more-or-less the same time in both systems   * If you're going for a real-time sync (ie an update in one system immediately triggers an update to the other system) how to handle divergence over time due to bugs or system crashes Personally I can think of ways to tackle all this but I'm wondering if there are any well known patterns, literature or best practices that I could refer to.


title: Learning Zend Framework 1 or 2?

text: I have programmed for a few years in php and now I'm going to learn zend framwork. Zend is very popular and there are a lot of tutorials, books and documentation out there. But I saw in the last months that there is a second version of Zend, but it's not so used and popular, not yet. I think it is better to start with a new version, but I don't know what to do now, as when I see job offers many people require the first version. Which version do you suggest me?


title: What was the first server-side language

text: I was thinking about different server-side languages and this question immediately cropped up in my mind. What was the first server-side programming language using which websites were being created? Was it java or some other language? Note: I think some languages became prime server-side because they provided or rather aimed to provide better tools and libraries for easy development. I agree Java was not primarly server-side but it provided better tools and hence was and is used a lot.


title: How do I assess tradeoff between robustness and "lazy" code in API design?

text: Postel's law: > Be conservative in what you do, be liberal in what you accept from others. "Lazy" code (per The Pragmatic Programmer): > Be strict in what you will accept before you begin, and promise as little as > possible in return. I'm developing a finance (asset pricing, etc.) framework for Python. Question: when designing the API for the framework, what factors should I consider when I assess the tradeoff between being strict and being liberal re: inputs? Example: I have the following method that downloads stock prices from Yahoo.               def historical_prices(ticker, start=None, end=None, data='d', convert=True):     # Do stuff      For the date arguments (`start` & `end`), I could:   * Be strict, and only allow a string of ISO format YYYY-mm-dd, or   * Be liberal and accept datetime objects, strings (of specified formats), etc.


title: Can I save & store a user's submission in a way that proves that the data has not been altered, and that the timestamp is accurate?

text: There are many situations where the validity of the timestamp attached to a certain post (submission of information) might be invaluable for the post owner's legal usage. I'm not looking for a service to achieve this, as requested in this great question, but rather a method for the achievement of such a service. For the legal (in most any law system) authentication of text content and its submission time, the owner of the content would need to prove:   * that the timestamp itself has not been altered and was accurate to begin with.   * that the text content linked to the timestamp had not been altered I'd like to know how to achieve this via programming (not a language-specific solution, but rather the methodology behind the solution). * * *   1. **Can a timestamp be validated to being accurate to the time that the content was really submitted?**   2. **Can data be stored in a form that it can be read, but not written to, in a proven way?** In other words, can I save & store a user's submission in a way that proves that the data has not been altered, and that the timestamp is accurate? I can't think of any programming method that would make this possible, but I am not the most experienced programmer out there. Based on MidnightLightning's answer to the question I cited, this sort of thing is being done. * * * **Clarification:** I'm looking for a method (hashing, encryption, etc) that would allow an average guy like me to achieve the desired effect through programming. I'm interested in this subject for the purpose of Defensive Publication. I'd like to learn a method that allows an every-day programmer to pick up his computer, write a program, pass information through it, and say: > I created this text at this moment in time, and I can prove it. This means the information should be protected from the programmer who writes the code as well. Perhaps a 3rd party API would be required. I'm ok with that.


title: Getting unicode characters in gVim on Windows

text: What I'm trying to do? I'm using gVim on Windows, and am trying to get something that looks like this. ![alt text](http://i.stack.imgur.com/IqEuN.png) See the indent lines and tab characters? _(check out the link for the big picture if this one is too small)_ I tried a lot of things already, some of them having to do with fonts, some of them having to do with encodings, some of them having to do (it seems) with the current air pressure, and wind speed. But none of them worked.


title: What is the meaning of the sentence "we wanted it to be compiled so it’s not burning CPU doing the wrong stuff."

text: I was reading this article. It has the following paragraph. > And did Scala turn out to be fast? Well, what’s your definition of fast? > About as fast as Java. It doesn’t have to be as fast as C or Assembly. > Python is not significantly faster than Ruby. We wanted to do more with > fewer machines, taking better advantage of concurrency; we wanted it to be > compiled so it’s not burning CPU doing the wrong stuff. I am looking for the meaning of the last sentence. How will interpreted language make the CPU do "wrong" stuff ?


title: What is an exit option in an IT career

text: In management consulting, iBanking...there is a popular term called Exit option. What exactly does this refer to in layman's terms?   Also in an IT career, is the term relevant? For a programmer/ project manager for example?


title: Which Linux distro to pick for volunteering?

text: The number of Linux distributions is large. Someone wanting to volunteer with one of them might have a hard time picking between them, because it's hard to sense the culture, environment, and level of community and esprit de corp. Also, some might be very strict with long processes before you are trusted, or else much looser with a smaller community with more trust. It's hard to tell where to look for information. Maybe one is in great need, and others are well-established with less need. How would I find out who is in greatest need? Joining a Linux distribution's team of writers, developers, testers, coordinators, and administrators is a big decision. This is an extremely sensitive question, and I hope nobody is slighted by either the question or responses.


title: How to convert an html page to pdf using javascript?

text: I am developing a project, In that I have a receipt page (this is the html page that I want to convert it into pdf) and I've to print it. While printing that page alignments are not coming properly. If I convert it into pdf, then pdf only will take care of that alignments thus my work will become easy and effective. I was restricted to use either JavaScript or js libraries only to complete this task. Could any of you please help me?


title: What is the smallest snippet of code that can be copyrighted?

text: Obviously something as simple as `int i = 0;` or `for (int i = 0; i < 10; i++)` can't be copyrighted, but an entire function could be. Where is the line between copyrightable and uncopyrightable?


title: Is an architecture description document a violation of the DRY Principle?

text: The DRY Principle (Don't Repeat Yourself) states that "every piece of knowledge must have a single, unambiguous, authoritative representation within a system." Most of the time this refers to code, but it is often extended to documentation also. It is said that every software system has an architecture whether you chose it or not. In other words, the software you build has a structure and that "as built" structure is the architecture of the software. **Since a built software system comes with an architecture, is creating an architecture description of that system a violation of the DRY Principle?** After all, if you need to know the architecture then you could always just look at the code...


title: New job and my boss is frequently absent

text: So I just started a new position at a great company that is pretty much a dream to work for. The only problem is that there's a steep learning curve for the type of data I will be working with, and my boss/training lead **is never there.** I think he is, after 10 years, experiencing burnout. He's here probably 3-10 hours out of the week, and even then its not a guarantee he's checked-in. I can still contribute in some fashion (I don't need training on programming, per say), but I'm two months in and I still don't feel comfortable in my position due to the lack of one on one time. I can contribute to some projects which I volunteer for, but they're a little outside the scope of my primary responsibilities. I'm worried that the higher ups might view me as slow to adjust. Any suggestions to change this situation? edit: So I took the suggestion in the multiple answers to schedule face time. I did, and it took us about 20 minutes to accomplish a task that should have taken about 5. The reason it took so long? **He was talking about his kid.** FML


title: Improving exception handling?

text: I am a newbie programmer and I recently started learning about exception handling in Java. I know what try, catch and finally blocks do, but I really need to understand how to use them well and where to handle something in the call stack... I have a project right now that involves I/O and all I'm doing is handling the exception in the lowest possible method in the call stack. I'm sure my exception handling can be improved, so I'm asking you guys how you think of exception handling? How did you guys get good at this and how can I better wrap my head around this idea?


title: GIT branch model for derivative work

text: I'm planning on using Vincent Driessen's branching model which I found great for my current development. I think Vincent approach is very general to any development project but I'm finding it difficult to handle the following scenario. I'm working on an application that will be branded to several customers, so each one of my bundles is a different branch that I `rebase` from `develop` branch each time a new build is going to be released. Each brand has its assets (images and text) and they do not conflict with changes in `develop` branch because in that branch I never touch the assets. My question is, now that I'm planning on using it, how can I handle different versions based on the same code base but with different assets?


title: is c or c++ necessary for game programming?

text: Do you need to learn c or c++ for game programming? I am very good with java. Is it true that most game engines are in c or c++.should i learn c or c++ or start making games in java.Can you suggest some books to start with


title: When the shell prints "TBD: create a test thread to print info from the Test object", what does the 'TBD' stand for?

text: I did this after 'make' for some C++ files, and then running one of them. Does anyone know what the significance of the acronym 'TBD' is?


title: Is it bad practice to define/use "Preset" functions

text: Lets say I have an extremely robust and versatile function:   `void DoAnything(action, target, context)` In my program, 90% of the time I call this function, it's with the same parameters:   `DoAnything(eat, food, lunchtime);` Is it bad form for me to define a function such as:   `void EatLunch(){ DoAnything(eat, food, lunchtime); }` And call that instead?


title: How did we get saddled with the (hierarchical) filesystem as the basic data structure?

text: I'm self-taught and I don't have a CS degree. The more I've been learning about data structure, the more I wonder, in this day and age, how are we still saddled with the filesystem, with directories and files, as the basic data storage structure on the OS? I understand the simplicity of it, but it seems nowadays that there could be more options available natively. As far as I'm aware, the only project to improve the basic functionality of the filesystem was ReiserFS, where you could tell what line of a file was changed by whom, and when. For instance, if I could have native tagging for files, where I could tag images, diagrams, word-processing documents, an entire code repository, all as belonging to a single project, that would really be helpful to me. Since I'm stuck in the filesystem paradigm, I know that I could put all those into a single folder/directory, but what if they already exist in disparate directories, and they need to stay there? I know there are programs out there that can do this, but why aren't they on the filesystem? Something that would be nice to have is some kind of relational feature in the filesystem, like you get with RDBMSes. I understand that that was supposed to be part of Vista/7, but that fell off the feature list too. Sure, any program can store a binary file and have any data structure it wants in it, by why couldn't the OS offer more complex ways of storing data, beyond the simple heirarchy of the filesystem?


title: How to present my startup experience in my CV?

text: I started doing Android mobile development (with a partner) sometime ago. I do this in part time. I'm trying to find out how to display this information in my CV, since I believe it is relevant for the development jobs which I'm searching for (not only due to the Java/Android experience that I aquired but also in terms of showing some personality traits). I could place it in the "Professional Experience" section, but I fear that it could "flaky" (i.e. trying to pass a hobby around as real experience). Although it actually is real experience... Any suggestions? Thanks in advance. PS: I'm asking this because I did place it as a normal "job" entry in my CV (it contains a link for the startup's website which contains a description aboutthe product/app, and so on). Last week I had an interview and got questioned on it. Namely, the usage of the "founder" expression seamed to intrigue the HR lady. So I'm wondering if this may raise strange vibes or may look like I'm faking some experience.


title: Is it OK to push my code to GitHub while it is still in early development?

text: I have some projects that are in a very early development state. They are nowhere nearing completion but I do host them (as public repos) on GitHub because:   * I have multiple computers and I want access to my code everywhere   * I want a backup for my code   * I want it to be easy if someone wants to collaborate in some way   * I use GitHub Issues as a poor man's project management software Is it OK to publish a project on GitHub even when it is very early in the development? I am a bit concerned about someone to come by and say `OMG this is total BS, this code is so bad!` while looking at unpolished/still in development/not tested code. What are your practices when you start new public projects? Do you wait until you have something substantial to show or you create a bare repo directly on GitHub and start from there? I used `GitHub` throughout this post but this applies to every code hosting service out there.


title: Why isn't lazy evaluation used everywhere?

text: I've just learnt how lazy evaluation works and I was wondering: why isn't lazy evaluation applied in every software currently produced? Why still using eager evaluation?


title: Saying "no" to people asking questions

text: > **Possible Duplicate:**   >  When do you not give help to less experienced programmers? Currently, I am finding a lot of my day is taken up by people asking domain knowledge/system questions. This impacts personal productivity. Should developers learn to say "no" more to ensure they get asked less questions and be more productive, or should the developers help each other out? Stuff does get documented, but it is often easier to ask a "quick question". How do you handle this sort of scenario?


title: Software patterns for frameworks

text: I am currently doing some research about software patterns and about architectural patterns for frameworks specifically. Google is not really showing off for this topic, so I am curious which patterns would you consider specificially important for the architecture of frameworks? I am focusing on frameworks for web, mobile and desktop software, such as Rails, UIKit, etc.


title: Why does C# have much more features than Java?

text: Please note that this isn't meant to be a Java vs. C# argument. I'm a Java programmer with no C# experience, asking just out of curiosity. I did some reading on C#, and it seems it has much more features than Java. A number of examples:   * Type inference.   * `dynamic` keyword.   * Delegates.   * Optional parameters.   * Lambda and LINQ _(I actually have no idea what these are)._   * Properties. However Java doesn't really feature anything that C# doesn't have. My question is: why does C# have much more native features than Java? And why didn't Java add some of these throughout the years, for example Properties or type inference? Do the Java language designers take a more simplistic approach? What is the reason for this?


title: Is there a real advantage to dynamic languages?

text: First I want to say Java is the only language I ever used, so please excuse my ignorance on this subject. Dynamically typed languages allow you to put any value in any variable. So for example you could write the following function (psuedocode):               void makeItBark(dog){         dog.bark();     }      And you can pass inside it whatever value. As long as the value has a `bark()` method, the code will run. Otherwise, a runtime exception or something similar is thrown. (Please correct me if I'm wrong about this). Seemingly, this gives you flexibility. However, I did some reading on dynamic languages, and what people say is that **when designing or writing code in a dynamic language, you think about types and take them into account, just as much as you would in a statically typed language.** So for example when writing the `makeItBark()` function, you intent for it to only accept 'things that can bark', and you still need to make sure you only pass these kinds of things into it. The only difference is that now the compiler won't tell you when you made a mistake. Sure, there is one advantage to this approach which is that in static languages, to achieve the 'this function accepts anything that can bark', you'd need to implement an explicit `Barker` interface. Still, this seems like a minor advantage. Am I missing something? What am I actually gaining by using a dynamically typed language?


title: How secure is my private repository on bitbucket

text: Does anybody know how secure are my private repositories on bitbucket.org? Can I rely on that? I have some repositories and I only want them to be reachable only by me and two others.


title: Rapid prototyping and refactoring

text: Sometimes when I start a small project (like an android app), I don´t know which approach will work out at the end, and I just go for one approach and give it a try. But if I never used this approach before (for a sort of application I´ve never programmed before) it is like stepping into unknown terrain. I don´t know which libraries to use (maybe I have to try out several libraries) and there are so many unkonwns (like: how to get raw audio data in android) So then my development process goes like this:   * Write a piece of code to see if the approach has a chance. (The more uncertain the approach is, the uglier the code gets)   * If it works, refactor a lot until it is beautiful I think it could be a waste of time if I planned my software design in detail at this point, it would be like planning a trip without a map. Is this part of aglie development? How do you deal with unknown terrain in software development?


title: Are there any existing real time trivia web apps I could contribute to?

text: I want to build a trivia app where people can take part in an in person trivia competition from their phone browser. Like, the question comes up on the screen and everyone can answer from their phone. I feel like this is probably already a thing, and would like to contribute to an existing project instead of building from the ground. But I cant find anything like this. Is there anything like this?


title: "The guard condition is false"

text: On the English Language Learning StackExchange, there is this seemingly simple question on whether you would throw a "be" in with "evaluates to": evaluates to be false vs evaluates to false The "be" is a word that most programmers -- I'd think -- would feel is _"in the way"_. Someone answered that part already. And I probably would not have thought much of this and clicked on... _if_ it hadn't been for the answer declaring the more natural phrase is _"the condition is false"_. That led me to internally consider that what I thought the right words would be in a simplification. _"The condition is **met** "_ ... _"The condition is **satisfied** "_ came to mind. Then I thought about the interchangeability of how we use "condition" to mean "conditional expression" and it made me want to talk about the subtler points. The risk I mention is that if we are to say that conditions are either "true" or "false" is that we have a limited vocabulary. When you have code that says `if (foo - bar)` then you run into problems when you talk about **"the condition"**. I'd say that common usage is that "the condition" mostly refers to "the conditional expression"; this is to say that "the condition" would be `foo - bar`. But even if we think throwing away "evaluation" is okay, then as false values in the language may be different from the logical falseness governing conditional statements, we should prefer "condition is not satisfied" or "condition is not met" unless we really wish to emphasize that an evaluation produced false. In that sense, I do not see "the condition is false" as being a good substitute; if one were to get literal then that might even suggest the code says `if (false)`. English Language Learners does not have a wide programmer audience, so I thought I'd bring the question here for insights. Think of `if (foo - bar)` where foo and bar are integers in a language with a separate boolean type (C++ for instance). What wording is best? When--if ever--is it okay to say "the guard condition is false"?


title: Spring MVC Workflow: multiple configurations for dev, staging and production

text: I'm looking for info about best practices of handling multiple configurations (not to be confused with - multiple configuration files) for seamless development of Spring MVC based app. I come from world of "big" PHP frameworks, where all you have to do is to write confirations specific for each phase (dev, staging, production) in separate files named as framework wants you to (Symfony), or writing one huge config file and dividing it into sections (Zend), and this will actually work. Sometimes you also/additionaly have to put some extra, `vcs` ignored files and it will do. How to handle this in Spring MVC, or Tomcat apps in general? If you're not sure about what I'm talking about, please refer to this article. To clear things up even more:   1. I'm talking (mainly) about `web.xml` and `pom.xml`.   2. I want to have (or maybe what I dream about):      * local configuration - for each developer in team, to run project locally, on `localhost:8080`, displaying full error messages and stack traces     * dev configuration - to run on test server, `dev.example-private.com`, show errors     * staging configuration - client preview, `staging.example-private.com`, nice error pages, send mails with critical errors and stack traces     * production configuration - `example.com`, nice error pages, send mails with errors   3. I don't want to switch configurations manually. I want `spring` to recognise the environment (maybe using `tomcat` config) and use appropriate configuration files. This is mainly because I want to make deployment as easy as merging branches.


title: How to select an appropriate Nvidia GPU for learning CUDA

text: What would be a good GPU to start learning CUDA on? Are any GPUs unsuitable?