How does Google store its PageRank matrix?

I'm curious to know how Google stores the matrix that's used in the PageRank algorithm; and am looking for a data-structure for storing a very-large (not fitting in memory of any one computer) sparse matrix, and efficiently (not sure what that means yet) performing operations on it. If there's a white-paper available please post a link or a title (I've done some research, and couldn't find one), and if not, it would be great if you could post links or just names of papers or books that would help get me started. In my initial research I found the sparse row-wise format [1], and I started reading Sparse Matrix Technology [2]; so please let me if I'm on the right track here.   * [1] Chang, 1969 Curtis and Reid, 1971 Gustavson, 1972   * [2] Pissanetzky, 1984


Multi-threading in C# .NET Windows Service

I am writing a Windows Service (using C# .NET 3.5 VS2008) and my requirement is:   * When the Windows Service start - it performs record check operation (in Database) @ every 30 second interval (I have used a timer for this)   * If the appropriate record was found in the database - then it starts multiple threads and performs the required operation (that may be network operation or Database operation). The number of multiple threads also depends on the amount of records found (like if 10 record found then starts 5 threads and for 20 records start 10 threads etc...) How to design/code for these multiple threads? Example: 10 records found in the database, I want to start 5 threads for first 5 records which may perform network operation... out of 5 threads whichever thread completes his job - will start processing for next the record (i.e Record number 6, 7 ... 10) Please suggest best possible solution for the above case.


Use Android NDK for portability with iOS?

I am currently planning to implement a little painting app using OpenGL ES 1.1. I believe this question applies to any OpenGL ES project. I am starting development on Android and I would like to know if you would recommend writing the drawing logic (using OpenGL) in C++ with the NDK so it will easier to port to iOS, or to use the Java API and being locked on Android. The reason I am asking that is because I have seen mixed opinions on the Web about using the NDK (some people say it is an added level of complexity). From what I have already seen, I believe that I should go with the Java API since I am starting on Android and then, if I decide to go on iOS, to rewrite the OpenGL logic in Objective-C or C++. This should be pretty straightforward since the calls appear to be the same in both languages. What do you think? Am I right?


CSS and HTML inconsistent when declaring multiple classes

I'm learning CSS "seriously" for the first time, but I've found that the way you deal with multiple CSS classes in CSS and HTML quite inconsistent. For example, I learned that if I want to declare multiple CSS classes with a common style applied to them, I write:               .style1, .style2, .style3 {        color: red;     }      Then, if I want to declare an HTML tag that has multiple classes applied to it, I write:

      And I'm asking why? From my personal point of view it would be more consistent if both could be declared by using a comma to separate each class, or if both could be declared using a space; after all IMHO we're still talking about multiple classes, in both CSS and HTML. I think that it would make more sense if I could write this to declare a `div` with multiple classes applied:

      Am I'm missing something important? Could you explain me if there's a valid reason behind these two different syntaxes?


Please explain object versioning in the nodejs module system

This question is about the persistance of variables across different modules in nodejs when they don't directly "require" each other, but do "require" a common ancestor. It is also the generalised version of this stackoverflow question. Whilst I received an answer there that helped me solve my specific case, I'm still unclear as to the answer to the architectural problem I posed. I hoped that the general problem was a good fit for a programmers.stackexchange question. Assume we have a nodejs program structured like so:   * Module Alpha - exports variable a.   * Module Beta - requires module Alpha, reads variable a -> prints it to console periodically   * Module Gamma - requires module Alpha, periodically writes to variable a Is the instance of module Alpha, and thus variable a, common across all three modules. e.g. can module Gamma make changes to variable a that are successfully printed to the console by module Beta. If this is true, why is this true **even though there is no direct "requires" relationship between modules Gamma and Beta?** If this is not true, **can you explain the best way to share a variable than needs to be modified at runtime between multiple node modules?** Can you explain the underlaying data model which is causing this behaviour in nodejs modules?


How to handle egocentric programmers?

Let me explain this a little. In a previous job, I had a coworker that has a good reputation with the management. He always finished on time. And the bosses were happy with his progress so het got certain privileges. The problem was that the other programmers knew his secret. He has optimized the 80/20 rule, so he worked his 20 percent time to finish 80 percent of the code. The other (hard) 20% was left to the maintenance programmers. Who (not surprisingly) got penalized because of their lack of progress. But because this programmer had a good reputation with the management, it was almost imposible to shift the blame to him. (Fortunately he left the company). My question is, what to do as programming team if you have such a programmer within your team. Do you try to warn management with risk of ruining your own chances? Do you accept the fact? Or are there other options.


Is a simple iPhone app more appealing to users than a mobile website?

My client wants to do an iPhone app because she's found that people are significantly more likely to use the iPhone app over a mobile optimized site. The iPhone app is very simple - it just displays a couple images and some text. As a programmer I'd much rather do a mobile site given the simple nature of the content. From a technical perspective I feel that it's overkill to use an iPhone app in this situation. Does it make sense to build an iPhone app when a mobile site would suffice, simply because your users would much rather it be an iPhone app? Is there anyway to easily convince users that a mobile site is just as easy to use?


Writing code based on code snippet from the internet without license

I'm working on an assembly project and I need to write code to switch from text to VGA mode. This is fairly complex and requires setting up a lot of data, so I'd rather not write it myself. Fortunately I found a snippet of code on the internet that does exactly what I want. Unfortunately it does have a copyright notice, but no license is anywhere to be found. I've currently written my own code with the snippet as a reference, but in the end it's basically the same code with different variable names and comments. Then again, with assembly there's only so many ways you can introduce variation in your code. Is it okay if I publish my code with for example a notice that it was inspired by that snippet? Or am I not allowed to do this at all?


Does one really need multiple instances of a class?

Generally I'm extremely skeptical of anyone who criticizes the singleton design pattern in software. In the MVC (model-view-controller) design pattern, views and controllers are usually singletons and the only cases of multiples instances of a class are the model classes (usually modeling a database table). In my experience, the only type of software that consistently utilizes Object Oriented programming to the fullest (multiple instances of multiple types of classes) is simulation software, which is no surprise considering Object Oriented software was invented for that purpose. So my question is, besides simulation:   * what other types of software need having multiple instances of a class?


Better performance on web with big PNGs

I'm currently developing a web that is all made from images (an HTML version of a Flash web). The client provided me with a big PSD which I had to export each layer as a PNG to keep transparencies. There are some layers that are heavy in detail, and of course, in size, like 5MB each (mainly the background, it's like 6 PNG, 4-6Mb each). Loading them with CSS3 renders them great, but I'm having performance problems in the browsers (Chrome lags, Opera reloads images each time I scroll down/up, Firefox lags, IE obviously lags, etc) and in a future when I upload the finished page to a server, it will suffer from heavy image load, a lot to download from the client. My client knows this and I'm waiting for them for a possible solution (lower the PSD resolution for example), but meanwhile I'd like the go ahead on this problem and try something else, do you have any tips for this situation? I tought in the basic solutions for this, like compression and other things, but if you have any other tips it will be great. Oh, and another "detail", this HTML version is primarly focused at iPad/iPhone devices.


On-the-fly graphical representation of code

I know about Omondo's plugin for live code-UML synchronization in Eclipse, but I was wondering if there was any other tool/IDE/IDE-extension that has some form of live graphical code representaiton (structural, flow, call-stacks, dependencies, etc.). I'm essentially looking for richer visual feedback on code while programming, not really looking for purely graphical code editors, though round-trips would be nice (edit graphically, code gets modified; edit code, representation gets modified). If you don't know about any graphical live documentation tool for code, maybe someone that can coexist with code, such as MySQL Workbench or Enterprise Architect. **EDIT** : Please, original answers, meaning other tools different than what I quoted (even if they are similar to Omondo, MySQL Workbench and Enterprise Architect). **EDIT 2** : I found Netbeans' C/C++ call graph: ![enter image description here](http://i.stack.imgur.com/SNk6c.png)


How to use my proprietary framework on a new job without making it open-source?

I have been working on a framework for years. It is solid, extensive and tested. It is exactly what the employer needs for the foundation of its new project. There is no point in rewriting the whole thing from scratch or using a competing open-source alternative. My desire is to give a free, non-exclusive, non-redistributable license to the employer for access to the binaries and sources, so the employer can change the code. I understand that the employer cannot depend on closed-source code so I am willing to give my sources to the employer for free (the equivalent to two years of my work for free). I just want to protect my copyright and prevent the employer from giving the code to someone else. I believe many programmers will find themselves in this situation when starting a new job. However, making it open-source is out of question for a variety of reasons that do not matter for the purpose of this question. I want to keep the source closed, but provide a free copy under a non-exclusive, non-redistritubable license. So my questions are:   * When do I bring it up that I have a framework that I would like to use? Probably before I take the job because if they don't want to use it OR don't accept my license I am not taking the job.   * What kind of license should I use to make this deal with my employer?   * Any other considerations or comments? **UPDATES:**   1. One thing I can say is that there are other companies using the software (with licenses) so I cannot make it open-source or simply transfer the copyright to my new employer, which is what actually happens if you use it in your job without having this discussion.


Coding and testing in the same sprint

How is testing handled within the same sprint as coding, if all or most of the coding is not done until the end of the sprint? (I'm referring to the "soup- to-nuts" development and testing of a single PBI within a sprint.) Most of the answers I've seen online involve QA automation, but even that isn't really possible since you generally need a functional UI to record or create automated tests from. I only have storyboards that continue to evolve as I develop features and discover new requirements. In my case, I am developing a new desktop application. Desktop apps don't generally lend themselves to automated testing very well. I have some automated unit tests, but they are not the manual functional/integration tests that a QA professional would perform. So, where I'm at now is that my sprint ends tomorrow, I still have coding to finish, and my QA folks have nothing to test yet, and no idea how to test whatever I'd give them without me holding their hands. I'm sure I'm not the first person to have this dilemma. In the past, I've done a pipeline: in the current sprint the test team tests the features that have been implemented during the previous sprint. At my current job, the PM refers to this approach as "waterfall", and as such, unacceptable.


Zend Framework 2 - Keeping all the models and mappers in Application module?

I am in process of planning web application by following the best practices and approaches of software development. I am building this application using zend framework 2 and going through its documentation and best practices of building applications through zend framework 2 and MVC patterns. Right now I am confused about where to keep my model layers. So far all the applications I have developed using Zend I used to keep my model layers in application module because I think models are not related to single module and a single module may communicate with multiple models. Also in Zf2 modules gets loaded only when it is requested except the Application module which loads with every request despite which module is requested. If I place my models in the specific modules and load them in the service config of there relative modules. I will not be able to use them in other modules. So what should I do?


Should the check correctness of a time constrained puzzle game application be done on the server side?

I am working on an application where a user has to complete a puzzle and check within a given time limit. This is an HTML5 based game, I can't keep the solution on the client side. but I also want to avoid the latency that will be caused when we check for the correctness of the player's attempt. Is there a way I can check the correctness of the solution on the client side safely ? One implementation I was considering was to take the hash of the solution and compare it with hash of user's solution at the client side and once he finally submits it, recheck it on the server side. Any potential flaws here or are their cleaner ways to accomplish the same ?


Implementing a Username Class

I am attempting to encapsulate several features about a user in a single class. Although the main use for this class would be to initialize it once and never have to call set any variables again, I would like this class to be scalable to be called many times. Although by putting this into a class I feel like I am either over-complicating it or breaking OOP standards. At the moment I am currently using these current sorts of calls throughout VBA code:               username = GetUsername()      OR               IF userHasSecurity(GetUsername(), "WhatUserHasAccessTo") = true THEN      What I am hoping to do it replace it (respectively) with:                 Set UserID = New Username       UserID.GetUserName      OR               IF UserID.HasModuleAccess("WhatUserHasAccessTo") = true THEN      In addition to this change, I have a function that returns `Active Directory` information and also verify if usernames input exist in `Active Directory` The Class Diagram is as such               Private UserName As String     Private FirstName As String     Private MiddleInitial As String     Private LastName As String          Private Sub class_Initialize()     Private Function findCurrentUsername() As String     Private Function doesUsernameExist(usernameToCheck As String) As Boolean       Public Property Get GetUserName() As String     Public Property Let setUsername(newUsername As String)     Public Property Get getFirstName() As String     Private Property Let setFirstName(newFirstName As String)     Public Property Get getLastName() As String     Private Property Let setLastName(newLastName As String)     Public Property Get getMiddleInitial() As String     Private Property Let setMiddleInitial(newMiddleInitial As String)     Private Function findNameDetails()     Public Property Get getFullName() As String     Public Function HasModuleAccess(moduleName As String, Optional appName As String) As Boolean     Public Function getUserActiveDirectoryGroups() As DAO.Recordset      Is this more an opinion based execution(standalone functions vs. class) thing or is there something to gain? Does this break OOP standards and am I using classes incorrectly?


how to license my application

I want to release a software application developed by me as freeware and after I make considerable profits(from its commercial version), I'll release it as an open source. So, could someone please suggest me how I can release my app under freeware license, from where I can get that license, suggest me the best way. (I don't know much about these governing laws). I hope freeware license we can make it at free of cost. Please don't leave me by giving a set of vendors list, suggest me which one fits to my release. I don't have any specific terms or conditions that user has to obey while using that application. Note: Till now I've not released it or discussed it any where else.


What is the single most effective thing you did to improve your programming skills?

Looking back at my career and life as a programmer, there were plenty of different ways I improved my programming skills - reading code, writing code, reading books, listening to podcasts, watching screencasts and more. My question is: What is the most effective thing you have done that improved your programming skills? What would you recommend to others that want to improve? I do expect varied answers here and no single "one size fits all" answer - I would like to know what worked for different people.


Should programmers have access to PHI for development and testing?

My responsibilities at a small company are mostly programming-related, but I also perform a number of other roles that definitely require access to PHI1. In larger organizations with clearer delineation of responsibilities, is it prudent to provide programmers with only dummy data and never actual PHI? 1 Protected Health Information, as outlined by the US legislation that governs patient privacy, HIPAA.


How to develop my own phone OS

I know it's a very big question to ask :), I'm just asking out of curiosity. Is it possible for someone to build a phone OS? Can someone guide me through this please. For example, how to choose a H/W and how should you test your code, is it possible buy some device (eg HTC) and just try the code with it? The good thing here is Linux Kernel is there so one won't start from scratch.


Condition to use polymorphism

is polymorphism only possible when there is a scenario of inheritance or is the implementation of polymorphism not dependent on inheritance. Or is polymorphism mainly usefull when there is inheritance ?


Does ASCII have a header or footer or anything similar?

I'm working through a problem in Programming Pearls -- specifically, the implementation of a program which sorts a file containing, at most, 10,000,000 integers, each of which is 7 digits long (Column 1, Problem 3). The problem has some very strict constraints when it comes to memory, so I'm considering reading and writing the integers in ASCII -- 7 bytes at a time. I need to know if ASCII has any headers or footers or anything similar that I should be considering (I'm putting everything on 1 line without any separators, so new lines aren't an issue).


How to model users accounts in ASP MVC Framework with Entity Framework using code-first approach?

How do you design your code-first approach in entity framework when your code should include user data (name, password...) without repeating/overwriting what the MVC framework will generate in terms of user tables, classes, authorization and authentication As simple example, if i have an application that will manage user projects, my models will contain the following classes, and have the following relationship:               - One user may be assigned one or MANY projects     - One project may be assigned to one or MANY users      ( just to show the many to many ERD relationship nature)               class User{         //implementation of the class members and          // navigation properties to alow Entity Framework to create the DB tables     }          class Project{         //implementation of the class members and          // navigation properties to alow Entity Framework to create the DB tables     }      Now the problem i am facing is that EF and ASP .net MVC framework takes care of creating user tables, profiles and roles entities... I am not sure whether it is possible to design my classes in a way to show an automatic (conventional) relationship with the rest of the tables created by MVC. In the case this needs to be done by writting custom Authentication classes, can you please explain how? because i have found many articles that discuss the same issue but without pointing out the relationship between the project classes and the MVC created classes / tables, plus if the developer choses to use the MVC way he will end up with two data contexts, even after merging both tables in one sql server catalog.


Example of persisting an inheritance relationship using ORM

I have some experience with OOP and RDBs, but very little exposure to web programming. I am trying to understand what **non-trivial** types of problems are solved by ORM. Of course, I am familiar with the need for **data** persistence, but I have never encountered a need for persisting **relationships between objects** , a situation which is indicated in many online articles about ORM. I am not asking about the **process** of persisting a POJO to a database and restoring it later. Nor am I asking about why ORM **frameworks** are useful -- or a pain in the butt -- for doing so. I am particularly interested in how the need arises to persist and restore **relationships between objects**. In various documentation, I have seen many examples of persisting POJOs to a database, but the examples have all been for only very simple objects that are essentially nothing more than records anyway: a constructor, some private fields, and getter/setter methods. The motivation for persisting such an "object-record" seems obvious and trivial. This example: Hibernate ORM Tutorial offers such an example, but goes on to discuss mismatch issues of granularity, inheritance, identity, associations, and navigation that are not motivated by the example. If someone could offer a toy example of an instance where, say, the need arises to persist an inheritance relationship, I would be grateful. This might be blindingly obvious for anyone who has already encountered this situation but I have not and a great deal of searching and reading have not turned up any examples.


Does my use of the strategy pattern violate the fundamental MVC pattern in iOS?

I'm about to use the 'strategy' pattern in my iOS app, but feel like my approach violates the somehow fundamental MVC pattern. My app is displaying visual "stories", and a `Story` consists (i.e. has `@properties`) of one `Photo` and one or more `VisualEvent` objects to represent e.g. animated circles or moving arrows on the photo. Each `VisualEvent` object therefore has a `eventType` `@property`, that might be e.g. `kEventTypeCircle` or `kEventTypeArrow`. All events have things in common, like a `startTime` `@property`, but differ in the way they are being drawn on the `StoryPlayerView`. Currently I'm trying to follow the MVC pattern and have a `StoryPlayer` object (my controller) that knows about both the model objects (like `Story` and all kinds of visual events) and the view object `StoryPlayerView`. To chose the right drawing code for each of the different visual event types, my `StoryPlayer` is using a `switch` statement.               @implementation StoryPlayer          // (...)          - (void)showVisualEvent:(VisualEvent *)event onStoryPlayerView:storyPlayerView     {         switch (event.eventType) {             case kEventTypeCircle:                 [self showCircleEvent:event onStoryPlayerView:storyPlayerView];                 break;         case kEventTypeArrow:                 [self showArrowDrawingEvent:event onStoryPlayerView:storyPlayerView];                 break;         // (...)     }      But switch statements for type checking are bad design, aren't they? According to Uncle Bob they lead to tight coupling and can and should almost always be replaced by polymorphism. Having read about the "Strategy"-Pattern in Head First Design Patterns, I felt this was a great way to get rid of my switch statement. So I changed the design like this: All specialized visual event types are now subclasses of an abstract `VisualEvent` class that has a `showOnStoryPlayerView:` method.               @interface VisualEvent : NSObject          - (void)showOnStoryPlayerView:(StoryPlayerView *)storyPlayerView; // abstract      Each and every concrete subclass implements a concrete specialized version of this drawing behavior method.               @implementation CircleVisualEvent          - (void)showOnStoryPlayerView:(StoryPlayerView *)storyPlayerView     {         [storyPlayerView drawCircleAtPoint:self.position                      color:self.color                      lineWidth:self.lineWidth                     radius:self.radius];     }      The `StoryPlayer` now simply calls the same method on all types of events.               @implementation StoryPlayer          - (void)showVisualEvent:(VisualEvent *)event onStoryPlayerView:storyPlayerView     {         [event showOnStoryPlayerView:storyPlayerView];     }      The result seems to be great: I got rid of the switch statement, and if I ever have to add new types of VisualEvents in the future, I simply create new subclasses of `VisualEvent`. And I won't have to change anything in `StoryPlayer`. But of cause this approach violates the MVC pattern since now my model has to know about and depend on my view! Now my controller talks to my model and my model talks to the view calling methods on `StoryPlayerView` like `drawCircleAtPoint:color:lineWidth:radius:`. But this kind of calls should be controller code not model code, right?? Seems to me like I made things worse. I'm confused! Am I completely missing the point of the strategy pattern? Is there a better way to get rid of the switch statement without breaking model- view separation?


Do I need to paste open source license information at the top of my webpage?

I'm developing a JavaScript application that uses several open source JavaScript projects. All their licenses have a phrase like "You must give any other recipients of the Work or Derivative Works a copy of this License". Does this mean I need to make a massive HTML comment at the top of my webpage with all the licences of the software that I use? I ask this question because I've never seen the source code of a webpage that does this.


What is the current "standard" for setting up a development environment that supports remote collaboration as well as secure version control? Considering a virtual dedicated solution with vm for a web layer and a data layer, using VPN for each programmer. We're a small start-up that do both Microsoft and open-source development. Is there a set software tools or packages that are appropriate for a small shop and yet scalable?


What would be the best way to spend a day learning Guice?

I have just joined a company where the major projects, including the one i have landed on, use Guice. I have never used Guice. I am familiar with dependency injection, in the shape of CDI (a bit) and the obscure but decent Nucleus (part of ATG). We just completed a successful iteration, so tomorrow (friday the 13th!) is a day that developers have to spend on things they think are valuable. I have some meetings during the day, but i will have about four or five hours to do this. I have a machine to myself, with Eclipse installed and configured to my liking. I would like to spend my day learning about Guice. How should i spend my time? (I'm not entirely sure this is an appropriate question for Programmers, but there's only one way to find out)


pattern to share objects between API and application

I'm having serious doubts about the design for my Web application. I wanted to separate the business logic from the interface so I made a Web API that handles all the requests to the database. It's an ASP.NET Web API with Entity framework and a unit of work and generic repository pattern. So far, everything is good. **PROBLEM** Where I need help is I can't figure out an efficient way of sharing objects between the API and the application. I don't want to serialize directly the entity object, I thought it would be a bad practice because if the entity model changes, I could end up with serializing large objects for no reason. **How it's implemented now** Because my interface is ASP.NET Web application in C# and my API is in C#, I made a common library with the definition of all my classes I want to share between them. I know that solution won't work when I will develop an android app, I will have to create my classes again in Java but that's not my biggest problem. The problem is I feel like I'm always converting my objects. **EXAMPLE** Here's an example of my work flow : I start with a model with all the objects and the data annotations for my form then user would POST that model to a controller. In the controller I have to convert this model to a class in my common library then send that object to my API. Then a controller in my API catch the call and convert that object to an entity object to update the database. So I have 3 classes   1. The model for the view with all the data annotation for the validation (Client)   2. The common library classes to share the objects (DLL)   3. The Entity classes (API) I have a feeling that I do something really wrong. Is there something more elegant? I would like to make sure that I have a good solution for this problem before the project gets too big.


How is Pash licensed?

Pash is an open source reimplementation of Windows PowerShell. It was released in 2008, and has been idle since then. I would like to take up the mantle. It's not clear what the license is. There is no LICENSE file or license details in the code. The only reference to a license I can find is on this page: http://sourceforge.net/projects/pash/ where it says: > "License: BSD License, GNU General Public License (GPL)" But I'm not sure if I can take that as authoritative. I have tried to contact the author but he has not responded. I would hate to proceed with this project and later discover that I am violating a license, and have the project crippled as a result.


Does a patch for an opensource project inherit the same license?

I have submitted a patch for a GPL'd project and now a third-party wants to include this patch in a product. They have asked me what license my patch uses. Does my patch have to adopt the GPL license? Or I can choose an alternative one?


job prospects for a 45 year old beginner in programming

I am about to finish my associates degree in programming and want to know if it its a good idea to go for bachelors program for someone of my age (45)? If your answer is yes which language or skills do you think I should acquire to get a job after I am out of college?


Is it possible to release Code using the MS Solver Foundation under GPLv3?

I have written a piece of software using the Microsoft Solver Foundation. Now the work is done I want to release the code under the Terms of the GPLv3, if that is possible. The problem is, the GPLv3 states in section 1: > The "System Libraries" of an executable work include anything, other than > the work as a whole, that (a) is included in the normal form of packaging a > Major Component, but which is not part of that Major Component, and (b) > serves only to enable use of the work with that Major Component, or to > implement a Standard Interface for which an implementation is available to > the public in source code form. A "Major Component", in this context, means > a major essential component (kernel, window system, and so on) of the > specific operating system (if any) on which the executable work runs, or a > compiler used to produce the work, or an object code interpreter used to run > it. The way I see it, the Solver Foundation does not fall into this definition, making it incompatible with the GPL (which is not a surprise by itself). Now, I do not want to distribute any form of the MSF (or the included Gurobi license for that part) and I will not provide any binaries for the software, so I am unsure whether thew MSF not being a system library does affect my licensing options at all (first time I have to choose a license myself for anything). The rest of the libraries I used use Apache2 and (L)GPLv3 licenses plus the zlib license for NUnit (which allows everything for binary distribution), so those should not be a problem (please correct me if I'm wrong). But the MSF and Gurobi part bothers me a bit. What I had in mind was to provide the Visual Studio solution (which lists the MSF as a dependency) and instead of including the gurobi plugin dlls, there would be a readme on how to include them after acquiring the gurobi solver along with the MSF. So, is this possible? If it isn't, maybe a different FOSS license could be found?


How can I move a team from C# ASP.NET development to PHP development using Drupal?

I have a team of skilled C# developers with vast experience in creating ASP.NET MVC applications. We will soon be starting a new big web site project based on the Drupal platform. My developers do not have any experience in Drupal or PHP and I want to make the transition as quickly and effective as possible. We decided to make this decision based on two factors:   1. In my organization there are a couple of teams competing on doing this project. None of the other teams has experience in PHP or Drupal, and I truly believe that my team would do it the best, whether it's ASP.NET or Drupal.    2. One of the requirements from higher management was that we won't build something from scratch, but use an existing foundation. Many of the requirements are available in plugins/modules for the various CMS.  I know this is not an ideal environment, but it's a given state and I have to make the best out of it. None of the .NET Framework based CMS supported all of our requirements. Since my team is dynamic in nature, I believe it can adapt to working with Drupal. Hiring other people is not an option, and sending them to a course will take too much time. I thought about dedicating a week in which each developer will study a specific subject and then will pass it on to the team. Any suggestions on how you would do it?


Are certain problems solved more elegantly with AOP?

I've come across the idea of Aspect Oriented Programming, and I have some concerns with it. The basic idea seems to be that we want to take cross-cutting concerns which aren't well modularized using object and modularize them. That is all very fine and well. But the implementation of AOP seems to be that of modifying code from outside of the module. So, for example, an aspect could be written that changes what happens when a particular object is passed as a parameter in a function. This seems to go directly against the idea of modules. I should not be able to modify a module's behavior from outside of that module, otherwise the whole point of modules are overturned. But aspects seem to be doing exactly that! Basically, aspects seems to be a form of code patching. It may useful for some quick hacks; but, as a general principle perhaps its not something you want to do. Aspect Oriented Programming seems to me taking a bad practice and raising to a general design principle. Is AOP a good practice? Are certain programming problems solved more elegantly with AOP?


Advice on caching/updating data in memory for silverlight client

Currently in my Silverlight app I'm polling the database for changes to cached objects and am looking for advice on how to update the views that are displaying these lists. Example: I have a static class that has lists of objects (Areas, vehicles drivers etc.) that I will be using throughout the application. I have a timer in my shell that will poll the database passing a timestamp of the last update. So if the timestamp has changed the updates will be passed back and the lists will be updated. How do I update the views that will be displaying these lists. If the user is editing a record that displays a combobox bound to this list how will this data be updated and if the user has made a selection from the list will this affect the selection? Bear in mind that some users will be adding to these lists that I will be inserting to the database. Am I going about this in the right way?, or has anybody implemented this with success in their application?


How to approach functional tests in segregated systems

I'm implementing some automatic functional tests in an environenment that has about 20 applications talking to eachother using queues and/or restful interfaces. The problem I'm facing is that I added some test to one of the application, lets call it Payments, and they all looked very nice and green. One of the changes on the Payments application added an extra field in a messages that is send to another application, lets call it CRM, and the CRM discarded the message, which meant that the applications started to become out of sync. The Payments application (as most other applications) send messages in a fire-and- forget way, which means that the producer never knows if a message is processed or discarded. I'm wondering is how to test these dependencies between systems. One option (that I dislike from my gut, but no idea why) is to connect to the other system and verify that the record was updated. Most applications have a restful interface and also provide clients, so is not a lot of work. But I have the strong feeling that doing this will make the test more brittle. One of the reasons why I don't like this, is that most of the applications talk to another 4-10 other applications, so it's not just checking another app... and since lots of things are asyncronous, it adds even more uncertainity to the test. So, how do you create functional tests for this type of environment?


Making sure database connection information is secured

This is the first time that I am working on a web application. I was going through the question What should every programmer know about web development? and noticed one thing that I knew nothing of: > Make sure your database connection information is secured. I am confused about it because as per my knowledge the database info, password, etc will be on my server used in my coding to connect to the db. Then what does this line specifically mean?


Requirement gathering in an agile methodology

In the great book User Stories Applied the author specified the following process for trawling requirements in the form of user stories: Create user roles (personas) **\-->** brainstorm user goals for each role **\-->** Write user stories **\-->**   estimate all user stories **\-->** prioritizes stories **\-->** select some user stories for the first release **\-->**   write acceptance criteria for each story **\-->** divide each story into tasks **\-->** estimate tasks However, I don't get why **ALL** stories should be estimated first and if they need to be estimated why leave the acceptance criteria out of the story till it's time to work on it? Next thing is about the acceptance criteria itself, in the book acceptance criteria where simple statements as:   * test with Master Card for payment.   * test with Visa for payment. Isn't the **Given... When... Then...** format better for writing acceptance tests? Last thing is about breaking user stories to tasks, why bother re-estimating the tasks when the task itself was estimated in story point?


Do we need to use JCA while connecting to db from inside EJB

While writing an EJB (deployed on WAS) that connects to a db, i have never needed to use JCA. But apparently JCA is the standard for connection to thrid party EIS (which includes database). So does the WAS implement JCA internally? Under what situation would the app develoepr need to use JCA related classes?


Visualization of N>2-D array?

I have an array of dimension 5. But, I can't figure out how to visualize that array?               int[][][][][] array = new int[4][4][4][6][2].      Is there a good way to visualize arrays with dimension counts of 3 or more?


What will be the best practice for having 'reviewed' source code in a source control repository?

What will be the best way to manage reviewed source code in a source control repository? Should the source code go through a review process before getting checked in, or should the code review happen after the code is committed? If the review happens after the code is checked in to the repository, then how should that be tracked?


Publish/subscribe, observer pattern implementation question

I'm developing desktop application in java/swing. I have a component that is registered as a subscriber to many panels and gets messages (my custom event) from them. That component is something like message tray. When there is a validation error or some kind of info message it's delivered from panel to that tray by my "publish" method. But now I'm facing a problem. I have window that consist my message tray and internal panel. in this internal panel there are some components and other Panel. And in this Panel there are panels that implements Publisher interface but they are being created on the fly from metadata and I don't have access to them to register subscriber. So I cannot directly register my message tray as subscriber to panels because:   1. I don't have access to them   2. they are created dynamically from metadata and can change. Is it ok to set my subscriber object reference in the middle (between) panels, and when creating dynamically my publisher panels register that reference to them? Is it ok with the observer pattern because now other classes have reference to the object that they don't strictly need. Maybe this object should be injected in other way? or maybe it is all OK and I just messed my mind today ;) ![Picture to make it clearer](http://i.stack.imgur.com/iiHxN.png)


Do I need to understand the Internals of a programming language?

I am beginner to Python and I really like it so far. One question that comes to my mind very often is if I need to understand and therefore learn the Internals of a programming language (as in my case Python). As you might know, Python itself is written in C. So my question is: How deep do have to dive into a programming language to be proficient or fluent in this language. I compare this question to "natural" languages. I don't know every detail in grammar in my mother language but I am able to express myself with no problems in that language. This is when I say I am fluent in a language. Does that apply to programming languages too?


What is JavaScript, really?

All this started when I was looking for a way to test my webpage for JavaScript conformance like the W3C HTML Validator. I have not found one yet. So let me know if you know of any...   1. I looked for the official JavaScript page and find ECMA Script. These people have standardized a scripting language (I do not feel like calling it JavaScript anymore!) and called it ECMA-262 (Wikipedia). Their latest work is Edition 5.1   2. JavaScript was developed my Mozilla Corporation and their last stable version is 1.8.5 (see this) which is based on the ECMA's edition 5.1   3. The Wikipedia page linked mentions dialects. Mozilla's JavaScript 1.8.5 is listed as a dialect along with JScript 9 (IE) and JavaScript (Chrome's V8[Wiki]) and a lot others. Am I to understand that JavaScript 1.8.5 is a derivative of the ECMA-262 and SpiderMonkey[Wiki] is an engine that runs it? And Chrome has its own dialect and V8 engine is the program that runs it? With all these dialects based off ECMA-262, what I can no longer understand is "What is _JavaScript_ "? Are there any truly cross browser scripting languages? Do the various implementers come together to agree on the dialect cross compatibility? Is this effort ECMA?


Representing business rules with exceptions

I know it is expensive but (IMO) I believe it is a very good practice. I'm talking about rules like say, you can't save an Invoice if you are not a sales person... so in that case throwing an exception saying 'your are not authorized' or such... Another approach it would be having objects with a status or something like that Is there any other approach? how do you feel about it?


Are there any reliable solutions for annotations/reflection/code-metadata in C?

Not all languages support java-like annotations or C#-like attributes or code metadata in general, however that doesn't mean it is not possible to have in languages that don't have this. An example is PHP with Stubbles and the Doctrine annotation library. My question is, is there anything like this for C?, or are there any reliable ways of doing reflection with extended code metadata in C? Ideally, I'm looking for something that reads javadoc-like comments. Edit: The reason for me ***needing*** as opposed to just wanting, is that I need to generate C code and code-metadata from a database, as well as being able to edit that metadada and update the database. The volume of the work (~15,000 variables/structures/functions to generate from this database) justifies the solution.


How to keep a generic process unique?

I'm currently working on a project that makes connection between different banks which send us information on which that project replies. A part of that project configures the different protocols that are used (not every bank uses the same protocol), this runs on a separate server. These processes all have unique id's which are stored in a database. But to save time and money on configurations and new processes, we want to make a generic protocol that banks can use. Because of PCI requirements we have to make a separate process for every bank we connect to. But the generic processes have only 1 unique identifier and therefor we cannot keep them apart. Giving every copy of that process a different identifier is as I see it impossible because they run entirely separate. So how do I keep my generic process unique?


In MVC , DAO should be called from Controller or Model

I have seen various arguments against the DAO being called from the Controller class directly and also the DAO from the Model class.Infact I personally feel that if we are following the MVC pattern , the controller should not coupled with the DAO , but the Model class should invoke the DAO from within and controller should invoke the model class.Why because , we can decouple the model class apart from a webapplication and expose the functionalities for various ways like for a REST service to use our model class. If we write the DAO invocation in the controller , it would not be possible for a REST service to reuse the functionality right ? I have summarized both the approaches below. **Approach #1**                 public class CustomerController extends HttpServlet {              proctected void doPost(....)  {                      Customer customer = new Customer("xxxxx","23",1);                 new CustomerDAO().save(customer);              }                }      **Approach #2**                 public class CustomerController extends HttpServlet {              proctected void doPost(....)  {                      Customer customer = new Customer("xxxxx","23",1);                 customer.save(customer);              }                }           public class Customer {             ...........             private void save(Customer customer){                  new CustomerDAO().save(customer);             }          }      **Note** \- Here is what a definition of Model is : Model: The model manages the behavior and data of the application domain, responds to requests for information about its state (usually from the view), and responds to instructions to change state (usually from the controller). In event-driven systems, the model notifies observers (usually views) when the information changes so that they can react. I would need an expert opinion on this because I find many using #1 or #2 , So which one is it ?


When is the register keyword actually useful in C?

I am confused about the use of `register` keyword in C. It is generally told that its use isn't needed like in this question on stackoverflow. Is this keyword totally redundant in C due to modern compilers or are there situations in which it can still be useful? If yes, what are some situations in which use of `register` keyword is actually helpful?


Using bug-tracking / issue-tracking software to discuss design questions, new tools etc

Does anybody have experience with using a bug-tracking / issue-tracking software like bugzilla, mantis or JIRA not only for bugs or tasks, but to initiate and maintain discussions that in the end lead to a decision? For example, a developer thinks that all protected fields should be abolished and changed to private fields with protected methods that access them. It is not his call, and he would like to discuss it. Normally he brings up the point in the next developer meeting at the end of which a decision is made. Instead, my idea was for him to open an issue of a certain type "decision" and describe his intent like normally one would describe a bug or task. Other developers can make their comments if they feel like it, and in the end, the issue is closed as "accepted" or "denied". The advantages I see in this:   * Asynchronous communication: no one is forced to voice his opinion in a meeting when they didn't have time yet to oversee all ramifications of said decision.   * Written log of considerations that lead to a decision. If one later raises that question again he can be referred to it.   * Relations to other issues can be made, e.g. a task can be followed back to a decision.   * Integration with version control software, e.g. a commit can be traced back to a decision. Disadvantages:   * Heavy smell of a golden hammer: issue tracking software normally is used to track actionable items   * Organizational overhead may be disproportionate: instead of a small informal talk one has to communicate his ideas in written form


Does modular programming affect computation time?

Everyone says that I should make my code modular, but isn't it less efficient if I use more method calls rather than fewer, but larger, methods? What is the difference in Java, C, or C++ for that matter? I get that it is easier to edit, read and understand, especially in a group. So is the computation time loss insignificant compared to the code tidiness benefits?


Isolating unit tests in python

As a 30-year software developer, mostly in OO languages, but a newbie at python, I'm looking to find what is best practise for isolating unit tests in python. Let's say I have the following, semi-pseudo-code. I know some_database_client isn't a real database client:               from some_database_client import connection          connection.connect('server_id', 'username', 'password')          def function_under_test():         return connection.get_value('some_value_reference') + 10      If I write a test for `function_under_test()`, then I'm effectively testing the potentially enormous amount of logic in connecting and retrieving the data from `connection`. Instead, I really want to test that `function_under_test()` adds ten to the value retrieved. This relates to a practical real-world example where the module-level variable `connection` (or it's real-world equivalent) is referenced heavily all over the code. Therefore, it would involve a large and therefore very risky change to pass `connection` as an argument to all the functions that use it. Without doing this though, I can't easily separate the variable `connection` when I'm trying to unit-test the functions that use it. `connection` is instantiated before I even get to run the unit-test. Is there a recommended way to isolate functions like this for testing? I can certainly think of many, many ways, but I suspect that some have more of the "Zen of Python" about them than others. e.g. Wrapping everything in classes is a possibility, but that is perhaps moving too far away from keeping stuff simple, which is a goal of python.


Is it required to start a business to sell Android Apps (US)?

I know you can sell apps using your own personal tax information, but what if there are several people working on the app? Our plan is to just have one of us register for the Google Merchant account and then we'll privately divide up any revenue that comes to the PayPal account. Is this legal? Or do we need to actually create an LLC and have a payroll, etc?


Organising staggered user story in Scrum

How would you organise a backlog item that is planned to change in future releases? I've got a requirement that states that: In release 1 users can open content from local machines. In future releases users can open content from remote servers, FTP and web streams. Is it typical to just create 2 backlog items to describe that requirement. Then just assign the enhancement to a future release? (Using TFS for any contextual answers)


Make an app that communicates with an app on a server over wifi

This is a very broad question, and I'm just looking for a pointer in the right direction more than a specific answer, but it's something I've always wondered and never known. Lets say I have a program that I wrote, and I put it on a server. Then, I write an android app that I want to use to control that program (give it inputs, basically) To boil it down even further, what I want to do is have a program that sits on a server, and basically make an android app that is just a gui for that program, and it can be controlled from anywhere, I guess sort of like a remote printing over Wi-Fi type of thing. I really know nothing about this or even where to begin. I'd appreciate even some vocab words that point me in the right direction.


Visualizing a complex software application

## Question What is a good way to go about visualizing a complex software application? Are recommended software applications that can be used for this purpose? ## Background About 3 years ago, I started building a web data mining application. Started out as just me, but has since grown into a project with 5 developers. I used to be able to keep track of all the parts of the application in my mind, but now it has grown in complexity such that I'm feeling the need for some sort of visual documentation of the application's structure. I'm not really sure where to go from here. I'm thinking something that looks kind of like a flow chart. But I don't have any background, experience, or formal training in software development on this scale. I have also never served on another team where I could observe someone else architecting a complex application or managing a team. Any pointers in the right direction such as books or resources on the subject would be much appreciated!


Separation of construction and initialization

I'm confused by this post by Mark Seeman. And his comment on IInitializable below: > The problem with an Initialize method is the same as with Property Injection > (A.K.A. Setter Injection): it creates a temporal coupling between the > Initialize method and all other members of the class. Unless you truly can > invoke any other member of the class without first invoking the Initialize > method, such API design is deceitful and will lead to run-time exceptions. > It also becomes much harder to ensure that the object is always in a > consistent state. The same time he writes:   > This issue is similar to the issue of invoking virtual members from the > constructor. Conceptually, an injected dependency is equivalent to a virtual > member. I thinks this statement is true only if admit that constructed != initialized. What we get now:   Dependecnies are injected in constructor but it is not recommended to use them.   Initialize phase brings complexity and should be avoided.   Isn't it contradictory? Imagine class needs to set its state using the provided dependencies. Loading saved setting for example.   Init is bad, constructor is bad, so where to perform this operation?   And another point:   Are not methods like Connection.Open() just another name for Initialize? Question:   _So can anyone describe a good initialization pattern in the context of Dependency Injection that addresses the concerns Mark Seeman brings up?_


What to test in this project?

Every developer advocates test-driven development, but I am coding a website in NodeJS and I am not testing my app. This is **not** because I don't see any reason. I know it allow me to check at each commit whether my code is right, thus avoiding security flaws. I don't do any tests because I don't know how or what to test. I coded a MVC app with express + mongoose + passport, and I have no idea what to test or how to test. I know it is possible to mock express requests or mongodb, but I don' find that clean and flexible. So, what and how to test?


Preferrable Method to record Documentation

As any taught Software Engineer knows how important Documentation for good software projects is. Could you show me best practices for assure good documentation beside of JavaDoc comments? In my opinion the documentation should not only contain javadoc comments to assure good human readable text for future and present programmers. My thought would be to assure maybe some paper or wiki. Is there maybe any Software that helps recording documentation beside the standart solutions like JavaDoc, etc.


Will SQL Server autonumber reuse a value if a record is deleted?

The titled basically states it. If I have a bigint column with primary key and autonumber, and a record is deleted, will SQL Server ever reuse that now available value? The underlying issue is that I have a multi-user environment, and if I retrieve a record from the database into memory, then another user makes changes (like deleting and/or re-adding), if I do updates or deletes based on that ID in memory, is there a chance that I could be editing a record that was added in the background that doesn't truly represent the record I should be editing? I realize I could use Guids, but I'd really like to know if BigInt/Autonumber is "safe" in this scenario. Thanks!


Search for a sub-string in a given array of strings

I have an array of n strings. I want to select all the elements of the array that starts with the given string. Sorry if that is not clear. I'll give an example.               input = "as"     array = ["abas", "aras", "as", "ask", "asi", "aso", "atas" ]     output =            ["as", "ask", "asi", "aso"]      Which algorithm will I need to do this selection. I need the fastest algorithm that will perform this operation since I'm using it for autoComplete in JavaScript. So the search should be faster than the typing speed of the user. **Edit** : Was just thinking about the data I have to pre-process if using a data structure. The data would be dynamic, and I have to perform insert operation that many number of times. I'm fetching data dynamically using AJAX requests. **Edit 2** : The array might contain 1 million entries and the search should be made at two places. One on the server side, to select all elements matching the condition. This can be restricted to 10000 entries, and the other on the client side... search size will be those 10000 entries, and this can be restricted to first 250 entries. Sorry for the late editing of the question.


What Does Bubbling Mean in this Context?

This page it has the following: _If we want to stop the event (e.g., prevent its default action and stop it bubbling), we can do so with the extended event object's Event#stop method:_               $('foo').observe('click', function(event) {       event.stop();     });


Continuous Build server (cc.net, hudson, bamboo, etc...) remote build experience?

We currently use once cc.net server for our build process, which builds both .net (using msbuild & nant) and java (using maven and ant). CC.net monitors source control, and triggers a remote build running on a separate server. CC.net then collates the results. When we run the remote build, it typically:   * runs nunit or junit or similar using mocked data   * optionally runs a DB script to create a fresh database instance or restore a database from a known position.   * runs selenium or similar to test UI   * runs emma or ncover for code coverage   * builds the system for various deployment environments (test, acceptance, production) We may have several builds running at a time, some .net and some java (from different project teams). It's quite time consuming to get the remote builds working when we set up a new project and we feel that there must be something more suited to remote builds than cc.net. Does anyone have any experience with remote builds with continuous integration systems?   I don't really want feature lists of CI servers, I'd more appreciate hearing about how you've used them in a multi language, multi server environment.


As a new programmer, how much time should I spend learning new libraries?

As a junior programmer, how much time should I spend focusing on new libraries or language features, as opposed to learning how things worked before those libraries came about? How dangerous is it to learn these libraries before I can understand the details of their implementation, or even fully appreciate the problems they solve? This came up as I was doing a bit of research on Reactive Extensions. One thing I do know about .NET events and asynchronous programming is that they're kind of a pain, so I can sort of intuit what's exciting about the framework, and even some cases where our own product could probably benefit from it. But I have not yet spent much quality time with events or asynchronous programming in general. I find I have to remind myself about things like delegates, lambdas, even what the IEnumberable and IEnumerator interfaces look like, before I can really get the RX concepts. This makes me apprehensive about spending time learning the framework, out of a worry that I won't truly understand it, or I'll end up using it inappropriately. I have similar feelings about LINQ, though in that case it's more about not fully understanding how it's implemented. I'd spent more than enough time with collections to understand and love what LINQ can do right out of the box, but not enough time to understand how it does it, or the best ways to use it. Not knowing what's going on behind the scenes makes me nervous about doing something grossly inefficient, or just plain dumb. This makes me think I need more time with the foundational stuff that led to the development of these libraries - but that leads me to think that I'd probably get a higher ROI, and help my team more, if I spend what little time I have to learn new things getting acquainted with the stuff that would make all our lives easier. Though I'm coming at this from a .NET perspective, I'm sure there are analogs on other platforms. I guess the real question is, can you ever get the most out of a "paradigm shifting" feature without having spent some real time drudging through the old paradigm?


Is Java to Linux what .NET is to Windows?

Is Java becoming the de facto standard from Linux application development in the same way .NET is the standard for Windows application development? If not why not?


What to send when a client wants a sample of my code to test my qualities?

We've all faced this. You apply to a cool project and they ask you to send them a piece of your code. On the surface, this look OK and I am fine with it. But what shall I send them? My cool utility? Snapshot of structure in complex project? Something else? So far, I have tried to persuade them to have a desktop share via Skype and that I lead them through code and structure. But somehow clients do not like this approach. So I'd like to hear your thoughts.


Unit-testing databases: test all possible permutations of read and write to table?

I am testing a resource management class that is interacting with a database or a file system, or a combination of both. I was wandering if it is the norm to test **all possible permutations** of read and write for all columns of a data-set when a database is involved. What I mean is: Database table of test case:               +----------------------+----------------------+----------------------+----------------------+     | users                                                                                |     +----------------------+----------------------+----------------------+----------------------+     |       user_id        |      user_name       |      user_email      |      user_role       |     +----------------------+----------------------+----------------------+----------------------+     |          1           |      A New Name      | email@provider.com   |          1           |     +----------------------+----------------------+----------------------+----------------------+     |          2           |   A different name   | address@domain.com   |          1           |     +----------------------+----------------------+----------------------+----------------------+      I could envision something different going wrong in the abstraction layer, updating the first record but no others, updating the second record, but not the fourth, or any of other permutation or combination. Is it the norm to write tests for all those scenarios (if I am thinking this through correctly it would be 4! = 24 cases, right)? Now if I want to retrieve columns, I again could imagine something going wrong only retrieving the first and the fourth column, just the third, or all possible permutations of that. Now what if write and read is mixed, first a read, then a write, then a read. Maybe a write to one column, a read of three columns, then a read of one, or any other permutation. Very soon there are potentially thousands of test cases... Am I over thinking this and should I just test what I am actually encountering, or is it the norm to do due diligence and test all of this. I am asking because database access is causing my test suites to balloon in execution time. Edit: In case this wasn't clear, I am not trying to test if the database is doing what it should be, but if my abstraction layer behaves as intended.


Error handling - Should a program fail on errors or silently ignore them

I'm writing a simple little program to transmit MIDI over a network. I know that the program will encounter transmission problems and / or other exception situations that I won't be able to predict. For the exception handling, I see two approaches. Should I write the program so that it:   * fails with a bang when something goes wrong **_or_**   * should it just ignore the error and continue, at the expense of data integrity? Which approach would a user reasonably expect?   Is there a better way of handling exceptions? Additionally, should my decision about handling exceptions be affected by whether or not I am dealing with a network connection (ie. something where I can reasonably expect to have problems come up)?


What does Jamie Zawinski's Law mean?

I need a proper explaination of Jamie Zawinski's Law of Software Envelopment: > Every program attempts to expand until it can read mail. Those programs > which cannot so expand are replaced by ones which can.


Is there any good reason for someone who knows Python to learn Perl?

Reading the answers to Python vs. Perl in ten years time here on SE, most people seem to say go with Python. I agree (sorry Perl fans ;-) ). I already know Python, and I think it is a very good language, sure, as any programming language it _does_ come with its defects, but when I tried Perl I just didn't like it nearly as much as I liked Python. I "know" C, Python, Java and Scheme and have toyed with several other languages. Now, is there any good reason for me to learn Perl? **What is Perl "better" at than Python?** I do (hobby) application development and am learning some systems development as well (mostly programming for the Linux kernel). I'm pretty sure Perl is not fundamentally enough different from what I know this far to broaden my mind too greatly either (I would probably do better by focusing on Haskell, Scala, Forth or something like that for that purpose).


Beginning development of a C++ project

I study in software engineering and this year a new association at my university is opening a robotic submarine club. It's a new club and they needed software guys for micro-controllers manipulation, gui output and other software oriented requirements. I've been accepted to the club and there is nothing established right now. Although the language might not matter on a higher level we are working in C++ under a UNIX system. Since I have to set up the base I'd like to have input from people with experience on starting up big projects with collaboration in mind. Obviously we want this to scale nicely over the years and have a solid API for the future students who will replace the older ones. So to make my question more precise, I'm looking for tips on setting this up and perhaps books that could help me. I'm comfortable on implementation in C++ and I've done some analysis and conceptual OO courses too. It's really just that I've never had the chance to start up on something bigger than a 2-3 man group with SVN. I don't know either if there is a similar JUnit system and perhaps maintenance system that works well for C++ that I could set up for the team(I've used maven with trac in Java). This is an opportunity for me and the others because we have a green flag on using any of the latest technology and best practices, so I would like to exploit that and learn a thing or two about software management that I wouldn't normally learn in a company with a system already in place.


Is it best practice to have a file only of "includes/requires"?

I have 5-10 files on one server that all catch XMLRPC-PHP requests. There's about 20 lines of `require_once` in each one that are all the same. It'd make life simpler for me to create a separate file that only has the `requires` and `require` that in my XMLRPC files. Is this best practice, or does it open up issues that I don't know about?


Can I distribute open-source software that uses the syntax/interface of a proprietary program (Stata)?

Stata is a proprietary statistical program used largely by economists. I want to write a basic multiple regression package that uses the same commands as Stata, e.g., `regress var1 var2 var3, robust if var4[_n - 1] < .` Is it legal (in the US) to distribute source code that does this under an open-source license? In other words, does any IP protection apply to the command syntax used by proprietary software?


If an entity is composed, is it still a god object?

I am working on a system to configure hardware. Unfortunately, there is tons of variety in the hardware, which means there's a wide variety of capabilities and configurations depending on _what_ specific hardware the software connects to. To deal with this, we're using a Component Based Entity design where the "hardware" class itself is a very thin container for components that are composed at runtime based on what capabilities/configuration are available. This works great, and the design itself has worked well elsewhere (particularly in games). The problem is that **all** this software does is configure the hardware. As such, _almost all_ of the code is a component of the hardware instance. While the consumer only ever works against the strongly typed interfaces for the components, it could be argued that the class that represents an instance of the hardware is a God Object. If you want to do anything to/with the hardware, you query an interface and work with it. So, even if the components of an object are modular and decoupled well, is their container a God Object and the downsides associated with the anti- pattern?


Why is it not standard to implement abstraction layers for the file system?

I have been taught to access databases through abstraction layers. I was wondering why it is not also standard practice to access the file system through an abstraction layer? It seems to me unit testing would become much simpler, since mocking the filesystem is often a pain and poorly supported by some languages.


Best way to rename existing unique field names in database?

I have a database table that contains `id, filename, userId`   * id is unique identifier   * filename should also be unique   * table may contain >10000 records > When a user uploads a file it should be entered in database with given > rules:   1. If there is no record with same filename, it should be _added as it is_ (Ex. **foobar.pdf** )   2. If there is _record with same filename_ , it should be _added as uploadedName(2).ext_ ( **foobar(2).pdf** )   3. If there are n records with same base filename ( _foobar_ ), it should be _added as uploadedName(n+1).ext_ ( **foobar(20).pdf** )   4. Now if _foobar(2).pdf_ is uploaded, it should be added as **foobar(2)(2).pdf** & so on > This pattern needs to be followed because the file is already being uploaded > at client side using ajax before sending the details to server and the file > hosting service follows the above rules to name the files. * * * _**My solution:_**   1. maintain a file that contains all the names and the number of times it has occurred.   2. if a filename that exists in file is entered, increase occurrence count and new name is generated, else add to it to file   3. if the new name generated is in database, add it to file and generate new name


How do I handle a user story that I complete, but with compromise and need to revisit?

I have just fulfilled (is that a good term?) two user stories out of a new project backlog I have just built. These are user registration and password reset, both requiring mail. I need to implement a substitute mail component because my initial choice, and a normally reliable one, wasn't working. Because I was focused on delivering the user stories, not debugging the mail component, I swapped it out to deliver working code at sprint end. Do I now log a new support issue for the mailer, or 're-insert' these stories into the backlog? If I do the latter, am I not introducing too much tech detail into user stories?


elevator algorithm and implementation

I wanted to know how (real) elevators work. But, so far, I could not find much material about the algorithms they use, nor software (if any) for simulation. Could anybody give me references for that?


Are there any standard for exchanging rules rather than data?

Just out of curiosity. There are many open standards for data exchange, as well as standards for exchanging code (jsonp, for example). But are there any standards for exchanging formulas/rules, for them to be executed on different platforms?


Does following TDD inevitably lead to DI?

I learned to do Test Driven Development (TDD), Dependency Injection (DI) and Inversion of Control (IoC) all at the same time. When I write code using TDD I always end up using DI in my class's constructors. I am wondering if this is because of how I learned to do TDD, or if this is a natural side-effect of TDD. So my question is this: Does following TDD principals and writing unit tests that do not depend on external services inevitably lead to DI?


Best tool to privately share code with members of a team?

I'm getting into freelance web design and I have a team of several people. I was wondering what is the best tool (preferably free) to share code with other members of the team, allow them to edit it etc. A way for us all to work fluidly.


Code and intellectual property

Years ago I developed a website in Flash for one of my clients. I was in charge of code/animation and also maintaining Hosting and Domain. I also have a basic contract with my client and in the contract it does not mention who is the owner for the code. My Client (ex client) decided suddenly to work with a different company, so they moved the website without asking my permission and left me with unpaid bills for hosting and domain registration. Now the website is running on the same name but with a different extension, the website is managed by my competitor. The other company probably used some SWF Decompiler and uploaded the entire website on the new domain. My question:   * Even if in our contract it is not mentioned who the owner of the code/website, I would like to know if I have some right on the code/website I developed?   * Do you now any international regulation on this matter (I'm in Europe)? If you like please share your opinion or similar story on this, I would appreciate it.


Is functional programming just different, or is it actually really tougher?

Is functional programming just _different_ , or is it actually really _tougher_? Say someone who have never learned programming at all before, and is taught functional programming. vs someone who have never learned programming at all before, and is taught imperative programming. which will he find tougher? or the same? My question: say the problem now is to camel-case an input, such that `qwe_asd_zxc_rty_fgh_vbn` becomes `qweAsdZxcRtyFghVbn` The procedural way is:   1. split it along the `_`   2. loop through the array skipping the first item   3. for each entry we capitalise the first letter   4. join the results together The functional way is:   1. if cannot find `_` return `input`   2. cut the `input` along the first `_` (such that we get `qwe` and `asd_zxc_rty_gfh_cvb`)   3. capitalise the first letter of `head` and concat that with `f(tail)` Ok if you have a _functional-background_ AND have substantial experience in procedural-programming, I would like to ask: will it take you longer to figure out the procedural way or will it take longer for you to figure out the functional way? If you have a _procedural-background_ but have many years of experience with functional-programming, I would like to ask the same question: will it take you longer to figure out the procedural way or will it take longer for you to figure out the functional way?


Anyone know about webs.com?

I have a friend who created a website with web.com which use to be called freewebs.com. He also has his domain name registered through them as well. Are theses one of those dangerous sites to stay away from or is he going to be okay for now?


Service Method to Use for Uploading Large Chunks of Data

I have a need to be able to provide a web-based service to upload large amounts of data that would come in as chunks as large as 10,000 lines of 950 byte records, which is 9.5 MB. I've gotten advice that I shouldn't use web services (aspx) because MS has deprecated this, and I've also been told that WCF services aren't designed to be used for this purpose either (although this seems odd). FWIW, I've tried both WS and WCF and have run into size issues, and even though some solutions claim to fix this, I've not found any settings in either case that enable me to upload anything larger than 4 MB. The question is, if not WS and also not WCF, what else is there? I am trying to replace a number of different applications that all use FTP to upload data to a mainframe accounting system, and so for this question, FTP is not the answer. Unless the answer is that I need to abandon a service-based solution and stick with FTP.


Can I bundle my JavaScript code with an MIT licensed code and keep my code unaffected from the MIT license?

Can I bundle my proprietary JavaScript code with MIT licensed libraries (e.g. JQuery, AngularJS) into the same file, distribute it via HTTP but disallow my users to use my own code as an MIT licensed code? This way I could minimize the number of browser requests, and reduce errors due to network errors. I don't want to let my users copy, modify and reuse my own code outside of my website.


Is there any value in writing unit tests for code that already works when inheriting applications?

Obviously some old applications can't be or is extremely difficult to unit test because of the way it was written in the first place. But in places, like some helper methods which could probably be unit tested, should I bother writing unit tests for them? I mean, they could be written like a dog, but however complexly fragile the logic, the test of time has proved that it works the way it should. Should I only bother to unit test if I'm say re-factoring it or should I write unit tests for them whenever I have the time? Is there any value in doing this? Take into account also that the method definition may be vague, and I may need to research what some of the methods should actually do in given conditions.


Preferred location for installing user guides, sample documents on Windows?

By default, the installer for my product copies files to the **Users\Username\AppData\local\MyProduct** directory (though the user can change this during installation, of course). I want to bundle some other files with product - documentation, sample spreadsheets (it includes an Excel add-in) etc. It doesn't seem appropriate to copy these additional files to **AppData** because it's a hidden folder that users shouldn't really muck about with. I could, of course, create a new sub-folder in the user's Documents directory and stick the files in there but as I haven't asked their permission to do this it seems impolite. So - any suggestions as to an easily accessible location to put these files in?


Are MSDN licenses transferrable? How about if they have expired?

I have a coworker who will likely be leaving the company soon. An msdn subscription (Premium I believe) was purchased for him - but I believe it was more than 1 year ago. Is this license transferrable to me when he leaves the company?


Finding the lowest average Hamming distance when the order of the strings matter

I have a sequence of binary strings that I want to find a match for among a set of longer sequences of binary strings. A match means that the compared sequence gives the lowest average Hamming distance when all elements in the shorter sequence have been matched against a sequence in one of the longer sets. Let me try to explain with an example. I have a set of video frames that have been hashed using a perceptual hashing algorithm so that the video frames that look the same has roughly the same hash. I want to match a short video clip against a set of longer videos, to see if the clip is contained in one of these. This means that I need to find out where the sequence of the hashed frames in the short video has the lowest average Hamming distance when compared with the long videos. The short video is the sub strings Sub1, Sub2 and Sub3, and I want to match them against the hashes of the long videos in Src. The clue here is that the strings need to match in the specific order that they are given in, e.g. that Sub1 always has to match the element before Sub2, and Sub2 always has to match the element before Sub3. In this example it would map thusly: Sub1-Src3, Sub2-Src4 and Sub3-Src5. So the question is this: **is there an algorithm for finding the lowest average Hamming distance when the order of the elements compared matter?** The naïve approach to compare the substring sequence to every source string won't cut it of course, so I need something that preferably can match a (much) shorter sub string to a set of million of elements. I have looked at MVP- trees, BK-trees and similar, but everything seems to only take into account one binary string and not a sequence of them.               Sub1: 100111011111011101     Sub2: 110111000010010100     Sub3: 111111010110101101          Src1: 001011010001010110     Src2: 010111101000111001     Src3: 101111001110011101     Src4: 010111100011010101     Src5: 001111010110111101     Src6: 101011111111010101      I have added a calculation of the examples below. (The Hamming distances aren't correct, but it doesn't matter)               **Run 1.**     dist(Sub1, Src1) = 8     dist(Sub2, Src2) = 10     dist(Sub3, Src3) = 12     average = 10          **Run 2.**     dist(Sub1, Src2) = 10     dist(Sub2, Src3) = 12     dist(Sub3, Src4) = 10     average = 11          **Run 3.**     dist(Sub1, Src3) = 7     dist(Sub2, Src4) = 6     dist(Sub3, Src5) = 10     average = 8          **Run 4.**     dist(Sub1, Src3) = 10     dist(Sub2, Src4) = 4     dist(Sub3, Src5) = 2     average = 5      So the winner here is sequence 4 with an average distance of 5.


what is a efficient way to find repeating decimal

I am trying to find a efficient algorithm in Java to find the repeating decimal part of two integers `a` and `b` where `a/b`. eg. 5/7 = 0.714258 714258.... I currently only know of the long division method.


How do I convince the IT department to relax Antivirus settings on my PC

I've been given a relatively decent new laptop at Work. I really thought it would help speeding development up, especially build times and the like. The problem is that our company runs Mcafee antivirus and it is slowing my machine down to a halt. My harddrive is almost always active even when I'm doing nothing. It seems to be doing some kind of real time scan. I run no antivirus at home and haven't had any problems in years as I know not to do anything stupid like download attachments that I'm not expecting etc. Also, the corporate firewall is pretty strict so I believe that would make it even harder to obtain a virus. How would you convince the IT department to relax AV settings for you? edit: As many people have pointed out, the chance of getting them to turn it off is slim to non so I've changed the subject from disable to relaxing settings.


Ways of marking changes being made to a file

I am looking for a lightweight way to notate changes made to a file. The obvious answer to this is a version control system. But this is more robust than necessary for what I would like to do. All I want is the functionality to compare an edited file to its original in a lightweight manner.


how to deal with controller mutations

During development process, things are constantly changing (especially in early phases). Requirements change, UI changes, everything changes. Pages that clearly belonged to specific controller, mutated to something completely different in the future. For example. Lets say that we have website for managing Projects. One page of the website was dedicated to managing existing, and inviting new members of specific project. Naturally, I created members controller nested under projects which had proper responsibility. Later in the development, it turned out that it was the only page that was "configuring the project" in some way, so additional functionalities were added to it:   * editing project description   * setting project as a default   * ... In other words, this page changed its primary responsibility from managing project members to managing project itself. Ideally, this page should be moved to "edit" action of "projects" controller. That would mean that all request and controller specs need to refactored too. Is it worth the effort? Should it be done? Personally, I am really starting to dislike the 1-1 relationship between views and controllers. Its common situation that we have 1 page (view) that handles 2 or more different resources. I think we should have views completely decoupled from controllers, but rails is giving us hard time to achieve this. I know that AJAX can be used to solve this issue, but I consider it an improvisation. Is there some other kind of architecture (other than MVC) that decouples views from controllers?


Technical Support Developer position with a Software Engineering degree

I've received a job offer from a company for a technical support developer. I originally had an interview lined up with them for a C# Developer role but this was filled internally before my interview. I am feeling under a lot of pressure to take this role because of the economy and since it'll be my first role since graduating. The reason for this post though... will I be hurting my chances of becoming a fully fledged software developer in the near future? The job will involve mostly bug fixing and testing with skills required such as C#, ASP.net, MVC, Javascript. As far as I'm aware, there'll be no pure development. There will be chance to progress to new roles in the business but I'm unsure of the time frame. I would be grateful to hear from anyone who has been in similar positions.


Finding and managing a group of testers

I am about to release a piece of software that will be licensed with the **GPLv3** (the project itself is "for fun" and has no commercial dimension in it). The software is intended to help designing digital clocks and I know the core functionality works as - beside having unit tests - I used it for designing a couple of clocks myself. Yet, before getting the software advertised on hackers and makers sites, I would like to get a few voluntary testers... trying to use it and reporting any problems. The only tests I did so far in my life were with fellow programmers or with the customers. So I would appreciate input from the community on:   1. **Where to find voluntary testers** (is there a well-known website that escaped my googling perhaps?)   2. **How to brief them** (fellow programmers and clients know a great deal on the software they are going to test... should I try to brief in depth these "unknown" testers or should I contrarily try to let them "on their own"?)   3. **How to structure the tests** (I'm not asking what to ask them to do here, but if I should structure my test in some specific way: for example in more phases, like having one group to make a test, then fix bugs, then having a second group test again... or collecting data in a particular way [e.g. with a questionnaire with scores rather than with free-form e-mails])   4. **How to give maximum visibility to their contribution** (Again: I can't afford to invest _also_ money on this project, but I would be happy to give them as much glory as I can to them! The focus of the test would be primarily **usability** (Does the GUI make sense? Is the workflow easy to follow? Are there unexpected behaviours?). But of course any bug that should emerge in the core functionality would definitively receive all my attention too! Thanks in advance for your advice and time.


What's the best way to get up to speed with Java?

I'm a software developer that just switched teams so I shall write code in Java now. Last time I wrote something in the language was in programming 101 at uni (I was already an amateur coder back then). So what is the best book/tutorial to get up to speed with Java? Where's the _Java - the good parts_? Learn you some Java for great good? _Learn Java the hard way_? Or is it too enterprisey for that kind of passion...?


Why would a developer create a public class that has all static properties?

A previous developer has a couple public classes that do not inherit from any other classes but are filled with static properties. Is this another way of creating a struct or enum? Is this an older or newer technique of housing static data to be referenced? I find it odd/different to see a class built in this way but am wondering what other fellow programmers thoughts or feelings are about what this coder was trying to accomplish. This is a made up example of what I am seeing...                   public class CashRegister         {             public static decimal OneDollarBill             {                 get { return (decimal)1; }             }                  public static decimal TenDollarBill             {                 get { return (decimal)10; }             }         }


Does it make sense to sanitize email form input?

So, I'm expending this email submission form script for a client and saw something rather strange to my experience. As you can see below, the original programmer has sanitised the user input. Is this a good practice or does this makes sense at all?               // Build Message Body from Web Form Input      foreach ($_POST as $Field=>$Value)         $MsgBody .= "$Field: $Value\n";      $MsgBody .= "\n" . @gethostbyaddr($_SERVER["REMOTE_ADDR"]) . "\n" .         $_SERVER["HTTP_USER_AGENT"];      $MsgBody = htmlspecialchars($MsgBody, ENT_NOQUOTES);  //make safe      Thanks everyone!


Why are /// comment blocks important?

Someone once said we should prefix all our methods with the `/// <summary>` comment blocks (C#) and I am wondering if that is true or not. I started to use them and found they annoyed me quite a bit, so stopped using them except for libraries and static methods. They're bulky and I'm always forgetting to update them. Do you recommend using them? Why? **EDIT** : I normally use `//` comments all the time, it's just the `/// <summary>` blocks I was wondering about


Which library/framework did you ditch as being too complex for the problem it is solving?

... and coded the functionality "manually"? As a rather metaphorical example, you'd hardly need a library for solving quadratic equations, although such libraries do exist and someone takes them seriously. As a more questionable case, depending on the circumstances I may ditch jQuery (for example when I don't need to support some stone age browsers): it does simplify some things but it adds another layer of complexity and unreliability to DOM. And overusing jQuery leads to absurd problems, such as one seen recently on SO: how do I assign an empty href to an `a` tag with jQuery? Turned out it was a HTML question, not even JavaScript. Another absurd case and yet non-obvious for many is using some templating engine/language built on top of another templating system: PHP. Third level of templating anyone? And another one: _sometimes_ just spitting out XML with (figurally) `printf` is far easier than doing it with some monstrous XML engine. Any other cases from your experience?


What would happen if you defined your system's CSV delimiter as being a quotation mark?

Title says it all. If the CSV's system delimiter was `"` (as opposed to a comma or pipe or other common alternatives), how would anything deal with it? The crux of the matter is of course that by definition, CSV will surround any values containing the delimiter with quotation marks, and will convert all quotation marks to double quotation marks. Would the result be parse-able? (Inspired by an answer in Most common "Y2K-style" bugs today?) ![System Delimiter \(which drives excel, databases, etc\)](http://i.stack.imgur.com/lWhbO.png)


How can I send a signal to a program via external hardware

I am trying to find a piece of hardware that will signal a program to start a timer when it is moving and stop when it stops. The hardware can just be a ball that moves and is connected to the computer through USB, I was thinking of something similar to the way a mouse would work. For the programing I would like to use c# or possibly ActionScript with adobe air. I am a web developer and have not had any experience with hardware or drivers and would appreciate any ideas on where to start. Maybe there is some piece of simple hardware out there that I can use to send signals to the computer or some literature of articles for beginners that you can point me to. Thanks in advance


Are niche job boards effective?

There are number of job openings each day and also there are number of job seekers actively looking for job everyday. Still it is challenging to find right candidate for a job. It gets even more challenging and surprising when both the employer and the candidate are active seekers, but could not connect each other. There are very niche job sites that focus on specific technologies. Are these places more effective at connecting employers with qualified candidates than the more conventional and less focused job sites?