How do you deal with the costs of too-rapid change?

Like most modern developers I value Agile principals like customer collaboration and responding to change, but what happens when a product-owner (or whoever determines requirements and priorities) changes requirements and priorities too often? Like several times a day? I recently inherited a smallish code base that was buggy, incomplete, and couldn't even handle the simplest scenario it was supposed to. I can deal with the technical issues but I get several emails, texts, or phone calls a day saying "OMG you MUST work on this RIGHT NOW! TOP PRIORITY! This is a MUST!!!oneone" (that's only a slight exaggeration) What makes it even worse is that most of the things are minor details that aren't even relevant to what the software is actually supposed to do and would take days to implement anyway. I've tried explaining that there's only so much time and that we should focus on the most important things first, but something seems to get lost in translation because the same thing happens a day or two later. Is there some sort of Product-Owner-Handler role, in-depth study, metaphor, or quote that can help me reduce the amount of wasted effort or at least explain the costs of this chaotic behavior?


Does Rhino have a future?

I'm looking to add serious scripting into my Java app and JavaScript would be a great language choice. My concern though is the Rhino project and its future. While Groovy/Jruby etc have seen constant updates, and engines like V8 and SpiderMonkey make continuous and significant performance boosts; Rhino languishes with its last release in March '09. I've seen some work on hacking Rhino:   * Great Thundering Rhinos! presentation from Oracle   * Explore and implement JDK7 InvokeDynamic Google Summer of Code project But nothing solid about actually merging this code into the project and getting an active committer community around it. What is the Rhino road map? For example, is there any plan to bring `invokedynamic` to the Rhino world?


How to know how much detailed requirements should be?

This doubt has to do with the requirements gathering phase of each iteration in one project based on agile methodologies. It arose because of the following situation: suppose I meet with my customer to gather the requirements and he says something like: "I need to be able to add, edit, remove and see details of my employees". That's fine, but how should we register this requirement? Should we simply write something like "the system must allow the user to manage employees", or should we be more specific writing for points   1. The system must allow the user to add employees;   2. The system must allow the user to see details of employees;   3. The system must allow the user to edit employees;   4. The system must allow the user to delete employees; Of course, this is just an example of a situation I was in doubt. The main point here is: how to know how much detailed I must be, and how to know what I should register? Are there strategies for dealing with these things? Thanks very much in advance!


How do you avoid working on the wrong branch?

Being careful is usually enough to prevent problems, but sometimes I need to double check the branch I'm working on ( _e.g._ "hmm... I'm in the `dev` branch, right?") by checking the source control path of a random file. In looking for an easier way, I thought of naming the solution files accordingly ( _e.g._ `MySolution_Dev.sln`) but with different file names in each branch, I can't merge the solution files. It's not that big of a deal but are there any methods or "small tricks" you use to quickly ensure you're in the correct branch? I'm using Visual Studio 2010 with TFS 2008.


Storing page-specific javascript on an AJAX driven site?

I have a general question about the placement of javascript code in a AJAX- driven web application. At a previous job, we tended to throw everything in one monolithic file. When maintaining that file became too difficult, we split it up into multiple smaller files and "glued" them back together with a php "loader" (pretty much just a bunch of include statements) Since all of my pages are dynamically loaded through AJAX, I cannot simply have different files called separately per page. The obvious disadvantage to this method is that all of your javascript is loaded by the end user, even if it is not required on first page load. (Which compounds the problem, the more pages you have) To get around this, I started putting page-specific javascript on the template page itself, in a `<script>` tag at the bottom, which works as intended. Only the javascript I want is loaded. However, I am unsure of whether this practice is taboo, or if there are better strategies for loading my javascript. I get the feeling that mixing my template with my scripted code is a recipe for disaster..


Does cohesion really reduce coupling?

' _Cohesive classes reduce coupling_ ' So, if cohesive classes or connected classes reduce coupling (union), which piece of the puzzle is missing me? BTW, I took this sentence from an article about identifying classes before any developmemt, which I'm trying to figure out the whole sense of why, when, how to use 'that' particular classes, polymorphism, abstraction, etc. For sure I'm in the beginner stage about OOD. I have read some books but I don't understand the relationship between cohesion and coupling.


Pros and cons of using generic delegates as nested functions

I've written code like this before:               private void Strings_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)     {         var onAdd = new Action(() =>         {             if(e.NewItems != null)             {                 foreach(string item in e.NewItems)                 {                     // Do something                 }             }         });         var onRemove = new Action(() =>         {             if(e.OldItems != null)             {                 foreach(string item in e.OldItems)                 {                     // Do something                 }             }         });              switch(e.Action)         {             case NotifyCollectionChangedAction.Add:                 onAdd(); break;             case NotifyCollectionChangedAction.Remove:                 onRemove(); break;             case NotifyCollectionChangedAction.Replace:                 onRemove(); onAdd(); break;         }     }      I find this style useful when there is some small reusable function that only applies within the scope of another function. However during code review, I received feedback that this was unnecessarily complicated and hard to read. Personally I find this style somewhat elegant, but I can see the argument for readability. What other benefits and drawbacks are there to this style?


Programming structural question, controlling lots of states and specific transitions between states case by case

This is a theory question for me just to try and write better code. I am pretty new so hopefully I am using terms like state in the correct way. How I should be thinking about this problem? I am coding something that sort of works but whatever I do it seems complicated, hard to understand and hard to modify. I'm playing a video clip with an id, I also want it to be able to dynamically switch to a thumbnail view of that video clip. I want to be able to set this video blank also and shut down any connections that are not needed, I'm trying to do all of this efficiently - not reconnecting to the server when I don't need to etc. **so I have-** connected -> on/off video id -> a string mode -> streaming video/thumbnail view/disabled **Hopefully you will see my dilemma with some examples-** _Case 1.The user starts from scratch and wants to view a thumbnail of video "a"_ -connect to server for "a", send request for thumbnail, turn thumbnail object on. _Case 2.The user starts is viewing a thumbnail of video "a" and wants to start watching a stream of video "b"_ -compare strings "a" and "b"- see they are different. hide thumbnail object and clear its buffer. Disconnect from server for "a" and connect to "b" server. start streaming video, turn video object on, request thumbnail from the server so its loaded in memory in case the user wants to switch to thumbnail mode. _Case 3.the user is watching a stream of "b" and wants to view a thumbnail of "b"_ -compare strings "b" and "b"- see they are the same and stay connected to the server, hide video object and stop streaming, turn thumbnail object on, send another request to server for the thumbnail... All these options are doing my head in, I want it to choose the most efficient way to get from one state to another but all the different options are confusing me. I guess Im looking for help about whats the best way to structure this, because what Im doing at the moment seems very confusing, i end up with huge tree of nested ifs of lots of specific cases and then patching up where it goes wrong.               if (connected but used to be disconnected) {          if (mode streaming but used to be thumbnail) {...         if (mode streaming but used to be streaming) {...          if (connected but used to be connected) {....          if (disconnected but used to be connected) {....          if (disconnected but used to be disconnected) {...      it goes on forever..


Should I keep a technology I haven't used in a long time on my CV?

I worked with OfBiz and Opentaps for a couple months in 2005, and became very comfortable in coding with these back then. Now a few weeks back, I had a look to Opentaps code, and I don't think I understand or remember anything of the current codebase. Is it time to remove it from my CV as a technology I am familiar with?


Using a SDK with crazy code

I recently had to work with an SDK that had a lot of crazy parts*. Not using the SDK was not an option as it had to talk to some third party software. What is the best way to deal with the crazy code? I genrally used static methods to convert between sensible data types to the format they required (ie bool to yesNo). That method did however lead to lots of calls to very unintuative static methods (which one of the three dateToString methods should be called where?) Would a better approach be to store almost everything as a string in the database? Or possibly convert each datatype inline so its clear (although with repeated code). Possibly there is some more elegent solution I hadent thought of? * _Certain methods required an enum called yesNo which contained "Yes","y","No" and "n". There were also multiple diffrent formats of string they wanted to represent datetimes used inconsistently. There were also other smaller bits of crazy code._


Is there really a relationship between number of people assigned to a project and the number of defects?

Here is a quote from a training manual at work regarding SLIM and software estimation: > Notice also, there is a correlation between Effort and Defects. This means, > the more people there are assigned to a project of a given size, the more > Defects there will be. Effort is person-time (person-years, person-months) for the project. Defects is the count of defects detected at any point in the lifecycle. Size is defined as the use cases, function points, or SLOC that compose the project. This seems counterintuitive, assuming a good process and capable engineers. For example, having more people means more eyes on all of the artifacts (requirements specs, designs, code, tests). Aside from having more eyes, my intuition suggests that there is little relationship between effort and defects on a project that utilizes appropriate quality techniques. I haven't been able to find any documents, aside from those about the Putnam Model (which is used by SLIM), that suggest any kind of known relationship between defects and effort or defects and number of people on a project. Is this a known relationship, and is the assertion that "more people = more defects" valid?


Using Jython and Tomcat in bundle - should we even try to?

Have you ever used Jython in bundle with tomcat in any serious, production- ready service? What pros and cons can you name? Is it worth trying if all guys in team has no problems with coding on Java, but know python as well?


WCF service which takes XML file

I have a client requirement where I need to expose a web service which takes XML. Client will consume my web service and send XML . This web service need to be async. Could you please suggest any good proven approach ? with advantage / disadvantage


Is Assembly still relevant?

Are there major differences between assembly language and higher level languages when it comes to coding and/or managing projects? Obviously it takes more statements in assembly language to carry out a particular operation than in most other languages, but are there differences that affect how a project needs to (or should) be run based on targeting assembly language (specifically x86/x64 assembly language)? To the extent that there are differences between assembly language and other languages, it seems reasonable to guess that at least some of these are advantages for the other languages. Can anybody point out specific disadvantages of assembly language, and ways to mitigate those disadvantages? One specific example would be staff availability. Has anybody had trouble finding experienced assembly language programmers, and if so, what steps can be taken to mitigate this problem?


What is a Real-time system

What is the most appropriate definition of a Real time system? Is online railway reservation a real time system ? Is Aircraft control system a real time system? Is Process control system a real time system?


One Developer, Two Machines

I currently use a Mac Pro for Xcode development, but am considering buying a MacBook Air when the newer models are released. How should I collaborate with _myself_ when using both machines on the same project? Should I use Git, or should I just acess the Mac Pro as a networked drive from the MacBook, or something else?


What are some database designs that support lineage tracing?

# Environment   * PostgreSQL 9.1   * Java # Problem I'll try to illustrate the problem here as simply as possible: I'm trying to record the following relationship: Node 1 => Node 2 => Node 3 Where Node 1 is the parent of Node 2, and Node 2 is the parent of Node 3. In the database table, the initial design is tracking this data in a linked list fashion. However, I am finding this extremely inefficient because each time I want to trace the lineage of say Node 1, I'd have to retrieve Node 2, then with Node 2, I'd retrieve Node 3. Since I would be displaying the lineage of Node 1 to the user, I'd have to make 3 separate calls to the database to display this information. I'd also like to backtrack, but for the sake of simplicity I left that part out. # Alternatives Some alternatives I have considered, but I can't go to at this time are Neo4j and other solutions like it. Unfortunately, at this time, I have to stay in Postgresql. # Question Is there a design pattern such that I can retrieve all this information at once? If there is, how would you implement with the example above? # UPDATE With @MichaelT's comment, and finding Common Table Expressions, I've been lead to this link, which seems to provide more information on this: http://stackoverflow.com/questions/53108/is-it-possible-to-make-a-recursive- sql-query


Should I store UK postcode data in my database

I am building a website for a UK audience that will utilise location data to offer search results based on a desired location or home address. I have a large list of UK postcodes and geographic locations that I could parse and input to my DB to use in searches I am wondering if this is the right thing to do? Would it be better to just rely on an API such as google geolocation?


What are the main programmers web sites in other countries?

Looking at the demographics of sites like this one, there seems to be a very heavy US weighing of users. I know there have been discussions about using English as a programmer, but the are some large countries with large programmer bases that must be using localized sites. Countries like Brazil and China, in particular, what sites do programmers go for discussions? Do a lot of the threads link up to English speaking sites like these? In France they obviously prefer their own language, what do the equivalent sites look like? I don't want to turn this into an English language speaking discussion like this one, it's more a general trans-cultural programming curiosity.


Extensibility in multi-tenant systems?

> **Possible Duplicate:**   >  How do you manage extensibility in your multi-tenant systems? I asked this on StackOverflow, but I thought it might be more appropriate for Programmers. * * * I've got a few big web based multi-tenant products now, and very soon I can see that there will be a lot of customizations that are tenant specific. An extra field here or there, maybe an extra page or some extra logic in the middle of a workflow - things like that. Some of these customizations can be rolled into the core product, and that's great. Some of them are highly specific and would get in everyone else's way. I have a few ideas in mind for managing this, but none of them seem to scale well. The obvious solution is to introduce a ton of client-level settings, allowing various 'features' to be enabled on per-client basis. The downside with that, of course, is massive complexity and clutter. You could truly introduce a huge number of settings, and over time various types of logic (presentation, business) could get way out of hand. Then there's the problem of client-specific fields, which begs for something cleaner than just adding a bunch of nullable fields to the existing tables. So what are people doing to manage this? Force.com seems to be the master of extensibility; obviously they've created a platform from the ground up that is super extensible, you add on to almost anything with their web-based UI. FogBugz did something similiar where they created a robust plugin model that, come to think of it, might have actually been inspired by Force. I know they spent a lot of time and money on it and if I'm not mistaken the intention was to actually use it internally for future product development. Sounds like the kind of thing I could be tempted to build but probably shouldn't. :) Is a massive investment in pluggable architecture the only way to go? How are you managing these problems, and what kind of results are you seeing?


Software to organize and maintain project documentation, specification?

I'm looking for software to organize and maintain projects internal documentation, specification, requirements, etc. Currently we store all documentation as lots of MS Word DOC files in a source control repository, which gives us version control, and that's nice. But you can't search this information, create links between them, categorize, collaborate. _Requirements, preferences:_   * Zero install on client side (WEB based).   * Document version control.   * Document annotations.   * Document linking.   * Full search (all documentation).   * MS Word (*.doc) import\export.   * WYSIWYG text editor. _Systems I have discovered and tried so far:_   * MediaWiki   * XWiki   * Confluence


Why most use Cygwin and not Uwin?

Most academic researchers I know target just *nix, and rely on Cygwin to make their applications available on Windows. I have tried many of these projects and always found them too unstable for serious use when running on Cygwin. Uwin looks like a promising alternative to Cygwin. I haven't tried it yet, but I found several comments that it is faster and more stable. However, I haven't seen any use of Uwin to support running *nix apps on Windows. What are the social and/or technical reasons behind Uwin's lack of popularity?


Choosing a diff program for Mercurial

I decided to try to contribute Firefox development, and they use Mercurial for source control. In the documentation about using Mercurial it was advised to choose a diff program and to do it before you start coding. They list a bunch of options, one of which appears to be the standard Unix/Linux diff program, which I'm somewhat familiar with via basic use. The thing is, I hadn't realized that the diff program can even be an issue and I have a feeling that I won't know how to pick one until I pick the wrong one and get screwed by it somehow. So to skip this unnecessary hurdle, I'd like to ask what should I look at when choosing a diff program, and in what cases is the choice important (and in what way)?


How to help team members value each others input?

The sad reality is that team members in different roles see each other with different eyes. The above link presents a very true picture of how we regard each other in the SDLC. However the truth is that as a team, we need each other to perform in order to succed. And by working together rather than against each other, your performance as a team increase exponentially. As a team member (leader, head, coworker) who understands this, how should one manage to create an atmosphere of respect for each other's role in the process? For example, how do you get developers to understand the importance of QA testers and the value of designers? How do you get designers to value developer input? etc...


How do the algorithms to solve problems encountered in interviews translate into real world solutions?

I have recently finished an undergraduate course in computer science and I am looking for a job. During the search I encountered several interesting (and tough) problems that needed clever algorithms to solve. I also use google code jam as a practice set. I cannot understand how those solutions translate in solving real world problems. Many problems appear (to me) not only contrived and fantastical but also highly specific to be a general purpose solution (although it isn't impossible to extend them using ingenuity). Are these problems there only to test the problem solving skills or are these some aspect of real world problem camouflaged?


Wise to list proprietary language experience on resume?

My entry-level position suddenly sprung a proprietary scripting language into everyone's lap. Think of it as PASCAL/PERL. Anyway, since this is an entry-level job, I'll definitely be moving on some time in the future. Would it be wise to list that I have experience using proprietary languages on my resume? I figure it would imply that I am quick to learn new style and syntax on the fly, but that seems like an unnecessary perk to a career that involves years of study.


Checking for emptiness of collections with (in)equalities - what's the best practice?

For a long time now I've been in the habit of checking whether a collection (array, dictionary, whatever) is non-empty with a nonequality. Like this:               if ( MyArray.Length < 1 )     {         // Do something if the array is empty     }      Sometimes I do this for strings too, and other kinds of collections. In practice, this should be the same as               if ( MyArray.Length == 0 )     {         // Do something if the array is empty     }      Because the length of collection should never be less than 0 anyway, right? So I always thought - what the heck, I'll include the inequality and be double- safe even in the case the sky falls down. But today a though struck me that the second version might be more readable than the first. It expresses more clearly that the case I'm looking for is the empty array, which is not immediately apparent from the first version. So maybe I should use that instead? Since, you know, if a collection length is less than 0, then I'm screwed anyway. Which version do you use, and which would you suggest others to use (and why)? **Clarification:** This was meant as a question about simple collections, where obtaining `.Length` is O(1) or otherwise inexpensive. If `.Length` itself is a nontrivial operation (such as necessitating the iteration through a linked list, or contacting the DB), then this is the wrong approach altogether. The question was about `x < 1` vs `x == 0` where x is a nonnegative integer (although it might not be typed as such).


Stack and Heap memory in Java

As I understand , in Java, Stack memory holds primitives and method invocations and heap memory is used to store objects . Suppose I have a class               class A {            int a ;            String b;            //getters and setters     }        1. where will the primitive 'a' in class A be stored ?   2. Why does heap memory exist at all ? Why cant we store everything in stack ?   3. When the object gets garbage collected , is the stack associated with the objected destroyed ?


How do you manage your javascript unit tests?

When you are writing JavaScript unit tests, where do you put all the test code? I see two potential approaches:   1. Leave all your test code with your regular web project and explictly don't release the code to production.    2. Maintain a separate project that runs all your tests. I see pros and cons for both. I'm curious what more experienced JavaScript developers have ended up using.


'dock' working in simple words

I would like to know the idea behind the working of 'docking' in applications. I have worked with applications where components from individual forms are docked on a single main form to provide the necessary GUI. But I don't have any idea whats happening in the background. According to Wikipedia   _A dock is a graphical user interface element that typically provides the user with a way of launching, switching between, and monitoring running programs or applications._ Now I am a bit confused if it is some component or an event or a property or something else. EDIT : The applications was developed in Delphi on windows platform. There is something more in Delphi (manual dock and automatic dock).


Condition based function declarations

I recently came across a weird piece of code               if(foo == bar){      function foo_bar(){        // Function definition      }     }      Is this a good practice of coding ?


Is programming language that is non-visual ... possible?

In common life we use text for programming. But why not gestures or voice? **Are there any researches around this topic?**


How do I avoid writing lots of pass-through functions in a wrapper?

I have a class, which wraps another class of a common base type. Because the base type interface is quite large this involves writing a lot of pass-through functions. I am looking for a way to avoid this. Let's make an example:                     Car          /   \     Volvo     VolvoWithTrailer      Now I have to implement each and every function in the car interface for VolvoWithTrailer and call the appropriate function on the wrapped Volvo object except maybe GetMaxSpeed() which will return something lower. Basically I will have many functions like               int VolvoWithTrailer::GetNumSeats() {       return mVolvo.GetNumSeats()     }      An obvious way to solve this would be to make VolvoWithTrailer a subclass of Volvo                   Car          |        Volvo          |     VolvoWithTrailer      but that seems to violate the principle of favoring composition over inheritance. How else could I avoid writing all those wrappers (the language is C++)? Or - if that is your position - why should I just write them/just use inheritance? Is there any template magic that could help with this?


Externalising SQL Queries in Java

What are the advantages and disadvantages of externalising SQL queries in Java (or similar general-purpose object-oriented programming language. Externalizing means storing all SQL in a separate non-java file or files. Several good examples are here. Does it make debugging harder or easier?


Isn't SQLite a bit underestimated?

Before I ask the question, let me first describe my thoughts about SQLite. I happen to like tools that are small, fast and, more importantly, have only the really necessary functionality. That's why I like SQLite and I like MS-SQL a bit less. For example: MS-SQL may have much more functionality, scalability, etc. etc., but it can also be a pain to install if you're unlucky. Of course, I'm not saying that a difficult installation is a reason to not choose a particular database. Don't understand me wrong: MS-SQL is a fine quality product. I'm very experienced with MS-SQL; I understand the product very well as a professional. I just prefer it less in some circumstances where it's _not really needed_ (= not many users, < 10-15). How much of a database's functionality do you really use? In my experience it's often just the normal SQL (SELECT, INSERT and UPDATE). I like SQLite. Is fascinating fast. It's extremely easy to "install". I think SQLite can do more than it claims it can do. Why only use it for one- process/single user applications? After all: not many applications are constantly accessing a database. For example: consider a ERP application with, let's say, 15 users. Why can't SQLite used for that? Let's face it: in my professional experience most of the time users of this kind of application will access the database for about 5-10% of the total time they are using the application. In the other 90-95% they are just watching the information on the screen, entering data in a grid/form and when they save their input that's not more than 1 second of database time. F.e.: 1,5 minutes of input time vs. 1 second of saving time. If the SQLite database file is locked during the "saving time" other users that need to access the database just wait, but they don't notice that because the waiting time will be very small (unnoticeable). In code you just have to deal with the possible "busy" time of the database, to avoid exceptions, but that isn't difficult to do. Some guy, who must think the same like me, has even build a client-server solution for SQLite: SQLitening. This made me more convinced that I may be not fooling myself. Of course there are database intensive applications where SQLite doesn't fit. But as I now think about it, many multi-users applications, if they don't exceed 15 users or so, should do just fine with SQLite. Many of our customers don't spend much on hardware, so I often encounter a sole server with everything on it (Exchange, SQL(s), clients, etc.) and because of that are almost "out of breath". If I could deliver a product that hasn't high system requirements, then my customer would be happy. SQLite doesn't add any weight (at least not much), MS-SQL does. So I would not choose SQLite because it's free, cheap, or easy to install. I would choose it for practical/technical reasons. FYI: In my profession we sell products (custom and standard, mostly ERP related) to customers where, on average, no more than 5-6 people will use the product. There are some exceptions, but no more than 10-15 users. _Question is:_ Am I right in thinking that I can use SQLite for some multi- user application like the example I describe? Are there any technical disadvantages which I should know of? What are your experiences (negative or positive) that will help me making the right choice? Update: Please don't see this as a negative judgment of other databases. They are mostly all fine products. Just sharing my thoughts here and interested in your opinions about this.


OO Design: hint EntityManager to preload some datasets

say I have an EntityManager that can `read(PK)` a dataset from the DB and return it. I have an application that will process multiple records, iterate over them and for each, use the EntityManager to read each record. Therefore it would be nice to inform that EntityManager about the coming workload so it is able to preload the necessary data more efficiently. How would you integrate such optional hints into a clean, SoC OO-Design? Thanks alot


What endpoints should I provide, if any, to permit connectivity testing for my web services?

What endpoints should I provide, if any, to permit connectivity / availability testing for my web services / Web API? * * * **TL;DR** I am developing both the server and client in an enterprise environment. The client will interface with the server via an RESTful Web API. I would like to provide an indication to the user that they have correctly entered the Web API's root URL correctly. I would also like to implement connectivity monitoring of the API in the future. None of the public APIs (Facebook, Twitter etc) that of have looked have a dedicated end point for connectivity testing. There are a number of web sites that provide availability monitoring of public APIs. One of them, Watchmouse, reported they preform their availability testing by actually exercising the API (logging in, perform an action, and testing the results). On the other hand calling the root URL for CouchDB returns and configurable message and the CouchDB version. Should I provide dedicated endpoints for connectivity / availability testing? If so what endpoints? Or should I just exercise existing endpoints?


which version of Windows should use I to develop an app

I need to develop a Windows application which can be installed on any version of Windows from XP through 7. Which version of Windows should I use for application development. I'll be using Qt-C++/GTK+ for development. How do I decide/determine which Windows version is to be used for development?


Learning Each Type of Programming Language

I have heard several times that every programmer should learn one of each type of language. Now, this is not necessarily true, but I believe it is a good idea. I've learned a Procedural Language (Perl), but what **are** the other types? What are the differences between them and what are some examples of each?


Testing responsive designs for large displays... on a laptop

I use a 13" laptop. I want to test my responsive site designs on displays larger than 1280x800. Is there an easy way to do this? Or should I just set that as my top media query?


What to change in Ruby on Rails?

In my last interview I was asked what would I change on Ruby on Rails to make it better. I use Ruby on Rails daily and I was not able to give an answer. So, my question is: 'What could be changed in Ruby on Rails to make it better?'


What is the most compatible, widely used production language to export knowledge and skills gained from Haskell?

I like Haskell, plain and simple. While Haskell is used in production software, it's not especially widely deployed from what I've seen. What is the most similar and still widely used language in regards to production projects so that I might have a snowball's chance of using something similarly awesome in industry? Also is the same language from the first part available on large numbers of platforms? If not, what is the best alternative that has wide platform deployment? I'd like a single language to put on my to-do list rather than a massive swarm or family. Hard evidence would be a plus.


Port forwarding and C++ Winsock Client-Server applications

As the title says, I'm creating a TCP client and a server program in C++. My question is, when running the client and server on two separate machines that go through a different firewalled router over the internet, does it matter which router has ports forwarded? Ex. Can just the router used by the client machine have the correct TCP ports forwarded and the client server connection be established?


Understanding C# Delegates Structure

I've been trying to understand C# delegates using Pro C# 5. In short, the author describes the motivation for delegates as a structured way of dealing with function pointers and callbacks or two-way communication between objects. The part I find confusing is the syntax/implementation for this:   * On the one hand, an object of delegate type is seen as the _handler_ or the one responsible for invoking some method or list of methods. To this end, it has methods such as `Invoke()` etc.    * On the other hand, the delegate type is used as a 'wrapper' with which to pass around methods. For example, it seems strange to me that a call to a delegate's `GetInvocationList()` returns an array of delegates. Shouldn't there be something else with which to wrap methods? I expected there would be some other construct/type, say, `MethodContainer` which wraps methods. Then the syntax for adding methods to a delegate would be               class MyClass{ void Method(string s){} }          MyClass c = new MyClass();     MethodContainer container = new MethodContainer(c.Method);          delegate void MyDelegate(string s);     MyDelegate d = new MyDelegate();          d.Add(container);          d.GetInvocationList(); // returns array of MethodContainer


Work experience before masters

I dont know if its the right place to ask such questions: I have a bachelors degree from an Indian university. I want to pursue a masters in one of the universities in USA. My profile is good enough to get me admitted to the school that I prefer. I also have an offer letter from one of the top software companies in India. I don't know which path to take, I know a masters degree will be of great help in future both in terms of money and career but I do not know whether I want to do it at this moment. I have signed up for both edx and coursera for some of the courses and I really liked learning them online. I am not sure if taking these courses can be a substitute for a masters degree. Also how will I be able to differentiate myself in the real world if I do not have a masters degree, since there are many in India who don't have it. And is it advisable for me to take some work experience say 1-2 years and then apply for a masters degree. Although universities do not explicitly mention work experience as a criteria, will any kind of work experience help me in deciding whether I want to do masters? Finally I want to know what are the cons of not doing a masters.


Using WebStorm for Razor Syntax MVC

I am building a lot of client-side heavy SPA-like apps with VS2010 and MVC3/4. VS2010 Javascript/HTML/CSS editing (mostly javascript) is interminably slow and sluggish. I'd love to use something like JetBrains' WebStorm to edit my .CSHTML files (with embedded javascript, etc. because I am using RAzor to pop in URL names, etc.) WebStorm seems to have all of the things I want.. better language recognition ("intellisense") and the ability to integrate additional outside libraries into this (I'm using Kendo), etc. Is this possible? How do you get WebStorm to recognize the @"" invoked Razor language inserts? Any help or suggestions would be appreciated.


A simple menu - hide and show on click

I already posted this question over at stackoverflow, but they meant that this would be the better place to ask. So here i am :) I am new to Jquery and currently practicing. I wrote a little piece of code to show and hide a navigation on click and change the text of the button when the navigation is opened and close. Because i am fresh in this area i would love to get some feedback about the code, for example if there are any ways to do it better, with less code or any other area of the matter. Just a little code review for learning and practicing. (especially the second if is bothering me :)) Thank you And here the small line of code:               // Function Hide nav     function hideNav() {     $('nav').hide();     }          // Hide Nav     hideNav();          // Function Show Nav          function showNav() {     $('nav').show();     }          // Clickevent on Button     $('button').click(function() {     if($('nav').is(':hidden')){     // Show Nav on Clickevent     showNav();     // Change Text when Nav is showing     $(this).text('Close me');               }     else     hideNav();     // Change Text back when Nav is hiding     if($('nav').is(':hidden')){     $('button').text('Open me');     }     });


History of protocols and Formats that gone wrong but still are used

I trying to find some historic evidence about protocols or formats that had different implementations where the interoperability led to problems we might still see today or bugs in implementations that became features. What I am trying to do, is to convince people to invest in a reference implementation of a format to avoid problems of interoperability. Best would be to provide examples from the past that didn't go so well, and caused many problems. For example STMP EHLO vs. HELO. As I remember EHLO is Microsoft only. thanks for your ideas.


What is Hadoop and what are some example applications of it?

The title basically says it all. I keep hearing about Hadoop, and from the wikipedia entry, it certainly _sounds_ interesting, but I'm curious if there are some good examples where it makes sense to pursue a solution using that technology? Put another way, if I pick up a new toy, I like to at least know how I'm supposed to play with it!


Explaining programming to a child

How could I try to explain programming to a child, about 6 to 8 years old?


Eliminating Magic Numbers: When is it time to say "No"?

We're all aware that magic numbers (hard-coded values) can wreak havoc in your program, especially when it's time to modify a section of code that has no comments, but where do you draw the line? For instance, if you have a function that calculates the number of seconds between two days, do you replace               seconds = num_days * 24 * 60 * 60      with               seconds = num_days * HOURS_PER_DAY * MINUTES_PER_HOUR * SECONDS_PER_MINUTE      At what point do you decide that it is completely obvious what the hard-coded value means and leave it alone?


Can you learn functional programming in C?

As a result of the comment discussion here, I wonder whether you can learn Functional Programming in C?


Why is Javascript faster than Jquery?

I was reading a thread and saw this post, which says that Javascript is faster than Jquery because it uses native code. But why is the use of native code faster? Is this always the case? What impediments does Jquery have in performance?


Is there an optimal number of lines of code per function?

Functions are not only used to minimize duplication of code - they are also used to split up a long function into smaller ones to increase readability, as well as making the code self-commenting. Yet this gain is not directly inversely proportional to the number of LOCs per function or method; otherwise we would have tonnes of functions, all of which only contains a single line or two of code. This lead me to wonder: **Does there exist an optimal number of LOCs per function? If so, what is it, and does it deviate between languages?**


How viable is "Windows Workflow Foundation"? What alternatives should I consider?

I started learning WF 3.0 back a few years ago and never quite got the hang of it. Has anyone learned WF 4.0 (now that it has been rewritten)? Is it a viable platform worth considering? What alternatives exist?


Is it appropriate in a developer's job description to have "error free" as a key output?

As part of a review of all job descriptions, my company has decided to include the following as a key output: > website development completed on time, within specification and **error > free** Given that specifications regularly change, there is no formal change control process and environments are, shall we say, a little unpredictable, how realistic and reasonable is this KPI?


Does anyone know of a way to acquire a REAL credit card that is specifically designated for ecommerce testing purposes?

What I mean is we always want to test something in the actual real world live production environment, regardless of any testing we do with any fake paypal credit card numbers or other sandboxed numbers. So instead of using our personal cards, I wonder if there is a credit company that will supply a fully feature credit card specifically for the purpose of this kind of real world testing? I suppose the answer may simply be just to get yourself a credit card and only use it for that, but I'd want to be sure it was 'out of the loop' when it came to affecting credit scores or that kind of thing.


How to choose the best approach when adding features/refactoring code

I've got a problem. I find really difficult to foresee the effect that my changes to the code will have over the whole application, either when I have to add new features or re- factor it. Very often it is not until testing time that I find out that I should have done things in a different way or that those changes produce an unexpected behavior. I would like to know how you guys approach changes in the code, how you get to know how those changes will affect your current code, what tips or tricks work best for you, or any recommended readings about the matter. Any help will be sincerely appreciated! Thanks a lot guys


Is it actually possible to have a 'useful' programming language that isn't Turing complete?

Where it is accepted that a language has to be Turing complete to be any good, is it actually possible to have a 'useful' programming language that isn't Turing complete? I should clarify that this is quite specifically about 'programming' languages in the traditional sense, and not markup or query languages.


Are there non-turing complete dynamic languages which can be used to create useful programs?

While it takes a turing complete language to create any imaginable program, is it possible to compute most "useful" programs with a non-turing complete dynamically typed language? For example, is there a non-turing complete language capable of solving the Project Euler problems?


In a company whose primary business is software, are the developers still considered to be "IT"?

My thinking is that a company who's primary business is making widgets groups developers with networking, support, etc because none of it is the business, it's support of the business. If your primary business IS selling software, then I would call the development group "Research and Development" or something similar. Maybe if you had some developers who worked strictly on internal apps then they would be in with IT/Support/Comms, etc. What is the norm for companies like Microsoft, Google, etc? Is there some dictionary for this type of thing in CIO magazine or something? What does your company do?


What is a "wrapper" program?

Where I work, employees use a third-party desktop program for their clients. This program saves data to a flat file. My colleague wants to write a Java program that uploads that flat file to a remote server, opens the desktop program when the flat file is downloaded from a Web site, and checks if the desktop program is running or not by looking at the Windows processes. He keeps calling this helper/utility program a "wrapper." But it doesn't wrap anything! I tried to clear it up with him, but he said, "Well, I call it a wrapper." He now has everyone in the company calling it a "wrapper." What would you call it? I say that it's a helper program or utility program.


Is Node.js "considered" to be its own programming language?

Whenever I read blog posts about a new app that had Node.js involved, bloggers often write "the app was **written** in node." But I hardly ever see a phrase going like "the app was written in JavaScript, with the Node.js runtime." Now I'm beginning to ask whether or not Node.js is merely a runtime, or perhaps the creators are now planning to add more features that JavaScript doesn't offer, or maybe because it's much easier to say "written in Node" rather than "written in JavaScript, but runs on Node." What's the deal?


Database Application Design Best Practices

Once upon a time it was common practice for both the business logic and database logic to be written in the same language (eg PL/SQL, Transact SQL, etc), more recently the practice is to separate the application into layers/tiers such as database, business logic, and presentation, with each tier written in a different language. Typically an ORM is used to help facilitate communication between the business logic and the database. From time to time however, especially when the application is relatively small, I still write applications with the business logic pushed down into the database layer, only the user interface is outside the database. I am aware of the various arguments for and against this, however I'm wondering as to whether there are any contemporary best practices if one was to write a database application in this manner? There are quite a few books on data models etc, but none really talk about how to structure the actual application code in terms of stored procedures, functions and so on. Also there are a number of books on database refactoring, or database anti-patterns, but again they broadly assume that the database is just being used to persist data. I did find this one paper by Blaha, "Object-oriented design of database stored procedures". Are there any other books, papers, or sample databases that illustrate contemporary database application design best practices? It actually seems relatively common to still build applications in this way, however it appears to be one of those things that people have accepted is not best practice so they want to avoid talking about it. Is it OK for a business stored procedure to access a table directly ? Or should all table access be through CRUD methods? Are there any code generation tools people recommend? Thanks.


Importance of stored procedures and triggers in building web applications?

Almost in every interview for the position of web developer, they ask about stored procedures and triggers well I am aware from their definition and basic usage but the truths is I have never used any of them in any of my project. Well I have seen other developers who used them but only when they were the only solution. My question is are they really important and interview is incomplete without asking questions about triggers and stored procedures. I tend to do keep almost all my logics in PHP, like if change in one database table row will require change in other database table row, I run another query from PHP rather than writing trigger, is it wrong or bad practice? do I need to change my approach? any examples in which use of stored procedures and triggers are better than performing similar operations in PHP?


How much business logic should the database implement?

I've worked in some projects where most of the business logic was implemented on the database (mostly through stored procedures). On the other side, I've heard from some fellow programmers that this is a bad practice ("Databases are there to store data. Applications are there to do the rest"). Which of these approaches is the generally better? The pros of implementing business logic in the DB I can think of are:   * Centralization of business logic;   * Independency of application type, programming language, OS, etc;   * Databases are less prone to technology migration or big refactorings (AFAIK);   * No rework on application technology migration (e.g.: .NET to Java, Perl to Python, etc). The cons:   * SQL is less productive and more complex for business logic programming, due to the lack of libraries and language constructs the most application-oriented languages offer;   * More difficult (if possible at all) code reuse through libraries;   * Less productive IDEs. Note: The databases I'm talking about are relational, popular databases like SQL Server, Oracle, MySql etc. Thanks!


Do stored procedures violate three-tier separation?

Some colleagues of mine have told me that having business logic in stored procedures in the database violates the three-tier separation, since the database belongs to the data layer whereas stored procedures are business logic. I think the world would be a very grim place without stored procedures. Do they really violate the three-tier separation ?


How to avoid the pitfalls of static analysis

I'm working at a company that would score 11 on Joel Test - at least on paper. In practice, however, nothing works quite as well as expected, and the project has been on **DEFCON 1** for half a year. Now, most of my peers are happy if they can go back home at 6pm - on Sunday. One of the apparently good practices that struck me as not working is the use of static analysis tools. The project both tracks gcc -Wall warnings and a proprietary and very expensive _"C/C++"_ tool. Gcc warnings do more often than not point to real(if most of the time inoffensive) bugs. The proprietary tools, however, list things such as implicit casts and sizeof'ing a string literal. Implicit casts are also blacklisted on their stylebook. The standard practice is that people is pressed to make every single warning shut up. Note that this does exclude warnings that are predominantly false positives, this is not the problem. The result is:   1. People add type casts to every rvalue and to every argument hiding real problematic type mismatches in the process.   2. People introduce off by one bugs, or use a different problematic language feature.(strlen instead of sizeof, strncpy instead of strcpy, etc.)   3. The warnings are silenced.   4. The bug reports start rolling in. The main point is the original code was working and written by people who were playing safe within their language abilities whereas the fixes were not. Now, I don't really think this company can be saved. However, I would like to know if there is a better, preferably working, way to use the _"pro"_ tools or if I should just avoid using them altogether in case I am the one making the decision in the future. A solution which doesn't assume all programmers are geniuses that can't err. Because well, if they are, then there is no need to use the tools in the first place.


Best exception handling practices or recommendations?

I think the two main problems with my programs are my code structure/organization and my error handling. I'm reading Code Complete 2, but I need something to read for working with potential problems. For example, on a website, if something can only happen if the user tampers with data via javascript, do you write for that? Also, when do you not catch errors? When you write a class that expects a string and an int as input, and they aren't a string and int, do you check for that, or do you let it bubble up to the calling method that passed incorrect parameters? I know this is a broad topic that can't be answered in a single answer here, so what I'm looking for is a book or resource that's commonly accepted as teaching proper exception handling practice.


How do I mashup Google Maps with geolocated photos from one or more social networks?

I'm working on a proof of concept for a project, and I need to pin random photos to a Google Map. These photos can come from another social network, but need to be non-porn. I've done some research so far, Google's Image Search API is deprecated. So, one has to use the Custom Search API. A lot of the images aren't photos, and I'm not sure how well it handles geolocation yet. Twitter seems a little more well suited, except for the fact that people can post pictures of pretty much anything. I was also going to look into the API's for other networks such as Flickr, Picasa, Pinterest and Instagram. I know there are some aggregate services out there that might have done some of this mash-up work for me as well. If there is anyone out there that has a handle on social APIs and where I should look for this type of solution, I would really appreciate the help. Also, in cases where server-side implementation matters, I'm a .NET developer by experience.


Software Defect Patterns

Does the Pareto Principle, that being 20% of the causes are link to 80% of the problems, apply to software bugs, and if so, are there any common patterns of note on average within the 20% of cause?


Easter eggs as IP protection in software

I work in embedded software, and for some reason, management wants to hide an Easter egg as means of IP protection. They call it a watermark, and since our software interact with the video preview feed (the image displayed on a screen before you take a photo), they want me to implement a trigger which will react to some unusual video input (a video konami code like dark - bright - dark - bright - whatever). When this trigger fires, something strange happens (which is outside of the normal behavior of the software). The goal is to check whether our software is included in a device. Does it sound like a good idea? I have many argument against this move:   * What if the konami code is too sensitive and user triggers it?   * Does this kind of `watermark` have any legal value?   * What if this "feature" is discovered by the client?   * The performance penalty should be very small, since the soft run on small devices.   * I am the one developping this trigger. If things go wrong, what is my responsibility? What is your opinion about this method? I can't find a link, but I remember seeing an answer on this site suggesting that putting Easter eggs for protection purpose was a good idea. Has anyone tried it with good results?


How to promote my newly developed software ?

I have recently developed a registry cleaner. But as far as I am concerned, there are already so many registry cleaners on the market, and some of them have won great popularity. Does that mean there is little chance for me to get my customers' attention? How can I make my software known by my targeted customers?


Nested Try Catch Error Handling with Log Files?

Best practice question for error handling in C#? In our system we will be writing out files, and with each file they will have a corresponding error file. The error file will get written every time even if there are not any errors. I'm looking at the best way to handle the errors for this. Assuming when we go to write the main CSV file, we would get a number of errors. From permissions on the folder, to a parsing exception when turning a Datatable to a CSV. If we get a permission error the error log file will fail as well. Would this be done in the exception? in another try catch (which would be bad.. I think). We would also want to get the exception to place in the error file. Some pseudo code below (without the try catch in the exception) or should this be broken down more and using methods, that contain their own Try / Catch that could bubble up the messages to log and write to files.                   Message.log("begin writing file");             try {                try {                    // get data from DB                   // write to CSV file                   // all good, write Empty Error Log file and main file                }                 catch(Exception ex) {                   // Write Error File with ex.toCSV                   // write log message.                   Message.log("error : " + ex.ToString());                }                  } catch (Exception ex) {                  var e = new Exception(string.Format("An unexpected error occurred for file.\r\n{0}", ex.Message));                  Message.log(e);                  throw e.             }            Message.log("all files written");


Does calling a virtual protected method from a base class violate the LSP?

Let's say we have this base class:               class MyBase     {         public string Name { get; set; }              public string GetDescription()         {             var descriptionList = new List<string>() { this.Name };             descriptionList.AddRange(this.ExtraDescriptions.ToList());             return string.Join(", ", descriptionList();         }              protected virtual IEnumerable<string> ExtraDescriptions()         {             return new List<string>();         }     }      Then add a derived class:               class MyDerived : MyBase     {         protected override IEnumerable<string> ExtraDescriptions()         {             return new List<string>() { "a", "b" };         }     }      It seems to me that this violates the LSP (because we're changing the behavior of the `GetDescription` method), and yet it's also a fundamental feature of object-oriented programming. The base class _obviously_ declares its intention to allow the `ExtraDescriptions` method to be overridden, but this isn't necessarily visible to a consumer of the class. Ever since I learned about the LSP, this problem has really been gnawing at me. So:   1. Does this violate LSP?   2. What's the correct alternative to this?


best way to send messages to all subscribers with multiple subscriptions and multiple providers

I'm writing an application in which - Many users can subsribe to posts made by another users. So for a single publisher there can be many subscribers. When a message is posted by an user X, all users who have subscribed to messages of User X will be sent an email. How to achieve this ? I'm thinking of using publish-subscribe pattern. And then I came through JMS. Which is the best JMS implementation to use according to your experience ? Or else what else solution do you propose to the given problem ? Shall I go for a straight-forward solution ?: User x posts a message, I find all users (from database) who subscribe to user x and then for every user, I call the sendEmail() method. [EDIT] My intention here is not to send-emails. I'm really sorry if it wasn't clear. I also have to send kind of system-notifications apart from Email to all subscribers. Right now, I've implemented the email-sending as a threadPool


Determine Cluster Label in K-means

I have dataset that is contain 150 data that is actually divided into 3 group. Each group has it’s own label. I do clustering process with K-means algorithm to group the data. I need to assign the label of each group that is created by K-means process. So I could compare the result of K-means with the data training. Anybody could help to explain how to determine the label of each group?


Why are many programmers moving their code to github?

For the past 6 months or more, I've been seeing many codes hosted at sourceforge.net as well as other hosting sites "Move to GitHub". A mere Google Search with the phrase "Moved to Github" returns several results containing the text moved to github. This is very confusing for me, and I'm wondering, why exactly are people moving? Does it mean that GitHub is better or is there some special advantage I'm not seeing?


Should a programmer fix someone else's failed build?

One programmer committed some work to the SVN repository, then went home. After he left, the Hudson automatic build failed. Another programmer saw this, and after looking through the code changes, detected that the problem was the absence of one library. He added this library to SVN and the next build completed successfully. Did the second programmer do the right thing or should he have just waited until the first programmer fixed the issue?


Is WCF a good fit for this problem?

I'm working to implement a data service solution that has 2 request functions but can respond with one of 3 transmission types:   1. x12 EDI    2. HTTP MIME multipart    3. SOAP/XML + WSDL  I would also need to include logging and username/password authentication to the services. I'm in the very early learning stages of WCF. Is WCF a good fit for this?


HTML5 localStorage and encrypted sensitive data

I'm looking for a way to have a website remember sensitive data, but without actually storing it server side. And I was looking at HTML5 `localStorage` to do it. Here's the plan as I see it.   1. User enters sensitive data into form, and submits.   2. Server encrypts data via AES-256 with a strong key that is kept in private source control.   3. Server responds, providing encrypted data to rendered page.   4. Page runs javascript to save encrypted data to `localStorage` Later...   1. User visits a page that uses javascript to fetch encrypted data from `localStorage` and sends it to the server.   2. Server decrypts encrypted data, gaining access to sensitive information for that request. My thinking is that that allows either the client or server to compromised, and things stay secure. If the client is compromised, then the hacker can read only an encrypted string they do not have the key to decrypt. If the server database is compromised, the data is simply not stored there so it obviously can't be accessed by the hacker. (Obviously some types of server hacking could read sensitive data as it's coming in initially, but such a hack would work whether client storing it or not, so that doesn't apply to this discussion. Also client hacks that log keys and whatnot would still work, I'm simply talking about data storage getting compromised on either side here) But I'm no security expert, so I am wondering if my plan has any holes in it? Any glaring security vulnerabilities I am missing here?


What is the point of a Gantt Chart, and will it help me?

My (non-technical) colleague has threatened me with a Gantt chart for a new project that we are currently planning. What is this likely to provide for us, and will it be a helpful tool?


Your strategy to ensure vertical growth

What is the single most important thing that you do to ensure career progression ? In other words what is it that you have to learn\unlearn\implement every day so that you do not stagnate at a level in a company and there is constant vertical growth. These strategies might be different at each role and might vary for different segments like Development Teams\ Sustaining Teams \ QA Team and Technical Pub teams. The question is independent on which team you are in. P.S : Vertical growth can also be on technical path.


Do people in non-English-speaking countries code in English?

I've heard it said (by coworkers) that everyone "codes in English" regardless of where they're from. I find that difficult to believe, however I wouldn't be surprised if, for most programming languages, the supported character set is relatively narrow. Have you ever worked in a country where English is not the primary language? If so, what did their code look like?


Non-English Naming Conventions

> **Possible Duplicate:**   >  Do people in non-English-speaking countries code in English? I know that there are non-English based languages out there, where keywords are in some other tongue, but popular languages are in English. However, if you're a non-native English speaker, developing for a non-English market, do you use your native language when naming functions, classes, variables, etc.? If you do, what kind of morphology do you adopt? For example, functions are often named with verbs (e.g., `buildData`), would you use the imperative form -- if your language has one -- in the name (e.g., `construisciDati` in Italian)? A related question: For users of non-Latin writing systems and languages that support Unicode naming, do you make use of it or stick with romanisation? e.g., `建造数据`, for our `buildData` example in [Googled] Mandarin.


Is it a good practice to code in English?

> **Possible Duplicate:**   >  Do people in non-English-speaking countries code in English? I have a development comming that is intended to be sold across Latin America (Spanish speakers), but I've heard from some partners that is a good practice to always code in English, I mean just code (methods, classes, pages names, etc), labels on GUI are going to be all in Spanish... Code will be edited in the future by developer of companies across Latin America and just maybe some from outside. What do you think?, any experience with this?


When should the programmer's spoken language be used during development?

I'm an Italian developer, but I have a good understanding of English. Sometimes, when developing an application targeted for an Italian audience, I wonder whether it is correct to use the Italian language in my code or not. By "Italian language in my code" I mean the names of methods, classes, comments, variables and so on. For example, when I write code like this:               /* Attenzione: metodo esageratamente complicato */     public double calcolaImposteDeiServizi() { ... }      Do I break any sacred law of programming because I didn't write that code as follows?               /* Caution: overly complicated method */     public double calculateTaxesOfServices() { ... }      I remember a project I worked on some time ago. It was about calculating VAT/taxes/bonuses. Some of this code was dealing with concepts that existed only in the Italian economy at that moment. I preferred to write that project using only Italian names for methods, otherwise it would clearly have become a mess understanding that _VAT_ was Italian's _IVA_ and so on. By using this example, should there be some kind of rule for deciding whenever to use your language or not in code? Did any highly authoritative programmer ever said something about this issue? How do you make this kind of decision in your projects?


HTML/CSS in Other Spoken languages?

> **Possible Duplicate:**   >  Do people in non-English-speaking countries code in English? Do developers who don't natively speak English still code using english property and tag names? Like, would a Japanese front end web developer still need to know what border-radius means in English to use it, or would Japanese sites use Japanese CSS? I ask because I'm an English speaking web developer who aspires to be multilingual someday, and I might try to use that combination of skills to travel the world a little. Will I still code in English, even while building sites in China or Japan? If so, would that improve my chances of getting a job?


"Open source" proprietary software licenses?

I am writing some software that (for once - usually I open source stuff on sourceforge/github/etc.) I plan on selling. To each source file, I want to attach a proprietary software license that doesn't allow anyone to use, modify, derive, etc. the software (and source code) without my express permission. I have been looking at the Microsoft Reference Source Licensing and would be happy to use that, however I'm not sure if I can (legally). So I ask: in the same way that there are well-known an regarded open source software licenses (ASL, GNU, etc.), are there well-know proprietary licenses that are "open" in the sense that I could use them to protect my product? Thanks in advance!


In an optimal software design, would you ever need to throw InvalidOperationException?

.NET defines the `InvalidOperationException` as > The exception that is thrown when a method call is invalid for the object's > current state. In an optimal software design, would it ever make sense to throw this exception? I would argue that the 'optimal' API prevents any misuse, including, never allowing a method to be called when its state is invalid.


How to teach computer science?

I am just starting to teach computer science. It's just the basic level. I'm finding that I sometimes don't know how to approach topics in a way that lets students easily understand. I've found that the best thing is to use analogies. A terrible one, that worked well, was presenting recursion by using the process of eating a burger. (You eat one bite, then you eat the rest). Interesting real world examples do wonders here. I'd like to know the techniques you have used for teaching, or teachers you've had have used that proved particularly effective. I'd also like to know your best analogies and examples for topics in CS101, especially for those harder to grasp topics. I'm teaching the class in Java (as required).


Application Logic Vs DB Triggers for database cleaning

When cleaning out old data from a set of database tables, is it safer to have the logic in the application or in a database trigger? I am upgrading an application that I wrote a while back (and in a hurried fashion) and one of the things I want to clean up first is ensuring that data which is no longer being used is propmtly deleted. Currently this is being done in my application itself via a number of SQL calls to various tables. Some of these queries take a bit of time to run and as the application is PHP driven, I don't want users having to wait too long. I was therefore thinking about creating a database trigger on one table that would merrily clean up all the other tables and then allow the single row delete to occur from my master table. I am considering these pros and cons at the moment:   * _Database trigger_   * (+) Invisible to the application   * (+) Simplifies application logic - new objects can be simplified   * (-) Adds complexity to overall maintenance - have to maintain code and triggers during table changes etc.   * _Application Logic_   * (+) Keeps all maintenance tasks in one place   * (-) Longer page loads on certain tasks   * (-) More chance of a request timing out - orphaning data If you have any further insight, considerations I haven't thought of here, experience with one vs the other or can point me towards some reading on the matter I would love to hear it. Edit: I originally thought that my pages would run quicker, but if I am creating a _Before Delete_ trigger, will the page loads be the same - as in the application sends a tiny query through but it won't be actioned until the entire set of statements in the trigger complete?


What is the process of planning software called? Or what is the job title of someone who does software planning?

For example, let's say a non-technical person comes to me with their rough initial specification. And I sit down with them over a couple weeks and help them hone, formalize and better plan the application that they want built. What is this called? Information architecture, software architecture, specification writing, software planning, requirements analysis? What is the best, most recognizable term for this?


Is there a website where you can upload random useful applications that you have created?

From times to times, I need to solve a problem and I find it faster for me to create an application for the specific problem instead of searching all over the Internet for it. Most of the times it is an application created in .NET framework but there are also times that I create apps for linux. My question is: Is there a website where I can upload my free apps? I know that I can obviously upload everything to my personal website, but since I'm not very popular I'm afraid that most users that need my apps will not be able to find them if they are in my website. Keep in mind that I'm not talking about releasing my source code (just the binaries and the documentation) and I'm not talking about huge applications. To give you a better idea, in most cases the applications that I'm talking about will not even have an installation procedure: just a couple of executables and a config/data file. Thanks in advance.


MVC framework that uses classes instead of methods for actions

In most MVC frameworks, Controller class contains multiple methods, each representing one action. Then annotations and reflection is used to call those methods appropriately. But from OOP point of view, the whole class has many responsibilities, eg. one for each action. Then each action should be represented by it's own class. Does MVC framework that implements actions like this exist? And is there some kind of discussion that discusses pros and cons of both approaches? I believe it would be much cleaner to do it class-way, because it would allow simple extensibility through inheritance without need for annotations. But there would be 'overhead' of many more classes, making it harder to maintain the code.


Is it possible for a one-man start-up to follow agile methods like Scrum?

For a small start-up with only one or two programmers, is it possible to implement agile methods like Scrum? If NO, what is the minimum team size required? I guess Scrum needs few programmers to be onsite as well? _**_Edited **** I think the Agile methods are meant for team collaboration and improve workflow so a single man may not benefit much.


Are there tasks which require significantly less work with Ruby than C# 4.0?

I just finished reading the Ruby chapter of the book 7 Languages in 7 Weeks. Aside from some syntactic sugar here and there I can't really see anything which can't be done with C# with a similar syntax. I do understand both languages are inherently different, but my question relates to its usage rather than design. Relevant questions make me believe Ruby offers little more than C#:   * Why aren't c# programmers drawn to ruby as java programmers are?   * Is Ruby's code block same as C#'s lambda expression? I hardly worked with Ruby and my understanding of the language is still very limited, so perhaps somebody who experimented with both .NET 4.0 and Ruby can answer with concrete examples. **Which tasks require significantly less work with Ruby than C# 4.0?** P.s.: This question got closed on StackOverflow as too subjective and argumentative, although it did attract some attention. I was hoping it would be merged to here, but instead I'll just have to repost it.


What makes a piece of software an Engine?

The descriptor 'Engine' gets thrown around a lot: graphics engine, RegEx engine, AI engine, etc. but what actually makes a piece of software an Engine? Design, Input/Output, Purpose, Size?


Presenting PHP source on the Web

I've written a patch for a GPL'ed JavaScript library. To check how the patch works one needs sample CGI (or PHP) backend. I want to write a demo PHP to show that my JS works and put the open code on my site. The question: What it the best way to have PHP on server both executed and viewed as the source? Note that recently I have ordered a Virtual Private Server with a 5 Gb disk, so there are no troubles with installing new software (if any needed) for me.


What is the career path for a software generalist?

A question on software specialties inspired this question. How valuable is a software generalist compared to a specialist? When I say generalist, I mean someone who can take a project from requirements to deployment, and is competent with all phases of the software development lifecycle. Someone who can put all the specialties together into a cohesive whole. An expert generalist knows his or her weaknesses and fills them by relying on specialists - example: Oracle specialists or UX specialists. What do you see as the ultimate career path of the software generalist?


ScrumMaster Interview Questions

I have a bunch of ideas around questions I can ask a potential candidate for a ScrumMaster position, but I wanted to reach out to the awesome community as to interview questions/exercises to do for a potential ScrumMaster role:   1. What questions would you ask?   2. What exercises would you have them do?


How are Programming Languages Designed?

After doing a bit of programming, I've become quite curious on language design itself. I'm still a novice (I've been doing it for about a year), so the majority of my code pertains to only two fields (GUI design in Python and basic algorithms in C/C++). I have become intrigued with how the actual languages themselves are written. I mean this in both senses. Such as how it was literally written (ie, what language the language was written in). As well as various features like white spacing (Python) or object orientation (C++ and Python). Where would one start learning how to write a language? What are some of the fundamentals of language design, things that would make it a "complete" language?


Two database fields for date and time - should they be merged?

In the following question, field and table names have been changed to protect their identities. If I have two database columns:               MONKEY_DATE DATETIME NULL (with data e.g. 2012-05-14 00:00:00.000)     MONKEY_TIME DATETIME NULL (with data e.g. 1753-01-01 16:30:53.025)      _The date component of the time field is **mostly** set to 1st Jan 1753... but some data has 1st Jan 1899 and some has 1st Jan 1900._ I find that maintaining the code to query and report on these columns causes me (and our team) a headache that could easily be solved by merging the two columns. However, experience (and Terry Goodkind) has taught me that nothing is ever easy. See below some examples of why this is a headache. **My Approach** I'm thinking the following approach will have the desired effect of merging the two columns:   1. Use SQL to update the data, setting the value for the date field and the value for the time field both to the same value, which is a mix of the date component from the date field and the time component from the time field   2. Write any new code only using the MONKEY_DATE field   3. Eventually phase out the MONKEY_TIME field and any of the date/time component SQL (see examples)   4. Drop MONKEY_TIME This will mean we don't immediately have to go and make retrospective changes to the whole system... all existing code will continue to work... and we can begin to do things The Right Way. SQL for #1 might be (Oracle):               UPDATE MONKEY SET          MONKEY_DATE = TO_DATE(TO_CHAR(MONKEY_DATE, 'MM/DD/YYYY ') ||                            TO_CHAR(MONKEY_TIME, 'HH24:MI:SS'),                            'MM/DD/YYYY HH24:MI:SS')         MONKEY_TIME = TO_DATE(TO_CHAR(MONKEY_DATE, 'MM/DD/YYYY ') ||                            TO_CHAR(MONKEY_TIME, 'HH24:MI:SS'),                            'MM/DD/YYYY HH24:MI:SS')      **The Question** My questions to you are:   * Should these fields be merged?   * Is my approach reasonable to merge these two columns?   * Do you think it would be better to skip steps two and three?   * Do you have any other (constructive) comments or suggestions? **Examples** For example, to select all my monkey dates and times and order them by date and time, I need to do something like this (SQL Server):               SELECT            CONVERT(DATETIME, CONVERT(VARCHAR, MONKEY_DATE, 101), 101) AS MONKEY_DATE         , CONVERT(DATETIME, CONVERT(VARCHAR, MONKEY_TIME, 108), 108) AS MONKEY_TIME      FROM MONKEY      ORDER BY           CONVERT(DATETIME, CONVERT(VARCHAR, MONKEY_DATE, 101), 101) DESC         , CONVERT(DATETIME, CONVERT(VARCHAR, MONKEY_TIME, 108), 108) DESC      or this (Oracle - slightly more explicit):               SELECT           TO_DATE(TO_CHAR(MONKEY_DATE, 'MM/DD/YYYY'), 'MM/DD/YYYY') AS MONKEY_DATE         , TO_DATE(TO_CHAR(MONKEY_TIME, 'HH24:MI:SS'), 'HH24:MI:SS') AS MONKEY_TIME     FROM MONKEY     ORDER BY           TO_DATE(TO_CHAR(MONKEY_DATE, 'MM/DD/YYYY'), 'MM/DD/YYYY') DESC         , TO_DATE(TO_CHAR(MONKEY_TIME, 'HH24:MI:SS'), 'HH24:MI:SS') DESC      I also often find myself selecting a merged date/time column (Oracle):               SELECT          TO_DATE(TO_CHAR(MONKEY_DATE, 'MM/DD/YYYY ') ||                  TO_CHAR(MONKEY_TIME, 'HH24:MI:SS'),              'MM/DD/YYYY HH24:MI:SS') AS MONKEY_DATE_TIME      FROM MONKEY      Because, almost all the time, we want to know the date and time of the monkey. The above SQL could be easily altered to:               SELECT MONKEY_DATE_TIME FROM MONKEY ORDER BY MONKEY_DATE_TIME      ... If only we had merged columns. **Background** I've inherited an old ASP system that stores dates and times in separate columns in the database. I've been told this is probably because the application started out in an early version of Access, where it was not possible to store both date and time in the same column. The whys and hows aren't really part of this question, but some people like to know. **P.S.** I really nearly posted this in SO.SE, so my apologies if I got the wrong site.


Geographically limited / gradual release process

I am looking for more information on a **gradual release process** \- that is when you release new version of a software only to certain set of end users, mostly geographically limited (or limited by a reach of particular server). Google seems to be blind to this term - that indicates that's not how it's called. What's the name then? EDIT: An example of what I mean is when Facebook rolled out new image galleries they were first visible to certain users only, then to whole US and then to the rest of the world.


(Dis-)advantages of structural typing

I’ve just watched this talk by Daniel Spiewak where he talks about the advantages of _structural typing_ as compared to Scala’s ans Java’s _nominal typing_. One example for this difference would be the following Java code               public interface Foo {       public int length();     }     public interface Bar {       public int length();     }          Foo f = ...;     Bar b = f;      which of course would not compile because type compatibility between `Foo` and `Bar` is determined by name. A structural type system on the other hand could declare both types being equal or compatible and thus, amongst other things, allow for checked duck typing. Now I think I do understand most of the advantages of a structural type system but I wonder if it would not invalidate type safety from examples like the following               class Foo {       class Bar { /* ... */ }       def takeBar(b: Bar) = { /* ... */ }       def getBar: Bar = new Bar     }          val foo1 = new Foo     val foo2 = new Foo     foo1.takeBar(foo1.getBar) // should compile     foo1.takeBar(foo2.getBar) // should not compile      Is my understanding correct that in a structural type system the last line would compile as well and if so, wouldn’t this be a disadvantage with respect to type safety?


Dynamic initialization, how does it work?

I have a question regarding dynamic initialization. Example code               void main()     {     int a = 100;     //Statement1     //Statement2     ...     float b = 6.32987; //StatementA     ...     return;     }      The `StatementA` allocates memory at the middle execution of program. How does process takes place and where does space gets allocated for variable `b` (stack or heap)?


FSM drawing tool with export to XMI

I'm searching for good tool that will allow me to draw Finite State Machine and then export it into XMI file so I could easily read it into my program. Could somebody propose something?


License question, what happens to a piece of source code when its owner passes away

I am using a piece of free source code in one of my projects. The source code was written in the 1990s and is available from a website that says the code may be modified and distributed freely. The source files contain no License indication but they have a "Copyright All Rights Reserved" comment. This morning I started to realize that I may have a License problem because my project is published under the GNU General Public License so I tried to contact the owner of the source code. Unfortunately the owner passed away and thus his company ceased work. What happens to the source code, is its Copyright sill valid, does it have an owner???


storing and retrieving millions of documents using c#

I am working on an integration project, where my “app/web service” will sit in the middle serving documents. Basically, a request is sent with the document id as part of the query string, I check if it exists and if it does, write the document (pdf) back to the response. Now, this is very simple to do and we have done this many times. This is where it gets very tricky, there will be about 5200 new files added each week, that’s 3GB per week (so about 150GB of data per year). We are expected to keep 10 years of data. What is the best way of storing these documents and searching has to be very quick. Some options are: If I choose to save all these files on a network share, initially it will be quick but over time it is going to be very slow. If I choose SQL to store these files, I can’t really store all documents in a single table or utilize table partitioning, DB partitioning etc. If I go with DB partitioning that’s still 150GB DB file each year to backup and restore. I was thinking implementing RBS for MS SQL but not sure how quick this is going to be. Any suggestions or other options I might have....?


Should JavaScript and PHP objects be treated as different objects in an interaction diagram?

I'm drawing a communication diagram for an application where you can buy books. I'm using domain-driven design and have a 'shop' object, a 'cart' object, and a 'book' object. My **first communication diagram** , for when the user first comes to the site, is **straightforward**. I generate all HTML (to show all books and an empty cart) back end with the help of PHP. I use an MVC pattern; so first I send a message to a 'controller' which creates a 'shop' with 'book's and an empty 'cart' before sending these to the view. My **second communication diagram** is where I run into **problem** : It is about adding a book from the shop to the cart. I already have all the information I need to add the book to the 'cart' on the client side; since all book information is already in the shop. So when writing the communication diagram, should my first message, that is, AddBookToCart(bookId:int), be to a JavaScript object called 'shop' which gets the book info and send a message 'AddBookToCart(bookinfo:object) to 'cart' which in turn update the page? I have never done communication diagrams with JavaScript in mind before, so I'm really confused about how to deal with the front end. (I have been searching for over five hours, but I didn't find anything on this topic. It's like it's not even an issue to people. Am I viewing this problem completely wrong? Otherwise any resources, or even search terms to use to learn about how to model (and code) these kind of things would be much appreciated)


What is the best plugin for Eclipse to work with GitHub? What does it do well? What does it do not so well? And how do you work around them?


Functional Programming in Commercial Software

I was recently discussing functional programming with a co-worker. While the two of us both agreed that FP has some obvious benefits (simpler code, easier to reason about mathematically, etc.), we both wondered whether or not it is or will ever be used in commerical software. I know there are a number of open source and academic projects that are written functionally (e.g. I've seen this question on Stack Overflow) but I'm wondering if anyone can list some other commercial software that is written, at least in part, in a functional language (and what language).


Which problems domains are more suited to functional programming solutions and why? Can anyone provide any examples? **EDIT** Just to clarify, I'm not asking for a list of problems. I want to know what **type** of problems are best suited to functional solutions. For example I have heard financial problems are solved well with functional programming.


Example of where Functional Programming is Superior to Imperative or Object-Oriented Programming?

> **Possible Duplicate:**   >  Which problems domains are more suited to functional programming solutions I've been reading about functional programming. I've been using mostly C#.net recently, and I would like to know of a good real-world example of where a functional language such as Lisp or F# would be a clearly superior tool for getting a job done.


How can I improve my communication skills?

Jeff Atwood suggests that becoming a great programmer takes serious communication skills. What are the suggested ways for a programmer to develop his communication skills?


I have only two languages on my resume - how bad is this?

I have a question that can be best answered here, given the vast experience some of you guys have! I am going to finish my bachelor's degree in CS and let's face it, I am just comfortable with C++ and Python. C++ - I have no experience to show for and I can't quote the C++ standard like some of the guys on SO do but yet I am comfortable with the language basics and the stuff that mostly matters. With Python, I have demonstrated work experience with a good company, so I can safely put that. I have never touched C, though I have been meaning to do it now. So I cannot write C on my resume because I have not done it ever. Sure I can finish K & R and get a sense of the language in a month, but I don't feel like writing it cause that would be being unfaithful to myself. So the big question is, are two languages on a a resume considered OK or that is usually a bad sign? Most resumes I have seen mention lots of languages and hence my question. Under the language section of my resume, I just mention: C++ and Python and that kinda looks empty! What are your views on this and what do you feel about such a situation? PS: I really don't want to write every single library or API I am familiar with. Or should I?


What is an "ontology" in the context of the Semantic Web?

Okay, I have been learning SPARQL to query dbpedia and I can't seem to find clear and practical tutorials related to SPARQL and the Semantic Web. If I say that an ontology is analogous to an SQL table definition or maybe a specification of an object's members should I be slapped?


Help me in choosing appropriate pattern

From last one week i was searching for most suitable architecture for a **new web application**. To be honest i did web development for only 1 year (back in 2007). And from last four years i am working in C++. Now, suddenly i am assigned a task to search for best architecture for a new web application. During my search i cam across following 3 options:   * Model View Controller   * Model view Presenter   * 3 Tier Archi (Presentation layer <\--> BLL <\--> DAL) # What we are going to Develop We are targeting towards the development of a social web application like facebook, twitter etc. Once we have launched the web version then we move towards the **mobile edition** of same application # What we will use We will use ASP.net and C# under framework 4.0 # Why I Post Question? To be honest, i don't have experience either in web development or mobile application development, so the major purpose of posting this question is to get hep from some experienced developers/architects. # My Question: I am looking for such an architecture that first allow me to start with web version and then allow me to provide mobile edition with less effort. With less effort i mean to say that I only want to develop two UI Layer two times (One for web and one for Mobile). I want my Business logic and data access layers remain same for both UI layers. Please help me in chossing appropriate pattern for above application. # What i did so far at my own? I read all above 3 architectural patterns in details and have basic understanding of all three but still unable to choose appropriate pattern for me, secondly i didn't find any more patterns so if there are some more please share their names only


How is indirection different from aliasing?

Take from wikipedia, aliasing is defined as accessing a data location through different names. Also taken from wikipedia, indirection is defined as referencing something "using a name, reference, or container instead of the value itself". Am I missing something here - Are these two one and the same? If not, how are they different?


Should I learn a web framework(python)?

I'm learning Python, and I wanted to advance my skills a bit further so I decided to learn django, then moved on to Flask before realizing that I was having difficulties understanding the very concept of web-frameworks. I don't have any ideas for a website yet so do you still advise me to continue learning a web framework?


Sentence Tree v/s Words List

I was recently tasked with building a Name Entity Recognizer as part of a project. The objective was to parse a given sentence and come up with all the possible combinations of the entities. One approach that was suggested was to keep a lookup table for all the know connector words like articles and conjunctions, remove them from the words list after splitting the sentence on the basis of the spaces. This would leave out the Name Entities in the sentence. A lookup is then done for these identified entities on another lookup table that associates them to the entity type, for example if the sentence was: `Remember the Titans was a movie directed by Boaz Yakin`, the possible outputs would be: >   >  {Remember the Titans,Movie} was {a movie,Movie} directed by {Boaz > Yakin,director}   >  {Remember the Titans,Movie} was a movie directed by Boaz Yakin   >  {Remember the Titans,Movie} was {a movie,Movie} directed by Boaz Yakin   >  {Remember the Titans,Movie} was a movie directed by {Boaz Yakin,director}   >  Remember the Titans was {a movie,Movie} directed by Boaz Yakin   >  Remember the Titans was {a movie,Movie} directed by {Boaz Yakin,director}   >  Remember the Titans was a movie directed by {Boaz Yakin,director}   >  Remember the {the titans,Movie,Sports Team} was {a movie,Movie} directed by > {Boaz Yakin,director}   >  Remember the {the titans,Movie,Sports Team} was a movie directed by Boaz > Yakin   >  Remember the {the titans,Movie,Sports Team} was {a movie,Movie} directed by > Boaz Yakin   >  Remember the {the titans,Movie,Sports Team} was a movie directed by {Boaz > Yakin,director}   > The entity lookup table here would contain the following data:   > Remember the Titans=>Movie   >  a movie=>Movie   >  Boaz Yakin=>director   >  the Titans=>Movie   >  the Titans=>Sports Team   > Another alternative logic that was put forward was to build a crude sentence tree that would contain the connector words in the lookup table as parent nodes and do a lookup in the entity table for the leaf node that might contain the entities. The tree that was built for the sentence above would be: ![enter image description here](http://i.stack.imgur.com/TJw5M.png) The question I am faced with is the benefits of the two approaches, should I be going for the tree approach to represent the sentence parsing, since it provides a more semantic structure? Is there a better approach I should be going for solving it?