Advice: Developing two projects where one is an extension of the other

### The Two Projects I work at a pretty small software company, and I'm currently in a situation where I'm at the end of development for "Project A", about to start development for "Project B". Project B is supposed to be an "extension" of Project A (both are primarily web apps). In Project B, the plan is to not only add brand new features, but modify some of the existing things from Project A; for example, some of the web pages. The difficulty is that we still want to be able to distribute Project A, without any of the features from Project B, but _with_ any "A"-related bug fixes that we end up doing while we work on "B". ### Method 1: Branching The way I'm thinking about it is that Project A is like the "stable" branch and Project B is like the "dev" branch, but "dev" never gets merged back into "stable". We have concerns with this approach because it seems like it will require a lot of discipline to make sure that bug-fix changes are always committed to the Project A branch and then merged up to the Project B branch (as opposed to fixes being implemented on the Project B branch and needing to manually copy them back into the Project A branch). ### Method 2: Plugin Architecture Alternatively, we could start turning things into sort of "plugins" wherever there needs to be a "difference" between Project A and B. This way also seems like it could turn into a tangled mess, since we don't yet know exactly what changes will be needed. ### The Choice Right now, I see it as a choice between the lesser of two evils (read 'difficulties'). Based on your experience, do you have any advice that will help with my choice? Are there any other ways to manage the split between the two projects that I might have overlooked?


Managing false positives in TDD or BDD

I'm relatively new to TDD and have been thinking a lot about how to manage the perpetually growing pool of tests that comes with it. One of my biggest concerns is about false positives. In my experience, it's not uncommon at all for a feature to undergo fairly massive changes over time. To implement a change we would first write a test (or many tests) for the new behaviour and then code the change. Ideally, all the tests would pass once the feature change has been correctly implemented. But what about the tests that covered the first incarnation of the feature? There is no guarantee that:   1. they are still relevant;   2. they still pass;   3. their pass/fail status is even correct. Reviewing/updating/deleting these tests in a relatively small pool of tests may be manageable, but what about when you have thousands or tens of thousands of tests? It seems to me that there is a big risk that your collection of tests will eventually contain many false positives. And, considering that these tests are a form of system documentation, this is pretty bad! **Question:** How do you mitigate the risk of accumulating False Positive tests when applying TDD or BDD (or anything that eventually leads to having a massive collection of tests)?


Using Visual Foxpro DBF with ASP.NET as opposed to SQL Server

I work in a small software company where my boss is a great fan of Visual Foxpro. We are working on an ASP.NET project but my boss is insisting to use Visual Foxpro DBF instead of SQL Server. I want to know what may be the advantages and disadvantages of using a Foxpro database file with ASP.NET 3.5.


What is an algorithmic programming language?

"... You need to understand the core language: is it algorithmic, functional, object-oriented? ..." - Effective Java, Joshua Bloch, 2ndEd. 2008. Foreword, p xiii Functional: Lisp, OO: Java, but what is ( would Bloch mean by ) an algorithmic programming language?


Why do people tend to gravitate to older versions of visual studio?

I'm starting to pick up all of the perks of C++11, and being a 2010 user i'm considering installing 2012 instead for better c++11 support. But why is it that 2012 doesn't seem as popular as 2010? Am i going to be losing anything when I switch from 2010 to 2012? Or is it a more ease of use concern, and a different GUI that pushes people away? I dont want to install 2012 to learn of some big limitations that 2010 did not present to me, thanks for any input!


Question about the use of the word 'porting' in programming

I'm currently in the process of modifying a C++ code that was written for UNIX system so that it works by compiling from Visual Studio. I had to change some built-in functions' names and I had to change the way dynamic arrays are defined. My question is, can I say that I'm 'porting' this code from UNIX to Windows/Visual Studio or is 'porting' used only when changing from one programming language to another (porting from C++ to Java)?


What can you do to decrease the number of deployment bugs of a live website?

I'm sure lots of you have experienced this problem. A website or web application is running and is live. You want to upload the next version, but you haven't figured out everything, like setting a value to false in configuration file, inserting another record into the database, and doing lots of minor stuff which can sometimes count to 20 or more parameters. As soon as you upload the new version, everything breaks. Now, fixing the problem may only take up to 20 minutes, but the overall stress that you tolerate, and the financial and goodwill damage to the company are sometimes not forgettable. What are the ways to reduce these types of bugs which arise from the initial configuration of new version deployment? PS: Please don't mention check-lists, cause we already have them. The problem with check-lists is that, they should always get updated, but they won't.


How do we finish all our stories by the end of the sprint and not after and why is this important?

We are running 2 weeks sprints where the team will just barely finish development by the last day of the sprint but cards are not complete because testing is not finished. The definition of done is really "when development is complete" rather than "when the stories are complete." We have a 1 week delay between the last day of the sprint and the release date. The team does finish the sprint by the release date but that seems like that isn't quite meeting the objective of scrum. The team starts the next sprint the day after the previous sprint ends. I see the following problems:   1. team is not using whole team testing   2. team is not too interested in pair programming or piling on one card at a time.    3. Maybe the stories are too large and we should break them down more so that we finish at a more steady pace throughout the sprint? Any suggestions on how we get the team bought in to finishing the sprint by the end date? Or other ideas? Why do we think it is important to finish by the last day? Why does it matter if the team is still finishing by the release date? (I have my own answers but am curious what others think here.)


Is it a good idea to measure the performance of a method by using unit test timeout?

In a project where there are non-functional requirements which specify the maximum execution time for a specific action, QA must check the performance of this action on a dedicated machine using precise hardware under precise load, both hardware and load being specified in the requirements. On the other hand, some erroneous changes to the source code may severely impact the performance. **Noticing this negative impact early** , _before_ the source code reaches source control and is verified by QA department, could be beneficial in terms of time lost by QA department reporting the issue, and by the developer fixing it several commits later. To do this, is it a good idea:   * To use unit tests to have an idea of the time spent executing the same action² _n_ times,   * To use per-test timeout through `[TestMethod, Timeout(200)]` attribute in C#? I expect several problems with this approach:   * _Conceptually_ , unit tests are not really for that: they are expected to test a small part of a code, nothing more: neither the check of a functional requirement, nor an integration test, nor a performance test.   * Does unit test timeout in Visual Studio measure really what is expected to be measured, taking in account that initialization and cleanup are nonexistent for those tests or are too short to affect the results?   * Measuring performance this way is ugly. Running a benchmark on any machine¹ independently of the hardware, load, etc. is like doing a benchmark that shows that one database product is always faster than another. On the other hand, **I don't expect those unit tests to be a definitive result, nor something which is used by the QA department**. Those unit tests will be used just **to give a general idea** about the expected performance, and essentially **to alert the developer that his last modification broke something, severely affecting performance**.   * TDD is impossible for those tests. How would it fail, in the first place, before starting to implement code?   * Too many performance tests will affect the time required to run the tests, so this approach is limited to short actions only. Taking in account those problems, I still find it interesting to use such unit tests if combined with the real performance metrics by QA department. Am I wrong? Are there other problems which makes it totally unacceptable to use unit tests for this? If I'm wrong, **what is the correct way** to alert the developer that a change in source code severely affected performance, before the source code reaches source control and is verified by QA department? * * * ¹ Actually, the unit tests are expected to run only on developer PCs having comparable hardware performance, which reduces the gap between the fastest machines which will never be able to fail the performance test, and the slowest machines which will never succeed at passing it. ² By action, I mean a rather short piece of code which spends a few milliseconds to run.


How should I implement my chosen software license?

I have always kind of wondered, but never took my time to actually ask these questions regarding licensing. Most of these questions are presumably pretty basic, but I have no idea what I'm dealing with here. The thing that baffles me the most is how exactly you "implement" the license for your OSS. Is just saying in the post you're publishing the code on, "by the way, this is licensed under GPL" enough? Or should something more delicate take place, like registering the software somewhere? Also,   * If I just say I use a particular license, is that enough?    * Do I add a copy of the license to the distributed code?    * Am I required to add a header on every file detailing the licensing information? Do I manage this with my version control system (e.g. Subversion)?   * Is the above not enough?   * What are the most commonly used software licenses?   * Are there any gotchas/licenses that are better left alone?


Use of pdb file in release build executables

This question is appropriate only for programs created on the windows platform. If I build a release of my program with the /Zi option (create pdb file and store path to file in exe) then I don’t have to ship pdb file with release but we could retain for internal use. The pdb file would be retained for our internal Quality Assurance use. Then if a crash occurred, we have a system of printing the stack trace at the point of crash and this 'system' would have access to the exe symbols and we would get a nicely populated stack track in this file. But there is a slight complication in that the final executable is created by a separate build dept in our company. We developers can of course create a release build. My query is that one of my colleagues is saying that the exe built by build team would be different from a release build created by us in development. But I don’t understand why? Is my colleague correct? If so why? And if so does this mean my plan for using pdb files with release builds is not possible?


Building a Live Auction component

I am looking to integrate a live auction component (similar to BigDeal.com) to a website. I generally program using PHP. What is the best plan of action with this type of project (Timer, live bids..)?


What are the bytes between the MSB and LSB named?

I've searched around and can't find anything on what the middle bytes of a >16-bit integer are called, if anything. **Are there standard names for these bytes?** E.g. the number `0x0D0C0B0A` would have:               MSB ??? ??? LSB      0D  0C  0B  0A


Why use string.Empty over "" when assigning to a string object

I've been running StyleCop over my code and one of the recommendations SA1122 is to use string.Empty rather than "" when assigning an empty string to a value. My question is why is this considered best practice. Or, is this considered best practice? I assume there is no compiler difference between the two statements so I can only think that it's a readability thing? UPDATE: Thanks for the answers but it's been kindly pointed out this question has been asked many times already on SO, which in hind-sight I should have considered and searched first before asking here. Some of these especially forward links makes for interesting reading. SO question and answer Jon Skeet answer to question


Upcoming Google interview, looking for some preparation advice

Well I've been hitting the books wherever I can. I have an interview coming up, first one via phone, for a software engineer position. I've read all the blog posts, I've read all the accounts of interviews (some pretty old), and Google itself even suggested a reading list of books, none of which would surprise anyone here. Still, after some time preparing, I can't shake that feeling that there is such a large ground to cover, and I'm never sure whether to go with depth or breadth. I've found myself re-learning a whole area of compsci, only to forget most of the nitty details as I move on to another. So, I don't know that there's a good answer to this question, but I'm looking for any practical advice on how to tackle the remaining weeks in advance of the interview. Part of my brain is tired from cramming, and of course the rest of it has to be utilized for some tough problems at my current place of employment.


Fiction that includes BASIC programs

Back in what must've been the mid-80s, when every microcomputer included BASIC and Choose Your Own Adventure Books were really popular, there were some novels that had BASIC programs listed in the text, for you to type in and further enjoy. For example, as I recall, in one of these books, the adventurers were infiltrating an undersea base (and eventually wiped the bad guy's data storage [I do believe it was a hard drive, even though they were uncommon then]). One of the programs involved a game were you piloted a submarine and had to avoid or shoot sharks. The code was in BASIC; minor changes (such as 'CLS' -> 'HOME') had to be made for your specific computer, and it used good old 40-column text-mode to display the action. IIRC, the plot never depended upon the programs. My question is, does anyone else recall these sorts of books? Do you know any titles that I could look for, or of any online? I am toying with the idea of writing a story like this (no, not in BASIC!), and would really like to see how it was done, back in the day.


What is "egoless programming"?

I first heard this term about fifteen years ago. My understanding is similar to that described in the Wikipedia article and a TechRepublic article: you work with your colleagues in a "friendly, collegiate way in which personal feelings are put aside". It includes things like doing peer reviews with mutual respect and a desire to learn, and not feeling like you "own" code, so if somebody has a suggestion or says there's a bug or needs to change it, you don't get defensive about it. I've also thought it was largely about having an attitude that makes for good relations with other programmers with the goal of improving the code. So I haven't seen it as being incompatible with taking pride in the quality of your work or feeling regret if something you did caused your customer a problem. However, an answer to a recent question makes me think some other programmers have different understandings about "egoless programming". So what is the correct definition? And what are its implications?


What is the job of a language virtual machine, and creating one

Recently I have become incredibly interested in language development. The past few weeks I have written many language front ends (lexer, parser) including a calculator language/expression parser and much more. After creating so many things I have realized there MUST be more abstraction between parsing and code execution than what I currently have, which leads to my main question(s). My first question is, this. What exactly is the job of a language virtual machine, like for example the JVM (of course my envisioned system would be much, much much more smaller scale). What does it do? Does it actually sort of emulate hardware and execute low level instructions on the emulated hardware? Or does it simply provide an abstraction and execute lower level managed instructions on the system? (I have read this question but it hasn't really helped me understand) Second question. What exactly is byte code? Is it some sort of machine code for the virtual machine? Or is it the human readable possibly assembly like instructions, and are these instructions directly executed or somehow compiled to native code? Third question. How would I go about implementing this? I consider myself a competent programmer and don't need step by step instructions by no means, just an overview of what exactly I need to be doing, and how low level this is exactly. Thanks so much for any help/suggestions/explanations. Please ask questions if something I stated was confusing or you need more detail on it. Thanks again!


What is Development Environment? e.g. Vagrant

By luck i landed on this website http://www.vagrantup.com/ It is says, that software is for development environment. My question is what exactly definition for development environment (in this case is vagrant)? I wondering what vagrant can give benefit to me as PHP web developer, my current thoughts for development environment is Web Server. Is that right?


Using a public username as a login username

It has just dawned on me, that a system I am developing exposes a users username in the URI. This is a problem, since some of the users pages are public. Therefore people will know their username. I thought that this would be a security issue, but then realised that big names like twitter do the same thing. Pretty much every single twitter user has their username on full display. If a big name like twitter see it as safe, should I also assume the same?


Prevent developers from using constants

I have one one software system which allows developers to specify an ID or name to create `NodeReferences`. Both work fine, but ID's are not guaranteed to be the same across different environments. I've tried in documentation and in conversations to stress that ID's should not be hard coded (since they will break when deployed to a different environments), but some developers are still using them. This works only in dev environment:               var level = LevelReference.ById(20);     var node = NodeReference.ByName(level, _patientGuid.ToString());      This works in all environments:               var app = ApplicationReference.ByName("Reporting");     var area = AreaReference.ByName(app, "Default");     var level = LevelReference.ByName(area, "Patient");     var node = NodeReference.ByName(level, _patientGuid.ToString());      I think the appeal is just that it produces fewer lines of code. The use of ID's is not by itself bad (since there are valid use cases like caching the ID returned from the server and using it later for faster look-up), but hard- coded ID's are bad. Most of the time the first code will throw an exception, but it's possible that it could be a valid ID for a different object than the developer intended, and this could result in very bad problems. What's the best way to discourage the use of such constants in code? Ideally I'd like throw some kind of compiler error when I see code like the first example, or at least throw an exception before the call gets down to the database.


Which languages are used today for low-level programming?

When I hear low-level programming, such as for drivers, embedded systems, operating systems, etc., I immediately think about C and perhaps C++. But mainly C. But what other languages are also used for these kind of tasks? Today, I mean, not what _has been_ used.


Should QA file 5 separate bugs or one bug with multiple parts in it?

The question might not be as simple as it sounds, as we have struggled with this a bit. If there are 5 separate bugs, which can be taken care of with a single fix, then it is wasteful to take this approach. One bug might slip through the cracks, and would take away from a complete picture, or just be hidden for some time (we have several years worth of outstanding bugs, and our bug tracker sucks at searching :( ). Now, if you file a bug of 100+ parts (such as help tooltips are missing from all 234 dialogs), then it should be treated as a project and be broken down. However, if it is a bug of 3-4 parts, then the developer would attempt to fix all 3 or 4 at once. This is where it gets interesting. What if the coder only fixes 3 or 3.5 out of 4? Should after testing a new bug be filed and old one closed? If yes, then this invites sloppy programming practices, where close enough is good enough. If the bug is to fail, then all of it has to be re-done and re-tested. Now ... what if part 1 is the size of a breadbox in terms of size and risk, part 2 is more like a car, part 3 is like a house, and so on :) When sizing and prioritizing this bug (I must mention that we use Scrum), the house part was not noticed - who reads anything but a bug title anyway? So, it was deemed a low hanging fruit - low effort, low risk, happy user = high reward. But, we got bitten with one of them recently. What seemed to be logically the same area, was actually code in transitional state, where we are trying to deprecate one method of doing things, or one library for creating widgets with another, new and better. The problem is that we had to release mid-conversion, so we made two very different beasts look alike. Our QA folks did not know that, are not expected to know that, and so in their mind these are all the same issues. We need to be QA-friendly - not to push back too hard or too often, but also try to give a set of heuristics which would help to decide whether to file one bug or many. I suppose the problem might lie with weak tools, where splitting and merging bugs is hard to do. However, how do you deal with this stuff in general? P.S. In Scrum - once you committed to fixing something, it probably should be fixed. Break this rule too many times and discipline will degrade.


Tool to manage requirements throughout a software development lifecycle

I am looking for a tool to manage requirements or features for a software development project. It will be used by a small geographically diverse team of 5-10 people to raise, discuss and track requirements. Consequently it will need:   * Support for multiple users   * Web-based   * Support a hierarchy between requirements, e.g. parent / child relationship   * Provide a means for discussing individual requirements   * Support file uploads   * Cost effective. Ideally free or  Some of the project management tools available are overkill or focus on tasks or resource scheduling rather than features / requirements. Does anyone have a solution?


Is this a poltergeist or is it justified?

I've come to a point in re-design of my code where I face an imminent Poltergeist Anti-Pattern threat. A master application object has two "eye" objects. Eye objects have a "RenderHUD" function, which is supposed to use (a) the state of the eye object, and (b) the state of the application object to render the HUD at each frame. I have a function right now that derives the HUD info from the application object, and then passes these as arguments to the "RenderHUD" function of each eye. The problem is that these argument lists are reeaaaaly loooooong. Obvious solution is to put them all into a struct, e.g. HUD_Info. But that would be a new poltergeist that would be created and destroyed with each frame, right? Any easy way to avoid that?


Learning YACC nowadays, does it make sense?

I have a huge project that is using YACC and I would need to fix a bug in it. I might ask someone else who wrote that to fix it but I'm interested in how compilers work. Does it make sense to learn YACC nowadays? It was told me that it's old and obsolete. I would love to understand how compilers/llvm and other stuff like those work... what about YACC?


programming algorithm - bulls and cows game

I am working on a Bulls and cows game. And I have the following code that calculated the number of bulls and cows: let User and comp be the lists that have the 3 digits that the user entered and the number randomly generated by the comp               cows = 0          bulls = 0          for x in User:              if x in comp:                  if comp.index(x) == User.index(x):                      bulls += 1                  else:                      cows += 1      This works completely fine, unless the number generated by the computer has repeated digit(like 277) and I enter 447. then what happens is that I get 1 cow and zero bulls. Whereas I should get 1 bull and 0 cows. **Note that there is no issue with the game when there are no repeated digits.** I am unable to get what the problem is and why it is occurring. I would greatly appreciate any kind of help in understanding the root of this problem. **more importantly** I want to get this done with. So I want a clarification on this approach or I want a new way to think about this. I am using Python Tkinter to program this game. **please** help me with this issue.


will having an event with subscribers prevent an object from being GC'ed?

I have an object, which has an event which in turn has subscribers. I know that the subscribing objects won't get GC'ed since the delegate they stored for the event is connected to them, thus keeping them connected with the object graph, until one explicitly unsubscribes them. This is only logical since otherwise nothing good will happen when the event is fired. **Does this apply to the Event-owner as well?**   I would _think_ it does not, since the subscribing objects do not have a connection to it, to my knowledge. And again using common sense (which I know does not neccessarily relate to IT-reality): Nothing bad can happen if the event-owner is GC'ed, only the event will never fire (again). **Is this assumption correct?**


Is MongoDB the right choice in my case?

I'm going to build my first real project in Rails that consist in a web app made of 3 main parts:   * The static part where no database is used   * The User registration part which will require a database and I can use MySQL since each user's row will have the same fields   * The "App" where users will be able to create, organize, edit... items in collections and share them with other users There will be several item types and each one will have different options for example I may have "video" items with the following options:   * id   * user_id   * collection_id   * title   * platform (if embedded)   * url (if embedded)   * file name (if hosted on my app)   * file size (id hosted on my app) and "map" items:   * id   * user_id   * collection_id   * title   * platform (google maps, bing maps...)   * location   * url   * map size As you can while for users I may use MySQL for items the flexibility of MongoDB may be useful since each item may need different options then another item Up to now I've always used PHP and MySQL (always on shared hosting for small projects) and scalability is a totally new word for me. I have time to learn but I would like to be able to do something concrete in something like 1 month. I've read a lot about MongoDB and NoSQL vs RDMS and MySQL and after trying it I have to say that I like how MongoDB works: no tables, no rows and its documents JSON like so:   * In my situation what would you raccomend? why?   * About scalability there may be problems with MongoDB? if yes when (in term of DB size) and may these problems slow down my app considerably? **Edit: how the app will work** Since many asked this is how I'd like the app to work:   1. A user sign up   2. He's logged in   3. He create his first collection iside which he can create infinite items   4. Items are of various type and each type need different data to be saved in the database and type of items may be added or modified  Users may create other collections and items inside it. So we have CRUD for collections and items inside of them and each collection/item is referred to a specific user The main problem with MySQL is that it hasn't a flexible schema, there is way to solve this (a workaround?)? Thinking about NoSQL the only doubt I have is about join, for example given a certain colection I want to retrieve datas related to the User with id = user_id field in the collection **EDIT: Idea to keep using MySQL** Create a field in the "items" table with optional settings, each setting divided by a | or another symbol. Then I will save somewhere a structure of each item optional settings, for example the "notes" item type need two optional settings "colour" and "strange_setting", when I get the data from MySQL i will split the field for optional settings into an array knowing that the first item in the array is for "colour" and so on. What do you think? there are problem with that solution? do you have other ideas?


which is better of these two architectures and why

PhpServer will handle gSoap requests and http requests from clients.   PushServer will push notifications to clients and act a file server. There are many server machines. Every PhpServer will communicate with a specific PushServer when needed. Every PhpServer needs to register itself to a PushServer letting the PushServer to help push notifications to clients. Here are two architectures:   1) Architecure A   This architure will run each PushServer with a PhpServer on the same machine. Each client will register itself to a PhpServer and the PushServer which is running on the same machine with the PhpServer                                     |Database|                           _____|_____                          |           |                          |           |                   (|PhpServer| + |PushServer|)   //a same server machine                           \            /                             |Client|      2) Architecture B   This architure will run each PushServer on a single machine. Each client will register itself to a PhpServer and the PushServer which the PhpServer registers.                                     |Database|                           _____|_____                          |           |                   (|PhpServer|)  （|PushServer|） //two server machines                               \            /                             |Client|      Which architecture is better and why? **[update]**   We are worried about performance, extensibility, and flexbility. Actually the first achitecture is what we currently have and if we choose the second one, we need to modify our software: PhpServer, PushServer and Client. Thus, unless the second network architecture is much better (from load-balancing or network application design perspective), we won't choose the second one.


Verification & Validation books

So I need some help with Verification & Validation of software. So I know the definitions of both but ... I can't really find any real entry level books about the process from setting up the requirements of a customer, to making the finished product. And of course, making sure you tested it to what you think it should do, and what the customer actually wants. Can anyone recommend me any good entry level books, blogs, pretty much anything that just gives an overview of V&V? I'm pretty much just looking for concrete methods/examples on how to deal with all. I have looked, and found some good (advanced, if you ask me) texts scratching the surface of V&V, but nothing entry level :( Any help is greatly appreciated.


Should I support IE compatibility mode?

So I have a client that is running multiple versions of multiple browsers. I currently support IE7, IE8, IE9, Firefox4/5, Safari 5 and Chrome. The site works in all the named browsers. IE has a feature called 'compatibility mode', the current bane of my existence. The problem is that in compatibility mode, form buttons work differently. I won't get into the details but it would be a major effort to make the site support 'compatibility mode'. Is this something that there are frequent requests for? Am I off my rocker to push back on the client and tell them this just isn't an option?


Should I rely on Visual Studio in adding HTML and CSS?

I am wondering if I should rely on Visual Studio in adding HTML and CSS elments by using the viusal toolbars or should I write them by myself? Is it considered bad practice if I relied on Visual Studio to do that?


Would you contribute to open-core software?

I recently considered contributing to an open-core software (a product which core is released with an open-source license by the company that developed it, but it retained a paid license for more advanced functionality). But some questions occurred about the nature of working with an open-core project, and I would like the input of the community. My question is would you still be motivated to contribute if:   * most if not all the software was contributed by paid developers.   * you'd be benefiting the finances of one company (opposed to benefiting the community)   * the direction of the software would be determined by the company and not by you (or the community). I would like also for someone to confirm if those are myths or not   * implementing the same features that are sold by the company won't be allowed.   * forking the project won't be allowed (it might depend on the open-source license). Thank you. ps: Could someone create an "open-core" tag?


Why doesn't HTTP have POST redirect?

HTTP redirects are done via HTTP codes 301, and 302 (maybe other codes also) and a header field known as "Location" which has the address of the new place to go. However, browsers always send a "GET" request to that URL. However, many times you need to redirect your user to another domain via POST (bank payments for example). This is a common scenario, and really a requirement. Does anybody know why such a common requirement has been neglected in HTTP specification? The workaround is to send a form (with parameters in hidden fields) with action set to the target location (the value of the **Location** header field) and use `setTimeout` to submit the form to the target location.


distribution of programming languages in embedded systems

I am looking for statistics concerning the distribution of programming languages in the embedded sector. Do you know any good websites, articles or books? I found this as a first reference but am still looking for further information: http://www.eetimes.com/electronics-blogs/industrial-control-designline- blog/4027479/Real-men-program-in-C?pageNumber=0 I need this for my bachelor thesis which is about programming the HAL of microcontrollers using OOP.


How important is it for programmers to look and behave smart?

I know that looking and dressing good is of vast importance in fields like sales, marketing, and human resources. But is it really important for developers, even when they aren't directly contacting clients or third parties? Can a developer get away with dressing shabbily, and still get the raises he deserves on the sole basis of his coding skills?


Loading next level after complw=etion of previous

i am creating a hangman game in visual studio using C#. how can i load 2nd level after 1st one is completed.


Style bits vs. Separate bool's

My main platform (WinAPI) still heavily uses bits for control styles etc. (example). When introducing custom controls, I'm permanently wondering whether to follow that style or rather use individual bool's. Let's pit them against each other:               enum EMyCtrlStyles     {        mcsUseFileIcon = 1,        mcsTruncateFileName = 2,        mcsUseShellContextMenu = 4,     };          void SetStyle(DWORD mcsStyle);     void ModifyStyle(DWORD mcsRemove, DWORD mcsAdd);     DWORD GetStyle() const;          ...     ctrl.SetStyle(mcsUseFileIcon | mcsUseShellContextMenu);      vs.               CMyCtrl & SetUseFileIcon(bool enable = true);     bool GetUseFileIcon() const;          CMyCtrl & SetTruncteFileName(bool enable = true);     bool GetTruncteFileName() const;          CMyCtrl & SetUseShellContextMenu(bool enable = true);     bool GetUseShellContextMenu() const;          ctrl.SetUseFileIcon().SetUseShellContextMenu();      As I see it, **Pro Style Bits**   * Consistent with platform   * less library code (without gaining complexity), less places to modify for adding a new style   * less caller code (without losing notable readability)   * easier to use in some scenarios (e.g. remembering / transferring settings)   * Binary API remains stable if new style bits are introduced Now, the first and the last are minor in most cases. **Pro Individual booleans**   * Intellisense and refactoring tools reduce the "less typing" effort   * Single Purpose Entities   * more literate code (as in "flows more like a sentence")   * No change of paradim for non-bool properties  These sound more modern, but also "soft" advantages. I must admit the "platform consistency" is much more enticing than I could justify, the less code without losing much quality is a nice bonus. **1\. What do you prefer? Subjectively, for writing the library, or for writing client code?**   **2\. Any (semi-) objective statements, studies, etc.?**


What is some key aspect of C/C++ I need to know?

I had some C background back in the university, however, I have been programming in java for 2 years and most of the C stuff were left behind. Now I need to prepare for a test about C/C++, I doubt that I can go right into it with only some remnant of C knowledge. What could they possible cover in the test?


Moving a multi-GB SVN repo to Git

Currently my company has a Visual Studio solition in an SVN repo that's organized as follows:               SolutionFolder (~3.5 GB)     |-> SolutionName.sln     |-> .. Some source code folders... (~250 MB)     |-> ThirdParty (~3 GB)     |-> Tools         | -> Tool1         | -> Tool2      Tool1 and Tool2 are build independently (have their own solutions), but produce executables that are used in the main build. ThirdParty folder contains all dependencies for the project, including some pre-compiled 100+ MB .lib files and large libraries like boost. It's convenient to have it all in one SVN repo so that (1) developer has to do only one check-out, and (2) we don't need to keep track which versions of dependencies we need for each version of the build. On the flip side, it takes a while to check out this repo. What would be the best way to move this project structure to git? Presumably it's best to exclude ThirdParty and possibly Tools from the main repo, but we'd like to keep ThirdParty easily downloadable in one step, and we like it versioned (and version mismatches between main repo and ThirdParty/Tools would be bad). At this point I'm not interested in preserving history, just in figuring out how to organize such project.


Preventing a Javascript object function called twice

I am trying to reuse an object but my function is getting called twice. Here is what I have:               var KEYBOARD = {       template: 'keyboard';       getkeyboard: function(){         console.log(this.template);       }     }      now in one file I do this:               $.extend(KEYBOARD, {         template: 'keyboard',      }).getKeyboard();      then in a different file I do:                $.extend(KEYBOARD, {         template: 'keypad',      }).getKeyboard();      Now in the second file the getKeyboard function prints out:               keyboard     keypad      Can someone please tell me what I'm doing wrong? I thought I could change the properties and run them through the function, but for some reason it holds the values of the first object.


A new CAPTCHA using sentences?

I was just thinking about how recaptcha is getting harder when I thought about another posible solution. Images won't last forever so we will need something else some day - like human logic or emotion. Google and others are trying grouping images by category (find the image that doesn't belong) but that requires a large amount of images and doesn't work for the blind. Anyway, what if a massive collection of text was gathered (public-domain books from each language) and a sentence was shown to the user with 1 (or 2) words that were a select box of choices? Only computers that knew correct English/Spanish/German grammar would be able to tell which of the words belonged in the sentence. Would there be any problems with this approach? I would assume that it would be easy enough for anyone that knew the language that the sentense was displayed in to figure out the answer easier than trying to read the reCAPTCHA text. Plus, storing an insane number of sentences would only take a couple gigabytes of space and wouldn't take anywhere near the CPU time creating images/audio takes. In other words, anyone could host their own captcha system with minimal impact on system performance. **Is there a problem with this approach?** More specifically I'm looking for the main problem with this approach. migrated from stackoverflow


Django web app with websockets

I want to make a web service using Django, but that also has websocket functionality. Having done a bit of reading, this is the tech stack that I'm looking at:                  ---------------------------------       | Django (handling sync requests) |        ---------------------------------                       |                       | (wsgi)                       |      -------------------------------------     | Tornado (handling websockets, wsgi) |      -------------------------------------                       |                       |                       |      -------------------------------------     | Gunicorn (spawning tornado workers) |      -------------------------------------                       |                       |                       |      --------------------------------------     | nginx (reverse proxying to gunicorn) |      --------------------------------------      So the sync requests (website, most API calls) would go all the way through the stack to Django, but the websocket requests would be serviced by Tornado directly (websocket calls would be distinguishable by the URL). Am I overcomplicating this? I've added the Gunicorn layer because a single tornado worker would block while servicing a WSGI request, but perhaps there's a way around this? I only ask the question because it seems like a lot of layers to me. Does this look like a reasonable way to do Django with websockets?


Numerous Sync/Async calls to webservice from hybrid app

I have a requirement where I have to make numerous calls to webservice to update the local database. Since I have to support lower-end Android phones also, I'm not yet sure as to how this would be possible without actually exhausting the device memory and eventually crashing the app? Possible issue: Consider I have to sync 100 records to webservice and each of them have particular set of results returned and local database operations linked with it. The problem I am facing right now is, if I use synchronous calls the memory issue become major one and app crashes and if I use asynchronous calls, the app takes too much time and also recognising data returned will be a huge difficulty. **Platform** : iOS + Android **Technology** : AngularJS + Phonegap **Webservice** : RESTful **Note** : Please note that I am using purely front-end technologies and this would be a hybrid app.


How do you deal with the details when reading code?

After reading some projects, I find that it is not the architecture of the software that is really hard to know. It is not hard to figure out the architecture immediately if the project is clearly designed and implemented, if it's hard and never seen before, some day later I can find out some pattern similar to the one I read in the same domain. The difficulty is that the concepts and mechanism defined by the author are really hard to guess, and these concepts may spread in the whole project which makes it hard to grasp. The situation is normal and universal and you can ask questions to your colleague when in a company. However, it gets worse if nobody around you knows these details. How do you handle these details which block your reading?


Share data layer for outsourcing project

We are a small team of programmers, and we are now facing a situation where we have to outsource some of the work in order to complete it in time. Project is about website that was previously build with asp.net webforms, EF and SQL server. We have previously build a data layer and optimized SQL, but we need to complete front end of the project. Clients wants asp.net MVC and HTML5. The problem for us is how to open data layer to outsourcing team without compromising or disclosing any data?


Should one define an interface and code an adapter for it whenever a dependency is found?

Given a particular third-party class/library you want to make use of, the simplest thing to do would be to just hardcode API calls to it through your application. On the other hand you have the possibility of defining a interface that generically dictates what you want -not _how_ -, and then follow the Adapter pattern to bind your interface to the third-party class. I currently feel inclined to the second option because:   * It creates a single point of change if you ever want to replace the functionality provider   * In a similar way, it allows you to add more providers without changing your application code   * It permits following your own naming conventions, simpler method signatures, etc The thing is, I'm not experienced with this approach and I don't know how complicated or inconvenient it can get. I'd also like to know if are there any common errors when following this pattern. In my particular case I don't want to wrap either a giantic library -e.g. a GUI- or a small function. Also there are actual possiblities I'll change my provider in the future, so this is not a YAGNI. Thank you


Could it be more efficient for systems in general to do away with Stacks and just use Heap for memory management?

It seems to me that everything that can be done with a stack can be done with the heap, but not everything that can be done with the heap can be done with the stack. Is that correct? Then for simplicity's sake, and even if we do lose a little amount of performance with certain workloads, couldn't it be better to just go with one standard (ie, the heap)? Think of the trade-off between modularity and performance. I know that isn't the best way to describe this scenario, but in general it seems that simplicity of understanding and design could be a better option even if there is a potential for better performance.


What Java client+server stack to allow async client info popups and responses?

Being new to Java I'd like to use the following scenario to steer my learning and could use some advice! First I want to build a Java server app that handles login and client settings, and based on client info pulls up random database entries and sends these random entries to the client on a timer. This must work for many clients, each on their own private timers against the main database, and just keeps looping on timers so it's not a one-shot lookup. Second I want the client to stay logged in all day, and to notify and maybe popup locally with the info from the server. This popup will be a small input form which is then sent back to the server. I can't do this as a web page because I want it to run any time the client wants to start the local app. This could possibly be used as a calendar, meeting planner or schedule notifier for clients which are my user stories. Suggestions on appropriate design patterns and techniques appreciated!


Is there value in having new developers (graduates) start as testers / bug-fixers?

Hi **Programmers** Community. What are your thoughts on the following:   _Is there value in having new developers (graduates) start as testers / bug- fixers?_ There are two schools of thought here that I have come across.   1. Having new developers (graduates) start as testers / bug-fixers / doing SLA (Service Level Agreement) work, get's them familiar with the code base. It also allows them the opportunity to learn how to read [other people's] code. Further more, by fixing bugs, they will learn certain bad and good practices, which could hopefully help them in the future.   2. The other way of thinking though, is that if you immediately start new developers on something like testing / bug-fixing / SLA work, their appetite for the development world might go away, and/or they might leave the company and you potentially loose out on a great future resource. Is there a balance that should be kept between these two? Currently where I work there is no clear-cut definition of what new starters do. Some go directly on to client work, while some fall in to the SLA world. Should companies have such a policy? Or should it be handled on a case-by-case or opportunity-based basis? Hope to hear from some of you that have experience in this field. Thanks!


What is the best way to do development with git?

I have been searching the web for best practices, but don't see anything that is consistent. If you have an excellent development process that includes successful releases of your product as well as hotfixes/patches and maintenance releases and you use git. I would love to hear how you use git to accomplish this. Do you use branches, tags, etc? How do you use them? I am looking for details, please.


Question about API and Web application code sharing

This is a design question. I have a multi part application with several user types. There is a user client for the patient that interacts with a web service. There is an API evolving behind the web service that will be exposed to institutional "users" and an interface for clinicians, researchers and admin types. The patient UI is Flex. The clinician/admin portion of the application is RoR. The API is RoR/rack based. The web service component is Java WS. All components access the same data source. These components are deployed as separate components to their own subdomains. This decision was made to allow for scaling the components individually as needed. Initially, the decision was made to split the code for the RoR Web application from the RoR API. This decision was made in the interests of security and keeping the components focused on specific tasks. Over the course of time, there is necessarily going to be overlap and I am second guessing my decision to keep the code totally separate. I am noticing code being lifted from the admin side being lifted, modified and used in the API. This being the case, I have been considering merging the Ruby based repositories. I am interested in ideas and insight on this situation along with the reasoning behind your thoughts. Thanks.


General thought process for "How would you build this website/app" interview questions

I've collected a bunch of interview questions like "Describe how you would design a photo album application", "Describe how you would design this particular feature of this particular website" (e.g. likes on Facebook, recommendation on Amazon, shopping cart, game of black jack). Then, what if there are millions of this thing? What would you change? It looks like this is either expecting a database schema or a bunch of class definitions (or both?). I have learned about databases in school but I've never actually architected an application before and am having trouble knowing where to start, whether the designs I come up with are "good" and what I can change to make it scalable. Is there a general approach or thought process when designing these systems? And general issues/problems that seem to come up a lot in the design that I should try to avoid? Could someone maybe walk me through one (or preferably all, while comparing the needs of each) of these and explain: 1) How do you come up with what entities are needed? 2) How do you decide on what relationships everything will have? 3) How do you incorporate performance optimization into your design? 4) Do I do this using classes or databases? Does it make a difference (i.e. would I have a class that can't really be translated to a database table, for example?) The main reason I'm asking is because I was going through "Cracking the Coding Interview" and my answers were completely different from the author's - I had very different ideas of what classes were important. **MY ATTEMPT:** With the photo sharing app, I would have the classes/tables: Photo and User for sure. Then, I think if we're trying to create a schema, there would be a table linking photo and user if we assume each person in the photo is linked to the photo (is this table necessary? If not, is it still common practice to have a separate table for many-to-many relationships or not?). But if we're trying to take an object oriented approach, maybe instead we'd have a class called album which does all the work and has all the info from the two other tables/classes. This is one thing I noticed in the book- there are a bunch of classes and then one class which basically has all the info and connects the other classes- is this common? For example, in my examples above, does this seem like it would apply? I'm just hoping for some general rules/guidelines to follow because right now I have no idea how to tell what a good architecture for a large system looks like.


Are functional languages a kind of program derivation?

Program derivation is defined as the derivation of a program from it's specifications. Usually this specification language is some form of propositional logic, but from what I understand, it need not be. For the sake of specificity, I'm only dealing with purely functional languages like Haskell here. When you write a program in Haskell, you aren't describing _how_ the computation is done, but what things _are_. For example, in this function that produces Fibonacci numbers, all this is given is a specification for Fibonacci numbers, not how the function should be implemented.               fib :: int -> int     fib n = (fib n-1) + (fib n-2)     fib 1 = 1     fib 0 = 1      To make this code run, the Haskell compiler must convert this declarative specification of the function to imperative machine code. Isn't this by definition a kind program derivation?


What is the importance of XML in the world of JSON?

How important is it to learn XML when JSON is able to do almost all that I need? Having said that, I use JSON mainly for AJAX requests and obtaining data from various APIs. I am a total newbie to web development and the reason I am asking this is that I want to know whether I should go ahead and buy a book on XML or whether I can just give it a pass.


Will official 'Mango' release allow sideloading of apps on WP7 devices?

Any news whether the official Mango release will allow sideloading of apps? I mean ability to deploy apps without going through the MarketPlace? I would like to see the ability to deploy my own apps on my own device without using third party services and paying extra fees. I don't plan to publish apps publicly. (I tried ChevronWP7 and it couldn't work as intended. Probably obsoleted by MS.)


Builder pattern inside interface. Bad design decision?

I am having trouble evaluating an implementation of the builder pattern I just came up with. The context is an API library, so I am trying not to expose any implementations in order to have a stable interface while being able to change implementations later. My thinking is that even though there is a reference to the implementation in the interface's _file_ , the interface and the implementation are not actually coupled because > In effect, a static nested class is behaviorally a top-level class... The benefit of this design is that clients can call `Person person = new Person.Builder().age(20).firstName("John") .lastName("Doe").build();` without the need for a dedicated Factory type class. Am I missing something or is this a valid design decision? **Person.java**               package net.mhi.rd;          public interface Person {              int getAge();         String getFirstName();         String getLastName();              public static class Builder {             int age;             String firstName;             String lastName;                  public Builder age(int age) {                 this.age = age;                 return this;             }                  public Builder firstName(String firstName) {                 this.firstName = firstName;                 return this;             }                  public Builder lastName(String lastName) {                 this.lastName = lastName;                 return this;             }                  public Person build() {                 return new PersonImpl(this);             }         }         }      **PersonImpl.java**               package net.mhi.rd;          class PersonImpl implements Person {              private final int age;         private final String firstName;         private final String lastName;              PersonImpl(Person.Builder builder) {             this.age = builder.age;             this.firstName = builder.firstName;             this.lastName = builder.lastName;         }              @Override         public int getAge() {             return age;         }              @Override         public String getFirstName() {             return firstName;         }              @Override         public String getLastName() {             return lastName;         }     }


Is Perl outdated for CGI and FCGI?

When we did web development in 1996 it was CGI, FCGI and Perl on the backend. Now why is Perl not that popular anymore and instead we use Java, Python, Go, PHP, C# and everything but Perl? To me it seems that Perl should be good since it has had long time to mature. What happened that causes Perl to lose its applicability as server language?


In MVC software, who should load the models?

I'm working in a REST JavaScript client, and I'm trying to follow the MVC pattern, but a very basic question came to my mind: who should make the http request and load the data into the model? My intuition tells me that the controller should do it, but in lots of examples (the ember.js documentation, by example) it's done by the model, with a find() method. But other frameworks, like Django, do it in the controller. What do you think it's the better way to do this?


Subversion permissions and Visual Studio projects

I have a quite specific question regarding Subversion structure, different permission levels and Visual Studio projects and solutions: We develop a framework with external partners with functionality the partner is not allowed to see. Consider following structure of a VS solution: example.sln   |_ /unit1/unit1.csproj (incl. cs files)   |_ /unit2/unit2.csproj (incl. cs files)   |_ /unit3/unit3.csproj (incl. cs files) unit1 and unit2 belongs to the framework, unit3 is specific (secret) functionality. Framework is functionally without unit3 (which will be shipped as dll). My question now is: How can this project be structured if the two parties should have a functional development environment, example.sln references unit3, but our external partner won't have this part because of the SVN permission. We, of course, have full access to the repository. I hope my request has become clear... Am I one a wrong track with my question? **EDIT:** Thanks to this answer I see clearer. Last question: How to implement different solutions for different groups so that each group can only check out their solution:   * two sln files in one directory with different permissions   * two directory trees for each solution with links to the shared projects?


Ways to present testing results

I'm doing a school project which requires us to create a computer application and then write documentation; therefore I have to write testing documentation, I already have a of test plan (Validate all input and test all features) but how do I present the testing results in my project (e.g. table etc.)?


TFS merging - how to track what changes go into MAIN?

I'm new to TFS branches, and have opted to set up a \Dev and \Main branch (ultimately there will be release branches too). I'm using TFS2012. My understanding is that I will work on the \Dev branch on a day to day basis. When a bug is fixed or a user story is completed, I will merge \Dev to \Main, build, and give that to the tester. In \Dev I have a policy to ensure that check-ins are associated with a work item. However when I merge from \Dev to \Main, and check-in that merge, what would I associate that check-in with, if anything? The reason I ask is because I'm wondering how someone could find out what changes went into a particular \Main build? It's obvious in \Dev, as you'll see the associated work items in the build output. But there will be no such history in \Main, unless I associate the merge check-in with some sort of work item. The tester needs to know what's gone into a particular \Main build, but how? Is it a manual process, where the developer simply gives him a list of changes that have been merged into \Main? I've read the MS branching/merging guidance, but it doesn't really shed light on this kind of thing.


How are undocumented functions discovered?

I've always wondered how do you find **undocumented / private** API ? Example the _Apple_ undocumented / private API, _Play Station_ , _Windows Phone 7_ , _Win32 Kernel_ , _Windows API_ , _hidden callback_ , etc... What tools do hackers use to find out about private and undocumented functions? Where can I read about peoples' experiences delving into private APIs and reverse engineering techniques which reveal the secrets which are normally explained in API documentation? thanks,   A


How do Data Scientists Use Python?

Do you know how Data Scientists use Python and if it requires data, where I can get sample data to practice with? I'm currently learning the language and plan on applying for Data Scientists jobs, so it would be helpful if I knew if there were specific types of tasks where I'd use python. If it's relevant, I use C# regularly.


What are the most known arbitrary precision arithmetic implementation approaches?

I'm going to write a class library for .NET which provide an implementation of arbitrary precision arithmetic for integer, rational and maybe complex numbers. What best known approaches should I become familiar with? I tried to start with Knuth's TAOCP Vol.2 (Seminumerical Algorithms, Chapter 4 – Arithmetic) but it's too complicated. At least I couldn't get the ideas in a relatively short period of time.


Why is Java boolean primitive type name not 'bool'?

Java has   * `int` and `Integer`   * `boolean` and `Boolean` This seems a bit inconsistent, why not either   * `bool` vs `Boolean` to use an established shorter name for primitive type? or   * `integer` vs `Integer` to keep type names consistent? I _think_ C++ had decided to use `bool` quite a bit earlier than Java decided to use `boolean`, and maybe also some (non-standard at the time?) C extensions too, so there would have been historical precedence for `bool`. I've noticed I often instinctively try to use `bool` at first (good thing modern editors immediately spot this without extra compilation round), so it'd be nice to know the rationale behind current state of affairs. If someone remembers (a part of) the story, or can even find and link to relevant historical discussion in the net, that would be great.


Objected oriented application exit

We are writing a program that does a standard "auto update software on startup". If the software finds an update ready, it will start the update process and then exit (and not run the program). We have two different designs on how to write the logic of the update. Design 1: Let our AutoUpdate class handle everything, including exiting the program if required. Design 2: AutoUpdate does most of the logic, and if it wants the program to exit, it returns a value indicating this, and the Main() takes care of exiting. code wise, the main function would look like: Design 1 (AutoUpdate exits internally if required)               Main()     {         AutoUpdate.DoAutoUpdate();         RunMainProgram();     }      Design 2 (AutoUpdate returns true if it needs to exit, Main handles the exit)               Main()     {         if (AutoUpdate.DoAutoUpdate() == false)         {             RunMainProgram();         }     }


Cost of design based on the cost of programming

What is your methodology when you need to determine the cost of UI design if you know the cost (work hours) of programming in some project? Let's say, programming of logic in some project cost X dollars. Is there some general percentage (like 30% of programming costs) which can help determine the cost of design? The area of interest is mobile phones development (mainly business tools and 2D games, not 3D at all). There is less design work here comparing to a web design or a PC game design.


What are the IEEE and ACM good for?

Membership in the IEEE and ACM is sometimes portrayed as a sign of professionalism. But all that is involved, as far as I can tell, is sending them your money. In return, besides the potential resume line, these organizations sponsor conferences and journals. I can always attend a conference or subscribe to or submit a paper to a journal, whether I am a member or not. If being a member makes some of that cheaper, or is a prerequisite for admission then OK, but I still don't see the purpose of these organizations. * * * The answer, as far as I can gather, is that their most important value is to provide some reading material. I'd suggest that this is not worth the money given the wide availability of other valuable reading materials.


OOP, domain models, and the user

When developing domain models, I can see two major ways of thinking about the user:   * The first one assumes that a program is a kind of "simulation" of what happens in the real world, and the user is an spectator. With that approach you would have a Customer class -for example- with perhaps methods that correspond to the actions a Customer can perform. Whenever the customer wants to do something, the corresponding method is called.    * The other approach would be to design the classes as if they were exposed to the user and s/he then has the ability to create and play with the objects “directly”, thinking of the program as a kind of extension of the user’s reality. With this approach, a Customer class would probably make no sense as the customer is already “involved”.  I've read some articles talking about adding security at the method level, which seems to be consistent with the second approach, but I believe the first approach is far more popular. What's the best way to deal with this? Thanks.


what is the concept behind sstatic.net?

Question is pretty simple. whenever i login to stackoverflow or some sites i get lots of http://sstatic.net/ type like request. What is the whole concept of this? How does it help to speed up a website?


How to limit time period to another period?

For a project planning I have an initial period, lets call it `PPStart-PPEnd`.   The planning is associated with a project. This also has a period `PrjStart- PrjEnd`. PrjStart and PrjEnd are fixed, and can be unbound, i.e. the project start time or end time are not defined. `PPStart-PPEnd` should be adjusted so that people can only plan tasks in the valid project period. If that changes the duration, fine.   How do I efficiently limit `PPStart-PPEnd` to `PrjStart-PrjEnd` without having to go over all the possible combinations?   Maybe first detecting overlapping periods is a good start? 4 examples on a time axis ([-- = bound, <\-- = unbound):               Project planning period:                                   [---PPStart-PPEnd---]     Project periods relative to ppp:                                                                       [---PrjStart-PrjEnd---]   PPStart should be set to PrjStart, PPEnd unchanged                          [---PrjStart-PrjEnd---]                  PPEnd should be set to PrjEnd, PPStart unchanged                          [---PrjStart-PrjEnd------------------->  No adjustments         [---PrjStart-PrjEnd---]                                   PPStart should be set to PrjStart and PPEnd to PrjEnd.      Cases like that last one make it complex.


What is the main job of a team leader?

* In a project following agile programming model what is the main job of a team leader?   * What are the job differences between team leader and project manager?


When is Java a good choice for web development? Please do not say "When you have a development team that knows only Java."


JavaScript Class Module: How to avoid an antipattern

I've seen a number of different methodologies when it comes to applying class- based inheritance to JS/ECMA-based projects. Over the past several months, I've been applying IIFE Namespaces to my class models when I need classes. This results in a little extra boilerplate code that is easily abstracted for highly dynamic classes. _(Make note that I only employ classes when they indeed fit the task.)_ In general, I see classes employed in one of the following 4 ways: **Constructor:**               function MyClass(arglist) {         this.property = value;         this.method = function(){};     }      **Prototype:**               function MyClass(arglist) {         this.property = value;     }     MyClass.prototype.method = function(){};      **Object.create**               Object.create(MyClassPrototype, {prop-list});      **IIFE Class**               MyClass = (function(){         function MyClass(arglist) {             this.property = value;         }         MyClass.prototype.method = function(){};              return MyClass;     }());      Obviously, there tend to be some support functions to reduce keystrokes, such as `extend()` and/or `inherit()` helpers. Let me be upfront that I don't generally like the most accepted class libraries _(for various reasons)_ , so I've been experimenting with my own methodology. What I've come up with is the following: **Class Module**               (function(Class){         //Private Static Property         var staticProperty = value;              //Public Static Function         Class.staticMethod = function(){}              //Potentially allows for static construction         Class.create = function(config){             //Public Object Member             this.property = value;         }              //So the constructor actually works.         Class.prototype.class = Class;         //Public Object Method         Class.prototype.method = function(){};              //Allows it to be assigned to a var or Namespace.         return MyClass;     }(function MyClass(){this.class.create.apply(this, arguments)}));      What I'd like to know is, what are some potential pitfalls to this pattern? Here are some of the advantages that I think this pattern has:   * The use of private statically scoped functions. In my own experience, this can dramatically improve performance by taking functions out of the constructor that don't need to either a) be there, or b) don't make sense as closures.   * The ability to use new(), static create(), Object.create() as desired.    * Doesn't break any standards-required functionality for classes (i.e. `new`, `instanceof`, `typeof`, prototype chain, `constructor`, etc.)   * Give every object a reference to their current "class". Not necessary for many things, but I always seem to want it when it doesn't exist.   * Can utilize the class as a facade for multiple classes without breaking logic or flow. While I haven't used this a lot, it's extremely useful when I do.   * Hoisting different methods at different times can adjust the benchmarks according to the need for the specific class. For instance, if I need it to construct objects faster, I can hoist a constructor method to the private static level. In contrast, if I need a particular method to perform faster, I can hoist a prototype method to the private static level.    * Nesting classes is simple   * Since scoping is so important to JS security, usability and performance metrics, I find this to be the most flexible.   * I personally find it to be very readable (in general). At a glance, I know whether a method is public or private, static or object.   * Finally, though very rare, sometimes I need the "class" to have different behaviors when not actually interacting with an object. This pattern allows me to do this with one simple check. My question here is, since I am quite biased toward this pattern when implementing Class-like behavior, what pitfalls should I be aware of to avoid this becoming an antipattern? Are there any clear reasons to avoid this pattern entirely, aside from bias or convention?


Should I learn Javascript before Coffeescript?

I'm a reasonably experienced programmer trying to learn web developement. I'm trying to develop a client-side web application which uses svg or canvas for graphics. I've decided I'd like to write the application code in Coffeescript. I don't know either Javascript or Coffeescript. How necessary knowing Javascript to Coffeescript web development? Am I likely to hit some gnarly problem which requires me to understand Javascript? Can I work happily with Javascript APIs from Coffeescript? **Edit** : I could easily learn the basics of Javascript in a week. I'm more concerned that Javascript seems to have a lot of hidden sharp edges. In the strangest language feature question on StackOverflow Javascript is one of the most common languages. It has an unusual object and class model. It has non- obvious name scoping rules. I find it takes more than a week for me to really know a language. I'm going to work on a small simple project to learn web development. Would I be better off to use Javascript or Coffeescript? I think in the long run I'll prefer Coffeescript but I'm willing to start with Javascript if that I'm going to need a thorough understanding of Javascript to use Coffeescript.


ASP.NET Webforms developers and web designers: how to interact?

I'm an ASP.NET Webforms developer, and I face some problems when I deal with designers. Designers always complain about the `asp.net server controls`. They'd rather just have an html file and create `css` files along with the required images to go with those. Sometimes, if the design phase is done in advance, I get html files with related css files, but then we face many problems integrating the design with the `aspx` files (sever controls an telerik controls ... etc). What I want to ask about is:   * How do I overcome these problems? The designers prefer php- and mvc developers because of the problems with .net server controls. I need to know how to interact with the designers in the correct way.   * Are there any tools or applications to provide the designers with the rendered (html page) of the .aspx pages? By that I mean the page in runtime rather than the aspx in Visual Studio. They do use Web Expression but they want the rendered page in html as well.


What does "flatten" mean?

If I had a tree, would "flatten" intuitively imply > get a list of all items in the tree, traversing from left to right? If i have a linked list, would "flatten" intuitively imply > get a list of all items, starting with this one For example, a linked list would be made up of an exception that aggregates its inner exception. Would it be fair to name a method on exception "flattenInnerExceptions" with expectation that it would return a sequence of exceptions, outermost exception first, and inner-most exception -- last?


Importance of having technical architecture knowledge as a developer

I am a junior developer (half a year out of university) currently working in a small project. The project team size about 30. I am wondering how important it is for us developers to know about the technical architecture (hardware, network, etc.) of solutions. I don't think that I can do side-projects for small firms without a strong TA background. Are there books where I could learn more on software TA and the like?


Looking for web languages performance comparison

Not to long ago I was here on stack overflow and saw this great diagram of programming languages performance comparison, and now I can't find it...   Does anyone have a similar comparison? The two I'm most interested in are PHP vs Python.


What could be used to get data from server to android as fast as it reaches server?

What is the best way to get data from server as fast as it gets to it? (Like instant message, or simple broadcast for example). I first thought about using miniature web server in android and get post requests to it with data. However with this approach I soon understood that I will get many problems with NAT and similar issues. Later I thought about manually pooling the server from android, but it seems somewhat flaky approach to problem, because data is got in irregular intervals (like image with some text). I was thinking about using something like webrtc or rtp to have connection between server, but these approaches are somewhat complex and half baked. I found very little info on those about data operation. Thought I managed to get in my „experiments“ video and sound transfer, I found very little info how to get data transfers. What should I do? Now I am thinking about having some connection to server and getting some events in android, which when I got update in server could download everything from server. Update: My data is encode64 processed html5 canvas png image. Probably I will add to it some text data to blob. It is generated on webpage it should reach phone as fast as it can through server. The problem is part where image data goes from server to phone. Data size per request is ~50KB.


Are programming languages pretty much "stable" for now?

Recently i have looked at the " **timeline** " of Programming Languages and while a lot has changed in the past 5-10 years, there are a lot of languages that have pretty much "stayed" the same in their niche/use. For example, let's take C language. We don't really ever see much languages being developed (correct me if i'm wrong) to try to Unseat C. However, there are a lot of languages that try to do similar things (look at all the SQL/No- SQL languages) Scripting Languages, etc... Is there a reason for this trend? Or is it just because C was designed very well ? and there isn't really any need for new once?


How often should a Scrum team meet its Sprint commitment?

Commitment is a promise, and we all have been taught that you need to keep your promises. But is it realistic to keep the commitment for each Sprint? Sometimes people get sick, sometimes the technical approach is proven wrong and you have to rethink everything, sometimes during further discussions with the product owner or the users you understand that the feature should be very different from what was originally thought. I know that the official Scrum Guide now uses the word "forecast" rather than commitment, probably to address these problems. So my question is how often do teams in your organizations keep their commitment and whether you like this approach or you want to change it. Thank you.


Representation of data in application versus database

I'm going to make an application that will be given data to put in a database. The data will for the most part be the same, but the way it is formatted will vary a lot (could be in anything from text files to .xls to .doc).   I'm not a very experienced developer, but I can see some potential issues and I want to minimize them.   First off I have decided to use the DAO pattern, so that I can easily support new file formats or file suddenly formatted in different ways.   What I really wonder about though, is how I should manage the data itself within my application. I'm thinking that the database DAO should have models representing each table of the database with the same relations between them, to make the uploading process easy. But should the filesystem DAO's have to use the same models? I can imaging that when the database changes, the change will suddenly propagate throughout the entire system, all DAOs and models alike. And that is obviously a bad thing. I'm a little bit tired and out of time. Will update with what ever questions you have. Thanks!


Does a vm implemented in garbage collected language need a garbage collector?

This is more of a theoretical question. If jvm is implemented in go which itself is a garbage collected language, then does that jvm need a separate garbage collector to be implemented for its own operation?


in doubt of using code generators

I am now entering the world of java ee 6. And I am supposed to used different technologies like jsf, jpa, different kinds of beans and all that stuff. I am learning using the netbeans IDE, which is, I should say, very efficient when it comes to getting the work done. It is just that, I came from the old school servlet programming environment using scriptlets on them jsp pages where you get to write every line and every request parameter/attribute you have to set manually. which is somehow good because you get to understand you program THAT WELL. but with this java ee 6, with the code generators from NETBEANS, I get to create controllers, jsf pages and entities without writing any code (taken aside the DB part though). I do understand the flow of the application but not to the degree that I can understand what the line does, how does it reached, what are the use of the variables and what does it do after. all the nitty gritty stuff. to make it short, I am using generators without REALLY understanding the code that well (mostly on the new tags by jsf). I just want to ask if this is a bad path/practice or is it ok because we want PRODUCTIVITY?


Could I GPL this code?

I'm working on reviving a C++ codebase that hasn't been touched since '97. It's academic software for text analysis, and originally it was non- functional, it wouldn't even compile. I fixed the code so that it works, and added some new functionality of my own. I'm doing this privately for someone else, and they will pay me over a student contract. I signed nothing with them, so ultimately, my work belongs to me. Given that they agree (I don't want to be rude), would I be able to relicense this code under GPL, and post it on a site like GitHub? The current license is as follows: > Copyright (C) 1997, Carnegie Mellon University. All rights reserved. This > software is made available for research purposes only. It may be > redistributed freely for this purpose, in full or in part, provided that > this entire copyright notice is included on any copies of this software and > applications and derivations thereof. > > This software is provided on an "as is" basis, without warranty of any kind, > either expressed or implied, as to any matter including, but not limited to > warranty of fitness of purpose, or merchantability, or results obtained from > use of this software. Seems like I would have to include that notice as well.


Would copyrights drop if I re-write open source project into another language?

I have re-written an open source project from java to haxe, then from haxe compiled to javascript, with totally different UI So, the question is, is the code considered to be mine after rewriting it to another language in a closed source project? can I use it freely with no worries about original copyrights?


Is procedural programming the root of all object oriented evil?

If you read Working Effectively with Legacy Code, Clean Code, Refactoring: Improving the Design of Existing Code and Design Patterns you will get what I mean. Many of the examples and topics discussed in these books aim at improved the quality and design of the code. It is my observation that most of the problems mentioned in these books revolve around turning a procedural or semi procedural code to a well structured object oriented code. Think God objects, long switch cases, hard coded dependencies,..etc. What actually drove me to ask such question is that I often hear people talking about functional programming and that it good to learn such languages even if you are doing object oriented programming as it affects your mindset and perspective of the code. So to keep the topic constructive, focused and objective as much as possible:   1. Is there any studies or evidence that learning procedural programming before object oriented programming leads to the infamous object oriented anti patterns?   2. Does the same problem occur when learning OOP after FP?   3. Is there a proper/proven way to approach OOP in general to avoid most of its pitfalls?


Architectural problem for Activity communication in an Android app

I maintain an open source Flickr app Glimmr for Android. There is currently an architectural issue around pagination that I've been trying to solve for quite a while, and would appreciate ideas. Here are the components involved:   1. Tasks - various subclasses of AsyncTask that fetch photos from sources such as a users photostream (LoadPhotoStreamTask), photoset (LoadPhotoSetTask), etc.   2. PhotoGridFragment - a fragment that displays photos fetched by the Tasks in a grid. Subclasses of this exist matching each task, e.g. PhotoStreamGridFragment, PhotoSetGridFragment, etc. The grid is paginated, so that when the user scrolls to the end of the photos, the task is triggered to go and fetch the next page of photos.   3. PhotoViewerActivity - responsible for displaying a list of photos from the grid in fullscreen. This is started from the PhotoGridFragments with two pieces of info, a) the list of photos currently in the grid, and b) an index at which to start viewing at. The issue arises when the user reaches the end of the list _from within the PhotoViewerActivity_. This activity does not have the info required to start the correct task and update the list of photo's it has been passed. I want to figure out a way of doing this while keeping the coupling between the PhotoGridFragment and PhotoViewerActivity as low as possible. People who are familiar with Android will know that because we're dealing with two separate Activities, all communication between them must take place via Intents with data having to be persisted or serialised. Afaik the PhotoViewerActivity can not easily call back to the Grid and ask for more photos. Things are complicated by the fact that each task requires different pieces of state and info to do it's work. e.g. a LoadPhotosetTask requires the set id, LoadPhotoStreamTask requires a specific user but doesn't care about sets, etc. So just passing the task name required to fetch more photos to the viewer activity isn't enough. Another solution could be to abstract the common pieces of functionality from the PhotoViewer into an abstract class, and then create specific photo viewers for each source, similar to the way we have specific PhotoGridFragments for each source. This feels overkill, but is probably the solution at the front of my mind right now. How would you solve this?


How do login systems work?

I assume that when a user registers at a site, the password and username are stored inside of a database. I've read that the password is often encrypted using a salt. So, is it safe to encrypt the passwords with a salt and to save it in the same schema with the username? Secondly, how does authentication work? Companies like Google have giant databases of username/password pairs. How does validation work so quickly, and how is it implemented?


PHP OOP - Getters / setters vs. database storing

### Problem I am trying to optimize the architecture of my web-application developed in PHP using the Symfony framework. I have an object "pool" that contains "swimmers". I need to display the number of swimmers in my pool, but only those with a pink bath-suit. In order to do this, I see many possible approaches : ### Approaches   1. Create a custom getter method in my Pool class, and filters the swimmers by bath suits color :              public function getSwimmersInPinkSuit() {         for each($this->getSwimmers() as $swimmer) {             if($swimmer->getBathSuitColor() == "pink") {                  $pinkSwimmers[] += $swimmer;             }         return $pinkSwimmers;     }      > {{ pool.getSwimmersInPinkSuit | length }}   2. Create a custom SQL query in my controller, define the number there before sending it to my template.   3. Add a "$pinkSwimmers" property to my Pool class, and increment/decrement it with an eventListener every time I persist in database the event "a pinkSwimmer joins/leaves the pool". I then can access the value where i want : > {{ pool.pinkSuits }}   4. Use a denser twig request to filter out the pink swimmers directly in my template > {{ pool.swimmers.suitColor("pink") | lenght }} // If that's even possible o0 ### Question In the four propositions above, I see pros and cons to each of them, so :   * What is the best practice in this situation ? Am I overseeing a better logic in addition to the ones mentioned above ? I try to find an implementation that would be lightweight in term of performance (memory, bandwidth), but also easy to reconfigure (change from pink to green suits, or from suit color to swimming style).


Event Driven Programming?

I have been looking into event driven programming in C and the language doesn't seem to have support for it. This has led me to wonder about the nature of event driven programming. Is it correct to say that an event handler basically spawns a thread that waits for a response from I/O and sets a variable? Or is there something more complicated to the process.


A startup as a web-application then later extended as mobile application. How to do it properly?

I have this idea that I want to build. I want to start the idea as a web-app, then move into mobile-app and possible desktop application. The project should have databases (mostly strings). Also users would have accounts and access to these databases. So the project provides access to the user-resources through the Internet. I want the database easily accessible through different platforms. The project is also to sharpen my IT, so I don't want the easy road, but the better one.   * What are my best options of frameworks/skills?   * Good tools to manage the project?   * Is starting as a web-app a good choice, or should I build it as a mobile-app first? I have some knowledge (but not a lot of experience) in: C, C++, Java, PHP, Javascript, MySQL, HTML/CSS. Edit: I know that my question is too general, all I wanted is some ideas and guiding to have a good start. @Nathan Taylor, regarding the web-app, I don't mind any option (should I learn Python, or stick with php in this regard)? I'll probably implement the project in Android, and possibly iPhone.


What is the appropriate Data URI to use for 0-byte content?

I have a method that generates a data URI from a byte array. In the event the input byte array is empty, what is the appropriate thing for the method to do? Here are the options I see:   1. return `data:,`   2. return an empty String   3. throw an Exception By my read, RFC 2397 doesn't explicitly address the notion of empty data.


Tail-recursive implementation of take-while

I am trying to write a tail-recursive implementation of the function `take- while` in Scheme (but this exercise can be done in another language as well). My first attempt was               (define (take-while p xs)       (if (or (null? xs)               (not (p (car xs))))           '()           (cons (car xs) (take-while p (cdr xs)))))      which works correctly but is not tail-recursive. My next attempt was               (define (take-while-tr p xs)       (let loop ((acc '())                  (ys xs))         (if (or (null? ys)                 (not (p (car ys))))             (reverse acc)             (loop (cons (car ys) acc) (cdr ys)))))      which is tail recursive but needs a call to `reverse` as a last step in order to return the result list in the proper order. I cannot come up with a solution that   1. is tail-recursive,   2. does not use `reverse`,   3. only uses lists as data structure (using a functional data structure like a Haskell's sequence which allows to append elements is not an option),   4. has complexity linear in the size of the prefix, or at least does not have quadratic complexity (thanks to delnan for pointing this out).  Is there an alternative solution satisfying all the properties above? My intuition tells me that it is impossible to accumulate the prefix of a list in a tail-recursive fashion while maintaining the original order between the elements (i.e. without the need of using reverse to adjust the result) but I am not able to prove this. **Note** The solution using `reverse` satisfies conditions 1, 3, 4.


When would dynamic scoping be useful?

With dynamic scoping, a callee can access the variables of its caller. Pseudo C code:               void foo()     {         print(x);     }          void bar()     {         int x = 42;         foo();     }      Since I have never programmed in a language that supports dynamic scoping, I wonder what some real world use cases for dynamic scoping would be.


Abstraction concept in OOP

I hear that Abstraction is a technique that helps us identify which specific information should be visible, and which information should be hidden. Encapsulation is then the technique for packaging the information in such a way as to hide what should be hidden, and make visible what is intended to be visible. I understand Encapsulation well... A simple example would be a Method that calculates calories based on the parameters we provide. CalculateCalories(x,y,z) Here I don't know how this method calculates calories but I can call it to calculate the calories. Abstraction is what I am confused about. What are those techniques that Abstraction uses to help identify which specific information should be visible, and which information should be hidden? Or am I misunderstanding the concept? Could anyone give an intuitive example?


PHP coding practice

I'm a self taught PHP programmer. Because I have no formal training in PHP, I often find my coding style to be considerably different than example code I find on the Internet. I've slowly started adapting some of the more common practices I find. However, before changing my habits, I try to find a good reason to use the new style. I just don't see much reason to change my habit if it isn't actually advantageous. I see a lot of people write PHP code such as :
<?php echo $cTitle; ?>

<?php print $cContent; ?>
      Whereas I generally write :               <?php         echo "
", $cTitle, "
";         print("
" . $cContent . "
");      What I'm seeing is that people are commonly going in-and-out of PHP, while I'll just use PHP to print/echo the html content along with the PHP variables. Is there a measurable difference between these two methods? Is there a good reason for me to change my ways?


How is Nothing a subtype of every other type in Scala

I am taking Martin Odersky's coursera course on functional programming with scala, and for now I have learned two things that together don't make sense:   1. Scala doesn't support multiple inheritance   2. `Nothing` is a subtype of every other type These two statements cannot live together, so how exactly is this done? and what exactly is the meaning of "subtype of every other type" **Edit 1** In the Scala API, `Nothing` is defined as `abstract final class Nothing extends Any`... so how can it extend other classes?


Why big companies use Perforce?

I heard about some big companies e.g. Google, Facebook use Perforce Are there any reason why SVN/Git cannot replace Perforce?


Promoting scalability in small business applications

I am part of a small software company that specializes in small to medium- sized business applications and my experience with distributed architectures/SOA is limited. Please let me know if I'm going about this all wrong. We often start development on small business applications, where a distributed architecture seems like overkill and will not be implemented as such. However, in some cases, the project expands way beyond the original scope, and the preferred solution may later become a distributed one. How do we ensure from the very beginning that this transition becomes as smooth as possible, with a minimum cost of performance and (primarily) time? Specifically, I'm looking for advice in regard to the architecture of the solution in order to achieve this. Take this simple example:   * At first a windows application is running on several computers, invoking all business logic locally in an assembly that is distributed along with the application.   * Later, the business logic is moved to a central server, and the windows application must now communicate with the business layer through a WCF service. The obvious answer here would be to just create the WCF service from the very beginning and have it run locally on each machine, but my initial thought was that this could cause undesirable time consumption on projects with strict deadlines, due to increased overhead in development (having to maintain the intermediate layer(s) etc.). One of the concrete problems with the initial architecture is that instances of objects are passed from the windows application to the business layer, thereby creating a dependency that could break code when moving to a distributed solution. By 'simulating' a distributed solution, we could ensure that our developers aren't unintentionally introducing these sorts of issues.   * What is the best way to achieve this scalability?   * Am I wrong in my assumptions regarding time consumption and performance?