title: Running entire frontend of a system on a flatfile cache

text: I'm in the middle of moving away from PyroCMS to a custom solution built on Laravel. Wont go into the details as to why here, but it is a necessity. I'm toying with the idea of caching things like pages and posts into flatfile once they are created, and then loading them (if they exist) and falling back to the mysql database if the cache isnt found. It got me thinking. Is there a problem with essentially running the entire 'frontend' of your system or site on flatfile, pre-rendered cached files? Surely the cache only needs dropping/replacing when a post or page is modified, so a cache could essentially be kept for the lifetime of the site. Unless I'm missing something, surely this is something that should be done a lot more, should it not? Even if it was just storing serialised or json data from the database tables, it's got to be faster than opening up a mysql connection hasn't it?


title: Single write, multiple read of stateful objects

text: Scenario:   * One data input feed (call this `Source`)   * Multiple objects (call these `Layer1`) **read** this `Source`, and analyze the feed. This analysis is stateful.   * `Layer1` objects have configuration parameters. For example, `new FooLayer1(10, 20)` will do different analysis than `new FooLayer1(20, 20)` will do different analysis than `new FooLayer1(20, 30)`     * The `Layer1` analysis is done asynchronously.   * Still other objects (call these `Layer2`) **readonly** the output of the `Layer1` objects and process those results. This analysis is also stateful.   * Guice object creation hierarchy   * Needed `Layer1` objects are accessed often enough that it doesn't matter if they are created lazily, as long as they remain in memory after they're created the first time.   * The needs of `Layer2` objects are hardcoded; no good way to know in advance which `Layer1` objects will be needed. I want to be able to reuse the work of the `Layer1` objects. For example, lets say I have:   * `AlphaLayer2` object that reads the output of `FooLayer1` and `BarLayer1`   * `BetaLayer2` reads the output of `BarLayer1` and `BazLayer1`   * `QuuxLayer1` is implemented, but I don't want my server to compute the value of `QuuxLayer1` unless there is a `Layer2` object that needs it. Currently, I have a factory that all `Layer2` objects have access to, that only creates the appropriate `Layer1` object as needed, and stores all created `Layer1` objects in a Map. But, since `Layer1` objects also have configuration parameters, I need to make sure that I'm storing the `Layer1` objects in a good data structure. But the `Layer1` functionality needs to be flexible, and I figure as I create more kinds of `Layer1` objects, this kind of a `Map` could get really complicated. I am asking this question because, while it's fine now, as the complexity grows, maintaining the data structure in this way seems to become really difficult. Trying to do some sort of nested `Map` data structure should get me `O(1)` access times on finding these `Layer1` objects, but will make the caching super complicated. Alternatively, I could keep them in a much flatter structure, and iterate over the list of all the `Layer1` objects and see if they have the right parameters. If none found, create the new one. As long as `Layer2` objects keep the reference, this should only happen once. Yet another option would be to create a `Map<Class, Set<Layer1>>` so that it only needs to iterate through the created `Layer1` objects of the correct class. Has anyone seen this kind of scenario before? Which of the options I've mentioned is preferred? Or, is there something I haven't mentioned yet? Also, is there any way to use Guice to create `Layer1` objects in a way where I can get reuse them (which I need to do, because they're stateful)


title: Suitable algorithm for joining records from multiple databases

text: I am in the process of writing a library that is used to be able to access data from a database. The library requires the initial definition of all the tables that the application will be using in the form of classes that extend an abstract class within the library. These classes contain the database connection the table is stored in, the table name, the columns, the indices, and the relationships between tables. The abstract class contains static functions that allow a user to `select` or `insert` rows into that particular database. The `select` function returns an object that allows a query to be assembled, that provides options for the `fields`, `joins`, `where`, `group`, `having`, `order`, and `limit`, which culminates in a `fetch` function that returns an object that contains the resultant records along with `save` and `delete` functions. Now, this works fine when it is working between tables within the same database, when being combined with tables in other database, but I am trying to get it so that I can do something like this:               class tabA extends tableBase {         public static $database  = 'mySqlDB';         public static $tablename = 'tableA';         public static $columns   = array(             'tableAID'       => 'int(11)',             'tableAKey'      => 'varchar(128)',             'tableBRefID'    => 'int(11)',         );     }          class tabB extends tableBase {         public static $database  = 'oracleDB';         public static $tablename = 'tableB';         public static $columns   = array(             'tableBID'       => 'int(11)',             'tableBSpecial'  => 'boolean',             'tableBValue'    => 'text',         );     }          tabA::select()->join('tabB', 'LEFT')->where(andCondition(eqCondition(tabA::tableAKey, 'foo'), eqCondition(tabB::tableBSpecial, true)))->fetch()      Where the return of `fetch` would comprise of rows containing the found columns from the two databases. The drivers for the databases use a common interface, of which the select function looks like:               function select ($columns, $from, $joins, $where, $group, $having, $order, $limit, $offset)      I am aware that the tableBase class will have to break up the query it will be performing into two separate queries, one to query from tabA, and one from tabB, then join the results in the defined type (in this case, LEFT join). But I am having problems coming up with a suitable algorithm for dividing the query into two separate query blocks, then how to combine the results (satisfying the `where` condition) in an efficient manor. My thoughts so far would entail stripping out the columns (excluding fields that are derived from operations between data over the two databases) and conditions that are relevant to each database, using those searches on each database, passing through the results of the main database table results and joining data (discarding rows that don't match the join), (at this point, if there are any derived fields as stated above, they are computed), then finally passing through all the resultant rows to ensure that any remaining where or having conditions are matched, and applying any final orderings. But to my mind, this doesn't seem the most efficient manor, and creates issues when using limits, unless fetches all the rows, then applies the limit operation on the final result. So, are there any resources, or information on how such a thing could be accomplished in a better/more efficient/neater way? **ADDITIONAL** Although these are SQL databases, a NoSQL database could work as long as the driver built operates within the confines of the database driver interface. At the moment, there is only one driver that uses PDO, but I am working on building drivers for XML and MongoDB datastores.


title: Writing a Jenkins plugin - non-Java-Expert

text: Can anyone point me (.NET by career, primarily Ruby by hobby) in the right direction(s) for learning how to write a Jenkins plugin? I'm looking specifically at build summary information and trend graphs from PartCover stats. I'm not worried about being able to find my way around Java, though I don't want to have to learn everything about it before I attack the problem.


title: How many juniors should a senior mentor?

text: Our shop's size increases dynamically, so we are planning to hire a few new junior developers but we would not like to overwhelm the seniors with too much mentoring and training. How many (usually fresh out of college) junior developers could (and should) a senior developer mentor while the senior is still being able to do his or her tasks effectively?


title: HTML, JS, CSS Engines

text: I am just messing around, trying to figure out how stuff works and right now I have a couple questions about HTML, JS and CSS engines. I know there are two major JavaScript engines out there - V8 and JavaScriptCore (WebKit's JS engine as far as I know). Is that correct? And what are the main HTML + CSS renderers out there? Let's say I want to build a web browser using V8 (I saw it has some documentation and stuff + I like the way it works), what are the best options for me? Partially another question. Is there any bare browser that uses V8 and runs on Ubuntu at least? P.S. I am a Ubuntu user and prefer C++.


title: Is is possible to unit test a web forms site

text: Is is possible (and sensible) to unit test a web forms site? It seems to me that as so much of it depends on state and user input it wouldn't be fesable. If it's not feasible is there a valid automated alternative?


title: Delegate vs Method

text: Is there any advantige using delegates instead of methods? For example:               public void LoginAuthenticate(object sender, AuthenticateEventArgs e)     {      if (Membership.ValidateUser(lgUserLogin.UserName, lgUserLogin.Password))          {            Func<string, string> getDestinationPage = (userLogin) => { //definition };               e.Authenticated = true;          lgUserLogin.DestinationPageUrl = getDestinationPage(lgUserLogin.UserName);       }          else        {         Action<string> invalidLogin = (msg) =>          {            lgUserLogin.FailureText = string.IsNullOrWhiteSpace(msg) ? "Invalid login" : msg;            e.Authenticated = false;          };               MembershipUser user = Membership.GetUser(lgUserLogin.UserName);           if (user != null)            {             if (user.IsLockedOut)              {                invalidLogin("User has been blocked");                   }              else if (!user.IsApproved)               {                invalidLogin("User is not activated");               }               else                {                    invalidLogin(null);                  }                 }                 else              {                invalidLogin(null);              }        }     }      If I `getDestinationPage` define as `private string getDestinationPage(string login){...}` and `invalidLogin` as `private void invalidLogin(string msg){...}` does it gives any benefits?


title: How effectively "sell" a good design in large meetings

text: Many times I have witnessed a sad tragedy. Here's what happens:   1. A team design review for a new project.   2. I see a simple design that has quite a few holes.   3. I casually mention the holes and ways to avoid them.   4. The warnings are ignored with comments like "that 'never' happen in real life"   5. Eventually the things that "will 'never' happen" happen   6. An emergency team design review for a broken project. So what do I do? Copping the "I told you so" attitude is not going to win friends and influence people. Sometimes years go by and the comments from step 3 are forgotten anyway. I definitely don't want to be the annoying pest reminding the world of the gotchas. I often sit back and watch the Titanic sail off to Europe. It's frustrating to see bad designs move forward. It's also frustrating that I can't seem to convince others of the pending peril of the current path. I do worst on team meetings where everyone has different ways of understanding different terms. Also, egos tend to win of reason and thought. I'm looking for good tactics to convince groups people to use some new and complicated ideas.


title: How to convince co-workers the merits of local development enviroments

text: I'm trying to convince my co-workers about the merits of developing on local environments, but so far have had little luck in my quest. Outside of myself, the other developers with my company develop on seperate folders on the same server as our development server, using the same DB/DB Server/Web Server for all folders, with your standard text editor on the local machines. I've mentioned the benefits of any mistakes (like say the stray while loop misconfiguration) localized to one machine, network or server issues having no relevance or effect on work, and able to use xdebug (although you can use it on a shared server, the issues with sessions I've been told are problematic...and not having a fulltime sys admin to keep things happy doesn't hurt either). So far, no dice. So I ask you the SO community what could be done to convince others to do so, or if I'm the one that is on the wrong path. The current environment that we have is your typical WAMP environments, but I wanted to keep the question language and environment agnostic as possible. Thanks in advance!


title: Hit the Upper Limit for Cross Platform API Capabilities

text: I am a junior programmer who works as an intern(8 mths into the internship) in a team of 1(myself only) creating mobile phone apps & websites. I have created an App that works exactly how it should & has some pretty cool features but the App fails to run on Android(the main target platform for us, it works on the desktop emulator but not on Android) due to the memory problems with large apps in the Mosync API(see the links for more info on the memory problem). The most demoralising aspect of the problem is that(as explained in the links below) the app crashes randomly & not consistantly so you make a change run it on the platform a cple of times & where something worked before it will now freeze then cause the app to crash(Android OS kills my app). http://www.mosync.com/content/android-how-much-memory-too-much-memory http://usingimho.wordpress.com/2011/06/14/why-you-should-stay-away-from- appcelerators-titanium/ I have invested 4 weeks in developing the app(an interactive calendar) & 5 mths in learning the Mosync API for apps that wont work on the platform. **My Problem:** I have to decide between dumping the app & starting the app again in Native Android Java(I know Java) or severely reducing the the number of resources(.pngs) & features of the app(polaroid effect it produces) to make it work in the android platform. The end result will be functional but low quality(in terms of graphics) & simple. **What would more experienced developers decide to do & how would you explain this decision/recommendation to your non-technical boss?**


title: Will it ever be possible to build quality websites with editors alone, without needing to know HTML?

text: Lots of big companies, from Apple to Microsoft to Google, are putting more and more money into creating tools that will allow anybody to create a website with a WYSIWYG editor. For example, this email I just got from Adobe: > **Build websites as quickly and easily as an Adobe® InDesign® layout.** > > Currently in beta form, the application code-named "Muse" is a new > technology that enables graphic designers to use familiar, free-form tools > to design and publish HTML and CSS websites—all without writing code or > being restricted to templates. Be part of this incredible free preview and > experience how Muse will revolutionize the way you create for the web. As a web developer, I can't foresee any way that Adobe or any other company will be to create some solution which allows a user with no HTML/CSS/JS knowledge to build a useful website design for these reasons:   * The code generated will almost certainly be a mess, which makes it difficult for a programmer who wants to write the backend for the site to work with it. They may even be required to change the code themselves to structure it as they need it.   * HTML is not pixel-based, so it is very difficult to develop a tool that can easily design templates which can flow with changes in text size, etc. In addition, elements should follow each other in reasonable order, not in some random order (e.g. as dictated by when an element is added).   * Code generated in one tool would likely not be portable to other tools easily, which would lock you in to the original tool. (I am assuming that the tool would allow complete control of a website; as Adobe said, "as quickly and easily as an Adobe InDesign layout". Programs which let you use professionally-designed templates are a different story.) Do you think it will ever be possible for a person unskilled in HTML to create quality (both behind-the-scenes and appearance) web designs/sites?


title: Relationships Of Complex Documents In Document Databases

text: I have been looking at a number of document databases (RavenDB, CouchDB, MongoDB) and there are two things about them that I really like and makes me what to incorporate them as much as possible and that is the schema-less natural (not that they are schema-less per-say but that it is a very flexible schema that is much easier to change than ones with RDBMS) and the fact there is a lot less impedance mismatch when mapping the database data to code. There have a been a number of things that I have found that have prevented me from using a document database because I find I need these things all the time. Some of them I have found solutions for like unique fields. While document databases don't directly support this feature, a work around that is acceptable is creating another document with the email is the document id and then inserting the user if the insert on the email document was successful however there are there is one big thing that I don't think document database can provide me from my searching. That feature is relationships with complex documents. One of my projects I wanted to use a document database for is a project management system. The issue with this is that there are a lot of places where I need relationships with large objects (and multiple relationships within one document). When it come to something like a task or a user, those are complex documents and having the document embedded would not be a good thing as data mismatch with these items can't happen. Now if I just reference the document then am I really getting any benefit from using a document database because now I am probably going to have a lot more queries that I need to run compared to a relational database. While I was hopping to have most of my data be stored into a document database, the more I look at it, it seems like most of the data needs to be in a RDBMS. Am I correct in assuming this type of relationship needs a RDBMS or am I un-aware of how this can be accomplished in a document database.


title: restful web development in scala

text: I ve been a php developer for the past 4 years and worked in OO PHP and almost all sorts of PHP mvc frameworks. Ive joined a new company now and here we use scala for web development. We have a product which has a frontend developed in a js mvc and a backend in scala. Actually this kind of restful architecture itself is brand new for me. In PHP we just use PHP for both frontend and backend. So i started working in scala and did some basic console app stuff. But there are no articles on how i must use scala to do restful web development. There is a framework called lift developed in scala. But we havent used that. Ours is a pure scala app without lift stuff. I found out two blogs but it has too little information on implementation. So can any one point me in the right direction on when to use the restful architecure as against mvc architecture and absolute newbie guides to creating a web app using restful architecture in scala.


title: Negotiating with Google as a lone software developer

text: > **Possible Duplicate:**   >  Do programmers need a union? I have come across this website that is a trade union for Android Developers http://www.andevuni.org/ I was inspired to search for a trade union after this post Should developers accept overtime/weekend work/denied bonus payments? which was featured on Hacker News How effective could a trade union be to improve working conditions for Software Developers, more precisly, Android developers? I am an Android developer myself, and I am planning to release my app in a month or so. Could this petition by the trade union be effective at renegotiating the 32% Google tax on Android apps? If yes, should I wait with releasing my app?


title: What is State, Mutable State and Immutable State?

text: This is a newbie question, but I couldn't find a newbie-proof enough answer on Google. What do people mean when they say 'state' - in programming in general, and in OO programming specifically? Also, what is mutable and immutable state - again, generally in programming and also specifically in OOP?


title: What are the most crucial categories of content to organize into an internal developer portal in a large company?

text: I have been tasked with organizing all of the company's internal content currently spread around sharepoint, a markdown reference manual and confluence into a single cohesive and usable portal in confluence. I want the home page to be the "dev center" and for it to be where we point new devs and where everyone goes for reference and to see what is going on at the company. Here are some general categories I imagine might be important:   1. news... what's going on in the company, promotions, new hires, project updates   2. best practices... coding standards, solutions to common problems, etc...   3. on-boarding... docs describing how to set up a dev environment on your workstation   4. company culture... org chart, roles and responsibilities, the functions of different groups, processes   5. training... courses coming up, recommended and required training   6. events... events coming up, slides and materials from previous events Anything else you think is important to include? My goal is to have this portal be something devs actually want to look at multiple times per day for help doing their jobs. Expected user base is around 500 devs, testers, ops, etc... across over a dozen teams. Both .Net and Java are in use in this Enterprise. The page will be in Confluence, so I believe we can let everyone contribute in some way, or should we lock it down and appoint content managers? Good point about analytics. I will include that in my proposal. Thanks for the input!!


title: How can I develop/install iPhone apps without owning an iPhone?

text: What are my options? I've heard that iPhone emulator is not reliable. Also is it possible for me to buy iphone apps without even owning an iphone? BTW, I am running linux and a windows VM. Thanks!


title: Algorithm for HIghest Local Alignment Score with a specific character match between two subsequences

text: I'm writing a code that identifies the highest-scoring local alignment between a substring X' of X and a substring Y' of Y that has at least one column in which a C from X' is aligned to a W from Y'. Example: if X=:HCEA and Y=:HWEA, then some of the local alignments with a column that aligns a C to a W are : >   1. CE > > WE > >   2. HCE > > HWE > >   3. H-CE > > -HW- > > I need to compute all these possibilities and find the one which has a maximum alignment score. My Solution: I've taken the above 2 sequences as inputs and tried to solve the problem. Here is my code. I myself know that I haven't fulfilled the question because I've identified the matching substring alone. Can anyone tell me how should I improve my code to get the desired result.               public class Q1 {              public static void main(String[] args) {             //  Input Protein Sequences              String seq1 = "HCEA";               String seq2 = "HWEA";                  //  Array to store the score             int[][] T = new int[seq1.length() + 1][seq2.length() + 1];                  //  initialize seq1             for (int i = 0; i <= seq1.length(); i++) {                 T[i][0] = i;             }                  //  Initialize seq2             for (int i = 0; i <= seq2.length(); i++) {                 T[0][i] = i;             }                  //  Compute the matrix score             for (int i = 1; i <= seq1.length(); i++) {                 for (int j = 1; j <= seq2.length(); j++) {                     if ((seq1.charAt(i - 1) == seq2.charAt(j - 1))                             || (seq1.charAt(i - 1) == 'C') && (seq2.charAt(j - 1) == 'W')) {                         T[i][j] = T[i - 1][j - 1];                     } else {                         T[i][j] = Math.min(T[i - 1][j], T[i][j - 1]) + 1;                     }                 }             }                  //  Strings to store the aligned sequences             StringBuilder alignedSeq1 = new StringBuilder();             StringBuilder alignedSeq2 = new StringBuilder();                  //  Build for sequences 1 & 2 from the matrix score             for (int i = seq1.length(), j = seq2.length(); i > 0 || j > 0;) {                 if (i > 0 && T[i][j] == T[i - 1][j] + 1) {                     alignedSeq1.append(seq1.charAt(--i));                     alignedSeq2.append("-");                 } else if (j > 0 && T[i][j] == T[i][j - 1] + 1) {                     alignedSeq2.append(seq2.charAt(--j));                     alignedSeq1.append("-");                 } else if (i > 0 && j > 0 && T[i][j] == T[i - 1][j - 1]) {                     alignedSeq1.append(seq1.charAt(--i));                     alignedSeq2.append(seq2.charAt(--j));                 }             }                  //  Display the aligned sequence             System.out.println(alignedSeq1.reverse().toString());             System.out.println(alignedSeq2.reverse().toString());         }     }      A post states that, dynamic programming could solve this question in a better way. Also is there any other way to solve the question optimally? If its available can anyone post a pseudo code or an algorithm, so that I'll be able to code for it.


title: How to handle exception in REST API

text: Given a REST API, which throws an exception when handling a request from a client. Whenever the REST API throws an exception, it's logged and the application (in this case a console application) closes to prevent further damage. Should I send a response to the client whose request resulted in an exception, indicating that an error occured or should I let the client hang and deal with it (timeout)?


title: What is the recommended approach for helper functions in JavaScript?

text: What is the recommended approach for helper functions? I would like to choose one technique, and run with it to create my new "class". Here are the design options I have pondered: **Option 1: Helper function in outer scope, invoke with context of instance**               function createPane (pane) {         // logic to create pane         var proto = Object.create(this.paneList);         $.extend(paneProto, pane);         return paneProto;     }          Panes.prototype.initialize = function (panes) {         var _this = this;         _.each(panes, function () {             _this.panes.push(createPane.call(_this, this));         });     }        * **Pros:** Simple syntax. `createPane` is not published on the instance.   * **Cons:** `createPane` is accessible in other scopes. **Option 2: Helper function in closure, invoke with context of instance**               Panes.prototype.initialize = (function () {              function createPane (pane) {             // same logic as last createPane         }              return function (panes) {             // same logic as before - calls createPane         }          })();        * **Pros:** `createPane` is not published on the instance.   * **Cons:** Lower readability and testability; Testing of this helper must occur in the scope of initialize. **Option 3: Prepend _ to name to indicate a private method**               Panes.prototype._createPane = function (pane) {         // same logic as last createPane     }          Panes.prototype.initialize = function (panes) {         // same logic as last, except calls this._createPane     }        * **Pros:** Implicit context of `_createPane` is the instance. Testability from the outside.   * **Cons:** Exposing helper function on the instance. **Option 4: Helper functions as arguments**               Panes.prototype.initialize = (function (createPane) {              return function (panes) {             // same logic as before - calls createPane         }          })(function createPane () {        // same logic as last createPane     });        * **Pros:** `createPane` is not published on the instance. Helper functions lack access to each other.   * **Cons:** Lower readability and testability; Testing of this helper must occur in the scope of initialize.


title: Fantasy: One Language/Standard supported by all devices?

text: No introduction or description needed. We all know how troublesome it is make different codes and test codes in different platforms and browsers such as IE, Firefox, Chrome, Android 2.3 onwards, iOS, Windows, etc... All across the web, here and there, we have talks of having HTML5 apps run seamlessly on all devices. Will that ever be true? Is that future coming up?


title: When is it reasonable to create my own programming language?

text: Are there types of killer applications, classes of algorithmic problems, etc., where it is better, in the long run, to create my own language? PS: Just to be sure, I mean a new programming language and a compiler, not a new compiler for an existing language. **EDIT** : Thank you for the answers. Can you provide some examples, where it is absolutly unnecessary to create a DSL or cases in which a DSL might be a good idea?


In numerics, it is very important to be able to identify unstable schemes and to improve their stability. How to identify unstable floating point computations? I am working on a very complex simulation where many numerical schemes work together and I am looking for a methodic to identify its weak parts. I am working on a physical model involving differential equations. A bird's eye view of the overall process is:   1. (Preliminary step) Gather physical observations _P_.   2. Determine initial parameters of the simulation. This uses an optimisation algorithm, where we walk in a parameter space and look for parameters _C_ such that some error function _E(F(C), P)_ is minimised, where _F_ is some derived quantity of the parameters.   3. Plug _C_ in the simulation engine. This is an Euler scheme of the EDP, so that at each time step, we compute the terms driving the dynamic (each of them is a complex function, potentially subject to instability) and feed the Euler scheme with these dynamic terms to compute the next state. This goes on for thousands time points.   4. At the end of the simulation, we compute some function _Proof(S)_ of the final state _S_ and compare to some quantities _Require(P)_ deduced from the observed quantities. This is not a formal proof of the result, more a plausibility check. Also, I see a tower of complex operations (computation of dynamic terms, within the Euler scheme, within the _Proof_ ). And would like to recognise “bad parts” and fix them. I speculate that using a software implementation of floating point numbers with reduced precision would magnify the unstability of numerical schemes, thus easing the comparison between different implementations. Is this a common technique to investigate this question? Is it possible to use a virtual machine, as Bochs, to achieve this without altering the program? To deal appropriately with the stability question, it is sometimes acceptable to target the typical input of the numerical procedure, so that it can be tuned to do well on that input and maybe less well on other valid, yet unlikely, input. Given a sample of typical inputs, it is possible to _snoop_ some intermediate results and prepare a statistical profile for them. Again, is this a common technique to study stability issues? Is a virtual machine useful for this?


title: Under what scenarios will an App's localStorage get cleared?

text: I am developing an Hybrid android app using HTML5 which will work completely offline. Today morning when I opened the app, I saw that all the data stored in localStorage was cleared. Under what scenarios can the localStorage get cleared? Given these scenarios, is it a good idea to use localStorage?


title: Java has lots of libraries. How much more than other modern languages?

text: The only programming language I ever used 'seriously' to create relatively big applications, is Java. Thus, I'm very familiar with the fact that Java offers a lot of built-in libraries that help with lots of tasks, that otherwise you'd have to implement yourself. But I wanted to ask: Does Java offer significantly more built-in libraries than other modern OO languages, for example C#? Is Java especially generous in the libraries it gives you, compared to other modern languages? Also, as a different question: Is it considered 'less proferssional' to often use the built-in libraries instead of implementing thing by yourself?


title: I want to turn VB.Net Option Strict On

text: I recently found out about strong typing in VB.Net (naturally it was on here, thanks!) and am deciding I should take another step toward being a better programmer. I went from vba macros -> VB.Net, because I needed a program that I could automate and I never read anything about strong typing, so I kind of fell into the VB.Net default trap. Now I am looking to turn it on and sort out this whole type thing. I was hoping someone could direct me towards some resources to make this transistion as painless as possible. I have read around some and ctype seems to come up a lot, but past that I am at a bit of a loss. What are the benefits of switching? Is there more to it than just using ctype to cast things? I feel like there is a good article that I have failed to come across and any direction would be great. Would a good approach to be to rewrite a program that is written with option strict off and note differences?


title: Should a class without instance variables be considered a class?

text: Say you need to implement a few closely related functions that provide a piece of functionality, but there is no need to track any state between those functions, they just sometimes pass some parameters between themselves. What would be the best decision from the design standpoint? Make it a class, or just a separate source file that contains these functions? UPD: Objective-C, no namespaces


title: Efficient ways to model cars moving along a road

text: This has never come up, so I've never thought how a data or programming model should work that simulates (a) bird's eye view of cars moving and some rudimentary physics, (b) how the cars would follow a road layout and (c) how an efficient data structure for roads would look like. Obviously, this question also means to ask how the road data structures would interact with cars. Any recommendations, or reviews of such data models?


title: What JavaScript inconsistencies should I look out for?

text: I remember reading some "funny" examples once of weird results JavaScript can give when you, for example, add strings to numbers etc. Does anyone have any good examples or a link to the blog that I might have read them on? Which ones are likely to catch a programmer out in the real world?


title: How can I thoroughly evaluate a prospective employer?

text: We hear much about code smells, test smells, and even project smells, but I have heard no discussion about employer "smells" outside of the Joel Test. After much frustration working for employers with a bouquet of unpleasant corporate-culture odors, I believe it's time for me to actively seek a more mature development environment. I've started assembling a list of questions to help vet employers by identifying issues during a job interview, and am looking for additional ideas. I suppose this list could easily be modified by an employer to vet an employee as well, but please answer from the interviewee's perspective. I think it would be important to ask many of these questions of multiple people to find out if consistent answers are given. For the most part, I tried to put the questions in each section in the order they could be asked. An undesired answer to an early question will often make follow-ups moot. **Values**   * What constitutes "well-written" software?    * What attributes does a good developer have? Same question for manager. Who are your most valued employees/managers, and why? **Process**   * Do you have a development process?    * How rigorously do you follow it?    * How do you decide how much process to apply to each project?   * Describe a typical project lifecycle. Ask the following if they don't come up otherwise:     * Waterfall/iterative: How much time is spent in upfront requirements gathering? upfront design? **Testing**   * Who develops tests (developers or separate test engineers?)   * When are they developed?    * When are the tests executed?    * How long do they take to execute?    * What makes a good test?    * How do you know you've tested enough?   * What percentage of code is tested?  **Review**   * What is the review process like?   * What percentage of code is reviewed? Design?   * How frequently can I expect to participate as code/design reviewer/reviewee?   * What are the criteria applied to review and where do the criteria come from? **Improvement**   * What new tools and techniques have you evaluated or deployed in the past year?   * What training courses have your employees been given in the past year? What will I be doing for the first six months in your company (hinting at what kind of organized mentorship/training has been thought through, if any)   * What changes to your development process have been made in the past year?   * How do you improve and learn from your mistakes as an organization? What was your organizations biggest mistake in the past year, and how was it addressed?   * What feedback have you given to management lately? Was it implemented? If not, why?   * How does your company use "best practices?" How do you seek them out from the outside or within, and how do you share them with each other? **Ethics**   * Tell me about an ethical problem you or your employees experienced recently and how was it resolved?   * Do you use open-source software? What open-source contributions have you made? **Follow-Ups** I liked what @jim-leonardo said on this Stack Overflow question: _Really a thing to ask yourself: "Does this person seem like they are trying to recruit me and make me interested?" I think this is one of the most important bits. If they seem to be taking the attitude that the only one being interviewed is you, then they probably will treat you poorly. Good interviewers understand they have to sell the position as much as the candidate needs to sell themselves._ @SethP added: _Glassdoor.com is a good web site for researching potential employers. It contains information about how specific companies conduct interviews..._


title: Why no fortran standard library?

text: To be a language focused on mathematics and scientific computing, I am always baffled by the total lack of useful mathematical routines in the Fortran standard library. One would expect it to be shipped at least with a routine to compute standard deviation and mean, but this is not the case. In particular with the introduction of Fortran 90 and the addition of modules (thus reducing namespace pollution), I don't see any reason why of this critical lack of services. I would like to hear your knowledge about why this is the case.


title: Building iOS Applications using  MonoTouch

text: I am planning to learn objective-c to be able to build iOS Applications I have seen some guys using Monotouch sdk, I am really confused where to start from. I have a solid experience in Developing sites and Application using .NET Framework Technology, should I go with `Monotouch`? Will the application made in the native platform run faster? Many Thanks.


title: Can I use corporate-licensed tool at home/for personal projects?

text: Normally, the company where a programmer works has corporate licensed tools which are useful for programmer (ex: proprietary IDEs, reflectors, diagramming tools, office tools and PDF makers, etc.) Can I :   * Install it at home and use it for company projects?   * Install it at home and use it for personal projects (possibly commercial)?   * Use it at office for personal project (e.g. after office hours)? I am not strictly asking for legal advise here (though some legal point of view would be nice, too). But is it a right thing to do in general?


title: Why retrieves a native app data faster than one with PhoneGap?

text: I know that an app developed with PhoneGap is slower than a native one because at PhoneGap the whole code must be interpreted at runtime into a native one. But could someone explain or has a good in-depth website which explains why a native app retrieves data (a picture or text) from a web ressource faster than an app with PhoneGap? Do both apps handle internet connections in another way, or is there more data retrieved by an PhoneGap app?


title: What are the duties of a software control management (SCM) engineer in a large company?

text: What are the canonical responsibilities of such a specialized role? Normally, I expected this to be part of the tasks of a normal developer, but in large companies I know this role is to be fulfilled by an engineer in his own. In my current company, there is a possibility for a new opening in a SCM position, so I could apply, but first I would like to hear about what, in your experience, characterizes this role best.


title: What are the pre-requisites for writing .NET web services?

text: I am very new to web development. I have been a C,C++ programmer for 5 years and I'm starting to get into the web development, writing web services, etc. I understand that basic concepts of web services. I know .Net web services can be written in VB or C#. Working with C,C++ will help getting used to writing code in C#. I do not have experience in .Net framework. I'd like to quickly get into writing .Net web services and learning on the go, without extensively spending a lot of time learning .Net framework (if possible) Any suggestions? Update - I know my way around databases and sql express in Visual Studio


title: What is the best strategy for transforming unicode strings into filenames?

text: I have a bunch (thousands) of resources in an RDF/XML file. I am writing a certain subset of the resources to files -- one file for each, and I'm using the resource's title property as the file name. However, the titles are every day article, website, and blog post titles, so they contain characters unsafe for a URI (the necessary step for constructing a valid file path). I know of the Jersey UriBuilder but I can't quite get it to work for my needs as I detailed in a different question on SO. Some possibilities I have considered are:   * Since each resource should also have an associated URL, I could try to use the name of the file on the server. The down side of this is sometimes people don't name their content logically and I think the title of an article better reflects the content that will be in each text file.   * Construct a white list of valid characters and parse the string myself defining substitutions for unsafe characters. The downside of this is the result could be just as unreadable as the former solution because presumably the content creators went through a similar process when placing the files on their server.   * Choose a more generic naming scheme, place the title in the text file along with the other attributes, and tell my boss to live with it.  So my question here is, what methods work well for dealing with a scenario where you need to construct file names out of strings with potentially unsafe characters? Is there a solution that better fills out my constraints?


title: Is it worth making a commit solely to resolve non-critical typos?

text: If I come across a non-critical typo in code (say, an errant apostrophe in a print(error) statement), is it worth making a commit to resolve that error, or should it simply be left alone? Specifically, I'm curious about weighing the gumming-up of the commit log against the value of resolving these non-critical typos. I'm leaning toward resolving them. Am I being pedantic?


title: WCF + N-tier = why?

text: I've seen projects that use N-tier with WCF. When creating a WCF project in the solution it is often named with the word "service?" The main questions:   Why and what benefit do you have when using WCF in relation to N-tier? Which situation should be used with WCF and N-tier?


title: Is extensive documentation a code smell?

text: Every library, open-source project, and SDK/API I've ever come across has come packaged with a (usually large) documentation file, and this seems contradictory to the wide-spread belief that good code needs little to no comments. What separates documentation from this programming methodology? a one to two page overview of a package seems reasonable, but elegant code combined with standard intelisense should have theoretically deprecated the practice of documentation by now IMO. I feel like companies only create detailed documentation and tutorials because its what they've always done. Why should developers have to constantly be searching through online documentation in order to learn how to do things when such information should be intrinsic to the classes, methods and namespaces?


title: How to identify (business) processes for automation?

text: I recently started at a company and am working on statistical data analysis and data handling (market research). A lot of my tasks were previously done entirely by hand, so I created a few tools to automate much of my work. My boss asked if I could go ahead and look for other automation-possibilities. I certainly have the time and skill, but I don't know how to find processes which would be good candidates to be automated. I could ask co-workers, but most of them don't understand what is easy to automate and what isn't. I believe that there are processes for this sort of thing - but I don't know enough to start Googling. **What comes before requirements discovery and analysis?** **How do I identify business processes that will be more efficient as automated tasks?**


title: What should I do when waiting for a review?

text: Before asking my question, I must explain the situation. I'm working for a company as a junior software engineer. One of the seniors always stops me when I have finished my development and want to commit. He always wants me to wait for him to review it. This is ok, because usually he finds some bugs, and does some optimisations. However I must commit my code before the deadline. When I finished, I call him and say it is finished. He usually comes late. So my code is late too. My question is, what should I do? Should I wait him for a review? **EDIT:** Addition to the question. I'm curious about one more issue. I want to be free when coding. How could I gain the trust for freedom of development? **Some explanations:** I've talked with him about this. But it didn't help. We use an issue tracker already, but there isn't any task for reviews. There are just development and test tasks.


title: How can I convince a project manager that there is no way to solve all the compatibility issues?

text: I have been working on this project for more than a year now, and we are close to release, the project manager wants the product to be perfect and working in every single aspect. I like that and I love working under the perfection idea, but it seems he is delaying the launch too much because of compatibility issues, he wants the product to work in every single installation, every single configuration possible, and in most cases, the product just works without issues when it's on the hands of the client. * * * UPDATE : yes the product doesn't work properly when there are conflicts, for example, other products that don't use guidelines nor standards to load libraries (causes double library load which leads to failure), cache is another example and so on..... but we warn the clients about the conflict before purchasing and help them fixing it after purchasing * * * I've tried to explain it by giving some examples on major products, he understands the situation, but can not believe that it is near impossible (if it is not impossible) to do what he wants. Hope it is clarified enough for the community to answer.


title: Experiences with WebSphere?

text: I'm going to be an intern soon at a bank (this is my first software related job) and I was told that I'm going to be working mostly with:   * Java (I already know SE)   * WebSphere   * DB2 I saw this thread at reddit recently and let's just say I cringed a bit while reading the comments. I'm currently going through Head First JSP & Servlet and using tomcat as container to get myself ahead a bit. I would like to know your experience regarding working with the above technologies. Is WebSphere really that bad of a server? or is it just the typical reddit hate for Java?


title: How does a static type system affect the design of a prototype-based language?

text: The Wikipedia article on prototype-based languages contains the following paragraph: > Almost all prototype-based systems are based on interpreted and dynamically > typed languages. Systems based on statically typed languages are technically > feasible, however. In what ways does a static type system impose restrictions or introduce complexity in prototype-based language, and why are there more dynamically- typed prototype languages?


title: What's an expat XML parser?

text: I found the term here: https://developer.mozilla.org/en/Mozilla_Web_Developer_FAQ I know what a XML parser is. I can't understand; what exactly is an **expat** XML parser?


title: If you have a piece of logic that needs to be shared between two controllers where do you keep it?

text: I have a set of single purpose functions that I need in two separate controllers. Right now I just have duplicate code and I want to get rid of it. This code is part of the controller and doesn't belong in my service layer. Where would you put it?


title: How to evaluate an open source project with joining in mind?

text: Assuming I've found an open source project I'm interested in, how do I evaluate the project(the members, the activity level, etc) to determine if joining the project will be a good use of my time and energy?


title: Does FFMpeg support gpu acceleration of media encoding/decoding?

text: I was wondering if ffmpeg supported gpu acceleration. I was reading on their websites and came across contradicting information. http://www.ffmpeg.org/general.html#Video-Codecs -H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (VDPAU acceleration) http://ffmpeg.org/trac/ffmpeg/wiki/x264EncodingGuide -Will a graphics card make x264 encode faster? No. libx264 doesn't use them (at least not yet). There are some proprietary encoders that utilize the GPU, but that does not mean they are well optimized, though encoding time may be faster; and they might be worse than x264 anyway, and possibly slower. Regardless, FFmpeg today doesn't support any means of gpu encoding, outside of libx264. If not, is there any way to add gpu acceleration to h.264 encoding/decoding?


title: "Employee morale is the employee's responsibility"

text: How true should (or does) this statement ring for developers? Many people I've talked to say "it's like this everywhere", while a similar number treat it as practically an invitation to resign. It's a bewildering statement, and I'm curious if anyone has experienced this and has ideas on how to approach a manager that holds this viewpoint.


title: "how bad" is unrelated code in try-catch-finally block?

text: This is a related Q: Is use of finally clause for doing work after return bad style/dangerous? In the referenced Q, the finally code is related to the structure used and the necessity of pre-fetching. My question is a little different, and I believe it's germane to the broader audience. My particular example is a C# winform app, but this would apply to C++ / Java finally usage as well. I'm noticing quite a few try-catch-finally blocks where there is a lot of code unrelated to exceptions and exception handling / cleanup buried within the block. And I will admit my bias towards having very tight try-catch-finally blocks with the code closely related to the exception and handling. Here are some examples of what I'm seeing. Try blocks will have lots of preliminary calls and variables being set leading up to the code that could throw. Logging information will get setup and run in the try block as well. Finally blocks will have form / module / control formatting calls (despite the app being about to terminate, as expressed in the catch block), as well as creating new objects such as panels. Roughly:                   methodName( ... )         {             try             {                 // Lots of code for the method ...                 // code that could throw ...                 // Lots more code for the method and a return ...             }             catch( something )             { // handle exception }             finally             {                 // some cleanup due to exception, closing things                 // more code for the stuff that was created (ignoring that any exceptions could have thrown) ...                 // maybe create some more objects             }         }      The code works, so there is some value to it. It is not well encapsulated and the logic is a bit convoluted. I'm (painfully) familiar with the risks in shifting code around as well as refactoring, so my question boils down to wanting to know others' experience with similarly structured code. Does the bad style justify making the changes? Has anyone been badly burned from a similar situation? Would you care to share the details of that bad experience? Leave it be because I'm over-reacting and it's not that bad of style? Gain the maintenance benefits of tidying things up?


title: How can you add acknowledgement functionality to a Command pattern, given the response from receiver is gotten asynchronously on Server?

text: I have a scenario where I will implement Command pattern like described in this article. Actually from an Asp.Net MVC view, some user will invoke different commands/actions like Start Live Video, Start Live Image, Start Recording etc. A Web Socket Server will then receive these commands and dispatch them to a Receiver (a Windows based application). The receiver before executing the requested command, will first acknowledge the received command and will confirm back to sender that the sent command has been received for processing. Note: The acknowledgement and/or the actual response will be returned to the Web Socket Server always in an asynchronous manner and then accordingly dispatched to the sender. Means whole system is event driven based. So my question is: Given the Command pattern described in the article, now which best way I could add Command Acknowledgement to it and will the returned acknowledgment and/or actual response be also in the form of some command/message or something else? If we are to go something different for dispatching the Acknowledgement or response, then which pattern to use for it?


title: Python productivity VS Java Productivity

text: Over on SO I came across a question regarding which platform, Java or Python is best for developing on Google AppEngine. Many people were boasting of the increased productivity gained from using Python over Java. One thing I would say about the Python vs Java productivity argument, is Java has excellent IDE's to speed up development where as Python is really lacking in this area because of its dynamic nature. So even though I prefer to use Python as a language, I don't believe it gives quite the productivity boost compared to Java especially when using a new framework. Obviously if it were Java vs Python and the only editor you could use was VIM then Python would give you a huge productivity boost but when IDE's are brought into the equation its not as clear cut. I think Java's merits are often solely evaluated on a language level and often on out dated assumptions but Java has many benefits external to the language itself, e.g the JVM (often criticized but offers huge potential), excellent IDE's and tools, huge numbers of third party libraries, platforms etc.. Question, Does Python/related dynamic languages really give the huge productivity boosts often talked about? (with consideration given to using new frameworks and working with medium to large applications).


title: Can non-technical staff gather requirements on behalf of the development team?

text: Working in a large organisation, it is often the case that the members of the development team are not able to get direct access to the client to gather requirements. Is it possible/advisable to give a list of questions to an account manager so that they can gather requirements on your behalf?


I see that many managers or (even CEOs) running an IT company do not perform as well as those who have IT background. If I may take an example (without judging or pointing fingers), Microsoft's current CEO is one among many. I also see this in some smaller organizations. Should a manager (or CEO) in an IT company have an IT background to perform in the organization? Will a manager that has an IT background perform better than those who do not?


title: VCS for single user using file sync service

text: I'm trying to setup a version control for my one man project. My project files are in sync thanks to live mesh (but I could be using dropbox for that matter), between my laptop, my home pc and my office pc. I'm now using Netbeans with local file history. Sometimes it helps to revert to a previous state of one file. But imagine a situation when multiple files have problems. Correct me if I'm wrong but I would have to go to every file and revert to previous "safe" state. I don't like this approach, so I'm considering using a version control between SVN and GIT. I have some previous experience with SVN (TortoiseSVN) and I know that I can create a file:// repo. So, what a want to do is setup a VCS inside my synced folder **just** to have the **ability to "revert"** to a previous version if something goes wrong. Since everything's been synced to all computers, I wouldn't ever need to run an update. The file tree organization would be the following: C:...\SyncedFolder\MyProject\ Inside MyProject folder are all the project files plus a directory that has SVN or GIT info of my project (the repo/master). What VCS is best for this situation: SVN or GIT? Does SVN need to store all files from HEAD revision, thus "duplicating" all my project inside my synced folder? Does GIT eliminates this problem? Is this the best approach?


title: how to verify ConcurrentHashMap is threadsafe?

text: As the jdk doc said, ConcurrentHashMap is thread safe and it doesn't block multiple thread read. It is not necessary to doubt that since it was under many and restricted test. But I just curious how to tell and write code to verify that. **Edited** : to be more precisely   1. how to keep read consitent without read block   2. does it return the latest view of data


title: What are options for 3rd Party Centralized Software Settings Management?

text: I am an architect in an enterprise looking to build a SaaS solution. Our products are distributed over many different deployable containers, Web Services, Web UI's, etc. I am looking for some open-source or 3rd party software solution to manage the settings of our application. These would be similar to the settings you might find in Word or Eclipse or Visual Studio. The settings would control various behaviors and features of the product. (Probably not settings like which database to connect to but more like, should I show line numbers on the page or not by default..). Ideally, we would be able to store values for different dimensions (by tenant, by user, by application environment... ) Because we have so many different deployables, I am looking for a centralized solution that can provide a web service that each of the deployables can get their individual settings from. Does anyone know of a centralized service providing this sort of features or give me some help in searching for an alternative to rolling our own?


title: Algorithm that determines relevant attributes in ordered list

text: Suppose I have a list of objects sorted by a person based on that person's subjective taste. Let's assume that this person is being somewhat consistent in their sorting and that there are quantifiable attributes of these objects that I can identify. For example, a person might sort cheese based on how much they enjoy the taste, and people who disliked salt would rank salty cheese lower than cheeses that were low salt. One person might not care what the color of the cheese was or whether it came from cows, goats, or sheep, while another might rank sheep's milk cheeses higher than goat's milk cheeses. I assume there is a procedure to identify what attributes of data elements in a list are and aren't relevant to the determining the order. What is the name for this problem, and what algorithms exist for solving it? (ideally in Python)


title: Is there a sample C project designed for comparing compiler output size?

text: I am about to start a new project and must choose a compiler. Because we are working in the embedded domain, one of the criteria that we are evaluating is the size of the output of the compiler. There are benchmarks, such as Dhrystone and Whetstone for evaluating compilers in terms of how compilers handle string, integer, and floating point functions. Is there something along these lines for providing a general comparison of the ability of compilers to produce small output files?


title: Preferred form for error detection and loop termination conditions?

text: In this Stackoverflow anwer I dimly recall being taught that it's better to use as "wide" a condition as possible to terminate a loop, rather than testing for an exact termination condition. i.e. use:               while (x < 10)       rather than               while (x != 10)      however I cannot recall (or find) any formal basis or rationale for this. Is this actually written down anywhere as best current practise?


title: Is it possible to evaluate the efficiency of a testable algorithm against alternative solutions that aren't already built?

text: An e-commerce application I used to work on used a decision tree and a rules engine for each node in order to determine if a customer qualified for certain discounts. The problem was that every promotion tree had to be evaluated, so the more promotions the client had the slower the evaluation became. This was a big problem that was often solved by throwing more hardware at it. There were alternatives to consider, but the promotions engine was a considerable undertaking. I always wondered if there was a way to consider an alternative without developing it (or developing it entirely)?


title: Android or iPhone application collecting payments

text: I'm starting to study a project that mainly will allows users to make payments from their iPhones or Androids. Since I don't have e-commerce experience and also I have never owned a smart phone, I ask you to give me some orientation on what is important when heading this kind of project. **What is making me doubt**   * Is it possible to do this witout apple or google refusing my app or charging my transactions with amounts similar to 30%?   * Is google checkout an alternative to paypal or am I getting this wrong?   * For debit card payment, what are the most common payment services in the US nowadays?   * How high is the technical complexity of that application? Is it very different to do it for iPhone and do it for Android? **What I already know:**   * The payments has nothing to do with the application itself; this is not an in-app scenario.    * We would like to go live with Android and iOS, but it would be acceptable to start with only one of them.   * No credit card information will be stored by the application; a payment gateway like PayPal should by in charge of the actual money movement. **Why Am I asking this?** Someone is asking me to develop an iOS or Android application for allowing his cutomers to add money into their customer cards. **Details of the application requeriment:**   * This service would be available only in the US.   * The application will cost a fix amount to download.    * It is initially required for iOS or Android but off course, bb's and why not wp7 could need to be supported soon. Searching stackoverflow and then the web I came to the feeling of Apple and Google being restrictive to this kind of applications, I also would like to know if it is true. **Example** I've found Starbucks' mobile app to be a very good example of what I need as the link says: _To reload the card, customers can link it to a debit, credit card or PayPal account_ I wonder if doing that is possible for any application or if there is a commercial agreement between starbucks and Apple behind. **Thanks for your help!**


title: WinRT and the server (ASP.NET, Azure, etc)

text: Has Microsoft made any indication of WinRT's current or future relationship with server development (such as ASP.NET)? While it's been made clear that WinRT is the intended future of Windows UI programming, it also includes a substantial library of common features like networking and data processing (like JSON). If these libraries are to the the future of Windows development, it seems to me like it's only natural that they will eventually move into the world of server development (WinRT is already supported by "Server 8"). (I realise that ASP.NET isn't going anywhere and that MVC, for example, could potentially be completely gutted without affecting the programming model. I'm just curious)


title: Where could SPMD parallel programming be used in a Compiler?

text: I have little knowledge about the subjects of compiler construction and parallel programming, so please bear with me. This is a course about compiler construction, and we are asked to learn CUDA while taking the course because the professor would like us to write a compiler for a simplified language. That compiler is supposed to be doing the work in parallel at some specific stages. My understanding was that the scanner, parser, semantic analyzer, code generator and the optimizer are inherently sequential. I have written some parsers for very simple tasks before, so my understanding is based on little bit of theory and little bit of experience. I would understand how to incorporate shared state at some point in the construction of the compiler to do multiprocessing, but not SPMD. **What components of a compiler can be parallelized(e.g. using CUDA as in my case, SPMD model in general)?** _SPMD_ : Single Program Multiple Data


title: What is LPCTSTR?

text: what is `LPCTSTR` and `LPCTSTR`-like (for instance `HDC`) and what it does stand for?


title: How do SaaS companies provide data liberation services?

text: # Overview I considered posting this to DBA but I think the question goes beyond the database. Of all the software-related Stack Exchange sites, the Programmers FAQ seemed most in tune with what I'm asking here. My company provides a SaaS offering. Our customers collect a lot of data using our service, and we wish to make that data more easily available to our users than our web application currently provides. Our largest customer databases can run into the tens of GB including indexes. Stripping away indexes, a single database can still be several GB and will grow with each additional year of service. The primary use cases our prospects and customers cite are:   * As a prospect/customer, I want guaranteed access to my data in the event your company should fail.   * As a prospect/customer, I want access to query my data so that I can build my own reports, dashboards, applications using that data. I like the phrase "data liberation" to classify these kinds of use cases. Google seems to be at the vanguard of the data liberation movement. They've done admirable work to enable their customers to get access to their data and to raise awareness of the state of SaaS data accessibility. As a SaaS provider, I'd like to give our customers better access to their data. # The Evolution In the past, we developed many custom report-like web pages to give customers a degree of access. This led to a lot of complex, custom pages that we must maintain. We later added a separate reporting solution and began charging for custom reports. Although this gives us more flexibility and we can deliver faster, this is also costly to maintain and not scalable. Customers also don't like being charged for every custom report, as they see it as us charging them for access to data they own. While we are meeting the needs of some customers, others want more. Some want to combine their SaaS data with in-house data, and they can't do that without the ability to query their SaaS data. There are many approaches to solving these problems. I'll talk about the two use cases and approaches I've considered, then ask for your input. I'm going to willfully avoid the question, "How useful is the data without the application?" Side Note: Our database is Microsoft SQL Server, but that's largely irrelevant. # Use Case 1 _As a prospect/customer, I want guaranteed access to my data in the event your company should fail._ ## Host Our Own Download Service A relatively easy solution would be to set up our own download service on a separate server hosted in the same data center. We'd put nightly database backups here for every customer to download at their leisure. Pros:   * We use free internal bandwidth to move files around.   * Customer only incurs bandwidth costs when they want to download. Cons:   * Some customers may download nightly "just because we can".   * Provisions must be made to keep the download service operational in the event the company fails, otherwise we've solved nothing. The customer still has to trust us to keep this service running, which is the core issue in the first place. An extreme variation of this model is to create a separate company to own the download service and pre-fund the hosting for a period of time sufficient to allow customers to download their last backup. ## Push Database Backups to the Customer Here we copy full nightly backups to a storage account or service (FTP over SSL, SFTP/SSH, Dropbox, Box.net, SkyDrive, Amazon S3/Glacier, etc.) of the customers' choosing. Pros:   * Customer always has access to their data. Cons:   * This method is bandwidth intensive and wasteful. We're pushing mostly the same data, night after night. The customer only needs the data in the event of a catastrophe.   * This method runs the risk of losing up to 24 hours of the customers' data if we only copy nightly backups. Copying periodic diff backups would help to reduce the recovery point objective at the expense of more bandwidth.   * Managing all the possible destination types, auth credentials and integrating new targets is complex. A less complex variation is to require our customers to provide credentials to a storage service of a single type, like Amazon Glacier. Everyone uses Glacier, or you don't benefit from the service. ## Third-Party Backup Tie-In There are services out there like Backupify that hook into Google Apps and back up data on a regular basis. I'm seeking out more services like this which could provide an independent, turn-key solution that our customers could sign up and pay for, and which we could fully automate. Unless the third party service ties into SQL Server in an intelligent way to only pull data differences from night to night, this is still going to be bandwidth intensive. ## Native Database Replication There are several built-in SQL Server features of interest, such as log shipping, mirroring, replication and "always-on availability groups". These all require a SQL Server on the remote side, as well as requiring the remote server be joined to a single domain and/or be part of a Windows Server Failover Cluster controlled by us. These methods therefore don't seem viable for this use case. # Use Case 2 _As a prospect/customer, I want access to download and/or query my data so that I can build my own reports, dashboards, applications using that data._ ## Web API Providing a comprehensive REST or SOAP/XML (or both) API would help some, but not most of our customers. Many customers really want some kind of SQL access, through ODBC/JDBC/ADO.NET or the like. ## Open Data Protocol (OData) We could expose denormalized data sets and present them using OData (see also SO questions on OData). However, being newish (1) I'm not sure OData will become mainstream enough to warrant a long-term investment and (2) it may be challenging for our customers to both understand and access. I'm not married to this opinion. I do know that the PowerPivot plugin for Excel 2010 can connect to OData sources, and Tableau (a tool at least one customer users) can as well. That's promising. ## Data Replication We've experimented with using Microsoft SQL Server transactional (pub/sub) replication of de-normalized subsets of data with a couple of customers. This requires VPNs and DBAs, making it complicated to set up and maintain. The dependence on SQL Server isn't ideal. ## Third Party Connectors I've researched and found a couple of companies who provide offerings around opening SaaS data to end customers.   * Connection Cloud   * Progress DataDirect Both companies have products that would seem to enable exactly what I'm looking to do. These are the only two providers I've found so far. I'm talking to representatives from both companies to evaluate their offerings. # The Question How have you solved your own customers' "data liberation" problems?


title: Why did the Haskell committee choose monads to represent I/O?

text: The Clean language uses uniqueness types to handle I/O in a purely functional setting. Why did the Haskell committee go with monads instead? Were there other proposals for handling state that the committee investigated but decided against? **Note** : I'm not looking for a holy war between monads and other forms of computing. Let's keep the topic to just the committee's choices regarding I/O.


title: Creating webservices using spring-mvc. One project or multiple projects

text: Using spring mvc to create a restful api, Maven is build tool and tomcat with spring jars is deployment . **Plan A** : each webservice will be its own separate war file/project ? if required I would supply dependices as jar(s) (such as any dao's/dto's/service layer classes used in different webservices? I would share the spring jars between projects from with tomcat lib directory. **Plan B** : Have one large project with different controllers (and subsequent request mappings for restful api) added when needed. Supply the spring dependices with project in maven. Which is better ? I'm aware spring is not jax-rs compliant - what does this mean in practice, whats the difference if not compliant ?


title: How important is self-teaching in the programming field?

text: I'm 16. I started programming about a year ago when I was about to start high- school. I'm going for a career in programming, and I'm doing my best to learn as much as I can. When I first started, I learned the basics of C++ from a book and I started to learn things by myself from there on. Nowadays I'm much more experienced than I was a year ago. I knew I had to study by myself because high-school won't (likely) teach me anything valuable about programming, and I want to be prepared. The question here is: how important is it to study programming by oneself?


title: Estimate cost of project depends on [SLOC|COCOMO]?

text: Is it logical to estimate cost of project depends on source lines of code? Like those calculated reports from tools such as   * sloccount   * ohloh estimating   * * How to convince [somebody|employer|client] to pay depends on those reports ? The weird things come to scene when I see something like $83,862 based on my project. Sometimes the developer [him|her]self would write more lines of code because of this estimating. So if the count of the source lines isn't worthy, Why should be [sometimes|somehow] interesting part of development, Specially for employer, It does amaze them but why doesn't have any effect on pricing ? Hey _Employer_ I've developed this project that worth $1 million dollars, This source code counter program will prove it. Maybe I don't know the real worth of my work, Should I public it for people and collect some comments about it or show it to some [experts|consultants] to find-out or just estimate myself upon my knowledge, And all of these solutions aren't right or at least logical. And what happens to those codes I didn't wrote by myself, I mean sometimes we just copy a piece of code and [pasted|modified] into project. And if estimating in this way is wrong, What is the purpose of these tools to generate such a report about source lines of code, Average hourly work and other facts. Ohloh : > **Estimated Cost** > > We calculate the estimated cost of the project using the Basic COCOMO model. > For those familiar with the details, we are using coeffcients a=2.4 and > b=105. > > Estimate still seems way off? > > Software cost estimation is tricky business even when all the variables are > known (which we certainly don't have). One thing to remember is that COCOMO > was created to model large institutional projects, which often don't compare > well with distributed open-source projects. Beyond just development time, > COCOMO is meant to include the design, specification drafting, reviewing and > management overhead that goes along with producing quality software. > > This model seems to be most accurate with mature, large projects. Young > projects with little activity are typically overvalued. _I know quote from ohloh isn't just about SLOC_


title: Should an application be designed without prototyping first?

text: I've just begun using a popular, well-documented graphics engine, and was given a month to create some small programs and get familiar with it. The library is huge, and there are sections I haven't explored. Due to a time-crunch, my tech-lead has asked me to start designing my software ( _sequence and class diagrams_ ) even for the parts I haven't explored, just by looking at the documentation and figuring out the capabilities of those classes. It's my understanding that designing software requires good knowledge of how something works. Does it make sense to create a design with only a vague understanding of how a class works, just by looking at the class's documentation? Shouldn't I be prototyping it with a small program, tweaking it here and there and understand how it behaves and THEN do the design for it?


title: Where should instantiated classes be stored?

text: I'm having a bit of a design dilemma here. I'm writing a library that consists of a bunch of template classes that are designed to be used as a base for creating content. For example:               public class Template     {         public string Name {get; set;}         public string Description {get; set;}         public string Attribute1 {get; set;}         public string Attribute2 {get; set;}              public Template()         {             //constructor         }              public void DoSomething()         {             //does something         }         ...     }      The problem is, not only is the library providing the templates, it will also supply quite a few predefined templates which are instances of these template classes. The question is, where do I put these instances of the templates? The three solutions I've come up with so far are: ## 1) Provide serialized instances of the templates as files. On the one hand, this solution would keep the instances separated from the library itself, which is nice, but it would also potentially add complexity for the user. Even if we provided methods for loading/deserializing the files, they'd still have to deal with a bunch of files, and some kind of config file so the app knows where to look for those files. Plus, creating the template files would probably require a separate app, so if the user wanted to stick with the files method of storing templates, we'd have to provide some kind of app for creating the template files. Also, this requires external dependencies for testing the templates in the user's code. ## 2) Add readonly instances to the template class Example:               public class Template     {         public string Name {get; set;}         public string Description {get; set;}         public string Attribute1 {get; set;}         public string Attribute2 {get; set;}              public Template PredefinedTemplate         {             get             {                 Template templateInstance = new Template();                 templateInstance.Name = "Some Name";                 templateInstance.Description = "A description";                 ...                 return templateInstance;             }         }              public Template()         {             //constructor         }              public void DoSomething()         {             //does something         }         ...     }      This method would be convenient for users, as they would be able to access the predefined templates in code directly, and would be able to unit test code that used them. The drawback here is that the predefined templates pollute the Template type namespace with a bunch of extra stuff. I suppose I could put the predefined templates in a different namespace to get around this drawback. The only other problem with this approach is that I'd have to basically duplicate all the namespaces in the library in the predefined namespace (e.g. Templates.SubTemplates and Predefined.Templates.SubTemplates) which would be a pain, and would also make refactoring more difficult. ## 3) Make the templates abstract classes and make the predefined templates inherit from those classes. For example:               public abstract class Template     {         public string Name {get; set;}         public string Description {get; set;}         public string Attribute1 {get; set;}         public string Attribute2 {get; set;}              public Template()         {             //constructor         }              public void DoSomething()         {             //does something         }         ...     }      and               public class PredefinedTemplate : Template     {         public PredefinedTemplate()         {             this.Name = "Some Name";             this.Description = "A description";             this.Attribute1 = "Some Value";             ...         }     }      This solution is pretty similar to #2, but it ends up creating a lot of classes that don't really do anything (none of our predefined templates are currently overriding behavior), and don't have any methods, so I'm not sure how good a practice this is. Has anyone else had any experience with something like this? Is there a best practice of some kind, or a different/better approach that I haven't thought of? I'm kind of banging my head against a wall trying to figure out the best way to go. Thanks!


title: How should I encapsulate database access?

text: What are some examples of good class structures used to manage database access? I am a fan of class encapsulation and would prefer the containers (e.g. car) not to perform database tasks. I would also like the ability to easily drop in things like a database cache in future. I often take the pattern of container classes, complete with getters and setters for validation and database access performed by a single singleton class. That being said, this often gets mixed between the two and becomes quite confusing. Sorry if my question is hard to understand; I'm not absolutely sure on terms regarding databases. Please feel free to ask for clarification if needed.


title: Is software development an engineering discipline?

text: Can software development be considered engineering? If no, what are the things that it lacks in order to be qualified as an engineering discipline? Related to this is this question on Stack Overflow about the difference between a programmer and a software engineer. There is the Software Engineering Institute at Carnigie Mellon University that prescribes and maintains the CMMI standards. Is this something that will turn development into engineering?


title: What is the difference between UML Data profile and ER model?

text: I have been asked this question and even after a lot of research, I cannot find the answer. When I design a database using Entity relationship (ER) and then re-draw it as UML class model (extended with Data modeling profile for UML), what are the differences and how both models can be (in their way) useful for db developer? With regard to multiplicity, foreign keys..


title: Why don't compilers support non-English keywords?

text: When you read C, C#, Java, Python, PHP and many other programming languages all the syntax is written in English. Simple code like this               if (X+1 > 4) {     }     while (A == true) {     }      Is written in English even if the programmer's native language is something else. Would it not be more effective to allow the programmer to use their own native language in the source code, like this (my bad Spanish so forgive me if it's wrong)               si (X+1 > 4) {     }     mientras (A == verdadero) {     }      There is no technical reason why a compiler or parser should be _stuck_ with it's syntax hard coded. Any developer who has done internalization knows there are many easy ways to support other spoken languages. You can run most IDE platforms in different languages. Yet, the programming language the developer is using is stuck in English. Why have none of the major languages added support for language packs?


title: What are the names for various forms of camel-case style naming?

text: For the purposes of communicating coding styles to my co-workers, what would I formally call the following variants of camel case? > camelCase and > CamelCase Notice that the former version starts with a lower-case alphabetic character, and the latter version starts with an upper-case alphabetic character. I assume these have some sort of "official name". Also if there are any other forms I have not listed here, bonus points to those that mention them as well as well as their names.


title: Scripting language for filling out web form

text: I have a job as an intern at a technology company, I was given the unfortunate job of performing some data entry into our web management system. The information entered into the web form is stored in a MySQL DB. Upon receiving the data I realized I would have to submit this online form about 1000 different times all consisting of about 10 different text fields / check boxes per form. (So in other words, would be completely mind numbing and be a ridiculous waste of time and resources, or so I thought...) Having used databases a good bit prior to this, my immediate reaction was to just write a short MySQL script to bulk import all of the data, especially since it was already presented to me in an excel spreadsheet ready to go. Thought it may have been some sort of a test since it seemed too obvious. I wrote the script which consisted of about 10 lines of code but was then informed I couldn't be trusted with MySQL Admin privileges to run said script. So my next thought would be to write a script to just enter the information through the web form (Which will take ten times longer but it's what I have to) Being unfamiliar with scripting of this nature (seems like I would need something similar to a bot, but the good kind) I was unsure of how to proceed to do this. Is there a preferred language to use to enter the data i have into the web form I do have access to? I'm not particularly looking for this to be done for me by any means just a nice point in the right direction as far as what scripting language to use and how to pair that with the data I have that needs to be entered. Thanks for the help/ valuable input! **EDIT:** Is there a way to perform this using perl without having access to place any files on the server? Would I be able to run some Javascript loops to pull the data out of .csv or just a .txt format with line delimiters and insert it into the web form?


title: Is it ok to use localized character encodings for code?

text: Is it ok to use a localized encoding (i.e. ISO-8859-15) instead of ANSI/UTF-8/some standard for code? What when you have names that do not translate very well into english code? Or when your company and your customers are (and always will be) local and not international, like governments? And what about using special characters like people in almost all countries have? What do you think, what encodings do you use?


title: Licensing systems for software

text: I'm writing an application that will be made available for sale. I'd like to have a system to ensure that customers have paid to use the software. The variables to consider are: 1) Number of users in an organisation 2) Facilities available in the application to the users 3) Licensing period - ie one month or one year Are there any free or commercial offerings that can be used to help with this? What are the best practices for this kind of thing? What else should I be considering? My initial idea is to have a block of encoded text which is either emailed, or downloaded. The contents of the block of text would include a unique number for the PC, end date, facilities etc. I guess I would need a server somewhere to control the number of licenses for an organisation.


title: Developing BlackBerry app with 3rd party content

text: I'm working on a BlackBerry app, however I'm loading data from various 3rd party websites around the web. (E.g, posts from stackoverflow or currency rates off Yahoo.com) I'd like to know if this could cause any trouble, would it be allowed? Thank you!


title: Can someone who studied web easily switch to software

text: I'm applying to university _very_ soon, and I have my mind set on programming. I narrowed down my program options to **Web Services and Applications** , **Computer Applications** , and **Computer Games**. I'm leaning towards Web, since I've been developing for Web since college. **Question** So, my question is, would it be very difficult to switch career path from Web to Software for example should I find years from now that I would have preferred a different career path? **Note** The three programs are all part of a Bachelor of Computer Science and seem to share the same basic courses.


title: Should programming schools be more competitive?

text: There have been several postings on P.SE about lower quality programming education, and this post from Joel on JavaSchools shows his frustration with the way computer science is often taught. At many art and music schools, only the best students are allowed to continue their education. They only accept a limited (call it x) number of students, and if you are not in the top x students, you don't continue. Contrast this with computer schools, where if you get a C, or a B in my school, you go on. Should computer science schools have a similiar program? What are your feeling regarding such a program? EDIT: In reply to the posts who say that graduating from a top school does not guarantee a good career: I don't think it should. My question has to do with how you be sure that the people who do graduate from any school - Ivy League or not - have reached the level of proficiency that a degree is supposed to show.


title: I need to develop a parser. Can I use Lex and Yacc for the purpose?

text: I need to extract very particular data from log files(of different types and formats). Since I am a recent college passout; my mind ran to using Lex and Yacc for the purpose. Now I have the **following Questions** **1.** Will it be legal to do so ? (This product I am working for belongs to one of the biggest tech companies in the world.) **2.** Also ; I would like to know if I am being too afraid to write my own parser? **3.** How can I use Lex and Yacc if my product is Windows based? Please tell me if you need any clarification or extra information.


title: Why isn't Radix Sort used more often?

text: It's stable and has a time complexity of O(n). It should be faster than algorithms like Quicksort and Mergesort, yet I hardly ever see it used.


title: Fixing bugs may lead to delayed feedback

text: I worked in a group in Microsoft that developed the upgrade to the Microsoft Security Essentials antivirus. For a year we worked on the next version of the product. We had 6 milestones (milestone each two months). Most of the features were developed in the first few milestones, and for the second part of the year these features were refined and bugs were fixed. Each milestone a larger portion of users (subscribed to the various alpha/beta programs) would get the product and provide feedback. I was told by the program managers in the project that the advantage of this approach is that there is more time for potential users to give feedback on the features, so it is preferable to ship all the features as soon as possible. However Scrum doesn't advocate this approach. In Scrum are you advised to deliver completely tested and functional piece of software and not half baked and brittle features. This approach has various benefits, but it also has some drawbacks. One of them is that feedback is delayed. So which approach do you prefer and why?


title: Should I save a simple list cookie in Javascript or PHP?

text: I am currently making a simple list tool. You can click a checkbox to mark it as done and if you navigate away from the page/close the browser and reload, it will still be saved. So it's pretty much just a visual difference. For this, I'm wondering, should I use PHP or Javascript to set a cookie to save the data on whether or not the item was checked? If not, should I use `$_SESSION`? I haven't been able to find a simple solution relevant to my concern, from my searches almost all of them are related to saving usernames/passwords, which of course have an added security aspect too. Thanks.


title: Are Nassi-Shneiderman diagrams actually used?

text: I learned about them in a Structured Programming course, but never saw them used thereafter either at the analysis phase or for documentation purposes. Not even for highly structured languages like Pascal (Delphi).   Does any of you actually use Nassi-Shneiderman diagrams? If yes, what tools do you use to create/maintain them?   **edit:**   Or have you never heard of them?


title: Is using YouTube a good, inexpensive solution to building a website that requires users to post videos?

text: I'm diving into web development after ten years of desktop development and I have an idea for a Rails website that will rely on users posting short videos (5 -15 mins) they've recorded. The website will be ad-supported and probably won't generate enough revenue to support hosting video based on how expensive I understand it to be, so the idea I had was to allow users to specify a link to the video they recorded and have posted on Youtube. This way, YouTube funds all the resources (storage, bandwidth, etc.) needed for the videos and I simply embed them in my website. My questions are...   1. Is it worth the poor design choice to separate the user's content service provider (in this case, YouTube) from my website in order to save the money it would cost me to host the videos myself?   2. Is there an inexpensive way for me to host the videos myself if the answer to my first question is "No!"?   3. If it's not a bad idea, do you see any other potential problems with this approach? I apologize if this question is absurd in any way, I'm still getting familiar with the workings of web businesses. Thanks so much in advance for your wisdom, I'm going to continue researching my questions right now.


title: Does a team of developers need a manager?

text: **Background:** I'm currently part of a team of four: 1 manager, 1 senior developer and 2 developers. We do a range of bespoke in-house systems / projects (e.g. 6-8 weeks) for an organisation of around 3500 staff, as well as all the maintenance and support required from the systems that have been created before. There is not enough of us to do all the work that is potentially coming our way - we're understaffed. Management acknowledge this, but budget restraints limit our ability to recruit additional members to the team (even if we make the salary back in savings). **The Change** This leaves us where we are now. Our manager is due to leave his role for pastures new, leaving a vacancy in the team. Management are using this opportunity to restructure our team which would see the team manager role replaced by another developer and another senior developer. Their logic being that we need more developers, so here's a way of funding it (one of the roles is partially funded from another vacant post). The team would have no direct line manager and the roles and responsibilities would be divided up between the seniors and the (relatively new to post) service manager (a non-technical role with little-to-no development knowledge/experience whose focus is shared amongst a number of other teams and individuals) - who would be our next actual manager up the food chain. I guess the final question is: **Is it possible to run a development team without an manager?** Have you had experience of this? And what things could go wrong / could be of benefit to us? I'd ideally like to "see the light" and the benefits of doing things this way, or come up with some points for argument against it.


title: OOP (php) for beginners - some unclarities

text: I started reading some tutorials about OOP, because I want to learn the basics. I have a question about it. I understand how you can have a object "Car" and give it a color like this $oCar->setColor("white"); But there are some things unclear to me. Let's say I have a database with all kinds of cars. What is the best way to create the object "car"? A SQL-query instead the class? And the other question is: how can I output a list of all cars? Do I need to create a object called "Garage" with has only one method within that selects all the cars from the database? Or does this kind of method belong in the "Car" object?