title: What's the most productive coding environment

text: I was speaking with an ex-colleague the other day about the most productive way to write code and he said he found it best "to CIMP, or Code In My Pants". When I asked him exactly what he meant, he explained he found it best to work at home, coding at his own pace, dressed comfortably (in his pants), and communicating with his team through emails, IM, or the telephone. Digesting his approach (which he describes to clients as the Complete Integrated Method of Programming), I realised my coding is also more productive when working in an isolated environment, which made me wonder if the software industry has got it all wrong and should development be really done by dispersed teams of individuals, or are there advantages to geographical herding that make up for the added interruptions it brings? So has business got it wrong? Should development occur predominantly across geographically isolated individuals to increase productivity, or are there real reasons why herding developers together makes sense?


title: How will I restrict the number of users logged in based on session?

text: I have a software (in cloud) with so many registered users. I want to restrict the number of users logged in at a time to certain number (configuration based, let's say 100). If the 101 user tries to login he should be placed in queue with priority 1, subsequently 102 user should be 2 in queue, I know at every time a logged in users request is hitting the server the `sess_file` access time will be updated. What should be the logic from here? Should I check the last accessed time of all the `sess_file` and log-out the uses that are idle? and how will I manage the waiting queue? Software is done with PHP-MySQL. When the user is logged in I mark the column as logged in in user table, and when the log-in page is loaded if the total logged in user count is 100, the 101 user who is trying to log-in is directed to a intermediate page which will check via ajax call fired at an interval of 5 mins that if any user is logged out. If a slot is available it redirects to the log-in page, automatically logs in and redirects to the user dashboard. But I want to know any better practice is there. Mostly I want to know the invalidation of logged in user by checking the access time of `sess_file` is the right way to do it?


title: Internal Libraries (Subversion Externals, 'library' branch, or just another folder)

text: Currently working on multiple projects that need to share internal libraries. The internal libraries are updated continually. Currently only 1 project needs to be stable but soon we will need to have both projects stable at any given time. What is the best way to SVN internal libraries? Currently we are using the 'just another folder' like so... > trunk\project1   >  trunk\project2   >  trunk\libs It causes a major headache when a shared library is updated for project1 and project2 is now dead until the parts that use the library are updated. So after doing some research on SVN externals I thought of this... > trunk\project1\libs (external to trunk\libs @ some revision)   >  trunk\project2\libs (external to trunk\libs @ different revision)   >  trunk\libs\ I'm a little worried about how externals work with commits and not making library commits so complicated that I am the only one capable of doing it (mostly worried about branches with externals as we use them extensively). On top of that we have multiple programming languages within each project some of which don't support per-project library directories (at least not easily) so we would need to check out on a per project basis instead of checking out the trunk. There is also the 'vendor' style branching of libraries but it has the same problem as above where the library would have to be a sub folder of each project and is maybe a little to complicated for how little projects we have. Any insight would be nice. I've spent quite a bit of time reading the Subversion book and feeling like I'm getting no where.


title: Should a DR & CR entry both be created or a single-entry accounting is fine

text: A new project has an amount. It is always related to a client. One client can have many projects. And he may pay in steps for a particular project. In order to keep track of client payments, I've created a table namely `client_ledger` which contains information about date, time, amount, mode of payment & related project. But then in one of the software screens, I have to reports pertaining to a client's debit & credit. So there are 2 things that can be done :   1. Either I can get the total amount of all projects of that client and his total payments & then can show how much balance is left to be paid.   2. Or if I'd created an entry in the `client_ledger` table for `DR`, then as soon as a project is created, an entry is made in the table for `DR` and subsequent payments received will be `CR`ed into the data-base. In this case, if a project's amount is modified/edited later, then either the original `DR` entry has to be modified, or a new `CR` entry followed by the new project amount's `DR` entry should be made. Which of these processes should be followed ?


title: Developers inheriting code. What to ask the old developer to better help the new developer?

text: I know nothing about code. We've had our old iOS developer drop out and we're looking for a new developer or a team to pick up where he has left off. I'm aware there can be issues with developers inheriting code etc. What are some questions that I can ask my old developer to better help the new developer understand what stage the code is at, what needs working on etc etc. Just general type questions? So that when I meet with potential new developers I can hand them a 'fact sheet' of where the code is at form the old developer.


title: Is there a need for a factory class for creating viewmodels?

text: A colleague of mine suggested using a factory class for creating viewmodel objects in our ASP.NET MVC solutions. The idea being that it can help with the design, and maintainability, of the way viewmodels are built in our apps. I wanted to find out if anyone else has experience of this. I've done some research and found very little on this practise. Currently we create viewmodel objects at the controller level eg               public ActionResult Index()     {         return this.View(this.BuildIndexViewModel());     }      So this.BuildIndexViewModel() is responsible for creating the viewmodel class (obviously :). But we're looking into the possability of:               public ActionResult Index()     {         return this.View(ViewModelFactory.CreateIndexViewModel());     }      This is an interesting idea, but I'm not 100% convinced. I was interested in other people's opinions on this.


title: Switching to Windows Identity Foundation - Should we use the SQL Server role and membership provider?

text: We have an application which uses SQL Server as the back end. It was client server based, now it will be web based. Our implementation to logon was a user ID and password hash/salt stored in the database. Additionally, all policies and roles were stored in our table schema and assigned to users and or user defined groups. So, they would login, authenticate, and then we would pull the role(s) and policies for that user so they could use the parts of the application that thier role(s) and policies allowed for. We are investigating WIF now that it is web based. Ideally we would like to re-use our current model, that is, be able to logon using our existing table(s) and then pull the roles and polices afterward. However, there is a SQL Server role and membership provider. Would it be easier to switch the login, roles, and membership using the built in SQL Server provider and deprecate our table schema? Or should we build a provider from scratch?


title: How can I keep a production Python environment secure?

text: Most of my work is creating websites in Django (a Python web framework) and deploying them to my own or clients' servers. I work from a `virtualenv` to separate site from system packages and have perhaps 60-80 packages installed in there and that lot is shared between two-dozen sites. This obvious limitation to this approach is needing to test every site if I upgrade a package it uses. I consider that a fair trade-off for not needing to keep on top of umpteen separate virtualenvs. And that is essentially my whole problem. **How on earth are you supposed to keep on top of`virtualenv` deployments?** People just seem to treat them like a dumping ground but if the programming universe has learnt anything this past week from the Ruby on Rails explosion, using old versions of software is unacceptable. I have a simple script that attempts to check for current package versions with the latest `pip` counterpart but it's quite inacurrate. It also doesn't differentiate between security upgrades and feature upgrades (which require days of testing and fixing). I am looking for something better. I am looking for something that can let me know if Django has a new security release out, or if something is end-of-life. I want something to help me (and other Python devops) not become the next batch of people crying after a wave of kids with scanners and scripts convert our servers into a botnet. Does such a thing exist?


title: What is the difference between bug and new feature in terms of segregation of responsibilities?

text: We are planing to introduce Help Desk and Support Desk in our project. Our current development team would be divided into two smaller teams: Support Desk and Development team. Support Desk would be responsible only for bug fixing. Development team would be responsible for making enhancements and new features development. What value do you see from such responsibilities and teams segregation? Can we find a differences between bug and new features in terms of development activities? Is there any real value of doing such things?


title: Does hierarchial inheritance belong to the past?

text: Recently it came to my attention that hierarchical inheritance may be a relic of thinking of classes as "structs with functions" rather than a product contract-driven mentality. Consider, as a simple specimen the implementation of "Unmodifiable Iterator" from Guava. http://guava- libraries.googlecode.com/svn/trunk/javadoc/com/google/common/collect/UnmodifiableIterator.html It's an iterator which throws an "UnsupportedOperationException" on invocation of remove(). Now, I'm sure most people would agree that implementing a contract and then having one of its methods always throw an exception is bad form -- when you implement a contract you're implicitly guaranteeing that all the methods would work. Yet, what are our options here? We could declare an interface which does not contain the remove method but that would render our return type incompatible with all methods which work on iterators. We could blame the Java API designers for forcing the remove() method to be a part of every iterator, rather than moving it to a higher level interface such as "RemovableIterator". If they did that it would indeed avoid some problems but let's say we need an iterator which can also set values called "SettableIterator" (implements setValue(T) ) and also a resettable iterator. If we require a combination of these functionalities we are forced to declare an interface for every combination. RessetableSettableIterator, RessetableRemovableIterator, RemovableSettableIterator , etc. The combinations grow exponentially to the extra features we add to the interface. What we are usually trying to express is something like 'this function requires a parameter which is Iterable, Settable and Ressetable' or 'this function returns a value which is Iterable and Resettable'. Yet languages like C#, Java and C++ do not allow us to do this without very awkward use of generics. Are there recent methods that make this kind of design obsolete?


title: Which UML colors should this example be represented by?

text: See UML colors here. Here is the example, I have following entity classes:               User(name)          MailBox(owner: User, label)          Mail(from: User, to: User, subject, body, composeTime)          MailCopy(type, from: User, to: User, subject, body)          MailDelivery(mailCopy, mailBox)      Use case: Every users have three mailboxes by default: `MailBox(*, draft)`, `MailBox(*, received)` and `MailBox(*, sent)`. `User(alice)` composed a new `Mail(alice, bob, hello, world)`, and clicked the "send" button. A new `MailCopy(SOURCE, alice, bob, hello, world)` is created and delivered to the `MailBox(alice, sent)`, and another copy `MailCopy(DEST, alice, bob, hello, world)` is created and delivered to the `MailBox(bob, received)`. I want to know how to classify these entities according to the UML colors archetype?


title: Is there a canonical book on mathematics for programmers?

text: I'm a self-taught programmer. I am honestly not good in math. What advice you can give to improve my Mathematical skills so that I will not be so insecure around my fellow programmers? What are the steps or guidelines that you can recommend to improve my mathematical skills? Is there a book out there that's the de-facto standard for describing best practices, design methodologies, and other helpful information on mathematics for programmers? What about that book makes it special?


title: How would you go about education yourself in math in a way that is relevant to programming?

text: > **Possible Duplicate:**   >  Is there a canonical book on mathematics for programmers? My undergraduate math educating was mostly breadth with little to know depth. Yes, I passed the tests; i got my As, but I do not feel competent in mathematics. If you were to change that? How would you go about doing it? What books? What order? What would you emphasize? What would you skip altogether?


title: Is there such a thing as too much asynchronous code?

text: I am at the moment messing around with clients and servers in C# winforms and I'm trying to implement it all asynchronously. However, I'm beginning to wonder, should I use asynchronous code for everything? Here's a list of what I'm doing asynchronously at the moment:   1. TcpClient.BeginConnect with TcpClient.EndConnect   2. NetworkStream.BeginRead with NetworkStream.EndRead   3. TcpListener.BeginAcceptTcpClient with TcpListener.EndAcceptTcpClient   4. Listening thread on server for client connections   5. Listening thread on client for incoming data from server   6. Listening Task on server for incoming data from each client   7. New Task created every time an event such as ConnectionLost is raised (so the respective form can update). Think Delegate.BeginInvoke. Everything is set up asynchrously and it works well, but I'm beginning to wonder if all of these _should_ be asynchronous. I mean, it all sounds nice and people claim it to be efficient due to IO completion ports not blocking or something, but is it really? I can understand having a single thread for listening on both the client and server, and for reading it makes sense as well. But every time an event is raised (which may be quite often!), should its invocation really be asynchronous? It seems like I am using Tasks for everything that _can_ be made asynchronous and I'm not sure whether or not that is best practice.


title: Parent and child permission schemes

text: Which approach makes most sense to use, the destructive one or the non- destructive one? Does anyone have real-world experience with one, both or even a different approach? **Model** A permission scheme has a set of permissions linked to it. It can also have a parent from which it inherits permissions. **Destructive** Taking away permissions from a parent scheme also takes away those permissions in any child scheme. Reason to use this: when later re-enabling those permissions for a parent scheme, they are not automatically re-enabled for child schemes. Reason to not use this: accidently taking away permissions from a parent scheme means the permissions for child schemes have to be restored separatly. **Non-destructive** Taking away permissions from a parent scheme has no effect on child schemes. The parent and child schemes are combined to determine the correct permissions. Reason to use this: accidently taking away permissions from a parent scheme does not require the child schemes to be restored separatly. Reason to not use this: when later re-enabling those permissions for a parent scheme, they are automatically re-enabled for child schemes.


title: what is "graceful degradation"?

text: I hear a lot about this term "Graceful degradation". For example ,                "An application server should gracefully degrage when it is under heavy load "            "Graceful degradation of user interfaces.... "      The term looks like an abstract thing to me. Any concrete example of what it means?


title: How to Implement Error Handling

text: Even though I've programmed on a professional level for some years I still do not fully understand error handling. Although my applications work fine, the error handling isn't implemented at a professional level and is a mix and match of a number of techniques. There is no structure behind my error handling. I'd like to learn and understand how it's implemented at a professional level. This is one area where I lack knowledge. When should I use an exceptions and when should I return a success status, to be checked in the logic flow? Is it OK to mix exception and returning a status? I code in C# mainly.


title: Building automated unit tests for tools which don't have an xUnit implementation

text: # Preamble I have been bitten by the bug of automated unit testing. I feel the benefits and the confidence in a code base it can deliver. I am also feel I have a reasonable intuition as to what parts of the code _deserve_ to be unit tested. Code that has logic, code that might be messy (because it's dealing with some messy requirements) that you are happy to have encapsulated, that may have a few odd fringe conditions. # Unusual Context At my place of work, we leverage a number of tools which are fairly niche. For the sake of argument I can certainly see that these tools deliver on features and efficiencies making them indispensable for getting their particular job done. The challenge I have is that I certainly have implemented logic in these tools which my gut says "this should be covered with a unit test". I have tested these bits of code...   * In a throwaway fashion - try several inputs to exercise the code until satisfied it works - this has the downside of being lost effort when it comes to people maintaining the code in the future   * In a less throwaway but manual fashion - writing up the test cases and steps to poke the code to produce output; with test data; such that the above throwaway tests are not thrown away - this retains the investment in time, but is slow and subject to people knowing about the tests and running them   * In a slightly more automated fashion - with scripts to do the poking of the code; perhaps even check the output to a degree - this is more pleasant to re-run but is far from leveraging a mature framework in a consistent manner like when writing the xUnit style tests While the progression feels nice, I feel I'm missing the xUnit experience I've become a fan of. # What kind of languages/platforms exactly am I dealing with here?   * An ETL tool, akin to SSIS, called RedPoint Data Management: not open source so I'll describe, it has projects which have tools, these tools are linked by data flows, and some have some logic I wish to unit test   * A composition tool, this for the uninitiated is a product which takes a data file and outputs a print file. Imagine XML in, PDF out.   * DOS script functions: I promise this is a real feature of good'ol'fashioned DOS scripts, tutorial here   * (I'll add this to the list, not strictly what I need help with, but may be more clear than the above if my tool set is difficult to empathise with) COBOL data transformations, using CopyBooks to specify the formats of the flat file inputs and outputs. When compiled results in one big-ball-of-mud binary even if functionally decomposed inside # The Actual Question Are xUnit style tests fundamentally aimed at Object Oriented languages?


title: Optimal Data Structure for our own API

text: I'm in the early stages of writing an Emacs major mode for the Stack Exchange network; if you use Emacs regularly, this will benefit you in the end. In order to minimize the number of calls made to Stack Exchange's API (capped at 10000 per IP per day) and to just be a generally responsible citizen, I want to cache the information I receive from the network and store it in memory, waiting to be accessed again. I'm really stuck as to what data structure to store this information in. Obviously, it is going to be a list. However, as with any data structure, the choice must be determined by what data is being stored and what how it will be accessed. What, I would like to be able to store all of this information in a single symbol such as `stack-api/cache`. So, without further ado, `stack- api/cache` is a list of conses keyed by last update:               `(<csite> <csite> <csite>)      where `<csite>` would be               (1362501715 . <site>)      At this point, all we've done is define a simple association list. Of course, _we must go deeper_. Each `<site>` is a list of the API parameter (unique) followed by a list questions:               `("codereview" <cquestion> <cquestion> <cquestion>)      Each `<cquestion>` is, you guessed it, a cons of questions with their last update time:               `(1362501715 <question>) (1362501720 . <question>)      `<question>` is a cons of a `question` structure and a list of answers (again, consed with _their_ last update time):               `(<question-structure> <canswer> <canswer> <canswer>      and `               `(1362501715 . <answer-structure>)      This data structure is likely most accurately described as a tree, but I don't know if there's a better way to do this considering the language, Emacs Lisp (which isn't all that different from the Lisp you know and love _at all_ ). The explicit conses are likely unnecessary, but it helps my brain wrap around it better. I'm pretty sure a `<csite>`, for example, would just turn into               (<epoch-time> <api-param> <cquestion> <cquestion> ...)      **Concerns:**   * Does storing data in a potentially huge structure like this have any performance trade-offs for the system? I would like to avoid storing extraneous data, but I've done what I could and I don't think the dataset is that large in the first place (for normal use) since it's all just human-readable text in reasonable proportion. _(I'm planning on culling old data using the times at the head of the list; each inherits its last-update time from its children and so-on down the tree. To what extent this cull should take place: I'm not sure.)_   * Does storing data like this have any performance trade-offs for that which must use it? That is, will set and retrieve operations suffer from the size of the list? Do you have any other suggestions as to what a better structure might look like?


title: Other than the Linux kernel, which operating system kernels should you study?

text: The Linux kernel is often listed as a code base which you are recommended to read and, even if it is poorly commented (or the files I have looked at have all been), it does have some really good code in it. Now, putting the Linux kernel aside, which other operating system kernels do you recommend people interested in systems programming and/or operating systems to study? **Why?** What is so great about the code base? Would it show you very different approaches from what the Linux kernel has gone with? Do they use interesting technologies? Something else...? That the kernels are under an open source license is more or less necessary.


title: What are some good open source c++ packages to study in order to learn advanced software construction?

text: I've heard that you should read 10 times more than you should write. This applies to both literature and source code. Therefore, I'd like to study the best c++ packages we've developed. I'm interested in discovering extremely high quality software packages that use c++, c and assembly. This begs the question, "What determines high quality?". Well, that's kind of up to you. Could you provide a bulleted list of **_your reasons for choosing your packages_** and also **_the list of open source c++ packages_**. For example my list of qualities that I think make good software are:   * Well commented (with full javadoc comments for every function, method and class signature)   * Well organized (files broken up into logical, manageable pieces)   * Well documented (a reasonable amount of up to date, bug free documentation. Hopefully with some documentation on the high level structure)   * Well named classes and variables (succinct, verbose variable names; this should reduce the need for inline comments, however inline comments are always welcomed; no single-letter variables)   * Should have unit tests.   * Consistent style and formatting.   * Hopefully demonstrates clean and recommended usage of a good library like Boost, Qt, STL, etc. My list of packages is:   * TrueCrypt (Though is doesn't have full javadoc signatures)   * Chrome   * OpenSceneGraph I'm aware of this post. It's two years old and doesn't have the list of reasons. Thank you very much for your contributions, in advance. :-) UPDATE: I've created a github repository will all of the packages listed below. I'll continue to update it as more are added. https://github.com/homer6/c_reading


title: Difference between a pseudo code and algorithm?

text: Technically, Is there a difference between these two words or can we use them interchangeably? Both of them more or less describe the logical sequence of steps that follow in solving a problem. ain't it? SO why do we actually use two such words if they are meant to talk of the same? Or, In case if they aren't synonymous words, What is it that differentiates them? In what contexts are we supposed to use the word pseudo code vs the word algorithm?


title: What's the cheapest way to host hobby projects?

text: What's the best place to put your hobby web projects(the web app itself, not the code) ? Typically, the projects are such that: a) I just want to test out an interesting idea without exploring the business angle to it, just to see how people take it. b) I don't expect a lot of traffic c) I don't want to scale immediately d) I don't want to be tied down to one technology(I want to do different projects to get familiar with various web stacks, langs and libs) Google app engine seems very restrictive for such exploratory stuff ... Restrictions like no outbound request can go beyond 10 seconds and every request has to return with 30 seconds, etc. piss me off, I know they are needed for scale, but I would like them to be optional. Amazon EC2 micro nodes are free for a year. But they ask for credit card information which I am not sure if I want to give away when I'm not paying initially. What other free/cheap alternatives do I have?


title: Make my project Open Source but protect my Company

text: My Company is developing a web application, similar to GMail or Remember the Milk. We are on the verge of releasing the source code under AGPL. We are just afraid somebody will take the code and set up as a competitor. What can we do to prevent that? We were thinking to keep the code that powers our API closed, as it is the most important asset of the Company. We don't like that very much, so we would like to find alternative routes.


title: What's your approach to assuming someone else's project?

text: I think this is a fairly common and challenging topic for anyone that has ever inherited code from another programmer or team. I can think of two common scenarios in my professional career that I've run into; diving into an open source project, and strictly inheriting the code of an individual's project. I'm coming up on the latter and will be inheriting a project created by an individual, and while thinking about how to best approach this, I figured I would ask for the intelligence of p.se so I can learn from your experiences. When Magento (large scale eCommerce application) came out, I was really lost in the Zend framework. There was little documentation out during alpha, so it was hard to use the community resources. I ended up using `grep` a lot and back tracing methods to get a firm understanding of what it does. By doing that, I eventually learned more about the application design, although it did take a little while. What is your approach when you're up against a project that has little documentation? I feel like it is almost finishing the painting of someone else, which is always an interesting task.


title: JRE for 64-bit and 64-bit Java?

text: FWIK Java can run on 64-bit system, no problem. I'd like to know how Java support 64-bit features, e.g., `System.identityHashCode()` returns a 32-bit int, it's common to see the object pointer (memory address) is returned. Should 64-bit Java returns long instead? If not, how would Java scale to 64-bit systems?


title: Order collisions in ecommerce

text: Suppose I have a web app where sellers add their products and set them as available for sale. Then I show a list of products in my mobile app, where I get products via my REST API. My problem: suppose two clients view the same product(and there's only 1 item available from the seller) and they make simultaneous order. How do I resolve such collision? My technology stack: RoR, PostgreSQL, heroku.


title: User input and automated input separation

text: I have a MySQL database and an automation script which modifies the data inside once a day. And these columns may have changed by an user manually. What is the best approach to make the system only update the automated data, not the manually edited ones? I mean yes, flagging the cell which is manually edited is one way to do it, but I want to know if there's another way to accomplish this? Just curiosity. BTW, the question is about cell values, not rows.


title: Continuous integration (with iOS and Android projects)

text: I'm trying to make some positive changes in my company and one of the changes is implementing continuous integration. We do mobile development (iOS/Android) so I need a CI that supports both types of projects. As you can tell I don't know a lot about CI but I've googled a little bit and I think that Jenkins and Hudson are the two most popular. I have a two part questions.   1. Your thought on Jenkins?   2. Is there a way for CI to check if the project is compiling to the   coding standards (like loose coupling and so on)?


title: Why are there multiple Unicode encodings?

text: I thought Unicode was designed to get around the whole issue of having lots of different encoding due to a small address space (8 bits) in most of the prior attempts (ASCII, etc.). Why then are there so many Unicode encodings? Even multiple versions of the (essentially) same one, like UTF-8, UTF-16, etc.


title: Storing T&C acceptance in database - best practice

text: I wondered if anyone could advise on the best way of storing a users acceptance of the Terms and Conditions in the database. I am in the UK if this changes anything. I have had the T&Cs drawn up by a UK Lawyer so don't need any advice on that part! At the moment I am thinking at the time of signup having a checkbox saying "I agree to the [linked] terms and conditions" and making sure this is checked to sign them up. In the database I will have a boolean saying True and also a Timestamp along with the email address they used to signup. Is this enough, if a user ever decided they wanted to challenge their acceptance is this recognised as proof? I have been able to find very little, if no, information about this on the web.


title: What's a good, quick algorithms refresh?

text: I have programming interviews coming up in a couple weeks. I took an algorithms class a while ago but likely forgot some key concepts. I'm looking for something like a very short book ( **< 100 pages**) on algorithms to get back up to speed. Sorting algorithms, data structures, and any other essentials should be included. It doesn't have to be a book...just looking for a great way to get caught up in about a week. What's the best tool for a **quick** algorithms intro or refresher?


title: Questions about TDD and unit testing

text: I am a junior software developer and I have been researching some of the practices in the industry to make myself better. I have been looking at unit testing briefly and I cannot see how the extra time writing a ton of unit tests is going to make my code better. To put things into perspective:   1. The projects I work on are small   2. I am the only developer on the said project (usually)   3. The projects are all bespoke applications The thing I don't get the most is, how can a unit test tell me whether my calculate price function (which can depend on things like the day of the week and bank holidays etc, so assume 20-40 lines for that function) is correct? Would it not be quicker for me to write all the code and the sit through a debugging session to test every eventually of the code? Any examples that are forms-based would be appreciated (examples I have seen from the MSDN videos are all MVC and a waste of time IMHO).


title: Listing technologies on a resume for a software position when your background is game programming?

text: So I'm thinking about applying for a entry level position in the software industry but my limited experience working and all my notable experience in college is with game technologies. Sure, the languages transfer over well but most of the technologies I have experience with are all related to graphics programming, engines of various types, and such, and do not transfer over at all. I feel like it would be inappropriate to just take my game programming resume and basically replace the word game with software for the reasons mentioned but on the other hand if I take them out I will only have languages and some technologies that I have some small passing experience with- which will obviously not reflect well on me. Should I leave them out or put them in, and if so how can I spin them to be appropriate?


title: How Do You Pull Something from a Release?

text: Let's say your team is working on 10 features/fixes for a sprint. At the end of the sprint, there are one or two things that the product owner does not accept. But, they would really like the other 8 or 9 to be released. How do you handle this? Using subversion, what would be the best methodology to manage a sprint with the possibility that this could happen?


title: Reading Java book -- I'm confused on this explanation of the difference between information and data?

text: From "Demystifying Java".. > For many of us, the terms _information_ and _data_ are synonymous. However, > information and data are distinctly different in programming. Data is the > smallest amount of meaningful information. Can someone please give me an example that could help me out, and perhaps relate to a 14 year old? I _sort of_ understand, but when I try to seperate the two in my head, I'm having problems for some reason (probably thinking of them as the same for my whole life is the reason for this).


title: Where should I start reading AngularJS's source code?

text: After reading this article I realized that I really didn't read any "serious" source code during my 3-years as a professional developer. Recently I started a new web-project which makes heavy use of AngularJS, so I decided to start my reading - or, better, _decoding_ [as the blogger wrote] - activity from something that is both challenging and professionally useful. Now I just need to be pointed in the right direction. Should I just start from the start of the source code or is there a better starting point?


title: How to effectively find, hire and work with contractors?

text: I know there are some questions that are sort of similar to this one, but I don't think any of them really ask or answer my set of questions. A bit of background: Approximately 6 mos ago, I went from working for a large, bureaucratic, process-driven software company to a very small start-up. I wanted to work for a smaller, faster team and company -- note: be careful what you wish for! :) Although I have a much fancier title, I am mostly a dev manager (and part-time software architect and technical lead). One of my biggest challenges in my career has always been hiring. On average, I probably get 1 good dev for about every 5 I hire. It's a huge waste of time and money. I find that I still struggle with it, but that now that I work primarily with contractors, the challenges are a bit different (the good news is that contractors are easier to fire than full-time US based employees). First things first... Finding, interviewing and Hiring: What sources do you use? What questions do you ask? Do you ask for references? Do you ask for them to work problems/submit code samples? Note: I never want to risk someone submitting someone else IP, but I have had potential employers in the past ask me to create an app for them to solve a problem, etc. I don't want this to be a cultural thing, but do you ask different questions based on country of origin? Again, I don't want it to turn into don't use contractors from this or that country because they are crap... there are good devs everywhere, but a lot of bad ones, too. Do you find it better to work with individuals or contracting companies? I guess I've spent a lot more time working with larger companies. Once hired, how to effectively work with them? What technologies do you use? For example, I can't imagine trying to do this kind of work without a DVCS. I don't think I'll ever go back to SVN! :) What collaboration tools/websites do you use? Have you had better experiences with fixed priced or hourly contracts? I've managed both and I understand some of the pros and cons of each, but I swear I still haven't figured out which is the better "bet" (and yes, it's pretty much a bet in my opinion). I think for me, I need to start hiring hourly because I don't like the control that I seem to give up over the code when it's fixed priced? Do you demand to have access to the code during development so you can review and see if you feel like you are getting quality work? How do you handle poor code? What SLAs do you demand in the contract? For example, unit-test coverage? etc. Finally, I know that most people could take any one of these things and write a bunch on the topic. Please feel free to answer just one part of the question. Or provide a link to a blog post where you think someone has answered a similar set of questions.


title: Naming interfaces for persistent values

text: I have 2 distinct types of persistent values that I'm having trouble naming well. They're defined with the following Java-esque structure, borrowing Guava's Optional for the example and using generic names to avoid anchoring:               interface Foo<T> {         T get();         void set(T value);     }          interface Bar<T> {         Optional<T> get();         void set(T value);     }        * With `Foo`, if the value hasn't been set explicitly then there's some default value available or pre-set.   * With `Bar`, if the value hasn't been set explicitly then there's a distinct "no value" state. I'm trying to optimize the names for their call sites. For example, someone using `Foo` may not care whether there's a default value involved, only that they're guaranteed to always have a value. How would you go about naming these interfaces?


title: Is this a design pattern?

text: I have following C# code. It helped me to avoid some code repetition in a good way. The `ExecuteQueryGenericApproach<T>` method receives a `Func` generic delegate as argument. The delegated method has a parameter which receives `IDataRecord` as argument. That is, the `ExecuteQueryGenericApproach<T>` method provides the required IDataRecord to the functions passed to it. **QUESTIONS**   1. What is the name of this pattern? (Based on `GoF` design patterns)   2. Is there any other scenario where this pattern is used? **Note** : Knowing the name of this pattern will help me to better research on this and find opportunities to use it. CommonDAL               public class CommonDAL     {         public static IEnumerable<T> ExecuteQueryGenericApproach<T>(string commandText, List<SqlParameter> commandParameters, Func<IDataRecord, T> methodToExecute)         {             string connectionString = @"Server=XXXX;Database=AS400_Source;User Id=dxxx;Password=xxxx5";                  //Action, Func and Predicate are pre-defined Generic delegates.             //So as delegate they can point to functions with specified signature.                  using (SqlConnection connection = new SqlConnection(connectionString))             {                 using (SqlCommand command = new SqlCommand())                 {                     command.Connection = connection;                     command.CommandType = CommandType.Text;                     command.CommandText = commandText;                     command.CommandTimeout = 0;                          if (commandParameters != null)                     {                         command.Parameters.AddRange(commandParameters.ToArray());                     }                          connection.Open();                     using (var rdr = command.ExecuteReader())                     {                         while (rdr.Read())                         {                             yield return methodToExecute(rdr);                         }                         rdr.Close();                     }                 }             }         }     }      EmployeeDAL                public class EmployeeRepositoryDAL         {             public static List<Employee> GetEmployees()             {                 string commandText = @"SELECT E.EmployeeID,E.EmployeeName,R.RoleID,R.RoleName FROM dbo.EmployeeRole ER                                         INNER JOIN dbo.Employee E  ON E.EmployeeID= ER.EmployeeID                                         INNER JOIN dbo.[Role] R ON R.RoleID= Er.RoleID ";                      //IEnumerable<Employee> employees = MyCommonDAL.ExecuteQueryGenericApproach<Employee>(commandText, commandParameters, Employee.EmployeeFactory);                      //Group By is needed for listing all the roles for an employee.                 IEnumerable<Employee> employees = CommonDAL.ExecuteQueryGenericApproach<Employee>(commandText, null, Employee.EmployeeCreator)                                                         .GroupBy(x => new { x.EmployeeID, x.EmployeeName },                                                                 (key, group) =>                                                                                new Employee                                                                                {                                                                                EmployeeID = key.EmployeeID,                                                                                EmployeeName = key.EmployeeName,                                                                                Roles = group.SelectMany(v => v.Roles).ToList()                                                                                }                                                                 ).ToList();                           return employees.ToList();             }                   }      Entity               public class Employee     {         public int EmployeeID { get; set; }         public string EmployeeName { get; set; }         public List<Role> Roles { get; set; }              //IDataRecord Provides access to the column values within each row for a DataReader         //IDataRecord is implemented by .NET Framework data providers that access relational databases.              //Static Method         public static Employee EmployeeCreator(IDataRecord record)         {             var employee = new Employee             {                 EmployeeID = (int)record[0],                 EmployeeName = (string)record[1],                 Roles = new List<Role>()             };                  employee.Roles.Add(new Role { RoleID = (int)record[2], RoleName = (string)record[3] });             return employee;              }     }


title: What concept am I missing with private methods and testing?

text: I've read a lot o blogs arguing about private methods and testing. Some people say you should not test private methods, they say you should make them public or put those methods in a new class. But then, what about encapsulation? let's say:   1. I have this method which is simple enough for not being part of a new class, and    2. It can be useful only for internal stuff, so there's not a good reason to make it public. My general rule about methods being public or private is simple, if it's useful outside it's public, if it's useful just inside then it's private. Am I missing something with this logic?


title: Is it wise to accept for a backend developer to work only on the Front end part of the application only because you even know it well?

text: I am a python developer , i have experience in developing web applications using python. Since i deal with web , i have to know some knowledge about the front end part , hence i even learned HTML, CSS & JS. I have chosen python as my career domain. I recently moved onto a new R & D company , they hired me as a python developer with a huge package and gave me a web application to develop. They doesn't had any designer to work on the front end part , so in my first few weeks i developed its design and i started developing the application by myself doing the front end and the back end. Everyone were very much impressed about the design and the flow of the application on the front end part. In two months i almost finished 30% of the work. So far everything was good. Suddenly they hired a new guy who have experience in Perl for another project and since the manager wanted to finish off my project soon he asked the perl guy to work temporarily on the back end part of my app ( Python ) and asked me to do the only the Front end part. Now i feel like this will degrade my profile. Since i have not given any python work as of now. They hired me as a python developer and since i took initiative and did the front end of app , so that i wanted my product to look good. And now since they all liked the way i did its design they now made me a full time front end developer. **Few Details About Me:** Before getting in this company i had got 5 offers for python job including some of the giant companies but i chose this since this was only the R & D company and even the highest package. And this company had conducted around 4 rounds for python and after selecting me they had said that they were waiting for a guy like me for the past six months. All of the people who interviewed me for python were from other team. Then once i started developing the project i came to know python work is somewhat less compared to the front end js part , since it is a whole SPI application with fully ajax driven. And in my previous company i used to do even the JS and the back end python for my projects. Since i am doing the python part , i felt good working in that way. Then in the new company also am working in the same way , but since now the manager came to know that python has less work , he asked a less experienced guy to take care of it. So that the project will get finished soon. The manager is thinking only about finishing the project , he is not caring about we employees and our main domain. **The Reason to choose python:** I think i can say in confidence that i am already expert in the front end side , but i feel like python is a huge side , and i may require many more years experience to get expert in it. And python is the domain which has given me a rapid boost in my career , when i compare with my friends in other web technologies like php. What my heart says is become expert in python in its every field. Please any one suggest me how will i deal with this? Do i need to inform manager anything of how i feel? Do these product companies work in this way? Should i switch my job?


title: What kind of licensing is required for Visual FoxPro?

text: I am thinking of developing customized software for desktops in Visual FoxPro 9 and want to know what type of licensing is required. As a developer, would I need to have a Visual FoxPro 9 license and would my users need to have the End User License? What type of licenses would be needed for commercial release? How would the licensing change if I released this as freeware?


title: Is CSV a good alternative to XML and JSON?

text: Is CSV considered a good option against XML and JSON for programming languages? I generally use XML and JSON (or sometimes a plain text file) as flat file storage. However, recently I came across an CSV implementation in PHP. I generally have seen CSV used for inputs in Excel files though, but I have never used it with programming. Would it be better than XML or JSON in any way?


title: Why GWT .. what are the advantages?

text: > **Possible Duplicate:**   >  What are proven advantages of tools like GWT over pure JavaScript > frameworks? When should we decide to use GWT, what are it's advantages over normal web app design with html/jsp, css, js etc. Still we need to design our pages, css/styles but cant debug with tools like Firebug ... Seems to be complex Java coding to design web pages - which is ultimately html having never understandable complex javascript. Can we do complex web page design easily with GWT?


title: Is it considered best practice to dynamically bind return types from the Entity context?

text: MyDbEntities context = new MyDbEntities();     var result = context.StoredProcedureName(userId);      In the situation above, is it considered best practice to use `var` or `ObjectResult<ComplexType>`?


title: Optimistic work sharing on sparsely distributed systems

text: What would a system like BOINC look like if it were written today? At the time BOINC was written, databases were the primary choice for maintaining a shared state and concurrency among nodes. Since then, many approaches have been developed for tasking with optimistic concurrency (OT, synchronization primitives like vector clocks, virtual synchrony, shared iterators etc.) Is there a paradigm for optimistically distributing units of work on sparsely distributing systems which communicate through message passing? Sorry if this is a bit vague. P.S. The concept of Tuple-spaces is great, but locking is inherent to its definition. **Edit2** : The entire system is sparsely distributed - they can communicate only through WAN. And communication _can_ be slow and faulty. The question is about how to best distribute units of work among them without a central co-ordinator and with as little consensus as possible (because consensus is expensive). The answers here seem to be talking about databases - data isn't the problem. The problem is in distributing work. **Edit** : I already have a federation system which works well. I'm looking to extend it to get clients to do units of work.


title: Should I focus on being deep or broad

text: I have been a professional developer for just over half a year and have been amazed at how big the world really is out of college. I have continued to learn in my free time but I am wondering where should I focus? FOCUS 1) The development stack used by my company. Quickest payoff in my day to day development. #Deepest FOCUS 2) A different language with the same paradigm. See if I can generalize my knowledge and way of thinking. FOCUS 3) Different language, different paradigm. Expand my borders and learn new ways to do things. #Broadest If anyone has a different focus feel free to put that out there.


title: Coding in known language or learning a new one in free time?

text: > **Possible Duplicate:**   >  Should I focus on being deep or broad Doing which of {coding,learning} will you recommend for a programmer in his/her free time? Of course,this question is valid in case of coders who are able to do reasonable things in at least one mainstream language.The reasons why I'm asking this question are,   * Coding will improve skills on the language already learned, but there will be situations in which we have to use other languages.   * If one learns a new language,instead of using what he/she learned, it will cause losing at least some knowledge on the language already learned.   * No doubt,no one can completely learn a language,so moving to a new language may make him/her nothing


title: is it better to spend my free time mastering a language I work with or learning a new one?

text: > **Possible Duplicate:**   >  Should I focus on being deep or broad I work full time on an android project and am very comfortable with both java and the android framework. On a good day, I would rate my abilities at an 8, and maybe a 7 on a bad day. I've recently found myself with more free time then I'm used too, so I have been working on a lot of personal projects. I am beginning to wonder what others think about this; is it worth my time to continue experimenting and pushing Android, or would I be better off learning another language? What do you all think about this? What would you do with more free time and energy than you know what to do with?


title: Why doesn't "object reference not set to an instance of an object" tell us which object?

text: We're launching a system, and we sometimes get the famous exception `NullReferenceException` with the message `Object reference not set to an instance of an object`. However, in a method where we have almost 20 objects, having a log which says an object is null, is really of no use at all. It's like telling you, when you are the security agent of a seminar, that a man among 100 attendees is a terrorist. That's really of no use to you at all. You should get more information, if you want to detect which man is the threatening man. Likewise, if we want to remove the bug, we do need to know which object is null. Now, something has obsessed my mind for several months, and that is: **Why doesn't .NET give us the name, or at least the type of the object reference, which is null?**. Can't it understand the type from reflection or any other source? Also, what are the best practices to understand which object is null? Should we always test nullability of objects in these contexts manually and log the result? Is there a better way? **Update:** The exception `The system cannot find the file specified` has the same nature. You can't find which file, until you attach to the process and debug. I guess these types of exceptions can become more intelligent. Wouldn't it be better if .NET could tell us `c:\temp.txt doesn't exist.` instead of that general message? As a developer, I vote yes.


title: Type systems: nominal vs. structural, explicit vs. implicit

text: I'm a bit confused about the difference between nominal and structural type systems. Can someone please explain how they differ? From what I understand:   * Nominal: Type compatibility is based on type name.   * Structural: Type compatibility is based on the type structure, e.g. in C if 2 variables are struct types with different names but the same structure, then their types are compatible. Now about explicit and implicit: why is it different from static and dynamic typing? In static typing, types will be explicit while in dynamic typing, types are implicit. Am I right?


title: How to program thread allocation on multicore processors?

text: I would like to experiment with threads on a multi-core processor, e.g. to create a program that uses two different threads that are executed by two different processor cores. However, it is not clear to me at which level the threads get allocated to the different cores. I can imagine the following scenarios (depending on operating system and programming language implementation):   1. Thread allocation is managed by the operating system. Threads are created using OS system calls and, if the process happens to run on a multi-core processor, the OS automatically tries to allocate / schedule different threads on different cores.   2. Thread allocation is managed by the programming language implementation. Allocating threads to different core requires special system calls, but the programming language standard thread libraries automatically handle this when I use the standard thread implementation for that language.   3. Thread allocation must be programmed explicitly. In my program I have to write explicit code to detect how many cores are available and to allocate different threads to different core using, e.g., library functions. To make the question more specific, imagine I have written my multi-threaded application in Java or C++ on Windows or Linux. Will my application magically see and use multiple cores when run on a multi-core processor (because everything is managed either by the operating system or by the standard thread library), or do I have to modify my code to be aware of the multiple cores?


title: Difference between language virtual machine and emulating vm?

text: I'm having a hard time understanding the difference between an emulation virtual machine and a language vm. I started with the research and implementation of an emulation virtual machine. Primarily emulating quite old 16-bit architectures. I want to get the basics down for a language virtual machine. Are both systems similar? Do they both use register-based architectures and stack-based? I'm under the impression a language VM is basically a run time environment. Depending on the complexity of the VM, it may have a garbage collector, JIT compiler, etc... Would that assumption be correct? EDIT: I'm also talking about bytecode VMs, but native machine code works too.


title: Books that every software system architect/data modeller must read

text: I hope I'm not confusing the term system architecture with the data model/database. Is there a book out there that's the standard for describing best practices, design methodologies, and other helpful information on designing the architecture and the data model for a web-based application? What about that book makes it special?


title: Cost Benefit Analysis of choice of javascript framework for excel-like web app

text: I am engaged by a telco company sales team to develop a web application to replace their current workflow. Their current workflow consists of many spreadsheets containing product, pricing, and sales data. I have successfully done this, but they continuously want me to allow them to download certain data into excel files for them to view. I appreciate why they want this because a) sometimes they want a lot of data and pagination on the web app just does not work for them. b) they have been so used to Excel and its functions that it is hard to wean them off it completely. As a vendor, I want to marry the convenience of both Excel and a web application, that I ended up surfing for javascript frameworks that allow me to simulate an Excel software on the web app. My web application is developed in CakePHP 2.4.2 using MySQL as the database. I have narrowed down to 2 choices: dhtmlx and wijmo. This web application is hosted within the company's intranet system. The top Excel features I noticed the sales team is using:   1. They want tabs   2. They want to be able to see the formula bar so that they know why a figure is 1,789.45 for e.g.   3. They want to be able to select a bunch of cells and then find out either the sum of the figures in the cells or the count.   4. They want to be able to do sorting and filtering the way it is done in Excel with checkboxes. See the attached screenshot. ![enter image description here](http://i.stack.imgur.com/RlkPm.png) Although I have narrowed my choice to these 2 javascript libraries, I am open to other choices. Another important thing is that the library must be as simple for a beginner me to write the application as possible.


title: Is it legal or good idea to have a backup of all client sites on my own server

text: I have seen many times that if we build a website for a client then there is a possibility that this site gets changed over a period of time. I was thinking that from now onwards whichever site I make I will host a copy of the site on a personal server. Like `client1.myserver.com` so that even if they change it I have the copy of it. So that if I need to show someone or I need to refer myself few things I have the proof there. I will not make them public but will password protect it. I want to know whether this is legal and a good idea or not.


title: Strictly from an employability perspective, what is the best web development framework to learn right now?

text: Even though Ruby on Rails seems to be the most popular with the most job openings, is there a compelling employability reason to learn django for example? Maybe because everybody's learning RoR and there's a shortage of django developers in relation to the demand? Or is php along with a popular php framework the way to go simply because of the sheer volume of php related jobs out there?


title: Evidence of Bad Design: Updating feature A breaks/interferes with existing feature B

text: I am working on a Javascript Web App & I am finding as I expand the program & add new features(new animations) it causes existing features to break or work differently than prior to adding that new feature. So as I continue to finish the app, it keeps breaking old features & I have to go back & redo/update those features. So it seems I never complete a feature because I am always coming back to it so I can get it to work nicely with other features. Is this indicative of bad application design? Or is this a normal feature of computer programming, ie just like how in any program you will spend 20% of time developing the program & 80% of the time fixing bugs(or is it maintaining the program?)? **Are there design &/or any other techniques I can employ to avoid having this problem occur?** The application is a renderer (which takes an XML file which contains information about objects that perform animations - move around, fade etc.) that creates HTML elements & animates them. The design is OOP, with as close as you can get to classes in Javascript by using prototype. It employs ALOT of multiple inheritence. It also makes use of the anonymous functions where possible so I think it would be very much like a Java project because they both have OOP, anon functions & inheritence. There is a class purely dedicated towards animation called AnimatedObject & many objects inherit from this class. You just perform an animation by simply calling a function from that class such as myAnimObj.performFade() or myAnimObj.performRotate().


title: Clang warning flags for Objective-C development

text: As a C & Objective-C programmer, I'm a bit paranoid with the compiler warning flags.   I usually try to find a complete list of warning flags for the compiler I use, and turn most of them on, unless I have a really good reason not to turn it on. I personally think this may actually improve coding skills, as well as potential code portability, prevent some issues, as it forces you to be aware of every little detail, potential implementation and architecture issues, and so on... It's also in my opinion a good every day learning tool, even if you're an experienced programmer. For the subjective part of this question, I'm interested in hearing other developers (mainly C, Objective-C and C++) about this topic.   Do you actually care about stuff like pedantic warnings, etc? And if yes or no, why? Now about Objective-C, I recently completely switched to the LLVM toolchain (with Clang), instead of GCC. On my production code, I usually set this warning flags (explicitly, even if some of them may be covered by -Wall):   * -Wall   * -Wbad-function-cast   * -Wcast-align   * -Wconversion   * -Wdeclaration-after-statement   * -Wdeprecated-implementations   * -Wextra   * -Wfloat-equal   * -Wformat=2   * -Wformat-nonliteral   * -Wfour-char-constants   * -Wimplicit-atomic-properties   * -Wmissing-braces   * -Wmissing-declarations   * -Wmissing-field-initializers   * -Wmissing-format-attribute   * -Wmissing-noreturn   * -Wmissing-prototypes   * -Wnested-externs   * -Wnewline-eof   * -Wold-style-definition   * -Woverlength-strings   * -Wparentheses   * -Wpointer-arith   * -Wredundant-decls   * -Wreturn-type   * -Wsequence-point   * -Wshadow   * -Wshorten-64-to-32   * -Wsign-compare   * -Wsign-conversion   * -Wstrict-prototypes   * -Wstrict-selector-match   * -Wswitch   * -Wswitch-default   * -Wswitch-enum   * -Wundeclared-selector   * -Wuninitialized   * -Wunknown-pragmas   * -Wunreachable-code   * -Wunused-function   * -Wunused-label   * -Wunused-parameter   * -Wunused-value   * -Wunused-variable   * -Wwrite-strings I'm interested in hearing what other developers have to say about this. For instance, do you think I missed a particular flag for Clang (Objective-C), and why?   Or do you think a particular flag is not useful (or not wanted at all), and why? **EDIT** To clarify the question, note that `-Wall` only provides a few basic warnings.   They are actually a lot more warning flags, not covered by `-Wall`, hence the question, and the list I provide.


title: How does one pronounce "cron" as in "cron job"?

text: Before someone ban-hammers this question as they do with all other pronunciation questions, let me explain its relevance. Verbal communication among co-workers and partners is important; today I was on a conference call with people discussing what I thought was something to do with "Chrome", as in Google Chrome. I pronounce the "cron" in "cron job" with a short O, much like "tron", "gone," or "pawn", but this individual pronouced it with a long O, as in "hone", "bone", or "stone" (notice the e at the end of all those!). Is there a _standard_ pronunciation? Or is this a matter of opinion. For example, there's nothing ambiguous about the pronunciation of "Firefox", but debate is raging over "potato" and "tomato".


title: Dynamic query in Mysql

text: I'm doing a J2EE web application with Struts2, Mybatis and a MySQL database, so what I want to allow to the user is to be free to choose different parameters to perform a select to a table in the database. For example, I have a Table called SALES, so I want to that the user select different parameters according to what he needs. Maybe, he wants to filter by dates and the employee name, and then he want to filter just by customer and so on. Should I show all the necessary data to filter on the client side with js, or can I do a query to several tables after the user choose the parameters? if that is possible, how should I write the query with parameters that could be present or not?


title: peer to peer inside a web browser

text: I've built peer to peer app a while ago in QT and C, but I had to build the whole thing with a friend of mine. I'm wondering if it possible to build such an application in web browser. Is there an opensource lib, API or anything that could help me achieve that on a browser?


The Actor Model which is used by Erlang seems to be a very different way to do concurrent programming. What are your thoughts about the Actor Model? Will it be a popular solution for concurrency?


title: Can PHP be used for desktop application development?

text: I want to know whether it is possible to develop desktop applications using the PHP language. In my case, I have never developed one with it. If it possible, please give me referral link or detailed understanding of where i can improve my skills.


title: Introducing a new JVM programming language into an established enterprise environment

text: Imagine that your current workplace is a Java shop. There is a lot of built-up knowledge about the Java language and there is a comprehensive build and deployment process in place to handle everything in a smooth and Agile manner. One day, a project comes along that just screams out to be written in, say, Ruby. Only the senior developers have any clue about Ruby but there's a general notion that since JRuby exists for the JVM then existing infrastructure could continue to be used and supported. Also, JRuby could show the way to a better way of implementing the current applications with less code so this could represent an ongoing migration. Remember that JRuby is just an example, it could equally be Clojure or Groovy or whatever else runs on the JVM. The question is how would you go about introducing this kind of change - if at all?


title: Well documented open source projects to study for a beginner?

text: I've been reading up on/learning C for a week or two and was wondering if anybody could recommend some extremely well documented open-source projects I could study? Things like sourceforge are great and so on, but there's a great deal of things I don't understand about most of the projects on there and could do with a bit more hand-holding to begin with. Suggestions?


title: Why should you get MCTS certified?

text: I just found out about MCTS (Microsoft Certified Technical Specialist). But why should you become certified? Why not just study the stuff, and don't take the exam. It saves you a few bucks and you know just as much.


title: Is it possible to use GNU GPL for application that has no source?

text: I mean, it is possible to create application without source code - for example using HEX editor or some debugger that can assembly instructions (actually every decent debugger can). Creating programs this way is of course hard, but possible for small applications. I even can imagine cases, where it is the only possible way - for example, on some very old hardware where you simply does not have any development tools. For another example - read the article "Programming in extreme conditions", published in Assembly programming journal, issue 9 So, what if the author of such application wants to distribute it under GNU GPL?


title: Where did the notion of "one return only" come from?

text: I often talk to Java programmers who say "Don't put multiple return statements in the same method." When I ask them to tell me the reasons why, all I get is "The coding standard says so." or "It's confusing." When they show me solutions with a single return statement, the code looks uglier to me. For example:               if (blablabla)        return 42;     else        return 97;      "This is ugly, you have to use a local variable!"               int result;     if (blablabla)        result = 42;     else        result = 97;     return result;      How does this 50% code bloat make the program any easier to understand? Personally, I find it harder, because the state space has just increased by another variable that could easily have been prevented. Of course, normally I would just write:               return (blablabla) ? 42 : 97;      But the conditional operator gets even less love among Java programmers. "It's incomprehensible!" Where did this notion of "one return only" come from, and why do people adhere to it rigidly?


title: Best practices concerning exit in Delphi

text: A co-worker and myself are having a debate on whats best. Both concepts work and work well but is there a general consensus on not making a call to exit? Whats better? To call exit within a procedure to avoid doing the rest of the code as in ...               if Staging.Current = nil then exit            DoSomethingA(FileNameA);       DoSomethingB(FileNameB);       Staging.DeleteCurrent;      or to not call exit and instead wrap it in a begin and end               if Staging.Current <> nil then       begin          DoSomethingA(FileNameA);         DoSomethingB(FileNameB);         Staging.DeleteCurrent;        end;      Both work. I prefer to use the exit statement since it results in fewer lines of code and looks cleaner to me, but is there any reason or any consensus among programmers to avoid using exit to leave a procedure?


title: Python - only one return per method?

text: I'm trying to sort out whether this is just a personal preference thing or whether it's actually bad practice to do this one way or another. I did try to reference PEP8 first, and I did not see an answer. What I'm talking about here is the use of more than one `return` statement. In these examples, it's not _such_ a big deal, as they are very short and easily read.               def foo(obj):         if obj.condition:             return True         return False          def bar(obj):         answer = False         if obj.condition:             answer = True         return answer      It bugs me to assign a variable every time `bar()` is called, instead of just determining the answer and returning it. But in a longer function a second `return` might be hidden and so someone reading the code may have not realized that the function might return a value before hitting the end of the line:               def spam(obj):         blurb = "Francis"         if obj.condition:             blurb = map(gormf, [z for z in porp(obj)])             return blurb[2]         elif not obj.condition and dreg(obj.jek):             blurb = obj.hats * 17             if blurb % 13: return blurb         else:             blurb = obj.name         return "Whales and %s" blurb      That's a terrible function, but I think you see what I'm poking at. So is it preferable to create a function to have a _single, clear exit_ \- even if it's a few more operations than you actually need? Or should one try to root this out whenever possible in favor of shorter code?


title: Should I return from a function early or use an if statement?

text: > **Possible Duplicate:**   >  Where did the notion of "one return only" come from? I've often written this sort of function in both formats, and I was wondering if one format is preferred over another, and why.               public void SomeFunction(bool someCondition)     {         if (someCondition)         {             // Do Something         }     }      or               public void SomeFunction(bool someCondition)     {         if (!someCondition)             return;              // Do Something     }      I usually code with the first one since that is the way my brain works while coding, although I think I prefer the 2nd one since it takes care of any error handling right away and I find it easier to read


title: What are the pros and cons of temporary variables vs multiple returns

text: Take the following examples:               public static String returnOnce() {         String resultString = null;         if (someCondition) {             resultString = "condition is true";         } else {             resultString = "condition is false";         }         return resultString;     }          public static String returnMulti() {         if (someCondition) {             return "condition is true";         }          return "condition is false";     }      Is one approach objectively better than the other, or is it just a matter of preference? The first requires a temporary variable, but has just a single place where the method returns. Does the decision change if the method is more complex with multiple factors that could change the result?


title: "Proceed if true" vs "stop if false" in if statements

text: While I was writing a private helper method in Java, I needed to add a check for a precondition that would cause the method to do nothing if not met. The last few lines of the method were just off the bottom of the editing area in the IDE, so in an epic display of laziness, I wrote the check like this:               function(){         if (precondition == false){             return;         }         //Do stuff     }      as to opposed finding the end of the block to write a more "traditional" statement like this:               function(){         if (precondition == true){             //Do stuff         }     }      This made me wonder: is there a reason to avoid my version in favor of the other, or is it just a stylistic difference? (Assuming they are used in such a way that they are _meant_ to be functionally equivalent)


title: Should a function use premature returns or wrap everything in if clauses?

text: > **Possible Duplicate:**   >  Where did the notion of "one return only" come from? Which is better? I see pros and cons for both, so I can't really decide on which one to stick to. ## Wrap in if clause               function doIt() {        if (successfulCondition) {           whenEverythingGoesWell();        }     }        * **Pro** : Shows programmer's intention through indentation.   * **Con** : Indentation can get really deep if you need to short circuit many times. For example, `doThirdThing()` requires the success of `doSecondThing()`, which in turn requires the success of `doFirstThing()`. This happens a lot in web development where many web services are not reliable.  ## Premature return               function doIt() {        if (!successfulCondition) {           return;        }        whenEverythingGoesWell();     }        * **Pro** : Subversion checkins would be succinct. Sometimes, I see co-workers wrap super long functions in an if clause. The whole shebang gets checked in and makes reading Subversion diffs difficult.   * **Con** : Requires you to read the whole function to figure out the various run paths.


title: function exit condition on parameter consistency check

text: When checking for parameter consistency a the top of a function body, what is the best strategy? This one:               protected void function(Object parameter)         if (parameter == null)              return;              //... do things     }      ...or this one:               protected void function(Object parameter)         if (parameter != null) {                 //... do things         }     }


title: What advantage is there in pairing when programming that there isn't when pairing in other jobs?

text: Surely two people sitting together doing countless other jobs you would see the same benefits. Why has programming been singled out for this practice?


title: kindle paperwhite

text: How good is the kindle paperwhite to read programming e-books?, I was looking info but anyone gives any answer from the own experience, and the current answers are outdated (> 2 years) It is a kindle paperwhite recommended as reading tool for developers? I would like to hear people's actual experiences.


title: Which is architecturally correct for Data Access Layer method names - Fetch or Select?

text: I have seen the words Fetch and Select used seemingly interchangeably when naming data access layer methods (ex. Person.Select or Person.Fetch). Which one is correct? My instinct is that the point of the data access layer is to abstract data access and thus the term Fetch would be more of an abstraction perhaps than Select would be. But if one can imagine for a moment that SQL was not an existing technology, the term Select on its own might be appropriate.


I was doing a small list of PHP MVC framework (like Zend, CakePHP, Yii etc...) and I noticed that all of them are open source. Then I tried to find some proprietary framework, but my research was unsuccessful. **Is there any proprietary PHP MVC framework? Why they are so few(if there is any)?**


title: Is specializing beneficial in IT industry?

text: For the past few years I started wondering if it makes sense to learn advanced techniques in some fields of IT, or is it better to be just good at everything, and use the simplest code possible everywhere. I will use C++ as a language for comparisons, since I'm a C++ developer. As a C++ developer you can write truly interesting code, ranging from code that looks like C with simple functions all around, to template meta- programming stuff, sometimes intermixed with pure abstract classes. I've started noticing that I'm leaning towards the later lately. The problem is, that with larger solutions programmers are rarely working alone, and most likely skills don't overlap that much either. So some parts of code I write might be confusing to other team members, and the other way around. I might like STL and templates, while other people might prefer pure abstract classes everywhere, others will rely on dynamic_casting, or code generated by VC wizards. While some just enjoy everything written in a very simple, C like manner. This also backfires with the fact that people who haven't worked with, say, with virtual classes, might not even know why the new class they've derived is broken because of simple missing virtual destructor. So the code you write paves a way toward memory leak if some other people decide to reuse your code later on. Do you have experience working in environments with multiple developers with different skill-sets? Do you try to find a common dominator in your environments? Does using the skill-sets of every person even works in larger projects?


title: If the spec is flawed, should it still be followed?

text: I have been assigned to develop an integration to one of my employer's applications to an external system developed by our client. Our client's specification for the integration that has some blatant flaws related to security. The flaws would allow an unauthorized user access to the system to view restricted data. I have pointed out the flaws and their potential security risks if they are implemented as designed, and provided an alternative without the flaw, but (in short) have been told "do it the way we specified" by the client. Does a programmer have an ethical responsibility NOT to implement code with known security risks? At what point do a client's requirements outweigh the ethical responsibility we have as software developers to create secure applications?


title: How my website should use its own API?

text: Im building small web-service which will provide my users with data through API. Also, some data will be available right on my website. The question is about how to use my own API? Should my website make a query to, for example, `http://website.com/api/users/?format=json` and then render data? Because I can use standard Django ORM features, but this is not corresponding with using of own API. For more explanation please look this gist: https://gist.github.com/xelblch/bde4c8f107f1ed398a7e update: Imagine that I have a database full of games with release date, game name, game platform etc. And on my own website I will show this games as a list or a grid. Also, this data can be reached through API in JSON format, this data can be updated through API and even deleted. And on my own website I have html forms that allow me to do this actions in a user-friendly way. So how should I access my own API? Via POST request to my API or via django ORM directly to database?


title: people fork my project but don't fetch from upstream - what can I do?

text: Several people have forked my github repo but they have not fetched-merged from upstream. So my original repo has evolved significantly since the fork took place, and meanwhile these people are showing an old outdated version of my work, which kind of makes me look bad (e.g. what they're displaying is incomplete, contains bugs that I've fixed since then, etc.). These people apparently don't understand what a fork is for; they just push the fork button (perhaps as a way of saying "this is cool") and then walk away. Ideally what I'd like is for them either to keep their fork updated from upstream or make a significant contribution or delete the fork. Is there anything I can do about this? (There isn't, is there? This is just the price of being open source, isn't it?)


title: How would you get all your expectations done within a user story?

text: I'm setting up some requirements for a software extension and try to use user stories to describe what I want to achieve. > As a creator I want to add a new entry, to let users access it through the > main page. I have the idea of adding an entry via Drag&Drop. My company has some guidelines, to have every command always available via context menu and ribbon. Should I split up my origin story into separate actions?   * As a creator I want to drag a new entry onto the main page, to let users access it.   * As a creator I want to create a new entry on the main page via ribbon, to let users access it.   * As a creator I want to create a new entry on the main page via context menu, to let users access it. That approach would result in at least three user stories per feature what won't feel comfortable to me. I could add these expectations during the discussion, but then it seems like giving a "way-to-follow" for developers. So how would I ensure that the required quality/user experience is achieved?


title: Average video frame size for video codec

text: In simple words, is it true that an average size of an encoded video frame would be `FrameSize = BitRate/FrameRate`? Because `BitRate` shows how much data we are transferring per time unit, and `FrameRate` shows how many frames does this time unit contain.


title: Can compilers and interpreters have bugs, and what can we (as users) do to deal with them?

text: If a compiler's work is essentially translating source code into machine level code, can there be any glitch in a compiler, i.e. a faulty "translation?" The same goes for an interpreter: can it fail to output the required content sometimes? I have not heard of any bugs in compilers/interpreters, but do they exist?


title: How can I get the business analysts more involved in BDD?

text: I am a proponent of Behavior Driven Development, mainly with Cucumber and RSpec, and at my current gig (a Microsoft shop) I am introducing SpecFlow as a tool to help with testing. I'd like to get the business analysts on my team involved in writing the features and scenarios, but they are put off by the "technical" aspect of it, meaning creating the files in Visual Studio (or even having Visual Studio on their machines). They want to know if we can put all the scenarios for a feature in Jira. What I'm looking for is suggestions for a workflow that will work well with BA types that are accustomed to project management/work tracking tools like Jira (we also use Greenhopper).


title: Is there a secure way to add a database troubleshooting page to an application?

text: My team makes a product (business management software) that our customers install on their own servers. The product uses a SQL database for data storage and app configuration. There have been quite a few cases where something strange happened in the customer's database (caused by bugs in our app and also sometimes admins who mess with the database). To figure out what is wrong with the data, we have to send SQL scripts to the customer and tell them how to run them on the database server. Then, once we know how to fix it, we have to send another script to repair the data. Is there a secure way to add a page in our application that allows an application admin to enter SQL scripts that read and write directly to the database? Our support team could use that to help customers run these scripts, without needing direct access to the SQL server. My big concerns are that someone might abuse this power to get data they shouldn't have and maybe to erase or modify data that they shouldn't be able to modify. I'm not worried about system admins, because they could find another way to do the same thing. But what if someone else got access to the form? Is there any way to do this kind of thing securely?


title: what does "domain" mean when referring to DDD

text: What does the word domain mean regarding driven design/development? Not in terms of semantics or a scholarly definition but in terms of how it modifies processes or philosophies? I was reading a post: Your software-problem-solution approach I came across this buzzword, DDD, and didn't really know what that meant.


title: Is there still any value in learning assembly languages today?

text: Specifically for a game programmer. If you really needed some assembly routines you could look for help, whereas back in the 80s/90s it was one of the mainstream languages. I read that compilers can generally equal (or beat) most hand written assembly code, so unless you are an embedded programmer who can only program some device in assembly, for example, is there any real point in learning it nowadays?


title: OpenCart (GPLv3)

text: I'm planning to use OpenCart to build a web site. According to the licence (GPLv3) it's necessary to provide the source code of any modifications made. Is it acceptable to provide this on request or should it be linked to from every page on the shop?


title: LINQ TO SQL or ADO.NET?

text: What is the best choice LINQ TO SQL (.DBML) or using ADO.NET with procedures for a database with 29 tables and about 30 concurrent users that will run the system that I am going to build? I know that ADO.NET is faster than LINQ TO SQL but it is so much simpler to work with LINQ TO SQL. Will LINQ TO SQL handle all the concurrency? Or will there be problems in performance? The system I am going to build will be a WCF service using multiple layers:   * Service layer   * Business    * Repositories   * Data Access Layer


title: Should a standard include header be specified in each file or as a compiler parameter?

text: I've got a file such as this:               #ifndef STDINCLUDE     #define STDINCLUDE          #include <memory>     #include <stdexcept>          #endif      I want this file to be included in every header file, because I use stuff from those headers so much. Is it preferable to include this via compiler options (`-I stdinclude.hpp`), or should I physically include them in each header? (`#include <stdinclude>`). Note that I am attempting to be cross-platform- minded. I use cmake to serve atleast Unix and Windows.


title: Why not expose a primary key

text: In my education I have been told that it is a flawed idea to expose actual primary keys (not only DB keys, but all primary accessors) to the user. I always thought it to be a security problem (because an attacker could attempt to read stuff not their own). Now I have to check if the user is allowed to access anyway, so is there a different reason behind it? Also, as my users have to access the data anyway I will need to have a public key for the outside world somewhere in between. Now that public key has the same problems as the primary key, doesn't it? * * * There has been the request of an example on why do that anyway, so here is one. Keep in mind that the question is meant to be about the principle itself not only if it applies in this example. Answers addressing other situations are explicitly welcome. Application (Web, Mobile) that handles activity, has multiple UIs and at least one automated API for intersystem communication (e.G. the accounting department wants to know how much to charge the customer based on what has been done). The Application has multiple customers so separation of their data (logically, the data is stored in the same DB) is a must have of the system. Each request will be checked for validity no matter what. Activity is very fine granular so it is together in some container object, lets call it "Task". Three usecases:   1. User A wants to send User B to some Task so he sends him a link (HTTP) to get some Activity done there.   2. User B has to go outside the building so he opens the Task on his mobile device.   3. Accounting wants to charge the customer for the Task, but uses a third party accounting system that automatically loads the Task / Activity by some code that refers to the REST - API of the Application Each of the usecases requires (or gets easier if) the agent to have some addressable identifier for the Task and the Activity.


title: WCF or ASMX WebService

text: I have been asked to create a web service that communicates with Auth.NET CIM and Shipsurance API. My web service will be used by multiple applications (one a desktop and another a web application). I am confused whether I should build a WCF or an asmx web service. Auth.NET CIM and Shipsurance API have asmx web services which I would be calling in my newly created web service. So is WCF the right approach or can I stay with asmx?


title: How to change the state of a singleton in runtime

text: Consider I am going to write a simple file based logger `AppLogger` to be used in my apps, ideally it should be a singleton so I can call it via               public class AppLogger {         public static String file = "..";              public void logToFile() {             // Write to file         }              public static log(String s) {             AppLogger.getInstance().logToFile(s);         }     }      And to use it               AppLogger::log("This is a log statement");      The problem is, what is the best time I should provide the value of file since it is a just a singleton? Or how to refactor the above code (or skip using singleton) so I can customize the log file path? (Assume I don't need to write to multiple at the same time) p.s. I know I can use library e.g. log4j, but consider it is just a design question, how to refactor the code above?


title: Interview approaches and questions for a software developer intern

text: What are some good ideas, common approaches and appropriate questions that you would bring when interviewing a software development intern to join your team? I really don't have expectations of any kind for this person, I understand that as an intern with no prior work experience that he won't have much to bring to the table. I am more or less looking for a good attitude and somebody willing to learn. What would be appropriate if you intend to put this intern 70/30 (QA Testing/Coding)? Would that be a good internship experience in your opinion?


title: Placeholders in strings

text: I find that I sometimes use placeholders in strings, like this:               $ cat example-apache     <VirtualHost *:80>         ServerName ##DOMAIN_NAME##         ServerAlias www.##DOMAIN_NAME##         DocumentRoot /var/www/##DOMAIN_NAME##/public_html     </VirtualHost>      Now I am sure that it is a minor issue if the placeholder is `##DOMAIN_NAME##`, `!!DOMAIN_NAME!!`, `{{DOMAIN_NAME}}`, or some other variant. However, I now need to standardize with other developers on a project, and we all have a vested interest in having our own placeholder format made standard in the organization. Are there any good reasons for choosing any of these, or others? I am trying to quantify these considerations:   1. **Aesthetics and usability**. For example, `__dict__` may be hard to read as we don't know how many underscores are in there.   2. **Compatibility**. Will some language try to do something funny with `{}` syntax in a string (such as PHP does with `"Welcome to {$siteName} today!"`)? Actually, I know that PHP and Python won't, but others? Will a C++ preprocessor choke on `##` format? If I need to store the value in some SQL engine, will it not consider something a comment? Any other pitfalls to be wary of?   3. **Maintainability**. Will the new guy mistake `##SOME_PLACEHOLDER##` as a language construct?   4. **The unknown**. Surely the wise folk here will think of other aspects of this decision that I have not thought of. I might be bikeshedding this, but if there are real issues that might be lurking then I would certainly like to know about them before mandating that our developers adhere to a potentially-problematic convention.


title: How does one think about object oriented design and Aspect oriented Design  for  solution

text: I have worked on few projects in which both AOP and Object oriented paradigm were used. But, AOP usage was limited to logging only. I think AOP is a much more powerful technique. My question, to those who have worked with both AOP and OOP paradigm in projects, is, how do they come up with a solution, combining these powerful paradigms. Do they think AOPwise first and then design objects or vice versa. My general question to those who have used AOP extensively is, whether they find it a powerful modularizing technique. If yes, please quote examples.


title: Are the technologies used in an application part of the architecture, or do they represent implementation/detailed design details?

text: When designing and writing documentation for a project an architecture needs to be clearly defined: what are the high-level modules of the system, what are their responsibilities, how do they communicate with each other, what protocols are used etc. But in this list, should the concrete technologies be specified or this is actually an implementation detail and need to be specified at a lower level? For example, consider a distributed application that has two modules which communicate asynchronously via AMQP protocol, mediated by a message broker. The fact that these modules use the Spring AMQP library for sending and receiving messages is a fact that needs to be specified in the architecture or is a lower-level detailed design/implementation detail?


title: How to familiarize myself with Python

text: I'm a Python beginner. I started programming with Python 1.5 months back. I downloaded the Python docs and read some parts of the tutorial. I have been programming on codechef.com and solving problems of projecteuler. I am thinking of reading Introduction to algorithms and following this course on MIT opencourse ware as I haven't improved much in programming and I am wasting a lot of time thinking just what should I do when faced with any programming problem. But I think that I still don't know the correct way to learn the language itself. Should I start with the library reference or continue with the Python tutorial? Is learning algorithms useful for languages such as C and not so much for Python as it has "batteries included"? Are there some other resources for familiarization with the language and in general for learning to solve programming problems? Or do I need to just devote some more time?


title: Is objected oriented programming paradigm outdated since it is anti-modular and anti-parallel?

text: I have read the controversial article Teaching FP to freshmen posted by Robert Harper who is a professor in CMU. He claimed that CMU would no longer teach object oriented programming in the introductory course sine it is “unsuitable for a modern CS curriculum.” And he claimed that: > Object-oriented programming is eliminated entirely from the introductory > curriculum, because it is both anti-modular and anti-parallel by its very > nature. Why consider OOP as anti-modular and anti-parallel?