title: How to choose a language, when taking in account the community it includes?

text: I was reading the following article: Great Hackers The following part grabbed my attention: > "When you choose a language, you're also choosing a community. The > programmers you'll be able to hire to work on a Java project won't be as > smart as the ones you could get to work on a project written in Python. And > the quality of your hackers probably matters more than the language you > choose. Though, frankly, the fact that good hackers prefer Python to Java > should tell you something about the relative merits of those languages." I would like to apply his advice on a commercial web application I am building (I am a strong believer in culture and community), yet this article was written in 2004, and python has increased in popularity in the recent years. How can I decided a language when taking in consideration its community, rather than the popularity? Any recommendations? Is there any language community that show dedication and passion for developing, rather than learning a language to get a Job and a paycheck?


title: Window Position on Startup

text: Here's a question for me that really makes me wonder every time I start designing and developing a thick-client desktop application. I'm a .NET developer, and with my forms (WinForms mostly, but the platform should be unimportant) I also choose the startup position to be **Center**. The reason I do this is because I can't stand randomness, and as a user myself I don't like when windows jump all over my monitor. So my question for you, is what is the best way to go about this? Center an application startup window or have it randomly placed? And why?


title: Definition of mixing programming idioms?

text: Say I have class that is partially implemented as a static class and partially implemented as a singleton. Besides "kludge" and "code-smell" (imo this is both) is there a more appropriate term for this type of mixing programming idioms?


title: Static Tables vs Dynamic Entity Attributes Storage Configurations

text: I am trying to figure out a better way to decide table storage configurations whether it will use **static configurations using tables** or **dynamic configurations using EAV** (entity-attribute-value) When creating database tables, forms, and reports, when do you decide that a program should use a normal database (wherein everything is statically configured, possibly final) or use entity-attribute-values (wherein all of the data are dynamic and can be customized)? Does it all depend on the client/people using it? Is static-table-customized- programs only applicable for small and medium businesses? and dynamic-eav- customizable-field-programs (like Quickbooks) only for the general public or big businesses wherein they don't want another programmer to tamper again with their software?


title: Why is there no 'subclasses-only' access modifier in Java?

text: In Java, there are four available access modifiers for methods: `public` - any class can use this method. `protected` - classes in the same package and subclasses in any package can use this method. `private` - only this class can use this method. `no modifier` ("package private") - only classes in the same package can use this method. What happens often is that I want to have useful methods in a superclass, that all subclasses can use. But it wouldn't make sense for other classes to access this method, and in a sense it would break encapsulation. So I have to declare these useful methods in the superclass `public` or `protected`, which exposes them to all other classes at least in the package. Even though they're only meant to be used by the subclasses. Is there a reason why there isn't a `subclasses-only` access modifier in Java? It seems very odd to me. Am I missing something? _Also, a`subclasses-only` access modifier would also be useful for when you want to expose variables only to subclasses. Which to me happens a lot._


title: What does a Technology Analyst do at a banking company?

text: I just graduated from college and I got a job as a _Technology Analyst_ in a banking company. I was told that I would be working on .Net or Java. What kind of work will I be doing? What is the need of a programmer in a banking company?


title: How should I program with dynamic typing language even no type is noted on documentation?

text: I lived long time on static typed language world. All types were explicitly noted on each variables and arguments. Now I have to use some kind of dynamic typing language. (Smalltalk) The problem is there is no type noted on any message argument, and even on documentation. So, how can I know what should be passed to the each argument? Why the people didn't note type on message arguments? Really isn't it need?


title: MBA versus MSIS

text: I am considering going back to school for my masters and I've been looking at several avenues I can take. I've been considering either an MBA or an MSIS degree. Overall I know that an MBA is going to give me a solid skill set that can help me become an executive. However they seem to be a dime a dozen these days and the University I can get into is good, but it's not exactly in the top 100 anything. My undergrad MINOR was in Business Information Systems. I'm rusty as hell, considering I haven't touched it, but an MSIS would be more in the direction of my past academic experience and seems to touch both on business management and IT. Question... With an MSIS will I just be a middleman? Will I really be an important person with a real skill set or will I merely be someone who isn't quite cut out to be a manager and who is clueless about the tech side? Is an MSIS degree going to give me a real chance to move up the pay scale quickly or am I better off learning programming, networking through another BS degree? What will give me more upward mobility career wise? An MBA or an MSIS?


title: Gathering all data in single iteration vs using functions for readable code

text: Say I have an array of runners with which I need to find the tallest runner, the fastest runner, and the lightest runner. It seems like the most readable solution would be:               runners = getRunners();     tallestRunner = getTallestRunner(runners);     fastestRunner = getFastestRunner(runners);     lightestRunner = getLightestRunner(runners);      ..where each function iterates over the runners and keeps track of the largest height, greatest speed, and lowest weight. Iterating over the array three times, however, doesn't seem like a very good idea. It would instead be better to do:               int greatestHeght, greatestSpeed, leastWeight;     Runner tallestRunner, fastestRunner, lightestRunner;     for(runner in runners){         if(runner.height > greatestHeight) { greatestHeight = runner.height; tallestRunner = runner; }         if(runner.speed > ...     }      While this isn't too unreadable, it can get messy when there is more logic for each piece of information being extracted in the iteration. What's the middle ground here? How can I use only a single iteration while still keeping the code divided into logical units?


title: clarification about amortized analysis

text: I was going through an article here In the section named Aggregate Method ,the author says > Then summing over the entire sequence, all the 1's sum to O(n), and all the > di also sum to O(n). That is, and then gives this               Σ1≤i≤n ci   ≤   n + Σ0≤j≤m 2j−1      I can understand how summing 1's to get n , But I am not very clear how the second term becomes `Σ0≤j≤m 2j−1` and thereby O(n) Sorry about the formatting..I am not sure how the math notations are to be printed here.. Will you please see the original article ?


title: An ideal way to decode JSON documents in C?

text: Assuming I have an API to consume that uses JSON as a data transmission method, what is an ideal way to decode the JSON returned by each API resource? For example, in Java I'd create a class for each API resource then initiate an object of that class and consume data from it. for example:               class UserJson extends JsonParser     {         public function UserJson(String document) {         /*Initial document parsing goes here...*/         }     //A bunch of getter methods . . . .     }      The probably do something like this:               UserJson userJson = new UserJson(jsonString);//Initial parsing goes in the constructor     String username = userJson.getName();//Parse JSON name property then return it as a String.        Or when using a programming language with associative arrays(i.e., hash table) the decoding process doesn't require creating a class: _(PHP)_               $userJson = json_decode($jsonString);//Decode JSON as key=>value       $username = $userJson['name'];      But, when I'm programming in procedural programming languages (C), I can't go with either method, since C is neither OOP nor supports associative arrays(by default, at least). What is the "correct" method of parsing pre-defined JSON strings(i.e., JSON documents specified by the API provider via examples or documentation)? The method I'm currently using is creating a file for each API resource to parse, the problem with this method is that it's basically a lousy version of the OOP method, as it looks exactly like the OOP method but doesn't provide any OOP benefits(e.g., can't pass an object of the parser, etc.). I've been thinking about encapsulating each API resource parser file in a **publicly accessed** structure(pointing all functions/publicly usable variables to the structure) then accessing the parser file code from within the structure(`parser.parse()`, `parser.getName()`, etc.). As this way looks a bit better than the my current method, it still just a rip off the OOP way, isn't it? Any suggestions for methods to parse JSON documents on procedural programming lanauges? Any comments on the methods I'm _currently_ using(either 3 of them)?


title: Examples of Finite State Machines

text: I'm looking for good examples of finite state machines, language isn't particularly important, just good examples. Code implementations are useful (generalized pseudo-code), but it's also very useful to gather the various uses of FSM's. Examples don't necessarily need to be computer based, for example Mike Dunlavey's Railroad networks example, is very useful.


title: Why do programmers use `Acme` as a package, namespace or directory name

text: This may or may not be a silly question, but I really would like to know the answer to something which has been bothering me for a while. I quite often see programming examples/conventions where the programmer has created a directory called `acme` to put stuff in. What does `Acme` mean? Why Acme and not Emca or other? Is Acme like a generic folder name to group miscellaneous OOP classes? Where did the term come from in terms of the programming convention. As far as I can see, it has nothing to do with a programmer UI http://plan9.bell- labs.com/sys/doc/acme.html


title: One Event Sent to Multiple Listeners, Want to Log Notification Once

text: ![System Layout](http://i.stack.imgur.com/jc40i.png) I have a system in place where a Cache is made up of many Cache Nodes. When one is added, a CacheNodeAdded event is raised by the Cache. The Cache has a redundant set of Monitors listening for this event. Monitors are responsible for notifying on Cache events. Since I have multiple Monitors, but only want to be notified once, **Step 3** is what I am looking to implement. Solutions I can't use:   * Cache notifying directly. Monitors must be used.   * Have each Monitor check the log to see if the notification has been sent. Since they all run separately, they could all access the list of notifications at the same time, see the notification hasn't been sent, and notify multiple times as a result. Solution I'm toying with:   * When event is received, get a list of all Monitor IDs (GUID), order the list, and the first Monitor in the list gets to send the notification. This is a simple solution but it seems a little inelegant. Are there any other simple solutions that I may be overlooking?


title: Are project managers useful in Scrum?

text: There are three roles defined in Scrum: Team, Product Owner and Scrum Master. There is no project manager, instead the **project manager job is spread across the three roles**. For instance:   * **The Scrum Master:** Responsible for the process. Removes impediments.   * **The Product Owner:** Manages and prioritizes the list of work to be done to maximize ROI. Represents all interested parties (customers, stakeholders).   * **The Team:** Self manage its work by estimating and distributing it among themselves. Responsible for meeting their own commitments. So in Scrum, there is no longer a single person responsible for project success. There is no command-and-control structure in place. That seems to baffle a lot of people, specifically those not used to agile methods, and of course, PM's. I'm really interested in this and what your experiences are, as I think this is one of the things that can make or break a Scrum implementation. _**Do you agree with Scrum that a project manager is not needed? Do you think such a role is still required? Why?_**


title: How to evaluate Secure Authorization for server to client

text: I have a customer that wants me to build a web portal (Asp.net 4.0) that will communicate with a desktop client, tablet and/or smart phone (e.g. iOS and/or Android). I was thinking of using oAuth 2.0. But I'm not familiar with any potential cons to using OAuth. And I don't know how to compare OAuth to other Secure Authorization method/protocols that would be appropriate for this situation. How should I evaluate OAuth to see if it's right for my project or if I should use a different protocol?


title: How do you evaluate learning C# from videos for a beginner?

text: I have an idea about programming in general so I know what a variable and a method is but I didn't program before. I liked C# because of Visual Studio and I only tried Hello word program in it. I still don't know much about OOP. Now, I have videos to learn from which I found on (LearnVisualStudio.net). However, I'm not sure about the author of the videos in that site if he is a professional or just a hobbyist because I want someone to teach me with a good practice habits, I want to learn the right way! I also have some books but I found most of them don't explain the principles in a clear way. So they start with a 'hello world' program and after that you find yourself lost with a lot of concepts which are explained randomly. Please let me know if you know anything about the site mentioned above if it is good or not to start with and let me know if learning from videos considered good for learning programming and OOP?


title: How would you architect an application which is largely a collection of flowcharts?

text: I am working with a history teacher on a history app. He has like 200 flowcharts that he wants to put into the app (among other things). The two likeliest-looking ways to do it:   1. HTML/CSS. The big minus here is that neither one of us is a big HTML/CSS person. Though I do know a bit about them.   2. Adobe Illustrator. The interface makes it easy to draw stuff, and we can make vector graphics files and work from those. The drawback is that the text of a box, the graphical box, and the corresponding hyperlink would be different entities, where as if the HTML/CSS is done right, they might all be a single thing. There are some flowchart-drawing websites out there. But the ones I have looked at have some problems:   1. In the ones I have looked at, the HTML is big and messy. We need ours to be short and simple.   2. Often a large amount of JavaScript is involved. We could do that, but it adds to the complexity of our mobile app, as well as the risk of failures. We are starting on iOS but may add other platforms later.


title: Code design: is this specific case of monkeypatching in python acceptable?

text: I'm using python to do some research tasks. I have a class hierarchy for "tools", where each object is an instance of a particular tool. They all share some functionality and have many similarities in their states. Some of these tools can use one of several methods based on the tool object's current state. The specific tool I'm going to ask about actually calls functions from external modules instead of methods written in the class directly. The underlying reason for this is to break up the code into multiple files, i.e. not have any huge monster file that has all the various methods and helper functions those methods use, when all it needs at any given time is a particular very-targeted subset. I.e. when the mode of the tool is "clean_house", I would only functions like "wash_windows", "vacuum_carpet", and "ask_girlfriend_for_help", while when the mode is "do_work", I use functions like "write_code", "debug_code", and "ask_SO_question". The subsets don't intersect in any way, i.e. "write_code" would never call "ask_girlfriend_for_help", etc. Instead of calling these functions from module scope within the class methods, it seems to me that it's a better idea to monkeypatch them to the tool's class, since there are instance methods they need to call that go further up the class hierarchy and modify some (protected) part object's state that is used later in the destructor. I know monkeypatching is often considered poor design or last-resort practice when hot-fixes are in order (Programmer's SE post here), but is it justified in this case? Any alternative code design suggestions?


title: Grouping conceptual algorithms into one class or associate with their object models

text: If I have a number of classes, lets say a variety of buildings of some sort. Each of these buildings have various properties and do some stuff etc Now there is a set of operations I need to do on these buildings that are all conceptually the same. Lets call this conceptual group of operations _Move building effluent_. This functionality is essentially responsible for performing methods based on the information of each Building and then setting properties in other areas of the code as well as setting information on the building itself (can't help the need to set properties in other areas at the moment due to current system design limitations). It's important to note that although these methods are conceptually the same and they set many of the same properties in various classes the way they calculate and get to these values are different (they do share some code however). My question is should I put the code to do this into one class called say _EffluentBuildingDistribution_ or should I put it into each buildings own class with appropriate methods to perform essentially the same code. So either something like:               public class EffluentBuildingDistribution      {         public void DistributeEffluent()         {            // parameters example only            DistributeBuildingHouse(var param1, var param2);            DistributeBuildingDogHouse(var param1, var param2);            DistributeBuildingSecondHouse(var param1, var param2);         }              // and various private methods to help work with the 3 methods some shared         // others not         }      or               public class HouseBuilding    {        public void DistributeEffluent(var param1, var param2)        {           // do stuff        }     }          public class DogHouseBuilding    {        public void DistributeEffluent(var param1, var param2)        {           // do stuff        }     }      Or perhaps neither of these options!. I'm not sure if putting the code on the objects they are working on is the way to go, or putting it in a class that represents conceptually what we are trying to do. This is an example of my current dilemma however it's also a general responsibility question on where to proportion methods and actions etc If it's not specific enough or needs more explanation etc let me know and I'll try to explain more of my issue. EDIT: Due to some understandable confusion with my usage of the term _Structure_ in my example, I since changed it to _Building_. Some of the answers below refer to Structure but they are still valid as I have not changed the core of the question.


title: Easy To Use Collaborative Editing Software?

text: My friend and I usually don't have time to meet up in person to do some real pair programming. Since we want to program together anyway, we turned to the world of collaborative software editing. Sadly, most of the solutions we have tried are either lackluster or don't work at all. Cloud9 (fusion of Mozilla Skywriter, ACE) is tossing errors like there's no tomorrow and makes developing a project impossible. Notepad++'s plugin seems to be broken. CollabEdit allows only for one file at the time. Granted, you can open multiple windows, but that makes editing a bunch of files really, really awkward and clumsy. Is there any online or offline software to enable sane collaborative editing? We tried Skyping with a shared screen, and while it's truer to pair- programming than two people coding at once, we don't want to be limited that way.


title: Python sorted iterable set, modifiable during iteration

text: I am looking for a datastructure to handle cycling through a large number of ordered subroutines, some of which are active, most of which are not. I am thinking I need an implementation of a python set like object which remains ordered when modified, can be easily iterated over (I don't care if an actual for loop works, as long as there is a simple and efficient way to read each element in order). And most notably can be modified while being iterated over. This is to allow an implementation of a very specific form of subroutine program (unfortunately I cannot use the built in subroutine modules as my python program is emulating the behaviour of a legacy system precisely so I need finer control.) Effectively I have a list of subroutines which are referenced by an index number in a dictionary, the subroutines are iterated over in ascending order until the last is reached at which point we return to the lowest number one. However there are a large number of subroutines and only a few at any time will be 'active' and ones which are not active are skipped in the order for running. I considered simply giving each routine an active flag which would be tested before running however the enormous number of potential routines compared to the tiny number of active ones makes this method much to slow. Subroutines are only occasionally activated or deactivated but running them must be very fast. As such I have been looking to keep a list of the keys of the active ones and iterate through that, adding or removing them as they are activated or deactivated but am looking for a reasonably efficient way of maintaining this list. The main two systems which seem feasible to me are blist sorted sets, however I am not sure if they support being modified while iterated over, and using two heapq and shifting the items between them in order, this will definitely support modification at any time but would require a lot more manual work, and would probably be slower. However somebody may have a much better answer than either of those so I will appreciate any ideas on how to achieve this with reasonable efficiency and ideally in a 'pythonic' way, though I can deal with it being a little ugly if it does the job.


title: Is it appropriate to go around your boss to receive an answer? If so how?

text: If you have a project and there are questions that need answered regarding a specific part of it but answers are not coming back to you because of a reason such as: "The project is not in scope and as a side project we are not going to push for answers," is it appropriate to go outside/around your boss to get those answers. If so how? If not why? My situation: In the next month we have a lot of projects slated for our team but currently we have a lot of down time and some side projects that I really want to participate in are coming to a screeching halt because of the lack of answers I have received regarding some of the specifications. My boss won't press for answers because he said since this is a side project we are not "supposed" to really be investing out full efforts into it, however, I go crazy at work with down time unless I find something constructive to do. Ie. learn a new language, take on a side project like this one. How can I elicit the answers I need to start working on this project because chartered projects come up that require my full time and I have to toss this side project off to a student developer? Additionally, how can I do so without pissing off anyone above me?


title: Duplicate code in DCI model and use case

text: I'm just coming in to an application that's already built with a DCI architecture. I've discovered in trying to implement a feature that there is duplicate code in a use case and a model. This is not general utility code, but domain specific code about pulling data back from a service. As I understand DCI right now, I don't see an obvious good way to factor this out so I can call the same code from both places. What is the recommended way to deal with a problem like this in DCI?


title: Looking for a specific type of artificial intelligence

text: I am looking to create a challenging AI project. There is an online card game that allows you to build a deck to play with out of randomly presented cards. You have to choose one each time out of a couple of cards. I want to build an AI that picks the cards as I would pick them myself using my knowledge of the game. My guess is that I would have to create a system that can be trained based on "experience" (taught by training) and adapts its choices based on which previous cards it has already selected. I am looking for the specific name for this type of AI so I can start finding some resources for it or similar projects if you know any.


title: How Challenging is it to Mix Pure JS with CoffeeScript on a Team?

text: I keep running into Senior JS positions where they want CoffeeScript. The reason I don't use CoffeeScript is that my first impression of it was that it puts limitations on JS OOP features that I find valuable. I've seen claims that the two can inter-mix freely but that sounds dubious to me. Should I even bother applying to these positions if CoffeeScript-only is a dealbreaker for me?


title: Is it appropriate to only release the GPL-licensed part of the code as open source?

text: Is it appropriate to release incomplete open-source firmware, or in other words, to release only GPL software but not proprietary software source code? How are non-open-source programs, in compiled firmware for a router/embedded device, allowed with the open-source, Linux-based operating system and other GPL software? For example: If a company releases compiled firmware and source code for a router but only releases the source code for GPL software within the firmware, is it okay, according to the GPL, that the firmware source code would be uncompilable because it is incomplete and is missing the proprietary part of the software?


title: GPL modify code

text: If I take GPL code and modify it, does it have to still be under GPL?


title: Customized Computer Science Degree - What other field would mesh well with computer science?

text: So here's my situation: I have seven years of experience with web development. I can do PHP, MySQL, OOP, all of that stuff. I would like to make the argument that I have enough technical experience to go out in the real world and get a well-paying, full-time job if I were to drop out right now (I've had a number of job offers recently, and I have already gotten a lot of actual job experience), but I would like to stay in school and get a degree for a number of reasons ranging from the social aspects to the fact that I just want to have a BS in one thing or another as it seems to be important to have one for a lot of jobs, even when it doesn't have anything to do with the job. With that said, it makes little sense for me to major in Computer Science, because that would be like studying everything I already know. I don't want to major in something COMPLETELY different, because that would be contrary to my career goals. I am considering trying to find some interdisciplinary, customized degree of sorts that allows me to combine my current skills with a new education. I'm thinking maybe buisness or even psychology (interface design?). Could I get some ideas for what to major in and tips on who I might talk to? Thanks!


title: Is Information Technology really Engineering?

text: While travelling I met a mathematician who was sitting near me. In a discussion he said: "... _there is nothing like engineering in IT or rather programming_ ". A true engineering is what Architecture is, what Electrical and Mechanical is. It made me think and I was puzzled. A percent of my brain agreed also because in Indian Army, there is no subject like Computer Engineering in the Engineering Corps. They don't consider programming as engineering. This is what I heard few years back, I don't know what Indian Army thinks now. What are your views?


title: Will SRS be sufficient enough for the programmers to do their work, without the additional overhead of FS?

text: We always make 2 documents the SRS (Software Requirement Specification) and the FS (Functional Specifications) documents for the coders aka programmers. As I have examined the SRS is more like containing both functional and non- functional requirements as compared to the FS that deals only with the functional requirements. To cut it short will the SRS be sufficient enough for the programmers to do their work? and not make any FS anymore?


title: Why does Java use UTF-16 for internal string representation?

text: I would imagine the reason was fast, array like access to the character at index, but some characters won't fit into 16 bits, so it wouldn't work... So if you have to handle special cases anyways, why not just use UTF-8?


title: creating object parameters in {}?

text: I am trying to decode a piece of code from a book:               List<Person> people = new List<Person>()     {     new Person {FirstName="Homer",LastName="Simpson",Age=47},     new Person {FirstName="Marge",LastName="Simpson",Age=45}     };      Person is just a simple class they made, with a bunch of fields: Name, Last Name, etc... What I don't understand is, don't we send parameters to a constructor of Person in non-curly brackets? I tried replicating this code, but it doesn't seem to fly, any takers? Thanks for input.


title: Good example of a properly unit tested PHP project?

text: In hopes of getting myself and my coworkers to adopt automated unit testing methods in future projects, I would like to see a proper example on how it's done. Simple introductionary lessons to unit testing only cover very basic examples and they don't seem to convince anyone of the benefits unit testing can offer. What are some open source projects written in PHP that come with an extensive array of unit tests that are done "properly", and can be used as an example of how testing should be done?


title: What are the advantages of using bitwise operations?

text: Following reading the latest CodeProject newsletter, I came across this article on bitwise operations. It makes for interesting reading, and I can certainly see the benefit of checking if an integer is even or odd, but testing if the n-th bit is set? What can possibly be the advantages of this?


title: Is it worth writing a memory error detection tool for C++ these days?

text: For past 2 years, I have been writing a tool in C++, meant for C++ as my hobby project. Slowly, I realized that it can be made commercialized, as it can compete with other memory leak detectors. This tool finds:   * all kind of memory leaks   * null pointer exception   * corrupt heap   * static/dynamic array out of range   * multiple or invalid deallocations   * It also gives real time code flow, i.e. what functions are called (without any debug statements) I have written a parser (which also parses the complex syntax of template also) which replaces all the pointers in the code with my custom made smart pointers and new/delete with my wrappers. With making some primary tests, this tool seems to work fine. I still continue to work on it to complete the remaining 20%. However, I am just wondering whether will it be a good idea to work on it ? Now a days, so many programming techniques have been developed to overcome such errors. People simply don't use raw pointers (while most of the errors occur due to pointers). This kind of thoughts, sort of demoralize me. Would highly appreciate some expert opinions.


title: Should shopping carts be secure via SSL/TLS

text: So, pretty straight forward question. Somebody told me that all shopping carts should be secure. I can see in some instances where this would be beneficial... but all instances? I realize that typically carts are stored on the server via a session, but in the end the details of the cart have to be sent to the user so they can see what is in their cart. This is very difficult to google because all that comes up is ads for commercial shopping carts. Question: Is it a standard/typical to secure all shopping carts? (pages which display the shopping cart)


title: AVL Trees and the REAL world

text: in school we are taught how we can balance an AVL tree upon an insertion or deleting. How is this type of knowledge actually going to be useful in the real world? Can someone give an example on when this type of knowledge would actually be useful? From what I have seen, in the workplace such details hardly ever come up... I can see how detailed knowledge about algorithms and some data structures can be important but not such details as AVL tree rotations (and similar detailed concepts). thanks!


title: Front-End Business Rules / JSON

text: I am working on a project that now needs business rules. One design discussed is to make API calls (based on the form we are on) which responds with business rules for form input. I am unsure if this is the best way. The business rules are in JSON, but the business rules server actually has a business rules engine (so the engine crunches the rules and spits out JSON). Some background: In our web app, various forms exist, such as for logging in, registering, editing a profile, etc. Maybe 25-30 forms. They are content managed. For any of these forms, various rules exist to show or hide fields, or present error messages on the form based on logic such as a field name being too long, too short, or not meeting a regular expression. Other things such as required field validators, etc, exist. The idea was to have everything centralized in a different environment (as mentioned above...on the business rules server). I am concerned about making so many calls to a server to get simple rules like a first name being required, or showing or hiding a button based on if a person sells a certain number of widgets, etc. Perhaps a better solution would be to have this rules engine publish to our server, and we just call the local server rather than make API calls from the front end each time. What does everyone think? Is it natural to make API calls from our .net forms (using jquery) to get our rules for each form, each time? Thanks!


title: Object-Oriented Object Transformations

text: At my company, we are considering rewriting our business logic and database to have a better architecture after years of organic and unforeseen growth, leading to the inevitable maintenance nightmare. The business model is one where a, let's say, cookie flows through multiple steps, changing states along the way. It is received raw, gets cooked, and is potentially split into two or more smaller cookies depending on the order. At this point, one of two things could happen: one, the cookie or cookies are considered finished and sent out to the customer, or two, the cookies requires outside processing (adding icing, adding food coloring, cutting to a design (there is no theoretical limit to an outside processing change to a cookie but it always changes the physical properties)), from which it is sent straight to the customer or back to us for shipment. The customer can reject the cookies if they don't find them to their standards, and we can then store and attempt to resell the cookies to a less discerning customer and/or send them to outside processing again as per the customer's whim. The way our system currently works is initially assigning it a Raw Cookie number, then baking and/or cutting it and assigning the resulting cookie(s) a Finished Cookie number, one for each cookie. However, there is no common ground between any types of Cookies, resulting in a lot of extra code. I'm trying to propose an object-oriented approach. I am fresh out of college while my coworkers are close to 30 or more years older than me; they know little about it and some are hesitant to change, so my model has to be pretty solid. I have worked with it academically, but never practically, and especially not when monitoring the form of a flow of a specific object. I may be a bit off in my understanding, but I believe OO is the best choice for this problem. I have a UML diagram showing my proposed class hierarchy. Each kind of cookie that can be instantiated has access to a function that turns it into the next step's cookie. Is this a correct way of doing it? Would it be better to have these toCookie() functions accessed through the static abstract Cookie class? ![](https://www.dropbox.com/s/663zilppijft8uq/cookies.png) Don't worry too much about inherited method placement, I'm just trying to understand how objects transform here.


title: TDD and Version Control

text: I am currently learning about TDD and trying to put it into practice in my personal projects. I have also used version control extensively on many of these projects. I am interested in the interplay of these two tools in a typical work flow, especially when it comes to the maxim to keep commits small. Here are some examples that come to mind:   1. I start a new project and write a simple test to create an as-yet-nonexistent class. Should I commit the test before writing the class even though the test doesn't even compile? Or should I stub out the minimum amount of code that is needed to get the test to compile before committing?   2. I find a bug and write a test to recreate it. Should I commit the failing test or implement the bug fix and then commit? These are the two examples that come immediately to mind. Feel free to provide additional examples in your answer. **Edit:** I made an assumption in both examples that immediately after writing the test I will write code to make the test pass. Another situation might also arise: I work on a project using TDD for several hours without committing. When I finally make commits, I want to break up my work into small chunks. (Git makes this relatively easy even if you want to want to commit only some of the changes in a single file.) This means that my question is as much about as _what_ to commit as it is about _when_ to commit.


title: Quicksort and don't bother?

text: Especially when writing 'standard' (non-HPC) applications, do you consider what sorting algorithm to pick, or just settle with quicksort (which is what most libraries just call sort)? To some extent it may be profitable in specific situations, but on the other hand proper optimization requires some time to analyse the problem and make benchmarks.


title: Unit testing - one test is partly a "superset" of another, is this wrong?

text: Wasn't sure how to phrase that title, sorry! I've just come across this in our code base, and was wondering what the consensus was about how to unit test it: **C#** (-ish, sorry, this is paraphrased from memory)               class DateCalculator     {        public static DateTime CalculateLeadTime(DateTime deliveryDate)        {           //return the result of some determinate calculation involving deliveryDate        }     }          //New example     class OrderController     {         public ActionResult GetLeadTime(WidgetOrder order)         {             var leadTime = DateCalculator.CalculateLeadTime(order.GetDeliveryDate() );             return Json(leadTime.Value.Date.ToString("dd/MM/yyyy") );         }     }          //Old, incorrect example     class OrderService     {        public DateTime GetLeadTime(WidgetOrder order)        {           return DateCalculator.CalculateLeadTime(order.GetDeliveryDate() );        }     }      We've then got two unit tests, one to verify that CalculateLeadTime works (this is very easy, you can put in several test values and predict what comes out), and one that GetLeadtime works (still easy, but...). My question is: what would you test here, and where? It makes sense to me to test CalculateLeadTime in isolation, because it could be a complicated calculation, and it's already a nice small predictable unit. But would you then go on to test some of the same stuff (maybe a single representative input and output?) in your GetLeadTime method? Or would you simply test that _any_ DateTime value is returned, and assume that the calculation is correct because you're testing that somewhere else? Or would you not test the Calculate method on its own, because you know that you're going to test it when you use it, and you don't like the duplication? EDIT: to muddy the waters a bit, I can see the code now, and rather than a Service, the calling class is an MVC Controller, and the Action under scrutiny is an AJAX method so returns the result of the calculation wrapped in JSON. The current test verifies that JSON is returned, but not the contents of it. Does this change anything?


title: what to do when UX asks for an ugly, convoluted event driven design and you don't know how to implement it in a clean manner?

text: I have been tasked with creating a desktop client application that fetches data from web apis and presents it to the user. During the last month or so, I've spent most of my time and energy bringing to life the functionality that UX described with two pictures. Looking at the pictures, it seems like a simple design. There are only 4 controls: One drop down list that fires a selection event. Another drop down list that is populated based on selected data from the first drop down list and also fires a selection event. Two radio controls that enable or disable the second drop down list. A third drop down list that, depending on which radio button was last selected, is populated with data based on either the first drop down list or the second drop down list. Doesn't seem hard. But then when I actually start implementing this design I find that I don't know, for example, what to do with if the user selects radio button B (which is supposed to enable the second drop down list) but the drop down list has no elements; in that case, do I force the first radio button A to be reselected? Do I display an error message? Do I prompt the user for action? It's these little 'corner' cases that don't necessarily jump at the people who request these designs that make me wonder if I'm in the wrong line of business or if I'm stuck working with people who don't have a clear picture of what they want or don't really know what they want but expect me to fill in the dots without actually doing the UX design myself. UX is about enhancing the user's experience, not the programmer's experience, I get it, but is this the kind of input that programmers are typically expected to receive from UX? Are programmers always expected to fill in the dots, even when the proper behavior hasn't been explicitly stated?


title: Real-time Dataflow Programming

text: ## Background Recently, I have been fascinated about the possibilities of dataflow-based programming approaches - in particular, signal/event-based concepts as realized by functional reactive programming, Boost::Dataflow::Signals, and the like. ## Sample scenario: Consider a car that has four speed sensors, one at each of its tires. Let's simplify things and say that these sensors are analog sensors providing the measured speed at that tire. The car further has individual brakes on the four tires (the actuators) that one can program to break more or less strongly. There is no concrete task, but imagine having to realize things like detecting tires not turning due to aqua-planing, or ABS-support, or or or... In short: you have to evaluate the speed sensor data and control the actuators according to some logic. From a programming point of view, one could think of realizing this via a signal-network of the following sort:               timer ------------\     sensor1/2/3/4 -> logic -> brakes1/2/3/4      (That is, the timer triggers the logic, which takes the latest analog values of the sensors) Like this, the timer can be programmed to trigger in fixed intervals (especially important to ensure the real-time constraints). The advantage of the dataflow-approach here is that the above diagram is directly realized in the code, i.e. you have a logical wiring of signals and just need to provide an implementation that turns your actual hardward sensor's data into a signal (of the corresponding library you are using). When it comes to real-time requirements, the maximal signal path length can also be computed (or at least more easily derived from the source). ## The question Of course, all of this is just an application idea and I am sure several brilliant people have come up with this before. What I am looking for is the follow-up. Are there any hard problems with this scenario which make it unrealizable in practice? Are there experiences from real-world projects on following such a line of thought? Is there even existing literature on this? To make things clearer and more objective, I am looking for an answer that either shows an inherent fault in my line of thinking or provides reference to existing work/literature along with evaluations. Bonus points if real-time constraints are taken into account.


title: Copyright in a database schema using a licenced windows application

text: I work for a company that has bought a licence for a windows client software that allows only 20 running clients per company. I am trying to find a way around this 20 user restriction by programming a PHP web front end that connects to the existing database. This will allow unlimited users to access the database. The problem I have is that the licence states that no CRM type interface is allowed to be used with the package. Since I will not be using the windows binary in any way, what is to stop me from studying the database schema and developing my own front end? I would have thought that a schema that uses common tables, for example, customer addresses, materials, parts, orders etc could not be copyrighted by law otherwise a single company could have a monopoly over it. What makes a database general or distinct enough to warrant copyright? Any thoughts on this?


title: Is it a deal breaker if the HR person asks programming questions during an interview?

text: The title pretty much says it all, but the longer story is: I went to a job interview last year for a junior tester position. The first interview was with a person from HR. This is weird, in my opinion the technical interview should come first. We started talking HR specific stuff and some details about the company/job/etc. Then, out of the blue, she just started asking me very general and easy questions about object-oriented programming. Things like what is a class, what is inheritance, what's the difference between overriding and overloading blabla. Now, maybe it makes business sense to make the people in HR memorize some programming questions and answers in order to screen out completely idiot applicants. However, there are a few important setbacks about this:   * most of the time, the HR person will have absolutely no idea what he/she or the applicant are talking about at that moment. So if the applicant's correct answer differs from the one he/she memorized (which it probably will), then he/she will wrongfully consider (with very high probability) that the applicant has no idea about OOP.   * why not just have a senior developer do phone screening instead ? Seems much more effective (and also cheaper).   * my CV was pretty complete, it contained all my relevant skills and projects. Did he/she even bother read it ? Or, if he/she did read it, does he/she just assume that every applicant is lying on their CV ? In that case, why should I ever bother putting one together and sending it to them ? All this definitely raised some red flags in my mind for the reasons mentioned in the list above. We did not move forward for second and/or 3rd interview (the reason for this is irrelevant), but **is it reasonable to consider this a deal-breaker ?**


title: A good way to share knowledge of a new technology with team members when time is short?

text: We've been having constant requirement changes of having to choose which graphic rendering library to use for our project. In a team of about 10 members, two of us are exploring the new graphic library. The team lead expects that we learn what's necessary within 2 days and introduce it to the rest of the team ( _wants the two of us to give a value-add to the other teams by introducing it to them so they won't be lost_ ). We've told him that 2 days is ridiculous, so he asked us to give him our plan. We've already lost a few months in exploring some other graphic libraries, so the project is behind schedule. The other team members are developing algorithms that will make calls to the graphic library. They'll have to write some code using the graphic library too. In such a situation, what is a good way to share knowledge?   * Have brainstorming sessions everyday for an hour where they tell us their algorithm interfaces and we tell them the graphic library interfaces which they can use?   * Give them a short overview of the skeleton of how their interfaces would fit in with ours and let them figure out the graphic library code for themselves?   * Any other ways?


title: How to maintain a forked git repo with feature branches that upstream won't pull?

text: So here's a typical workflow on Github...   1. Like some project `->` fork it `->` `git clone https://github.com/you/someproject`.   2. Open project. Like what you see, but make some changes.    3. Having been careful to work only in a `feature-branch` (`git checkout -b some-feature`), you decide to make a pull request with the `upstream` maintainer - after having pushed your `feature-branch` to your Github fork.   4. Maintainer, for whatever reason, declines the pull. For example.. here is a failed pull request that I submitted that matches the above scenario... Now _typically_ , if the maintainer _HAD merged_ the pull... the workflow would be simple... On my local machine, I would commit any local changes on whatever `feature-branch` I was on at the time... `git fetch --all`, `git checkout master`, `git pull upstream --ff-only`. Then replay my changes on top of that, as desired... BUT... What if I decide that you want to continue working off the changes to my fork, regrdless... yet still want to be able to track + merge changes that happen `upstream`? Ordinarily, I would delete the feature branch, and go on my way.. How can you maintain a `master` branch that is able to be merged upstream, yet maintains your fork's features while being "permanently detached" from `upstream`'s `HEAD`?


title: Any suggestions how it would be good to promote software in a small company ?

text: Ok, I know if I am Red hat or other giant and offer some support etc. I can be profitable, in fact, Red Hat is doing quite well. However, what about a small company where I create a small program. e.g. an instant messenger for a windows or linux (just as an illustration) and I want to sell it. But how can I sell it if it is free and everybody can download it? Any advice? I like the idea of FSF by Richard Stallman, however I am missing the way how to sell my software under GNU/GPL licence. Any advice, how can I solve this problem? Any profitable small business software developers around with their opinion? Any links or names of small companies taht I can look at and study their model of business?


title: What to call requirements that are "assumed"/"invisible"/"very obvious"

text: I'm looking for an umbrella term for all the nitty-gritty requirements that it's helpful to have specified up front but which the client never thinks about in his excitement about the product. In the client's mind, they think of the headline requirements, the main user stories such as "I need to be able to view the status of all equipment" and "I need to receive automatically any notification equipment failure". But at times the mundane ones are there but the client never mentions them until the result differs from his unspoken expectations: "Well _of course_ a user must be able to change his own password" and " _Of course_ the user's session must time out after 30 mins" Any development team can anticipate what's likely to be needed but is there a name for this category of requirements? Obvious/infrastructural/boring/details?


title: Animation in Swing

text: I have a project written using Swing, and I want to make it more smoothly (like JavaFX is) by adding animation to some components(`JButton`, `JScrollPane`, `JSplitPane`) using `javax.swing.Timer`. **UPD:** That is not a game. I want to use the Timer for short animations like mouseHover events or dropdown, or scroll. But the problem is, a lot of Timer objects should be created. **Question:** What action does it perform for JVM? I would start and stop a lot of Timers during app session.


title: What are the key factors in choosing a Mocking Framework?

text: I'm looking to get started with objects in my unit tests. It seems there are tons of good mocking frameworks out there.   1. Do the different frameworks have different target audiences?    2. What factors should I consider when choosing which framework is right for my situation?


title: Are there any concerns with one user mapping a TFS project to two directories?

text: I'm planning to map some of my TFS projects to two different directories as discussed here. I'll be using two different workspaces, both with the same Computer and the same Owner. Is there any reason why this would be a bad idea? Are there any complications with merging or locks that one user with two mappings would run into, that are different from the normal complications that two users checking out a project run into? Basically, I want to keep all of my projects on a shared drive, all mapped to TFS, but then have additional second local mappings for the few projects I'm most actively working so that Visual Studio is faster. I'm using VS 2010 with the TFS Power Tools Extension.


title: I need to create an employee schedule/appointments program, but I don't know how to set it up

text: I work for a gym. I am the programmer, its just me, nobody else! Gets really frustrating when there's nobody to bounce conceptual ideas off of. I'm getting rid of our archaic paper binder systems for tracking appointments and what not. I've made a lot of things successfully already, now I'm trying to tackle the personal training department. What I want:   * Trainer information and work schedule   * Appointment booking that can be done by time slot with all available trainers for that time, or by trainer with all available hours for that trainer What I've tried so far:   * I started with an 'appointments' database, a 'trainers' database, and a 'schedules' database. This became so complicated trying to fit the schedule in that I scrapped it. Does anyone know know the best way to structure the tables for this and how to sort of make them communicate correctly? I don't need specific code, I just need help understand _how_ to make this thing!


title: How can I convince my managers to enforce documentation standards?

text: I'm trying to convince another group in my company— that's about to hand code off to my group—that they need to provide more documentation in their source code, but they're treating it as a "nice to have". In my view, it's a necessity. Of course, I also support intuitive naming conventions, but I think I'll have less difficulty getting the original authors to add comments than I would getting them to rename their functions and variables. I've run a source code analysis tool and it's showing about 10% comment line, but looking at the source code, most of that is coming from entire functions that the author has commented out. How can I convince my managers to enforce documentation standards on this other team? Have there been studies or work done to prove that code documentation increases profitability or productivity?


title: Redex and reduction strategies

text: I'm studying Types and Programming Languages, and have some trouble getting my head around the concepts of the 5th chapter, _The Untyped Lambda Calculus_. Specifically, _redex_ , _reduction_ and the various evaluation strategies are doing my head in. The following is what I understand put into my own words, in an attempt to explain things to myself and get more knowledgeable people to correct my mistakes / imprecisions. I am honestly unsure as to whether this is an acceptable format for stackexchange, and am open to suggestions to make this a better fit. Note that others have tried to answer a very similar question, but have still left me confused:   * Call by value in the lambda calculus   * Untyped lambda calculus: Why is call-by-value strict? ## Redex If my understanding is correct, a _redex_ is a reducible expression, that is, the application of a lambda term to a lambda abstraction. Or, more concretely, a redex is always of the form `(λx.s)t`. ## Redex reduction Reducing `(λx.s)t` is done by replacing all free occurrences of `x` in `s` by `t`. For example:               (λx.x + 2) 1     → 1 + 2     → 3      The process of reducing a lambda expression to its normal form is driven by an evaluation strategy: an algorithm for picking which redex to reduce first. In order to describe these however, we need some more vocabulary. ## Redex qualifications ### Leftmost and rightmost   * the _leftmost redex_ is the one whose abstraction is textually to the left of all other redexes.   * the _rightmost redex_ is the one whose abstraction is textually to the right of all other redexes. So, for example, in `(λx.x + 2) (λy.y + 1)`, we have:   * leftmost redex: `λx.x + 2`   * rightmost redex: `λy.y + 1` There can only be one leftmost and one rightmost redex in a given expression. I'm assuming that in an expression composed of a single redex, that redex is both the leftmost and the rightmost. ### Innermost and outermost   * an _innermost redex_ is one that contains no other redex.   * an _outermost redex_ is one that is contained within no other redex. So, for example, in `(λx.(λy.y + 1) x) 2`, we have:   * innermost: `λy.y + 1`, as it contains no other redex.   * outermost: `λx.[...]`, as it isn't contained in any other redex. I'm assuming that in an expression composed of a single redex, that redex is both outermost and innermost. ## Evaluation strategies Having defined this, we can talk about the two evaluation strategies that I'm struggling with: _call by name_ and _call by value_. ### Call by name In _call by name_ , the leftmost outermost redex is always picked for reduction. Additionally, no reduction can occur within a lambda abstraction. The example given by _Types and Programming Languages_ is:               id (id (λz. id z)) # the leftmost, outermost redex is the very first id     → id (λz. id z)    # the leftmost, outermost redex is still the first id     → λz. id z         # there is no outermost redex remaining, we're done.      I do not understand the need for the definition of the strategy to include _no reduction can occur within a lambda abstraction_ : is that not implied by the fact that only outermost redexes are eligible for reduction? ### Call by value In _call by value_ the rightmost outermost redex is always picked for reduction. The example given by _Types and Programming Languages_ is:               id (id (λz. id z)) # the rightmost, outermost redex is the second id     → id (λz. id z)    # the rightmost, outermost redex is the first id                        # (it's textualy on the left, but there is no redex to its right)     → λz. id z         # the only remaining redex is not outermost (it's contained within                        # an abstraction) and cannot be reduced.


title: Is there a correlation between complexity and reachability?

text: I've been studying cyclomatic complexity (McCabe) and reachability of software at uni recently. Today my lecturer said that there's no correlation between the two metrics, but is this really the case? I'd think there would definitely be _some_ correlation, as less complex programs (from the scant few we've looked at) seem to have 'better' results in terms of reachability. Does anyone know of any attempt to look at the two metrics together, and if not, what would be a good place to find data on both complexity and reachability for a large(ish) number of programs?


title: How to sell Agile development to (waterfall) clients

text: Our development shop would really like to do more agile projects but we have a problem getting clients on board. Many clients want a budget and a deadline. It's hard to sell a client on an agile project when our competitors do come up with waterfall-based fixed deadlines and fixed prices. We know their fixed numbers are bad, but the client doesn't know that. So, we end up looking bad to the client because we can't fix the price or a deadline but our competitors can. So, how can you get your sales force to successfully sell a project that uses agile development methods, or a product that is developed using such methods? All the information I found seems to focus on project management and developers.


title: What are the basic skills a beginner JavaScript programmer should have?

text: In NYC, we are working on creating a collaborative community programming environment and trying to segment out software engineers into differing buckets. At present, we are trying to define:   * Beginners   * Intermediates   * Advanced   * Experts (and/or Masters) Similar to an apprenticeship, you would need to demonstrate specific skills to achieve different levels. Right now, we have identified beginner programming skills as:   * Object - method, attributes, inheritance   * Variable - math, string, array, boolean - all are objects   * Basic arithmetic functions - precedence of functions   * String manipulation   * Looping - flow control   * Conditionals - boolean algebra This is a first attempt, and it is a challenge since we know the natural tension between programming and software engineering. How would you create such a skills-based ranking for JavaScript in this manner? For example, what would be the beginner JavaScript skills that you would need to have to advance to the intermediate training? And so on.


title: Microsoft Certified Solution Developer with .net Framework 4?

text: So I am confused when it comes to the .net framework 4. Is there a Microsoft Certified Solution Developer for .net framework 4? The Visual Studio 2010 Certifications Paths seemms to highlight MCPD 70-519 for one, which does not have pre reqs... Have I gotten it wrong? Is there still Microsoft Certified Solution Developer? and the Microsoft Certified Solution Developer Enterprise?


title: Prerequisites to compiler theory?

text: It's not meant to be subjective or get advice on what would be the best path to take, but an objective list of things that must be known in order for me to pick up a book on compiler theory and understand it. What level of mathematics, and related skills are required?


title: Ruby on Rails - branding

text: I am working on a website, which is to have multiple brands. The core functionality for all brands will be the same, however there will be a number of differences between them. Those differences may appear, obviously, in assets, models, views or settings. One example would be that one brand will have one extra field for one of our models. This means that we need to have an extra database column for this brand only, together with proper validations within the model and modified view. The question is, what would be the best way to implement this? There is a number of ways we can think of, none of them is perfect:   1. Conditionals (previous implementation): at the application start, set the global variable called `BRAND` and then fork our logic depending on that constant. This obviously is not what we are looking for, as it will clutter the code terribly as we are planning to have a large number of brands.   2. Load path precedence (current implementation): We can have one folder with core functionalities and another with brand specific overrides. On the application start we can prepend load paths with brand-specific folder path. This way it will always try to load brand-specific models and fall back onto core if none are defined there. The downside of this approach is that we need to duplicate each file we want to modify for given brand. So if we want to add an extra field to the brand, we need to copy the core view to the brand folder and modify it there. If at any point we would like to change the core view, this change needs to be added to this branded view as well manually.   3. Using git branches (proposed): The core implementation sits on git master branch and each brand occupies its own branch. Then any brand specific changes are committed to underlying brand branch. If we need to modify all the brands, we modify master branch and then we merge this change to all brands. Downside: for a large number of brands merging this change might be quite a long and conflict-prone process Are there any other ways to implement flexible branding for ruby on rails application? I am definitively in favour of the git option - are there any obvious `no-no`s for this solution?


title: How can I limit access for automatically generated files to specific users in a MVC setup?

text: I have a typical MVC based website, and I'd like to give some registered users the abillity to extract data from the database (in a variety of formats). The workflow is very simple:   * User logs in,   * User clicks export,   * A file is generated,   * User downloads the file. I'm trying to figure out a way to secure the last step and limit access to the file. In order for the user to be able to download the file, it should be in a publicly accessible folder. That, however, means that the file is accesible to everyone else that has access to its full url. I thought of a few possible solutions:   1. Email the export file Instead of having the user download the file, I could simply email it to their email (the one they used to register on the site). This seems like a decent option when the export files are small, but I don't think it'll be optimal for larger files.   2. .htaccess magic I could automagically generate an .htaccess in the export dir that would only let the user who requested the export access it. Also a decent option, but it's webserver specific and IP based. I don't know if Apache will always be the webserver of choice for the project, and I'm not sure an IP based solution is actually secure.   3. Store the export file in a private folder and have the user fetch it through ftp Secure, but not particularly user friendly. All my options seem to have problems, and I'm at that point where I'm completely stuck and can't shake the feeling I'm missing something obvious. Am I? Is there a better workflow? I'm more interested in a high level overview than technical details, the project is still in its early days and technical requirements haven't yet stabilized (e.g. we may not use Apache after all). The project is build in PHP, but I don't think that matters (does it?). Thanks.


title: Demoing Project

text: I'm an undergraduate student studying computer science. I have been working at a company as a student researcher and next week I am to demo my complete project to my boss and the other developers. It is the most complex and largest program I have developed. My questions are: What is the most effective way to demo? Are there any good articles concerning this issue? What are key points to show? How do you do demo? I began this project before I knew much of TDD so it was not developed this way. Most of my testing/validation was done as I wrote the program with print statements and myself just verifying results. I will want to prove the program works and based on my testing it is bug free. My only proof really is it does what it should do... This is a little disconcerting for me. Any question answers, comments, suggestions, links and all else greatly appreciated. Thank you!


title: Is it a bad idea to sell Android apps in the Android Market under your real name?

text: I'm just getting started in Android development and am working on a few small "practice" apps. As an example, one is a live wallpaper. The others are similar in terms of development effort. When these apps are done I would like to list them in the market. I may list them for free (or maybe not), and they're simple apps, but if things go smoothly I may try to build and sell larger and more ambitious projects in the future. My question is **is it wise to sell apps in the Android Market under my own name?** Looking around in the market, it seems almost everyone is selling under a company name, even if they're only a 1-2 man shop. I can definitely see the advantage of creating a company to sell my apps if they were big apps involving a team of people. But it seems like overkill to create a company, even if just in name and identity, just to list something like a live wallpaper. On the other hand, I don't want to expose myself to legal liability or other potential problems that I haven't foreseen. What's the best course of action here? For purposes of legal jurisdiction, I am in the United States. I understand that you are not my lawyer and answers are not legal advice. **Edit for clarification:** Just to be clear, what I want to ask is less about the advantages of forming a company, and more about potential dangers of _not_ forming one. In other words, are there likely to be situations where I'm beating myself up and saying "Oh, if only I had formed a company instead of listing this is as a personal project!".


title: What are the negatives of Development Managers as Scrum Masters?

text: It is commonly agreed that team managers should not be scrum masters, but I am struggling to see why. For context, I am an Application Development Manager with 4 devs in a Scrum Team. I come from a Scrum Master background, and have introduced scrum to the organisation. I have built the team from scratch and made it clear that everything I do is to facilitate the team, and that they make the decisions. As a team we are very open - they even silenced me at stand-ups for a while to eliminate the 'reporting' feel we were starting to get. A lack of openness is generally the biggest argument against the manager as scrum master, but handled well, is easily overcome with the right culture. I've been warned by experienced scrum coaches that this is a dangerous situation, and there are risks 'if things go badly'. The way I see it the 2 positions do not conflict, in both roles I have the same aim for the team and individuals. Scrum resolves conflicts within the team, which could traditionally be a managers role. The self-managing nature of sprints takes away the allocation of work a manager would traditionally do. All I really see left to pick up as a dev manager is making sure individuals needs are met, career objectives, workplace etc. I have a weekly catch up with each team member to raise any issues, and handle any admin tasks. A lot of this relates directly to the team, or my role as scrum master anyway. I understand in large organisations how this could be unmanageable and a separate role but for a small organisation we could certainly not justify another Scrum Master or Development Manager. Please enlighten me as to the pitfalls of Development Managers as Scrum Masters, excluding the points I raised above and have already overcome.


title: What the best way to wire up Entity Framework database context (model) to ViewModel in MVVM WPF?

text: As in the question above: What the best way to wire up Entity Framework database model (context) to viewModel in MVVM (WPF)? I am learning MVVM pattern in WPF, alot of examples shows how to implement model to viewModel, but models in that examples are just simple classes, I want to use MVVM together with entity framework model (base first approach). Whats the best way to wire model to viewModel. Thanks for answers.               //ctor of ViewModel      public ViewModel()     {      db = new PackageShipmentDBEntities(); // Entity Framework generated class          ListaZBazy = new ObservableCollection<Pack>(db.Packs.Where(w => w.IsSent == false));      }      This is my usual ctor of ViewModel, think there is a better way, I was reading about repository pattern, not sure if I can adapt this to WPF MVVM


title: Sharing source code of my online game?

text: So one of my long-standing projects is an online fan-game that's been running for a good four years now, and is at least somewhat well-known among the related community. To give you an idea, Alexa ranks my online game higher than the official website for the franchise my game is based on. One thing I've been wondering is, would it be a good idea to make the game's source code publicly viewable? The reasoning for the idea is that this will allow the more programmer- oriented people in the community discover how the game works internally, and research certain features to determine possible outcomes of events, and share this knowledge with other users. For instance, they would be able to discover the exact chances of various treasures appearing in Chests, rather than just having a statistical analysis. Major reasoning against it is "people can copy it", but honestly there are already copycat sites out there and many of them fall flat on their face simply because they try to be my game and either just don't get any attention in the first place, or get called out on being a rip-off by other members of the community. These two points have been like a see-saw in my mind, tipping back and forth between "I should totally do it" and "nowai, src iz myne!" (not really like that :p) So I was hoping that I might be able to get some advice here, perhaps someone else has been through this and might have seasoned advice to offer?


title: Updating GUI in 'realtime' using events

text: My Plan   * Have a system that holds some objects   * Have a winforms-form that displays some key values of these objects   * When certain changes occur(object gets add / removed / datat change): Update GUI My Idea   * subscribe my form to events in the objects   * update form when objects chamge (/raise events) My Troubles   * winforms (for good reasons) does not allow for changes coming from foreign threads   * an eventHandler is in fact run in the thread of the object calling   * hence .net throws an exception and I'm done. Question:   Is there a way to manipulate a form through events not raised by itself? Alternatively:   Is there a way I can "nudge" my form to say "hey, better check your data, there's something new", without having to constantly poll?


title: In C++ is casting to find bad pointers undefined behavior?

text: By accident I found that with a polymorphic type using dynamic_cast back to the derived class will throw a 'bad cast' error if the pointer is no longer valid. Is this undefined behavior or could this be a way to check for valid pointers without using smart pointers? I'm not really against using smart pointers as they serve a real need, but I dislike the syntax. I don't have anything against templated types but I find smart pointers to bloat the code and I'm not a fan of macro's to try and avoid that bloat. I wish C++ included something in the language syntax itself vs using the template feature **but with this question I'm more concerned about what is happening below and if this is a valid and defined way to checking for valid pointers as this gives an exception every time from my tests.**               #include <string>     #include <map>               using namespace std;          class Base     {     public:         virtual ~Base(){}     };          class Derived : public Base     {     public:         virtual ~Derived(){}     };          class Storage     {     private:         map<string, Base*> storage;     public:         void AddItem(string name, Base* base)         {             if (storage.find(name) == storage.end())             {                 storage[name] = base;             }         }              template <class T>         T& FindItem(string name)         {             if (storage.find(name) != storage.end())             {                 Base* item = storage[name];                      return dynamic_cast<T&>(*item);             }                  throw;         }     };          int main()     {         Storage store;              // force 'd' to go out of scope for our test         {             Derived d;                  store.AddItem("test", &d);         }              // this will throw a bad cast exception         Derived& test = store.FindItem<Derived>("test");                   return 0;     }


title: Import data and modify

text: I should build an importer in PHP. So below you can see how it should work or how it currently works. This is only a small example, the real importer is much bigger so the import() method is also very big :(               function import($src, $dest)      {         // Name         if(!$dest->nameFixed()) {             $dest->setName($src->getFirstName() . $src->getLastName());         }              // City         $city = City::searchByName($src->getCity());         if ($city instanceof City) {             $dest->setCityById($city);         } else {             $dest->setCity($src->getCity())         }              // Image         $now = new DateTime();         if ($src->getImage() && $now->diff($src->getBirthdate())->format('%y') >= 18) {             $image = myDowndloader::download($src->getImage());             $dest->setImage($image);         }              // Birthdate         $dest->setBirthdate($src->getBirthdate());         // ...     }      some ideas:               class Translate      {         protected $src  = NULL;         protected $dest = NULL;              public function __construct($src, $dest)          {             $this->src  = $src;             $this->dest = $dest;         }              public function importName()          {             if(!$this->dest->nameFixed()) {                 $this->dest->setName($this->src->getFirstName() . $this->src->getLastName());             }         }              public function importCity() {             $city = City::searchByName($this->src->getCity());             if ($city instanceof City) {                 $this->dest->setCity($city);             } else {                 $this->dest->setCity(City::createByName($this->src->getCity()));             }         }         // ...     }      or a little bit more fancy:               namespace Translate      {              class Abstract          {             protected $src  = NULL;             protected $dest = NULL;                  public function __construct($src, $dest) { ... }             abstract pubilc function import();         }                   class Name extends Abstract          {             public function import()              {                 if(!$this->dest->nameFixed()) {                     $this->dest->setName($this->src->getFirstName() . $this->src->getLastName());                 }             }             // ...         }          }      I'm not really happy with the examples above. The main problem is how to call the methods (1st solution) or create the Objects (2nd solution). One option is to get all methods or classes dynamicly by get_class_methods() and parse the method names for /import\w+/. But I'm not sure how performant this is. The other option is to call the methods staticly but there is also a danger to forgot a method to call...


title: How to implement only a part of an interface

text: When developing in OOP, sometimes an interface / contract is given by a library that you cannot alter. Let's call this interface J. Now you have an object of class A that consumes objects that implements this interface. Inside A only a small part of the interface's definitions are needed. Some of the object classes are created by me during the project (let's call one of them type D), so there's an overhead in the implementation of everything inside interface J. I want to implement a subset of the functionality in interface J, but my solutions so far do not satisfy me:   * implementing every aspect of J and then throwing "notImplementedExceptions" misinforms the user of my objects: it would seem my objects of type D do conform to interface J, but they don't - and other consumers of my objects (that accept objects implementing interface J) can't rely on the integrity of my objects.    * Implementing a newly defined interface prohibits me from using objects that implement only interface J, although interface J is fully compatible with my own interface.   * Letting my custom objects implement interface J would create significant overhead, because they don't need all this functionality. When I was able to alter interface J, I would create a "super-interface" K that had this subset of the functionality of interface J, and make interface J inherit from interface K. But I cannot alter interface J. What is an object-oriented solution to this problem? Is the best solution still implementing "just" interface J? Or are there OOP-ways to "superclass" an interface without altering it?


title: How do we learn BPM products?

text: What are the topics I should learn for a BPM (Business Process Management) product? I mean, do I need to learn BPMN (Business Process Modelling Notation), BPEL (Business Process Excecution Language)? Are there any open source lightweight BPM products by Apache or somebody?


title: Should I continue to perform freelance work for customers who keep on demanding more without paying?

text: So a client comes to me and says it needs some work done. Basically 4 tasks, which I agreed to perform for a certain price. The customer creates the job offer (a fixed time and price job) on ODesk, I accept it, but it took some days and constant reminding for the customer to initiate a contract based on that job. The problem is that the original task has been completed, the contract is still active, I have not been paid yet, the customer says he will pay when the project is completed, and until then, new tasks occur constantly, or changes to older tasks that require full re-doing of elements. For all of this the client promises payment. No updates from this client on ODesk, no new tasks there. I keep reminding the client about sorting out the administrative issues, but with no results. At the same time, the client pushes on continuing work, since the project is soon to be launched. I don't know what to do.   * If I refuse to perform any work without the bureaucracy, the project will be late. But it's not my fault, is it? I am scared that I might receive a negative feedback in this case, or something even worse.   * If I drop out of this project I'm afraid I won't be getting even what I've earned.   * If I continue like this, I'll be wasting a lot of time doing stuff similar to the stuff described here, but as a programmer (yes, it has already come to similar requests, for lots of hardcoded content). How do I communicate with such clients in such situations? How do I avoid a conflict? P.S. The client is a small company. Different people handle different aspects of this project, and everybody introduces their own changes to the original specs. **After 2 years** : Wow! Very question! Much popular!   I decided to let everyone in on the ending of this story. I've confronted the customer, explained that I will not work until I get paid for what I did, and until a hourly contract is open. They paid me the next day and opened a contract. A fruitful, but short collaboration started. Everyone was happy. Except I didn't get any feedback.


title: Why was strict parsing not chosen for HTML?

text: I am pretty much unaware about the detailed computing history that surrounds internet but it has always made me think why strict parsing was not chosen when creating HTML. Browsers accept any rubbish you write and try their best to parse it. The process, if I am not wrong, hinders performance, allows people to write insane markup, and also allows the obsolete features browsers support because of legacy reasons. Is there a specific reason for why HTML is not strictly parsed?


title: What is the most reliable session storage in PHP: Memcache, database or files?

text: What is the best and most safest way to handle PHP sessions. Is the best way to store sessions in:   1. Database (more reliable, but high bottleneck, slow speed, not good for high database usage websites)?   2. Memcache (super fast, but distributed more security problems, chances of loosing data when the server restarted and chances of loosing data when the cache is full)?   3. Files (default option, I guess slow since it reads and writes from file I/O, less security, etc). Which method is the best? What are the problems and good things of each of those approaches?


title: Best Way To Bring C++ Into Objective-C Project

text: For an upcoming XCode iOS project I'm planning on writing my views and view controllers in Objective-C. My model will be provided to me in C++. I am aware of 2 ways of using C++ in an objective-c project. They are described below. What are the pros and cons of each method. Is there any other recommended way, and what are its pros and cons? -In C++ header files, use extern "C" declaration as described in Wikipedia. -Wrapping C++ with an Objective-C++ as described by Rob Napier.


title: Why do browsers leak memory?

text: A colleague and I were speaking about browsers (using a browser control object in a project), and it appears as plain as day that all browsers (Firefox, Chrome, IE, Opera) display the same characteristic or side-effect from their usage and that being 'Leaking Memory'. Can someone explain why that is the case? Surely as with any form of code, there should be proper garbage collection? PS. I've read about some defensive patterns on why this can happen from a developer's perspective. I am aware of an article Crockford wrote on IE; but why is the problem symptomatic of every browser? Thanks


title: How to outsource a pet project?

text: I have a fairly ambitious software development project that I have no time to give. This project is for my personal life and if completed will save me much time and money. I am a software developer by trade but don't have much time to work on this project. So, I am considering outsourcing or contracting out some of the work so I can get it done faster. It's one of those projects where the longer I take to finish it, the more it costs me. I have not outsourced anything and would like to try, what is a good way to get started? What are some risks that I might face?


title: what kind of certificate needed for my application ?

text: I am releasing free C# softwares I've created using Visual Studio. In the future, some of these softwares might become Paid. I was wondering if I need to purchase any kind of license for them ? I understand that it's good to have a certificate for your website (SSL?), if your trying to sell your software but what about your applications ? I just don't want anti-virus/browsers flagging my application as not trusted. Any suggestion is appreciated.


title: How common are "bandage" fixes?

text: Imagine the following scenario: You've detected that your (or someone else's) program has a bug - a function produces the wrong result when given a particular input. You examine the code and can't find anything wrong: it just seem to bog out when given this input. You can now do one of two things: you either examine the code further until you've found the actual cause; or you slap on a bandage by adding an `if` statement checking if the input is this particular input - if it is, return the expected value. To me, applying the bandage would be completely unacceptable. If the code is behaving unexpectingly on this input, what _other_ input that you've missed will it react strangely to? It just doesn't seem like a fix at all - you're just shoveling the problem under the rug. As I wouldn't even consider doing this, I'm surprised at how often the professors and books keep reminding us about how applying "bandage" fixes is not a good idea. So this makes me wonder: just how common are these kinds of "fixes"?


title: Code execution time out occasionally

text: I am working on an e-commerce website. There is a case where I need to fetch the whole data in database through a third-party API and send it to an indexing engine. This third-party API has many functions like getproducts, getproductprice, etc., and each of those functions will return the data in XML format. From there I will take charge, I will use various API calls and will handle the XML data with XSLT. And will write to a CSV file. This file will be uploaded to an Indexing engine. Right now I have details of 8000 products to feed the engine, and almost all time the this process takes about 15 min to complete, and sometimes fails. I can't find a better solution for this. I am thinking about handling the XML data in C# itself and get rid of XSLT. As I think, XSLT is far slower than C#. Is it a good Idea? Or what else I can do to solve this issue?


title: What should you do when presented with a horrible design?

text: Our firm makes websites. We also design websites. But sometimes our client brings his/her own design. This is often made by an in-house designer, or it is the same design they used for something else. However, sometimes these designs look awful. And I am talking really unprofessional, unbalanced, uncool. But the client really wants this design. I really do not like working with a design that is so awful. It takes away all pleasure in coding. You code. You check the demo. Works great. Looks awful. It's just not fun. And ultimately the client might be happy, but 1) I do not feel proud of the final product and 2) the community sees you 'develop' ugly websites, which is bad for your image. Anybody experiencing this kind of stuff? What do you recommend? I've been thinking:   * Blocking these clients. If somebody has an 'own' design, ask to see it first. Then somehow politely decline. Drawback: you lose a client.   * Create a new design. Have our in-house designers work one something really cool. Drawbacks: client would need to pay for this (without asking for it), or it will be declined and the company loses time = money. And it might come as an insult if you propose a new design out of the blue. THEIR designer won't like it for sure.   * Put a clear disclaimer at the bottom of the site: Website design by XXXXX, Website development by US. Helps for the community-impact (if people pay attention), but not for the uneasy feeling.


title: What techniques do you use when dealing with a difficult project manager?

text: I'm currently working on one part of a technical data heavy project. The project manager in charge of this project is what one might term "An Old- School Project Manager" in that he has absolutely no knowledge of the application domain or anything remotely technical whatsoever - in his own words "What he does is Delivers." As well as designing the technical specifications and developing the code to those specifications, my role is also quite client facing, so I need to interact with the people who will be consuming the data to help to get it in shape for when it is all finally deployed; most of the tasks that these clients are being asked to do is way beyond their job description and I think it is important to be respectful of that and realise any help that they give us is based on goodwill. The PM is an absolute control freak who rubs everyone he ever deals with completely up the wrong way. All emails must go through him (maybe he will forward them on, maybe he will let you know if there has been a reply), and all emails must be written in a language that he understands (he doesn't know what a database is, or the difference between a schema and data so...). He almost never reads anything he's sent, what he does read he sends back asking for it to be "more high level", and he never knows what he is asking for, he just starts rambling about "this must be simple right, this is how it is, no?" - not that he admits this, he just says that he needs me to make what I've said "more high level". I'm struggling to work out what he actually does all day except of course for Delivering and acting as postmaster. How do you work with a manager who has this kind of personality?


title: Should I sign an NDA and IP contract without an expiry date?

text: I work in a small software development company. I just received a NDA and IP contract to sign, but it doesn't have an expiry date.   1. Does this mean that it's a lifetime agreement with the corporation?   2. Lacking an explicit expiry date, is there an implicit date at which the contract expires?   3. If/when I leave the company, does the agreement still stand? If so, how long?


title: What is the best IDE for Scala?

text: I tried programming Scala in Netbeans and Eclipse, but it is not what I'm looking for. In Netbeans suggestions for method names etc. are not working. In Eclipse I can't go to some classes sources by pressing F3. (e.g. scala List). Is support in IntelliJ IDEA any better? Are there other IDE's supporting Scala?


title: What would be a few ideas/concepts from programming that I can have on paper and hang on a wall as art?

text: And by that I mean any piece of code, or an idea/algorithm presented in pseudo code, something which is very important and is almost art now. I intend to put up a few paintings and work on paper around my office which depict engineering, rather celebrate engineering. I want them to be not so commonplace like e=mc2 or anything too geeky, like 42. They be special, they be important and have earned the position of being almost sacred owing to their contribution to their field. So I want a representation of computer programing as well. Thanks for your time. EDIT:After seeing a few initial responses I would like to mention that I am not looking for things which go on a t-shirt or mug, but huge framing on a wall. So anything funny/wicked/clever is not only not suitable, but I want it to be inspiring/celebrating. Not to say that I don't love the funny, but this time I want to focus on things serious.


title: Method naming advice required

text: My question will be about how do you think it would be fit to name some methods in a fluent interface. Let me try to demonstrate the problem. Consider this relation tree: ![associations](http://i.stack.imgur.com/SgfFs.png) A person can have dogs and cats, and a dog can have bones. Pretty simple. What i'm trying to do is create a domain specific fluent interface for determining, which ones of these relations does the user need. It is able to handle any depth of relationships. **I designed the operation something like this** (It is building the assoicaiton tree, from which i can determine, what the user wants): ![association tree building](http://i.stack.imgur.com/R1UCs.png) As code (it may be more readable):               personAssoc = person.associate().withCats().and().withDogs().withBones().up().done();       But i'm trying to make this part as intuitive as possible, so i wan't the **method names** to **make sense after each other** , and **be as close to spoken language as possible**. My biggest concerns are the following 3 method names:   1. **`and()`** in my language of choice `and` is a reserved keyword, so i can't use it. I looked up synonyms (`together()`, `including()`, `also()`) but they don't sound/look right (`and` means, that we will add more children to the parent association).   2. **`up()`** it is obviously breaking any kind of flow. With this method name, the whole thing became a lot further away from spoken language, than i wanted to (`up` means, we are not necessary wan't to add more relations to the parent, but we are done with the current one. In code it is the same as `and`).   3. **`done()`** is only called once, at the end of the method calls, but still doesn't fit the picture (`done` means, that we are literally done, we won't add more associations). **What i'm looking for** is other, better names for the above 3, which:   1. Which make the usage of the fluent interface closer to spoken language.   2. For `and` a name, which is as far as possible from any language keywords. If you read this whole thing, feel free to drop by any ideas, it might help me out a great deal! **Thank you for any suggestion.**


title: Scheme Stream Implementation

text: After working my way through SICP I decided to work though some Project Euler problems using scheme. In this particular problem I am trying to generate an infinite stream of integers however I am recieving an error from the MIT Scheme interpreter.               ;Aborting!: maximum recursion depth exceeded      This leads me to believe my stream implementation is incorrect however after comparing my code against that in the book I can not find any errors.               (define (delay x)       (lambda ()         (x)))          (define (force x)       (x))          (define (cons-stream a b)       (cons a (delay b)))          (define (car-stream s)       (car s))          (define (cdr-stream s)       (force (cdr s)))          (define (integers-starting-from n)       (cons-stream n (integers-starting-from (+ n 1))))      The error occurs when I run the following code:               (define n (integers-starting-from 1))      Where have I gone wrong? **EDIT:** Thanks to Chris Jester-Young below I have it working now. The correct implementation of delay and stream are as follows.               (define-syntax delay       (syntax-rules ()         ((delay expr)          (lambda ()            (expr))))          (define-syntax stream       (syntax-rules ()         ((stream a b)          (cons a (delay b)))))


title: JUnitEE vs JUnit

text: I know what unit testing is in general and what _JUnit_ is in particular. But here I see that there is a project called _JUnitEE_ which seems to me to be a wrapper over JUnit. So I would like to better understand the pain point of using vanilla _JUnit_ and how _JUnitEE_ is able to solve those problems.