title: I cannot understand the application of oops How can I develop the understanding of application of oops?

text: I am struggling hard to learn the application of Object Oriented Programming since last 2 years. I am a developer in PHP technology, I am aware of almost all the basics of OOPS, but still cannot find out the way to apply those concepts over a procedural programming. I do it in very orthodox way, but I don't know why I am coding it in that way. I never have reasoning to justify my oops applications, which has inferred me that I am worst in OOPS, Please help me guys to learn to think over the application of OOPS.


title: ZeroMQ and Majordomo protocol

text: I am learning ZeroMQ and came across the Majordomo Protocol. I am wondering if I'm understanding this correctly, is the use case the same as.. for example.. the Microsoft Azure AppFabric service? Would I use Majordomo if I wanted to create an AppFabric-like servie bus? Or would I do Pub/Sub+Request/Reply? If you are not familiar, azure service bus is a way to connect applications to services (or applications to applications, etc) -- at least for the purposes of this discussion: ![Azure AppFabric Service Bus](http://i.stack.imgur.com/PY6xJ.jpg) Does it seem like this is a Majordomo protocol use case, or am I looking at a different pattern here (the bottom "direct-connection" line notwithstanding). How would eventing work (a worker initiated message)? \-- (EDIT) Thanks Adam. Distilling the question down to its essence, if I were to implement the Azure AppFabric messaging protocol with ZeroMQ, would I be using the Majordomo protocol, or would another pattern be more appropriate? Also as reference, link to ZMQ Majordomo: http://rfc.zeromq.org/spec:7


title: Storing last polled database timestamp unix

text: I have a Unix script which is called by a scheduler (CTRL M) every 3 seconds. The script queries an external database(not belonging to my application and therefore I can only query it) to check for new records. Currently it stores the last run timestamp in a local table and on the next poll queries the external database for all records > timestamp. Now I want to avoid updating and querying this local table. The only option I see is to store and read this timestamp in a file.However chances of the file getting corrupted or overriden are higher than data in a database. Google had lot of java options but I need this in a script. Is there any better way to store the timestamp or better design for the functionality as a whole?


title: want to learn more about implementation of object oriented design in web application using asp.net c#

text: Can some one guide me about How can i have complete grasp for object oriented design. basically i am looking for a book about that or any good website you people can share . bottom line is that i want to develop a web application for my learning from start to finish which is completely object oriented in asp.net c#.


title: What's a good naming convention for generic types in C#?

text: I decided to ask this question here instead of on stack overflow because it is rather subjective. In C#, typically I see generic types with very poor names. Specifically, "T" is commonly used but is not a meaningful name by itself. For example:               class Fruit<T>     {         T fruit;     }      While this is the typical approach, would anyone recommend against this? And if so, what would a reasonable naming convention be for generic types in the context of C# for generic functions and classes? In my previous example, let's assume that generic type `T` must always be a type of fruit, such as `Apple` or `Orange`. The type `T` needs to make it obvious that it's a type of fruit, so maybe a better name would be `FruitType`, so we end up with:               class Fruit<FruitType>     {         FruitType fruit;     }      This is just to give you guys an idea of what I'm looking for. What's an acceptable "rule of thumb" for this issue?


title: How to run a function and load Viewbag on every page load?

text: Here is my issue. On my _Layout, I have a help button that shows up on every page in my MVC application. Is there a way to assign the Viewbag with my simple model without having to put in every ActionResult method throughout my application? A global method?               public ActionResult Index()     {        var query = db.OnlineHelp.Where(a => a.PageUrl == Request.RawUrl).FirstOrDefault();        ViewBag.htmlraw = query.PageContent     }      and on my _Layout.chtml               @Html.Raw(@ViewBag.htmlraw)      The Request.RawUrl tracks the user and depending on the page, the database is queried and returns the result such as /Home/Index


title: What "sublicense" actually means?

text: First, it is clear that the right to sublicense doesn't give you the right to relicense. Let's say we have a library with MIT license(1 file), someone adds some features to the library but puts them under GPL(in the same 1 file). Or if someone wants to sublicense they have to separate the code? If someone wants to use the library, how are the licenses handled?   Let's say that the developer uses only the features under the MIT license even if in the file there are some features under GPL.   Does he have to GPL his application because of the GPL licensed code?   Does he have to remove the GPL code in order to be free of the GPL restrictions or he can just use the library under MIT permissions/restrictions as long as he doesn't use the GPL code?


title: Strategy for securing paid Data as a Service API

text: When creating a webservice/api that is intended to be used by javascript/flash/mobile clients, what is a good method for making sure that a paying client's credentials are not stolen and reused. To clarify further, lets say I want to charge $1 for every 10,000 requests against my API. If someone wants to farm my data for free, they would just need to find another client app that already uses my API and construct requests using the credentials of the paying customer. I don't see any way that I can "hide" what is going on the client, someone will always be able to easily reverse engineer the "auth" scheme. So what are good ways to mitigate abuse? EDIT More in depth example of the scenario... Lets say my data service is bus schedules. The purpose of the services is for developers to write apps consuming the data. There's nothing personal about the data, it is the same for everyone. The intention is for the developer to write javascript/flash/mobile apps **directly against** the api (I'm aware of cross domain restrictions). But the developer has to pay when users of his app make requests against the bus schedule api. How do I keep another developer going to the original developer's site and just lifting the credentials that are used by his browser to talk to the bus schedule api, and writing his own app using those credentials?


title: How do you maintain focus when a particular aspect of programming takes 10+ seconds to complete?

text: I have a very difficult time focusing on what I'm doing (programming-wise) when something (compilation, startup time, etc.) takes more than just a few seconds. Anecdotally it seems that threshold is about 10 seconds (and I recall reading about study that said the same thing, though I can't find it now). So what typically happens is I make a change and then run the program to test it. That takes about 30 seconds, so I start reading something else, and before I know it 20 minutes have passed, and then it takes (if I'm lucky!) another 10+ minutes to deal with the context switch to getting back into programming. It's not an exaggeration to say that some things that should take me minutes literally take hours to complete. I'm very curious about what other programmers do to combat this tendency (or if I'm unique and they don't have this tendency?). Suggestions of any type at all are welcome - anything from "sit on your hands after hitting the compile button", to mental tricks, to "if it takes 30 seconds to start up something to test a change, then something's wrong with your development process!"


title: Which is the correct licence?

text: So I found this very interesting library in Google Code site. It turns out it is advertised as "LGPL", which is good enough for me. However, in the README file of the library the author contradicts himself saying it is not available for commercial purposes. I'm guessing that when you sign up to create your project in Google Code you can only choose open source licenses. Open source licenses allow selling software, offering commercial support, etc. So my guess is that either the author confused the word "commercial" with "proprietary", or that he just wanted a good place to host his software even violating GoogleCode standards... The thing is, if I want to use the library, which licence should I consider the software to be under? I've already asked the author by email but he has not replied. Thanks very much.


title: Managing 'done' but not releasable code in TFS

text: I am working in an organisation with 11 scrum teams developing on the same code base. Currently, all development is done in trunk, and at the end of a sprint everything MUST be releasable, or it must be backed out (an arduous process) as a release is cut. My opinion is that while work in a sprint is (ideally) 'done' at the end of the sprint, this doesn't necessarily mean ready for release. You may be at a point where you do not have a Minimum Viable Product to release, but have some stories complete. If a story is not done, or the story is only part of a larger feature, it should be easy to keep this separate from the release ready code. At the moment it is all backed out, the release cut is taken, then it is checked back in. A huge waste of time! We use continuous integration, which is the main argument for everyone developing on trunk. Occasionally teams use a team branch, but this is currently frowned upon. I've been considering simply having a 'dev' and 'release' branch, and pushing features to release when they are an MVP, or having a branch for each story or feature, but this is very admin heavy in TFS. Have other people dealt with similar issues in the past, and what are your thoughts on the best way forward? Unfortunately, we are tied to TFS in the short term.


title: Essential management tools for a small/medium software development shop

text: I've recently started work with an organisation that is rapidly expanding and is recruiting or growing several development teams (including two web-based products and a data warehouse/BI team). They are basically working to agile methodologies but haven't formalised a standard way of working yet. Despite the fact that it is early days, I've been surprised by the lack of tools being used to manage the development processes (e.g. no issue tracker, no tool to manage the product backlog etc.) Although it's not my primary responsibility, I'd like to help them out with some recommendations on the most important tools they should get in place. What are the 3-5 top priority tools to establish for management of a good development shop? Why are they necessary? How do they improve the software development process, and how do I justify them to my bosses?


title: What is this algorithm for converting strings into numbers called?

text: I've been doing some work in Parsec recently, and for my toy language I wanted multi-based fractional numbers to be expressible. After digging around in Parsec's source a bit, I found their implementation of a floating-point number parser, and copied it to make the needed modifications. So I understand what this code does, and vaguely why (I haven't worked out the math fully yet, but I think I get the gist). But where did it come from? This seems like a pretty clever way to turn strings into floats and ints, is there a name for this algorithm? Or is it just something basic that's a hole in my knowledge? Did the folks behind Parsec devise it? Here's the code, first for integers:               number' :: Integer -> Parser Integer                                             number' base =          do { digits <- many1 ( oneOf ( sigilRange base ))            ; let n = foldl (\x d -> base * x + toInteger (convertDigit base d)) 0 digits            ; seq n (return n)            }      So the basic idea here is that `digits` contains the string representing the whole number part, ie `"192"`. The `foldl` converts each digit individually into a number, then adds that to the running total multiplied by the base, which means that by the end each digit has been multiplied by the correct factor (in aggregate) to position it. The fractional part is even more interesting:               fraction' :: Integer -> Parser Double     fraction' base =         do { digits <- many1 ( oneOf ( sigilRange base ))            ; let base' = fromIntegral base            ; let f = foldr (\d x -> (x + fromIntegral (convertDigit base d))/base') 0.0 digits            ; seq f (return f)      Same general idea, but now a `foldr` and using repeated division. I don't quite understand why you add first and then divide for the fraction, but multiply first then add for the whole. I know it works, just haven't sorted out why. Anyway, I feel dumb not working it out myself, it's very simple and clever looking at it. Is there a name for this algorithm? Maybe the imperative version using a loop would be more familiar?


title: What HTTP verb is appropriate for an api route that restarts an application the server?

text: I got asked to do a code review of a very simple one-route web service that when hit would simply restart an application on the system. The developer had coded this up as a POST which strikes me as odd. Now I realize that this is not really the type of thing that HTTP is all about - you can't even query state - but is there a more appropriate HTTP verb? My intuition is that since this is mostly idempotent and creates no new resources it should be a PUT.


title: Restful WebAPI VS Regular Controllers

text: I'm doing some R&D on what seems like a very confusing topic, I've also read quite a few of the other SO questions, but I feel my question might be unique enough to warrant me asking. We've never developed an app using pure WebAPI. **We're trying to write a SPA style app, where the back end is fully decoupled from the front end code** Assuming our service does not know anything about who is accessing/consuming it: WebAPI seems like the logical route to serve data, as opposed to using the standard MVC controllers, and serving our data via an action result and converting it to JSON. This to me at least seems like an MC design... which seems odd, and not what MVC was meant for. (look mom... no view) What would be considered normal convention in terms of performing action(y) calls? _My sense is that my understanding of WebAPI is incorrect._ The way I perceive WebAPI, is that its meant to be used in a CRUD sense, but what if I want to do something like: "InitialiseMonthEndPayment".... Would I need to create a WebAPI controller, called InitialiseMonthEndPaymentController, and then perform a POST... Seems a bit weird, as opposed to a MVC controller where i can just add a new action on the MonthEnd controller called InitialisePayment. Or does this require a mindset shift in terms of design? Any further links on this topic will be really useful, as my fear is we implement something that might be weird an could turn into a coding/maintenance concern later on?


title: Looking for a very subtle unit testing example

text: In the context of Continuous Integration, I need to **teach** unit testing to a 20-people audience of programmers. Everything will be all right, but I am still trying to find the perfect unit testing example. More than writing tests like a robot, I want to show that unit testing can help prevent very subtle errors. I am thinking of the following **scenario** to happen when doing a live TDD demo:   * the test cases would already be written,   * we would have to write methods together,   * most of us would naturally have forgotten to handle a specific case for a method,   * everyone would then be surprised, when seeing that all tests don't pass,   * the failing test would make us think more and realize that we forgot an important case. My question will probably finish as "too broad" or "not clear what you are asking", but we never know, one of you might have a great idea. Your answer can use Java and JUnit, though any other language will be fine since only the idea will matter.


title: Layering Design Pattern in Java clean code style

text: As a Java developer, I am developing trying to use the clean code rules. But in my team we are facing a concrete problem: We have a business layer offering a service called "createObject", this service makes a lot of operation which can result to problem. E.g: parentObjectDontExist, objectAlreadyExist, dontHaveAuthorizationToCreate, operationFailed... and we want the UI using this service to display different information messages depending which error occurred. In old java dev, we should have create all signed exception type and throw it in createObject. As Clean code says, it is forbidden to use Exception for business logic AND signed exceptions are evil... Why not...But i don't know how to solved this problem and i don't want to use return code. How do you do? Thanks for youre experience return.


title: Git alternative to a shelveset in TFS

text: I use git for my personal projects, so I have never run into any issues with Git, however I had a discussion at work today and its something that I haven't thought about. In TFS you can store your changeset into a shelveset, this shelveset can be viewed by other developers, say for a peer review. From what I understand in github you are working on your local copy of the repo (possibly with custom branches for different features) and then comes a point for a peer review. How would you go about sharing a specific changes on your local repo with someone else?


title: Strong Name signing order for dependant projects

text: I have two project A(.EXE) and B(.DLL) in the solution. A references B. If I delay sign both and send them for full signing. Will A be able to load B after ? Or do I have to get B fully signed first, and then add a binary reference to that in Project A, delay sign A and send for full signing ?


title: Naming convention for main arguments

text: I recently started using arguments in my main program (here written in `C++` but could be any programming language)               #include <iostream>          int main(int argn, char* argv[]) {         // do stuff depending on argv[1], argv[2], etc.     }      For now I am using mostly random naming conventions like `-t` for testing, `-d` for debugging, `-l` for printing logs e.g. There is no need for adding `-`, it is just that most shell parameters are named that way. I also use `--` for second parameters. Is there any established naming conventions for main arguments ?


title: How do you unit test Application and UI code?

text: I love writing unit tests and agree they are an excellent way to test code, prevent regressions, etc. However, I find myself unable to write them much as the vast majority of the code I work on day-in and day-out is application code that displays a UI to the user. Is there a good way of unit testing application code? What are the best practices here? I am not looking for a specific answer such as a framework, etc. But rather, in general, how do you approach this problem?


title: copyleft licensing question

text: I'm writing an app and referring to some open source, source code (copyleft licensed.) I am not using the original source code because it's for a completely different operating system using a different language, and as far as I am aware, no-one has ported that source into the language I am using nor my target operating system. Am I still covered by the original copyleft license?


title: Alternative Web model

text: One of the problems web apps have against native apps, especially on the mobile front, is the constant need to re-download each web page on request. Ultimately, this leads to slower performance. Why if web apps only download new pages if they're actually needed, not because they're simply requested. For example: perhaps the server can store a web page version in a cookie. Every slight change to the page on the server-side changes the version number. Now instead of the browser requesting a new page each time, why not just check the version number and have the server send the page if they're different? If the page similar, the user can just use a cached page. I'm sure browsers doesn't necessarily have to change to accommodate changes to this, correct?


title: Converting Business Process Maps into Software

text: I am fairly new to web application development. I have defined my problem domain through talking to various stakeholders and putting a process map together - basically a flow chart showing the different steps and processes that the web application must be able to recreate. The problem I am having is that I'm struggling to map this process into application design and code. I was wondering if there are any best practices or development methods that help map a business process into an application design? I have briefly read up about Domain Driven Development and that seems like it may be a good approach. To clarify, I am after a methodology or design principle that will help turn the business process into code. For example, I COULD just map every box in the process map to an identically named class in my code. Thus translating the business process into a domain model (i.e. object orientated) in my code. But is this the best way to do it?


title: A license like the LGPL, but compatible with JavaScript

text: I have written a library that is quite extensive and has taken up a lot of my time, so I would like to license it properly. The LGPL seems to have many of the things I want, but does not work with Javascript or other interpreted languages. Here are the things I want my license to say:   * My library can be used in commercial application (either web or desktop applications).   * My library can be used in open source applications (again, any platform is fine).   * You may not redistribute my unmodified library in any form, except for when the javascript is downloaded to the client's browser.   * I would like to remain as the copyright owner.   * If possible, I would like users of my library to be able to use other libraries under any license (though this is less important). I am fine with distributing source of my library, and I'll have to since it's JS, the thing I don't want is others distributing my unmodified library and saying it is purely their work. I am ok with people modifying and redistributing the library, though I would rather they submitted their work to me and I would give them credit. If they do modify and redistribute the library, they must give me partial credit. I have also thought about using the MIT license, but it clearly states that people could redistribute my library unmodified, which is the most important thing to me, to make that impossible. I sincerely apologize if an identical question has been asked on this network, I have done several days' research and have not found one (this is the closest I've gotten, but the answer didn't help me). Also, IANAL so if any of this is legally contradictory or impossible, please explain rather than just stating that it is impossible.


title: Looping Exhaustive Test Cases - A Good Practice?

text: Sometimes we have code like this:               private static final List<Goat> INEDIBLE_GOATS = [GOAT_A, GOAT_B, GOAT_C]           void eatGoat(Goat goat) {        if(INEDIBLE_GOATS.contains(goat)) {            throw new CantEatGoatException();        }        ...     }      Should it best tested (along with whatever tests for the actual eating) as:               for(Goat goat: INEDIBLE_GOATS) {        // forgive abuse of syntax        assertThrows(CantEatGoatException, eatGoat(goat));     }      Or more like?               assertThrows(CantEatGoatException, eatGoat(GOAT_A));      Should tests verify each and every sort of inedible goat? Or should they test a representative goat from the list and trust that it works for the other goats?


title: Should I use a single platform for common services or modularize them?

text: I am designing a suite of web applications that have the same base functionality. That is, they all will know how to create and operate on widgets. The differences will be in their target audience and how a user will interact with a widget. Essentially, if these applications were developed independently, there would be _a lot_ of duplicated effort. To simplify this I have thought of two solutions. I would like all of your feedback on the pros and cons for each solution, and which you would prefer.   1. "Platform" -- The idea is that there is an independent service layer, a la web services. It wouldn't be a web service, but simply a back-end for all the applications. The platform would talk to the applications via messaging or object serialization. I would want to write the platform with Java, but the intention would be that the applications could be written with any web framework such as Rails, Django, Flex, or just something in Java. The platform would abstract the database, so all interaction with the back-end would be done via the platform. One potential problem with this is that updating the platform will entail taking down all the applications. But at least all the applications will be consistent in regards with the back-end. I like how this is cut horizontally, and that the application really only has to focus on the front-end, rather then worrying about how to organize the back-end.   2. "Modules" -- The idea is that I just write everything with Java and develop modules which would live in their own jars. Each module would represent a Guice module and each application would just include the modules they want, and create their own Injectors. This approach would make each application completely independent from each other, aside of sharing a common database. So, theoretically, it would be much easier to deploy an application in a different environment with out worrying about the platform. I would be stuck in one language environment, Java. Although, JRuby and Jython would be available. So maybe that isn't much of a concern. Also, I foresee it being easier to customize an application with out effecting the platform. The one con is that if I update a module, I would want to redeploy each application using that module. This would be easy with continuous integration, though. Thank you for your time. * * * In regards to Gary's answer, I've decided to take a hybrid approach. I'm going to develop a platform, which will be the access point for the web applications to data and services. I will then modularize the platform, but all the modules will remain under a single repository with a parent POM. While I could just keep them all in a single JAR, I would like the classpath separation for development purposes, to make me/others think before requiring a module to depend on another.


title: How to model the components of a non Information System?

text: I am working on a kernel-related project (specifically related to the TCP/IP stack of the kernel). I need to build some models to describe the functionality and components of my system. Initially I thought about using a Class Diagram, as it can describe the general architecture of my system. But it doesn't make sense since my code is VERY structured (written in standard C). I also thought about DFDs: they'd describe the processes of my system, and how the data is flowing. But they contain something which doesn't really fit in: data-storages. I have no databases here (at all). For the functionality, other team members suggested using Activity and Sequence diagrams, which is kinda okay with me, but what about the system components? So basically my question is: If I want to describe the components of my system, what do you suggest as a meaningful diagram ? Again, the project is a research low-level systems-oriented project with almost no user-interface at all.


title: 2D Image Creator for a video game

text: I need to make a few images for an arcade video game I'm making in Java. As of right now, I have drawings that animate, but there are two problems.   1. The drawings are horrible, and as a result, the game won't get enough attention.   2. It's a pain to have to change each coordinate for the drawing, as the drawings are fairly complex. I'd like to use images. I feel they could solve my problem. They would look better than the drawings, and it would only have an x and a y coordinate, rather than the many coordinates I need for each drawing. So, in a sense, I have two questions.   1. Would images actually help? Would they solve my 2 problems? I just want to clarify.   2. How would I make these images. I don't think I can copy them off of the internet because I plan on publishing this game. So, is there any software where you can make your own images? (It has to be in an image type that Java can support. I'm working with java).  It also, as stated by the header, needs to be a 2D image; not 3D


title: What is the name of the functional argument in fold

text: In the higher order function fold/reduce what is the name, if any, of the functional argument? I am working on a monadic tabular processing library where rows are folded to produce simple analyses (like finding the minimum, maximum, average of a column). I am therefore looking for a sound name for the argument of the `fold` function and any name which is well-established in the ML community (or Haskell or Common Lisp as second and third candidates) would be interesting. A name like `f` is common in the description of `fold` functions, it is however undescriptive and a noun would be better suited.


title: How does having assets saved on a secondary domain(s) reduce the load time of the website?

text: I went for an interview yesterday where I was asked this question: "How does having assets (images/videos) stored on a secondary domain (assets.example.com) reduce the load time of example.com?" To that I answered that by having the code "call" those assets from a secondary website it reduces the traffic that is coming to the main domain and therefore only applying bandwidth to the main domain vs having to also serve bandwidth to request assets. Is that correct? Also, If i am correct, would you say it makes sense to start new websites with this in mind or do you prefer having it done after large traffic rates are achieved?


title: Advantages and Disadvantages of Forced Code Reformat

text: I'm currently working at a place that may be looking at forcing developers to use an automated code formatter on version control check-in. I'm looking for developers opinions on the advantages and disadvantages of doing this ... how you think it would help or hinder developers. My specific case involves Java/JSPs, but I think the question could apply to any language.


title: Is it possible to successfully transition out of being embedded software engineer?

text: I'm a recent college graduate, and I'm mainly involved in high-level programming (e.g., Java, C#, and Python). I've received an offer form a good company for an embedded software engineer position, where I'd be programming devices with C, handling interrupts, and so forth. If I take this job and decide to go back into high-level software development later on, will I be at a disadvantage? Are there development practices specific to embedded development that will sour me to high-level development gigs? In a nutshell, if I'm mainly interested in high-level development, would this just be a very long diversion with very little benefit?


title: Bypass HR to get an interview

text: I recently sent in an application for a position that I am qualified for and received this response: "We regret to inform you that your current qualifications do not match those needed for our current openings. We will retain your resume and if a position opens that closely matches your skill set, we will contact you at that time." The position listed required technical skills A, B, C, D, and E with nice-to-haves of X and Y. I listed in my resume and cover letter that I had experience with A through E as well as X. I don't have any experience with Y. This leads me to believe that I am qualified for the position and the Human Resources representative (who does not appear to be a part of the company) is wrong. I asked for a clarification of what qualifications I was missing, but have yet to receive a response. I did a good bit of research about the company and the developers I would be working with and I think it would be a great place to work. I don't want to take no for an answer so easily. I am thinking about directly contacting the development lead (via Twitter) at the company and asking him to look at my resume. He does not know who I am. Is this a good idea?


title: What are the organizational benefits of TDD over functional development backed by unit tests?

text: I've heard of TDD as an organizational development paradigm, where all developers are asked to let testing drive development, and I've also heard of organizations who don't embrace TDD so long as unit test coverage reaches close to 90 percent for the application. One thing I never hear is why an organization would set a standard for TDD specifically when it is an individual development discipline.


title: Sell code using dynamically linked Open Source GPL code?

text: I am really confused. The GPL states that if you start with GPL code, and modify that code, that you must release your code with modifications free of charge also under a GPL. But what if you simply use the existing GPL code without modifications as a library? Can you then write software to interface with that code, unchanged, that is closed source?


title: Open source licenses (specifically GPL) & gamemaker's source format

text: Now with gamemaker studio source files are no longer stored in a proprietary format - instead they are stored as simple XML files containing all data. Now I am wondering, can projects created with gamemaker be licensed using an open source license - especially wondering about the GPL and BSD/APACHE families? And if so how to? The biggest objection I see is that all files are generated by gamemaker - and regenarated each time gamemaker saves/loads. The main problem with this is that GM will remove any "unrecognized" data from the xml (so any comments). Including copyright notices.   A second problem is that gamemaker typically creates a few dozen files, basically for each function a separate file is created. A typical generated xml looks as following:               <!--This Document is generated by GameMaker, if you edit it by hand then you do so at your own risk!-->     <object>       <spriteName><undefined></spriteName>       <solid>0</solid>       <visible>-1</visible>       <depth>0</depth>       <persistent>0</persistent>       <parentName><undefined></parentName>       <maskName><undefined></maskName>       <events>         <event eventtype="0" enumb="0">           <action>             <libid>1</libid>             <id>603</id>             <kind>7</kind>             <userelative>0</userelative>             <isquestion>0</isquestion>             <useapplyto>-1</useapplyto>             <exetype>2</exetype>             <functionname></functionname>             <codestring></codestring>             <whoName>self</whoName>             <relative>0</relative>             <isnot>0</isnot>             <arguments>               <argument>                 <kind>1</kind>                 <string>xml = FS_xml_open("C:\Users\user\Documents\filesystem\student.xml");          </string>               </argument>             </arguments>           </action>         </event>         <event eventtype="9" enumb="13">           <action>             <libid>1</libid>             <id>603</id>             <kind>7</kind>             <userelative>0</userelative>             <isquestion>0</isquestion>             <useapplyto>-1</useapplyto>             <exetype>2</exetype>             <functionname></functionname>             <codestring></codestring>             <whoName>self</whoName>             <relative>0</relative>             <isnot>0</isnot>             <arguments>               <argument>                 <kind>1</kind>                 <string>var root_elem = FS_xml_root_element(xml);     show_message("start with root element: " + FS_xml_get_elem_name(xml, root_elem));     xml_test_display_func(xml, root_elem, "");     </string>               </argument>             </arguments>           </action>         </event>       </events>       <PhysicsObject>0</PhysicsObject>       <PhysicsObjectSensor>0</PhysicsObjectSensor>       <PhysicsObjectShape>0</PhysicsObjectShape>       <PhysicsObjectDensity>0.5</PhysicsObjectDensity>       <PhysicsObjectRestitution>0.100000001490116</PhysicsObjectRestitution>       <PhysicsObjectGroup>0</PhysicsObjectGroup>       <PhysicsObjectLinearDamping>0.100000001490116</PhysicsObjectLinearDamping>       <PhysicsObjectAngularDamping>0.100000001490116</PhysicsObjectAngularDamping>       <PhysicsObjectFriction>0.200000002980232</PhysicsObjectFriction>       <PhysicsObjectAwake>-1</PhysicsObjectAwake>       <PhysicsObjectKinematic>0</PhysicsObjectKinematic>       <PhysicsShapePoints/>     </object>      (where you can see that the amount of non-generated actual code programmed corresponds to 4 lines). Adding something like `<!-- copyright 2013 ....... >` to each file does not work as the notice will simply get replaced the moment gamemaker "saves". Is using a central COPYRIGHT notice file "enough" for open source formats? Can that be used with GPL/APACHE? If it is incompatible, what would cause this?


title: WCF Service in an N-tier Application

text: Is it recommended to use a WCF Service Library in developing an N-Tier Windows Application? Also is it better to use the VS wizards to create the DataTables and DataSets? And if so should I add all of my tables to 1 dataset or have a dataset for each table? This is all new to me and I want to learn it the right way.


title: Alternatives for saving data with jquery

text: I am not sure if this question is considered too broad, but I would like to reach out to my fellow programmers to see what alternatives are out there for saving data using jquery. I have a content management system that generates an set of HTML pages called an IETM (Interactive Electronic Technical Manual). The HTML pages are written in HTML and uses jquery. The ITEM is meant to be light weight, portable and run on most modern browsers. I am looking for a way to save data. I have considered cookies and sqlite. Are there any other alternatives for saving data using jquery?


title: Does your company have architectural principles? Which ones?

text: Does your company have architectural principles that are written and agreed upon? How did they come about? How do you manage ownership and acceptance of these principles? Are they helping you or hinder you?


title: What's the idea behind defining rectangles with two points?

text: It's not that this doesn't make sense, but it just works out awkward 99% of the time. Often in 2D graphics rectangles are initialized, stored and manipulated as a pair of points. In no particular language,               class Rect:        p1, p2: point      It makes more sense to define a rectangle as two x values and two y values, like this:               class Rect        xleft, xright: int        ytop, ybottom: int      With two points, if at some place in the source code you want to make use of the y value of the top, you'd have to say rect.p1.y (hmmm, stop and think, is it p1 or p2) but with the four values as plain data members, it's clear and direct: rect.ytop (no thinking required!) The use of two points means that in dealing with the vertical, you have to tangle the horizontal; there's an extraneous relation between indepenent elements. How did this two-point idea come about and why does it persists? Does it have some benefit over bare x and y coordinates? ADDED NOTE: This question is in the context of X-Y aligned rectangles, such as in windows managers and GUI toolkits, not in the context of arbitrary shapes in drawing and painting app.


title: What is wrong with Java's generics?

text: I have seen several times on this site posts that decry Java's implementation of generics. Now, I can honestly say that I have not had any issues with using them. However, I have not attempted to make a generic class myself. So, what are your issues with Java's generic support?


title: Refactoring or upgrading databases to handle new features

text: Several responses to a database schema question, suggested an additional table to normalize a database for a feature that is not part of the current requirements (A UserDepartment table to allow for a many-to-many relationship between employees/users and different departments they may belong to.). Not against normalization. Seems like when it comes to database design, there is a strong push to include features that they're 'sure' someone will want in the future. Is it so difficult to add tables/fields to the database to accomodate features that there is a tendancy to over-engineer? Wouldn't they be refactored or upgraded just like the rest of the app if needed? Redoing things is never fun, but moving data from one table to a new one can be done. Just not sure where this line of thinking will end. Edit: There is so much of an aversion to this, I wonder how many projects end up not adding a feature that requires a drastic database change or are non- normalized approaches taken like adding a DepartmentID2 field instead of a new table. The need for multiple departments for an employee is a common domain problem. I just haven't noticed many database schemas that are littered with many-to-many relationships.


title: How to organize a MST when one node disappear?

text: I'm doing my research and stuck with a question: I am having a minimum spanning tree (prim algorithm), now one node in my tree gets deleted, I wonder if there is a way i can re-organize my tree such that the optimality still maintains? I'm looking for some suggestions here and I will appreciate your help. Thank you! Note: All edge weights are 1 (unit graph)


title: Dependency injection with Finite State Machines and the Interface Segregation Principle

text: I am trying to figure out what is the best way to setup a FSM and also keep my interfaces clean and use an IOC container to use DI. Let's just visit the Head First design pattern textbook example of the gumball machine.               interface IState     {         InsertQuarter();         EjectQuarter();         TurnCrank();         Dispense();     }      Is the best practice to just thrown an exception for an invalid state? Why add the state if it's not even applicable? I guess that is the portion where I am confused. I could see this simple example getting more complex. My other related question is, how do I perform DI to these states? Should a state machine and states should be registered in my IOC container? Let's suppose I have an Order Service and an Inventory Service that have a dependency on a `StageOrderState`. What might this object model look like? I'm having a hard time digesting how to actually inject the dependencies in to these states. My guess is that I _could_ register the states and pass the container around to the states.


title: Mac Dev Team, suggestions for an remote windows testing environment?

text: Alright, so my situation is as follows:   * 1 Front End Developer   * 2 Back End Developers   * 1 QA Tester We all currently have Virtual Machines, or Second PC's set up with our windows environments to test. Now, the real issue is our Windows Environments expire. We're now running into points where randomly parts of our team forget to set up their refreshed environments, and we lose a few hours of productivity. **What I'm hoping to accomplish?** I'm looking to try and set up an external environment that we can all remote to and test on. Something that's separate and external. The only people that really need the environment regularly would be the Front End, and QA parts of the team. They'd also be working on the same section. Anyone have a suggestion for this setup? Has anyone accomplished something similar? Anyone have a suggestion for a better method behind consolidating these Windows Environments? **Clarifying:** by 'windows environments' I mean a local machine running a copy of windows to test on, not a Windows Server where we would deploy code.


title: Feedback on setting up a "Programmer Dojo" -- suggestions?

text: Looking for a case study, or operational plan for setting up a "programmer/hacker dojo" in the United States. Here's an example of one, **hackerdojo.com**; it's possible this info is on their site, but I have been unable to find it. * * * **UPDATE (1):**   * **Wikipedia** \- http://en.wikipedia.org/wiki/Hacker_Dojo   * **WSJ** \- Techies Get to Work at Hacker Dojo (2011/03/10)   * **venturebeat** \- Hacker Dojo, finally a hangout where coders can go 24/7 (2009/08/13) * * * **UPDATE (2):**   * Learning Space Matrix - Microsoft Corporation (MS Word Doc, Google Preview)   * **KEYWORDS:** Community Centric Working Space


title: Two git repositories, one project

text: I am building an app using Code Igniter, it is being based on CI-Bonfire. I am pulling in the dev branch of CI-Bonfire using git, I want the entire project to be git controlled as well, but I want to be able to just pull the latest changes from the dev branch of CI-Bonfire, but push my entire app to a different repository. All changes that I make to the files that come from bonfire will be config changes, so all pulls will be able to merge automatically. Is this possible?


title: Why would one ever want to use a synchronized method in Enum?

text: I stumbled upon this question and a couple of other along the same lines. While we know creation of enum is thread safe and `enums` are by birth singletons . It kind of confuses me that why would any one want to have a `synchronized` method with in an `enum`. Yes I am fully aware that methods in an `enum` are not thread safe but then what? They must **not** try to change the state of an enum any way . If we are not concerned about change of state of an enum then why would we ever like a method in an enum to be thread safe.


title: How to properly use Hibernate

text: I am new to Hibernate so my question could be seen as a very straight forward one, also I will try not to be too generic (as I am always told off because of that), although as with all architectural question it is hard to avoid that... I never know where to ask these questions. I have setup a webapp using Spring + Hibernate. My architecture uses a series of Controllers which make use of Services that ultimately call DAO methods to obtain my domain objects. I also have a GenericDAO which implements all the basic data access methods (findAll, findById, save, delete, update...) which I extend for my concrete Dao so I only have to implement specific data access methods. So a request to view all users will have this flow: the proper controller is called through request mapping, which feeds the view with the result from calling `userService.getAllUsers()` which at the same time makes a call to `userDao.findAll()`. This is all nice and I think I'm doing it properly enough. My question relates to relationships among domain objects, so let's say users have accounts and for one view I want to show the user's details plus his list of accounts. I never found out what's the best way to gather the accounts object list. Should I mark the relationship as Eager? Should I make a call like this:               user.accountList = accountService.findAccountsByUser(userId);      if that's the case then what's the point of specifying the relationship in the first place? Or maybe I am missing some other way here? What happens with Many to Many relationships? Am I forced to create a domain object called UserAccount (assuming an account can be associated to several users) that maps the relations between the two?


title: Is it required to differentiate between js framework and js library?

text: While searching through many javascript libraries/frameworks, I observed that the terms are sometimes used interchangeably. So, conceptually is it important to distinguish between framework and library? Do people seriously make their decisions based on whether it is a library or framework? Would a user like to browse two separate areas - libraries and frameworks while looking for a solution?


title: Making a decentralized system utilizing JavaScript/HTML5?

text: I am interested in decentralized systems, and am currently considering building one myself. I am considering using JavaScript and HTML5, simply because it makes it very easy to use the system (they just have to go to a website). Some thoughts:   * I may or may not use another decentralized network for storage, and even if I do, I probably want to cache stuff on the client. If I do not, I **need** to store stuff on the client, since the information will then be distributed on **my** network. Is any of the HTML5 storage models good for this? I've read somewhere that they have a size limit.   * When using JavaScript in the browser, my understanding is that I have to use WebSockets instead of regular sockets. Doesn't this force me to use WebSocket in my "protocol spec"?


title: Can a method that must be overridden be considered private?

text: Suppose I have a class `C` with a method `f()` which is meant to be used only within `C`'s implementation, but which should be overridden by `C`'s subclasses. Is it reasonable, or "pythonic", to consider it private, i.e. to name it `_f()` rather than `f()`? In other words would you distinguish the interface provided to subclasses from the interface provided to code outside the inheritance hierarchy?


title: Why shouldn't a new software product try to compete on price?

text: I know about how the economies of scale work, and how a bigger competitor could beat you in price, if they wanted. But there doesn't seem to be anything better to compete at when entering a market in software (without being dishonest); a new product often won't be as good as an established one as far as features go. Plus, older popular products are usually priced higher just "because they can," and it's not likely they'll change just to crush a smaller company, so it seems tempting just to set a low price.


title: Best practice for handling variable values outside of source code?

text: I am trying to get my head wrapped around OOP after programming in more procedural languages for a number of years. My question: What is the best practice for handling variable values outside of source code? For example, I have file directory values and regex patterns that may need to be manually changed from time to time. I would like to avoid changing these values directly in the source code. I am thinking of creating a text file that will hold key/value pairs. I would then create an object to set these values so that they can be referenced by any methods in my code. Is this the right approach or am I violating any OOP principles? Thanks


title: Pre-Interview Screening Questions

text: I need to hire a senior software developer. I've switched to a new recruiter and he's asked for about 3 questions to ask each candidate on the phone that he'll send the answers to when I see the CV to help me screen out the obvious bad ones. I quite like the idea of not having to phone screen people who just cannot code but I'm struggling to be honest. The notion of quickfire hire/no hire questions intrigues and worries me in equal measure. I reckon it's possible to come up with some useful ones but most of the questions I ask in an interview are open ended, language agnostic and based on cultural fit. Now, the recruiter has told me that the candidate wont be able to google the answers since they'll be asked immediately before he sends the CV but I clearly don't want to ask questions that are 'googleable',..I don't care if they routinely google those sorts of questions. In fact, I'd rather they did! So, if you were in my position what questions would you ask? For what it's worth, the primary platform is .Net, C#, Sql Server et al along with the normal slew of legacy technologies. **Edit** Just to be super clear... knowing whether the candidate knows what the volatile keyword does in C# or how they would create a regex that validates UK postcodes would be pointless information. That's classic google fodder. I want something that demonstrates a deeper understanding than that. I considered simple 'what is polymorhism' type questions or 'explain the difference between an 'HTTP PUT vs POST' but these seem pretty straight forward for a senior. I'm looking for something to help support the decision to interview a senior.


title: Two factor authentication using time base key generator on smartphones

text: I recently enabled two factor authentication for my Google account. One of the ways of getting the second factor (the key that I have) is to install an Android app on my phone that displays a key for a short duration of time. What does it take to create a web server solution paired with a smartphone solution? I am using Windows and .NET on the server side and would be interested in both Android and iPhone apps. Are there existing libraries out there or do I need to start from scratch? Where is some starting documentation and explanations of the techniques used?


title: Do exceptions basically exist to prevent a system from crashing?

text: Second of all, I was wondering if anyone knew what the difference was between exceptions (in the realm of exception control flow) and Exceptions (such as used in Java). But are they there to basically protect the system from crashing by terminating the user program?


title: What are the disadvantages of using/writting a .Net Custom Membership Provider?

text: Recently, I posted the following question on SO: http://stackoverflow.com/questions/7197337/using-asp-net-membership-provider- with-an-existing-user-database As you may notice, I ended up answering my own question stating that it looked like writting/implementing a "Custom Membership Provider" was the way to go. Literally, a few minutes later, I stumble across this question: http://stackoverflow.com/questions/7222306/simple-login-attempt-counter-using- mvc-3-and-ajax/7222407#7222407 I try to answer and get a comment back that .Net Membership provider is "terrible on many levels". I'll admit, this is the first time I'm using Membership provider but it sure looked slick to me. I haven't seen anything that backs up the "terrible" claim so before I implement something "terrible", I was hoping to get some feedback from the community.


title: practical way to learn C?

text: I want to dig into C and normally when I want to learn a new language I think of a simple/attainable project goal that has some practical purpose (make use of an api, automate a task, etc...) I'm having a harder time coming up with one for C mainly because everything I read points to the fact that C's primary use currently is in embedded systems and more complex software projects like operating systems. Does this point me to the fact that I don't need to learn it or that I just need to be a bit more convoluted in my learning strategy? References to practical learning resources? (tutorial/how to that produces an end result that has some purpose/benifit)


title: Best Way to Handle Meta Information in a SQL Database

text: I've got a database where I want to store `user` information and `user_meta` information. The reason behind setting it up in this way was because the `user_meta` side may change over time and I would like to do this without disrupting the master `user` table. If possible, I would like some advice on how to best set up this meta data table. I can either set it as below:               +----+---------+----------+--------------------+     | id | user_id | key      | value              |     +----+---------+----------+--------------------+     | 1  | 1       | email    | test@testemail.com |     | 2  | 1       | name     | user name          |     | 3  | 1       | address  | test address       |     ...      Or, I can set it as below:               +----+---------+--------------------+--------------------+--------------+     | id | user_id | email              | name               | address      |     +----+---------+--------------------+--------------------+--------------+     | 1  | 1       | test@testemail.com | user name          | test address |      Obviously, the top verison is more flexible, but the bottom version is space saving and perhaps more efficient, returning all the data as a single record. Which is the best way to go about this?   Or, am I going about this completely wrong and there's another way I've not thought of?


title: How to organize unit/integration test in BDD

text: So finally after reading a lot, I have understood that the difference between BDD and TDD is between T & B. But coming from basic TDD background, what I used to was,   1. first write unittest for database models   2. write test for views (at this point start with integration test as well, along with unittests)   3. write more integration tests for testing UI stuff.  What would be a correct way to approach BDD. Say I have a simple blog application.               Given : When a user logs in.      He should be shown list of all his posts.       But for this, I need a model with a row user, another row blog posts.   So how do we go about writing tests?   when do we create fixtures? When do we write integration (selenium) tests?


title: When you create an open source project, how to know who's participating and if his version is good?

text: my friend has developed a CAD program in C, here it is http://web2coders.jrcw3.com/ i have convinced him to go open source, but we have some concerns:   * if you upload a project to sourceforge or github would you be able to know who's participating and if his version is good?    * if you have many versions being developed by other programmers, how to know which is the best version, which has too many bugs and so on, do you have to read every version or is there a faster way? I really hope that this question will not be closed, because i have asked it in other places and no one answered, so stackoverflow is my last chance to get an answer


title: Legality/Ethics of crawling a site to basically copy its database?

text: A potential freelance client wants a copy of all the phone numbers in an entire country of several million people in CSV format for their telemarketing system. They have sent me a link to an online phone number lookup service. There are also ways to list the phone numbers of a given region, 30 numbers at a time, with a next link at the bottom of the page to go to the next 30. I could write a spider to crawl the site and basically copy their database, but is this kosher, legal or ethical? Someone else I asked said it depends on the terms of service, but the site doesn't have a terms of service. What do you guys think?


title: Basics of ERP for dummies

text: A situation has arisen where (if I don't scream and run away) I will be involved in an ERP system. This project will be using OpenERP specifically. My background is entirely science/engineering/music/games/art/whatever. I've never set foot in the realm of business systems or anything describable with the word "enterprise". What is a good introduction to the whole ERP concept, OpenERP and business systems in general suitable for those with flat zero experience in that world? The ideal intro would explain, from no assumptions, what the main ideas are, terminology, they style of work and thinking of people in that world, and maybe some concrete suggestions how one can tinker around with a copy of OpenERP to gain basic familiarity.


title: What can slow a developer down?

text: What things tend to slow a developer down? Please try to refrain from posting answers that:   * are slow now but useful in the feature. (TDD, Refactoring, ...)   * list a distraction.


title: Concept of Address Space

text: I have searched the idea of address space that is `The set of all legal addresses in memory for a given application. The address space represents the amount of memory available to a program.` I am unable to find that how this concept is implemented? And how it works with operating system? Any help would be appreciated.


title: State machines vs threads

text: Alan Cox once said "A Computer is a state machine. Threads are for people who can't program state machines".   Since asking Alan directly is not an option for humble me, I'd rather ask here: how does one achieve multi-threading functionality in high-level language, such as Java, using only one thread and state machine? For example, what if there are 2 activities to perform (doing calculations and doing I/O) and one activity can block?   Is using "state-machine only" way viable alternative to multi-threading in high-level languages?


title: Timeline of a programmer in terms of languages?

text: > **Alan Perlis once said: "A language that doesn't affect the way you think > about programming, is not worth knowing".** I am not proud of the fact that I started programming with scripting languages first( _php_ ,then _javascript_ and now learning _python_ ). I dont have any experience in _c,c++,java,.net,c#,objective-c_. Programming is such a vast field,it would take an eternity to get down to all aspect of it. I cant go back in time.But there are lot of people who would benefit from this question. **MyQuestion** :-If anybody had the option of going back in time,Which programming languages chronologically should that programmer shoot for? The obvious answers might be opinion and purpose/requirement based,But keeping in mind the limited time we have,which languages we shouldnt miss out for to get thorough understanding of programming. **Difference in opinion is OK,just looking for the approximate chronology.** Hope I am clear and not misunderstood.


title: What types of specification documents exist in app lifecycle?

text: Developers in large companies usually have multiple specification documents that they write at each phase of the software in question. I've heard of some of them and would like someone to tell me of all specs documents that exist. For example, I've heard of estimation doc (written before project starts), high-level specs, low-level specs and implementation specs. Are there more of them? Can you sort them as they appear in the lifecycle of some application? Note: the reason for this question is that I have to delegate some project to another person and I would have to write all these specs docs. Somehow, I don't think that writing low-level specs is always the best solution (if I am wrong, let me know) so that is why I asked this question.


title: Why is float the default in the majority of languages?

text: In programming languages, for represent numbers you have (mainly) two types: `Int(s)` and `floats`. The us of `Int` is very easy. However floats cause a lot of unexpected surprises: http://anh.cs.luc.edu/python/hands-on/3.1/handsonHtml/float.html I wonder why is not used a decimal-based type make more sense as the default for literals and normal math? Where normal math is more precise?


title: Is it better to learn html, javascript, php, then mysql if you want to start your own site?

text: Is it better to learn html, javascript, php, then mysql if you want to start your site? Is it better to learn it in that order or not?


title: As a young student aspiring to have a career as a programmer, how should I feel about open source software?

text: Every once in a while on some technology websites a headline like this will pop up: http://www.osor.eu/news/nl-moving-to-open-source-would-save- government-one-to-four-billion My initial thought about government and organizations moving to open source software is that tons of programmers would lose their jobs and the industry would shrink. At the same time the proliferation and use of open source software seems to be greatly encouraged in many programming communities. Is my thinking that the full embrace of open source software everywhere will hurt the software industry a misconception? If it is not, then why do so many programmers love open source software?


title: What difference with Android when iOS is not open?

text: My question may seem silly, but, I've read in many Android books that the better part of Android is Android is open, and iOS is closed. But, from a programmer viewpoint, who cares about this point? Programmers just care about the platform: is it easy to program in, easy to have help in the network, etc. They don't care about whether the platform is open or closed. One book had additional information, but I don't understand it much. Since iOS is not open, I’d be able to share my work with others only if Apple allowed it. So, if you write an app, and need to share, you must have Apple's permission, but not Android's? Please help me understand this point. I'm preparing for a presentation on Android. And I don't know if I should put this point into my presentation.


title: What is classic object oriented programming?

text: I heard the phrase _classic object oriented programming_. Is it different from present object oriented programming, like classic ASP and ASP.net?


title: Design patterns - do you use them?

text: Being an IT student, I was recently given some overview about design patterns by one of our teachers. I understood what they are for, but some aspects still keep bugging me. Are they really used by the majority of programmers? Speaking of experience, I've had some troubles while programming, things I could not solve for a while, but Google and some hours of research solved my problem. If somewhere in the web I find a way to solve my problem, is this a design pattern? Am I using it? And also, do you (programmers) find yourself looking for patterns (where am I supposed to look, by the way?) when you start the development? If so, this is certainly a habit that I must start to embrace. UPDATE: I think when I ask if programmers do use them, I'm asking if when you have a problem to solve you think "Oh, I should use that pattern".


title: Proper program design for submitting a form

text: I have been stuck wondering what the best solution to the problem below: I am developing a form like GUI with quite a few places for input. Currently, I am storing each UI element in an ArrayList representing each modular component of the form (Seperate layouts containing UI elements relevant to one another) I then pass these ArrayLists into a new class that will then handle gathering the data entered by the user after a submit button has been clicked. I feel as though this method of passing the UI elements by ArrayList is not very good practice. If anyone has any better suggestions, I would love to hear them, as I feel this method is somewhat unclean.


title: How do I make up for a lack of feedback as a solo developer?

text: As a newly self-employed software developer, my concern is that I am not getting the stream of feedback I have received in the past when working in groups. (I do have feedback (mostly positive) from my customers, and I do spend a fair amount of time on self-improvement.) What should I be doing to fill the gaps? Any other one-person software shops out there? How do you stay connected and avoid becoming too enamored of your own work? Am I worrying about this too much? Thanks for your comments.


title: Formal requirements analysis

text: I've been doing a Requirements Analysis module in my university. We've covered all kinds of formal requirements stuff, like UML, Use Case Diagrams, Sequence Diagrams and Contracts. I have to ask- are any of these things of any value whatsoever in the real world? The only Use Case Diagrams I've ever seen could be summed up in a vastly more succint and understandable way in plain English- or even code in a reasonable language of your choice- and the same goes for the other things I've mentioned.


title: Diagramming large and complex application code

text: I tried creating a flow chart of a function that I use in my program, but there are a lot of conditional statements in between every process and the diagrams are getting more confusing. Is there a another language or markup other than flow charts that can be employed for large codebases with high complexity?


title: Post-Project Meeting a Waste of Time?

text: At my place of employment, we've had some serious growing pains. We went from a development team of 3 to 10, and the company itself has grow 30% in the past year. By most measurements, we're doing well. Unfortunately, the quality of our software has suffered. In a meeting today with my division's manager, I proposed a project team meeting a day or two after the product has launched. We could discuss budget concerns, scope, what went wrong, and what went right. Ideally, learning from our mistakes. We build sites/apps for other people, so our time is either billable on non-billable. A meeting like this would fall under the latter. My manager shot it down almost immediately: "That time isn't billable. It'll make us get behind on another project because we waste time at the end of that one talking about it." I was so caught off guard by this logic that I didn't even bother fighting him on it. So my question: I see the value is post-project meetings, but he doesn't. Is there **documented** proof of post-project meetings helping save time and money in the long (or short) run? Intuitively I think it will/would, but he clearly is more worried about a small amount of un-billable time from the 5 people that would need to be there.


title: Scrum: What if the Product Owner has tasks?

text: I have just started working with a team that has picked up some aspects of Scrum (two week timeboxing) but not others (the team does not currently agree to all estimates or to the number of points in a sprint, but I'll change this soon.) The product owner is also a technical resource (scientist) with some development background. Is it appropriate to have the product owner's tasks (which mostly involve research) mixed in with the team's tasks (some of which are research and some development).


title: Data Grid for Web Application

text: Are there any good Data Grid libraries that allow the user to view and edit data from a database? My boss asked me to research possible Data Grid resources to supplement our web application and I thought I'd ask here. I know we could make one in-house, but we'd like to have a professional looking one without expending too much time and work. We are looking for a web based Data Grid, preferably written in Java that is free or open-source. JDeveloper looks promising, however, it has quite a bit of overhead and quite a steep learning curve. The web application that this would supplement is not large enough to warrant the time it would take to simply learn JDeveloper. The grid viewer should be able to:   * allow users to view tables   * allow users to edit rows inline   * allow sorting by columns   * pages rows   * associate tables If there are any suggestions of possible Data Grids that allow have this criteria, it would be much appreciated.


title: Are there technical limitations or language features that prevent my Python script from being as fast as an equivalent C++ program?

text: I'm a long-time Python user. A few years ago, I started learning C++ to see what it could offer in terms of speed. During this time, I would continue to use Python as a tool for prototyping. This, it seemed, was a good system: agile development with Python, fast execution in C++. Recently, I've been using Python more and more again, and learning how to avoid all of the pitfalls and anti-patterns that I was quick to use in my earlier years with the language. It's my understanding that using certain features (list comprehensions, enumerations, etc.) can increase performance. But are there technical limitations or language features that prevent my Python script from being as fast as an equivalent C++ program?


title: Books having graded collection of programming problems

text: I am looking for a book with **graded** (i.e from low to high level of difficulty) collection of programming problems. The problems I am interested in are Algorithm/Data Structure problems, since this is the genre of problems asked in ACM ICPC, Topcoder, CodeJam, Facebook puzzles, and majority of interviews, I suppose. I do know of various collections on web but none of them are graded so it is daunting for a beginner to get started. I am looking for something that starts from the very beginning and goes up to Topcoder level, for instance.


title: Checking for cross-site scripting vulnerabilities in Perl web applications

text: I'm putting together some notes for a dev team on how to write secure Perl code - especially taking into account the current OWASP top 10 web application vulnerabilities. For cross-site scripting I've included information on ensuring that all output to the browser is checked and escaped where necessary, but I'm looking for more automated mechanisms that would mean a developer doesn't have to think about every output statement and, potentially, miss one. Perl's 'taint' function sounds like it should be a help because it distrusts all user input, but it doesn't complain on tainted data being output to the browser. Apart from checking all output statements individually (probably by calling a generic sanitizing function) does anyone have any ideas on how Perl can help with this with existing libraries or techniques?


title: Built-in Context-and-Input-to-Output-Hashing in Compilers

text: Why doesn't (open source) compilers contain builtin funtionality for (shared) caching and reuse-fetching (using SHA1-hash of compiler-version, build-flags, target-platform and inputs) of executable output objects (ELF or COFF) similar to what `ccache` does and `scons`? Many large software projects would benefit enormously in required build-disk- space and -time if this was present in, say GCC.


title: Is it okay for programmers to be given the task of outlining database requirements?

text: In my current job, dba's and programmers are divided in tasks. Any code that needs to be written in procedures dba's write, and programmers do only application code. The strange thing is that whenever a task needs to be defined/specced, programmers get the task, and we have to define all the procedures needed and what they should return. Is this a common practice in software development? Are programmers generally the ones tasked with building requirements for the database side?


title: Task-based authorization for user stories

text: My understanding is that the first step of defining user stories is to define roles. The problem with role-based systems is that this form of authorization is often too coarse-grained. Hence, people created task-based authorization where roles are still used to lump tasks into groups (see for example rhino security . At least that's my understanding. How do I write user stories for task based authorization? Any feedback would be very much appreciated. Many thanks!


title: Is it possible to offer an affiliate program for your iOS or Android app?

text: Independent of the App Store or Google Play, is there a way to track where new downloads or paying customers came from? For example, if an app advertises my app in theirs - is there a way for me to find out which users actually downloaded it? And then pay that app owner a commission? On the web this is done via a tracking URL which places a cookie on a users machine. If they signup within a designated timeframe, they are 'tracked to' whomever had their affiliate code in the URL they clicked and that person would receive commissions. How could this be done with native mobile apps, while not violating Apple/Google rules?


title: What do you call one element in an enumeration?

text: The following C# code defines an enumeration.               enum MyEnum             {                 alpha,                 beta,                 gamma,                 delta             }      As a whole it is called an enumeration. What do you call each item? For example, what do you call the object that is beta?


title: Integration testing in en example - confused

text: I know that integration testing means integrating unit tested moduls and testing for interface errors etc. But in real world examples, I am kinda lost. Here is an example of our system: Back end (Java).   Front end (Flex). Back end is processind data heavily and we have a lot of tests for weekly automated regression. But is it a system test? I think so, but on the other hand, it is just back end part testing. Or should I say it is system testing only when UI part is involved as well? But again, with testing UI we cannot test the logic in data processing.


title: Node.JS or Scala for mobile and web apps

text: I am coming from a php background with some python as well. I want to start working on a different language for both web and mobile development. I am also interested in real time apps dealing with games. I am looking at node.js because I can use tools like titanium and/or phone gap to have my apps ported and compiled to native java code, or in a way that makes it runnable on mobile (web views). I like this path because I can use existing JS knowledge to build apps. I am also looking at scala. I have done some C# as well as tinkered with Java about 5 years ago. And I do like that I can use scala to make native android apps. But unlike node/js which can be made to also work on other mobile os's, this only works on android. In a way, that doesn't really bother me. But scala seems like it would have much better performance for gaming that JS compiled to android. But I do not know how well. Ine the end I want to focus on socket and REST based web apps for API's that users can have access to, as well as some mobile development. I want to get towards games and interactive apps. The question is, what features of Scala would benefit me over the node/js side of things for making real time applications on web or mobile? I was looking at using frameworks like lift or play for web. Node also makes real time easy with socket.io and node handles much of that in the background. This is why I think node could be a great choice. So I was hoping someone could give some insight on features in Node, that would have some benefit over scala. I don't really want to hear 'this is better cause its webscale or related things. I was hoping for more facts about features that would benefit what I want to do. I already understand why node is good. I just dont know much of anything about scala. Or how they may compare for what I want to accomplish.


title: Database Facade to wrap our existing queries?

text: We have a very big application written in C++ using the MFC framework (millions of code lines). No need to say that it's a legacy system, but it's also heavily maintained and updated. This application lacks a lot of architecture. For example, we have a lot of classes that do queries directly to the database, which creates a lot of difficulty for unit testing. I have read the book Working Effectively With Legacy Code, and one of the most important things to do first is to create some kind of architecture so we can separate the GUI from the logic and from the database. My idea to go towards this is to create something like a database facade. There will be 2 goals for this:   1. Encapsulate all the calls to the database behind this facade.   2. Be able to test the facade in batch to detect errors in the SQL very fast. The database facade itself will be implementing an IDatabaseXXXX interface so it could be easily mocked in the unit tests. The second goal will be to be able to run all the functions in the facade in batch to test if there are errors in the SQL queries. I don't count them as unit tests and would be running them only once per day. My main concern about doing this is that I don't know if there is an existing framework or library to take care of this abstraction. As far as I know, there are some on other platforms like .NET, but it seems that for C++ or MFC, there are not a lot of options. Like I said, the application is very big and the change will be done slowly, mostly when new queries are added to the software. I think it is a good thing to add that we also have a LOT of recordsets (one for almost each object). For the moment, I don't know how to deal with them, so I kept them on the side and decided to deal with the regular SQL queries. But if you have suggestions to deal with recordsets, I will be glad to hear them. So my main question is: Is this whole idea of database facade worth trying? Is there any library of framework to help me in this adventure? If there are C++/MFC programmers out there, how do you deal with the abstraction of the query to the database? Thanks! _**EDIT_** Some people on the chat suggest looking up at repository pattern which I knew from the world of MVC 3. Any suggestion or tutorial about the repository pattern in C++? Most of what I found is in the .NET world.


title: How to insert a database layer in PHP

text: I maintain and add features on a freelance basis to a website written in PHP. The application was started in PHP4 by a junior programmer back in 2006, and features some very insecure and unmaintainable ways of doing things, which I am trying to correct as time goes on. If the client agrees, one of the first things I would like to do is add in a proper database layer of some sort. The current database access looks like this:               if (!function_exists('my_query')) {     function my_query($query) {              if ($query=='disabled') return false;              global $last_insert_id,$dbconn,$dbase;                   $result=mysql_query($query,$dbconn) or die('ERROR: '.mysql_error($dbconn).'<br />'.$query);         $last_insert_id=mysql_insert_id($dbconn);         return $result;     }     }      There is also a function to make arrays from the data returned.               if (!function_exists('spawnarray')) {     function spawnarray($result)     {         $i = 0;         if ($result != "") {             if (mysql_num_rows($result) > 0) {                 while($result_obj[$i] = mysql_fetch_object($result)) {                     $sp_result[$i]=$result_obj[$i];                     $i++;                 }                 return $sp_result;             }         }     }     }      These two functions are basically the database layer, and SQL queries are constructed on the fly for them all over the place. So my question is, how can I start to introduce database abstraction in to the mix? I would like to move to PDO for security and ease of use reasons, but maybe there is a better way to go? I have already moved the project to Composer for some of its dependencies (Some are dead projects, which is a different issue) so maybe an ORM like Doctrine would be the way to go? That might mean moving the website to OOP in one go though: a daunting prospect, and a sure no-go from the client.


title: Optimize database interaction through VPN

text: I have to develop a batch procedure with VB.NET. This simple procedure is going to read some data from a MS SQL database, execute some elaborations and the write the results on another Oracle SQL database located to a remote network reached via VPN. The VPN is "always on", we do not need a client to manage the connection because it is created firewall-by-firewall. The data that I have to write are atomic, so I have to use a transaction. Can you tell me what happen if the VPN connection fall down when a transaction is open and the COMMIT was not executed? Do you have some suggestion/best practice to follow to avoid this scenario?


title: Should I use a list or an array?

text: I'm working on a windows form to calculate UPC for item numbers. I successfully create one that will handle one item number/UPC at a time, now I want to expand and do it for multiple item numbers/UPCs. I have started and tried using a list, but I keep getting stuck. I created a helper class:               public class Codes     {         private string incrementedNumber;         private string checkDigit;         private string wholeNumber;         private string wholeCodeNumber;         private string itemNumber;              public Codes(string itemNumber, string incrementedNumber, string checkDigit, string wholeNumber, string wholeCodeNumber)         {             this.incrementedNumber = incrementedNumber;             this.checkDigit = checkDigit;             this.wholeNumber = wholeNumber;             this.wholeCodeNumber = wholeCodeNumber;             this.itemNumber = itemNumber;         }              public string ItemNumber         {             get { return itemNumber; }             set { itemNumber = value; }         }              public string IncrementedNumber         {              get { return incrementedNumber; }             set { incrementedNumber = value; }          }              public string CheckDigit         {             get { return checkDigit; }             set { checkDigit = value; }         }              public string WholeNumber         {             get { return wholeNumber; }             set { wholeNumber = value; }         }              public string WholeCodeNumber         {             get { return wholeCodeNumber; }             set { wholeCodeNumber = value; }         }          }      Then I got started on my code, but the issue is that the process is incremental, meaning I get the item number from a gridview via checkboxes and put them in the list. Then I get the last UPC from the database, strip the checkdigit, then increment the number by one and put it in the list. Then I calculate the checkdigit for the new number and put that in the list. And here I already get an Out of Memory Exception. Here is the code I have so far:               List<Codes> ItemNumberList = new List<Codes>();                   private void buttonSearch2_Click(object sender, EventArgs e)         {             //Fill the datasets             this.immasterTableAdapter.FillByWildcard(this.alereDataSet.immaster, (textBox5.Text));             this.upccodeTableAdapter.FillByWildcard(this.hangtagDataSet.upccode, (textBox5.Text));             this.uPCTableAdapter.Fill(this.uPCDataSet.UPC);             string searchFor = textBox5.Text;             int results = 0;             DataRow[] returnedRows;             returnedRows = uPCDataSet.Tables["UPC"].Select("ItemNumber = '" + searchFor + "2'");             results = returnedRows.Length;             if (results > 0)             {                 MessageBox.Show("This item number already exists!");                 textBox5.Clear();                 //clearGrids();             }             else             {                 //textBox4.Text = dataGridView1.Rows[0].Cells[1].Value.ToString();                 MessageBox.Show("Item number is unique.");             }         }              public void checkMarks()         {                  for (int i = 0; i < dataGridView7.Rows.Count; i++)             {                 if ((bool)dataGridView7.Rows[i].Cells[3].FormattedValue)                 {                     {                         ItemNumberList.Add(new Codes(dataGridView7.Rows[i].Cells[0].Value.ToString(), "", "", "", ""));                     }                 }             }         }              public void multiValue1()         {             _value = uPCDataSet.UPC.Rows[uPCDataSet.UPC.Rows.Count - 1]["UPCNumber"].ToString();//get last UPC from database             _UPCNumber = _value.Substring(0, 11);//strip out the check-digit             _UPCNumberInc = Convert.ToInt64(_UPCNumber);//convert the value to a number                  for (int i = 0; i < ItemNumberList.Count; i++)             {                 _UPCNumberInc = _UPCNumberInc + 1;                 _UPCNumberIncrement = Convert.ToString(_UPCNumberInc);//assign the incremented value to a new variable                 ItemNumberList.Add(new Codes("", _UPCNumberIncrement, "", "", ""));//**here I get the OutOfMemoreyException**             }                  for (int i = 0; i < ItemNumberList.Count; i++)             {                 long chkDigitOdd;                 long chkDigitEven;                 long chkDigitSubtotal;                 chkDigitOdd = Convert.ToInt64(_UPCNumberIncrement.Substring(0, 1)) + Convert.ToInt64(_UPCNumberIncrement.Substring(2, 1)) + Convert.ToInt64(_UPCNumberIncrement.Substring(4, 1)) + Convert.ToInt64(_UPCNumberIncrement.Substring(6, 1)) + Convert.ToInt64(_UPCNumberIncrement.Substring(8, 1)) + Convert.ToInt64(_UPCNumberIncrement.Substring(10, 1));                 chkDigitOdd = (3 * chkDigitOdd);                 chkDigitEven = Convert.ToInt64(_UPCNumberIncrement.Substring(1, 1)) + Convert.ToInt64(_UPCNumberIncrement.Substring(3, 1)) + Convert.ToInt64(_UPCNumberIncrement.Substring(5, 1)) + Convert.ToInt64(_UPCNumberIncrement.Substring(7, 1)) + Convert.ToInt64(_UPCNumberIncrement.Substring(9, 1));                 chkDigitSubtotal = (300 - (chkDigitEven + chkDigitOdd));                 _chkDigit = chkDigitSubtotal.ToString();                 _chkDigit = _chkDigit.Substring(_chkDigit.Length - 1, 1);                 ItemNumberList.Add(new Codes("", "",_chkDigit, "", ""));             }      Is this the right way to go about it, using a list, or should I be looking at a different way?


title: Geographically Distributed (Data & App) Architecture

text: Is there any design patterns (or best practices) for implementing a geographically distributed system (mostly a database)? Description: There is a network of warehouses and a central office. Now I want every warehouse replicates it's data to the central office and the central office replicates just that portion of data related to that warehouse (when it's modified). This I can call a "filtered replication". Our database here is SQL Server 2008 R2. Should I go with another database? How about NoSQL databases? This is a .NET based solution. So far I have learnt about Web Synchronization for Merge Replication and I am investigating it; but I did not learnt how to implement filtered replication yet. I am not sure how NoSQL fits for an e-commerce problem (I think I need to use a combination of NoSQL+RDBMS if I should go that way) but I am investigating RavenDB and MongoDB. Any insight would help a lot; Thanks;


title: "Anything can go wrong will go wrong" - Murphy's Law. so is it necessary to test all the conditional, exception cases?

text: If "Anything can go wrong will go wrong" is true, we need to test all the conditionals and exceptional cases in my code. But sometimes it's hard to find all of them since many of them are corner cases, which are hard to test. How can I go about finding corner cases better or avoiding the issue?


title: Are there minimum quality standards for .NET applications?

text: Does Microsoft require third party .NET applications to meet any minimum standards for things like application security or code quality?


title: How to visualize code?

text: I've mostly only had to read my own code. As such, I've had no need to visualize the code as I already know how each and every class and module communicate with one another. But the few times I've had to read someone else's code - let us now assume we are talking about at least one larger module which contains several internal classes - I've almost always found myself wishing _"This would have been so much easier to understand if I could just visualize it!"_ **So what are the common methods or tools for enabling this? Which do you use, and why do you prefer them over the others?** I've heard stuff like UML, module and class diagrams, but I imagine there are more. Furthermore, any of these is most likely better than anything I can devise on my own. **EDIT:** For those who answer with "Use pen and paper and just draw it": This isn't very helpful unless you explain this further. What _exactly_ am I supposed to draw? A box for each class? Should I include the public methods? What about its fields? How should I draw connections that explain how one class uses another? What about modules? What if the language isn't object- oriented but functional or logical, or even just imperative (C, for instance)? What about global variables and functions? Is there an already-standardized way of drawing this, or do I need to think up of a method of my own? You get the drift.


title: Why separate class CommandHandler with Handle() instead of handling method in Command itself

text: I have a part of CQRS pattern implemented using S#arp Architecture like this:               public class MyCommand     {         public CustomerId { get; set; }              // some other fields     }          public class MyCommandHandler<MyCommand> : ICommandHandler<MyCommand, CommandResult>     {         Handle(MyCommand command)         {             // some code for saving Customer entity                  return CommandResult.Success;         }     }      I wonder why not just have class `Command` containing both data **and** handling method? Is it a kind of testability benefit, where you need to test command handling logic separately from command properties? Or is it some frequent business requirement, where you need to have one command handled by different implementations of `ICommandHandler<MyCommand, CommandResult>`?


title: When should I start using frameworks?

text: I'm little confused with the motive and need for frameworks. At what stage should I use frameworks? For example, if I want to use some CSS framework, should I learn CSS at pro or advanced level to use it?


title: Solutions for giving feedback to students on their code?

text: I will be a TA for a course that teaches Haskell this semester and the professor and I are trying to come up with a solution that lets us do entirely electronic submissions. We would like students to be able to upload files (we have a system we could use that puts uploaded files into an FTP server) and then receive grading/feedback on those files. Is anybody aware of good solutions for code review that keep the submissions and feedback confidential?


title: When to apply corrections on data gathered from a server

text: I have an program that collects data from other servers. I don’t have access to these servers so I can’t change anything. The servers can give incorrect data, I can solve the problem but I’m a little bit stuck on “when to do the correction”. I download the data from the server, the data gets processed and stored on the hard-drive. When the same data is needed an there is no change, then I use the old data. So this is basically caching. There are 2 places where I could apply the correction.   * When I receive the data from the other servers;   * After I cache the data. So right before I use it. When I apply the correction on the downloaded data directly, then the server doesn’t need to do much calculations. It’s only corrected once. When I apply the correction after I took it from the cache or when isn’t cached after I cache the data. Then I need more CPU power. But this gives me the advantage to access the original data at all time. I could fall back when I made a mistake and apply a correct correction. So the question is, when should I apply the correction? And why should I do it that way.


title: Generic file parser design in Java using the Strategy pattern

text: I am working on a product in which the responsibility of one of the modules is to parse XML files and dump the required content in a database. Even though the present requirement is only to parse XML files, I want to design my parsing module in a fashion that I can support any kind of files in the future. The reason for this approach is that we are building this product for a specific client but plan to sell it to other clients in the near future. All the systems in the ecosystem for the current client produce and consume XML files but this may not be the case for other clients. **What have I tried so far? (The Present)** I have the following design in mind which is based on the Strategy pattern. I have quickly written down the code in eclipse to convey my design so it would be great if other aspects such as proper way of handling exceptions are ignored for now. **Parser :** The strategy interface that exposes a parse method.                public interface Parser<T> {             public T parse(String inputFile);         }      *The reason for using a generic parameter is to allow any return type as well as ensure type safety at compile time. **ProductDataXmlParser** A concrete class for parsing a product.xml file that contains product related information. (using XMLBeans)               public class ProductDataXmlParser implements Parser<ProductDataTYPE> {              public ProductDataTYPE parse(String inputFile) {             ProductDataTYPE productDataDoc = null;                 File inputXMLFile = new File(inputFile);                  try {                 productDataDoc = ProductDataDocument.Factory.parse(inputXMLFile);             } catch(XmlException e) {                 System.out.println("XmlException while parsing file : "+inputXMLFile);             } catch(IOException e) {                       System.out.println("IOException while parsing file : "+inputXMLFile);             }             return productDataDoc.getProductData();         }     }       **where** : ProductDataTYPE and ProductDataDocument are XMlBean POJO classes generated using an xsd and the scomp command. **The future** If I have a product.txt file to be parsed in the future, I can define my own POJO called ProductData that will hold the required contents of the file. I can then create a concrete class called ProductDataFlatFileParser that implements the Parser interface and have the parse method populate the ProductData POJO for me after parsing the file. Does this design make sense? Are there any obvious flaws in this design? As the design stands, I am allowing the concrete classes to define the algorithm to parse a file and letting the concrete class decide where to populate the data. The design seems to be more dependent on the domain objects rather than the file formats. Is this a bad thing? Any inputs on how I can improve my design will be highly appreciated.