title: Tips on persuading boss that code review is a good thing

text: Let's say one works in a hypothetical company that has several developers that rarely worked together on projects and the Boss didn't believe that code reviews are worth the time and cost. What are various arguments that could be presented in this scenario that will portray the benefit of code review? Furthermore, what are the potential arguments against code review here and how can these be countered?


title: EE vs Computer Science: Effect on Developers' Approaches, Styles?

text: Are there any systematic differences between software developers (sw engineers, architect, whatever job title) with an electronics or other engineering background, compared to those who entered the profession through computer science? By electronics background, I mean an EE degree, or a self-taught electronics tinkerer, other types of engineers and experimental physicists. I'm wondering if coming into the software-making professions from a strong knowledge of flip flops, tristate buffers, clock edge rise times and so forth, usually leads to a distinct approach to problems, mindsets, or superior skills at certain specialties and lack of skills at others, when compared to the computer science types who are full of concepts like abstract data types, object orientation, database normalization, who speak of "closures" in programming languages - things that make little sense to the soldering iron crowd until they learn enough programming. The real world, I'm sure, offers a wild range of individual exceptions, but for the most part, can you say there are overall differences? Would these have hiring implications e.g. (to make up something) "never hire an electron wrangler to do database design"? Could knowing about any differences help job seekers find something appropriate more effectively? Or provide enlightenment or some practical advice for those who find themselves misfits in a particular job role? (Btw, I've never taken any computer science classes; my impression of exactly what they cover is fuzzy. I'm an electronics/physics/art type, myself.)


title: Rails generators for subscription and payment processing services?

text: I've been thinking about making a generator for managing subscriptions with options for a couple different payment processing services, it is something that I would use. Are there any existing examples of this, or any thoughts on a generator. I thought it might work like the scaffold function, similar to the authentication function in nifty-generators. EDIT: Also, It seems that there should be a lot of security concerns when implementing payment processing, having a consistent and common way to generate this would let me make sure best practices and security are followed the same in all my apps.


title: Geo IP data on stackoverflow API?

text: Have just looked at stackgeography and at soapi. I cannot see where the geo data comes from as it's not on the soapi. Can anybody shed some light on that? More info on the stackgeography


title: (How can I / Am I allowed to) Use Google Maps as a Texture on an OpenGL object?

text: _**Note** : I asked a very similar question on StackOverflow but did not get much attention, so was directed to http://programmers.stackexchange.com as licensing issues seem to have more interest here..._ I am not an expert in Google Maps policies although I am aware that downloading / caching map tiles is not encouraged at all. In Android, developers were given the MapActivity and MapView classes which attempt to provide all possible services for displaying map tiles and even modifying them on the fly if needed, but they are pretty useless for me as I would like to use map tiles as a texture on a 3D OpenGL object. I'd like to know under which conditions the use of map tiles as an OpenGL texture is allowed. Anyone? _**UPDATE to clarify my question after Gavin's comment:_** **"Given that the Google Maps API does NOT provide a way to directly access map tiles as low level bitmaps, which is required by OpenGL texturing functions, is there any way to implement this without breaking Google licensing policies?"**


title: Learning the Operating Systems concepts and Programming Languages for elderly

text: I am not sure if this would be the right forum to ask the question (Please let me know and I will move the question to appropriate forum). I would like to know what can be the best way for elders (in my case, my parents) to learn how to program. I was looking at Qimo 4 kids as a possible platform so that my parents can have a closer look at Linux environments. But it seems like Qimo mostly consists of educational games. I also don't know about which programming language would make the best choice. If anyone can provide me with information on how to go about with this "project", that would be grateful!!!


title: single for-loop runtime explanation problem

text: I am analyzing some running times of different for-loops, and as I'm getting more knowledge, I'm curious to understand this problem which I have still yet to find out. I have this exercise called "How many stars are printed":               for (int i = N; i > 1; i = i/2) System.out.println("*");      The answers to pick from is ` A: ~log N B: ~N C: ~N log N D: ~0.5N^2` So the answer should be A and I agree to that, but on the other side.. Let's say `N = 500` what would `Log N` then be? It would be 2.7. So what if we say that `N=500` on our exercise above? That would most definitely print more han 2.7 stars? How is that related? Because it makes sense to say that if the for-loop looked like this:               for (int i = 0; i < N; i++)      it would print `N` stars. I hope to find an explanation for this here, maybe I'm interpreting all these things wrong and thinking about it in a bad way. Thanks in advance.


title: What is the best way to store multilingual data in MongoDB?

text: I want to save/serve multilingual data in my CMS application using Mongoose. Is this the correct way?               name: {         global: {             type: String,             default: '',             trim: true,             required: 'Please fill name',         },         en_US: String,         tr_TR: String,         sv_SE: String     }


title: How do you approach writing a piece of code?

text: I'm a junior php/js developer and have been working for about a year. When I start working on a task I tend to have a quick think about what needs to be done then jump straight in, in a somewhat brute force approach. However I think this hinders my productivity since I haven't defined path to completing the task. What have you found to be the best approach and way to prepare writing code? Especially dealing with legacy code


title: jQuery - When to Bind Event Listeners?

text: I'm building a medium-sized "single-page" JavaScript application using jQuery. If you include all possible functionality of the application, there are 134 `click` bindings. Since most of the content is dynamically loaded, I can't just do this: `$(element).click(function() { ... });` Instead, I'm doing this: `$(document).on('click', selector, function() { ... });` Currently, I'm binding all of these on `$(document).ready`. But is that bad practice? Is this a speed issue? The alternative would be to bind the event listeners every time the content is loaded, for example:               $('#content').html(...);     $('#newcontent').click(function() { ... });      The problem with that is it's difficult to organize. What advice can you give me?


title: Python shelve class rename

text: The main reason I use Shelve is to be able to quickly develop code without worrying about db table structure. Unfortunately changing a class name from, say, 'class1' to 'class2' gives "AttributeError: 'module' object has no attribute 'class2'" on the next run. What is the canonical way to rename a Shelved class? What other similar surprises are lurking deeper into the Shelve db structure?


title: Do Design Patterns Stifle Creativity

text: Many years ago, I was talking with an Economics professor about design patterns, how they were establishing a common language for programmers and how they were solving well known problems in a nice manner, etc etc. Then he talked back to me that this is exactly the opposite approach he would use to his Economics students. He usually presented a problem and asked them to find a solution first, so they could think about it first and try to find ways to solve the problem first, and only after that, he presented the "classical" solution. So I was thinking if the "design pattern" approach is really something that makes programmers smarter or dumber, since they're many times just getting the "right solution for this problem" instead maybe of using creativity and imagination to solve some problem in a new and innovative way. What do you think?


title: My first job in a dev team - what should my priorities be?

text: I just landed my dream job - working in a big (famous) company as a frontend web developer. I've never even worked in a proper dev team before - the last 4 years since I started learning web dev I've been working on my own just building sites and apps for small business clients I found. I want to make the best possible start in my new job but it's not going as easily as I thought it might - there's very little induction or training - its a bit like being thrown in at the deep end, and to make matters worse most of the other developers in the office whilst being friendly and supportive, are speaking a language I don't understand very well. When they do speak english they use a lot of technical terms / jargon / names of products / systems etc that I've never heard of. I want to make a good impression and don't want to show myself up by asking too many dumb questions. What advice would all of you seasoned veterans of development teams suggest?


title: Is there a metric that can be equated to complexity in laymens terms?

text: Often times users cannot comprehend the complexity of software. They think that because a problem is easy to describe then it is easy to solve. I want to equate the complexity of a "simple program" I have built with the complexity of a process with a tangible result. Is there a system that can take tangible processes and assign them a complexity such as: Building an outhouse = 5   Building a house = 50   Building the empire state building = 5000 that I can then equate to the software in a meaningful way: thisProject = 5 Maybe the project weight is determined by Cylcomatic Complexity. Whatever it is is not that important. What is important is that such a system exists. Does such a system exist? **Update**   I'm looking for a means to compare the complexity of two complete systems. I am not looking for estimation methods. The limitation I see in using "money and man hours" is that the laymen (or maybe even somewhat technical) individual could attribute the reason the project took so long and cost so much money is because the developer(s) were simply not good at their jobs. Thinking out a possibility... I imagine a solution to this problem could be similar to Dijkstra's algorithm. Create a flowchart for System1 and another for System2. Give each decision a weight based on how many routes the decision contains. Give each action a weight as well. The cumulative weight of each respective chart can then be used to compare the two processes.   1. For the "tangible process": If some engineer mapped a flowchart for "building an outhouse" then we could use such an algorithm to obtain a "total weight" for the process.    2. For the "intangible process": Assuming the entire program can be mapped to a Finite State Machine then it can be described as a flowchart and assigned a weight as well. So the outhouse process is weighted at 50 and "my program" is weighted at 60. So it's about as complex as building an outhouse.


title: What is the idiomatic way to persist the data in this simple data-based application?

text: I'm looking at developing a simple application in Java for a game which allows a user to keep track of which items they own and how much experience they have obtained while using the item. All of this data is input by the user. What is the idiomatic/standard way to persist the data that is being manipulated (the model)? The immediate possibilities seem to be saving it to a file, serialization, databases, etc, but many of these seem to be overkill for simple text fields that don't seem to necessitate objects. What is the idiomatic/traditional way to handle something like this?


title: Object oriented wrapper around a dll

text: So, I'm writing a C# managed wrapper around a native dll. The dll contains several hundred functions. In most cases, the first argument to each function is an opaque handle to a type internal to the dll. So, an obvious starting point for defining some classes in the wrapper would be to define classes corresponding to each of these opaque types, with each instance holding and managing the opaque handle (passed to its constructor) Things are a little awkward when dealing with callbacks from the dll. Naturally, the callback handlers in my wrapper have to be static, but the callbacks arguments invariable contain an opaque handle. In order to get from the static callback back to an object instance, I've created a static dictionary in each class, associating handles with class instances. In the constructor of each class, an entry is put into the dictionary, and this entry is then removed in the Destructors. When I receive a callback, I can then consult the dictionary to retrieve the class instance corresponding to the opaque reference. Are there any obvious flaws to this? Something that seems to be a problem is that the existence static dictionary means that the garbage collector will not act on my class instances that are otherwise unreachable. As they are never garbage collected, they never get removed from the dictionary, so the dictionary grows. It seems I might have to manually dispose of my objects, which is something absolutely would like to avoid. Can anyone suggest a good design that allows me to avoid having to do this?


title: OOP what is meant by object-to-object communication

text: I've been reading in basic concepts of OOP,as i'm trying to make this shift from transactional scripts to more oop manner in php, and i often come across this definition : > An object stores its state in fields (variables) and exposes its behavior > through methods (functions). Methods operate on an object's internal state > and serve as the primary mechanism for object-to-object communication and a simple example like : > Objects like real life objects have state and behavior. Dogs have state > (name, color, breed, hungry) and behavior (barking, fetching, wagging tail). from definition i see that methods should be either manipulating internal state (setters) or communicating with other objects; but when i try to apply this to a Blog example. composed of mainly 2 domains User and posts. **what could be the`User object` Behavior ?** I cannt find any !   1. login, its an auth lib. thing so i should not include it in user.   2. posting articles is a Post object thing; again user conduct it; but its more of a post object concern to create a post right ? User may be the main Aggregate object in a blog; yet the user is more like the Creator of Other Objects but he does not have a Behavior i can think of; he is being used -and his state- by other objects in most cases that all ! **in a nutshell :** what are allowed type of methods inside an object ?


title: Portlets (and portals) vs usual webapps

text: I am working on a big project containing (among others) two web applications: one is implemented with Spring MVC and the other is meant to be implemented using Web Experience Factory (portlets).   One big problem whith using Web Experience Factory is its poor community.   The main motive to use portlets in the second application is the already existing user management system inside IBM Websphere Portal (like any other portal).   A next step will be to integrate the first application (Spring MVC) into the Websphere portal. So I have a bunch of questions here:   1) Is the integration of a web application (Spring MVC) into Websphere portal obvious ? And what kind of problems should I be ready to encounter ? 2) Is it really a good reason to use a portal only to get advantage of its user management (authentication/authorization) system, knowing that both of the apps to be integrated are implemented by the very same team ? I really appreciate any hints especially if they came with solid arguments.


title: Is the Leptonica implementation of 'Modified Median Cut' not using the median at all?

text: I'm playing around a bit with image processing and decided to read up on how color quantization worked and after a bit of reading I found the Modified Median Cut Quantization algorithm. I've been reading the code of the C implementation in Leptonica library and came across something I thought was a bit odd. Now I want to stress that I am far from an expert in this area, not am I a math-head, so I am predicting that this all comes down to me not understanding all of it and not that the implementation of the algorithm is wrong at all. The algorithm states that the _vbox_ should be split along the lagest axis and that it should be split using the following logic > The largest axis is divided by locating the bin with the median pixel (by > population), selecting the longer side, and dividing in the center of that > side. We could have simply put the bin with the median pixel in the shorter > side, but in the early stages of subdivision, this tends to put low density > clusters (that are not considered in the subdivision) in the same vbox as > part of a high density cluster that will outvote it in median vbox color, > even with future median-based subdivisions. The algorithm used here is > particularly important in early subdivisions, and 3is useful for giving > visible but low population color clusters their own vbox. This has little > effect on the subdivision of high density clusters, which ultimately will > have roughly equal population in their vboxes. For the sake of the argument, let's assume that we have a vbox that we are in the process of splitting and that the red axis is the largest. In the Leptonica algorithm, on line 01297, the code appears to do the following   * Iterate over all the possible green and blue variations of the red color   * For each iteration it adds to the _total_ number of pixels (population) it's found along the red axis   * For each red color it sum up the population of the current red and the previous ones, thus storing an accumulated value, for each red  _note: when I say 'red' I mean each point along the axis that is covered by the iteration, the actual color may not be red but contains a certain amount of red_ So for the sake of illustration, assume we have 9 "bins" along the red axis and that they have the following populations > 4 8 20 16 1 9 12 8 8 After the iteration of all red bins, the _partialsum_ array will contain the following count for the bins mentioned above > 4 12 32 48 49 58 70 78 86 And _total_ would have a value of 86 Once that's done it's time to perform the actual _median cut_ and for the red axis this is performed on line 01346 It iterates over bins and check they accumulated sum. And here's the part that throws me of from the description of the algorithm. It looks for the first bin that has a value that is _greater_ than _total/2_ Wouldn't _total/2_ mean that it is looking for a bin that has a value that is greater than the _average_ value and not the _median_ ? The median for the above bins would be _49_ The use of _43_ or _49_ could potentially have a huge impact on how the boxes are split, even though the algorithm then proceeds by moving to the center of the larger side of where the matched value was.. Another thing that puzzles me a bit is that the paper specified that the bin with the median value should be located, but does not mention how to proceed if there are an even number of bins.. the median would be the result of _(a+b)/2_ and it's not guaranteed that any of the bins contains that population count. So this is what makes me thing that there are some approximations going on that are negligible because of how the split actually takes part at the center of the larger side of the selected bin. Sorry if it got a bit long winded, but I wanted to be as thoroughas I could because it's been driving me nuts for a couple of days now ;)


title: Moving Forward with Code Iteration

text: There are times when working on my programming projects, and I get to a point where I'm ready to move on to the next part of my program. However, when I sit down to implement this new feature I get stuck, in a sense. It's not that I don't know how to implement the feature, it's that I get stuck on figuring out _the best_ way to implement said feature. So I sit back for a day or two and let the ideas ferment until I am comfortable with a design. I get worried that I may not write something as well as it could be, or that I might have to go back and rework the whole thing; so I put it off. This is a big reason why I've never really finished many personal projects. Anyone else experience this, and how do you keep your self moving forward in your project?


title: Helpful articles on the subject of managing programmers?

text: What are the most helpful articles on the subject of managing programmers? I came across this one recently, and thought it was excellent - The unspoken truth about managing geeks What else is out there?


title: Considering career change to patent agent/patent engineer

text: After programming professionally for 17 years, I'm considering change careers and becoming a patent agent/engineer. Has anyone else pursued or evaluated that path? Any insight, rants or raves?


title: Communicating with Management

text: What are some concrete suggestions and techniques for communicating with management? My premise for this question is that as programmers we think in a much more granular/detail-oriented way than managers. It's not that managers can't think at this level, it's just that their decision making and judgement applies to a different spectrum. Where the manager may think in terms of "done" / "not done" the developer may think in terms of individual features, test cases, or bugs. Where a manager may be thinking "lots of bugs" / "bug free" a developer may think in terms of a ratio of feature to bugs or feature complexity or test coverage.


title: Creating a library in two languages simultaneously

text: I'm planning on writing an open source HTML parsing library in .Net so that I have a project out in the wild when I start looking for developer jobs. Now, in my Masters program I started learning Java and found that I like it as well and was also thinking that I could also write the library in Java at the same time, to improve my Java skills at once. Would that be advisable? Does the fact that Java and C# are similar languages play into the decision to do two libraries at once? My main concern is instead of having one great library, I end up with two mediocre libraries. Being new to development, are there any other pitfalls I should look out for? Also would having the library on the JVM and .Net work to my advantage any more than just one of those platforms when it comes to future employers? I did see this question, but my motivations aren't the same and I plan on releasing this code as well, so I'm not sure if the answers will differ.


title: skills that can't be outsourced- web development related

text: I never know where it's acceptable to post something like this, so please forgive if it's in the wrong place. I'm very interested in going further in to web development; I know a bit of javascript, a bit of php, and so forth, but I'm now seeing these services that will go from psd to wordpress for 200 bucks and I'm wondering how the hell is anyone able to compete with this? So I'm wondering if those more knowledgeable than me could tell me what areas are the least likely to be able to be outsourced, for 5 bucks to some kid in Uzbekistan( no offense to that kid).. do you think it's on the database management side, or maybe app development? ideas appreciated.


title: Convince a lone developer to use a separate build tool instead of the IDE one-click build

text: In my years of programming Java and more recently Scala, I've never used Ant, Maven, Gradle or any of those build tools for Java. Everywhere I've worked there was a build manager who took care of all of that -- I'd compile locally with the IDE for development and unit testing, then check in the source code and notify the build manager who did what was necessary to compile everybody's files for the shared environment. Now that I'm between contracts I've been working on my own self-funded project and it's getting to the point where it could be good enough to actually make money. I even have a potential investor lined up and plan to show them a beta version in the next few weeks. But all along I just click the build button on the IDE, and it creates the Jar file and it works just fine. Of course, the conventional wisdom suggests that I "should" be writing my own Ant/Maven/Gradle scripts and using that instead of the IDE, but what are the concrete advantages of that in my situation (working alone)? I've done some reading about how to use those build tools, and it just looks like I'd be writing hundreds of lines of XML (or Groovy or whatever) to do to what the IDE does in one click (the IDE-generated Ant XML for the project is over 700 lines). It just looks error-prone and time-consuming and unnecessary for my situation. Not to mention the learning curve, which would take away time from all the other work I'm doing to get the product ready to show people.


title: WinRT and .NET: What is it, where do i place it and what does it change?

text: Say I'm a .NET developer and want to build my application on WinRT. What I've read is that it is a completely new API for Windows 8, strongly related to Metro-style apps. I'm assuming that I can develop for WinRT in .NET/C#? How does it relate for example to WPF or Silverlight? Does WinRT provide it's own UI framework, or can I build a WPF application on top of WinRT? What about basic I/O. .NET provides methods for that, if I develop with/for WinRT, do I have to use other methods, or will the .NET framework use WinRT under the hood? Besides these specific questions, the overal question is really how does it relate to the other APIs and frameworks I'm currently familiar with as a .NET/C# developer?


A problem that I am facing and would like some input into is; a Product Owner introduces ungroomed (unfamiliar, not estimated) User Story(s) into the Sprint Planning meeting. The issue that this has caused is the team rushes to understand and estimate the User Story(s), which puts significant time pressure on the commitment portion of the Sprint Planning meeting. The team also seems to be unsure of their estimate due to the rushed nature of grooming them in the Sprint Planning meeting. The end result of this is a rushed, half hearted Sprint commitment, which is usually an under-commitment due to so much uncertainty. I have seen two distinctly different causes for the late introduction of the User Story(s):   1. The team is new to Scrum and has been having difficulties grooming stories, prior to planning.    2. A brand new high priority User Story has appeared just before the Sprint Planning meeting. I have discussed these issues with the Product Owner and we have decided upon on actions, I am wondering what have you tried when the Product Owner introduces a brand new high priority User Story just before or even in the Sprint Planning meeting? What worked, what failed? The team that is having difficulty grooming User Stories in new to Scrum; hence I suspect that some facilitation of their grooming sessions, mentoring and some time will help them. Do you have any other suggestions for helping teams come up prompt Planning Poker estimates?


title: What should I include in XML documentation comments?

text: I'm trying to make a point of documenting my code better, especially when it comes to the XML comments on class members, but often it just feels silly. In the case of event handlers, the naming convention and parameters are standard and clear:               /// <summary>     /// Handler for myCollection's CollectionChanged Event.     /// </summary>     /// <param name="sender">Event Sender</param>     /// <param name="e">Event Arguments</param>     private void myCollection_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)     {         // actual code here...     }      I also frequently have simple properties that are (IMO) named clearly so that the summary is redundant:               /// <summary>     /// Indicates if an item is selected.     /// </summary>     public bool ItemIsSelected     { get { return (SelectedItem != null); } }      I don't feel like such comments don't add any information that the declaration itself doesn't already convey. The general wisdom seems to be that a comment that repeats the code is best left unwritten. Obviously, XML documentation is more than just regular inline code comments, and ideally will have 100% coverage. What **_should_** I be writing in such cases? If these examples are OK, what value do they add that I may not be appreciating now?


title: Are there bots that download new iOS apps without being asked?

text: I noticed on the first day my iOS app hit the app store I got a download from Albania and another one from China. The app is only useful to a specific group, all of which are in a certain U.S. city. Are there bots that automatically download every new app? If so, to what end?


title: Where can I learn more about JavaScript and Python?

text: Been teaching myself how to code over the past four months or so -- mainly in JavaScript, but just started Python -- and had a revelation today. I can write in JavaScript pretty well, but I don't actually know what JavaScript **is**. Basically I know how to use it, but not the advantages/disadvantages, its origination, its purpose, etc. What is the purpose and background behind Javascript and why was it created?


title: What determines which Javascript functions are blocking vs non-blocking?

text: I have been doing web-based Javascript (vanilla JS, jQuery, Backbone, etc.) for a few years now, and recently I've been doing some work with Node.js. It took me a while to get the hang of "non-blocking" programming, but I've now gotten used to using callbacks for IO operations and whatnot. I understand that Javascript is single-threaded by nature. I understand the concept of the Node "event queue". What I DON'T understand is what determines whether an individual javascript operation is "blocking" vs. "non-blocking". How do I know which operations I can depend on to produce an output synchronously for me to use in later code, and which ones I'll need to pass callbacks to so I can process the output after the initial operation has completed? Is there a list of Javascript functions somewhere that are asynchronous/non-blocking, and a list of ones that are synchronous/blocking? What is preventing my Javascript app from being one giant race condition? I know that operations that take a long time, like IO operations in Node and AJAX operations on the web, require them to be asynchronous and therefore use callbacks - but who is determining what qualifies as "a long time"? Is there some sort of trigger within these operations that removes them from the normal "event queue"? If not, what makes them different from simple operations like assigning values to variables or looping through arrays, which it seems we can depend on to finish in a synchronous manner? Perhaps I'm not even thinking of this correctly - hoping someone can set me straight. Thanks!


title: Is this considered an implementation of a Layer Supertype pattern?

text: **1.** According to Fowler's definition this pattern is implemented by having all classes in a layer inherit from a superclass. But after some googling it appears all of the following are considered as implementations of a _Layer Supertype_ pattern: a - all classes in a layer inheriting from the same superclass   b - having only some ( thus not all ) of classes in a layer inheriting from a superclass   c - layer having superclasses **S1** and **S2** , where classes **A** and **B** inherit from **S1** , while **C** inherits from **S2** So which of above are considered as implementations of a _Layer Supertype_? **2.** If a,b and c are all considered implementations of a _Layer SuperType_ , then I fail to see how this pattern is any different from a regular _class inheritance_. In other words, couldn't we then claim we're using _Layer Supertype_ any time some class inherits from another class? thanks


title: Which component is responsible for updating the database schema?

text: We have what can be called a _distributed application_ : One full-blown web app and a small REST service. Both must be separately deployable. Both access the same database schema (they actually share only two tables). The common functionality is encapsulated in a common artifact (a JAR file here, since it’s all Java). So far, so good. However, I’m unsure how to handle schema changes properly. The web app uses Flyway for its schema updates, it works like a charm. But what should be the recommended procedure if one of the _shared tables_ needs an update? Whose responsibility should the upgrade be? (At the moment it is the web app that performs all the upgrades, perhaps that’s good enough, but it worries me.) I thought of perhaps even changing the architecture to have a separate application or service that has both web app and REST service as a client, but this would only make things difficult, not actually remove the problem.


title: Do developers ever contract by retainer? If not, why?

text: I'm leaving my current employer in two weeks, but have an excellent relationship with them and am somewhat emotionally attached to a project that I have developed over the last couple of years. They've asked me if I'd be willing to contract with them to continue supporting that project. I was thinking of proposing a monthly retainer that would assure them 5-10 hours of support, including answering support E-mails, fixing any bugs, and small stability enhancements and feature tweaks. I haven't ever seen any mention of software developers contracting under retainer; is this done? If not, is there something that makes it is a bad idea?


title: Am I barking up the wrong tree with Scala?

text: Having some spare time, I've decided to learn a new programming language while developing - for fun, will never see the light of day - an insurance administration web application (insurance is the industry I know). So I chose Scala as the language to learn but the more I learn the more I wonder if Scala fits the bill for the app I want to build. I don't want to bother learning functional programming and ignore all the best practices by making my domain objects - Policy, Section, Coverage, Insured, Insurer, etc. - mutable. Insureds have Policies which have Sections which have Coverages provided by Insurers blah blah. So there is this inter-relationship between all these objects and I don't understand how to update one object in the functional paradigm. Is it possible and worth the effort?


title: What's are best Windows 7 gadgets for programmers?

text: I am looking for a theme with gadgets that will make my life easier as a programmer.   Googling from the desktop is one feature I am looking for.   Integration with SharePoint or other bug trackers are the second.   Any other idea that might make me more productive is a good one.


title: Noobie wants to use source control, how would you guide them?

text: Let's say you know of an anonymous noobie that wants to be lead upon the path of righteousness. This noobie wants to use some sort of source control tools simply for the experience of using source control tools (and possibly for whatever benefits they bring along with them). To constrain things further (and to make this possibly even more noobie- tastic), let's say they're stuck in windows developing in visual studio. How would you guide your neophyte?


title: Origin of the name “OpenServer” for the SCO Unix operating system

text: I was looking over the evolutionary history of Unix and Unix-like systems on Wikipedia and one operating system name stood out to me: **OpenServer**. Judging from the image, SCO's **OpenServer** is completely _closed sourced_ ; so why does SCO **OpenServer** have the word "open" in its name if the operating system is proprietary and contains no open source code? I suspect this is because the original **Unics** operating system had a mixed/shared license, but that seems like a pretty distant ancestor when the proprietary **Xenix** came before **OpenServer** as well. Can anyone shed some light on the reason for this name?


title: Combining template method with strategy

text: An assignment in my software engineering class is to design an application which can play different forms a particular game. The game in question is Mancala, some of these games are called Wari or Kalah. These games differ in some aspects but for my question it's only important to know that the games could differ in the following:   * The way in which the result of a move is handled   * The way in which the end of the game is determined   * The way in which the winner is determined The first thing that came to my mind to design this was to use the strategy pattern, I have a variation in algorithms (the actual rules of the game). The design could look like this: ![enter image description here](http://i.stack.imgur.com/mk3EA.png) I then thought to myself that in the game of Mancala and Wari the way the winner is determined is exactly the same and the code would be duplicated. I don't think this is by definition a violation of the 'one rule, one place' or DRY principle seeing as a change in rules for Mancala wouldn't automatically mean that rule should be changed in Wari as well. Nevertheless from the feedback I got from my professor I got the impression to find a different design. I then came up with this: ![enter image description here](http://i.stack.imgur.com/3Ad2p.png) Each game (Mancala, Wari, Kalah, ...) would just have attribute of the type of each rule's interface, i.e. `WinnerDeterminer` and if there's a Mancala 2.0 version which is the same as Mancala 1.0 except for how the winner is determined it can just use the Mancala versions. I think the implementation of these rules as a strategy pattern is certainly valid. But the real problem comes when I want to design it further. In reading about the template method pattern I immediately thought it could be applied to this problem. The actions that are done when a user makes a move are always the same, and in the same order, namely:   * deposit stones in holes (this is the same for all games, so would be implemented in the template method itself)   * determine the result of the move   * determine if the game has finished because of the previous move   * if the game has finished, determine who has won Those three last steps are all in my strategy pattern described above. I'm having a lot of trouble combining these two. One possible solution I found would be to abandon the strategy pattern and do the following: ![enter image description here](http://i.stack.imgur.com/uiopy.png) I don't really see the design difference between the strategy pattern and this? But I am certain I need to use a template method (although I was just as sure about having to use a strategy pattern). I also can't determine who would be responsible for creating the `TurnTemplate` object, whereas with the strategy pattern I feel I have families of objects (the three rules) which I could easily create using an abstract factory pattern. I would then have a `MancalaRuleFactory`, `WariRuleFactory`, etc. and they would create the correct instances of the rules and hand me back a `RuleSet` object. Let's say that I use the strategy + abstract factory pattern and I have a `RuleSet` object which has algorithms for the three rules in it. The only way I feel I can still use the template method pattern with this is to pass this `RuleSet` object to my `TurnTemplate`. The 'problem' that then surfaces is that I would never need my concrete implementations of the `TurnTemplate`, these classes would become obsolete. In my protected methods in the `TurnTemplate` I could just call `ruleSet.determineWinner()`. As a consequence, the `TurnTemplate` class would no longer be abstract but would have to become concrete, is it then still a template method pattern? To summarize, am I thinking in the right way or am I missing something easy? If I'm on the right track, how do I combine a strategy pattern and a template method pattern?


title: Who owns the IP rights of the software without written employment contract? Employer or employee?

text: I am a software engineer who got an idea, and developed alone an integrated ERP software solution over the past 2 years. I got the idea and coded much of the software in my personal time, utilizing my own resources, but also as intern/employee at small wholesale retailer (company A). I had a verbal agreement with the company that I could keep the IP rights to the code and the company would have the "shop rights" to use "a copy" of the software without restrictions. Part of this agreement was that I was heavily underpaid to keep the rights. Recently things started to take a down turn in the company A as the company grew fairly large and new head management was formed, also new partners were brought in. The original owners distanced themselves from the business, and the new "greedy" group indicated that they want to claim the IP rights to my software, offering me a contract that would split the IP ownership into 50% co-ownership, completely disregarding the initial verbal agreements. As of now there was no single written job description and agreement/contract/policy that I signed with the company A, I signed only I-9 and W-4 forms. I now have an opportunity to leave the company A and form a new business with 2 partners (Company B), obviously using the software as the primary tool. There would be no direct conflict of interest as the company A sells wholesale goods. My core question is: **"Who owns the code without contract? Me or the company A? (in FL, US)"** **Detailed questions:**   1. I am familiar with the "shop rights", I don't have any problem leaving a copy of the code in the company for them to use/enhance to run their wholesale business. What worries me, **Can the company A make any legal claims to the software/code/IP and potential derived profits/interests after I leave and form a company B?**   2. **Can applying for a copyright of the code athttp://www.copyright.gov in my name prevent any legal disputes in the future? Can I use it as evidence for legal defense?** Could adding a note specifying the company A as exclusive license holder clarify the arrangements?   3. **If I leave and the company A sues me, what evidence would they use against me? On what basis would the sue since their business is in completely different industry than software (wholesale goods). Every single source file was created/stored on my personal computer with proper documentation including a copyright notice with my credentials (name/email/addres/phone).** It's also worth noting that I develop significant part of the software prior to my involvement with the company A as student.   4. **If I am forced to sign a contract and the company A doesn't honor the verbal agreement, making claims towards the ownership, what can I do settle the matter legally?** I like to avoid legal process altogether as my budget for court battles is extremely limited at the moment.   5. **Would altering the code beyond recognition and using it for the company B prevent the company A make any copyright claims?** My common sense tells me that what I developed is by default mine in terms of IP, unless there is a signed legal agreement stating otherwise. But looking online it may be completely backwards, this really worries me. _I understand that this is not legal advice, and I know to get the ultimate answer I need to hire a lawyer. I am only hoping to get some valuable input/experience/advice/opinion from those who were in similar situation or are familiar with the topic._ Thank you, PT


title: Pure C++ for iOS apps

text: Is it possible to use only C++ to create iOS apps? Is there any downside to that? I read somewhere that you have to use a mix of objective C and C++ if you want to use C++ that bad.


title: Namespaces and naming

text: I'm having some trouble working this one out, probably more than I should. This is a pretty large project, with a very clearly defined structure, with no obvious problems, but I can't seem to figure out the optimal solution for this case, even after reading several convention documents and such. For example, given the following namespace:               \vendor\core\lib\view;      Obviously it refers to a "view" namespace...which technically also has a 'view' class in it:               \vendor\core\lib\view\view      This is clearly not ideal, but I can't come up with a better way to name these. Take for example the cache namespace:               \vendor\core\lib\cache;      Same deal, the cache class becomes confusing when inside this namespace:               \vendor\core\lib\cache\cache;      Should I just move these 'core' classes from their namespaces, and put them in the parent namespace?               \vendor\core\lib\cache (class)     \vendor\core\lib\cache\adapter\redis (class)      Or is there a better term to refer to these types of classes? Pardon my circularity, it's a bit late and my head's not quite working in optimal condition.


title: Interview questions on C++ for developers with mainly Java/.NET experience

text: What questions would ask a candidate with mainly Java/.NET experience (10 years+) in an interview for a C++ position?


title: Programs that claim they are not "multi-core" friendly

text: You see this phrase or similar kicked around from time to time, generally referring to a program that claims they were not designed to take full advantage of multi-core processors. This is common especially with video game programming. (of course a lot of programs have no concurrency and do not need it, such as basic scripts, etc). How can this be? A lot of programs (especially games) inherently use concurrency, and since the OS is in charge of task scheduling on the CPU, then are these programs not inherently taking advantage of the multiple cores available? What would it mean in this context to "take advantage of multiple cores"? Are these developers actually forbidding OS task scheduling and forcing affinity or their own scheduling? (Sounds like a major stability issue). I'm a Java programmer, so maybe I have not had to deal with this due to abstractions or whatnot.


title: Use the word "Apple" and "Safari" in my application

text: I am developing an application and i want to use two words somewhere in my application. First i want to use the word "Safari" in a menu option which labels "Open in Safari"(for a url). The second is the word "Apple" in my Terms pages where i want to use it in the phrase "....as provided by Apple",referring to technologies and API's provided by Apple. Can i use them and if yes with in which conditions?(adding "TM" or "Copyright" signs maybe?). Thanks.


title: How do memory-clean apps work?

text: In terms of operating system architecture, what does a memory-clean software to get rid of all data that fill the virtual memory? I assume that it simply saves all RAM data into a file, but how does it exactly do this? What happens if you delete a file while a process that has resources on that file is executing? Hope this is not a too-broad question.


title: What do I gain by using the Strategy pattern in this case?

text: I wrote a program with Java that plays simple music. Currently chords have only one way ('strumming pattern') to be played. I want to expand this and create different 'strumming patterns' that chords can use to play their notes. The `Chord` class has a `play()` method that is responsible for playing the chord. Currently it contains the logic for the only 'strumming pattern' of how the notes are played. To add new strumming patterns, the simplest approach is to change `play()` to something like this:               void play(int strummingStyle){         if(strummingStyle == REGULAR_STYLE) playRegular();         if(strummingStyle == SOMETHING_ELSE_STYLE) playSomethingElse();         // .. etc     }      Have a method for each strumming style, and parameterize the method to play a specific style. However using the Strategy pattern feels like a better approach. What I mean is to encapsulate each strumming pattern in a subclass of `StrummingPattern` and set the `Chord` to a specific strumming pattern: `chord.setStrummingPattern(StrummingPattern pattern);`. `play()` would then simply delegate to the strumming pattern like so:               void play(){         pattern.play();     }      While this clearly **feels** like the better, more OO approach - I find that I can't explain myself what the actual benefits are. And it's important for me to actually understand _why_ I'm doing something. Please explain why using the Strategy pattern in a case like this is a better approach than the more naive 'a method represents a behavior' approach. **What exactly are the Strategy pattern's benefits in this kind of situation? Why should I use it?**


title: Objective Metrics for Software Quality

text: There are various types of quality that can be measured in software products, e.g. fitness for purpose (e.g. end use), maintainability, efficiency. Some of these are somewhat subjective or domain specific (e.g. good GUI design principles may be different across cultures or dependent on usage context, think military versus consumer usage). What I'm interested in is a deeper form of quality related to the network (or graph) of types and their inter-relatedness, that is, what types does each type refer to, are there clearly identifiable clusters of interconnectivity relating to a properly tiered architecture, or conversely is there a big 'ball' of type references ('monolithic' code). Also the size of each type and/or method (e.g. measured in quantity of Java byte code or .Net IL) should give some indication of where large complex algorithms have been implemented as monolithic blocks of code instead of being decomposed into more manageable/maintainable chunks. An analyis based on such ideas may be able to calculate metrics that are at least a proxy for quality. The exact threshold/decision points between high and low quality would I suspect be subjective, e.g. since by maintainability we mean maintainability by human programmers and thus the functional decomposition must be compatible with how human minds work. As such I wonder if there can ever be a mathematically pure definition of software quality that transcends all possible software in all possible scenarios. I also wonder if this a dangerous idea, that if objective proxies for quality become popular that business pressures will cause developers to pursue these metrics at the expense of the overall quality (those aspects of quality not measured by the proxies). Another way of thinking about quality is from the point of view of entropy. Entropy is the tendency of systems to revert from ordered to disordered states. Anyone that has ever worked on a real world, medium to large scale software project will appreciate the degree to which quality of the code base tends to degrade over time. Business pressures generally result in changes that focus on new functionality (except where quality itself is the principle selling point, e.g. in avionics software), and the eroding of quality through regression issues and 'shoe-horning' functionaility where it does not fit well from a quality and maintenance perspective. So, can we measure the entropy of software? And if so, how?


title: Do all programs run in a loop?

text: I was wondering whether all programs run in a Loop, checking for variable changes then acting upon said changes followed by another Loop. Or do they run in a While statement, waiting for a variable to change before they execute a routine? Or am I just completely wrong?


title: If an object should be flagged, should it be built with the flag attribute?

text: Let us assume I have a basic object with a handful of self-relevant points of data.               class A(object):         def __init__(self, x, y, width, length):             self.x = x             self.y = x             self.width = x             self.length = x      And so we go on to instantiate several `A` objects and shove them into a list, as programmers are wont to do. Now let us assume that these objects need to be checked for a particular state every so often, but we needn't check them on _every_ pass, because their state doesn't change particularly quickly. So a checking method is written somewhere:               def check_for_ticks(object_queue):         for obj in object_queue:             if obj.checked == 0 and has_ticks(obj):                 do_stuff(obj)             obj.checked -= 1      Ah, but wait - it wasn't designed with `obj.checked` attribute! Well no big deal, Python is kind and lets you add attributes whenever, so we change the method a bit.               def check_for_ticks(object_queue):         for obj in object_queue:             try:                 obj.checked =- 1             except AttributeError:                 obj.checked = 0             if obj.checked == 0 and has_ticks(obj):                 do_stuff(obj)      This works, but it gives me pause. My thoughts are mixed, because while it's a functional attribute to give an object and it solves a problem, the attribute isn't really used by the object. `A` will probably never modify its own `self.checked` attribute, and it isn't really an attribute that it 'needs to know about' - it's just incredibly convenient to give it that attribute in passing. But -- what if there are multiple methods that might want to flag an object? Surely one does not create the class with every attribute that some other method might maybe want to flag it for? Should I be giving objects new attributes in this way? If I should not, what is the better alternative to just giving them new attributes?


title: Is there a name for this technique in testing?

text: When I've written tests for some code and want to make sure that it's actually testing what it's supposed to, I'll mess up or remove the code-under-test, and see if the tests fail. If they don't, I've got a problem. Is there a name for this technique? It's a real bother having to talk in sentences everytime I want to suggest to someone that they do it.


title: Static or non-static?

text: For example I have these two classes: First               public class Example     {         public Example()         {         }              public int ReturnSomething         {            return 1;         }     }      Second               public class Example         {             public Example()             {             }                  public static int ReturnSomething             {                return 1;             }         }      I want to use the `ReturnSomething` method, which of the two classes allocated less/more memory? When I use               int x = Example.ReturnSomething;      or when I use               Example object = new Example();     int x = object.ReturnSomething();


title: Why have private static methods?

text: I just wanted to clear up a question I have. What is the point of having a private static method as opposed to a normal method with private visibility? I would have thought an advantage to having a static method is that it can be called without an instance of a class, but since its private is there even a point to it being static? The only reason I can think of is that it helps conceptually understanding the method on the class level as opposed to object level.


title: Dependency Inversion Principle vs "Program to an interface, not an implementation"

text: I'm trying to understand how the Dependency Inversion Principle differs from the "program to an interface, not an implementation" principle. I understand what "Program to an interface, not an implementation" means. I also understand how it allows for more flexible and maintainable designs. But I don't understand how the Dependency Inversion Principle is different from the "Program to an interface, not an implementation" principle. I read about DIP in several places on the web, and it didn't clear up my confusion. I still don't see how the two principles differ from each other. Thanks for your help.


title: Location services on Mobile platforms

text: Do location based services on mobile devices know what business you are in exactly or does it just have a general approximation of where you are and you have to manually check in to be specific? Trying to see if it's possible for a application on a mobile phone to use location services to determine how many given people are in a particular business without having to manually check in. Is this possible,and if so, would this be accurate information or a loose approximation? Thanks in advance ^_^


title: What design is best for data transformation?

text: My company's database makes available data to a lot of external applications. So I need to transform the same data to a lot of _dynamic_ views. I can see that a former database developer had implemented many long chains of view- function-procedure call sequences to do transformation more common to all external applications. I think, this architecture and so long requests (stored proc calls a function, then function calls some view and this view based on other one and so on) are a performance problem, at least query optimizer does not resolve these issues (please confirm my guesses). Is it a good approach? Does it cause degradation of performance? If yes, how can I reimplement objects of the database. At this moment I see these steps to do this:   * analysis of source data structure (own data)   * analysis of all external systems (what formats does database have to provide for)   * separate views, functions, stored procs for every external subsystems (I have to avoid long chains, common to many subsystems DB objects, if it is a cause of problem)


title: How to handle a Restful Call in a RESTless state?

text: I have a bit of a dilemma. We are choosing our DBContext using a dynamic builder. This is done because in the current database structure we have a separate server for every "Customer". All of these Customer Databases use the same model so they are all exactly the same structure. Enter picking the context to use with each call. We are using WebApi 2 and angular. What we do is on the first "page" you pick your customer and we pass the customerId down and I need to store this value until the user decides to swap. That being said Session and WebApi2 are not friends. I have a base repository that needs the customerId every time a call is made to one of the repositories. We have to verify that we are using the right context for that customer. So.... That's where I am. Should I break the rules and use Session to store the customerId? I could use my DI container to inject an instance of HttpContext.Current into every call so that I would ignore the fact that session is null on a WebApiController. Is there another way to handle this?


title: Is the abundance of frameworks dumbing down programmers?

text: With all of the frameworks available these days, ORMs, dependency injection (DI), Inversion of control (IoC), etc., I find that many programmers are losing or don't have the problem solving skills needed to solve difficult issues. Many times, I've seen unexpected behaviour creep into applications and the developers unable to really dig in and find the issues. It seems to me that deep understanding of what's going on under the hood is being lost. **Don't get me wrong** , I'm not suggesting these frameworks aren't good and haven't moved the industry forward, only asking if, as a unintended consequence, developers aren't gaining the knowledge and skill needed for deep understanding of systems.


title: Learning how to integrate JavaScript with other languages

text: After learning JavaScript syntax, what are some good resources for learning about integrating JavaScript with other languages (HTML, XML, CSS, PHP) to create real, useful applications? I'm most interested in reading articles or other people's code - not so interested in books. Basically, I'm looking to move from programming puzzle- solvers to programming complex applications and could use some advice.


title: what kind of online technical documentation system would you recommend?

text: the goal is to have an online documentation system, with these major requirements:   * will be mainly used as an intermediate stage for the final technical docs of all our application (which will probably never get completed though :]). It would be typically used as so: someone has a problem, I fix it, and write down the fix immedeately. What happens now is getting unmanagable: someone has a problem, I fix it, both me and someone are happy but 2 months later somebody else has the same problem and nobody remembers what the fix was.   * accessible from everywhere, running behind our apache server   * user/group managment, allowing read-only/read-write/admin access   * the format is not too important: plain text would do, wiki-style would be nicer though   * cheap or free some ideas of mine:   * just serve files on a file share or through ssh (cons: not too copmatible with windows, pros: simple, can be any file type)   * keep it in an SCM (svn/git, idem as above but easier to access and control access)   * Confluence: we use Jira already, is Confluence worth it? How does it integrate with Jira?   * something else? Please don't hesitate commenting on these or share your experience with other systems.


title: Why can python webapps keep sessions between restart and not java?

text: I've used both webapp2 + GAE for python and a number of Java/JEE webapp frameworks. The python WSGI framework could keep users logged in while I redeploy the app while none of the Java web framework that I tried could do it. If I redeploy, users of the Java webapp will get logged out but if I use GAE for python then a redeployment doesn't log users out. Is this a general "feature" of python vs Java webapps and is this true in general or just a coincidence that the ones I tried had these features? Is there a name for this feature, ability to keep users logged in between redeployments and also keeping caches (e.g. memcache) without getting the cache erased for updating the app=


title: How to avoid Memory Error

text: I am working with quite large files (pytables) and I am having problems with the `Memory Error` when I try to load the data for processing. I would like some tips about how to avoid this in my python 32bits, since I am new working with pandas and pytables, and I do not know how to work splitting the data in small pieces. My concern also comes when, if I get to split the data, how to calculate statistics like mean, std, etc without having the entire list or array, etc. This is a sample of the code that I am using now, this works fine with small tables:               def getPageStats(pathToH5, pages, versions, sheets):              with openFile(pathToH5, 'r') as f:             tab = f.getNode("/pageTable")                  dversions = dict((i, None) for i in versions)             dsheets = dict((i, None) for i in sheets)             dpages = dict((i, None) for i in pages)                       df = pd.DataFrame([[row['page'],row['index0'], row['value0'] ] for row in tab.where('(firstVersion == 0) & (ok == 1)') if  row['version'] in dversions and row['sheetNum'] in dsheets and row['pages'] in dpages ], columns=['page','index0', 'value0'])                     df2 = pd.DataFrame([[row['page'],row['index1'], row['value1'] ] for row in tab.where('(firstVersion == 1) & (ok == 1)') if  row['version'] in dversions and row['sheetNum'] in dsheets and row['pages'] in dpages], columns=['page','index1', 'value1'])                          for i in dpages:                           m10 = df.loc[df['page']==i]['index0'].mean()                 s10 = df.loc[df['page']==i]['index0'].std()                      m20 = df.loc[df['page']==i]['value0'].mean()                 s20 = df.loc[df['page']==i]['value0'].std()                      m11 = df2.loc[df2['page']==i]['index1'].mean()                 s11 = df2.loc[df2['page']==i]['index1'].std()                      m21 = df2.loc[df2['page']==i]['value1'].mean()                 s21 = df2.loc[df2['page']==i]['value1'].std()                      yield (i,m10, s10), (i,m11, s11), (i,m20,s20), (i,m21,s21))       As you can see, I am loading all the necessary data into a Pandas DataFrame to procoess it, just the mean and the std by now. This is quite fast, but for a pytable with 22Millions of rows I get `Memory Error`


title: content fingerprint algorithm

text: I have a database containing just simple URLs. It is as simple as it sounds for now and URL can link to a website or a document(i.e. anything parseable to text). Now I have a simple code which inserts records to database. The problem is that website/document may be actually the same, just:   * Hosted somewhere else   * Not available so linked from Google Cache   * Not available so linked from archive.org   * Page can be republished from another source   * etc... _**I would like to get some kind of fingerprint of a website/document and think of a way to do so._** What I have thought of: **I can rely on title** because even if content is published somewhere else or cached on some server it will probably will have the same title. That's ok, as title is usually short and doesn't consume a lot of space. Downside - this works only on website. Maybe a filename is appropriate for documents but these can be renamed too. **I can rely on keyword count** But the problem is that I just enter URL and no keywords nor do I want to do so. It is a simple URL storage engine. **I can get a some kind of checksum of all the content** But this method would be a total guess. **SO MY QUESTION IS:** How can I fingerprint a content so later on I could identify possible duplicates ? **EDIT** I don't want to fingerprint just the title. I want to fingerprint the whole content. Content stays the same but can be hosted anywhere and it's structure(title too) can change. For documents - filename can change too. I want to fingerprint content. All the text so I can later on identify possible duplicates.


title: Mixed licenses inside product

text: This question relates to software-licensing. Someone familiar with open-source licensing may be able to answer this question. I am facing an issue in trying to interpret/understand some Licenses, due to a language barrier (English is not my first language). My situation is that I am using three products inside a distributable closed-source commercial product. These are:   * Jersey (Common Development and Distribution License)   * Jetty (Dual Apache & Eclipse)   * RXTX (LGPL) The tools above are not modified in my project and are used 'as is' included with Maven. My question is what step/s should I take to be perfectly sure I am not violating any Licence agreements? Should I (for example):   * Put some information inside the README file that I am using this software inside?    * Print something in command line?    * Should I place the full-license texts of those tools in separate files (but this could be misleading to customer, because my product doesn't have any Licence)?    * Could I extract these Licenses text files during the first JAR run?  I am looking for practical information, not necessarily from a lawyers.


title: Data Access Layer for application

text: I am working on a retail application where currently I'm using raw SQL like               insert into some_table values (Textbox1.Text, Textbox2.Text, ...)      and               update some_table set some_column = value      for save and update, but the problem is I need to write this everywhere that a save or update is needed. Is there a better solution for handling CRUD operations, like a separate class to contain data access logic which would use methods in the data access layer to perform CRUD operations?


title: How to combine Google Analytics with Relational Database

text: I have a website with quite a lot of registered users, they are stored in a PostgreSQL database. I also running Google Analytics on the website to track the users. Is there a way to individually combine the GA data with the registration data from the website, e.g. finding out the e-mail address of a user we found in GA? Also, is there a way for non-technical people to access the SQL database without knowing SQL? Thanks!


title: Automating tests in a browser not supported by selenium

text: I work on a company that have a payment system that runs under a executable kiosk instance of internet explorer 7. when the application is running the process name is not similar with iexplore.exe or something like that. The name of the windows process is the same as the executable.exe. We cannot run the system under a local webserver because the executable expect some pages in pure .html to process the data and give the users change. The executable pass information to the .html forms and vice-versa. So we cannot user another browser. I think selenium will not work with this browser. Any idea how i can automate tests on the interface? **EDIT** Selenium fail trying to start my executable: _Exception: Failed to start new browser session: org.openqa.selenium.server.RemoteCommandException: Error while launching browser_ I think the executable its not the browser itself. Its just a executable that make some security tasks and after that call a internet explorer instance somehow. But the internet explorer process don´t appear on the windows process.


title: What programming skill do you use most often that you are terrible at?

text: What are the techniques that you use just about everyday, but are still awful at? Are you bad at it because of the difficulty of the task, laziness to learn better, or some other reason?


title: How could we rewrite the 'No Evil' license to make it 'free'?

text: I did not find the lawyers' SE site, so I thought it best to post here.               /*      * ...subject to the following conditions:      *      * The above copyright notice and this permission notice shall be included in all      * copies or substantial portions of the Software.      *      * The Software shall be used for Good, not Evil.      *      * THE SOFTWARE IS PROVIDED "AS IS"...      */      This is the 'non-free', Crockford, No-Evil, MIT-style, license. This license is considered non-free because of this phrase: " **The Software shall be used for Good, not Evil.** " How could we rewrite this to become a 'free' license, while retaining the original spirit of the sentence?


title: Making a basic computer that adds number passed by the user

text: What are the things that I should be familiar with to make my own computer that can add two numbers, in the same way that happens in a calculator? Can anyone please give me links that teach these things in detail? I know how to program but have never programmed at the root level.


title: How to identify and run the most relevant automated tests?

text: Suppose you have a reasonably large codebase (0.5 - 1 msloc) with a large test-suite (6-7hr single-threaded runtime; with a mix of unit-tests and integration-tests built with different tools). You have a proposed patch (or diff or pull-request) for the codebase, and you want to automatically run the most _relevant_ tests. Running _all_ tests would be too expensive. Running smoke-tests would be too shallow. The goal is to find something in-between. By automating the selection of relevant tests, you can help new developers participate in TDD -- and provide timely pre-merge feedback (as part of code- review). What techniques or arrangements would you use to identify "relevant"? (A basic example: if a patch modifies "src/(.*).php", then run "phpunit test/{$1}Test.php".) What, if any, existing tools come to mind? Or what new tools are needed? Or is it impossible for tooling to help? (For context: In my particular use-case, I work with LAMP-based web-apps, so tools or techniques that work with PHP/JS/bash are most helpful. But similar issues probably arise with any large app/deep stack, so examples from other stacks could provide insight.)


title: What is the most orthogonal programming language?

text: I find myself repeatedly annoyed by having to teach freshmen about special language rules (like array-to-pointer decay) that have absolutely nothing to do with programming in itself. So I wondered: What is the programming language with the smallest number of special language rules, where everything is first class and can be composed without annoying technical restrictions? Wouldn't such a language be the perfect teaching language? > ### Moderator Note > > We're looking for long answers that provide some explanation and context. > Don't just list a language: please explain _why_ you think the language > answers the question. Answers that don't explain anything will be deleted. > See Good Subjective, Bad Subjective for more information.


title: What suitable Q & A application can integrate with a Java portal?

text: I'm looking for suggestions on whether **we should build** _or_ **are there readymade applications** that do the following:   * Allow admins to build a structured workflow of support Q & A, similar to Windows Troubleshooting i.e. when you try one tip, you then get the next one.   * Allow end-users to search and follow the Q & A We have an existing Liferay portal which we would like to plug in this app to it - is there some suitable app like a CMS which does this? I mean building the structured questions - not just plain content like a wiki. Open source options are welcome, but I'd like to know of COTS as well.


title: Best practice for marking a bug as resolved in Bugzilla ?

text: I am wondering what is the best way to handle the situation of marking a bug as resolved and providing a version of component/product in which this fix can be found. **Context** For a project I am working on, we are using Bugzilla for issue tracking, and we have the following:   * A product "A" with a version number like vA.B.C.D, This product "A" have the following components:   * Component "C1" with a version number like vA.B.C.D,   * Component "C2" with a version number like vA.B.C.D,   * Component "C3" with a version number like vA.B.C.D. Internally we keep track of which component versions have been used to generate the product A version vA.B.C.D. Example: Product "A" version v1.0.0.0 has been produced from component "C1" v1.0.0.3, component "C2" v1.3.0.0 and component "C3" v2.1.3.5. And Product "A" version v1.0.1.0 has been produced from component "C1" v1.0.0.4, component "C2" v1.3.0.0 and component "C3" v2.1.3.5. Each component is a SVN repository. The person in charge of generating the product "A" have only access to the different components tags folder in SVN, and not the trunk of each component repository. **Problem** Now the problem is the following, when a bug is found in the product "A", and that the bug is related to Component "C1", the version of product "A" is chosen (e.g. v1.0.0.0), and this version allow the developer to know which version of component "C1" has the bug (here it will be v1.0.0.3). A bug report is created. Now let's say that the developer responsible for component "C1" corrects the bug, then when the bug seems to be fixed and after some test and validation, the developer generates a new tag for component "C1", with the version v1.0.0.4. At this time, the developer of component "C1" needs to update the bug report, but what is the best to do:   1. Mark the bug as resolved/fixed and add a comment saying "This bug has been fixed in the tags v1.0.0.4 of C1 component" ?   2. Keep the bug as assigned, add a comment saying "This bug has been fixed in the tags v1.0.0.4 of C1 component, update this bug status to resolved for the next version of the product that will be generated with the newest version (v1.0.0.4 of C1)" ?   3. Another possible way to deal with this problem. Right now the problem is that when a product component CX is fixed, it is not sure in which future version of the product A it will be included, so it is for me not possible to say in which version of the product it will be solved, but it is possible to say in which version of the Component CX it has been solved. So when do we need to mark a bug as solved, when the product A version include the fixed version of CX, or only when CX component has been fixed ? Thanks for your personal feedback and ideas about this !


title: Is FPA incompatible with Agile?

text: I am currently working in an Agile + SCRUM based project. I work on a lower level module. This leads to a peculiar problem. The work I do cannot be directly associated with a user story many times. Since I cannot relate a user story directly to my work I often face the problem that my requirements are unclear. Also I tend to "miss out" a few things which only become clear to me late in the sprint. And my layers work cannot be tested directly. On a similar note our GUI team was generating a lot of bugs due to missing out minor implicit requirements. For instance, the text field width was less than anticipated, etc. I had used FPA before in another project and I think it is a good way to break down requirements to the tiny atomic details , clarify the minor points and then build your software using the points as a checklist. I really felt that it would benefit our project and my layer in particular. I suggested it in my team meeting bit it was turned down becuase of the documentation involved. The "wise guy's" rationale: FPA is documentation-heavy and Agile frowns on heavy documentation. I argued that Agile is about producing good products and if an Agile process cannot be moulded to add a process that will reduce defects and produce good code, then it simply isnt "agile". In the end the team voted down the proposal claiming that it wasnt "Agile". however I suspect the reason was more likely to be laziness. Is FPA really incompatible with Agile due to the amount of documentation involved? What about the lofty aims of the Agile Manifesto? Is it just "wroking code" or "good working code"?


title: Is there a canonical book for learning Java as an experienced developer?

text: I have been a .NET developer now for about the past 5/6 years give or take. I have never done any professional Java development and the last time I really touched it was probably back in college. I have been toying with the Scala language a little bit but nothing serious. Recently, I've been offered an opportunity to do some pretty cool work, but using Java instead of .NET. I think I can get by alright with my current skill set, meaning I already know how to program well and am familiar with languages such as C# and C++, etc. So, the syntax and all that language stuff are really not a problem. What I need is a really good reference book and a book about how to think in Java. Each language/Framework/Stack tries to address things a certain way and I'm sure Java is no different. What are some great Java books that you simply can't live without? Are there any books that talk about the most important parts of Java that must be understood before all else? As a side note, I will be doing mostly Java web development. Not really 100% on what types of stuff they are using for persistence, framework, server, etc.


title: Effective Java for experienced Java programmers?

text: I own and read 'Java Puzzlers', 'Clean Code' and GOF's 'Design Patterns' and more specific technology books however I have not yet read 'Effective Java'. Whenever I see a list of must read books I always see a copy a 'Effective Java' but I have put off buying it seeing as a learn to write Java book rather than a write better Java book. Is it still worth a read or even a purchase. What is special about this book that I am missing out on by not reading this. I know my design patterns and practice TDD and attempt to write clean code :), what will I gain from this book?


title: Most efficient way to learn java if you already know how to code?

text: > **Possible Duplicate:**   >  Is there a canonical book for learning Java as an experienced developer? I've been coding for close to 25 years now in basic, (C64 & Amiga), (Object) pascal, C, LPC and for the last few years, Python. Python is definitely my favourite (and strongest) language. However, lately I've been forced to do stuff in Java - I have never written a single line of java code so far. So I'm asking your advice - what is the fastest and most efficient crash course to learn java. **EDIT** : I'm really looking for something along the lines _teaching java to people who know how to code and what OOP is_ \- not something that has _with no previous programming experience_ in the synopsis.


title: what is best book to learn optimized programming in java

text: > **Possible Duplicate:**   >  Is there a canonical book for learning Java as an experienced developer? > Let me elaborate a little: I used to be a C/C++ programmer where I used data structure concept like trees, queues stack etc and tried to optimize as much as possible, minimum no. of loops, variables and tried to make it efficient. It's been a couple of years that I started writing java codes, but it is simply not that efficient in terms of performance, memory intensive etc. > To the point: I want to enter **programming challenges** using java so I need to improve my approach at things I program. So please suggest me some books that can help me learn to program better and have a chance in solving challenges in programming.


title: OOP concept: is it possible to update the class of an instantiated object?

text: I am trying to write a simple program that should allow a user to save and display sets of heterogeneous, but somehow related data. For clarity sake, I will use a representative example of vehicles. The program flow is like this:   1. The program creates a **Garage** object, which is basically a class that can contain a list of vehicles objects   2. Then the users creates **Vehicles** objects, these **Vehicles** each have a property, lets say _License Plate Nr_. Once created, the **Vehicle** object get added to a list within the **Garage** object   3. \-- ** _Later on_** \--, the user can specify that a given **Vehicle** object is in fact a **Car** object or a **Truck** object (thus giving access to some specific attributes such as _Number of seats_ for the Car, or _Cargo weight_ for the truck) At first sight, this might look like an OOP textbook question involving a base class and inheritance, but the problem is more subtle because at the object creation time (and until the user decides to give more info), the computer doesn't know the exact Vehicle type. Hence my question: **how would you proceed to implement this program flow? Is OOP the way to go?** Just to give an initial answer, here is what I've came up until now. There is only one Vehicle class and the various properties/values are handled by the main program (not the class) through a dictionary. However, I'm pretty sure that there must be a more elegant solution (I'm developing using VB.net):               Public Class Garage         Public GarageAdress As String         Private _ListGarageVehicles As New List(Of Vehicles)              Public Sub AddVehicle(Vehicle As Vehicles)             _ListGarageVehicles.Add(Vehicle)         End Sub     End Class          Public Class Vehicles         Public LicensePlateNumber As String         Public Enum VehicleTypes             Generic = 0             Car = 1             Truck = 2         End Enum         Public VehicleType As VehicleTypes         Public DictVehicleProperties As New Dictionary(Of String, String)     End Class      NOTE that in the example above the public/private modifiers do not necessarily reflect the original code


title: Resources on concepts/theory behind GUI development?

text: I was wondering if there were any resources that explain concepts/theory behind GUI development. I don't mean a resource that explains how to use a GUI library, but rather how to create your own widgets. For example a resource that explains different methods on how to implement scrollable listboxes. I ask because I have an idea for a game tool where I would like to create my own widgets and let users drag and drop them onto some kind of form. How do GUI libraries usually draw widgets? I'm not sure if reskinning widgets from a GUI library fits my needs, since widget behavior needs to be dynamic based on user interaction.


title: What are the valid test cases for method calls within if-else condition

text: I have a discount service that gets called if certain conditions are met. I need to write test cases to check if the discount service is called. My doubt is checking if the discount service is NOT called for type 4 and 5 is a valid test case scenario.               public void ApplyDiscount(int typeId, double amount)     {          if(typeId == 1)     {       //call discount service     }          else if(typeId == 2)     {       //call discount service     }          else if(typeId == 4)     {        //do other stuff     }     else if(typeId == 5)     {        //do some other stuff     }          }


title: What revision control has the best merging engine?

text: When it comes to merging, each control version has it's engine to do it. Conflicts are unavoidable but the question is - which revision control has best AI to avoid conflict. Is it possible to measure such thing? More specifically, we are thinking to move to GIT cause it has nice hype and rumour that handles conflict better... Any comment is appreciated...


title: Should a user story be shared between developers?

text: I commonly see stories that have back-end and front-end development. For example, consider a large dialog with a few tables and some dynamic controls. We'll make several stories (maybe one for each table and another for the dynamic control system). The dev team will then split with one person on the back-end and another on the front-end. This makes it easy for the back-end person to just worry about the structure of the SQL layer while the front-end person focuses on stuff like layout. After the initial interface between back- and front-end is agreed, the two developers can focus their attention to get their part done by the end of the sprint. Then comes the chaos. Who "owns" which story? What does "in progress" mean or "done"? Should we make two separate stories for back-end and front-end? If so, doesn't that break the idea of user stories based on feature? Our system has a notion of "sub-tasks", which eases some of these problems. But sub-tasks add an extra complexity. Is there a better way? Is this a "bad" way to use Scrum? I have been using some form of Agile over the past few years at a couple places. I have no official training yet, so please forgive any wrong terminology or ideology. I'm just trying to learn practical ways to improve our process.


title: Use global variables or methods in an API's frontend

text: I am currently designing a graphics library in Java and now it's come to making the frontend I am curious why I have never seen libraries using global variables for their settings/properties - in-fact some go out of their way to protect them such as JavaScript libraries, and of course choose to use getters and setters such as:               Viewport.VSyncEnabled(true)      instead of simply               Viewport.VSyncEnabled = true;      I assume that it is to let the library know what is happening, but there are so many variables that simply don't need monitoring such as output debug data.   I would really like to use global variables however if it very against the convention and there are benefits (that I don't know of right now) then I'll be happy to use methods. My reason for wanting to use global variables instead is by my benchmarks it is faster to access directly like that.


title: Class design with bi-directional relationships

text: This is a purely design question. I want to port a nice educational "game" Bug Brain to Java. In this game you design neural networks which consist of three elements: neurons, nodes and synapses. Neuron is used to perform some kind of processing on its input signals to produce the desired output; it can be connected with other neurons/nodes (connections are uni-directional and weighted). We can think about nodes can as of junctions - they can also be connected with other neurons/nodes (and these connections are also uni-directional and weighted), but the weight of we cannot change weights of input connections. Synapse is a connection between these two elements. To sum up: neurons and nodes have both inputs and outputs (to other neurons/nodes) and they do some inputs->outputs processing. Q: Now, how would you design this class structure? This is a sketch I "produced" so far: screenshot of the design Because the operation "connect two joins (i.e. neuron/node)" has three responsibilities (add synapse, add output to join A, add input to join B) I've decided to put it as a static methid in a controller class. Of course I could avoid such two-directional relationships between elements: I don't have to keep track of outputs, only inputs but there are some other limitations eg. there can be only 8 I/Os per join so then I'd have to iterate over all synapses every time I add a connection to see if there is still some place to add it. In this case (this game) you won't have too many connections so it would not hit performance, but I'd like to know how to deal with such situations in general. As it's the foundation of this whole logic of this project I'd like to have it properly made. All suggestions are warmly welcome ;)


title: What is the concept behind writing a cancel operation in c++?

text: I'm attempting to write a cancel operation for a software download application. This application will first transfer the software to the device and then install the software on it. (These are givens I'm not allowed to change). What should the cancel operation do? When a user presses 'cancel', the application should stop transferring/installing the software immediately. Question: Since I've never written a "cancel" function, I'm wondering what are the types of things to consider when writing the code, and what are the common bugs I should expect and how to deal with them? Couldn't find anything in google so if you have some links that would be good reads I'd really appreciate it since I'm not looking for answers I'm just looking for guidelines/macro/concept help


title: Why do C# and Java use reference equality as the default for '=='?

text: I've been pondering for a while why Java and C# (and I'm sure other languages) default to reference equality for `==`. In the programming I do (which certainly is only a small subset of programming problems), I almost always want logical equality when comparing objects instead of reference equality. I was trying to think of why both of these languages went this route instead of inverting it and having `==` be logical equality and using `.ReferenceEquals()` for reference equality. Obviously using reference equality is very simple to implement and it gives very consistent behavior, but it doesn't seem like it fits well with most of the programming practices I see today. I don't wish to seem ignorant of the issues with trying to implement a logical comparison, and that it has to be implemented in every class. I also realize that these languages were designed a long time ago, but the general question stands. Is there some major benefit of defaulting to this that I am simply missing, or does it seem reasonable that the default behavior should be logical equality, and defaulting back to reference equality it a logical equality doesn't exist for the class?


title: JavaScript objects and Crockford's The Good Parts

text: I've been thinking quite a bit about how to do OOP in JS, especially when it comes to encapsulation and inheritance, recently. According to Crockford, classical is harmful because of new(), and both prototypal and classical are limited because their use of constructor.prototype means you can't use closures for encapsulation. Recently, I've considered the following couple of points about encapsulation:   1. Encapsulation kills performance. It makes you add functions to EACH member object rather than to the prototype, because each object's methods have different closures (each object has different private members).   2. Encapsulation forces the ugly "var that = this" workaround, to get private helper functions to have access to the instance they're attached to. Either that or make sure you call them with privateFunction.apply(this) everytime. Are there workarounds for either of two issues I mentioned? if not, do you still consider encapsulation to be worth it? Sidenote: The functional pattern Crockford describes doesn't even let you add public methods that only touch public members, since it completely forgoes the use of new() and constructor.prototype. Wouldn't a hybrid approach where you use classical inheritance and new(), but also call Super.apply(this, arguments) to initialize private members and privileged methods, be superior?


title: Need advice: Staying techie or going the MBA way?

text: I know this is a very subjective question and I am the best person to decide this for myself...but I am just looking for your views. I have 5 years of experience as a professional developer. I have a decent background in Maths and have done my bachelors in engineering in CS. I have still not reached a stage in my career where growth is difficult and do not foresee this happenning for a very long time if ever because I find myself constantly (self) motivated to pick up new skills. A lot of my friends have however been getting through their MBA lately ...and not from the likes of Harvard or Kellogs, just mediocre colleges. They've however been landing paychecks fatter than me even though they have little or no work experience. Given that I have the option of pursuing an MBA an have my finances in order (and am planning an MBA from INSEAD / IE) would it make sense for me to sell out what I like doing and go for an MBA? Will I regret not doing an MBA later, given that I am in the right age/experience group to do an MBA? I absolutely love what I am doing right now and also the people I'm doing it with, but am just worried if this career would be as rewarding financially as the one after a management degree.


title: How to avoid big and clumsy UITableViewController on iOS?

text: I have a problem when implementing the MVC-pattern on iOS. I have searched the Internet but seems not to find any nice solution to this problem. Many `UITableViewController` implementations seems to be rather big. Most examples I have seen lets the `UITableViewController` implement `<UITableViewDelegate>` and `<UITableViewDataSource>`. These implementations are a big reason why `UITableViewController`is getting big. One solution would be to create separate classes that implements `<UITableViewDelegate>` and `<UITableViewDataSource>`. Of course these classes would have to have a reference to the `UITableViewController`. Are there any drawbacks using this solution? In general I think you should delegate the functionality to other "Helper" classes or similar, using the delegate pattern. Are there any well established ways of solving this problem? I do not want the model to contain too much functionality, nor the view. I believe that the logic should really be in the controller class, since this is one of the cornerstones of the MVC-pattern. But the big question is: **How should you divide the controller of a MVC-implementation into smaller manageable pieces? (Applies to MVC in iOS in this case)** There might be a general pattern for solving this, although I am specifically looking for a solution for iOS. Please give an example of a good pattern for solving this issue. Please provide an argument why your solution is awesome.


title: How to structure classes in the filesystem?

text: I have a few (view) classes. Table, Tree, PagingColumn, SelectionColumn, SparkLineColumn, TimeColumn. currently they're flat under `app/view` like this:               app/view/Table     app/view/Tree     app/view/PagingColumn     ...      I thought about restructuring it, because the Trees and Tables use the columns, but there are some columns, which only work in a tree, some who work in trees and tables and in the future there are probably some who only work in tables, I don't know. My first idea was like this:               app/view/Table     app/view/Tree          app/view/column/PagingColumn     app/view/column/SelectionColumn     app/view/column/SparkLineColumn     app/view/column/TimeColumn      But since the SelectionColumn is explicitly for trees, I have the fear that future developers could get the idea of missuse them. But how to restructure it probably? Like this:               app/view/table/panel/Table          app/view/tree/panel/Tree     app/view/tree/column/PagingColumn     app/view/tree/column/SelectionColumn          app/view/column/SparkLineColumn     app/view/column/TimeColumn      Or like this:               app/view/Table     app/view/Tree          app/view/column/SparkLineColumn     app/view/column/TimeColumn          app/view/column/tree/PagingColumn     app/view/column/tree/SelectionColumn


title: Classes in OOP , methods and attributes memory internals

text: I would assume that instances of the same class would actually share their methods, and just have save different attributes in their namespace. How often do you arbitrary add methods to a single instance? Yet for example in Python that's not the case. Instances' methods are all different objects. Even if you decorate them as `@classmethods`, (or use `__slots__`) they seem to be different objects in memory. Can someone give me a definition of what I'm describing here, or even given same details on why this model was chosen? What happens in other languages?