title: When to deprecate and when to delete in Java

text: As part of a refactoring effort or just ongoing development, a particular method or maybe an entire class may become obsolete in some sense. Java supports the `@Deprecated` annotation to indicate that there's probably a better way to handle the functionality in question. I imagine this is particularly useful in public API's where the effects of removing parts of an API might not be known. For a non-public API and a project that uses revision control systems (so deleting can be undone in some sense), when is it appropriate to deprecate rather than deleting the obsolete element(s)?


title: Separating words in a string

text: How do I separate words in a string? In the following I have a random sample of words in a string extracted from text file with over a million words. Here's the string: "intervene Pockets Jerusalemand tissues powerful days gadgets rate invention heated Stewartis find communal working lots internal They caused noise offer goand big jumps lose galaxies All Mall birth child world spin killed produced great center Dont pretend Africa solution times cursor good night professional problem refugees talk" As you can see, the third word is "Jerusalemand." My goal is to separate "Jerusalem" and "and", and do the same thing for any other words that are stuck together. Only thing that I could think of as of now is to compare every word in the string to a dictionary (SCOWL perhaps?), and if a segment of the word matches a word in the dictionary, I'll have to split the words to make them independent. As an example, for "Jerusalemand" I'll loop through every character until a match is found in the dictionary for "Jerusalem," then I can separate that from "and," in turn completing the separation. Shouldn't there be a better way to do this?


title: Virtualized Development Environments in Enterprise Networks

text: We are attempting to implement a development environment using virtualization for a small team of 4 developers within an enterprise organization. This would allow us to set up separate development, testing, and staging environments - as well as allowing access to new operating systems that are requirements for systems or tools we are evaluating. We re-purposed an existing workstation- class machine, threw in 24GB RAM and RAID-10, and were doing fine until we attempted to get the machine added to the domain. Now we are beginning the war that all enterprise developers since the beginning of time have had to fight - the fight for local control of a development and testing environment. The network and IT admins' have raised concerns ranging from "ESX Server is the enterprise standard" to "servers are not allowed on client VLANs" to "[fill-in-the-blank] is not a skill set currently possessed in the local or enterprise IT organization". We could justify production-class hardware and formal IT support if we had to, but it would take time and involve a whole lot of headache. Even then it might take months to formally get IT resources assigned by treating this as a production system - and even if we did, we would likely lose the local control we need. I imagine that many of you have had similar struggles over developer control of non-production environments - and virtualization in particular - so my questions are as follows:   1. What strategies and arguments have helped you win over the infrastructure (IT & Network) folks to allow these types of silos to exist within enterprises which have standard network and security policies in place that would generally (and understandably) preclude this type of non-(centrally)-managed infrastructure?   2. Have you found this to be a matter of technical justification - or more of a political struggle for control and ownership?   3. If you ended up with a IT-managed development environment, how much of a roadblock has it been for day-to-day development and testing?   4. Has anyone ended up moving their development environment to a disconnected VLAN or entirely separate network to avoid these network access struggles? Also, this is not a Hyper-V vs. ESX holy war (we would be fine with either - but Hyper-V was selected since it is "free" with MSDN for these purposes [yes, VMWare has free tools too - but the good management tools generally aren't], and would be easier to manage by the local developers in a "Microsoft Shop") - so arguments for or against either are outside the scope of this question. This is also less of a virtualization vs. physical hardware - I suppose the same question could be asked without the virtualization component to the equation. Also assume that the dev team has already made assurances to either manage patch management and antivirus, or integrate with the existing enterprise systems if they will support it. This scenario, with different questions, is also posted on SF to hopefully elicit the opposing viewpoint.


title: How do I start correctly in building database classes in c#?

text: I am new in C# programming and in OOP. I need to dive into web applications for my company, and I need to do it fast and correct. So even that I know ASP.NET MVC is the way to go, I want to start with some simple applications with ASP.NET Webforms and then advance to MVC logic. Also regarding my db classes: I plan to create common database classes in order to be able to use them either from WinForms or ASP.NET applications. I also know that the way to go is to learn about ORM and EF. BUT I also want to start from where I am feeling comfortable and that is the traditional ADO.NET way. So about my Data Access Layer classes:   * Should I return my results in datasets or arraylists/lists?   * Should my methods do their own connect/disconnect from the db, or have separate methods and let the application maintain the connection?


title: Implementing FUSE for deduplication

text: I am new to FUSE and using python-fuse for writing a file system for data deduplication. Let's say, I have a directory named "metadata" and in that directory, there is a file foo and a directory "data". Data contains a data chunks having unique names. These chunks are obtained from the process of data deduplication. foo contains a list of filenames present in data directory. I am taking a metadata directory and exposing it under the mountpoint drive. Till now, I have implemented a `readdir()` method such that If ls command is invoked on a drive, it would only display foo. Now I want to do a following thing. When foo file is read, it should display all the data(combined) from every file whose name is in foo. How do I implement a `read()` method? I have the following idea: Method has the signature `def read(self, path, length, offset, fh)`.               Open a file and read the list.          initialize empty buffer.          For everyItem in list append the content of file named everyItem to the buffer          return buffer      Am I going in right direction? As I want to write a read only fuse, is implementing only `read()` method sufficient?


title: Access JSON object in different Languages

text: I have a Java code which is writing some data in string format to Messaging queue. Now any one can subscribe to this queue and fetch this data. Here the client fetching this data can be written in any programming language. I was planning to expose this data in JSON format, but then as per my understanding I have to expose my Bean Object, as the Object is needed to parse this JSON string. And in this case I am limiting client to be Java only. I don't want to have any of such a limitations, so now I am looking to expose this data as XML. Any other way so that I can still use JSON here?


title: How to combine search words? AND or OR?

text: I have a basic search in my webpage. When I designed it, I chose to combine the search box inputs with OR. For example: A search for `foo bar` will be translated to `foo OR bar`, so every entry which includes foo or bar will be shown. I did this because I thought that a search should return as much as possible and leave it to the user to search with AND (a search for `foo and bar` will return only the entries that contain both). When the customer tested it, he tried a lot to search for 'foo bar' and wasn't able to find the right entry because the search returned to much. It seems confusing to him that a search for `foo bar` could return entries where one of the search inputs is included and not both. What is the best way to combine search words (when the user doesn't provide any combining info)? Should I use `foo AND bar` or `foo OR bar`?


title: Algorithm to arrange objects so that the total length of edges between them is minimized?

text: We are given a list of edges between a set of N vertices. There are atmost three edges joining a vertex. We have to arrange all the vertices on a straight line with the positions numbered from 1 to N so that the sum of the length of all the edges is minimized.   The length of an edge a,b is the difference between the positions of vertices 'a' and 'b' on the line. There are atmost 12 vertices. The algorithm should work within the time limit of 1 second. This is the actual problem. I have tried solving this problem by trying all the permutations and finding out the total cost of each edge. But this work only for 8 out of the 12 test- cases to the problem. Because in the worst case the total number of operations is proportional to 12! * 18. The size of N is very small so I think the solution might be similar to trying all the possibilities.   I don't need the complete solution to this problem because I want to try to come up with it myself but only a hint on how can I optimize my algorithm so that it works within the time limit. Thanks.


title: Can I deploy a Google App Engine application to my own server?

text: I am getting started in web application development and am considering using Google App Engine. It's great that I can deploy the web app to the Google servers, but is that my only option? Can I use an authentication system different than the Google services?


title: Employer admits that its developers are underpaid and undervalued. Time to part ways?

text: My employer recently posted an opening for a C# Developer with 3-5 years of experience. The requirements and expectations for the position were fair, up until the criteria for salary determination. It was stated clearly that compensation would depend ONLY on experience with C#, and that years of programming experience with other languages & frameworks would be considered irrelevant and not factored in. I brought up my concern with HR that good candidates would see this as a red flag and steer away. I attempted to explain that software development is about much more than specific languages, and that paying someone for their experience in a single language is a very shortsighted approach to hiring good developers (I'm telling this to the HR dept of a software company). The response: "We are tired of wasting time interviewing developers who expect 'big salaries' because they have lots of additional programming experience in languages other than what we require." The #1 issue here is that 'big salaries' = Market Rate. After some serious discussion, they essentially admitted that nobody at the company is paid near market rate for their skills, and there's nothing that can be done about it. The C-suite has the mentality that employees should only be paid for skills proven over years under their watch. Entry-level developers are picked up for less than $38K and may reach 50K after 3 years, which I'm assuming is around what they plan on offering candidates for the C# position. Another interesting discovery (not as relevant) - people 'promoted' to higher responsibilities do not get raises. The 'promotion' is considered an adjustment of the individuals' roles to better suit their 'strengths', which is what they're already being paid for. After hearing these hard truths straight from HR, I would assume that most people who are looking out for themselves would quickly begin searching for a new employer that has a better idea of what they're doing in the industry (this company fails in many other ways, but I don't want to write a book). Here is my dilemma however: This is the first official software development position I've held, for barely 1 year now. My previous position of 3 years was with a very small company where I performed many duties, among them software development (not in my official job description, but I tried very hard to make it so). I've identified local openings that I'm currently qualified for, most paying at least 50% more than I'm getting now. Question is, is it too soon for a jump? I am getting valuable experience in my current position, with no shortage of exciting projects. The work environment is very comfortable, and I'm told by many that I'm in the spotlight of the C-level guys for the stuff that I've been able to accomplish during my short time (for what that's worth). However, there is a clear opportunity cost to staying, knowing now with certainty that I will have to wait 3-5 years only to be capped at what I could potentially be earning elsewhere this year. I am also aware that 'job hopper' is a dangerous label to have, regardless of the reasons. UPDATE: I've just accepted an offer at another company, paying significantly more and with even cooler projects. Thanks to all for the insightful responses.


title: Is it customary to write Java domain objects / data transfer objects with public member variables on mobile platforms?

text: We performed a code review recently of mobile application Java code that was developed by an outside contractor and noticed that all of the domain objects / data transfer objects are written in this style:               public class Category {         public String name;         public int id;         public String description;         public int parentId;     }          public class EmergencyContact {         public long id;         public RelationshipType relationshipType;         public String medicalProviderType;         public Contact contact;         public String otherPhone;         public String notes;         public PersonName personName;     }      Of course, these members are then accessed directly everywhere else in the code. When we asked about this, the developers told us that this is a customary performance enhancement design pattern that is used on mobile platforms, because mobile devices are resource-limited environments. It doesn't seem to make sense; accessing private members via public getters/setters doesn't seem like it could add much overhead. And the added benefits of encapsulation seem to outweigh the benefits of this coding style. Is this generally true? Is this something that is normally done on mobile platforms for the reasons given above? All feedback welcome and appreciated -


title: Is ASP.NET MVC slow as compared to traditional approach?

text: I create three folders in the Project Explorer of any IDE that I use. I name them: App Layer, Business Layer and Data Layer. The App Layer holds all the UI stuff, the Business Layer holds all the classes dealing with business logic and the Data Layer holds the classes for DB connectivity and queries. I am new to MVC pattern and when I attempted it on VS2010 with ASP.NET, I found it far more complicated with all sorts of nested folders created. I was already separating the logic and the UI in my old style. What differed in the MVC is that you can use Routing to directly call methods via URL (Correct me if I am wrong), but in that case I assume the performance of the MVC application slows down. It is just an overhead to call a method via URL and than the method queries the DB. Isn't the performance of ASP.NET MVC a bit slow? Even though manageability is good but the learning curve is also very steep?


title: Should I strictly follow every single HTML and CSS Standard?

text: A few years ago I considered myself somewhat of a web developer, knowing the basic 3 languages (HTML, CSS, JS) and lots of PHP. Moving on from simple text to actual websites was a pain because of the so called "standards" out there, which at the time were ridiculously complicated for me. It pretty much boiled down to this (minus the IE related stuff): ![Web development in a pie chart](http://i.stack.imgur.com/aVD7a.gif) Standards are there to replace old ways of doing things in a simpler way. However when trying to actually implement some of the stuff (Entirely CSS based layout for example), it took me 10x longer to actually do it then if I did the simpler and still working solution. If it rendered the same, then why should I use the more complicated example that takes 10x longer and breaks once you change browsers? This sparked many long religious debates in ##php, ##css, and ##js in Freenode IRC and actually got me banned from ##css because I messed with their little world over there. My question: Should I follow every single standard and coding conventions even if they take me 10x longer but get me the same result as the simple one? * * * For the poll tag, those of you who have websites of any size (huge or small), do **you** follow all the standards?


title: How do I give a free copy of my iPhone app?

text: I'm just about done writing an iPhone application and submit it to the App Store for approval. I'm going to sell the app for a price, but I'd like to be able to give out a few free copies on occasion, kind of like a promotional offer. I know when you go to one particular coffee establishment, they have gift cards available to feature various artists. You type in a code and it immediately "purchases" and downloads the song for you. I'd like to be able to do something similar to this for my own app. Is this possible?


title: Dynamic programming algorithm for finding minimum spanning tree

text: I know cool greedy algorithm like brokuva, kruskal and prim's exists for finding minimum spanning tree but I am curious to know a dynamic programming algorithm for finding minimum spanning tree.I am not able to come up with such an algorithm. If someone already have it please let me know the explanation for your algorithm along with the code.Or can anyone argue the other way round why no such dynamic programming algorithm cannot exist.


title: How does accumulating large amounts of business logic on the model objects make building strong service contracts harder?

text: I heard a couple of times that putting business logic in database models is bad down the road. I just read this in blog of a Rackspace employee: _The Django ORM also tended to have us accumulate large amounts of business logic on the model objects, which made building strong service contracts even harder._ But it seems logical to me that if you have an `Invoice` model to encapsulate a lot of invoicing logic there. Seems very similar to what we've been taught in OOP. Could you show me how this is wrong? Please include a practical example if possible. **Benefit of "put logic in models"** What I see as a big benefit of putting logic in models is that users of the models don't have to worry about how they can use stuff, they just use it and it works, can't break anything. Let me elaborate with an example: So if you don't put logic in models, then you probably have this code elsewhere, let's say it's in `api`. If you want to change a state of an `Invoice`, what do you do? Do you do `invoice.state = new_state` or do you read the `api` code to see if there's some method there that changes the state? This is confusing and error prone. How do you fix this issue then?


title: How to organize a larger project with several sub-projects and their dependencies?

text: As a software developer until now, I've mostly worked on projects that were quite "monolithic" with hardly any dependencies on other projects, without building automation (no Make, Ant, Maven, etc.) and kept on a simple version control system (mostly Subversion) with just a few easily managed version branches. Now together with some friends I'm planning a project that is intended to run on multiple platforms (mostly mobile: Android, iOS, Kindle, Windows, etc.), thus written in several languages and on different development platforms. This will lead to many dependencies: All projects sharing the same resources (e.g. images) or projects dependent on each other (e.g. a core Java library project used by the Android and other Java based implementations). So what I need is some basic information on how to answer questions such as: How would the VCS be structured? Would a client-base or a decentralized VCS be better? How to decide building automation system(s) to use? Since this quite an open question I guess for now it would be great if you could point me to any books or web resources that you can recommend for this topic.


title: Requirment Analysis Communication

text: Someday s ago we was discussing about the current project, and suddenly sir and my senior started talking about the new feature to add in the project , and i become lost :). i was not able to find how i should provide my input for the new feature. So i want to know what things should be discussed for developing new feature in project and how we can contribute in requirement talk of new features. Please suggest.


title: Are there drawbacks to taking a job where I will be using a unique programming language?

text: I just graduated from college with a degree in CS, so I would like to find a job where I can learn more about the field and build up some professional experience. I've interviewed at a company that uses their own in-house programming language, and I don't think any others use it. They have not mentioned using any other languages or what they use for a development environment. What should I be concerned by taking a job like this? If I were to switch jobs later, would I have to start looking for entry level positions again because I haven't gained any language-specific experience?


title: Store history in SQL database column

text: We have a database that stores the process/history of particular machines. What I mean by that is that we have "started", "updating", "shutdown", and so on for all the computers in the company. The requirement is to have the history available in the right order. Simple enough. My approach was to have a simple database table like this:               counter  | machine | time | process | ...      1       | PC1     | ...  | started       2       | PC2     | ...  | updating      1       | PC1     | ...  | updating      The query will be very simple because I can simply sort by the counter. My colleagues suggested a very different approach. My gut feeling says it is wrong but I don't have enough arguments against it. Can you help define what is wrong with it? Instead of using multiple rows for the process of a machine, they want to write them sequentlly into the same field. Same goes for the time field. Their main arguement is that we save storage               counter  | machine | time        | process | ...      1       | PC1     | ... ... ... | started updating shutdown      2       | PC2     | ... ... ... | started updating


title: Use of # in answers/documentation when referring to methods of a class

text: When looking through Java documentation or answers for Stack Overflow / programming forum questions, I often see people referring to methods like `String#format`, `Object#clone` etc, rather than `String.format`. Is this something to do with it being a non-static method, or is this just some convention? This is quite hard to search for due to most search engines ignoring the '#' symbol so I apologise if this is a duplicate question.


title: How to organize points on a sphere in bins and navigate between bins?

text: I'm having trouble coming up with a suitable way to navigate through a set of star coordinates in the Equatorial Coordinate System. My goal is to display those which are within a given range of horizontal coordinates. The display is square with about 10 degrees "length" in each direction. I thought about binning the stars in clusters of sufficiently large (but small enough) equal right ascension and declination, so I can display one or more bins at a time on the display (one if the display is showing the center of a bin, four if the display is showing the point connecting adjacent bins). The binning is simple, but how can I navigate between bins in order to select the right ones for the display? This appears to be a problem around the poles, where many bins touch each other. The application is being written in C++ and will have to run on a microcontroller, so resources (memory and CPU time) are very limited. Coordinates can be read from an SD card and the format may be custom, so if the algorithm imposes any constraints on that, that's fine. * * * **Additional thoughts:**   * The tiles that divide the celestial sphere into bins also have constant (not necessarily equal) size and are generated together with the lookup structure.   * insertion time is not important. The structure used for finding the right bin does not change during runtime and can be loaded from the SD card to RAM at startup.   * The word I was missing was "tiles". Gamedev SX has a [tiles] tag and there are some questions and answers there; I'll have a look at those. * * * **And another one:** Digging through the Gamedev [tiles] tag didn't reveal a lot that I could use for spherical coordinates. It also looks like I'm not familiar enough with the underlying theory to come up with a suitable solution. Another idea I had was to add information about all adjacent bins to each bin, so that when the display's view is moved I can just scan through all neighbours to find the next one that the display is "centered" on. I think this is similar to a graph, but decentralized.


title: Mental schema for SQL queries

text: While preparing SQL introductory material, I've ended asking myself about the line of thought followed by a developer when writing a query. I believe it could be too valuable from a beginner's point of view. Let me illustrate the subject with an example. For the sake of brevity, I won't include the database schema, hoping for the query to be descriptive enough by itself. Suppose we want to write a query for retrieving all _new_ customers from the last quarter. Typical. Me, the first thing I think about is the set of entities involved, beginning with the ones corresponding to the requested data. So, as I want to get customers, first of all I write the following query skeleton:                   SELECT           FROM Customers AS NewCustomer          WHERE       There immediately follow the remaining **entities**. In this fictional context, a new customer is any customer having placed an order for the first time:                   SELECT           FROM Customers AS NewCustomer     INNER JOIN Orders AS RecentOrder      LEFT JOIN Orders AS OlderOrder          WHERE             AND OlderOrder.Id IS NULL      With all the entities identified, I proceed writing the **relations** between them:                   SELECT           FROM Customers AS NewCustomer     INNER JOIN Orders AS RecentOrder             ON RecentOrder.CustomerId = NewCustomer.Id      LEFT JOIN Orders AS OlderOrder             ON OlderOrder.CustomerId = RecentOrder.CustomerId            AND OlderOrder.PlacementDate < RecentOrder.PlacementDate          WHERE             AND OlderOrder.Id IS NULL      Once I'm finished with the entities, it's time for me to define whatever **restrictions** to be applied over the resulting data set:                   SELECT            FROM Customers AS NewCustomer     INNER JOIN Orders AS RecentOrder             ON RecentOrder.CustomerId = NewCustomer.Id      LEFT JOIN Orders AS OlderOrder             ON OlderOrder.CustomerId = RecentOrder.CustomerId            AND OlderOrder.PlacementDate < RecentOrder.PlacementDate          WHERE RecentOrder.PlacementDate BETWEEN @fromDate AND @toDate            AND OlderOrder.PlacementDate < @fromDate            AND OlderOrder.Id IS NULL      Finally, I ask myself which concrete data **fields** I want the query to return, thus completing the `SELECT` clause:                   SELECT NewCustomer.FirstName, NewCustomer.LastName           FROM Customers AS NewCustomer     INNER JOIN Orders AS RecentOrder             ON RecentOrder.CustomerId = NewCustomer.Id      LEFT JOIN Orders AS OlderOrder             ON OlderOrder.CustomerId = RecentOrder.CustomerId            AND OlderOrder.PlacementDate < RecentOrder.PlacementDate          WHERE RecentOrder.PlacementDate BETWEEN @fromDate AND @toDate            AND OlderOrder.PlacementDate < @fromDate            AND OlderOrder.Id IS NULL      Of course, this is a very simple query, without aggregates, nested queries and other advanced stuff. But this is my overall train of thought, whatever the query's complexity:   1. Entities   2. Relations   3. Restrictions   4. Fields My question is, is this a suitable schema to be taught explicitly to a beginner? How could it be improved, anyway, in order to smooth her learning curve?


title: How to approach client who started using my server to train staff?

text: I'm in the process of finishing and delivering a web development project. The contract specifically specified that client is responsible for adding all content and installing. The deliverables specified are the WordPress theme. I ended up using a lot of content from their existing site because I needed it to make sure everything worked as promised. I also included 30 minutes of training to show them how to use the custom dashboard I created. I did the training yesterday and gave the client an admin login so they could inspect my work. I offered to do a staff training session at an additional hourly rate ( original agreement was project priced) and also include the database to use as an example on how to add the content. The client declined and said they would handle the training. They mentioned they were going to do some training today and didn't even ask if they could use my server and installation. I just got 3 emails that new admin accounts were added and it looks like they started migrating some content. Should I tell them that it will be an extra charge for the database or bill them for using the server? This has been one of my largest projects and first time to encounter this situation. What's the professional thing to do without letting them take advantage of me and keep the relationship intact?


title: What are the most common options for data storage in desktop applications?

text: When I was working as a website designer/engineer I primarily used databases for storage of much of my dynamic data. It was very easy and convenient to use this method and seemed like a standard practice from my research on the matter. I'm now working on shifting away from websites and into desktop applications. **What are the best practices for data storage for desktop applications?** I ask because I have noticed that most programs I use on a personal level don't appear to use a database for data storage unless its embedded in the program. I'm not thinking of an application like a word processor where it makes sense to have data stored in individual files as defined by the user. Rather I'm thinking of something more along the lines of a calendar application which would need to store dates and event info and such where accessing that information would be much easier if stored in a database... at least as far as my experience would indicate.


title: Quitting a small start-up where you are a primary developer?

text: Just curious to hear from other people who may have been in similar situations. I work for a small startup (very small) where I am the main developer for a major part of the app they are building, the other dev they have does a different area of work than I do so couldn't take over my part. I've been with the company 5 months, or so, but I am looking at going to a more stable company soon because its just getting to be too much stress, overtime, pressure, etc for too little benefit and I miss working with other developers who can help out on a project. The guy is happy with my work and I think I've helped them get pretty far but I've realized I just don't like being this much "on the edge" as its hard to tell what the direction of the company is going to be since its so new. Also, even though I'm the main dev for the project, I would still only consider myself a mid-level dev and am selling myself as such for the new job search. Just to add more detail, I'm not a partner or anything in the company and this was never discussed, so I just work on a W2 (with no benefits of course). I work at home so that makes it easier to leave, I guess, but I don't want to just screw the guy over but also don't want to be tied in for too long. Obviously I would plan to give 2 weeks notice at least, but should I give more? How should I bring up the subject because I know its going to be a touchy thing to bring up. Any advice is appreciated UPDATE: Thanks everyone for posting on this, I have now just completed the process of accepting an offer with a larger company and quitting the startup. I have given 2 weeks notice and have offered to make myself available after that if needed, basically its a really small company at this point so it would only be 1 dev that I would have to deal with... anyways, it looks like it may work out well as far as me maintaining a good relationship with the founder for future work together, I made it out to be more of a personal / lifestyle issue than about their flaws / shortcomings which definitely seems to help in leaving on a good note


title: How do we pass data between two Amazon instances?

text: I'm trying to create a website where the user enters a few numbers, these numbers are fed into some equations, and the output of these equations is emailed to the user. I'm using Python 2.7 for everything. I'm using a cheap Amazon instance (m1.small, Ubuntu 12.04) to host the frontend, but I only want to launch a backend instance when needed (the computations are heavy and require a powerful - and expensive - instance). I can use boto to programmatically launch a backend instance, but after that how do I feed the user input into the backend? Everything is simple enough when I'm doing things manually, with SFTP and SSH, but what's the programmatic way to do it? Should I simply execute SFTP and SSH from my Python script (using, say, 'os.system')? Somehow that feels wrong; how do people actually do it? In case it matters, this is not for a commercial website. I'm in grad school and I want my committee members to be able to replicate and tweak my research, which is stats-heavy. Also, I have no security concerns - it's just academic research, I'm not storing any kind of personal info or anything.


title: Am I right to be skeptical of ASP.NET MVC "Html Helpers"?

text: ASP.NET WebForms seemed really great until that moment of realization the abstraction you'd welcomed was producing HTML that was worlds away from what you needed. Wrestling with that framework to generate HTML that matched a designers or used external libraries became a big nightmare for me and one I'd rather not have again. When approaching a simple Bootstrap form in ASP.NET MVC I copied over the basic HTML and then started the process of adding @Html.BeginForm(), @Html.EditorFor() until it hit me that I was going down the same path. Sure, you add an attribute here, define an alternate helper there, but how long until you are fighting the framework to get back to what you could have just pasted in from any Bootstrap example on the web? Is anyone else feeling that, or is it possible that the Helpers introduce enough "sugar" to make using them worth the effort?


title: Steve Yegge post about platform vs product

text: I am reading this and I came across: > The Golden Rule of Platforms, "Eat Your Own Dogfood", can be rephrased as > "Start with a Platform, and Then Use it for Everything." You can't just bolt > it on later. Certainly not easily at any rate -- ask anyone who worked on > platformizing MS Office. Or anyone who worked on platformizing Amazon. If > you delay it, it'll be ten times as much work as just doing it correctly up > front. You can't cheat. You can't have secret back doors for internal apps > to get special priority access, not for ANY reason. You need to solve the > hard problems up front. What does that exactly mean? Can someone please explain?


title: DOMDocument programming: a lot of little dilemmas, how to solve them?

text: I need elegance and performance: how to decide by the "best implementation" for each DOM algorithm that I face. This simple "DOMNodeList grouper" illustrate many little dilemmas:   * use `iterator_to_array` or "populate an array", when not all items need to be copied.    * use _clone_ operator, _cloneNode_ method or _import_ method?   * use `parentNode::method()` or `documentElement::method`? (see here)   * first `removeChild` or first `replaceChild`, no avoids "side effects"?    * ... My position, today, is only "do an arbitrary choice and follow it in all implementations" (like a "Convention over configuration" principle)... But, **there are another considerations? About performance, there are some article showing benchmarks?** * * * PS: this is a generic DOM question, any language (PHP, Javascript, Python, etc.) have the problem.


title: does one method overload an other, or are both methods "overloaded"

text: If i create this method               public void foo()      And then i create an overloaded version like this               public void foo( string bar )      Do we say that the second functions overloads the first, or are both methods equally "overloaded". This would imply ( i think ) , that there is a base type function, that is being overloaded, by another function. ( somewhat like inheritance, but not really ) Assuming that one method can "overload an other", would also imply terms like "overloader" and "overloadie", if that is a word at all. But that doesn't feel right at all, especially since you can have several overloads. I got to this question when i wanted to write down the process of creating an overloaded method and i wanted the most correct way of writing it down. Examples:   * I am overloading `foo`   * I am overloading `foo` with `foo( string bar )`   * I am creating an overloaded method    * I am making foo overloaded So yeah, this kind of got my thinking, i am not sure what to make of it. There are hundreds, if not thousand, descriptions of function overloading online, but at a first glance i couldn't find any addressing this.


title: Will perfecting my assignments help get me a job?

text: I am currently a student with the intention of pursuing a career as a programmer. All of my assignments are functional and complete to the letter but I feel as though there is plenty more work that could be done on these applications beyond the scope of the assessment. Will putting in the extra hours into these assignments help me land a job? Also, I was thinking of showcasing my programming skills with a video demonstration of my work. Do you think potential employers would respond well to this kind of visual resume?


title: XP, TDD or DDD - Which one should I learn first?

text: I want to learn XP, TDD and DDD to improve myself. My problem is I have general ideas of what they are but I don't know which one should I learn first, do I need to learn something before other? Please suggest me which topic should I learn first, second and third.


title: How to implement instant communication between iPad and iPhone through the net?

text: What is the best way to implement this: 1.iphone/webBrowser user selects some products (a,b,c) to buy 2.the chosen products most appear on the iPad located in the Store. using a UITableView perhaps. 3.The store staff then decide if the products are available in 10, 20 or 30 minutes for pick up. 4.When the store staff chose the time(10,20,30 minutes) it must appear/communicate back to the users web browser or iPhone. 5.buyer comes to the store to pick up the products he buyed! Im not really good in this kind of communication stuff! I need help! what is the best way to implement this? are there external api/plugin I could use? I already have an ftp server. I can do all the graphics and User interactions. the only problem for is the communication between the devices? Thanks for help.


title: What is Developer Anarchy?

text: I've been reading about Developer (or Programmer) Anarchy, which seems to be billed as a post-Agile development methodology. I found a few resources on it (1, 2) but it doesn't seem to be a lot out there. I was wondering if anyone had any good resources where I could find out more about it _ how to implement it, pros and cons, comparison with other methodologies etc.


title: In transitioning to C# from Java, how can I ensure that I am not only proficient, but competent?

text: My biggest fear with getting back into C# (I have rudimentary .NET skills) is that although I may find the solution to a problem, it will not be the optimal solution. What is the best way to ensure that I am not just getting the job done, but that I become a competent C# programmer?


title: How do you manage project estimation and managing your teams time

text: I'm thinking of things like:   * designating a developer having say 6 hours out of their normal 7.5 hour day dedicated to the project, the rest for other work/company related activity (meetings, emails, calls etc), maybe a senior dev is less.   * building in 20% contingency time to estimates. What are the best ways to produce tight estimates and at the same time shield developers from management. Addendum: I've been asked to help my current client with these types of issues. They are a really poor dev team with the business calling all the shots, scope creep, overlapping environments, priority changing at a whim etc. I want to help them get better.


title: Materialized View vs POJO View based on Objects representing Oracle tables

text: I have about 12 Oracle tables that represent data that's being integrated from an external system into my web application. This data is going to be used in an informational and comparative manner for the clients using my web application. On one particular page of my web application, I need to combine data from 3 - 5 Oracle tables for display as an HTML table on the page. We are NOT currently using a framework (Apache Struts for instance) and we're not in a position to move this Java web application into one at this moment (I'm trying to get us there...). I am certainly not an architect, but I see one of two ways that I can effectively build this page (I know there are other ways, but these seem like they would be good ones...): 1\. Create an Oracle Materialized View that represents what the HTML table should look like and then create a POJO based on the View that I can then integrate into my JSP. 2\. Create POJOs that represent the Oracle tables themselves and then create another POJO that is the View used for the HTML table and then integrate that POJO into my JSP. To me, it seems the Materialized View would possibly offer quicker results which is always what we strive for in web applications. But, if I just create 12 POJOs that represent the Oracle tables and then build POJO Views off of those, I have the advantage of keeping all the code in one place for this and possibility for creating any number of different views and reusable components in my web application. Any thoughts on which one might be the better route? Or, maybe you know of an even better one?


title: For what common problems is functional programming not a good fit?

text: Functional programming is a declarative paradigm. One of the strenghts with FP is that side-effects are avoided. It's said that for some problems FP isn't a good fit. For what common problems isn't functional programming a good fit?


title: what is a good stack for software as a service (SAAS) application?

text: We will be engaging large corporations to help them run various types of analysis, mostly code analysis of their applications. The storage requirements will likely be modest, hundreds of MB per client. My question is mostly aimed at finding the stack with existing frameworks, best practices and a community which will allow a rapid development process. I am comfortable with the .Net environment and am leaning towards Azure. Any thoughts?


title: What is the "architecture" that provides functionality to application-level URI interfaces, like chrome:// and Firefox's about:config, etc?

text: According to Wikipedia, > `about` is an internal URI scheme (also known as a "URL scheme" or, > erroneously, "protocol") in various web browsers to display certain built-in > functions. It is not an officially registered scheme, and has no standard > syntax. my question is... what "powers" these "interfaces"? there doesn't seem to be any kind of "application server" running - that would conventionally support such a front-end - were it to be running remotely.. i'm sure the reason for the dearth of information out there - is that these all break the _psuedo- promise_ that anything "you do" in the browser - won't "effect" your system. these interfaces _clearly_ have access to system level resources and permissions, etc.. are they all simply custom, c-coded hooks to the internal code of the parent applications - or are they a more abstract, _ui--layer_? i admit to little knowledge of plug-in authoring, but can this type of functionality be achieved via the typical plug-in API's, or are they too limited? i have spent some time in the webkit source code poking around - but it is so massive and convoluted that its hard to deduct much... it would seem that however these vendors are implementing these features might be an appealing alternative to say, the various language-specific bridges that webkit implements on various platforms. i personally find the bridges frustrating, which is probably what led me down this train of thought... any insights appreciated.


title: Unforeseen Spike in a Sprint... what to do?

text: I did a look around and couldn't find a question that addresses my case, so I figured I would post. I have a situation where as a new team, we ran into 2 unforseen spikes (is there a better term?) during a sprint. We 'thought' we knew, but then we had to research mid way, so this introduced a spike. My questions are:   * If we have an outage/process issue (Jenkins craps out, requires 8 hours of debugging / setup by a dev or more), is this a spike or somethine else? Do I create a spike, throw it into Sprint (mid sprint), do I then subtract hours from overall sprint (8hr spike = minus 8hrs of planned tasks?) or just end up with undelivered items for next sprint?   * If I had an estimate of 8 hours for something, then the devs find, in fact they need to research more, do I have a spike there too? remove task times? etc; I want to make sure I have a better hand at planning out these 'unforeseen' events, and have a good idea of deliverables for the sprint. I'm looking at this from a purely Project Management perspective where I need to report up the chain on progress / burndown of tasks / deliverables.


title: What kind of object relational mapping is appropriate here?

text: In my database I have a table that looks like this Master(ID, Name, Attr1...). Every ID will have at least 1 entry in additional tables that have additional attributes. Those tables specialize the master table. Spec1(MasterID, Attr2,...) Spec2(MasterID, Attr3,...) ... So, not sure how to map this to object oriented design. If every ID could have just one specialization then it would be easy, master would be abstract class and specializations would be concrete inherited classes but in this scenario, single ID can have all specializations and they could be added or removed during his lifetime in the database. Each specialization has unique business rules ofc.


title: How should non-functional changes be committed?

text: I'm working a small-to-medium legacy codebase and when working on a ticket I will come across code that should be cleaned-up or that I _need_ to clean-up just to be able to understand the follow of the application. A real example is:               if( !a && b ){          doSomething1();          doSomething2();          doSomething3();          doSomething4();          doSomething5();     }else if( a ){          doSomething1();          doSomething2();          doSomething3();          doSomething4();          doSomething5();     }else if( !b && ( a || c )  ){          doSomething1();          doSomething2();          doSomething3();          doSomething4();          doSomething5();     }      Another is fixing typos and Engrish in comments and documentation across a dozen source files. However, often this clean-up ends up not related to the main issue and I wonder how is it best to commit the clean-up. The way I see it, there are three options:   1. Before the fix: this works chronologically since this is the order in which they occur but if they break something they complicate the fix and it makes it harder to diff the fix with what was in production. It also introduces an additional commit which is noise.   2. With the fix: but that obscures the actual replacement of defective code with files where `findGeoragphy` was correct to `findGeography`.   3. After the fix: this requires removing and clean-up you made that helped you understand the code and then retesting the fix, committing the fix, and then going back and redoing the clean-up. This allows the cleanest diff to the defective code, but duplicates effort and can lead to spurious commits as well. **tl;dr:** So, what is the best method of committing clean-up code? **Context:** We have no unit-tests and development proceeds by running changes and eye-balling them and throwing them over the wall to QA to validate through manual regression fixes. Also, if we don't do some form clean-ups the code becomes unintelligible. I know this is far from ideal, but this is real enterprise dev that puts food on my table and not my choice.


title: Should I fork a fork (on Github)?

text: On Github, I've run across a pull request which it implements a feature I like but feel isn't quite intuitive and could be better. The maintainers of the original repo have so far declined to accept it (or explain why). It was requested 3 months ago so I suspect they won't take it without changes. I'd like to improve upon this contributor's code but don't know the etiquette: should I fork this fork? Or do I fork the main repo and add the other fork as another upstream source? If the latter, how do ensure credit is given where due? What implications does either option have for pull requests? EDIT: While I appreciate hearing opinions and did ask about etiquette, I'm more interested in knowing about whether there is any technical or pragmatic reason to fork off the main project and add the creator of the 'cool feature' PR as an upstream versus just forking the branch of the 'cool feature' PR. Based on jan-hudec's answer I'm inclined to fork main + add new upstream. I suspect it'd be easier to keep my fork up-to-date and not reliant on this other contributor to incorporate upstream changes.


title: Initializing char array with string

text: I don't remember how I got to the thread, but I was reading its replies and one of them states that you should never initialize a `char[]` with a string literal. My question: Is initializing a character array with a string literal a bad practice or is that just the author's opinion? * * * Here is the original question: > **strlen vs sizeof** > > Code:               #include <stdio.h>     #include<string.h>     main()     {         char string[] = "october";         strcpy(string, "september");              printf("the size of %s is %d and the length is %d\n\n", string, sizeof(string), strlen(string));         return 0;     }      > right. the size should be the length plus 1 yes? > > this is the output > > `the size of september is 8 and the length is 9` > > size should be 10 surely. its like its calculating the sizeof string before > it is changed by strcpy but the length after. > > Is there something wrong with my syntax or what?


title: How to preserve order of incoming requests on a multithreaded server

text: I want to write a multithreaded server application which is able to process requests in a multithreaded fashion while keeping up execution order of incoming requests of the same client. For example if client A sends a message M1 and then a message M2 the muiltithreaded server must process these requests in exactly the same order, first M1 and then M2. However, there is no guarantee that threads that process these incoming requests do process these messages in the same order. For example, thread T1 consumes message M1, thread T2 consumes message M2 and completes processing the message and is able to accept further messages before T1 has finished it's job. After a message has been processed the result will be passed to some other process for further processing (of which only one exists in the whole computation), this process will schedule sending a response to the client. These mutliple threads do only exist for the purpose of preprocessing data for some other process. This particular problem sounds like a problem with pipeline characteristics, first M1, then M2, then M3, etc. However, I wanted to parallalize as much as possible to achieve a higher number of communication cycles between the server and the clients. What architecture / pattern / technique is well suited for such a task?


title: Diving into C++ GUI Programming for the first time

text: I am about to start learning C++. I currently am a PHP programmer, I also know how to write Java code and create Java GUI applications. I have browsed http://www.cplusplus.com/doc/tutorial/ and to me it looks fairly similar to what I already know, just a few language syntax differences here and there. I want to create a C++ GUI application, and from what I researched, it sounds like using `Qt` and `Qt Creator` is a good place to start. So, is using `Qt` and `Qt Creator` a good/decent way to start to learn C++ GUI programming or should I do it some other way?


title: Should technical debt be scheduled as a feature or a chore (or a bug)?

text: I've added a couple of user stories that address some technical debt to my Pivotal Tracker board. Should I consider them as features (keeping my velocity level) or as chores/bugs (lowering my velocity)? I understand it won't make any difference in the long run if I did one or the other consistently, but every time I add a technical debt story I have to make the decision. Some thoughts:   * They aren't actually bugs, they don't break anything   * The users haven't requested anything as it is low-level implementation that doesn't affect them, but it will make long term development easier   * If you define features as stories that add value to the users, well a) they don't as the users won't see any direct benefit, but then b) they do because they make future development/maintenance possible which _does_ add value, just not right now I'm not deciding whether or not to actually do the work, or when to schedule it, I just what to know what I should call technical debt in my project management tool, and why.


title: Where can I find design exercises to work on?

text: I feel it's important to continue practicing my problem-solving skills. Writing my own mini-projects is one way, but another is to try and solve problems posted online. It's easy to find interesting programming quizzes online that require applying clever algorithms to solve - Project Euler is one well-known example. However, in a lot of real-life projects the _design_ of the software - especially in the initial phases - has a large impact and at later stages it cannot be tweaked as easily as plain algorithms. In order to improve these skills, I'm looking for any collection of design problems. When I say "design", I mean the abstract design of a software solution - for example what modules will there be and what are the dependencies between them, how data will flow in the program, what sort of data needs to be saved in the database, etc. Design problems are those problems that are critical to solve in the early stages of any project, but their solution is a whiteboard diagram without a single line of code. Of course these sort of problems do not have a single correct solution, but I'll be especially happy with any place that also displays pros and cons of the typical solutions that might be used to approach the problem.


title: Alternatives to Traditional Password Authentication

text: The third party login is excellent function that has come in recent years that relieves the load on a programmers mind so that I have to remember less useless passwords. I don't use the same password for many sites, I use an algorithm: for instance if I make a password for StackOverflow its name starts with S so I'll put in an S and then with my secret sentence so the password for SO will be something like `i81b4uS`, e.g. my secret phrase plus some token that makes the password not the same for every since since I don't want the disaster if some site saves my password in plaintext and gets hacked (then somebody would have access to all my online material if I used the same password). Biological metrics are good but this technology is not here. In the future we will probably only have to unlock at one point all our online material, instead of providing the system so many locks. Google's 2-step verification is flexible and goo but it's not perfect. Are there other, perhaps newer, or less known, authentication methods for instance that simplifies the common use-cases of renewing a password (where it is often tedious to check your mail where you often get interrupted, and providing the old password to change it to a new etc) and reset password, which is a lot like renew a password? I'm not asking for the detail of which algorithm, but rather if there are newer and more effective flows, like third party login which made me start an account at SO where I landed with me Google account, that puts less of a burden on the user's mind and manual memory and that are also safe? At my site I offer authentication much like SO and SE, where you can login at my site just like SO with Google, FB, Linkedin, Yahoo or custom accounts. I've used webapp2's user model to facilitate my logins and the simpleauth library for GAE (python). What would especially be good would be getting rid of email altogether and not bugging users about their email address at all. Some users are hesitant to leave their email, and email is often too much of a direct contact. So many users have smart-phones and androids so that there could be one app for many sites that does the authentication via smart-phone or a desktop app or a large third-party like Google, FB or Yahoo where I can offer Google, FB, Yahoo, LinkedIn so that a user can have a choice not to make up a new password, since that can be painful if you already have memorized 40 passwords for different sites and services.


title: How to add document directory path in javascript file in iOS -MetaIO SDK

text: I am working on a project using **MetaIO SDK (AREL)**. It works fine with all the files in the package (ipa), but I'm trying to download an animation automatically using a web service. It will be stored in the document directory. > Since AREL uses a javascript file, I need to give the javascript file the > address for the document directory, but I don't have any access to the iOS > (because Metaio does not give me direct access to the webview as there isn't > any other http request so cant use delegate). All i need is > window.MyImagePath = "/Users/mac/Library/Application Support/iPhone > Simulator/6.0/Applications/E02C5AE0-DFF0-4803-8C7F-134023077BD0/Documents/placeholder.png" In my JS file which is not in the document directory. I tried sending this information through the clipboard (safari allows clip board access only when paste event occurs) and through a web service which is not helpful either. Can any suggest a better solution please?


title: Subranges in Pascal

text: I'm reading some Pascal code and everything is pretty straightforward except subranges. In the program I'm reading there's a variable `d` with the following type declaration:`array[0..22] of 0..15`; there's then the following procedure:               var a:integer;     begin       a:=0;       while k>0 do         begin           k:=k-1;           a:=(a+dig[k]*two) div 10;         end;       round_decimals:=(a+1) div 2;     end;      Where `k` is a variable of type `0..63`. So since `k` can be above the range of the index of `dig` how does this code work? — It's a routine for doing fixed point arithmetic and so I would assume the array indicie overflows in some controlled manner, but if anybody could explain the exact behavior I'd be really happy. Also, do Pascal arrays assign in some known manner? There were a lot of versions of Pascal and I think this program is written in a pretty “Pascal-version agnostic” manner, but I can't find much explanation on the subtle semantics of subrange expressions.


title: What is a constructor? And what are set/get methods in Java?

text: I am having difficulty understanding constructors and set/get methods. What are they being used for? If someone can explain a little more hopefully I can get the AHA moment.


title: How to measure the right time to bring a new client?

text: My growing company has a team of developers working on a number of separate projects. Our developers depend on us to keep them working, and we depend on them to make our clients happy. Our projects have differing start and end dates, as you can imagine. The company's responsibility to the developers is to make sure we have clients waiting in the wings so that when one project ends, another can start. For now, finding clients is not a problem and not the topic of this question. What I'm trying to think through right now is, how can I best measure/view/evaluate the end dates of projects so that I know when I need to start courting the next client. Is there a tool that does this? If it's just a spreadsheet, what might it look like?


title: Default vs Impl when implementing interfaces in Java

text: After reading Should package names be singular or plural? it occurred to me that I've never seen a proper debate covering one of my pet peeves: naming implementations of interfaces. Let's assume that you have a interface `Order` that is intended to be implemented in a variety of ways but there is only the initial implementation when the project is first created. Do you go for `DefaultOrder` or `OrderImpl` or some other variant to avoid the false dichotomy? And what do you do when more implementations come along? **And most important... why?**


title: Is a scrum sprint backlog ordered?

text: Currently, Wikipedia Scrum Article defines "Sprint Backlog" as: > A prioritized list of tasks to be completed during the sprint. It is my understanding that the "Product Backlog" is a prioritized list but that the "Sprint Backlog" does not have an order. I am looking for a definitive reference for the answer.


title: Where should "display functions" live in an MVC web app?

text: I'm using the Yii Framework which is an MVC php framework that is pretty similar to your standard web-based MVC framework. I want to display the related data from a many-to-many table as a list of strings in my view. Assuming a table schema like:               tag { id, name }     post { id, title, content, date }     post_tag { post_id, tag_id }      A post will display like:               Date: 9/27/2012      Title: Some Title     Content: blah blah blah...     Tags: Smart Funny Cool Informative      I can achieve this by doing something like this in my Post view:               <?php       echo join(' ',                array_map(function($tag) { return $tag->name; }, $model->tags));     ?>      (where `$model->tags` is an array of `Tag` objects associated with my model) My questions are:   1. Is this amount of code/logic okay in the view? (Personally I think I'd rather just reference a property or call a single function.)   2. If not, where should this code live? In the model? the controller? a helper? Potentially I may want to use in in other views as well. Ultimately I think its purely a display issue which would make me think it should be in the view, but then I have to repeat the code in any view I want to use it in.


title: Most efficient Implementation a Tree in C++

text: I need to write a tree where each element may have any number of child elements, and because of this each branch of the tree may have any length. The tree is only going to receive elements at first and then it is going to use exclusively for iterating though it's branches in no specific order. The tree will have several million elements and must be fast but also memory efficient. My plan makes a node class to store the elements and the pointers to its children. When the tree is fully constructed, it would be transformed it to an array or something faster and if possible, loaded to the processor's cache. Construction and the search on the tree are two different problems. Can I focus on how to solve each problem on the best way individually? The construction of has to be as fast as possible but it can use memory as it pleases. Then the transformation into a format that give us speed when iterating the tree's branches. This should preferably be an array to avoid going back and forth from RAM to cache in each element of the tree. So the real question is which is the structure to implement a tree to maximize insert speed, how can I transform it to a structure that gives me the best speed and memory?


title: Architecting a modular service application

text: I'm looking at architecting a new solution that is very modular by nature and would like to create a structure that supports that design to allow for easy future expansion, clear separation of concerns, licensing by module, etc. Most of what I've found on the web about modular or composite applications are UI- centric, focused on Silverlight, WPF, etc. In my case, I am developing a WCF service application that will be consumed by other developers working on various UI projects. **Background** The goal of my project is to create a centralized source of business/domain logic to support several of our business applications that currently duplicate process, rules, etc. And while not every benefit of modularity will be achieved, I'd like to seize the opportunity to establish a framework that will leverage those parts we can take advantage of. I've started the design by looking at the API exposed by the service application. It is clear that the services can be segregated along the modular lines that I was considering. For instance, I will have FinanceService, InventoryService, PersonnelService, etc. services that group my service operations to provide high-cohesion in the API while keeping the coupling low so clients only have to consume the services that are pertinent to their application. It makes sense to me that I can then have separate modules for each of these services, such as MyApp.Finance, MyApp.Inventory, My.Personnel and so on. Cross-cutting concerns and shared types would be in the MyApp shared assembly. From here I get a little tied up. (Oh, I should mention that I'll be using an IoC container for Dependency Injection to keep the application loosely-coupled. I won't mention which one because I don't want to open Pandora's box!) In MyApp.ServiceHost, I will create a service host file (.svc) corresponding to each module, FinanceService.svc for example. The service host needs the name of the service which corresponds to the information in the configuration file that contains the interface defining the service contract. The IoC configuration is then used to map the concrete implementation of the interface to use. **1\. Should the service layer implement the API and delegate to the modules or should the modules be self-contained (in that they contain everything related to that module, including the service implementation)?** One way of approaching the problem is to have a MyApp.Services "module" which contains the implementation of the service contracts. Each service class simply delegate to another class int eh appropriate module which contains the domain logic for the operation. For example, the FinanceService WCF class in MyApp.Services delegates to another interface which is implemented in the Finance module to carry out the operation. This would allow me to maintain a thin service facade and 'plug-in' the implementation to the service implementation and eliminate the need for the modules to worry about WCF, for instance. On the other hand, maybe it's preferred to have each module self-contained in that it has the interface and the implementation. The service host refers to the service contract interface found in the module and the IoC is configured to use the appropriate implementation from the module as well. This means that adding a new module can be done with no changes to the service layer other than adding a new .svc file and IoC configuration information. I'm thinking about the impact if I switch from standard WCF to a RESTful service interface or maybe go to RIA services or something. If each module contains the implementation of the service contract, then I have to make changes in every module if I change the service technology or approach. But, if the facade is its own module, then I only have to swap out that part to make a change. The modules would then have to implement a different set of contracts (interfaces), possibly defined in the shared assembly??? **2\. What is the best way to handle sharing resources between modules and/or dependencies between modules?** Take, for instance, a Receiving operation. At first blush it makes sense that this goes into the Inventory module as receiving goods is an inventory function. However, there is also a financial aspect in that we need to generate a Receipt and authorize payment. On the one hand, I would expect to use some type of domain events / messaging to communicate the operation. The Inventory module raises a GoodsReceivedEvent which is handled by the Financial module to generate the Receipt and initiate the payment process. However, this means that the Financial module needs to know about the inventory items that were received. I can simply refer to them by ID but what if I need additional information for the Receipt, such as the name and/or description, unit cost, etc.? Does it make sense for each module to have their own version of an inventory item that is designed to suit the needs of that module? In that case, the Financial module would have to perform its own lookup of the inventory items when handling the GoodsReceivedEvent. Or do I now have to put my domain objects into a shared location (at which point I lose some cohesion)? ... I used this example on purpose because I've worked a lot with various ERP systems and know they are designed with this type of modularity - I just don't know how. I also don't explicitly mention it above, but I prefer to follow Domain Driven Design principals in architecting the solution and believe that this type of modularity fits right into that area. Any help getting my head wrapped around this is greatly appreciated.


title: How much effort should you put into a junior developer?

text: At what point should one give up? I've tried helping them out by having them shadow me. We agree to break a minute, and then they go missing in action for a while...then just go back to their desk. Even when I know they've done this, part of me feels like I shouldn't have to go get them but that they should be showing interest in learning. Frankly, it's a bunch of time I don't have explaining things as I go when I could just do it. Am I expecting too much to expect that if they want to learn they'll make sure I know they're ready and willing? They go to meetings that they were not told they had to attend...good, but then sit in the corner and sleep...bad. I don't even know what to do with that. Sometimes I give them something small to do and they do it great, so I give them something just a touch harder and they totally fail, hard. They check in things without testing them. Part of me thinks that maybe I should be spending more time with them but at the same time I don't see a lot of interest and I really, honestly don't have time teaching the same things over and over. Sometimes I get asked questions that are really, really easy to answer if you just do a little bit of your own work trying to find out. Other times I'm not asked anything. I'm sure I could be doing better but honestly...I don't really want to anymore.


title: Extremely trivial C++ phone interview question

text: My company is currently interviewing for a developer position, and a disturbingly high number of candidates with good resumes end up being total frauds. We do have a written technical test which works fine for that purpose (it was initially designed for interns, but we found out that even candidates interviewing for senior positions failed it abysmally), but I'd like a few questions that allows us to filter out those people with a < 10 min. time investment. I'm trying to come up with a very trivial C++ (or even just programming) question that can be easily answered on the phone. The goal is not to get tricky, or even midly complex, just to weed out the people who'd fail an "intro to programming" midterm. So far, the best I've come up with is "Let's assume I'm an intern you're mentoring: can you explain to me, in simple terms, the difference between a vector and a list, and when I should use or the other". Any other ideas?


title: Does it make sense to write build scripts in C++?

text: I'm using CMake to generate my projects IDE/makefiles, but I still need to call custom "scripts" to manipulate my compiled files or even generate code. In previous projects I've been using Python and it was OK, but now I'm having serious trouble managing a lot of dependencies in two very big projects I'm working on so I want to minimize the dependencies everywhere. Someone suggested to me to use C++ to write my build scripts instead of adding a language dependency just for that. The projects themeselves already use C++ so there are several advantages that I can see:   * to build the whole project, only a C++ compiler and CMake would be necessary, nothing else (all the other dependencies are C or C++);   * C++ type safety (when using modern C++) makes everything easier to get "correct";   * it's also the language I know the better so I'm more at ease with it even if I'm able to write some good Python code;   * potential gain in execution speed (but i don't think it will really be perceptible); However, I think there might be some drawbacks and I'm not sure of the real impact as I didn't try yet:   * might be longer to write the code (that said I'm not sure because I'm efficient enough in C++ to write something that work quickly, so maybe for this system it wouldn't be so long to write) (compilation time shouldn't be a problem for this case);   * I must assume that all the text files I'll read as input are in UTF-8, I'm not sure it can be easilly checked at runtime in C++ and the language will not check it for you;   * libraries in C++ are harder to manage than in scripting languages; I lack experience and forsight so maybe I'm missing advantages and drawbacks. So the question is: does it make sense to use C++ for this? do you have experiences to report and do you see advantages and disadvantages that might be important?


title: Is there a sequence to read through the Android developer site for a user new to Android?

text: To summarize: I can buy a book, people say "Just read the developer site", I like to be spoon-fed the early learning piece for a technology, what path through the developer site will give me that spoonfeeding I need (that is, examples tied directly to the section being discussed, a clear path, etc.). I keep seeing that I don't need to buy an Android development book, that I should just read the Android developer site, because it has everything I need to know. I see it more as drinking from a fire hose. But I'm one of those people who likes to be walked through the basics. I like to build up my knowledge, rather than being dropped into reference documentation. I also like to make sure I have see all/most of the topics covered. I'd hate to develop the wrong thing, because I don't know about Fragments, Content Providers, or whatever. So, since it's a great resource, better than any book (we don't need no stinking books), how do I traverse the site to get the information provided in the same way as a book would lay it out?


title: Turning your code inside out (functional style) compared to a OO paradigm

text: I have find this article Turning Your Code Inside Out and I want to know how this approach described in article is for OO programmers/languages. Is this style of design used in OO programmers/languages? What's downsides and goodsides of this approach in a OO language? **Update:** OO objects have state and behavior, the design explained in article is stateless. Is not only Single Responsability Principle. (If I'm talking shit, please explain to me instead of only downside/close votes)


title: Service Design approach - one generic operation, and its implications

text: The hot topic in our organization is Service Design Approach. First Approach - The team wants to design services which essentially have one operation, can take any XML and return response XML message. The operation and the parameters are in the request XML message. Once the message is received the service determines the action/method that is requested. Reasons cited are ease of deployment and flexibility of introducing future operations. Second Approach - The second group is adamant about well defined service contracts and specific messages. Reasons cited are better performance, message validation and versioning. This is my preferred approach as well. What are the Pros and Cons? Can there be challenges introducing an ESB later in the architecture if we have chosen the first approach?


title: Why the bound of a linear function is same as that of a quadratic equation

text: I am learning algorithms, and I came across something very interesting. The asymptotic bound of the linear equation `(a * n)+b` is `O(n^2)`, for all `a` > 0. This is same bound as `a * n^2 + b * n + c`, which is surprising.


title: What approaches exist to setting up continent/country/city drop down menus?

text: How easy (or difficult) is it to have a Continent/Country/City drop down menu? Where one select from Drop Down Menus (for example): 1 - Europe 2 - UK 3 - London and then writes the Province/Area (for example: Essex). Realistically, how long should it take an experienced web developer to write the code of the above, as well as to link this selection to a Browse function and database storing? I do not have a geographical database yet and I am wondering what the fastest and cheapest way to add it to the drop down menu is. Is there any way to get that geographical database for free? I can see this type of geographical drop down menu in thousands of websites, but I am struggling as to how to implement it ASAP. * * * Follow Up: Tks All x your answers and comments so far. I hear what you are saying. I understand that there are rare occasions of Countries with multiple (same) name Cities and that it might be disputable whether a Country belongs to a certain Continent/Region or not (see Russia x example, Europe or Asia?). Anyway, please take a look, for instance, at this website Sign UP screen http://www.couchsurfing.org/register.html My question then is: Where do I get that list (Country/Cities) and how do I create that _array? Manually copying it somewhere else (which would take me ages) or are there ready made lists that can be downloaded from somewhere for free? * * * Follow Up n2: No way I plan to re-write the whole planisphere! I do agree, to a certain extent, that the number of Countries on this Planet is not fixed and this very issue is arguable (I've Googled: "How many Countries are there in the world?" and realized that there are different answers, however, I haven't got time to keep up to date with the ever shifting political landscape and engage into such debate). Irrespective of the argument between the Commentators below, all I just need is a straight and practical solution: a ready made list (database) of Countries/Cities (to use as _Array) in my DropDownMenus, exactly like the one on http://www.couchsurfing.org/register.html Has anyone got a clue where to get that list please?


title: What is the biggest support a boss can give to his/her developers?

text: Buying the best hardware, paying the most precious bonus or reward, treating them politely, provide the opportunity for improvement, etc.? We want to improve the productivity of our development team. We want to see what can be regarded the biggest support (or generally a good support), so we can start from there.


title: Should I use try catch in my test methods?

text: I am doing unit testing. I am trying to test one function. I call it from my test component. But If remote function cannot handle the exception then my tester component will also get exception, I guess. So should I worry about getting exception in my tester component? Thanks. **EDIT:** PS: Throwing an error is good, but only for other functions, not to end users until its a last option! OMG I wrote a programming quote!!


title: Where can I find windows via c/c++ video training?

text: There are plenty of windows programming online-video courses but most of them is about .net programming. But many task cannot be accomplished by .net such as API Hook. I think to be a windows programmer one must learn windows api via c/c++ sooner or later.I have the _windows via c++_ book, Is there any video course about advanced windows native programming online?


title: Right tool for small size Content Management System Project

text: I'm starting a new project in my head. It will be an events calendar. It will get info from openData sources the local goverment provides and will allow registered users to add aditional events to the calendar. The project is a personal one, and will be used also as a learning tool for me. In the Web side I just know HTML+CSS+PHP, but have never used PHP frameworks like Zend or Symfony, or any CMS systems like Alfresco or LifeRay. Which will a reasonable technology for this one? I know I just can code plain php, but like to learn some new technology, even if the project size seems not to justify the use of a complex tools more apropiate for bigger projects. It's hard to figure where to start just reading and not diggin into the subject, but I will be pleased to hear your opinions.


title: Are my negative internship experiences representative of the real world?

text: I'm curious if my current experiences as an intern are representative of actual industry. As background, I'm through the better part of two computing majors and a math major at a major university; I've aced every class and adored all of them, so I'd like to think that I'm not terrible at programming. I got an internship with one of the major software companies, and half way through now I've been shocked at the extraordinarily low quality of code. Comments don't exist, it's all spaghetti code, and everything that could be wrong is even worse. I've done a ton of tutoring/TAing, so I'm very used to reading bad code, but the major industry products I've been seeing trump all of that. I work 10-12 hours a day and never feel like I'm getting anywhere, because it's endless hours of trying to figure out an undocumented API or determine the behavior of some other part of the (completely undocumented) product. I've left work hating the job every day so far, and I desperately want to know if this is what is in store for the rest of my life. Did I draw a short straw on internships (the absurdly large paychecks imply that it's not a low quality position), or is this what the real world is like?


title: Best practices for merging a new version of third party source into an old version you've made changes to

text: A project I work on uses source code that's been purchased from a third party. The source code is delivered to us in a zip file. We store this source code in version control (TFS 2010) and routinely make modifications to it. When the third party releases a new version of the product we've purchased, I need to merge their new code into ours. Because the code I get is not under any kind over version control, it's very difficult to do this merge correctly. The last time I did this, we had not made many changes. As a result, I was able to check all the files out, copy the new files into their place, and fix up everything by hand without the help of any merging tools. Now that we've got a much larger set of changes, fixing things up by hand is too fragile to be a viable option. Are there any better ideas, or is this doomed to be painful and fragile each time?


title: Are robotics engineers also programmers?

text: I am going to be a senior next year, and I have done lots in computer programming and electronics. I am thinking of studying robotics when I go to university, but I am not sure how much programming there is going to be. Are robotics engineers programmers? How much programming can I expect to do if I choose to go down this career path?


title: Is JSF and JPA worth learning?

text: I'm attending a company sponsored training event for JSF and JPA that crams 10 days of training into 5 days. I plan on getting all that I can out of the class, but there is no "final exam".


title: When deploying updates, do you deploy all or selected/changed assemblies?

text: I'm a developer and I have had several experiences in web application deployment which are the following:   1. Deploy all files then apply configuration values as appropriate to the environment. We've used this style of deployment for larger softwares with long development cycles and quick releases aren't needed or allowed unless for emergencies.   2. Deploy only what has changed; manually update configuration files with what new or updated configuration as appropriate to environment. We've used this style for web applications that tend to be more agile, i.e. fix and feature releases are almost done daily. I've had issues with this before where not all assemblies dependent on an assembly that has changed were identified (A constant value was change in assembly A and the same constant was used in assembly B and only assembly A identified as changed). Which of the 2 is a better (or best) practice? I'm starting a new medium sized project where deployments would be on a monthly basis and would like to establish this process early on.


title: How ensure secure two cloud services can only talk to each other?

text: **Question** Given two cloud services, Sender A & Receiver B, communicating over HTTPS, what options do I have to ensure that Receiver B only response to Sender A? For the purposes of **Background** The receiver is generating activation keys for some hardware from a serial number. Our support team is using Salesforce and we're making callouts from Salesforce to an Azure service to generate the key. Since neither are behind a firewall we want to make sure that only request from our Salesforce instance can generate an activation key. My thought was just to create a nice long key stored on both sides that could be used to validate the request, but I'm not a security expert and don't know if there is anything else I should be considering.


title: Better word for Optional Requirements?

text: What's a better word for an optional requirement in software engineering? The phrase is contradictory. I've used "Non-Core Requirements" in previous projects.


title: Designing a scalable and robust retry mechanism

text: **Backstory** I have an Messaging Server Application that is responsible for brokering/proxying calls made from an Application Tier to numerous external services. The purpose of this application is to abstract the technicalities of invoking these services away from the main Application Tier. This works well as the Application Server does not have to worry about http/ldap etc protocols, wcf, ftp, soap, ebxml etc etc. They simply send a "payload", with a few identifiers, and the Messaging Server handles the rest. It also means that if a service definition changes the Application Server does not need to be changed. Additionally the Messaging Server is back ended by an SQL 2008 database that stores an audit of all messages sent and associated responses etc. The general data flow architecture of this is as follows: Application Server(s) => Load Balancer => Messaging Server(s) => [X] => External Services **The Question** I need to implement a retry mechanism into the Messaging Application tier. The intention is to gracefully recover from situations where the Messaging Server isn't able to forward onto the target service (i.e. service down, network issues, timeouts etc), i.e issues with point [X] in the architecture above. **The high level design requirement is:** Application Server sends a request to the Messaging Server. This then attempts to forward to the external services. If the first attempt at this fails the Messaging Server responds synchronously to the Application Server stating that the message is "in retry" The Messaging Server then proceeds to retry the fowarding per the contract (i.e. X retries with Y seconds between each). One of two things will happen next, all contracted retries will have been performed unsuccessfully or one of the retries will succeed. In either case a message is sent back into the Application Tier to notify the state of the messaging request. **A few gothcas** The message to retry can't be held in "memory" as if that Messaging Server goes down the message is lost. Additionally a retry contract could be 5 times once every 12 hours, holding data in memory for that length of time isn't feasible. That said some retry contracts could be 5 times once every 5 seconds. If the forward network goes down and then recovers the load of the retries should be spread across the entire messaging tier rather than a single server. **The question** The commucation between Application and Messaging tier isn't a concern as that framework is already in place. However the architecture of the retry framework in the Messaging Tier is still up in the air. How would you implement this? **Options we have/are considering** On failure store the retry data in a database, then have a polling service that checks the database every second. If a message is found that is scheduled for retry this is push back onto the Messaging Tier via the Load Balancer On failure store the retry data in a database, use a CLR job to poll the database and push messages, scheduled for retry, back onto the Load Balancer **Other Information** May or may not be relevant:   * All code is C#   * Databases are SQL 2008   * Comms from Application to Messaging tier is performed via WCF with BasicHttpBinding.   * We have complete control over all aspects of the Messaging Server tier and no control over the Application Tier.   * The Messaging Tier currently handles around 500k transactions per hour, so you can imagine how quickly things will backup if there is a failure on one of the external services


title: How to add personal android projects to my CV to get into Android job market

text: I am an experienced Java Programmer. 1 year back I started android programming and published 3 Apps into the market. But these all are my personal projects. Now I want get into the android job market. As my android experience is not corporate experience does the companies consider this? How to add these android projects to my CV to get into Android job market? Thanks


title: How can I use icons under a CC-ND license?

text: I am developing an open-source Java desktop application and I would like to use some icons in the GUI to indicate various settings, external links, etc. I found a set of free icons that are published under the Creative Commons Attribution-NoDerivs 3.0 Unported license that I would like to use. My questions are:   * Would including such an icon in my application constitute an adaptation or derivative work, and as such be a violation of the license?   * The icons are a little too big for my use case. Am I allowed to include scaled-down versions in my application? And would there be a difference between scaling them in photoshop and including these modified images versus including the original images and scaling them down programmatically?   * I would like to release my program under the Apache License 2.0. Does this have an effect on whether I can include the icons or not? Would I need to take any extra steps, other than including the original copyright and license information for the icons in my NOTICE file? Edit: An ArsTechnica article titled "Creative Commons images and you: a quick guide for image users" states that > More subtle alterations, like cropping an image to make it fit your page > width, might seem to be a gray area, but as long as you don't make enough > changes so that your version, when taken as a whole, qualifies as an > original, copyrightable work in its own right, then you should be safe. So the second question essentially becomes:   * Does a scaled down version of an icon qualify for copyright in its own right? And if the answer is "no", then it is not considered an Adaptation and therefore not prohibited under the terms of the license.


High performance mysql book suggests that for sharding a blog application, one may want to put comments data across 2 shards: first, on the shard of a person posting comment, and on the shard where the post is stored. So this raises the question how to reliably duplicate this data. Which of the following data duplication options across shards is recommended?      _Option 1:_ Make 2 separate inserts from the PHP script.   _Pros:_ a) Logic is in application layer.   _Cons:_ a) User is held for 2 inserts. b) This logic will need to be duplicated in every client trying to insert similar data.   Conclusion: Seems reasonable. _Option 2:_ Form federated tables and use some trigger to handle the insert of duplicate.   _Pros:_ a) App layer doesn't need to worry about multiple inserts   _Cons:_ a) Every shard need to have federated connection to every other shard; b) Federation will work on machines in LAN, but what about at 2 different sites. c) what if connection to federated server fails.   Conclusion: Doesn't seem like a sound idea. _Option 3:_ Messaging such as RabbitMQ   _Pros:_ a) Different clients can insert data at one place, and all subscribers can consume the insert.   _Cons:_ a) Complex; b) may impose overhead in order to host messaging server, and clients; c) not sure how will it work with a look-up service to locate appropriate shards   _Conclusion:_ Not sure   _Option 4:_ your suggestion? I will greatly appreciate your help.