Inspiring a team - Startup company - Real world problems

I joined my company 2 years back which is a startup company that has been around for 5 years now. From the beginning I've been working on one of the Microsoft technologies. Just after few days I joined the company I learnt that the company doesn't have a working process in place right through the software development life cycle. The employees are left unmonitored and the schedules, deadlines, milestones and the quality didn't come off as expected. I've been always passionate about programming and more importantly patterns and practices in both technical and non-technical areas and kept myself busy in my learning curve. Meanwhile the company's productivity started deteriorating every day. There is no mutual understanding between the management and the employees (just 12). The management didn't care much about the employees' benefits, their work environment, realistic schedules etc. Due to the miscalculations from the management the developer teams has been pushed to work crazy many a times. This made the employees unhappy making them to lose interest in their work. So they started producing very _bad_ results affecting the company's growth. There always was mistakes equally on both sides, the management and the employees. The trivial reason I find is that the management failed to educate employees about the process, importance of quality, software development patterns, practices etc. The management was always keen in delivering results and failing to look on 'how to' deliver the results. Recently I've been elevated to be a team leader (I just completed my 2 years) as the management believed that I have the technical proficiency as well as the managerial capabilities to handle a bunch of products. I was having a more _intimate_ relationship with my colleagues more than a _professional_ relationship. So I'm finding it very hard to employ some rules and establish a working model within the company. And so far I've been receiving adverse results if I push it a little bit more. Moreover I need to make myself qualified for this role and feel confident about the working model I propose as I've no good hand to guide on this. I kind of have more bookish knowledge rather than the practical experience. What can I do on this situation? Should I abandon the company or should I put more effort to set things right? _"In a company of 10,000 people if 5 guys fail to work properly the company can withstand it. But in a company of 10-15 people even if one guy doesn't perform well it impacts the company's growth in a huge way."_


Good Data Structure book to improve programming logic for children

My cousin (Age 10) who studies in Standard 5. He wants to learn programming and programming logic. Which book or resources should I refer? Is there any Good Data Structure book to improve programming logic specially for children?


Do resumable exceptions make any sense?

Following up my previous question I wonder if `resumable exceptions` make any sense. It looks like nobody uses them in `Java`. Don't they use `resumable exceptions` because of Java limitations or just because they don't really need them? Suppose, I want to create a file in a directory, which should exist but does not. I would probably prefer use a `resumable exception` (i.e. throw an exception, catch it and create the directory, and resume the execution) instead of testing if the directory exists every time I create a file. Does it make sense in general ?


Most useful features of VIM that aren't standard in a IDE

I'm considering whether I should start using VIM again instead of an IDE. What are the most useful features of VIM that aren't standard in an IDE?


Git Staging: When to stage? What to do if modification occurs afterwards

I'm rather new to the broad world of Git. I have read the manual and have been practicing but I am confused about few aspects of it, which I couldn't figure out after searching for. I'm wondering:   * In a project (post first commit), when is the right moment to stage source files? Right before committing? Right after adding/deleting or modifying?   * If files are staged midway between two commits, and then they get modified, what happens with Git? Does it need care about content changes when it was stated and what it become since?   * If I create a new file, stage it and then want to delete it, why does Git ask me to use "-f" flag and a simple "git -rm file.ext" won't work? I have read "What stage means" and various other subjects of the manual and other tutorials on Git but as I said, I still don't understand the above matters. So, if you could, please answer the questions with your own words and examples so I might have a better chance of understanding it. Thank you.


Any alternative main stream programming methodologies to OOP using C#?

As far as programming languages go, I love C#, and for that matter all the good that comes from the .net framework (LINQ, etc). My main concern is I seem to be churning out too much code, and using OOP, I have a concern my code isn't always that easy to manage. I want to continue using C# and .Net, but are there any other approaches to applying the language to get overall less code, and easier to manage compared to text book OOP? Thanks in advance!


Should a service use session information?

As an example, if I have a Post service and have a method to retrieve all posts for the logged in user, is it OK to have a findPosts() method that uses an injected Security service to get the user ID and then pass that user ID to my post DAO to get the records? Or should the findPosts() method explicitly require the user ID as an argument?


Do "Builder" static methods violate SOLID?

I am writing a class which consists mostly of data storage responsibilities. The context for the use of this class will, in general, be retrieving an array of objects of this type for display later. In light of that, I've created a static method, `build_question_array()`, which queries the database, instantiates the objects, and returns the array. Does this violate the "SOLID" principle?


What to expect during an interview with a senior development executive?

I passed first two technical interviews at a global e-commerce company for the position of senior software engineer. I was told that there are two more interviews, one with a senior development executive and another with a person from human resources (HR).   1. What kind of questions I should expect during the interview with the senior development executive? Is is technical, high level architecture related, etc.?   2. During HR interviews, is it ok to ask about the work-life balance and actual working hours?


How can I remove my fear of doing freelancing work?

I usually work in a web design company, but my manager also has his own company. He is a designer basically and he catches the projects with clients and then I do his work during weekends or whenever I have time. He is very bold. He has no knowledge of programming at all. But I have seen that many times he catches projects which even I don't know how to do. Last year he got projects in Joomla, Drupal, and Microsoft Sharepoint which I didn't know at the time. I told him that I don't know how to use those. He told me to take my time to learn and then do it. At that time I was thinking that I didn't know what would happen but eventually I finished them all. He sometimes hands unfinished projects to clients even though he knows that they're not done, but he's not worried because people won't notice at all. If they do notice then he tells me to do it. I sometimes wonder how he is running such a risky business. I have seen that I, who know programming, am afraid of accepting projects but he, who doesn't know anything doesn't hesitate to accept them. I'm always too afraid of doing personal projects because I start thinking about what can go wrong. If I did something wrong, then people will sue me. How will I pay the damages? Due to this thinking I was not able to get any projects done from my known clients. Whenever they ask me if I can do one, I say no. I'm afraid of accepting projects. Even though I have done many projects at work but I worry about it when it comes to me. What should I do?


How can I make my career in supply chain optimisation and data mining?

There is a company in my city which does supply chain optimization, data mining and predictive modelling. I tried hard but was not able to enter there. Now I want to do similar sort of work. They apply many optimization techniques which makes the decision making of company easier. Presently I know Python, Django, PHP, Linux and web development. Can anyone guide me that what i need to do for that sort of work, what thing I need to learn so that after 5-6 years I can also start making those type of softwares for small shops. I mean which languages and tools I need to learn.


CMP Entity Beans as a "naive" ORM solution

I was browsing through this talk about "Historically Bad Ideas" over the history of Computer Science, and found an interesting presentation about the rise & fall of the Java Enterprise initiatives. Slide #16 grabbed my attention by suggesting that Container Managed Persistence is a "naïve ORM solution". Of course, I assume the presenter made a live in-depth analysis of the problem, which is missing in the slide. So I was left intrigued by that statement. Is CMP Entity Beans just a heavy piece of naive engineering? Aside any bias from the author(s) of the presentation, what would constitute a more adequate ORM solution in the domain of languages like Java or C#? I'm not asking for specific tools or frameworks, but better approaches. Thank you!


How can I share data across several websites?

I am trying to develop a simple system for sharing data across several websites. Most of them are developed in PHP while some are developed in Wordpress/Drupal. Redundant information is spread across several websites and this has caused a problem where we have to update the information across several websites separately. I am trying to provide a solution where even static pages can get shared data. Here is my proposed architecture: ![enter image description here](http://i.stack.imgur.com/h7JFZ.png) I am doing this for an academic institution. The data varies from simple fees structures to academic policies. For example consider academic costs. Academic costs -> ug, graduate, pharmacy... each of the departments will have a fees structure categorized by off campus, on campus, commuter.               "Undergraduate": {         "metaid": "0770",         "Offcampus": {           "FeesItems": {             "comprehensive": {               "label": "Comprehensive Fees",               "value": "2,141"           }         }       }     }      For front end using mustache, they just have to include the js and use something like below to get values,               <td>{{Undergraduate.Offcampus.FeesItems.comprehensive.label}} </td>     <td>{{Undergraduate.Offcampus.FeesItems.comprehensive.value}}</td>      My questions: Is this design scalable?   How to give the data owners the ability to edit the data?   How to store the data in sql?


Why is there a leading zero in HTML 4.01 version number?

I've never noticed this quirk until now, and it's screwing with my mind. Why was HTML 4.01 numbered with a leading zero, rather than as 4.1?


Writing better timesheet

Recently, my company started to require us to fill out a monthly timesheet, writing down everything you do in office. A timesheet contain 29-31 days, depends on the number of days of the month. I need to write the things I did in every row of the excel file, which represent a day. This timesheet embarrasses me, because something like this can happen:   * **I spent Monday writing a program, and the program was done.** Because my boss didn't give me other program to write, basically I am just sitting there and pretending I am busy in the following days before my boss gives me another assignment. Of course I should not write it in the timesheet as it is. I can write it in the timesheet that I write the program using 4 days, but it makes me feel very inefficient.  I can separate the process into 1) write the program, 2)deploy the program, 3)test the program, but that can make the process so long like 3 weeks, really. Have you encountered such a situation? How would you deal with this? EDIT: some people said I should be more proactive about asking for more assignments, but here is the situation: the boss of my boss gives some jobs to my boss, then my boss gives the jobs to me, sometimes I can also see my boss being quite less busy. One of my colleagues said that I should not ask for another assignment in a proactive manner, because it would be a headache for my boss to **think a job out of nowhere** for me. I don't want the things turn out like that, really.


Software design for procedural programming

Right now, I'm trying to learn a well documented software engineering. I knew that if we code using Object Oriented concept, we can do software design concept using UML. But what if we code using procedural programming, how we do software design? as my understanding, UML is for OOP. And do you have any references in internet? Please advices and correct me if I'm wrong about UML.


Who is responsible for updating the Java API and how can other individuals contribute?

I made a search on google to find out who are the people in Oracle responsible for updating the Java API in other words who are those responsible for adding new classes and methods to the API and updating the Java Documentation. I could not find an answer to this question which leads me to the next question, what if I had some classes that are not found in the API which I wished to share with others, how do I get Oracle to add those classes for me?


How should test for a "for any different than x return false" requirement look like

I tried to find if there's a similar question but didn't even know what keywords should I use :) I got a method in an interface accepting an other interface as a parameter:               bool CanDoIt(AnInterface subject)      One of the implementations needs to fulfill the requirement that the method should return false for all concrete types (implementing AnInterface) different than X. Simple implementation could look like (didn't wrote it since got no UT for that):               bool CanDoIt(AnInterface subject)     {         if(!(subject is X)) return false;         else ...     }      I know that this is a code smell accepting an interface and then checking it's concrete type - unfortunately for now I got to stick with it. I would like to write a test that would check if the requirement is implemented correctly. So that test would fail if someone would ever add a new type implementing AnInterface and changed the method not to meet the requirement. If writing such a test isn't possible then what can I do to consider the coded tested? Would writing a test using few exemplary types would be enough, or is it better not to write it at all?


Formalizing a requirements spec written in narrative English

I have a fairly technical functionality requirements spec, expressed in English prose, produced by my project manager. It is structured as a collection of UI tabs, where the requirements for each tab are expressed as a lit of UI fields and a list of business rules for the tab. Most business rules are for UI fields on a tab, e.g:   1. Must be alphanumeric, max length 20.   2. Must be a dropdown, with values from table x.   3. Is mandatory.   4. Is mandatory under certain conditions, e.g. another field is just populated, or has a specific value. Then other business rules get a little more complex. The spec is for a job application, so the central business object (table) is the Applicant, and we have several other tables with one-to-many relationships with applicant, such as Degree, HighSchool, PreviousEmployer, Diploma, etc.   1. One such complex rule says a status field can only be assigned a certain value if a many-side record exists in at least one of the many-side tables. E.g. the Applicant has at least one HighSchool or at least one Diploma record. I am looking for advice on how to codify these requirements into a more structured specification defined in terms of tables, fields, and relationships, especially for the conditional rules for fields and for the presence of related records. Any suggestions and advice will be most welcome, but I would be overjoyed if i could find an already defined system or structure for expressing things like this.


Relation between developers and clients

I'm currently working in a small company that its taking care of implementing lots of systems, most of them for goverment institutions, in witch it generally means taking software developted 20 years ago and refurbish them so fit up-to-date needs. The clients generally are very used to them and tend to discourage change (they are in their 50s 60s give or take, so not technologie- friendly in general). As you can imagine, dev-team in most cases starts taking care of relation with clients, generating the documentation needed in this cases (CU usually), assisting to weekly meets to see improvements with clients. As for experience, this is a gold mine for me, because gives a nice perspective on all the aspects of software development, but also some problems rise because, if developers come from mars then clients are from venus. There is a fine gap on the vocabulary/experience/capability-to-interpret-needs that generates a noise in the communication, and some times affecting the final product. Should a developer be in direct contact with the client, or there should be an "adapter" guy that translates client needs in pseudo formal requirements understandable to us?


how to structure MVC models and ORM models

I have some trouble getting a good folder structure in my project and i would like to know what other ways i could use to structure my files. I'm currently working in an MVC sturctured folder.               www/       Controllers/       Models/       Views/      Nothing special so far. But i'm also using an ORM system. With it i can easily get an 'object' from my database like:               ORM::load('table');      Now this sort of code should reside in a Model right? So i'd get something like this:               <?php     class userModel     {         public function getAllUsers ( )         {             return ORM::load('table');         }              public function getUserById ( $id )         {             return ORM::load('table', 'userid=?', array($id));         }     }     ?>      Looks good so far in my opinion... But there's one more thing. I can also specify a 'model' when using the ORM system. With this model i can basically set up validation rules. Like so:               ORM::withModel('authModel');      This lets the ORM know that before it adds a new row (or updates an existing one) to the DB, that it should check the following model first for validation rules.               <?php     class authModel //Or maybe authValidation??     {         // Method gets automatically triggered when an update is done with the ORM         public function onUpdate ( $obj )         {             if ( $obj->username == '' )                 throw new \Exception('No username');         }              public function onInsert ( $obj )         {             // Validations here too.         }     }     ?>      Now the problem is, is that i have 2 sorts of models. One where i basically use getters/setters to get and store data to the database (from my controller to my model). And i have another model in which validation rules are set... I don't want to mix both in the same folder. So i must come up with another structure for this. Something like:               www/       Controllers/       Models/         Repositories/         Entities/       Views/      It's just that my model isn't a real 'repository', since it doesn't store any objects in the repo class and doesn't have a commit() method or anything like that. I also can't store the 2nd model (for validations) in the Entities folder, because they're not Entities at all... Any idea how i should structure this..??


Why is the empty list used as the list terminator in Lisp?

It seems to me that the list terminator in Lisp could be any arbitrary value. For example, the string terminator in C is the null pointer. Is there a philosophical reason why the empty list was chosen to terminate lists?


Licencing FOSS for profit

Some projects are available under restrictive FOSS licenses (GPL or AGPL, for example) which preclude them from being used in proprietary projects. The developers can then sell separate commercial licenses which allow the code to be used in proprietary projects. How common is this? Examples I'm aware of: MySQL x264 Cygwin


Your Approach to Learning Language(s)?

_This question is geared specifically towards finding out what techniques you employ when faced with learning a new language - feel free to skip to the last paragraph for the straight-forward question._ I'm an inexperienced programmer and would like to learn a multitude of languages (quickly (thirsty for knowledge ;), but thoroughly). I've dabbled in computer programming since I was 10 years old (VB 6 - 19 years old now). I've played with PHP, C, Ruby and HTML + CSS (though the last two arent technically programming languages, though you obviously know that). I want to structure my learning for efficiency and productivity as I develop my career and would like to hear **how you approach learning a language.** For instance, I read up a little bit about a particular language and if I like the look of it, I usually do a bit of book research and buy a thoroughly (and positively) reviewed one since published content is usually better than a lot of the content you'll find on the web (don't quote me on that). I'll then follow the book and set myself mini-projects to complete, obviously from the first 'hello world' application to a CMS or minigame. I find setting myself projects is a good tactic - it requires research 'off the beaten trail' to find out what features of a language I need to know about to accomplish it in the most efficient way. **What works for you when learning a language? Anything different from reading books and setting small bite-size targets?**


What is the difference, if any, between Model and QA environments?

I have worked for various organizations many of whom call their environment that comes after the test/developer environment and before the staging and/or production environment either model or QA. They all seem to use this term interchangeably, however, is there any technical difference or should there be a difference in these terms? Or are should they be completely interchangeable terms?


Setting up and syncing a developer (local) version and a public version of a website

What is the best and most efficient way to set up two versions of the same website? I want one version that is online and open for everyone to use but I also want a developer version where I can develop and test new things instead of doing that against the ftp. Currently I have MAMP setup on my developing machine and I use Git for version control. In MAMP/XAMPP the location for the files are `localhost/example/` and on the ftp it is the host's (Dreamhost's in this case) file structure. Something like `/home/username/example.com/`. That results in having multiple versions of pretty much the same file. This isn't that efficient but I can't come up with a good solution for it. Are there any? It would be perfect if I wanted to add a new feature to the website I could do that in MAMP and when i commit the changes with Git it uploads the changes to the ftp.


UI patterns in functional languages

I would like to start fiddling with ClojureScript, but I am puzzled about some points. My problem is what is a good way to deal with state changes coming from user interaction, when you trying to work functionally. Let me give a couple of examples. I have in mind applications which run in the browser, but I think the issue is more general. Of course something will be changing - the DOM at least. But I would like to find out how to organize the rest of the code to work with immutable data structures. 1) Say I want to attach some events to some DOM object. This is not hard to do in a mostly functional way: when you create the node, you attach it a hash map with the various event handlers. **But** consider the case where you are using event delegation. Then when you create a new node, you may attach a event handler to some parent node that probably already exists. So you would have to change the hash associated to the already existing node. 2) Say I am designing an autocomplete module for an input field. Every time the user presses a key, I can make a call to a server to get the suggestions. This is easy. But now suppose I want to optimize it a bit. If I know all results matching `foo` there is no point in asking again for all results matching `foobar`; I can just filter the former. So I need to build some kind of cache. This cache will be updated every time the user inserts a new word which is not a superset of the words previously entered. Again: how do I model the cache? The most reasonable way seems to be a hash map mapping words to results, but it should be mutable. Can you suggest some patterns that would make it easier to incorporate changes due to user interaction into a functional design?


Is an ASP.NET site in a Linux environment possible?

I found some software a while ago that claimed to execute ASP.NET applications on a Linux server, I remember that the information said that takes the code and converts it to Java. I never downloaded or tested the software. Does anyone know the name of this software? Also, is possible to execute ASP.NET on a Linux server in the first place?


Is Visual Studio Express suitable for commercial application development?

If I were to develop a Silverlight game and publish it to a site where you can play it for free is the use considered to be commercial or personal? What about if the site has adverts on, is it then considered to be commercial if the program is free but its hosted on a site that makes money? My reason for asking this is Visual Studio Express can only be used for personal or non-commercial use so I want to check what the limits for the use are.


Is it a problem to have different styles of HTML coding within team?

I with 2 other friends are new to web development. We are learning HTML, CSS, Javascript and are creating simple websites to get a feel of different things. And as HTML is only a markup and not a programming language we have very different styles evolving. I mean whenever we look at each other's code, we tend to put a good amount of time in understanding why the other one does that. Now we want to build a larger website together and my question is- Is that a problem having very different styles in a team for web development(specifically)?


Excellent knowledge of C++

I recently saw a recruiting page for a software company where one of the requirements was "Excellent knowledge of C++." Now, I know this somehow implies as expert knowledge of C++, but where exactly does expert knowledge fit into. Is it the knowledge and experience of (let's say) eight years of programming in the language, having and knowing the ins and outs of a specific domain. Or, is it a more brush-up, surface approach to one or more domains and a at the same time a more detailed understanding of the whole language? For example, you cannot be an expert at writing system drivers and game engines at the same time. So, where does this excellent or expert knowledge fit into?


Online Code Editor

The major online IDEs are hosted on the service provider's server. Examples are Kodingen, Cloud9, ShiftEdit. Hence they would be unavailable if the external server was down for some reason, and I prefer to do my computing on my own computer anyway. Does anyone know of an online IDE or editor (preferably just an editor - a simple implementation of the Ace or CodeMirror JS editors) which can be downloaded and run on localhost (on a local LAMP server)? I've found two so far - Eclipse Orion and Wiode, but I don't like either of them very much, and I'm looking for alternatives. Also suitable are browser extensions which run natively on the browser (offline) without going to some external site. An example would be SourceKit for Chrom(e/ium).


Queuing RPC calls

I'm designing a system which listens to JSON RPC calls from clients, piles them up inside a list, and if the list gets full it will store them in a DB and keep receiving calls. My original plan is to listen to the RPC calls from Perl with the JSON-RPC and put them in an array. The clients do some long polling in another server to get responses as they appear.   * What is this blocking/non-blocking thing?    * Should I do a script for node.js to listen to the calls?    * What do you think is a good practice in this case?  The goal is to listen as much calls as possible.


How do professional software development teams deal with design complexity in non-trivial projects?

First, I realize this question may by somewhat long and vague and I apologize for this. This is probably a basic problem with a short name to anybody who's "got it", but as I find myself lacking in this regard, please bear with me in describing the problem. I've been doing programming in this way or the other since I was about 11 years old. This means that I've been mostly teaching myself everything from the start. I received a technical education, but not strictly in Computer Science (I graduated with a degree in Photonic Engineering). We had programming courses of course, but this was mostly basic stuff for me and I didn't learn much new things. I've kept educating myself along the way for the joy of it and always knew I would pursue a career in programming, but all my projects were quite small at that time. I had no trouble keeping them in my mind and maintaining them. Now, I find myself the lead on a team, but not in a corporate environment - I work for the university developing scientific software (in C++) for engineering applications. Suddenly the project is growing (relatively) big and I've trouble wrapping my mind around it most of the time. I'm losing a lot of time and effort on two things mostly:   1. When I have to return to a section of code I've not worked on for a while, I have difficulty remembering how it worked. I spend a lot of time reviewing the header files for the relevant classes and reading the comments I placed along the way in the source files. I wish there was some form of "schematic" I could glimpse at and regain the picture more easily;   2. When I introduce changes, sometimes I realize half-way that what I'm trying to do will break things somewhere else (or worse, it shows up only at runtime as a surprise). I revert and start doing it differently, only to find out I neglected the influence on some other component. I wish there was some "architecture diagram" where I could see how things get done, how what I'm trying to do will influence other components and a way for me to plan in detail before I start implementing changes. Most of the people I work with have similar stories as my own - strong technical orientation and sometimes great skills, but with no way of organizing their work. However, their projects are usually much smaller than mine so they cope somehow. Anyway, what that means for me is that I'm on my own and I have nobody to learn the good practices from. I took up a postgraduate course in managing IT and while I find it quite satisfying, it's mostly targeted at non-programmers, teaching about project management methodologies, budget/schedule estimations, enterprise architecture etc. - not software design and planning as such. That's OK, I'm trying to learn that stuff too. Of course, some tools (like UML) and the types of sofware development processes (cascade, iterative, agile...) were introduced, but obviously not in great detail and I've a hard time deciding what I should pick and use (and to what extent). I've been reading many questions and answers about software design on SO - there are many about doing it using this or that particular tool or methodology, and if I was convinced that UML documentation would solve my problems - I'd pick it up and start using it. But some people swear by it, others say it's useless. I'm looking for an answer on a higher level of abstraction - are there ways to solve the two problems I'm having, and how do you personally do it? What should I learn to be able to do it, possibly without being bound to one particular tool? These come and go out of style from time to time, and I expect their applicability varies depending on the type of the project. Thanks a lot for reading, I was unable to say what I mean more briefly (lacking in software design experience and vocabulary).


Looking for changes in a MySQL database with node.js for a live dashboard

So, I work for a NOC in a small ISP. We're planning on getting a large wall mounted monitor and I'd like to make a dashboard in Node.JS - I've never used node before so it should be interesting. I'm aiming for something like this as a vague example: https://gds.blog.gov.uk/wp- content/uploads/sites/60/2012/02/developmentprocess.png The data we will pull will be from Nagios + Icinga boxes (we have many). Currently I have a script that fetches all the problems from our Nagios + Icinga boxes and dumps them in to a MySQL table. It's then possible to have a PHP dashboard that just displays data from those tables, and an auto-refresh plugin for the browser. What I want to do is use a node.js front end so refreshing isn't required. From tutorials, it seems you need to send events to node to make it work properly. What I want to do is the MySQL method as we can then use it for reports etc. Imagine in that image, the right contains a list of all problems, and the numbers are counts of all problems. How do I get node to realise there's new data, compare what clients are already displaying and display changes?   1. Constantly pull data from the database, compare to an array of currently displayed data, send any changes to the client   2. Somehow construct a query to find only new data (based on current time maybe?) push that (need to find out what has cleared though and is no longer in database)   3. Something else altogether I'm a pretty skilled PHP developer, but live updating with something like node is alien to me. I'm following the infrastructure used by Manuel Kiessling in nodebeginner.org (index > server > router > request handler for each page - there'll be different pages for different info i.e. nagios/icinga, BGP peers etc). Any help appreciated, if I can't think of a solid way to do it I'll end up going back to PHP which is a shame as node really interests me.


Weaknesses of 3-Strike Security

I've been reading some literature on security, specifically password security/encryption, and there's been one thing that I've been wondering: is the 3-strike rule a perfect solution to password security? That is, if the number of password attempts is limited to some small number, after which all authentication requests will not be honored, will that not protect users from intrusion? I realize gaining access or control over something doesn't always mean going through the authentication system, but doesn't this feature make dictionary/brute-force attacks obsolete? Is there something I'm missing?


How to know, with good performance, which areas a certain point is in?

I'm interested in build a prototype that needs this sort of thing:   * Point A (xa, ya) with a radius of 500 meters.   * Point B (xb, yb) with a radius of 700 meters.   * Point C (xc, yc) with a radius of 1200 meters.   * Point D (xd, yd) with a radius of 200 meters.   * Person 123 is in some certain point. **Question** : which points 123 is in? For example, the person is both inside A, B and D areas, but not on C. All points are geographic coordinates, i.e. lat/long. I want to understand what are the best algorithms and strategies to implement a good index. My current idea (not implemented yet) is: > The hole map is divided in quadrants, small as (for example) 50~100 > > meters. When a point is marked, all quadrants inside their area will > be > marked as well. Then, when I search using "Person 123", I'll just > find its > quadrant and retrieve all points marked into it. Basically I'll build a huge prefix tree based on geohashes of all points (+10k points). Problem is, for a single point, there will be numerous entries inside the Tree (though it would be better for searching, I think). Note I lack the formal understanding of spatial indexes.


Trying to wrap my head around class structure for domain-specific language

My work is mostly in embedded systems programming in C, and the proper class structure to pull this off eludes me. Currently we communicate via C# and Visual Basic with a large collection of servos, pumps, and sensors via a USB- to-CAN hid device. Right now, it is quite cumbersome to communicate with the devices. To read the firmware version of controller number 1 you would use:               SendCan(Controller,1,ReadFirmwareVersion) or     SendCan(8,1,71)      This sends three bytes on the CAN bus: (8,1,71) Connected to controllers are various sensors.               SendCan(Controller,1,PassThroughCommand,O2Sensor,2,ReadO2)      would tell Controller number 1 to pass a command to O2 Sensor number 2 to read O2 by sending the bytes 8,1,200,16,2,0 I would like to develop a domain-specific language for this setup. Instead of commands issued like they are currently, commands would be written like this:               Controller1.SendCommand.O2Sensor2.ReadO2      to send the bytes 8,1,200,16,0 What's the best way to do this? Some machines have 20 O2 Sensors, others have 5 controllers, so the numbers and types of controllers and sensors, pumps, etc. aren't static.


License for free source (re)distribution, but no distribution of modified executables

## Question I want to put a phone/tablet app on Github and want to allow full rights for using, studying, sharing and modifying the source code, but disallow any redistribution of executables that result from modified code. The purpose of this second requirement is that I want to make it illegal for users to remove or redirect in-app payments. The actual app will be free. So, my requirements are:   * License must support forking on Github and therefore both modification and redistribution of source code by others (this excludes license-free distribution covered by plain copyright, Ms-RSL, and also CC BY-ND as it doesn't draw a distinction between source code and executables)   * License should permit redistribution of "Standard" executables - the ones originating from my version of the source code - but must not permit any distribution of "Modified" executables (this excludes any license that conforms to the Open Source or Free Software Definitions) (I'm aware that there is pirating is happening on especially Android app stores, I'm willing to live with that as pirates would have to both edit code and redistribute the modified version before I potentially take a hit from it. Even then, I could theoretically go after them through legal means.) ## Prior research The Artistic License starts off great by saying: > (1) You are permitted to use the Standard Version and create and use > Modified Versions for any purpose without restriction, provided that you do > not Distribute the Modified Version. but then goes on allowing Modified Versions if they're marked as sufficiently distinct from the Standard Version. qmail relied on plain copyright (shipping without any kind of license) to ensure that the Standard Version is not tampered with, and people were providing patches for its source code to provide other users with their modifications. That's _almost_ good enough for my purposes, in that others would be free to fork my own source code repository, however, forking someone else's modified repository would be illegal so I actually need a license to make that possible. This question brings up a related problem, but I chose to open another question because (a) the question does not deal with redistributing source code, as is required by Github, (b) none of the answers in there satisfy the requirements, (c) the original poster already accepted an answer that works around his requirements, so the question is basically closed, and (d) it's worded unnecessarily specific to Android and open source. That question was the closest match I was able to find on here. In the interest of minimizing license proliferation, I'd like to use an existing license. However I've exhausted my knowledge of licenses and googling skills, and didn't end up with anything that satisfies these (fairly simple and potentially popular?) requirements. Is anybody aware of a license that I could use or do I have to roll my own?


How can I improve my English and Communication skills to communicate with clients?

Can somebody tell me how is it possible, as a programmer, to improve my communication skills and perfect my English as it is not my mother tongue ? What steps should I follow to improve on these two matters?


Sass File Formating - what problems might are there with the following rules?

For a while now I have been considering the formatting of sass files to maximise their usability by other coders and I think that this would be perfect place to get some feedback on the rules I try to apply when writing a sass file. I am specifically interested in the usability of the source code as it is created and maintained by humans, as well as with the correct creation of css code. Some of these rules could be applied to sass or vanilla css. The rules I have been honing are as follows:   1. **Start general and get specific**. So start with body font size, colour variables, default tag declarations etc. then move through the parts of your site that are common to all pages, then onto the re-usable elements on the site and finally concluding with page specific styles, with the liklihood of cascading re-use and the potential for over-ridden styles increasing as you move through the document(s)   2. Try to **group selectors in a way that matches the distribution of html amongst views**. So if I look at widget.view the file or block of a file labeled widget.scss will contain those styles. NB, I specifically do not mean following html sructure with hierarchical sass in this case.   3. Following on from that. **Minimise the amount of hierarchy defined in sass**. Only use sassy {} based inheritence when needed.   4. **Group properties into logical sets** , so width and height together, font declarations together, rather than everything alphabetically.   5. Always **consider the resulting css file size** and be prepared to use classes if necessary instead of mixins, editor snippets or other bloat encourgaing techniques.   6. Put **more than one property per line** in certain cases, following on from the logical grouping of elements, meaning more code can be fitted onto a monitor screen without going so far as to make lines too long to read easily. No more than 3/4 properties per line.   7. **Block code in files** by indenting all selectors after an introductory comment to make the the left hand side of the file easy to scan and to quickly discover it's contents. Also provide a file map of these blocks at the top of the file if it is large.   8. Use **placemarkers for find operations** , such as ^NAVIGATION   9. **Only use classes for styles**. And don't be afraid to use classes for specifcity and to make re-use more atomic. [edit for clarity - I don't mean use only classes, I mean use classes instead of IDs]   10. Use a completely **separate set of javascript specific classes** for binding functionality to html elements, meaning that either form or function can be swapped out without damaging the other. These classes are not refered to in the css.   11. **Selectors one per line** and in alphabetical order as they are arbitrary in name


Is there a modified LGPL license that allows static linking?

LGPL requires that it if a program uses LGPL-ed library, users must be able to re-link the program with a different version of the library: > ... > > d) Do one of the following: > > 0) Convey the Minimal Corresponding Source under the terms of this License, > and the Corresponding Application Code in a form suitable for, and under > terms that permit, the user to recombine or relink the Application with a > modified version of the Linked Version to produce a modified Combined Work, > in the manner specified by section 6 of the GNU GPL for conveying > Corresponding Source. > > 1) Use a suitable shared library mechanism for linking with the Library. A > suitable mechanism is one that (a) uses at run time a copy of the Library > already present on the user's computer system, and (b) will operate properly > with a modified version of the Library that is interface-compatible with the > Linked Version. > > ... However in some cases, this can pose considerable difficulties. In particular, Haskell programs are almost always statically compiled. Moreover, the compiler does cross-module optimizations so its not possible to take a part of the code out and replace it with another. So it's very hard to satisfy this condition. (See this link at Haskell Wiki.) _Update:_ Dynamic linking would be a solution, but in many cases, this isn't possible. For example:   * Some platforms may not have dynamic linking at all.   * Some languages don't have the possibility of dynamic linking. Or, it's not possible to make modules multi-platform.   * In some cases dynamic linking would prevent important optimizations. While I'd say this is rarely a serious problem, in languages like Haskell the performance loss could be considerable. Therefore, I'm looking for a standard LGPL-like license that wouldn't require the possibility of re-linking (and I understand that that removes a bit of freedom given to users). Some projects use their own modification of LGPL, for example wxWidgets. But I'd rather use some standard license that is somewhat more official, perhaps checked by some law experts, and (L)GPL compatible. Is there some like that? (Also I'd be interested to know if are there some unforeseen consequences of such a modification of LGPL.)


Is it okay to fake part of the class under test?

Suppose I have a class (forgive the contrived example and the bad design of it):               class MyProfit     {       public decimal GetNewYorkRevenue();       public decimal GetNewYorkExpenses();       public decimal GetNewYorkProfit();            public decimal GetMiamiRevenue();       public decimal GetMiamiExpenses();       public decimal GetMiamiProfit();            public bool BothCitiesProfitable();          }      (Note the GetxxxRevenue() and GetxxxExpenses() methods have dependencies which are stubbed out) Now I'm unit testing BothCitiesProfitable() which depends on GetNewYorkProfit() and GetMiamiProfit(). Is it okay to stub GetNewYorkProfit() and GetMiamiProfit()? It seems like if I don't then I'm simultaneously testing GetNewYorkProfit() and GetMiamiProfit() along with BothCitiesProfitable(). I'd have to make sure I setup the stubbing for GetxxxRevenue() and GetxxxExpenses() so that the GetxxxProfit() methods return the correct values. So far I've only seen example of stubbing dependencies on external classes not internal methods. And if it is okay, is there a particular pattern I should use to do this? **UPDATE** I'm concerned that we might be missing the core issue and that is probably the fault of my poor example. The fundamental question is: if a method in a class has a dependency on another publicly exposed method in that same class is it okay (or even recommended) to stub that other method out? Maybe I am missing something, but I'm not sure splitting up the class always makes sense. Perhaps another minimally better example would be:               class Person     {      public string FirstName()      public string LastName()      public string FullName()     }      where full name is defined as:               public string FullName()     {       return FirstName() + " " + LastName();     }      Is it okay to stub FirstName() and LastName() when testing FullName()?


Is IronScheme complete enough or stable enough to be worth learning?

IronScheme is mentioned on Wikipedia as a successor to a failed project called IronLisp, bringing Lisp to CLR and .NET, the way Clojure does for the JVM. Does anyone have experience with this language? It looks fairly complete (99%) but I'm not sure how to judge whether it's worth my time to fiddle with getting it set up or not. By stable or complete, I mean using it for actual projects rather than just fiddling with tools and Project Euler style problems.


Do you do the exercises when reading a book?

How many of you actually work out the exercises when learning from a book (any programming related book), I'm currently working my way through a C++ book and find that some of the exercises I feel I can complete rather easily I skip. Do most people do this? Or do they read the whole book and come back to exercises that looked difficult?


Is fewer lines of code always better?

Which of these programming styles is better?               var result = methodOne(methodTwo(a, methodThree(b)), c, d);      or               var result3 = methodThree(b);     var result2 = methodTwo(a, result3);     var result = methodOne(result2, c, d);


Why was GOTO included in PHP 5?

I discovered some time ago that the GOTO control keyword was introduced in PHP 5.3.0. http://php.net/manual/en/control-structures.goto.php Why did it happen? What are the language design goals behind this? Did the PHP developers community asked for it?


Web application - database design/infrastructure

I have just begun development of a web application (that will be deployed using Google app engine), without going into the specifics, the web app will allow users to deploy a small website of their own, part of app allows the users to create a form to allow customers to sign up to the users website, however each user may require to collect different data on its customers, for example one user may require a customer’s first name and email address only where as another may also require the customers age. My question is what would be the best way to structure the database(s)? By structure the database(s) I mean how can I implement them so that I can store the different data collection sets for each user and then store the information that is retrieved by each of these users from their customers? For example I don’t think this is right but my initial though was that I would have to deploy a database for each of the users but this seems like overkill, or add a new table for each of the users (I don’t even know if these two are options). I have only had experience with trivial databases and this problem has me confused.


Is there a way to publish software architectural design for open use and prevent patenting?

I'm not sure I have the correct verbage in my question, so let me explain: What I mean by "software architectural design":   * I have (what I believe) is a unique and useful design concept for an architecture that involves multiple clients, shared states, blah-blah, etc. etc.    * This architecture would be used in multiplayer games with persistent worlds.   * Although it would facilitate a novel kind of gameplay, it is not a description of "gameplay." What I mean by "for others":   * Free for personal/edu/commercial use. (MIT/BSD style license?) What I mean by "prevent patenting":   * I want to make sure that this particular design cannot be patented/copyrighted by someone else. (Basically, litigation battles over software architectures for games like MMOs, etc. disgust me, and I want to keep this particular design idea free to use.) Is this something that I can easily accomplish? Can I just write up a design document for the architecture and publish it to the web under say, the MIT license even though its not actual code? Or do I have to file for a patent?


Looking for the better way to combine deep architecture refactoring with feature based development

## **Problem statement:** **Given:**   * TFS as Source Control   * Heavy desktop client application with tons of legacy code with bad or almost absent architecture design.   * Clients constantly requiring new features with sound quality, fast   delivery and constantly complaining on user unfriendly UI. * * * **Problem:** Application undoubtedly requires deep refactoring. This process inevitably makes application unstable and dedicated stabilization phase is needed. **We've tried:** Refactoring in master with periodical merges from master (MB) to feature branch (FB). (my mistake) _Result:_ Many unstable branches. * * * **What we are advised:** Link to the article (pdf)   Create additional branch for refactoring (RB) periodically synchronizing it with MB via merge from MB to RB. After RB is stabilized we substitute master with RB and create new branch for further refactoring. This is the plan. But here I expect the real hell of merging MB to RB after merging any FB to MB. **The main advantage:** Stable master most of the time. Are there any better alternatives to the procees?


What's the career path for a developer who doesn't like management?

If you're developer (Senior or Lead Developer) and you'd rather stay with code/design than pursue a management career, what are the available career paths at your company, or any you've heard of? How far can you go? Is it possible to continue being a geek until you bite the dust or is that too naive? Are people like Uncle Bob for example still considered developers, as they claim?


Is musical notation Turing-Complete?

I'm wondering, is music notation language Turing-Complete? My first thought is that there are loops in musical notation, but there is no way to write conditional branches, right? I'm not a musician, so perhaps someone can help fill in the gaps?


Should a large company standardize engineering tools across all teams internationally?

I've been thinking a lot about the problem of standardization across large companies. For me, the answer is pretty clear: do not arbitrarily standardize on tools just because that's what everyone else does. It's counter-productive. I'm thinking about source control, bug tracking and testing tools primarily. It seems so obvious to me that I can't really think of many good counter- arguments. Some I've thought of :   1. Easier sharing between teams   2. Easier for IT to manage (1) is definitely true if different teams are working on the same codebase/product. But in cases where one team doesn't work directly with the code I don't think is a valid reason. (2) is just kind of pisses me off if that's really an argument. The limitations placed on programmers, I believe, is more burdensome than any extra work piled on to IT. But I'm not an IT guy. I'm hoping for some better arguments than those.


Coworker that detrimentally picks on every minutia

Hypothetically speaking imagine that there exists a coworker that has a very shallow understanding of computing. To avoid stereotyping lets give this coworker the gender neutral name Chris. Now Chris' diagnostic ability is low and can't figure out the correct IP addresses to set his/her virtual machines to. Chris also fails to merge code properly and overwrites a commit I made fixing something, thereby re- introducing a bug. I let this slide, refix the bug and do not make a sound about it to management. Given a task Chris either 1) complains that there isn't sufficient information resulting in 2) you provide Chris with inordinately detailed instructions to satisfy 1). The more detail you provide in a list of steps to carry out, the more chance of an error being present in your instructions. Chris gets these instructions, tries to execute them, fails and it becomes your fault because your instructions aren't good enough. How do you deal with this?


How to properly distinguish between MVC and three-tier?

Many webapp frameworks, e.g. Spring,call themselves MVC frameworks, but how is the distinction done between MVC and three-tier? It seems that some frameworks call themselves MVC frameworks but they are really three-tier frameworks, or how do we properly label which is which?


Classic ASP to ASP.net or ASP.net MVC

We have a web application which is developed in classic ASP and it evolved over 5 years to its current form which has 100's of pages, huge database and more than 10000 active users going through at least more than 10 pages daily. Now, we wanted to upgrade it to latest version of .net. Initially we thought rewriting the entire app, but after analyzing the scenario we found that is not a viable option also not suggested by many experts. We have not yet decided on how to do it in otherway, but got some thoughts on how to achieve the rewriting in faces. **Option 1:** We thought of identifying the main modules in this application and rewriting them one by one by separating the application into different layers such as database (existing), then business logic and the view. This way newly developed modules will be added to existing system and new pages will replace old pages in that particular module. At the same time we can test the new layers alongside old system and release them once we feel confident. We also thought of developing API kind of structure for business logic and this will be accessed by view as an external application. **Option 2:** At the moment we have done a simple module and used it in classic ASP page through an IFrame, though it was quite troublesome sending data between classic ASP and new page in the IFrame. This is just in planning stage on how we should achieve the rewriting of the entire application without disturbing the user base. I want to get other programmers views, opinions and suggestions on should we approach in such scenario? if anybody has faced this kind of scenario please share your opinion too. Also would like to know using of ASP.net MVC is going to help me in this? **UPDATE** : Thanks for both the answers for putting up your views. Would like to get more inputs on both the options I specified above in migrating the application from classic asp to asp.net or asp.net mvc. It would be great help for me, if you all can through your views, points and thoughts on migration part rather than the point of choosing asp.net or asp.net mvc.


Javascript storing data

Hi I am a beginner web developer and am trying to build the interface of a simple e-commerce site as a personal project.The site has multiple pages with checkboxes. When someone checks an element, it retrieves the price of the element and stores it in a variable. But when I go to the next page and click on new checkboxes products the variable automaticly resets to its original state.How can I save the value of that variable in Javascript? This is the code I've writen using sessionStorage but it still dosen't work when I move to next page the value is reseted. How can I write this code so that it dosen't reset on each page change. All pages on my website use the same script.               $(document).ready(function () {         var total = 0;              $('input.check').click(function () {             if ($(this).attr('checked')) {                 var check = parseInt($(this).parent().children('span').text().substr(1, 3));                 total += check;                 sessionStorage.var_name = 0 + total;                 alert(sessionStorage.var_name);                  } else {                 var uncheck = parseInt($(this).parent().children('span').text().substr(1, 3));                 total -= uncheck;             }         })     })


How does PHP internally represent strings?

UTF8?   UTF16? Do strings in PHP also keep track of the encoding used? Let's look at this script for example. Say I run:               $original = "शक्नोम्यत्तुम्";      What actually happens? Obviously I think `$original` will not contain just 7 characters. Those glyphs must each be represented by several bytes there. Then I do:               $converted = mb_convert_encoding ($original , "UTF-8");      What will happen to `$converted`? How will `$converted` be different from `$original`? Will it be just the exact same byte sequence as `$original` but with a different encoding?


What do you use string reversal for?

In PHP it's `strrev()`, in Rails it's `.reverse`, but most languages don't have any string reverse function. Some have array reverse functions that can be used on characters. I was thinking this must be a major oversight but then it occurred to me, what would you actually use string reverse for??? The only time I can think I've seen it is in demos and lessons to turn "Hello World!" into "!dlroW olleH". My question is; Is there a use for reversing a string or is it completely pointless? . **Addendum** There have been way more answers that I had anticipated and not all of them were entirely academic. I would have put money that no one could come up with a legitimate example. I also didn't think I would learn anything new but Mark Canlas' regex suggestion is just brilliant and I look forward to the opportunity for it to prove itself. Thanks to all.


Software Engineer VS "Harder" Jobs

_This should probably be in a Dear Abby column, nevertheless..._ I am the only engineer in my entire family (including extended family). Occasionally I hear family members say that being a Software Engineer is not as hard as say a UPS Driver. While both may work the same hours, intrinsically the SW Engineer job is rated as less difficult than the other. The general consensus is that we just sit in front of computers all day with some occasional meetings. I feel that being a Software Engineer is not physically demanding but mentally draining. For those that have encountered this line of thinking before, what is the best way to convince your friends and family otherwise? Edit: My Wife told her Mother... I am tired after work and don't want to be running errands... her Mother said that I am in an office all day on a computer, how can I be tired. Side note: I am also an Army Reserve Officer, member of my city's planning commission, and a freelance blogger for my local newspaper. Plate is pretty full aside from being a SW Engineer - BUT, the notion still remains with the family that being a SW Engineer is nowhere as difficult as being an UPS Driver, which my brother-in-law is currently employed as.


Isn't the Spiral Model/Agile Development essentially just a more rapid and compressed Waterfall Model?

Since I learned about the Spiral Model of software development, I've tried to apply it to the different projects I've been involved in. However, I'm starting to feel like it's really just compressing and iterating more rapidly through a traditional Waterfall Model. Even in each Spiral or Agile cycle, there are still step-by-step tasks/objectives that need to be finished in order to complete the spiral, and that step-by-step process seems really similar (although shorter total cycle and perhaps less steps) to the Waterfall Model. Is the main difference the introduction of a feedback loop into the process of development earlier on and throughout the process, or is there a fundamental difference in the actual step-by-step completion of a task?


How do you deal with stealing?

I have been recently hacking on a project I started a couple of months ago. It was a simple idea. Allowing people to collect achievements for code they shared on Github. So I started this noble endeavor, trying to rake in my friends to get coding and helping. I spent all my free time working getting this up and running and building it. _Enter musical time lapse_ My friends pitched in when they could. As you can imagine, I became very attached to its success. Then just as I was gearing up for release, a company releases a very similar product. I was very disheartened when I came to hear my little project was release by someone else, but it wasn't like I had rights to the idea. I swallowed my pride and shot them an email saying something along the lines of > Hey, I have been working on something similar. We should talk! It's super > cool stuff. We talk, I get the feeling that he really doesn't want to collaborate, although cordial we allow each other access to one another site. Couple of days pass, and **I see that some of the descriptions for my achievement are appearing on their achievement site.** After speaking to him originally, I **_was_** going to send them a nicely worded email outlining my plan for my achievement system and call it quits. **Once I saw the descriptions of my achievements appearing on their site, I couldn't just let it go.** I decided to fight back. I have open-sourced the project, just leveling the playing field and it frees me up from having to deal with the competition, since I am was only working on it part-time. This isn't the action I can take every time, I am wondering what options do I have if I find myself in this position in the future? lawsuit? stern email? Just as a heads up, I am looking for advice on how to deal with this without lawyers; or is this the way things play out in the real world?


Is Cleanroom still used on software projects?

Cleanroom is a software engineering process that's often mentioned in textbooks. There was some documented use of the process in the 90s (I believe it was used at the NASA Software Engineering Lab), but I haven't heard anything about it years. Does anyone have any direct experience using it on a software project?


Question about SDLC. How to answer this?

I have seen this asked many times in job interviews but I am still not sure how to answer this. I am a web developer for quite some time but I still have problem with explaining OOP and SDLC (Familiar with system development life cycle) . How to prepare for above 2 topics for an interview point of view. Still I use both all the time during development. I am not clear on OOP SDLC Is there any simplest answer to both of these?


How do you decide how much your software will cost?

If you are a solo developer, or have a leading role in a software company, you might have to decide how much your software will cost one or another day... What is your experience with calculating how much your software costs for your customer? Why does this method it work for you?


Is there a defined way to create a commit history for Git

I have been working (alone) on an open-source project without using any sort of formal version control. I recently started using Git and GitHub for this project and am wondering if it is possible for me to build a code/commit history based off of the archived, older versions of the code that I have. Development thus far has been solely linear. It's progressed from version 0.1 through 0.9.6.3 without any branches. I've looked through the Git User Manual and the closest thing I can think of would involve making labeled or named commits for each previous version. What is the best way to handle this? Do I need to create a new repository and start pushing labeled commits into it, ending with the current version? Is it possible to change the dates of existing commits? Is there a more straightforward way? I'm using Git on Windows XP (native, not Cygwin), but if it would be easier I can set it up on my Ubuntu box.


Do code style guides increase productivity?

Our team of 12 is currently considering implementing a style guide. The question came up if long term productivity benefits outweigh the short term productivity loss as everyone adapts. What has been your experience with style guides? I should also note our code base is rather large and we'll probably have to run our code through uncrustify or something similar to bring the entire code base into conformance with the guide.


Learning programming from a book which uses C++98

I am learning programming from a book called "Programming Principles and Practice" by Bjarne Stroustrup. It has been highly recommended over here and elsewhere. My only issue is that it uses C++98 and as I understand there have been two other standards c++2003 and c++2011. Going through this book will be a significant investment of time and effort for me (210 hours recommended) and I would not want to commit to if my skills or knowledge gained may be outdated or not as useful etc. On the other hand this book is written by an expert and is widely recognized as one of the best for entry level programming (assuming no prior knowledge). Despite a lot of research I have struggled to find another book which is written by such a leading authority and provides good and accurate introduction for the beginner. Could someone share some insight as to what and how much I would be losing out on if I use this book and learn C++98. And whether going through it would be a good choice for a person in my situation and worth the investment of time and effort. If you own this book or are experienced user of C++, your insight will be appreciated even more. Thanks.


Preferred lambda syntax?

I'm playing around a bit with my own C like DSL grammar and would like some oppinions. I've reserved the use of "(...)" for invocations. eg:               foo(1,2);      My grammar supports "trailing closures" , pretty much like Ruby's blocks that can be passed as the last argument of an invocation. Currently my grammar support trailing closures like this:               foo(1,2)     {        //parameterless closure passed as the last argument to foo     }      or               foo(1,2) [x]     {         //closure with one argument (x) passed as the last argument to foo         print (x);     }      The reason why I use [args] instead of (args) is that (args) is ambigious:               foo(1,2) (x)     {     }      There is no way in this case to tell if foo expects 3 arguments (int,int,closure(x)) or if foo expects 2 arguments and returns a closure with one argument(int,int) -> closure(x) So thats pretty much the reason why I use [] as for now. I could change this to something like:               foo(1,2) : (x)     {     }      or               foo(1,2) (x) ->     {     }      So the actual question is, what do you think looks best? [...] is somewhat wrist unfriendly.               let x = [a,b]      {     }      Ideas?


What Is The Best Technique For Managing Bugs and New Features With Version Control in CVS/SVN for a Team of 6 to 9 People?

In a company working on a long term software project, there are 6 to 9 developers working in the same office. The development team uses JIRA for bug tracking and CVS (and some SVN) for version control of different Java Web Apps related to the software application. The team uses REST to communicate between the Web Apps on different servers. The environment consists of Amazon EC2 and Google App Engine Apps, all written in Java, HTML, CSS, and JavaScript. The development team commits the code every day. Using this strategy, deployments happen every 20-25 days, but they would like to target once per week or once every 2 weeks instead. When the code goes through testing, the testers find and report bugs, but when the development team fix the bugs and deploy the software, the software sometimes then has more bugs in it because developers working on new features are still committing code to the repository. Sometimes the sales team or customers find bugs as well on production systems. Our thought is that we could check out a copy of the code that is stable and make changes there. I suspect this is a problem with how the version control is used, but it could be something else in the process. How should this agile development team of 6-9 people make sure that the releases are both frequent, once per week or once every 2 weeks, and that the deployments are high quality with no regression bugs?


Software Development vs. Information Technology

What are the major differences between Software Development and Information Technology. If you have majored in IT is it a fine major but as different as Software Development and Computer Science as stated in Joel's blog?


How to make a legacy system time-zone sensitive?

I need to implement time zones in a very large and old Delphi system, where there's a central SQL Server database and possibly hundreds of client installations around the world in different time zones. The application already interacts with the database by only using the date/time of the database server. So, all the time stamps saved in both the database and on the client machines are the date/time of the database server when it happened, never the time of the client machine. So, when a client is about to display the date/time of something (such as a transaction) which is coming from this database, it needs to show the date/time converted to the local time zone. This is where I get lost. I would naturally assume there should be something in SQL to recognize the time zone and convert a DateTime field dynamically. I'm not sure if such a thing exists though. If so, that would be perfect, but if not, I need to figure out another way. This Delphi system (multiple projects) utilizes the SQL Server database using ADO components, VCL data-aware controls, and QuickReports (using data sources). So, there's many places where the data goes directly from the database query to rendering on the screen, without any code to actually put this data on the screen. In the end, I need to know when and how should I get the properly converted time? What is the proper way to ensure that I handle Dates and Times correctly in a legacy application?


Using grammars to extract bibliographic citations

My task lays in the area of text mining / labelling, more particular extraction of bibliographic citations (references) from the plain text, as shown here: ![enter image description here](http://i.stack.imgur.com/CjLn6.png) Basically, for the input text the algorithm should recognize:   * The beginning and end of citation   * Journal name, title, author, issue, volume, pages This task was already approached in e.g. Citation Parsing Using Maximum Entropy and Repairs (Ng Yong Kiat, 2005), which demonstrated that CRF models deal better then MEMM or pattern-based approaches. Currently there are two projects, that do the job:   * ParsCit, a Perl program build on the top of CRF++ project   * Grobid – Java module, also based on CRF++ While the results of mentioned approaches are already known (and are very good), I was given a task to do the same but using the context-free grammars. Indeed, the information looks to be very structured but I am not sure if this approach can outperform CRF on sensitivity, at least I hope it can beat it on accuracy. My idea is the following:   * Define the fixed grammar rules for already known types:   `YEAR → (19|20)\d\d | \d\d\d\d`   `PAGE → \d{1,3}\-\d{1,3} | e\d{1,3}`   `ISSUE → \d{1,3}`   * It is possible to infer from training set the probabilities of rule alternatives e.g.:   `PAGE → \d{1,3}\-\d{1,3} with P=0.8 | e\d{1,3} with P=0.2`   * From the pre-annotated training set generate the high-level rules (all chars between non-terminals are terminals):   `CITATION → AUTHORS, JOURNALTITLE, ISSUE, PAGES, YEAR | AUTHORS, BOOKTITLE, VOLUME, CHAPTER, CHAPTERTITLE, EDITORS, PUBLISHER, PUBPLACE | ...`   `CITATIONS → CITATION | CITATIONS; CITATION | CITATIONS; and CITATION` The problematic places are:   * `AUTHORS`: There is no fixed rule for them, but one can write a function, that can score that the given text looks like an author. Also the list of possible (English) surnames is not so huge, but if I create the thousands of rules it will slow down the grammar parser. Let's say for authors we have some scoring function, that for given input returns a number [0 .. 1] reflecting how the input really looks like an author. The grammar parser should feed all possible variants for `AUTHORS` and stop on one with a best score.   * `JOURNALTITLE`: The same story. There is obviously no general rule to define it. There is a list of all journals, but then comes also the subproblem of abbreviation: _Ann. NY Acad. Sci. = Ann N.Y. Academy Sci = Annals of the New York Academy of Science_. Again, we can define a scoring function for that; in worst case the function can measure the distance between input sting and all known journal titles using Damerau–Levenshtein algorithm.   * The text like "Vol", "Chapter", "edited by" can be very useful as terminators prefixing the corresponding values (and thus reducing the ambiguity of the grammar), but can they be identified and learned automatically?   * The same for terminators before and after citation, which can be very useful (perhaps will speedup the parsing):   `SUPERCITATION → ( CITATIONS ) | ( see, e.g., CITATION ) | see, for example, CITATION | described in, e.g., CITATION | is disclosed by CITATION`   Does it make sense to "hardcode" them or try to learn them?   * The "noise" text between citations: how to deal with it? The goal of the lexical analysis is perhaps not to find the most probable parse tree, but also to maximise AUTHORS and JOURNALTITLE functions. Can somebody advise me:   * If SCFG is the right way to approach the problem? If yes, how is it possible to adapt this approach to create a parse tree based on probabilities and also on scoring functions?   * Are there any other relative works / articles?   * Are there any libraries that can help in chunking the text (written in a way that can be applied also for e.g. Chinese text)? I have found some monsters like UIMA, Mallet, MinorThird... I wonder about your personal experience when using them for the task like above. Thank in advance for any reply.


What non-technical skills do I need?

Apart from:   1. being strong technically   2. being able to communicate effectively What are the most important formal / informal skills required to really shine as a developer? (Naturally, I struggle with the first two, but even so...).


Push response to the user for which the request is created in Asp.Net (Chat Server)

I am working on a Chat Server Application in Asp.Net with C#. Suppose there are 5 users online say User A,B,C,D,E. Suppose A sends a message in chatbox to user B, so how the chatbox (Textbox/Textarea of chat) of User B will load the new content? One Option is to refresh the chatbox every 10Seconds or 15 seconds but it's pretty unuseful way because as if there is no new message for the user the chatbox will still be refreshed. * * * I have an aspx page say client.aspx with client.aspx.cs as code behind file and server file say server.cs. There is a send button on aspx page on click event of this button i called a method of my server file say UpdateChatbox(from,to,content) now the from is User A, to is User B and content is my msg in chatbox, Now the question is : How Server.cs file update the ChatBox on client.aspx page of User B?


Should I lock a list of objects while a socket is receiving messages?

I have a scenario where I will be receiving messages through a socket connection. I also need to keep a list of 100 messages (such as List) and periodically toss out old messages from the list when a condition is met.               List<Message> MessageList = new List<Message>();     Message CurrentMessage = new Message();          public void ReceiveSocketMessage (SocketMessage Message) {              if (Message.Type == duplicate) {             CurrentMessage = MessageList.FirstOrDefault(x=> x.MessageText == Message.Text);             CurrentMessage.Time = DateTime.Now;         } else {             MessageList.Add(Message);         }     }      Since the socket sends messages very quickly, it seems like any other method that attempts to access MessageList will cause a problem. Other methods will need to access the list at many random points in time. I just can't get my head wrapped around working on the list of objects without causing trouble. What is the traditional method of handling this? UPDATE: Would it be simpler just to maintain a list of items in a database table instead of a list of c# objects? A database would surely have all the major locking problems ironed out to a point where I shouldn't need to worry about it.


What is the best solution for printing a document from Azure with limited user interaction?

I currently have a web app hosted in Azure, with a few worker background jobs. My goal is for a user to click print on a page, and to them the printer will magically start printing a document(for security purposes). The setup will look something like this:                    Azure           |     _____________     |     |     |     B1    B2    B3      Where each 'B' is a building. When a user from B2 clicks on a web app to print a document, the document will start printing in the designated printer in B2. Each building is on its own network when it comes to workstations and computers. I'm not 100% sure how to approach this. One option is to have a Windows task running on each workstation that will continuously ping blob storage for new documents. If one shows up if will start printing. This is probably the easiest route but seems like it would be maintenance hell for 100+ buildings. It also seems like a waste when there may only be one document a day. Are there any other options for printing a document in such a fashion?


SQL Server CE 4, graphical tools for designing tables, etc.?

I thought that Visual Studio 2010 SP1 would include support for using SQL Server Compact Edition 4 inside the designer, but it seems not. Was I wrong, or has I managed to botch up my installation somehow? I installed SQL Server CE 4 from the download page, not through the web installer. If Visual Studio 2010 SP1 does not, and should not, include such support, what are my choices, if any?


Applying Denotational Semantics to design of Programs

I've read a bit on denotational semantics (DS) and I'm very intrigued about the process of designing computer programs where types and functions have strong and clear mappings to mathematics. Are there any resources that discuss designing programs based on DS in detail? I've seen a few superficial treatments of the subject. I'm conversant in Haskell, Scala, Common Lisp, and a bit of Scheme so any resources that use those languages would be greatly appreciated.


Difference between the two enums

I came across an enum definition :-               typedef enum NSInteger {         kBorderTypeNone   = 0,         kBorderTypeLeft   = 1 << 0,         kBorderTypeRight  = 1 << 1,         kBorderTypeTop    = 1 << 2,         kBorderTypeBottom = 1 << 3     } BorderType;      and also (possibly) it can be equivalent to               typedef enum NSInteger {         kBorderTypeNone   = 0,         kBorderTypeLeft   = 1 ,         kBorderTypeRight  = 2,         kBorderTypeTop    = 4,         kBorderTypeBottom = 8     } BorderType;      What are the internal differences(if any)? Is there any advantage of one over the other? Which one is recommended? If both are same then how compiler handles it? In which phase of compiler is it reduced to same set of instructions?


Is is common to use the command pattern for property get/sets?

Suppose I have a controller class with a bunch of properties. Each time a property is changed, I would like to update the model. Now also suppose that I use the command pattern to perform model updates. Is it common to use command classes within property get and sets of the controller class or is there a better way? Here is an example of what I am currently using:               class MyController {       private int _myInt;       public int MyInt {         get { return _myInt; }         set {           MyCommand cmd = new MyCommand();           cmd.Argument = _myInt;           cmd.Execute();  // Command object updates the model         }       }      }


Resources for using TFS for Agile Project Development?

Our company just installed TFS for us to start using for project development processes and source control. They want us to start using it to manage our projects as well. We have a small team, no current bug or task tracking software, and 2 developers of the 3 have experience with any actual methodologies. What books, websites, and/or other information can you recommend for us to use to get started?


Any language where every class instance is a class too?

Taking inspiration from Javascript prototypes, I had the idea of a language where every instance can be used as a class. Before I potentially reinvent the wheel, I would like to ask if there is a language already using this concept:               //To declare a Class, extend the base class (in this case, Type)     Type(Weapon,{price:0});          //Same syntax to inherit; simply extend the parent:     Weapon(Sword,{price:3});     Weapon(Axe,{price:4});          Sword(Katana,{price:7});     Sword(Dagger,{price:3});          //And the same to create an instance:     Katana(myKatana,{nickname:"Leon"});     myKatana.price; // 7     myKatana.nickname; // Leon          // An operator to return children of a class;     Sword_; // [Katana, Dagger]          // An operator to return array of descendants;     Sword__; // [Katana, Dagger, myKatana]          // An operator to return array of parents;     Sword^; // Weapon          // Arrays can be used as elements     Sword__.price += 1; //increases price of Sword's descendants by 1     mySword.price; //8          // And to access specific element (using its name instead of index)     var name = "mySword"     Katana_[name]; // [mySword]     Katana_[name].nickname; // Leon      Has this kind of approach been already studied/implemented?


Google-Gson Converting JSon to CSV

What is the easiest way to convert a Json data to a String at CSV format ? I haven't read all the api yet but it seems that subclassing the default JSonWriter allows to remove unnecessary character in order to be closer to CSV format. Does a simpler solution exist ?


Building a Graph Editor - How to create a data driven graph

I am developing a graph-editor that uses drag and drop to build hierarchical graphs (containing nodes and links). Each node in the graph should be linked to a table in our database (SQL Server). I did a lot of research about libraries based on javascript or/and JSON specifications to draw nodes and links. There are a lot of great examples to follow, but I have no idea about the way I can link a graph to a database (SQL Server, Oracle, MySQL...). I thought about this architecture (Question posted on stackexchange.com) I have looked at the D3 library. It creates data-driven charts, but I think it only uses flat files, and not relational databases. First can you please tell me if my architecture is well thought out? And second can you give me some ideas about the way I can link my graphs to the DBMS? Thanks a lot.


Where should you store variables for a search program in java?

**I'm wondering which is a more effective storage method in java.** Would be better to save constants in a class or a resource? The constants will be searched later by my Search program which will go through the list of constants so as to recognize possible options. Also if there is a more efficient method of storing them please say so or if i doesn't matter where i store them. **1). A java class called Search is going to be inputted with two or more constants they will then either access a java class that will redirect them as needed.** **2). Search will receive the same information but will look to a external resource to see what possible files match it then corresponding what info was give will open a pathway to the java class it correlated.** Which version should be better or will it not matter? the values the constants contain are going to be ints but each int will have their own unique meaning. To clarify why i need these arrays each number is going to have a meaning and the arraylists will hold the numbers like 1 may mean work 2 may mean private and so a private work document would have name PDocument has [1,2] so on and so on hope that clarifies So which option is more effecient #1 or #2


How can I configure my programming environment to enable rapid switching between projects?

It often happens that I develop multiple different projects at once, so I need a solution to switch from one environment to another. I have created batch files to do the job but as this thing grows, I'll soon need something better. Some things I do are:   * Map drives   * Launch applications   * Load test databases   * Set environment variables   * etc. Any suggestions on that? **Edited:** I want to unify the development process in some way. We use VS, Eclipse, Notepad++ or what ever the developer needs. The goal is to be able to load a project in any windows machine without having compiling or other issues. Example:   * The solution might need to reference files, sdk folders, test data paths or other stuff. To solve this: I have mapped the code to a drive. The project doesn't need to know whether the dev is using c:\dev or c:\programming folders (user choice). They only need to map their coding folder to a drive (lets say W:) every file of the solution is under W:   * Another problem is the SDKs. An sdk can be in c:\programfiles\Microsoft sdks\etc.. or in c:\programfiles **x86** \Microsoft sdks\etc.. Those Sdks should also need mapping to a standard folder that the solution knows. Another thing is that we want services running (apache lets say) if we develop a website. We don't want this to run all the time. The solution so far is to distribute batch files that the developer edits once in order to match their paths to the solutions and they run the batch before they start their new task. I am thinking on developing a app that will set the environment as desired. Preconfigured sets that are distributed. The developer executes them in order to set the enviromnent as desired. I hope to be clear now on the problem. Any suggestions on doing that in a better way?


Differences between different creative coding libraries

I've worked with Cinder previously under Windows, but have recently switched to Ubuntu. Since Cinder doesn't work on Linux (::sadface::) I've began looking for alternatives. With that in mind, could you please tell me what the differences between Processing, openFrameworks and Polycode are, and compare them to Cinder? Specifically, I would like to know   * If there are differences in the _functionality of the packages_ compared to Cinder (ie. one does something that Cinder doesn't and vice versa).    * I would also like to know how different the _syntax of the package_ is from Cinder's. I have already seen the following articles : here and here and have also visited the corresponding website for each of the libraries but could not find a clear and concise answer to my question.


JavaScript Frameworks for traditionally structured web applications

I am looking for a way to control large amounts of JavaScript code in a ASP.Net MVC web application. I have been looking at Ember.js and whilst it's pretty compelling it takes control of the routing and as such treats the server as little more than a place from which to receive API calls. This isn't really useful for what I need. I wondered if there recommendations for similar projects out there that allow faster, more structured, JavaScript but in traditional server-based web applications?


Data transfer between "main" site and secured virtual subsite

I am currently working on a C# ASP.Net 3.5 website I wrote some years ago which consists of a "main" public site, and a sub-site which is our customer management application, using forms-based authentication. The sub-site is set up as a virtual folder in IIS and though it's a subfolder of "main", it functions as a separate web app which handles CRUD access to our customer database and is only accessible by our staff. The main site currently includes a form for new leads to fill in, which generates an email to our sales staff so they can contact them and convince them to become customers. If that process is successful, the staff manually enter the information from the email into the database. Not surprisingly, I now have a new requirement to feed the data from the new lead form directly into the database so staff can just check a box for instance to turn the lead into a customer. My question therefore is how to go about doing this? Possible options I've thought of:   1. Move the new lead form into the customer database subsite (with authentication turned off).   2. Add database handling code to the main site. (No, not seriously considering this duplication of effort! :)   3. Design some mechanism (via REST?) so a webpage outside the customer database subsite can feed data into the customer database How to organise the code for this situation, preferably with extensibility in mind, and particularly are there any options I haven't thought of?


Rest API Architecture from Rest in Practice book

We maintain an API that as part of its purpose makes a call to an external API. This external API takes a few seconds to fulfil the request we make to it. With our current architecture the request is made synchronously, meaning that the http response we return to the user request is blocked until our service get the response from the external API. I am considering changing our architecture to be able to deal with the request asynchronously... By this I mean accept the user request into our API and put a message on a queue so that we return an http response a lot quicker. The response would contain the address of where the full/complete result can be found. A background task would then pick messages up from the queue and make the call to the external API, then store the result at the address provided in our response. The address could then be polled by the user/client until the desired state of the respource is reached (i.e. when the background task has finished calling the external api and has stored the result). This architecture I have mainly lifted from the REST in Practice book. The crux however is that our external API only takes 2-3 seconds to return the response. The example in the book describes an ordering process that might take minutes or hours. Is this suggested solution worth the increase in complexity for such a short response time from our external dependency? i.e. will the application still scale with the existing synchronous architecture?


Factory-Class versus Static Class

I've got a little problem in choosing the best design. I have some (5 at the moment) image processing operations in my coe (Java). Every processing step independent from the other ones and consoists of a small amount of code, 5-15 lines in general. These are mostly wrappers to JAI, AWT and so on. My current design is an abstract class:               public abstract class AbstractPreProcessingStep {         protected Logger logger = Logger.getLogger(this.getClass().getName());              protected AbstractPreProcessingStep() {         };              public abstract BufferedImage startProcessing(BufferedImage input);          }      Every processing step implements this class and can be called uniform. (like the Strategy-Pattern). Since every processing step may have a different set of parameters, I created a factory class, like this:               public class PreProcessingFactory {                   public static AbstractPreProcessingStep createColorInverter() {             return new ColorInverter();         }                   public static AbstractPreProcessingStep createRescaler(float rescaleFactor) {             return new Rescaler(rescaleFactor);         }                   public static AbstractPreProcessingStep createEdgeDetector() {             return new EdgeDetector();         }              public static AbstractPreProcessingStep createBlackAndWhite() {             return new BlackAndWhite();         }     ...      So, if you want to create a black and white image with inverted colors, you need to do this (pseude code)               bw = PreProcessingFactory.createBlackAndWhite();     inv = PreProcessingFactory.createInverter();     result = bw.startProcessing(result);     result = inv.startProcessing(result);      In my mind, this is a good design since the implementation details are hidden and new processing steps can easily be add by adding a new class. The other approach which was in my mind was to create a single class with every step as a static method - however, I've got dislike of 'static' Do you have any suggestions to improve the code?


Operator distributivity in expressions - syntactic sugar

When writing boolean expressions out, you often have to use something of the type:               A == any of B1, ..., Bn     C < all of D1, ..., Dm      But in code you have to use expanded forms:               A == B1 or ... or A == Bn     C < D1 and ... and C < Dm      That looks, to me, like _any of_ and _all of_ are simply the distributed form of _or_ and _and_. That made me wonder if you can apply distributivity to operators in some way that compilers/interpretors can understand. For the above example, say, something like this:               A == B1 +_or ... +_or Bn     C < D1 +_and ... +_and Dm      Essentially, taking operators as relations, it should work something like this:               R1(A, distributive_R2(B1, ... , Bn)) becomes     R2(R1(A, B1), ... , R1(A, Bn))      This could apply to more than just booleans:               X / Y1 +_+ ... +_+ Yn becomes     X/Y1 + ... + X/Yn      Of course, my `+_` prefix may not be the ideal syntax; I'm sure there's better ones out there. Nevertheless, this strikes me as being possibly quite useful and understandable. Any thoughts?


Should CountDownLatch be used for waiting for an event?

I have a situation here, where I have a loop that loops x amount of times. The value x is determined by the user. Everytime it loops, I want it to wait for a button click before continuing the loop. ie. something like this (pseudocode):               loop(x times){     Button b;       wait until a click       when clicked{         b.onclicklistener{           setText(x);         }       }     }      I am using this for an android app, so with Thread.wait()/Thread.notify() what I learned was that it interrupts the main UIthread, so I cannot use that. So what I believe the only two options that I can use to kind of "pause" the loop is CountDownLatch.await() or AsyncTask (I don't know what that does, have not researched about it) Would CountDownLatch.await()/CountDownLatch.countDown() be the best methods and class to use in this example, or should I look into AsyncTask?