title: Functional Programming approach for a simplified game using Scala and LWJGL

text: I, a Java imperative programmer, would like to understand how to generate a simple version of Space Invaders based on Functional Programming design principles (in particular Referential Transparency). However, each time I try to think of a design, I get lost in the morass of extreme mutability, the same mutability which is shunned by the functional programming purists. As an attempt to learn Functional Programming, I decided to attempt to create a very simple 2D interactive game, Space Invader (note the lack of plural), in Scala using the LWJGL. Here are the requirements for the basic game:   1. User ship at the bottom of the screen moved left and right by the "A" and "D" keys respectively   2. User ship bullet fired straight up activated by the space bar with a minimum pause between shots to be .5 seconds   3. Alien ship bullet fired straight down activated by a random time of .5 to 1.5 seconds between shots Things intentionally left out from the original game are WxH aliens, degradable defense barriers x3, high speed saucer ship at at the top of the screen. Okay, now to the actual problem domain. For me, all the deterministic parts are obvious. It's the non-deterministic parts that seem to be blocking my ability to consider how to approach. The deterministic parts are the bullet's trajectory once they exist, the continuous motion of the alien and the explosion due to a hit on either (or both) of the player's ship or the alien. The non-deterministic parts (to me) are handling the stream of user input, handling fetching a random value for determining alien bullet firings and handling the output (both graphics and sound). I can do (and have done) lots of this type of game development over the years. However, all of it was from the imperative paradigm. And LWJGL even provides a very simple Java version of Space invaders (of which I began moving to Scala using Scala as Java-without-semicolons). Here are some links that talk around this area of which none seem to have directly dealt with the ideas in a way a person coming from Java/Imperative programming would understand:   1. Purely Functional Retrogames, Part 1 by James Hague   2. Similar Stack Overflow post   3. Clojure/Lisp Games   4. Haskell Games on Stack Overflow   5. Yampa's (in Haskell) Functional Reactive Programming It appears that there are some ideas in the Clojure/Lisp and Haskell games (with source). Unfortunately, I am not able to read/interpret the code into mental models that make any sense to my simpleminded Java imperative brain. I'm so excited by the possibilities offered by FP, I can just taste the multi- threaded scalability capabilities. I feel like if were able to grok how something as simple as the time + event + randomness model for Space Invader can be implemented, segregating the deterministic and non-deterministic parts in a properly designed system without it turning into what feels like advanced mathematical theory; i.e. Yampa, I'd be set. If learning the level of theory Yampa seems to require to successfully generate simple games is necessary, then the overhead of acquiring all the necessary training and conceptual framework will vastly outweigh my understanding of the benefits of FP (at least for this over-simplified learning experiment). Any feedback, proposed models, suggested methods of approaching the problem domain (more specific than the generalities covered by James Hague) would be greatly appreciated.


title: Managing lots of little (sometimes contradictory) changes

text: I work in a large company and most coding projects are fairly structured with a project plan and review process. However, for existing support there are occasional periods where a department will need lots of tiny changes made to an existing app or site such the accounting department at the end of a fiscal year. The problem is that they get incredibly busy and my team gets a slew of tiny emergency changes thrown at us. We need to be flexible enough to support their needs as they are real and provide a great deal of value to the company. On the other hand, given how crazy their environment is, they sometimes give us contradictory changes (change the text to 10pt, then the next day change it to 12pt). Again, the changes are trivially tiny but they can suck up a developer's day given how frequent they are. I'd like to push back and set some fair limits for how we'll handle these requests going forward. Is there a best practice for handling these types of small changes? The department in question is far to busy to commit a lot more time to working with us. We also don't charge back so it's hard to communicate the problem to them. What's a good approach to resolving this?


title: Should Item Grouping/Filter be in the ViewModel or View layer?

text: I'm in a situation where I have a list of items that need to be displayed depending on their properties. What I'm unsure of is where is the best place to put the filtering/grouping logic of the viewmodel state? Currently I have it in my view using converters, but I'm unsure whether I should have the logic in the viewmodel? e.g. ViewModel Layer:               class ItemViewModel     {         DateTime LastAccessed { get; set; }         bool IsActive { get; set; }     }          class ContainerViewModel     {          ObservableCollection<Item> Items {get; set;}     }      View Layer:               <TextView Text="Active Items"/>     <List ItemsSource={Binding Items, Converter=GroupActiveItemsByDay}/>     <TextView Text="Active Items"/>     <List ItemsSource={Binding Items, Converter=GroupInActiveItemsByDay}/>      or should I build it like this? ViewModel Layer:               class ContainerViewModel     {        ObservableCollection<IGrouping<string, Item>> ActiveItemsByGroup {get; set;}        ObservableCollection<IGrouping<string, Item>> InActiveItemsByGroup {get; set;}     }      View Layer:               <TextView Text="Active Items"/>     <List ItemsSource={Binding ActiveItemsGroupByDate }/>     <TextView Text="Active Items"/>     <List ItemsSource={Binding InActiveItemsGroupByDate }/>      Or maybe something in between? ViewModel Layer:               class ContainerViewModel     {        ObservableCollection<IGrouping<string, Item>> ActiveItems {get; set;}        ObservableCollection<IGrouping<string, Item>> InActiveItems {get; set;}     }      View Layer:               <TextView Text="Active Items"/>     <List ItemsSource={Binding ActiveItems, Converter=GroupByDate }/>     <TextView Text="Active Items"/>     <List ItemsSource={Binding InActiveItems, Converter=GroupByDate }/>      I guess my question is what is good practice in terms as to what logic to put into the ViewModel and what logic to put into the Binding in the View, as they seem to overlap a bit?


title: Do we set the bar too high by requiring that code tests not suffer from buffer overflow?

text: We are currently recruiting for a Junior Developer position working mainly in C on Linux. As part of the process, we require candidates to complete a code test at their leisure in C. So far we have rejected two candidates on the basis that their code, although readable and in one case rather idiomatic, suffered from buffer overflow errors due to unbounded buffer writes. Are buffer overflows acceptable from a graduate developer? Are we setting the bar too high? What is the expected capability of graduate/Junior engineers? **[Edit]:**   * We explicitly ask for error-checked, production quality code.   * We provide a test & build framework for the candidates **[Update]:** As a result of this thread, and conversations we have had with other developers in person, we are changing the way we carry out code tests and who we target with our recruiting. We decided that a candidate being unable to fix or understand a buffer overflow means that he would be unsuitable for the work we carry out, in particular he would take more mentoring than we are comfortable with. We will therefore still reject candidates that cannot eventually submit a robust code sample. However, we have put in place some measures to make the recruitment process more productive for both us and the candidates. In particular:   * We make our expectation more explicit, with clear explanation of what we mean by production quality, and a warning that the code is expected to be robust with respect to input and errors.   * We now link candidates to resources on defensive programming and the C standard library in the description of the code test.   * We changed our target audience from Junior developers and graduates to target people with some relevant experience.   * In case the submitted code fails in some way but would otherwise be accepted, we now provide a minimum test case that causes the error condition and give the candidates a chance to correct their mistakes (unless the code is rejected for some other reason). We'll also point out problematic lines/functions if appropriate.   * The goal of the tests itself has now slightly changed from a front end filter to a chance to build a better picture of the candidate, in particular it will inform our phone discussion. That said, we are still willing to reject based solely on code.


title: Is the use of security conditionals in a view a violation of MVC?

text: Often what's displayed to a user (e.g. on a web page) will be based partly on security checks. I usually consider user-level / ACL security to be part of the business logic of a system. If a view explicitly checks security to conditionally display UI elements, is it violating MVC by containing business logic?


title: Two components offering the same functionality, required by different dependencies

text: I'm building an application in PHP, using Zend Framework 1 and Doctrine2 as the ORM layer. All is going well. Now, I happened to notice that both ZF1 and Doctrine2 come with, and rely on, their own caching implementation. I've evaluated both, and while each has its own pro's and cons, neither of them stand out as superior to the other for my simple needs. Both libraries also seem to be written against their respective interfaces, not their implementations. Reasons why I feel this is an issue is that during the bootstrapping of my application, I have to configure two caching drivers - each with its own syntax. A mismatch is easily created this way, and it feels inefficient to set up two connections to the caching backend because of this. I'm trying to determine what the best way forward is, and would welcome any insights you may be able to offer. What I've thought up so far are four options:   1. Do nothing, accept that two classes offering caching functionality are present.   2. Create a Facade class to stick Zend's interface onto Doctrine's caching implementation.   3. Option 2, the other way around - create a Facade to map Doctrine's interface on a Zend Framework backend.   4. Use multiple-interface-inheritance to create one interface to rule them all, and pray that there aren't any overlaps (ie: if both have a "save" method, they'll need to accept params in the same order due to PHP's lack of proper polymorphism). What option is best, or is there a "None of the above" variant that I'm not aware of?


title: Can multiple CPU's / cores access the same RAM simutaneously?

text: This is what I **guess** would happen:   1. If two cores tried to access the **same** address in RAM, one would have to **wait** for the other to access the RAM. The **second** time that each core would try to access the same address, they may still have that RAM cached, so they could access their respective **caches simultaneously**.   2. If two cores tried to access **different** addresses in the same RAM, one would have to **wait** for the other to access the RAM. In other words, I would imagine that for RAM intensive programming tasks, multiprocessing won't help much unless it involved reading from the same address in RAM multiple times per core. So, can multiple CPU's / cores access the same RAM simutaneously, or is what I'm saying correct?


title: How do you handle domain logic that spans multiple model objects in an ORM?

text: So I know that business logic should be placed in the model. But using an ORM it is not as clear where I should place code that handles multiple objects. E.g. let's say we have a `Customer` model which has a `type` of either `sporty` or `posh` and we wanted to `customer.add_bonus()` to every posh customer. Where would we do this? Do we create a new class to handle all this? If yes, where do we put it (alongside all the other model classes, but not subclass it from the ORM?)? I'm currently using django framework in python, so specific suggestions are even more wanted.


title: What are the reasons one would use fully qualified class names in source code?

text: I recently ran across code where the developers used both fully qualified class names AND imported class names in their source code. Example:               import packageA.Foo;          public class Example {         public packageB.Bar doSomething() {             final Foo foo = new Foo();             ...         }     }      I was under the impression that the only reason one might want to use fully qualified name for classes in source code is when they have identical class names in two different packages and they need the fully qualified name to distinguish between the two. Am I wrong?


title: How should I distinguish between built-in types in Python?

text: I have a function that accepts either a string or a dictionary as an argument. That is, it can be called as either:               lookup_person({name: "John Smith", age: 57})      or               lookup_person("John Smith")      My first inclination is to use `type` or `isinstance` to distinguish the type of the argument, but I've seen a lot of ink spilled over whether and when rigid type detection is appropriate. The prevailing wisdom I've read suggests that I should test if my object implements some interface, but testing for particular string or dictionary methods seems significantly less safe than simply testing if the type of the object is a string or dictionary. Is it possible to employ duck typing here, and is it appropriate to do so? Or do I have a larger problem, and my approach here somehow fundamentally not Pythonic? **EDIT:** To clarify, passing a dictionary is the "typical" use. Passing in a string is simply an API shorthand for a single-entry dictionary with `name`, i.e., `lookup_person({name:"John Smith"})`.


title: Sorting : Useful for more than just viewing data?

text: **Context** I'm currently working on a personal project involving functional reactive JavaScript, and I've come up with an odd question. Note that this question is not JavaScript specific, but that is the context in which I am asking it. **Scenario** When filtering a collection of data, you end up with a smaller set of data. Therefore, correctly filtering your data earlier (rather than later) ends up optimizing your later code, as it does not need to iterate through the portion of data which will not be used. (think filtering before mapping, instead of visa-versa) However, I was wondering if there's a scenario in which sorting provides similar benefits, or if sorting is generally used as a way of formatting data to be displayed, so that an end user may more easily absorb it (sort by name, city, state, etc). **Question** When is sorting your _data_ more desirable than sorting the corresponding _views_ of that data?


title: One method with many behaviours or many methods

text: This question is quite general and not related to a specific language, but more to coding best practices. Recently, I've been developing a feature for my app that is requested in many cases with slightly different behaviours. This function send emails , but to different receivers, or with different texts according to the parameters. The method signature is something like               public static sendMail (t_message message = null  , t_user receiver = null , stream attachedPiece = null)      And then there are many condition inside the method, like               if(attachedPiece != null)     {     }      I've made the choice to do it this way (with a single method) because it prevents me to rewrite the (nearly) same method 10 times, but I'm not sure that it's a good practice. What should I have done? Write 10 `sendMail` method with different parameters? Are there obvious pros and cons for these different ways of programming? Thanks a lot.


title: How does a search functionality fit in DDD with CQRS?

text: In Vaughn Vernon's book Implementing domain driven design and the accompanying sample application I found that he implemented a CQRS approach to the iddd_collaboration bounded context. He presents the following classes in the application service layer:   * CalendarApplicationService.java    * CalendarEntryApplicationService.java   * CalendarEntryQueryService.java   * CalendarQueryService.java I'm interested to know if an application will have a search page that feature numerous drop downs and check boxes with a smart text box to match different search patterns; How will you structure all that search logic? In a command service or a query service? Taking a look at the CalendarQueryService.java I can see that it has 2 methods for a huge query, but no logic at all to mix and match any search filters for example. I've heard that the application layer shouldn't have any business logic, so where will I construct my dynamic query? or maybe just clutter everything in the Query service?


I'm a little bit confused about 'function' and 'lambda'. I've seen some examples showing that the scheme keyword `lambda` works very similarly to the JavaScript keyword `function`, but I really don't know how they are related. I'm told that 'function' and 'method' can be used interchangeably when speaking about objects in .net. I'm wondering if 'lambda' and 'function' similarly mean the same thing. I wonder if 'lambda' has some esoteric meaning, seeing that the Greek letter lambda (λ) appears in so many avatars on this site. To make things even more confusing, in .net, the functional parts of C# refer to function expressions passed to another function as 'lambda expressions', so the word really seems to be all over the place. I'm also vaguely familiar with the term 'lambda calculus'. What is the difference between a function and a lambda?


title: Pure Front end JavaScript with Web API versus MVC views with ajax

text: This was more a discussion for what peoples thoughts are these days on how to split a web application. I am used to creating an MVC application with all its views and controllers. I would normally create a full view and pass this back to the browser on a full page request, unless there were specific areas that I did not want to populate straight away and would then use DOM page load events to call the server to load other areas using AJAX. Also, when it came to partial page refreshing, I would call an MVC action method which would return the HTML fragment which I could then use to populate parts of the page. This would be for areas that I did not want to slow down initial page load, or areas that fitted better with AJAX calls. One example would be for table paging. If you want to move on to the next page, I would prefer it if an AJAX call got that info rather than using a full page refresh. But the AJAX call would still return an HTML fragment. My question is. Are my thoughts on this archaic because I come from a .net background rather than a pure front end background? An intelligent front end developer that I work with, prefers to do more or less nothing in the MVC views, and would rather do everything on the front end. Right down to web API calls populating the page. So that rather than calling an MVC action method, which returns HTML, he would prefer to return a standard object and use javascript to create all the elements of the page. The front end developer way means that any benefits that I normally get with MVC model validation, including client side validation, would be gone. It also means that any benefits that I get with creating the views, with strongly typed html templates etc would be gone. I believe this would mean I would need to write the same validation for front end and back end validation. The javascript would also need to have lots of methods for creating all the different parts of the DOM. For example, when adding a new row to a table, I would normally use the MVC partial view for creating the row, and then return this as part of the AJAX call, which then gets injected into the table. By using a pure front end way, the javascript would would take in an object (for, say, a product) for the row from the api call, and then create a row from that object. Creating each individual part of the table row. The website in question will have lots of different areas, from administration, forms, product searching etc. A website that I don't think requires to be architected in a single page application way. What are everyone's thoughts on this? I am interested to hear from front end devs and back end devs.


title: Language for Chess Position Evaluation (experimental)

text: My aim is to, via pattern analysis and statistics, (as well as piece mobility and position) build a chess position evaluation analyzer (rather than simply going brute force ply-searching). Id like to hear some thoughts a language that will be interesting/fun/challenging to learn and reason with. Ideally the language would have be well suited for:   1. Statistical Analysis   2. Pattern Analysis    3. Native Array and Vector Operations    4. Native Mathematical Functions Note:   1. I have no need for a GUI, and may not even get to the point of a 'move engine' but simply stop at a position evaluation engine   2. I am not interested in speed.    3. I am personally most comfortable with Python but I might be interested in trying something else. (though feel free to suggest this if you think it fits).   4. I am particularly curious about how good a fit a functional language would be in this context.


title: What was before MVC?

text: MVC is used a lot (not only in web apps) and it seems it's the 'go to' approach when designing software. There are also a lot of MVC versions. My question is: what was before MVC? How did people structure large software systems? Obviously 'separation of concerns' wasn't invented with MVC (even if it wasn't called that). I assume this type of thinking, which is crucial for building and maintaining software, was present long ago. But in more technical terms, how was software structured before MVC?


title: How should I organize bugs in redmine?

text: I'm helping to reogranize several redmine projects; although I have a lot of experience with issue tracking systems, I've never worked with redmine before. What is the best way to organize Issues in Redmine so that they can be easily grouped by:   * feature (e.g. "Upload a file", "Login to site", "Send message")   * system component (e.g. front-end, back-end, database), and   * target version ("beta 1", "beta 2" "GA") Right now, most "Bugs" are child issues of "Features"; unfortunately, this means that the Target Version of each bug is automatically populated with the Target Version of the parent feature. Is there some way to fix this?


title: Representing domain objects

text: This is related to my recent question regarding naming awkward domain objects. A number of answers indicated I was using the wrong representation for the domain objects. To summarize, I chose to use an enum to represent some domain objects used as keys in lookups. For this question, I want to review my decision to use an enum and identify alternatives. Jump to the bottom of my question for the TL;DR. **Domain Description**   My application is responsible for performing some calculations involving chemical compounds. Some basic equations are:   * calculating the number of moles of a compound    * calculating the specific gravity or density of a compound at various concentrations These equations could be handled as methods within a `Chemical` class like:   `Chemical.GetMolesFromMass(double mass_grams)` or   `Chemical.GetDensity(double concentration)`   or they could be implemented as methods off of a generic chemical properties class like:   `Chemical.GetMolesFromMass(Compound cmpd, double mass_grams)` or   `Chemical.GetDensity(Compound cmpd, double concentration)` I think from an object responsibility point of view, the first option of methods off of the `Chemical` class would be a better representation. Some advanced equations involve:   * calculating quantities of a compound consumed by a business process   * calculating storage requirements of compounds    * optimizing deliveries based upon standard container sizes  In these equations, the chemical compound is an input to the method.   `StorageTankCluster.Generate(Compound cmpd, double requiredVolume)` The `StorageTankCluster` needs to know about the chemical because the dimensions and spacing of the tanks within the cluster will change based upon the chemical and required volume. The chemical being stored can affect tank material selection as well as impacting safety clearances between tanks. At the moment, I'm considering those parameters (spacing, material, ...) as lookup items instead of elements that the compound is responsible for knowing about. Likewise, the delivery optimization as affected by the chemical compound but it's arguable on whether or not those aspects are the compound's responsiblity. Both the `StorageTankCluster` and the delivery optimization components are intended to be reused by other non-chemical aspects of the application. As this question is already getting complicated, we can just call those other elements `Foo` and `Bar`. Both `Foo` and `Bar` could utilize the delivery optimization, but only `Foo` can be used with the `StorageTankCluster`. It's not in the application now, but all of the various properties discussed so far will need to be stored within a database / persistence layer. I realize that shouldn't affect a good design, but I thought it was worth mentioning. I'll admit that some of my decisions have been biased because I'm porting this application from another source that forces everything to be done in a structured manner. Writing out this question has highlighted a few areas where I should have better examined what object had responsibility for that functionality. My design so far has been oriented around lookup tables and I'm using the enum values as the keys to those tables. It is their use as keys that causes me to treat them as named objects within the program instead of treating them as objects the system would operate upon. This has pretty much relegated the chemical compounds to 2nd-tier class status, and I'm wondering if that was the right decision. On the other hand, I'm concerned about the chemical compound class becoming bloated beyond usefulness. **TL;DR**   My implementation is / must be in C#. So was using an enum the right choice, or what should I have done and why?


title: Continuing to code on large projects

text: I am a hobbyist programmer, and I've started many medium - sized projects to work on just by myself. These include games, a raytracer, physics simulations etc. By the time these projects get to a certain size (around 5000 lines), I begin to slow down in adding features to the program. This is not because of a lack of ideas of what to implement in a program, but rather a struggle in how to go about it. In particular, I'm afraid of breaking what I already have working in order to implement a new feature. I've tried using version control like Git and Subversion, but these seem unnecessary when you are a one man team. I simply have a folder of "versions" of my program, one for each major change I make. How do I keep coding past this 5000 line mark? What about the 50000 line mark?


title: Is there such a thing as truly random?

text: I saw a video about random numbers and how the programmer in that video was talking about computers generating pseudo random numbers and that they are not really random. I knew about this. Then he showed the decay of a radioactive material to generate random numbers where he claimed to be truly random. Is there really such a thing? I mean the process of the radioactive material shooting electrons might seem random but is it? Isn't it just a mysterious black box to us simply because we don't know how it really works? Or does randomness just depend on the current level of scientific knowledge? If so, then how come quantum computers are often quoted to be capable of generating truly random numbers? Can they really do this?


title: Is there a desktop tool to auto-combine & minify JS on save?

text: I've been using Less.app lately to automatically minify CSS and compile it from LESS to CSS immediately when I save a LESS source file. It seems like an obvious thing, but I can't find a tool that does the same thing for JavaScript. Does such a tool exist? Desired features:   * I'm on OSX, but a cross-platform solution (e.g. using Adobe AIR) would also be acceptable.   * Leave it running minimized/hidden, automatically watches specified folder for changes (no button clicking necessary)   * Installing NodeJS/python/php/etc is a non-starter. Must be totally self-contained.   * Especially interested if it will automatically combine all of the files from the same directory.      * Either sorting based on filename so that I can name them "1.library.js", "2.framework.js", "3.app.js", etc, or...     * Allow setup of manual sorting


title: Charging for a project where you retain the IP for the end product

text: I have read up on quite a few of these questions asked on here regarding "how much should I charge for..." such as: How should I charge for programming things which take two minutes to fix? How much should I charge for a web app How much can I charge for this a little job? and these are fine for freelance projects dealing with specific clients for a specific product. My situation has a bit of a curve-ball to it, and this is: how much should I charge a company to develop a product where I retain the 'Intellectual Property' of the final product. I am working with a company to create a web application that will help with some administrative processes. The idea for this project had originated between me and an employee of the company outside of business hours. Thus the product idea was then presented to the company and they are very interested in me developing this idea for them. The CFO of the company wants to pay me for my time to develop this product, yet I would also like to own the IP of this product and resell it to other companies when it is completed. When we do meet to discuss fair wages, what would be the best way to position myself? Presumably in the future with a completed product this would be a 'fee for service' software platform, wherein a company would purchase seats (monthly or annually). But I am unsure of how I should treat this development 'partner'. Their contributions would include helping me tailor the product to fit their needs specifically, along with debugging and testing.. So should I charge an hourly rate? A lump sum? Or start out right away with a monthly subscription type? This project is done on the side, I still have a day-job.. But will be investing a lot of time into this project since it has a lot of potential. (if that factors into any of it)


title: How do I partially add PHP namespacing to a library without breaking existing code?

text: My company has created a modular PHP framework over the years, beginning long before PHP 5.3 added namespaces. Recently, we decided to start using namespaces in our library's new code, and we intend to namespace old code eventually. However, we have a few issues we are trying to work out to determine if adding namespaces to a pre-v5.3 codebase is just not a good idea:   1. Can I namespace a class but also import (use) the global namespace so all global classes do not need a `\` prefix?   2. If we namespace an existing class in our library, how can we prevent all existing projects from breaking as soon as the framework upgrades? For example, can the library change the name of class `ThemeEngine` to `\module\theme\ThemeEngine`, but the existing websites call `ThemeEngine` without **any** code modification? If so, what would that code look like?


title: How do I determine what project ideas will work as a resumé builder?

text: I have been programming almost exclusively in C/C++ for the almost 3 years now (not including college) and feel stagnated (not to mention working on proprietary code for the most part). So I decided to change my career path and jump into web devlopment by learning Rails. The problem is not the learning but getting a Rails/web dev job. Since I don't have any real work experience in RoR, the one way to get noticed is through side projects. There's a lot of basic advice about building up a resumé in a new technology: creating a project on GitHub, for example. But being new to the whole web development world I don't know what constitutes as a good project that shows that I am good programmer and not just an eager enthusiast: things like my testing methodology, coding standards, design patterns, programming practices, and so on. How do I come up with a project that'll demonstrate these things?


title: Should an API be aware of client versions?

text: Should an API be aware of a client version? The idea of that really goes against the grain for me, but it seems like it is being pushed for in my current project. Am I wrong? Can I get some reasons for or against this that I can present or understand why it might be good. The API is a RESTful API.


title: Finding my path for masters (CS or HCI or some other trail)?

text: I am student pursuing Bachelor of Technology in Electronics and Communication at my university. While pursuing my course, I started to work on some projects related to CS. Computers being my favourite from the very foundation, I kept on working on towards my passion for these three years winning some awards, writing a paper, doing projects etc. I am currently in fourth year now and I am thinking to totally switch my branch to CS for masters. I always work to build innovative solutions to problems like software for disabled, something for education, or be it software for environment etc. There is no certain subject for solutions but innovation and novelty is certainly what I yearn for while scheming inventive solutions. The problem is that I am not able to find the correct path to go for the masters i.e. the diversification of courses is taking a toll. Mostly, there are HCI courses in universities which focus to build these innovative solutions but, I was trying to parallel MS in CS & MS in HCI. There looks like more of a focus on drawing/arts type if thing in HCI which I don’t want to go ahead with but what I do want is building up creative solutions with technical ingenuity. A person in HCI also has all the same technical skills as that of a CS student, then where does the difference arise? Let’s say as a very odd example, can a HCI student apply for SDET positions for example at a big firm, instead of User Experience Design etc. since he is having the same skill set? Or, in terms of monetarist paybacks, is there a difference between salaries of CS graduates and HCI graduates? I do not want to remain as an interaction designed submitting just on-paper designs of things. I do want to surface with more imaginative ideas. At the current stage, what’s stopping me is that I am a little lesser than the technical knowhow as compared to a full time CS student since I put in the effort for all the CS prep myself (being a non-core CS student). I presently need to learn more about CS at a reputed place while pursuing these projects. So, is it really HCI that I should be going for or is there is some other contour that I haven’t given a thought to? Please help me out. Thanks


title: Tutoring students who are struggling with the basics in C++

text: I am tutoring a few students who are having significant trouble learning the basics of their first programming language: C++. I have known many excellent and bright students who have failed or dropped their first CS course. Everyone I am tutoring gives a similar account of his or her experience in class: the instructor moves along too quickly, nothing in the lectures make any sense, et al. Prior to this CS class, most of these struggling students had not expressed any interest in computers as anything more than word processors, web browsers, or some other form of entertainment. The computer is a blackbox that works, so why mess with it? My best guess is that they are having trouble connecting the abstractions of computer science with familiar concepts. That is to say, these student might know how to learn math, biology, or physics, but those techniques are not working when it come to programming. Does anyone have any suggestions or advice? The students I am helping do not deserve to fail this class. It is clear that the instructor is not taking into account the learning style of these students. That is to say, the instructor is failing not his students.


title: Why almost no webpages hash passwords in the client before submitting (and hashing them again on the server), as to "protect" against password reuse?

text: Relevant XKCD There are many sites on the Internet that require login information, and the only way to protect against password reusing is the "promise" that the passwords are hashed on the server, which is not always true. So I wonder, how hard is to make a webpage that hashes passwords in the client computer (with Javascript), before sending them to the server, where they would be re-hashed? In theory this doesn't give any extra security, but in practice this can be used to protect against "rogue sites" that don't hash your password in the server.


title: How to share common methods if objects have different roles?

text: If 2 classes have the following in common:   * part of how their state is represented (both have a linear container)   * multiple identical methods (identical code, not just signature) But are not substitutable, ie: they play different roles.   Then how do I avoid repeating those methods? The obvious solution would be inheritance, but I have read: "inheritance is not for code reuse". (Does this apply here?, Is this really a case of just code reuse?) I am deliberately not telling you which language, because I am hoping for a language agnostic answer. The methods are couple lines long, all of them modify the container, one of them transforms/extracts a sort of "final result" from the container. By roles I mean: substituting one for the other would be valid runnable code (in the places where only the common methods are used), but would result in logic/semantic error. By inheritance I meant that introducing a 3rd class as base/super with the common methods, but that would be virtual. So by substitution I meant substituting a "sibling" type and not a subtype.


title: Introducing polymorphism to new programmers

text: I've been teaching Java to a group of four people for about four months now. Prior to this, they've all had very limited or no other experience programming. We've gotten through basic control structures and their use and have been able to solve some of the simpler Project Eulers. Things similar to:               int count = 0;          for(int index = 0; index < 1000; index++)     {             if(index % 3 == 0 || index % 5 == 0)             {                     count += index;             }     }               System.out.println(count);      We've also gone over basic object-oriented things such as classes and their uses. However, we have not covered inheritance or polymorphism yet. I'd like to introduce inheritance and polymorphism together, but I'm not sure how to properly explain polymorphism to someone who's never seen nor heard of it before. To sum up my question in a few words, I am looking for an effective way to introduce polymorphism to new programmers.


title: When to separate a project in multiple subprojects

text: I'd like to know if it makes sense to divide the project I'm working on in two repositories instead of one. From what I can say:   * Frontend will be written in html+js   * Backend in .net   * The backend doesn't depend on frontend and the frontend doesn't depend on the backend   * The frontend will use a restful api implemented in the backend.   * The frontend could be hosted on any static http server. As of now, the repository has this structure: root:   * frontend/*   * backend/* I think it's a mistake to keep both project in the same repository. Since both project do not have dependencies between each others, they should belong in individual repositories and if needed a parent repository that has submodules. I've been told that it's pointless and that we won't get any benefit from doing that. Here are some of my arguments:   * We have two modules that don't depend between each others.    * Having source history of both projects in the long term may complicate things (try searching in the history for something in the frontend while you have half of the commits that are completely unrelated to the bug you're looking for)   * Conflict and merging (This shouldn't happen but having someone pushing to the backend will force other developer to pull backend changes to push frontend changes.)   * One developer might work only on the backend but will always have to pull the backend or the other way around.    * In the long run, when it will be time to deploy. In some way, the frontend could be deployed to multiple static server while having one backend server. In every case, people will be forced to either clone the whole backend with it or to make custom script to push to all servers the frontend only or to remove the backend. Easier to just push/pull only the frontend or backend than both if only one is needed.   * Counter argument (One person might work on both projects), Create a third repo with submodule and develop with it. History is kept seperated in individual modules and you can always create tags where version of backend/frontend do really work together in sync. Having both frontend/backend together in one repo doesn't mean that they will work together. It's just merging both history into one big repo.   * Having frontend/backend as submodules will make things easier if you want to add a freelancer to the project. In some case, you don't really want to give full access to the codebase. Having one big module will make things harder if you want to restrict what the "outsiders" can see/edit.   * Bug introduction and fixing bug, I inserted a new bug in the frontend. Then someone fix a bug in the backend. With one repository, rolling back before the new bug will also rollback the backend which could make it difficult to fix. I'd have to clone the backend in a different folder to have the backend working while fixing the bug in the frontend... then trying to remerge things up... Having two repository will be painless because moving the HEAD of one repo won't change the other. And testing against different version of backend will be painless.  Can someone give me more arguments to convince them or at least tell me why it is pointless (more complicated) to divide the project in two submodules. The project is new and the codebase is a couple of days old so it's not too soon to fix.


title: RESTful URI's, Creating a new noun/uri or add a queryparameter

text: I have a Person class with a one to many relationship to Employment. A Person in the CRM can have multiple Employments (historic data). My current REST URI for this class looks like this:               http://domain/persons GET [collection]     http://domain/persons/{id} GET [resource]     http://domain/persons/{id}/employments GET [collection]      To get the CURRENT active employment (so the employment where the endDate is NULL) should I create a URI or should this be done using a QueryParam? Basically should I do this:               http://domain/persons/{id}/employments/current GET [resource]      or               http://domain/persons/{id}/employments?current GET [collection with query param filter]      I'm thinking the second one (with the queryparam) because as far as I understand REST a resource should be identified with a non changable URI. Since the current employment position can change it should be done with a QueryParam. What are your suggestions?


title: C quiz, puzzles obfuscated C

text: I believe that I am a good C programmer. I can solve beginner level Question in google's code jam. I did solve all of the programming examples in KN kings: C programming. Given a problem I can express a solution to it in C(probably not good, but still works with brute force most of the time). A couple of days ago I had registered for a C quiz. And took the quiz today. From the beginning till the end I was confused, feeling rejected and unhappy most of the time. I could not figure out what most of the question did. It was cryptic to me. For example I have used for loop almost 1000 times, but the for loops in that quiz were just cryptic and confusing. Most of the question looked like it had illegal syntax. After the test I felt dejected and posted this question. I wanna know that does solving cryptic code make you a good or a great programmer?. A simple solution to a straight forward question is better than a cryptic confusion right?. If I had done really well in the test what does it indicate? If I have performed average or bad what does that indicate?. Oh yes, I will get the paper of quiz on monday and i will update that monday evening around 7:30. (GMT +5:30). Thanks for your concern. By the way to hell with you people who have down voted for this post. You people cant wait for edits or dont have patience to at least listen to someone. I still think there is nothing wrong in this question and i wont delete it.


title: Distributing GPL licensed software that optionally links to non-GPL licensed libraries

text: I can find lots of information regarding the restrictions imposed on linking GPL licensed libraries from non-GPL licensed software. However, I'd like to do the opposite - I'd like to distribute some software under a GPLv3 license that has the option to dynamically link to a proprietary shared library. The proprietary library would not constitute an essential component of the functioning software, since there are other open source (BSD licensed) libraries that could be linked at runtime instead (specifically, I'm thinking about linking MKL BLAS versus ATLAS, OpenBLAS etc.). I found this relevant section in the GPL FAQ.   * Does this mean that I would need to explicitly grant an exception for every possible non-GPL licensed shared library the user might choose to link to at run-time?   * Would I need to write exceptions for libraries that are open source, but not GPL licensed (e.g. BSD)?   * If the library that is being linked to is not covered by an exception (i.e. if it is GPL or LGPL), what would be my obligation to distribute the source code for that library?


title: How do I resolve a Title Dispute? Head Programmer/Developer and Consultant

text: I am working on a project (software) for an organization. Someone else from that organization asked If I could build something for the organization. I did so, for free in fact because I wanted to support this organization. Now heres the problem. This other person, has come back and asked me to polish up the titles/credits give to us in the about screen. But he want's to be called the lead Developer and call me lead Programmer. The thing is that, he has not contributed any code towards this application. Thing is, I feel that I developed/programmed/designed the entire thing. I did 100% of the actual product including design. His input was, can we have it have a specific color background (for design) or how soon "we" can incorporate another feature. Maybe I'm being one sided, but technical stuff wise, the other person has no "developmental" use. I'm still happy to have him, because he is my contact within the organization and he has brought some interest into the product but I don't know if the title is fitting. What do you think the best title/solution is here? Am I being narcissistic/worrying about things that don't matter? Let me be clearer 1. Dude asks me if I can make something 2. I say yes. I want to help the organization that he works for (the product is not for profit) 3. I build the thing with design and stuff 4. Initial launch. 5. He suggests some design changes, maybe a feature. 6. I change + add features 7. Pretty successful, generates interest in growing larger 8. And then, the tittle issue Would Lead Consultant be a nice way out of this?


title: Avoiding problems when copying code

text: From time to time, I find myself copying a bit of code and modifying the copied version. I know very well that having two copies of the same code is a very bad idea, but those pieces of code are small and have significant differences. The problem is, when modifying the copy, I sometimes forget some piece of the original, that shouldn't be there. So for example I first write (C# code, but that's not important here):               if (DateFrom != null)         query = query.Where(x => x.Date >= DateFrom.Value);      then I copy-paste it and modify into the following:               if (DateTo != null)         query = query.Where(x => x.Date < DateFrom.Value);      which isn't correct, because there should be `DateTo` on the second line instead of `DateFrom`. What would you suggest to help avoiding this kind of bug?


title: HTML 5 Double-Helix/DNA

text: What would be the most cross browser friendly (IE9, Chrome, FF, Safari, Opera) way to code an animated, interactive double-helix? HTML 5/JavaScript is fine. Flash or Java is not. I am unsure if canvas or svg or pure css should be considered as graphics aren't typically my thing. In fact, I really don't know where to start here, so I probably just need a nudge in the right direction. Any advice is appreciated!


title: Do coding puzzles make good interview questions

text: I am interviewing candidates for Java programmer positions. My colleague insists in filling more than half of the interview with java coding puzzles.His view is that, if candidates are able to navigate through the loops, then they must be good. One such example of coding puzzle is                       i=0;             for( i=1 ; i< 10 ;i++)             {                     if(i%3 ==0) i++; break;                     if(i%2 ==0) i++;                   }               print(i);      Follow up: what happens if break is removed ?


title: How to stop dwelling on problems rather than tasks?

text: I can't say I am a good programmer but I've been earning money for programming last decades. I've thought I was born for programming and people said I was very good at it - at some point. But after 10 years of programming, I feel my programming efficiency is not as good as others. Of course, CS education is way better now and many young programmers are smarter than me. But one of my problem is that when I am executing a task, I tend to dwell on specific problems I am facing with the task rather than focusing on completion of the task. I understand to keep thinking about it does not solve the problem. But I habitually do that and easily become exhausted. I hope I am not the only one feeling in this way. Did you feel the same feeling? If so, how did you get rid of this terrible habit?


My department is planning on working on our next several releases (spanning a year) simultaneously. The powers that be are advocating we support this by refactoring all affected code into classes like AbstractGizmo, R1Gizmo, R2Gizmo, etc and use configuration (via Spring and/or ANT) to control which classes are used in a particular release. Ostensibly this is to save us the work of merging changes into multiple branches, especially when the changes are in the common code. However, I see this as a clear cases for branching and merging in version control (TFS, in our case). However, I have very little experience on projects that have active streams of development like this. I'm sure others have (like Microsoft, with Windows XP, Vista, and 7). What's the best way to handle multiple simultaneous "streams" of development in version control? Do you branch and merge changes in version control, try to develop everything in one branch and use configuration or build scripts to assemble the different version, or something else? P.S. We use TFS right now, but our version control strategy may not be constrained by it. A coworker of mine is pushing to switch to Git or Mercurial, and it seems like he's getting a bit of traction.


title: What are the similarities between Perl and Java?

text: I have my mind set that I'm learning Java as my second language (I am a Perl developer). But just from reading a little of the online tutorials, I really can't find any similarities between the two. What will I have an easy time understanding when learning Java?


title: FOSS Development: Who develops the OS-specific packages?

text: I have a couple of FOSS projects. They can be a bit of a pain to get running unless you've got dependencies in place already, which I figure is par for the course for FOSS projects. We know that each free operating system out there has its own package management systems. A few of them, such as homebrew on Mac OS or AUR on Arch linux are very friendly to community contributions. What I am wondering is, who exactly is expected to contribute packages? Primarily I am concerned with the case of small or developing projects, since it's pretty standard for the big projects to be put in there by the OS maintainers. From my perspective, it is something of a chicken-egg problem, because your software will not make its way into a package system if it does not have users, and it is less likely to gain users if it is not easy to install and use. For the sake of discussion, let's assume that the software in question is actually legitimately useful. I can see where people could create crapware or spam and that should obviously be kept out of any package system. So, in summary, whose job is this? Is it spammy for a FOSS software dev to put his own work into various OS package repositories?


title: Exposing warnings\errors from data objects (that are also list returned)

text: I'm exposing Data objects via service oriented assembly (which on future usages might become a WCF service). The data object is tree designed, as well as formed from allot of properties.Moreover, some services return one objects, others retrieve a list of them (thus disables throwing exceptions). I now want to expose data flow warnings and wondering what's the best way to do it having to things to consider: (1) separation (2) ease of access. On the one hand, I want the UI team to be able to access a fields warnings (or errors) without having them mapping the field names to an external source but on the other hand, I don't want the warnings "hanged" on the object itself (as I don't see it a correct design). I thought of creating a new type of wrapper for each field, that will expose events and they'll have to register the one's they care about (but totally not sure) I'll be happy to hear your thoughts. Could you please direct me to a respectful design pattern? what pattern will do best here?


title: How to go about "taking over" an open-source project?

text: There's an open-source project that I'm interested in and use regularly. It's licensed under the Apache License 2.0 and it has basically no activity any more. It's hosted on Google Code and I'm interested in continuing it's development. I'm new to the open-source process and I'm trying to figure out the appropriate way to go about this. Can I just check it out and push it to github so I can continue it's development in the open there? Should I contact the project "owner" first? Also, do I leave all the author information at the top of the classes, etc even though I'm going to be making changes..(I'm assuming the answer is yes)? Also, how do I practically adhere to the license requirement of "all modifications are clearly marked as being the work of the modifier"? Do I place a comment by every change I make? Any guidance on what's the normal course/standard here would be greatly appreciated?


title: Should a class validate argument using external method/service with unit testing?

text: I have a class that runs as a service and returns html code of a website when supplied with a URL. The code:               public interface IHtmlDownloader     {         IWebProxy Proxy { get; set; }         string UserAgent { get; set; }              string GetHtml(string url)     }          public class HtmlDownloader : IHtmlDownloader     {         WebClient _client;              public IWebProxy Proxy         {             get { return _client.Proxy; }             set { _client.Proxy = value; }         }              public string UserAgent         {             get             { return _client.Headers[HttpRequestHeader.UserAgent].ToString(); }             set             { _client.Headers[HttpRequestHeader.UserAgent] = value; }         }              public HtmlDownloder()         {             _client = new WebClient();         }              public string GetHtml(string url)         {             this.CheckValidity(url);                  var htmlOfWebsite = _client.DownloadString(url);                  return htmlOfWebsite;         }     }      Now I am not sure how exactly I should validate the URL. I know that it should not be null or whitespace or anything else, but should I validate that it is indeed a properly built URL? Doing so would result in a method which would perform the validation. I could simply create a public static method inside `HtmlDownloader` so that the caller can validate the URL, or maybe even not a static one (`GetUrl(string url)` is after all called after the object has been instantiated), but it would be wrong for at least two reasons:   1. It would be a validator applicable in so many places, and it should be available to other classes.   2. I can't contract a static method with an interface. Furthermore, it shouldn't be made static, but rather a service, so I could unit test `HtmlDownloader` (service would be injected through the constructor). All of those ideas are quite dreadful and I am starting to think, that I shouldn't validate anything, but simply create a `try/catch` block that would catch the proper exception and then throw a UrlNotFoundException with the original exception supplied through InnerException. Still, it would be nice to check for the validity of the URL. But to whom and how? Should the caller be injected with the proper service? But then, what if the URL is generated higher than the caller and the caller simply passes it on to the HtmlDownloader? Where should I validate the URL? Or is the simple fact that the URL have to passed through a few levels a code smell?


title: Which numeral systems are useful in computer science?

text: I am wondering which numeral system different programmers are using, or would use if their language has support for them. As an example, in C++ we can use:   * Octal by prefixing with 0 (e.g. `0377`)   * Decimal by default (e.g. `255`)   * Hexadecimal by prefixing with 0x (e.g. `0xff`) When working with bitmask, I am using hexadecimal but would sometimes want to be able to express binary numbers directly. I know some programming language support it with 0b syntax (e.g. `0b11111111`). Is there any other numeric system useful in some computer science domain (e.g. cryptography, codecs, 3D graphics, etc)?


title: Python Compare Values from 2 Columns from two separate CSV files

text: I am using Python. I have two columns(in separate CSVs) that contain an ID tag. Ideally, I would like to add on columns of information from one CSV to the other whenever the ID tag matches. For the most part, the tags are hand and hand, however, there might be times where one ID tag is missing, and if that happens, I would like it to just continue through. Here is an example of the data: From 1: ID   1   2   3   4   5 From 2: ID VariableX Variable Y missing......................................                     2     X1          Y1      missing........................................ 4 x4 y4                     5     x5          y5      I would like to take the values from variable x and y and add those columns onto the first file (with only the ids) whenever the IDs match from each file. Another thing to note, these IDs will show up from time to time again periodically (maybe every 3-400 times). If anybody could help with this topic, I would really appreciate it! Thank you!


title: implementing dynamic query handler on historical data

text: **EDIT :** _Refined question to focus on the core issue_ Context: I have historical data about property (house) sales collected from various sources in a centralized/cloud data source (assume info collection is handled by a third party) Planning to develop an application to query and retrieve data from this centralized data source Example Queries: **Simple** : for given XYZ post code, what is average house price for 3 bed room house? **Complex** : What is estimated price for an house at "DD,Some Street,XYZ Post Code" (worked out from average values of historic data filtered by various characteristics of the house: house post code, no of bed rooms, total area, and other deeper insights like house building type, year of built, features)? In addition to average price, the application should support other property info ** maximum, or minimum price..etc and trend (graph) on a selected property attribute over a period of time**. Hence, the queries should not enforce the search based on a primary key or few fixed fields In other words, queries can be What is the change in 3 Bed Room house price (irrespective of location) over last 30 days? What kind of properties we can get for X price (irrespective of location or house type) The challenge I have is identifying the domain (BI/ Data Analytical or DB Design or DB Query Interface or DW related or something else) this problem (dynamic query on historic data) belong to, so that I can do further exploration **My findings so far** I could be wrong on the following, so please correct me if you think so I briefly read about BI/Data Analytics - I think it is heavy weight solution for my problem and has scalability issues. DB Design - As I understand RDBMS works well if you know Data model at design time. I am expecting attributes about property or other entity (user) that am going to bring in, would evolve quickly. hence maintenance would be an issue. As I am going to have multiple users executing query at same time, performance would be a bottleneck Other options like Graph DB (http://www.tinkerpop.com/) seems to be bit complex (they are good. but using those tools meant for generic purpose, make me think like assembly programming to solve my problem ) BigData related solution are to analyse data from multiple unrelated domains So, Any suggestion on the space this problem fit in ? (Especially if you have design/implementation experience of back-end for property listing or similar portals)


title: Loop invariant vs Assertions

text: I have an exam on Programming Concepts this Saturday and I am struggling to find some information to understand some concepts better. What is the difference between loop invariant and assertion? To me they look the same. Also, what exactly is `while` loop invariance theorem? Not sure whether it is me or it is ridiculously hard to find any specific information about algorithms and pseudocode online.


I've read here on P.SE more questions in which beginner programmers are advised to pick Python as their first programming language. Don't get me wrong, I like Python. I like it a lot! But its philosophy revolves around "We are all consenting adults here". From an experience/knowledge point of view, a beginner programmer is not an adult. Which then kinda means it is easier to shoot yourself in the foot and pick up some bad habits even if you survive the wound. I'm thinking that in a "more static" language it would be harder to shoot yourself in the foot as it will be more restrictive. Back to my question. Why is Python recommended as an entry level programming language? What are the points that make it good for teaching a programming language. Or... is it personal preference of the adviser?


title: In hindsight, is basing XAML on XML a mistake or a good approach?

text: XAML is essentially a subset of XML. One of the main benefits of basing XAML on XML is said to be that it can be parsed with existing tools. And it can, to a large degree, although the (syntactically non-trivial) attribute values will stay in text form and require further parsing. There are two major alternatives to describing a GUI in an XML-derived language. One is to do what WinForms did, and describe it in real code. There are numerous problems with this, though it’s not completely advantage-free (a question to compare XAML to this approach). The other major alternative is to design a completely _new_ syntax specifically tailored for the task at hand. This is generally known as a domain-specific language. So, in hindsight, and as a lesson for the future generations, was it a good idea to base XAML on XML, or would it have been better as a custom-designed domain-specific language? **If we were designing an even better UI framework, should we pick XML or a custom DSL?** Since it’s much easier to think positively about the status quo, especially one that is quite liked by the community, I’ll give some example reasons for why building on top of XML _might_ be considered a mistake. Basing a language off XML has one thing going for it: it’s much easier to parse (the core parser is already available), requires much, _much_ less design work, and alternative parsers are also much easier to write for 3rd party developers. But the resulting language can be unsatisfying in various ways. It is rather verbose. If you change the type of something, you need to change it in the closing tag. It has very poor support for comments; it’s impossible to comment out an attribute. There are limitations placed on the content of attributes by XML. The markup extensions have to be built "on top" of the XML syntax, not integrated deeply and nicely into it. And, my personal favourite, if you set something via an attribute, you use _completely different syntax_ than if you set the _exact same thing_ as a content property. It’s also said that since everyone knows XML, XAML requires less learning. Strictly speaking this is true, but learning the _syntax_ is a tiny fraction of the time spent learning a new UI framework; it’s the framework’s concepts that make the curve steep. Besides, the idiosyncracies of an XML-based language might actually add to the "needs learning" basket. Are these disadvantages outweighted by the ease of parsing? Should the next cool framework continue the tradition, or invest the time to design an awesome DSL that can’t be parsed by existing tools and whose syntax needs to be learned by everyone? P.S. Not everyone confuses **XAML** and **WPF** , but some do. XAML is the XML-like thing. WPF is the framework with support for bindings, theming, hardware acceleration and a whole lot of other cool stuff.


title: What are the downsides of RoR?

text: I'm currently trying to decide what server-side language to learn and use for web development, and while it's relatively easy to get information on why x, y, or z is a good thing, it's harder to figure out the downsides to each of them. In particular, I'm curious about what drawbacks there are to learning and/or using Ruby on Rails as opposed to any other given language/framework.


title: Good Programming Competitions for Highschool Students

text: What are good programming competitions (or web design competitions) available for highschool students in the Northeast (I am looking for a pretty long/comprehensive list)- of the USA? The competitions must either allow you to chose what language to use or must be in PHP or C. They can either be single coder or group coding competitions. Thanks you to anyone who can help me out.


title: Are tree structures inherently bad for mark-and-sweep garbage collector performance?

text: I'm implementing a bounding volume hierarchy in F#. Since it would be for a game, I want the garbage collector to be as quick and infrequent as possible. It seems though that I may have to pull some whacky tricks, probably pre- allocating everything. That means that I can't have many things immutable, and that I have to know up front how large my tree will be -- a major annoyance. I'll probably end up biting the bullet and doing just that (or maybe just go back to C++), but for the record, are trees inherently bad for GC performance? They would seem to be, considering the mark stage would have to traverse a lot of nodes.


title: How to master C++?

text: I am a grade 11 student and have Computer Science... I just love the subject.. We are doing C++ ... I have loadsss of interest in this subject ... I am kind of able to do the programs but would like to master C++ before college itself... It would be kind enough if someone can tell me some sites where there are source codes of some good programs (specially library systems)...Also, can anyone recommend any books! Moreover, to have a profession as a C++ programmer, what is required? I mean what type of courses in college should I apply to? Do I need to do Computer Engineering for this?


title: BIG O - Algorithm Case Analysis

text: Why is big O most commonly associated with worst and average case complexties of a function


title: What equipment do you use to avoid wrist pain?

text: I've recently been trying to improve the ergonomics of my workspace, and as a part of that I'm looking into how I can improve the hardware I use. Do you use a standard keyboard, a shaped one, or a split one? Mouse or trackball? Are there any other accessories you can't live without?


title: Is the 'C' in MVC really necessary?

text: I understand the role of the model and view in the Model-View-Controller pattern, but I have a hard time understanding why a controller is necessary. Let's assume we're creating a chess program using an MVC approach; the game state should be the model, and the GUI should be the view. What exactly is the controller in this case? Is it just a separate class that has all the functions that will be called when you, say, click on a tile? Why not just perform all the logic on the model in the view itself?


title: Is the agile approach compatible with having contractors on staff?

text: On the one hand, the agile approach stresses a tight-knit team that holds each other accountable and accepts collective ownership of the project. On the other hand, companies use contract programmers so that they can manage the peaks and valleys of funding without laying off actual employees. If there is a shortfall in funding, the contractors are the first to go, even if they are fully integrated members of the team (and there are employees are not). Companies also only like to keep contractors around for a limited amount of time. This is somewhat mitigated by the possibility that some contractors could be brought on as regular employees. Thus my question of whether there is a fundamental contradiction of having an agile team with a mix of employees and contractors, and the vastly different statuses that entails? * * * EDIT: The answers are indicating that I may not have expressed the tension I'm facing well, so let me take another shot. I'm a permanent employee. The agile approach (at least as implemented here) encourages me to see all team members, both permanent employees and contractors, as equal members of a cohesive team. The corporate approach to contractors encourages me to see them as expendable resources to whom we shouldn't become overly attached. I'm curious how others have resolved this tension.


title: VB6 to .Net 4.0 Conversion 3rd party tools

text: Since Visual Studio 2010 does not come with a VB6 conversion tool, the boss wants to use a 3rd party tool (i.e VBUC) that Microsoft is suggesting. Has anyone used one of these 3rd party tools/services? If so, have you found them to be worth the money?


title: How to interest my 8 yo child about programming?

text: I tried to make him interested, but he got bored very quickly and got back to his iPad games. I want to try again. Any idea how to approach this?


title: What is the historical reason why Python uses the double underscore for Class Private members

text: In python a module private function or variable is named `_foo`. If it is private to a class it is names `__foo`, The mechanics behind how these work are different, however that is of little relevance to the question. Why, during the design of the Python language was the double underscore characters chosen for class private members? Why not single underscore, like for module private? Why not some other character that is more visible? (Differentiating between _ and __ is hard). I'm sure there is some history here, but I'm having trouble finding it, because all I find are tutorials telling me what it means, rather than why it is that way.


title: Where should you be at with 5 years experience?

text: **Backround:** I am currently a Junior in college working towards a degree in MIS. I've been interning with a compnay for a 3 summers and a winter break in there. With only 11 months to go before I start marketing myself to potential employers I've decided to teach myself as much as possible about languages and platforms that are currently in high demand. My school offers job placement, but I've heard stories where it doesn't work out so well for applicants. Its this reason I've started doing searches for jobs online - Dice, Monster, CareerBuilder, etc. It seems that the only jobs I can find reequire at least up to 5 years experience. I also know not every requirement needs to be exact. **Situation:** Although I've not been in the field for 5 years, I would like to assure employers that I'd be able to keep up with someone who was. Experience is critical to self-development but I need somewhere to gain that experience. If you were an employer looking for someone with 5+ years experience, what would you expect them to know? How can you tell a 2 year from a 5 year besides a resume? I know this question is very general and it could apply to many different levels. I'm mainly concerned with programming languages such as C#, Java, etc. I won't be an expert on either but I want to know what I can at least set as a goal? **EDIT** : I found this website that explains the progression of skills that I though gave me an idea of where I stand. I know it doesn't specify years like I asked but it was helpful nonetheless.


title: Implementing a basic interpreter - should I learn regular expressions?

text: For fun and for practice, I'm thinking of maybe implementing a very basic programming language to run on a simple interpreter written in Java. My question is this: **Is it a 'must' to know regular expressions when designing an interpreter, for parsing the text?** Should I learn this topic before starting to implement the interpreter? Or is it enough to just run through the text, break down into strings, etc, i.e. do 'basic parsing' without regular expressions?


title: What is the differences between committing and patching?

text: I am quite new to source control and would like to know the differences between committing and patching? Also, how/when a patch is use and can it be used on a web application?


title: Has anyone ever claimed a warranty on an SSL certificate?

text: SSL certificates often advertise varying amounts of warranties or guarantees, for example $500,000 or $1m. My question is, in the history of SSL, has anyone ever actually successfully claimed one of these warranties? Has there ever been a case? If not, is it fair to assume they are just marketing gimmicks?


title: Why is it said that V-model introduces QA?

text: In several articles and books I learnt that "V-model introduced QA into SW development". I would like to understand the point of such statement, as from my understanding, V model activities (verification and validation) cannot be considered as QA as both deal directly with product control, no matter if it's static (verification) or dynamic (validation). I would agree that testing (say V&V) is a tool used by QA to measure the quality, but how does it assure it? Examples in Google Books:   _"Real-Time Systems Design and Analysis: Tools for the Practitioner"._ " **..these QA activities form the heart of the V model...** "   or   _Iterative Software Engineering for Multiagent Systems: The MASSIVE..:_ **the V-Model adds explicit quality assurance mechanisms to the Waterfall model: verification is concerned...**


title: Graph traversal and filtering in indoor navigation and path finding

text: Which of the following options take less processing time/is less expensive in a graph traversal algorithm for a (indoor)navigation system? a) To produce all possible paths between start and destination points (nodes on the graph) then applying a filtering mechanism to match the navigation user's capabilities and preferences (such as finding all the paths on the graph and then exclude stairways for wheelchair users), or b) As soon as the user's profile is available to the system, filter the graph and exclude the paths which are non-traversable for this user and then run a shortest path algorithm?


title: If the bug is 5+ years old, then is it a feature?

text: Allow me to add details: I work at an institutional place with many coders, testers, QA analysts, product owners, etc. and here is something that bugs me: We have been able to sell crappy (albeit pretty functional) software for over a decade. It has many features and the product is competitive, but there are a some serious bugs out there, as well as thousands of "paper cuts" - little annoyances that clients need to get used to. It pains me to look at some of the things because I firmly believe that if computers do not help to make our lives easier, then we should not use them. I have confidence in my colleagues - they are smart, able, and can improve things when the focus is on doing that. But, it can be difficult to file bugs against some old functionality without seeing them closed or forgotten. "It worked like that for eons" is a typical answer. Also, when QA does regression, they tend to look for anything that is different as much as anything that does not seem right. So, a fix to an old problem can be written up as a bug, because "it has been like that before even my time". The young coder in me thinks: rewrite this freaking thing! As someone who had the opportunity to be close to sales, clients, I want to give a benefit of a doubt to this approach. I am interested in your opinion/experience as well. Please try to consider risk, cost-to-benefit, and other non-technical factors.


title: How to obtain GPS Coordinates for local businesses?

text: Is anybody aware of a database that consists of businesses, addresses and GPS location information, preferably searchable by city at a minimum? I have an application in mind that I'd like to develop and would like to know if someone is doing this for free or cheap in possibly a web service or similar open format.


title: Is there a viable alternative to the agile development methodology?

text: The two predominant software-development methodologies are waterfall and agile. When discussing these two, there is often much focus on the particular practices that distinguish them (pair programming, TDD, etc. vs. functional spec, big up-front design, etc.) But the real differences are far deeper, in that these practices come from a philosophy. Waterfall says: _Change is costly, so it should be minimized._   Agile says: _Change is inevitable, so make change cheap._ My question is, regardless of what you think of TDD or functional specs, is the waterfall development methodology really viable? Does anyone really think that minimizing change in software is a viable option for those that desire to deliver valuable software? Or is the question really about what sort of practices work best in our situations to manage the inevitable change?


title: Which mobile development platform is easiest to develop?

text: From your experience in developing mobile apps, which mobile development platform is easiest to develop? iOS, Android or WinPhone 7? And why would do you think it is the easiest? If you can order it from easiest to most difficult it is even better.


title: how do I form a team which is remote?

text: I've got a bit of a challenge. While I'm not "in charge" I'm certainly lead developer on a project and my team will be scattered to high heaven. I've got someone who works on Fridays only, and probably 2 people who will be 3-4 hours away in another state. (One of the lovely side effects of partnering with multiple universities). Anyway, how can I get them all on the same "team"?? I've read a bunch of Joel Spolsky's stuff, but I can't create the same kind of environment that he uses. This is also the first project I'll be lead on, so it's kindof make-or-break. Specifically I'm looking for managing styles (personality), process models, project management (scrum?), video conferencing tools, and the like. I just don't have any resources for this kind of thing, and I'm afraid I'm going to be stuck doing too much work. Thanks,


title: Reasons for looking to change a job - What do you give

text: What reasons do you usually give when you are looking for a change to your prospective employer/recruitment consultants?   1. I need a change, which is basically this question but here, I am asking it more specifically as a response to the recruitment consultants.    2. I am interested in working in .NET 4.0 but my current organization is still stuck on VB6.0   3. I am working in the Telecom sector and I want to move to the Financial Sector.   4. ... The above are more or less responses that either some of my friends (including me) have given or we have heard. What would you classify as a **definite NO NO** reason? More importantly, what would you classify as an acceptable reason?


title: Why is the finalize method included in Java?

text: According to this post, we should never rely on the finalize method to be called. So why did Java include it in the programming language at all? It seems like a terrible decision to include in any programming language a function that _might_ get called.


title: How to execute batch jobs via webservices or rest api

text: I have an AppHarbor site where I need to do weekly updates to some of the data. I don't want to go the route of deploying an exe and adding an additional "webworker" to my site because those cost money. My thought is to add a web service/REST api service to the site so I can just call it, it will execute the "batch job stuff", then when it's complete, return a custom status code, like success or failure. Behind the scenes, it would update a "BatchLog" table or something like that, then I could create a page/view where I could access the log details and see which batch processes did or did not run. So, that's how I'm thinking I want to implement, but I'm a little skeptical of the security around this. First of all, obviously I don't want ANYONE to be able to kick off these batch jobs just by going to my web service/rest api. To fix that, I'm thinking there are 2 different ways to do this, or a combination of both. 1) Require some credentials and maybe an additional secret code in order to get them to actually kick off. 2) Configure in a table when each batch job can actually run, and the frequency. That way, if a hacker does call my service/rest api. It will only be able to execute 1 time per hour/day/week/month/etc. So they could hammer the service, but each successive call would just return a failure, or something like that. One thing to note, I read someplace a couple months ago that there are cloud services out there that will "schedule" batch jobs like this for you. And the free one that I read about will do 1 service. Any more than 1 and you have to start paying for it. So for my example, I'd just create one service, and have it called multiple times per day/week, and let my BatchJob configuration table determine whether it actually needs to process or not. So, how horrible of an idea is this? What are some other approaches to accomplishing batch jobs in a cloud environment where they don't offer batch services.


title: Issue Management

text: I know this isn't about `programming` but i should learn "`Issue Management`" What is `Issue Management`? I read Wikipedi page but i don't understand very well. Can you tell me `Issue Management` and if there is some product for this subject?


title: Is Akka a good solution for a concurrent pipeline/workflow problem?

text: **Disclaimer:** I am brand new to Akka and the concept of Actors/Event-Driven Architectures in general. I have to implement a fairly complex problem where users can configure a "concurrent pipeline":               Pipeline: consists of 1+ Stages; all Stages execute sequentially         Stage: consists of 1+ Tasks; all Tasks execute in parallel             Task: essentially a Java Runnable      As you can see above, a `Task` is a `Runnable` that does some unit of work. Tasks are organized into `Stages`, which execute their `Tasks` in parallel. `Stages` are organized into the `Pipeline`, which executes its `Stages` _sequentially_. Hence if a user specifies the following Pipeline:               CrossTheRoadSafelyPipeline         Stage 1: Look Left             Task 1: Turn your head to the left and look for cars             Task 2: Listen for cars         Stage 2: Look right             Task 1: Turn your head to the right and look for cars             Task 2: Listen for cars      Then, Stage 1 will execute, and _then_ Stage 2 will execute. However, while each Stage is executing, it's individual `Tasks` are executing in parallel/at the same time. In reality Pipelines will become very complicated, and with hundreds of Stages, dozens of Tasks per Stage (again, executing at the same time). To implement this Pipeline I can only think of several solutions:   1. **ESB/Apache Camel**   2. **Guava Event Bus**   3. **Java 5 Concurrency**   4. **Actors/Akka** Camel doesn't seem right because its core competency is _integration_ not synchrony and orchestration across worker threads. Guava is great, but this doesn't really _feel_ like a subscriber/publisher-type of problem. And Java 5 Concurrency (`ExecutorService`, etc.) just feels too low-level and painful. So I ask: is Akka a strong candidate for this type of problem? If so, how? If not, then why, and what is a good candidate?


title: Naming convention: Final fields (not static)

text: Today I had a discussion with a co-worker about the naming of `final` fields in Java classes. In his opionion `final` fields should also be considered constants since their values won't change after the creation of the instance. This would lead to the following naming convention for `final` fields:               public class Foo {         private static final String BLA_BLA = "bla";              private final String BAR_BATZ;              ...     }      In my opinion only `static final` fields should be considered constants while fields which are only `final` should follow the usual camelCase naming convention.               public class Foo {         private static final String BLA = "bla";              private final String barBatz;              ...     }      Now I'm a bit uncertain since he is a far more experienced programmer than I am and I usually agree with his opinions and consider him a very good developer. Any input on this?


title: Best practices when dealing with lots of empty table columns?

text: I have a schema that allows for multiple post types in my Django project (kinda like Tumblr). Users can make Posts of different types. One of those types is a photo, which I'll want the EXIF data for. If I have a super generalized table, does it make sense to create additional columns for the exif data? This would result in a ton of empty columns for every post type that isn't Photo. Alternatively, would it make sense to create a separate model for photos completely and create a foreign key to the Posts model instead?


title: TDD, new tests while old ones not implemented yet

text: I am experimenting with test-driven development, and I found that I often come to a following situation:   1. I write tests for some functionality X. Those tests fail.   2. While trying to implement X, I see that I need to implement some feature Y in a lower layer of my code. So...   3. I write tests for Y. Now both tests for X and Y fail. Once I had 4 features in different layers of code being worked on at the same time, and I was losing my focus on what I am actually doing (too many tests failing at the same time). I think I could solve this by putting more effort into planning my tasks even before I start writing tests. But in some cases I didn't know that I will need to go deeper, because e.g. I didn't know the API of lower layer very well. What should I do in such cases? Does TDD have any recommendations?


title: F# open source project hosting using SVN

text: I'm looking to choose open source project hosting site for an F# project using SVN. CodePlex is where the .NET community in general and most F# projects are hosted, but I'm worried TFS + SvnBridge is going to give me headaches. So I'm looking elsewhere and seeking advice here. Or if you think CodePlex is still the best choice in my scenario, I'd like to hear that too. So far, Google Code is looking appealing to me. They have a clean interface and true SVN hosting. But there are close to no F# projects currently hosted (it's not even in their search by programming language list), so I'm wondering if there are any notable downsides besides the lack of community I might encounter. If there is yet another option, I'd like to hear that too. Thanks!


title: What are the advantages and disadvantages of cryptographically signing commits and tags in Git?

text: So someone peer reviewed my work, and he told me that I should always sign my commits and tags cryptographically. When asked why, he didn't know to explain it to me, and said "It's just a good thing to do". Trying to avoid an obvious chimpanzee scenario, why should I really? Are there really so many distinct advantages and no disadvantages? **What are the practical reasons which would make me want to sign every commit and tag I make?**


title: Database GUI Programming - .Net vs MS Access

text: MS Access gets pooped on a lot because A) many newbies use it B) people use it as a database backend which is not a good idea. I'd like to see some reasonable discussion on why you might choose VB.Net over MS Access or vice versa for programming a Database GUI (forms and reports) to be used with MS SQL Server.


title: Is there a cheaper non-express non-student, non-msdn version of Visual Studio 2010 that supports plugins in the US than the $710 Professional Edition?

text: I've never actually purchased a copy of Visual Studio myself. SharpDevelop and Express edition have always been good enough for my personal use, and my employers always furnished me with the IDEs I needed to serve them. However, I'm thinking of actually paying for a copy for my personal laptop. I need this mainly so I can open solutions that contain web projects. So my question is: Is there an edition cheaper than the $710 Pro edition on Amazon that will do what I need: http://www.amazon.com/Microsoft-C5E-00521-Visual-Studio- Professional/dp/B0038KTO8S/ref=sr_1_2?ie=UTF8&qid=1287456230&sr=8-2 ? What I need is defined as:   1. Open up a solution with C#, Web App, VB.NET, and Web Projects.   2. Install addins like resharper, testdriven.net, etc, SCM plugins, etc.   3. Some level of db project support. At least to be able to open a dbproj. I only need that for SCM hooks. SSMS and SQLCMD are good enough for actually editing databases.   4. Ability to install F#, IronPython, IronRuby etc. Now naturally I'm a fairly intelligent resourceful person so I realize I can get Visual Studio in a questionable manner. Thats not what I'm looking to do. I want a legal copy, I don't want a student copy, or an MSDN copy. I want a real copy, I just want to make sure I get the cheapest edition that serves my needs.


title: Best arguments for/against introducing ORM technology into a companies dev process

text: I have started using ORM technology in the last few years. My first exposure was NHibernate. I then moved onto Linq 2 Sql, and Entity Framework. The issue I have however is, there are some organisations where I have found strong opposition to introducing ORM tools. They usually have a number of reasons:   * they have a lot of built up SQL skills in the team, and are worried about the underlying SQL that ORM's generate.   * they have DBA's who like to be able to see the SQL an app uses in order that can review it for best practice.   * they are worried about performance (some people have "heard" the ORM's aren't as performant but have no real proof themselves - there may well be some truth in this! :). So, I'm looking for the best or most convincing arguments that you have put forward FOR the use of ORM tools. Equally, I would be interested in the against arguments too. Note: this is NOT a discussion over which ORM I should use.


title: Should I go with PHP.NET and Resharper or PHPStorm

text: I am a fairly adept .NET and PHP programmer. These days my pattern of choice for complex web apps is an SOA approach where I use PHP as the front end, and WCF web services as the middle tier. My ajax calls are usually to JSON webHttpBinding WCF endpoints. On the .NET side of things I am absolutely in love with the Visual Studio plugin ReSharper. So my question is as follows, I want to rethink my tool chain on the PHP side of things. On one side JetBrains, the makers of Resharper, have a PHP IDE called PHPStorm. On the other side, I can use VS.PHP and ReSharper. Does anyone use the later combination fo VS.PGP and Resharper? Can you recommend it?


title: Algorithm to infer tag hierarchy

text: I'm looking for an algorithm to infer a hierarchy from a set of tagged items. E.g. if the following items have the tags:               1 a     2 a,b     3 a,c     4 a,c,e     5 a,b     6 a,c     7 d     8 d,f      Then I can construct an undirected graph (or graphs) by tallying the node weights and edge weights:                node weights  edge weights           a 6           a-b 2      b 2           a-c 3      c 3           c-e 1      d 2           a-e 1  <-- this edge is parallel to a-c and c-e and not wanted      e 1           d-f 1      f 1      The first problem is how to drop any redundant edges to get to the simplified graph? Note that it's only appropriate to remove that redundant a-e edge in this case because something is tagged as a-c-e, if that wasn't the case and the tag was a-e, that edge would have to remain. I suspect that means the removal of edges can only happen during the construction of the graph, not after everything has been tallied up. What I'd then like to do is identify the direction of the edges to create a directed graph (or graphs) and pick out root nodes to hopefully create a tree (or trees):                trees                       a        d        // \\      |       b     c     f              \                    e           It seems like it could be a string algorithm - longest common subsequences/prefixes - or a tree/graph algorithm, but I am a little stuck since I don't know the correct terminology to search for it.


title: Best Practices PHP mvc routing

text: I have a custom MVC framework that is in a constant state of evolution. There's a long standing debate with a co-worker how the routing should work. Considering the following directory structure:               /core/Router.php     /mvc/Controllers/{Public controllers}     /mvc/Controllers/Private/{Controllers requiring valid user}     /mvc/Controllers/CMS/{Controllers requiring valid user and specific roles}      The question is: "Where should the current User's authentication be established: in the Router, when choosing which controller/directory to load, or in each Controller?" My argument is that when authenticating in the Router, an Error Controller is created instead of the requested Controller, informing you of your mishap; And the directory structure clearly indicates the authentication required. His argument is that a router should do routing and only routing. Leave it to the Controller to handle it on a case by case basis. This is more modular and allows more flexibility should changes need to be made by the router. PHP MVC - Custom Routing Mechanism alluded to it, but the topic was of a different nature. Alternative suggestions would be welcomed as well.


title: Tips for developing with a remote team?

text: My company has corporate offices around the country and I have been hired under contract to work in one office while the rest of my team works in another. We are in the same time zone, but definitely remote. I have not met the team yet, but will be flying up there soon. What is your best advice for integrating and developing with this team? What are the most important priorities? Standard versioning control, e-mail, phone, conference call and IM are all available resources, however Google apps, Skype and the like are not for security reasons.