Jargon to describe unnecessary running of code?

Some code works but it runs an unnecessarily large fraction of the code in many cases, though that extra code is still required sometimes. Better preprocessing, simple stoppers and conditional checkers would save enormous amount of running time. What is the technical jargon to describe unnecessary running where a programmer could simply place a condition or do better preprocessing?


Is it better to find issues myself or let the computer figure it out?

I'm about to start the process of migrating a program from one component to another. Most of the core functionality will be the same but I'll need to change database calls, etc. I'm sure there will be a few quirks somewhere. Naturally, there will be many errrrrrors, some of which Ill miss completely. Would it be better to completely scrutinize the code, checking for errors line by line, or to just write the code and see what errors occur?


How do I draft user stories as a developer?

I am writing a system where both the system owner and myself are developers, and we are currently the only source of 'requests' or requirements for the system, which I would like to capture in user stories tied to features{1}. My urgent priority now is to get a managaeble backlog captured. How should I go about capturing the level of technical spec I am used to to working with in users stories, which aren't supposed to be too technical. {1} I am evaluating agile project management service TargetProcess, and each user story must be tied to a parent feature. The system seems a good fit, so this small constraint is something I would rather work with than work around.


What makes a project big?

Just out of curiosity what's the difference between a small, medium and large size project? Is it measured by lines of code or complexity or what? Im building a bartering system and so far have about 1000 lines of code for login/registration. Even though there's lots of LOC i wouldnt consider it a big project because its not that complex though this is my first project so im not sure. How is it measured?


Do you spend your working hours on learning?

Do you spend your working hours learning new stuff, reading tech blogs, books on programming etc.? What's your opinion on it? Can an employer have benefits allowing developers to spend about 1-1.5 hrs a day on learning. Will it be repaid in future (with better productivity etc.)?


Most logically consistent way to create methods of the form a affects b?

I have a common scenario where I have an object (a) that logically affects another object (b), like a makes a note on b, or a marks b as disabled (usually a is a user object of the system and b is some kind of business object like a customer or an appointment). In the past, the method was on the affected object like:               customer.Disable(user); // user is marking the customer as disabled      ... but it doesn't read well (it appears backwards). The opposite:               user.Disable(customer);      ... reads better, but there's something about it that I can't put my finger on that just doesn't seem right. The only other option is to have a static intermediary:               ThirdPartyClass.DisableCustomer(customer, user);      ... but the domain objects end up becoming more like DTOs and I prefer the domain model approach because it makes more sense. So the question is: which makes the most sense? Is there an option I haven't considered? Who actually owns an operation like this? **Edit** With the second option, the actionable objects in the system (users usually) end up becoming huge because the users of the system are the ones that pretty much do and affect everything.


Language Niches and Niche Libraries

"Everyone Knows" ...   * ... that c is widely used for low level programs in large part because operating system/device apis are usually in c.   * ... that Java is widely used for enterprise applications in large part because of enterprise libraries and ide support.   * ... that ruby is widely used for webapps thanks in large part because of rails and its library ecosytem  But lets go into to details what are the specific niches and subniches. Especially with respect to libraries. Where might you embed lua for application scripting versus python. Where would you use Java vs C#. Which languages do different scientists use? Also which languages have libraries for these subniches? Things like bioperl/scipy/Incanter. Please no flamewars about how nice each language or environment is. This is where they used. Also no complaints about marketing/PHBs. **(Manually migrated) I asked this question again after it was closed on stackoverflow.com**


How will writing the transaction part in Java benefit the security of the application, when all other parts are being written in PHP?

A friend of mine while working on a PHP application asked me to write one part of the application in Java. The part that involved transactions. He said it will be better to write this portion in Java. He talked about how secure it will be! Though I was too busy to help him then, I want to know the essence of this idea. Why he was trying to use Java when he wrote the most part in PHP? Will it really boost up the security? And writing transactions in Java is only concerned with security? The thing seems very interesting but I really have no idea, what it is! Please provide some insight into the topic. Note: When I say transaction, it involves everything. From accessing account to transferring money.


Is there a loophole in the GPL that allows proprietary software to be linked with GPL libraries?

Let’s examine a hypothetical scenario: Company X writes a proprietary program (A) that dynamically links with a proprietary library (B). Company Y wants to use a replacement library (C) licensed under the GPL, and so writes a wrapper library (D) that dynamically links to both A and C and translates the API calls used by A to the API calls used by C. As D is intended to be used with C, and uses C’s API calls, it is a derivative work of C and must therefore be distributed under the terms of the GPL*. As a result, the combined work of A and D must also be distributed under the terms of the GPL, which is impossible given that Company Y does not possess the source code for A. That said, so long as Company Y distributes D by itself, there is no problem. _However, regardless of Company Y’s actions, Company X does not violate the GPL by distributing A, even without B. The mere existence of D does not mean that A is suddenly a derivative work of C (through D) that must be licensed under the GPL as well._ Now this is the loophole: _there is nothing that stops Company X from writing its own version of D, distributing it separately from A, and telling end-users to use D instead of B when running A._ It seems that a company is capable of designing a proprietary program to use a GPL library without violating the GPL, so long as a wrapper module is used to insulate the proprietary program from the GPL library and that module is distributed separately. Am I correct in my reasoning? Is this a real loophole in the GPL? *D is also a derivative work of A, but for the purposes of this scenario, Company X has explicitly authorized the creation of D and allowed it to be licensed under the GPL.


What type of code or program , i can post as open source on Git or Bit Bucket

I have seen many times that if you want to look good on resumes you should have some project coded as open source on bit bucket and Git. I want to do that , even though it may be small but at least i want to starts the steps which can make me a good programmer and it looks good on resume. I knows these languages like `php bash python django jquery joomla` Can anyone give me some example what type of projects i should upload there which i can mention in resume. i usually build websites , how can i put those type of codes. Does putting shell script for backing database can also be put in there


Process monitoring in Linux environment?

I'm trying to write a multi threaded/processes application and it need to know how to monitor a process from another process all the time. So here is what I have, I have a 2 processes, each with multiple threads that handle the network part, then another 2 process also with multiple threads that interact with DB and with the network processes, what I need to do is that if for example one of the network processes goes down the DB process start sending to the live network process until the second one is up again. I'm using fifo between the DB and the network process. I was thinking of sending messages with message passing all the time but not sure whether this is a good idea or I need to use some other IPC for this issue, or probably neither is good and I need to use entirely something else?


Do ORM POCOs replace domain entities?

This is somewhat similar to this question but more broad. In general, with ORMs like EF 4.1 supporting POCOs, does it now make sense to have your domain entities **be** the objects that are persisted to your database? With older ORMs like EF 4 or Linq-to-SQL, your "database objects" were auto- generated, and tightly coupled to your database, and so, for non-trivial applications, were mapped to more robust, intelligent domain entities before being put to work. Is the idea with newer ORMs to just build robust domain entities, and then have a data-layer that simply provides a mapping between said domain entities and your DBMS? In writing that I get the feeling that this has **always** been the goal, but not readily (easily) possible with the tools available, at least not in the .NET world.


constants/enums in API

What are a few ways constants and enums are dealt with when creating an API Client? I'm writing a client in python for our API and I've hit a sticking point with this. We use a lot of mappings to numbers (to save space) and I was wondering what the best technique is. I can hard code them into the client, but if a new enum/constant gets added, the consumer would have to update his version of the client. I also thought about grabbing the maps/enums when the client is first initialized and cached until there is an update. Are these typical approaches, or is there a more effective way to do this? Edit: This is a REST API but I'm making a python client (so platform specific I suppose) for it to make it easier to work with. For a little more detail, when I say enums, I just mean using a constant (like an integer) to represent a certain choice a consumer has for a certain attribute. So lets say someone using the API is saving what type of video game system they have. 1 = xbox, 2 = playstation, 3= wii, etc... Do I hardcode those into the python client for the consumer to use? Do I grab them from the server when the client is initialized and then cache them client side?


Is there justification for leaving conflict markers in checked-in code?

Consider conflict markers. i.e.:               <<<<<<< branch     blah blah this     =======     blah blah that     >>>>>>> HEAD      In the particular case which has motivated me to post this question, the team member responsible had just completed a merge from upstream to our branch, and had in some cases left these in, as comments, as a sort of documentation over what had just been resolved. He left it in a compiled state, tests passing, so it's not as bad as you would think. Instinctively though, I really took objection to this, however being devils advocate to myself I can see why he might have done it:   * because it highlights to other team developers what has changed as a result of the merge.   * because those who are more expert with the particular pieces of code can then address the concerns illustrated by the comments so that he doesn't have to guess.   * because the upstream merge is a right pain and it can be difficult to justify the time to resolve everything well and completely, so some semi-complete FIXME notice is necessary, so why not use the original conflict as a comment to document this. My objection was instinctive, but I'd like to be able to justify it rationally, or see my position more wisely. Can anyone give me some examples or even experiences where people have had a bad time with someone else doing this and/or reasons why it's bad practice (or you can play devil's advocate and support it). My own immediate concern was that it would clearly have been annoying if I had been editing one of the files concerned, pulled the changes, got real conflicts, but also pulled in the commented ones. Then I would have had a very messy file indeed. Fortunately that didn't happen.


MVC pattern with JSF-Spring-MyBatis webapp

I've a Java webapp with these frameworks and I want to know if my implementation meets with MVC pattern: **Controller Layer (V)** I'm using JSF               @ManagedBean     public class Controller{         @ManagedProperty("#{business}")         private Business business;              public void insert(){             business.insert();         }     }      **Business Layer (C)** I'm using Spring               public interface Business{         public void insert();     }          @Service("business")     public class BusinessImpl implements Business{         @Autowired         private DaoMapper mapper;              @Override         @Transactional         public void insert(){             mapper.insert();         }     }      **Data Layer (M)** I'm using MyBatis (This java interface is associated to XML file of MyBatis)               public interface DaoMapper{         public void insert();     }      My layers implemented MVC pattern? I'm confused :S...


Why in the world does a heap need to make sure it allocates in 8-byte alignments?

4-bytes = word; 8-bytes = 2x word Then why doesn't the heap just go with 4-byte alignment (because it will be grabbing a word at a time anyway, right?) If we went with 8-byte alignments, why not 12? 16?


What is a suitable replacement for an Access 2003 database required to run an older PC?

Many years ago, I wrote a small Access 2003 database for a non-profit to track the donations they received. They recently wrote me asking for some new features (I was shocked it was still in use, honestly) and I'm wondering if I could rewrite the application with a newer technology/framework. Here are the machine specs:   * Pentium 4 2.8 Ghz   * 1 GB RAM   * Onboard Intel video card   * Windows XP SP3 What, if any, would be a suitable replacement for the database and UI? I'm mainly a C# developer so Winforms + SQL Compact 4 springs to mind (I don't know how WPF would perform on a machine that old). Perhaps there are other possibilities in Python/Ruby/etc? Update: I appreciate and agree that rewriting is rarely the right thing to do, but I was hoping to learn via this question, that given the PC's specs and OS, what possibilities would I have for writing an application that could   * perform CRUD for donations   * generate summary reports (totals by month/year/etc) Or, put another way, is Access still the appropriate tool for the job?


How do I know if I'm cut out for the position I'm in?

Most times someone gets the chance for more responsibility and growth in their career they would not know for sure if they can handle it until they are actually doing the work. When things dont seem to be working out, how would one know whether it is because of himself not capable of doing the work due to incompetence, or due to lack of experience? Keeping in mind that there is no one more senior than you at the company for the specific area of expertise. If you've been given a job that you are not ready/capable of performing adequately, what would be the better career move:   1. Push hard to skill up in order to be able to perform the job. potential Burnout danger, and then how would you handle the time between being incompetent and becoming competent.   2. Tell management that you are not ready for the job and they need to hire someone more senior. They may replace you all together.   3. Look for another job where your experience is correctly matched to your responsibilities   4. None of the above


What's the best explanation of what Story Points are?

We're starting to use Story Points here for our Agile development but I find it hard to explain and also can't find any definitive answer to what they are. The best thing I can do is point to other sites (like http://blog.mountaingoatsoftware.com/tag/story-points) and give some vague generalization of what they are. I'm looking for a good explanation with some examples of use that would be helpful for others to use. Are there any good resources for explaining story points?


Xerox SOLID example in PHP

There is a good example on Wikipedia regarding the violation of SOLID principles. > The ISP was first used and formulated by Robert C. Martin while consulting > for Xerox. Xerox had created a new printer system that could perform a > variety of tasks like stapling a set of printed papers and faxing. The > software for this system was created from the ground up and performed its > tasks successfully. As the software grew, making modification became more > and more difficult so that even the smallest change would take a > redeployment cycle of an hour. This was making it near impossible to > continue development. The design problem was that one main Job class was > used by almost all of the tasks. Anytime a print job or a stapling job had > to be done, a call was made to some method in the Job class. This resulted > in a huge or 'fat' class with multitudes of methods specific to a variety of > different clients. Because of this design, a staple job would know about all > the methods of the print job, even though there was no use for them. The > solution suggested by Martin is what is called the Interface Segregation > Principle today. Applied to the Xerox software, a layer of interfaces > between the Job class and all of its clients was added using the Dependency > Inversion Principle. Instead of having one large Job class, a Staple Job > interface or a Print Job interface was created that would be used by the > Staple or Print classes, respectively, calling methods of the Job class. > Therefore, one interface was created for each job, which were all > implemented by the Job class. > > http://en.wikipedia.org/wiki/Interface_segregation_principle I tried to find a good PHP solution for this, I got this far:                class Job implements StampleJob, PrintJob {      }           class Print {        protected $objPrintJob;        public function __construct(PrintJob $objPrintJob) {          $this->objPrintJob = $objPrintJob;        }      }           class Staple {        protected $objStapleJob;        public function __construct(StapleJob $objStapleJob) {          $this->objStapleJob = $objStapleJob;        }      }      I can understand how the interface will limit knowledge but this will not actually change the big Job class or remove the SRP violation. Can you clarify how this solution actually solves the problem: "The design problem was that one main Job class was used by almost all of the tasks"?


Why put SQL statement in a variable before using mysql_query()?

I'm been working with PHP on and off for a bit now, and I've seen plenty of code both ways:               $sql = "SELECT …";      mysql_query($sql);      vs               mysql_query("SELECT…");      Is there a reason for separating the two, beyond being able to also pass in something such as $con?


What does it mean for software, libraries, and languages to be asynchronous?

With popular software out today like Node.js, Celery, Twisted, and others boasting about being asynchronous, what does it mean? I've gone through the basic Node.js tutorials and written a few Node.js scripts, but still don't feel comfortable with the topic. Please note that I haven't had I had any formal introduction to the topic.   1. How exactly does asynchronous software work?    2. What are the pros and cons?   3. What are callbacks?   4. Lastly, how does a synchronous web server perform vs. an asynchronous web server?


Where does UI fit in a Multi Agent system

**tl;dr** How would I represent GUI as agents in a multi agent system. I am learning more about Multi Agent Systems. I like the concepts of such systems, it makes a lot of sense and it sounds very useful when I want to create a large system devised of smaller parts for the Web. So, I created a basic `Agent` class, taught my agents to negotiate and communicate, created an environment for them to be situated in and such. So, in a simple app attempt I have:   * Several "InfoBroker" Agents that handles communications with server services, wanting to obtain information about the world and willing to share it under certain terms (They hold an auction if that matters).   * A few agents that coordinate the communication between my services on the client side (Also "InfoBroker" agents I guess).   * A few working agents, that have a simple goal in their environment, performing calculations and performing (very basic) means-end reasoning in the environment. They're my 'manual labor' in the app.   * A few other things specific to my application. That's all great, but I have no idea where GUI fits in all that? I need to show information about my system to the user, the GUI isn't a small part (consider agents that speak to the DOM in a web app). How would represent GUI as an agent in a multi agent system? Note: I've implemented this in JavaScript, but this seems more language agnostic to me.


Keyword Collection, ManyToOne or OneToMany relationship?

I hope this is the right place for this type of problem. An Object of my class `Movie` can have several `keywords` ( like 'fight club', 'brad', 'fincher'), and be part of different `categories` (like 'Drama', 'Best Movies Ever') I implemented them as ManyToMany:               @OneToMany(targetEntity = Keyword.class,fetch=FetchType.EAGER)         private Set<Keyword> keywords;          @OneToMany(targetEntity = MovieCategory.class, fetch=FetchType.EAGER)         private Set<MovieCategory> movieCategories;      Somehow I don' think, this is not the correct relationshipmodel, how would you implement this? Right now hibernate wont allow me to fetch.eager. fetch.lazy is okay. I found this link http://www.mkyong.com/hibernate/hibernate-many-to- many-relationship-example-annotation/ but it didn't answered my question.


Is an "associate engineer" the same as a "junior engineer"?

I'm a recent college grad starting my first software engineering job. I received an offer I like but the title is associate engineer. I'm used to seeing junior engineer. Is this pretty much the same thing? Salary is $70k + stock options.


How important are PHP notices really?

I recently turned all possible error-messages on with `error_reporting(-1);`, on my PHP project. Of course, right away I got alot of messages. For example: > **Notice:** Undefined variable: foo in /.../file.php on line **205** So I started updating my code to get rid of all the notices. Mostly, by adding `isset($foo)` and making the `$foo = NULL;` So, I'm wondering. How important are these notices really? I mean, if the `$foo` variable is not set, then it should be false/null/not-set by default..so technically the code works?! If I would get rid of all notices, then does it make the process faster or slow it down (because I'm adding more code, `isset($foo)`, `$foo = NULL` etc)? How do you guys deal with these notices, or do you even pay attention to them?   I guess, the most important question is: Should the code be written so strict, that it would never generate any notices or warnings?


About empty line of code

Why do my colleagues hate it when I add an empty line of code? Sometimes I add a few lines to see when a method ends and another one starts more easily.


What is the standard practice for extracting an auto-incrementing primary key?

I have some objects that will be created an entered into the database. There is no guarantee that any of their fields will be unique except for the auto- incrementing primary key. I would like to be able to access these objects later in the program using their primary key. What is the best way to get this key out of the database? I can think of two methods to obtain the primary key after adding the object's data to the database:   1. Find the maximum primary key as this was the one most recently added.   2. Delete the current object, compare the data in the database with the data in the program, and then create a new object based on the row that is not contained in the program. Both of these seem error-prone and hacky and I am wondering if there was a more standard way do to this.


Writing arguments in constructors

When creating constructors with multiple arguments, is ok to use the generic `String[] args` or is it better to list the arguments? Does it really make any significant difference as the coding becomes more complicated?               public static void Something (String[] args)      {     }      or               public static void Something (String lots, ... int some, ... etc)      {     }


sell applications that run only on a GPL v2 Server

I have been testing Pentaho BI server community edition, and after reading their licensing terms I found out that the community edition is under GPLv2. As you may know the server is intended to host different types of files and applications (like reports, olap cubes,etc...) My question is : are we allowed to sell applications that run on the GPLv2 server ? (we will maybe modify the server source code a bit but we won't charge it to our clients. thus the modified GPL server will be just an execution environment or a container for the reports and applications that we intend to sell) ? this suggests that our clients must install the GPL v2 edition first and then buy from us the reports that work on it but not their source code. Thanks in advance.


Tomcat + Spring + CI workflow

We're starting our very first project with `Spring` and `java` web stack. This project will be mainly about rewriting quite large ERP/CRM from `Zend Framework` to `Java`. Important factor in my question is that I come from `php` territory, where things (in terms of quality) tend to look different than in `java` world. **Fatcs** :   * there will be 2-3 developers,    * at least one of developers uses Windows, rest uses Linux,   * there is one remote linux-based machine, which should handle test and production instances,   * after struggling with buggy legacy code, we want to introduce good programming and development practices (CI, tests, clean code and so on)   * client: internal, frequent business logic changes,   * scrum, daily deployments What I want to achieve is good workflow on as many development stages as possible (coding -> commiting -> testing -> deploying). The problem is that I've never done this before, so I don't know what are best practices to do this. **What I have so far is:**   1. developers code locally,   2. there is `vagrant` instance on every development machine, managed by `puppet`. It contains the same `linux`, `jenkins` and `tomcat` versions as production machine,   3. while coding, developer deploys to vagrant machine,   4. after local merge to `test` branch, `jenkins` on vagrant handles tests,   5. when everything is fine, developer pushes commits and merges   6. `jenkins` on remote machine pulls commit from `test` branch, runs tests and so on,   7. if everything looks green, `jenkins` deploys to `test` `tomcat` instance   8. Deployment to production is manual (altough it can be done using helping scripts) when business logic is tested by other divisions and everything looks fine to client. **Now, the real question: does above make any sense? Things that I'm not sure about:**   1. Remote machine: won't there be any problems with two (or even three, as jenkins might need one) instances of same app on `tomcat`?   2. Using `vagrant` to develop on `php` environment is just vise. Isn't this overkill while using Tomcat? I mean, is there higher probability that `tomcat` will act the same on every machine?   3. Is there sense of having local `jenkins` on vagrant?


Cost Estimation For Aspect Oriented Programming AOP

There are many estimation techniques, such as counting lines of code, Function Points, Object Points, etc. However, my next project is using Aspect Oriented Programming. Are there any special estimation methods or techniques that can be applied to software developed using this paradigm? Is there something like function points or object points for AOP?


What is the correct way to deal with similar but independent features?

Let's say we have a feature request come in and we begin work on it, which we'll call _feature-1_. It introduces some new logic to the application, which we'll call _logic-A_ and _logic-B_. A programmer branches from the release branch and begins work on the feature. Soon after, we get another feature request, which we'll call _feature-2_. It will implement _logic-A_ and _logic-C_ into the application. The _logic A_ being implemented by this feature is the same _logic-A_ as was implemented in _feature-1_. Let's also say that given _logic-B_ , _logic-A_ might be implemented slightly differently than it would have been given _logic-C_ , and also differently given both _logic-B_ and _logic-C_ (eg. with only one feature, the code would be less flexible than with both). How should this situation be handled? **Concrete Example** (to help with any confusion in my wording)   * _feature-1_ is a feed from programmers.stackexchange.com.   * _feature-2_ is a feed from gaming.stackexchange.com.   * _logic-A_ is the implementation of a feed at all (assuming the application currently has no feeds), which links to the content as well and gives related information.   * _logic-B_ is that the feed's source is from programmers.stackexchange.com.      * Adds to _logic-A_ that the related programming language is displayed.   * _logic-C_ is that the feed's source is from gaming.stackexchange.com.      * Adds to _logic-A_ that the related game's name and box art is displayed.


Alternative to Perl's POD Documentation in Other Languages?

Perl has this really cool documentation method that makes documenting really easy. It's called POD (Plain Old Documentation). Here is an example:               =head1 NAME          Example::Module - an example          =head1 SYNOPSIS              use Example::Module;         my $object = Example::Module->new();         print $object->as_string;          =head1 DESCRIPTION          Just an example.          =head2 Methods          =over 12          =item C<new>          Returns a new My::Module object.          =item C<as_string>          Returns a stringified representation of     the object. This is mainly for debugging     purposes.          =back          =head1 LICENSE          This is released under the Artistic      License. See L<perlartistic>.          =head1 AUTHOR          Dynamic           =head1 SEE ALSO          L<perlpod>          =cut      The output of this would be in HTML, like this example on CPAN (not what I wrote). Cool right! So is there a method similar to POD in which a developer can put there documentation inside of the code itself, without it being a comment?


Create Tickets From TODO (or otherwise annotated) comments

Is there any software that will allow me to generate trouble tickets (for Trac, Team Foundation Server, etc.) from TODO or otherwise annotated comments in the source code?


A defense for boilerplate?

To me, boilerplate code is obviously bad. However I've met a developer who displays resistance in any attempt to reduce boilerplate. I realized I didn't have a readily formed, well thought out argument past the abhorrence I have developed for it over time. So that I can form a convincing argument for favoring less boilerplate, what are some counterarguments? In other words what are the arguments (if any) in favor of boilerplate? (I mean what I think is generally meant by boilerplate, but a good example is getters and setters in Java.)


How can I improve upon this "pattern"?

I have a series of method calls that all share similar qualities. The basic layout is               public void CallDataBase()     {        Utility sqlHelper = new Utility();                StringBuilder query = new StringBuilder(200);        query.Append(@"update " + Environment.NewLine);//or insert, select        query.Append(@" table " + Environment.NewLine);        //...        utility.ConnectAndExecuteNonQuery(query);//or query, scalar       }      I'm not a big fan of the `StringBuilder` in this case, but it does help readability to have line breaks in the inline SQL. Stored Procedures are not an option (way too much work to convert, have higher priorities). LINQ and EF are not options. Company is on SQL 2000 and there are no concrete plans to upgrade.


How can I prevent programmers from capturing data entered by users?

I'm developing a web application with a strong focus on security. What measures can be taken to prevent those who work on the application (programmers, DBAs, quality assurance staff) from capturing user entered values that should be well-protected, such as passwords, social security numbers, and so forth?


How to decide whether to implement an operation as Entity operation vs Service operation in Domain Driven Design?

I am reading Evans's Domain Driven Design. The book says that there are entity and there are services. If I were to implement an operation, how to decide whether I should add it as a method on an entity or do it in a service class? e.g. `myEntity.DoStuff()` or `myService.DoStuffOn(myEntity)`? Does it depend on whether other entities are involved? If it involves other entities, implement as service operation? But entities can have associations and can traverse it from there too right? Does it depend on stateless or not? But service can also access entities' variable, right? Like in do stuff myService.DoStuffOn, it can have code like               if(myEntity.IsX) doSomething();      Which means that it will depend on the state? Or does it depend on complexity? How do you define complex operations?


Command-Query-Separation and multithreading safe interfaces

I like the command query separation pattern (from OOSC / Eiffel - basically you either return a value or you change the state of the class - but not both). This makes reasoning about the class easier and it is easier to write exception safe classes. Now, with multi threading, I run into a major problem: the separation of the query and the command basically invalidates the result from the query as anything can happen between those 2. So my question is: how do you handle command query separation in an multi- threaded environment? * * * Clarification example: A stack with command query separation would have the following methods:   * push (command)   * pop (command - but does not return a value)   * top (query - returns the value)   * empty (query) The problem here is - I can get empty as status, but then I can not rely on top really retrieving an element since between the call of empty and the call of top, the stack might have been emptied. Same goes for pop & top. If I get an item using top, I can not be sure that the item that I pop is the same. This can be solved using external locks - but that's not exactly what I call threadsafe design.


What is the canonical reference on probabilistic data structures?

I've heard of probabilistic data structures like Skip Lists and Bloom Filters being immensely useful and I'd like to learn more about them in general. Is there a canonical reference on the subject on the level of Cormen et al.?


BDD: Getting started

I'm starting with BDD and this is my story:               Feature: Months and days to days         In order to see months and days as days         As a date conversion fan         I need a webpage where users can enter         days and months and convert them to days.      I have some doubts ... Should I write my scenarios before coding anything or should I first write a scenario and then write code, write a scenario again and then write code, and so on ... ? If I should write my scenarios before, can my steps be approved and production code still does not get done? When should I do refactoring on my code? After the feature is done or after each scenario implementation?


Ethics and best practices when forking code base

I have a question as to the proper best practices and ethics revolving forking code. I've taken code base licensed under Creative Commons Attribution- NonCommercial-ShareAlike 3.0 and brought significant changes to it to suit my needs. I feel as though my version could benefit others and wish to redistribute it. I'm unsure what liberties I have for redistribution or what is ethically and morally accepted. Can I rename the projects? Should I start a new v.1 or continue from the original version number? What is considered giving proper attribution to the original author? Should I consult the author and ask permission before releasing (although he is already aware)?


Is it acceptable within the community of developers to copy open-source software and branch it?

Is it generally, to a reasonable developer, considered morally acceptable, to take a branch of an open-source repository, and start making changes to it and calling your own? You would be taking this to another open-source. Assume that you will link to the original. Note that this is a question of what is considered acceptable, _not_ what is legal. If this is okay, where is the line of how much you change that allows you to call it your own?


Migrating from PHP to ASP .NET MVC

I plan on migrating a website from PHP to ASP .NET MVC. However, since the website is large and this migration can't be done in a short time I plan to use both MVC and PHP pages together. So the idea is to replace each PHP page or group of pages with an MVC equivalent. I have to refactor each page and rewrite it overall anyways so I thought I might as well move to the ASP .NET MVC framework for various reasons. The question is, does anyone know what are some of the problems I will face while doing this? Here are some I thought of: \- Logins \- I plan to overcome this with an ajax request to the ASP .NET website on the background and keeping the login information separately for asp .net. \- Sessions \- I'm not sure how I can share sessions or if I will even need to. Other than that, I'm not sure if anything else will arise. Anyone experienced that have a few things to say?


What can I use to generate API documentation with my custom formatting?

I want to automatically generate documentation for a java project, but I'd like to have my own custom styling for it. As an example, take the stackoverflow api (method description page), can that be done by an automated tool? Can it "take me close" to that?   I wouldn't mind having to manually change a few things to achieve the result I want (ie: it doesn't have to be 100% automated)


Are first person comments distracting and unprofessional?

I just found myself writing the following comment in some (archaic Visual Basic 6.0) code I was writing:               If WindowState <> 1 Then         'The form's not minimized, so we can resize it safely         '...     End if      I'm not sure why I subconsciously use "we" in my comments. I suspect it's because I imagine someone stepping through the code, as if they were actually "doing" all of the commands on each line, rather than just watching them happen. With this mindset, I could have used `I can resize it`, since I'm the one "doing" it currently, or `you can resize it`, as if I were speaking to whomever is "doing" it in the future, but since both of those of these cases will most likely happen, I use "we" as if I'm leading someone else through my code. I can simply rewrite it as `it can be resized` and avoid the issue, but it's sparked my curiosity: is it common to use first person like this in comments, or is it considered distracting and/or unprofessional?


How to hire a contract/outsourced architect for

The company I work for has a legacy application that we are looking at rewriting and enhancing using more modern technology. We are a very small company (5 people) and do not have the resources to hire a full time permanent architect so we are looking to hire an architect as a consultant for a short term (about 6 months) engagement to help us design the software and then we will take care of (or use additional staff augmentation) of developing based on the design. We have compiled a list of general high level requirements as well as some other lists of more specific functional requirements. How feasible is what we are trying to do? What kinds of information should we have prepared so that we can provide enough information to potential candidates for them to determine if they will be able to come up with a design for us that we can take over and develop from? What should we ask for from them to base our hire decision on?


Does forcing a user to add numbers or uppercase letters really make a password stronger?

Recently my university updated their password storage procedure, and they have several criteria such as that the password must contain a number, symbol, and uppercase character, and has a length requirement. Realistically, when a brute force / dictionary attack is being performed, doesn't this just make it easier for the person to crack one that works? I understand that this is to prevent people from doing things like "password," but what about one such as "youwillneverguessmypassword" ?


How to keep up with the Rails world?

How should I keep up to date with the ever-changing Rails community? I have been trying to learn Rails off and on for a year now and the brick wall I keep running into is the fact that I'm trying to balance learning most of the Rails' community best practices and they keep changing direction. For example, I obviously need to learn Rails and Ruby (I've done some work with both but I've forgotten a bit). When I was using it before it was still Rails 2.3.4, so now Rails 3 is out and changed some things; I'm not sure if Ruby 1.9 had any major changes. I like my version control, and the Rails world is solidly behind Git, so I have to use Git (again I've used it before but not recently). I want to make sure my app is solid so I want to write tests; the new trend in Rails seems to be to use RSpec or similar BDD frameworks instead of the built-in test framework, and mocks/factories instead of fixtures. I'm having a very hard time keeping up with all the things I need to pick up to be successful using Rails, and it seems that it's always changing and I end up frustrated because I will choose something, then when I research how to do something I find loads of blog posts saying don't use it anymore, use this new thing instead. So I have to ask how much this matters? If I'm going to be revisiting Rails I obviously want to be using Rails 3. I've used Git so I can stick with that. Should I even bother with RSpec/HAML/SASS/whatever else the "cognoscenti" is hyping or should I just focus on mastering the framework and stick with the built-in stuff (e.g. use the built-in ERB engine for HTML, Test::Unit for testing, Fixtures instead of mocks/factories, etc) as much as possible (stupid thing to ask, I know, but the way my brain works I am always torn between doing the easiest thing that will benefit me and doing things the "right" way as the really high-end guys suggest) so I can focus on actually developing my application? Should I extend that to Javascript as well, meaning should I just say screw it and use RJS or is that actually worth using jQuery (I've used jQuery for my .NET work a fair bit although I'm by no means an expert) due to the benefits? I would like to "nail down" a stack that I can use and not deviate but again I find myself constantly wondering "If the top Rails guys are using XXX now am I hurting myself by not switching to it myself?" For example I'd like to just decide 100% on:   * Framework: Rails (obviously) Source   * Control: Git Test Framework:   * Test::Unit w/Factories HTML Engine:   * ERB Javascript Framework: jQuery but whenever I try this there's a voice in the back of my heading saying I'm "doing it wrong" and should be using RSpec/Shoulda/HAML/library du jour instead.


How do you accept arguments in the main.cpp file and reference another file?

I have a basic understanding of programming and I currently learning C++. I'm in the beginning phases of building my own CLI program for ubuntu. However, I have hit a few snags and I was wondering if I could get some clarification. The program I am working on is called "sat" and will be available via command line only. I have the main.cpp. However, my real question is more of a "best practices" for programming/organization. When my program "sat" is invoked I want it to take additional arguments. Here is an example:               > sat task subtask      I'm not sure if the task should be in its own task.cpp file for better organization or if it should be a function in the main.cpp? If the task should be in its own file how do you accept arguments in the main.cpp file and reference the other file? Any thoughts on which method is preferred and reference material to backup the reasoning?


Should you create a class within a method?

I have made a program using Java that is an implementation of this project: http://nifty.stanford.edu/2009/stone-random-art/sml/index.html. Essentially, you create a mathematical expression and, using the pixel coordinate as input, make a picture. After I initially implemented this in serial, I then implemented it in parallel due to the fact that if the picture size is too large or if the mathematical expression is too complex (especially considering the fact that I made the expression recursively), it takes a really long time. During this process, I realized that I needed two classes which implemented the `Runnable` interface as I had to put in parameters for the `run` method, which you aren't allowed to do directly. One of these classes ended up being a medium sized static inner class (not large enough to make an independent class file for it though). The other though, just needed a few parameters to determine some indexes and the size of the for loop that I was making run in parallel - here it is:               class DataConversionRunnable implements Runnable         {             int jj, kk, w;                  DataConversionRunnable(int column, int matrix, int wid)             {                 jj = column;                 kk = matrix;                 w = wid;             }                  public void run()             {                 for(int i = 0; i < w; i++)                     colorvals[kk][jj][i] = (int) ((raw[kk][jj][i] + 1.0) * 255 / 2.0);                 increaseCounter();             }         }      My question is should I make it a static inner class or can I just create it in a method? What is the general programming convention followed in this case?


Design Pattern for Skipping Steps in a Wizard

I'm designing a flexible Wizard system that presents a number of screens to complete a task. Some screens may need to be skipped based on answers to prompts on one or more previous screens. The conditions to skip a given screen need to be editable by a non-technical user via a UI. Multiple conditions need only be combined with `and`. I have an initial design in mind, but it feels inelegant. I wonder if there's a better way to approach this class of problem. **Initial Design** **UI** ![UI Mockup](http://i.stack.imgur.com/biEbk.png) where The first column allows the user to select a question from a previous screen. The second column allows the user to select an operator applicable to the type of question asked. The third column allows the user to enter one or more values depending on the selected operator. **Object Model**               public enum Operations { ... }     public class Condition     {         int QuestionId { get; set; }         Operations Operation { get; set; }         List<object> Parameters { get; private set; }     }          List<Condition> pageSkipConditions;      **Controller Logic**               bool allConditionsTrue = pageSkipConditions.Count > 0;     foreach (Condition c in pageSkipConditions)     {         allConditionsTrue &= Evaluate(previousAnswers, c);     }           // ...          private bool Evaluate(List<Answers> previousAnswers, Condition c)     {         switch (c.Operation)         {             case Operations.StartsWith:                 // logic for this operation             // etc.         }     }


Initializing derived classes in the same way

I have a class Base that has several children, say A, B, C. For testing purposes I'd like to mock those derived classes by deriving from them. So MockA derives from A, MockB derives from B and so on. The problem is, that MockA, MockB, ... all inherit protected members from Base that have to be set in the same way in each mock class. The code looks like this:               MockA::init()     {         x = 1;     // inherited from Base         y = "abc"; // inherited from Base         z = 0.5;   // inherited from Base     }          MockB::init()     {         x = 1;     // inherited from Base         y = "abc"; // inherited from Base         z = 0.5;   // inherited from Base     }      and so on. So my question is, how can I avoid this cut&paste initialization? Can I achieve it without touching Base, A, B, C, ...?


Call a script over the network

I have a Python script on a box that I want to call from a Java server, over the network. I know that I can start a server on the Python side and then connect to it from the Java site, but I am trying to see if there is a way to avoid the overhead of running a server on the Python side. Is there any other way of doing it?


is coding important?

Is coding important to be good at computer science? Should one implement the algorithm to know it well ? I remember one cs professor's idiom that " **I never code"**


Client side authentication through signatures instead of passwords

I want to save some user-generated data with some signature of the user that generated it (let's say that the user has to fill some forms with some data and I want him to sign the written data). The server side is some random server language (that has big enough libraries to cover everything I'll need to do), the client side is Javascript (and the webapp is a SPA, Single Page Application). The client machine can be a cellular (a fairly new smartphone... but still a slow CPU compared to standard desktops/laptops) The DB backend is "insecure". It is possible to tamper the data (many persons have access to the machine, perhaps it's "in the cloud"), but there is and a strong sequential continuous backup where it is very difficult to tamper with the already written data (something similar to a secured sequential log) (perhaps a digest of the log is shipped continuously to a secure server, or the sequential log is kept in another cloud totally separate from the first one, or if it only has to save some hashes, even a random machine can do it). What I want to be able to do is make very difficult for third parties that have read/write access to the DB machine and read access to the server machine to add/modify records created by the user. For the deletion I'll do this: the program doesn't do any real update/delete operation. Every update/delete simply add a new version of the data and marks the old as "old". The hash of all the data is continuously saved on the tamper proof backup. This will even protect me from updates to old data. The only thing it won't protect me is against adding new data through spoofing an existing user. I will use https to secure transmission (with certificates bought from some SSL cert authority). I know I can't really secure the site (as in "the javascripts that will go to the user"), so that this is a weak point (someone could install a keylogger directly in the javascript code). I've watched around but it doesn't seem possible to sign some javascript code, send it to a client and let the client check the signature (probably because the javascript, being a dynamic language, would let a malicious javascript inject himself in the signed code/in a random piece of the javascript base library, so it would be very difficult to firewall everything the pre-existing environment). I could check the signature from the server side (the server program is signed and sends only javascripts that are signed). I don't want to use client-side SSL certificates because they are difficult to use for the user (if the user changes computer he has to reinstall the certificate, if the user forgets he has a certificate in a computer it's possible to steal it...) The solution I thought was to use ECDsa, generate a public/private keypair from the user password (plus some other data) and then the client signs the user's data client-side. The public/private key generation happens client side. When the user is created and the password is chosen, the client generates the public/private keypair and tells the server the generated public key. The user only needs to remember its password. Clearly the weak point of this is that someone could add a new public key of the user on the server and sign something with the new public key, but it would be quite easy to spot this, because there would be a new public key. Something more clever would be to change an old public key and then resign everything the user signed with that new key, so it would be impossible to show if the data was tampered, but for this there is the tamper-proof log. Another weak point would be from the user side: someone could install a keylogger and steal the password, but this is a problem of all the "standard" password schemes (for this I'll add a TOTP authentication, see at the end) Password recovery would be handled "manually" (a super-user would have to confirm the identity of the user and then sign the change of the password with the super-user's key) Now let's make it a little more complex: the private key is generated from the PBKDF2 of a salt unique for each user (sent by the server) plus the user's password. Sadly to make the software compatible with cell phones I will need to keep the iterations of PBKDF2 low (mmmh... On my old Optimus W, 1000 iterations require 8 seconds, while with the S3 it's nearly instantaneous... But 1000 iterations isn't very strong) (perhaps I could use Scrypt instead of PBKDF2... It should be more resistant to GPU attacks) So in the end it would be: User inserts username and password and press a button. The client asks the server for the salt, for the number of iterations of the hashing function and for the time of the day (this to stop attacks based on reusing the same signature), then calculates the hash of the password by using PBKDF2/Scrypt, regenerates the ECC private key, signs the message (that contains the operation requested and the time of the day received by the server) and sends the signature. The server must remember what challenges he has given and what have been replied (and so are "exhausted"). After this I could add a two step verification (using the algorithm used by Google Authenticator, for example). The key of this would be shared between user and server. The one-time password could be inserted in the various messages signed by the client. The server could save the calculated time of the TOTP so that it would be easy to verify at a later time. So the question is: is everything ok? Is there a pre-made solution that does everything? Is there an hole in my reasoning?


A job in big company like IBM/Microsoft vs. own small 1-2 people software company?

I hope all programmers have gone through the stage at I am. I'm an iPhone and mobile apps developer and currently working in a company which is 1 of the best in my city. Now I am at a stage where I've two options. The first is with a big company like IBM or the second is with my own small company in which one of my friends and I will be starting. You might be wondering why am I asking this question instead of trying my own company but I know that once getting myself into a business going back to a job after closing a business would be a painful condition for me. What's your preference? What advice can you suggest?


One or many RESTful APIs for large company?

I work for a large company which has several non-RESTful APIs. I am tasked with building a web application to interact with these APIs. Each API handles and provides very different business processes and data. I'd like to build RESTful (a) interface(s) fronting the APIs so as to make them reusable by other future web applications. Then, I'd like JavaScript to interact with the RESTful interface(s). Should I build one RESTful API (one subdomain) for my entire company               http://api.mycompany.com         /business_process_1/resource/         /business_process_2/resource         /business_process_3/resource      and make it front the very different business processes and data? Or, should I build multiple APIs (multiple subdomains)?               http://business-process-1.mycompany.com     http://business-process-2.mycompany.com     http://business-process-3.mycompany.com


ASP.NET MVC: Getting User input in your Controller?

I wanted to get your opinion on best practices for getting user input while doing something in a controller. I am inside a Action method in my controller and I am processing some data. The data may force me to ask the user for further input, based on that input I will then do something with that data. What is the best practice to go about this? 1) How do I issue an alert or confirm box to get user input from the Controller? This Action is initiated by an update button on a Telerik MVC grid. 2) How do I persist my data from initially processing it, to asking the user for input, and then continue processing the data? It's a fair amount of data. If the initial request was started from a ajax call in a javascript function, I think I would know how to do this. I would probably have the Action method pass back a JSON object back to the javascript method that would in turn ask the user and then decide which controller action to call and then pass this json object to it. Am I on the right track here? If so, my problem would be with the Telerik MVC grid. I would need the update event of my grid to be bound client side. Any help or thoughts on this is appreciated. Steve


Why is Software Engineering not the typical major for future software developers?

While most agree that a certain level of Computer Science is essential to being a good programmer, it seems to me that the principles of good software development is even more important, though not as fundamental. Just like mechanical engineers take physics classes, but far more engineering classes, I would expect, now that software is over a half century old, that software development would begin to dominate the undergraduate curriculum. But I don't see much evidence of this. Is there a reason that Software Engineering hasn't taken hold as an academic discipline?


How would you like to be coached?

My boss is going through a certification process reggarding "Coaching", and he asked me if he could coach me. According to what I understood from him, I should have an objective on what should I be coached at and some initial questions from where the coaching process would stem from. As a software developer who likes to embrace new technologies and has lately been specially enjoying the "requirements negotiation" part of the work, I have no idea on what could I be coached or what kind of questions could I bring him. Maybe you guys here would have nice ideas?


What do I tell my colleagues when they complain that our Rails-based website has an API but is not a Web Service?

People want SOAP or a WDSL. I've just got a defined API. What's wrong with that?


Is it appropriate to ask for reasons after rejected after the interview?

I thought I did okay in the interviews but apparently the interviewers didn't think so. Is it appropriate to ask for a reason after I have received the rejection email? After all I don't want to annoy the HR person. I am a student, so not so much job hunting experience so far. Bear with me if this question sounds stupid.


I have to do an economic viability analysis for an iPhone app and I do not know if you could help me in some questions like link text:   * How can I estimating an iPhone application development costs?   * Cost per hour of a programmer?   * Time that 1 programmer takes in doing an app similar to “Spend Free - Personal Budgeting” link text supposing that it has experience in Java but is rookie in the world of development of aplicaiones for iPhone (neither Objective-C nor Cocoa Touch knows …)   * Time in integration testing?   * Return on investment (ROI)? Where can I find information?


Do Ruby (and other dynamic language) programmers use IoC / Dependency Injection?

I'm primarily an ASP.NET developer and the single thing i've been introduced to in recent years that has had the most dramatic impact on the quality of the code I write has learning how to use IoC containers to manage dependencies between different layers of the application efficiently. I've recently made it my hobby to learn Ruby (and Rails) for personal projects, and I love the language so far. However, one of the things i've noticed from the various tutorials and references i've been using, has been that there has been no mention yet of using IoC. This is in stark contrast to .NET where it is (and where it isn't, should be) drummed into developers at an early stage. I appreciate that one reason why dependency injection may not be necessary in Ruby, is that everything in a class is public and virtual so open to modification so it's not really needed in order to write good unit tests. But there are of course many other benefits to using IoC containers such as the decoupling options this brings, managing object creation and lifetime etc. Is dependency injection used in Ruby? If not, why is this not an issue?


Why is SIT called SIT when it serves for system testing?

I should define a testing strategy and environments and I have encountered rather terminology issue (but might well be my fault) so I hope someone will correct me here. We are using INT environment where the application is deployed at first and then SIT environment, where is the app passed if it is fine on INT. So, testers do all system tests on SIT. But according to all definitons, SIT is system integration testing which is done after the system tests and validates cooperation of more systems. So why SIT serves actually for system testing, yet it is said to be a phase which actually follows the system testing? EDIT: According to common knowledge-books:   1. Unit   2. Integration (modules to larger pieces)   3. System test   4. ().. System Integration Test --if there are more system to integrate Our apps consist of db, services, frontend. So to make a system test, they must be integrated, otherwise testers cannot do anything. So SIT precedes actual system testing (both funtional and non functional) which does not match with described processes. And environment for testers is also called SIT..


Class diagrams - do aggregated/composed classes automatically see each other?

Let's say that in the game, a player has a pet: Player<>------Pet Obviously player can access Pet's fields and methods, but I assume Pet does not know about the player? I need that Pet can access the player as well, how should I model that?


Deleting Lookup Item

I was wonder what people do in this situation. You have an admin area of a system where you let users define a list of values they want to see in a dropdowns across the system. What do you do in your application is a user wants to delete this option? What do you do with data records which already use this value?


How to see bits of an integer in Visual Studio

As far as I know it is not possible to see the bits of an integer in Visual Studio, you can see variables in decimal or hexadecimal format in the Locals and Watch windows in the debugger. Why is this limitation in place and are there any tools/addins to see integers as bits?


Data aggregation like polyvore.com

I'm creating a website that is going to aggregate women shoes from across the web into one website. Kinda like polyvore.com does with all their products but mine is only going to be shoes. Which makes my job a lot easier but I'm still lost as to how I go about getting all the data. I have access to 3 APIs so far. Which provide over 15000 line items so far but there are 1000's of sites out there and millions of products. What is the best method to aggregate all this data? Is it even possible? Or should I rely on a social aspect as well, like polyvore where users can upload any products that aren't on the website? Also, do I have to resort to screen scraping? And is this possible as a one man show? Polyvore has a team of 30 programmers, do I need a team to do this properly?


What is the most frequently used design pattern?

Which design pattern do you think is the most popular?


What are your experiences with off-shore or outsourced testing?

**Has anyone had experience** with out-sourced testing? Is it worth the fairly high premium you have to pay? Can you simply hire some _off-shore_ 'mechanical turks' (who offer the same services, but a lot cheaper) with a testing script as a cheaper alternative to professional software testing services?


Is SugarCRM really adequate for custom development (or adequate at all)?

Have you used SugarCRM for custom development successfully?, if so, have you done it programmatically or through the Module Builder? Were you successful? If not, why? I used SugarCRM for a project about two years ago, I ran into errors from the very installation, having to hack the actual installation file to deploy the software in the server and other erros that I can't recall now. Two years after, I'm picking it up for a project once again. I'm feeling like I should have developed the whole thing from scratch myself. Some examples:   * I couldn't install it in the server (again).  I had to install it locally, then copy the files and database over to the server and manually edit the config file.   * Constantly getting deployment errors from the module builder.  One reason is SugarCRM keeps creating a record in the upgrade_history table for a file that does not exist, I keep deleting such record and it keeps coming back corrupt. I get other deployment errors, but have not figured them out. then I have to rollback all files and database to try again.   * I deleted a custom module with relationships, the relationships stayed in the other modules and cannot be deleted anymore, PHP warnings all over the place.   * Quick create for custom modules does not appear, hack needed.   * Its whole cache directory is a joke, permanent data/files are stored there.   * The module builder interface disappears required fields.   * Edit the wrong thing, module builder won't deploy again, then pray Quick Repair and/or Rebuild Relationships do the trick. My impression of SugarCRM now is that, regardless of its pretty exterior and apparent functionality, it is a very low quality piece of software. This even scared me more: http://amplicate.com/hate/sugarcrm; a quote: > I wis this info had been available when I tried to implement it 2 years > ago... I searched high and low and the only info I found was positive. Yes, > it's a piece of crap. The community edition was full of bugs... nothing > worked. Essentially I got fired for implementing it. I'm glad though, > because now I work for myself, am much happier and make more money... so, I > should really thank SugarCRM for sucking so much I guess! I figured that perhaps some of you have had similar experiences, and have either sticked with SugarCRM or moved on to another solution. I'm very interested in knowing what your resolutions were -or your current situations are- to make up my own mind, since the project I'm working on is long term and I'm feeling SugarCRM will be more an obstacle than an aid. After further failed attempts to continue using this software I continued to stumble upon dead-ends when using the module editor, I could only recover from this errors by using version control. We are now moving on to a custom implementation using Symfony; perhaps if we were using it with its out-of-the- box modules we would have sticked with it.


Is php|architect any good?

Kind of a hard topic to search for, as architect turns up a lot about software architects instead. After 8 months of PHP self-study, I finally stumbled across the php|architect site. The length of time it took me to find it makes me suspicious of its quality. 3 related questions:   * do professional PHP coders read/care about php|architect?   * is it a good source for PHP beginners?   * assuming yes to either of the above, how far back in the archives to articles remain relevant? (ex: does stuff written about PHP4 still matter?)


"C++ Templates: The Complete Guide" (c) 2002 -- up to date with C++11?

The book _C++ Templates: The Complete Guide_ , (c) 2002, looks very appealing to me, but as it's 12 years old, I'm concerned it may be out of date. There are some highly favorable Amazon reviews dated as recently as a year ago, and I don't see any other very recent titles on C++ templates. Does anyone know whether a book about templates published in 2002 (as opposed to a book specifically about the STL) would have syntax or concepts that have been superseded or added to by, say, C++11? The following is from the Amazon book description: > Templates are among the most powerful features of C++, but they are too > often neglected, misunderstood, and misused. C++ Templates: The Complete > Guide provides software architects and engineers with a clear understanding > of why, when, and how to use templates to build and maintain cleaner, > faster, and smarter software more efficiently. > > C++ Templates begins with an insightful tutorial on basic concepts and > language features. The remainder of the book serves as a comprehensive > reference, focusing first on language details, then on a wide range of > coding techniques, and finally on advanced applications for templates. > Examples used throughout the book illustrate abstract concepts and > demonstrate best practices. > > Readers learn > >   * The exact behaviors of templates >   * How to avoid the pitfalls associated with templates >   * Idioms and techniques, from the basic to the previously undocumented >   * How to reuse source code without threatening performance or safety >   * How to increase the efficiency of C++ programs >   * How to produce more flexible and maintainable software >


UDP segments that are lost

i know that UDP does not care about segment (packet) order and their arrival on the destination. then how on earth are we able to stream videos?   * if a segment is lost (doesn't reach the destination), destination has no idea about it. so, it can't ask the target to retransmit it.   * if a segment arrives out of the order, should't the video being streamed be distorted? since the whole segment order is wrong now, because of that one segment is not on its place.


If another team haven't done a requested task, are we supposed to mention it in every Daily Scrum as an Impediment until they do?

Is it really necessary to mention the same impediment (blocking issue) in every daily standup, if the whole Scrum team already know about it because it's been mentioned at previous daily standups?


Interface naming: prefix 'Can-' vs suffix '-Able'

It's common to use '-able' as a suffix for interfaces e.g. Serializable Printable Enumerable Drinkable Shootable Rotatable I was thinking that 'Can-' might better because it may be more descriptive. Yes, it is more wordy and it adds noise to the interface name. In particular, passive verbs can be used. _E.g. 1_ does Shootable mean that the object is able to shoot (a gun might implement this), or does it means that it can be shot at (a target board might implement this). With the 'Can-' prefix, the former would be "CanShoot" and the latter would be "CanBeShotAt" or "CanShootAt". _E.g. 2_ A document 'CanBePrinted' and a printer 'CanPrint' Or, should we stick with '-Able' and _let the documentation provide the context?_ Any opinions.


How to elegantly work with a lot of print functions?

I'm working on a Python project that is executed on a terminal (or console) for which I am planning to implement a GUI. I did not major in CS so I really have no idea how to effectively design a terminal GUI such that:   1. the user interface looks good   2. in GUI, it is directed to a certain widget, let's say, a text label, or a bottom bar, or a hide-able frame. Do you have any suggestions? Currently, I am using the `print` function to provide essential information on `STDOUT` during execution, so a lot of `print` calls are distributed here and there in the code. I'm thinking of using macro-like variables such as 'FILE_NOT_EXISTS_MESSAGE' for printing, and all of them and their values would be defined in one file. Is that a standard way to do this? Should I introduce a logging system? In summary, I'm looking for a pattern for handling console output that is effective and adaptable.


When accessing/manipulating complex data, is it better to store it in many small pieces or one large chunk?

I am building a web app that manipulates fairly complex data: guitar tabs.                   As a reference, guitar tabs look like this:     Eb|-------------------------------------------------------------------------|     Bb|-------------------------------------------------------------------------|     Gb|--5-5-5-5----------------------------------------------------------------|     Db|--5-5-5-5--3-3-3-3--7-7-7-7--5-5-5-5--2-2-2-2--3-3-3-3--2-2-2-2--5-5-5-5-|     Ab|--3-3-3-3--3-3-3-3--7-7-7-7--5-5-5-5--2-2-2-2--3-3-3-3--2-2-2-2--5-5-5-5-|     Eb|-----------1-1-1-1--5-5-5-5--3-3-3-3--0-0-0-0--1-1-1-1--0-0-0-0--3-3-3-3-|      Would it be more efficient for performance to store this data as a large chunk, or to break it up and store it on a "note by note" basis?               As a use case:     User changes first chord from:       to:                              Eb|---   Eb|---                              Bb|---   Bb|---                              Gb|--5   Gb|--4                              Db|--5   Db|--4                              Ab|--3   Ab|--2                              Eb|---   Eb|---      If I store it as a block, the code to manipulate the tabs would have to be much more complex. If I store it note by note, the database will have to be accessed a lot more. **Which method is more efficient?** Potentially, a lot of users will be modifying the data. I want the **best performing web app.** I will be using MySQL if that affects the answer at all.


How do you answer "explain current architecture of your project" question in interviews?

The application which I am working on currently is a bit huge. It cannot be explained in 15 minutes or so. Last time I ended up drawing some class diagrams and how they are linked, but I could see that the interviewer was not happy with the answer. What are the main things that should be highlighted when answering this question? For example, how session is managed, how persistence is achieved are few things. What are other things, which should not be missed?


How to optimize Cartesian product

Is there a better way to compute cartesian product. Since cartesian product is a special case that differs on each case. I think, I need to explain what I need to achieve and why I end up doing cartesian product. Please help me if cartesian product is the only solution for my problem. If so, how to improve the performance. ## Background: We are trying to help customers to buy products cheaper. Let say customer ordered 5 products (prod1, prod2, prod3, prod4, prod5). Each ordered product has been offered by different vendors. ## Representation Format1: Vendor1 - offers prod1, prod2, prod4 vendor2 - offers prod1, prod5 vendor3 - offers prod1, prod2, prod5 vendor4 - offers prod1 vendor5 - offers prod2 vendor6 - offers prod3, prod4 In other words ## Representation Format2: Prod1 - offered by vendor1, vendor2, vendor3, vendor4 Prod2 - offered by vendor5, vendor3, vendor1 prod3 - offered by vendor6 prod4 - offered by vendor1, vendor6 prod5 - offered by vendor3, vendor2 Now to choose the best vendor based on the price. We can sort the products by price and take the first one. In that case we choose prod1 from vendor1 prod2 from vendor5 prod3 from vendor6 prod4 from vendor1 prod5 from vendor3 ## Complexity: since we chose 4 unique vendors, we need to pay 4 shipping price. Also each vendor has a minimum purchase order. If we don't meet then we end up paying that charge as well. In order to choose the best combination of product. We have to do cartesian product of offered products to compute the total price.               total price computation algorithm:          foreach unique vendor      if(sum(product price offered by specific vendor * quantity)<minimum purchase order limit specified by specific vendor)     totalprice +=sum(product price * quantity) + minimum purchase charge + shipping price     else     totalprice +=sum(product price * quantity) + shipping price     end foreach      In our case {vendor1, vendor2, vendor3, vendor4} {vendor1, vendor3, vendor5} {vendor6} {vendor1, vendor6} {vendor2, vendor3} 4 * 3 * 1 * 2 * 2 = 48 combination needs to be computed to find the best combination. {vendor1,vendor1, vendor6, vendor1, vendor2}=totalprice1, {vendor1, vendor3, vendor6, vendor1, vendor2}=totalprice2, . . {vendor4, vendor5, vendor6, vendor6, vendor3}=totalprice48 Now sort the computed totalprice to find the best combination. ## Actual Problem: If customer order's more than 15 products.Lets assume, each product has been offered by 8 unique vendor then we end up computing 8^15=35184372088832 combination. Which takes more than couple of hours. If customer order's more than 20 products then it takes more than couple of days. Is there a solution to approach this problem in a different angle?


Memoization, Caching, Buffering and Page Filing?

I'm writing something on how iterative Fibonacci is substantially better than recursive Fibonacci - a few lines. The main reason of this I find, as do many prominent researchers I believe, is that you don't recalculate values - space vs time. From this I thought **ah ha!** caching! But I'm not sure if it is caching, memoization, buffering or one of the others. I personally think buffering to be the preloading of material before something is done with it vs caching and memorization being more of a processing based thing. The buffering notion is that I get from such a _buffering_ a picture or a video. What is the difference between buffering, memoization, caching and page filing?


Is there any "Set" database?

Is there any "set" database? For example Neo4j is a "graph" database. What I'm looking for is database which can be used to organize "items" into "sets" and then be able to query them with set operations. For example "items that are in set A and B but not in set C". Or which one of current databases can efficiently do this data modeling? Sets are not limited, they can be added/edited/removed as data, just like items or like links in a graph database. For example making a new set called D or Set2347 and add some item in it. An example would be pages liked by users, where each page is a "set" which is liked by users as "items" it contained. To clarify my question I would better quote Karl Bielefeldt comment: > The question isn't whether it's possible to use a relational database for > this use case. Obviously it is. It's possible to use a relational database > for a graph, but we have graph databases anyway which make working with > graphs a lot easier. Asking if something similar exists for sets is not an > unreasonable or unclear question, even if the answer happens to be no. Maybe > people have some good ways to make working with sets on relational databases > easier.


How to slow down your computer (for testing purposes)?

As most people agree, encouraging developers to make fast code by giving them slow machines is not a good idea. But there's a point in that question. My dev machine is fast, and so I occasionally write code that's disturbingly inefficient, but that only becomes apparent when running it on other people's machines. What are some good ways to temporarily slow down a turbocharged dev machine? The notion of "speed" includes several factors, for example:   * CPU clock frequency.   * Amount of CPU cores.   * Amount of memory and processor cache.   * Speed of various buses.   * Disk I/O.   * GPU.   * etc.


Problem and Requirements Definition

I was recently hired to redesign a management system from scratch. This is my first business-scale project. I have assisted with business applications in the past, but I am the only one dedicated to redesigning and programming the system with the assistance of a company employee. This employee built the previous version of the management system. We all agree that we want this done, and done right. I am willing to put in the time upfront to define the problem and requirements so I do not have to reap bad seeds during testing. At the moment, I am trying to capture the problem and gather the requirements for this management system. What questions should I ask this employee to be able to move forward with some documentation? I realize these requirements can change constantly, but I would like a starting point to work with. Here are a few questions I have come up with: > What is the purpose of the management system?   >  What is the problem we are trying to solve?   >  What will be the features of this system?   >  Who will be using the system? (Employees? Outside Entities?)   >  What are the means of security for this system? (Can an outside entity see > what an employee can see? etc.)


Using Map in Java (or other strongly-typed languages) to work with unstructured data

After looking at the core data type for frameworks that deal with unstructured data in java:   * json java library: JsonObject   * Mongodb java api: BasicBSONObject   * SolrJ (Solr java client): SolrDocument the common theme seems to be that data are first de-serialized into Map, then transformed into an given class by reflection.   So this raises the question, why not just work with these Map (or sub-type of map) directly? You can extend Map and create your own sub-type, and you will still have all the benefit of OO programming. **Edit** I am not concerned with the cost of deserialization, but the flexibility that Map offers when dealing with unstructured data. By this, I mean not having to define a class that the data can be deserialized into.   **Edit 2** I am more interested in the "why not (disadvantages)", since the framework I mentioned already demonstrated that it could be done.


Starting to be a team leader

After half a year working for the company, I got two students to be leader for. So, I got some technical management responsibility. As I think, I should be not just a leader, but a teacher and the one who is example. What are common steps to educate junior developers? How to be not just a boss, who gives the task, but a 'senior fellow'? Is it appropriate to give some advices which are not properly related to coding(for example, human interaction and so on). I want to be a good leader for them, but don't have any experience in that and don't know what to begin from. Thanks.


Client wants to resell the app I programmed

Not sure if this is the right forum. If it's not, please let me know and I'll move it. So I have been asked by a client to develop a RoR Web App for them. He asked me if the development is their property. I said yes, you can request the source code and database migrations anytime. Then he says "I'm asking you this, because we plan to resell the app to other branches. That's why I'm asking you if the development is ours and we have rights to resell it." So I'm thinking they do. I mean, they paid me to program for them. Is there a recommendation from any of you more experienced programmers? I'm thinking about of course, telling him he has the right to resell it, and I could help him deploying the app in more servers and cut him a web hosting deal so I can also benefit from my app being resold. What do you guys think?


Why shouldn't you develop on production database?

I need help with organizing my arguments for why it's MADNESS to develop against production data. **Backstory:** I started working here six months ago and I noticed we're developing directly against production data. The codebase is local, but the database we're connected to is live data! So i have to be super careful constantly when doing update/store operations, so that I don't break anything. We have an annual software meeting soon and I want to raise my concerns, and come loaded with arguments but I have a really hard time coming up with good solid points to something that's should be obvious as this. It's as if they would ask me to come up with arguments to why I need to breathe. **My Question:** What arguments are there for NOT developing on production database directly?


Safely fixing production database data

Bugs happen and sometimes data has to be fixed in production. What is the safest way to go about this from a big company standpoint? Are there tools that can help? Here are some considerations driving this requirement...   1. We need to log who ran the query and what they ran   2. Ideally we need to give the person access to only run queries against the tables of interest and only for a short time   3. Whatever is running the queries needs to have some smarts about it to not allow long running and locking SQL to run without explicit permission   4. This process needs to be DB agnostic or at least understand DB2, Oracle, and SQL Server. We are trying to reduce the risk of ad-hoc prod fix-up queries from doing the "wrong thing" and at the same time add some security/audtis to the process. Thoughts or Ideas?


How do you deal with clients asking for manual data edits in the database?

I've recently started working on a legacy application that frankly doesn't do all that it should. It's lacking a lot of features, has barely any administration capacities and doesn't check half the data it should. As such, it's very easy for users to do something stupid and get stuck. _"Oops, I added this item of the wrong type to this thingie and now it won't let me remove it"_. Indeed, the application should have checked for this, but allowed adding the wrong item. And now, when it comes to deleting the wrong item, it becomes extremely protective and refuses that anything be removed. Problem is, the clients (who are actually users within the company) don't care much for that. They need the application to hold the real-world data as it should be, so they ask the developers to "fix it" by changing the data. In this example, deleting the wrong item. In other cases, it will be reassigning items to different parents, fixing various values, etc... Since the application has almost no admin GUI, everything ends up being done directly in the database (augh!), risking even more issues down-the-line unless you know _exactly_ how it works (which no one really does considering the massive application). Ultimately, it feels like the database has become a huge Excel file that devs edit day by day at the whims of the clients, because of failures of the application. It's obvious to me that fixing the application to avoid such situations should be top priority, but it seems the clients prefer asking for a lot of new features instead and it's accepted as such. What can a developer do in such a situation? Is it even possible to refuse DB edits in favor of fixing things? There are so many bugs that it feels like they're never going to wait _that_ long...


How many ALU additions are needed to add three numbers?

Please give reasons for your answer. As I found, two additions are needed. This is because every number to be add needs to changed to binary. Then addition is done between two binary numbers where the XOR gate is used for addition. When a carry bit is required an AND gate is involved to add the carry bit to the next line. Therefore if more than 3 binary numbers are added together there can be more than one carry bit and the AND gate doesn't support that. Am I right or I am confusing everything and nothing make sense? Thank you for your time.


Reading/resources for improving architect and senior engineer skills

I am working on improving my architect / senior engineer skills. In particular, I want to focus on "getting lost in the weeds" - spending a lot of time on a problem while a better solution could have been achieved and "not seeing the forest for the trees" - missing the big picture and only providing part of the functionality - issues. What is some recommended reading/source material that can help me along?


Java Swing ActionListener design

I have a form that includes an area for putting in address information and a table that shows the addresses that have been added. I've separated out the ActionListener for the "add address" button on the form into it's own top level class and I'm finding it tricky and cumbersome to refer back to the form that has the text boxes and the table. From a design perspective, is it a bad idea to put the class that implements the ActionListener for the add address button as an inner class in the form class? The ActionListener class will be specifically tied to the parent form alone, so I'm figuring that an inner class might be the better route to go. I'm going to perform any business logic outside of the form class, of course...


Advice for transitioning into a Java developer position from doing other types of web development?

I've been doing web programming and currently work at a company working with mainly PHP and Javascript. For a little while now I've been becoming more and more frustrated with the shortcomings of this type of development and want to move to a company with a more defined development process that values doing things the "right way" such as using Unit tests, dependency injection / IoC, etc. I've been learning JEE / Java as much as I can on my own time but would really like to make a switch to doing this as my career and leave behind the PHP world altogether. I'm just wondering if anyone can give me advice on which things to put my main focus on right now to make myself marketable as an entry level Java developer? Basically, I feel that I'm not really learning anything new at my current job that will benefit me and its only making me more and more frustrated so I figure if there is any way to position myself for a transition I would rather do it sooner than later.


Creating a text input simplifaction tool

I have been working on a project for several months now to write a web-based tool that will help me at work. I work at a call center and the CRM software that is used is wretched, we basically have to input all of our information into notepad templates and then paste it in to a description box. My initial goal was to create a web-interface for the templates so that I didn't have to use notepad anymore. I was just going to write it with HTML5/CSS/JS, both as a learning experience and, if I was fortunate enough, an opportunity for advancement. As I worked on coding this tool I continuously found myself changing the foundation of the project, attempting to integrate more functionality in my tool. It has gotten to the point where I want the tool to be used alongside the CRM software for every call I receive. I want to be able to simply copy the customer's information off of CRM (simply with Ctrl + A/Ctrl + C), then be able to paste the block of jumbled text into a text box. The program will then pick out the customer's info by looking for keywords in specific positions to fill out a user selected template. The rest of the information is input manually and then the output is generated with the push of a button. The information will also be parsed into a backup text file. The text file will be created automatically based on the date. If the text file for the current date exists, it will simply concatenate the info. As I wrote my code I found myself getting distracted looking at different coding languages and possibilities. I kept looking back at what I had completed and I was disappointed, I've started over from scratch two times now. Now for the actual question: I am thinking of starting over, writing my program with AngularJS. I like the idea of a smooth, single page, app-like interface, but I'm scared of hitting more barriers and starting over using something else. Based on my description of how I want my program to run, can anyone suggest how to go about implementing this? Should I look into a different language, or is JS really the way to go these days? I just discovered Dart and am intrigued, but the idea of learning yet another language is discouraging instead of exciting. I feel like I'm missing a pretty big point. I hope this question is appropriate for this forum. I feel a bit lost with StackExchange, and the last thing I want to do is receive negative attention for a bad post. I'm just feeling a bit lost when it comes to this project, and perhaps even programming in general. Regardless, any feedback will be appreciated. Even direction to a forum for emotionally distraught fledgeling programmers would be a welcome answer. >.< Thank you.


Unit testing side effect-heavy code

I'm starting to write C++ code to run a robot, and I don't know how to incorporate unit testing, if indeed I can. I have been provided with a library which allows the creation of "commands" for the robot, which are automatically scheduled and executed. The mechanism to create these commands is to subclass a command base class they provide, and implement virtual `void Initialize()`, `void Execute()`, and `void End()` methods. These functions are run purely for their side effects, which do things to the robot (run motors, extend pistons, etc.). Because of this, I don't really see anywhere to attach unit tests to the code, short of mocking the entire library so that I can check the virtual before and after states of the robot. Is there a way to unit test this that isn't overly burdensome? ## Edit I think I may have been misleading about the functionality of the library. The library provides most of the interface to the robot as well as the command/scheduling system, so it's not as simple as mocking the command base class, I'd have to mock the entire interface to the hardware. I unfortunately just don't have the time to do that.


What's a typical team size using a Git repo?

We've been using Git as our version control but as the team grows, there are more and more pains when it comes to getting all our changes onto a single branch ready for a deployment. I'm wondering if maybe we're outgrowing Git as an effective collaboration tool. I know there are large OSS projects with many developers that use Git but there also tend to be some gatekeepers responsible for the merging of branches into the final build/deployment branch. In an office environment, where the developers are relatively independent and can be trusted to merge their own changes, how many people can effectively collaborate on Git? Additionally, are there any tips for effective use of Git? We've been using the rebase workflow, I'm not entirely convinced switching to a merge based workflow would improve the situation but then, I haven't seen a formal description of how a large group would work together in a merge workflow (It seems like the history would just turn into merge hell). Addendum: So that it's easy to find for anyone else wondering:   * We're using a feature branch strategy   * The code base is well organized and pretty clean. It's Python (with some HTML/JS), MVC via pyramid for the web app, separate package (different top level folder in same repo, itself split up into well defined layers) for a large chunk of the non-web specific application functionality.   * We experience pain as far as merging code because developers are frequently making changes in the same files, like, one dev owns auth, so they're touching the views, etc... related to auth, but another dev is handling internationalization, so they're touching all the views, etc.


What are good ways of balancing informative exceptions and clean code?

With our public SDK, we tend to want to give very informative messages about why an exception occurs. For example:               if (interfaceInstance == null)     {          string errMsg = string.Format(               "Construction of Action Argument: {0}, via the empty constructor worked, but type: {1} could not be cast to type {2}.",               ParameterInfo.Name,               ParameterInfo.ParameterType,               typeof(IParameter)         );              throw new InvalidOperationException(errMsg);     }      However, this tends to clutter up the flow of the code, as it tends to put a lot of focus on error messages rather than what the code is doing. A colleague started refactoring some of the exception throwing to something like this:               if (interfaceInstance == null)         throw EmptyConstructor();          ...          private Exception EmptyConstructor()     {         string errMsg = string.Format(               "Construction of Action Argument: {0}, via the empty constructor worked, but type: {1} could not be cast to type {2}.",               ParameterInfo.Name,               ParameterInfo.ParameterType,               typeof(IParameter)         );              return new InvalidOperationException(errMsg);     }      Which makes the code logic easier to understand, but adds a lot of extra methods to do error handling. What are other ways to avoid the "long-exception-messages clutter logic" problem? I'm primarily asking about idiomatic C#/.NET, but how other languages manage it are helpful as well. **[Edit]** It would be nice to have the pros and cons of each approach as well.


What could be the use of forking a repository in a github's organization?

I'm trying to figure it out some nice workflow for our company, and we have so far the main repository on the github's organization account and we all, the members of the team working on the branches of that repo. Could you please mention some advantages on forking the repo or some use, by the members of the organization? I was thinking, that for example, I could make a fork and perform a upgrade of the libraries, but someone pointed that, "what is the differences on doing it simply in another branch,without forking? Thank you in advance, for your time.