How Do You Determine Your Hourly Rate?

In pricing a service or product it is general practice to not merely charge for the effort spent and the costs involved + margin but from the value delivered down. As an independent consultant, how do you set the price of your work? What is the process of determining your hourly rate as an independent software developer? If you have one, what is your hourly rate and how did you arrive at that figure? What factors would you take into account. Is the process of setting a hourly rate only based on balancing demand with supply so that supply (you and your time) doesn't get overwhelmed? When are the good times to raise your rates? Are there projects in which you have had to charge higher than other projects? If so, please cite examples. Do you change your hourly rate based on what kind of development you are doing? (for example, .net programming more, and lesser for php programming) Do you set hourly rates based on what type of business the client is? If so how? If you know of any relevant articles or material on the topic of charging for programming services, please post the same.


Relevance of HTML5: Is now the time?

It seems like most of the jobs I'm receiving, and most of the Internet, is still using standard HTML (HTML 4, let's say) + CSS + JS. Does anyone have any vision on where HTML5 is as a standard, **particularly regarding acceptance and diffusion?** It's easy to find information about inconsistencies between implementations of HTML5 and so forth. What I want to know about is relevance of HTML5.


Why do interrupts need to be turned off when inside other interrupt code?

Simple question that will help me understand my OS class... thanks! Basically, why is it unsafe to have an interrupt within an interrupt? (or exception within exception)


Why is there an emacs vs. vim debate?

I'm new to the whole scene, so I was wondering why programmers tend to be really passionate about this debate? Thanks. Also, are these referred to as "text editors"?


Is there an open source license for this?

I have written code at home, on my own time and using my own knowledge and equipment, while under no contract or NDA. I want to make this code open source so that I can use it in software I write for an employer, without denying myself the right to use it at home or elsewhere later. I'm not sure if saying it is in the "public domain" would fit this purpose, or if I need to find an open source license. I want anyone to be able to use the code in closed source proprietary software with zero requirements for including a license with the source or binary. And I want to minimize the risk of anyone being sued for using it. (I'm aware that one can never be 100% safe from being sued.) Is there an open source license that fits this purpose? To what extent is what I want to do even possible? I wouldn't mind putting the license in comments in the code files themselves, but that obviously doesn't go with the binary.


Could spending time on Programmers.SE or Stack Overflow be substitute of good programming books for a non-beginner?

Could spending time (and actively participating) on Programmers.SE and Stack Overflow help me improve my programming skills any close to what spending time on reading a book like Code Complete 2 (which would otherwise be next in my reading list) will help. Ok, may be the answer to this question for someone who is beginning with programming might be a straight no, but I'd like to add that this question I'm asking in context when the person is familiar with programming languages but wants to improve his programming skills. I was reading this question on SO and also this book has been recommended by many others (including Jeff and Joel). To be more specific, I'd also add that even though I do programming in C, Java, Python,etc but still I'm not happy with my coding skills and reading the review of CC2 I realized I still need to improve a lot. So, basically I want to know what's the best way for me to improve programming skills - spend more time on here/SO or continue with CC2 and may be come here as and when time permits.


systems/software engineering design process

I just developed my first non-trivial android app. It was a complete nightmare. I came up with an idea, build the app, changed my idea, and implemented a lot of input from others on new features. All in all my app took 10 times longer than I think that it should have, it is almost impossible to look the source code and tell what's going on with the classes, and may or may not have unused methods that I'll never be able to find... So I would like an opinion from those of you with experience on how to plan out my designs for the future. I created a flow chart (pencil drawn) of a plan: ![flow chart of plan](http://i.stack.imgur.com/Nyi2U.jpg) I would like constructive criticism.


How can I pull data from PeopleSoft on demand?

I work in IT at a university and I'm working with about 5 different departments to develop a new process for students to apply to a specific school within the university (not the university as a whole). We're using a web-based college application vendor and adding the applicant questions for the school itself to the main university application. Currently the main application feeds into PeopleSoft. The IT staff here is building a new table to hold just our school's applicant data. I want to be able to access that data from PeopleSoft for use in external applications, but our IT staff doesn't really seem to understand what I'm requesting, as they simply tell me I can have access to the PS query tools. The problem is, I don't want to run just ad hoc queries, I want to be able to connect from outside PeopleSoft and show current data within the external app. I am unable to find documentation or get a clear answer to my question. Does PeopleSoft support access via a web services API or anything similar, and does that sound like the right direction for me to take?


How are blocking calls implemented?

This may be a very simple question. I'm curious how blocking calls are implemented. Specifically, how do they block? Is this just thread.sleep?


Google App. Engine for RoR and Python apps

I fairly understand that this Q+A site is programmers destination and questions on hosting are not permitted here, but anyone who has heard of Google's App. Engine is well aware that this question is suited for this site only. Google App. Engine supports either Java or Python interpreter. I want to know what type of applications can be hosted on this engine? If my Python or RoR application needs a database behind, will this engine support it? For RoR applications, which interpreter to choose? What are the advantages of Google App.Engine over a local IDE?


Demand of other frameworks in the market. Should a job-seeker go after them?

I have reading about variety of frameworks for web applications like OpenRasta, Django, CodeIgniter etc. It is a passion of developers to dip their hands on any new technology, but from the job-seeker's point of view, what is the significance of these new buzzes. Is it better for a job-seeker to stick with the standard frameworks like ASP.NET, Rails etc., or devote time on other open-source frameworks as well?


Why am I never completely satisfied with my program?

For as long as I've programmed, I've never really been entirely satisfied with any projects that I've finished. Sure, they do what I've set out to do, but there has always been _something_ in the code that I, in retrospect, would have done differently but can't be bothered to refactor. Is this just me, or is it a common programming trait?


Where to set the model in this design (service-provider pattern)?

we are modelling an application using the "Service-Provider" pattern, where the service will offer a generic functionality implemented by different providers registered on the service. The responsibility of the service will be to choose the right provider based on certain conditions. The layers we currently have are the following ones: ![enter image description here](http://i.stack.imgur.com/QjZXP.png) What I don't like about this approach it that the client needs a reference to the providers to access the A definition. I think that normally dependences should go only from one layer to its layer below, right? One solution could be duplicating the model on the service layer but that would mean duplicating ... and of course we should avoid that: ![enter image description here](http://i.stack.imgur.com/h4qlF.png) Another solution could be creating a package only for models, but this could be overkill and also breaks the top - down dependency chain: ![enter image description here](http://i.stack.imgur.com/k8P3K.png) I'm not happy with any of these solutions but I currently do not have others. What do you think, do you like any, are there others that I have not thought about? Thanks in advance.


Should we do entity-relationship modeling or object-oriented modeling first?

When building an application from scratch, should I start with the object- oriented (OO) model or the entity-relationship (ER) model?


Best approach for a Java web chat client

I am trying to add a chat to my web application written in Java. What would be the best solution in this matter? I have read something about JMS, but the pub/sub pattern doesn't seem to be designed for this kind of usage, and for the p2p pattern, I need to build a queue for each user(this doesn't sound right neither). What would you suggest?


Interactive training site for Javascript complete with code challenges

A few months ago I discovered a cool course called Rails for Zombies. This is a great site that allows us to write code and see the results. It takes us through the paces to get us up to speed with Rails. You have to pass each level (including code challenges) before being taken to the next level, and it gets you grounded in the fundamentals of Rails. I'm wondering if an interactive tutorial site exists for Javascript? One that will walk me through the paces of writing better Javascript, and challenge me along the way.


Specification languages vs automated tests

I recently listened to an episode of Software Engineering Radio in which Leslie Lamport was interviewed. One thing he discussed was his specification language, TLA+. Essentially, he seemed to be arguing that, for programs where correctness is very important, we need to think carefully and specify carefully before writing code, and TLA+ is meant to be a tool to do that. He said a team at Amazon has recently had success using it. Personally, I write executable tests for my code. I see the tests as a specification, which has the huge benefit of **proving** whether the code conforms to it. I assume that Mr. Laport, being a brilliant and accomplished computer scientist, has long known about this, and still sees a need for his language. But why? Are formal specification languages and automated tests complementary approaches, or at odds? Do they lend themselves to different kinds of code?


Reverse Engineering PHP application without reading the (ugly) Code

I have this new customer, that has this PHP App. It was written by a single developer that wanted to "make yet another framework" back in 2005. About 3 Years later the developer left the company, and with him all Knowledge on what this thing is actually doing. Now, as the App already went in production the manager just hired a few more developers / freelancers (that are not available anymore too) to fix bugs here and there and develop some more functionality. Some tried to follow the undocumented guidelines of the software, some did not. You might be able to imagine how the code looks today ... its an utter mess! I talked to the manager and told him what I think of his software and managed to get him to realy think about rewriting the damn thing. But here comes my problem: To be able to estimate the effort needed to rewrite I would need to know what the thing is doing. The manager can tell me from his perspective what it's doing but there is just no technical knowledge about it. And as with all software that grew over years there are these "special edge cases". Basically my idea is "record/log" the live system for a few weeks to actually get a technical, somewhat complete conclusion of what this thing is doing most of the time and what are the things that rarely get touched/used. E.g. what was the Request and what route did it go to render the results. Reading and trying to understand the code is impossible. It would help though to see which Classes/Functions are called and then read/understand them. So, is there any tool to log/record Http Request/Responses and what call graph of the php app it triggered? Preferably something that would not have to get written into the code? I ditched PHP years ago and am somewhat rusty with my PHP Utility and Standard Library Toolset to know of something that could help me here.


Company wants to move its programs to a new framework / concept - what are options?

So there is an insurance company which wants to move long term its proprietorially written software for different insurance products to a new platform / framework / concept / something. One of the applications is ~700 pages big. We would require some workflow application (ibm websphere products?). Transaction control, historisation, support for running batches, integration of different systems (basically our DB2 is on a host zOs system). The front end is a web gui. The business logic code is written in C++. We would like to move step by step to the new environment. What would be good options?


More idiomatic syntax for 2nd level vector value update

I'm pretty sure there has to be a more idiomatic way of writing this:               (defn update-2nd-level-vector       [map index value]       (assoc map :key1 (assoc (get map :key1) :key2 (-> map (get-in [:key1 :key2]) (assoc index value)))))      Example of its working:               => (update-2nd-level-vector {:key1 {:key2 [0 1]}} 0 1)     {:key1 {:key2 [1 1]}}


What are binaries?

I see very often people using term **binaries** in different context. What are binaries? Collection on binary files, installation files, .dll files or what? Or is it just an general term for some collection of files on disk?


What is the best design decision approach?

I have two classes (named `MyFoo1` and `MyFoo2`) that share some common functionality. So far, it does not seem like I need any polymorphic inheritance but, at this point, I am considering the following options:   1. Have the common functionality in a utility class. Both of these classes call these methods from that utility class.    2. Have an abstract class and implement common methods in that abstract class. Then, the `MyFoo1` and `MyFoo2` classes will derive from that abstract class. Any suggestion on what would be the best design decision?


OpenSSL Client model for half duplex communication over socket

I have read in this SO question that OpenSSL socket communication can be only half duplex in a single thread. Assuming what I have read is true, I am wondering if I can apply philosopher's dining problem to send SSL_write() and receive SSL_read() on a non-blocking socket in a single thread that communicates with a OpenSSL TCP Server. Both server and client are non-blocking. Would that be a good model? Or should I always set priority to read SSL_read()? What would be the best approach to code? I am using C++ to code this single threaded non-blocking socket model (without BOOST or other libraries).


When to use Constants vs. Config Files to maintain Configuration

I often fight with myself on whether to put certain keys in my web.config or in a Constants.cs class or something like this. For example if I wanted to store application specific keys for whatever the case may be..I could store it and grab it from my web config via custom keys or consume it by referencing a constant in my constants class. When would you want to use Constants over config keys? This question really applies to any language I think.


I am working on site which have a lot of configuration and security settings and I have to check either clients browser is on trusted zone or not using JavaScript. Is it possible to determine whether my web site is being accessed as a trusted site? The reason I'd like to do this is that some functions won't work unless the site is being accessed as a trusted site, and I'd like to be able to warn users. Is there any solution ?


Correlation between college grades and job performance?

In Facts and Fallacies of Software Engineering at the end of fact 2, Robert Glass says: > The problem is—and of course there is a problem, since we are not acting on > this fact in our field—we don't know how to identify those "best" people. We > have struggled over the years with programmer aptitude tests and certified > data processor exams and the ACM self-assessment programs, and the bottom > line, after a lot of blood and sweat and perhaps even tears were spent on > them, was that the correlation between test scores and on-the-job > performance is nil. ( **You think that was disappointing? We also learned, > about that time, that computer science class grades and on-the-job > performance correlated abysmally also [Sackman 1968].** ) Is this fact supported by more recent papers?


For small-ish programs, should a single method handle most method calls to centralize program flow?

I'm fairly new to OOP (and programming in general), but what I find myself doing is that in the event that I don't need to pass a value from one method to another, I'll have my method calls centralized in some class within a Form.cs file. For example:               public void CentralMethod()     {         MethodA();         MethodC();         MethodD();     }      MethodA() will then do some stuff and call MethodB() directly, to which it passes a value. However after MethodB() is done, control reverts back to CentralMethod() and then MethodC() is called, etc. I can see how this is a nightmare on a large project, but is this at all a habit that one should get into on a relatively small project? I didn't necessarily do this by design, but I found myself doing it when it didn't make logical sense to include some method calls within other methods.


Can an entire software infrastructure stack be built entirely from source in-house? Is it practical and sustainable?

I'm a big fan of using open source software but I mostly use community binary releases for the job. I'm wondering about companies that go the extra degree and build everything they use in their production server application infrastructure entirely from source, in-house, in an effort to promote transparency and supportability (instead of relying on binaries). Is it practical and sustainable to do this? It seems that the sheer number of dependencies to maintain and build from source for some of the major open source projects would quickly complicate things.


Select custom output formats from database with SQL

I am planning to make a simple rest service application, and I am currently deciding the architecture. I have decided that I want to write the middle layer in multiple languages, so that it is easy to deploy/integrate with as wide a range of systems as possible. Due to the necessity of porting the code to multiple languages, I want to keep the middle layer logic as simple as possible, to alleviate the coding effort involved. I am planning to put as much code into SQL as possible. For example, traditionally, I might select some data from the database, then loop through the array of results, and process them further before sending back as a well formed response, like perhaps some HTML derived from the data. However, given I want the middle layer to be as simple as possible, I would prefer to do all the processing as SQL. I have prepared sql statements that select from my results by concatenating and using group aggregates for repeating elements. It all seems to work fine, but I have a niggling doubt that I have left the reservation. I am concerned that I have not seen this kind of thing done, so perhaps there is a good reason I have not thought of. My question is... ### Is it a bad idea to write complex formatting logic in SQL instead of application code? In terms of...   1. performance   2. maintenance of code   3. limitations of language   4. anything else **n.b. I don't want to use PL_SQL or anything like that, I am only interested in using very basic SQL commands to achieve my formatting, as I want the database code to be portable between different databases too**


What triggered the popularity of lambda functions in modern mainstream programming languages?

In the last few years anonymous functions (AKA lambda functions) have become a very popular language construct and almost every major / mainstream programming language has introduced them or is planned to introduce them in an upcoming revision of the standard. Yet, anonymous functions are a very old and very well-known concept in Mathematics and Computer Science (invented by the mathematician Alonzo Church around 1936, and used by the Lisp programming language since 1958, see e.g. here). So why didn't today's mainstream programming languages (many of which originated 15 to 20 years ago) support lambda functions from the very beginning and only introduced them later? And what triggered the massive adoption of anonymous functions in the last few years? Is there some specific event, new requirement or programming technique that started this phenomenon? **IMPORTANT NOTE** The focus of this question is the introduction of **anonymous functions** in modern, main-stream (and therefore, maybe with a few exceptions, non functional) languages. Also, note that anonymous functions (blocks) are present in Smalltalk, which is not a functional language, and that normal named functions have been present even in procedural languages like C and Pascal for a long time. Please do not overgeneralize your answers by speaking about "the adoption of the functional paradigm and its benefits", because this is not the topic of the question.


What techniques or tools do you use to make your app simpler?

I've been programming a new iOS app for about 5 months, and I'm pretty much on the final stretch. My team and I agreed to make the app more simple once we were at this point of the development process. This question doesn't really apply to a whole team (where there are people who do design for a living), but more about from a programmer's mind. I tend to dig into every little detail about a personal project, and figure out a way to create a feature for it as I'm sure most other programmers on here tend to do. While that's definitely not bad, it has to be controlled. So what I'm asking is what you all use as far as technique's and tools to help yourself keep things simple. Or in other words, how you control your programmer-type mind from not getting out of hand :P


Git: rebasing on top of a refactor that affects the target rebase branch

Let's say I have a feature (topic) branch that I keep rebased on top of my development branch. During the course of the project (before merging in my feature branch), I decide that I need to make a large refactor to my project (for example, after updating a 3rd part module). So I do this large refactoring on my development branch. Now I want to rebase my feature branch so I can take advantages of my refactoring. **The problem** There are still things in my feature branch that need refactored to match the changes I made in my development branch. Should I:   1. Go back through my feature branch's history trying to edit commits (with `rebase -i`) to make the branch look as though all of the work had been done after the refactoring.     * The advantage to this is that it keeps the history clean.     * The disadvantage is that this can take a whole lot of time if the changes made in the development branch cause a lot of changes to need to be made in the feature branch.    2. Fix the things that need to be refactored in my feature branch and make a commit for this.     * The advantage here is that it will be much easier to identify and fix things that need to be fixed     * The disadvantage is that now the tree will have _two_ commits in it for the refactor. One for the refactor done for the entire development branch, and a smaller commit done for the feature branch, once merged in it will look a little funny. Which strategy should I go with? * * * **An Example** Lets say on the development branch I rename `functionA` to `functionB`. Now In my feature branch I've never modified the file containing `functionA` (now `functionB` in development). So when I run `rebase development` while on my feature branch it rebases cleanly. The problem is if I've ever made a call to `functionA` in my feature branch, it's going to fail now since it was renamed `functionB`. Now, should I just do a find and replace for `functionA` -> `functionB` and make one commit on the feature branch (option 2). Or should I go back through my history, finding where I introduced the call to `functionA` and rewrite the commit so it is introduced as calling `functionB` (option 1)?


Is it worth it to switch from home-grown remote command interface to using JMX

Without knowing too much about JMX, I've always assumed that it would be the best approach for building in remote management to our standalone Java server application. Our server application has some minimal remote control capability, using text commands sent via TCP/IP socket to it. Using the home grown approach, it is fairly to add a new command. (Just create new command text, and the code to handle that in the message receiver). On the other hand, we have hardly implemented any commands, even though there are many things we would like to be able to execute remotely. I am trying to weigh the value of moving to incorporating JMX (learning it, and building the interfaces), versus just sticking with the home-grown approach. Does anyone have any experience or advice regarding changing an existing application to use JMX?


How do I balance program CPU reverse compatibility whist still being able to use cutting edge features?

As I learn more about C and C++ I'm starting to wonder: How can a compiler use newer features of processors without limiting it just to people with, for example, Intel Core i7's? Think about it: new processors come out every year with lots of new technologies. However you can't just only target them since a significant portion of the market will not upgrade to the latest and greatest processors for a long time. I'm more or less wondering how this is handled in general by C and C++ devs and compilers. Do compilers make code similar to `if SSE is supported, do this using it, else do that using the slower way` or do developers have to implement their algorithm twice, or what? More or less how do you release software that takes advantage of newer processor technologies while still keeping a low common denominator?


What's the best way to scale and split an agile team building a web app?

I've recently joined a company where I'm working as the scrum master on an agile development project building a web app. The team is just about to be the maximum size for an agile team (expecting 9 next week). We have talked about potentially splitting the team into two teams, not so much to shorten standups (which aren't excessive at the moment) but to stop people from being completely bored in sprint planning sessions (which again aren't excessively long). There are two very distinct layers to the project - high technical backend dev (like seriously complex), and UI design/build/integration. It seems that when the backend guys are talking technical the UI guys zone out, and vice versa. It seems like the logical way to split the team if only to be more time efficient, but I have one massive reservation in that all I might really be doing is reducing collaboration and knowledge sharing. The two teams just won't really have a good idea about what the rest of the team are building. Does anyone have any experience in dealing with something like this?


Why prefer non-static inner classes over static ones?

This question is about whether to make an inner class in Java `static` or not. I searched around here and on StackOverflow, but couldn't really find any questions regarding the design implications of this decision. The questions I found are asking about the difference between static and non- static inner classes, which is clear to me. However, I have not yet found a convincing reason to ever use a non-static inner class in Java - with the exception of anonymous classes, which I do not consider for this question. Here's my understanding of the effect of using static inner classes:   * **Less coupling:** We generally get less coupling, as the class cannot directly access its outer class's attributes. Less coupling generally means better code quality, easier testing, refactoring, etc.   * **Single`Class`:** The class loader need not take care of a new class each time, we create an object of the outer class. We just get new objects for the same class over and over. For a non-static inner class, I generally find that people consider access to the outer class's attributes as a pro. I beg to differ in this regard from a design point of view, as this direct access means we have a high coupling and if we ever want to extract the inner class into its separate top-level class, we can only do so after essentially turning it into a static inner class. So my question comes down to this: Am I wrong in assuming that the attribute access available to non-static inner classes leads to high coupling, hence to lower code quality, and that I infer from this that (non-anonymous) inner classes should generally be static? Or in other words: Is there a convincing reason why one would prefer a non- static inner class?


Stubbing and mocking boundaries

Suppose I'm building a JSON API and would like to include an endpoint that returns a list of recently created posts. Somewhere in my system is an existing Post model with the following test:   * create a few posts in the db (some new, some old)   * posts = Post.recent   * assert that posts only contains new posts Now I want to test drive the JSON endpoint wrapping this functionality (the "controller"). The most obvious way to test this would be a full integration test like:   * create a few posts in the db (some new, some old)   * make a request to /posts   * assert that only the new posts were returned in the response This seems to duplicate much of what is already being tested in the model and will start to slow down the test suite as more code paths need to be tested (i.e. auth, query string params, etc.). The alternatives…   1. Mock the model     * mock Post.recent     * make a request to /posts     * assert that Post.recent was called   2. Stub the model     * stub Post.recent     * make a request to /posts     * assert that the stubbed posts were return in the response Either one of these options alone does not seem sufficient to fully test the controller but when combined seems fairly comprehensive. The piece that remains untested is the agreement between the model and controller about Post.recent. What if I decide to refactor my model and model tests and Post.recent no longer exists…my tests will still pass even though the production system will fail. How does one address this? Are integration tests the only answer? If so, why bother stubbing and mocking at all?


GPL copying copyright notices

The "GPL How to" has the following to say about applying copyright notices of code copied from other programs: > If you have copied code from other programs covered by the same license, > copy their copyright notices too. Put all the copyright notices together, > right near the top of each file. I did a _total_ refactoring of a C# library, which itself was a port from Visual Basic (VB) code. The original VB code is currently released under the Microsoft Public License (Ms-PL), but originally under GPL. The C# library is GPL, continuing work on the older VB library. Basically I only used the same 'technique' they used. I don't care making the library GPL, so that's not the issue. (From this answer I gather my library might be considered a derivative work.) I do however find it cumbersome having to copy the previous copyright notices in every source file. I would rather only reference them in the README file. This question discusses the need to add notices to _every_ source file, but there's no consensus between the answers. Therefore I'd like to add the license to every file as a safety measure. Do I have to include copyright notices **of the projects on which my library was based** in all source files as well?


How DEP and ASLR play role in security?

Lines from CLR via C#:   A managed module is a standard 32-bit Microsoft Windows portable executable (PE32) file or a standard 64-bit Windows portable executable (PE32+) file that requires the CLR to execute. By the way, managed assemblies always take advantage of Data Execution Prevention (DEP) and Address Space Layout Randomization (ASLR) in Windows; these two features improve the security of your whole system. Que: I want to know the Security in which context here and what DEP and ASLR does here??


Daily Scrum when the team is just fixing bugs

I understand all the advantages of Daily Scrum and my team does it when we are working on stories. But sometimes we just have bugs to fix for days, while we're waiting for new stories, and when this happen we put daily scrum aside. Some of developers says that "There's no need to do a Daily Scrum when we have nothing to discuss". I don't know if a Daily Scrum when we don't have any new story to develop is necessary. Is there anything interesting we can do on a daily scrum when we just have bugs to fix?


Professional Development: Finding that "pet project" to work on - then managing other commitments

At the moment, like a fair few of you I'd imagine, I spend at least 40 hours working on projects that use a specific set of technologies. Sometimes I'm doing maintenance, and have those technologies enforced, and sometimes I'm doing new builds.. but have the skillset of the team enforced due to maintenance reasons (quite rightly). Yet I've got a growing set of technologies I want to test the waters with; be they custom Javascript frameworks or new Mobile Development techniques. I have no idea how to get to grips with them though! Take for instance the Chromium Embedded Framework; I've always been a fan of the UI of the GitHub app, and also been impressed by both Evernote and Spotify. When I found out how those UIs were produced I naturally tried thinking of a project that I could toy about with and produce over a weekend. (Which, with minimal OS interaction (perhaps simple file manipulations), should be ample) **But I can't think of a single thing to develop.** At work I've been tasked with retraining on Ruby on Rails; not wanting to go in blind - I decided to hammer a few books and try a few techniques. Now aside from the usual Lynda.com examples, and the very good _"Agile Web Development with Rails"_ project from the book... **I can't think of a single thing to develop.** Ordinarily I'd consider contributing to some FOSS software, and with frameworks I use regularly I do actually have a few ideas and I belong to the relevant mailing lists - i.e The Apache Cordova mailing list, and have signed the appropriate paperwork where required. (i.e For Apache Licensed projects) **Sometimes it's good to have an idea and run with it from scratch though, especially if you're new to the technology. So how do my fellow programmers manage doing that, and more importantly, how do you get ideas that allow you to use that specific framework/technology? It's hard to shoehorn ideas in to specific technologies at times.** I fear this is half the battle and the other **half is how to keep such a project when work commitments can eat in to your personal time** , and as it is, downtime is quite a valuable commodity!


Is saying "JSON Object" redundant?

If JSON stands for JavaScript Object Notation, then when you say JSON object, aren't you really saying "JavaScript Object Notation Object"? Would saying "JSON string" be more correct? Or would it be more correct to simply say JSON? (as in "These two services pass JSON between themselves".)


Advantages/Disadvantages of NFA over DFA and vice versa

What are the relative pro's and con's of both DFA's and NFA's when compared to each other? I know that DFA's are easier to implement than NFA's and that NFA's are slower to arrive at the accept state than DFA's but are there any other explicit, well known advantages/disadvantages?


Clean, Modular Code vs MV* Frameworks

I've been hearing a-lot about the "new" MV* frameworks. I've tinkered with KnockoutJS, creating an invoicing application, but I much prefer to write clean, modular code in raw JavaScript - leveraging utility APIs and other libraries when necessary. Given a methodical/structured/SOLID approach to writing a JavaScript application, where OOP, SOC, SRP and other design principles are adhered to, wouldn't the usage of MV* frameworks be superfluous? Are there any articles that express/address these concerns? I've found one in the past _note - i've migrated this question from SO to this site, as its more appropriate for this audience._


Are animations and other eye candies considered non-functional requirements?

I've seen many lists on the internet that includes many 'ities' (maintainability, scalability, portability, etc), but I'm not sure if animations, screen transitions, and similar features are functional or non functional requirements.


Should We Use Surrogate Primary Keys for Every Table?

We are developing a data model for a marketing database that will import transaction, customer, inventory, etc. files and the directive is ONE process that works for every client. We have been told every client will have different import layouts and different columns that identify a table's primary key. Our initial idea is to get definitions from the client on what columns make each record unique, store those in a mapping table, and then have lookup tables that translate those primary keys to an internal surrogate keys automatically for every destination table so that every table conforms to an integer primary key no matter how many columns/types are used to make up the real pk. The first major problem I saw was when/if have to map back to the lookup tables to get data that we did not store in the main data model, but I have ben assured that anything we ever want to query will be duplicated in the lookup and main tables so that should not be a concern. This kind of flexibility seems like it will cause some serious limitations on:   1. Technology stack (no way to dynamically map these import files in SSIS, need lot of dynamic SQL or java/c#)   2. Scalability (based on previous concern and initial testing, this would be difficult to scale without speed concerns)    3. Complexity (we are already running into some complex code changes when we try to implement all these tables with historical change logging while maintaining mapping to the lookup tables for example) My question - Is this feasible or is there another obvious solution we are missing?


Does Service-Oriented Architecture require the robustness principle?

I try to migrate more and more of our IT infrastructure to a _Service-Oriented Architecture (SOA)_ , that means separation of independent tasks and implementation of this tasks as decoupled services, simply accesible via HTTP. If you don't like the term SOA, just put in another - the basic idea is to put functionality in little modules and expose them by well-defined interfaces. It also means a lot of documentation and communication, because people tend to think in integrated systems. When I combine multiple services to a new component, I always take care to catch errors: if one service fails, the rest of the system should keep on running as best as possible. You probably know the Chaos Monkey, which I keep in mind. However, if other people use services, they tend to think in reliable parts. Does good SOA require the robustness principle? In short, if you use a service, you should not expect to much quality: be aware of any kinds of errors: the service response may not contain all information (missing fields), it may include additional, unknown parts, it may respond very slow, or it may not work at all. Is this a property of loose coupling or am I just to lazy to guaranteeing strict service quality? ;-)


In an MVC project, does the Information Architect define the models?

The definition of an Information Architect's responsibilities seems to fit neatly with the definition of 'model' in the MVC pattern. But I've never heard the two concepts discussed together. In a large project that has a dedicated Information Architect as well as a team of developers, does the Information Architect actually say "Model A has properties x, y, and z and has foreign keys to Models B and C..." etc, or do they just express the concepts more vaguely and let the development team translate this into MVC models? Just wondering what is the most common practice.


Do Tech Firms use a lot of Algorithmic Practices that we studied in college?

I am yet to start my career, I have a profound interest in algorithm design. I somehow fail to understand that, how would a tech firm use the algorithmic paradigm? I mean in real life projects do we actually end up using dynamic programming, greedy techniques, graph algorithms etc. Is there actually a future for people who are good at this subject. I understand that there are a wide variety of projects that are based on java, html5, css, javascript, j2ee etc. that never use algorithms. But are there companies out there using from the algorithmic paradigm for software development/solving complex (business or other) problems or is just for clearing interviews. p.s. I understand that software development is also based on other subjects as well, for example Design Patterns .


Multiple scrum teams moving to single backlog

We currently have 5 scrum teams that work off their own product backlog for the past year. Each team works on their own dedicated system but underlying technology is the same .Net. There has been a lot of discussion on moving to feature based teams working off a single backlog. The reason is one of our main systems has a significant amount of work coming and their is not enough capacity to deliver all the work in the year. The other reason which I believe is the significant one is it gives greater flexibility to adjust to changes in the portfolio rapidly. A decision been made to change two teams to work on a single backlog but the devs don't have experience on the other systems. One thing we're doing is cross-skilling by moving an experience system developer over to the team. My question is, have you experienced moving to single backlog for two or more different systems. What were your challenges? What did you need to do to get it to work?


Calculate Ellipse based on 4 points

I need to move an object based on 100 images rotating. The object needs to move in a path that is forming an ellipse when I'm rotating the image based on my gestures. I have **4 points** , _2 pairs of opposite points on X/Y axis_ , on the ellipse but how do I calculate the rest of the points in **code-behind** so that I can **calculate** the new **X/Y Value** of my **next/previous point**? Currently I'm just rotating my object in a circle what is a start but not what I want at all...      ![enter image description here](http://i.stack.imgur.com/rhyj2.png)


In Android can we let a fragment know other fragments?

I think I have found contradictory design guidance within the Google Android documentation on fragmentation. The first statement below advises each fragment be unaware of other fragments and always communicate only to the activity and let the activity decides what needs to be done. > Creating event callbacks to the activity > > In some cases, you might need a fragment to share events with the activity. > A good way to do that is to define a callback interface inside the fragment > and require that the host activity implement it. When the activity receives > a callback through the interface, it can share the information with other > fragments in the layout as necessary. > > For example, if a news application has two fragments in an activity—one to > show a list of articles (fragment A) and another to display an article > (fragment B)—then fragment A must tell the activity when a list item is > selected so that it can tell fragment B to display the article. In this > case, the OnArticleSelectedListener interface is declared inside fragment A: But a second statement later on the same page, a list fragment directly instantiates detail fragment.                  if (mDualPane) {             // We can display everything in-place with fragments, so update             // the list to highlight the selected item and show the data.             getListView().setItemChecked(index, true);                  // Check what fragment is currently shown, replace if needed.             DetailsFragment details = (DetailsFragment)                     getFragmentManager().findFragmentById(R.id.details);             if (details == null || details.getShownIndex() != index) {                 // Make new fragment to show this selection.                 details = DetailsFragment.newInstance(index);                      // Execute a transaction, replacing any existing fragment                 // with this one inside the frame.                 FragmentTransaction ft = getFragmentManager().beginTransaction();                 if (index == 0) {                     ft.replace(R.id.details, details);                 } else {                     ft.replace(R.id.a_item, details);                 }                 ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);                 ft.commit();      So my questions: Are these contradicting each other?   Should this be left to Activity? I feel confused, so any clarification is appreciated.


Check some value between each function call

Can you recommend a nice way of checking a particular value between calls to a set of functions? E.g. something like this in Python (might not be terribly 'Pythonic'):               self.error_code    = 0 # this will be set by each function if an error has occurred     self.function_list = [self.foo, self.bar, self.qux, self.wobble]     ...     def execute_all(self):         while not self.error_code and self.function_list:             func = self.function_list.pop() # get each function             func(error_code) # call it              if self.error_code:             # do something      The idea is that subsequent functions won't be called if `self.error_code` is set and all functions will be called in order if all is good. Anyone can think of a better alternative to that in Python or maybe a language-agnostic approach? I want to avoid having that code in each function call (e.g. `if self.error code: return`) so that I don't end up with the same check across all functions.


Why are string resources generally kept external to the code and not inside the code?

Generally, on many platforms, I'm writing my string resources to a .resx or .xml file, and then I'm getting them using some platform-dependent approach. That is, on iOS, I'm getting them via `NSBundle.MainBundle`, and by using `Context.Resources` on Android. What are the advantages of this approach, and why not having it directly accessible in the code, so, for example:   1. In a cross-platform project, any platform can access it directly, with no integration.   2. There are no concerns during building about whether or not the resources built well.   3. The coder can use functionalities such as multilanguage handling Long story short: what is the reason why string resources are structured that way? [Edit] Let's say that my file is part of a "core" project shared between other project. (Think about a PCL, cross-platform project file structure.) And suppose that my file is just totally similar to a .resx/.xml file, looking like this (I'm not a pro in xml, sorry!): Parameters Paramètres So, this is basically a custom xml, where you point to the key/language to get the proper string. The file would be part of the application just like you add any accessible file inside an app, and the system to access the string resources, coded using PCL. Would this add an overhead to the applications?


ASP.net/IIS runtime envitonment

I'm not too experienced in the regard of configuring IIS/ASP.net. A client has asked me to extend the functionality of a custom web application I didn't develop. Unfortunately, they don't have the original Visual Studio project/source code. I'm trying to pull the application off of their production IIS server and configure it for development on my machine. I've already setup a new website instance in IIS on my machine and copied the code to it's directory. When I access it (`http://localhost`), I'm currently receiving a null reference in the application. Obviously, this is a pretty generic error the can be caused by a bug, but I feel it's related to IIS's configuration. I've made sure both sites are using the same .NET version and they are also both running in integrated pipeline mode. Any ideas on what else I should look into? Production server: Server 2008 R2 (64bit), IIS 7.5 Development machine: Win7 (64bit), IIS 7.5


Contracting outside of full time contracting job

I'm a full time consultant for a contracting company. Essentially, I'm just a full time employee and when my current contract is up, I roll to the 'bench' until they find me another contact. One of the independent contractors I'm colleagues with threw a job my way (he's overbooked currently) for a very small company of just a couple employees to do some maintenance on their website. My handbook states "No individual shall provide consulting services for a fee in competition with [COMPANY]". But this company isn't a client of my employer (and I doubt ever would be since they're so small). To boot, some of my co- employees for my company either talk on the DL about doing contracts independently, or even have formed companies to do outside contracting with outside clients. Is it safe to do outside contract work even if you're a full time contractor for a consulting firm? (A lawyer question obviously but would love some feedback from anyone with experience)


What sorting algorithm does STL use?

I recently started using `<vector.h>` library and I was wondering, since all the operations are already implemented, **IF** the method of the sorting algorithm is the most efficient one. Everything runs perfect, there is no doubt, but should I worry about its performance? If I want to sort up to 6-7 million numbers, should I implement my own sorting method using quick sort?


Is there a name for the concept of a hierarchy of many short methods in a class

A refactoring I commonly do is where I come across a large method such as               public void doSomething() {         // do First thing         doPartA1();         doPartA2();              //now something else         doSomethingElse();         doMoreSomethingElse();         doEvenMore();              // finally do this stuff         someStuff();         someMoreStuff();     }      and use extract method refactoring it to make it like this:               public void doSomething() {         doFirstThing();         doSomethingElse();         doStuff();     }          private void doFirstThing() {         doPartA1();         doPartA2();     }     ...      I know the benefits of this are that duplication tends to be spotted more easily, comments are replaced by descriptive methods and methods can be tested at a finer granularity. Also, in a large class it can be easier to isolate and group a selection of methods/fields as a candidate to extract to a new class. But, I think most importantly it means If I'm looking at doSomething() for the first time, I may only need to read 3 lines of code to know what it does instead of 7. If I don't fully understand doEvenMore(), I can choose to read the method and so on, working down through the class like a hierarchy. Effectively I start reading a short entry point method and only need to read the lower methods in any class when I need to drill down deeper. So, my question - is there a name for this concept in programming and what is the easiest, most concise way to explain or demonstrate it? I have sometimes found it difficult to explain the benefits to colleagues why it's good to split up large methods, even when these new methods are only called from one place. EDIT: I'll try to be clearer: I'm not asking about the concept of extracting methods, I'm asking about the principle that makes extracting methods the right choice in this case e.g. If I had duplicated code in the original method I would extract a method because of the DRY principle. In the case above I don't but it's still good to extract the methods because of the X principle. What is X?


Apache Wave API

I'd like to create an application based around Apache Wave. Where can I learn more about working with Apache Wave and/or the API for a locally running instance? At the moment, the extent of what I can find seems to be APIs for _Google Wave_ (running off Google's servers) and that it's written in Java.


How do you annotate instantiation in UML class diagrams?

Given this pseudo code:               class B { }          class A : B     {         int val;     };          alpha = new A();      What arrow do I draw between `alpha` and `A` in a UML class diagram? Is this even something UML is meant to do?               +-------+        +-------+        +-------+     | alpha | --??-- |   A   |------|>|   B   |     |       |        |       |        |       |     +-------+        +-------+        +-------+      In my case, I truly do want to express explicitly that `alpha` instantiates `A`. So if there is no way in UML, I'll just make up a way -- which is fine, but I want to know if UML can express it already. My situation is that I'm trying to explain OOP to a friend who is very visual. Therefore, I want to try to visually distinguish the two relationships (inheritance and instantiation) so that he can distinguish it mentally.


What is the difference between C# and Visual C#?

So let's say I want to start learning C# so I can program Unity with it. I look for a good reviewed book and it says "Learn Visual C#!". I ask myself, what is the difference between Visual C# and C#? If I know Visual C#, do I also know C#?


More comfortable working on the backend, often referred for role on the front end

I have applied and have been approached for different roles in web development recently. The one thing that keeps coming up is that I am more suited to front end development than back end development. This makes sense given my background starting out as a designer. The problem is that while I have worked on a large app using ExtJS, I found designing and developing in ExtJS really frustrating. Oddly enough, it was working on this project that landed me in web development because my coding skills were recognized by some senior developers. I highlight that in my CV but I wonder if this might be a mistake. I also use JavaScript quite a bit outside of web development. Specifically in Photoscript and InDesign to create batch operations. It's often assumed that I have expert knowledge in JavaScript, whereas I'm only just getting to grips with the OOP style of JavaScript. I use a lot of procedural code or I just use libraries like jQuery and Google Maps. I have created some experimental apps in Node and Knockout which I fortunately have enjoyed although Node is back end. I used to avoid JavaScript and jQuery in certain web projects since I was focusing on SEO and would only use Javascript if I really needed it. During the interviews, I'm asked questions about JavaScript and front-end development. But I really wanted to talk about PHP and the server side development, so I guess my background shows. How do I address this when I am either contacted for a role or I applying directly without selling my short?


What is the advantage of currying?

I just learned about currying, and while I think I understand the concept, I'm not seeing any big advantage in using it. As a trivial example I use a function that adds two values (written in ML). The version without currying would be               fun add(x, y) = x + y      and would be called as               add(3, 5)      while the curried version is               fun add x y = x + y      (* short for val add = fn x => fn y=> x + y *)      and would be called as               add 3 5      It seems to me to be just syntactic sugar that removes one set of parentheses from defining and calling the function. I've seen currying listed as one of the important features of a functional languages, and I'm a bit underwhelmed by it at the moment. The concept of creating a chain of functions that consume each a single parameter, instead of a function that takes a tuple seems rather complicated to use for a simple change of syntax. Is the slightly simpler syntax the only motivation for currying, or am I missing some other advantages that are not obvious in my very simple example? Is currying just syntactic sugar?


Anti Cloud Open Source License

I'm working on a browser based open source monitoring project that I want to be free to the community. What I'm worried about is someone taking the project, renaming it, deploying it in the cloud and start charging people who don't even know my project exists. I know I maybe shouldn't mind, but it just sticks in my throat a bit if someone took a free ride like that and contributed nothing back. Is there any common open source license that can prevent this. I know GPL or AGPL don't.


What are the benefits of PHP?

Everybody knows that people that have prejudices against certain programming languages. Especially PHP seems to suffer from problems of its past and some other things (like loose types) and is often called a non-serious programming language that should not be used for professional applications. In that special case PHP: How do you argue using PHP as your chosen programming language for web applications? What are the benefits, where is PHP better than ColdFusion, Java, etc.?


Combine jquery/jqueryui/qtip/custom javascript into one minified file

I'm using jQuery, jQueryUi and qTip in my web application alongside custom JavaScript I've written. All three of the JavaScript libraries I mentioned above are licensed under the MIT license. From what I've read, I just need to include a copy of the MIT license for each of those libraries in my web application. Is it OK to put each license as a separate file underneath a "licenses" directory of my project? So, I would have a licenses directory with "jQuery- MIT-LICENSE.txt", "jQueryUi-MIT-LICENSE.txt" and "qTip-MIT-LICENSE.txt" in it. Or, do I need to put the licenses right at the top of the JavaScript files? Confused about where exactly these licenses need to be put in my web application... What I'm ultimately looking to do is combine all of the JavaScript files into one minified version for faster loading and I want to put the licenses in whatever is the proper place...


Increase Performance of VS 2010 by using a SSD

After searching on the internet for performance improvements when using Visual Studio 2010 with a solid state hard drive, I heard a lot of different opinions. A lot of people said that there isn't really a benefit when using a SSD, but in contrast others said the exact opposite. I am a bit confused with the contrasting opinions and I cannot really make a decision whether buying a SSD would make a difference. What are your experiences with this issue and which SSD did you use?


Geocoding for an application unable to show maps?

We have a situation where our users need to geocode a location (programmatically turn a description into latitude/longitude coordinates) from within an application unable to show a graphic image. Since the Yahoo Geocoding API and the Google Geocoding API both require that the result is used for showing maps (which is a graphic image) this means that we cannot use them immediately. Is there a Geocoding facility available - web service or locally installed (preferred if it does not require network access) - that can be used for such a scenario with a reasonable price model? We can use either Windows applications, Java libraries or remote web services in this particular scenario. Suggestions?


If you develop on multiple operating systems, is it better to have multiple computers + displays?

I develop for iOS and Linux. My preferred OS is Ubuntu. Now my software shop (me and a partner) is developing for Windows too. Now the question is, is it more efficient to have multiple workstations, one for each target OS? Efficiency and productivity is a higher priority than saving money. I have a 3.4Ghz i7 desktop workstation running Ubuntu and virtualized Windows with two displays, and I'm putting together an even more powerful i7 Hackintosh with 16GB RAM (to replace my weak 2.2Ghz i5 Macbook Pro). My specific dilemma is whether I should sell the first computer and triple boot on the second one, or buy two more displays and run both desktop systems simultaneously. Would appreciate answers from developers who write software for multiple OSes. Running guest OSes in VirtualBox on one system not ideal, because in my experience performance is seriously degraded under virtualization. So the choice is between dual/triple booting on one system vs having two systems, one for OSX+iOS/Windows (dual boot) and the other for Ubuntu (which I prefer to use as my main OS). For much of our work, I write a server-side application in Linux and a client for iOS (or for Windows or OS X) simultaneously.


How is the facade pattern different from abstraction layers?

**I just read about the facade pattern and found this example where a client (user of a computer) invokes a`startComputer()` method which calls on all the complex stuff:** _Source: wikipedia_               /* Complex parts */          class CPU {         public void freeze() { ... }         public void jump(long position) { ... }         public void execute() { ... }     }          class Memory {         public void load(long position, byte[] data) { ... }     }          class HardDrive {         public byte[] read(long lba, int size) { ... }     }          /* Facade */          class Computer {         private CPU cpu;         private Memory memory;         private HardDrive hardDrive;              public Computer() {             this.cpu = new CPU();             this.memory = new Memory();             this.hardDrive = new HardDrive();         }              public void startComputer() {             cpu.freeze();             memory.load(BOOT_ADDRESS, hardDrive.read(BOOT_SECTOR, SECTOR_SIZE));             cpu.jump(BOOT_ADDRESS);             cpu.execute();         }     }          /* Client */          class You {         public static void main(String[] args) {             Computer facade = new Computer();             facade.startComputer();         }     }      Here we can see the client class (You) creating a new facade, calling the `startComputer()` method. This method instantiates several objects and invokes their methods, encapsulating it inside the facade class where it `'glues it together'`. ### Question 1: **But exactly how is this different from layers of abstraction?** Yesterday I made login functionality for a web application where a `doLogin($username, $password)` encapsulated a `'complex'` lower-layer method call that updated login info about the user, set sessions to log in with and instantiated several objects etc. to do this job. This layer would also call another even lower level which would deal with CRUD-like operations such as checking activation status, account existance and other things like processing strings through hashing algorithms. This method _(on model level, look 'layer overview' below)_ would return an array with either a `'success'` key or a `'error_message'` key, acting as a boolean of sorts to the layer calling it. This is what I understand is known as `'abstraction layers'`, hiding complex procedures from the higher-level architecture, but when I read about the facade pattern it seems like I have been using it all along? ### Question 2: **Would my approach to abstracting the login mechanism be a bad choice in a MVC architecture? (if not, please give examples why)** Taken into consideration it should be very easy to decide where the end result goes (HTML, AJAX, etc.), wouldn't this be a wise choice to avoid alot of IFs as this can be dealt with on a controller layer? ### Layer overview: **Controller layer:** `$model->doLogin(POST VARIABLES HERE)` **Model layer:** (Is this a facade?) Sets sessions, updates login information in database etc., calls independent components for information: `$user_id = $user->getId();` and `$session->sessionExists();` **Independent class layer:** Each class on this layer is independent and has little to no coupling. After all, why would it? It's the layer above's job to build the application and lend an API to control it with. ### Question 3: **Is the facade pattern only used for routing calls to sub-classes in an API- like form, or perhaps just most commonly?** _With this I mean:_ Object A instantiates object B and lends a method to control object B's methods through a method of it's own:               <?php          class A {         private $_objectB;              public function __construct()         {             $this->_objectB = new B();         }              public function callMethodB()         {             $this->_objectB->methodB();         }     }          class B {         public function methodB()         {             die('Wuhu!');         }     }          // --------------------------     $objectA->callMethodB(); // Wuhu!      _instead of:_               $objectA->objectB->methodB(); // Wuhu!


Preventing RSI (Repetitive Strain Injuries)

I am 16 years old and I love to program and playing the piano. It's not uncommon that I'm bashing away on my mouse and keyboard all day long. I do not feel any pains doing so. Yet I am still worried, because I often hear from people that they can never type for longer then 10 minutes again without getting severe pains. Given my two hobbies, programming and playing the piano that worries me **a lot**. My current situation is this:   * G15 keyboard and G5 mouse   * A chair that looks like this (the back of the chair is surprisingly supportive): http://www.ikea.com/nl/nl/images/products/torbjorn-bureaustoel__0084333_PE210956_S4.JPG   * In my "normal sitting position" the table is around the height of my bellybutton.   * A LG Flatron L194wt screen (too small IMO, getting a new one soon) Should I be worrying about RSI/similar health issues? If yes, what can/should I do about it?


What to do with a 7 button mouse as a programmer?

I just got a new mouse with 7 buttons. Is there any way to use these extra buttons in eclipse or emacs? Is it possible to have a mouse button for compiling? Do you have any other ideas how to use the extra buttons? I'm using linux, but I'd be interested to hear from windows or mac users too, just to get some ideas.


How to test for performance or locking issues of sharing a database with another app

I have a typical Spring/Hibernate Tomcat webapp that has a user_info table. I’m trying to create another webapp that will do CRUD actions on the user_info table. I'm considering sharing the same database between the two apps. The apps will use C3P0 for database pooling. What is the best way to test the performance and any issues (e.g. locking) that could arise from sharing the db with another app?


Understanding the differences: traditional interpreter, JIT compiler, JIT interpreter and AOT compiler

I'm trying to understand the differences between a traditional interpreter, a JIT compiler, a JIT interpreter and an AOT compiler. An interpreter is just a machine (virtual or physical) that executes instructions in some computer language. In that sense, the JVM is an interpreter and physical CPUs are interpreters. Ahead-of-Time compilation simply means compiling the code to some language before executing (interpreting) it. However I'm not sure about the exact definitions of a JIT compiler and a JIT interpreter. According to a definition I read, JIT compilation is simply compiling the code _just_ before interpreting it. So basically, JIT compilation is AOT compilation, done right before execution (interpretation)? And a JIT interpreter, is a program that contains both a JIT compiler and an interpreter, and compiles code (JITs it) just before it interprets it? Please clarify the differences.


Starting android Development

I am considering learning android development. I have some basic knowledge in C++. I downloaded the ADT plugin and eclipse. Now while starting from http://developers.android.com I see the codes were in XML. So I googled for learning XML. The best site I found was http://www.w3schools.org but there I found that for learning XML I have to learn HTML and CSS. So I learned the basics of HTML and CSS. But, Now I find in that learning java is a must. So can someone give idea about the sequental languages that I should study now? Should I learn php,mysql too. BTW, I have a dream to work in google :p


Should you ever use private on fields and methods in C#?

I am somewhat new to C# and just found out that: in C# all of the fields and methods in a class are default private. Meaning that this:               class MyClass     {          string myString          }      is the same as:               class MyClass     {          private string myString          }      So because they are the same should I ever use the keyword private on fields and methods? Many online code samples use the keyword private in their code, why is that?


Why is the JavaScript-language different in different programs/sites?

I'm kind of new to programming and i have a question that's been bothering me for awhile. Why is the JavaScript-language different in different programs/sites. I've used Codecademy to practice and i've noticed it's different from Eclipse and Unity. For example, in codecademy, you use: var blabla = "something" to declare a variable. In eclipse though, you use: int x = 2, String x = "hey". Why is it like this? Thanks in advance.


Choosing a class abstraction when multiple viable approaches exist

I'm having trouble trying to design a class structure for some search functionality. It's quite possible that I'm approaching this incorrectly altogether, but putting that aside I'm curious how other people would approach a situation as follows: We need search functionality that allows users to access parcel information:   * People will be able to search via 3 different search methods -- MethodA, MethodB, MethodC.   (To give some perspective on what I mean by "method", lets think of these as things like a one line search that will do some intelligent parsing, another method has specific form fields for entering each parameter, etc.)   * People will be able to search via 3 different search types -- TypeA, TypeB, TypeC. (For example, search by owner, search by parcel address, etc.) The situation isn't terribly complex, but what I'm stuck on is whether I should design my classes around an abstract method object, or an abstract type object. Essentially, should I do this:               public class ConcreteMethodA : BaseMethod      {       public ReturnDataType GetResultsTypeA(){};       public ReturnDataType GetResultsTypeB(){};       //Etc.     }      Or this:               public class ConcreteTypeA : BaseType     {       public ReturnDataType GetResultsMethodA(){};       public ReturnDataType GetResultsMethodB(){};       //Etc.     }      If you do have some advice about how to solve my specific scenario, I will certainly appreciate it. However, I'm more interested in **heuristics** for approaching a design problem of this nature.


When to learn the command line version of a programming tool?

Almost every programming tool has a command line version; many of which also have a gui version. It takes a lot of time and memorization effort to learn the different commands and various options/switches of the command line version. So I have a couple of questions (which are not necessarily mutually exclusive): 1) When would you bother learning/memorizing the commands in the command line version of a tool which also comes in a gui version ? 2) What tools should I learn the command line version of ? .... compilers ? version control system ? etc, etc


A better approach to refactor code when doing A/B Testing

I'm asked to refactor my component code to support A/B Testing. What is the better approach:   1) Pass a boolean value to the methods and check for that flag inside the method body?               method(flag abTest):             if A_VERSION_ENABLED:            // Do 'A' logic         else            // Do 'B' logic      2) Create dedicated methods for each version?               codeForATest()     codeForBTest()


using static methods and classes

I know that static methods/variables are associated with the class and not the objects of the class and are useful in situations when we need to keep count of, say the number of objects of the class that were created. Non-static members on the other hand may need to work on the specific object (i.e. to use the variables initialized by the constructor) **My question what should we do when we need neither of the functionalities?** Say I just need a utility function that accepts value(s) and returns a value based solely on the values passed. I want to know whether such methods should be static or not. How is programming efficiency affected and which is a better coding practice/convention and why. PS: I don't want to spark off a debate, I just want a subjective answer and/or references.


What's the fundamental difference between the MIT and the Boost Open Source licenses?

What's the fundamental difference between the MIT open source licence : > Permission is hereby granted, free of charge, to any person obtaining a copy > of this software and associated documentation files (the "Software"), to > deal in the Software without restriction, including without limitation the > rights to use, copy, modify, merge, publish, distribute, sublicense, and/or > sell copies of the Software, and to permit persons to whom the Software is > furnished to do so, subject to the following conditions: > > The above copyright notice and this permission notice shall be included in > all copies or substantial portions of the Software. > > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING > FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS > IN THE SOFTWARE. and the Boost Open Source license : > Permission is hereby granted, free of charge, to any person or organization > obtaining a copy of the software and accompanying documentation covered by > this license (the "Software") to use, reproduce, display, distribute, > execute, and transmit the Software, and to prepare derivative works of the > Software, and to permit third-parties to whom the Software is furnished to > do so, all subject to the following: > > The copyright notices in the Software and this entire statement, including > the above license grant, this restriction and the following disclaimer, must > be included in all copies of the Software, in whole or in part, and all > derivative works of the Software, unless such copies or derivative works are > solely in the form of machine-executable object code generated by a source > language processor. > > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, > FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT > SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE > FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, > ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER > DEALINGS IN THE SOFTWARE. I'm willing to take an exception to the "retain this copyright notice" bit.


How can I effectively discuss language limitations with a client?

I would like to know the ideas that are being used for explaining to the client the limitations of the language used for enhancement of the existing project. Given a scenario was that the project existed in VC++ 6.0 and the client had asked for enhancement that could include transparency (alpha) component in the color part (currently using `gdi`). I found out that `gdiplus` library supports such feature but could not find it for MSVS 6.0 since its already being outdated (could not even find the msdn files for it) did not have support for gdiplus. I had to explain it to my client, so created an application in the newer MSVS and included both `gdi` and `gdiplus` and drew some objects using both the libraries side by side. So gave him an idea that the following point could be fixed if we migrate it to the newer version of code. Since client being a developer himself understood it. But there are cases when the clients are not developers and bearing no knowledge about programming. In such cases it is difficult to explain the problem.


What is the name of the following (anti) pattern? What are its advantages and disadvantages?

Over the last few months, I stumbled a few times over the following technique / pattern. However, I can't seem to find a specific name, nor am I a 100% sure about all its advantages and disadvantages. The pattern goes as follows: Within a Java interface, a set of common methods is defined as usual. However, using an inner class, a default instance is leaked through the interface.               public interface Vehicle {         public void accelerate();         public void decelerate();              public static class Default {              public static Vehicle getInstance() {                  return new Car(); // or use Spring to retrieve an instance              }         }      }      For me, it seems that the biggest advantage lies in the fact that a developer only needs to know about the interface and not its implementations, e.g. in case he quickly wants to create an instance.                Vehicle someVehicle = Vehicle.Default.getInstance();      someVehicle.accelerate();      Furthermore, I have seen this technique being used together with Spring in order to dynamically provide instances depending on the configuration. In this regard, it also looks like this can help with modularization. Nevertheless, I can't shake the feeling that this is a misuse of the interface since it couples the interface with one of its implementations. _(Dependency inversion principle etc..)_ Could anybody please explain to me how this technique is called, as well as its advantages & disadvantages? **Update:** After some time for consideration, I rechecked and noticed that the following singleton version of the pattern was used far more often. In this version, a public static instance is exposed through the interface which is initialized only once (due to the field being final). In addition, the instance is almost always retrieved using Spring or a generic factory which decouples the interface from the implementation.               public interface Vehicle {           public void accelerate();           public void decelerate();                public static class Default {                public static final Vehicle INSTANCE = getInstance();                     private static Vehicle getInstance() {                     return new Car(); // or use Spring/factory here                }           }      }           // Which allows to retrieve a singleton instance using...      Vehicle someVehicle = Vehicle.Default.INSTANCE;      _In a nutshell:_ it seems that this is a custom singleton/factory pattern, which basically allows to expose an instance or a singleton through its interface. With respect to the disadvantages, a few have been named in the answers & comments below. So far, the advantage seems to lie in its convenience.


Why EJBContainer has no methods for managing transactions and other EJB low level services

I read that the EJBContainer is responsible for things like managing transactions, managing EJB lifecycle, managing bean pools etc. So I took a look at the source code But there seem to be no methods for managing transactions, managing EJB lifecycle, managing bean pools.   So how is this taken care of?


Workflow versioning

I believe I have a fundamental misunderstanding when it comes to workflow engines which I would appreciate if you could help me sort out. I'm not sure if my misunderstanding is specific to the workflow engine I'm using, or if it's a general misunderstanding. I happen to use Windows Workflow Foundation (WWF). **TLDR-version** WWF allows you to implement business processes in long-running workflows (think months or even years). When started, the workflows can't be changed. But what business process can't change at any time? And if a business process changes, wouldn't you want your software to reflect this change for already started 'instances' of the business process? What am I missing? **Background** In WWF you define a workflow by combining a set of activites. There are different types of activities \- some of them are for flow control, such as the IfElseActivity and the WhileActivty while others allows you to perform actual tasks, such as the CodeActivity wich allows you to run .NET code and the InvokeWebServiceActivity which allows you to call web services. The activites are combined to a workflow using a visual designer. You pretty much drag-and-drop activities from a toolbox to a designer area and connect the activites to each other. The workflow and activities have input paramters, output parameters and variables. We have a single workflow which sometimes runs in a matter of a few days, but it may run for 5-6 months. WWF takes care of persisting the workflow state (what activity are we currently executing, what are the variable values and so on). So far I think WWF makes sense. Some people will prefer to implement a software representation of a business process using a visual designer over writing all of it in code. **So what's the issue then?** What I don't really _get_ is the following: WWF is designed to take care of long-running workflows. But at the same time, WWF has no built-in functionality which allows you to modify the running workflows. So if you model a business process using a workflow and run that for 6 months, you better hope that the business process does not change. Because if it do, you'll have to have multiple versions of the workflow executing at the same time. This seems like a fundamental design mistake to me, but at the same time it seems more likely that I've misunderstood something. For us, this has had some **real-world effects** :   * We release new versions every month, but some workflows may run for a year. This means that we have several versions of the workflow running in parallell, in other words several versions of the business logics. This is the same as having many differnt versions of your code running in production in the same system at the same time, which becomes a bit hard to understand for users. (depending on on whether they clicked a 'Start' button 9 or 10 months ago, the software will behave differently)   * Our workflow refers to different types of entities and since WWF now has persisted and serialized these we can't really refactor the entities since then existing workflows can't be resumed (deserialization will fail We've received some **suggestions on how to handle this**   * When we create a new version of the workflow, cancel all running workflows and create new ones. But in our workflows there's a lot of manual work involved and if we start from scratch _a lot_ of people has to re-do their work.   * Track what has been done in the workflow and when you create a new one skip activites which have already been executed. I feel that this alternative may work for simple workflows, but it becomes hairy to automatically figure out what activities to skip if there's major refactoring done to a workflow.   * When we create a new version of the workflow, upgrade old versions using the new WWF 4.5 functionality for upgrading workflows. But then we would have to skip using the visual designer and write code to inject activities in the right places in the workflow. According to MSDN, this upgrade functionality is only intended for minor bug fixes and not larger changes. What am I missing?


Many user stories share the same technical tasks: what to do?

_A little introduction to my case:_ As part of a bigger product, my team is asked to realize a small IDE for a DSL. The user of this product will be able to make function calls in the code and we are also asked to provide some useful function libraries. The team, together with the PO, put on the wall a certain number of user stories regarding the various libraries for the IDE user. When estimating the first of those stories, the team decided that the _function call mechanism_ would have been an engaging but not completely obvious task, so the estimate for that user story raised up from a simple 3 to a more dangerous 5. _Coming to the problem:_ The team then moved to the user stories regarding the other libraries, actually 10 stories, and added those 2 points of " _function call mechanism_ " thing to each of those user story. This immediately raised up the total points for the product of 20 points! Everyone in the team knows that each user story could be picked up by the PO for the next iteration at any time, so we shouldn't isolate that part in one user story, but those 20 points feel so awfully unrealistic! _I've proposed a solution, but I'm absolutely not satisfied:_ We created a "Design story" and put those annoying 2 points over it. However when we came to realize and demonstrate it to our customers, we were unable to show something really valuable for them about that story! _Here the problem is whether we should ignore the principle of having isolated user stories (without any dependency between them)._ What would you do, or even better what have you done, in situations like this? * * * _(a small foot-note: following a suggestion I've moved this question from stackoverflow)_


Does my JavaScript look big in this?

As programmers, you have certain curtains to hide behind with your code. With PHP all of your code is server side preprocessed, so this never see's the light of day as far as the user is concerned. If you have maybe rushed through some code for a deadline, as long as it functions correctly then the user never needs to know how many expletives you've inserted into the comments. However with more and more applications being written for the web, with a desktop feel implemented by AJAX and popular frameworks like jQuery being banded around to every Tom, Dick and Harry, how can a programmer maintain some dignity and hide his/her JavaScript code without it being flaunted like dirty laundry when the users hit Right Click->View Source or Inspect Element. Are there any ways to hide JavaScript application logic/code?


Defining Rank names for employees

I want to create a list of ranks for the employees in my company. We are an open source integrator that works usually with existing solutions and also building custom solutions. We don't want to name our employees as normal senior consultant, trainee and we would like give them ranks as forums do to the users. Does anyone have any suggestion for this?


Use cases sequentialy related, how to deal with this?

I'll express my doubt with an example. Suppose I have the following requirement: > _The customer needs a page in his website that displays all the products he > has with a quantity field on the side of each product. The visitor of the > website must be able to fill in the quantities desired, select one location > and ask for the budgeting. After asking for the budgeting, the visitor must > be taken to a page with the summary of the products asked, together with the > prices and fields to fill in contact informations to proceed the negotiation > if desired_ To organize this I've decided on building two use cases: "Require budgeting" and "Ask for products". The first one is: > Title: Require budgeting > > Actor: Website visitor > > Scenario: > >   * The visitor selects to see the products > >   * While the visitor want to add products to the budgeting > >     * The visitor fills the desired quantity of a product in the > corresponding field >   * The visitor selects his location to estimate shipping price > >   * The visitor sends the requirement > > After that, the visitor will be redirected to the page with the information about what he asks and the fields to require the products. This is another use case, but there is a close connection with the first one, because it is in the sequnce. I didn't know exactly how to deal with this. So I thought of using precondition: > Title: Ask for products > > Actor: Website visitor > > Precondition: the visitor has asked for a budgeting > > Scenario: > >   * The visitor reviews the products and prices > >   * If he wants to ask for the products > >     * The visitor fills his contact information and sends to the sales > department >   * If not, he exits the page > > But I'm unsure this is the right way to do so, I think that "extension" was the right way to express that, but I think I didn't get this yet. How should we proceed when use cases are closely related like that?


Using neo4j for managing project tasks and schedules?

I am considering using Neo4j to manage project tasks and schedules and compute critical paths. Obviously tasks and milestones would be nodes, and dependencies would be relationships. Are there any best practices, resources, or implementations to which I can refer?


What kind of documentation should UX designers provide to the developer?

It would be interesting to hear what is used besides sketches from UX engineers during development of a GUI. Unfortunately our UX team provides just a minimum of requirements for GUI screens. I believe that a better solution would be to use some tables with requirements and state machines or may be just some text description of GUI behavior? Is that something you use ? I tried speaking to our UX team but looks like it's impossible to get anything besides graphic sketches from them and I am wondering what others use. Our project is for iPhone currently, but it is could be useful to hear any advice even if you develop for any other platform or even desktop or web. Thanks!


Is it correct to say that CSS is AOP?

With selectors being a counterpart to pointcuts, and rules pretty much doing the same as advices do, - can we say that cascading style sheets are adhering to aspect-oriented paradigm ? And a corollary of this: "every CSS coder is doing AOP"? I found this similarity some time ago, but the brilliant post below reaffirmed my thoughts on this topic: Every time you use CSS, you’re doing Aspect- Oriented Programming > When you write the following CSS statement, you’re injecting the behavior of > the rules into your entire site, without touching the code that’s already > there... > > Aspect-oriented programming is the most misunderstood programming paradigm. > But fundamentally, the reason it exists is the same reason CSS exists — to > better separate concerns in your code.


All possible solutions to equation, where operators are arbitrary?

Given something like this: 1 5 3 4 = 18 I need to determine (using an algorithm) if there is a combination of operators and brackets that bring me to 18. Only "+" and "*" and "(" and ")" are allowed. Example: 1 + 5 + ( 3 * 4 ) = 18 Beside brute force, is there any particular algorithm that is able to compute all the possible combo in reasonable time? RPN may help in order to encode the possible solutions, but the same are a lot (4^n ?).


Tips for phone interviews

I'm about to do my first phone interview in a few days (I'm the one who is being interviewed), and am wondering about how to approach it (how to prepare, what to expect, and so on...). The job is for a software engineer. How do these things usually go? What would you advise for someone about to do a phone interview?


How to get a programmer to apply nice design touches?

We have a small webdesign firm, and count with one designer. We can currently not afford too much expansion in the design area, so that means that the designer creates the main design of a website (which often means: the homepage), and the programmers then work with this to make it into a website. In general, this works for us. However, I have noticed a big difference between the abilities of different programmers to apply 'nice design touches' to a website. Given that we only have the homepage design, we often need to structure internal sections ourselves. Nothing major, no design program needed, but CSS skills come into play. So let's say we need to show a list of different sections in the website. I will have the content and assign this to two programmers. One will come up with this: ![enter image description here](http://i.stack.imgur.com/jw6Lr.png) And another will do very much his best - and has the same CSS knowledge - but can only come up with something like this: ![enter image description here](http://i.stack.imgur.com/aVTiU.png) NOTE: sample image taken from MailChimp website. The second programmer is aware that his 'design' lacks style and that it needs improvement, but he is just not able to create something nice without having it all drawn up by somebody else. He wants to work on this, but I do not know what a good approach would be. Any tips? Anybody with similar experiences?


How do you track third-party software licenses?

How do you track licenses for third-party libraries that you use in your software? How did you vet the licenses? Sometimes licenses change or libraries switch licenses--how do you stay up to date? At the moment I've got an Excel spreadsheet with worksheets for third-party software, licenses, and the projects we use them on (organized like a relational database). It seems to work OK, but I think it will go out-of-date pretty quickly.


What Are The Specific Meanings Of The Terms: Functions, Methods, Procedures, and Subroutines?

I'm wondering what are the specific differences in the terminology we use for grouping related parts of code. I've sometimes seen the terms used interchangeably: many OO languages even use the keyword "function" to define a method. (Why?) If you wanted to be precise, what are the specific meanings of each? Or is it just whatever each language chooses to call it?


Whats the best way to handle errors in code?

So I'm a little concerned about my error handling... Currently my execution path looks something like this: > Users.aspx -> App_Code/User.cs -> Data Layer/User.cs So now when I try to update a user record, I put my Try/Catch block in the event handler and ensure that only the App_Code class interacts with the data layer. Exceptions that happen on the data layer, to my understanding, should bubble up to the event handler below. In the data layer, I started off with this:               public void Update()     {         var product = (from p in db.products                             where p.productid == id                             select p).FirstOrDefault();              if (product != null)         {             // update the thing         }     }      More info on reddit. After chatting with a friend, he recommended something like this:               public void Update()     {         int count = db.users.Count(u => u.userid == id);              if (count == 0) // no user found         {             throw new ValidationException(String.Format("User not found for id {0}.", id));         }         if (count > 1) // multiple users         {             throw new ValidationException(String.Format("Multiple users found for id {0}.", id));         }              var user = db.users.FirstOrDefault(u => u.userid == id);         // update the user record     }      Then I went onto IRC where they suggested I create my own Exceptions. I can see the pros here, but it seems a bit unnecessary when my friend's option will work just fine. Basically I'm just really confused as to how I should handle this... Obviously my initial option is insufficient, but it seems like creating my own exceptions might be complicating things too much. So what should I do here?


Can higher-order functions in FP be interpreted as some kind of dependency injection?

According to this article, in object-oriented programming / design **dependency injection** involves   * a dependent consumer,   * a declaration of a component's dependencies, defined as interface contracts,   * an injector that creates instances of classes that implement a given dependency interface on request. Let us now consider a higher-order function in a functional programming language, e.g. the Haskell function               filter :: (a -> Bool) -> [a] -> [a]      from `Data.List`. This function transforms a list into another list and, in order to perform its job, it uses (consumes) an external predicate function that must be provided by its caller, e.g. the expression               filter (\x -> (mod x 2) == 0) [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]      selects all even numbers from the input list. But isn't this construction very similar to the pattern illustrated above, where   * the `filter` function is the **dependent consumer** ,   * the signature `(a -> Bool)` of the function argument is the **interface contract** ,   * the expression that uses the higher-order is the **injector** that, in this particular case, injects the implementation `(\x -> (mod x 2) == 0)` of the contract. More in general, can one relate higher-order functions and their usage pattern in functional programming to the dependency injection pattern in object- oriented languages? Or in the inverse direction, can dependency injection be compared to using some kind of higher-order function?