The best approach to building a mobile service that's also available when the connection drops?

Hopefully this question will be a good suit for P.SE since it is a whiteboard- level 'how can this be done' conceptual question. I'm trying to build a product that needs to be available to someone on the move with a mobile device when their connection may be quite poor (due to travelling between cities where 3G coverage is stronger). For simplicity, let's say the application is an address book. The user must be able to add/remove/edit all contacts in the address regardless of connection state, then those changes iterated to a central server DB whenever the connection next becomes available (and any changes made on the server since the connection dropped also downloaded). I was originally building the application with PHP/Symfony working with static pages but this new 'mobile' requirement has made me re-think my front-end technology. I'm now looking at using EmberJS for my frontend (download all the necessary frontend templates with the initial request, then only update the dynamic parts seems like it would suit my application better than serving an entire static page (and resources) for every request). I've been implementing Ember-Data with the standard REST Adapter which is working great with my already-existent Symfony2 API, so I've greatly reduced the amount of data being sent/received and the responsive 'feel' of the app but still need to tackle my 'no-connection-available' scenario. Instinctively, I'm drawn to HTML5's LocalStorage functionality but can see synchronizing data between the localstorage and central DB server being a gigantic headache. Let's say I add "Bob Smith" to the address book from my mobile when the connection is up. The connection drops. I change the name to "Bob Jones" and then change the name to "Fred Smith" using a desktop with a stable connection. When the mobile re-connects, which update takes precedence? I saw this question regarding using multiple data adapters (REST and LocalStorage) with Ember and it looks like I'm in for a world of hurt. Should I just build a nice-responsive version of the app/service with Ember/REST Adapter, then roll native mobile apps for the on-the-move version? Will handling data persistence be easier to handle as a native app?


How to split up ASP MVC Project using Code-First Entity Framework

For an academic exercise, we have been tasked with creating a small website. We have already gathered the requirements and fleshed out the business domain to see the classes we are supposed to support. It is to be on Microsoft stack, so I decided to use _ASP MVC_ with _code first Entity Framework_. I am now looking for the best way to split up a 6 man team in order to best tackle the project. **TLDR:** What are some effective ways of splitting up an ASP MVC project so that multiple developers can work on it concurrently? I have researched where projects have been split across the tiers, i.e. _database, business, views_ , and such, but I don't exactly know how to instruct them to go about designing a view for which there is no controller. Is splitting it up between the different business models used a decent strategy? I have read that this has led to an application that didn't mesh well, due to the different aesthetics.


When is a number a magic number?

Over the last couple of months I have been diving into coding standard IfSQ. As a part of this IfSQ standard, a rule is to not use `Magic Numbers`. While I don't have a problem with building this rule into checks as FxCop or StyleCop, I am confused as to what actually IS a Magic Number. According to Wikipedia there are 3 explanations of magic numbers:   1. A constant numerical or text value used to identify a file format or protocol;   2. Distinctive unique values that are unlikely to be mistaken for other meanings (e.g., Globally Unique Identifiers);   3. **Unique values with unexplained meaning or multiple occurrences which could (preferably) be replaced with named constants.** I am focussing on the third meaning. But this is also where I am stuck. Seeing as I am trying to build this in a FxCop rule; the check has to be automated. But what am I supposed flag as magic number? The IfSQ standard explains the following as magic numbers: `Numeric literals (other than 0 or 1) have been embedded directly into the source code. For example "34" or "86400".` But this doesn't sound good to me at all. This would mean I'd have to flag every single occurence of a number other than 0 and 1. Numbers like 24 (hours), 60 (minutes) and 100 (percentage) are, in their correct context, no magic numbers; in my eyes that is. Because this is will be an automated check, looking from things in a contextual way isn't really possible. Based on this I have the following questions:   1. How should I define a magic number?   2. Is it possible to define magic numbers without context?   3. Should I skip certain statements when checking for magic numbers?


Why Java doesn't make use of encapsulation with some classes?

My question is related with `System.in` and `System.out` classes (there might be others like those in the Standard library). Why is that? Isn't that a bad practice in OOP? Shouldn't it be used like: `System.getIn()` and `System.getOut()`? I've always had this question and I hope I can find a good answer here.


Backlog item with preparation for future sprint Scrum

I'm currently at the beginning of a build. We are requiring a lot of back end functionality around Clients/Users/Groups/Roles. However, these aren't required for Sprint 1 which is acting as a MVP release. But I want to ensure we are preparing for this enhanced back-end in the future. This is easiest by defining an interface to the User Management system without actually building all of it yet. How would you organise this in a Scrum project environment? Obviously, in order to decide how the interface needs to look. We need to decide on it's functionality. But in doing so, we'll be getting very close to speccing the entire thing out. Which isn't required for several months! (This is a Team Foundation Scrum 3.0 workflow for those interested)


MVVM ViewModel and Commands

I need a bit of help to understand the relationship between a viewmodel and a command, and the responsibility of the viewmodel. I'll try to give an example (using Caliburn Micro). I have a viewmodel class, a command class and a view with a Save button.               public class EditViewModel : Screen     {         public bool CanSave         {             get { return IsDirty; }         }              public void Save()         {             var command = new SaveCommand(this); // command gets reference to VM             command.Execute();         }     }          public class SaveCommand     {         private readonly EditViewModel _viewModel;              public SaveCommand(EditViewModel viewModel)         {             _viewModel = viewModel;         }              public void Execute()         {            var work = _viewModel.Work;            ..            _viewModel.IsDirty = false;         }     }      When the user click Save. Save() method is called and spins up a command that saves the work. Now my question is, should the command have a reference to the viewmodel? No) The viewmodel will have to pass the work to the command, which will have to pass the save result back to the viewmodel, which will update itself. Yes) The command needs a reference to the viewmodel and properties needs to be public set-able. _No_ seems like the cleanest way, but also requires extra work, when the work or result aren't a simple bool or similar. I guess the root it all is. What is the relationship between a viewmodel and it's command and the responsibility of the viewmodel ? Is there a strong 1:1 "friend" relationship between the view-model and it's command, where code has just been moved to another class. So there is nothing wrong with the command having direct access to the viewmodel. Another understanding, the viewmodel is a very simple class, almost only with properties and contains little logic. So the logic should be in the command. Or the viewmodel is pretty smart and should contain application-logic. Commands are really only needed when there are either too many in one viewmodel or they are a bit complicated otherwise the command code can stay in the viewmodel. I'm just rambling I guess, please help me out to understand the viewmodel and what it's responsibility is?


bad practice to have actions in web api controllers

I was creating a new action for a `WebApi` controller and tried to create a url using the following:               @Url.RouteUrl("DefaultApi", new { httproute = "", controller = "ClientApi"})      and noticed that the default route did not have an action attribute, it looks like this:               config.Routes.MapHttpRoute(         name: "DefaultApi",         routeTemplate: "api/{controller}/{id}",         defaults: new { id = RouteParameter.Optional }     );      how come the default route doesn't have the action in the route configuration by default? is it bad practice to have it? that is to say is it bad practice to have so many actions in a web api controller that it requires to change the route.


I've unit tested my class, now how do I get started with an integration test?

I've written a class that manages recipients on a MailChimp list, called MailChimpRecipient. It uses the MCAPI class, which is an third-party API wrapper. http://apidocs.mailchimp.com/api/1.3/ http://apidocs.mailchimp.com/api/downloads/ I pass the MCAPI object into the constructor of the MailChimpRecipient object, so I have written unit tests using PHPUnit that test all of the logic in my own class (I am not testing the MCAPI class). I have 100% code coverage and all tests pass. This is done by mocking and stubbing the MCAPI object. My next step was to write an integration test, also using PHPUnit, where I would construct the MailChimpRecipient fixture using a real MCAPI object, set up to use a real MailChimp list. I have written what I think is an intergration test, which basically runs tests agains the public interface of the object, like:               public function testAddedRecipientCanBeFound()     {         $emailAddress = 'fred@fredsdomain.com';         $forename = 'Fred';         $surname = 'Smith';              // First, delete the email address if it is already on the list         $oldRecipient = $this->createRecipient();         if($oldRecipient->find($emailAddress))         {             $oldRecipient->delete();         }         unset($oldRecipient);              // Add the recipient using the test data         $newRecipient = $this->createRecipient();         $newRecipient->setForename($forename);         $newRecipient->setSurname($surname);         $newRecipient->setEmailAddress($emailAddress);         $newRecipient->add();         unset($newRecipient);              // Assert that the recipient can be found using the same email address         $this->assertTrue($this->_recipient->find($emailAddress));     }      The "integration" test doesn't test any of the internals of the class - it just makes sure that given a real MCAPI object, it behaves as advertised. Is this correct? Is this the best way to run an intergation test? After all, the internals have been tested with a unit test. Am I right in thinking that the integration test is there to test that it really works, according the way its behaviour is advertised? To take it a step further, the MailChimpRecipient class implements an interface, which will also be implemented by other classes. The idea is to use a factory to pass different types of mailing list recipient objects to my code, which all do the same thing, albeit using different mailing list providers. Since my integration tests test the that interface, how about using it for all of the classes that implement the interface? Then, in the future, if I design a new class to be used interchangably, I can run the same integration test before inserting it into a project. Does this sound reasonable? The unit tests test the internals of an object, intergration tests make sure that it behaves as advertised?


Using the STL to solve interview questions?

If I'm undergoing a technical interview that's based on my C++ skills, would most companies allow or expect me to use STL containers to solve problems? I think it's clear that if a question is pertaining specifically to a linked- list and my knowledge of linked-lists that I probably won't be able to or shouldn't use the STL list containers. On the other hand, I could get a question where using std::vector might be really useful and the question itself doesn't concern std::vector directly. In this latter case I would think using the vector STL container would be acceptable. Of course, the answer to this question is at least somewhat company dependent. I'm curious as to how bigger tech companies approach this situation.


thick client migration to web based application

This query is related to application design the technology that I should consider during migration. The Scenario: I have a C#.net Winform application which communicates with a device. One of the main feature of this application is monitoring cyclic data(rate 200ms) sent from the device to the application. The request to start the cyclic data is sent only once in the beginning and then the application starts receiving data from the device until it sends a stop request. Now this same application needs to be deployed over the web in a intranet. The application is composed of a business logic layer and a communication layer which communicates with the device through UDP ports. I am trying to look at a solution which will allow me to have a single instance of the application on the server so that the device thinks that it is connected as usual and then from the business logic layer I can manage the clients. I want to reuse the code of the business layer and the communication layer as much as possible. Please let me know if webserives/WCF/ etc what i should consider to design the migration. Thanks in advance.


How do I / what is the best way to interact with a desktop application from a browser web application?

Situation: We have a desktop application. We also have a web application. We need the two to interact with each other. So when a button is pushed in the web application, the desktop application needs to start running a process (pulling data from the cloud using an API we've created). With two local applications, this can be done with ports/listening, editing a flag somewhere locally, and the other application reading this flag, etc. Can this be done from web -> desktop? Ideally the web application would have direct communication with the desktop application and notify it to begin pulling data down from the cloud using our API. But if this is not possible, having the desktop app run a process that loops and checks for a flag in a file or something would be a good start. After minimal research, I've found some stuff like HTML5 File Api which interacts with "Sandbox" directory on the local machine. I've also read that it is impossible to access any thing on the local machine for security reasons. Also, I dont want the user to be prompted to request a download file everytime, we need things to happen behind the scenes. (Even if the user has to initally set up some lower security / permissions just for this situation) Any input is appreciated!


> **Possible Duplicate:**   >  Career Prospects: Women at Management positions in Software Why are there so few female programmers? My wife asked me and I didn't know.


I know what I want to do, but I have a hard time coding it?

After doing some interviews, I've realized that I usually know what I want to do to solve a problem, but I often get my logic complicated (and introduce a lot of bugs) when I'm actually coding. For example, when I tried to code up insertion into a sorted singly linked list, this is what I knew I had to do:   1. I had to check for the case where the list is currently null   2. I had to check if the element I want to insert is less than the current head   3. To insert between nodes, we had to link one node to the new node, and the new node's next to the one that is supposed to be after. I had trouble inserting between nodes because I was actually supposed to check the NEXT node's data and not the node which I had my pointer pointing to (so I could set current's next to the new node). I also struggled on this problem (note that this was coded on white board) because I was pressured under time and I think I made it more complicated in my mind that I should have. When I went back to this problem after the interview, it turns out the solution isn't complicated at all (as it shouldn't be). However, I just tend to complicate things and confuse myself. Would anyone have any suggestions on how I could improve this vulnerability of mine?


Building a database class in PHP

I wonder if I should write a database class for my application, and if so, how to accomplish it? Over there on SO, a guy mentioned it should be written as an abstract class. However, I can't understand why this would be a benefit. Do I understand correctly, that if I would write an abstract class, every other class that methods will need a database connection, could simply extend this abstract class and have its own database object? If so, how is this different from a "normal" class where I could instantiate an database object? Another method would be to completely forget about my own class and to instantiate a mysqli object on demand. What do you recommend?


Emulation of MMU accessing the contents of the registers

I'm having a play around with emulating a simple old CPU. I've set the structure up, so far anyway, as follows: The device is the main and creates an instance of the CPU. The CPU then creates instances of the registers, clocks and MMU. I'm in the position where the MMU needs to access the contents of the registers, how to do this? I figure I could probably bodge something together by passing the entire register object to the MMU when it's called but that seems unwieldy. The other thing I thought to do would be to initialise the MMU with the register object in the constructor. If I'm not mistaken that will still reference the same object? Meaning any changes I do to the registers in the MMU will affect the whole system?


Why is iOS "jailbreaking" CPU specific?

Recently, iOS 6 was "jailbroken" but only on the Apple A4 CPU. Why is the "jailbreaking" process specific to a CPU? From Wikipedia: > ... "iOS jailbreaking is the process of removing the limitations imposed by > Apple on devices running the iOS operating system through the use of > hardware/software exploits – such devices include the iPhone, iPod touch, > iPad, and second generation Apple TV. Jailbreaking allows iOS users to gain > root access to the operating system""" ...


Making Code Changes While PHP Script Is Running

I have a PHP program running right now that is processing database rows of over 6 million. Considering the speed at which number of records have been processed so far, it looks like the whole process might take few days to complete (due to hardware limitations). I was thinking if I could make changes in the program to remove unnecessary logging and other things that may be consuming time. Can I do this with the current program still running so that further processing would speed up, or will this cause the PHP script to break ?


Linking application build number to svn revision

I am looking for a strategy to version an application with the following requirements. My requirements are given an exe with version number (major.minor.build- number) 1) I want to map the version to a svn source revision that made the exe 2) With the source and exe I should be able to attach and debug in vs2010 with no issue. 3) Once I check-out the source code for the exe I should be able to build the exe again with the version number without having to make any changes to a file.


Company wants thoughts about their site during interview

I have an initial phone interview coming up with a company for a Senior Web Developer position and in the email they asked to prepare by signing up on their site because they'd like to hear my thoughts about it and suggestions for improvement. I've heard stories before of companies that do this. They interview 10 people and then if everyone gives advice, then they've got a lot of free consultation. I believe this is the first time I've ever been asked to do something like this so I wanted to hear other people's thoughts of whether it is free consulting or if I'm just being paranoid.


How should I get my code ready for OpenSourcing it and putting it on GitHub?

In a few weeks, my project is going to be finished and I want to start getting my code ready for other people to use it. I am going to be posting everything to GitHub so people can tweak it and hopefully make it better. I guess what I'm asking is, what would be the best way to make sure my code is sufficiently documented and worded right for other people to use? I know you should always comment everything and I'm going to be putting in the @params feature for every method, but are there any other tips in general?


What are the most important concepts to understand for "fluency in developer English"?

In April, I'm going to be giving a talk called **English 2.0 - Understanding the Language of Developers" to a group of English teachers. The purpose is in two hours to give them a quick background in key concepts so that they can better understand developer blogs and podcasts and are able to ask better questions when talking to developers. What do you think are the most important concepts to understand, concepts that developers take for granted but the general public is not familiar with? Here are a few ideas:   * version control   * abstractions   * pub/sub   * push vs. pull   * debugging   * modularity   * three-tier architecture   * class/object   * "spaghetti code" vs. OOP   * exception throwing   * crowd sourcing   * refactoring   * the cloud   * DRY - don't repeat yourself   * client/server   * unit testing   * designer/developer


From non programmer to "professional" freelance programmer

I am 15 year old student looking to buy his first car and thought I could earn some extra money by learning to program since I like messing around with the computer all the time. I have been reading a lot of the posts here and have come up with a list of books I think would be beneficial to me, however, I do not know which information is most important to know first or if I have everything I will need. Here is what I was thinking: 1: Learn a programming language in depth. I am about 1/2 way done with the Step-by-Step book 2\. Learn about object oriented design and design patterns 3\. Learn about software testing 4\. Go practice these skills on websites like projecteuler, topcoder, and try and do simple projects on freelance websites like rent-a-coder. Is there anything else you think I may need or should look into? Thank you. Microsoft Visual C# 2010 Step by Step Professional C# 4.0 and .NET 4 (Wrox Programmer to Programmer) C# in Depth CLR via C# Applying UML AND Patterns Head First Object-Oriented Analysis and Design Design Patterns: Elements of Reusable Object-Oriented Software Test Driven Development: By Example Growing Object-Oriented Software, Guided by Tests


Participating in Webinars and Seminars about Developing and Programming

Does participating in Webinars and Seminars about software development and programming improve a developer's programming level? Please note that I'm asking this question about developers, not managers. Because in many webinars and seminars, there are highly general views about future technologies which can be useful for manager to decide ahead about future tools their team should use.


Avoid losing time making budget

I often receive some potential client who wants me to make his web site. Some of them end up as real clients and give the project. Some others (the most) have no idea about prices and times. For those, if they are close to me, I can hear what they want, tell them it is going to be about X money and Y time and it can go higher or lower. If they had that idea in mind then I use the time I need to make the right budget. Now, for the cases that they are not so close to me, I have to lose the time to make the right budget from the beginning. If the budget is accepted I would get paid for that time because I included it, but if it is not accepted, I'd have lost lot of time without being paid. How can I avoid losing that time?


What kind of algorithm could be used to produce an ordering which maximizes # of satisfied 'less than' constraints?

Let's say I have a set of items {e1, e2, ..., en}, and I also have a set of constraints {c1, c2, ..., cm}, with ci := ej appears before ek, for some j and k. I want to produce an ordering of my items which maximizes the number of satisfied constraints, with the possibility that some of the constraints are contradictory. I'm not sure how to search for this, but I hope there is some known efficient algorithm for this. It might also be helpful if, given weights for the constraints, I could instead maximize the total weight of the satisfied constraints, rather than just the number.


Why And is needed when there is AndAlso

I have referred What is the difference between And and AndAlso in VB.net? to understand the difference between `And` and `AndAlso`. I am from C# background - and C# has `AndAlso` only - no `And`.. And I don't see any practical use/advnatage of `And`. Is there any practical use of `And` in VB.Net? **Reference**   1. Or versus OrElse   2. What is the difference between And and AndAlso in VB.net?


Unable to convince on data hiding

I am working on a Selenium + java project where all Web Element in a class are declared as -               public class CheckoutPaymentConfirmpage extends WebPage{          public final Button btnPrintorder = new Button("//input[@id='but_Print']");     public final TextField txtpassword = new TextField("password", "//input[@id='pass']");              // Some more elements here         // Some page object methods here     }      Now when ever test need to access these elements they are directly invoked over the object of `CheckoutPaymentConfirmpage` class What ever little java (or OOPS) I know, has taught me that members should be as hidden as possible. Hence I would have had `btnPrintorder` and `txtpassword` declared private and would access them using getters or would have created methods in page object class to be used by tests. But when I convey this to others they don't see much value in it as state of instance variable (i.e. `btnPrintorder` etc) would not be changed from one object to another for page object class (i.e. `CheckoutPaymentConfirmpage` etc) Hence in this situation, is it ok to leave instance variable as public?


We have developed one product for payroll processing. We have 10+ customers who are using this software product. Our existing and new customers are giving us customization changes w.r.t. their needs, and now we are facing the problem of product management. Please give some guidelines to us. How to manage single software product to multiple customers? Software developement details :   Front End Tools : Visual Studio 2008 (ASP.net web application)   Source Code Mangement : Visual Source Safe (VSS)   Back End : Sql Server 2005   Team Size: 12


Are asp.net web parts good enough for exclusive development?

I have had the question posed at my work that, since we are planning to eventually move to Sharepoint 2010 for most of our Development, and since Sharepoint 2010 supports asp.net web parts, should we start moving all of our new development to be exclusively asp.net web parts? It was also asked how prism factors into all of this. (not sure what that is) We are now a mostly client/server based location but are moving to an SOA framework (slowly though). Is this a good idea? Is it better to have some apps in WPF and Winforms hitting the services or should we just go to web parts solely? What are we going to miss out on if we make this move?


How to organize integration tests and test data for different environments when using Maven Failsafe

I have started to separate my unit tests from my integration tests by using Maven Surefire and Failsafe. Now I'm wondering what good ways there are to deal with separate environments. Take for example these two integration tests scenarios:   * Given a customer id, can I get a list of orders belonging to that customer.   * Given a customer id and a product id, can I create an order for that customer. I want to be able to run these tests against both TEST and PRODUCTION environments, but they will need different data and in some cases slightly different code as well. In some cases there are also tests I might not want to run in PRODUCTION, but only in TEST. For example my test customer won't have the same id in both TEST and PRODUCTION. And when I need to create the product for the order I might need to instantiate a different product (with different properties, etc). What are some good ways of tackling this without too much of a mess or duplicated code?


Strategy for maintaining assembly references in TFS

I have a 3 branch setup: Dev, QA, Prod. There is a references folder where we store common 3rd party and internal assemblies. Change mgmnt has been challenging. Sometimes Devs forget to go into the References folder and check in the new version. We tried referencing Projects, which results in a reference to the bin folder. This works out fine as long as you keep the build order correct and always contain all the projects in the same solution file. This isn't always a good idea or feasible, so we went to a references folder. Continuous Integration may help alleviate some of these issues, but we don't have a CI server yet. Is there a good process for for managing the References folder that doesn't require so much manuel dev intervention? I thought about copying the files out on post-build. That doesn't solve the issue of checking the new version in so other devs can access it. We have TFS. This is for internal corporate development. Anything that requires open-source of our product is not possible. **UPDATE**   I own FinalBuilder. I am new to using it and do not know if it can benefit this process.


Rails - How to use modal form to add object in one model, then reflect that change on main page?

I'm working on a Rails app and I've come across a situation where I'm unsure of the cleanest way to proceed. I posted a question on SO with code samples and such - it has received no answers, and the more I think about the problem, the more I think I might be approaching this the wrong way. (See the SO question at http://stackoverflow.com/questions/9521319/how-to-reference-form-when- rendering-partial-from-js-erb-file) So, in more of a generic architecture type question: Right now I have a form where a user can add a new recipe. The form also allows the user to select ingredients (it uses a collection_select which contains Ingredient.all). The catch is - I'd like the user to be able to add a new ingredient on the fly, without leaving the recipe form. Using a hidden div and some jQuery/AJAX, I have a link the user can click to popup a modal form containing ingredients/new.html.erb which is a simple form. When that form is submitted, I call ingredients/create.js.erb to validate the ingredient was saved and hide the modal div. Now I am back to my recipe form, but my collection_select hasn't updated. It seems I have a few choices here:   1. try and re-render the collection_select portion of the form so it grabs a new list of ingredients. This was the method I was attempting when I wrote the SO question. The problem I run into is the partial I use for the collection_select needs the parent form passed in, and when I try and render from the JS file I don't know how to pass it the form object.   2. Reload the recipe form. This works (the collection_select now contains the new ingredient), but the user loses any progress they made on the recipe form. I would need a way to persist the form data - I thought about manually passing the values back and forth, but that is sloppy and there has to be a better way...   3. Try and manually insert the tags using jQuery - this would be simple, but because I'm allowing for multiple ingredients to be added, I can't be certain what ID to target. Now, I can't be the only person to have this issue - so is there an easier way I'm missing? I like option 2 above, but I don't know if there's an easy way to grab the entire params hash as if I had submitted the main recipes form. Hopefully someone can point me in the right direction so I can find an answer to this... If this doesn't make any sense at all, let me know - I can post code samples if you want, but most of the pertinent code is up on the SO question. Thanks!


How to bypass Oauth2 authentication when the client and resource owner is the same entity?

We are currently working on using an API provided by Mercado Libre which is a maket place for selling various goods. Their APIs use OAuth 2.0 for authentication. The problem is that OAuth 2.0 as implemented by Mercado deals with the case that the Client application and the Resource owner are different entities. So if the client application wants to view all orders made by a seller for example it will require the user to authenticate himself first on Mercado before allowing the client application to get his data. This is a convenient flow if the client application and resource owner are different entities and the resource owner is using a browser to access the client app. However, in my case there will be now UI. The client app my are building will collect orders and other info from Mercado automatically with no user intervention as we own the data ourselves. **TL;DR** So in short I need a way to bypass the user authentication when using OAuth 2.0 without a UI.


How is Java used in the financial sector?

I am an student with good knowledge of Java, and I'd like to get into the financial sector. How is Java used there? How can a Java developer expect to break into the financial sector and find success? What types of systems should I be looking into?


Web development: no local server workflow

I'm considering the reengineering of my web development ecosystem. We use Git very successfully to deploy new changes to our Production, Staging, and Development servers. Traditionally, I've always had a copy of Apache on my local machine - in the interest of keeping my local machine as lean as possible, I'm considering running Apache in a non-local VM and syncing changes somehow. My initial thought was to run something like `rsync` and `cron` (Mac development system) to monitor the directory for file changes and then sync them up. I have been tempted to use a separate branch in Git and writing a hook to have the Apache server pull in the changes, but versioning all of my changes may be unproductive, particularly on very experimental additions. My question is, is there something I'm not considering in this workflow? This particular project requires ColdFusion, so am I going to realize significant benefits over not having Apache/CFIDE locally?


Is switching from a CVCS to a DVCS a considerable bandwidth save?

So, I'm in a big geographically-distributed company, we use perforce and I'm starting to make the case for a DVCS with a whitepaper I was requested to write. I was thinking that one of the arguments I could use is the bandwidth saved using a DVCS, and technically if there were binaries to download (there are, but they're not sync'ed every day) and enough developers downloading them one could see a substantial difference. Unfortunately that's an edge case and its all that I can think of (other than individual developers being able to work faster when diffing, committing locally, and all those other DVCS perks). So, **would there be an actual noticeable bandwidth save?, in what other cases?**. Free cookie to anyone with actual empirical evidence (confirming or refuting). **Edit:** It is just one of the arguments I'm trying to support and it's not at all the main one, I got at least 10 others... this is one of the "side- benefits" but I want to find out how real it is. Plus, I want to win over the IT guys =)


Ext JS code review check list

Can any one share a code review check list for Ext JS in common and specially for Ext JS 3.4 ?


Are High Level Design and Low Level Design documents needed to follow Agile development process?

Our team is developing a project using an Agile development process. All of our requirements are converted into product backlog items and task are broken down based on that. One of my team member suggested to maintain the High Level Document (HLD) and Low Level Document (LLD) for the requirement. Do we need to have these documents to follow the Agile process?


Why does my C++ (OpenMP) matrix operations code start incurring more cache misses running in parallel compared to Scala?

I have written code using C++ (OpenMP for parallelizing loops) which does lots of matrix operations. A single instance of the code runs very fast and completes in 0.2 seconds. For the same processing, code written in Scala (using Actors) takes around 3 seconds. The problem that I am facing is that when I run multiple instances of the C++ code in parallel, the running time increases very rapidly. The Scala code does not exhibit such behavior. Running parallel instances of the Scala code increases the time linearly. Using the Zoom profiler, I found that my C++ code starts incurring cache misses. A single instance of the code uses around 2 MB of memory. And the L3 cache in my machine is 3 MB. So it makes sense that multiple instances running in parallel will lead to cache misses. I don't understand why the running time of the Scala code does not get affected when multiple instances are running in parallel. All the matrices are dense matrices in both the C++ and Scala code.


Is it true that a stricter coding style is always better?

I am currently studying computer science and was wondering how strict coding styles are in industry, how much it differs between industries and if it is true that a stricter coding style is always better?


Advice on making sure e-commerce site is secure using PHP and MySQL

Like the title says, I would like some advice from knowledgable web developers on figuring out security issues for my e-commerce site. I am designing the database as well as the code that communicates with the database to make changes, etc. I have a few questions, but in general a good checklist on what to do to make the security pretty tight, seeing as I will be dealing with credit cards. I will not be storing credit card numbers. Links to good places would be helpful. My main concern is keeping the database secure. I am pretty new to web development, and I am just concerned about thst. I do have a question about the design of a database used for online transactions. Is there a better way to make the schema than to just put all the user info into one table: ex.               customer(customerid, firstname, lastname, username, password,              address, city, country, zipcode)      Would it be better to store user credentials in another table and link them with the customerid? Sorry if I am not getting too specific, but I am new to web development and mainly have experience in offline programming. Again my main concern is security issues. If anyone has a great article on security, that would do just fine as well. Thanks for your time!


Programmers will be designers in the future?

Is everything going to tend to powerful interface in the nearest future(I'm talking about desktop applications)? Console or simple GUI applications will not be popular? And does it mean that all programmers will have to become designers?


DB table with column for each datatype

I need to design a DB for storing key-value data. List of Key names isn't fixed and should expand at later point. I don't want to create a table with a column for each key, because I'll need to add columns frequently and it might grow too big, and I understood that the Entity-Attribute-Value design isn't efficient. I thought of the following type of table design, and I'm asking if it makes any sense and does anyone can come up with any drawbacks related to efficiency, table size or any other issue - Each column in the table is of a different data type; irrelevant columns for a key are NULL:               ID |DataType |KeyName |ValInt |ValSmallInt|ValBool |ValStr  |ValText  |ValDate     -------------------------------------------------------------------------------     1  |1 (int)  |Width   |100    |NULL       |NULL    | NULL   | NULL    | NULL     2  |1 (int)  |Height  |200    |NULL       |NULL    | NULL   | NULL    | NULL     3  |2 (bool) |IsActive|NULL   |NULL       |false   | NULL   | NULL    | NULL     4  |3 (text) |URL     |NULL   |NULL       |NULL    | NULL   | w.com   | NULL     5  |1 (int)  |Size    |4      |NULL       |NULL    | NULL   | NULL    | NULL     6  |4 (date) |Created |NULL   |NULL       |NULL    | NULL   | NULL    | 2/2/2012      Number of columns will be as the number of all datatypes (about 30?). The DataType column is a flag of type int which is used for the caller - it tells him what column to take the value from. Each row is actually a property of some object in other table. A set of rows makes a set of properties for that object and usually a SELECT will get the whole set.


Is it good practice on server/client systems to automatically install updates?

I'm working on an automated update system for a legacy server/client software package written in Delphi. The way I'm designing it is so the client's (customer's) server machine runs a service which...   1. periodically checks online for new versions   2. automatically downloads files   3. hosts latest version information for all client machines   4. hosts files for client machines to update Once this service has downloaded update files, it raises a flag in the database alerting all client machines that updates are available. BUT, the thing is, the server must be installed first. So, an administrator would see this message and approve the update. However, the administrator must schedule a time for it to install. At that scheduled time, the server will update its self. If everything was successful, it will raise another flag in the database for all client machines to also update. If anything happened, it will restore the backup which was made before the install. My question is... Is this good practice? Of course automated updates is a very good thing... **if done right**. This software is used in real-time in retail and wholesale environments, so if anything goes wrong during this scheduled installation, people could come to work the next morning to a broken system. The point is, no matter how automated I make this, an administrator still needs to ensure everything went smooth. Further issues...   1. client machines must know not only the database server info, but also their update server info.   2. server machine might be at another location which might require firewall configuration   3. database changes may give unforeseen results, which aren't known until something bad happens   4. client machines may be shut down and need to update once it starts   5. a list full of possible scenarios which may go wrong So in this situation, would you feel comfortable making a 100% automated updating system for a sensitive software? Because some of our clients have up to 50 client computers which need to be updated to match their server's database.


Get entities ids from two similar collections using one method

I've got two lists:               List<Integer, ZooEntity> zoos;     List<Integer, List<ZooEntity>> groupOfZoos;      These operations will return collections of values:               Collection<ZooEntity> cz = zoos.values();     Collection<List<ZooEntity>> czList = groupOfZoos.values();      What I want to achieve is to get list of all zoo ids.               List<Integer> zooIds = cz ids + czList ids;      Of course I can create two methods to do what I want:               public List<Integer> getIdsFromFlatList(Collection<ZooEntity> list) {         List<Integer> ids = new ArrayList<Integer>();         for (ZooEntity z : list) {             ids.add(z.getId());         }         return ids;     }          public List<Integer> getIdsFromNestedList(Collection<List<ZooEntity>> list) {         List<Integer> ids = new ArrayList<Integer>();         for (List<ZooEntity> zList : list) {             for (ZooEntity z : zList) {                 ids.add(z.getId());             }         }         return ids;     }      As you can see those two methods are very similar and here is my question: Is it good to create one method (for example using generics) which will get ids from those two lists (`zoos` and `groupOfZoos`). If yes how it should look like? If no what is the best solution? BTW. This is only the example. I've got very similar problem at job and I want to do it in preety way (I can't change enities, I can change only `getIds...()` methods).


Should I store False as Null in a boolean database field?

Let's say you have an application that has a boolean field in its `User` table called `Inactive`. Is there anything inherently wrong with just storing false as null? If so can you please explain what the down side should be? I have discussed this with someone a few months ago and we both agreed it shouldn't matter as long as you do it consistently throughout the app/database. Recently, someone I know was emphatic that "true" `true` or `false` should be used, but they didn't really give an explanation as to why.


Syntactic sugar regarding function parameters

Are there any modern programming languages where you don't have to specify types for each parameter in a function's definition? Ex:               procedure P(a, b, c, d: integer)      vs               void P(int a, int b, int c, int d)      Is there a good reason why the latter form is so popular? Why don't more languages allow you to specify the type of all your parameters at once, like the first form?


Error checking in actor-based paradigm

I have an existing Scala application that I am trying to refactor in order to use Akka. One of the problems I have is how to manage error-checking in actor- based applications. Usually error-checking is done through one of two mechanisms:   * either one returns a value indicating an error condition, such as `Option[A]` or `Failure[A]`, or   * by the use of exceptions. Neither of these style seems particulary useful here. On the one hand, actor messages are usually "fire and forget", hence there are no return values. [One can have a return value using Futures, but it certainly not customary to ask for futures on every message.] On the other hand, processing of the message usually happens on another thread, so that one cannot catch an exception arising from the processing of a message. One could simulate the first mechanism by sending back error or confirmation messages, such as               class FooActor extends Actor {       def receive = {         case Foo => ...           if (errorCondition) sender ! ErrorMessage       }     }      But if one has to do this for every actor, it becomes a lot of boilerplate and it seems a poor man's simulation of stack unwinding. > What is a good strategy to recover from errors in actor-based applications?


What's the difference in content between Chris Okasaki's 1996 thesis and 1999 book, Purely Functional Data Structures?

I want to read Purely Functional Data Structures. I've easily found the thesis (which is freely available as a PDF), but see that there's a book available also. So I'd like to know what the differences are, if any, between these two publications.


Shuffling algorithm with no "self-mapping"?

To randomly shuffle an array, with no bias towards any particular permutation, there is the Knuth Fischer-Yeats algorithm. In Python:               #!/usr/bin/env python     import sys     from random import randrange          def KFYShuffle(items):         i = len(items) - 1         while i > 0:             j = randrange(i+1)  # 0 <= j <= i             items[j], items[i] = items[i], items[j]             i = i - 1         return items          print KFYShuffle(range(int(sys.argv[1])))      There is also Sattolo's algorithm, which produces random cycles. In Python:               #!/usr/bin/env python     import sys     from random import randrange          def SattoloShuffle(items):         i = len(items)         while i > 1:             i = i - 1             j = randrange(i)  # 0 <= j <= i-1             items[j], items[i] = items[i], items[j]         return items          print SattoloShuffle(range(int(sys.argv[1])))      I'm currently writing a simulation with the following specifications for a shuffling algorithm:   1. The algorithm is unbiased. If a true random number generator was used, no permutation would be more likely than any other.   2. No number ends up at its original index. The input to the shuffle will always be A[i] = i for i from 0 to N-1   3. Permutations are produced that are not cycles, but still meet specification 2. The cycles produced by Sattolo's algorithm meet specification 2, but not specification 1 or 3. I've been working at creating an algorithm that meets these specifications, what I came up with was equivalent to Sattolo's algorithm. Does anyone have an algorithm for this problem?


it is a good approach to implement dependency injection in a desktop app?

Well, the thing is that I am just about to create a Desktop App (with .NET windows forms) And now I just wonder if it would be really a wise choise to use any IoC (StructureMap,Ninject,Spring .Net), I have used them before for Asp.Net web applications but what makes me doubt now is the fact that working with windows forms my business entities will persist when I navigate through tabs and unlike than web forms or mvc apps where it would be necesary to inject my business entity for every new request that is performed, I mean this because of the Asp.Net page life cycle where is performed the initialization and controls instantiation. Maybe I am misunderstanding the point of using an IoC, so please tell me what do you think would be a better choise?


Can I WTFPL/CC0 parts of a GPL code?

I know I should not expect a lawyer's notice here, but programmers advices would suit me well enough. I want to publish a program which is derivated from a GPL-licensed program. I understand from the GPL legal notice that the whole work is to be licensed under GPL as well. Now, I'd rather publish my work under a more permissive license — namely, I don't care about attribution. It seems to me that CC0 or WTFPL licenses, for instance, don't need the work to be considered as a whole, right ? So as they are compatible with the GPL, in principle I could just say something like (in addition to the GPL notice) the following : > This work is GPL as a derivative work of foobar. In addition, modifications > with regards to the original foobar are WTFPL/CC0. Would this be valid licensing ?


What is the correct way to handle debug output in Java?

As my current Java projects grow bigger and bigger, I feel a likewise growing need to insert debug output in several points of my code. To enable or disable this feature appropriately, depending on the opening or closure of the test sessions, I usually put a `private static final boolean DEBUG = false` at the beginning of the classes my tests are inspecting, and trivially use it this way (for example):               public MyClass {       private static final boolean DEBUG = false;            ... some code ...            public void myMethod(String s) {         if (DEBUG) {           System.out.println(s);         }       }     }      and the like. But that doesn't bliss me out, because of course it works but there could be too many classes in which to set DEBUG to true, if you are not staring at just a couple of them. Conversely, I (like - I think - many others) wouldn't love to put the whole application in debug mode, as the amount of text being output could be overwhelming. So, is there a correct way to architecturally handle such situation or the most correct way is to use the DEBUG class member?


Better solution then simple factory method when concrete implementations have different attributes

abstract class Animal {       function eat() {..}       function sleep() {..}       function isSmart()     }          class Dog extends Animal {       public $blnCanBark;       function isSmart() {         return $this->blnCanBark;       }     }          class Cat extends Animal {       public $blnCanJumpHigh;       function isSmart() {         return $this->blnCanJumpHigh;       }     }          .. and so on up to 10-20 animals.      Now I created a factory using simple factory method and try to create instances like this:               class AnimalFactory {       public static function create($strName) {            switch($strName) {               case 'Dog':                 return new Dog();               case 'Cat':                 return new Cat();               default:                 break;            }       }     }      The problem is I can't set the specific attributes like blnCanBark, blnCanJumpHigh in an efficient way. I can send all of them as extra params to create but this will not scale to more then a few classes. Also I can't break the inheritance because a lot of the basic functionality is the same. Is there a better pattern to solve this?


Web-programming vs Hardcore-programming

Why questions about HTML/CSS/JS/etc(Web-programming et al) collect more views and answers than those about, for instance, automata theory? Does this mean that the huge part of programmers are just "intermediate" programmers? (This is not sarcasm, I really interested!)


"Build your own website" - Developing a CMS with Vague Requirements on a Tight Deadline

I'm a Java developer in charge of making a product which allows clients to "build their own site". I've spent a lot of time looking into Liferay, as I don't have any experience in building CMSs, and want to either use it, or get ideas of how to build a decent system. The time line is short, requirements are vague, yada yada Is Liferay a good technology to work with when showing the client (who may be very low on computer expertise) a user interface to build a site? The thing is, I want the power and flexibility to avoid the learning curve in building a CMS like product, but I don't want to waste time learning a new technology only to find its over-kill, or can't do the simple - but uncommon and unimplemented - things that we are asked to add as features Ideally I'd like to provide multiple web interfaces to the core API to build the sites - one that is very powerful, and another that is watered down and easy to use.


Are C or C++ The Only Viable Languages for a GC

### Background I have just finished writing a compiler for a functional language compiling to the JVM as a learning project. However, since I'm just doing this to learn, I thought it might be interesting to write a native backend and a RTS for it. As I've been planning out what this new backend will look like, the one point I'm stumbling on is the garbage collector. I've implemented the compiler in Haskell. But I have no desire to write the GC in Haskell since, while it may be possible, it'd suck. ### Question I've looked at several FOSS garbage collectors prior to posting and most of them were implemented in good old ANSI C. Is this still the most accepted choice for writing a GC nowadays? I've seen that this site tends to frown upon questions with multiple answers so I hope this will make it more specific: If some startup was writing a professional grade gc today, are the only viable choice for them C or C++? It's my first question here so please comment and let me know if this question is ill-suited for for programmers.


Code Reuse and Abstraction in FP vs OOP

I've been told that code reuse and abstraction in OOP is far more difficult to do than it is in FP, and that all the claims that have been made about Object Orientedness (for lack of a better term) being great at reusing code have been flat out lies So I was wondering if anyone here could tell me why that is, and perhaps show me some code to back up these claims, I'm not saying I don't believe you Functional programmers, it's just that I've been "indoctrinated" to think Object Orientedly, and thus can't (yet) think Functionally enough to see it myself To quote Jimmy Hoffa (from an answer to one of my previous questions): > The cake is a lie, code reuse in OO is far more difficult than in FP. For > all that OO has claimed code reuse over the years, I have seen it follow > through a minimum of times. (feel free to just say I must be doing it wrong, > I'm comfortable with how well I write OO code having had to design and > maintain OO systems for years, I know the quality of my own results) That quote is the basis of my question, I want to see if there's anything to the claim or not


Software development based on a reference implementation

Lets say I have library "A2" as a dependency in a project. Library "A2" is derived from library "A1"(A2 is a fork of A1 with some modifications to the original source code) where someone has done few changes to the library "A1" 's source code. Lets say there is a new version of "A1" I want to use the new version but no modification to its sourcecode at all. I am planning to identify what are the changes done to the original library when deriving library "A2" out of it and decorate the latest version of the library with those changes. Is it a good approach to solve this? if not can someone suggest the best approach to solve this kind of problems?


Evolution of the Win32 API

Has the Windows 32 API changed much over time? Does the Charles Petzold book "Programming Windows, 5th Edition" from 1998 still contain relevant information, or is most of it obsolete/outdated? What are some prominent examples of recent additions to the Windows 32 API (if there are any)?


Do you use i-->0 for backward loops?

Some people write               for (int i=N; i-->0; ) doSomething(i);      instead of               for (int i=N-1; i>=0; --i) doSomething(i);      for backward loops. The `--> "operator"`1 looks very confusing at the first glance, but it's trivial:   `i-->0` simply parses as `(i--)>0`, and once you get it, you see it immediately. The main disadvantage is the strange look. The advantage is that you'll get it always right (unlike the more verbose version offering the possibility to forget something, which really happened to me a couple of times). _What do you think about using the`--> "operator"`?_ * * * 1First time I saw the funny term in a comment to this question today.


Where do we put "asking the world" code when we separate computation from side effects?

According to Command-Query Separation principle, as well as Thinking in Data and DDD with Clojure presentations one should separate side effects (modifying the world) from computations and decisions, so that it would be easier to understand and test both parts. This leaves an unanswered question: where relatively to the boundary should we put "asking the world"? On the one hand, requesting data from external systems (like database, extental services' APIs etc) is not referentially transparent and thus should not sit together with pure computational and decision making code. On the other hand, it's problematic, or maybe impossible to tease them apart from computational part and pass it as an argument as because we may not know in advance which data we may need to request.


Where do I publish a program?

I have finished designing a little application for Pandora and I am not sure how I can get it out and share it with everyone. What should I do to help advertise it to the public and let other people use it? As of right now it is free, and I hope to keep it that way, so I don't want to spend any money to give it out. I had actually designed this application just for personal use, but hey, why should I be the only one to use it?


About insertion sort and especially why it's said that copy is much faster than swap?

From Lafore's "Data Structures and Algorithms in Java": (about insertion sort (which uses copy + shift instead of swap (used in bubble and selection sort))) > However, a copy isn’t as time-consuming as a swap, so for random data this > algo- rithm runs twice as fast as the bubble sort and faster than the > selectionsort. Also author doesn't mention how time consuming shift is. From my POV copy is the simplest pointer assignment operation. While swap is 3x pointer assignment operations. Which doesn't take much time. Also shift of N elemtns is Nx pointer assignment operations. Please correct me if I'm wrong. Please explain, why what author says is true? I don't understand.


Undergrad internship career path

I am a CS student currently searching internship positions that are important to my future career. I am passionate about web design and development and it is really what I think my niche is in the programming world. I recently got offers between two companies - the first one, in an offshore company as a web developer where I am expected to study C# and AJAX (along with the basics: HTML, CSS, JS/JQuery, PHP, MySQL) and the second one specializes in Java and Agile software dev't. I am better in PHP than Java. It is obvious that I would pick the first one but I'm still on the fence because the second one is known to give solid training and foundation to both interns and employees while the first will expose me further to what I want to do. Which should I pick - **solid software development training and application** or an **real life application of a web developer's job** for my internship? **[UPDATE]** As of 25 May 2012 To everyone, next week will be the last of my internship. I went with the Java/Agile company and that decision changed my career path and life in general a lot. My fear of Java is now gone, instead it made me love the language better and everything during the internship training just solidified my passion to be a web developer. Thank you all!


Does EF mean you might never have to use SQL or design database tables again?

Does Entity Framework mean you might never have to use SQL or design database tables again? Is this what "persistence ignorance" means? I am new to EF and ORMs in general, and I would like to understand how much of it is hype and how much is reality.


How can I mirror an SVN trunk repository into a regular network folder?

Me and a small team of engineers are considering using SVN to store our electrical schematics and parts libraries; currently we just have a network folder where we put all of our files. Our company also has a separate SVN server that we have access to. I was wondering if there was some way that we could use the SVN repository to store our files and schematics, but then somehow have the trunk SVN repository be automatically mirrored into a non-SVN network folder like we currently have. The reason I am asking for this is because sometimes non-technical people need to access our schematic data, and we don't have enough resources to teach everyone how to use SVN. This way we could have everything under revision control, as well as allowing other people to continue accessing the data in the same way that they are used to.


How do you define a project for a web developer?

I am primarily a web designer, and a very rookie web developer. Say I have a comprehensive web app I want developed through a freelancer on Odesk.com What is the best way to effectively communicate the entire project, goals and requirements? Wireframes, spec sheets? Any examples/templates on this would be greatly appreciated.


Does it make sense to avoid a framework when building a large webapp with PHP?

Being a PHP web application developer for several years now, I've had my share of MVCs and frameworks. At first I thought they were the best thing since sliced bread; everything seemed to be very easy to implement. Now however, it seems that the more complex the application gets, the more hassle the framework introduces, so I have to develop workarounds to overcome them. Such workarounds are usually pretty daunting and complex since I have to delve down into the framework core code and make changes so that it behaves the way I want. For example, in one of my projects where I use Slim(C)+Idiorm(M)+Twig(V) (which I believe is very flexible), I have to create a custom function just to display dynamic data in parent templates; without a framework I could have simply executed mysql_query() in the included file. Okay, frameworks are cool if I'm creating a simple company profile website; I can just whip some code in one night and they're usually ready by the morning, and the amount of good coding practice and design patterns I've learned from them is very valuable. But really, for a complex web application like an all-in-one web based school management system, frameworks usually get in the way of my business process like in the example above. So my question is: is it okay to just go back to basics, and use standard PHP code and libaries for doing my next project where there might be a gazillion frameworks and libraries, provided I can sufficiently use good coding practices and follow sensible design patterns like MVC? My development team is pretty small: only 2 programmers and 1 designer. The other programmer agrees with my thoughts above.


How can I avoid using my own name in the identifiers, packages, or namespaces of open sources projects I create?

I do a lot of development in my own time. These projects I work on are all just for fun and learning (so far). I commonly do Java development with Maven but I have also been known to dabble in .NET and Python. All of the projects I work on use open source licenses, although most of them are not on any public code repositories. Java/Maven development requires me to use a unique `groupId` (e.g. "com.mydomain") and a unique `package` (directory) structure, usually containing the `groupId` while .NET development encourages unique `namespaces` in which I use similar conventions to the Java `package` concept. To ensure uniqueness, I usually just use one of my domain names with the parts reversed (e.g. "ca.jessewebb"); I believe this is a very common practice. I am in the initial stages of creating a new, open source, Java/Maven project (let's call it "newproj") and I would like to put it on GitHub. My username on GitHub is "jessewebb" so this will give it a URL like: `https://github.com/jessewebb/newproj`. I don't want to bother registering the "newproj.com" domain name so I decided to use "ca.jessewebb" and "ca.jessewebb.newproj" as the `groupId` and `package`, respectively. It occurred to me that the presence of my personal identity in the code and as part of the project's home (in the GitHub URL) will likely cause a potential contributor to think twice about getting involved with my project. This is a problem, I don't want it to be _my_ project. I would prefer if I could, instead, convey the message that I do not own the project. Now, in all honesty, it really isn't that big of a deal because I doubt my projects will garner much community involvement but I also see this as even **more** of a reason to avoid any possibility of deterring would-be contributors. For another example, I created a Google Code project a few years ago (let's call it "oldproj"). When I created the project, I knew I was going to host it on Google Code so I used the `groupId` and package name of "com.googlecode.oldproj", which is the reverse of the default domain name Google Code provides every new project. This turned out to be a not-so-great idea; a year or so later, I moved the code to a different repo and I had to rename these identifiers (well I didn't _have_ to but...). At the time, I didn't own any domain names and I ended up buying the domain name "oldproj.com" and I used it. I liked this because it gave the project its own identity and I wasn't stamping my name on the code everywhere. I could have just as easily registered the "jessewebb.ca" domain name and used "ca.jessewebb.oldproj" as the package name but I didn't because I had the same concerns back then too. So my question is... How can I avoid using my own (domain) names when creating open source projects while still maintaining uniqueness of packages/namespaces? As projects gain more momentum, it makes sense to register the domain names but it seems silly and a waste of money to do this earlier on. I realize that I don't actually have to **own** the domain name to use it in the code but that feels wrong and can lead to a squatter snatching it from under you in the meantime. What do other people do about this dilemma? Are there examples of popular (widely used, large community, etc.) open source projects that contain the original developer's identity as part of its own identifier(s)?


Learning frameworks without learning languages

I've been reading up on GUI frameworks including WPF, GTK and Cocoa (UIKit). I don't really do anything related to Windows (I'm a Mac and Linux guy) or .NET, but I'd like to be able to throw together GUIs for various operating systems. We are in the enviable position now of having high level scripting languages that work with all of the major GUI toolkits. If you are doing Linux GUI programming, you could use GTK in C, but why not just use PyGTK (or PyQt). Similarly, for Java, one can use JRuby. For Mac, there's MacRuby. And on .NET, there's IronRuby. This is all fine and good, and if you are building a serious project, there are tradeoffs that you might encounter when deciding whether to, say, build a WPF app in C# or in IronRuby, or whether you are going to use PyGTK or not. The subjective question I have is: what about learning those frameworks? Are there strong reasons why one should or should not learn something like WPF or Cocoa in a language one is familiar with rather than having to learn a new language as well? I'm not saying you should never learn the language. If you are building Windows applications and you don't know C#, that might be a bit of a problem. But do you think it is okay to learn the framework first? This is both a general question and a specific question. I've used some Cocoa classes from Ruby and Python using things like PyObjC and there always seems to be an impedance mismatch because of the way Objective C libraries get built. Experiences and strong opinions welcome!


How to determine what throws an exception

Whenever I encounter crashes, the exact type of the exception usually already gives enough info to easily find the culprit. **FileNotFoundException** will hardly occur while using sockets. Now recently I encounterd a **SystemNotSupportedException** and had no idea where it could come from, still don't. Also I cannot reproduce it, so I am designed to find it by detective work, rather than just running the debugger and crashing that thing. I checked through MSDN's article on this exception, hoping to maybe find something like "this type of exception is usually thrown in connection with file operations / integer-math / riding dinosaurs to Taco Bell / you-get-it", to no avail as MSDN only associates the other way around which is commonly more useful indeed. So here's my question:   Is there a lookup-table or something that allows me to determine what operations could cause a specific exception?


Difference between a Quality Engineer and a Tester

In a software firm there are three kinds of jobs   1. Software Developer   2. Software Quality Engineer   3. Software Tester The role of a software developer is quite clear but what's the difference between the jobs done by a Software Quality Engineer and a Software Tester? It's very strange for me why there is so much of a difference in the salary levels of a Software Quality Engineer and a Software Tester.


How to store / not to store passwords

I am building an web site which will allow users to aggregate the information stored in their online profiles ("data feeds") in one place. I am wondering - what is the accepted (from a secureness point of view) way to store user name / password information in a my database? Normally I would derive a salted-hash value from a password and would store this, but that obviously would not work in this case, as "data feeds" websites would need an actual password. Storing the credentials it in a clear text is not an option, as it would be a huge security risk. Not storing passwords in a database, asking users to type them in at the beginning of each session and then keeping them in a in-session memory does not seem like a viable option either, as it would be too much trouble for users to enter the same passwords many times again and again. So far it seems that the only option is to encrypt passwords somehow, but I don't know what are the best design patters for such option. Or perhaps there is way to deal with that problem, I haven't even considered ... What would you recommend?


What's the computational complexity of the Groovy unique() method?

**Question 1** What's the computational complexity of the Groovy `unique()` method? **Question 2** How could I have figured it out by myself? The `unique()` method is defined in the class `DefaultGroovyMethods`. The source code can be found here: org.codehaus.groovy.runtime.DefaultGroovyMethods. Can you point me to the piece of code which illustrates the answer to question 1?


Refactoring from Python to Ruby with a BSD v3 license?

There is a project that is written in python which works great and is under the BSDv3 license. I wanted to use it as a base template for a ruby project instead of starting from scratch. I'd be refactoring (converting) the code from python to ruby, as if the author wrote a ruby gem along with his python library. My question is what proper credit should be given to the python lib author?   Just mention that the gem is based off the python lib or more extensive?


Are Java applets worth learning?

I'm on the way of learning Java myself. I find most of texts giving emphasis to Java applets. I got confused about the importance. Is it something widely used? Do I need to spend more time on it?


Checking equality of a request parameter

I have a codes table that stores name value pairs and a group name. So for this example let me demonstrate with two rows, each row would represent one value in the same drop down. Group Name = 'Drop_Down_1' Name = 'Value 1' Value = 'This is my value' Group Name = 'Drop_Down_1' Name = 'Value 2' Value = 'This is my value 2' This value would be apart of a drop down on a webpage. When selected and submitted the backend code would get the value 'This is my value', if that value in the drop down was selected. Now depending on the drop down selection I want to do something. So now i need to compare the string in the request command to something. What I do NOT want to do is something like this:                   if(requestParam.equals('This is my value') {             do something         }         else if(requestParam.equals('This is my value 2') {             do something else         }      Now I can query the database and get the appropriate codes back and check against those for equality. But How would i know what action to perform?


What would it take to get developers to pay for something that is already freely available as open source?

For example, I know that open-source versions of IL readers/writers exist such as Cecil, and Microsoft's (closed source) CCI. What would it take to get developers to pay for something that is already freely available? I have always wanted to start my own ISV by writing my own tools and selling them in the open market, but it's hard to gauge the demand, given that free alternatives already exist. Does anyone else have any successful experiences selling a commercial version of an open-source product?


How would you represent an object that can be of multiple types, when storing it as a document in MongoDB?

Somewhat related to this question, say that I have an object category which, depending on which type of object I have, has different restrictions on what it contains. (if you can reword the previous sentence to make more sense I'd appreciate it) For example               var SomeSchema = new Schema({       _id: ObjectID,       [... large number of common fields ...]       type: //Restricted somehow to members of a fixed array       data: //depending on type, this might be restricted - sometimes an integer, sometimes array, etc...     });      What's the idiosyncratic method for defining this type of schema? Is it appropriate to define a single schema, and handle the types inside of it's members, or am I better off with separate schema for each type?


How to simulate an ATM terminal in a POS

Recently I started same projects to improve my programming skills, so I tried to develop a point of sale software. I started to bay the required hardware (ticket printer, Barcode Scanner….) to make my personal lab, but I’m unable to find how to implement the payment process using an ATM terminal. Is there any possibility to simulate the payment process whiteout having the equipment?


On naming conventions: would you recommend short names or longer, more descriptive names?

I'm consistently being asked by a colleague to shorten my identifiers (class names, mostly). We use CamelCase and rarely if ever use 4 words in a name, but I often get requests to shorten from 3 to 2 or even from 2 to 1. I favor the most descriptive name and am able to find one of acceptable length, 95% of the time that is 3 words or less. **Would you try to go shorter?** Recently it occurred to me that he may not have auto-completion, but would not ask him this because I wouldn't like to offend him. He's a vi/vim guy which made me thinking....


Should event listeners be held in weak references?

Usually event listeners shouldn't outlive object that registered them. Does it mean that event listeners should be held by weak references by default (stored in weak collections by the object listeners are registered on)? Are there valid cases when listener should outlive its creator? Or maybe situation like that is a mistake and it shouldn't be allowed?


Dealing with technical debt and nearing release

Say you have a project that is a tangled mess. No code structure and breaking one area breaks the entire thing. Fixing one area breaks another area. The closest you can fix things is writing the code that's almost like redoing the entire thing. But then, **the release is in the next week**. Here's some facts that actually worsen the situation:   * There's very minimal testing. Makes breaking hard to find.   * The code has no structure. Imagine one app has everything _in one file_.   * No documentation. Very hard to replicate server requests when there's no documentation about the parameters to send, and what to expect. What should one do to address this situation? The best thing to do is extend the project release, but I'm not the one who calls the shots. I did comment on the issue though.


How to track features in a big project ?

I am currently working on a project of my own for a little over 2 months (not much time on my hands). The purpose of this project is to be able to remotely update all of my Linux systems from one graphical application. The problem I am having is I am building two applications: the client and the server. As the size of both the programs increases, I am finding it harder to manage what needs to be done. While coding I am trying to think of things that need to be done and with the addition of another program it's starting to make my head spin. **Is there any technique by which I can track the features: yet to be implemented and currently under development features in a big project?**


Add javascript to all pages (for caching), or only to the pages that require the scripts (for a smaller page size)?

I'm using bits of javascript on my website for an image gallery, smooth scrolling, etc. These scripts are not used on every page (not every page has an image gallery for example). However, the scripts aren't very big and most users will have to download them eventually (the image gallery is very central to the website). Now what would be the pros and cons of these two (mutually exclusive) ways of including the scripts:   * add them to every page (so that they'll all be cached after one page view)   * add them only on the pages on which they are used (so they're cached only when they're needed, but some pages will take a little longer)? I'm not asking for opinions, I'd just like to know if there are any pros and cons I've overlooked.


Why one would commit changes to version control every three minutes?

The frequency of commits depend on two factors:   * the developer himself: some developers tend to commit often, others may spend hours without committing,   * the current work: the same developer may have to commit very frequently when effectuating risky refactoring operations or similar tasks, and quite rarely when working on other parts of the codebase. From what I observed, beginners tend to commit one or two times per day on average. Developers with a few years experience are probably committing once per hour on average. Committing every fifteen minutes is probably the best thing to do, but I've rarely seen this commit frequency. **Question:** I've spotted in Google Closure Library logs that it has commits nearly every three minutes from the same developer. What are the benefits of such high frequency? Are there consequences on the way the code is written? Is it related to the fact that at Google, codebase is compiled and tested on servers and so one should commit the code to see if it compiles and passes all the unit and integration tests?


Migrating old Asp.net 1.1 project to mvc 3 or 4

we have to migrate a very old project that are having more than 500 web forms and 400 tables and it is hugely depends on stored procedures, the current specification is:   1. Asp.Net : .NET version 1.1   2. language: VB   3. uses 2 Tier architecture (UI and business(includes DataAccess also))   4. xml is used to pass the data between UI and Biz layer   5. For data access sql queries and stored procedures are used that fetch data as dataset.   6. Finance related domain.   7. a lot of javascript for validation Planned specification:   1. Asp.net 4.0 with c#   2. MVC 3 or 4 Now my questions are   1. Is it possible to implement mvc only for UI layer, if possible then how to use current business layer? Also we don't have class and properties because it uses xml to pass data, also we have to use same legacy database.   2. We don't want to use Entity framework, because of performance, legacy database(not properly designed), uses more than 700 stored procedure.   3. how to create model i.e Domain level or project level because my solution contains 14 projects?   4. Is it possible to implement Repository pattern in separate layer?


What is the best toolset for developing an enterprise application for SMBs?

Need a Free, Fast(development and runtime) and Reliable(transactions and locking) tool set for creating an enterprise application for SMBs. I'm thinking of an application framework + UI framework + DB which will help me in developing the software faster. As it is known, business softwares need lot of similar UIs to be created. My idea is ...to create a new form with N number of fields and connecting it to the database for basic CRUD operations within 30min to 1hr. I got the taste of Intersystems Cache technology stack with an app framework on top of it. To be frank...it is amazing... I'm looking out for something similar to this in opensource. Any suggestions?


Better design for a generic doubly linked list around which I plan to make different wrappers?

I am currently writing a C code for a doubly linked list(dll) around which I want to write wrapers for implementing stack, queues etc. instead of writing separate codes for all of them. I'll be using `void *` for making it possible for the doubly linked list to work with any data type. The idea is basically the same as this implementation of stack using pointers in my github. I am thinking of 2 different designs   * Placing the size of elements alongwith the maintenance data. That would make coding easier but any instance of dll would be able to use only a particular data type.   * Placing the size of element in the nodes. That would make it more general but I have concerns whether this approach would be easier to use? This is the confusion that I wanted to clear before implementing any particular one. If there is any confusion regarding what I am trying to implement then please ask and I'll clarify.


Realistic time to learn new framework/API

I have my ideas, but I always feel that I'm overly pessimistic. So I'd like to hear more opinions. How much time do you need to start coding using a new framework so that your code is production ready and not become a support nightmare later on for: Say large scale frameworks:               ATL/MFC/STL/WTL/.NET/COM/BOOST      And small scale frameworks/APIs:               MSXML/Silverlight/ADO/LIBXML/WIN32/OpenGL/DirectX/CUDA      What are your estimates for both types, [from;to] for both senior/junior developers. Any ideas on what can decrease the learning time say: `Book>API doc`, or `Tutorials>Book`


What kind of a test is a "consistency check"?

Some or all of the tests I write and run are checks for consistency e.g. assert that if I create a new user account, that the account that was created actually has the same name as the name that was submitted in the registration. And now for checking that I implemented a pagination correctly, I suppose I can check that for any given large resultset, getting the "next page", sometimes repeated times and not only once, will eventually lead to the same last page as getting the last page directly (which is done another way than stepping through one page at a time, going directly to the last page in done by using the reversed order and getting the first page from the reversed order. In our projects we try to follow test-driven development but sometimes I think it is not exact whether a test is a unit test or an integration test when in fact both the integration tests and the unit tests are mostly or only "constistency checks". I didn't see any other type of test than for consistency (both the unit tests and the integration tests do assertions), but it seems that mocking is used more in integration tests than in unit tests and than a unit test is smaller and for a single component or method while an integration test is "larger", but that is still not an exact difference. So what kind of a test is a consistency check? Is it a unit test or an integration test?


What do I need to know before approaching a web developer/ developing team?

I have little experience in website programming. However, I have an idea for a website that I would like to make real. It would have many of the same features that a site such as TripAdvisor uses, but obviously on a smaller scale, and its main feature being a user rating system. Whilst it would be ideal for me to learn how to do it myself, I feel it would be unrealistic given the complexity and time consuming nature of it. Therefore, my question is what will I need to know and understand before I approach a web developing team?, i.e., what are the questions that they will ask me when I sit down to talk with them about my idea? On a slightly separate note, what are the legal restrictions on creating a website that has already been done? There are a small number (2 or 3) of websites that I would be essentially doing the same as, but in my opinion, I would be providing the users with far more useful features in a more user friendly manner.


Design Pattern for Data Validation

What would be the best design pattern for this problem: I have an Object A. Object A can either be registered or deleted from the database depending on the user request. Data validation is performed before registration or deletion of the object. There are a set of rules to be checked before the object can be registered and another set of rules for deletion. Some of these rules are common for both operations. So far, I think the Chain of Responsibility design pattern fits the most but I'm having trouble implementing it.


My Programming Challenges

I love programming and I can't imagine living without it. The problem is when I am developing my own unique algorithms I find it difficult to properly co- ordinate my thinking and I spend more than the reasonable time trying to visualize the solution, although I usually find the solution. I think spending that much time on sometimes "not that hard" algorithm show's that my thinking strategy might be wrong. Have you experienced similar issues? How do you solve it? Or am I wrong? Please advise me.


Compatibility between Class Diagram and Sequence Diagram

Do the `message` being passed between `objects` in `Sequence Diagram` match with the `methods` in `Class Diagram`?


How do crackers determine number of iterations of a Hashing algorithm?

Does a cracker need to know the number of iterations a hashing algorithm uses to compute a hash? If they don't know it, how do they figure it out? How much longer does it take to figure it out, than if they didn't know? I can only guess that they try a number of the most common passwords, and try it with different iterations, and see what amount of iterations returns the most correct passwords. Would this even work though?


Problem combining SlidingMenu and ExpandableListView

As said i'm trying to combine SlidingMenu (https://github.com/jfeinstein10/SlidingMenu) with an ExpandableListView, but i'm having an issue that i don't know how to fix, so i'm hoping some one here can. I'm currently setting the layout for the menu by 'setMenu(resId)' function, which sets the correct layout for the slide menu, but the problem is that it only sets the XML file layout, which simply includes a and nothing else (So all i get is a white screen).   All other data and settings for the ExpandableListView are set in my SlideMainMenu.java file, but this is never called when setting the XML layout for the slide menu. So how can i make sure my .java file is called when my XML file is inflated?   It's most likely very easy, but at the moment i just can't seem to figure it out. I should mention that i'm fairly new to Android/Java, and i'm learning as i go.. setMenu function:               menu.setMenu(R.layout.expand_listview_main);      Start of SlideMainMenu.java               public class SlideMainMenu extends Activity {              ExpandableListAdapter listAdapter;         ExpandableListView expandableListView;         List<String> listDataHeader;         HashMap<String, List<String>> listDataChild;              @Override         protected void onCreate(Bundle savedInstanceState) {             super.onCreate(savedInstanceState);             setContentView(R.layout.slide_left_main_menu);                  Toast.makeText(getParent(), "SlideMenuInit success", Toast.LENGTH_LONG).show(); // TEST                  expandableListView = (ExpandableListView) findViewById(R.id.ExpandableListView_Main);             prepareListData();             listAdapter = new ExpandableListAdapter(this, listDataHeader, listDataChild);             expandableListView.setAdapter(listAdapter);


Why does the assignment operator assign to the left-hand side?

I began teaching a friend programming just recently (we're using Python), and when we began discussing variable creation and the assignment operator, she asked why the value on the right is assigned to the name on the left, and not vice-versa. I had not thought about it too much before, because it seemed natural to me, but she said that left-to-right seemed more natural to her, since that's how most of us read natural languages. I thought about it, and concluded that it makes code much easier to read, since the names that are assigned to (which the programmer will need to reuse) are easily visible, aligned on the left.               aligned = 2     on = 'foo' + 'bar' + 'foobar'     the = 5.0 / 2     left = 2 + 5      As opposed to:               2 = aligned      'foo' + 'bar' + 'foobar' = on     5.0 / 2 = the      2 + 5 = right           # What were the names again...?      Now I wonder if there are other reasons as well for this standard. Is there a history behind it? Or is there some technical reason why this is a good option (I don't know much about compilers)? And are there any programming languages that assign to the right side?


How do professional application developers use version control systems, like GIT and Subversion?

I am a beginner developer and I have been wondering from the start, how do professional use tools like GIT and Subversion (I don't have a very good understanding about these tools), to fulfill their project's needs. If they do use it, how would I set up something like that? My applications are not so large and I am not working in a team yet, would they be of huge help to me? There are questions on this site about how to use the tools, but I need beginner support.


Why creativity is consider a bad practice by architects?

If you do something creative (for example I did a new approach to logging) is consider a bad practice. the good practice in Java is to put static field logger in every class. My approach creates static 5 static field in a single class (less code) and just calls methods that have access to it. I don't care about my logging framework, its just an example. I feel that any best-practice that is forced for no good performance or clean code reasons is bad-practice. I understand for example that all data that can change should be in xml or properties files, because later if you need to manually change WAR is easier to change .xml than .class. You could regenerate WAR, but than it would make putting constans in xml and properties look pointless.


How much does a web developer need to know about Linux?

I was just wondering if a typical PHP developers needs to be very familiar with Linux. I am studying Linux right now and I believe some of linux knowledge is not required for a PHP developer job (not sure if I am right about that). For example, vi or shell programming. In sum: what should I learn about Linux if I only want to land a PHP developer job.


When did the first "REST"-model and friendly URL web technology come to be?

Everyone knows that the "current" way to do things is to have user-readable URLs. Like: http://example.com/blog/edit/1234 Rather than: http://example.com/blog.php?action=edit&id=1234 When exactly did people start making web technologies handling this though? I remember in the dark ages of the early 2000s, I don't remember ever seeing a friendly URL. In fact, I think Stackoverflow (in 2008/9) may have been the first time I noticed them. When exactly did this become so popular, and what were the first servers/frameworks built with friendly URLs in mind? I'm interested as well in when rewriting to friendly URLs became common, and when serving friendly URLs natively became common


How to handle this unfortunately non hypothetical situation with end-users?

I work in a medium sized company but with a very small IT force. Last year (2011), I wrote an application that is very popular with a large group of end-users. We hit a deadline at the end of last year and some functionality (I will call funcA from now on) was not added into the application that was wanted at the very end. So, this application has been running in live/production since the end of 2011, I might add without issue. Yesterday, a whole group of end-users started complaining that funcA that was never in the application is no longer working. Our priority at this company is that if an application is broken it must be fixed first prior to prioritized projects. I have compared code and queries and there is no difference since 2011, which is proofA. I then was able to get one of the end-users to admit that it never worked proofB, but since then that end-user has went back and said that it was working previously......I believe the horde of end-users has assimilated her. I have also reviewed my notes for this project which has requirements and daily updates regarding the project which specifically states, "funcA not achieved due to time constraints", proofC. I have spoken with many of them and I can see where they could be confused as they are very far from a programming background, but I also know they are intelligent enough to act in a group in order to bypass project prioritization orders in order to get functionality that they want to make their job easier. The worst part is is that now group think is setting in and my boss and the head of IT is actually starting to believe them, even though there is no code or query changes. As far as reviewing the state of the logic it is very cut and dry to the point of if 1 = 1, funcA will not work. So, this is the end of the description of my scenario, but I am trying not to get severally dinged on my performance metrics due to this which would essentially have me moved to fixing a production problem that doesn't exist that will probably take over 1 month. I am looking for direct answers to this question. This question is not for rants, polling, or discussions as this is not the format for StackExchange. Please don't downvote me too terribly it is pretty common on this specific site of stack, I am looking for honest answers to this situation and I couldn't find a forum more appropriate.


Research topics for starting and optimizing a high-traffic website

I bury a good deal of my ideas for fear that I don't know enough about scaling web applications and high-traffic websites. That said, I'd like to know of any general topics to research in order to ensure that your web app doesn't break / slow down when you start getting to Twitter-level traffic. I'm looking for research topics with, preferably, additional resources. For example: **Make sure you optimize SQL queries (seeHigh Performance MySQL Optimization)**


In an oft-cited (if dated) reference for C# coding standards (pdf; from Lance Hunt), the statement is made, > 33\. Avoid invoking methods within a conditional expression. I've not seen this recommendation elsewhere, including in the .NET guidelines (here or here). Unlike the other very reasonable guidelines in Hunt's document, this suggestion seems unintuitive to me. Can someone provide a justification for it?