Do Design Patterns Stifle Creativity

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?


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

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?


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

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.


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

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?


Object oriented wrapper around a dll

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?


OOP what is meant by object-to-object communication

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 ?


Portlets (and portals) vs usual webapps

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.


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

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 ;)


Moving Forward with Code Iteration

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?


Helpful articles on the subject of managing programmers?

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?


Considering career change to patent agent/patent engineer

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?


Communicating with Management

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.


Creating a library in two languages simultaneously

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.


skills that can't be outsourced- web development related

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.


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

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.


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

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?


What should I include in XML documentation comments?

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?


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

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?


Where can I learn more about JavaScript and Python?

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?


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

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!


Is this considered an implementation of a Layer Supertype pattern?

**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


Which component is responsible for updating the database schema?

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.


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

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?


Am I barking up the wrong tree with Scala?

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?


What's are best Windows 7 gadgets for programmers?

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.


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

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?


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

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?


Combining template method with strategy

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?


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

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


Pure C++ for iOS apps

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.


Namespaces and naming

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.


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

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


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

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.


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

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.


How do memory-clean apps work?

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.


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

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?**


Objective Metrics for Software Quality

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?


Do all programs run in a loop?

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?


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

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?


Is there a name for this technique in testing?

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.


Static or non-static?

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();


Why have private static methods?

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.


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

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.


Location services on Mobile platforms

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 ^_^


What design is best for data transformation?

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)


How to handle a Restful Call in a RESTless state?

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?


Is the abundance of frameworks dumbing down programmers?

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.


Learning how to integrate JavaScript with other languages

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.


what kind of online technical documentation system would you recommend?

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.


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

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=


How to avoid Memory Error

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`


content fingerprint algorithm

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.


Mixed licenses inside product

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.


Data Access Layer for application

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?


How to combine Google Analytics with Relational Database

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!


Automating tests in a browser not supported by selenium

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.


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

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?


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

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?


Making a basic computer that adds number passed by the user

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.


How to identify and run the most relevant automated tests?

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.)


What is the most orthogonal programming language?

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.


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

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.


Best practice for marking a bug as resolved in Bugzilla ?

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 !


Is FPA incompatible with Agile?

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"?


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

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.


Effective Java for experienced Java programmers?

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?


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

> **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.


what is best book to learn optimized programming in java

> **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.


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

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


Resources on concepts/theory behind GUI development?

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.


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

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     }          }


What revision control has the best merging engine?

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...


Should a user story be shared between developers?

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.


Use global variables or methods in an API's frontend

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.


Class design with bi-directional relationships

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 ;)


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

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


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

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?


JavaScript objects and Crockford's The Good Parts

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?


Need advice: Staying techie or going the MBA way?

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.


How to avoid big and clumsy UITableViewController on iOS?

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.


How to structure classes in the filesystem?

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


Classes in OOP , methods and attributes memory internals

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?


Term For Errors That Occur In Certain Environments

What is the term for an error or bug that exhibits itself on computers with certain environments/setups only? **Context:** We have produced our own anti-piracy software. We distribute applications that are locked using this anti-piracy software. The anti-piracy software is simply a windowless Windows OS executable. When it runs; it downloads an encrypted file (Client File) from our server, decrypts it, checks that the users serial number occurs in the Client File and writes the result (hashed) to a Result File. Each of our companies products 'consults'/accesses this executable to verify that the user is allowed to run and use our product. On some of our clients computers, our anti-piracy executable is being blocked from running or blocked from downloading the Client File (its unknown what the cause is yet). These clients are Civil Engineering firms that have their Windows OS's very controlled and 'sandboxed' for security reasons. _So to sum up, the anti-piracy software works and passes our tests on most of our clients computers and on all our in-house test nodes. The software fails on these few Civil Engineering clients computers._ **What would be the term (if any) for this kind of error or bug in software?**


Why do relational databases only accept SQL queries?

As far as I know, most relational databases do not offer any driver-level API for queries, except a `query` function which takes an SQL string as an argument. I'm thinking how easier it would be if one could do:               var result = mysql.select('article', {id: 3})      For joined tables, it would be slightly more complex, but still possible. For example:               var tables = mysql.join({tables: ['article', 'category'], on: 'categoryID'});     mysql.select(tables, {'article.id': 3}, ['article.title', 'article.body', 'category.categoryID'])      Cleaner code, no string parsing overhead, no injection problems, easier reuse of query elements... I can see a lot of advantages. Is there a specific reason why it was chosen to only provide access to queries through SQL?


I never did generic programming before, being more of a python guy, and generally using OOP. As I moved into generic programming, I faced some issues. I read the FAQ, but I am not satisfied. What I want to ask are the following questions (I am mostly interested in the first, but answering the others will be extremely welcome): Are generic programming and OOP mutually exclusive? Meaning, for example, are you supposed to have methods and functions accepting the template, instead of baseclass or abstract pure class? * * * Some other questions I've got, only to provide context to my lack of understanding are: How do traditional design patterns react to generic programming approach and concepts? How to prevent (or control) the genericity of each class/template to "bubble up" in the dependencies dictated by the program logic, in particular when two types are related and go always together (e.g. a RealNumberProducer class and double vs ComplexNumberProducer and std::complex)?


How is determined an impact of a requirement change on the existing code?

How companies working on large projects evaluate an impact of a single modification on an existing code? * * * Since my question is probably not very clear, here's an example: Let's take a sample business application which deals with tasks. In the database, each task has a state, 0 being "Pending", ... 5 - "Finished". A new requirement adds a new state, between 2nd and 3rd one. It means that:   * A constraint on the values 1 - 5 in the database must be changed,   * Business layer and code contracts must be changed to add a new state,   * Data access layer must be changed to take in account that, for example the state `StateReady` is now 6 instead of 5, etc.   * The application must implement a new state visually, add new controls for it, new localized strings for tool-tips, etc. When an application is written recently by one developer, it's more or less easy to predict every change to do. On the other hand, when an application was written for years by many people, no single person can anticipate every change immediately, without any investigation. So since this situation (such changes in requirements) is very frequent, I imagine there are already some clever techniques and ways to predict the impact. Is there any? Do you know any books which deal about this subject? * * * Note: my question is not related to How do you deal with changing requirements? question. In fact, I'm not interested in evaluating the cost of a change, but rather the way to predict the parts of an application which will be concerned by the change. _What_ will be those changes and _how difficult_ they are really doesn't matter in my question.


What are the benefits of not including other header files in a header file?

Sometimes, a header file uses objects that are in declared in other header files. The user of this header file would have to include the dependency anyway and get the order correct too.


Overview of computer science, programming

Where I can find overview of computer science, programming etc.? I graduated in physics and want to begin programming or similar and I'm not even sure of what's out there or where to begin. What I'm looking for is some broad overview of existing technologies - just like you have a book "Physics of elementary particles" that explains general view of that area, but for computers/programming of course. Do you have some book to recommend?


Tips for working at home?

> **Possible Duplicate:**   >  I program from home. What can I do to be more productive? What about if your office is your home? I'm not talking about a self-employed devoloper. I'm talking about been hired and work from your home. Do you have some tips for been focus on work? Thanks


Nested classes vs namespaces

Is it good to use nested classes or should I use namespaces instead? In context: I have a templated codec loader and a codec have In objects and Out objects               template<class TypeOfData>     class Codec         {         private:             typename TypeOfData::In* reader;             typename TypeOfData::Out* writer;         };      On the other hand, I cannot use               using TypeOfData;      if i dont want to :: my way to a static method.


What specific task could be given to a Java web development candidate during an interview?

I'm looking for ideas for tasks that I can give to a Java programmer candidate to check his knowledge of Java; I'm specifically looking for a Java developer for web applications.


How to simulate and estimate long running application

We are building a large, modular application that is intended to run across multiple processors. I need to develop a method to estimate how long it will take to run all of the functions. I already have the function's execution time on a single processor. Now I need to find a way to account for the communication overhead. I also need to identify if there is a difference in execution time based upon particular functions being spread across a number of processors instead of remaining on the same processor. How should I simulate the overall application in order to identify the communication overhead and to provide an estimate for what the total execution time would be?


Is there a downside to using AggressiveInlining on simple properties?

I bet I could answer that myself if I knew more about tools to analyze how C#/JIT behaves but since I don't, please bear with me asking. I have simple code like this :                   private SqlMetaData[] meta;              [MethodImpl(MethodImplOptions.AggressiveInlining)]         private SqlMetaData[] Meta         {             get             {                 return this.meta;             }         }      As you can see I put AggressiveInlining because I feel like it should be inlined.   I think. There's no guarantee the JIT would inline it otherwise. Am I wrong? Could doing this kind of thing hurt the performance/stability/anything?


Web app that runs other applications?

I am trying to write a web application that interacts with a service that would run scripts at the system level. Something like a website that you can schedule a job, the service will run the job with the given inputs, write the outputs to a database, and inform the website of its status. A few questions: How is this typically done? Do I write to a "JOBS_QUEUED" table in my database and have the service check that? How can I pass a "% done" back to the web page? Is there a name for this type of thing? Not sure if it matters, but I am working with Ruby on Rails right now.