title: Metrics / Methodology for estimating resource utilization for software in planning stage

text: I'm looking for approaches to estimate the resource utilization of an (web-)application in a JEE environment. The overall target is to get a forecast for hardware/software requirements while the application is still under development or even in planning stage.   Is this task too complex (many different factors) to get a fairly reliable proposition without spending too much time?


title: External file (images, sounds) naming convention at Xcode

text: * What is better naming conventions at Xcode regardng External File (images, sounds) etc?   * Is there any guideline from vendor Apple?   * As we store our projects at SVN, is there any complicity from Hosted Server (we use Linux + Server SVN ) ?


title: What is the difference between K&R and One True Brace Style (1TBS) styles?

text: I have read the Wikipedia article on Indent Styles, but I still don't understand. What is the difference between K&R and 1TBS?


title: What factors influence you to try out a new framework or tool?

text: I'm in the process of putting the final touches on an open-source framework that I hope to release in the next few months. It's something that I'd like to develop a community for and so I'm curious about what factors influence your decision to use a new framework or tool and why. Some of the specific things I'd like to know more about (feel free to add to this):   * Types of documentation/tutorials/instruction   * Community support (comments/forum)   * Updates (blog/social media/feeds)   * Look and feel of the project website design   * White papers/testimonials   * A big feature list   * Community size   * Tools   * Ability to contribute   * Project test coverage (stability/security)   * Level of buzz (recommended by friends or around the web)   * Convincing marketing copy Ideally, I'd like to have all of the above, but what specific features/qualities will carry greater weight in getting programmers to adopt something new? **What says, 'This is a professional-grade project,' and what are red flags that keep you from trying it out?**


title: Planning Before Starting a Project

text: How much planning should one do before starting a project? Should they have everything already planned when they begin coding or should they just get a basic idea of what they want and then make things up on the fly? For instance, I want to create a YouTube client that allows for streaming videos and for downloading multiple videos simultaneously (similar to Minitube). I know what I want the interface to look like when the program is first opened. Is this enough for now? Should I create this and then plan the next step or should I continue planning? How much planning is enough?


title: What traits do the best managers you've worked for have in common?

text: I have been listening to Scott Hanselman and Rob Conery's podcast, This Developer's Life. In the latest episode, they discuss personality traits: > 1.0.4 - Being Mean. > > What makes people mean in our industry? What about aggressive? Confident? > What's the difference? Would you rather have a drill sergeant for a boss, or > a zen master? We talk to Cyra Richardson and Giles Bowkett. It got me thinking, what traits did the best managers _you've_ worked for have in common? EDIT: Just to clarify, as there have been a few close votes, I'm interested in whether there are traits common to managers of developers that are not necessarily those traits that a manager of some other profession requires. As for whether this is programming related or not, well I don't want to ask this question on a site that isn't about programming because, frankly, I'm not as interested in what people who make cans of soup for a living want from their managers as I am interested in what _developers_ want from their managers.


title: Do you handle Out-Of-Memory conditions?

text: What do you do when `malloc` returns 0 or new throws exception? Just halt or try to survive OOM condition/save the user's work?


title: How to handle large scale js+jquery projects using well written, Object-Oriented JavaScript and jQuery code?

text: I love the whole user experience/interface thing and put a lot of jQuery and JavaScript (pure JavaScript for HTML5 stuff, like canvas, file API, etc). The problem I face now is that my codes are growing large, 3-4 files per project with each file around 1000 lines of code, and maintaining and extending them is becoming a headache. I know that Object-Orientated JavaScript coding can solve a lot of my problems. I know the basic concepts of Object-Orientated Programming, have done a decent amount of it in C++, Java and Python in school and college projects. I want to read some good examples large scale OO programming in JavaScript (and jQuery), or if possible, some book specifically on writing big OO programs in JavaScript. EDIT1: Checked out backbone.js, guess thats what i needed, will be sure once i use it in my next project, thanks Raynos, also, my question should have been about handling large js projects, and not what it is, sry


title: Finding a new job when my skillset isn't matching the job ads

text: I am a C++ programmer and have worked on various web apps using Perl, Ruby, etc.. I have decent a knowledge of Java as well. The problem I face while applying for jobs is companies have specific requirements like, "Experience with C# 3.5/4. Should have experience experience building web apps with ASP.NET". What should you do in these situations?   1. Not consider these companies and look for companies with your expertise?   2. Just put that in your resume, and learn the technology before interviews? After all, how hard is it for a developer to wrap their brains around new languages?   3. Try to convince the employer in the cover letter that you are good at one thing but can a learn a new language a tool pretty easily?   4. Something else?


title: Priority list of tasks stored in a database

text: I am trying to think of the best way to do the following: I have a list of tasks stored in the database. A task has a priority assigned to it. You can change the priority of a task to reorder the order they should be carried out. I am thinking of something very similar to Pivotal Tracker. So imagine we had the following:               1 Task A     2 Task B     3 Task C     4 Task D     5 Task E      We decide that E is now the most important task               1 Task E     2 Task A     3 Task B     4 Task C     5 Task D      I need to update all 5 tasks to give them a new priority. If Task B then becomes more important then A I would I would have               1 Task E     2 Task B     3 Task A     4 Task C     5 Task D      I need to update Task B and A only. What ways would go about structuring this in a DB? I imagine that you would have a differnt projects stored in the same table that would have there own weight. Would it be better to point a Task that takes place after it (a bit like a link list). This is just a brain dump really. Just was wondering how you would go about implementing something like this.


title: How to develop custom functions on top of Ejabberd?

text: I'm developing a real time chat app. After searching around for a while, I found Ejabberd and Erlang is a good option. The question is the Ejabberd is not providing all the functions I need. I need some custom features such as location based matching and anonymous login. So how to development custom functions on top of Ejabberd? write modules for it? or develop another standalone server app (web or other kind of server app) to interact with it? Thanks!


title: what are the benefits of closure, primarily for PHP?

text: I am beginning the process of moving code over to PHP 5.3 and one of the most highly touted features of PHP 5.3 is the ability to use closures. My understanding of closures is that they allow anonymous functions, can be assigned to variable names, and have interesting scoping abilities. From my point of view the only seeming benefits in real world applications is the reduction of clutter in the namespace because closures are anonymous. Am I wrong in this? Should I be trying to put closures wherever I code? **EDIT** : I have already read this post on Javascript closures.


title: Does your team function well without following a work methodology (such as scrum)?

text: I've worked in a number of small teams over the last 9 years. Each had the obvious good practices, such as short meetings, revision control, continuous integration software, issue tracking and so on. In these 9 years, I've never heard much about development methodologies; for example, there's never been a "we're doing scrum", or "lets do agile", or anything more than a passing reference. All of the teams seemed to function fine, without following much process, we were just freeflowing and just naturally worked well. Has anyone else progressed for long periods of time without encountering scrum/agile/etc? The only exposure I've had to these is through sites like this one. I read questions like http://programmers.stackexchange.com/questions/16905/sprint- meetings-what-to-talk-about ... and all the talk seems to describe almost robotic like people who follow a methodology finite state machine. Is it really (though exaggerated) like that? I wonder if the people posting on the internet just loud supporters of "best practice", with similar textbook views, not really reflecting how people work... Or that I've encountered some teams making their processes up naturally. Furthermore (I am in the UK, which may be relevant)... I think if a methodology were introduced to any of the teams I'd work on, they'd just reject it as being silly and unnecessary... then carry on. I'd tend to agree, following processes seems a bit unnatural. Is this typical or common?


title: How can I measure my competency level or skill-set in ASP.NET?

text: > As a ASP.NET developer with 5+ year experience. I like to measure my > competency level in ASP.NET & SQL Server. Basically my goal is to raise my > competency level and skill-set in ASP.NET; before that I need to know what > is my level considering current ASP.NET and related technologies... Please provide some pointers...   * Is there are any skill-set measuring Quiz or exam, which account experience and technology ?    * How do you measure your or your junior developers skills or competency? Note: This question was originally asked in SO, I am reposting here to get more input.


title: What does it mean if a job requires a "Bachelor's degree in Computer Science or related field"?

text: Specifically, what is meant by "related field"? I'm in the process of pursuing an IT Infrastructure B.A.S. from the U of M (Twin Cities), but have been playing around with the idea of just doing the CSCI B.S. I don't want to be a hardcore programmer, but would having the CSCI degree, instead of the ITI degree, open more doors to whatever profession within the IT world I end up setting my sights on?


title: Is having a switch to turn mocking on or off a code smell?

text: I have a method that looks like this:               def foobar(mock=False, **kwargs):         # ... snipped      `foobar` actually makes several calls to Amazon S3 and returns a composed result. In order to make this testable, I introduced the `mock` parameter to turn off making live network connections. It feels like a code smell for me but testability is also very important. What else can I do if I want to do away with the parameter ?


title: Using static classes as namespaces

text: I have seen other developers using static classes as namespaces               public static class CategoryA     {         public class Item1         {             public void DoSomething() { }         }         public class Item2         {             public void DoSomething() { }         }     }          public static class CategoryB     {         public class Item3         {             public void DoSomething() { }         }         public class Item4         {             public void DoSomething() { }         }     }      To instantiate the inner classes, it will look like the following               CategoryA.Item1 item = new CategoryA.Item1();      The rationale is that namespaces can be hidden by using the "using" keyword. But by using the static classes, the outer-layer class names have to be specified, which effectively preserves the namespaces. Microsoft advises against that in the guidelines. I personally think it impacts the readability. What are your thoughts?


title: Why is Conway's "Game of Life" used for code retreats?

text: Code Retreat is an all-day training event that focuses on the fundamentals of software development. There's a "global" code retreat day coming up, and I'm looking forward to it. That said, I've been to one before and have to say there was a huge amount of chaos... which is fine. One thing that I still don't get is why the "Game of Life" is a good problem for TDD, and what good and bad TDD for it feels like. Realize this is a pretty open ended question, so feel free to comment.


title: Which of these algorithms is best for my goal?

text: I have created a program that restricts the mouse to a certain region based on a black/white bitmap. The program is 100% functional as-is, but uses an inaccurate, albeit fast, algorithm for repositioning the mouse when it strays outside the area. Currently, when the mouse moves outside the area, basically what happens is this:   1. A line is drawn between a pre-defined static point inside the region and the mouse's new position.    2. The point where that line intersects the edge of the allowed area is found.    3. The mouse is moved to that point. This works, but only works _perfectly_ for a perfect circle with the pre- defined point set in the exact center. Unfortunately, this will never be the case. The application will be used with a variety of rectangles and irregular, amorphous shapes. On such shapes, the point where the line drawn intersects the edge will usually not be the closest point on the shape to the mouse. I need to create a new algorithm that finds the _closest_ point to the mouse's new position on the edge of the allowed area. I have several ideas about this, but I am not sure of their validity, in that they may have far too much overhead. While I am not asking for code, it might help to know that I am using Objective C / Cocoa, developing for OS X, as I feel the language being used might affect the efficiency of potential methods. My ideas are:   * Using a bit of trigonometry to project lines would work, but that would require some kind of intense algorithm to test every point on every line until it found the edge of the region... That seems too resource intensive since there could be something like 200 lines that would have each have to have as many as 200 pixels checked for black/white....   * Using something like an A* pathing algorithm to find the shortest path to a black pixel; however, A* seems resource intensive, even though I could probably restrict it to only checking roughly in one direction. It also seems like it will take more time and effort than I have available to spend on this small portion of the much larger project I am working on, correct me if I am wrong and it would not be a significant amount of code (>100 lines or around there).   * Mapping the border of the region before the application begins running the event tap loop. I think I could accomplish this by using my current line-based algorithm to find an edge point and then initiating an algorithm that checks all 8 pixels around that pixel, finds the next border pixel in one direction, and continues to do this until it comes back to the starting pixel. I could then store that data in an array to be used for the entire duration of the program, and have the mouse re-positioning method check the array for the closest pixel on the border to the mouse target position. That last method would presumably execute it's initial border mapping fairly quickly. (It would only have to map between 2,000 and 8,000 pixels, which means 8,000 to 64,000 checked, and I could even permanently store the data to make launching faster.) However, I am uncertain as to how much overhead it would take to scan through that array for the shortest distance for _every single mouse move event_... I suppose there could be a shortcut to restrict the number of elements in the array that will be checked to a variable number starting with the intersecting point on the line (from my original algorithm), and raise/lower that number to experiment with the overhead/accuracy tradeoff. Please let me know if I am over thinking this and there is an easier way that will work just fine, or which of these methods would be able to execute something like 30 times per second to keep mouse movement smooth, **or** if you have a better/faster method. I've posted relevant parts of my code below for reference, and included an example of what the area might look like. (I check for color value against a loaded bitmap that is black/white.)               //     // This part of my code runs every single time the mouse moves.      //          CGPoint point = CGEventGetLocation(event);               float tX = point.x;     float tY = point.y;          if( is_in_area(tX,tY, mouse_mask)){              // target is inside O.K. area, do nothing     }else{          CGPoint target;           //point inside restricted region:     float iX = 600; // inside x     float iY = 500; // inside y               // delta to midpoint between iX,iY and tX,tY     float dX;     float dY;          float accuracy = .5; //accuracy to loop until reached          do {         dX = (tX-iX)/2;         dY = (tY-iY)/2;              if(is_in_area((tX-dX),(tY-dY),mouse_mask)){                  iX += dX;             iY += dY;         } else {                  tX -= dX;             tY -= dY;         }          } while (abs(dX)>accuracy || abs(dY)>accuracy);              target = CGPointMake(roundf(tX), roundf(tY));         CGDisplayMoveCursorToPoint(CGMainDisplayID(),target);          }      Here is "is_in_area(int x, int y)" :               bool     is_in_area(NSInteger x, NSInteger y, NSBitmapImageRep *mouse_mask){              NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];              NSUInteger pixel[4];         [mouse_mask getPixel:pixel atX:x y:y];              if(pixel[0]!= 0){             [pool release];             return false;         }         [pool release];         return true;     }      ![bitmap for the "allowed area" \(allowed area is black\)](http://i.stack.imgur.com/MHaNC.png)


title: CQRS without using others patterns

text: I would like to explain CQRS to my team of developers. I just can't figure out how to explain it in the simplest way so they can implement the pattern rapidly without any others frameworks. I've read a lot of resources including video and articles but I don't find how to implement CQRS without using others patterns like a service Bus, event sourcing pattern, domain driven design. I know the purpose of these pattern but for the first step, I don't want them to think CQRS and these patterns must be tied together. My first idea is to say that CQRS is about separating the read part and the write part. The read part is composed only of the UI project, and DAL project. Then the write part is composed of a typical multilayer architecture: UI/BLL/DAL. Then, does CQRS say we must also have two datastore ? What about the notion of commands which reveal the user's intention, is it also something part of CQRS or DDD ? Basically, how to implement CQRS without using others patterns. I concede it's also not that clear in my mind because I've used to work with NCQRS/DDD/Event Sourcing/ServiceBus in my personal project.


title: Is OOP becoming easier or harder?

text: When the concepts of Object Oriented Programming were introduced to programmers years back it looks interesting and programming was cleaner. OOP was like this               Stock stock = new Stock();     stock.addItem(item);     stock.removeItem(item);      That was easier to understand with self-descriptive name. But now OOP, with pattern like Data Transfer Objects (or Value Objects), Repository, Dependency Injection etc, has become more complex. To achieve the above you may have to create several classes (e.g. abstract, factory, DAO etc) and Implement several interfaces Note: I am not against best practices that makes Collaboration, Testing and Integration easier


title: HTML5 file API or Java bridge to acces to local Files?

text: I've to access to files on the software user and I don't know if it's better to use a full JS app with HTML5 File Api rules or use Java and communicate with it ?


title: What does a programmer really need to become a professional?

text: There are huge numbers of programmers, especially juniors, who need good assistance in becoming professional. I've heard a lot of about "books every programmer should read", etc. I have two years of programming experience, feel good in C++, but currently have a strange feeling, that I do not know anything about programming. I should read Algorithms by Cormen, Code Complete by McConnell etc., but I don't know the exact steps required to become a professional. What should we do? What should we learn? Operating systems? Computer organization? Algorithms? C++ in depth? How much time do we have to spend to become what we want?


title: Inheritance: Is code from superclass virtually *copied* to subclass, or is it *referred-to by subclass*?

text: Class `Sub` is a subclass of class `Sup`. What does that mean practically? Or in other words, what is the practical meaning of "inheritance"? **Option 1:** The code from Sup is virtually _copied_ to Sub. (as in 'copy- paste', but without the copied code _visually_ seen in the subclass). Example: `methodA()` is a method originally in Sup. Sub extends Sup, so `methodA()` is (virtually) copy-pasted to Sub. Now Sub has a method named `methodA()`. **It is identical to Sup's`methodA()` in every line of code, but entirely belongs to Sub - and doesn't depend on Sup or is related to Sup in any way.** **Option 2:** The code from Sup isn't actually _copied_ to Sub. It's still only in the superclass. But that code can be accessed through the subclass and can be used by the subclass. Example: `methodA()` is a method in Sup. Sub extends Sup, so now `methodA()` can be accessed through Sub like so: `subInstance.methodA()`. But that will actually invoke `methodA()` in the superclass. Which means that **methodA() will operate in the context of the superclass, even if it was called by the subclass.** **Question: Which of the two options is really how things work? If none of them is, than please describe how these things actually work.**


title: What do you do to convince your boss to update your development environment?

text: I've barely succeeded in this, I'm just wondering how you convinced your boss to update and if you're faring better than me. Here's where I stand:   1. I'm using Delphi 7.   2. We've bought Delphi 2009 for each programmer.   3. I'm still using Delphi 7.   4. It's almost 2011 and Delphi 2010 and Delphi XE area already out. So I'm stuck in a timewarp, there are too many commitments to bother about creating bugs by updating our IDE. I have a bad feeling that when we do finally start using Delphi 2009 it'll be as obnoxious as Delphi 7. (This may be a bad generic example as there are special Unicode considerations in the 2009 update, but I'd like general answers - because I do more than just Delphi programming for my company)


title: Writing the minimum code to pass a unit test - without cheating!

text: When doing TDD and writing a unit test, how does one resist the urge to "cheat" when writing the first iteration of "implementation" code that you're testing? For example:   Let's I need to calculate the Factorial of a number. I start with a unit test (using MSTest) something like:               [TestClass]     public class CalculateFactorialTests     {         [TestMethod]         public void CalculateFactorial_5_input_returns_120()         {             // Arrange             var myMath = new MyMath();             // Act             long output = myMath.CalculateFactorial(5);             // Assert             Assert.AreEqual(120, output);         }     }      I run this code, and it fails since the `CalculateFactorial` method doesn't even exist. So, I now write the first iteration of the code to implement the method under test, writing the minimum code required to pass the test. The thing is, I'm continually tempted to write the following:               public class MyMath     {         public long CalculateFactorial(long input)         {             return 120;         }     }      This is, technically, correct in that it _really_ is the minimum code required to _make that specific test pass_ (go green), although it's clearly a "cheat" since it really doesn't even _attempt_ to perform the function of calculating a factorial. Of course, now the refactoring part becomes an exercise in "writing the correct functionality" rather than a true refactoring of the implementation. Obviously, adding additional tests with different parameters will fail and force a refactoring, but you have to start with that one test. So, my question is, how do you get that balance between "writing the minimum code to pass the test" whilst still keeping it functional and in the spirit of what you're actually trying to achieve?


title: High School Dropout - Is It Always This Difficult?

text: > **Possible Duplicate:**   >  Can someone find a job as a programmer without an education? I made a lot of mistakes when I was younger and never ended up graduating from even my ninth-grade classes (this is Canada and I'm going to admit ignorance as I'm not sure how the educational systems differ between countries). I'm 24 now and have been looking for work in regards to programming for quite some time. Everybody seems to want degrees (be it University or College) in computer programming of some kind, so that leaves me at an impasse. I don't have my high school degree, let alone one that is post-secondary. What does a guy like me do to be taken seriously as a programmer? I am self- taught, but no one seems to put much stock in that this far in Northern Ontario. I've considered coding in open-source and trying to build a portfolio out of that, but, again, I don't know if that'll be taken very seriously. I've even considered blogging about programming, if not to just have some sort of validation that I know what I'm talking about. Unfortunately, it's way too easy to pretend to know anything about **anything** these days, so I'm just wondering - are any of you drop-outs and, if so, how did you get taken seriously? Also, if there are people who hire programmers, what would someone have to do to be considered in your eyes? Thanks.


title: Are abstract classes / methods obsolete?

text: I used to create a lot of abstract classes / methods. Then I started using interfaces. Now I am not sure if interfaces aren't making abstract classes obsolete. You need a fully abstract class? Create an interface instead. You need an abstract class with some implementation in it? Create an interface, create a class. Inherit the class, implement the interface. An additional benefit is that some classes may not need the parent class, but will just implement the interface. So, are abstract classes / methods obsolete?


title: UI design and confirmation paradigm

text: I just saw this lecture by Spolsky, where he questions the need for choices and confirmation dialogs. At some point he has a MacOS settings window and he mentions that "now some are getting rid of the OK button". The window indeed has no OK (or cancel) button. Changing a setting makes it change, when you're done configuring, you close that window, period. Being a long time Windows user and a recent Mac owner, the difference is noticeable at first. I looked for the OK button for a while, only to find out, quite naturally and painlessly, that there was none. I expressed satisfaction and went on my merry way. However, I'm curious to know if this UI design pattern would succeed in the Windows-based world. Granted that if Microsoft brought it out with say Windows-8 (fat chance, I know), people would get used to it eventually. But is there some experience out there of such an approach, of changing the "confirmation paradigm" on a platform where it's so prevalent? Did it leave users (especially the non-technical ones) confused, frustrated, scared, or happy? TL;DR: Remove OK/cancel confirmation, what happens? EDIT: Mac GUI for appearance settings. ![alt text](http://i.stack.imgur.com/YtoYX.png)


title: Can we set up svn server on a local computer without any network access?

text: I want to set up an SVN repository on my computer without any network access. I am working on a code without any collaborator, so I don't want it to be publicly available. I read this post, but it suggests using online SVN repository services that give free repositories. In that case, my code will be publicly available (as is included in the terms of free plans). So I was wondering if I can set up a local server on my Windows XP machine that only I access even when I don't have any internet connection?


title: What exactly is OO reuse?

text: And why is it often talked about? Like I know what OO programming is obviously... but people always say "Oh OO reuse is the biggest programming myth ever". What exactly does this mean?


title: Are there issues with learning to program on a Virtual Machine?

text: I'm not a programmer, but financial analyst by profession who is learning how to code (Python, Django, C w/ ctypes when I need something to go really fast) in a virtual Ubuntu setup on my work laptop. Question: I just assumed that coding on a Virtual machine was no different from if Linux was my main OS. Is this a bad assumption? Is there anything I need to watch out for? Thanks, Mike


title: How to Quantify the Value of Unit Testing

text: Our organization is considering integrating unit testing into our software development workflow. I've heard lots of anecdotal stories about how it encourages better, easy to maintain, and well-planned code. As a programmer, I understand the benefits. However, in order to build consensus around using unit testing in projects that might affect customers, I would like to demonstrate its value quantitatively, in terms of saving hours of developer time. Does anyone in the community have any historical data or experience they would be willing to share as quantitative evidence in my case for unit testing?


title: Automated unit testing, integration testing or acceptance testing

text: TDD and unit testing seems to be the big rave at the moment. But it is really that useful compared to other forms of automated testing? Intuitively I would guess that automated integration testing is way more useful than unit testing. In my experience the most bugs seems to be in the interaction between modules, and not so much the actual (usual limited) logic of each unit. Also regressions often happened because of changing interfaces between modules (and changed pre and post-conditions.) Am I misunderstanding something, or why are unit testing getting so much focus compared to integration testing? It is simply because it is assumed that integration testing is something you have, and unit testing is the next thing we need to learn to apply as developers? Or maybe unit testing simply yields the highest gain compared to the complexity of automating it? **What are you experience with automated unit testing, automated integration testing, and automated acceptance testing, and in your experience what has yielded the highest ROI? and why?** If you had to pick just one form of testing to be automated on your next project, which would it be? Thanks in advance.


title: How to explain the value of unit testing

text: I want to introduce the concept of unit tests (and testing in general) to my co-workers; right now there are no tests at all and things are tested by actually performing the tasks via the UI to see the desired result. As you might imagine, the code is very tightly coupled to the exact implementation - even resulting in code that should be in a class and reused across the system being copied and pasted across methods. Due to changed requirements, I have been asked to modify a module I previously wrote and that is fairly loosely coupled (not as much as I would like, but as best I can get without having to introduce a lot of other concepts). I've decided to include a suite of unit tests with my revised code to "prove" that it works as expected and demonstrate how testing works; I'm not following true TDD as some of the code is already written but I'm hoping to follow some TDD concepts for the new code I'll have to create. Now, inevitably I'm sure I'll be asked why it's taking me more than a day or two to write the code, since parts of what I'll be interacting with already exist in the system (albeit without any tests and very tightly coupled), and when I check the code in I'll be asked just what this "Tests" project is. I can explain the basics of testing, but I can't explain the actual benefits in a way the others would understand (because they think testing requires you to run the app yourself, since often the actual UI matters in determining if the feature "works" or not). They don't understand the idea of loose coupling (clearly evident by the fact nothing is loosely coupled; there aren't even any interfaces outside of the code I've written), so trying to use that as a benefit would probably earn me a "Huh?" kind of look, and again I can't be as loose as I would like to without having to rework several existing modules and probably introduce some kind of IoC container, which would be viewed as wasting time and not "programming". Does anyone have any suggestions on how I can point to this code and say "We should start creating unit tests" without coming off as either condescending (e.g. "Writing tests forces you to write good code." which would probably be taken to mean code except mine is _bad_ ) or without making it seem like a waste of time that doesn't add any real value?


title: How do you prevent confused tests?

text: Testing code for correctness is important. Whether you do strict TDD or not, tests are really the only way a project can scale in size beyond a point where every team member can reasonably keep all the code knowledge loaded in their brains at once. After that point, tests are imperative in order to ensure future modifications don't break old logic (that or you're burning lots of resources doing the same thing manually). The majority of people understand what I've stated above -- not much to argue with there. However, without much of a CS background, there is a lot open to interpretation. Naively, _tests_ are likely to simply mean _code that runs other code_. While this is true, it doesn't paint the entire picture. Without much concern for proper testing, in my experience, people will tend to generate a bunch of **integration** or **functional** tests when asked to write **unit** tests. Whether you aren't privy to testing nuances, or whether you simply choose to ignore them (in the interest of time or because you don't like testing), the result is the same. You get a project with a bunch of "confused tests", or tests that don't really respect the line between unit, functional, and integration styles of testing. In other words, you get tests that don't have a clear purpose other than to exercise as much code as possible. This is frustrating because it becomes increasingly cumbersome to parse the result of those tests for meaningful information.   * _Did the tests fail because my remote server is down, or is my logic incorrect?_   * _Why is this "unit" test failing when I swap [un]related system component`x` for component `y`?_ And so on. How can you illustrate this distinction in a way that someone with a more engineering/get-it-done mindset can identify with? In essence, how do you make people _care_ about the distinction? Indeed, at a recent Android testing meetup at Twitter, the team asserted that full blown testing of software is a project in-and-of itself. And projects require resources. You can't just slip testing in on the side and not think much about it. _Resources must be allocated and developers must take it seriously_. That's a good start, but we can't just throw retrospective resources and attention at code that's already been written. I'm curious, what approaches work to remedy a confused test landscape, and how you can prevent confused tests from happening in the first place?


title: How do I explain the importance of NUNIT Test cases to my Colleagues

text: I am currently working in Software Development for applications including lot of Mathematical Calculations. As a result there are lot of test cases that we need to consider. We donot have any NUNIT Test case system, I am wonderring how should I get the advantages of implementing the NUNIT testing in front of my colleagues and my boss. I am pretty sure, it would be of great help for our team. Any help regarding the same, will be higly appreciated.


title: .Net community in Germany

text: I recently moved to Germany and I'm interested in what German .Net community looks like. Do you know any regularly held workshops in Germany (around Mannheim preferably)?


title: Cross border data obfuscation and how to deal with it?

text: I am currently facing a situation where I will need to obfuscate data for legal reasons (these are countrywide rules and not specific to me) I will still need to work with teams outside this area who will still need to access applications/databases for testing/deployment and so on, however the data must be fully obfuscated. What are your experiences of this scenario? e.g. Who owns what stage of the process, what access do the various parties have, how strong is the encryption, how do updates occur


title: Why isn't iostream included as a header file anymore?

text: First of all I have gone through this question Why is #include <iostream.h> bad? and there the reason was simply that it is outdated but I personally think that as a header iostream was better cos you don't have to declare objects like cout and endl in global scope cos they were already in global scope and moreover since # is not used anymore that means it does not comes under a pre-processor directive. I just need to know that why was this done? I still use turbo sometimes and am comfortable in using it in c++ programs even though gcc and g++ provide better debuggers and everything.


title: Optimization of time-varying parameters

text: I need to find an optimal set of "n" parameter values that minimize an objective function (a 2-hr simulation of a system). I have looked at genetic algorithm and simulated annealing methods, but was wondering if there are any better algorithms and guidance on their merits and limitations. With the above optimization methods I can find the optimal parameter values that hold true for the entire simulation duration. Incase, I want to find the optimal "time varying" parameter values (parameter values change with time during the 2-hr simulation), are there any methods/ideas other than making each time varying parameter value a variable to optimize? Any thoughts?


title: GitHub Organizations for a project spanning multiple repositories?

text: I've started a project that involves at least three repositories on GitHub. One of the repositories is a generic documentation-and-examples dump, and the other two contain the implementation of two programs that form the backbone of the project. Should I use a GitHub Organization to handle such a configuration?   Or should I just dump it all to my own account, along with a dozen other, completely unrelated repositories?


title: Structuring an application that reads from a .properties file

text: I have a Java app with three classes: `Foo`, `Bar` and `Baz`. All three depend on a bunch of what are currently constants defined in each class in order to determine how to run. On top of that, `Baz` interacts with a number of builder classes that need to be set up in various ways. I'd like to refactor out all of the configuration info in to a .properties file so that I don't have to recompile every time I change a constant. But I'm not sure how to structure it: Do I have a `ConfigInfoSingleton` that holds all of the parameters of the application in static properties, and have other classes ask it for information when they need it? That seems wrong, as it introduces global state. Do I pass around a `ConfigInfoMap` as a parameter to all of the classes that need that info? Then I need to have `Foo`, `Bar`, and `Baz` parsing strings in order to decide what they're going to do, and that seems very wrong. Especially in the case of `Baz`, where I can't just pass around values, but I need to use `switch` statements on configuration info to determine builder method calls. Do I parse the info in a different class, and have that class tell the others how to set themselves up? Then I have a class that needs to know about everyone else's implementation details, which seems wrong, but less so than the other options. This seems like a really basic question but I'm not sure how to proceed in terms of good software design, and I haven't had much luck Googling. Whats the "right" thing to do?


title: What time should be recorded against story points in order to determine velocity and hours per point

text: We recently tried to correlate the hours spent on a sprint against the stories assigned to the project (to try and get an idea of velocity and hours per point). However our recording system only allowed us to put time against a project and so included time such as:   * Customer meetings / phone calls   * Scrums   * Development / testing Should all of the time for these be taken into account when trying to determine velocity. Or should only the development / testing time be taken into account that occurred against specific stories. If everything, what should scrums and meetings be against. Should there be a separate story for these, or just recorded against a different metric i.e. project-elaboration vs project-development. If only development do we need a finer grained recording system for recording time spent on a project? **EDIT** : As well as velocity we are also trying to get a better idea of hours per point **EDIT** : I've had a few comments saying this isn't the way to do it (that's great). However no-one in those comments has suggested how we can give a priced quote for the next lot of work if we won't know how long the points took on an hour basis. The customer wants to know how much cost the next lot of work will be. Some additional points to note are: 1\. The team isn't solely dedicated to this project. Some time is spent on other work for some people and this may vary. 2\. The team may vary in size as the project goes with a member coming and going (I guess this effects estimations, but how?)


title: Single or multiple files for unit testing a single class?

text: In researching unit testing best practices to help put together guidelines for my organization, I've run into the question of whether it is better or useful to separate test fixtures (test classes) or to keep all tests for a single class in one file. Fwiw, I am referring to "unit tests" in the pure sense that they are white-box tests targeting a single class, one assertion per test, all dependencies mocked, etc. An example scenario is a class (call it Document) that has two methods: CheckIn and CheckOut. Each method implements various rules, etc. that control their behavior. Following the one-assertion-per-test rule, I will have multiple tests for each method. I can either place all of the tests in a single `DocumentTests` class with names like `CheckInShouldThrowExceptionWhenUserIsUnauthorized` and `CheckOutShouldThrowExceptionWhenUserIsUnauthorized`. Or, I could have two separate test classes: `CheckInShould` and `CheckOutShould`. In this case, my test names would be shortened but they'd be organized so all tests for a specific behavior (method) are together. I'm sure there are pro's and con's to either approach and am wondering if anyone has gone the route with multiple files and, if so, why? Or, if you've opted for the single file approach, why do you feel it is better?


title: Find points whose pairwise distances approximate a given distance matrix

text: **Problem.** I have a symmetric distance matrix with entries between zero and one, like this one:               D = ( 0.0 0.4 0.0 0.5 )         ( 0.4 0.0 0.2 1.0 )         ( 0.0 0.2 0.0 0.7 )         ( 0.5 1.0 0.7 0.0 )      I would like to find points in the plane that have (approximately) the pairwise distances given in D. I understand that this will usually not be possible with strictly correct distances, so I would be happy with a "good" approximation. My matrices are smallish, no more than 10x10, so performance is not an issue. **Question.** Does anyone know of an algorithm to do this? **Background.** I have sets of probability densities between which I calculate Hellinger distances, which I would like to visualize as above. Each set contains no more than 10 densities (see above), but I have a couple of hundred sets. **What I did so far.**   * I did consider posting at math.SE, but looking at what gets tagged as "geometry" there, it seems like this kind of computational geometry question would be more on-topic here. If the community thinks this should be migrated, please go ahead.   * This looks like a straightforward problem in computational geometry, and I would assume that anyone involved in clustering might be interested in such a visualization, but I haven't been able to google anything.   * One simple approach would be to randomly plonk down points and perturb them until the distance matrix is close to D, e.g., using Simulated Annealing, or run a Genetic Algorithm. I have to admit that I haven't tried that yet, hoping for a smarter way.   * One specific operationalization of a "good" approximation in the sense above is Problem 4 in the Open Problems section here, with k=2. Now, while finding an algorithm that is _guaranteed_ to find the minimum l1-distance between D and the resulting distance matrix may be an open question, it still seems possible that there at least is some approximation to this optimal solution. If I don't get an answer here, I'll mail the gentleman who posed that problem and ask whether he knows of any approximation algorithm (and post any answer I get to that here).


title: Long running task initiated in the web site

text: The plan is to develop generic solution for long running task initiated in web site by users such as: 1\. upload large file and do some custom processing and then insert in the database. 2\. export large amount of data But we do not want to run these tasks on web servers and instead run on dedicated other sever. I have a couple of following solutions but looking for suggestion on these solutions or a new option.   1. Web site calls WCF service on other server (one-way operations / fire-forget). WCF service has all the information to process request and task will run in WCF service.    2. Window service but not sure how Window service will start the job as soon as possible as we do not want any delay between user submitted the form and process start time. Need some kind of flag for Window service to start.


title: How to publish my application as open source software?

text: Recently I wrote some (I hope) useful application. I would like to share it with every person on the world, making it open source. I would like to publish the source code as well as binary files (both for Windows and Linux). I used only free tools to write my application: Code::Blocks, MinGW, gcc/g++, Linux Ubuntu/Linux Mint, Windows 7 with the license I bought. I read about different types of licences but still have some doubts. I looked into the source code of some open source software, for example, here: https://polarssl.org/aes-source-code or here: http://qt- project.org/doc/qt-5/qtnetwork-blockingfortuneclient-blockingclient-h.html. Those files have some header, where you can find the license as a comment. Here are my questions:   1. Is there any place in the internet where I can read about these things? Licensing, how to publish my code?   2. Should I copy the license to every file of my source code when I want to publish it? From where I can take the license to copy it? (meaning should I copy it both in `*.h` and `*.cpp` file?)   3. For Windows version of my application I used Visual Studio Express Edition and Qt. To make an `*.exe` which will run out of the box with no additional installations, I need to redistribute with my `*.exe` file some files from Qt and Visual (`*.dll` files). How and where can I check if its free to redistribute those files with my application?   4. Which license would be the best for my needs? I did a little research and found that license: http://opensource.org/licenses/BSD-3-Clause. Is it 100% good for my needs, any advices?


title: Software monetization that is not evil

text: I have a free open-source project with around 800K downloads to date. I've been contacted by some monetization companies from time to time and turned them down, since I didn't want toolbar malware associated with my software. I was wondering however, is there a non-evil way to monetize software ? Here are the options as I know them:   * **Add a donation button.**     * I don't feel comfortable with that as I really don't need "donations" - I'm paid quite well.     * Donating users may feel entitled to support etc. (see the second to last bullet)   * **Add ads inside your application.     * ** In the web that may be acceptable, but in a desktop program it looks incredibly lame.   * **Charge a small amount for each download.**     * This model works well in the mobile world, but I suspect no one will go for it on the desktop.      * It doesn't mix well with open source, though I suppose I could charge only for the binaries (most users won't go to the hassle of compiling the sources).     * People may expect support etc. after having explicitly paid (see next bullet).   * **Make money off a service / community / support associated with the program.**     * This is one route I definitely don't want to take, I don't want any sort of hassle beyond coding. I assure you, the program is top notch (albeit simple) and I'm not aware of any bugs as of yet (there are support forums and blog comments where users may report them). It is also very simple, documented, and discoverable so I do think I have a case for supplying it "as is".   * **Add affiliate suggestions to your installer.**     * If you use a monetization company, you lose control over what they propose. Unless you can establish some sort of strong trust with the company to supply quality suggestions (I sincerely doubt it), I can't have that.     * Choosing your own affiliate (e.g. directly suggesting Google Toolbar) is possibly the only viable solution to my mind. Problem is, where do I find a solid affiliate that could actually give value to the user rather than infect his computer with crapware? I thought maybe Babylon (not the toolbar of course, I hate toolbars)?


title: Any success stories continuously using commercial static analysis tools for C++?

text: I can't decide whether an offer of a commercial static analysis tool is worth spending the resources. We tried the tool on several million lines of our C++ code and it found something like 50 real issues. We wanted to find how those issues might have affected users. We grabbed a year old version of stable branch and analyzed it and then looked into the defects base - none of the issues found in the old code has caused any of the problems users reported. Not only those defects don't seem to manifest themselves to users but using the tool requires nontrivial effort - address false positives, analyze every warning the tool produces. Also the tools doesn't find all defects, it of course only finds some defects. So once again   * a noticeable effort   * very low number of issues found   * issues found don't seem to affect customers The tool is licensed at 7K euro for a team of five per year. Currently it looks like it's a lot of money and effort and no return except _now our code will maybe have less defects that likely don't manifest themselves_. It feels like we could have spent that effort on addressing issues that hurt right now. The supplier claims that using their tool in the development process helps _drastically_ improve code quality. I currently can't get any explanation of what this _drastic_ improvement can be - all the facts I considered are listed above. I'd like to hear stories that go like this: _before we licensed X we were miserable, because (what specifically was wrong), now using X at all times we have (what's much better now than before), so we're pretty happy - money were spent well_ and negative experience with enough details would also be helpful. Has anyone had really positive experience continuously using commercial static analysis tools? Is there a drastic improvement in source code quality that directly affects customers? Was the result worth the license fee and effort?


title: 1 to 1 Comparison and Ranking System

text: I'm looking to create a comparison and ranking system which allows users to view 2 items, click on the one that they feel is the better one and then get presented with 2 more random items and continue to do this until they decide to stop. In the background, I want the system to use these wins and loses to rank each item in an overall ranking table so I can then see what is #1 and what isn't. I haven't got a clue where to begin with the formula, but I image I need to log wins and loses. Any help/direction appreciated!


title: Lisp Macros: A practical approach

text: On my way to learn Lisp I have discovered the all powerful and feared so called Macros, then after spending a hard time trying to understand them and their usefulness I said to myself, I FINALLY GOT IT.   I couldn't be more wrong, I was thinking that the only purpose of Macros was to define new control structures and that was all I needed to know until I start reading more and more on the subject and a whole new world has comes to me ! One can use Macros for new **Domain Specific Language** , **Code Transformation** and to avoid **Boilerplate Code**. Hence, if a few examples at which the aforementioned usages of macros and others as well, with a concise and simple-to-understand explanation could be given it would be really nice.


title: "Read" a file without using a file pointer

text: I was asked this question in an interview. I'm somehow supposed to "read" a file into my C program as input without using a file pointer (including "f" functions, e.g. fgets, fscanf etc.). I'm also not allowed to redirect it using the terminal, i.e. no system or exec calls. The program will not get the file during runtime (that's what he said). The interviewer did not answer the question even though I requested him a lot, and I'd like to know how it'd be possible to do this.


title: What's the reason of choosing PascalCasing over camelCasing or vice versa from a programming language design POV?

text: I like both but I notice languages that use camelCasing for members sometimes need more adjustments when you want to edit your code. For example (in Python):               node.customData()      vs               node.setCustomData()      custom changes casing. It could be avoided if it was:               node.getCustomData()      In C# they will use PascalCasing for example. I know some even use no casing so:               node.getcustomdata()      It seems to be that scripting languages generally prefer camelCasing more than PascalCasing to be more relaxed? Is there a reason for choosing one over the other from a programming language design POV?


title: Domain Objects with Interfaces

text: I'm in a situation where part of my system has a dependency on another module in the same system, but the modules themselves need to remain independently deployable, where the parts they depend on would be filled in with another implementation. A module in this instance is the concept of a bunch of components that all contribute to servicing a business function. The system is also built in C#. So, where I depend on another module, the source module defines an interface describing the functions it needs the dependent party module to implement. The contract types (domain model objects) are also interfaces for the dependent module. Here is where it gets a bit hazy to me. The dependency inversion principle doesn't sit well in my head at this point. Both of those "modules" are of the same importance as each other. Which should define interfaces and force the other to reference it? I'm suspecting a 3rd project sitting between the modules that handles setting up the dependencies (probably a DI container). Should the entities in the modules be interfaced? They are simply bags of get/set (no DDD here). Can anyone offer any guidance here? Thanks in advance. **Edit 1:** The project structure:               Module1.Interfaces        IModuleOneServices     Module1.Models        ModuleOneDataObject     Module1        Module1 implements IModuleOneServices          Module2.Interfaces        IModuleTwoServices          Module2.Models        ModuleTwoDataObject - has property of type ModuleOneDataObject          Module2        Module2 implements IModuleTwoServices            depends on IModuleOneServices      Module2 needs to be deployable by itself, and remains compilable, and sometimes, run without a Module1 present at all.


title: How to capture different build verisons of the same production release artifact version in Artifactory?

text: Let's say I have artifacts "mylibrary-5.2.jar" and "mylibrary-5.3.jar" representing the 5.2 and 5.3 versions of a library that our project creates and publishes for one of our other projects. Does Artifactory support having multiple "versions" of each of these artifacts to represent the different builds that were performed during a release to construct this artifact? For example, to produce the final version of the 5.2 release of "mylibrary" aka the artifact: **mylibrary-5.2.jar** , we went through 3 builds to get to a version that passed our integration environment's automated tests and our user acceptance tests. So there were three separate builds that produced three separate artifacts for release 5.2. We want to be able to retain and potentially recall these different build's artifact at a later date (for testing, etc). In order to do this, which of the following options would work?   1. Capture the artifacts as separate Artifacts, i.e. build-5.2-b1.jar (build 1's artifact), build-5.2-b2.jar (build 2's artifact), build-5.2-b3.jar (build 3's artifact), and build-5.2.jar (the final production release; which matches build 3)   2. Capture a SINGLE artifact named "build-5.2.jar" which has VERSIONS of the artifact which capture builds 1 through 3 and which can be recalled later, by version number.    3. Some other option we have not considered, but should


title: Is it appropriate to remove redundant code explicitly assigning the default values?

text: Sometimes while I'm editing something I see some useless code added by other developers, probably due to habit. Editing this code will not make any difference, so is it appropriate? In my specific case I'm talking about Java private fields like this:               private int aSimpleInt = 0;     private boolean myBool = false;     private MyObject obj = null;      declaring the default values is redundant and useless.   Should I remove them or just skip?


title: Can I maintain copyright of the name/logo of an otherwise copyleft (GPL) application?

text: I'd like to release an application that basically has the license of "the code is GPLd but forks cannot use the name or logo", with the intent of avoiding confusion to users. Is that possible or is it an all or nothing deal?


title: Does distributing non-GPLd assets with a GPL application violate the license?

text: This is somewhat related to my other question, but is actually different. I would like to license a Windows Phone application under the GPL. All other Windows Phone Marketplace issues aside (I'll ask those on the forums), I'd like to include icons that ship with the SDK in my application. While this is common practice (documentation points to the icons' location), I'm not sure if I'd be forcing GPL on the icons (a move expressly forbidden by the Application Provider Agreement). How is this usually handled in GPL or am I simply out of luck? **EDIT** The icons in question are copied into the project's source tree and distributed with the application. The license that ships with the SDK states that you may **not** : > modify or distribute the source code of any Distributable Code [incl. the > icons] so that any part of it becomes subject to an Excluded License. An > Excluded License is one that requires, as a condition of use, modification > or distribution, that > >   * the code be disclosed or distributed in source code form; or >   * others have the right to modify it. > My question now becomes: can I distribute the icons with my GPL'd application in any way (for example, by including provisions in my license text) that would not violate either the GPL or the SDK agreement?


title: Should we hire a new developer now, or wait until the code is refactored to make it suitable for a team environment?

text: I support and develop a large system that uses various technologies e.g. c++,.net,vb6 etc. I am a sole developer. I am debating whether now is the right time to approach my manager (who is not a developer) to ask if another developer can be recruited. I don't have any experience working in software teams. I have always been a sole developer. The concerns I have are:   1. There is still a lot to do. Training another developer would take time and distract me from my duties.    2. The company does not invest heavily in tools e.g. source control    3. The code in this system needs to be refactored to introduce concepts such as interfaces, polymorphism etc, which are supported by methodologies such as Agile (I inherited the system about 12 months ago). I am gradually trying to refactor the code. I believe I have two options:   1. Approach my manager now    2. Wait until I have had time to refactor the code so it is more suitable for a team environment. Which option is best? I am hoping to hear from other developers who have been in my situation.


title: Understanding unit testing for dynamically changing condition

text: I was trying to understand how to write unit tests for a few days now. I'm confused with following scenarios in the existing code. In first function the max value changes depending on the object created at run time but in the second case it is a constant. NOTE: The following functions are not related. These are two different scenarios.               SomeFunction1(arg1,....)     {       if(arg1 > someObject.MaxAllowedValue)       {          throw exception;       }     }                    SomeFunction2(arg1,....)     {       if(arg1 > maxAllowedValue)       {          throw exception;       }     }      I am trying to test whether the function throws an exception when max value is exceeded. Does the unit test remain the same in both the cases or is it different?


title: What do you do when you realize your job requires you to do something out of your depth?

text: For a large software project recently, I was really out of my depth. And I did actually know this; and that the only reason I was employed was mostly a lack of other qualified candidates. The job was to build a large application on top of PHP/MySQL, a system I had little experience with. (I did advise the employer of this beforehand -- I've been spoiled by C# ASP.NET/MVC and MSSQL Server) The main reason I applied was location, location, location -- on campus jobs which actually have any programming component are relatively rare. For almost a year and a half I've slogged through this, and I think I can say I know (at least somewhat) what I'm doing now. I've made some mistakes, torn out some hair, and moved on. (I'm still working on this system nowadays, but I no longer feel completely lost) In the future though, I'd like to keep my personal and professional self a little healthier than what occurred in this case. So I'm curious -- what's the best way to handle a situation like this?


title: Shifting between XML schemas and C# classes in a sensible fashion

text: A .NET/C# system receives XML messages for processing and further transmission. Since working directly on XML documents would be very inconvenient, it is necessary to deserialize the message to a C# object and then serialize just before delivery. Up until now this has been done with Microsoft's XSD tool (xsd.exe) and it gets the job done, but poorly. The tool is old and buggy and generates outrageous class names and code representations of the various XML schema constructs. Are there better ways to accomplish this in .NET, or should I go a whole other way about it?


title: Key bindings war in my brain

text: How many key bindings are there in your brain? I personally use Intellij Idea as my primary IDE for development, but sometimes switch to Eclipse and Netbeans a bit, and sometimes I use Jedit,Notepad++, Emacs, Vim. I am always trying to find a perfect key bindings that I can use crossing all the editors. What's your idea to solve this problem?


title: List structures in memory

text: Could anyone give an overview of how list structures which are composed of a head and a tail which references the rest of the list i.e linked list are represented in memory of the computer? Does the computer make use of cpu registers to hold the pointers the head and rest of the list?


title: How to temporarily save the result of the query, to use in another?

text: I have this problem I think you may help me with.   P.S. I'm not sure how to call this, so if anyone finds a more appropriate title, please do edit. ## Background   * I'm making this application for searching bus transit lines.    * Bus lines are a 3 digit number, and is unique and will never change.   * The requirement is to be able to search for lines from stop A to stop B.   * The user interface is already successful in hinting the user to only use valid stop names.   * **The requirement is to be able to display if a route has a direct line, and if not, display a 2-line and even 3-line combination.** ### Example: I need to get from point A to point D. The program should show:   * If there's a direct line A-D.   * If not, display alternative, 2 line combos, such as A-C, C-D.   * If there aren't any 2-line combos, search for 3-line combos: A-B, B-C, C-D. Of course, the app should display bus line numbers, as well as when to switch buses. ## What I have: My database is structured as follows (simplified, actual database includes locations and times and whatnot):               +-----------+     | bus_stops |     +----+------+     | id | name |     +----+------+          +-------------------------------+     |    lines_stops_relationship   |     +-------------+---------+-------+     |  bus_line   | stop_id | order |     +-------------+---------+-------+      Where `lines_stops_relationship` describe a many-to-many relationship between the bus lines and the stops. Order, signifies the order in which stops appear in a single line. Not all lines go back and forth, and order has meaning (point A with order 2 comes after point B with order 1). ## The Problem   * We find out if a line can pass through the route easily enough. Just search for a single line which passes through both points in the correct order.   * How can I find if there's a 2/3 line combo? I was thinking to search for a line which matches the source stop, and one for the destination stop, and see if I can get a common stop between them, where the user can switch buses. **How do I remember that stop?**   * 3 line combo is even trickier, I find a line for the source, and a line for the destination, and then what? Search for a line which has 2 stops I guess, but again, **How do I remember the stops?** ## tl;dr How do I remember results from a query to be able to use it again? I'm hoping to achieve this in a single query (for each, a query for 1-line routes, a query for 2, and a query for 3-line combos). _**Note:_ I don't mind if someone suggests a completely different approach than what I have, I'm open to any solutions.** Will award any assistance with a cookie and an upvote. Thanks in advance!


title: Being productive during downtime

text: Lets say you are somewhere where coding and getting online isn't possible (On a busy flight, for example)what do you do to stay productive? Things I would do are read whatever tech book I am currently slogging through and maybe doodle some UI stuff or workflows. What else could I be doing?


title: When do you have enough experience?

text: I've worked on three successful projects (freelanced) throughout my highschool career; however, they primarily involve web technologies. I know that I'm proficient in setting up LAMP stacks, working with PHP, databases, and designing with strict markup, version control, usability testing, and all that fun stuff but since I began programming, I've seen an evident gap between the complexity from hash maps to binary search trees (Java is the ultimate PL for learning no matter its condition in the industry). Although I'm attempting to pursue some multifarious career in software design, is it really necessary to push for a University education (Berkley or Stanford ideally in CS) before I fully commit myself to programming? Are three successful projects regarding web design, web development, and video streaming (and all concomitant technologies) enough to be regarded as "experienced"? Could that experience get me hired? Ultimately, when is there enough experience such that University degrees become irrelevant?


title: MongoDB Embedded vs Reference Private info

text: I have searched extensively for a similar Mongo schema design and can't find relevant examples. I have a store (with public info), each store has an account (with private account info).               // store object     {       name: "Departement Store",       email: "contact@store.com",       account: { // private info not returned by API         manager: "Steve",         employees: [...]       }     }      The stores will be searched through a public API. I am limiting the search queries using MongoDB's features to limit the returned data:               db.stores.find({}, {account:0});      **My question** : is it more efficient to keep the private data as a subdocument or in a separate collection? It seems a separate collection with account info is the best choice as I will be picking and choosing from an embedded document. References:   * mongo schema (embedding vs reference)   * Embedded document vs reference in mongoose design model?


title: What is better for coding - desktop or laptop?

text: Use of desktops are decreasing day by day in daily life but for coding purpose are there any reasons for using desktop over laptop?


title: Class hierarchy question - do you implement separate classes for the same behavior?

text: **NOTE:** The language I am using is C#. I am currently working on a 'The Quest' mingame where there is a player and some enemies. My design so far involves a base abstract class called 'Mover' and an interface called 'IAttacker', since the Player object and the Enemy object(s) both move and attack, albeit in different ways. However I also think this may be unnecessary because I could just create one big combination interface, 'IMoveAttack' or something like that. Moreover, my friend who gave me the challenge recommeded that the Weapon class (the player can pick up weapons along the way which are lying on the floor) to be a subclass of Mover, even though the Weapons don't really need to move, they just need to spawn at random locations at every level. What is the best design principle in this case?


title: Do we need use case levels or not?

text: I guess no one would argue for decomposing use cases, that is just wrong. However sometimes it is necessary to specify use cases, which are on lower, more technical level, like for example authetication and authorization, which give the actor value, but are further from his business needs. Cockburn argues for levels when needed and explains how to move use cases from/to different levels and how to determine the right level. On the other hand, e.g. Bittner argues against use case levels, although he uses subflows, requires the vision documents which contain information about the purpose of the system in the business, much like use cases on the higher level, and at the end of his book mentions, that at least two levels are needed most of the time. My questionis, do you find use case levels necessary, helpful or unwanted? What are the reasons? Am I misssing some important arguments?


title: How can the process of creating and maintaining documentation be improved?

text: I know it's a very subjective question , but this is one section of Software Engineering wherein I haven't seen any improvement in terms of how we can do it in a better way. I guess every programmer does documentation with some frustration, but when working I feel it's the most important tool for me. How can the process of creating and maintaining documentation be done in a better way?


title: can a logic error happen way later than its cause?

text: For comparison, for a runtime fatal error, it is often that the cause of the error is way before the error crashes a program. For a logic error, it doesn't crash a program. It happens when the state of the execution of the program isn't what we expect for the first time. The cause of a logic error in a program, I think, just like the cause of a runtime fatal error, is where you make correction and the program will not have the logic error. I wonder if the cause of a logic error must be where the error happens, or can be way before that? Thanks.


title: Assertions in private functions - Where to draw the line?

text: We use assertions to check for illegal behaviour which just shouldn't happen if everything is working as it should be, such as using `NULL` as argument when it clearly shouldn't. This is all very well when you write public functions since you can't trust that the programmer who will use them won't make a mistake. But what about private functions, which won't be accessible from the outside? Of course, the function which uses those private functions may contain a bug (i.e. _you_ made a mistake), but should we _always_ use assertions in private functions? Is there a line where we can say "Hey, we don't need an assertion here because due to previous assertions and usage of the private function, we can assume that the parameters are always safe"? Now I myself am a bit skeptical about that last part - can we ever safely assume that things are always as they should be?


title: Who should write the test plan?

text: I am in the in-house development team of my company, and we develop our company's web sites according to the requirements of the marketing team. Before releasing the site to them for acceptance testing, we were requested to give them a test plan to follow. However, the development team feels that since the requirements came from the requestors, they would have the best knowledge of what to test, what to lookout for, how things should behave etc and a test plan is thus not required. We are always in an argument over this, and developers find it a waste of time to write down things like:-   1. Click on button _A_.    2. Key in _XYZ_ in the form field and click button _B_.   3. You should see behaviour _C_. which we have to repeat for each requirement/feature requested. This is basically rephrasing what's already in the requirements document. We are moving towards using an Agile approach for managing our projects and this is also requested at the end of each iteration. Unit and integration testing aside, who should be the one to come up with the end user acceptance test plan? Should it be the reqestors or the developers? Many thanks in advance. Regards   CK


title: How to explain that catch(...) is wrong?

text: I have a problem: Now Microsoft has changed, and in respect with the C++ Standard, and starting from from Visual Studio 2005 now:   * Access Violation are not to be catched in `catch(...)` However, if one compile with `/EHsc` or other similar flags under VS2003 and before, then Access Violation are really caught in `catch(...)`. Yes, really. In my new company, they have protected their whole application accordingly. And now I have a **whole application** with hundreds, maybe thousands, of `catch(...)` compiled in VS2003. Those `catch` don't put an end to the process. Sometimes they hopefully trace something like "unexpected error in...", but only sometimes. How can I explain to them it's plain wrong ? That it hides corruptions until a point where it's impossible to tell what is going wrong ?


title: How to chain together points in an array

text: I have a series of points with lengths and rotations like this: ![points](http://i.stack.imgur.com/xiG62.jpg) I need to create separate chains from points whose lines overlap but I’m having real trouble doing this efficiently. I have an array of simple Point objects, in no particular order, and I can loop through them and test them with a simple "intersect" function. I need to end up with an array of chains, each with an ordered list of points. (Or another way of representing the chains). At the moment every avenue I explore seems to involve a convoluted hack of arrays, nudges and fudges. Having never studied Computer Science I wonder if there is some sort of data structure or technique that would lend itself well to this sort of thing.


title: What differences can I expect on the Java 6 Exam compared to the Java 5 Exam?

text: I am taking a Java class that teaches based on a Java 5 book and the prof. says that if we get the Java certification then we instantly pass the class, sounds like a deal. My question is, since I want to go for the most recent certification (Java 6), what can I expect to be different? I was told that Java 6 is so similar to Java 5 that learning Java 5 is not useless, but what about when it comes to exam differences?


title: What was the most used programming language before C was created?

text: C is a language written between '69 and '73 according to WIkipedia. I imagine it made programming a whole lot easier and opened the gate for other programming languages. My question, however, is what programming language dominated the market before C appeared? I'm tempted to say fortran and/or BASIC but I wasn't even alive back then so I have no idea. By "most used", I mean a MUST-LEARN programming language, which most programmers were using at the time.


title: What responsibilities does a Management Information Systems job entail?

text: At my school there is apparently a Computer Science degree, which is located under the "department of natural sciences", while Management Information Systems is considered "business". Besides the usual descriptions that can be found about both jobs, I was wondering how the job of MIS actually differs from say, that of a software engineer or programmer. Just curious, thanks


title: How to output library test/benchmark data in a web framework?

text: I am writing an MVC framework. I have a folder full of library classes, each are self contained, and could be ripped out of the framework and used by themselves. The only problem is that a few of these libraries (benchmarking, unit testing) display HTML to report results. I am wondering, do I display this HTML in a view file, or hard code it into the class? If I use view files, these modules will no longer be able to be used by themselves, and will require the print_view() method found in another class. If I hard code this HTML into the library class however, the class becomes difficult to read, as well as makes it harder to modify the design aspects of the reports. Any suggestions/thoughts?


title: Dependency Management tool for REST endpoints

text: I work in a Rest Oriented environment. The number of endpoints is quite large and span multiple applications. The dependencies between the endpoints are large in number as well and not very well planned. Applications have cyclic dependencies amongst each other. Unfortunately, there is no central location where all the endpoints are documented and declare dependencies (the endpoints that they inturn call). Is there a tool that will help in such dependency management. I tried searching for a tool online, but not know what such a thing would be called, I am unable to find anything.


title: How do I make complex SQL queries easier to write?

text: I'm finding it very difficult to write complex SQL queries involving joins across many (at least 3-4) tables and involving several nested conditions. The queries I'm being asked to write are easily described by a few sentences, but can require a deceptive amount of code to complete. I'm finding myself often using temporary views to write these queries, which seem like a bit of a crutch. What tips can you provide that I can use to make these complex queries easier? More specifically, how do I break these queries down into the steps I need to use to actually write the SQL code? _Note that I'm the SQL I'm being asked to write is part of homework assignments for a database course, so I don't want software that will do the work for me. I want to actually understand the code I'm writing._ More technical details:   * The database is hosted on a PostgreSQL server running on the local machine.   * The database is very small: there are no more than seven tables and the largest table has less than about 50 rows.   * The SQL queries are being passed unchanged to the server, via LibreOffice Base.


title: How do I convince some one that test should do assertion (not assertions) and not the helper methods

text: Joined a new employer and came across a new style of writing tests.               @Test()     public testMethodWhichDoesNotDoAnyAssertion() {         LoginPage loginPage = signUpPage.doLogin("username","password");         oneMoreCommonMethodCalledHere()         anotherCommonMethodCalledHere()     }          public void doLogin(String userName, String password) {          //login here          Assert.assertTrue("Login Successful")     }          public void oneMoreCommonMethodCalledHere() {          //Some more operations here.          Assert.assertTrue("This also succeeded")     }          public void anotherCommonMethodCalledHere() {          //Some more operations here.          Assert.assertTrue("Even this succeeded!!! Your code is awesome!!!")      So far I have been doing assertions in tests and not in the methods which are invoked from test method. The problems I have with approach are multiple - There are two many assertions happening in one method, though indirectly and it defeats the idea of one responsibility per test There are times when I want to do one assertion in my test method while testing for a work flow. And many of the helper methods which would be called would assert things and might even fail which would hamper work flow test. Now thing I have heard in favour of this approach - It is easy for any one to just plug in helper method in a test while not worrying about the assertions which should be carried out for a scenario, as helper method takes care of it. Comments?


title: How to present asynchronous state change in chart or diagram?

text: I started to study about _state transition chart_. As I see, it assumes all state transition is done instantly with no time consuming. But in most of my case, I'm heavily depending on asynchronous I/O, so it seems to be less efficient modeling them with the chart. How do you think about how to represent asynchronous state change? Please recommend something to me :)


title: Does single inheritance limit what we can do with generalisation?

text: As a rule of thumb, generalisation is used only in specific circumstances. For example, when we can say that X is literally a subclass of Y. So, we can happily say that a Horse is a subclass of Mammal. I have always been lead to believe that we should use generalisation and inheritence here. If we do not have this strict correspondence between two objects then we should not. A Horse is a Mammal. However, it is also literally a mode of transportation. So what happens in a world of single inheritance where horse cannot inherit from both? Do we then subjugate the fact that a horse is literally a mode of transportation to realisational, i.e., an interface such as ITransportable?


title: Why is using C++ libraries so complicated?

text: First of all, I want to note I love C++ and I'm one of those people who thinks it is easier to code in C++ than Java. Except for one tiny thing: libraries. In Java you can simply add some jar to the build path and you're done. In C++ you usually have to set multiple paths for the header files and the library itself. In some cases, you even have to use special build flags. I have mainly used Visual Studio, Code Blocks and no IDE at all. All 3 options do not differ much when talking about using external libraries. I wonder why was there made no simpler alternative for this? Like having a special .zip file that has everything you need in one place so the IDE can do all the work for you setting up the build flags. Is there any technical barrier for this?


title: What can we learn from inactive assembly languages?

text: There are still groups of programmers who support old microprocessors, e.g., Z80, 6510, 68000, etc. What can we learn from old assembly languages at a time when functional programming is becoming fashionable? **EDIT** I imagine that there would be more to learn for embedded systems. However, assembler styles apply to a more limited extent for web programming where caching is used and the size of routines does not really matter. The guideline for best practice for embedded and web styles differs massively (server and client styles being different). For example, the optimising a sprite multiplexer to run in say, under 30 bytes, is different to types of optimising we would make for code we intend to run on a web server. The types of optimisation are very different. The sprite multiplexer is written with memory usage as the main priority but regarding our web server routine, we want maximum performance which has little to do with efficient use of memory unless we are talking about shared resources.


title: Compile GPL-code into a JNI-capable shared library and use it in commercial software

text: I am developing an application for Android in JAVA which calls GPLed C-code via JNI. I have modified & capsulated a GPL-software under a JNI-interface and compile it as a shared library (.so) which I can use via JNI from my JAVA-part (the commercial part with closed source). Because I have stripped the original GPL-software from everything which is not needed by my software, that GPL-software has no more other GPL-dependencies which explicitly forbid using it as a shared library in a closed-source software (like SecretRabbitCode for example forbids it). I have no problem to set my modified version of the GPL-software online, but I cannot do this with my commercial software. Because I need the modified version of the GPL-software in my software, I have to bundle it in one package (a APK-file in Android). Sadly, the GPL-software has 1 or 2 more dependencies to GPL-code (just C-files like aes.c), so it's not as easy as just ask the author of this GPL-software. Because the Android-way of "packing JAVA and .so-files together, bundle it and distribute it" is quite new, it's not as easy as with pure JAVA or pure C code. Who can help out?


title: Sharing API's between different Programming languages?

text: I was just wondering how API's can be shared between different Programming languages. I mean, MS have .Net which uses VB.net C# and various other technologies.   I doubt .Net is written for each programming language.   How are structs and classes shared between languages? Also the same for Unity3D - Javascript shares API's with C# and BOO.   How?


title: What would happen if a bit of GPL code sneaked into the Windows source code?

text: Imagine that an unfaithful (or maybe careless) employee at Microsoft managed to sneak in three lines of GPL code into a the core of a distribution of Windows. Wouldn't this mean that Microsoft would need to publish all their source code under GPL as well? Or could they just rewrite the three lines once they are notified about the issue? Shouldn't Microsoft be scared to death about this? **Edit** In the comments below, Kenneth states that it has actually happened, so I would be most intereted in any references. I also do not understand how this question could get closed.


title: Setting up ASP.NET structure for code

text: I've always coded in C# MVC3 when developing web applications. But now i wanted to learn a bit more about developing web sites with just ASP.NET. But now i'm wondering what a good setup for my code would be. For me, an MVC like pattern seems to be a good way to go. But obviously ASP.NET doesn't have any `router` and `controller` classes. So i guess people have a different way of setting up their code when they do ASP.NET. So i'm looking for more information on how to get started with this. So not really the basics of ASP.NET, but something that focuses on a good code setup. Any good tutorials/information about this/?


title: Another way of expressing 'Dirty' coding

text: I'm writing a brief for a new starter at the company.   I've pointed out the aims of what I want to achieve and now I'm writing some suggested (but not concrete) solutions. For each of the aims, I'd like to suggest a fast, dirty method, and a slower, but more robust solution. I don't mean 'dirty' as in uncommented and untabbed code, but simply as in faster, hackishy code. I'm happy that the new starter takes whichever pathway they feel are necessary, and I feel my use of the word 'dirty' is going to put them off that particular solution. They're probably going to try to impress the management, and I don't want the 'dirty' solution to be a turn-off if that's what they're most comfortable with. Can you help me decide on a slightly better terminology than dirty? I aim to contrast between the hacky/fast solution (which is still valid) and a more robust, scalable solution. For a project as trivial as the one we're producing, then either method will be accepted.


title: Which topics do I need to research to enable me to complete my self-assigned "Learning Project"?

text: I want to continue learning C#. I've read parts of a few books recommended on here and the language is feeling more familiar by the day. I'd like to tackle a mid-sized personal project to take my expertise to the next level. What I'd like to do, is create an application that 'manages expenses', that runs on multiple machines on a LAN. So for example, say we have person1 and person2 on seperate machines running the application, when person1 enters an expense, it will appear on person2's (pretty UI) view of the expenses database and vice versa. What topics do I need to research to make this possible for me? I plan on learning WPF for the UI (though the steep learning curve (or so I'm told) has me a little anxious about that at this stage. With regards to the database, which database would you recommend I use? I don't want a 'server' for the database to run on, so do I need to use an embedded database that each client machine runs a copy of that updates to each other (upon startup/entering of expense on any machine etc)? What topics under networking should I be looking at? I haven't studied networking before in any language, so do I need to learn about sockets or?


title: best practice for initializing class members in php

text: I have lots of code like this in my constructors:-               function __construct($params) {              $this->property = isset($params['property']) ? $params['property'] : default_val;          }      Is it better to do this rather than specify the default value in the property definition? i.e. `public $property = default_val`? Sometimes there is logic for the default value, and some default values are taken from other properties, which was why I was doing this in the constructor. Should I be using setters so all the logic for default values is separated?


title: What relationship do software Scrum or Lean have to industrial engineering concepts like theory of constraints?

text: In Scrum, work is delivered to customers through a series of sprints in which project work is time boxed to a fixed number of days or weeks, usually 30 days. In lean software development, the goal is to deliver as soon as possible, permitting early feedback for the next iteration. Both techniques stress the importance of workflow in which software work product does not accumulate in development awaiting release at some future date. Both permit new or refined requirements and feedback from QA and customers to be acted on with as little delay as possible based on priority. A few years ago I heard a lecture where the speaker talked briefly about a family of concepts from industrial engineering called theory of constraints. In the factory, they use an operations model based on three components: drum, buffer, and rope. The drum synchronizes work product as it flows through the system. Buffers that protect the system by holding output from one stage as it waits to be consumed by the next. The rope pulls product from one work station to the next. Historically, are these ideas part of the heritage of Scrum and Lean, or are they on a separate track? It we wanted to think about Scrum and Lean in terms of drum-buffer-rope, what are the parts?   * Drum = {daily scrum meeting, monthly release)?    * Buffer = {burn down list, source control system)?    * Rope = { daily meeting, constant integration server, monthly releases}? Industrial engineers define work flow in terms of different kinds of factories.   * I-Factories: straight pipeline. One input, one output.   * A-Factories: many inputs and one output.   * V-Factories: one input, many output products.   * T-Plants: many inputs, many outputs.  If it applies, what kind of factory is most like Scrum or Lean and why?


title: When, if ever, can code standards be ignored?

text: My company has decided to use stored procedures for everything dealing with the database (because they didn't know of any other way besides raw SQL), and as the saying goes "When in Rome..." so I try to follow. Recently I had to add a hack fix that required grabbing a database value, and since it was a single value from a single table I wrote it as inline SQL (parameterized, of course) since there didn't seem to be a need for a stored procedure for one trivial line of code used in a single part of the application as a kludge. Of course, I've now been told to fix it and only ever use Stored Procs for anything related to the database. This feels just a bit too much like blindly following dogma instead of using common sense. Don't get me wrong, I understand the purpose of having coding standards but I am also a proponent of ignoring standards when they don't make sense, not just blindly following them as though they were Gospel.


title: Splitting Logic, Data, Layout and "Hacks"

text: Sure, we all heard of programming patterns such as MVVM, MVC and such. But that isn't really what I'm looking into as Layout, Data and Logic is already pretty much split up (XML-Layout markup, Database, _insert your language of choice here_ ). The platform I am developing for is hard to maintain over the updated versions and older OSes. The project significantly grew up over the last few months and dealing with different platform versions really is a pain. For example simply disabling an user interface control for all existing versions took me around 40 lines of code in the logic layer, wrangling around with invocation, delegation, singletons that provide UI handling and so on. Is there a clean way to keep track of those "hacks" by maybe excluding it into separate classes or even packages? Should I overwrite existing framework code in order to handle _my_ requirements correctly? If so, does that concept have a name?