title: What are the pros and cons of having a CaseInsensitiveString type in Java?

text: I'm tempted to create a `final class CaseInsensitiveString implements CharSequence`. This would allow us to define variables and fields of this type, instead of using a regular `String`. We can also have e.g. a `Map<CaseInsensitiveString, ?>`, a `Set<CaseInsensitiveString>`, etc. What are some of the pros and cons of this approach?


title: Who should pay for fixes/bugs?

text: So I just started freelancing both in desktop/web development and this client who already accepted my work, and payed me keeps coming back at me each time he finds a bug etc. And I have found myself spending more time than I thought fixing them for free. Is this alright, or should I start charging a support fee? Which is the best way to deal with fixes on a supposedly accepted and completed work?


title: Keeping SQL Server DB Up to date in Team environment

text: We are working in a Visual Studio Environment using TFS. When developers get the latest source code it includes a copy of the 'update' sql scripts for the database of the application. The challenge is keeping our local copies of the DB up to date. When changes are made to the DB by another developer, we are looking for a way to:   1. indicate to other developers that their version of the DB is out of date   2. indicate to other developers the order in which they should run the update scripts We are looking for suggestions. For point number 2, I have used numbers such as 01_DropCreate_TableX, 02_Create_StoreProcedure_X. etc DH


title: Picking powers of two for sizes/limits

text: A habit I've observed among programmers, and a habit I sometimes subconsciously exhibit myself, is to pick powers of two (or powers of two minus one) when defining a database schema, a data buffer, etc. Have you made the same observation? If I'm not being blatantly subjective, the follow-up questions are: Are there still valid reasons to use powers of two [minus one] in modern technologies? Assuming these habits are mostly vestiges of old technological limitations, I'm just wondering what different flavors of limitations there once were. Some potential reasons I can think of are data structure optimizations and addressing bits. I'm wondering what else was/is out there...


title: Multi-module web project with Spring and Maven

text: Assume we have a few projects, _each_ containing some web resources (e.g., html pages).               parent.pom      +- web           (war)      +- web-plugin-1  (jar)      +- web-plugin-2  (jar)      ...      Let's say `web` is the deployable `war` project which depends on the known, but selectable, set of plugins. What is a good way to setup this using `Spring` and `maven`?   1. Let the plugins be `war` projects and use mavens **poor** support for importing other `war` projects   2. Put all web-resource for all plugins in the `web` project   3. Add all web-resources to the classpath of all `jar` `web-plugin-*` dependencie and let spring read files from respective classpath?   4. Other? I've previously come from using `#1`, but the `copy-paste` semantics of `war` dependencies in maven is horrible.


title: How can one find software development work that involves directly the final end user?

text: I've worked in software development for 15 years and, while there have been signficant personal achievements and a lot of experience, I've always felt detached from the man/woman-on-the-street, the every day person, how it affects their lives, in a number of ways:   * the technologies: embedded software, hidden away, stuff not seen by the everyday person. Or process technology supporting manufactured products   * the size of the systems, meaning many jobs, divided up, work is abstract, not one person can see the whole picture   * the organisations: large, with departments dealing with different areas, the software, the hardware, the marketing, the sales, the customer support   * the locations and hours: out-of-town business parks away from the rest of society, fixed locations, inflexible: 9-5 everyday This to me seems typical of the companies I worked for and see elsewhere. Granted, there are positives such as the technology itself and usually being among high calibre co-workers, but the above points frustrate me about the industry because they detach the work from its meaning. How can one:   * change these things in an existing job, or compensate for them?   * find other work that avoids these and connects with the final end user? Job designs tend to focus on the job content and technical requirements rather than how the job aims to fulfil end user needs, is meaningful.


title: Would this be the equivalent of creating a branch, while working with a detached head in Git?

text: Let's say I checked out a version different than HEAD. Let's say I made some commits, and so an anonymous branch was created. Afterwards I may have checked out a different branch, so now the only way to get to my commits is via `reflog`. If do this:               >> git reflog | grep -i mycommit     sha1hash     >> git branch reattaching     >> git cherry-pick hash_of_commits     >> git checkout master     >> git merge reattaching      Is it the equivalent of:                  >> git reflog | grep -i mycommit         sha1hash        >> git branch reattaching sha1hash        >> git checkout master        >> git merge reattaching      What happens to the detached head commits, as I think that via cherry-picking, they will exist in 2 places. Will they forever remain in my repository?


title: Thoughts on Development using Virtual Machines

text: I'll be working as a development lead for a startup and I've suggested that we use VMs for development. I'm not talking about each developer having a desktop with VMs for testing/development, I mean having a server rack where all VMs are managed and have the developers work from a microPC (ChromeOS anyone?) locally, or even remotely from their home computer. To me, the benefits are the fact that it's extremely scalable, cheaper in the long run, easier to manage and that we utilize the hardware its maximum potential. As for cons, I can't think of any particular showstoppers other than we'll need someone to setup/maintain said setup. I was hoping that some of you might of had a similar setup at your place of employment and be able to weight in with your opinions. Thanks.


title: Boss wants to convert all developers to virtualized desktops

text: > **Possible Duplicate:**   >  Thoughts on Development using Virtual Machines My boss has been singing the praises of leveraging virtualized desktops for all our developers in the company - about 100 people. I think this is a horrible idea and can think of no other companies pursuing a similar course of action. He believes that he can run Word and Outlook much faster over his server hosted virtual machine and has somehow come to believe that this will work for software development just as well. I have grave doubts of this. **Can anyone else provide me with some objective technical and/or business data on this scenario which can be used to dissuade him?** I can see desktop virtualization as a viable option for task based workers who sit in front of MS Office or a LOB app all day, but for software development, I see this as a huge potential blunder. I for one, have no interest in returning to dumb terminals and blind faith in operations to keep the servers and network tuned to our needs. If such a system is instituted, I may very well leave the company... as I see the policy betraying a clear lack of understanding and a diminished perception of value in what the devs are doing...


title: Leading a team, am I being overbearing?

text: I'm in what seems to me a very strange position. I'm "team lead" in role for a particular project, Sr. Software Engineer in job title. On my team I have 4 developers, one of whom serves a similar role on another project but now mine has been given priority so he's working on mine. I also have 2 testers, one of whom is a Manager. Another member of the team is the "Customer Representative" who is a part of a completely unrelated department. I also have a Manager who is directly above me and I believe also above the Manager of Test that's part of my team...not so sure about that though. I've tried to get clarification on why my role is exactly several times. It's been hard for me to figure out where my authority begins and ends, if I even have any. The answer I'm currently working with is that I am "technical lead" of the team. This seems to mean that my authority is over technical decisions regarding architecture, design, and process/coding standards as they pertain to the product code itself. Today something came up and the results of code I delegated to one of the members of my team where shown to the rest of the company in our Scrum show- it-all-off meeting. The customer representative person does the showing off. Something was shown off today that I really disagreed with and nobody had ever even asked me if I wanted to have a say in what happened. In short, in order to provide the ability of a user to display a value in a report in the following manners ("doc" units, design units, rounded, not rounded) they provided access fields for each permutation. Thus we have the value in rounded doc units, rounded design units, unrounded doc units, unrounded design units. Each record that the user will be wishing to work with has many such values and each one is permuted in this manner. I really hate this. The people we showed this to want to make sure that the API we use for reports is the same as the way we do things like export data to Excel. Unfortunately, now we're gaining this momentum in a direction that I think is really, really bad. I did get a little upset at the next meeting and I asked the two people who'd done this, "Why wasn't I involved in this decision??" It's an issue that keeps coming up and I have a hard time it seems to just get people on the team I'm supposed to be leading to ask me if I want to be involved. Sometimes I do not and I think whatever they come up with will be fine. Other times I do. Unless people ask me though it's hard to even know that something is going on that needs my input and they don't give me that opportunity. Unfortunately, my authority doesn't extend to telling people, "Next time you go off and do something like this on your own without even talking to me, you're going to be disciplined." That's a "PR" issue that is one area that's quite clearly not in my scope of authority. That's fine with me actually since I don't want to have to deal with that kind of crap if someone else is willing. Today though, my manager, in front of everyone (which I guess is partly my fault too for bringing it up like that) told me that I can't be involved in every decision and need to delegate. I of course think I'm right....I always do. I don't say things I think are BS. I think I should have been approached about this issue and asked if I had a better idea. My direction for this would have actually been to just decide on ONE value to provide for now, since this was actually the very beginning stages of a new feature, and discuss options for providing further access in the future if so desired. I never would have approved of or recommended the current implementation and I really don't think it should have seen the light of day. The question is, am I the one being unreasonable? * * * Well, the two of us talked about it and agreed that we both "dropped the ball" and we seem to be on the same page. Monday mornings... We're going to try to make sure my role is clear in the team and that yeah, I get to decide when there's a design or task change that needs to happen; I get proposed to and either agree or decide I need to look deeper. Then there are some other bits I can try to work on to make sure they know that they can come to me.


title: License key solution in web application, what is the best approach?

text: I am stumped by a request from my manager. I work for a small startup and we developed a web application for a fixed rate with a maintenance agreement for a MUCH larger company. Knowing horror stories about how large companies will only pay their bills to the last second we decided that we would like to protect ourselves by being able to license this web application in a way that if we don't get paid the software no longer works. I have seen this done before for desktop applications however this will be a web application that they will host internally and will not be accessible from the Internet. What is the best approach to do this, we would like it to have a small footprint and would like the ability to renew the license key that they have distributed. Has anybody done something similar? Are we completely out of our minds? Does anybody have any better suggestions?


title: Specific reasons why a top left origin is better/worse than a bottom left origin for computer graphics

text: I have been researching why the origins for most graphic applications are located in the top left corner of the screen. From everything I have read, they are located there because that is where the electron gun on a cathode ray tube would start to scan, from top to bottom. _Other than this historical reason, is there any usefulness to having the origin in the upper left hand corner versus (which is personally more natural to me) the bottom left hand corner?_ From my knowledge, I can't think of any reason that one origin might be more useful than the other. In terms of math, I don't think it should make any difference, as long as the relation between the pixels/point in the image stay the same you should be able to apply any mathematical transformation in the same way using either origin. I am specifically looking for examples that show why it would be better to use one origin over the other, and not just for the reason that "this is the way it was done before" or "its easier this way because device x uses it" because all of those reasons relate back to the historical reason.


title: Alternatives to the use of the Id/Name properties with non-inputs elements in HTML

text:
I'm migrating a website that use Javacsript/HTML/PHP using reusable javascript code, in certain moment I saw the opportunity to simplify code in functions that use almost the same code. **Let's say** : _I want to display values from the database into various`<span>` or `<div>` elements using AJAX. all the referred elements use the same layout to display the data, the difference only resides in the element id or a minimal procedure to validate data._ **That's all.** However, I quickly came to the conclusion that I don't have a way to refer a specific element in HTML without use the `id` property, and the only alternative that I think was the use of `name` property. I know that this property it's only for `<input>` in a `<form>`,and because this elements are not `<input>` this rule doesn't _apply_ ( _I know that in HTML the rules are not enforced_ ). The basic idea is to stop using `id`s to make my code more reusable. To pass from this:
       +---
       |     +---       +---
             +---
       +---
       |     +---       +---
             +---      to this:
       +---
       |     +---       +---
             +---
       +---
       |     +---       +---
             +---      Doing my code in this way, i think will break the HTML5 conformity rules. I know this isn't a problem _per se_ , because I have solved in not orthodox way, but I want to hear what is the best way to deal with this situations. I know that exist a question related HTML - Alternative for ID when ID is only unique within a certain scope? but in this case I don't want to deal with classes and CSS rules because the current page is using a lot of CSS and there are a lot Javascript function in the page that manipulates the CSS class, using Class as kind of identifier, I think would lead to some bugs (but not so sure).


title: Why would someone use @Native annotations?

text: link : http://download.java.net/jdk8/docs/api/java/lang/annotation/Native.html In Java 8, there will be @Native annotations. > Indicates that a field defining a constant value may be referenced from > native code. The annotation may be used as a hint by tools that generate > native header files to determine whether a header file is required, and if > so, what declarations it should contain. Problem is: **What for?** Do you have any idea on which problematics would be efficiently solved by this feature?


title: Recommened design pattern to handle multiple compression algorithms for a class hierarchy

text: For all you OOD experts. What would be the recommended way to model the following scenario? I have a certain class hierarchy similar to the following one:               class Base {        ...     }          class Derived1 : Base {        ...     }          class Derived2 : Base {        ...     }     ...      Next, I would like to implement different compression/decompression engines for this hierarchy. (I already have code for several strategies that best handle different cases, like file compression, network stream compression, legacy system compression, etc.) I would like the compression strategy to be pluggable and chosen at runtime, however I'm not sure how to handle the class hierarchy. Currently I have a tighly-coupled design that looks like this:               interface ICompressor {        byte[] Compress(Base instance);     }          class Strategy1Compressor : ICompressor {        byte[] Compress(Base instance) {                // Common compression guts for Base class           ...           //                if( instance is Derived1 ) {              // Compression guts for Derived1 class            }           if( instance is Derived2 ) {              // Compression guts for Derived2 class           }                // Additional compression logic to handle other class derivations           ...        }          }      As it is, whenever I add a new derived class inheriting from Base, I would have to modify all compression strategies to take into account this new class. **Is there a design pattern that allows me to decouple this, and allow me to easily introduce more classes to the Base hierarchy and/or additional compression strategies?**


title: Best practice for storing HTML coming from text fields to a database?

text: I have an application that allows users to edit certain parts of text and then email that out. My question is what is the best way to store this in a Microsoft SQL Server database. Right now I have two tables, one holding the HTML data and one holding the plain text data. When the user saves the info, it replaces newlines with br's and puts it in the HTML-conntaining table and then puts the regular text in the other table. This way the text box has the newlines when they go to edit, but the table that contains the HTML data, has the BR's. This seems like a silly way to do things. What would be the best practice? Thanks.


title: Sharing business logic between server-side and client-side of web application?

text: Quick question concerning shared code/logic in back and front ends of a web application. I have a web application (Rails + heavy JS) that parses metadata from HTML pages fetched via a user supplied URL (think Pinterest or Instapaper). Currently this processing takes place exclusively on the client-side. The code that fetches the URL and parses the DOM is in a fairly large set of JS scripts in our Rails app. Occasionally want to do this processing on the server-side of the app. For example, what if a user supplied a URL but they have JS disabled or have a non-standard compliant browser, etc. Ideally I'd like to be able to process these URLS in Ruby on the back-end (in asynchronous background jobs perhaps) using the same logic that our JS parsers use WITHOUT porting the JS to Ruby. I've looked at systems that allow you to execute JS scripts in the backend like execjs as well as Ruby-to-Javascript compilers like OpalRB that would hopefully allow "write-once, execute many", but I'm not sure that either is the right decision. Whats the best way to avoid business logic duplication for apps that need to do both client-side and server-side processing of similar data?


title: Why does the C library use macros and functions with same name?

text: I am reading 'The Standard C Library' by PJ Plauger which is really interesting. The book explains not only how to USE the library but also how it is implemented. I have finished reading the `ctype.h` section and in the header the functions are declared as both macros AND functions. For example               int isdigit(int);      but also               #define isdigit(c) (_Ctype[(int)(c)] & _DI)      I don't understand why BOTH are used? Also, if I try to recreate my own custom `ctype` header and implementation, I can only compile successfully if I remove the macro (comment out the define). This aspect was not really explained in the book. Can someone please explain?


title: DI or Factory Pattern ? Both ? or a different apprach?

text: Lets say we have an abstract class called `BaseSwitch`, inherited by concrete implementations `Switch A` and `Switch B`, Each Switch representing a real- life switch (A telephony tool which among its responsibilities is writing CDR; all data records of calls hitting the switch). Each Switch in real life writes CDR in a different format and to different sources, say some switch writes to a text file another writes to a MySQL database. The Switches as entities and CDR details are defined by the system's end user My goal is writing `Importer` classes responsible for importing CDR based on the source of the data determined by the switch entity into my system, but hiding the `Importer` from the switch classes. The layer responsible for importing the CDR will loop upon switches, and instatiate an 'Importer' object, based on the CDR format defined in each switch. Can anyone suggest an approach to use ? EDIT : More clarification Below : public class SwitchBase { public abstract string CDRFormat { get; } }               public class SwitchA:SwitchBase     {         public override string abc         {             get { return "Text"; }         }               }          public class SwitchB : SwitchBase     {         public override string CDRFormat         {             get { return "MySQLDatabase"; }         }     }               public class CDR     { }          public class MySQLImporter     {         ICollection<CDR> GetCDR()         {             //DoSomething         }     }          public class TextImporter     {         ICollection<CDR> GetCDR()         {             //DoSomething         }     }


title: Benefit of using Data URI to embed images within HTML document and its cross-browser compatibility

text: I want to embed an image using Data URI within HTML document so that we don't need image as a separate attachment, we get just one HTML file that contains the actual image. What are its advantages and disadvantages? Does IE10 supports it? Is it useful to have such an implementation? I am working on an application, where we have html documents that link towards images stored in some location. If I use tiny online editor, as images are saved somewhere in the server, while editing the document, i can provide a link towards that image, but can't preview the final document with images from within tiny editor. If I chose to download the file locally, then i will need to download the images from server side. It looks a bit overkill, so I thought if Data URI could be used in such a situation.


title: Euclidean Space Fully Connected Nondirectional Graph: Shortest Path to all nodes

text: So this may be a question that is born of my inability to properly express my intentions to Google. In a fully connected non-directional graph such that any three points can be properly represented in a triangle in Euclidean geometry it would seem that a greedy first algorithm which chooses the shortest edge would find the shortest path from a starting point to visit all other points. I can't find a condition under which this is false, but one of my neighbors (another programmer) insists that I am wrong, though still cannot come up with a condition where I am wrong. Edit: I am not sure this question is an instance of of the general TSP, which I know is NP hard, or if it is I thought that all of the constraints on the allowed graphs would have impacted the difficulty. From wiki: TSP is `the shortest possible route that visits each city exactly once and returns to the origin city`. In this problem there is no requirement to return to the origin city. Further, we don't care about selecting the optimal origin city since the origin city is set in our specific example that we were discussing. Additionally, the graph in this problem must conform to the constraints of euclidean distances in either 2 or 3 dimensions so a three node graph such as below (key is the node, val is the distances between other nodes) could not exist since the edge from A to B would make the edges from C to A and B infeasible. ` A:{B:80, C:10}, B:{A:80, C:5}, C:{A:10, B:5} ` Also by fully connected I meant all nodes have edges between them and every other node. Sorry if the description came off as confusing, but I am wondering if given all these constraints, does it become solvable in a more simplistic manner.


title: Porting an open source project from ISC license and public domain

text: I have ported libsodium and NaCl to .NET. NaCl is the original project that is in the public domain while libsodium is a derived work from NACL and is using the ISC license. I looked at both projects to port the code to .NET. For my project I prefer to use MPL v2, but I'm not sure I'm allowed to change the original license. I know ISC is a permissive but it's not clear if I can use another license for my work. Any help would be appreciated.


title: Developing a virtual machine / sandbox

text: I'm interested in learning how a virtual machine/sandbox actually works. I have developed an 8051 emulator and also wrote a dissassembler for x86, so this part of a virtual machine is not really the problem. What I'm interested in, is the sandbox functionality of it. To illustrate what I mean consider this example. Let's assume I have a function which simply opens a file. So nothing fancy.                int fd = open(path);      Now when this code is executed natively it will go to the operating system and opens the file (assuming that it exists). Now when I run this in a virtual machine environment, the specified path is not the one that the operating system sees, but rather something that the VM will substitute, thus redirecting the open call. So what I'm interested in is, how a VM can do this, when the executed code is run natively (like x86 on a x86) because for an interpreted VM it is rather obvious. When I google for virtual machines I either find only links talking about interpreters like Java, LLVM or similar, but nothing that goes into more detail. I downloaded the sourcecode from Oracle Virtual Box, but as this is a rather big codebase, it's quite hard to understand the concept just form digging in that code.


title: What does an interviewer notice most on my resume?

text: When applying for a position such as a software developer for a company, what does an interviewer notice **most** on my resume concerning the work i have done? Is he/she concerned with the amount of work i do with others(Open source projects), The specific accomplishments I've made in my field(programs, apps) or the amount of time i spend helping others(forums, mentoring)? For those of you who have applied and work/worked in a position similar to a software developer,In your personal experience, what do you think helped you the most in landing the job? P.s. if 'software developer' is to broad a term, i would specifically enjoy working with teams to create large applications such as dropbox / google / skype etc...


title: What type of pattern would be used in this case

text: I want to know how to tackle this type of scenario. We are building a person's background, from scratch, and I want to know, conceptually, how to proceed with a secure object pattern in both design and execution... I've been reading on Factory patterns, Model-View-Controller types, Dependency injection, Singleton approaches... and I can't seem to grasp or 'fit' these types of designs decisions into what I'm trying to do.. First and foremost, I started with having a big jack-of-all-trades class, then I read some more, and some tips were to make sure your classes only have a single purpose.. which makes sense and I started breaking down certain things into other classes. Okay, cool. Now I'm looking at dependency injection and kind of didn't really know what's going on. Example/insight of what kind of hierarchy I need to accomplish...   * class Person needs to access and build from a multitude of different classes.      * class Culture needs to access a sub-class for culture benefits     * class Social needs to access class Culture, and other sub-classes     * class Birth needs to access Social, Culture, and other sub-classes     * class Childhood/Adolescence/Adulthood need to access everything. Also, depending on different rolls, this class hierarchy needs to create multiple people as well, such as Family, and their backgrounds using some, if not all, of these same classes. Think of it as a people generator, all random, with backgrounds and things that happen to them. Aging, death of loved ones, military careers, e.t.c. Most of the generation is done randomly, making calls to a mt_rand function to pick from most of the selections inside the classes, guaranteeing the data to be absolutely random. I have most of the bulk-data down, and was looking for some insight from fellow programmers, what do you think? **EDIT** Flowchart added. I decided to leave a few things out, but you get the idea.. I didn't really know what types of visuals to use, so I prioritized the boxes importance by size, and the most connections. The non-boxes are flavor text, with no life altering events. ![http://i.stack.imgur.com/ZdYkq.jpg](http://i.stack.imgur.com/ZdYkq.jpg)


title: License requirements for including open source software

text: In an open source project, a number of other open source libraries have been included to implement needed functionality, some as libraries (LGPL), and some as source code (non-LGPL). The new BSD license was selected for the project. The included open source libraries are licensed under the new BSD, MIT, Apache, and LGPL licenses, but no GPL licensed code. How should these other open source libraries be credited?   Do all the library licenses need to be included in the main project license file?   Is it sufficient to just provide links to the project web sites in the Help->About dialog and documentation?   Is any credit _really_ needed?


title: CRM: In-House vs. OTS

text: Many, many years ago, when I was young and naive and wrote everything from scratch unless it came with the language, I was working for a company with two sales people in two locations who were trying to share leads and contacts. I had just discovered a shiny new hammer, PHP, so of course I built them what I would today would describe as a primitive MySQL backed CRM system. They loved it--at this point most in history all their competitors were using local Access databases. I have since learned how much easier life is when you don't try to reinvent the wheel. I am again faced with a growing company that needs an online CRM system. I am roughly aware of what CRM systems do of course, but I am not very familiar with what exactly products like MS Dynamics or SAP offer. I am having a hard time sorting through marketing fluff trying to figure out just what exactly these companies spend tens of millions of dollars and euros developing. Most of them appear to be fairly straightforward enterprise applications with a few bells and whistles that I'm not really interested in, such as Outlook and Sharepoint integration or the ability to create workflows through a click-and-drag interface. So my question is, are you crazy to attempt to develop a custom CRM system from scratch?


title: What does IE mean by saying "'console' is undefined"?

text: I like IE's persnicketiness (the debugging tools that take you right to your code is even more user-friendly than what I've found in F12 Chrome Dev Tools), but why does it say, "'console' is undefined" re: this line of jQjuery:               console.log("entered submit button click");      How could _console_ be undefined? Neither Chrome nor Firefox complain about it... And ironically, IE shows me this error message where? In the "Console" tab! Shirley it couldn't be case-sensitive, and it expects "Console.log"? BTW and anyway, I'm impressed with IE's F12 tools; I wonder if it's "The Avis Effect" at work - they were #5 (among Browsers) and have thus begun fighting like a rabid wolverine to claw and scratch their way upwards?


title: Have javac call automatically run java

text: I want to be able to call `javac <class file name>`, and then automatically run java on the compiled `.class` file. I thought initially to use a x86 disassembler to hack it (javac.exe) but bumped that idea; I then found the open source code for JDK, and concluded that maybe a batch file would be easier. How can I do this?


title: does haskell have dependent types?

text: The questions all the title. Just to clarify, Haskell already has the ability to parametise a type over another type (this is just like template programming in c++), but can it parametise a type over values - this is a dependent type. So for example you can have a type thats parametised over the integers, for example vectors of size n, matrices of size n x m, etc. If not, why not. And is there any possibility that it will be supported in the future?


title: Compiler design decision for dynamic method invocation

text: I asked about Compiler interpretation of overriding vs overloading on StackOverflow, and got good answers, but this led me to another question that I'm not sure is appropriate for SO, but I think is for here. One should read the original question and accepted answer, but perhaps it's understandable just by looking at the code below:               public static void whatIs(Circle s)     {         System.out.println("Circle");     }     public static void whatIs(Square s)     {         System.out.println("Square");     }      and we attempt to call,               whatIs(shapes[0]); //array of Shape objects (interface implemented by Circle,Square)     whatIs(shapes[1]);      we will get two errors (one for `Square` and one for `Circle`) indicating that: >   * method Driver.whatIs(Square) is not applicable >     * actual argument Shape cannot be converted to Square by method > invocation conversion > As is suggested in my question, using `instanceof` can give the desired results, and as the answered suggested: > The compiler could auto generate code like >   >   >     if (shapes[0] instanceof Circle) >     { >         whatIs((Circle) shapes[0]); //prints "Circle" >     } >   **but, it does not**. Just to be clear, I know one can use an abstract class instead of an interface to achieve similar functionality, nonetheless, does anyone know why the Java compiler won't automatically do this for you? I'm not a compilers guy, but I have a feeling that this is not an opinion based question. I assume that there is a good reason for this decision.


title: Why is the concept of lazy evaluation useful?

text: It seems lazy evaluation of expressions can cause a programmer to lose control over the order in which their code is executed. I am having trouble understanding why this would be acceptable or desired by a programmer. How can this paradigm be used to build predictable software that works as intended, when we have no guarantee when and where an expression will be evaluated?


title: Graduate expectations versus reality

text: When choosing what we want to study, and do with our careers and lives, we all have some expectations of what it is going to be like. Now that I've been in the industry for almost a decade, I've been reflecting a bit on what I thought (back when I was studying Computer Science) programming working life was going to be like, and how it's actually turning out to be. My two biggest shocks (or should I say, broken expectations) by far are the sheer amount of maintenance work involved in software, and the overall lack of professionalism:   1. **Maintenance** : At uni, we were all told that the majority of software work is maintenance of existing systems. So I knew to expect this in the abstract. But I never imagined exactly how overwhelming this would turn out to be. Perhaps it's something I mentally glazed over, and hoped I'd be building cool new stuff from scratch a lot more. But it really is the case that most jobs are overwhelmingly maintenance, bug fixing, and support oriented.   2. **Lack of professionalism** : At uni, I always had the impression that commercial software work is very process-oriented and stringently engineered. I had images of ISO processes, reams of technical documentation, every feature and bug being strictly documented, and a generally professional environment. It came as a huge shock to realise that most software companies operate no differently to a team of students working on a large semester-long project. And I've worked in both the small agile hack shop, and the medium sized corporate enterprise. While I wouldn't say that it's always been outright "unprofessional", it definitely feels like the software industry (on the whole) is far from the strong engineering discipline that I expected it to be. Has anyone else had similar experiences to this? What are the ways in which your expectations of what our profession would be like were different to the reality?


title: Difference Between Unit Testing and Test Driven Development

text: From reading the descriptions, I understand that in TDD tests are done prior to writing the function and in Unit Testing, its done afterwards. Is this the main difference, or the two terms can't even be compared as such. Perhaps, Unit Testing is an integrated part of TDD.


title: TDD - is it just about unit tests?

text: Do I understand it right that classical TDD is just about unit tests? Don't understand me wrong: I know the difference between TDD and just unit testing. I am asking whether it is correct to use integration test in TDD workflow. Currently I work on the project where TDD is surely only about unit tests and there is at least one serious problem with it. The majority of our unit tests are behavioural tests which often become false negative (false red) during refactoring (just because some sequence of dependencies calls changed). The project was created in TDD style to make refactoring simple and suddenly refactoring became a hell. Epic fail! The most obvious decision now is to make our test not unit but integrational (but still with TDD). So if previously we stubbed/mocked class dependencies, now we won't do it (at least not all of them). As result most of our tests will become state (instead of behavioural). And state tests become false negative much more seldom (because they test the result but not the workflow of execution). So I would like to know how widespread is an approach of using TDD with integration tests. Is it okay? Would be grateful for any resources on this topic. I have read this article but it is a bit... strange **Update.** Here I will clarify what I mean under unit test and integration test. Unit test is a test which stubs/mocks all class dependencies. Integration test has real implementations of dependencies (although it can stub/mock some dependencies if needed).


title: How do you successfully hire out a few programmers to make it cost effective?

text: Many of us know this situation well: we're a one-man (woman) development team, we need some extra help to keep up with all the tasks, the budget is small and we decide to get some help. But hiring someone is difficult. Either the person is inexperienced and I end up becoming their full-time teacher in the hopes they will produce work they way I want, or the person is skilled but for whatever reason doesn't hand over code within budget that I can just plug in and use without reworking it myself. Any thoughts/ideas?


title: Is a Model Driven Architecture in Language Oriented Programming (MPS) feasible at this time

text: As a side project I am developing some sort of DSL where I describe a data model, and generate desired code files from it. I believe this is called Model Driven Architecture. My partial existing implementation uses C#, CodeDOM, XML and XSLT to do this manually. I discovered there already exist better environments to do this in. The one which fascinated me the most is called MPS, which follows the Language Oriented Programming paradigm. This article, written by a cofounder of JetBrains was a real eye opener for me. I truly believe LOP has a very good chance of becoming the next big programming paradigm once it has broader support. From my short experience with MPS, I noticed it is still mainly Java- oriented. My question is, how feasible is it to generate code files for other (multiple) languages instead of just Java. I don't need full language support from the start, so preferably, I need to be able to implement a language in a agile way. E.g. first support only one type, add access modifiers, ... Perhaps some other (free) environment already provides this out of the box. P.S.: I find it important to have a lot of control over the naming conventions and such of the generated code. This is one of the reasons why I started my own implementation. UPDATE: Judging from the answers it seems like people think I'm only interested in .NET solutions. This is not the case, any other suggestions are highly welcomed!


title: How should I study programming languages?

text: I am a student of computer engineering. I have never done any programming before, and as you can understand, I don't know how to study it or how to make my own programs. My English is weak [edited for clarity - ed], and so if you don't like the choices I list, please feel free to provide others. How should I study? How should I learn programming languages?   1. Study completely from a book.   2. Don't study from a book, just try writing code.   3. A mix of the two; study from a book, then try writing code.   4. Study half the book, then write the code by hand on paper.   5. Listed to the teacher, then try to solve general problems (those not from any specific chapter).


title: How important are Haskell's advanced concepts like Monads and Applicative Functors for most routine programming tasks?

text: I've read the Learn You a Haskell book up to the point where they introduce Monads and stuff like Just a. These are so counterintuitive for me that I just feel like giving up trying to learn it. But I really want to try. I'm wondering if I can at least avoid the advanced concepts for a while and just starting using the other parts of the language to do a lot of practical tasks with the more basic parts of Haskell, i.e. functions, standard IO, file handling, database interfacing and the like. Is this a reasonable approach to learning how to use Haskell?


title: Does new generation of programmers use Emacs?

text: I know that Emacs was very popular a few decades ago, but now - when there are a lot of IDEs and text editors, is it still popular between us?


title: As a high school student what should I be doing to make myself better/more hireable?

text: I'm a year away from university/college at this point in time, I'm currently 17 years old and practice programming as a hobby. I'd like to get a job one day in the market, I -love- programming. And I was wondering what would be my best course of action at the moment to get myself ready for a potential career in programming? I've talked to a couple comp sci majors and it doesn't seem like what they're doing isn't terribly hard (although, I'm sure it differs from school to school). I kind of feel like I'm in an odd limbo where it's gotten a bit stale, because I don't feel like I'm making 'progress'. As far as programming this is my current skill set: Languages: Lua, I know this one very well, I'd put myself at least a little bit past 'moderate' with Lua, I know how to use it's features and what to do, and not to do. C, I know C in a way I'd call a bit below moderate, I can write C but I don't know the best practices, and I often find myself consulting documentation on C. Projects: I've made a couple toy interpreters, I shipped a roleplaying modification for a Garrys Mod (while this doesn't sound like much, I and my friend have produced at -least- 20,000 lines, including comments and such), and I've made a couple small games. Experience: I'm fairly familiar with GNU tools and Linux, I can write a basic makefile etc. I know how to use command line tools, and I use Linux as my day to day operating system, but also have years of experience with Windows. I know how to use Git and SVN (I'm a master at niether, but I can use them well enough to maintain a project.) So if there's anything you guys could suggest? Should I be actively doing things now or just kind of waiting it out for university? I'm feeling lost. Edit: I put "is" instead of "isn't" terribly hard. What I meant to say is all the Comp Sci major I've talked to said that the material isn't terrible hard if you've got a bit of experience programming.


title: How to prepare for a programming job?

text: I'm basically done with my computer science classes in college but I don't seem to be "ready" for a computer science job, nor am I in a position to get an internship at the moment. I'm wondering if there is any way to prepare and gain experience I would need for a job without having an actual degree yet. Any certain books I can read or skills I should learn that would help? Thank you.


title: CSS structure for creating responsive websites

text: I'm a back-end engineer who works on a small team so occasionally needs to do some front-end. I like to develop a good workflow and project structure before I start anything, so I'm wondering about creating a responsive front-end for a web app. What's a best-practice way to strcture CSS for creating responsive websites that need to "scale down" for smaller screens? Specifically: do you create the mobile version first, then expand the code with min-width media queries in the CSS? Or do you do the opposite, creating the desktop-resolution version first? Secondly, do you define multiple element selectors and definitions in the same media query? Or do you define a media query for each element and selector? It would seem that the second method would make for more readable code perhaps -- although it's certainly more frustrating to "tweak" a working site to create a new version with media queries rather than simple fence-off the old settings in one media query and re-style the necessary parts from the new version from scratch.


title: NT Kernel Source

text: Well, the first question would be: Is it legal to take hold of the NT Kernel Source? If so, proceed to the second paragraph; if not, proceed to the third. The first thing you'd probably ask is "Why NT Kernel Source?" The answer is simply, I want to make my own OS compatible with Windows. This is of course, all a hobby, and I'm not planning any large project. Ignore this if it's possible to get an NT Kernel Source: "ReactOS" I'm pretty sure that it uses Window's source code itself, with a few minor exceptions, so I'd like to know how they got the code.


title: Implementing cache system in Java Web Application

text: I worked with JPA (Eclipselink implementation) and Hibernate. As I understand these two have great caching systems. I am interested in caching in a Web application and in order to better understand the process I'm trying to implement something on my own. Sadly, I cannot find any in depth documentation about this subject. I'm interested in things like high scalability, sharing memory on different machines and other important theoretical matters. Is there any tutorial or open project I could check out? Thank you! *LE: * I want to cache DB information in POJOs just like JPA or Eclipselink


title: Is Visual Source Safe (The latest Version) really that bad? Why? What's the Best Alternative? Why?

text: Over the years I've constantly heard horror stories, had people say "Real Programmers Dont Use VSS", and so on. BUT, then in the workplace I've worked at two companies, one, a very well known public facing high traffic website, and another high end Financial Services "Web-Based" hosted solution catering to some very large, very well known companies, which is where I currently Reside and everything's working just fine (KNOCK KNOCK!!). I'm constantly interfacing with EXTREMELY Old technology with some of these financial institutions.. OLD LIKE YOU WOULDN'T BELIEVE.. which leads me to the conclusion that if it works "LEAVE IT", and that maybe there's some value in old technology? at least enough value to overrule a rewrite!? right?? Is there something fundamentally flawed with the underlying technology that VSS uses? I have a feeling that if i said "someone said VSS Sucks" they would beg to differ, most likely give me this look like i dont know -ish, and I'd never gain back their respect and my credibility (well, that'll be hard to blow.. lol), BUT, give me an argument that I can take to someone whose been coding for 30 years, that builds Platforms that leverage current technology (.NET 3.5 / SQL 2008 R2 ), write's their own ORM with scaffolding and is able to provide a quality platform that supports thousands of concurrent users on a multi-tenant hosted solution, and does not agree with any benefits from having Source Control Integrated, and yet uses the Infamous Visual Source Safe. I have extensive experience with TFS up to 2010, and honestly I think it's great when a team (beyond developers) can embrace it. I've worked side by side with someone whose a die hard SVN'r and from a purist standpoint, I see the beauty in it (I need a bit more, out of my SS, but it surely suffices). So, why are such smarties not running away from Visual Source Safe? surely if it was so bad, it would've have been realized by now, and I would not be sitting here with this simple old, Check In, Check Out, Version Resistant, Label Intensive system. But here I am... I would love to drop an argument that would be the end all argument, but if it's a matter of opinion and personal experience, there seems to be too much leeway for keeping VSS. UPDATE: I guess the best case is to have the VSS supporters check other people's experiences and draw from that until we (please no) experience the breaking factor ourselves. Until then, i wont be engaging in a discussion to migrate off of VSS.. UPDATE 11-2012: So i was able to convince everyone at my work place that since MS is sun downing Visual Source Safe it might be time to migrate over to TFS. I was able to convince them and have recently upgraded our team to Visual Studio 2012 and TFS 2012. The migration was fairly painless, had to run analyze.exe which found a bunch of errors (not sure they'll ever affect the project) and then manually run the VSSConverter.exe. Again, painless, except it took 16 hours to migrate 5 years worth of everything.. and now we're on TFS.. much more integrated.. much more cooler.. so all in all, VSS served it's purpose for years without hick-up. There were no horror stories and Visual Source Save as source control worked just fine. so to all the nay sayers (me included). there's nothing wrong with using VSS. i wouldnt start a new project with it, and i would definitely consider migrating to TFS. (it's really not super difficult and a new "wizard" type converter is due out any day now so migrating should be painless). But from my experience, it worked just fine and got the job done.


title: Why do programming language (open) standards cost money?

text: Isn't it counter-productive to ask for 384 Swiss franks for C11 or 352 Swiss franks for C++11, if the aim is to make the standards widely adopted? Please note, I'm not ranting at all, and I'm not against paying; I would like to understand the rationale behind setting the prices as such, especially knowing that ISO is network of national standard institutes (i.e. funded by governments). And I also doubt that these prices would generate enough income to fund an organization like that, so there must be another reason.


title: Struggling not to use Hungarian notation

text: I've seen arguments for and against Systems Hungarian. For some years I've been working on a legacy project that uses this system by naming every variable, function with a prefix of the variable type eg (strName, intAge, btnSubmit etc) (I know the original Hungarian Apps prefixes by the kind of variable, not the type). I'd like my next project to abandon it fully, but I do find it harder to name similar things uniquely without resorting to it. Lets say I have an webform for collecting email addresses and storing them in a database table, and button which calls the function which save the address to the db. If I'm using Hungarian style notation, I might call the box `txtEmail` the button `btnEmail` and the value contained in the textbox `strEmail`. I might then use a function `storeEmail(strEmail)` to store the email. I have a clear convention here, it's obvious what each variable is. What would be the best practice for naming these variables   * without resorting to Hungarian Systems,   * without making them over long or confusing   * and with a clear convention to use across the whole of my project?


title: How much to each part?

text: I have been involved in a project and now it is coming to an end. The good news is the company will start to commercialize the software which is specific software to ISPs. As a programmer / developer of the project, I intend to still support the project, attend to new custommer customizations, basically the software will still alive and be sold in the market. How much should I charge to stay ON the project? Should I charge per hour? per month? or even by percent over each customer? What is the default for this kind of situation? or How do most programmers/developers deal with that? Thanks in advance, It is a very important question to me.


title: How important is it to implement a caching system in an MVC style framework?

text: I am writing my own PHP framework (...waits for the groans to subside) for the purpose of learning (best practices, design principals etc.) as I'm entirely self-taught and consequently there are gaps in my knowledge. I understand that most mainstream frameworks incorporate some form of caching system, which I'm guessing is for keeping regularly used classes and/or other files close by for fast loading (right?). Ideally I envisage a system that is somewhat self monitoring and self managing in that it tracks class/file usage, memory limits and request processing performance, removing items from cache automatically when no longer needed or increasing the cache size when performance drops too low etc. (even some form of basic garbage collection is better than nothing, right?). So my questions are:   * Firstly: Have I understood everything correctly so far?   * How important is it to implement this kind of system over regular include/require methods?   * How can I determine memory usage and other system performance metrics?   * To cache classes do I have to use the '_ _sleep()' and '_ _wakeup()' magic methods?   * I also gather that to be stored a class has to be serialized. Should I use a $_SESSION variable, a temporary DB table or some kind of flat-file / SQLite DB as the cache? Thanks for any and all help / suggestions.


title: Match two strings but allow for a degree of error

text: How can I match two strings, but at the same time allow for X number of characters to be incorrect in the match. The number of errors should be a controllable variable. While X number of characters can not match in the string there should be a limit as to how many run in a sequence. Given two strings I might allow 5 characters to be different, but not more than 2 in a row. I'm looking for a recommended algorithm for comparing these two strings, or maybe there is already a known solution for this.


title: Best practice for writing a service

text: We currently have a C++ socket server used by a java client. All of the socket code in both C++ and java is stick-built at a low-level with messages passed via JSON strings. Are there cots packages or better techniques commonly used in this situation to reduce the cost of future development and maintenance?


title: Java exam: prebuilt methods?

text: > **Possible Duplicate:**   >  Is using build-in sorting considered cheating in practice tests? I'm studying for a Java exam at the university. In your opinion, could I use, during the exam,               Arrays.sort(intArray);      instead of creating my own algorithm? How would you judge it, if you were the professor?


title: How to save and clear Files/PDFs received from web service in iOS apps?

text: My web service will send me a PDF and I have to store it locally on my iphone app and share it through whatsapp later. So how can I save this file received in my app for later sharing?   How can I again clear that from local db so that app is not heavy. Thanks


title: Is there a more intelligent way to do this besides a long chain of if statements or switch?

text: I'm implementing an IRC bot that receives a message and I'm checking that message to determine which functions to call. Is there a more clever way of doing this? It seems like it'd quickly get out of hand after I got up to like 20 commands. Perhaps there's a better way to abstract this?                public void onMessage(String channel, String sender, String login, String hostname, String message){                  if (message.equalsIgnoreCase(".np")){     //            TODO: Use Last.fm API to find the now playing             } else if (message.toLowerCase().startsWith(".register")) {                     cmd.registerLastNick(channel, sender, message);             } else if (message.toLowerCase().startsWith("give us a countdown")) {                     cmd.countdown(channel, message);             } else if (message.toLowerCase().startsWith("remember am routine")) {                     cmd.updateAmRoutine(channel, message, sender);             }         }


title: How can I permute pairs across a set?

text: I am writing a bet settling app in C# and WinForms. I have 6 selections, 4 of them have won. I know that using the following formula from Excel:               =FACT(selections)/(FACT(selections-doubles))/FACT(doubles)      This is coded into my app and working well: I can work out how many possible doubles (e.g., AB, AC, AD, AE, BC, BD, BE, etc.) need to be resolved. But what I can't figure out is how to do the actual calculation. How can I efficiently code it so that every combination of A, B, C, and D has been calculated? All my efforts thus far on paper have proved to be ugly and verbose: is there an elegant solution to this problem?


title: What advantages do continuous integration tools offer on a solo project?

text: If you're doing a solo project - would you use CI tools to build from a repository? I've used Hudson and Cruise Control in a team environment, where it's essential to build as soon as anyone checks anything in. I think the value of version control is still obvious, but do I need to build after every commit, seeing as I would just have built on my local machine, and no-one else is committing?


title: Correct way to handle sample logins or test accounts

text: In my JSP web application, I want to redirect sample users to a different page from the real users. Currently we do something like               if((user.getName().equalsIgnoreCase("Sample")) ...      This is (a) hardcoded and (b) executed for each normal user as well. Is there a better way to handle this logic? I am loathe to redirect these users via Javascript validation - which is one of the suggestions given internally


title: Loadbalancing and failover in code

text: I have HTTPS based webservices (not REST, rather old code). I am generating Java client stubs using Axis & using that to call the webservices. There are around 20 different APIs on the webservice. I have 2 servers hosting the webservices (identical - 2 servers are being used for redundancy) and data is synced between the 2 servers - so that same API called either server produces the same result). I do not have hardware or software load balancers or clusters. So I am planning to implement the failover & loadbalancing in code (the failover is important, it's OK even if I don't do load balancing). I was planning to do this in code i.e if I get a connect exception, I will trap the exception and do the same Webservice call on the other server. I was wondering if there are any known design patterns for this or any pitfalls I should be aware of.


title: Why to have an application with GUI on linux when command line is available?

text: If the question appears to be off topic then please migrate to some other suitable domain on stackexchange. **Q.why to have GUI along with CLI, when you already have command line interface?** I'm currently developing an application. As of now application has a command line interface. The target machines for application will be **80% servers and 20% workstations**. I'm considering to provide GUI too for the application. **GUI Use Case:** Product registration is main use case i.e. my product needs license key to run. And after that only some text info will be shown every time its launched. Only 2-3 buttons to perform extended functions. **CLI Use Case:** Product registration will expect some arguments as command line arguments. Later the 2-3 extended functions available in GUI can also be started from command line.


title: Architecture strategies for a complex competition scoring system

text: Competition description:   * There are about 10 teams competing against each other over a 6-week period.   * Each team's total score (out of a 1000 total available points) is based on the total of its scores in about 25,000 different scoring elements.   * Most scoring elements are worth a small fraction of a point and there will about 10 X 25,000 = 250,000 total raw input data points.   * The points for some scoring elements are awarded at frequent regular time intervals during the competition. The points for other scoring elements are awarded at either irregular time intervals or at just one moment in time.   * There are about 20 different types of scoring elements.   * Each of the 20 types of scoring elements has a different set of inputs, a different algorithm for calculating the earned score from the raw inputs, and a different number of total available points. The simplest algorithms require one input and one simple calculation. The most complex algorithms consist of hundreds or thousands of raw inputs and a more complicated calculation.   * Some types of raw inputs are automatically generated. Other types of raw inputs are manually entered. All raw inputs are subject to possible manual retroactive adjustments by competition officials. Primary requirements:   * The scoring system UI for competitors and other competition followers will show current and historical total team scores, team standings, team scores by scoring element, raw input data (at several levels of aggregation, e.g. daily, weekly, etc.), and other metrics.   * There will be charts, tables, and other widgets for displaying historical raw data inputs and scores.   * There will be a quasi-real-time dashboard that will show current scores and raw data inputs.   * Aggregate scores should be updated/refreshed whenever new raw data inputs arrive or existing raw data inputs are adjusted.   * There will be a "scorekeeper UI" for manually entering new inputs, manually adjusting existing inputs, and manually adjusting calculated scores. Decisions:   * Should the scoring calculations be performed on the database layer (T-SQL/SQL Server, in my case) or on the application layer (C#/ASP.NET MVC, in my case)?   * What are some recommended approaches for calculating updated total team scores whenever new raw inputs arrives? Calculating each of the teams' total scores from scratch every time a new input arrives will probably slow the system to a crawl. I've considered some kind of "diff" approach, but that approach may pose problems for ad-hoc queries and some aggegates. I'm trying draw some sports analogies, but it's tough because most games consist of no more than 20 or 30 scoring elements per game (I'm thinking of a high-scoring baseball game; football and soccer have fewer scoring events per game). Perhaps a financial balance sheet analogy makes more sense because financial "bottom line" calcs may be calculated from 250,000 or more transactions.   * Should I be making heavy use of caching for this application?   * Are there any obvious approaches or similar case studies that I may be overlooking?


title: Code maintenance: keeping a bad pattern when extending new code for being consistent, or not?

text: I have to extend an existing module of a project. I don't like the way it has been done (lots of anti-pattern involved, like copy/pasted code). I don't want to perform a complete refactor for many reasons. Should I:   * create new methods using existing convention, even if I feel it wrong, to avoid confusion for the next maintainer and being consistent with the code base? or   * try to use what I feel better even if it is introducing another pattern in the code ? * * * Precison edited after first answers: The existing code is not a mess. It is easy to follow and understand. BUT it is introducing lots of boilerplate code that can be avoided with good design (resulting code might become harder to follow then). In my current case it's a good old JDBC (spring template inboard) DAO module, but I have already encounter this dilemma and I'm seeking for other dev feedback. I don't want to refactor because I don't have time. And even with time it will be hard to justify that a whole perfectly working module needs refactoring. Refactoring cost will be heavier than its benefits. Remember: code is not messy or over-complex. I can not extract few methods there and introduce an abstract class here. It is more a flaw in the design (result of extreme 'Keep It Stupid Simple' I think) So the question can also be asked like that:   You, as developer, do you prefer to maintain easy stupid boring code OR to have some helpers that will do the stupid boring code at your place ? Downside of the last possibility being that you'll have to learn some stuff and maybe you will have to maintain the easy stupid boring code too until a full refactoring is done)


title: How can I deal with developers who don't use English in code?

text: > **Possible Duplicate:**   >  Code maintenance: keeping a bad pattern when extending new code for being > consistent, or not? I'm working on a project for a Greek public organization, as a part for a course semester project. I have to develop a 3-tier application that manages financial data. A professor of mine acts as an advisor and is helping me on the project. I write my own code but there are also pieces of code written by other developers that I can also use, and some the code is also written by my professor. The Greek developers program without using any patterns or conventions, they are generally unaware of phrases like "best-practices" and "programming methodology". They just write code of pure quality. Most of them are at least 10 years more experienced than me but I am on my way. My professor is a "pragmatic programmer" and produces "clean code that works" of high quality. The Greek developers speak English as well. The problem is that some of them use greeklish for the various names of variables, classes and methods- obviously greek charachters cannot be used for such purposes. For example, the greek translation of "user" is "χρήστης" which in greeklish could be written in the following ways:   * xristis,    * xrhsths,    * hristis,    * christis,   * ... As a result, the same meaning can be expressed with different characters. Some of the developers use English in their code, and there are no naming conventions at all. I'm working on this project just for the sake of knowledge and further practice. I would like to apply practices I read in books in software that can also be used and modified by others. Should I keep using greeklish just to be in harmony with the already existing code? In that case, who knows In a few months I may get valuable feedback for my effort, which will eventually make me a better programmer. Or, should I just keep doing the right thing, taking example from my professor? In that case my code might be an one-use throw-away effort because none of the Greek developers would like to follow a new set of conventions.


title: When developing on an old code base, should I use Best Practices or go for Consistency

text: > **Possible Duplicate:**   >  Code maintenance: keeping a bad pattern when extending new code for being > consistent, or not ? As my experience in programming increases with each project, I look back at earlier projects and cringe at some of the ways the code is structured or how well i have implemented a design pattern. These projects are still utilized in production environments (without issue) and have new features implemented on a yearly cycle. Updating the entire structure is not feasible. When implementing new features should I structure the updates with best practices in mind, or should I keep to existing (inferior) structure to maintain consistency with the rest of the project?


title: Clarification in steps OS takes during a page fault, related to TLB

text: I am reading the book operating systems by Galvin, and there is something I don't understand. Assume that there is a hardware managed Translation Lookaside Buffer (TLB). Now when a program requests for a page which is in its own address space, but is not found in the TLB (miss), then which of the following happens? (assuming its not in the page table either) **OPTION 1**   1. OS checks the page table, its not there as the valid/invalid bit is set to invalid.   2. OS selects a victim frame, swaps in the page from disk   3. OS updates page table flags   4. Replace an entry in TLB with the new entry in page table   5. Restart the instruction, which now runs like nothing happened **OPTION 2**   1. When there is a TLB miss, the page table entry for the page is brought into TLB first   2. Instruction is restarted   3. There is TLB hit, but the valid/invalid bit is invalid => page is not in memory   4. Then OS selects victim frame, swaps in page....rest of the steps are same I think the question boils down to **whether only the TLB can be inspected for valid/invalid bit (due to hardware reasons) or the page table itself can be inspected.** Because OPTION 2 is clearly slower. (but a friend insists that that is what must happen) Thanks in advance!


title: Countour Mapping API

text: I have done some searching on Google, but haven't come up with much as of yet. I am wanting to take a set of point data, which I had previously been using to create weighted points for a heat map through the Google API, and turn them into a contour map to overlay on the Google Maps API. I haven't seen anything in Google's code that would let me do this. Does anyone know of a good API to create such an overlay? Or is there possibly something I have overlooked that Google offers?


title: Organizing code for iOS app development

text: I've been developing an app for the iOS platform, and as I've been going along, I've noticed that I've done a terrible job of keeping my files (.h, .m, .mm) organized. Is there any industry standards or best practices when it comes to organizing files for an iOS project? My files include custom classes (beside the view controllers), customized View Controllers, third-party content, code that works only on iOS 5.0+ and code that works on previous versions. What I'm looking for is a solution to keep things organized in a manner that others (or myself in years to come) can look at this and understand the basic structure of the application and not get lost in the multiple files found therein.


title: Selecting a JAX-RS implementation for a new project

text: I'm starting a new Java project which will require a RESTful API. It will be a SaaS business application serving mobile clients. I have developed one project with Java EE 6, but I'm not very familiar with the ecosystem, since most of my experience is on the Microsoft platform. Which would be a sensible choice for a JAX-RS implementation for a new project such as described? Judging by Wikipedia's list, main contenders seem to be Jersey, Apache CXF, RESTeasy and Restlet. But the Comparison of JAX-RS Implementations cited on Wikipedia is from 2008. My first impressings from their respective homepages is that:   * **CXF** aims to be a very comprehensive solution (reminds me of WCF in the Microsoft space), which makes me think it can be more complex to understand, setup and debug than what I need;    * **Jersey** is the reference implementation and might be a good choice, but it's legacy from Sun and I'm not sure how Oracle is treating it (announcements page doesn't work and last commit notice is from 4 months ago);    * **RESTeasy** is from JBoss and probably a solid option, though I'm not sure about learning curve;    * **Restlet** seems to be popular but has a lot of history, I'm not sure how up-to-date it is in the Java EE 6 world or if it carries a heavy J2EE mindset (like lots of XML configuration). What would be the merits of each of these alternatives? What about learning curve? Feature support? Tooling (e.g. NetBeans or Eclipse wizards)? What about ease of debugging and also deployment? Is any of these project more up-to-date than the others? How stable are them?


title: What is the story behind Java Vulnerabilities?

text: I always appreciated the Java language. It is known as a very secure platform and many banks use it in their web applications. I wanted to build a project for my school and I discussed the options with some developers. However, one of them said we should ignore Java ecause of vulnerabilities appreared recently in it. For this reason I want to make sure, what is the story behind this and does that mean that Java today considered not much secure as it was previously?


title: Using an actor model versus a producer-consumer model?

text: I'm doing some early-stage research towards architecting a new software application. Concurrency and multithreading will likely play a significant part, so I've been reading up on the various topics. The producer-consumer model, at least how it is expressed in Java, has some surface similarities but appears to be deeply dissimilar to the actor model in use with languages such as Erlang and Scala. I'm having trouble finding any good comparative data, or specific reasons to use or avoid the one or the other. Is the actor model even possible with Java or C#, or do you have do use one of the languages built for the purpose? Is there a third way?


title: How to self Motivate technically to put my ideas into execution or just getting a job at MNC like google or microsoft

text: I mean, > How to self Motivate to get a job at google or create another google in > future. ,as there is no mentor who can guide me on this topic, so asked it here: I'm a Graduate in BE IT,but with less grades,with interest in learning new programming languages, but not yet done anything great like developed some system or anything. And I'm left with 2 more years to prove my worth to someone. So,is their a quick guide to start learning a language and then just go on implementing your ideas and it gets appreciated or I get a good Job ant Big MNC's. By the way, I just build one website for my one client and running my wordpress blog. And I had tried my hands on basic of C++,Java,JS,JSP,PHP,Ubuntu,web designing in past.


title: What does Windows 8 mean for the future of .NET?

text: Microsoft showed off a demo of Windows 8, including a new platform that allows developers to use HTML5 and JavaScript. Is this new platform the main way to develop for Windows 8? Is Microsoft phasing out the .NET platform in favor of the HTML 5 stack? What does Windows 8 mean for .NET developers?


title: Best practices for including open source code from other public projects?

text: If I use an existing open source project that is hosted for example on github within one of my projects, should I check in the code from the other project into my public repo or not? I have mixed feelings about this, #1 I want to give proper credit and attribution to the original developer, and if appropriate I will contribute back any changes I need to make. However given that I have developed / tested against a specific revision of the other projects code, that is the version that I want to distribute to users of my project. Here is the specific use case to illustrate my point. I am looking for a more generalized answer than this specific case. I am developing simple framework using rabbitmq and python for outbound messages that will allow for sending sms, twitter, email, and is extensible to support additional messaging buses as well. There is a project on github that will make the creation and sending of SMS messages developed by another person. When I create my own repo how do I account for the code that I am including from the other project?


title: What is considered third party code?

text: Inspired by this question Using third-party libraries - always use a wrapper? I wanted to know what people actually consider as third-party libraries. **Example from PHP:**   If I'm building an application using Zend framework, should I treat Zend framework libraries as third party code? **Example from C#:**   If I'm building a desktop application, should I treat all .Net classes as third party code? **Example from Java:**   Should I treat all libraries in the JDK as third party libraries? Some people say that if a library is stable and won't change often then one doesn't need to wrap it. However I fail to see how one would test a class that depends on a third party code without wrapping it.


title: Scheme vs Haskell for an Introduction to Functional Programming?

text: I am comfortable with programming in C and C#, and will explore C++ in the future. I may be interested in exploring functional programming as a different programming paradigm. I am doing this for fun, my job does not involve computer programming, and am somewhat inspired by the use of functional programming, taught fairly early, in computer science courses in college. Lambda calculus is certainly beyond my mathematical abilities, but I think I can handle functional programming. Which of Haskell or Scheme would serve as a good intro to functional programming? I use emacs as my text editor and would like to be able to configure it more easily in the future which would entail learning Emacs Lisp. My understanding, however, is that Emacs Lisp is fairly different from Scheme and is also more procedural as opposed to functional. I would likely be using "The Little Schemer" book, which I have already bought, if I pursue Scheme (seems to me a little weird from my limited leafing through it). Or would use the "Learn You a Haskell for Great Good" if I pursue Haskell. I would also watch the Intro to Haskell videos by Dr Erik Meijer on Channel 9. Any suggestions, feedback or input appreciated. Thanks. P.S. BTW I also have access to F# since I have Visual Studio 2010 which I use for C# development, but I don't think that should be my main criteria for selecting a language.


title: web server response code 500

text: I realize that this may spur a religious discussion, but I discussed this with friends and get great, but conflicting answers and the actual documentation is of little help. What does the 500 series response codes mean from the webserver? Internal Server Error, but that is vague. My assumption is that it means that something bad happened to the server (file system corruption, no connection to the database, network issue, etc.) but not specifically a data driven error (divide by zero, record missing, bad parameter, etc). Something to note, there are some web client implementations (the default Android and Blackberry httpclients) that do not allow access to the html boddy if the server response is 500 so there is no way to determine what caused the issue from the client. What I have been been implementing recently is a web service that returns a json payload wrapped in a response object that contains more specific error information if it is data related, but the server response will be 200 since it finished the actual processing. Thoughts?


title: Is code maintenance typically a special project, or is it considered part of daily work?

text: Earlier, I asked to find out which tools are commonly used to monitor methods and code bases, to find out whether the methods have been getting too long. Most of the responses there suggested that, beyond maintenance on the method currently being edited, programmers don't, in general, keep an eye on the rest of the code base. So I thought I'd ask the question in general: Is code maintenance, in general, considered part of your daily work? Do you find that you're spending at least some of your time cleaning up, refactoring, rewriting code in the code base, to improve it, as part of your other assigned work? Is it expected of you/do you expect it of your teammates? Or is it more common to find that cleanup, refactoring, and general maintenance on the codebase as a whole, occurs in bursts (for example, mostly as part of code reviews, or as part of refactoring/cleaning up projects)?


title: Building a satisfying community at work

text: In the influential "Peopleware", DeMarco and Lister state that an organisation that builds a satisfying community will tend to keep it's people. We have about 40 programmers at work. How do we go about creating a "community" out of them?


title: Open Source Projects Leading to Uniquely Interesting Opportunities

text: Not sure if I asked this at the right place (it's development related). It would be great if you can direct me to the right place if I did ask in the wrong place. I was encouraged by hosts during some company tours to participate in the open-source software community if interested in software. The reasons include showing initiative to contribute useful components to a project while others can evaluate the quality of your design and coding practices. However, other than case studies of CUSP being bought out by Apple Inc., I can't think of other case studies showing the trend of interesting opportunities being attracted over the long term. Do you have any high-profile projects fitting this criteria that comes to your mind? Appreciate it in advance for your suggestions!


title: Pros of start learning programming with Python if what I really want is Javascript?

text: A friend of mine seeks to learn Javascript programming but he never programmed before. I've found Python as a quite nice language that takes most unneeded "strangeness" out of learning programming while remaining useful. Personally my first language was Pascal and while experimented a little with C++, C, Java, C#, Php and Javascript, I then found Python and this is actually what I most of the time use for years. I find Python a good language to introduce most programming concepts in a way where you can focus on the concept and not on the language. Actually imho Python has only 1 big gotcha, the significant whitespace, while other languages often feature more that is unnecessary when introducing today's programming itself (like overhead, pointers, implicit conversions, operator overloading, etc.). I've also heard that many instructors use this language to introduce programming concepts, and I tend to agree with this choice. As Javascript has it's own strenghts and weaknesses as an programming- introductory language, I wondered whether it's worth considering using Python instead for learning programming and then learn Javascript, when you already understand many programming concepts. I'm not used to teaching, so I would ask ones who are, what pros and cons would teaching Python first have over teaching Javascript right away, for a newcomer to programming?


title: Should managers prohibit programmers from using IM in office?

text: > **Possible Duplicate:**   >  Would you allow your programmers to use Messenger and social networks like > Facebook? A manager may believe that using IM clients in the office is not acceptable, but many programmers use them for legitimate purposes, for example in order to easily contact one another. Do you think the IM chat prohibition is reasonable?


title: Should I demand unit-testing from programmers?

text: I work at a place where we buy a lot of IT projects. We are currently producing a standard for systems-requirements for the requisition of future projects. In that process, we are discussing whether or not we can demand automated unit testing from our suppliers. I firmly believe that proper automated unit-testing is the only way to document the quality and stability of the code. Everyone else seems to think that unit-testing is an optional method that concerns the supplier alone. Thus, we will make no demands of automated unit-testing, continous testing, coverage-reports, inspections of unit-tests or any of the kind. I find this policy extremely frustrating. Am I totally out of line here? Please provide me with arguments for any of the opinions.


title: XML or HTML for User Manual/Help and Why?

text: I want to make User Manual/Help to my program. I found two good ways - XML or HTML - which should I use and why? I know how to do it in html (I know how to use js, css and such) but in XML it's harder (or I imagine?) anyway which way should I choose and why?... **Edit** : There's one important thing I forgot to mention: I need it for the army, I can make it only on army's computer and I cannot install anything you said. I can use notepad and that's it.


title: How to manage two major versions using SVN?

text: At the company I'm working we support two versions of the software we develop. One version is available for customers, and one version the developers are developing new functionality in. The version available for customers is also changed by developers, to fix the bugs our customers have found. So, for example we have a 4.1 version available for customers, and we are developing 4.2. As soon as we release 4.2, 4.1 gets closed, and we start developing on 4.3. Currently we have two trunks, one for each version that is open for development. Every time a bug is fixed in the released version, we have to merge it in the new version too. This is extra work. Next to this, we would like to work in advance, and have a version already finished 'on the shelf', and already start on a new version. Which would mean if we fix a bug in the released version, we would have to merge it in three trunks! Is there a better way of structuring this, and possibly eliminate the duplicate merges? Are we doing something completely wrong? Thanks in advance.


title: What are some famous one-liner or two-liner programs and equations?

text: I'm experimenting with a new platform and I'm trying to write a program that deals with strings that are no longer than 60 characters and I'd like to populate the data store with some famous or well-known small chunks of code and equations, since programming and math goes along with the theme of my software. The code can be in any language and the equations from any discipline of mathematics, just so long as they're less than a total of 60 characters in length. I suspect people are gonna break out some brainfuck for this one. For example,               #include<stdio.h>     int main(){printf ("Hi World\n");return 0;}      60 characters exactly! Thanks so much for your wisdom!


title: what do you do to keep learning?

text: After the school i think my learning process has been slow(not yet stopped), so give me some advice which will be help me to keep learning. UPDATE: I am a web developer in PHP. I am working in PHP last 2 years.


title: Plagued by indecision - how to choose technologies to use for projects?

text: I have always been fascinated with the newest and best technologies available. I graduate from college this year, and over the course of the past few years, I have spent a lot of time learning new programming languages, web frameworks, Linux distributions, IDEs, etc., in an effort to find the best of each. I have installed and played around with Ubuntu, Gentoo, Debian, Arch Linux, SUSE, VectorLinux, Puppy Linux, Slackware, and Fedora, I have spend a good amount of time in Vim and Emacs, and have played around with Visual Studio, Eclipse, NetBeans, gedit, and several more obscure ones. I have played with all sorts of languages - I started with the common ones like C, Java, Visual Basic, but always heard that they were "bad" (for relative definitions of bad). I then discovered the scripting languages and have quite a bit of experience in PHP, Perl, Python, and Ruby. Then I heard that functional languages are where it's at, so I played around with Scheme, Lisp, Haskell, Erlang, and OCaml. I've played around with obscure languages like Forth and J. When I do web development, I go back and forth between frameworks and languages. Should I use plain PHP, Ruby on Rails, Django, CakePHP, CodeIgniter, Yii, Kohana, or make my own? I have a very broad and shallow knowledge of computer science. As soon as I have learned a useful amount of one technology, I see something else shiny and go after it. My progression often goes like this: "Perl is better than PHP, but wait, Python is better than Perl. Oh, but now I see that Ruby has the power of Perl and it is cooler than Python. Well, now that I have seen a little of Ruby, it is too complicated. Python is cleaner. Oh, but it is too hard to deploy Python, so I should use PHP if I want to do real web development." And so on and so forth. What technology should I use for projects? Should I just pick one language/framework/IDE and sort of forget about the other things that are available for a while? I don't have all that much in the way of completed projects, because I never stay with something long enough to finish it.


title: How do I get up-to-date on web development technologies?

text: I'm a regular user here, but linking my screen name to my real identity is dirt simple, and the question I'm about to ask would lead to a very unpleasant conversation with my current employer were they to see it. So, my apologies for this sock-puppet account; I promise Socky and I won't be voting on each other's stuff, and Socky won't be doing much of anything other than voting on answers to his own questions. I may have an opportunity to work with somebody I've worked with in the past. Short, extremely understated summary: It went well. This time he's looking to bring me on as a partner to a fledgling web venture. My job title isn't defined, but I'd basically be "the guy" in terms of the tech side of the company. One of the first things I'd be doing is fleshing out the current and future requirements of the site and determining the best way to meet them -- overhaul the existing site? Scrap the existing site entirely and replace it with something like Drupal? I'd also be tasked with making sure that the site is not only a pleasant user experience, but that it looks and feels like a modern, professional website. One problem: I'm not qualified. At least, not yet. I wasn't really qualified for the last time we worked together, but I taught myself what I needed to know and ... like I said. It Went Well. However, I was a lower-level code wrangler that time around, and a lot of key decisions had already been made. I had more room for error and time to learn as I was going. This outing, not so much. It's been a long damn time since I was completely up-to-date on web programming; my current gig has a healthy dash of web stuff, but the web interface isn't the main business and it's built on old technology. (Technology it honestly doesn't use particularly well.) I just don't spend a lot of time playing with new tech when I'm not at work; I generally spend that time on hobbies and passions I don't get paid to do. But I want this to happen. And I want to do it right. So my question is: what resources would you recommend I use to both get myself up-to-date and stay up- to-date on professional-caliber web programming? I know I need to beef-up my jQuery-fu; I've been exposed to it a little, and holy crap does it make hard jobs easy. I also know I need to acquaint myself with Drupal and other content management systems so that I can accurately gauge whether using one as the foundation for the site would be a good idea or a waste of time. But I'm certain there are other technologies out there that would help me do that job that I don't yet know anything about. What are some good resources for helping me figure out what I don't know? Websites, magazines, podcasts, whatever. I need to figure out how to get back into the game properly. This is scary as hell, but it also feels like it could be a huge step forward in my career. (Assuming it's not a step into a pool filled with laser sharks.) My thanks in advance for any assistance anybody can offer in curing my ignorance.


title: Keeping up to date with the speed of technology

text: I am going through 2 ebooks on ASP.NET MVC and SignalR . **SignalR: Real-time Application Development** Released in 2013 **Introducing ASP.NET MVC 4 Fourth Edition** Released in 2012 As i have been going through these books and writing out the code I have been told by visual studio that some of the code is obsolete. With MVC the section was on security and signalR on the main map connection. As of this question Entity Framework has just released its 6th version and now everyone is starting on WEB API as opposed to WCF. This is all very intimidating to say the least. Besides having to learn all these technologies, we also have to keep up to date with new releases every few months. In a standard web app there is ASP.NET /MVC, EF, SQL, jQuery, jQuery Lib( knockoutjs etc), HTML5 + CSS3, WEB API, Deployment environment setup. And these technologies are changes so fast. Its very often i come across old code looking for answers and to realize there are conflicts with other libraries, serious security concerns or bad practice for maintainability and testing. My question is. How can i stay up to date with all of this?


title: How do you remember numerous API?

text: There are lots of other APIs I need to use besides the Selenium test tool to be able to get tests working. Not using them for just one week and the mind has lost all of them. How is it possible to remember zillions of APIs?


title: How can I learn libraries and stuff faster?

text: As a programmer, it seems like I spend half my time figuring out how to use various libraries/frameworks/tools. First Javascript, then Jquery, then canvas, then Backbone, etc, etc. Every tool has its own set of non-obvious idiosyncrasies that you need to be aware of. Mastering them takes a lot of time. Any suggestions on how to speed up the learning process?


title: How can I prepare for the next software paradigm?

text: Throughout the history of programming whenever a new technology was made a **application** for it had to be made. _E.g. When Android came out Android Apps came out ~ giving millions of dollars in revenue to the respective developers who made the apps. (The OS came in 2008)_ The beauty about computers is that it is always changing. You cannot invent a new innovation for writing as most English students learn about Shakespeare while CS students face a ever-changing curriculum.. Programmers have this advantage. **They can make a lot of money if they play their cards right.** So I want to be prepared. I want to be first in line for the next promising innovation. I know many of them will fail but I think my instinct for spotting potential success is high. _But how can I be prepared?_ I am planning to assimilate fellow programmers, friends and offshore developers/contractors. I want to make my own start-up ~ for now as a sole proprietor. There is no way I'm pitching an idea to a large company. I want to get a BN and register a company, I believe it will give more **flexibility**. Plus its **better working with other minds as designing something by yourself without help is a recipe for burnout.** So my question - going more specific is what approach should I take?   * Should I start my own software company, passive as it may be in the   beginning?   * Who should help me? Is it wiser getting internal/external developers to help me with my ideas for the new paradigms? I am a first year CS student, 18 years old with good social skills.


title: How can I cope with every increasing/changing number of frameworks?

text: I started coding with php, mysql, html, and javascript back in 2002 and heck that is all you basically needed to create any type of website. Over the years I picked up other languages, but what turned me off were all of the frameworks and JQuery that was popping up every few months and clients (if freelancing) or employers expected you to be an expert on some crap a geek released recently. Because of this I got out of programming since I don't know if I can constantly throw away all of my previous knowledge and replace it with some new hip fad that does the exact same thing but just uses different function names. I miss knowing the core knowledge of PHP and being able to code from scratch and I'm afraid the skill of mastering a technology to completion is obsolescent. Is it right to feel this way, and can any of us feel secure about our programming career in the future?


title: html/css/js best practices

text: > **Possible Duplicate:**   >  What should a developer know before building a public web site? Are there any books or resources on html/css/js and web design best practices? There are plenty books which just learn the basics - syntax and other stuff which is not quite difficult, but I can't find use cases, real examples, how professional desginers use them.


title: Best way to acquire a complete comprehensive knowledge of web design and development?

text: > **Possible Duplicate:**   >  What should every programmer know about web development? Assuming one wants to be a professional in web design and development, what technologies would you recommend one learn? In what order should this be done? Any other suggestions. Note : I am interested in finding out about a video training package that contains all the listed technologies.