title: Handling false positives and legacy code warnings in static-analysis of C++ code?

text: We have a large "legacy" C++ code base on which _no_ static analysis is run at the moment. Every now and then, we are thinking about at least using cppcheck, maybe via Visual Lint. (I've also briefly checked the sites of Coverity or Klocwork or RedLizards/Goanna.) However, I do expect a _huge_ number of found warnings and probably also false positives (in that the error does not actually cause an observable bug in the application). We simply do not have the resources available to address these all on rollout of any analysis tool, especially as we would _very much_ only like to touch "code that works (well enough)" if we really have to. So what I am looking for are experiences and _user stories_ of adding C++ static analysis to legacy code bases: > We had this product, consisting of xxx lines of code over zzz C++ projects > and we started using static analysis tool yyy in development. Rooting out > the legacy code warnings took aaa effort, (temporarily) ignoring them was > hard/easy/impossible. Ignoring warnings selectively for the code base really > worked well/didn't work at all. Etc. Something like this. Thanks!


title: Premium and opensource

text: I am thinking about releasing my premium (commercial) project as an opensource project, but I am not sure how the user might benefit, how I will benefit and which license will I use. I really need to know anything possible about this step...


title: Basic web architecture : Perl -> PHP

text: This is an architecture question. If there is a better forum, please redirect me. Apologies in advance. Essentially every website is built around a relational database, right? When a user uploads form data, that data is stored in a table. The problem is that the table structure(s) need to be modified whenever the website form is modified. Although I understand that modern web frameworks work around this problem by automatically building forms based on the table structure. For the last 20 years, I have been building websites using Perl. When I first encountered this problem, the easiest solution was to save serialized Perl objects as data BLOBS. After XML's introduction, this solution worked even better because XML is so effective for representing arbitrary data. This approach is consistent with the original Perl principles of Hubris, Laziness, and Impatience and I'm pretty committed to it. Obviously, the biggest drawback is that this solution locks me into the Perl interpreter. So instead, I've just completed a prototype of a universal RDB table. The prototype is written in Perl but porting it to PHP will be a good chance to develop those skills. The principal is based on the XML::Dumper module, which converts arbitrary Perl data structures into uniform XML. With my approach, each XML node is stored as a table record. I underestimated this undertaking and rolled something up myself. But the effort allows me to discuss the basic design instead of implementation details.   1. As mentioned, I'm pretty committed to this approach of using flexible data structures. It's been successfully deployed on many websites, large, and complex. But are there any drawbacks I've overlooked?   2. I rolled my own. Are other people taking a similar approach to their data? What kinds of solutions are available?   3. I have not abandoned my dream of eventually contributing something useful to the worldwide community. In order to proceed, the next step would be peer review. How does one pursue that effort?


title: When too much encapsulation was reached

text: Recently, I read a lot of good articles about how to do good encapsulation. And when I say "good encapsulation", I am not talking about hiding private fields with public properties; I am talking about preventing users of your API from doing wrong things. Here are two good articles about this subject: http://blog.ploeh.dk/2011/05/24/PokayokeDesignFromSmellToFragrance.aspx http://lostechies.com/derickbailey/2011/03/28/encapsulation-youre-doing-it- wrong/ At my job, the majority of our applications are not destined for other programmers but rather for the customers. About 80% of the application code is at the top of the structure (Not used by other code). For this reason, there is probably no chance ever that this code will be used by other application. An example of encapsulation that prevents users from doing wrong things with your API is returning an IEnumerable instead of IList when you don't want to give the ability to the user to add or remove items in the list. My question is: When can encapsulation be considered simply OOP purism, keeping in mind that each hour of programming is charged to the customer? I want to create code that is maintainable and easy to read and use, but when I am not building a public API (to be used by other programmers), where can we draw the line between perfect code and not so perfect code?


title: Contracting out software development; deliver user stories or business requirements?

text: We are a small company that I am lead developer on, and we have been having on and off meetings with a potential stakeholder for a good opportunity. This stakeholder is helping us directly in getting a proposal together to a group of other stakeholders for software that they have a strong need for. Hopefully if we sell them on our proposal (consisting of very high level features and general deliverables) then they will sponsor the project and it will grow organically from there to users around the country who will see how useful it is. Problem is that we as a development are terribly bogged down as it is with prior projects, maintenance of existing production systems, and badly needed features on the backlog. As it stands, because this project could be highly lucrative and there are no serious competitors, management wants to act FAST and get the most basic functionality out as quickly as possible, **no matter the cost**. This isn't realistic for us without growing our team but that takes too much time. They are thinking about contracting the development work out, but want me to be a business analyst and also have architectural say in the project. When they finish major feature development, they anticipate my team taking responsibility over maintenance so clearly architectural control is important as we want the deliverables to be maintainable. I am okay with this role, but am unaccustomed to it. In house we typically don't use formalized requirements documents, and instead gather requirements from user stories, use cases, workflows and customer agreements. We are used to formulating user stories but I am afraid that doesn't make sense to deliver user stories to an outside contract company as they will likely have their own project managment who might want to do things their way. I wouldn't want to impose our unfamiliar project managment process on them if they find it alien and it slows them down. I am thinking that extremely detailed formalized business requirements are in order because we want to be sure that they have the necessary guidelines to create quality software, but I have no idea what kind of effort this will take from myself alone. I am also unsure of when to start. Nothing is official yet, but I have 90% of the information I feel I need from stakeholders. I just don't want to end up with management informing me that the deal was signed, we have to deliver in 6 months and to get him all the requirements documents by the end of the week. Feeling a little in over my head here, do I formulate user stories or business requirements? Any other helpful suggestions?


title: Is there a precedent for the license on a compiler restricting the kind of development you can use it for?

text: It was recently let slip that the new EULA for Delphi XE3 will prohibit Client Server development with the Professional edition without the additional purchase of a Client Server license pack. This is not to say the Professional version will lack the features, but the license will specifically prohibit the developer from using the compiler for a specific class of development, even with 3rd party or home grown solutions. **So my question is if there is a precedent of a compiler or similar creative tool prohibiting the class of work you can use it for. Specifically a commercially licensed "professional" tool like Delphi XE3. Also, would such a restriction be legally enforceable?** I know there have been educational edition or starter edition tools in the past that have restricted their use for commercial purposes, but those were not sold as "professional" tools. Also I know that a lot of computing software and equipment will have a disclaimer that it is not for use in "life support equipment" or "nuclear power" but that is more of avoiding liability than prohibiting activity. Seems like I recall Microsoft putting a restriction in FrontPage that you couldn't use it to create a web site that reflected poorly on Microsoft, but they pulled that restriction before it could be tested legally. **Update:** The EULA was dropped before the product shipped because of public resistance.


title: Web Developer: Ask to play more of a Project Manager role

text: I am a Web Developer (working with PHP/WordPress/Symfony2) in a small company (still hiring but at the moment 5 staff), has ~8 months experience (currently a Computer Science student) and asked to fulfill more of a Project Manager role. I am not really even good at personal time management nor would I say my programming is that outstanding yet (still learning, frequently stuck on errors, sometimes server fault eg. setting up a development server and SVN). In reality, it appears compared to my peers, its actually good, but thinking about Google, Microsoft or even err ... Oracle maybe, my skills are probably quite lacking still I thought either way, its a good learning opportunity. How do I start? I think I need to have a proper way of collaboration or communicating each others progress and documentation. Theres SVN but being relatively new, it slows things down sometimes. How do I assign work such that people dont mess up other's code? I actually caused a colleague quite a headache when I edited some configuration, meant for personal development use. I found myself waiting for another colleagues work (user management/login/registration) to be able to complete mine (ACL part for my "module", similar to blog posts). I actually wanted to "fake" a logged in user, but that didnt work out (entirely)


title: It's ok to study the C++ from a book that only support the 1998 version of standard?

text: I have this big book that basically covers all the main aspects of the C++, the problem is that is pretty old according to the C++ standards of today, it's ok to use it?


title: Does Silverlight have a future?

text: Recently I have read some articles/blogs/comments about the development and history of WPF and Silverlight. In some forums many developers and users criticize the performance of WPF applications (for example Visual Studio 2010). Actually the market share of Silverlight in comparison to Flash is not very high. At PDC 2010 Bob Muglia said something like "our Silverlight strategy and focus going forward has shifted...." and Microsoft wants to push HTML5 in the future. Additionally, Microsoft has announced HTML5 being a core part of the Windows 8 and Windows Phone 8 ("Mango") platforms. Recently I have started learning Silverlight and now I must ask myself, if I should continue investing time in learning these (in my opinions) very nice and powerful technologies!? Does they have a future? Does (Windows) desktop (client) applications have a future? Does so called "Rich Internet Applications" have a future? Or will HTML5 become the "absolute truth" in software development? What is your opinion and what do you think?


title: What are sites tracking software bugs/defects?

text: I am looking for websites which have list of 'real life' software bugs from software (OS software, application software, ... it can be any layer). It could be open-source or it can be code under any other model of development. Basically I am interested in finding out sites which allow me to read code snippets which have bugs in it. Programming languages interested are C,C++,PERL. But if the s/w defects are language agnostic, and more to do with general concepts(or misuse of them rather), then it still would be helpful. P.S. To check out 'bugzilla' or bug tracking links for each open-source project for this is one way. (BTW what is the url for bug tracking in Linux development(kernel related bugs, device driver related, networking layer related,...) Any pointers would be useful. Thank you, -AD.


title: Resources relating to Java EE and Scala

text: Are there any good sites / blogs / books / articles on using Java EE together with Scala? Or indeed articles saying that it should not be done. Many Scala resources talk about using Akka and Lift. Akka solves a different domain problem than Java EE. I don't know Lift, but I assume its geared towards the web end of Java EE and doesn't replace app server containers which provide transactions, security, scalability, resource management, reliability, etc. (all those things which Java EE markets itself as being good at).


title: How to get an image or rectangle to detect collision with another image

text: Can someone please explain to me how to detect collision with another image? The tutorial I was watching explained how to detect if a collision occurs between two rectangles but I would like to use two images instead. Please see the code below.               public void paintComponent(Graphics g){      //g.drawImage(yellowBall, xCoor, yCoor, this);     Rectangle r1 = new Rectangle((boardXSize/2), (boardYSize/2),50, 50);     Rectangle r2 = new Rectangle(200, (250),50, 50);     g.setColor(Color.red);     g.fillRect(r1.x, r1.y, r1.width, r1.height);     g.setColor(Color.blue);     g.fillRect(r2.x, r2.y, r2.width, r2.height);          if(r1.intersects(r2)){             System.out.println("Collision Detected");          }     repaint();          }      How can I detect if r1 intersects yellowBall instead of r2? Please keep responses at the beginner level but of course, any assistance is greatly appreciated. Thanks!!


title: Hadoop and Object Reuse, Why?

text: In Hadoop, objects passed to reducers are reused. This is extremely surprising and hard to track down if you're not expecting it. Furthermore, the original tracker for this "feature" doesn't offer any evidence that this change actually improved performance (unless I missed it). > It would speed up the system substantially if we reused the keys and values > [...] but I think it is worth doing. This seems completely counter to this very popular answer. Is there some credence to the Hadoop developer's claim? Is there something "special" about Hadoop that would invalidate the notion of object creation being cheap?


title: The destination of cout messages in a GUI program

text: I've been building some classes and functions in a static library which has the familiar printing of text messages to `stdout`:               cout << "Hello World!" << endl;      I've been developing this library for use in a console application but I'm considering also trying to make a GUI version, because it will be both useful and highly educational (for me). I wonder how is it possible to make output in a library sent to both `stdout` and GUI controls (like a status bar or a popup window). Since such messages are all sent (in my case anyway) to one destination (cout) could some sort of redirection be possible? I've always presumed something like this may be possible as people often release command line and GUI versions of their programs.


title: Scrum tool for Product Backlog management

text: My team and I are very keen on doing Scrum "manual"-style (with paper and scissors). Though, we are struggling to find a tool to manage our backlog. The main requirements are:   * To be able to print the backlog in cards to stick to the whiteboard   * To be able to assign backlog items to the releases manually So far we have not found anything that matches these criteria. Suggestions?


title: How are dates typically handled with testing?

text: I am writing an app at the moment that has some pretty extensive business logic based around dates. I have several hundred thousand records to test and testers who want to see how those records are handled, which has worked well so far, however, some edge cases are difficult to replicate. The reason is that most of the logic is related to today's date, in one way or another. What is the best way to handle this with both unit testing and for traditional testing? The only way I can really think of is allowing for today's date to be faked and fixed.


title: Is it bad practice to use reflection to do DB inserts with data from an external service?

text: Our supplier's webservice is returning address objects (~30 fields) and I'm using LINQ and reflection to store the returned data straight into the databse. I loop over the attributes and set the value from the object to the LINQ class. I'm fairly new to refection and I'm worried this may be bad practice; it saves ~30 lines of code in 3 or 4 methods but I'm afraid it could introduce hard to fix bugs. **EDIT** Here is the code. Target is normally a LINQ to SQL entity and input would be a webservice object.               public static void SetValues(object target, object input)     {         Type targetType = target.GetType();         Type inputType = input.GetType();              PropertyDescriptorCollection inputProperties = TypeDescriptor.GetProperties(inputType);         PropertyDescriptorCollection targetProperties = TypeDescriptor.GetProperties(targetType);              foreach (PropertyDescriptor p in inputProperties)         {             object value = p.GetValue(input);                  var t = targetProperties.Find(p.Name, false);             if (t != null && value != null)             {                 if (value.GetType() == typeof(string) || value.GetType() == typeof(Int64) || value.GetType() == typeof(int) || value.GetType() == typeof(Boolean))                 {                     t.SetValue(target, value);                      }                 else if (value.GetType() == typeof(DateTime) || value.GetType() == typeof(DateTime?))                 {                     if ((DateTime)value > DateTime.MinValue)                     {                         t.SetValue(target, value);                     }                      }                 else                 {                     t.SetValue(target, value.ToString());                 }             }              }


title: Making Class Diagram for MVC Pattern Project

text: I have a question about making a class diagram for an MVC based college senior project. If we have 2 actors of users in my system, lets say `Undergrad` and `Graduate` students are the children of abstract class called `User`. (Generalisation) Each actor has his own features. My question, in such case, do we need to have these two actors in separate classes which inherits from the abstract class `User`? even though, I'm going to implement them as roles using one Model called `User Model` ? I think you can see my confusion here. I code using MVC pattern, but I've never made a class diagram for this pattern. Thank you in advance!


title: Is it a betrayal of user privacy to publish server logs with IP addresses in them?

text: I have a web application with server logs that are attractive to researchers. Is it ethical or not to release the logs publicly? They contain visitor IP addresses and the user-agent but no more identity-related information than that.


title: Extend functionallity of a class: inheritance or java's dynamic proxy

text: Currently I have three classes and respective interfaces and respective builders:   * **Tree** : the data structure (implemented in `SimpleTree`)   * **ProbabilityTree** : is a `Tree` with added functionality to randomly select child nodes and to adjust the probability of selecting a node (implemented in `ProbabilityTreeImpl`).   * **DynamicTree** : is a `ProbabilityTree` which dynamically constructs nodes when a requested node doesn't exist yet. The client code needs Trees that support both random selection of nodes, as provided by `ProbabilityTree`, and the tree dynamically growing when yet unexisting nodes are requested, as provided by `DynamicTree`. _NOTE: Currently all three trees are immutable after having been build; for`DynamicTree` this means clients cannot add or remove nodes, but the tree itself can automatically change._ _NOTE: SeeGithub gist with the five Java classes for the code._ There are at least two issues with this design:   1. `DynamicTree` is derived from `ProbabilityTree`, while conceptionally these two capabilities are unrelated (i.e. orthogonal).   2. Using inheritance to add functionally is often considered "bad design" (correct me if I'm wrong here). * * * An alternative design would be to decouple `ProbabilityTree` and `DynamicTree` using something similar to the decorator and/or adapter pattern. Using Java's dynamic Proxy might enable "decorators" that extend the interface and that can decorate other `Tree`s with extended interfaces; i.e.:               TreeDecorator implements InvocationHandler, ... {         Tree adapted;         ...         Object invoke(Method method, Object[] args) {             if( «this class can/should handle method» ) {                 return method.invoke(this, args);             } else if ( «this.adapted can/should handle method» ){                 return method.invoke(adapted, args);             }         };     }      Again there are some issue's:   1. Using `Proxy` makes the code more difficult to understand. What shall I do? Use inheritance to extend functionallity, use dynamic proxy, or something else?


title: Can display issues affect SEO?

text: Can website display issues on certain platforms affect a website's search rankings and potentially hinder any SEO efforts?


title: Dependency Inversion Principle: How to define "high-level policy" and "low-level detail" to other people?

text: I am trying to explain the dependency inversion principle to my (mostly junior) colleagues. How can we define which one is the "high-level policy" and which one is the "low-level detail" in a software? For example, if our software automates workflow of several business applications, why do we say that the workflow automation is the high-level policy and the business applications are the details?


title: QFS (Quantcast File System): Scalable for medium "big data" problems or only for extremely large

text: I am doing some investigating and research into programming "big data", and am particularly interested in QuantCast (QFS) because it is written in my own favourite programming language, C++. Looking at how this may play a part in the solution to certain "big data" problems, I know this can manage implementation of peta-byte file systems. I would like to know however how scalable it is for big-data systems that are not as hugely big. I have seen a lot of comparisons between QFS and Hadoop, and how QFS can outperform Hadoop and so anyone who uses Hadoop may consider using Quantcast (if they just want mega performance). Essentially is it scalable for medium to large projects? (Someone asked the same about BDD but not Quantcast) (Also I have seen Hadoop and thus Quantcast being called a "database". I would call it a filesystem, on top of which you might build a database but wouldn't call it a database itself).


title: How might a simple IDE work? Algorithms/Pseudocode/etc

text: **Background** In a recent school software engineering module, I needed to developed a static program analyzer. Given a ficticious programming language source code, I need to analyze it, then the user can query about the program, eg. what statements uses this variable, which modifies, statements affected by another etc. **Possible link with IDEs** At first, it sounded very useless... it was a software engineering module but in reality more like some theoretical programming language module instead. However, some of these functionality could be what goes into the IDE's we use. So I was wondering how might some common IDE functionality be implemented. _**Static_ Program Analyzer (how to make it _dynamic/realtime_ )** In the project, we designed the analyzer for a _static_ program ... but who needs that? In the IDEs we use, everything is near realtime, as we type, syntax highlighting is done, the IDE's analyzes the code for errors, variables that are not used, etc. How is it done so efficiently? In the static analyzer, there is a parser that parses the source, builds AST & CFG. This can then be used to see if a variable is used by some statement etc. In reality what can be cached are cached. There are many areas that can be optimized, but I am not sure any (I can think of) can make it realtime. Some problems I can see are:   * As we type, things are incomplete, this will lead to a parsing error, but a real IDE somehow is smart enough to know where to continue parsing.    * As we type, things change very rapidly, we cannot parse the entire program. Even if I make the parser smart enough and parse only the changed line, I need to update my AST/CFG/expire relevant cache etc.  **In a real IDE, I don't see that CPU usage spikes as we type etc. How is it done?** Some might suggest looking at the source of some open source IDE eg. Eclipse or Netbeans. But I expect it to be really hard to understand such a big app by just reading code. What I hope to get is a high level _idea_ of how might a simple IDE (and some of the commonly used features) be implemented, a simple paragraph or some pseudocode etc. Some common features I can think of now are   * Refactoring (something like a contextual find and replace)   * Find usages   * Go to definition   * Auto complete (find all possible classes, variables, methods in context)   * Syntax highlighting For static code, some might be trivial to implement, but an IDE is _(near) realtime_


title: Audiobooks for programmers?

text: I'm a programmer with a two-hour round trip commute to work each day. I'd like to fill some of that time with audiobooks about software development. Any audiobooks that would help me become a better programmer would be appreciated. I'm thinking that books about design patterns and non-fiction about computing history might be good here, but I'm open to anything. Keeping in mind that I will be listening to this in a car, what are the best audiobooks that I can listen to? EDIT: Many people have also suggested podcasts. This is appreciated, but since podcasts arrive in a constantly arriving stream of data rather than as a finite amount of data, ways to juggle all of these different content streams would also be appreciated. To be more specific to my situation, my commuting vehicle has an MP3 CD player, USB input for MP3 files, and AUX input. I own Android and webOS devices that can be plugged into the AUX input.


title: Are unused CSS rules so costly that they must be removed?

text: I have been reading various Web application optimizing articles and many of them suggest to remove unused CSS rules. Currently, I have a page which has jQueryUI css, Bootstrap CSS, Datatables CSS and couple of more. All together they translate to about couple of thousands of rules ( my estimate ) and am quite sure I am using only 20-30% I asked my friend in UK who has very high speed broadband, to check the page load time and he says, like for every other page on his connection this one too loaded in a second which is quite suggestive that rendering time seems insignificant to the page load time. How much improvement is expected in removing unused CSS rules? Is it really worth it?


title: Would you purchase hardware with your own money to use at work to do your job better?

text: At work, I was given a reasonably-spec'ed machine (dual quad 2GHz, 4GB RAM, 160GB 7200RPM drive, Win7), but it was lacking in a few places (HDD / RAM). The IT staff was OK with me replacing hardware with my own, so now I'm sporting an SSD and an extra 8GB of RAM (so I can run multiple Visual Studios & virtual machines). I realize it was the company's business decision to pick the machines they did, but at the same time faster hardware made me happier and more productive at work. I guess my question is, am I the only one (self-employs not withstanding :) who's willing to spend personal money on their work hardware for a better quality of life, and should I approach it in a different way? Is it possible to retroactively say "I think you should reimburse me for this $500 in hardware because [blah]"?


title: How to make sure I don't end up with the blame

text: I'm working on a contract at present where I'm essentially working as a subcontractor for a fairly big digital agency. The real end customer is a big corp. So far, I have of course done an **_amazing_** job :)   * The agency had a "spec" up front - basically a "sitemap" for the app. This was my "blueprint".   * Inside the first week, I built a working prototype app complete with a new data service - which met the sitemap perfectly. Milestone formally accepted - lots of +ive feedback from the agency.   * In the second week I built and delivered a beautiful fully working CMS for the data (really, it's beautiful - I'm stunned). Milestone formally accepted - again lots of +ive feedback from the agency. Then the problems started... basically I needed the assets and design pack to complete the app and the project, and what the agency delivered was rubbish - unfinished photoshop files completely skipping half of the app and with every page having undecided A/B options. There's nothing decided in this design pack, so we can't even start on the next project phase. I flagged this with them a few times... they ignored me for a week, then came back with "what are you talking about? we finished the design pack weeks ago"... I then asked them if they'd looked at what they produced... they then looked at it and admitted it needed "some work". Since then it's been more delays and nothing delivered. The situation now is that:   * this project is now being delayed and delayed and delayed which is causing problems all over the place (with the customer, within the agency, within my schedule)   * I get the sense that the problems/delays are actually being blamed on "that subcontractor"   * my only contact in the project is one person in the agency - so no-one has any visibility of what the true situation is. I can cope with the delays and the problems, and I'm pretty sure I don't want to work with this current contact ever again. However, I'd really quite like to work for other people in this same agency in the future - and (in my dreams) I also wouldn't mind getting some contact with the end customer too. How can I avoid a "bum rap" on this project? Any ideas?


title: What's the best way to version a multi-component project

text: I have a program which is built of 5 major components. I find the standard version numbering too limiting because I would like to see what version each compoment is at. Has anyone found an easy way to do this other than list each separately?


title: Using gerrit (or similar tool) on a team where multiple devs work on a single feature

text: We have a team of roughly ~8 devs who regularly work on the same feature over the course of a 3 week sprint. It isn't quite pair programming, but in our current workflow devs regularly push up incomplete code for a colleague to complete. This worked fine before we introduced Gerrit, but now our commits need to represent chunks of test-passing, complete, logical functionality, and so the model breaks. My only idea is to have everybody push up to a separate, untracked branch up until the functionality is ready for review, then squash everything into commits that make sense and push up. Is there another Gerrit-ized workflow that could work? I know this is a widely discussed topic on Google Groups, and that there has recently been some discussion of Gerrit topic reviews, but I wanted to see if there is anybody out there using Gerrit in this way, and what the suggested workflow would be.


title: ELMAH - Where does it fit right...?

text: The question title may not be correct. I have worked in a very big ASP.NET web application (without using MVC), there I used a simple error handling strategy :   1. Enclose every statement in try..catch block   2. Have a error label on each page at the very top    3. If any exception occurs then show the error description on the Error Label. Now I am switching to a new project where MVC 3 framework is to be used, so I came across ELMAH. It is indeed a nice tool for error handling and logging. But as I read from many sites, it basically logs unhandled exceptions. If I use the same strategy that every statement in try..catch block and then show the error message on the page at the top, then where does ELMAH sit, how will it log the exception? Which exception will it log if I am not putting a single statement outside try..catch block. So there is no scope for the unhandled exception.


title: Keeping a project alive with a "skeleton crew"? Bad/good idea?

text: For political reasons, management seems intent on keeping a project progressing, but stripping away the most senior developers to perform other higher-priority tasks. Instead one more junior developer will be working on the project while consulting periodically with senior devs. Ostensibly the project will keep progressing, but at a much slower pace on the back burner. This seemingly satisfies both those that need the senior devs to fight fires and those that want to see the project continue to be worked on. In theory the senior devs will come back full time 6 mos from now to finish off the project. Is this a good idea? What problems could this cause? Would it be better to completely staff or completely halt the project and finish other stuff?


title: Should db be mapped directly to the UI or should there be multiple layers of enties/models with mappings to/from each?

text: I would like to know arguments for/against this concept. Technologies in use from the bottom up:   * MSSQL 2012 DB (exclusively accessed via sprocs)    * Entity Framework    * WCF Web Service    * ASP.NET Webforms Someone on my team would like to use Entity Framework to map the sprocs to ComplexTypes, and then use those ComplexTypes as DTOs, eventually using them as a view model to display on the page. His argument is that it's the fastest/easiest way and we'll get noticeable/valued changes more quickly. Also, he does not like the idea of the numerous mappings that would be necessary to go from DB -> Entity -> DTO -> ViewModel. Another consideration is, the majority of things from the DB are going one direction (db -> web), with only a few things actually needing to be changed on the UI and saved/persisted to the DB. To scope this question, there are thousands of previously existing sprocs written against poorly designed database structure (think tables that are 276 columns wide and single rows actually contain multiple entities). The poor structure isn't about to change soon because there are over 200 legacy apps written on top of it.


title: Animated requirements analysis flows with PPT or other software?

text: I've seen people do neat little PowerPoint shows that show data flowing in and out of a system that they use to wow a customer. Is this something you've done before? like show data in from source 1 and out to source 2? I've used mockups and DFD's but never presented anything in motion and I wonder if that adds value or ethos.


title: How to deal with ad-hoc mindsets?

text: I joined a dev team of six two month ago. People are nice, all is good. But more and more I observe an ad-hoc mindset. Stuff gets quick fixed, at the cost of future usability, there is little testing and two people happily admitted, that they like to carry the knowledge around in their head, rather than to write it down. How to deal with this? I'd like to lead by example, but time is limited - I like architecting _and_ actually implementing the stuff. But I'm afraid the ad-hoc mindset infects me and rather than striving for clearness and simplicity in design and code - which isn't simple to establish - I get pulled down the drain of an endless spiral of hacks on hacks - which no outsider can uncouple - just for schedule's and management's sake.


title: Database source control

text: Should database files(scripts etc.) be on source control? If so, what is the best method to keep it and update it there? Is there even a need for database files to be on source control since we can put it on a development server where everyone can use it and make changes to it if needed. But, then we can't get it back if someone messes it up. What approach is best used for databases on source-control?


title: What's the best way to use a kinect with multiple software music synthesizers?

text: For the past few months I've been looking into developing a Kinect based multitouch interface for a variety of software music synthesizers. The overall strategy I've come up with is to create objects, either programatically or (if possible) algorithmically to represent various controls of the soft synth. These should have;   * X position    * Y position   * Height   * Width   * MIDI output channel   * MIDI data scaler (convert x-y coords to midi values) 2 strategies I've considered for agorithmic creation are XML description and somehow pulling stuff right off the screen (ie given a running program, find xycoords of all controls). I have no idea how to go about that second one, which is why I express it in such specific technical language ;). I could do some intermediate solution, like using mouse clicks on the corners of controls to generate an xml file. Another thing I could do, that I've seen frequently in flash apps, is to put the screen size into a variable and use math to build all interface objects in terms of screen size. Note that it isn't strictly necessary to make the objects the same size as onscreen controls, or to represent all onscreen objects (some are just indicators, not interactive controls) Other considerations; Given (for now) two sets of X/Y coords as input (left and right hands), what is my best option for using them? My first instinct is/was to create some kind of focus test, where if the x/y coords fall within the interface object's bounds that object becomes active, and then becomes inactive if they fall outside some other smaller bounds for some period of time. The cheap solution I found was to use the left hand as the pointer/selector and the right as a controller, but it seems like I can do more. I have a few gesture solutions (hidden markov chains) I could screw around with. Not that they'd be easy to get to work, exactly, but it's something I could see myself doing given sufficient incentive. So, to summarize, the problem is   * represent the interface (necessary because the default interface always expects mouse input)   * select a control   * manipulate it using two sets of x/y coords (rotary/continuous controller) or, in the case of switches, preferrably use a gesture to switch it without giving/taking focus. Any comments, especially from people who have worked/are working in multitouch io/NUI, are greatly appreciated. Links to existing projects and/or some good reading material (books, sites, etc) would be a big help.


title: What is the best way to prove that in-code documentation is greater than extensive external documentation?

text: What is the best way to prove to my boss that in code documentation is greater than extensive external documents containing documentation and screenshots of code/ui? We have a group in the company running SAP code. Their documentation process involves hours of laborious documentation and screenshots of the code and the interface (before and after). They want us (C# developers) to follow the same rubric as they do. I want to argue that using comments in the code, and a great, self documenting language such as C# is fulfilling the need for documentation the same as, or greater than the other team's document method. Is there any published research by big companies that say external documentation is out dated and that in code comments are more efficient? (or something similar to this point) Edit - This has nothing to do with users. this is NOT user training documentation. Only internal use Edit Edit - This has nothing to do with Design Documents or Architectural Documents. Its comparing screenshots of code, before and after a change, and screenshots of forms, before and after the change, and putting them into a document with extensive documentation, opposed to simply having great incode documentation. Would you really want to have to screenshot your code before and after every single baby change and then write a document explaining the change in great depth? when no one will ever use these documents as reference material in the future?


title: How do I fix and prevent corrupted MySQL tables?

text: We have developed software that uses MySQL. After some months of usage, some of the database tables had been corrupted and need to be repaired. Because of the corruption,we are not able to create a backup using Navicat, and we can not generate a dump too. The log file has been indicating the following error for more than 2 days:               YYMMDD HH:MM:SS [ERROR] /usr/sbin/mysqld: Can't open file: 'ini.MYI' (errno:145)      What is the cause of this corruption? How can we fix them? How can we prevent the database tables from corruption in the future?


title: Should I limit my type name suffix vocabulary when using OOP?

text: My co-workers tend to think that it is better to limit non-domain type suffixes to a small fixed set of OOP-pattern inspired words, e.g.:   * *Service   * *Repository   * *Factory   * *Manager   * *Provider I believe there is no reason to not extend that set with more names, e.g. (some "translation" to the previous vocabulary is given in brackets):   * *Distributor (=> *DistributionManager or *SendingService)   * *Generator   * *Browser (=> *ReadonlyRepositoryService)   * *Processor   * *Manipulator (=> *StateMachineManager)   * *Enricher (=> *EnrichmentService) (*) denotes some domain word, e.g. "Order", "Student", "Item" etc. The domain is probably not complex enough to use specialized approaches such as DDD which could drive the naming.


title: Helper functions - well defined inputs or well defined outputs?

text: ### Problem In Codeigniter (PHP framework), I am trying to create a helper function that will inject an ActiveRecord (for MySQL) command into a chain of existing ActiveRecord calls. The reasoning for this is that the current ActiveRecord commands available are not reliable enough, and produce differing results depending on what parameters are passed in. For example:               $param = "";     $this->db->where('field', "");      produces               WHERE `field` = ""      This would provide a result set where **only blank fields were returned**. This is not always the intended behavior, as the input comes from a web form, and may be the result of no specific query being submitted - thus **all results should be returned instead**. ### Attempted solution What I decided to come up with, was a helper method that would take in a set of unknown inputs, and return a result set that would match my desired behavior (eg. return all results or return none). Using test cases and a test method to abstract the desired set of inputs and outputs away, I hoped to produce an easy-to-call method for coercing the database results into my desired behavior. This would be easier then say, **coercing the input into an expected type** , and then using the unreliable behavior of Codeigniter's ActiveRecord commands. My main concern however, is that my helper function may be trying to do too much - my colleague described it as a magic method that takes anything and may have arcane implementation details. It would thus be less readable than the ActiveRecord convention (which is more well-known) and harder to maintain. Is my function the best way to go about it, or are there better alternatives out there?


title: Rails: Useful example of delegate and Law of Demeter

text: I am currently learning about `delegate` and the Law of Demeter. I understand the Law of Demeter, but I can't seem to find a good example of where using `delegate` to avoid breaking the law would actually even be useful. I want to find an example related to my project, since I have to give a presentation. The only line of code that I found that could possibly be breaking the Law of Demeter is the following: `@game.promotions.find_by_promo_type("cross")` The model `Game` `has_many` `Promotions` and it is reaching across another model to execute a `find` call based on promotions attribute `promo_type`. From my understanding this is a violation of the Law of Demeter, and I should implement the following solution.               class Game < ActiveRecord::Base        has_many :promotions             delegate :find_by_promo_type, :to => :promotion     end      Can you give me an example where this would actually be useful besides "the Law of Demeter says so". The only thing I can think of, is for some reason I wanted to change the name of `promotions` to `promos`, then the solution would be useful because I would only need to make the following change and `:find_by_promo_type` will still work for `Game`               class Game < ActiveRecord::Base        has_many :promos             delegate :find_by_promo_type, :to => :promos     end      The only thing is, I believe this argument is flawed. If I were to change a models name, I would also have to refactor code in many other places that don't even break the Law of Demeter. It's hard to believe that this is all the Law of Demeter can accomplish in regards to this example. Can somebody please help me understand this.


title: SQLite resources or any other storage concept for mobile applications?

text: I would like to know what storage concepts are used for mobile or handheld devices, where an app is operated on?. AFAIK one of them is SQlite. Can anyone shed a light on this concept? perhaps links and resources will be much useful to many of new developers. Thanks a ton.:) EDIT: My target would be Android and ios OS.


title: What ever happened to the Defense Software Reuse System (DSRS)?

text: I've been reading some papers from the early 90s about a US Department of Defense software reuse initiative called the Defense Software Reuse System (DSRS). The most recent mention of it I could find was in a paper from 2000 - A Survey of Software Reuse Repositories > ### Defense Software Repository System (DSRS) > > The DSRS is an automated repository for storing and retrieving Reusable > Software Assets (RSAs) [14]. The DSRS software now manages inventories of > reusable assets at seven software reuse support centers (SRSCs). The DSRS > serves as a central collection point for quality RSAs, and facilitates > software reuse by offering developers the opportunity to match their > requirements with existing software products. DSRS accounts are available > for Government employees and contractor personnel currently supporting > Government projects... > > ...The DoD software community is trying to change its software engineering > model from its current software cycle to a process-driven, domain-specific, > architecture-based, repository-assisted way of constructing software [15]. > In this changing environment, the DSRS has the highest potential to become > the DoD standard reuse repository because it is the only existing deployed, > operational repository with multiple interoperable locations across DoD. > Seven DSRS locations support nearly 1,000 users and list nearly 9,000 > reusable assets. The DISA DSRS alone lists 3,880 reusable assets and has 400 > user accounts... > > The far-term strategy of the DSRS is to support a virtual repository. These > interconnected repositories will provide the ability to locate and share > reusable components across domains and among the services. An effective and > evolving DSRS is a central requirement to the success of the DoD software > reuse initiative. Evolving DoD repository requirements demand that DISA > continue to have an operational DSRS site to support testing in an actual > repository operation and to support DoD users. The classification process > for the DSRS is a basic technology for providing customer support [16]. This > process is the first step in making reusable assets available for > implementing the functional and technical migration strategies. > > ...   >  [14] DSRS - Defense Technology for Adaptable, Reliable Systems   >  URL: http://ssed1.ims.disa.mil/srp/dsrspage.html   >  [15] STARS - Software Technology for Adaptable, Reliable Systems   >  URL: http://www.stars.ballston.paramax.com/index.html   >  [16] D. E. Perry and S. S. Popovitch, “Inquire: Predicate-based use and > reuse,''   >  in Proceedings of the 8th Knowledge-Based Software Engineering Conference, > pp. 144-151, September 1993.   >  ... Is DSRS dead, and were there any post-mortem reports on it? Are there other more-recent US government initiatives or reports on software reuse?


title: Suggesting albums based on friends' top ten lists

text: Just wondering if someone could suggest a good algorithm in the collaborative filtering vein that I could use to suggest music choices based on top ten lists. This is a personal project, I am a member of a private music blog where most of the users recently submitted "best of 2011" lists. The lists range in size (say 10-50 albums) and are not ranked. Have around 100 lists. Basically hoping to give each user some recommendations based on the correlation of their list with everyone else's.


title: Ideas on the best way to structure my app in Xcode

text: I'd like my app to show locations of nearby restaurants, with different categories. It would have a screen with a button to select which categories should be shown. Depending on which button is pressed, map pins come up at nearby locations, and the pins can be pressed for more information. For storing all the restaurant data, should I create a list using 'enum', similar to the Apple sample code 'MapCallouts'?


title: Ideas for scraping a home-brewed Php-powered bug system

text: I work at a large company, and we are stuck with a crappy home-baked bug tracking tool, which does too many things half-decently, but it search functionality is next-to-impossible to use (has about 80 fields that one has to / can fill out) and the search needs to be precise. We have many duplicate bugs filed that are never consolidated, plus pulling up all bugs filed against some product in some version just will not be easy AT ALL. Getting rid of the current system is a political and strategical impossibility. Hundreds of people are tied into it. What I am hoping to do it iterate over bugs 1 through however many (there is a way, I believe) and then save the resulting HTML pages named 'bug000001.html', 'bug000002.html', etc. After that I would want some sort of Google-Style full text indexing going. What we have is so bad, that doing this would be worthwhile. Bugs do not change that much over time, so I am not that worried about being out-of-sync with the original - it will not be great. So, my question is: suppose I have downloaded the html files in the same folder. What free and open source tool can I use then that would allow fuzzy search on the content? I realize that I can concoct a specific regex every time I search that would probably do the task, but I would like to make this even easier, where mis-spellings do not hurt. I realize that Google's full power of personalized, history-based search will probably not be accessible to me, but I will gladly settle for something close, that is free and easy to use. If you have suggestions for a good free and open source tool/Python library that I can use to automate simple browser actions, such as entering text into a textbox, clicking the button and then saving the content into an HTML file, then please list that as well, although that probably should be a separate question. **EDIT** I do not have access to the source code for PhP front end or back end; this is all locked away by socialists on another continent.


title: Providing work experience on my resume

text: I have a question in writing my resume. I am looking for a career in Java/J2EE etc., I had worked as a teaching assistant for Data Structures in Java. This was from Aug 2009-May 2010. I got internship on PHP during May 2010 and as PHP developer in my univ as RA during Jan 2011 to May 2011. Since I am looking for a long term career in java should I mention the teaching assistant position i.e., Aug 2009- may 2010 at the top or the most recent experience at the top in my experience list.


title: Is "code that generates code" really all that great?

text: I was looking through CodePen's "popular pens" and I noticed this cool little spiral animation somebody made with a seemingly ridiculously small amount of code. This is quite impressive until you click the headings for HTML and CSS to show the "compiled" versions of the same code. Suddenly the 3 lines of HAML and ~40 lines of SCSS turns into a gigantic monster of repetition. Here's where my question comes in: Is it acceptable to do something like this in practice? Don't get me wrong - I love using preprocessors to help me write code faster, but in some cases it looks like it's an automatic copy-paste machine.


title: Is there a name for "More events than expected" bug?

text: Is there a **name for a family of bugs** , that are caused by assumption, that user would generate only 1 event during the execution of the handler ? Simplest example is: animation triggered by click, which can run several copies of itself, if user rapidly clicks several times.


title: Help in (re)designing my Swing application

text: I have developed a Swing application that controls execution of several scripts like jobs. I need to display the interim output of the jobs concurrently. I have followed MVC while writing the application. The application is working as expected. But off late I have the following requirements in hand:     1. A few of the script jobs need special user privileges to execute so as to access specialized resources. There seems to be no way in Java to impersonate as a different user while running an application.[examined in this question]. Also trying to run the Swing application as a scheduled task in windows is not helping.   2. Once started the jobs should be running even if the user logs off after starting the jobs. I am thinking of separating the execution logic from the UI and run that as a service; and introduce JMS in between the two layers so as to store/retrieve the interim the output. Note: I need to run this application on windows. Any ideas on meeting my requirements, will be highly appreciated.


title: What are the design principles that promote testable code? (designing testable code vs driving design through tests)

text: Most of the projects that I work on consider development and unit testing in isolation which makes writing unit tests at a later instance a nightmare. My objective is to keep testing in mind during the high level and low level design phases itself. I want to know if there are any well defined design principles that promote testable code. One such principle that I have come to understand recently is Dependency Inversion through Dependency injection and Inversion of Control. I have read that there is something known as SOLID. I want to understand if following the SOLID principles indirectly results in code that is easily testable? If not, are there any well-defined design principles that promote testable code? I am aware that there is something known as Test Driven Development. Although, I am more interested in designing code with testing in mind during the design phase itself rather than driving design through tests. I hope this makes sense. One more question related to this topic is whether it's alright to re-factor an existing product/project and make changes to code and design for the purpose of being able to write a unit test case for each module?


title: using source control to create release notes?

text: Lets say i have an off the shelf eccomerce cart. I put all the code inside subversion. I start to make changes and check the code changes back in. is it possible to then display each "check in" with the developer messages so that i can make release notes? I would like to use this for actual quoted time.


title: ISerializable vs WCF attributes

text: In C# .NET there is two main possibilities to serialize and object.   1. Implementing the **ISerializable** interface?   2. Using the [DataContract/DataMember] serialization **attribute** of WCF? What are the differences of this two possibilities and what is the better in term of execution time.


title: How to maintain synchronised state across threads - is this a good use for a Singleton?

text: I hear a lot about "Singletons are always bad" around the place. I don't hate on them to that degree but I try not to use them if I have a better alternative. In this case I have a system that handles a lot of requests, each of which comes in on its own thread. Every request that comes in needs to be allocated its own unique sequential Id. Currently I have a Singleton class whose role is to initiate this Id at start- up then maintain it while the system runs. The Singleton is created/retrieved and the Id value incremented in a thread safe way, as one would expect. It is actually handed out to the threads on creation by Dependency Injection, but the core of the class is a classic Singleton built around a static representation of the current Id value. Given that we are only likely to do more work that requires a multi-threaded approach, I would be interested to know whether there is a way I could implement this type of functionality in a way that allows data to be maintained synchronously across threads that are otherwise unaware of each other, without using the much feared Singleton pattern?


title: How to avoid reinventing the wheel when using complex frameworks?

text: For the backstory, I'm developing a GUI application in C#/WPF. I already had in my code quite many instances of               <ComboBox ItemsSource="{Binding Items}">         <ComboBox.ItemTemplate>             <DataTemplate>                 <TextBlock Text="{Binding ItemName}"/>             </DataTemplate>         </ComboBox.ItemTemplate/>     </ComboBox>      when I accidentally stumbled upon `DisplayMemberPath` during a marginally related StackOverflow search, which makes the above               <ComboBox ItemsSource="{Binding Items}"               DisplayMemberPath="ItemName"/>      Now `ComboBox` has 158 public properties, and I really doubt that I should read all of their descriptions before even starting to use a ComboBox. On the other hand I'm really afraid of encountering this problem on a larger scale, since this is my first WPF app and I sometimes get the feeling of doing it wrong. Note that online tutorials apart from the official documentation are very unreliable, often wrong and/or poorly written; at least I found it hard to find a good one. On the other hand, any programming books I've encountered went into too much detail, taking whole chapters explaining things that were obvious to me after the first paragraph, so I skipped a lot of parts. _When using a complex framework or library, how can I avoid accidentally skipping a relevant part of the impenetrably huge documentation, therefore creating unnecessary work for myself?_ I don't think this is a duplicate of What kind of process should I use to learn a big system? or How do you dive into large code bases?, because these are about learning a codebase that you have to understand/work on/modify/improve, also assuming that you have access to the code itself. My question is about being a user of a framework, and the task at hand is "given the huge official documentation and Google, efficiently find those parts of the framework that I can use to make my work easier".


title: Unit testing - should tests for a method validate the results of other methods?

text: One thing bothers me while I'm writing unit tests of my code. did tests of method should include validation of outcome from other methods? Of course, public methods. Let's go to - rather trivial - example:               public int Solve(string forumla)     {         if (forumla.Contains("+"))         {             return SolveAddiction(formula);         }         if (forumla.Contains("-"))         {             return SolveSubstraction(formula);         }         throw new ArgumentException();     }          public int SolveAddiction(string formula)     {         var strings = formula.Split('+');         if (strings.Length != 2)         {             throw new ArgumentException();         }         int firstFactor = int.Parse(strings[0]);         int secondFactor = int.Parse(strings[0]);         return firstFactor + secondFactor;     }      In this case, should tests of `Solve` methods only test control flow, or each possible scenarios for `SolveAddiction`? Let's assume, that `SolveAddiction` and `SolveSubstraction` have they own tests. Using other words, did test scenarios for `Solve` should contains only:   * 2+2   * 2-2   * 2:2 Or also include:   * 2+2+2+2   * 2-2-2-2   * potato - hamster Best regards


title: And if I ask the job interviewer for reasons to join the company?

text: In job interviews I am frequently asked if I know the company, explain why do I think I would be the best choice for this company, etc and I have never liked this kinds of questions. Using your experiences in job interviewing, what do you think it would happen if I ask the interviewer to explain me why he think the company is the best company for me and why I should accept their answer? Do you think it would be a good think or bad thing to do? Edit: the idea of the question would not be to "challenge" the interviewer. The idea of the question would be to see what he thinks about the company, what values he thinks are given importance inside the company and what are the strong points of the company.


title: Suggested Web Application Framework and Database for Enterprise, “Big-Data” App?

text: I have a web application that I have been developing for a small group within my company over the past few years, using Pipeline Pilot (plus jQuery and Python scripting) for web development and back-end computation, and Oracle 10g for my RDBMS. Users upload experimental genomic data, which is parsed into a database, and made available for querying, transformation, and reporting. Experimental data sets are large and have many layers of metadata. A given experimental data record might have a foreign key relationship with a table that describes this data point's assay. Assays can cover multiple genes, which can have multiple transcript, which can have multiple mutations, which can affect multiple signaling pathways, etc. Users need to approach this data from any point in those layers in the metadata. Since all data sets for a given data type can run over a billion rows, this results in some large, dynamic queries that are hard to predict. New data sets are added on a weekly basis (~1GB per set). Experimental data is never updated, but the associated metadata can be updated weekly for a few records and yearly for most others. For every data set insert the system sees, there will be between 10 and 100 selects run against it and associated data. It is okay for updates and inserts to run slow, so long as queries run quick and are as up-to-date as possible. The application continues to grow in size and scope and is already starting to run slower than I like. I am worried that we have about outgrown Pipeline Pilot, and perhaps Oracle (as the sole database). Would a NoSQL database or an OLAP system be appropriate here? What web application frameworks work well with systems like this? I'd like the solution to be something scalable, portable and supportable X-years down the road. Here is the current state of the application:   * Web Server/Data Processing: Pipeline Pilot on Windows Server + IIS    * Database: Oracle 10g, ~1TB of data, ~180 tables with several billion-plus row tables    * Network Storage: Isilon, ~50TB of low-priority raw data


title: GPL licensed software installed on commercial hardware

text: Do vendors need to provide sources, at the customer's request, for GPL licensed software installed on the hardware they sell? For example, a vendor sells an IPTV box and pre-installs some proprietary software product which is linked with some GPLed library. As a consequence, the software becomes GPLed itself.   Does the vendor need to provide the source code for it? The vendor doesn't sell that software, he sells hardware.


title: git tagging comments - best practices

text: I've adopted a tagging system of x.x.x.x, and this works fine. However, you also need to leave a comment with your git tag. I've been using descriptions such as "fixes bug Y" or "feature X", but is this the best sort of comment to be leaving? Particularly, what if a tag encompasses several fixes, it seems not to make sense to have a very long tag comment. Does this mean that I should be creating a tag for every bug fix or feature, or should the tag comments be reflective of something else? I have a few ideas that may be good, but I'd love some advice from seasoned git tagging veterans :) For those who prefer specific examples:               1.0.0.0 - initial release     1.0.0.1 - bug fix for issue X     1.0.0.2 - (what if this is a bug fix for multiple issues, the comment would be too long, no?)      Another example, in this example, the comments are more or less the same as the tags, it seems redundant. Is there something else we could be describing? https://github.com/osCommerce/oscommerce2/tags


title: What is tabular programming?

text: The Falcon programming language advertises itself as supporting tabular programming: > Falcon provides six integrated programming paradigms: procedural, object > oriented, prototype oriented, functional, tabular and message oriented. And > you don't have to master all of them; you just need to pick the ingredients > you prefer, and let the code follow your inspiration. The documentation expands a bit on how the language's flavour of tabular programming works, but it's focused on the language's own structures and syntax, and doesn't really explain the benefits of the paradigm (except of course those that are obvious from the simplistic examples). I'm a bit confused on how the whole thing works internally, from what I understand Falcon's `Table` is a native structure that works more or less as a relational table and could be described (in OO vernacular) as a native Record Set with relational querying capabilities. A horrible description, I know (blame my OO roots and years of abusing tequila). Could you help me get a better idea of what tabular programming is all about and how it works internally? **Clarification:** I am _not_ asking about Tabular Model Programming.


title: Why isn't the Microsoft Public License compatible with the GPL?

text: According to this GNU Project page, regarding Microsoft Public License (Ms- PL): > This is a free software license; it has a copyleft that is not strong, but > incompatible with the GNU GPL. They do not explain _why_ it is incompatible. I cannot find any satisfactory answers nor explanations via Google.


title: Automatic denormalization for a NoSQL database application

text: We have a use case where we store table-like data, but we know about the schema of the data only at runtime. In our application, a power user defines a schema and normal user can create records and make relations between those records. The problem that we are having is that when doing complex queries over the related "tables" (one could say, joins) with filtering and sorting, stuff becomes slow, which is logical. To give an example. Lets say we have an article table with 1M rows and supplier table with 500 rows. Some suppliers have 50K articles. Now lets say I want to get all the articles from that supplier, but sorted by the article name. This query is slow. Which is not strange as it basically creates some sort of temporary table/result, which it needs to sort, but it cannot do it fast as there is no index on a temporary table/result. Our current solution uses Neo4j, but I also tried this on orientdb and in both cases queries are slow, because of the same behavior. Now we have solved this problem for now by creating indexes at runtime based on the schema the user provided, denormalizing articles and suppliers in one index. The problem is that keeping this index up-to-date is very cumbersome. Lets say we want to filter on the articles table on its supplier name. Now the supplier name is in the index, but it has been replicated 50K times in the above example. So if the user changes the name of the supplier, 50K index records need to be updated. Giving us all sorts of performance headaches and timing issues such as what happends if the user in a couple of seconds changes the supplier name twice, we need to queue the operations. Etc etc. So my actual question, is there a clean, non-cumbersome way to automatically denormalize or index out of the box, for a system where the DB schema can change at run-time?


title: How to scope code base health when interviewing for new a company?

text: I've recently started working for an awesome company, on a product which is a steaming pile once you go under the hood. Apart from asking for a code review (which I doubt I'd get anyway), what are the ways of estimating code quality when interviewing?


title: How to implement change and new tools in a small dev team?

text: I have been tasked with producing a plan for implementing a slight change to the work of our developers (there are eight of us working at this company). The change affects a small portion of our work, but introduces a new tool that the developers aren't familiar with, and a new "step". _Very_ schematically the change looks like this Before change:   1. Write stuff   2. Do thing X After change:   1. Write stuff   2. Use tool A   3. Use tool B to do thing X What I have done so far is that I've written documentation for the use of tool A and tool B. My question is what should you be keeping in mind when introducing new tools/changes in development to a small development team? How do you assure that the transmission to the new way of doing things is smooth? What type of educational resources should be available? (The tools introduced are for version control of database schema [so it's only when we make changes the database schema that our development is affected], but I figured that was irrelevant to the topic)


title: Are there any unions for software developers?

text: Why does Software Engineering not have union representation like other professional occupations, such as teaching? Are there any unions for software developers that exist and are successful?


title: What is right choice of Data Access Layer for large application

text: I am using Singleton pattern for my application, I have used ADO.NET Entity framework as my Data Access Layer, after login to my application, it's taking 3 to 5 minutes to load the dashboard. Is there a way to reduce the time? Or I have to look for some other methods instead of Entity framework?


title: Should a structure be refactored into smaller structures?

text: In one of the projects (in C), I have the code that looks like this ( ** _the names are obfuscated specially for question to not give out details of the probject_** ):               typedef struct Module_s {         /* These fields are parsed by f1() */         S1 *s11;         S2 *s12;         size_t n11;         size_t n12;         int i11;              /* These fields are parsed by f2() */         S2 *s21;         S3 *s22;         S4 *s23;         char *c24;              /* These fields are set by f3() and later */         void *v31;         bool b32;         S5 s33[N];         bool b34;     } Module_t;          {         /* Read only header of file and          * parse first 5 fields to determine how to load the rest. */         Module_t *module = f1(input_file);              /* Read the rest of file using information set by f1()          * and determine how f3() should preprocess it. */         f2(input_file, module);              /* Preprocess the file using information provided by f1() and f2(). */         f3(module);              /* Process the file using the information provided by f2() and f3(). */         f4(module);     }      Then, the question is, is it a good move to separate the `Module_t` into 3 smaller chunks, which will contain corresponding fields, set by each function? Then each function will only accept and return a smaller part of `Module_t`, which is probably good, but may complicate further development as interconnections become more complex — and keeping all the dependent fields in one place looks simpler. What I have in mind is this:               typedef struct SS1_s {         /* These fields are parsed by f1() */         S1 *s11;         S2 *s12;         size_t n11;         size_t n12;         int i11;     } SS1_t;               typedef struct SS2_s {         /* These fields are parsed by f2() */         S2 *s21;         S3 *s22;         S4 *s23;         char *c24;     } SS2_t;               typedef struct SS3_s {         /* These fields are set by f3() and later */         void *v31;         bool b32;         S5 s33[N];         bool b34;     } SS3_t;               typedef struct Module_s {         SS1_t ss1;         SS2_t ss2;         SS3_t ss3;     } Module_t;               {         /* Read only header of file and          * parse first 5 fields to determine how to load the rest. */         SS1_t *ss1 = f1(input_file);              /* Read the rest of file using information set by f1()          * and determine how f3() should preprocess it. */         SS2_t *ss2 = f2(input_file, ss1);              /* Preprocess the file using information provided by f1() and f2(). */         SS3_t *ss3 = f3(ss1, ss2);              /* Compose module and          * process the file using the information provided by f2() and f3().          * Store ss1 as well for future use. */         Module_t module = f4(ss1, ss2, ss3);     }      So, should I refactor the structure into smaller substructures?


title: Where should CMS data logic go

text: We have a large web site written in `WebForms` and have begun implementing some new modules in MVC. We have a custom CMS in place. I put the data structure to hold CMS data in a `BaseModel` class. Now I`m wondering where would be the best palce to put the logic which calls the CMS data manager to get data relevant to the page. On one hand, I can create a `BaseModel`, which in its constructor receives a page Id, and calls the CMS manager. Then build all models on that model. On the other hand, I can do the same in a `BaseController`. I can't decide which is more correct, since I cannot think of any advantage one will have over the other. Most of my experience is in `WebForms`, so I am wondering what would be the more ASP.NET MVC way of placing this logic.


title: Do RESTful APIs tend to encourage anemic domain models?

text: I'm working on a project in which we are trying to apply both domain-driven design and REST to a service-oriented architecture. We aren't worrying about 100% REST compliance; it would probably be better to say we are trying to build resource-oriented HTTP APIs (~Level 2 of Richardson's REST maturity model). Nevertheless, we are trying to stay away from RPC-style use of HTTP requests, i.e. we attempt to implement our HTTP verbs according to RFC2616 rather than using `POST` to do `IsPostalAddressValid(...)`, for example. However, an emphasis on this seems to be at the expense of our attempt to apply domain-driven design. With only `GET`, `POST`, `PUT`, `DELETE` and a few other rarely used methods, we tend to build CRUDdy services, and CRUDdy services tend to have anemic domain models. `POST`: Receive the data, validate it, dump it to the data. `GET`: Retrieve the data, return it. No real business logic there. We also use messages (events) between the services, and it seems to me that most of the business logic ends up being build around that. Are REST and DDD at tension at some level? (Or am I misunderstanding something here? Are we maybe doing something else wrong?) Is it possible to build a strong domain model in a service-oriented architecture while avoiding RPC- style HTTP calls?


title: Build tools for php, html, css, js web app development

text: What are some recommendations for a build tool that would allow me to upload changes to a web server or a repository and minify the js and css automatically, and possibly even run Closure compiler on the JavaScript? I'm not worried about doing anything with the php code other than update with most recent changes although in the future would like to have phpdoc updated automatically. Just wondering if there is some way to do all this other than an amalgam of scripts that run or have to be invoked every time?


title: Low level Linux graphics

text: For educational purposes, I'd like to write an application on a Linux environment that can process keyboard events and draw graphics without huge dependencies like X or SDL. I presume that this must be possible, because X and SDL are just programs themselves, so they must rely on other methods inherent to the environment. Is this understanding correct? If so, where might I learn to write such a program? My limited experience tells me that it would involve making calls to the kernel, and/or writing to special files; however, I haven't been able to find any tutorials on the matter (I am not even sure what to Google). Also, in case it is relevant, I am running Debian Squeeze on Virtualbox. I have used a netinst cd without networking, so there isn't much installed on it currently. I will install `gcc`, but I am hoping I can get by with nothing more.


title: reloading singleton classes and dependency

text: I have a singleton object. It's a DAO that looks somewhat like this (pseudoish code):               class UsersDAO {       public usersDAO init(string sDSN){         variables.sDSN = sDSN;              return this;       }            public array getUsers(){         //do a query to get users, make into array              return aUsers;       }     }      my applications makes an instance of this and uses it throughout the codebase, but I also have another DAO that requires it:               class OrganisationsDAO {       public OrganisationsDAO init(UsersDAO oUsersDAO,string sDSN){          variables.sDSN = sDSN;          variables.oUsersDAO = oUsersDAO;               return this;       }            public array getUsersOrganisations(){         variables.aUsers = variables.oUsersDAO.getUsers();              //getOrganisations for the returned users              return aOrganisations;       }     }      so to make the OrganisationsDAO object I need to pass it the UsersDAO. At a later point in my applications life, I need to update the UsersDAO to include a `public user getUser(int userid)` function. I'm wondering, is there a way of passing through the new UsersDAO to objects that depend on it, without having to restart the application. In this instance the application is a website rather than a desktop based application.


title: What is the purpose of RESTful URIs for POST/PUT/PATCH/DELETE methods?

text: In the process of conceiving a web application framework, I spent some time pondering the notion of RESTful paths. If I wanted to create e.g. a new topic, I might send a POST request to /topics. The parameters thereof might be something like: `{ topic: { body: 'Body' } }` As such, the type of resource being created can be inferred from the parameters. Since there is the top-level item 'topic', we can logically ascertain that the request is to create a topic. For me, the strange thing is that POST create is the one action that falls outside of the notion of either a singular resource or a collection. It is arguably neither. Sure, you're adding to a collection, but in contrast to say a `GET index` you are not retrieving any part of that collection, and the state of that collection to a large extent is irrelevant. In contrast to a `GET`, `PUT/PATCH`, or a `DELETE`, you are not retrieving a singular item based on an identifier. You are creating an item where one does not exist. I conceived of a "master registrar" service that would respond to all incoming `POST`requests. Imagine every form `POST`ing to `/`, with the master registrar determining the intended resource based on the params, and deferring to services that exist for the purpose of persisting a resource based on those params. In fact, for any non-GET action, the paths become irrelevant. They don't seem to have an important semantic purpose. A user is not going to link to a form's action URL. Even in the case of `PUT`, `PATCH`, or `DELETE` The type of resource being created or the resource being modified can be inferred from the parameters. For example, if we were editing a topic versus creating one, the parameters might be `{ topic: { id: 1, body: 'New Body'} }`. The presence of an ID in the parameters indicates that the topic in question already exists and should be retrieved foremost. I don't know if this is RESTful or not. Regardless, I cannot see why this approach is invalid or inadvisable. Given my caution and naivete, however, I'd like to know why it might be.


title: How much data should be required in a request to a webservice?

text: When recieving data from clients how much data that you provided to them should you require back from them? For example when clients order a product from a webservice should they just need to provide a product code? The other alternative would be to require the product code product name and product price ect. I have alway built webservices the former way with the minimum of data returned back to me, however I have just been consuming another web service that requires the vast majority of the data returned back to them. What are the advantages of the second way?


title: Designing for an algorithm that reports progress

text: I have an iterative algorithm and I want to print the progress. However, I may also want it _not_ to print any information, or to print it in a different way, or do other logic. In an object oriented language, I would perform the following solutions: **Solution 1: virtual method** have the algorithm class MyAlgoClass which implements the algo. The class also implements a virtual reportIteration(iterInfo) method which is empty and can be reimplemented. Subclass the MyAlgoClass and override reportIteration so that it does what it needs to do. This solution allows you to carry additional information (for example, the file unit) in the reimplemented class. I don't like this method because it clumps together two functionalities that may be unrelated, but in GUI apps it may be ok. **Solution 2: observer pattern** the algorithm class has a register(Observer) method, keeps a list of the registered observers and takes care of calling notify() on each of them. Observer::notify() needs a way to get the information from the Subject, so it either has two parameters, one with the Subject and the other with the data the Subject may pass, or just the Subject and the Observer is now in charge of querying it to fetch the relevant information. **Solution 3: callbacks** I tend to see the callback method as a lightweight observer. Instead of passing an object, you pass a callback, which may be a plain function, but also an instance method in those languages that allow it (for example, in python you can because passing an instance method will remain bound to the instance). C++ however does not allow it, because if you pass a pointer to an instance method, `this` will not be defined. Please correct me on this regard, my C++ is quite old. The problem with callbacks is that generally you have to pass them together with the data you want the callback to be invoked with. Callbacks don't store state, so you have to pass both the callback and the state to the `Subject` in order to find it at callback execution, together with any additional data the `Subject` may provide about the event is reporting. **Question** My question is relative to the fact that I need to implement the opening problem in a language that is not object oriented, namely Fortran 95, and I am fighting with my usual reasoning which is based on python assumptions and style. I think that in Fortran the concept is similar to C, with the additional trouble that in C you can store a function pointer, while in Fortran 95 you can only pass it around. Do you have any comments, suggestions, tips, and quirks on this regard (in C, C++, Fortran and python, but also in any other language, so to have a comparison of language features that can be exploited on this regard) on how to design for an algorithm that must report progress to some external entity, using state from both the algorithm and the external entity ?


title: proposed algorithm and representation of an algorithm

text: What is the difference between an ambiguity in a proposed algorithm and an ambiguity in the representation of an algorithm? I have done some research and found out that ambiguity in the representation of an algorithm is when the representation can be understood by a group of people and not clear to another group e.g. a layman and a programmer.


title: Which benchmarking software would you use to evaluate the performance of your development rig?

text: I have been tasked with evaluating a new PC for our dev team that is spec'd only slightly better than our current models. Could anyone recommend appropriate benchmarking software that would be useful to emulate typical development tasks?


title: Are there architecture smells?

text: There are tons of resources on the web referring to and listing code smells. However, I've never seen information on _architectural smells_. Is this defined somewhere, and is there a list available? Has any formal research been done into architecture defects, and their impact on project speed, defects, and the like? **Edit:** I wasn't really looking for a list in the answers, but documentation (on the web or in a book) about architecture smells.


title: Which http response do you return to a hit from a blacklisted ip?

text: I have been using the http:BL to block bad IP's from accessing my site. If a malicious IP (comment spammer) trys to hit the site I just `exit` the web script which implicitly returns a `200 OK` response. Other responses I could return: 404 - Not found? If I return a 404 maybe the robots will think "this is a waste of time, lets move on to attack another site" which would reduce the load on the site (I currently get about 2 spam-hits per second). However   * I'm reluctant to return 404's on urls that, under normal circumstances, _can_ be found.    * I'm not sure if spam robots can 'waste time'. i.e Why would a bot writer be bothered to code for 404's when they just blitz the web anyway? 401 Unauthorized? Blocking a bad IP is not quite the same as "resource requires user authentication 1) which has not yet been provided or 2) which has been provided but failed authorization tests" * * * In general I feel that 'responding to the bad-bots according to proper http protocol' gives the bad guys the upper hand. In the sense that I play by the rules while they do not (a bit like Britain in the EU - ha, ha). On some days I feel like I should do something clever to divert these bot's away. On other days I just think that I should not take it personally and just ignore them. Accepting it as par for the course of running a web site. I dunno - what are your thoughts? How do you respond when you know its a bad IP?


title: Were they joking when they named PHP?

text: PHP stands for: > PHP: Hypertext Preprocessor This a recursive loop, if I'm not mistaken. Did the creator of PHP have this in mind when he named PHP? Is this the only language where the name has some sort of spurious grammar, spelling or phonetic?


title: Required skills for a senior level ActionScript/Flex developer

text: I'm looking to take my Actionscript knowledge to the next level and I've been having trouble finding what it takes to become a senior level AS developer. From my searching this has what I've come up with so far:   * Component Creation   * Memory Usage Debugging/Profiling   * AS specific usage of OOP    * Correct Use of Code-behind    * Accessing remote data   * Flex architecture frameworks   * Component lifecycle Those are just the topics I've been able to find. Resources on mastering those topics have been very hard to come by(i.e. what are common AS design patterns, etc). I may just not be searching correctly, but any help here would be greatly appreciated. My focus is on Flex specific AS development. Currently I've found here and here are the most similar SO questions I've been able to find. Any help would be appreciated, though I'm looking for specific examples. * _this question was first asked onstackoverflow and asked to be moved here_


title: What's the best way to organize our unit tests

text: We've built up a substantial number of unit tests for our main program over the years. Several thousand. The problem is that we don't have a clear idea of what tests we have because there are so many. And that's a problem because we don't know where we're weak on tests (or where we have duplicates). Our app is a reporting engine. So you can have a template that is used to test parsing (do we read all table properties), merging in data (did we keep the correct table properties in the merge), formatting the final page (is the table placed correctly on the page), and/or the output format (is the created DOCX file correct). Add to this what we need to test. Take the padding around a table cell (we use Word, Excel, & PowerPoint for the report design). We have to test the padding across page break, for a table inside a cell, vertically merged cells, horizontally merged cells, a vertically & horizontally merged cell that contains a table with a vertically & horizontally merged cells in the inner table, where that table breaks across a page. So what category does that test go in? Table padding, page breaks, nested cells, vertically merged cells, horizontall merged cells, or something else? And how do we document these categories, name the unit tests, etc.? **Update:** A number of people have suggested using coverage tools to verify that we have full coverage. Unfortunately that is of limited use in our case because the bugs tend to be due to specific combinations so it's code that has all been tested, but not in that combination. For example, we had a customer yesterday that started a Word bookmark at the end of a forEach loop in their template (a Word document) and ended it in the beginning of the next forEach loop. This all used code that has unit tests against it, but we had not thought of the combination of a template expanding a bookmark start to be started 25 times, then ended 10 times (the two forEach loops had a different number of rows).


title: Commenting strategies in C# & asp.net web api

text: I've been working on a ASP.NET Web Api 2 project as a learning exercise, and I was wondering what the norm regarding commenting is. I use the Repository / Service Pattern, and everything is very much decoupled, which results in having a large number of classes whose purpose is pretty clear. I also name my variables in a way that they explain themselves. This leaves me wondering what I should actually be commenting in this scenario.   * Should I just stick to class-summaries ( even if the class itself is self-explanatory ) ?    * What about self-explanatory methods ?   * Do data / business entity classes need a summary ?    * What about interfaces ? To give a bit more context, here is one of my repository classes which provides CRUD functionality:               public class UserRepository : RepositoryBase<User, decimal>     {         private readonly ShortStuffContext _context;              public UserRepository(ShortStuffContext context)         {             _context = context;         }              public override IEnumerable<User> GetAll()         {             return _context.Users.BuildUser();         }              public override User GetById(decimal id)         {             return _context.Users.FirstOrDefault(u => u.Id == id).BuildUser();         }              public override CreateStatus<decimal> Create(User entity)         {             if (_context.Users.Any(u => u.Id == entity.Id))             {                 return new CreateStatus<decimal> { status = CreateStatusEnum.Conflict };             }                  var user = new Data.Entities.User();             user.InjectFrom<SmartConventionInjection>(entity);             _context.Users.Add(user);             _context.SaveChanges();                  return new CreateStatus<decimal> { status = CreateStatusEnum.Created, Id = user.Id };         }              public override UpdateStatus Update(User entity)         {             var dbUser = _context.Users.FirstOrDefault(u => u.Id == entity.Id)                                  .InjectFrom<NotNullInjection>(entity);                  if (dbUser != null)             {                 var changeTrackerUser = _context.ChangeTracker.Entries<Data.Entities.User>()                                 .FirstOrDefault(u => u.Entity.Id == entity.Id);                      changeTrackerUser.CurrentValues.SetValues(dbUser);                 if (_context.SaveChanges() == 0)                 {                     return UpdateStatus.NoChange;                 }                 return UpdateStatus.Updated;             }             return UpdateStatus.NotFound;         }              public override void Delete(decimal id)         {             var user = _context.Users.FirstOrDefault(u => u.Id == id);             _context.Users.Remove(user);             _context.SaveChanges();         }     }      So in a class like that, is it worthwhile to put a summary like "Provides CRUD functionality for the User Data Entity" ( and then repeat that summary for every other repository ), or not ? What about method comments, or inline comments? Edit: My project is on Github. I know about adding comments to more complex methods, and I'm planning on adding comments to the Extensions and the ValueInjecter classes soon ( which hold by far the most complex code ). Apart from that, any advice regarding where to put comments is very much welcome.


title: Delegate pattern for retrieving data v.s. using simple setters

text: I am considering using the Delegate Pattern to get some data necessary for an operation. There are a few different pieces of data that the algorithm needs to run, but they all have default values that can be used if they aren't explicitly set. If I were to use the delegate pattern, I would define an interface that defines a function for each piece of information that the algorithm would then use to retrieve the data as it needs to. The other option I see is to have setters on the algorithm object so that those properties can be set explicitly instead of waiting for it to be requested through the delegate pattern. There are many advantages to using the delegate pattern, but I feel that many of them don't really apply to my situation. One of the biggest things is that it eliminates the need to make specialized subclasses of the object, but in my case, using setters also removes this need. Also, the delegate pattern allows reuse of delegates like "configurations." If I use setters, everything will have to be explicitly set whenever reconfiguring (instead of just changing delegates around). I would definitely lean towards using the delegate pattern, my only issue is that this is a public interface that will be used by people who aren't necessarily familiar with the pattern. I feel that using setters would be a more natural way for someone to do it without knowledge of design patterns. **A very simple example** of what I am trying to do would be the following: I have an algorithm that is going to determine if a certain range of characters exits in a string. The configurable options of the algorithm are:   * First character (e.g. "k" )   * Last Character (e.g. "p" will make it search for k,l,m,n,o and p )   * number of characters out of range that need to match So If I have the string "stack overflow" searching with a character range of "k-p" requiring that at least 4 characters match, it should return true because it contains "k","o","l", and "o". Using the delegate pattern it would look this this (not necessarily the most efficient):               char startRange = delegate.startChar();     char endRange = delegate.endChar();     int targetCount = delegate.charCount();     int currentCount = 0;     for( char c in targetString )     {        if( c >= startRange && c <= endRange )        {            currentCount++;            if( currentCount == targetCount )                 return true;        }     }     return false;      Otherwise the algorithm would require that member functions and variables are defined to set and store those values. The algorithm would look like this.               int currentCount = 0;     for( char c in targetString )     {        if( c >= mStartRange && c <= mEndRange )        {            currentCount++;            if( currentCount == mTargetCount )                 return true;        }     }     return false;      The variables may or may not be changed often, and there will definitely be reuse of those variable configurations. Are there any advantages of the delegate pattern that I am missing? Are there any disadvantages of using setters that I am missing? Any other comments or suggestions? Thanks!!


title: infrastructure software/technologies for developing web service

text: [Edit: Thanks S.Lott for the hints] I'm developing a web service from scratch. The service could have potential of 10,000 requests a day. Actually, to be honest, requirements aren't that clear at this point of the project. What the management team wants is to build something and getting it working. However, it does have the potential of getting bigger, so I need to put down the * foundation* right. I've decided to   1. Use Tomcat 6.0 as the application server   2. Use Apache Axis2 as the web service engine (Install it in Tomcat)   3. Use ??? for web service implementation   4. Use Hibernate for accessing database Point 3 is a bit fuzzy, I am not sure if I should use jax-ws or jaxb or spring or ejb or just POJO to implement the service. To people who have used these technologies, which one is easy to use, which one is easy to maintain, and which one is easy to scale? Thanks,   Sarah