title: Sharing ideas without risk of leaking

text: As freelancers, we meet somewhere and chat about a new idea for a project, brainstorm etc. Up to this point, we have taken notes of the ideas, but we would like to be able to share more efficiently the ideas with each other. However, I fear that if I use some online product (such as Google Docs) these ideas could be seen by people outside the team (employees of the company of the online product, other users...). I am not sure if I am being a little _Paranoid parrot_... One solution that we have considered is to install a Subversion with just one _ideas.txt_. But that would require a server in one of our houses, which is a little unconfortable. So how do you share your ideas for a new project with your team without risking the ideas to be _stolen_?


title: Cucumber Web Interface for business

text: I am trying to find a way to make the projects I work on more transparent to the business size, even though backend programming is not quite visible all the time. So in order to this I want to try ATDD and building acceptance tests with `Cucumber`. Is there a friendly way to show these tests to the business - I still think that running them from the command line is as cryptic as things were until now ? I am thinking of a web interface or something like that.


title: Is it good style to check explicitly for null in unit tests?

text: Whether or not a value is `null` could be checked implicitly like this:               assertThat(value).isEqualTo("something");      Or it could be checked explicitly:               assertThat(value).isNotNull();     assertThat(value).isEqualTo("something");      The latter makes the expectations a bit more clear, but it blows up the test code. Is there a good reason to prefer the second approach over the first?


title: Hungarian Notations/Systems Hungarian Should I?

text: I was wondering would it be worth using a form of standard such as Hungarian Notation/Systems Hungarian? Why would I bother if everything I'm doing now is working fine?


title: Is it worth making Visual Assembly?

text: We already have:   * Visual Basic   * Visual C++   * Visual C# Why there is no Visual Assembly? Is it worth making it?


title: Is it sane to use Document based NoSQL for store big data tables

text: In Document based NoSQL to create tables (AFAIK) I need: Create such many as many rows in table documents with same ID field (that will be table id) and each time need to set the columns (for each document). Then you first search documents by id (table) and next search what you need in the selection. Please correct if I understand it wrong... And is it sane? How could that be fast?


title: Model Driven Architecture Approach in programming / modelling

text: I know the basics of the model driven architecture: it is all about model the system which I want to create and create the core code afterwards. I used CORBA a while ago. First thing that I needed to do was to create an abstract interface (some kind of model of the system I want to build) and generate core code later. But I have a different question: is model driven architecture a broad approach or not? I mean, let's say, that I have the language (modelling language) in which I want to model EXISTING system (opposite to the system I want to CREATE), and then analyze the model of the created system and different facts about that modeled abstraction. In this case, can the process I described above be considered the model driven architecture approach? I mean, I have the model, but this is the model of the existing system, not the system to be created.


title: How important is knowing functionality before coding?

text: I work for a software development company where the development work have been off shored to us. The on shore team handle the support and talk directly to the clients. We never talk to the clients directly we just talk people from the on shore team who talk directly to the clients. When requirements come, on shore team talk to the clients and make requirement documents and informs us. We make design documents after studying the requirements (we follow traditional waterfall model ). But there is one problem in the whole process: nobody in the either off-shore or on-shore understand the functionality of the application completely. We just know its a big complex web app handling complex order processing, catalog management, campaign management and other activities. We struggle with the design document as the requirements would not be clear. It then goes into a series of questions/answers back and forth between the on shore team,off shore team and clients. We would often be told to understand functionality from the code. But that's usually not feasible as the code base is huge and even understanding a simple menu item take days if not weeks. We tried telling the clients to give us _knowledge transfer_ about the application but to no avail. Our manager would often tell us to start coding even if the design document is not complete or requirements not clear. We would start by coding part of the requirement that seems clear and wait for the rest. This usually would delay the deployment by a month. In extreme cases we would have very low errors in the development and production but the clients would say that's not what they asked. That would start a blame game and a series of change requests and we would end up developing something very different. My question is how would you do development work if you don't know the functionality of the app fully? UPDATE About development methodology it isn't really my choice and I am not my team's lead It is the way it began. I tried to tell people about the advantages of agile but to no avail. Besides I don't think my team has the necessary mindset to work in AGILE environment.


title: Is a Hackathon a good place to present serious projects?

text: I'm participating in my first hackathon soon. I have a great idea that has been rolling around in my head for a while, and if it takes off I'd obviously like to have my name on it/make some money on it. Is a hackathon a good place to present a project I'm serious about? How will the ownership work? I think I could get the project functional over the weekend of the event, but I'd definitely want to develop it further after. I'd like to be cited with the concept, but people who work with me on it would obviously be partial owners (or whatever would be considered fair). My main goal is for this project to get off the ground, but I also don't want to be left out if it ends up making money.


title: RFC syntax definition

text: I would like to bring our specifications to a better level of fine-grained definition of syntaxes, semantics and the like. I read my fair share of RFCs and just love the way they define things like "how an email adress looks like" or "what a correct URL is". But, I haven't yet found a definition of the syntax of those definitions. Like, e.g. how do you define optional parts? How do you define repetition? How to correctly define alternatives (`/` vs `|`) Is there an RFC that defines the syntax all those other RFCs use to define their actual domain-specific definitions that I could adapt to our specifications?


title: When profiling a function for time use, what information is desirable?

text: I'm writing a program similar to Python's `timeit` module. The idea is to time a function by executing it anywhere from 10 to 100,000 times depending on how long it takes and then report results. I've read that the most important number is the minimum execution time because this is the number that best reflects how fast the machine can run the code in question in the absence of other programs competing for processor time and memory. This argument makes sense to me. Would you be happy with this? Would you want to know the average time or the standard deviation? Is there some other measure that you consider more important?


title: As a junior programmer, how do I quickly make changes to large unfamiliar software?

text: > **Possible Duplicate:**   >  Tips or techniques to use when you don’t know how to code something? I recently graduated on a Computing course, and luckily got a job as a junior programmer. Now, I have been given a series of tasks, from a bigger project. My company has (supposedly) bought a revenue/sales software written in PHP. Basically this whole big piece of software needs to be modified to meet my country standards. I have been given a large number of tasks to do in a relatively small time span. Now, this might be my very own understanding of the whole timing problem, but this seems a very big thing to do because I need to fully understand:   1. the whole system structure   2. the "style" in which it has been written, classes, functions, etc.   3. the database structure Considering the above, I need to add some functionality, some of which can be considered "core" ones which, in my opinion, is a too long of a job to be done in 6 days. I understand that I have given too little information for anyone to understand the level of difficulty of said tasks, since for some people might be impossible while for others might be a breeze, so I want to ask the following: To the people who went past a similar situation, what was your outcome? Can I start considering myself unprepared or maybe they are asking too much? What was your experience on a similar situation?


title: Tree vs Graphs in search

text: Could anyone give a clear and concise explanation for when you use graphs vs when to use trees for data structures?


title: Speech introduction

text: I'm currently working on a speech introducing an introduction to C++ programming manual. The speech itself is going to be about the topics within the manual (which are very basic concepts, such as data types, ect..) I'll be giving this speech to students who are **not familiar to C++ or even programming in general** , and I'm looking for an attention grabber to begin my speech with such as a fun fact or quote about C++, or an interesting statistic regarding C++. I am wanting something the students will understand, and that sparks their interest. Does anyone have any good ideas that I can use? Thanks!


title: Best approach to including JBoss's standalone.xml in SVN structure?

text: Our application server is JBoss 7 as. We use SVN as our code repository. I need to ship our custom security domain in standalone.xml which is a jboss file (not packaged in my application's war file). However, I don't want to commit all of JBoss to the SVN. The approach I'm thinking of using is to commit standalone.xml in a separate folder in my SVN repository and move it to the correct location under JBoss when the application is deployed at production site. Is this the best mechanism?


title: New Customer Project - Use Legacy Application or Design Something New

text: We are starting a new project with a new customer. We have a legacy application circa 1997 that we are planning on using to satisfy the customer's business requirements. I have been on the fence as to whether this is really the right course both for our company, and for the customer. I don't want to rewrite the app for no reason, but I feel that this older technology MFC, VC6 - has outlived its usefulness. If I am honest with myself - I don't want to spend any more of my career on the legacy app either. To that end, I have justified to myself that I should present to management a plan to develop a new, fresh solution based on current methodologies. 1) Am I wrong for doing thinking this is a good idea. 2) If not - how can I sell it to the business. There are definite advantages from the ongoing support perspective for the customer (more people with skill-sets in newer technologies - which in this case would probably be .NET with an XML or Lua based configuration) I'll be happy to answer any follow-on questions to clarify my intent.


title: OOP - Separate Manager class

text: I have started using OOP in PHP recently. For every model, I create two classes. One class for read operations and another Manager class for all the create / update / delete operations. For example,               <?php     // This is a sample class, just to convey the idea     class Image {         public static function loadById() {}         public static function loadByName() {}         public static function search() {}              public function __construct () {}         public function __get () {}         public function getData() {}         public function getRating() {}         public function getSimilar() {}         public function getRelatedNews() {}     }          class ImageManager extends Image {         public function __construct() {}         public function __set() {}         public function remove() {}         public function update() {}         public function save() {}         private function updateSomethingElse() {}     }     ?>      The reason I separated this into two classes was that I thought it was a bit more secure, since it did not expose the C/U/D methods to a normal user. Also, I thought this might be faster / memory efficient since I am loading only the smaller class for 95% of the requests. But now I think these reasons are too insignificant for maintaining two files. Is this a bad practice? Normally, the Manager classes are loaded only during admin operations. User actions rarely update the database (except maybe during a rating operation, or a cron job for updating view count). Should I combine both the classes into the `Image` class?


title: Adding a new method to a class library for its new version and exposing a version option the users can select

text: Is it a bad idea to add a new method (that implements a new algorithm) to a class library for its new version and expose a version option the consumers can select? It is just for backward compatibility where an old application might need a constant sequence of random numbers for a certain seed number. The following code might speak my idea much better. Hopefully you get the essence.               //Class Library:     namespace MyGenerator     {         public sealed class MyRandom         {             public enum Version { One, Two }// add more options in the future              private int current;             private Version version;                  public MyRandom(int seed, Version version = Version.One)             {                 current = seed;                 this.version = version;             }                  public int Next()             {                 switch (version)                 {                     case Version.One:                         AlgorithmOne();                         break;                     case Version.Two:                         AlgorithmTwo();                         break;                     // add more options in the future                 }                 return current;             }                  private int AlgorithmOne()             {                 current = (current * 1234567890 + 987654321) & 0x7FFFFFFF;                 return current;             }                  private int AlgorithmTwo()             {                 current = (current * current + current) & 0x7FFFFFFF;                 return current;             }             // add more algorithm in the future         }     }      and               //Console Application (for testing purposes):          using MyGenerator;     using System;          namespace ConsoleApplication1     {         class Program         {             static void Main(string[] args)             {                 const int seed = 12345;                 MyRandom rnd = new MyRandom(seed, MyRandom.Version.Two);                 Console.WriteLine(rnd.Next());                 Console.ReadLine();             }         }     }


title: What's a similar functionality in JavaScript that insures the object has X data before any actions are taken?

text: If java/C#/etc one might do something like create a constructor with a parameter, the parameter being the thing the rest of the object may act upon. How is this done in JavaScript? I'm trying to figure out what the best practice is with JavaScript to do something similar to this C#/Java Object.               public class Blagh{              public var ThingToActOn;  // Appropriate get & set methods here.               public new Blagh(variable ThingForObjectToActOn) {             this.ThingToActOn = ThingForObjectToActOn;         }     }      I was thinking something like this in JavaScript, but it seems maybe I'm missing something. I'm also aware that New in JavaScript is frowned upon for a number of reasons, but am not sure what the best solution is otherwise.               var Symphonize = function(generation_specification){         this.gen_spec = generation_specification;     }          Symphonize.prototype.act_on_object = function () {              // Do actions here on the generation_specification value.              return this.gen_spec;     }          blu = new Symphonize({"gen":"stuff"});


title: Drawback of mixing C++ code with C for performance purposes

text: Often you can see answers like “Avoid using C libraries in your C++ code“ or “This can be rewritten using STD/Boost in pure C++“. I understand C++ produces more maintainable code and has many advantages, but is it actually bad using C libraries when performance is a priority? I mean writing in what is sometimes called C-with-classes. I‘ve been developing a text file parser with both C and C++ versions and the C one was considerably faster. What i would like to know is if using C libraries in C++ has hidden drawbacks apart from the obvious ones like making the code less maintainable.


title: How do you show the exception handler in a class diagram?

text: I have one exception handler class. I want to show this class in the uml -- class diagram. But, I do not know how to represent relationship between class `<X>` and exception handler class. How can I represent relationship between class in class diagram?


title: Handling permissions in a MVP application

text: In a windows forms payroll application employing `MVP` pattern (for a small scale client) I'm planing user permission handling as follows (permission based) as basically its implementation should be less complicated and straight forward. **NOTE** : System could be simultaneously used by few users (maximum 3) and the database is at the server side. This is my `UserModel`. Each user has a list of permissions given for them.               class User     {         string UserID { get; set; }         string Name { get; set; }         string NIC {get;set;}         string Designation { get; set; }         string PassWord { get; set; }         List <string> PermissionList = new List<string>();         bool status { get; set; }         DateTime EnteredDate { get; set; }     }      When user login to the system it will keep the current user in memory. For example in `BankAccountDetailEntering` view I control the controller permission as follows.                public partial class BankAccountDetailEntering : Form         {             bool AccountEditable {get; set;}                  private void BankAccountDetailEntering_Load(object sender, EventArgs e)             {                 cmdEditAccount.enabled = false;                      OnLoadForm (sender, e); // Event fires...                      If (AccountEditable )                 {                     cmdEditAccount.enabled=true;                 }              }         }      In this purpose my all relevant presenters (like BankAccountDetailPresenter) should aware of `UserModel` as well in addition to the corresponding business `Model` it is presenting to the `View`.               class BankAccountDetailPresenter     {             BankAccountDetailEntering _View;         BankAccount _Model;         User _UserModel;         DataService _DataService;              BankAccountDetailPresenter( BankAccountDetailEntering view, BankAccount model, User userModel, DataService dataService )         {             _View=view;             _Model = model;             _UserModel = userModel;             _DataService = dataService;             WireUpEvents();         }              private void WireUpEvents()         {             _View.OnLoadForm += new EventHandler(_View_OnLoadForm);         }              private void _View_OnLoadForm(Object sender, EventArgs e)         {                  foreach(string s in _UserModel.PermissionList)              {                  If( s =="CanEditAccount")                 {                     _View.AccountEditable =true;                     return;                 }             }         }              public Show()         {             _View.ShowDialog();         }     }      So I'm handling the user permissions in the presenter iterating through the list. Should this be performed in the `Presenter` or `View`? Any other more promising ways to do this?


title: Is there an easy way to type in common math symbols?

text: _Disclaimer: I'm sure someone is going to moan about easy-of-use, for the purpose of this question consider readability to be the only factor that matters_ So I found this site that converts to easting northing, **it's not really important what that even means** but here's how the piece of javascript looks.               /**      * Convert Ordnance Survey grid reference easting/northing coordinate to (OSGB36) latitude/longitude      *      * @param   {OsGridRef} gridref - easting/northing to be converted to latitude/longitude      * @returns {LatLonE} latitude/longitude (in OSGB36) of supplied grid reference      */     OsGridRef.osGridToLatLong = function(gridref) {         var E = gridref.easting;         var N = gridref.northing;              var a = 6377563.396, b = 6356256.909;         // Airy 1830 major & minor semi-axes         var F0 = 0.9996012717;                        // NatGrid scale factor on central meridian         var φ0 = 49*Math.PI/180, λ0 = -2*Math.PI/180; // NatGrid true origin         var N0 = -100000, E0 = 400000;                // northing & easting of true origin, metres         var e2 = 1 - (b*b)/(a*a);                     // eccentricity squared         var n = (a-b)/(a+b), n2 = n*n, n3 = n*n*n;    // n, n², n³              var φ=φ0, M=0;         do {             φ = (N-N0-M)/(a*F0) + φ;                  var Ma = (1 + n + (5/4)*n2 + (5/4)*n3) * (φ-φ0);             var Mb = (3*n + 3*n*n + (21/8)*n3) * Math.sin(φ-φ0) * Math.cos(φ+φ0);             var Mc = ((15/8)*n2 + (15/8)*n3) * Math.sin(2*(φ-φ0)) * Math.cos(2*(φ+φ0));             var Md = (35/24)*n3 * Math.sin(3*(φ-φ0)) * Math.cos(3*(φ+φ0));             M = b * F0 * (Ma - Mb + Mc - Md);              // meridional arc              } while (N-N0-M >= 0.00001);  // ie until < 0.01mm              var cosφ = Math.cos(φ), sinφ = Math.sin(φ);         var ν = a*F0/Math.sqrt(1-e2*sinφ*sinφ);            // nu = transverse radius of curvature         var ρ = a*F0*(1-e2)/Math.pow(1-e2*sinφ*sinφ, 1.5); // rho = meridional radius of curvature         var η2 = ν/ρ-1;                                    // eta = ?              var tanφ = Math.tan(φ);         var tan2φ = tanφ*tanφ, tan4φ = tan2φ*tan2φ, tan6φ = tan4φ*tan2φ;         var secφ = 1/cosφ;         var ν3 = ν*ν*ν, ν5 = ν3*ν*ν, ν7 = ν5*ν*ν;         var VII = tanφ/(2*ρ*ν);         var VIII = tanφ/(24*ρ*ν3)*(5+3*tan2φ+η2-9*tan2φ*η2);         var IX = tanφ/(720*ρ*ν5)*(61+90*tan2φ+45*tan4φ);         var X = secφ/ν;         var XI = secφ/(6*ν3)*(ν/ρ+2*tan2φ);         var XII = secφ/(120*ν5)*(5+28*tan2φ+24*tan4φ);         var XIIA = secφ/(5040*ν7)*(61+662*tan2φ+1320*tan4φ+720*tan6φ);              var dE = (E-E0), dE2 = dE*dE, dE3 = dE2*dE, dE4 = dE2*dE2, dE5 = dE3*dE2, dE6 = dE4*dE2, dE7 = dE5*dE2;         φ = φ - VII*dE2 + VIII*dE4 - IX*dE6;         var λ = λ0 + X*dE - XI*dE3 + XII*dE5 - XIIA*dE7;              return new LatLonE(φ.toDegrees(), λ.toDegrees(), GeoParams.datum.OSGB36);     }      I found that to be a really nice way of writing an algorythm, at least as far as redability is concerned. Is there any way to easily write the special symbols. And by easily write I mean NOT copy/paste them.


title: Best Practices and Tips for Reading Source Code

text: Code reading is an important part of a programmer's life because we usually work in groups and have to maintain, complete or contribute to the other developer's codes. From that point of view, code reading is inevitable. Our performance criteria is not only fast reading or interpreting. But also understanding and interpreting the code correctly is very important in our daily work-life. We usually have to deal with several different types of codes such as well documented ones, badly written, undocumented ones, buggy ones and even spaghetti ones. We usually have to deal with each one of them using different techniques and shortly my questions is how do you deal reading those codes, for instance consider dealing with undocumented and badly written codes. For example I apply some small methods for C/C++ code:   * Find the dependencies of the code and try to figure out the general overview of inter-class or inter-function relationships. Visualise on paper or board if necessary.   * Try to understand the coding conventions they have used and get used to it.   * Understand the general purpose of the functions in a file (figure out why are they populated in that file).   * Start from the main and find the places that you may have to change if necessary.   * Do some small modifications and put print statements in strategic locations to understand what a function or class is doing.   * Use cscope _My question is do you have any these kind of tips, tricks or best practices that you'd like to share?_ EDIT: Forgot to ask the question :)


title: MVC 3 - Any new features to explore for an existing MVC 2 application?

text: I have an existing ASP.NET MVC 2 application that is working well and is usually easy to maintain. I had a lull in development yesterday so I upgraded the solution to ASP.NET MVC 3 and everything appears to be working. I've been researching ASP.NET MVC 3 and there are a number of improvements including the Razor view engine, integrated support for unobtrusive JavaScript, etc.. These all seem interesting but not necessarily for an existing application that already has dumb views, unobtrusive JavaScript with jQuery, dependency injection, unit testing, etc.. What ASP.NET MVC 3 features, if any, could have the greatest impact on an existing MVC 2 application?


title: Should QA be part of the development department?

text: I work for a small company that has had a product development department for quite a while. What we haven't had, however, is a QA/testing group. We are looking to add a testing group, but are struggling to determine where best to put them in the organizational structure of the company. Specifically, we are going to hire a "lead tester" position. Should they be put in as part of the product development department, or should they be a new department? Should they be somewhere else? Our company is roughly structured as follows:   * CEO      * CTO        * Director Product Development       * Director Customer Care          * Developers       * VP Operations          * Network engineers     * Sales/sales engineers     * President        * Controller


title: Standards for reading code out loud?

text: Has anyone defined a standard for reading code out loud, for any language? I imagine this is important to software like screen readers for the vision- impaired. This sort of thing also comes up when you are discussing code with someone, reviewing it in a group, or teaching a class. In the C family of languages, there are a lot of words with "obvious" pronunciations. Some are simply English words: `for`, `break`, `case`, `default`, etc. Some abbreviations, like `int`, are unambiguous. And then there's `char`. I always tend to say it (and hear it in my head) like the first syllable of "charcoal". It was jarring to me the first time I was talking about code with someone who pronounced it like "car", which actually makes more sense because `char` is really an abbreviation of the word "character", so clearly it should be pronounced the same. But even knowing that, char-as-in-coal feels more right to me. And then there are statements like `foo = bar ? *(++baz) : zardoz`. Has anyone anyone produced a document dictating the correct way (in their opinion) how to read code aloud? Either for a specific language or maybe code in general?


title: Why do many languages not support named parameters?

text: I was just thinking how much easier it would be to read code if, when calling a function, you could write:               doFunction(param1=something, param2=somethingElse);      I can't think of any drawbacks and it would make code a lot more readable. I know you could pass an array as the only argument and have the array keys as the parameter names, however that would still not be as readable. Is there a disadvantage of this that I'm missing? If not, why do many languages not allow this?


title: Android learning curve (Hello, Android 3rd ed. Book)

text: I am currently reading the book Hello, Android, and am about 100 pages in. The problem is that even though I understand the instructions and what the code should do, I can't really put things together as to how things are connected(methods, views, things passed around different files(!!)). The sudoku example the book is following is too complicated to follow; maybe they should of instead gradually show and _explained_ each step to building such an app (let the reader build up with simple examples to more complicated ones). Maybe later in the author starts to explain things more clearly. Should I just keep reading/coding the book or should I focus more on my Java book and finish that first? If someone has experience with the book, I would love to hear some thoughts.


title: How do I determine the runtime of a double recursive function?

text: **Given any arbitrarily double-recursive function, how would one calculate its run time?** _For Example (in pseudocode):_               int a(int x){       if (x < = 0)         return 1010;       else         return b(x-1) + a(x-1);     }     int b(int y){       if (y <= -5)         return -2;       else         return b(a(y-1));     }      Or something along those lines. **What methods could or should one use to determine something like this?**


title: What kind of knowledge is needed to be a Financial Software Developer?

text: I have 4+ years of experience in software engineering. I am well competent in system design, analysis and development. I have worked heavily in Java and C++ and I am confident about my technical skills. Now I am thinking of finding a job in the financial sector. What kind of resources should I be looking for? What are the keywords I should look for? E.g. "algorithmic trading" Are there any books targeting software engineers?


title: Suggestions for CSS frameworks?

text: So I've started developing web sites and have learned HTML and CSS fundamentals. However, I often run in to WTF-moments concerning layout; what looks good in one browser may look strange in another and I can't figure out why. Do I need to learn CSS beyond the fundamentals or are there any frameworks that can make life simpler for me?


title: returning null vs returning zero, which would be better?

text: I inherited a project that I am managing and having to maintain pending the redevelopment of the code base. At the moment I am being tasked with adding little features all over the place and have gotten into the habit of returning `null` instead of zero in parts of the code where I am working on. The problem is we have a client that is using this code and parts of code that require data from my implemented features receive a `null` and dump the stack trace in the UI. I would like to avoid this entirely from my input but without the `NullPointerException` there's the potential that errors would be introduced into the client's data which may go un-noticed. Usually I would have come up with my own error notification system but I have never inherited a project before. So I am unsure whether to continue down this path. I still believe that the stack dump is preferable to un-noticed data corruption/inaccuracies.


title: Will all compilers start supporting C++0x as soon as it is officially out?

text: It's sometimes frustrating to know that one particular feature is working in one compiler and not in another. Even after downloading latest gcc4.6 few weeks back some C++0x features are not working. Will the **complete** C++0x support provided by the compilers (at least the popular ones) on the very 2nd day when the C++11 is released officially ? Have these compiler vendors decided any timeline to provide the full support ?


title: Get code from one open source project and add it to another

text: I found some functions that I want to get from WordPress source code and add want to add them into my project which is going to be open source. Do I simply get the functions that I want and add them to my project with a little comment saying that I got it from WP like:               /**       * Author: WordPress     **/      or is there anything else I have to consider before getting the code? Also, is there anything else apart from the above question that I have to consider if I want to sell to someone my project with these functions?


title: Do you do custom tests/work for a potential employer before the interview?

text: Every shop I've worked at we have followed what I thought was a standard hiring sequence:   1. Solicit resumes   2. Phone screen applicants we are interested in   3. In-person interview   4. In some shops, second in-person interview (just w/ CEO for example) Most places I apply to follow something along these lines. But some shops want to give me a test or ask me to build something after I send in my resume. They usually say "congratulations, you've made it to stage 2 of our hiring process!" But for all I know they are asking every applicant they get a resume from to do the same thing. This annoys me because it doesn't scale. If I'm applying for a lot of positions I can't spend all my time doing work that potentially can only land me one job. Plus there's no shared dedication to the process. If we do a 45 minute phone screen, that's 45 minutes the company commits to me and 45 minutes I commit to the company in hopes of a potential match. Do you guys have a policy regarding these sorts of things?


title: My company claims all rights to my hobby iPhone apps. What is your company policy?

text: I am a mobile developer in my day job. During my free time (nights and weekends), I develop my personal hobby projects. After I have published my iPhone apps, my company told me they own all rights to any technology related stuff that I create during my term. I read the contract, it is true, it is harsh. Is there better company policy on developing hobby projects? What's yours?


title: SQL Server 2000 vs 2008 Express?

text: Due to not wanting to pay licenses my company is still using SQL Server 2000 for new projects.   This is very limiting for multiple reasons.   I'm wondering what are the limitations of using SQL Server Express 2008?   Is there any reason NOT to use it to power ASP.Net MVC3 websites?


title: Should I build a multi-threaded system that handles events from a game and sorts them, independently, into different threads based on priority?

text: Can I build a multi-threaded system that handles events from a game and sorts them, independently, into different threads based on priority, and is it a good idea? Here's more info: I am about to begin work on porting a mid-sized game from Flash/AS3 to Java so that I can continue development with multi-threading capabilities. Here's a small bit of background about the game: The game contains numerous asynchronous activities, such as "world updating" (the game environment is constantly changing based on a set of natural laws and forces), procedural generation of terrain, NPCs, quests, items, etc., and on top of that, the effects of all of the player's interactions with his environment are programmatically calculated in real time, based on a set of constantly changing "stats" and once again, natural laws and forces. All of these things going on at once, in an asynchronous manner, seem to lend themselves to multi-threading very well. My question is: Can I build some kind of central engine that handles the "stacking" of all of these events as they are triggered, and dynamically sorts them out amongst the available threads, and would it be a good idea? As an example: Essentially, every time something happens (IE, a magic missile being generated by a spell, or a bunch of plants need to grow to their next stage), instead of just processing that task right then and adding the new object(s) to a list of managed objects, send a reference to that event to a core "event handler" that throws it into a stack of all other currently queued events, which then sorts them out and orders them according to urgency, splits them between a number of available threads for as-fast-as-possible multithreaded execution.


title: H.264 documentation and ressources

text: I'm tasked to use an API on a small embedded linux device. The use of the API is rather simple, but there are a gazillion of (face it, not documented) parameters to control multiple aspects of the codec. These parameters seem to be undocumented because they are not the responsibility of the codec supplier but core components to the h264 spec sheets. I'd like to find more information with solid sources on this codec. So far the best I've found is wikipedia. It is a good start but I'm not really sure where to move to from there. I'm asking here because I'd like to find something not too painful to read.


title: How can I answer interview questions about developing in a team when I've always been a lone developer?

text: In an interview, I was asked about about my experiences in developing in team settings. However, I've been self taught and have only worked on projects on my own. How would you go about answering this question? I just brought up school clubs and how I was able to play well with others, but this isn't really developer related.


title: How to manage version control company wide?

text: Are there any industry standards or best practises on how to manage a rapidly changing code base? The types of applications I am developing always have a custom aspect to them. So there will always be some code written which is client specific for every project. The method we are using now is as follows: Several 'CORE' projects exist in isolation from one another, each core project is a class library which is capable of running on its own, or with dependencies on other core modules. All of these core modules are documented (Sandcastle) and NuGet packages created for them, which are served up via a private NuGet feed. When a customer purchases the software we create a customer specific project which implements the bespoke code that they require, and pulls in the NuGet packages from the core libs as needed. The build of this project is what is provided to the customer, and each customer project has it's own Git repository. This has worked fine for a year or so, but I feel that as we add features to the core libraries the number of nuget packages is growing quite quickly. Is there a better method of organising code, whilst making sure there are not seperate version of the same code lying around? I know in this stackoverflow post it states that: > Google manages to keep the source code of all its projects, over 2000, in a > single code trunk containing hundreds of millions of code lines, with more > than 5,000 developers accessing the same repository. But this seems like it produce problems for us, due to having bespoke deployments. Any ideas or comments on what I am doing wrong? ## Edit The problems I foresee going with the google way are mainly to do with release management and build issues. We use continuous integration, so that every commit a build will be triggered and test automatically run. If we use one all encompassing repo I am not sure what effect this will have on the build and test servers. Will it have to build every customers project? Or would there be a branch per customer? In which case is this any better than a repo per customer?


title: Patent a program: possible or not?

text: Suppose I have devised a new algorithm that solves a particular problem faster/better than the currently available fastest algorithm for that particular problem. By faster and better I mean, **drastically** faster in execution time and better in terms of **very less space consumed** compared to an existing algorithm. My question is that can I patent this program? Do I need a second person as a partner? More importantly, **should I patent it?**


title: C++ for Java Programmers

text: I am going to have a lecture about C++ for experienced Java programmers. Because C++ is a big language and I have just one lecture, I want to point out the most important "gotchas" and C++ features when migrating from Java to C++. I myself went the opposite way (C++ -> Java) and therefore I would like to hear different opinions on this topic. What would you mention if you were me? The to-mention list I have so far:   * Use cases for C++ (when to use C++ instead of Java)   * Compiler stages (preprocessor, compiler, linker)   * Differences in data types (atomic data types, arrays, structs, classes, unions, enums), automatic conversion   * Pointers and memory management, difference between pointers and references, stack vs. heap allocations   * Interfaces and inheritance in C++ (multiple inheritance, virtual functions and the need of virtual keyword, pure virtual functions)   * Rewriting generics to templates   * STL (thanks Péter)   * Operator overloading   * Basics of macros EDIT: added suggestions from the answers


title: How to answer to this HashTable interview question?

text: Today I was asked this question during an interview: > What's gonna happen if we do not override hashcode method for our class, > then add it to `HashTable` and then try to get objects? Could you help me answer that?


title: Does profiling without benchmarking lead to micro-optimization?

text: **Read first:** For a definition of the two terms ("profiling" and "benchmarking") and the need for distinguishing them, please read this answer to a previous question. I have to admit that until I saw Winston Ewert's answer, I have never thought of the need to distinguish the two techniques. I simply think that "profiling" can be applied at different "scale levels" of software, and that when it is applied on the higher level, the profiling code in the lower levels ought to be turned off in order to lower the aggregate overhead. After I reflected on the answer, it might have explained why I fell prey to micro-optimization in my previous project. In an effort to optimize during that project, I implemented a low-overhead profiler (inserted into the source code) which is good at generating accurate profiling results at the millisecond level. I then spent all days tinkering with it, and optimized a lot of code based on the profiler's result. In the end, I was successful in reducing the _computation_ part of the project from several seconds to less than a fraction of a second. The next thing I learned, to my horror: when the optimized module was used in a larger project, _I/O and data conversion_ completely dominated the module's _computation_ time. The non-computation part is in the range of 1-2 seconds, making my optimization efforts moot. To this date, I still haven't got a chance to do a true "benchmarking", though I am going to give it a try very soon. Given that "Did you do profiling?" has become the cliche on both StackOverflow and Programmers.SE, is there a danger that my kind of ignorance is actually prevalent among fellow developers? Does this ignorance lead to micro- optimizations all over the places?


title: What should I do if Scrum member leave half way?

text: Due to health condition of one of the scrum member, he has to leave the team. My question is, do I need to start a sprint planning session again? or change the burn-down chart? or ask all the team members to bite the bullet and do extra work to meet the target? Thanks


title: Should a poll framework be closed sourced

text: I was having a chat with a coworker who is working on a polling app and framework. He was asking technical questions and I suggested he open source the application to get more quality opinions from developers who are interested in this problem and are willing to give it heavy though. He has a different point of view which I think is still valid so I want to open this question for discussion here. He says he believes something like a polling framework should **not** be open sourced because it will reduce its security and validity as people reveal loopholes through which they can cheat. Can't say I completely disagree. I see a somewhat valid point there, but I always believed that solutions by a group of people are almost always better than a solution thought by a single person asking a small number of coworkers, no matter how smart that person is. Again I'm willing to accept that maybe some types of applications are different. Does anyone have an argument in his favor? I'd really like to present your responses to him.


title: What would help when refactoring a large method to ensure that I don't break anything?

text: I'm currently refactoring a part of a large codebase with no unit tests whatsoever. I tried to refactor code the brute way, i.e. by trying to guess what the code is doing and what changes wouldn't change it meaning, but without success: it randomly breaks features all around the codebase. Note that refactoring includes moving legacy C# code to a more functional style (the legacy code doesn't use any of the features of .NET Framework 3 and later, including LINQ), adding generics where the code may benefit from them, etc. I can't use formal methods, given how much would they cost. On the other hand, I presume that at least "Any refactored legacy code shall come with unit tests" rule should be strictly followed, no matter how much would it cost. The problem is that when I refactor a tiny part of a 500 LOC private method, adding unit tests appears to be a difficult task. What can help me in knowing which unit tests are relevant for a given piece of code? I'm guessing that static analysis of the code would somehow be helpful, but what are the tools and techniques I can use to:   * Know exactly what unit tests should I create,   * And/or know if the change I've done affected the original code in a way that it is executing differently from now?


title: How does code produced on an open-source framework is affected by it's original license (MIT in this case)

text: I'm looking into building a new PHP commercial app for a client that will be hosted as a paid service and possibly resold to third parties with a non- compete clause. I've tested a few frameworks and chose Laravel which is licensed under the MIT License. The framework itself will not be modified but the app will be heavily dependent on Laravel functions and architecture. How does the original license affects code produced with the software it's covering? MIT being a non-viral license, my humble guess is that my code can be distributed under a more commercial-friendly license that prevent third- parties to do anything else than using the app as a final product as long as the original licensed is kept for the framework part. Am I wrong? How should I do this?


title: What are some alternative methods to IronPython for calling Python code from .NET?

text: There are some great libraries for Python that have cousins in the .NET world, but some are unmatched. Realizing that Python is a dynamic language, which makes it difficult to mix with a (largely) statically typed language like C# (though this is seemingly getting easier with .NET 4.0), there are options like IronPython which can help match up the two languages. I've never come across any other options for dovetailing Python libraries with .NET. Are there any other ways to do this that are tried and true? I have far less experience with Python, so it's entirely possible that I'm overlooking something.


title: How many copies are needed to enlarge an array?

text: I am reading an analysis on dynamic arrays (from the Skiena's algorithm manual).   I.e. when we have an array structure and each time we are out of space we allocate a new array of double the size of the original. It describes the waste that occurs when the array has to be resized.   It says that (n/2)+1 through n will be moved at most once or not at all. This is clear.   Then by describing that half the elements move once, a quarter of the elements twice, and so on, the total number of movements M is given by: ![enter image description here](http://i.stack.imgur.com/cm5Mm.jpg) This seems to me that it adds more copies than actually happen. E.g. if we have the following:               array of 1 element     +--+     |a |     +--+          double the array (2 elements)       +--++--+       |a ||b |       +--++--+            double the array (4 elements)       +--++--++--++--+       |a ||b ||c ||c |       +--++--++--++--+            double the array (8 elements)       +--++--++--++--++--++--++--++--+         |a ||b ||c ||c ||x ||x ||x ||x |       +--++--++--++--++--++--++--++--+              double the array (16 elements)       +--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--+         |a ||b ||c ||c ||x ||x ||x ||x ||  ||  ||  ||  ||  ||  ||  ||  |        +--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--+         We have the x element copied 4 times, c element copied 4 times, b element copied 4 times and a element copied 5 times so total is 4+4+4+5 = 17 copies/movements. But according to formula we should have 1*(16/2)+2*(16/4)+3*(16/8)+4*(16/16)= 8+8+6+4=26 copies of elements for the enlargement of the array to 16 elements. Is this some mistake or the aim of the formula is to provide a rough upper limit approximation? Or am I missunderstanding something here?


title: Practical Usage Of Structures in c#

text: > **Possible Duplicate:**   >  When do you use a struct instead of a class? While working in OOPs, we always battle around structures and classes. But in real world, we always sticks to classes. I just want to know what is the practical usage of structures in C# and where are they beneficial over the classes. Or they are just a topic for theory.


title: Ms Build publishing vs Visual Studio IDE publishing

text: I am currently working on ms build to publish my winform application based on the environment selected (Dev or Prod). I am using Ms Build Community Task and referencing this article to achieve this purpose. I had a few theoretical doubts based on publishing application. 1) Is there any difference in publishing through the visual studio ide and msbuild? 2) What do most developers prefer to use and why? 3) What are the advantages of using MsBuild to publish an application as compared to publishing through the visual studio IDE? 4) What is faster? I am using a .net 3.5 winform application developed in Csharp and my question is pertaining to clickonce windows applications only. Please help me clear these doubts


title: Advice on which technologies to use for a client-server desktop application

text: I am writing a desktop application in Java which will allow clients to authenticate to a server with their credentials, and afterwards view and manipulate some data (orders, invoices, employees etc.) stored on the server. I have decided to use Java to write the client, with SWT for the GUI. However, since I haven't previously worked on any large Java projects, I am not sure what technologies to use to make my job easier in writing the server. The server application will be a frontend for an internal RDBMS, allowing the successfully-authenticated clients to perform various operations on the data the user has permission to work on (not all users have the same role). This will, in simpler terms, work in a similar fashion to a multiuser RDBMS where each database user is only allowed to execute certain stored procedures and nothing more. I would like to have to deal as little as possible with serialization, duplicated code, writing my own protocol for client-server communication, hand-written object-relational mapping etc. It would be nice to be able to have some data bindings between models and GUI and to abstractize away the networking (by some form of RPC, I imagine). The first question to be asked is whether the protocol would be stateful or stateless, but I assume stateless is better (providing the user with some session id after successfully authenticating). The next question is what technologies/protocols/libraries should I use? RPC or something else? SOAP, something else over HTTP, not HTTP? I realize this is somewhat a matter of preference, but I'm not really aware of what options I have. I am interested in what's commonly used in the Java world etc. I would probably also need some way of sharing the model classes' definition (to avoid code duplication) across the client and the server. The client would bind the models to the view and propagate the changes to the server (serializing the model before sending it probably). The server would then deserialize the model object and push it onto the database via some object- relational mapper. Of course, that's oversimplified and is just the way I imagine it would work, but I'm open to any suggestions. My initial impulse was to use Python for the server, because that would make things more interesting for me (plus I have more experience). However, I'm thinking that going in this direction might over-complicate things. It's probably easier to write some model class and use it in both the client and the server than write it once in Python and once in Java and make sure to never forget to sync the changes (but then again, I might be able to use some common format to describe the model and then have it generate code in both Java and Python; I think ASN.1 does something like that). Do you think I can do this using a Python server without too much time wasted caused by the fact that the client is Java? Thank you for taking your time to read this. All of your suggestions are appreciated.


In code quarterly interview with Rich Hickey Michael Fogus hints that Clojure borrows a lot from Haskell: _Fogus: As someone who only knows Haskell enough to read the papers, Clojure appears to be influenced by it substantially. From the names and operation of core functions—take, drop, iterate, repeat, etc.—to its protocols facility, there is a lot in Clojure that a Haskell programmer would recognize. Can you elaborate on Haskell’s influences on Clojure both positive and negative?_ _Hickey: I think Haskell is a fantastic, awe-inspiring piece of work. I haven’t used it in anger, but it certainly was a positive influence. Haskell obviously goes much further than Clojure in pursuing the ideals of functional programing. In particular they differ in the approach to using types to enforce things._ **My question is - Does Clojure borrow concurrency ideas from Haskell?** Fogus hints at some syntax, and there is obviously functional laziness. What about the STM and concurrency operators? **Assumptions:**   * I'm asking this question in a positive tone. I think it is great that Rich could see some of the treasures in Haskell and use them.


title: Layers - Logical seperation vs physical

text: Some programmers recommend logical seperation of layers over physical. For example, given a DL, this means we create a DL namespace not a DL assembly. Benefits include:   1. faster compilation time   2. simpler deployment   3. Faster startup time for your program   4. Less assemblies to reference Im on a small team of 5 devs. We have over 50 assemblies to maintain. IMO this ratio is far from ideal. I prefer an extreme programming approach. Where if 100 assemblies are easier to maintain than 10,000...then 1 assembly must be easier than 100. Given technical limits, we should strive for < 5 assemblies. New assemblies are created out of technical need not layer requirements. Developers are worried for a few reasons. A. People like to work in their own environment so they dont step on eachothers toes. B. Microsoft tends to create new assemblies. E.G. Asp.net has its own DLL, so does winforms. Etc. C. Devs view this drive for a common assembly as a threat. Some team members Have a tendency to change the common layer without regard for how it will impact dependencies. My personal view: I view **A.** as silos, aka cowboy programming and suggest we implement branching to create isolation. **C.** First, that is a human problem and we shouldnt create technical work arounds for human behavior. Second, my goal is not to put everything in common. Rather, I want partitions to be made in namespaces not assemblies. Having a shared assembly doesnt make everything common. I want the community to chime in and tell me if Ive gone off my rocker. Is a drive for a single assembly or my viewpoint illogical or otherwise a bad idea?


title: Python: Counter for Simultaneous calls of a PHP script?

text: I'm trying to create a queue processing script that's purpose is to find particular files and apply actions based on specific parameters, with the result being to call a PHP script that serves to process a list of message files that we generated and passed to it. One of the things I need to specify in a config file the maximum number of concurrent calls to the PHP processor that can be running at a given time, and if max number of calls is >= then loop until <= Also need to specify a timeout variable 'tOut' in seconds... So basically it looks for the oldest file in the directory, locates a variable in that filename 'chCode', searches for the next oldest files in the directory with the same chCode and reprefix them and output file a list of those reprefixed paths. Then using Popen or Pcall the script with run 'php /path/to/filepathlist' and if: it returns output '00' then continue... it returns any text other than 00 then reprefix and mv.. it returns nothing for tOut secs then reprefix and mv. The counter is the part I'm really needing help with, as this needs to be proper accurate and high performance with batches of hundreds of thousands of outgoing text messages being sorted using this. I can confirm the counter from the PHP script but as said it needs to be accurate. Using Python 2.7 on CentOS6.


title: Does the programming language or database you use have any effect on the selling of your site?

text: I was just wondering if the programming language or database you use has any effect on selling your site to another company? I mean is it easier to sell PHP site than other language? How about database type? If I was using Redis instead of MySQL, would that make any difference?


title: Making my code more robust

text: I have recently finished a piece of code that passed all tests. (Here is some idea what it does and Here is some actual code.) Problems began, however, when I run my code on the cloud with actual data. Specifically, the remote database I am sending data to, rejects requests if data do not conform to certain scheme. E.g. I cannot send two hashes like that:               array(         array('key' => 'string'),         array('key' => array('string1', 'string2'))     )      Here the type of `key` must be fixed -- either string or array of strings (or sometjing else). I have tried to fix this problem quickly, which lead to some messy behaviour, showing that my code is not yet robust and my tests are not yet sufficient. I wonder what are best practices here. I've read Uncle Bob's book, where he recommends to test for _Boundary Values_. Does it mean to try all possible types of data as method arguments for testing? Does it mean I should start every method with multiple "if statements" to check for input validity, to make those tests pass? Are there cases where it is pointless to worry about errors but rather let them go and deal with them only if they occur? Is there good rule of thumb when to throw `Exceptions` and when only to log messages? I have tried to follow the approach to throw `Exception` when thing _should not happen_ and to output `message` when it can happen but I still want to continue. On the hand, I can still throw `Exception` and catch it later, so I am still not quite certain what is good approach here. I still haven't used custom `Exceptions`, any good practical examples you know to learn about them? Are there a good sources to learn about those things? I know it is a big topic and I've read long philosophical articles on TDD and BDD but they tend to dwell on the abstract level, without breaking down to simple practical rules supported by easy examples. So I am looking for more practical help here, many thanks!


title: Building a strong robust client-server system

text: I need some help with regards to implement a pre-designed system that has 4 components and several constraints. I've spent approximately 50 hours trying to determine the best way to build this system; however, I do not think I have a strong enough solution as of right now. ### ~~~ The Background Information ~~~ The purpose of this project is to allows for business owners (and their developers) to access data remotely. It has 4 components.   1. A Web Service    2. A Client   3. A Database For the webservice   4. A Database For the Client The user interface must be in the form of a web service as it is one of the design requirements. The Client is stored on a business owners computer (Which houses their database). It is a local program programmed in the .net platform. Business owners access the web service which then accesses a client, requests for data and passes that data to the client. The above is known and unchangeable (as I am not the person who makes the project specification) ### ~~~ The Real Problem ~~~ The problem is, The Client may not necessarily be at the same place every time, the IP of the client is subject to change. The Client may also simply not be online at the time of the request from the business owner. ### ~~~ My Present Solution ~~~ My Present solution to this problem is to create a TCP/IP Server on the Client. When the Client is turned on or started, it can "register" its TCP/IP Server credentials (the information needed to contact it) into the server along with some identification information. ~~~Editted for clarity~~~ When the Web Service gets a request, it can open a random TCP/IP connection and let the client (Remember the TCP/IP Server is on the Client) know it has a request for data. The Client can then get the request, process it and send a response with a 'request Id'. Based on this request Id, the web service can receive a call, let the client know it has a request, the client can go query the web service for the request, retrieve the request, process the request and send a response back to the web service which can then process the response (extract the request Id from it) and send it back to the appropriate web service caller.   ~~~ End Edit ~~~ (wow that sentence is a mouthful to read out loud) ### ~~~ What I Would Like ~~~ I feel my solution is sketchy and I would really like some feedback as to potential pitfalls that I may not see and better ways of approaching it.


title: Style guide for C++

text: Right now I am using Google C++ Style Guide in my C++ code and I was pretty happy with it. Recently I was told that this guide is very bad: it is used internally by Google (I knew that), is outdated, and promotes some very bad practices. So I want to use another coding style. What good and fairly used C++ style guides are there? I write code for both gcc and Visual Studio, and I use a lot of the C++11 features. What I liked very much about Google C++ Style Guide was the indentation, the whitespace and the naming conventions (specially naming all classes, types - including typedefs, type aliases and template aliases - with capital first letter). I know any answer is subjective (I hope this is ok on this site) and I would appreciate any opinion, but I am interested which guides are used these days.


title: Two-way calendar sync with any client

text: I have a database of calendar events, that can be administered by the user through a web application. I would like to offer to the user, functionality for viewing their calendar in any client of their choice (to the extent that open standards are implemented), primarily Outlook and Google calendar. I would also want for the clients, such as Outlook, to be able to edit and delete events, which would then be pushed to the web application, or which the web application would pull, or simply: which would somehow be synced. Additionally, it would be neat to be able to create a tentative event in the database, send a meeting request to the client, and have the client's accept or reject status somehow reported back to the application. But if this can't be achieved, that's no big deal. What would be the best approach for such integration? Would my application have to have built in support for communication with every single client API, such as Exchange etc.? Or are there any open standards that I could adopt? My initial attempts with iCal have not been rewarding so far. Perhaps I'm trying to do something that iCal cannot do. In that case, are there other techniques that can?


title: Opinions on logging in multiprocess applications

text: We have written an application that spawns at least 9 parallel processes. All processes generate a lot of logging information. Currently we are using Pythons QueueHandler to consolidate all logs into one file. Unfortunately this sometimes results in very messy files which make them hard to read (e.g. Track what exactly is going on in one thread). Do you think it is a viable option to separate all messages into dedicated files, or is this going to make things even more messy due to the high number of files? What are your general experiences when writing log files for multiprocessed/multithreaded applications?


title: Agile method for a non-technical product owner + one developer

text: My current client has several internal products which the IT-department supports. All product owners are non-technical and each application is always developed by one developer (and so is all change requests). The current methodology is a bit like waterfall. All uses cases are defined first by the product owner. Then the application is developed and released into a test-environment. The user tests it and says yes/no. Any changes results in a change request and a new release (including setup-packages). And it continues like that until the user is happy which results in the product going to production. I want to introduce an agile method instead to capture changes quicker and focus on the most important features from start. Scrum seems to be overkill since there only is one developer per project. Any other suggestions? **Edit** My client isn't going use anything that isn't documented. So I'm looking for an established and documented method (if there are one which suits one developer).


title: argument grouping with parenthesis are valid in C++?

text: On python I can group arguments into a tuple, something like               def func((a, b, c, d), x):         print a, b, c, d, x      I was wondering if it is possible to group arguments in the same way on C++, something like:               void func((int a, int b, int c, int d), float x)     {         cout << a << b << c << d << x << endl;     };


title: Are Request/Response Parameter Wrappers Good Practice?

text: I've seen several different ways to design WCF services, and it seems some developers prefer parameter wrappers while others favor 'naked' parameters. To explain what I mean, consider the following service interfaces: **'Naked' Parameters**               [ServiceContract]     public interface IService     {         [OperationContract]         string[] GetValuesByType(string groupName, ValueTypeEnum valueType)     }      **Parameter Wrappers**               [DataContract]     public class GetValuesByTypeRequest     {         [DataMember]         public string GroupName { get; set; }               [DataMember]         public ValueTypeEnum ValueType { get; set; }     }          [DataContract]     public class GetValuesByTypeResponse     {         [DataMember]         public string[] Result { get; set; }      }          [ServiceContract]     public interface IService     {         [OperationContract]         GetValuesByTypeResponse GetValuesByType(GetValuesByTypeRequest request)     }      I suppose there are cases where parameter wrappers make it easier to maintain the service over different versions of the software, since you can control serialization of each member a bit more directly than you can with the first method. But to be honest, parameter wrappers just seem like a lot more code for very little benefit. Am I wrong here?


title: python factory function best practices

text: Suppose I have a file `foo.py` containing a class `Foo`:               class Foo(object):        def __init__(self, data):           ...      Now I want to add a function that creates a `Foo` object in a certain way from raw source data. Should I put it as a static method in Foo or as another separate function?               class Foo(object):        def __init__(self, data):           ...     # option 1:        @staticmethod        def fromSourceData(sourceData):           return Foo(processData(sourceData))          # option 2:     def makeFoo(sourceData):        return Foo(processData(sourceData))      I don't know whether it's more important to be convenient for users:               foo1 = foo.makeFoo(sourceData)      or whether it's more important to maintain clear coupling between the method and the class:               foo1 = foo.Foo.fromSourceData(sourceData)


title: Prevent Click Fraud in Advertisement system with PHP and Javascript

text: I would like to build an Advertising project with PHP, MySQL, and Javascript. I am talking about something like...   * Google Adsense   * BuySellAds.com   * Any other advertising platform My question is mainly, what do I need to look out for to prevent people cheating the system and any other issues I may encounter? My design concept. An Advertisement is a record in the Database, when a page is loaded, using Javascript, it calls my server which in turn will use a PHP script to query the Database and get a random Advertisement. (It may do kore like get an ad based on demographics or other criteria as well) The PHP script will then return the Advertisement to the server/website that is calling it and show it on the page as an Image that will have a special tracking link. I will need to...   * Count all impressions (when the Advertisement is shown on the page)   * Count all clicks on the Advertisement link   * Count all Unique clicks on the Advertisement link My question is purely on the query and displaying of the Advertisement and nothing to do with the administration side. If there is ever money involved with my Advertisement buying/selling of adspace, then the stats need to be accurate and make sure people can't easily cheat the system. Is tracking IP address really the only way to try to prevent click fraud? I am hoping someone with some experience can clarify I am on the right track? As well as give me any advice, tips, or anything else I should know about doing something like this?


title: How to deal with almost the same enums?

text: I need to define **enums** in several classes. The **majority** of fields are the same in all of the enums. But one has one or two more fields, another has fewer fields. Now I wonder what is the best way to deal with this?   1. Create separate enums              public enum Foo {field1, field2, field5 };     public enum Bar {field1, field2, field3, field4 };        2. or use a general enum for them all               public enum FooBar {field1, field2, field3, field4 , field5};      The enumerations contain the list of actions available for each class. **Update** : sorry if the question was not clear enough . I want to use these enums as `parameters` in classes **methods** . for example `classOne` has a method as below :               public void DoSomeThing(Foo action,object moreData)     {         // operation desired     }      here I want **action** to be limited to `Insert` , `Update` and `Delete` while in `classTwo` :               public void DoSomeThingElse(Foo action)     {         // operation desired     }      I want to limit **action** availabe to `Insert` and `Select`


title: Is programming in the real world much less about programming itself?

text: I am in the second year of my CS degree, and so far most of the projects I worked on were pretty "programming intensive", which I like. For example, developing a Sudoku solver, creating a database management system from scratch in C, implementing algorithms to find the shortest routes between cities and so on. Recently I started working on some projects outside of my academic environment. Those include a web app and a couple of Android ones, which I shipped and got some people using. What I noticed with those "real world" projects is that I spend much less time programming, and a lot more time learning about the platforms, searching the web for that library I need, trying stuff until it works the way I need, learning to use tools that might help on the project and so on. In other words, I end up writing 5 to 10 lines of code per day because the rest of the time is spent learning auxiliary stuff. **My question** : Is this normal for real world projects, or once you master the platform you are working with you'll go back to programming intensive work?


title: One huge rails webapp or many small webapps?

text: We have a huge system to develop, it has 3 main functions:   1. API provider   2. Worker to automated data retrieval   3. Management of data built in workers They all share the same DB, but for scalability purposes we have at least one server for each function, that means initially we have thought on this server structure:   1. 1 server for DB (postgresql)   2. 1 server for load balancer (nginx + management section)   3. N servers for API providers (sinatra app)   4. N servers for workers (sidekiq or Resque) My problem with that is to handle migrations and models which I stated here on SO. Because I haven't found any solutions that we liked I started to think on build one rails app and ship everything inside of it (drop the sinatra and leave everything for the rails app)   1. Is this a good solution, to build a huge rails app and slicing it on each server?   2. Is this a good idea, to leave just the minimal code necessary to run a server?


title: How should I make progress further as a programmer?

text: I have just left my college after doing graduation in computer engineering,during my college life I tried to do some freelancing in local market.I succeeded in the last year and earned some small amounts based on joomla,wordpress and visual basic based job.I had some small projects on php,mysql also. After finishing my undergrad life,I sat for an written test for post of python programmer and luckily I got the job and is working there(Its a small software firm do most of the task in python).Day by day I have gained some experience with core python. Meanwhile an USA based web service firm called me for the interview and after finishing three steps(oral+mini coding project+final oral)they selected me(i was wondered!).And I am going to join their with in few days.There I have to work in python(based on Django framework,I know only basic of this framework). My problem is when I started to work with python simultaneously I worked in Odesk as a wordpress,joomla,drupal,php developer. Now a days I am feeling that I am getting "Jack of all trades master of none". My current situation is i am familiar with several popular web technologies but not an expert.I want to make myself skilled. How should I organize myself to be a skilled web programmer?


title: What kinds of non-source artifacts are vital to your development process?

text: The "classic" development artifacts are requirements documents and design specifications. But the development process includes many other non-source code artifacts: bug tracking databases, emails, wikis. What kinds of non-source code artifacts do you think are most vital to your development process? And how do you keep these documents up to date? Also, are there any artifacts that you don't necessarily find useful, but have to use because it's required by the contractor or management?


title: How do I improve my memory and recall?

text: How do I go about improving my memory and recall as it relates to Programming? I have a tendency to cache API information short term and then immediately put it out of my head as I move on to something else. This sometimes makes me look bad as I can't recall API information on code I should be really familiar with. It also can be a big time sink, as I often know that I can do something with an API, but I have to look up the specifics on how to actually do it. Are there any tools or methods I could use to make up for my memory short comings?


title: How to release bundled software with different licenses?

text: Recently, I was in a situation where I wanted to release a simple piece of JavaScript software under an open source license. However, I withdrew from it because the software contained several open source components that were released under different licenses. Under what license should the bundled software be released (given that various third party components are mixed into the software at code level)?


title: iOS NSError with global handler

text: I am in the beginning of programming an iOS app. Having read the Apple guides on how to deal with errors, I got the following most important points:   * Exceptions are for programmers   * Use `NSError` for the user Now, `NSError` is usually passed as out-argument which can then be used inside and has to be checked by the caller. However, I'm asking myself whether it is a good idea to use a global error handler, say a singleton which wraps around `NSError` and could be used to trigger errors and error handling from within the called function. Is there anything against that method or would it be a bad practice?


title: how to ask questions about bad practices in stackoverflow ( or other technical forums)

text: I had a case when I needed to do something in code that **I knew is a bad practice**. but because of a unique situation and after considering the risks thoroughly decided that is worth it. I cannot start explaining all my considerations that include buisness secrets over the internet but I do need technical assistance. when I tried to ask at SA I got heated responses why it is a bad practice instead of answeres to how to do this. poeple are so conserned about what is the right way to write code that they forget that there are other considerations as well. can anyone provide insight of how to correctly ask such a question in order to avoid "this is a bad practice" answers and get real answers?


title: Code review revenge

text: In the company where I work we are doing code reviews. I gave some negative comments about the code (code duplication) of programmer A. My commit was OK and ready to merge and then programmer A added negative comments to my code in revenge. What do you think about this kind of situation?


title: Does the usage of LINQ and Lambda Expressions lead to less readable code?

text: I'm having a discussion with a co-worker on Linq, I'll copy here: > Co-Worker: Lets be honest here. Linq syntax sucks. It's confusing and non- > intuitive. > > Me: oh come on, more confusing than T-SQL? > > Co-Worker: uh, yes. > > Me: it has the same basic parts, select, where, and from > > Co-Worker: Linq, to me, is a bastardization of relational + OO. Co-Worker: > Don't get me wrong - it's incredibly powerful, but they repurposed SQL to > use agains object collections. I'm of the opinion that using Linq + Lamda's is very powerful (he agrees), and also makes code easier to read (he disagrees on that point):               pickFiles = from f in pickFolder.GetFiles("*.txt")     where ValidAuditFileName.IsMatch(f.Name)     select f;      or               var existing = from s in ActiveRecordLinq.AsQueryable<ScannedEntity>()     where s.FileName == f.FullName && s.DocumentType != "Unknown"     select s;      or (VB code here)                  Dim notVerified = From image In images.AsParallel          Group Join verifyFile In verifyFolder.GetFiles("*.vfy").AsParallel.Where(           Function(v) v.Length > 0           ).AsParallel        On image.Name.Replace(image.Extension, ".vfy") Equals verifyFile.Name          Into verifyList = Group         From verify In verifyList.DefaultIfEmpty         Where verify Is Nothing         Select verify      To me this is clean and easy (at least easier than the alternatives) to read, what are your opinions on it?


title: Django - Using a JSON string as an attribute map to avoid subclassing

text: I have a Django model called Entity. Different types of Entity have different attributes (e.g. some have a currency associated with them, others don't). I'd rather not have to create a new subclass for every permutation of attributes. **Question** : Is it a bad design decision to create a CharField or TextField called "attributes" that uses a JSON-encoded map with the attribute names and values for a given entity? For the purposes of the answer, assume that I don't have many Entity records (~8,000) or users (~100 at one time, worst case) to deal with, so I'm not sure if the performance hit from dealing with a JSON object is a big problem.


title: Is it necessary to create a database with as few tables as possible

text: Should we create a database structure with a minimum number of tables? Should it be designed in a way that everything stays in one place or is it okay to have more tables? Will it in anyway affect anything? I am asking this question because a friend of mine modified some database structure in mediaWiki. In the end, instead of 20 tables he was using only 8, and it took him 8 months to do that (it was his college assignment). **EDIT** I am concluding the answer as: size of the tables does NOT matter, until the case is exceptional; in which case the denormalization may help. Thanks to everyone for the answers.


title: How to model future iPhone application GUI?

text: Say you're working on designing the world's greatest iPhone app. How do you decide what UI would be more effective, would be more intuitive etc? How do you take an idea and decide how to visually represent it? Do you use any programs (on a mac) to model something like that?


title: How is the router configuration gui designed and implemented?

text: It's a rather simple concept, and each vendor seems to have their own "Website" for their config. I am curious to find out a few things. In my linksys router, if I go to 192.168.1.1, it asks for a simple log in, followed by the status page. Here ports/passwords and all that can be completely changed. What's interesting is how the firmware updater works. You can click upload, drop in their new firmware, and it presumably flashes the device. What technologies / frameworks would be ideal for creating my own custom router page? I've seen a custom one (Tomato).


title: Microsoft Public License Question

text: Let preface this by saying that I understand that any advice I may receive is not to be taken as 100% correct, I am just looking for what people's understand of what this license is. I have been looking for a library that allow be to deal with archived compressed files (like zip files) and so far the best one I have found is DotNetZip. The only concern I have is that I am not familiar with the Microsoft Public License. While I plan to release a portion of my project (a web application platform) freely (MIT/BSD style) there are a few things. One is that I don't plan on actually releasing the source code, just the compiled project. Another thing is that I don't plan on releasing everything freely, only a subset of the application. Those are reason why I stay away form (L)GPL code. Is this something allowed while using 3rd party libraries that are licensed under the Microsoft Public License? **EDIT**   The part about the Microsoft license that concerns me is Section 3 (D) which says (full license here): > If you distribute any portion of the software in source code form, you may > do so only under this license by including a complete copy of this license > with your distribution. If you distribute any portion of the software in > compiled or object code form, you may only do so under a license that > complies with this license. I don't know what is meant by 'software'. My assumption would be that 'software' only refers to the library included under the license (being DotNetZip) and that is doesn't extends over to my code which includes the DotNetZip library. If that is the case then everything is fine as I have no issues keeping the license for DotNetZip when release this project in compiled form while having my code under its own license. If 'software' also include my code that include the DotNetZip library then that would be an issue (as it would basically act like GPL with the copyleft sense).


title: Can continuous delivery work in a big enterprise environment with lots of connected systems?

text: Much has been said lately of continuous delivery. It does sound appealing, but runs against the grain of convention wisdom in big corporations.   * Jez Humble - Continuous Delivery   * Thoughtworks Presentation - Continuous Delivery - Part 1   * Thoughtworks Presentation - Continuous Delivery - Part 2 Assuming the following:   * You have a number of remote systems connected via ESB   * You have an established system with several years of coding changes applied to it   * This is a website that allows financial transactions   * There are multiple backend systems responsible for processing different types of transactions   * Currently production releases assume a multi $10K investment in a manual regression test Can Continuous Delivery be implemented in such an environment? (ie is the underlying assumption behind Continuous Delivery that you invest a large amount in automated regression testing that is coordinated across systems?) (Surely automated unit tests can prove a system is not incorrect, but can't prove it is correct).


title: Learning basic graphics programming

text: After learning the basics of computing simple die throwing games and calendar applications, I want to explore simple graphics - drawing and moving around geometric objects is ok to start with, eventually adding pixel graphic of course. I've taken an introductory Java course but would rather do it in C++, Python or a combination of them (that's what we will eventually be using in school). I also want to learn the principles behind it, not just blindly applying incomprehensible syntax to make the compiler happy. Some posts seem to imply SFML is a solid choice, so I thought I'd get a book covering it and work through it, but there only seems to be ONE book on SFML available, and that one hasn't been reviewed at all. Not in the mood for a $30 gamble, so I'm feeling kind of lost! How should I approach learning basic graphics programming?


title: What does it mean for the JSON interchange format to have a license?

text: A recent flurry of comments on a JSHint issue alerted me to the fact that the JSON data-interchange format has a license. The content of this license can be debated elsewhere. What I'm unclear on is what it means for JSON (or any other data-interchance format) to have a license. If an a library simply consumes and parses JSON, does it have to include this license? I understand that using a library that contains this license would require a user to include it. I'm talking about writing a library from scratch. What if I have to use JSON because a third party service only communicates via JSON. If I'm serializing and deserializing data according to the RFC, do I still need to refer to the license?


title: Is there a title for someone who is both a Software Developer and a Business Analyst?

text: I usually see two job titles in the IT industry. My understanding of their most commonly accepted usage (simplified):   * **Business Analyst:** Main role is eliciting the users' needs   * **Software Developer** Main role is to design, build and test a software solution answering the needs I'm wondering: " _How we should call somebody whose role is to do both of the roles above?_ " Is this a common job title? And is trying to find people with these broadness of skills realistic, difficult? **EDIT:** I'm specifically interested to name Lead Software Developers who have eventually learned and can apply techniques of Business Analysis.


title: Tracking work history in a git repo

text: **Previous related questions:**   * Code bases for desktop and mobile versions of the same app   * Git branching and tagging best practices **Question:** I have split my repo into three directories (swing, android, and common) as suggested by @KarlBielefeldt in response to my previous question. Now I am jumping back and forth between developing my Android port and tweaking/adding features to my original Swing app. All of my commits are linear (fast-forward) and only my commit messages give hints indicating whether I'm working on my Swing app or my Android app. Is there a better way to keep track of the work flow in my git repo?


title: Learn to Program by Chris Pine book question

text: I don't know where to post this, so sorry if this is the wrong place. I bought the book Learn to Program by Chris Pine on my iPad, I will be travelling for about two days so want to read this book and learn to program obviously but won't have access to a computer so is it worth reading this book while travelling? I flicked through it and has some exercises so was wondering what I should do. thanks


title: Representing a parent/child hierarchy in a Relational Database

text: I am working on an application that connects to another application (Quickbooks) using an API by sending/receiving XML requests/responses. I am able to work with the data in the XML response and load it into a datatable in c#, so that's not the issue. What I am looking to do is write the data from the Quickbooks XML file to a relational database such as SQL Server so I can make it available to a web app or other applications. The problem I am having is that for the Accounts object, there are multiple child entities (up to 5) for a given parent. For example:   * Parent: Revenues    * Child: Charitable Donations   * Sub-Child: Homeless Shelter   * Sub-Sub-Child: Seattle Mission   * Sub-Sub-Sub-Child: Food This example is a bit extreme, as the particular file I'm working with only goes out to three levels, but a maximum of five is allowed by Quickbooks (thus I'm trying to come up with a solution that would scale well). When I create my datatable in C# from the data in the XML file, I have two columns: ParentID, ChildID. It would look like this:               ParentID     ChildID     Account               Balance     --------     -------     -------               --------     001          002         Revenues              45670     002          003         Charitable Donations   1500     003          004         Homeless Shelter        800     004          005         Seattle Mission         400     005          NULL        Food                    200      In this example, I am able to determine all of the child IDs of a parent, and then look to the ParentID with that ChildID and see if that child has any children, etc. I have a method which does a fairly good job of parsing through that, and it works fine for the time being, but is this really the best way to store it in a database if I wanted to permanently house the data in a relational database? It seems like there should be a more elegant solution, but I'm not sure what that would be.


title: How big does my project need to be for me to unit test it?

text: I assume that my project is decoupled enough to allow for unit testing. But how big, exactly, in terms of clases and functions does my project need to be to make unit testing worthwhile? We all make mistakes and no one's perfect, but I consider myself a decent programmer to handle small projects' errors with stepping through. Or is unit testing a hard necessity no matter of what size your project is?


title: Is donationware non-commercial?

text: I use quite some "non-commercial" applications when working on software projects. For clarification, I mean developing **applications** here, for example smartgit, **not libraries** or anything that gets shipped. Is it legal to provide a donation button for projects made using the non- commercial of certain applications? I know, I know, "consult a lawyer". Here's the real world: I'm a 16 year old hobbyist programmer that doesn't have the time nor money to consult one - a quick question on the internet would probably be a better idea.


title: Is there an industry standard for structuring code and comments?

text: I've worked with a number of professional teams and it seems that class code structure ranges from highly organized to completely cluttered. I did a project with the State of California recently and they required using specific Regions in my VB code, along with inline XML comments for auto-docs. It was very structured, but in many classes, there was more commenting than code. I'm just curious if there is an industry standard for code structure and commenting. **EDIT** Maybe a more appropriate question would be, what are some good practices to adopt for readability and maintenance and why? I want to set good coding habits early.


title: Google Summer of Code Experience

text: I was a Google Summer of Code student this year and successfully completed my project. It was an awesome learning experience. Just wondering, from an industry point of view - how is or how well is a Summer of Code experience viewed? I mean, if you were going to hire me, would it mean anything to you? I am just asking this since doing SoC != an internship. As a SoC student, I was a independent contractor for Google. Sure, there was proper development, but I am interested in looking at it from the experience you guys have here. Would you prefer me? Sorry for not revealing my name; I'd hope you understand.


title: Using a web framework as python GUI

text: If I built some useful piece of python code to e.g. scrape a website or to calculate something big, at some point I might want to add a GUI to my project. For this I could use Tk, Qt, Pygame or any python graphic/GUI framework. Now I also want this tool to be usable by clients without the need for a python installation. Of course I could use something like py2Exe or py2Dmg. But wouldn't it be cooler to use a python-based web framework for this? Something like Django or Pyramid. What would be the drawbacks of doing this? Can I just use the framework to execute my code on a server and only return the result? Or will this get tricky when there are multiple users?


title: Have you ever done a project using a languages that is not the mainstream choice for the specific niche of the project? Why?

text: I was thinking about my academic experience with Smalltalk (well, Squeak) a while ago and whether I would like to use it for something, and it got me thinking: sure, it's as good and capable as any popular language, and it has some nice ideas, but there are certain languages that are already well entrenched in certain niches of programming (C is for systems programming, Java is for portability, and so on...), and Smalltalk and co. don't seem to have any obvious differentiating features to make them the right choice under certain circumstances, or at least not as far as I can tell, and when you add to it the fact that it's harder to find programmers who know it it adds all sorts of other problems for the organization itself. So if you ever worked on a project where a non-mainstream language (like Smalltalk) was used over a more mainstream one, what was the reason for it? To clarify: I'd like to focus this on imperative languages.


title: where to get CodeIgniter views from

text: I just started using CodeIgniter I'm wondering if anyone knows where I can download pre-made views. For example right now I'm looking for an admin interface. I could write the code myself but I'm feeling lazy ;) Is there a place where you can get pre-made templates like you can for most CMS's? Thanks!


title: Can a shop score 12 on the Joel Test and yet be anything but Agile (or Lean)?

text: Inspired by this question - can an agile shop really score 12 on the Joel Test: Can you come up with explanations or examples where a software development organization satisfies **technically** all 12 points of the Joel Test, but fails to live up to the agile or lean principles?


title: Why are some classes or methods not "parameter compulsory" in java

text: Question title can be a little confusing but I didn't have a better way to put to put it. In Java you can have this:               JLabel HoHoHo = new JLabel();     ...     HoHoHo.setText("Ho Ho Ho");      And this:               JLabel HoHoHo = new JLabel("Ho Ho Ho");      In both cases, it gives a label with `Ho Ho Ho` on it. **Question** How is that possible? I mean, are there to JLabel classes, one with a `String` parameter and one without?


title: Software Licences Wizard

text: Is there a license "wizard" question system that asks you questions about how you would like to use the software, and then either allows you to compare it against one or more license types. Background: In asking a question that requires the open source image recognition software to have a license commercial internal distribution without release of the source code even internal to all those who have the binary... I realized that the current answer using a GPLV2 license likely mean it's a bad fit. I'd like to make the question more clear by adding a list of licenses that are known to be a fit, and those that are not a fit, but I don't even have a clue as how to do that other than to ask if there's a wizard that will help do this.


title: When are scripts inside HTML not considered a bad practice?

text: I am new to web development. While studying the Play framework and JSP, I noticed that they both give an option to place script (in jsp scriptlet) inside HTML, but in both books I am reading they both say it is bad practice and don't give an explanation as to when should I use scripts, only writing not to. My question is, if both frameworks supply such an option, when would it be ok to use scripts inside HTML? Please note, I'm talking about server side scripts for creating dynamic HTML (i.e. JSP scriptlet).