title: Is chartership important for software engineers?

text: I'm based in the UK and have been developing software for over 10 years so think I am a reasonable way through my career. On and off in various jobs I have had I have been members of various institutions, the BCS and the IEE being the main ones. At the moment I am not a member of either. I have tended to work in areas where most people are system engineers rather than software engineers but there has generally been a push to try and get everyone chartered at a level or other. However I actually do not know what use chartership has for me. Many senior people I have worked with say hat they have never bothered. It has never been part of any interview I have been one and it seems to make no difference to pay/training/conditions etc. So, can anyone tell me if looking at chartership for software roles is useful or important and if so, should I be looking at BCS or IEE?


title: How to get initial API right using TDD?

text: This might be a rather silly question as I am at my first attempts at TDD. I loved the sense of confidence it brings and generally better structure of my code but when I started to apply it on something bigger than one-class toy examples, I ran into difficulties. Suppose, you are writing a library of sorts. You know what it has to do, you know a general way of how it is supposed to be implemented (architecture wise), but you keep "discovering" that you need to make changes to your public API as you code. Perhaps you need to transform this private method into strategy pattern (and now need to pass a mocked strategy in your tests), perhaps you misplaced a responsibility here and there and split an existing class. When you are improving upon existing code, TDD seems a really good fit, but when you are writing everything from scratch, the API you write tests for is a bit "blurry" unless you do a big design up front. What do you do when you already have 30 tests on the method that had its signature (and for that part, behavior) changed? That is a lot of tests to change once they add up.


title: JSF problems due to shared server-side state

text: On it's latest technology radar, the guys at ThoughtWorks recommended avoiding JSF because it's attempt to create statefulness over HTTP ends up "causing a whole host of problems involving shared server-side state". I've been using JSF 2.x for almost a couple years now, I like it and I can't say I've encountered any problems like that. But I don't have that much experience with it and much less with alternatives, so I would like to understand what are those "whole host of problems"? Questions about JSF usually raise some heated discussions, so I think it pays to be clear: this is about JSF 2.x, but not about it being better or worse than X or Y, whether it's architecturally right to put state in HTTP, or anything like that. I'd just like to know what are those problems since the radar doesn't go on specifics.


title: How can you filter out irritable programmers in interviews?

text: So I've had a few situations now where programmers have passed the interview teams with flying colors, only to find when they arrive on scene, they demonstrate an extreme touchiness any time any criticism is leveled their way. I'm not talking about off-day irritability, but a 24/7 bruised ego thing. For certain employees this pertains to code review feedback, but others it can even include debugging suggestions (even if they're right). How do you filter out touchy candidates during the interview process in a manner that won't get you in trouble with HR? (I'm thinking something far short of Blade Runner here). Additionally, how can you help those types of programmers better deal with both real and perceived criticisms?


title: What are some techniques I can use to refactor Object Oriented code into Functional code?

text: I've spent about 20-40 hours developing part of a game using JavaScript and HTML5 canvas. When I started I had no idea what I was doing. So it started as a proof of concept and is coming along nicely now, but it has no automated tests. The game is starting to become complex enough that it could benefit from some automated testing, but it seems tough to do because the code depends on mutating global state. I'd like to refactor the whole thing using Underscore.js, a functional programming library for JavaScript. Part of me thinks I should just start from scratch using a Functional Programming style and testing. But, I think refactoring the imperative code into declarative code might be a better learning experience and a safer way to get to my current state of functionality. Problem is, I know what I want my code to look like in the end, but I don't know how to turn my current code into it. I'm hoping some people here could give me some tips a la the Refactoring book and Working Effectively With Legacy Code. * * * For example, as a first step I'm thinking about "banning" global state. Take every function that uses a global variable and pass it in as a parameter instead. Next step may be to "ban" mutation, and to always return a new object. Any advice would be appreciated. I've never taken OO code and refactored it into Functional code before.


title: Design Patterns - Service Layer

text: I currently reading a lot about Design Patterns and I have been watching various Pluralsight videos from their library. Now so far I have learnt the following:   1. Repository Pattern   2. Unit of Work Pattern   3. Abstract Factory Pattern   4. Reading the awesome "DI in .NET" book Now I read lot about **Services** and **Service Layers** and wanted some advice about the best place to read up and learn about these. I presume this fits into Domain Driven Design and I should start there? The term "Service" just seem to be used widely within IT and it can be confusing the exact meaning. So my questions is:   1. What is the **Service Layer**   2. Where is the best place to learn about them. I know there are probably tonnes of interweb/books/blogs on the subject, but some good areas to start from would be nice. If I'm being too vague, let me know.


title: Inheritance, commands and event sourcing

text: In order not to redo things several times I wanted to factorize common stuff. For Instance, let's say we have a cow and a horse. The cow produces milk, the horse runs fast, but both eat grass.               public class Herbivorous     {        protected int Quantity;             public void EatGrass(int quantity)        {           var evt= Build.GrassEaten                         .WithQuantity(quantity);           RaiseEvent(evt);        }             public void Apply(GrassEaten evt)        {            _quantity= evt.Quantity;        }     }          public class Horse : Herbivorous     {        private bool _HasFastRun;             public void RunFast()        {           var evt= Build.FastRun;           RaiseEvent(evt);        }             public void Apply(FastRunevt)        {            _HasFastRun= true;        }     }          public class Cow: Herbivorous     {        private bool _IsMilkProduced;             public void ProduceMilk()        {           var evt= Build.MilkProduced;           RaiseEvent(evt);        }             public void Apply(MilkProduced evt)        {            _IsMilkProduced= true;        }     }      To eat Grass, my application receives a command in Json or xml, or whatever that deserialise into this class:               namespace Herbivorous     {        public class EatGrass : CommandBase        {           public Guid IdHerbivorous {get; set;}           public Guid CommitId {get; set;}           public long Version {get; set;}           public int Quantity {get; set;}        }     }      The command handler should be :               public class EatGrassHandler : CommandHandler<EatGrass>     {        public override CommandValidation Execute(EatGrass cmd)        {           Contract.Requires<ArgumentNullException>(cmd != null);           Herbivorous herbivorous= EventRepository.GetById<Herbivorous>(cmd.Id);           if (herbivorous.IsNull())              throw new AggregateRootInstanceNotFoundException();           herbivorous.EatGrass(cmd.Quantity);           EventRepository.Save(herbivorous, cmd.CommitId);        }     }      so far so good. I get a Herbivorous object , I have access to its EatGrass function, whether it is a horse or a cow doesn't matter really. The only problem is here :               EventRepository.GetById<Herbivorous>(cmd.Id)      Indeed, let's imagine we have a cow that has produced milk during the morning and now wants to eat grass. The EventRepository contains an event MilkProduced, and then come the command EatGrass. With the CommandHandler, we are no longer in the presence of a cow and the herbivorious doesn't know anything about producing milk . what should it do? Should I have explicit contextual command like :               namespace Herbivorous.Cow         {            public class EatGrass : CommandBase            {               public Guid IdHerbivorous {get; set;}               public Guid CommitId {get; set;}               public long Version {get; set;}               public int Quantity {get; set;}            }            public class ProduceMilk : CommandBase            {               public Guid IdHerbivorous {get; set;}               public Guid CommitId {get; set;}               public long Version {get; set;}            }         }      This would mean that the external component that asks my herbivorous to eat grass should know that in this bounded context we talk about a cow. in the former command, we were talking about a general Herbivorous behavior, so the context of my call was not important. We knew that we needed herbivorous to eat grass that was all. This is my main problem possible leakage of domain specific from one bounded context to another. Actually It might mean too that I cannot support abstraction when working on interfaces between several applications. I wonder... Or I could just accept any event when rebuilding my herbivorous. It means that if it does not find a method to apply this event to, he will goes just fine trying to apply the next one of its stream. This is the real simple solution, but it does not put me at ease to know that events might not be applied ( and not producing errors) when rehydrating my object. (Actually the more I think about it the less I feel guilty..) Thanks for your help, I am just beginning with these kinds of problem, and I would be glad to have some news from someone more experienced.


title: Why large projects with big budgets are more likely to fail?

text: I have heard two reasons why information systems projects fail.   1. Large projects with big budgets are more likely to fail   2. When there are two isolates teams, one doing the software design and the other implementation. These two failure reasons are described as recipes for disaster, but I don't understand that. Can anyone explain why these are recipes for disaster?


title: LGPL and commerical application in PHP

text: I have rather specific question about licensing but first of all I would just like to state that I already read a lot of Q&A's here but I'm still not sure about the problem in that particular scope. As I've understand from other Q&A's, you are allowed to distribute your commercial application even with LGPL library as long as this library can be replaced by another version of it by user himself. That means that you pack it as .dll or whatever. The rest of the application remains proprietary licensed. This is clear at all for compiled software. But my question is: how this relate to software which is not compiled (which is distributed as source code but still proprietary) like all PHP applications? To be really clear I will show you exact example. I'm building a CMS applications for various purposes. All of them are different but most of them share the same "basic element" - JavaScript WYSIWYG editor. I would like to use one which is GPL/LGPL/MPL licensed. So there are several questions:   * Can I use this LGPL editor at all so that rest of my application remains proprietary?   * What I have to do to be able to do that?   * Are there any special "ways of distributing" the library like separated ZIP archive or something like that? As for non-native English speaker it's really hard for me to read the licenses in their original form. I just don't want to get in any trouble.


title: Book recommendation and advice on Analysis Patterns: Reusable Object Models

text: I am a software developer, and have knowledge of oo design, e.g. SOLID, and looking for a good book on object-oriented modeling. Is the book below still good to read? Analysis Patterns: Reusable Object Models Martin Fowler Publication Date: October 19, 1996


title: Does anyone prefer proportional fonts?

text: I was reading the wikipedia article on programming style and noticed something in an argument against vertically aligned code: > Reliance on mono-spaced font; tabular formatting assumes that the editor > uses a fixed-width font. Most modern code editors support proportional > fonts, and the **programmer may prefer to use a proportional font for > readability**. To be honest, I don't think I've ever met a programmer who preferred a proportional font. Nor can I think of any really good reasons for using them. Why would someone prefer a proportional font?


title: Are bugs part of technical debt?

text: Our Scrum Master keeps referring to bugs as technical debt. Is he right, are bugs considered to be technical debt in the world of Agile?


title: Use of mind-mapping software in project/task management

text: I've recently "discovered" mind mapping and even found some people here recommending it. It seems like a real handy tool, but I'm not really sure how to apply it to my work and/or hobby projects. I _really_ want to organize my time and work, because I feel like my projects are stagnating lately, and that doesn't really feel nice. So I'm interested in any tips you have if you're using mind maps, how do you organize your projects, TODOs, ideas..? For example: do you keep separate mind maps for projects, tasks, ideas, or do you have separate mind maps for each project? How do you organize your project mind maps? Please share your thoughts and ideas. (Feel free to suggest alternative methods if you think mind maps suck, but state your reasons) _[Can we make this community wiki since there is no "right" answer?]_


title: Is PHP actually a web framework?

text: I was reading an article/interview ( _Language War: PHP vs. Ruby_ (by Jeffrey Way; Mar 2011)) by a developer for Envato using Ruby. He says, "PHP is a web framework disguised as a language." He didn't expound on that statement, so it got me wondering if that is true, and if so how. I did a bit of research but couldn't turn up any information on this topic. I'm wondering how this statement is true and what makes PHP not a programming language. And why do other languages like python or ruby not fit in that category?


title: Which is a better practice - helper methods as instance or static?

text: This question is subjective but I was just curious how most programmers approach this. The sample below is in pseudo-C# but this should apply to Java, C++, and other OOP languages as well. Anyway, when writing helper methods in my classes, I tend to declare them as static and just pass the fields if the helper method needs them. For example, given the code below, I prefer to use **Method Call #2**.               class Foo     {       Bar _bar;            public void DoSomethingWithBar()       {         // Method Call #1.         DoSomethingWithBarImpl();              // Method Call #2.         DoSomethingWithBarImpl(_bar);       }            private void DoSomethingWithBarImpl()       {         _bar.DoSomething();       }            private static void DoSomethingWithBarImpl(Bar bar)       {         bar.DoSomething();       }     }      My reason for doing this is that it makes it clear (to my eyes at least) that the helper method has a possible side-effect on other objects - even without reading its implementation. I find that I can quickly grok methods that use this practice and thus help me in debugging things. Which do you _prefer_ to do in your own code and what are your reasons for doing so?


title: How can you become a real programming polyglot?

text: I work as a Java programmer, but C and C++ were always my favourite languages during studies. Unfortunatelly I don't have an opportunity to work with them as often as I would like to. As a result I sometimes get realized that I don't remember something quite important (today example: inherited protected members cannot be accessed in derived class constructors). The other example could be Python and Haskell which I enjoy using but don't use everyday. I got an idea to write my own wiki with easy to forget things (e.g. bash tricks & tips) but I find no sense in writing there everything I can forget about coolest programming languages. I know that the best way would be having a side projects (I want to start working on some C/C++ open source project after graduation), but currently I have to write my graduation thesis and work so I merely don't have time to do this. How do you stay sharp in languages that you don't use everyday?


title: DDD with entities with no relations

text: _Disclaimer: I'm not 100% sure I understand some of the practices and concepts in DDD, so this question may actually be answered by clarification of the ideas_ I'm working in a legacy system (written in PHP) in which the database tool provides no object relational mapping, and thus objects coming out of the database access layer tend to be, more or less, mirrors of the rows returned by the query. For newer modules, I'm trying to apply DDD. However, I'm struggling with how to build a rich domain model when my entities have no relations. Take for example the following requirement: `users can see the messages they have previously accepted`, where a message being accepted is, internally, recorded by a single new row in a database table. Were I using an ORM and did my entities have relations, I may write something akin to `$user->getAcceptedMessages()`, which would return a collection of message entities. However, since I don't have that, I'm torn between two approaches:   1. Populate the relations as part of the building of the entity in the repository. The queries could get big, unwieldy and hard to maintain as the number of relations grows and the schema changes.   2. Create services for actions such as this, which depend on the repository and a take a user, eg `UserMessageAcceptanceService`. However, I suspect this might lead to an anemic domain model. Is either approach sensible in this scenario? Or is some form of ORM a requirement for applying DDD effectively?


title: What would be a non-contrived reason to have an object with Private Copy Constructor as well as Assignment Operator?

text: Looking for non-conceptual/non-contrived reasons of when one would need to use an object with both a `private` copy constructor and a `private` assignment operator? _As in what problem does this technique/practice solve, that some other technique couldn't solve?_


title: GPL+FE license also applies to fonts used for the UI of a software?

text: The GPL font exception allows the font to be embedded within a digital "document" file without requiring the "document" itself to also be shared with GPL. Now I wonder, what is considered a "document"? If the GPL+FE font is embedded in a software to render a user interface, the software can be released with a non-GPL license?


title: Good architecture for passing data to multiple APIs

text: * I have a hypothetical scenario where I need to pass data to APIs from multiple different providers, depending on the 'vendor identity' provided by one of the pieces of data.   * If I have the data as objects within an enumerable parent object, what would be a good way to pass the objects to the appropriate API in a reasonably loosely coupled way?   * Even if the API definition was more tightly hardcoded somehow, what would be a good way to actually pass the objects through to the API?   * I'm writing the solution in C# although it's the general architecture that matters not the specific implementation


title: What steps can I take to ensure that I successfully integrate new functionality to an existing app?

text: I may potentially have some work to implement new features to a client's existing web application. (I didn't write the original app). I've never made an app that wasn't written from scratch, and I'm worried about integrating the new features without disrupting the service for too long (or at all). I don't think the client has an existing code repository set up. I was thinking that my development process should take the following path:   * Create an SVN repository and store all the current code in there, including (or making them if needed) SQL files that would be needed to create the current database structure.   * Get the client's app functioning as it is on a test server with mock-data in the test-server's database.   * Work as far as possible in cycles to write the code for one feature at a time and then migrate this across to the live app. _This is the bit that I'm most unsure about. There will be a short period of time when I'll be uploading some new files and users will most likely experience usability problems (crashes). Should I just display a "working on the server" page while I'm doing this? How would I do that?_   * Also, it seems to me that adding one feature at a time may cause problems, because some of them expect other features to be there to work properly. I suppose the answer to this is to only add a collection of features that can exsit as a stand alone module.   * Obviously I'd be testing the new code to the max before I migrated it across. I'd be grateful for any pointers or gotchas, or comments on what I've written above. I really want this to run smoothly for my client (and for me!) Cheers


title: Good, simple reasons for having multiple environments

text: Throughout my career I had worked at companies that had a collection of different environments for different purposes. We always had more or less our desktop environment, a test environment, a QA environment, a staging environment and a production environment. This went for both servers/applications and any data sources we were using. When I started at my current company I found that 90% of the apps were either developed on a desktop environment against production data sources or developed directly on the production server depending on the platform. This wasn't particularly surprising, as I was hired in part to make changes to improve the way the development team functioned, which was clear from my interview process. We slowly started to turn the philosophy and pretty soon, most of the apps could be run in either a desktop, test or production environment. Not too long after that staging came around as well. Now most of our developers see the benefit of this methodology and defend it vigilantly. However, we have a number of legacy apps that never got migrated. We also have a number of legacy programmers who think of this as a waste of time. Unfortunately, we got lip service but never full buy-in from management. We got what we thought was a commitment to invest substantially in this about a year ago, but nothing materialized despite the considerable planning that we put into it. Now we are finding that we need more and more environments. We need help from the server/network administration teams for setup and we need participation from the business stakeholders to support the release cycle. We are at a place now where a project can function what reasonable developers would consider "normally" only if you have the right people on the project and the time to set up the proper environments. I'd love to present a complete argument, but management really has no time and interest in hearing me out until there is a critical issue. I can't really articulate the benefits simply as it always just seemed second nature to me. I was wondering if there are any **good, simple, irrefutable reasons for the separation of environments that would get managers lacking development experience to support this idea**. Are there any good resources/literature on the topic?


title: What are the things necessary to become good technical architect

text: I was just curious to know about how to become a good technical architect Or what are the things makes a Developer good architect. Please share your insights and articles.


title: About protection for important actions on the server

text: We developing a web service. And need our important actions (i.e. money transfer) to be protected from accidental calling. In frontend we asking user to confirm such actions. Ok. But how to prevent accidental calling in case of developer mistake? Is it good idea, that action require some confirmation token from developer to proceed?


title: Design questions for a Node.JS based Dashboard

text: I checked with meta and apparently this is the best place to ask! The company I work at have many environments, and as such, many Nagios/Icinga etc boxes in each environment. We currently have a dashboard, but it was created quickly many moons ago and needs replacing. It currently scrapes the HTML of every box, builds a static HTML file and repeats. I put together a proof of concept using PHP/MySQL (as I'm good at it) which has a page which is dynamically generated from a MySQL DB, and then there's a background script which fetches data from Nagios/Icinga API's (or resorts to scraping where no API present). This works fine, but I've been itching to learn Node.JS and from what I've read it's good for dashboards - especially as I may want interaction in future. So, my question is where abouts in this does Node.JS site, and where abouts does it not sit? For example, should I be using Node.JS for the dashboard itself sat on something like MongoDB (never used it, but would like to try NoSQL for once) to show people the current problems etc and then I have a script in the background in PHP/Perl that does the fetching scraping? Or (option 2) does Node do the dashboard AND the fetching of data? Do I have two instances of Node? I'd also like to have a web-based config page (like an admin settings page) rather than flat file settings - again, is this something easily done in the same Node structure or is Node quite single purpose (just display a dashboard, just fetch, just do forms etc) I could accomplish all of the above with PHP/MySQL fairly easily and quickly, but Node.JS and MongoDB seem really popular nowadays and I feel like I'm missing out.


title: Documentation required for commissioned software (product)

text: The company I work for has commissioned a software company to produce a compliance software for several big companies. As part of our contract it is required of them to provide us with src code and documentation in case in the future we want to take over and further develop the project in house or have another company take over. What are the best practices for software documentation in this case? I.e. What shall I ask of them to provide us for if a 3rd company in the future were to take over? Right now they just provided us the src code and a auto-generated class document (not even class diagram, just a list of all classes, parameters etc). I hope someone can point me in the right direction so that I can produce a small document with what our requirements are.


title: Is it considered bad practice to make a DAO call in an object's constructor?

text: I am trying to figure out the best design for instantiating an object which requires two separate calls to the data layer through a DAO. The object is not usable until these calls have been made (because it requires the data retrieved from the database). I have come up with three possible solutions:   1. Create a method in the DAO itself that gets the necessary data from the database, and then pass the data to the object's constructor. The object is passed back as the return value.   2. Create a method in the class that is using the object. This method would make both calls to public methods in the DAO, then instantiate and return the object as in step 1.   3. Pass the DAO as a parameter to the constructor of the object. The constructor would then make both necessary calls to the DAO, setting its own member variables without the need for Setters. The DAO is not used other than in the constructor. Examples, if SomeObject is the object I want to create, and Foo is the class that will make use of it: 1 - DAO Contains the logic:               public SomeObject getSomeObject(){ // this DAO method called by Foo class          data1 = getData1();          data2 = getData2();          return new SomeObject(data1,data2);     }      2 - Class that uses object contains the logic:               public class Foo {         ...              public void useSomeObject() {                   SomeObject obj = createSomeObject();                   obj.doStuff();              }                   private SomeObject createSomeObject() {                   data1 = dao.getData1();                   data2 = dao.getData2();                   SomeObject someObject = new SomeObject(data1,data2);                   return someObject;              }      }      3 - SomeObject takes DAO as parameter and uses it in constructor:               public class SomeObject {     ...           public SomeObject(DAO dao) {                data1 = dao.getData1();                data2 = dao.getData2();           }     ...      }      Hopefully these examples are sufficient to convey my point. Are any of these solution considered better design than the others? If not, what solution is considered best practice? Thanks.


title: Is VB.Net deprecated by Microsoft?

text: I have come to this web page from Sony: http://www.sonycreativesoftware.com/scripting_in_vegas_pro_and_sound_forge > We suggest you use C# for your scripts, since although you can currently > write scripts in Jscript and Visual Basic.NET, those two languages have been > deprecated by Microsoft, meaning they may cease to be supported at some > point in the future. AFAIK VB.Net is pretty healthy, and I have been unable to find any other source for that claim. FWIW, the page seems to be pretty old (screenshots have a 2008 date in their names). Can anyone shed some light on this?


title: Agile retesting

text: I wrote some code about two years ago, which was deployed to the production environment. The code deletes information that is six years old from a system. When it was first deployed there were only 300 records deleted (because only 300 were six years old). Now there are now 10,000 - 10,000 records become six years old tomorrow. I want to retest the code but the project manager is against this (because it takes time - one day). The deletion routine is very complex (the six year rule is only one of the rules but is the main rule). The system has evolved over the last two years. Is it reasonable to set some time for retesting or should I assume that is it worked at the time then it will work now (as the project manager assumes)? Is there an Agile process that describes this sort of testing?


title: Strategy with using SVN to switch between test and production server. (with maintaining configuration files)

text: I would like to know your opinion about my setup right now, how I do things with SVN and if you could find some better solution for me. I'd appreciate it very much if someone could come up with some better solutions for my problems. I would like to do it the best way possible and the most efficiently. My situation is as follows: I'm maintaining a PHP website which is connected to mysql database. I have a subdomain on which I'm testing everything. There are also two databases: first for testing purposes, second for the production server. I have a project in Netbeans and I'm connected to ftp with it so every change I make is directly transferred to the website. Also I'm connected to SVN server and the testing part of the website is in trunk directory. Every time I want to upload the changes to the server I'm commiting my trunk and then I'm copying it to tags. After that I got another project in Netbeans prepared, already connected to the same SVN, but to the last tag copy. After I copy the trunk to tag directory, I switch to the second project and switch to the newest version in tags. Now I have in some another directory every configuration file prepared in proper directory structure - I copy it to my production project. After that I click "Run" in Netbeans and that opens a window which allows me to accept the transfers to the sftp, but this time to the production part of the website. My question is: is it the best way? Aren't there any more intuitive tools or options in SVN, so I don't have to copy the configuration files every time?


title: Is PGM (Pragmatic General Multicast) viable to achieve reliable message delivery with IP multicast?

text: I have a server application that distributes stock quotes to a number of clients on our internal network. As the number of clients has grown, unicast (TCP) connections between the server and the clients do not scale anymore. Hence, I have been looking into multicasts. Because of the inherent unreliability of IP multicast, I have been looking into reliable multicast and found Pragmatic General Multicast (PGM). Things like NAK suppression, forward error correction etc. sound like just the things I need and would have to implement myself when using raw UDP. Before I convert a mission critical application to this protocol, there are a couple of questions:   * **How widely used is PGM?** There aren’t many hits for it on Stack Overflow, Server Fault or the new Network Engineering Stack Exchange site. The RFC is from 2001 and a paper on the Microsoft Research site is from 2003. Why hasn’t this been adopted as a standard already?   * **How viable is the Microsoft implementation of PGM?** The documentation is extremely sparse and most projects using PGM (e.g. zeroMQ) seem to be built on top of OpenPGM. But using a socket API that comes with the operating system and that I am already familiar and that has good support in Delphi and C# (the languages I use) seems better than having to rely on additional libraries that need to be built separately and have their own dependencies. Are there any drawbacks of MS-PGM that I should be aware of?   * **What are the alternatives?** Are there other protocols that bring reliability to multicast programming, but e.g. allow for reordering of packets? That wouldn’t be a problem but actually a feature, because it would allow me to continue processing some instruments even when packets for others have been lost.


title: Reducing dependency cycles and reducing coupling

text: I'm trying to learn how to produce quality object-oriented code and have been studying concepts like SOLID. I'm currently working on an entity-component- process system for a small game engine. Currently, I have it implemented as such:   * There is a `ScreenStack` which contains a stack of `Screen`s   * Each `Screen` has an `EntityManager` and `ProcessManager`.   * The `ProcessManager` updates all `Process`es given entities from the `EntityManager`.    * A `Process` handles all game logic, so it needs to be able to use `ScreenStack` to possibly push and pop screens. It can also create, remove, and change entities, so it needs the `EntityManager` from `Screen`. Basically a `Process` needs to know everything about the game since it affects so much of it, but it feels wrong. How do I go about implementing this better? It seems like everything has a clear dependency hierarchy until you get to a process, where it gets thrown out the window. There also seems to be tight coupling when I would want to push a new screen. Say, for example, I have a process in a `MainMenu` screen that checks for menu choice. If "New Game" is clicked, I need to push a new screen, which gets created at that moment. I've read that I shouldn't randomly throw in `new` which this seems to be doing.


title: Will a MQ topic persist messages when one of the consumers is down

text: If I have a websphere MQ topic and 3 listeners have subscribed to the Topic. One listener is down when a message comes in the Topic. Other listeners consume the message. When the listener comes back up, will the message still be there? My gut feel is no, but i cannot say for sure.


title: How do you set and check a single bit in a programming language that does not support bitwise operations?

text: I'm using a programming language (more a scripting language) that does not support any bitwise operators like AND, OR, XOR, NOT (and shift as well). Common arithmetic and logical operations like + - * / % > >= < <= == !=, logical AND, OR, NOT and control flow (while, for, if,...) are supported however. It is like a "subset of C", but without these binary operators. My question does not target that particular language anyway. I was wondering if there is any (mathematical ?) way to set and check a bit at a specific position in a programming language that does not support bitwise operations :               a = 0;               //00000000b     a = togglebit(a, 5); //00100000b     a = togglebit(a, 2); //00100100b               a = 0xFE;            //11111110b     bool result = checkbit(a, 4); //true      For example, there is a way to perform a left or right binary shift using integer multiplication or division :               a = a * 2; //similar to left  shift : a = a << 1;     a = a / 2; //similar to right shift : a = a >> 1;      I'm looking for something similar but for setting or checking a flag.


title: What simple techniques do you use to improve performance?

text: I'm talking about the way we write simple routines in order to improve performance without making your code harder to read... for instance, this is the typical for we learned:               for(int i = 0; i < collection.length(); i++ ){        // stuff here     }      But, I usually do this when a `foreach` is not applicable:               for(int i = 0, j = collection.length(); i < j; i++ ){        // stuff here     }      I think this is a better approach since it will call the `length` method once only... my girlfriend says it's cryptic though. Is there any other simple trick you use on your own developments?


title: Global variable in a Linux shared library

text: Suppose we have the following setup under Linux, .so library named "libcnt.so" and 3 user space apps: "app1", "app2", "app3". This library does 1 simple thing, it says to the app (app dynamically links the library at runtime) by how many apps it is already linked. Apps should have access to link counter. My knowledge in C and Linux is somewhat limited in this aspect, but as I understand this information should be stored in a global variable inside the shared object. Something like: in libcnt.h extern int cnt_loads; in libcnt.c int cnt_loads = 0; // where each linking increments this counter or something... So, my question is how it should be declared and/or defined inside .so library to guaranty that multiple apps from user space get the same instance of that variable counter?


title: Licencing GNU GPlv3 - sofware provides a service - not distributed

text: I have a couple questions with regard to the GNU GPLv3 license. My application is closed-source and I do not intend to actually release it to the public. However, it does _generate_ commercial items. The use of dlls licensed under the above license are used and _linked_ to the software that generates these commercial products. I would just like clarification, that because the software is not actually being distributed - only what the software generates. Therefore, no release of source etc would be required. The licensed dlls are not modified in any way. Secondly, out of interest. When a GNU GPLv3 is used by commercial software (let's say this software is released). This time the licensed material is a EXE and not a .DLL and therefore not actually _linked_ to the code of the software. Rather the software is executing the licensed software directly and sending it command line style arguments and using what the exe returns. Would the source code have to be released? Thanks, I am new to the realms of these licenses and slightly confused.


title: Is Pure Fabrication (GRASP) only about 'behaviour' , is it the 'representational gap', or is it about actual 'reality'?

text: Does Pure Fabrication refer to the increased representational gap only in terms of behavioural responsibilities i.e. the software classes added to the domain model to handle ONLY behaviour, or does it include any software class which represent something which does not exist in the domain model? If it is the second option, does this mean that all Pure Fabrications together actually ARE the representational gap? Or does Pure fabrication refer to any class which represent something which does not exist in the real world? Which would mean that the separation of Pure Fabrications and other classes becomes a very scientific distinction. The trigger of this question was the text below in case some background information might help to understand my confusion. > Pure Fabrication: Problem: what object should have the responsibility, when > you do not want to violate High Cohesion and Low Coupling or other goals, > but solutions offered by Expert (for example) are not appropriate? There are > many situations in which assigning responsibilities only to domain layer > software classes leads to problems in terms of poor cohesion or coupling, or > low reuse potential. > > Solution: Assign a highly cohesive set of responsibilities to an artificial > or convenience class that does not represent a problem domain concept. > ...something made up, to support high cohesion, low coupling and reuse. Such > a class is fabrication of the imagination. E.g. a database handler. This > object will be a front-end façade on to a large number of back-end helper > objects. (persistentStorage is not a domain concept, but something made up > or fabricated for the convenience of the software developer.) > > The design of objects can be broadly divided into two groups: > >   1. Those chosen by representational decomposition. (supports the goal of > low representational gap) > >   2. Those chosen by behavioural decomposition (convenience class conceived > by the developer to group together some related behaviour or methods. > > > > (Applying UML and Patterns, Addison Wesley Professional, 2004)


title: Is it possible to write application-level logic in an XML or plain text format?

text: For example, a system where the developer does not need to write source code any more, instead they can using XML or some defined text to construct the application-level logic.


title: How do I encrypt the source code on the webserver?

text: I have a web application developed using Python, HTML, CSS & JavaScript. The customer installs it in any of their own Machine and uses it through their LAN. In short the customer sets up the webserver in any of their own machine. Since its a web application, all the source code is open for the customer in the document root directory of webserver. I want to encrypt the whole source code in the document root directory in such a way that it should not effect the working of the web application. Is there is any way to encrypt the Python, HTML, CSS & JavaScript for this purpose.


title: DevOps versus Software Engineers

text: I am aware that all the DevOps definitions are fairly vague, and this question is subjective, but it's still something I couldn't find an answer to. Is there any difference, prestige-wise, between DevOps and Software Engineers? Is the experience interchangeable? Are N years of DevOps experience interchangeable for N years of software engineering experience? Or do I even view the question in the wrong light?


title: Release Management versions control?

text: We recently experienced a deployment issue where it turned out that the version objects were not in sync in one of the environments. We have a large database group and different teams have different responsibilities and ownerships - I might code on schema X, Y, Z but I also will have dependancies on objects owned by other groups. This is the same no matter what technology - java libraries having different versions and what not. My aim is to have _something_ be in a webpage or a database table or something that I can see that for object A I have version X installed in Production, X + 1 in UAT and QA, and X + 2 installed in DEV. How do other folks handle this? How do you pick up version changes? Do you rely on SCM? Build numbers? Hash value of the source code? I'm interested in managing version consistency across technologies - java to db for instance.


title: How would you approach errors notification?

text: Recently we had a discussion with my colleagues caused by my intentional attempt to generate user friendly message about occurred error (business logic) at the server side. They insisted on putting all string localizable resources inside web client assembly and not server one. The argument is to let client decide how to generate and present messages to the user. I can't but agree with the requirement of such flexibility for public services, however we develop intranet back-office system and we develop client part as well (both thin and thick client). Frankly speaking the code I've seen so far does nothing more as generating the message (identical to the code I tried to put in BL). There is no particular controls highlighting, accurately positioned popups or something like that. But now the logic is duplicated: web client + win client. My point is that It's better to adhere to DRY and YAGNI principles. Copy paste is evil. The second argument is encapsulation. If error occurred inside Business Logic then it's BL who knows how to describe the error and what additional information should be collected and presented to the user without compromising security or revealing implementation details to the client part. For example, in case of concurrent changes we return `ConcurrenAccessError` from the server and client then converts this to "bla bla bla, object was changed by someone else, edit once again, please." Now, to add user name and timestamp of the changes I need to extend `ConcurrentAccessError` class with additional properties and change code of message generation in two places. I would ask whether client should even know about concurrency as a special error type if it does nothing about it besides user notification. System is not designed for conflict resolving via merge. I believe that high granularity of errors is important only when such structured information allows system somehow help user to make corrections. (Highlighted and focused email input field is better than just a message below the form) Well, eventually I did not manage to persuade my colleagues. I had to follow the conventions. Yet I need more pro and contra arguments to continue the discussion or agree with them. I'd like to know which strategies of error notification you usually use and why. Where do you put the logic of constructing the message?


title: Is your company thinking of transitioning from java to another technology?

text: As every Java developer knows, Oracle bought Sun and the future of java looks quite unclear, specially since Oracle wants to monetize the JVM. Java as a language has also been stale in the last few years, the non-inclusion of closures is one example (which might be included in java 1.8) At the same time, some new technologies such as Ruby, Scala and Groovy are being used to deliver complex sites. I'm wondering if there are companies or organizations which are talking, doing spikes or starting to use a different technology, with the idea to stop using java for green field projects, in the same way that 15 years ago companies migrated form C++, perl and other technologies to Java. I'm also interested to know what are the impressions of this happening, for example: planning to migrate to a different technology in 2 years. To be clear, I'm not asking which technology is better. I'm asking if your organization is thinking to leave Java for another technology.


title: Avoiding new operator in JavaScript -- the better way

text: _Warning: This is a long post._ Let's keep it simple. I want to avoid having to prefix the new operator every time I call a constructor in JavaScript. This is because I tend to forget it, and my code screws up badly. The simple way around this is this...               function Make(x) {       if ( !(this instanceof arguments.callee) )       return new arguments.callee(x);            // do your stuff...     }      But, I need this to accept variable no. of arguments, like this...               m1 = Make();     m2 = Make(1,2,3);     m3 = Make('apple', 'banana');      The first immediate solution seems to be the 'apply' method like this...               function Make() {       if ( !(this instanceof arguments.callee) )         return new arguments.callee.apply(null, arguments);            // do your stuff     }      This is WRONG however -- the new object is passed to the `apply` method and NOT to our constructor `arguments.callee`. Now, I've come up with three solutions. My simple question is: which one seems best. Or, if you have a better method, tell it. **First** - use `eval()` to dynamically create JavaScript code that calls the constructor.               function Make(/* ... */) {       if ( !(this instanceof arguments.callee) ) {         // collect all the arguments         var arr = [];         for ( var i = 0; arguments[i]; i++ )           arr.push( 'arguments[' + i + ']' );              // create code         var code = 'new arguments.callee(' + arr.join(',') + ');';              // call it         return eval( code );       }            // do your stuff with variable arguments...     }      **Second** - Every object has `__proto__` property which is a 'secret' link to its prototype object. Fortunately this property is writable.               function Make(/* ... */) {       var obj = {};            // do your stuff on 'obj' just like you'd do on 'this'       // use the variable arguments here            // now do the __proto__ magic       // by 'mutating' obj to make it a different object            obj.__proto__ = arguments.callee.prototype;            // must return obj       return obj;     }      **Third** - This is something similar to second solution.               function Make(/* ... */) {       // we'll set '_construct' outside       var obj = new arguments.callee._construct();            // now do your stuff on 'obj' just like you'd do on 'this'       // use the variable arguments here            // you have to return obj       return obj;     }          // now first set the _construct property to an empty function     Make._construct = function() {};          // and then mutate the prototype of _construct     Make._construct.prototype = Make.prototype;      * * *   * `eval` solution seems clumsy and comes with all the problems of "evil eval".   * `__proto__` solution is non-standard and the "Great Browser of mIsERY" doesn't honor it.   * The third solution seems overly complicated.  But with all the above three solutions, we can do something like this, that we can't otherwise...               m1 = Make();     m2 = Make(1,2,3);     m3 = Make('apple', 'banana');          m1 instanceof Make; // true     m2 instanceof Make; // true     m3 instanceof Make; // true          Make.prototype.fire = function() {       // ...     };          m1.fire();     m2.fire();     m3.fire();      So effectively the above solutions give us "true" constructors that accept variable no. of arguments and don't require `new`. What's your take on this. **\-- UPDATE --** Some have said "just throw an error". My response is: we are doing a heavy app with 10+ constructors and I think it'd be far more wieldy if every constructor could "smartly" handle that mistake without throwing error messages on the console.


title: Should a RESTful API provide data for an entire form?

text: Let's say I have a JavaScript web application which entirely uses a RESTful API for data. Let's say this application has a data form, and let's say I'm editing a record at /product/12345. When building the form, I make a RESTful request to /product/12345 and get JSON data:               {       "id": 12345,       "name": "Some Product",       "active": true,       "sales_user_id": 27     }      _So, my form obviously may have a dropdown list for selecting a sales person. I need to populate this list._ **Where should the data come from?** What's the most common approach? Would it make sense to make it part of the /product/12345 request response?               {       "id": 12345,       "name": "Some Product",       "active": true,       "sales_user_id": 27,       "sales_users": [         {"id": 1, "name": "Anna Graham"},         {"id": 2, "name": "Dick Mussell"},         {"id": 3, "name": "Ford Parker"},         {"id": 4, "name": "Ferris Wheeler"},         {"id": 5, "name": "Jo King"}       ]     }      What about when creating a new record? Should my API also respond to GET /product/new, with the following?               {       "sales_users": [         {"id": 1, "name": "Anna Graham"},         {"id": 2, "name": "Dick Mussell"},         {"id": 3, "name": "Ford Parker"},         {"id": 4, "name": "Ferris Wheeler"},         {"id": 5, "name": "Jo King"}       ],       "categories": [         {"id": 1, "name": "Category 1"},         {"id": 2, "name": "Category 2"},         {"id": 3, "name": "Category 3"},         {"id": 4, "name": "Category 4"},         {"id": 5, "name": "Category 5"}       ],       "etc": [ ... ]     }


title: Right multi object dependance design

text: I need some help with a correct design. I have a class called `BufferManager`. The `push()` method of this class reads data from a source and pushes it to a buffer repeatedly until there is no more data left in the source. There are also consumer threads that read data from this buffer, as soon as new data arrives. There is an option to sort the data before it comes to buffer. What I do right now is that `BufferManager`, instead of pushing data to the buffer, pushes it to another "sorting" buffer and starts a sorting thread. `SorterManager` class reads the data, sorts it in files and `push()`es the sorted data into the buffer. There will be a bottleneck (I use merge sort with files) but this is something I can't avoid. This is a bad design, because both `BufferManager` and `SorterManager` push data to a buffer (that consumers read from). I think only `BufferManager` should do it. How can I design it?


title: Choosing language to write general library in

text: I'm about to start writing a library to support machine learning algorithms (decision trees, ANNs, Bayes nets, etc.), and I'm planning on making this a very general library. By this, I mean I want to be able to plug this module into as many languages as possible. To clarify, here's why I've started writing it in C++ (Windows headers):   * I know I can import C++ libraries into C#, and I've heard you can import C++ into Python. So, obviously, the library can be used in 3 languages, possibly 4 if I don't use system-specific headers.   * Is there a language where I can cover a wider spread, weighted by popularity of languages? (For example, C# and C++ have pretty high weight to me because I use both frequently, Python less so.)


title: Which one is the fastest Message Broker in case of a single machine?

text: I would like to know, which Message Broker I should choose in case of communication among apps within a single PC, considering speed. Among Apache ActiveMQ , MSMQ , RabbitMQ , OpenAMQ which one is the fastest in case of communication among multiple apps on a single PC?


title: Constructor should generally not call methods

text: I described to a colleague why a constructor calling a method can be an antipattern. example (in my rusty C++)               class C {     public :         C(int foo);         void setFoo(int foo);     private:         int foo;     }          C::C(int foo) {         setFoo(foo);     }          void C::setFoo(int foo) {         this->foo = foo     }      I would like to motivate better this fact through your additional contribute. If you have examples, book references, blog pages, or names of principles, they would be very welcome. Edit: I'm talking in general, but we are coding in python.


title: HTML5 PhoneGap Mobile development?

text: I want some suggestions about the project concepts/ideas on HTML5 PhoneGap mobile app development. I want to develop some app that can be a learning curve to get to know about these technologies. Any specific app concepts wherein I can get myself accustomed with using features like camera, geolocation, accelerometer, etc and implement those as a coherent part of the project work? Apologies if this might not be appropriate forum to ask such question. But I could not find any relevant stackexchange site for this.


title: Why do we need "callback functions"?

text: I am reading the book `programming in Lua`. It said that > Closures provide a valuable tool in many contexts. As we have seen, they are > useful as arguments to higher-order functions such as sort. Closures are > valuable for functions that build other functions too, like our newCounter > example; this mechanism allows Lua programs to incorporate sophisticated > programming techniques from the functional world. Closures are useful for > callback functions, too. A typical example here occurs when you create > buttons in a conventional GUI toolkit. Each button has a callback function > to be called when the user presses the button; you want different buttons to > do slightly different things when pressed. For instance, a digital > calculator needs ten similar buttons, one for each digit. Y ou can create > each of them with a function like this:               function digitButton (digit)       return Button{label = tostring(digit),                     action = function ()                       add_to_display(digit)                       end}     end      It seems that if I call the `digitButton`, it will return the `action` (this will create a closure), so, I can access the `digit` passed to `digitButton`. My question is that:               Why we need call back functions? what situations can I apply this to?      * * * The author said: > In this example, we assume that Button is a toolkit function that creates > new buttons; label is the button label; and action is the callback closure > to be called when the button is pressed. The callback can be called a long > time after digitButton did its task and after the local variable digit went > out of scope, but it can still access this variable. according to the author, I think a similar example is like this:               function Button(t)       -- maybe you should set the button here       return t.action -- so that you can call this later     end          function add_to_display(digit)       print ("Display the button label: " .. tostring(digit))     end          function digitButton(digit)       return Button{label = tostring(digit),                     action = function ()                                add_to_display(digit)                                end}     end          click_action = digitButton(10)     click_action()      thus, `the callback can be called a long time after digitButton did its task and after the local variable digit went out of scope.`


title: What is a single word I can use to describe a non-query SQL statement?

text: I'm trying to come up with a good name for a data access object that executes non-query SQL statements. I know DML is a valid term, but I wanted to make sure it is the best. Right now we have OracleNonQuery, but I'm hoping to find something better. **UPDATE:** OracleDML or OracleDMLStatement are good suggestions. I'll probably go with one of those unless someone has a better term.


title: Find all points within a certain distance of each other?

text: Let's say, we have... 50k points randomly allocated in 3D space, according to some volumetric function, so that in some parts of the space, points are closer together, but in other parts, they are further away. Every point has a random color (represented by an integer, for example) I would like to find all points that:   * Are within a certain (general) distance of each other, and   * are of different color. What is the fastest way to compute this? Further, non-mandatory details: My end goal, is to remove all points with the same color, until there are no more collisions. I would like to remove as few colors as possible, however, this is not _mandatory_ I could simply remove all colors that are involved in any collisions AT ALL, though, it could result in a lower quality result. The distance does not need to be exact. For instance, if an exact "collision radius" represents a perfect sphere, then I would be fine with the collision radius being the shape of, say, a cube. I am also fine with a trigger-happy solution. That is, I am fine if points get "detected" even if they are not too close. I just don't want this to happen very often, and I _cannot_ accept points that are to close _not_ being detected. Also, I'm sure there is a family of algorithms devoted to this, but I can't for the life of me come up with any names... Knowing the name of an algorithm of this type would be immensely helpful.


title: Is there a difference between merges in svn compared to git or mercurial?

text: From my understanding SVN is 'Easy to branch. Difficult to merge'. Why is that? Is there a difference how they merge?


title: Complexity of ArrayList of LinkedHashSet

text: I get input strings from the console like this:               while ((currentLine = bufferedReader.readLine()) != null ) {         StringTokenizer string = new StringTokenizer(currentLine, " ");         while (string.hasMoreTokens()) {             // Create a new LinkedHashSet for every token and then add it to the ArrayList.             LinkedHashSet<String> linkedHashSet = new LinkedHashSet<String>();             linkedHashSet.add(string.nextToken());             setOfStrings.add(linkedHashSet);         }     }      I'm always getting different strings from input, never the same. After finishing filling in the data structures I have this situation:   * An `ArrayList<LinkedHashSet<String>>` which contains one LinkedHashSet for each string split.   * Inside each `LinkedHashSet` I have a string that is different from any other string present in the other LinkedHashSets - in other words, its unique. For example, I can't have this inside the ArrayList:              Set x : [foo]     ...     Set y : [foo]       **After doing that, I call the function below many times to make different merges.**               public void mergeSets(ArrayList<String> operations, ArrayList<LinkedHashSet<String>> setOfStrings) {         String toMerge = operations.get(1);         String fromMerge = operations.get(2);         boolean enteredFirstToMerge = false;         boolean enteredFirstFromMerge = false;         // Temporary LinkedHashSet reference used to merge two sets.         LinkedHashSet<String> subSetToMerge = null;         LinkedHashSet<String> subSetFromMerge = null;         for (Iterator<LinkedHashSet<String>> iterator = setOfStrings.iterator();                 iterator.hasNext(); ) {             LinkedHashSet<String> subSet = iterator.next();             if (subSet.contains(toMerge) && subSet.contains(fromMerge))                 break;             else {                 if (subSet.contains(toMerge) && !enteredFirstToMerge) {                     enteredFirstToMerge = true;                     subSetToMerge = subSet;                     iterator.remove();                 } else if (subSet.contains(fromMerge) && !enteredFirstFromMerge) {                     enteredFirstFromMerge = true;                     subSetFromMerge = subSet;                 }             }             if (enteredFirstFromMerge && enteredFirstToMerge)                 break;             }             if (enteredFirstFromMerge && enteredFirstToMerge) {                 subSetFromMerge.addAll(subSetToMerge);             }         }      Explanation: For example, if I have as operation `merge foo bar`, I have to do these steps:   * First of all, I have to find where `foo` and `bar` are located:     * Inside `setOfStrings`, I can have this situation:                              position x : [bar, tree, hotel]             ...             position y : [foo, lemon, coffee]           When I find them, I have to **_`combine the set which contains foo with the set that contains bar`_** this way:                           position x : {bar tree hotel foo lemon coffee}                 ...                 position y : {} -> deleted from the arrayList      This function takes as parameters an `arrayList` of operations and an `arrayList<LinkedHashSet<String>>`: For the `ArrayList` of `operations`, I always get a specific position:   * `operations.get(1)` refers to the set to merge (foo in this example)   * `operations.get(2)` refers to the set where to add the foo set (bar in this example) With this for loop, I iterate the ArrayList to search the to sets,`for (Iterator<LinkedHashSet<String>> iterator = setOfStrings.iterator(); iterator.hasNext(); )` This `if` statement checks if the iterator is in the specific set:               if (subSet.contains(toMerge) && !enteredFirstToMerge) {         enteredFirstToMerge = true;         subSetToMerge = subSet;         iterator.remove();     } else if (subSet.contains(fromMerge) && !enteredFirstFromMerge) {         enteredFirstFromMerge = true;         subSetFromMerge = subSet;     }      **_My question is: Could I have collisions with this type of algorithm that I implemented?_** If not the time complexity is only O(n) -> the size of the arrayList.


title: php and mysql hosting service that fulfills my registeration system

text: Kindly tell that how to make a registration system that work with php and MySql . I tried the demo that is here but how it works with the online web hosting . I have registered the free hosting at here   I have also created the database at here but cannot know how to use php files and upload at and use the mysql database that I created here . I want online registration system that uses php and mysql with the free hosting that serves my purpose. The registration system creates the user and sends confirmation email to user’s email address and after confirmation user can log inn to the web application and further work will be done here after registration. Kindly guide me in the above scenario or tell another free hosting service that fulfills my purpose.


title: One-use variables - has any language ever had them?

text: A principle that I follow is that, when an identifier is established, it should be a signal to the reader that the value referred to is indeed an abstraction which will be used more than once. That is, the identifier is defined or assigned once, and the value is read more than once. However, a common idiom exists whereby, in order to increase readability, parts of a complex expression are factored out into variables. These variables will only be used once, violating the principle. Thus, a special separate class of identifier should be used to indicate a one- use variable. This principle applies to any identifier. So you might have one-use functions, one-use methods, one-use variables, etc. Has there ever been a programming language which supported one-use variables?


title: Is it beneficial to study past the basics of a core language when the primary goal is to rely on its framework?

text: Please keep in mind this is not another 'How much [ _insert programming language here_ ] should I know before moving onto [ _insert framework here_ ]?' What I'd like to know is how beneficial is it to learn the those advanced concepts of a programming language when your intention is to heavily rely on its framework the majority of the time. So for example I've began to use jQuery and first took the time out to really grasp the core concepts of Javascript. Additionally I have a few _beyond the basics_ books (Secrets of a Javascript Ninja for instance) on the shelf that really delve into the language. As I skim through the pages though I find that a fair bit of it doesn't carry over to jQuery being that my main intention is DOM manipulation. The same can be said for Ruby and RoR. Will these books make me a better programmer overall? Probably. Can these topics help me become that much better with its framework? That's what I'm having a hard time understanding.


title: How would you rank these programming skills in order of learning them?

text: As a **general purpose** programmer, what should you learn first and what should you learn later on? Here are some skills I wonder about...   * SQL    * Regular Expressions    * Multi-threading / Concurrency    * Functional Programming    * Graphics    * The mastery of your mother programming language's syntax/semantics/featureset    * The mastery of your base class framework libraries    * Version Control System    * Unit Testing    * XML    * Do you know other important ones? Please specify them... On which skills should I focus first?


title: Storing Attendance Data in database

text: So i have to store daily attendance of employees of my organisation from my application . The part where I need some help is, the efficient way to store attendance data. After some research and brain storming I came up with some approaches . Could you point me out which one is the best and any unobvious ill effects of the mentioned approaches. The approaches are as follows   1. Create a single table for whole organisation and store empid,date,presentstatus as a row for every employee everyday.   2. Create a single table for whole organisation and store a single row for each day with a comma delimited string of empids which are absent. I will generate the string on my application.   3. Create different tables for each department and follow the 1 method. Please share your views and do mention any other good methods


title: Benefits of setting PHP memory_limit to lower value for specific PHP script?

text: I need to execute just few lines of PHP code on every single page of my website. This PHP code does not require more than 4MB memory. That is why i want to allocate just 4MB memory to all pages by using following code :               ini_set('memory_limit','4M');      Does it give any benfits in any of the following areas :   1\. Website speed   2\. Bandwidth optimization   3\. Optimizing server memory usage


title: Where to find a good mobile robot simulator?

text: I would like to learn more about robotic mobile, could anyone recommend some easy and stable one? **EDIT** If possible in C, C++ or Java as programming languages. It could run in linux or windows.


title: How does a movie theater seat booking system prevent multiple users from reserving the same seats?

text: In the movie theatre I go to they have ticket kiosks that allow you to select the seats you want; they also have a website that does the same (the website also has a countdown timer of like 30 secs in which you must choose a seat). While I understand things such as database transactions and other techniques for handling multiple simultaneous users, I just can't get my head around how multiple people can be allowed to select a seat at the same time; is it as simple as the first one to press BUY gets the seats and the other person will get an error message, or am I missing something?


title: Why do we write our specs in different files from our source?

text: The D Programming Language supports writing unit tests inline with source. There's a Ruby gem called test_inline that lets you write specs in the same file as your code. Why is it generally conventional to keep source code in a completely separate directory from test code?


title: How to create a common interface for classes with different subsets of members

text: Don't know how to put it, But I'll try to be as clear as possible I have a project in which I am creating lots of classes and those classes have some common properties and methods but those methods could have different code in them, So I decided to make an interface so that I could inherit that in all classes and all classes would have same methods in them like `insert, update, delete` with different code inside those those methods but this trick flopped when I discovered that not all classes have same structure like some have insert method but not update and if I inherit interface I have to provide a public declaration for all members of that interface which I don't want. Trick two I thought about abstract classes created one too but same problem all the abstract members has to be implemented with public. So long story short **I want to create a common inheritable structure which would work as a non instance-able blue print for classes and could be inherited into lots of classes but in many classes I don't want to implement all of the members of that structure** NOTE : I can do no-op(empty methods that do nothing, or return a null, for example) as some guys suggested me but that ain't the solution I am looking for because those unnecessary members will be visible during intellisence and that's what i want to avoid. How can I do that ?


title: Handling a request to override browser behaviors (Back and Refresh)

text: I'm a new guy in this company and I've been tasked to research on possible workarounds with the browser behaviors to cater to the demands of our client. A little background; what they want is to display a 'custom' dialog whenever a user would like to navigate away from a page (not the browser default) that has a form, just as how facebook does it. I've found a workaround with the `Back` button in the form of browser states and have it integrated in my local build of the web app. Works like a charm, though I'm not convinced this is good practice. (more of a trick if you ask me) The problem is the `Refresh` event. All my research (here's one) tells me I should give up. Sigh... So I'm looking for a way to convince my superiors that this it's a bad practice to override browser behaviors or how it's virtually impossible to override the refresh behavior; diplomatically as much as possible. (if I could do citations on articles that would further prove my point, that would be great) Or do I continue looking for possible workarounds in the internet? (too much research effort but not much accomplishment if you ask me, but hey, what do I know?)


title: Is there a downside to installing Visual Studio Ultimate if I don't need all the features?

text: Microsoft released today the final builds of Visual Studio 2012 on MSDN. I'm trying to decide from this version comparison page which edition to install (I can install any edition I want for free). I'm a solo developer who develops mostly web apps and console apps in C# and Python. Some of the features in Ultimate/Premium look potentially cool (like UML and "historical debugging"), but most of the features I will not need, or have never heard of. On the one hand, it would be nice to have the features in case I want them someday. On the other hand, for some software products, the extra features cause the higher end editions to (1) be slower and use more memory, and (2) have a more cluttered UI. Is this the case with Visual Studio?


title: Team switching from TFS Source Control to TFS with Git, not sure how to handle complex project structure

text: I've used git for my personal projects for years, but that's always working alone, not needing to branch much, etc.   Our development team at work has decided we are definitely switching to git, and as one of the most experienced git user on the team I have the task of figuring out our project structure. Our current structure has a single Source Control, with many Projects. Those source control "projects" may contain multiple folders which contain multiple Visual Studio Solutions which can contain multiple Visual Studio Projects, some of which are shared.   An example:   * Main Directory      * Folder 1        * Solution 1          * Project 1         * Shared Project 1     * Folder 2        * Solution 2          * Project 2         * Project 3       * Solution 3          * Project 4         * Shared Project 1         * Shared Project 2     * Folder 3        * Solution 4          * Shared Project 1         * Shared Project 2 I am not sure at all how to translate this to git properly. The main concern that has been mentioned to me is that if we use git submodules, when checking in changes it has to be applied to multiple repositories. Is there a way around this? Does TFS in Visual Studio handle this in an easy to manage way?   Anyone have any good information about this kind of thing?


title: Full signed part of two complement long

text: I am reverse engineering a data file (from a synthesizer). It seems that e.g. -1 is written as FF FF FF FF, so in four bytes. while +1 is written as 00 00 01 (--), so only three bytes. Is something like this common? I only heard about either a 3 or 4 byte format, but not 3 OR 4 depending on the sign. And is there some way to handle this in C#? BitConverter class is a bit too limited for this.


title: What is the legal status of old reference material?

text: I am in the very, very early stages of writing an Amiga 500 emulator, and would like to include the hardware documentation either alongside my source code or in a separate `doc` package. As one example, here is the copyright notice from the Commodore Amiga A500/A200 Technical Reference Manual: ![enter image description here](http://i.stack.imgur.com/4nOx4.png) That doesn't sound promising. Other documents I'd like to include are the Motorola 68000 Programmer's Reference Manual, the AmigaDOS Technical Reference Manual, and perhaps others in the future. Do I need to tackle these documents one-by-one, or is there a "Yes you can" or "No you can't" umbrella that covers all of them? If there is a broad-brush answer, it does not need to be specific to my documents in particular. Thanks in advance!


title: Testing minor browser version compatibility

text: I develop a web application and we test it on browsers like Firefox and Internet Explorer. During our development we test the application on Firefox 3.5. **2** and our testing team tests the same on 3.5. **6** and found the UI looks good. But all of the sudden the client complains that it doesn't look good in 3.5. **8**. How do we handle these minor version issues? How can we check the browser compatibility during development and during testing? Is there any tool to test the application on 3.5. **X** , X being all the minor versions?


title: Aspect oriented programming and implicitness

text: Lets suppose that I have a class which represent an image and has a number of methods.               class Image     {         circle(x,y,radius,color);         square(x,y,w,h,color);         floodfill(x,y,color)         clear();     }      Furthermore, I want to have undo functionality. A simple way of implementing this is to keep a list of all the actions that have been performed. When I undo, I just rerun all of the actions. One solution would be to implement an aspect, something like this:               aspect ImageUndo     {         on Image::circle, Image::square, Image::floodfill         precall(object, args)         {              object.actions_list.add(args)         }     }      Essentially, this aspect has now modified the behavior of Image. That gives me concern. In particular, another programming unfamiliar with the existence of ImageUndo aspect may run into the following problems:   1. He adds a method, and it does not work with the undo functionality.   2. Attempting to debug the undo mechanism, it is not clear where the actions_list get added to. On the other hand we could have               class Image     {         @undoable_action         circle(x,y,radius,color);              @undoable_action         square(x,y,w,h,color);              @undoable_action         floodfill(x,y,color)              @undoable_action         clear();     }      Which does not bother me as much because it gives an idea of where to look for the undo code and makes is so that the new coder will probably notice it an automatically add it to a new method. To summarize: aspects (at least those like the one I showed) seems to bring "implicit magic" into what code does. It seems to me that the implicitness is dangerous and we should really make it explicit. Are there good reasons for the implicitness? Do people who actually use AOP write code that does this sort of modification? Note: this is a reworking of Is Aspect-Oriented Programming a good idea? which was closed because my previous version came across, unintentionally, as ranting.


title: Effective ways to make your OSS project popular?

text: After writing a few (relatively obscure) OSS frameworks, I've learned the hard way that writing a good framework isn't enough--there has to be some time spent marketing your framework as much as the time you spend coding it. So here's my question: What are some effective ways for making your OSS project become well-known? Aside from blogging, how do I gain the most market attention for my code with the least amount of effort as humanly possible? (EDIT: I'm a lazy programmer and I hate documentation, but I'm biting the bullet. I want to be famous)


title: What makes C developers so curious if "i++ == ++i"?

text: Just a random observation, it seems that on StackOverflow.com, there are questions about if "++i == i++". That question gets asked all the time though, I think I saw it asked about 6 or 7 times in the past 2 months. I just wonder why C developers are so interested in it? The same concept/question exists for C# and Java devs as well, but I think I saw only one C# related question. Is it because so many examples use ++i? Is it because there is some popular book or tutorial? Is it because C developers just love to cram as much as possible into a single line for 'efficiency'/'performance' and therefore encounter 'weird' constructs using the ++ operator more often?


title: Should the Presenter depend on the View or the vice versa?

text: So far, I have used the **MVP** architecture pattern a few times. Every now and then, I wonder whether my `Presenter` should depend on my `View` or vice versa, that is the `View` depends on my `Presenter`. **NOTE** > Though the sample code provided is in C#, I don't mind about the language. > My question targets more precisely the **MVP** pattern. Additionally, it was > provided off the top of my head solely to help illustrate my concern. It may > not compile. Here's a short sample of what I'm used to do:               public interface IHasUiHandler<H> where H : IUiHandler {         H Handler { set; }     }          public interface IView {         void Close();         void Hide();         void Show();     }          public abstract class Presenter<V> where V : IView {         protected Presenter(V view) { this.view = view; }              public void CloseView() { view.Close(); }         public void HideView() { view.Hide(); }         public void ShowView() { view.Show(); }              private readonly V view;     }      And let's say I'm creating a Customer Management feature.               public interface ICustomerManagementUiHandler : IUiHandler {         Customer CreateNewCustomer();         IList<Customer> ListCustomers();         void RemoveCustomer(Customer customer);         Customer UpdateCustomer(Customer customer);     }              public class CustomerManagementPresenter : Presenter<ICustomerManagementView>                                              , ICustomerManagementUiHandler {         public CustomerManagementPresenter(ICustomerManagementView view             , CustomerManagementService service)              : base(view) {             view.Handler = this;             customers = service;         }              public Customer ChangeExistingCustomer(Customer customer) { return customers.Update(customer); }         public Customer CreateNewCustomer(Customer customer) { return customers.Add(customer); }         public IList<Customer> ListCustomers() { return customers.List(); }         public void RemoveCustomer(Customer customer) { customers.Remove(customer); }              private readonly CustomerManagementService customers;     }          public interface ICustomerManagementView : IHasUiHandler<ICustomerManagementUiHandler> {             }          public class CustomerManagementForm : Form, ICustomerManagementView {         public CustomerManagementForm() { }              public ICustomerManagementUiHandler Handler {              private get { return handler; }              set { if (handler == null) handler = value; }          }              private void changeCustomerButton_Click(object sender, EventArgs e) {             if (Handler == null)                  throw new InvalidOperationException("Can't change customer. No handler specified.");             Handler.ChangeExistingCustomer(current);         }              private void createCustomerButton_Click(object sender, EventArgs e) {                                     if (Handler == null)                  throw new InvalidOperationException("Can't add new customer. No handler specified.");             Handler.CreateNewCustomer(); // No parameters for sample simplicity sake.         }              private void deleteCustomerButton_Click(object sender, EventArgs e) {             if (Handler == null)                  throw new InvalidOperationException("Can't add new customer. No handler specified.");             Handler.RemoveCustomer(current);          }              private readonly ICustomerManager manager;         private ICustomerManagementUiHandler handler;     }      I feel like the `View` should depend on the presenter, so that there would be no need for a `Handler` property in the `View` itself. Then the `Presenter` could depend on the data access service or the like to handle the business entities and the like. This would wave away the **Method Injection**, which is a benefit, IMHO. Plus it seems to reduce complexity for waving away both the `IHasUiHandler` and `IUiHandler` interfaces. This makes it a easily testable code because the `Presenter` is an easily-tested class. However, this way I'm afraid that the `Presenter` has no real handle over the view which it should be able to either show or hide. So this is where I'm growing confused about which shall depend on which.


title: How to format Android view IDs

text: I struggle with this every time I work on a project. I am not entirely sure what the standard conventions are for creating view ids. I usually use something like               view_more_button      but then if we have, let's say, multiple dialogs with a view more button then I'll start doing               view_more_button_dialog1      and from there it just spirals downward. Any suggestions?


title: .Net build and deploy solutions for desktop and Web applications

text: My employer is still in the dark ages when it comes to software development, test, build and deploy. Our development to deployment application lifecycle is:   1. Once development/changes are done we build an msi package using a visual studio setup and deployment project.   2. Msi is placed in a network folder   3. instructions are given to relevant team to deploy package.  A deploy for a windows application can consist of an msi, Sql scripts and application configuration changes, and the deployment of these is all manual. We are now looking to automate the build and deployment process for our Windows and Web applications. Most of our apps don't have unit tests which can be run automatically but going forward we will. What is the best way to do this?


title: Where could Distributed Version Control Systems currently be in Gartner's hype cycle?

text: **Edit** : Given the recent downvoting (+8/-6 at this point) it was made clear to me that Gartner's lifecycle is a biased metric from a programmer's perspective. This is something that is part of a paper I'm going to present to **management** , and management types are part of Gartner's audience. Giving DVCS exposure & enthusiasm (that "could" be deemed as hype, **or at least attacked as such** ), think about the following question when reading this one: **"how could I use Gartner's hype cycle to convince management that DVCSs are ready (or ready-enough) for us, and that it is not just hype"** Just asking if DVCSs is hype wouldn't be constructive, Gartner's hype cycle is a more objective instrument than just asking that (even if this instrument is regarded as biased). If you know any other instrument please, by all means, mention it. **Edit #2** : I agree that Gartner's Life Cycle is not for every technology, but I consider it may have generated enough buzz to be considered hype by some, so it maybe deserves to be at least evaluated/pondered as such by using this instrument in order to prove/disprove it to whatever degree. I'm an advocate of DVCS, BTW. **Edit #3** : Thanks for your answers. Bounty goes to Caleb for answering my question with detail and practical advise. Accepted answer goes to philosodad for providing another useful instrument and answering beyond my question. * * * I'm doing research for a whitepaper I'm writing in favor of DVCS adoption at company and I stumbled upon the concept of social proof. I want to prove that the social proof of DVCS adoption is not necessarily cargo cult and doing further research I now stumbled upon Gartner's hype cycle which describes technology maturity in 5 phases. ![enter image description here](http://i.stack.imgur.com/CnhKu.gif) My question is: what could be an indicator of the current location of Distributed Version Control Systems (I mean git, mercurial, bazaar, etc. in general) at a particular phase in the hype cycle?... in other (less convoluted) words, **would you say that currently expectations of DVCSs are a) starting, b)inflated, c)decreasing (disillusionment), d)increasing (enlightenment) or e)stabilizing (mature) and (more importantly) _why_?** I know it is a hard question and there is subjectivity involved, but I'll grant the answer (and the traditional cookie) to the clearest argument/evidence for a particular phase.


title: What should I expect from a developers guide?

text: I'm willing, with some friends, to make a developers guide for an open source point of sale written in Java. The thing is I have never written anyone and so I don't know exactly what to put in there to meet standards. I'm thinking about putting UML, and using Java doc but still I don't know what are the expectations of developers towards a developers guide. How can we say a developer's guide is truly worth?


title: Why C++ to write a compiler?

text: I was wondering why C++ is a good choice to write a compiler. Of course C is good for this purpose too, because many compilers are written either in C or C++ but I am more interested in C++ this time. Any good reasons ? I was looking for that in the Internet, but I cannot find any good reasons.


title: Implementing a "state-machine" logic for methods required by an object in C++

text: What I have: 1 hypothetical object/class + other classes and related methods that gives me functionality. What I want:   1. linking this object to 0 to N methods in realtime on request when an event is triggered   2. Each event is related to a single method or a class, so a single event does not necessarily mean "connect this 1 method only" but can also mean "connect all the methods from that class or a group of methods"   3. Avoiding linked lists because I have to browse the entire list to know what methods are linked, because this does not ensure me that the linked methods are kept in a particular order (let's say an alphabetic order by their names or classes), and also because this involve a massive amount of pointers usage. Example: I have an object `Employee Jon`, Jon acquires knowledge and forgets things pretty easily, so his skills may vary during a period of time, I'm responsible for what Jon can add or remove from his CV, how can I implement this logic?


title: Difference between REST and CRUD

text: I learned REST and it feels a lot like CRUD (from what I have read about CRUD). I know they are different, and I wonder if thinking they are similar means I don't understand them. Is it that REST is a "superset" of CRUD? Does everything CRUD does and more?


title: Do job postings exaggerate their requirements?

text: I feel like a reasonably qualified programmer, but a lot of job postings I run into make me feel otherwise. Almost all of them separate qualifications into requirements and desirables, but even the requirements part can be daunting. I've seen a lot of postings that say they require several years (2 or more) experience in a relatively small technology or library, something specific to their company. Other times I see 5 or even 7+ years experience required for a language. On their own some of these would be ok, but it gets ridiculous when a small town company says you need 3 years in 2 languages, proficiency in network programming, scripting, databases, and stuff like "experience with large highly redundant business critical systems" all at the same time. Do they really expect to find someone who has extensive experience working with exactly the same technology set they use? I have a hard time finding a single posting where I don't have at least 1 or 2 holes in my skill set. I've heard over and over that most places value your ability to learn quickly and will teach you on the job, but then why say it's required? Are they just trying to discourage the bottom of the barrel (FizzBuzz failures) from applying?


title: Non-zero exit status for clean exit

text: Is it acceptable to return a non-zero exit code if the program in question ran properly? For example, say I have a simple program that (only) does the following: Program takes N arguments. It returns an exit code of min(N, 255). Note that any N is valid for the program. A more realistic program might return different codes for successfully ran programs that signify different things. Should these programs instead write this information to a stream instead, such as to stdout?


title: What is meant by "Now you have two problems"?

text: There is a popular quote by _Jamie Zawinski_: > Some people, when confronted with a problem, think "I know, I'll use regular > expressions." Now they have two problems. How is this quote supposed to be understood?


title: How to charge in agile iterative approach?

text: I have a doubt about budgeting when working with agile iterative approach. If I understood well, in agile at the end of each iteration we have usable product, so we have some of the requirements met and then some part of the software will be already working. How do we charge for our work in this methodology? Do we charge per iteration, i.e. charge per major requirements being met, or just charge the customer when the software is indeed finished and then receive for everything at once?


title: Does the method of adjustment matter, or just the final calibration?

text: A company produces software (and hardware) that is used to both perform automatic _adjustments_ on electronic test equipment as well as perform _calibrations_ of the same equipment. The results of the calibrations are put onto a certificate of calibration that is sent to the customer along with the equipment. This calibration certificate states various conditions of the calibration, such as what hardware (models/serial numbers) and software (version) was used to perform the calibration, as well as things like environmental conditions, etc. Making the assumption that the software used to produce the data (and listed on the calibration certificate) used on the certificate of calibration must have gone through a "test/release" process and must be considered "released" software - does this also mean that the software used for adjustment must also be released? I believe that the method (software/environmental conditions/etc) used or present during adjustment doesn't matter, all that really matters is the end result of the calibration, the conditions _present during the calibration_ , and whether or not the equipment was within the specifications. The real question I'm hoping to get answered: _Is there a reputable source (e.g. NIST or somewhere similar) that addresses this question?_ (I have searched...) The thinking is that during high volume production runs, the "unreleased" system can be used to perform adjustments, as long as a released system is used to perform the calibrations, since the time required to perform the adjustments is much longer than the calibration. This unreleased system will eventually become released for use, but currently is not. Also, please not that there is a distinction between "adjustment" and "calibration". The definition from BIPM International vocabulary of metrology, 2.39: > Operation that, under specified conditions, in a first step, establishes a > relation between the quantity values with measurement uncertainties provided > by measurement standards and corresponding indications with associated > measurement uncertainties (of the calibrated instrument or secondary > standard) and, in a second step, uses this information to establish a > relation for obtaining a measurement result from an indication. Followed by NOTE 2 (emphasis in original text): > Calibration should not be confused with **adjustment of a measuring system** > , often mistakenly called "self-calibration", nor with **verification** of > calibration As a side note, I'm not sure why this got down voted. It's regarding software and it's use before and after release for use. I believe there is a best practice that can be applied and this is (hopefully) not primarily opinion based.