title: Moving to Python (SciPy and NumPy) for Scientific Computing

text: Just read a presentation about using Python for Scientific Computing. I am currently using MATLAB (student license FTW, which will expire when I graduate soon). So I was wondering **how matured SciPy and NumPy are with respect to relying on them for all the Scientific Computing** I need to do. The advantage is that it's free. I am mainly focused on Signal Processing, Audio, Acoustics kind of computing. I can imagine that the NumPy and SciPy projects are evolving with respect to the support for more complex techniques. So, **how fast are they evolving** , are there large communities behind them? Finally, **are there other solutions**?


title: Python potential for science applications?

text: I'm a beginner in programming. I am learning Python as a hobby. However, after reading some things in what concerns, for example, its speed, I asked again myself if I should really learn Python or learn other more difficult language. I am in sciences at school, and have interest in physics and microcontrollers, so a performance-wise language would be needed for, for example, computational calculations, and that. So probably a language like C or C++ would be more handy in terms of future university degree. So, my questions are:   * I saw that Python is an interpreted language, therefore slower (up to 100 times from C++, from what I read at Stack Overflow, which is a lot). Can't it be compiled so that no interpreter is needed and it has high speed? (like C is) I mean, it's what the interpreter does, isn't it?   * Does Python have any chance of being useful for science? How could it surpass it's speed lack?   * Isn't there the possibility of writing a program in Python, and translate it to C++ in order to compile? Therefore having the simple writing of Python and the speed of C++? Are there any Python-to-C++ translators?


title: Do you write Documentation in a language other than English?

text: A couple of months ago I moved to Germany. Taking some projects on my own, I've recently had the opportunity to develop with a company-based framework, that was very well documented, but in German. My German is pretty good, however my programming terminology is somewhat lacking. Long story short, I was wondering, how common is it to document code in a language other than English? Sorry to seem English-centeric but it seems like a bad habit.


title: What is a good IDE for client side JavaScript development?

text: I recently started learning JavaScript and am looking for a good JavaScript Editor/IDE. I found dozens of them in a Google search but I would appreciate if users who have experience with using such an IDE could recommend one. I want an IDE with **syntax highlighting** , possibly **IntelliSense** and **debugging support** for JavaScipt code. I'm a **Windows 7** user and do just **client-side** JavaScript development. Any suggestions??


title: What is an untriaged bug?

text: I am an undergrad studying Computer Science. When I tried reporting bugs to several projects, I came across the classification _untriaged_ a lot. A web search didn't really explain what this means. Could you tell me what an untriaged bug is?


title: Are there any advantages of using separate RDBMS for reports?

text: My production database is SQL Server 2008 R2 Express. It has limited features and I am testing it in a production environment. To better handle reporting queries in a highly concurrent environment, I want to use any open-source RDBMS with tables that will be acting as temporary tables to frequently fill recent records and delete them after use. The only problem is that I need to keep two connections for each RDBMS, but I feel, Firebird or PostgreSQL can give me better performance of reports in a highly concurrent environment. What are your suggestions? Is this approach used in any commercial scenario?


title: Is Agile applicable in product development companies as well?

text: The following principles of Agile development makes it look like Agile is mostly suited for services companies:   * Customer satisfaction by rapid delivery of useful software   * Welcome changing requirements, even late in development   * Working software is delivered frequently (weeks rather than months)   * Working closely with the client. Often this involves a client representative to be a part of the development team.    * Face-to-face conversation is the best form of communication (co-location) My question is: Is Agile exclusively suited for service oriented companies or do even product development companies (including web based companies) benefit from Agile techniques?


title: How old is "too old"?

text: I've been told that to be taken seriously as a job applicant, I should drop years of relevant experience off my résumé, remove the year I got my degree, or both. Or not even bother applying, because no one wants to hire programmers older than them.1 Or that I should found a company, not because I want to, or because I have a product I care about, but because that way I can get a job if/when my company is acquired. Or that I should focus more on management jobs (which I've successfully done in the past) because… well, they couldn't really explain this one, except the implication was that over a certain age you're a loser if you're still writing code. But I _like_ writing code. Have you seen this? Is this only a local (Northern California) issue? If you've ever hired programmers:2   * Of the résumés you've received, how old was the eldest applicant?   * What was the age of the oldest person you've interviewed?   * How old (when hired) was the oldest person you hired?      How old is "too old" to employed as a programmer?      1 I'm assuming all applicants have equivalent applicable experience. This isn't about someone with three decades of COBOL applying for a Java guru job.   2 Yes, I know that (at least in the US) you aren't supposed to ask how old an applicant is. In my experience, though, you can get a general idea from a résumé.


title: I'm questioning my education choice because they say there's no place for old programmers

text: > **Possible Duplicate:**   >  How old is "too old"? I'm about to start CS next year. I love both the coding and the mathematical aspects of programming. However, recently I encountered multiple rants about how it's impossible to actually be a programmer over 45, unless you're in a managing position or filling a very specific niche. Any advice? I'm seriously questioning my career choice here, and would be grateful for some input.


title: Can a developer move into a fast-paced career later in life?

text: > **Possible Duplicate:**   >  How old is "too old"? Most developers I know pushed really hard to get ahead in their careers early on, then maybe slowed down about 10 to 15 years in to marry and raise a family. I didn't. I had a family early in my career, knowing that children were more important to me than my career. I will be in my early 40's when my children are going to college, and it seems that I might be able to take advantage of the lull in my responsibilities and get ahead at a level of experience where so many developers are slowing down to spend more time with their families. However, I'm also wondering if the effort would pay off that late in life. Specifically, I'm concerned about age-ism, especially as a woman in development. Women are affected by age-ism more strongly in most careers, and development seems to be far more biased towards youth than most fields. I also know the women who are in software development are fairly likely to leave the field at ages 35 to 40, although I wonder if that is related to delayed childbearing in this field more than anything. Can an older developer reap the same benefits of intense work that younger developers receive? Or will I automatically be perceived as "stable" and "jaded" at that age, regardless of my interest in moving ahead and investing lots of time into my career once the kids are grown? Would I be better off planning on starting my own business at that time if I want to make a large investment in my career and have it pay off (financially)? ETA: A little clarification: I expect to work between now and then, and grow on the job. So I would be a very senior SDET by that age. I don't expect to have trouble getting a job at that point; my question is more about climbing the ladder to get promotions and pay increases. I see the work the VP of tech does, and it looks fun - but he got to that point by rising quickly early in his career. Can I make the same rise later in my career? Or will I be limited to the rate of growth in position that I achieve in my earlier career?


title: Is it ever worthwhile using goto?

text: Goto is almost universally discouraged. Is this statement every worthwhile using?


title: What are the arguments against parsing the Cthulhu way?

text: I have been assigned the task of implementing a Domain Specific Language for a tool that may become quite important for the company. The language is simple but not trivial, it already allows nested loops, string concatenation, etc. and it is practically sure that other constructs will be added as the project advances. I know by experience that writing a lexer/parser by hand -unless the grammar is trivial- is a time consuming and error prone process. So I was left with two options: a parser generator à la yacc or a combinator library like Parsec. The former was good as well but I picked the latter for various reasons, and implemented the solution in a functional language. The result is pretty spectacular to my eyes, the code is very concise, elegant and readable/fluent. I concede it may look a bit weird if you never programmed in anything other than java/c#, but then this would be true of anything not written in java/c#. At some point however, I've been literally attacked by a co-worker. After a quick glance at my screen he declared that the code is uncomprehensible and that I should not reinvent parsing but just use a stack and String.Split like everybody does. He made a lot of noise, and I could not convince him, partially because I've been taken by surprise and had no clear explanation, partially because his opinion was immutable (no pun intended). I even offered to explain him the language, but to no avail. I'm positive the discussion is going to re-surface in front of management, so I'm preparing some solid arguments. **These are the first few reasons that come to my mind to avoid a String.Split-based solution:**   * you need lot of ifs to handle special cases and things quickly spiral out of control   * lots of hardcoded array indexes makes maintenance painful   * extremely difficult to handle things like a function call as a method argument (ex. add( (add a, b), c)   * very difficult to provide meaningful error messages in case of syntax errors (very likely to happen)   * I'm all for simplicity, clarity and avoiding unnecessary smart-cryptic stuff, but I also believe it's a mistake to dumb down every part of the codebase so that even a burger flipper can understand it. It's the same argument I hear for not using interfaces, not adopting separation of concerns, copying-pasting code around, etc. A minimum of technical competence and willingness to learn is required to work on a software project after all. (I won't use this argument as it will probably sound offensive, and starting a war is not going to help anybody) **What are your favorite arguments againstparsing the Cthulhu way?*** *of course if you can convince me he's right I'll be perfectly happy as well


title: When Interfacing with a 3rd Party API, What Can Make Things Challenging?

text: Reuse of components in development of software program are always exposed through the API's. Most of the products in today's world (such a facebook, google, .Net, JDK, ...) provide API's to reuse their components without being actually coding from the stratch. Also API's provide a huge high-level abstraction to the under lying components. My question is about the usability of these API's. Certainly, in all API's there are Obstacles. Obstacles can be   * skill sets,   * resources,    * Documentation of the API's   * the API itself. What do the programmers think the real obstacle are? List few of your opinions. To Question this here: Being a developer I investigated the obstacles when using 3rd party API's, one such is Highcharts. Though I have strong points why Highchart libraries are great compared to other Javascript visulization libraries (not comparing it with Google visulization API's) I found myself lost with the usability of the charts when going through their API docs at the very beginning. Indeed, their support forum is good to get your questions answered. Developers uisng API's - most of the time - do not (sometimes, need not) understand the design intents of the API, architecural design and the decisions made during the development of the API. Also, what will be your suggestions to make better API that will reach to large set of developers? I'm not entirely sure about the friction of learing new API's. PS: This may not be a constructive answer. But I am sure I am communicating with real developers on this site.


title: What do I need to know about Agile to blag my way past a recruitment agent?

text: I'm currently hunting for a new job. I'm a c# / SQL server developer, but have never worked in an agile environment. I'm in the UK, where very few (IT) employers advertise directly, but instead use recruitment agencies. The problem I'm having is that many agents have little or no understanding of the skills they're trying to recruit for. Agile, being the latest buzzword, appears as an "absolute requirement" on many job postings. I've already spoken to couple of agents today who believe that it's some kind of programming language, rather than a development methodology. It looks like I'm going to have to tell a few white lies to get my CV into the hands of potential employers. Can someone suggest a resource for the basics of Agile so I can at least sound convincing to an agent.


title: What is a microframework?

text: Why are some frameworks (e.g. Flask for Python, Sinatra for Ruby) called microframeworks? What differentiates them from full-fledged frameworks, like Django or Rails?


title: Using abstract methods to force subclasses to define values for member fields

text: Often in my designs I define an abstract superclass whose subclasses will vary mostly in their values for the fields defined in the superclass. For example, in a game I'm developing there's an abstract class `Missile` with a number of subclasses. Each one defines a different value for member variables such as `MAX_SPEED`, `MASS`, `FLYING_FORCE`, which are then used in calculations performed in the superclass. I use abstract methods in `Missile` to force it's subclasses to define these variables. For example I simply have an abstract method `defineMass()` that forces subclasses to define their own value of mass. A different example would be my `Entity` class (the superclass of all game- play classes) defining an abstract `loadImage()` method that forces subclasses to define an image for themselves. Is this good practice? Is it common?


title: Functional programming strategies in imperative languages

text: I've been convinced for awhile now that some strategies in functional programming are better suited to a number of computations (i.e immutability of data structures). However, due to the popularity of imperative languages, its unlikely that I will always be working on projects that are functionally implemented. Many languages (Matlab, Python, Julia) support using a functional paradigm, but it feels tacked on in many cases (looking at you, anonymous functions in Matlab). That being said, what are functional methods and strategies that I can use even in OOP/Imperative code? How can I write solid functional code that does not allow side effects even in languages that have mutable state and global variables?


title: Alternatives to Octopus for deploying .NET applications?

text: Our shop has a TeamCity server that produces deployment packages. The packages are either ASP.NET web apps, Windows services, or miscellaneous binaries (that just get copied to the network somewhere). The packages are all simple zip files. This is all working fine but right now the act of deploying involves a developer manually unzipping the package and copying it to the right place, starting/stopping Windows services if necessary, dealing with synchronization processes to push files to all servers in a web farm, etc. I'm working on figuring out the best way to automate all this. There is a new tool called Octopus which looks to be exactly what we need. However, for various reasons (cost, immaturity of product), we can't use it. At the other end of the spectrum, obviously I could script all this out with MSBuild. But what are my other options? Are there tools similar to Octopus out there? Are there open source equivalents? How are other shops solving this?


title: I don't know C. And why should I learn it?

text: My first programming language was PHP ( ** _gasp_** ). After that I started working with JavaScript. I've recently done work in C#. I've never once looked at low or mid level languages like C. The general consensus in the programming-community-at-large is that "a programmer who hasn't learned something like C, frankly, just can't handle programming concepts like pointers, data types, passing values by reference, etc." I do not agree. I argue that:   1. Because high level languages are easily accessible, more "non-programmers" dive in and make a mess   2. In order to really get anything done in a high level language, one needs to understand the same similar concepts that most proponents of "learn-low-level-first" evangelize about. Some people need to know C; those people have jobs that require them to write low to mid-level code. I'm sure C is awesome, and I'm sure there are a few bad programmers who know C. Why the bias? As a good, honest, hungry programmer, if I had to learn C (for some unforeseen reason), I would learn C. Considering the multitude of languages out there, shouldn't good programmers focus on learning what advances us? Shouldn't we learn what interests us? Should we not utilize our finite time moving _forward_? Why do some programmers disagree with this? I believe that striving for excellence in what you do is the fundamental deterministic trait between good programmers and bad ones. Does anyone have any real world examples of how something written in a high level language--say Java, Pascal, PHP, or Javascript--truely benefitted from a prior knowledge of C? Examples would be most appreciated.


title: Why learn more programming languages?

text: > **Possible Duplicate:**   >  (Why) Should I learn a new programming language? I came across a line in this article which is, > Learn one programming language every year Why do good programmers suggest to learn more programming languages . We can be a jack of all and master of none too in this case.


title: (Why) Should I learn a new programming language?

text: I'm quite proficient with Java, C/C++, JavaScript/jQuery and decently good at Objective-C. I'm quite productive with the languages and their corresponding frameworks too and do produce enterprise level systems (and also small scale ones) with sufficient ease all the while keeping code 'clean' and maintainable (yes, I can read my own code after six months :) Unless mandated by the platform (iPhone, iPad, etc.) or by the client/implementation organization, just "why" should I learn a new programming language? Just for "fun"? And do what with that fun if I'm not going to do anything worthwhile with it? A lot of my peers are ready to dive in to learn the "next new thing/language" and it's usually Python, Ruby or PHP (just naming a few popular ones). Now, just knowing the language by itself is futile IMHO. You also need to know the frameworks, learn their usage/APIs as well as 'good implementation practices', etc. So from an 'economic' sense, is there any benefit in learning a new programming language? If the language is learned in a quick and dirty fashion, it'll probably also be used for quick and dirty prototyping/implementation - but I don't see THAT as a justifiable investment of time/effort. So just WHY should I (or anyone for that matter) learn a new programming language other than "it's fun so let's try it out" - if the investment of time may not be worth it in the long run?


title: Is C a MUST-learn language for programmer?

text: > **Possible Duplicate:**   >  I don't know C. And why should I learn it? I start my programming from Java, and learned PHP. Also, because of the work, I learned Objective-C. But most of the programmer learn from C. So, is this necessary for a programmer to learn C? If yes, how important it is? Please drop your comments, thanks.


title: Why we still need C in terms of development for high level programming modules?

text: > **Possible Duplicate:**   >  I don't know C. And why should I learn it? I was kind of awkward in coding with C, though I am somewhat familiar with it. I like Java and C#. The reason I like to code with them is for better GUI application development. With C, it's hard to code for a better appearance of any application. I understand the fact that C is the basis of all. But now we have tons of libraries which can help us to do anything in no time. But why do many people still code in the C programming language?


title: Should I Learn C/C++ Even If I Just Want To Do Web Programming?

text: > **Possible Duplicate:**   >  I don't know C. And why should I learn it? My goal is to be able to create online apps and dynamic, database driven websites. For instance, if in the future I get the idea for the next Digg or Facebook, I want to be able to code it myself. To arrive there I think I have basically two paths: ### Path 1 Start at a basic level, learning C, then C++ for OOP, then algorithms and data structures, with the goal of getting a solid grasp of computer programming. Only then move to PHP/MySQL/HTTP and start working on practical programming projects. ### Path 2 Start directly with PHP/MySQL/HTTP and getting my hands dirty with practical projects right away. What would you guys recommend?


title: Java void methods implicitly returning this

text: there are a couple of discussion on SO about setter methods returning "this" type. And looks like java 7 had the proposal of void methods returning this. But this proposal could not make it to java 7 features. I could not find if this proposal is moved on to java 8 or future or have been completely discarded. Is it? Ref link - Design: Java and returning self-reference in setter methods


title: Documentation with images - what is the most git-friendly approach?

text: When documenting software I traditionally write a plain text file (like a README.txt) which works well, but unfortunately cannot contain images like HTML can. Unfortunately images must be stored as separate files with a normal HTML document (using <a href=".../foo.png">) which give unnecessary clutter. The "Save a single web-page" in Internet Explorer use MIME HTML (MHTML) to save all resources within a single file. The requirement of having to use a browser to read it, is not a impediment these days. Apparently Opera and Word support editing these documents directly. We use git for our source code, hence the differences as seen by git between two edits of the same documents should not be large to avoid unnecessary disk usage and unusable diff's when looking at the document outside the MTHML editor. What is the best mainstream HTML editor for producing git-friendly MHTML files?


title: Can we regard file-system structure as one part of architecture?

text: Put this image inside `images` folder. All JavaScript files should go inside a folder called `js`. Put templates inside a folder called site-templates and for each template, have three folders called `layouts`, `looks`, and `pages`. We're all familiar with these file-system structures in which we try to logically and efficiently categorize files and folders in an acceptable hierarchy inside our projects. On the other hand, because many times we do I/O operations on these files, changing the file-system structure forces us to update parts of our code, no matter how high-tech, and decoupled our code is. My question is, based on the effect that a file-system structure has on an overall project, can we consider it as a part of the software architecture? Because, in many cases, choosing a correct file-system structure prevents us from duplicating a file, say jQuery, in many places.


title: Reduce a list of IPv4 to lowest common CIDR

text: I have a long list of IP addresses that show some pattern of closeness Example:               XX.249.91.16       XX.249.91.21       XX.249.91.32       XX.249.91.160       XX.249.91.165       XX.249.92.15       XX.249.92.25       XX.249.92.51       XX.249.92.234        and sometimes a whois reveals a range like this               XX.163.224.0 - XX.163.239.255      I would like to create a list of CIDR that gives me the lowest common number It seems Python already has such a thing - iprange_to_cidrs - but I need it in JavaScript               XX.249.90.0/16      if that is what would handle               XX.249.91.0 - XX.249.92.255        ditto XX.163.200.0/nn to handle               XX.163.224.0 - XX.163.239.255      A calculator that can do it one range at a time when I fiddle with the mask is here http://www.subnet-calculator.com/cidr.php My preferred language is JavaScript and I have the following start but need the algorithm that does the match and transform               var list = [         [1234,"10.249.91.16"],         [5678,"10.249.91.21"],         [123,"10.249.91.32"],         [456,"10.249.91.160"],         [789,"10.249.91.165"],         [3456,"10.249.92.15"],         [7890,"10.249.92.25"],         [1234,"10.249.92.51"],         [5432,"10.249.92.234"]     ]     function dec2bin(ip) {          return ip.split(".").map(function(num) {            return ("00000000"+parseInt(num,10).toString(2)).slice(-8);          }).join(".");     }     $(function() {         $res = $("#res");         $.each(list,function(_,arr) {             $res.append('<br/>'+dec2bin(arr[1])+" - "+arr);          });     });      UPDATE after reviewing an answer FIDDLE               function getDec(ip) {       var octet = ip.split(".");       return (octet[0] << 24) | (octet[1] << 16) | (octet[2] << 8) | octet[3];     }     var res = document.getElementById("res");          var adr1 = "111.163.224.0";     var adr2 = "111.163.239.255"     var XOR = getDec(adr1)^getDec(adr2);          // now what?      Update 2: could the result of the range 111.163.224.0 - 111.163.239.255 be `111.163.224.0/20` ? since we have               01101111.10100011.11100000.00000000 - 0,111.163.224.0     01101111.10100011.11101111.11111111 - 0,111.163.239.255


title: Has anyone successfully used Windows Workflow for a Business Rules/Validation engine?

text: I was wondering if anyone has successfully used Windows Workflow Foundation for a BusinessRules/Validation engine, or if you know of some sample code or articles about this. If you have used it before, what do you think of it? How is it compared to other BusinessRule/Validation systems? I am thinking of rules like               if (A, B, and C)          AllowAccess();      Or               if (Value between X and Y)         return true;


title: Event driven design and separation of core/UI logic

text: I am new to event driven development, and I feel lost when I try to implement events that should pass the core/UI boundary. In my program I have the following (example in c#):               UI.RuleForm   Core.RuleList     UI.ResultForm     Cell 1        Rule 1     Cell 2        Rule 2     Cell 3        Rule 3      What I want is: when a RuleForm cell changes, it will update the corresponding rule in RuleList. And when the RuleList changes, the resultFrom will be recalculated from the rules. My current thought is that, in order to keep core logic separated from UI logic (i.e. core should know nothing about UI), core should then only generate events, but not processing events generated by others. So I have to create some kind of UI.RuleListWrapper which can process RuleForm change events, updating Core.RuleList. RuleList in term should fire OnChange events that UI.ResultForm can use. So in summary, my questions are: I want to know if my reasoning and purposed implementation is okay or not, which probably means: **should a core module be able to process events generated by outside UI** Is my separation some kind of "mysophobia", or has it been done before. Are there other better approaches?


title: What is the best way to plot 3D/2D plots with real time data?

text: First of all, I like to use Python, because it is easy to work with. I am not a programmer, so I prefer anything that is easy to use and understand. I understand that it might be faster to program 3D in C/C++ or whatever, but that is beyond my scope. Now, I wish to create a 3D plot of lots of data points (from a scientific sonar). I get roughly 5-10 updates per second and each update contains thousands of points. So the drawing of the 3D plot needs to be fast. Below the 3D plot I want to have a 2D plot "seen from above", and to the right another 2D plot "seen from the side". Both of these 2D plots will be updated at the same time as the 3D plot, with the same number of points. At any time I will want to pause the real time playback of data and select points from the 2D plots and extract data from those points. I also wish to represent the points with different size and color depending on target strength. And in the paused selection-mode, show the selection by changing color of selected points and/or make individual points blinking or similar (apply two different selections at once). I've done a bit of research, and it seems like Enthought has some nice tools. First of all Mayavi for the 3D plot, and then Chaco for the 2D plots. These seem to have nice built-in functionality of selecting points etc. But I am a bit concerned about the plotting speed. Are they able to plot thousands of points 5-10 times per second in real time? Also, maybe I missed something during my research and there are better alternatives out there? E.g. how much work is it to code directly for OpenGL and is it worth the extra hassle in this case? Or some gaming engine? Or matplotlib? I would appreciate any advice I can get on this. And if it is platform independent, all the better. I am using both Ubuntu and Windows7.


title: Database architecture decisions

text: I do not know too many things about databases, so a lot of questions concerning architecture came up lately. Two of these things are:   1. If I have a table with a lot of entries(millions probably), how can I make the `select` queries faster? I thought about sorting the table alphabetically and then splitting it in two, but that doesn't seem to make things easier for me. Do you have any suggestions?   2. I have a table _user_ and one _message_. In _message_ I should have `sender_id` and `receiver_id`. From what I know, I can't make them both _foreign keys_ for _user_ , so I have to pick one of them. Doesn't this, however, lead to data inconsistency(which, as far as I know, is bad)? What is the right approach here? I do not think that it matters, but I use MySQL 5.5.


title: Does an iterator have a non-destructive implied contract?

text: Let's say I'm designing a custom data structure like a stack or a queue (for example - could be some other arbitrary ordered collection that has the logical equivalent of `push` and `pop` methods - ie destructive accessor methods). If you were implementing an iterator (in .NET, specifically `IEnumerable<T>`) over this collection that popped on each iteration, would that be breaking `IEnumerable<T>`'s implied contract? Does `IEnumerable<T>` have this implied contract? eg:               public IEnumerator<T> GetEnumerator()     {         if (this.list.Count > 0)             yield return this.Pop();         else             yield break;     }


title: How do you navigate and refactor code written in a dynamic language?

text: I love that writing Python, Ruby or Javascript requires so little boilerplate. I love simple functional constructs. I love the clean and simple syntax. However, there are three things I'm really bad at when developing a large software in a dynamic language:   * Navigating the code   * Identifying the interfaces of the objects I'm using   * Refactoring efficiently I have been trying simple editors (i.e. Vim) as well as IDE (Eclipse + PyDev) but in both cases I feel like I have to commit a lot more to memory and/or to constantly "grep" and read through the code to identify the interfaces. This is especially true when working with a large codebase with multiple dependencies. As for refactoring, for example changing method names, it becomes hugely dependent on the quality of my unit tests. And if I try to isolate my unit tests by "cutting them off" the rest of the application, then there is no guarantee that my stub's interface stays up to date with the object I'm stubbing. I'm sure there are workarounds for these problems. How do you work efficiently in Python, Ruby or Javascript?


title: Have not been working as a programmer since the three years since I graduated and would like to, any advice?

text: I graduated with my BS in CS, June 2009 and then took a job near school which they told me would be web site maintenance. It was actually web-based customer service with a small amount of working on the company site. After about six months I got super bored with it and decided to move back home. I was desperate for a job so I could pay rent and start paying off my student loans. After six months of looking I found my current job where I've been for about a year an a half. My current boss also promised me the job would be company website development and maintenance but I ended up getting railroaded into doing customer service again. I just found out that my boss is having a website developed by a friend which I guess I will be asked to keep updated. I'm really unhappy in my job and I feel like my education is totally going to waste. I can't seem to find any job listings for CS degree students who don't have software development employment experience. And now that it's been three years since I graduated and I'm still not in the field it seems like that makes me look really bad to employers. I was offered an internship at a software company about a year ago but my fiance' asked me to turn it down because it would have been unpaid and we were running out of money. My current job takes up so much of my time and energy and leaves me so drained that I have a hard time working on projects at home or even finding the time to apply for new jobs. So, my question is two fold:   1. how do I get past the stigma of not having been working in the industry since I graduated and    2. how do I find a CS job in the small amount of time I have. Posting resumes and applying to job postings online, writing cover letter after cover letter seems useless.


title: Is the "Software Project Survival Guide" methodology compatible with Agile ones?

text: I'm considering re-reading Steve McConnell's excellent "Software Project Survival Guide" and perhaps applying it verbatim to my next project. However, one thought struck me: the book was written in 1998, before Scrum and other agile methodologies became popular. Are the teachings of this book still relevant in light of the newer methodologies? Or are they compatible? If the latter, do you have any experience of agile projects run according to McConnell's book(s)?


title: Can You Use 2 Python Modules Issued Under LGPL and BSD License in a Program?

text: I'm making a drawing program as my first open-source program merely to get a taste of the open-source community. To make said program, I am using Python 2.7. I'm using the following modules:   1. EasyGUI 0.96 - Under the 3-clause BSD license   2. Pygame 1.9.1 - Under the LGPL 2.1 license All I intend to do is create a program using these modules which depend on it, and upload it to a public GitHub repository for others to freely modify and distribute. _If_ using my code is allowed in closed source software, or profits to be made by others, I do not want it. I do not wish to modify Pygame or EasyGUI themselves, either. They just need to be simply provided to run the software. Is this possible with the two licenses mentioned above? If I were to do this, what license would I have to issue my program under and why? Are some better choices than others? Is it also possible release my drawing program code under a reciprocal license so the people contributing send their bug fixes in my script back?


title: Are detailed style requirements inappropriate from Marketing?

text: I'm working on the UI-side of a project which is under intense scrutiny by our Marketing group. Most of the time, we're reviewing functionality requirements. Once in a while, however, they will get very in-depth regarding colors, styles, etc. For example, I've been tasked by Marketing to make one particular button a very specific color and a very specific size, In other projects I've worked on, however, these types of requirements have been quietly ignored or rejected when they came from Marketing. Managers and tech leads have insisted Marketing shouldn't be specifying details like colors, styles, control layouts, etc., but I've never really been told _why_. Is it inappropriate for Marketing to list detailed style requirements for a UI, including colors, shades, layout, sizes, etc.? If so, why? Is this just a case of conflicting philosophies regarding Marketing responsibilities? (I should probably mention that we're not working with a unified style guide for company-wide applications. In the past, other projects I've worked on have "winged it" when assembling their UIs.) * * * **Edit:** I removed an editorial comment I made which probably implied this post was a complaint couched in a question. I'm not really concerned with what I should _do_ , but rather I would like better understanding as to what Marketing's responsibility is regarding these types of requirements. I've had very little exposure to Marketing (I've been more distanced from them in previous projects) and I don't understand their role as it pertains to UI styling.


title: Why can't `main` return a double or String rather than int or void?

text: In many languages such as C, C++, and Java, the `main` method/function has a return type of `void` or `int`, but not `double` or `String`. What might be the reasons behind that? I know a little bit that we can't do that because `main` is called by runtime library and it expects some syntax like `int main()` or `int main(int,char**)` so we have to stick to that. So my question is: why does `main` have the type signature that it has, and not a different one?


title: Is unit testing or test-driven development worthwhile?

text: My team at work is moving to Scrum and other teams are starting to do test- driven development using unit tests and user acceptance tests. I like the UATs, but I'm not sold on unit testing for test-driven development or test- driven development in general. It seems like writing tests is extra work, gives people a crutch when they write the real code, and might not be effective very often. I understand how unit tests work and how to write them, but can anyone make the case that it's really a good idea and worth the effort and time? Also, is there anything that makes TDD especially good for Scrum?


title: Convincing my coworkers to use Hudson CI

text: Im really aware of some benefits of using Hudson as CI server. But, im facing the problem to convince my coworkers to install and use it. To put some context, we are developing two different products (one is an enterprise search engine based on Apache Solr) and several enterprise search projects. We are facing a lot of versioning issues and i think Hudson will solve this problems. They argued about its productivity and learning curve What Hudson's benefits would you spotlight?


title: How commonly used is jQuery DataTables, and what are the alternatives?

text: I'm doing some work on a project that uses jQuery DataTables. I've never used this particular jQuery extension before. In the past, I've used the ASP.net DataGrid control, which of course is not available in ASP.net MVC. I've also used the Telerik Kendo UI grid, which is expensive. I've been wondering how commonly used jQuery DataTables is across the internet (especially with ASP.net MVC) and what other technologies are being used to replace the formerly ubiquitous ASP.net DataGrid.


title: Is there a trend for cross-platform GUI toolkits?

text: What is the trend like for the usage of **cross-platform** GUI frameworks right now? Are more people starting to use cross-platform frameworks (such as GTK+, Qt and wxWidgets) or are there more who use more platform-tied frameworks (e.g. Cocoa or WPF)? Is it more or less stagnant? Is it like a rollercoaster? What do you think the trend will be like, say, 5 years from now? The OS landscape is shifting with less people using Windows (personal observation). This should increase the demand for cross-platform toolkits, shouldn't it? Edit: Also, which (cross-platform) toolkits are growing the most, if so?


title: Are web applications limited by the amount of memory or by the speed of the database server on the server side?

text: Many web sites mostly only do CRUD (create, read, update, delete) operations to the database for different URLs. Suppose that we have a 3-tier solution with the database server on a dedicated server and the web server on another server. This question is not about the database server, but the web server. The web server use dynamic content so it execute some code for every request and is communicating with the database server. What should be the limitations of the web server if the web applications aren't computation-heavy under heavy load? Shouldn't the web application be limited of the speed of the database server? or is it limited by the amount of memory? With the speed of CPUs today I don't think that the web servers CPU speed is the limitation. For static content web servers like Nginx and Lighttpd the web server almost always use very little memory and are limited by the disk-IO speed. But how is it for dynamic content?


title: Many JS files included, one breaks all, smart approach to fix?

text: I'm doing a project that uses svg-edit(JS drawing tool) and the page grows big. By now there are about 20 JS file in a page - plug-ins and so on. One of the editor's files breaks in some kind of 'Uncaught TypeError' but it's compressed and can not understand anything. I used several jquery plug-ins that are important for the usability of the page and it's not possible to remove any of them. There are severe conflicts obviously but I can't rewrite any of the plug-ins. Any smart approach to fix this ? Where I can start ?


title: Would it be dishonest to use side tools during a phone interview?

text: A lot of time for decent tech jobs you have to go through a phone screening process. If you suck over the phone you generally don't get a chance to show how bad ass you are in person. These interviews, even for experienced and advanced positions, very often involve trivia style questions over basics. Unfortunately for me they're always in something I don't generally think about and didn't imagine to prepare for. With more experience with them (I haven't applied for a lot of such positions) I imagine I might get better but in the meantime... So for example, converting some decimal value XX to hexidecimal or binary. Last time I interviewed for something I had a total brain-fart on how to actually do this. I very rarely have to care. I use hexidecimal any time I want to be associating values with bit construction and decimal when I want to think of the value as a number. I rarely convert between the two. When I do need to I just pop open the calculator and let it do it for me. It's not like it's hard or anything but for some reason I simply couldn't even remember how to do it. I told the interviewer the truth and told him I'd have a better chance to convert the other way (since it's way, way easy and still shows understanding I guess). He then mentioned that most people struggled with that and wondered if it was some sort of age difference thing. Maybe, maybe not. I explained where I was coming from and let it at that. But, being a phone interview he couldn't exactly tell how I'd come up with the answer. Perhaps it's perfectly legitimate to just use the tools I always do? What do you think? If you where interviewing someone, asked a question like that, and then found out that they'd used a tool or reference to answer your question rather than do it by hand or in their head....would you be pissed off? Would you consider that dishonest or a good use of tools available to solve the problem?


title: How to distribute our software on Linux without shipping source code

text: For our company needs, we need to sell one of our software on *nix-like system. How can we distribute and protect our software ? I know that almost every program on linux is open-source, so how can we protect source code ? Do we need distribute part of source code in object files ? Software written in C.


title: What is ActiveRecord in Rails?

text: Today I interviewed with a big-ego VP for a Rails and Rails position at a profitable company in my city. He asked me to explain what ActiveRecord is in Rails. I told him the following: > ActiveRecord provides an object-oriented interface to an application's > database to make development easier and friendlier for the developer. It > provides validation functionality as well which helps keep data in the > database clean. ActiveRecord also pertains to the model part of the MVC He then told me that was "kind of mickey moused." So, IS my explanation "mickey moused," or should I just have hung up on him right then and there?


title: What's the simplest example out there to explain the difference between Parse Trees and Abstract Syntax Trees?

text: To my understanding, a parser creates a parse tree, and then discards it thereafter. However, it can also pop out an abstract syntax tree, which the compiler supposedly makes use of. I'm under the impression that both the parse tree and the abstract syntax tree are created under the parsing stage. Then could someone explain why these are different?


title: How should compilers report errors and warnings?

text: I don't plan on writing a compiler in the near future; still, I'm quite interested with compiler technologies, and how this stuff could be made better. Starting with compiled languages, most compilers have two error levels: warnings and errors, the first being most of the time non-fatal stuff you should fix, and errors indicating most of the time that it's impossible to produce machine- (or byte-) code from the input. Though, this is a pretty weak definition. In some languages like Java, certain warnings are simply impossible to get rid of without using the `@SuppressWarning` directive. Also, Java treats certain non-fatal problems as errors (for instance, unreachable code in Java triggers an error for a reason I'd like to know). C# doesn't have the same problems, but it does have a few. It seems that compilation occurs in several passes, and a pass failing will keep the further passes from executing. Because of that, the error count you get when your build fails is often grossly underestimated. On one run it might say you have two errors, but once you fix them maybe you'll get 26 new ones. Digging to C and C++ simply shows a bad combination on Java and C#'s compilation diagnostic weaknesses (though it might be more accurate to say that Java and C# just went their way with half the problems each). Some warnings really ought to be errors (for instance when not all code paths return a value) and still they're warnings because, I suppose, at the time they wrote the standard, compiler technology wasn't good enough to make these kind of checks mandatory. In the same vein, compilers often check for more than the standard says, but still use the "standard" warning error level for the additional findings. And often, compilers won't report all the errors they could find right away; it might take a few compiles to get rid of all of them. Not to mention the cryptic errors C++ compilers like to spit, where a single mistake can cause tens of error messages. Now adding that many build systems are configurable to report failures when the compilers emit warnings, we just get a strange mix: not all errors are fatal but some warnings should; not all warnings are deserved but some are explicitly suppressed without further mention of their existence; and sometimes all warnings become errors. Non-compiled languages still have their share of crappy error reporting. Typos in Python won't be reported until the code is actually run, and you can never really kick of more than one error at a time because the script will stop executing after it meets one. PHP, on its side, has a bunch of more or less significant error levels, _and_ exceptions. Parse errors are reported one at a time, warnings are often so bad they should abort your script (but don't by default), notices really often show grave logic problems, some errors really aren't bad enough to stop your script but still do, and as usual with PHP, there are some really weird things down there (why the hell do we need an error level for fatal errors that aren't really fatal? `E_RECOVERABLE_E_ERROR`, I'm talking to you). It seems to me that every single implementation of compiler error reporting I can think of is broken. Which is a real shame, since how all good programmers insist on how important it is to correctly deal with errors and yet can't get their own tools to do so. What do you think should be the right way to report compiler errors?


title: VisualVM Sampling & Accuracy

text: It's been said in other questions that jvisualvm sampling works as a "lightweight" profiling tool by calculating metrics directly from Java stack frames. Its almost unanimously agreed that such a technique is _faster_ but not as _accurate_ in terms of its "timings". My question: why is this method not as accurate? And, what is it not as accurate as (as opposed to what? Are there more precise profiling techniques?)?


title: Is "Code Smell" still a useful metaphor, or has misuse of the term subverted its meaning?

text: I've come across some comments and answers on Programmers.SE that decry the use of the phrase "Code Smell" and I've been wondering what the reasoning is for those who dislike it. I first encountered this term when I read Fowler's Refactoring back in 2000, yet it's only in the last year or two that I've heard any complaint about the use of the phrase. **Q:** Would it be correct to say that the phrase _Code Smell_ has recently started to fall into disfavor, and if so why does/should this metaphor no longer apply? * * * I am looking for well defined answers supported by sound reasoning as I realize that this question is borderline subjective.


title: Where to Populate Objects

text: As mentioned in this question, I am moving our team towards objects (as opposed to just throwing DataTables and variables around everywhere). I have picked a suitable spot for the project that contains the object definitions, but not sure how I should go about populating some of the objects. In particular, what do I do with classes as properties?               Public Class Class1         Public Property SomeProperty As String         Public Property SomeOtherProperty As String         Public Property SomeKey As Integer         Public Property Foo As Class2     End Class      In this basic example, I can easily populate the first three properties from a query, but `Foo` has its own set of properties. Right now, to create a `List(Of Class1)` I generate the data for all of the Class1 objects, and then use `SomeKey` to go back and, one object at a time, populate all of the `Foo`. Certainly this works, but in my case it is rather slow, and it seems that perhaps I am simply doing it wrong. Am I handling that incorrectly? If so, what should I be doing? The only other thing I can come up with is to create a query (or stored procedure) that returns all of the appropriate data for all of the objects. In my test case that amounts to a list that contains 154 `Class1`'s, with each of them having four properties like `Foo`, and some of those having classes as properties.


title: Avoid Postfix Increment Operator

text: I've read that I should avoid the postfix increment operator because of performance reasons (in certain cases). But doesn't this affect code readability? In my opinion:               for(int i = 0; i < 42; i++);         /* i will never equal 42! */      Looks better than:               for(int i = 0; i < 42; ++i);         /* i will never equal 42! */      But this is probably just out of habit. Admittedly, I haven't seen many use `++i`. Is the performance that bad to sacrifice readability, in this case? Or am I just blind, and `++i` is more readable than `i++`?


title: What are the advantages of the Unified Software Development Process?

text: Why should an organization adopt the unified process over others? What are the relative advantages? I know that it is closely coupled with UML, but clearly this cannot be the only advantage. Why choose this approach over others?


title: What are useful metrics for source code?

text: What are useful metrics to capture for source code? How can metrics, like for example _(Executable?) Lines of Code_ or _Cyclomatic Complexity_ help with quality assurance or how are they beneficial in general for the software development process?


title: Why don't interpreters interpret bytecode (like VMs) - instead of source code?

text: **Edited the question to be more clear:** It is known that interpreting bytecode is much faster than interpreting source code or some IL version of the source code. **The interpreter has a much easier time understanding bytecode than source code or source-code-like IL.** Virtual machines interpret bytecode. This bytecode interpreted by VMs is the result of compiling source code to bytecode. However, 'independent interpreters' (not inside a VM) are known to interpret source code or source-code-like IL, instead of bytecode. **Why is that? Why don't interpreters interpret bytecode, like VMs?** All that is needed is to first compile the source code to bytecode (like done for VMs), and then the interpreter can interpret this bytecode. **Is the reason for this is that an interpreter that interprets bytecode is a VM by definition?** (Just guessing here). Or is it something else?


title: Functional language with C-like syntax

text: I've been looking for functional language with C-like syntax and static typing. So far my choice would be Nemerle. Is there anything else/better? EDIT: second choice would be Lua or Go. Any pros and cons?


title: Building a serverless p2p CMS/System

text: I'm thinking about building an Open Source, serverless, offline-replicated p2p CMS, but I'm concerned about it really working in a real environment. How would you go about doing that, reducing the exposition to risks/bugs? _I've thought about this schema for now._ On the local device we have a folder called "cmsfiles" containing the software's files and a subfolder "database-shards", inside this subfolder we have: shard0.sqlite, shard1.sqlite, shard2.sqlite and so on.. each shard has a cap of 50GB. Inside these shards we'll assign the tables in a random way, being: comments, posts, answers, users etc. If a device visits a portal, it has read-only access and to interact it has to have a locally installed instance, with the same content as explained above. When he installs the software, he's asked for a nick and a password, that will then be saved on a private key for later verification. When a device does an insert (an answer to a post in this case), it has to send other information as well. _**Locally, the request is processed in the following way:_** The remote peer is asked for his ip address/proxy/tor-node and hardware UUID. A check is then done to determine if the remote peer is in the blacklist list, if TRUE, the whole operations/negotiations are discarded, but if it evaluate FALSE, a checking is done to see if it's present in the "breaking attempt log" list and if the number is less than 5 && not equal to 0, the number is ++incremented, at the same time all the operations are discarded with the remote peer. Else, if the number equal 0, we proceed to further verification. The remote peer's message (answer), private key and files in the "cmsfiles" folder are fetched. The files are now being compressed locally to cmsfiles.lz, hashing and comparing. This hash is then compared to the local one and if they're not equal, the number in the "breaking attempt log" list is ++incremented and all the operations being done discarded. But if they match, we proceed signing the remote private key with the public key, if it signs successfully, we check if the post (the answer) already exists. If it exists (if TRUE), the number in the "breaking attempt log" is ++incremented and any operation discarded, else (if FALSE) we check if post votes equal 0 (a new post cannot have more than 0 votes!), if it doesn't, the number in "breaking attempt log" list is ++incremented and any operations discarded. Otherwise, if it indeed equals 0 we can finally add the message (answer) to the local database. I'm including a tree schema representation just in case: ![example tree](http://i.stack.imgur.com/7m7Xe.jpg)


title: determine language limitations before development

text: It so happens that you are given a project specs and your knowledge about the language is very basic. There are features in the project that you have never worked with. But you have some ideas and logic on how this can be implemented.   Later on as the development continues you discover that the required features cannot be developed because of some language limitations or any other issues. Now you have to convince your client about this, which is not easy. **Edit** : the reason for working with not so comfortable technology is that,Company at times cannot afford to hire someone for this task. Hence relies on existing employees to learn something new and contribute. So how do I avoid such situations? How do I research about the features before accepting the project ?


title: How did the "Rails can't Scale" meme start?

text: One meme about Rails is that Rails can't Scale. Is it known how this meme started? Was there a particular blog post that argued this is the case?


title: Testing non-central features

text: Only 1% of our clients use particular features or scenarios. Do you think we should spend as much time testing these features and scenarios as we spend on our central features and scenarios, or we should test mostly the "happy path" for these features? **UPDATE** Maybe I should have asked the question in a different way. Do you think a company needs to spend more time testing the central features of its products? For example I assume the Windows 8 team tested the the boot sequence more in depth than they tested the driver for a very uncommon graphics card. The cost of a bug in a boot sequence is huge since no one would be able to use the OS. But a bug in a driver of an obscure GPU will hurt only a small client base.


title: I feel that my manager slows my work, how to deal with it?

text: It seems strange, but my manager sits right next to me and, well, when he isn't near, I feel free, and I'm planning, doing, etc, doing my work with flashes in the eyes, feel accomplishments. But everything is opposite when he's on his workplace, I simply have to force myself to do anything, I'm feeling very much worried and nervous and my brain doesn't work normally. How to deal with it?


title: Can I do anything to improve performance in VS 2010?

text: I'm using VS 2010 since we're developing an app in .Net 4 and the performance is driving me crazy. It's mostly bad when I don't view the IDE for a while (such as when I get pulled away for a help desk call or come in in the morning). I realize it's probably built in WPF which unloads its resources when unused, but the few minute delay while it loads everything back up is really annoying. I've also noticed some significant delays when opening files or compiling.


title: focusing on a language itself VS focusing on language + CS

text: So, I've been working on Ruby with the goal of self-employment (I'm an impoverished philosopher (not even in university!) and can't get a normal low- paying job). But there is a quandary in my road of learning and discovery: I keep getting sidetracked by CS (mostly theoretical). I'm starting to think that I should consciously stop myself from straying into the theoretical until I am, I dunno, not starving? :) So I would like opinions on whether or not my view is rational (I guess a better term would be pragmatic), and of course discussion in general relating to the interrelationship between language mastery and general CS mastery is welcome.


title: Which skills should I improve in order to become a professional software engineer?

text: > **Possible Duplicate:**   >  most desirable skills for a graduate software engineer I'm currently doing my PhD in physics and will be finished in about two years from now. I plan to become a software engineer afterwards. I'm now looking for advice on which skills I should improve during this time in order to reach my goal. My background: For my research I need to write my own programs. I've been programming every now and then since I was a child but only in the last 2.5 years I've actually spent a lot of time coding. I've got around 2 years of experience in C++ now and consider myself being good at it. Recently, I started learning Python. I didn't attend any university courses on algorithms, data structures or databases, so maybe I'm lacking some basic knowledge here. I thought about reading books on the following topics:   * General books like Code Complete or The Pragmatic Programmer.   * Test-driven programming and agile development methods (though I'm not sure how widely they are used in companies)   * Databases   * Algorithms and data structures I also thought about learning Java... What would you consider useful in my situation? Which skills are important for a company?


title: What does "downstream/upstream design" mean?

text: What does "downstream/upstream design" in software development mean?


title: Why can't Windows services have a GUI?

text: I was using this feature in earlier Windows release like XP and NT. I was able to run a GUI from a Windows service. But it is not possible in the later versions. What is the reason behind the removal of this feature? Why can't Windows services have a GUI?


title: Designing a fitness / weight lifiting routine database

text: I'd like to create an app similar to Barbell Pro for Android, for practice / interest / educational purposes really. Or even as another example for database purposes, Fitocracy The problem is, I have no idea how the database could be designed... For example:   * We have a 1000 Persons using the app    * Each Person could have 1-7 individualised WorkoutRoutines, depending on the day. (Perhaps even more -> AM workouts / PM workouts)    * Each WorkoutRoutine has an individual set of Exercises, with some crossover e.g. someone could do Bench Press on Monday and on Friday afterall.   * Each Exercise has a number of Sets   * Each Set has a number of Reps Now to me, this seems like it could potentially be a large amount of information to store for Each Person, and maybe pretty complicated to do so. I only have some experience with relational databases and I don't know how I'd go about designing that in an efficient matter for a relational database. I'm not asking for a design, just how I'd begin to go about it. The potential complexity is daunting for me due to lack of database experience. Maybe it's not even that complicated, but like I say, ignorance from myself.


title: Significance of many-to-many relationships?

text: How important are to-many relationships in iOS programming? Do you often hold a list of pointers to objects in an array in your codes? I don't think I fully understand the concept of to-many relationships, let alone how to implement them into code. From my current understanding, to-many relationships holds a list of pointers to one or more class objects and their corresponding properties and instance variables?


I'm writing some documentation in a project in a tool. In this tool of mine, and write in specific area, I have here use Case, Business Rule, N-Diagram Types, and Functionality and Functional Requirements. So I got me wondering, Are there differences between Functionality and Functional Requirements? In my vision, a Functionality a implementation of a Functional Requirement, is it correct? What other differences one can find between them?


title: What benefits do I get from learning Scheme?

text: I'm a java programmer and I've decided to learn a bit about theoretical computer science. I don't have a degree in that and a little background would help me a lot since I don't know anything other than coding when it comes to software development. I've searched this website for answers and I've found a lot of people recommending the book "Structure and Interpretation of Computer Programs" but since I don't have the required mathematical know-how to handle this book, I decided to go with "How to Design Programs" instead. My question here is what would I gain from this experience? Would it teach me about Computer Science like I want? Or am I better off reading about algorithms and data structures instead?


title: How should I go about re-releasing a GPL-licensed project?

text: A few months ago we found a library licensed under GPL that fit the bill for what we were looking to do at that time. We included it in our codebase and all was fine. Now, a few frantic months of coding later, we've refactored the hell out of the library: it's more feature complete, more stable, fully unit tested, PSR-0 compatible, etc. Now we would like to use the library in another one of our projects and that got me thinking, why not re-release the library? The problem is that I don't have any idea on how to attribute the work the original developers have put in (which is actually that much refactored that it's kinda unrecognizable) when releasing the library as GPL again. Over time all the file documentation headers with the original credits have been replaced and all that remains is the LICENSE file which is an exact copy of the GPL v3 license. I have absolutely no problem giving credit where it's due, but I would like to do it according to what is right in the FOSS world. Anyone can tell me how to proceed?


title: Possible to implement OOP without using extensive heap operations?

text: Is the concept of OOP intimately tied to allocating objects on the heap? Is it possible to write normal OOP without creating excessive objects on the heap?


title: PHP Framework for RESTful Web Service

text: I have been going round in circles with this question for days - which is the best PHP framework to use to create a RESTful Web service? I've trawled the web for info and have come across three main factors that are important:   * must have REST architecture built into the framework   * must be a stable application   * must be full featured It may be that what I want does not exists, but I wanted to check with the community to see of I had missed something. Currently the three contenders are: **CodeIgniter** Is a very stable framework with a large community and plenty of features and 'extensions'. Issue is that it's not RESTful. I have found a RESTful controller but there are a few things that I don't like about it. Mainly that it does not seem to correctly use the HTTP methods as per the RESTful architecture definition. I think this stems from restrictions in the CodeIgniter core though. **Yii** Again, seems like a large community and is stable with plenty of features, but not RESTful. **Laravel** A framework that is RESTful straight out of the box, and it has a good amount of features. The issue is that this is a relatively new framework so lacks stability. Other frameworks I've considered: Zend \- from what I've read, avoid unless writing Enterprise software. Recess \- RESTful, but seems very inactive and under used. **UPDATE:** In the end I went for Laravel. Can't recommend it enough! I had a RESTful API up and running in a week and also a simple web client. Amazing framework.


How does Facebook calculate mutual friends? Does it cache all mutual friends for each user? Does it use MySQL to calculate mutual friends with a query?


title: More Powerful language for client-side web apps: JavaScript or C#?

text: Concerns over Microsoft's future with Silverlight, HTML 5 and Windows 8 have led me to reconsider plans to develop a business app over the next few years in Silverlight. It can be difficult to define what powerful means. Here I mean to ask this as power in the sense that Paul Graham describes, as what you can express with the language. I'm not sure but it seems that even the latest features of C# 4.0 such as dynamic types, anonymous functions, closures, and even LINQ exist in JavaScript. Do you think there are plans to add additional power to the JavaScript language in its next release? Also, to deal more with the HTML5/JavaScript stack vs. the Silverlight/C# stack: which is or will be more powerful in the sense of what capabilities it gives to developers and their applications? e.g. WCF communication, tools, UI controls...


title: Is there a large bank using Mysql or PostgreSQL?

text: I always thought the largest scale of banks use Oracle. However, there is no proof they really use Oracle instead of Mysql or PostgreSQL, nobody knows the secret. Any idea what they really use? Can i build an ATM/Bank system where millions of transaction will happen using Mysql? Can I use PostgreSQL? Or must I use Oracle only?


title: What are the programming languages that never outdated and programs created be able to run for next 20 years?

text: I want to know what are the programming languages that have longevity? I mean, code that written today be able to run for next 20 years or so?


title: Algorithm for an exact solution to the Travelling Purchaser Problem

text: do you know of any algorithms which give an exact solution for the Traveling Purchaser Problem. I can only find heuristic and probabilistic approaches. I do have implemented a genetic algorithm so far, which by its nature does not terminate by itself an does not always yield the optimal result. Thus I'm looking for an exact solution to the problem such that I'm able to compare my solution to an exact / optimal value for a given test data set. For those of you who haven't heard of the Traveling Purchaser Problem (TPP), _this is_ **_not_** _the Traveling Salesman Problem (TSP)_ , but a generalization of it. It thus is also NP-hard.


title: Using someone else's code in your commercial products

text: Is it acceptable to use code made by other people that was deliberately made to be shared amongst Web developers? Things such as long libraries of code that contain hundreds of lines of code that you may want to copy rather than write yourself because it is too long and complicated. Is this unacceptable and frowned upon in the programming community simply because everyone is required to write all their code themselves and no copying to speed things up is allowed? Also, do you think large organizations would copy pre-made code that has been made to be used to speed the process of programming web development up? Must they write every single line of code themselves?


title: How can I test linkable/executable files that require re-hosting or retargeting?

text: _Due to data protection, I cannot discuss fine details of the work itself so apologies_ **PROBLEM CASE** Sometimes my software projects require merging/integration with third party (customer or other suppliers) software. these software are often in linkable executables or object code (requires that my source code is retargeted and linked with it). When I get the executables or object code, I cannot validate its operation fully without integrating it with my system. My initial idea is that executables are not meant to be unit tested, they are meant to be linkable with other system, but what is the guarantee that post- linkage and integration behaviour will be okay? There is also no sufficient documentation available (from the customer) to indicate how to go about integrating the executables or object files. I know this is philosophical question, but apparently not enough research could be found at this moment to conclude to a solution. I was hoping that people could help me go to the right direction by suggesting approaches. To start, I have found out that Avionics OEM software is often rehosted and retargeted by third parties e.g. simulator makers. I wonder how they test them. Surely, the source code will not be supplied due to IPR rgulations. **UPDATE** I have received reasonable and very useful suggestions regarding this area. My current struggle has shifted into testing 3rd party OBJECT code that needs to be linked with my own source code (retargeted) on my host machine. How can I even test object code? Surely, I need to link them first to even think about doing anything. Is it the post-link behaviour that needs to be determined and scripted (using perl,Tcl, etc.) so that inputs and outputs could be verified? No clue!! :( thanks,


title: Using MVP, how to create a view from another view, linked with the same model object

text: _**Background_** We use the Model-View-Presenter design pattern along with the abstract factory pattern and the "signal/slot" pattern in our application, to fullfill 2 main requirements Enhance testability (very lightweight GUI, every action can be simulated in unit tests) Make the "view" totally independant from the rest, so we can change the actual view implementation, without changing anything else In order to do so our code is divided in 4 layers : Core : which holds the model Presenter : which manages interactions between the view interfaces (see bellow) and the core View Interfaces : they define the signals and slots for a View, but not the implementation Views : the actual implementation of the views When the presenter creates or deals with views, it uses an abstract factory and only knows about the view interfaces. It does the signal/slot binding between views interfaces. It doesn't care about the actual implementation. In the "views" layer, we have a concrete factory which deals with implementations. The signal/slot mechanism is implemented using a custom framework built upon boost::function. Really, what we have is something like that : http://martinfowler.com/eaaDev/PassiveScreen.html Everything works fine. _**The problem_** However, there's a problem I don't know how to solve. Let's take for example a very simple drag and drop example. I have two ContainersViews (ContainerView1, ContainerView2). ContainerView1 has an ItemView1. I drag the ItemView1 from ContainerView1 to ContainerView2. ContainerView2 must create an ItemView2, of a different type, but which "points" to the same model object as ItemView1. So the ContainerView2 gets a callback called for the drop action with ItemView1 as a parameter. It calls ContainerPresenterB passing it ItemViewB In this case we are only dealing with views. In MVP-PV, views aren't supposed to know anything about the presenter nor the model, right ? How can I create the ItemView2 from the ItemView1, not knowing which model object is ItemView1 representing ? I thought about adding an "itemId" to every view, this id being the id of the core object the view represents. So in pseudo code, ContainerPresenter2 would do something like itemView2=abstractWidgetFactory.createItemView2(); this.add(itemView2,itemView1.getCoreObjectId()) I don't get too much into details. That just work. The problem I have here is that those itemIds are just like pointers. And pointers can be dangling. Imagine that by mistake, I delete itemView1, and this deletes coreObject1. The itemView2 will have a coreObjectId which represents an invalid coreObject. Isn't there a more elegant and "bulletproof" solution ? Even though I never did ObjectiveC or macOSX programming, I couldn't help but notice that our framework is very similar to Cocoa framework. How do they deal with this kind of problem ? Couldn't find more in-depth information about that on google. If someone could shed some light on this. I hope this question isn't too confusing ...


title: What are the deciding factors in choosing to expose a web service as a SOAP or REST service?

text: As far as I can see consuming SOAP requires a SOAP stack, so it is harder for your clients to consume i.e. they need to ensure that they have a SOAP stack in place that formats the POST data and the headers correctly and then gives you back some data structure, whereas with REST you just make an HTTP GET request with the arguments in the query string and get back some text that I guess is probably XML. So what does the extra overhead / complexity of SOAP give you, when do you need it and when could you and should you do without it?


title: How do I convince my boss to use REST over SOAP?

text: We need to create an API to our system. How do I convince my boss that REST is a better option than SOAP (or XML-RPC)? I say REST is...   * easier to implement and maintain   * not much new to learn -- plain old HTTP   * lot of people have chosen it Yahoo ~ Facebook ~ Twitter   * will be lot quicker to code My boss says SOAP is...   * richer and more expressive   * it's all standard XML (SOAP, WSDL, UDDI) -- and so will be easier to consume   * well standardized than REST   * Google uses a lot of SOAP   * it is important to adhere to SOAP standards than to create a custom XML schema in REST


title: Why the question "give five things you hate about C#" is so difficult to answer during an interview?

text: In podcast 73, Joel Spolsky and Jeff Atwood discuss, among other subjects, "five things everyone should hate about their favorite programming language": > If you’re happy with your current tool chain, then there’s no reason you > need to switch. However, if you can’t list five things you hate about your > favorite programming language, then I argue you don’t know it well enough > yet to judge. It’s good to be aware of the alternatives, and have a healthy > critical eye for whatever it is you’re using. Being curious, I asked this question to any candidate I interviewed. None of them were able to quote at least one thing they hate about C#¹. Why? What's so difficult in this question? It is because of the stressful context of the interview that this question is impossible to answer by the interviewees? Is there something about this question which makes it bad for an interview? * * * Obviously, it doesn't mean that C# is perfect. I have myself a list of five things I hate about C#:   * The lack of variable number of types in generics (similar to `params` for arguments).   `Action<T>`,   `Action<T1, T2>`,   `Action<T1, T2, T3>`,         ⁞   `Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>`   Seriously?!   * The lack of support for units of measure, like in F#.   * The lack of read only properties. Writing a backing `private readonly` field every time I want a read only property is boring.   * The lack of properties with default values. And yes, I know that I can initialize them in the parameterless constructor and call it from all other constructors. But I don't want to.   * Multiple inheritance. Yes, it causes confusion and you don't need it in most cases. It's still useful in some (very rare) cases, and the confusion applies as well (and was solved in C#) to the class which inherits several interfaces which contain methods with the same name. I'm pretty sure that this list is far from being complete, and there are much more points to highlight, and especially much better ones than mine. * * * ¹ A few people criticized some assemblies in .NET Framework or the lack of some libraries in the framework or criticized the CLR. This doesn't count, since the question was about the _language_ itself, and while I could potentially accept an answer about something negative in the core of .NET Framework (for example something like the fact that there is no common interface for `TryParse`, so if you want to parse a string to several types, you have to repeat yourself for every type), an answer about JSON or WCF is completely off-topic.


title: use of LGPL libraries in closed source android software

text: I'm investigating the legal issues of using LGPL native libraries in a closed source Android software. As for now, my research on the subject shows that using LGPL libraries in closed source software is doable, and that the requirements are not specially high. On a regular application (for example a C closed source application), I would dynamically link the library, and distribute the binaries of the application along with the library with proper reference to it and instruction on how to replace this library with the version the user would like to. (I may be forgetting some stuff here but this is not the point of my question). My question refers to Android software and JNI. Assuming I am building an Android software using JNI I do have : My java source A JNI folder including :   * Android.mk file for the compilation of the application   * the library source code   * _.cpp/_.h files linking the source code with JNI  To compile my application, two steps are required :   * Compilation of the library using NDK to generate a *.so file    * Compilation of the Android application using Ant. The java code includes a System.loadlibrary("nameOfTheLibrary") The problem I am facing is that the source code of the library is first compiled to a *.so file. This can be considered as derivative work, am I right ? How could I include the native LGPL libraries and distribute it in a proper way to avoid any legal problems ?


title: Maintaining independence between modules

text: I am reading Algorithms 4th Edition by Robert Sedgewick and in chapter 1.2 it discusses API design. It says: "The key to success in modular programming is to maintain independence between modules. We do so by insisting on the API being the only point of dependence among modules." Now the book is based on Java. I am considering this in terms of C++ development (but I imagine concepts are similar). Is this suggesting that if I have a library eg to do networking, that if a client #includes my net.hpp header (fictional name) and maybe sets to link with net.lib then no other includes or libraries should be required? Is that the jist of this? Or is there something else?


title: Under what license may this PyQt-based "Hello World" app be distributed?

text: **Update:** I was wrong about the PyQt license. It isn't merely a GPL license. The PyQt authors include a special set of exceptions that allow users to release their own code under a different license, as long as it is one of the Open-Source licenses specifically listed in the PyQt `GPL_EXCEPTION.TXT` file. * * * For the purpose of this discussion, consider the following fully-functional app, which depends on PyQt:               # hello_world.py     from PyQt4.QtGui import QApplication, QPushButton     app = QApplication([])     button = QPushButton("Hello, World!", clicked=app.quit)     button.show()     app.exec_()      (In case it's relevant to the discussion, please note that Python programs like this one do not require "linking" per se.) My preference is to distribute my code under a **permissive** license, e.g. the BSD license. However, PyQt is released under the ~~GNU GPL~~ **GNU GPL with special exceptions**. With that in mind, what are my options here? Am I obligated to release under the GPL, even if I don't distribute PyQt itself? To be more specific, in which (if any) of the following scenarios am I permitted to release my code under the BSD license vs. being obligated to release under the GPL?   * **Scenario 1:** I give you a fully-packaged binary that includes `hello_world.py` and PyQt.   * **Scenario 2:** I give you the source code of `hello_world.py` and PyQt in a single download (say, a `.tar.gz`), but it's up to you to get them running together.   * **Scenario 3:** I give you `hello_world.py` alone, leaving you to obtain PyQt on your own. I know that most of us aren't lawyers, so it is very much appreciated if you can cite the sources your answer is based on.


title: Do you think code is self documenting?

text: This is a question that was put to me many years ago as a gradute in a job interview and it's nagged at my brain now and again and I've never really found a good answer that satisfied me. The interviewer in question was looking for a black and white answer, there was no middle ground. I never got the chance to ask about the rationale behind the question, but I'm curious why that question would be put to a developer and what you would learn from a yes or no answer? From my own point of view, I can read Java, Python, Delphi etc, but if my manager comes up to me and asks me how far along in a project I am and I say "The code is 80% complete" (and before you start shooting me down, I've heard this uttered in a couple of offices by developers), how exactly is that self documenting? Apologies if this question seems strange, but I'd rather ask and get some opinions on it to gain a better understanding of why it would be put to someone in an interview.


title: Pros and cons of working at a company that uses a lot of its own frameworks

text: I have an opportunity to work in a company that looks good from the outside but has something that bothers me. It doesn't use commercial technologies. The main language that will be used is Java but the company doesn't use all known technologies like Spring, Struts, Hibernate etc. Instead it has its own technologies that do pretty much the same. Can you tell me what are the pros and cons about working in such a company?


title: What is a closure?

text: Every now and then I see "closures" being mentioned, and I tried looking it up but Wiki doesn't give an explanation that I understand. Could someone help me out here?


title: Refreshing website design and architecture

text: I have a website that is build with asp.net web forms. I would like to refresh design (using css, html5, responsive design) and also change it from web forms to asp.net MVC. To me this is more of a frontend project. Since there is already existing backend, it is "only" necessary to reuse it in MVC. Should I first start with design update or MVC? This project if far more easier, than starting a new website from the start, or am I mistaken?


title: Creating classes according to a struct

text: I get a array via SOAP service, in the array in each value which is a struct is a description of any visual components (size, position, default value etc.) like CheckBox, RadioButton etc. And I wonder about how to write a code which will return instances of those any visual components according to the input parameter with usage a design pattern. Which design pattern is the best for this purpose?


title: Avoid too complex method - Cyclomatic Complexity

text: Not sure how to go about this method to reduce Cyclomatic Complexity. Sonar reports 13 whereas 10 is expected. I am sure nothing harm in leaving this method as it is, however, just challenging me how to go about obeying Sonar's rule. Any thoughts would be greatly appreciated.                public static long parseTimeValue(String sValue) {              if (sValue == null) {             return 0;         }              try {             long millis;             if (sValue.endsWith("S")) {                 millis = new ExtractSecond(sValue).invoke();             } else if (sValue.endsWith("ms")) {                 millis = new ExtractMillisecond(sValue).invoke();             } else if (sValue.endsWith("s")) {                 millis = new ExtractInSecond(sValue).invoke();             } else if (sValue.endsWith("m")) {                 millis = new ExtractInMinute(sValue).invoke();             } else if (sValue.endsWith("H") || sValue.endsWith("h")) {                 millis = new ExtractHour(sValue).invoke();             } else if (sValue.endsWith("d")) {                 millis = new ExtractDay(sValue).invoke();             } else if (sValue.endsWith("w")) {                 millis = new ExtractWeek(sValue).invoke();             } else {                 millis = Long.parseLong(sValue);             }                  return millis;              } catch (NumberFormatException e) {             LOGGER.warn("Number format exception", e);         }              return 0;     }      All ExtractXXX methods are defined as `static` inner classes. For example, like one below -                   private static class ExtractHour {           private String sValue;                public ExtractHour(String sValue) {              this.sValue = sValue;           }                public long invoke() {              long millis;              millis = (long) (Double.parseDouble(sValue.substring(0, sValue.length() - 1)) * 60 * 60 * 1000);              return millis;          }      }      * * * ## UPDATE 1 I am going to settle down with a mix of suggestions here to satisfy Sonar guy. Definitely room for improvements and simplification. Guava `Function` is just a unwanted ceremony here. Wanted to update the question about current status. Nothing is final here. Pour your thoughts please..               public class DurationParse {          private static final Logger LOGGER = LoggerFactory.getLogger(DurationParse.class);     private static final Map<String, Function<String, Long>> MULTIPLIERS;     private static final Pattern STRING_REGEX = Pattern.compile("^(\\d+)\\s*(\\w+)");          static {              MULTIPLIERS = new HashMap<>(7);              MULTIPLIERS.put("S", new Function<String, Long>() {             @Nullable             @Override             public Long apply(@Nullable String input) {                 return new ExtractSecond(input).invoke();             }         });              MULTIPLIERS.put("s", new Function<String, Long>() {             @Nullable             @Override             public Long apply(@Nullable String input) {                 return new ExtractInSecond(input).invoke();             }         });              MULTIPLIERS.put("ms", new Function<String, Long>() {             @Nullable             @Override             public Long apply(@Nullable String input) {                 return new ExtractMillisecond(input).invoke();             }         });              MULTIPLIERS.put("m", new Function<String, Long>() {             @Nullable             @Override             public Long apply(@Nullable String input) {                 return new ExtractInMinute(input).invoke();             }         });              MULTIPLIERS.put("H", new Function<String, Long>() {             @Nullable             @Override             public Long apply(@Nullable String input) {                 return new ExtractHour(input).invoke();             }         });              MULTIPLIERS.put("d", new Function<String, Long>() {             @Nullable             @Override             public Long apply(@Nullable String input) {                 return new ExtractDay(input).invoke();             }         });              MULTIPLIERS.put("w", new Function<String, Long>() {             @Nullable             @Override             public Long apply(@Nullable String input) {                 return new ExtractWeek(input).invoke();             }         });          }          public static long parseTimeValue(String sValue) {              if (isNullOrEmpty(sValue)) {             return 0;         }              Matcher matcher = STRING_REGEX.matcher(sValue.trim());              if (!matcher.matches()) {             LOGGER.warn(String.format("%s is invalid duration, assuming 0ms", sValue));             return 0;         }              if (MULTIPLIERS.get(matcher.group(2)) == null) {             LOGGER.warn(String.format("%s is invalid configuration, assuming 0ms", sValue));             return 0;         }              return MULTIPLIERS.get(matcher.group(2)).apply(matcher.group(1));     }          private static class ExtractSecond {         private String sValue;              public ExtractSecond(String sValue) {             this.sValue = sValue;         }              public long invoke() {             long millis;             millis = Long.parseLong(sValue);             return millis;         }     }          private static class ExtractMillisecond {         private String sValue;              public ExtractMillisecond(String sValue) {             this.sValue = sValue;         }              public long invoke() {             long millis;             millis = (long) (Double.parseDouble(sValue));             return millis;         }     }          private static class ExtractInSecond {         private String sValue;              public ExtractInSecond(String sValue) {             this.sValue = sValue;         }              public long invoke() {             long millis;             millis = (long) (Double.parseDouble(sValue) * 1000);             return millis;         }     }          private static class ExtractInMinute {         private String sValue;              public ExtractInMinute(String sValue) {             this.sValue = sValue;         }              public long invoke() {             long millis;             millis = (long) (Double.parseDouble(sValue) * 60 * 1000);             return millis;         }     }          private static class ExtractHour {         private String sValue;              public ExtractHour(String sValue) {             this.sValue = sValue;         }              public long invoke() {             long millis;             millis = (long) (Double.parseDouble(sValue) * 60 * 60 * 1000);             return millis;         }     }          private static class ExtractDay {         private String sValue;              public ExtractDay(String sValue) {             this.sValue = sValue;         }              public long invoke() {             long millis;             millis = (long) (Double.parseDouble(sValue) * 24 * 60 * 60 * 1000);             return millis;         }     }          private static class ExtractWeek {         private String sValue;              public ExtractWeek(String sValue) {             this.sValue = sValue;         }              public long invoke() {             long millis;             millis = (long) (Double.parseDouble(sValue) * 7 * 24 * 60 * 60 * 1000);             return millis;         }     }      } * * * ## UPDATE 2 Though I added my update, it is only that much worth the time. I am going to move on since Sonar now does not complains. Don't worry much and I am accepting the mattnz answer as it is the way to go and don't want to set a bad example for those who bumps on to this question. Bottom line -- Don't over engineer for the sake of Sonar (or Half Baked Project Manager) complains about CC. Just do what's worth a penny for the project. Thanks to all.


title: Is a well written documentation a good enough reason for learning a programming language?

text: I am learning Python currently which wasn't part of my college curriculum. I was asked in an interview why I chose Python and I replied that it is easy to learn and the documentation is very well written. The interviewer didn't reply whether it was a good enough reason. He looked convinced but I cannot be sure. Is a well written documentation along with ease of learning a good enough reason for choosing a scripting language? Or should I have elaborated more about the availability of Python libraries and bigger user base of Python? Just a note. Python wasn't required for the job. The company worked on Ruby- on-rails. Python was in my resume and I think the interviewer just wanted to know what considerations I made as a fresher while choosing a programming language.


title: SaaS / PaaS / IaaS / HaaS

text: I've read:   * IaaS, PaaS and SaaS Terms Clearly Explained and Defined and   * Cloud Computing – Demystifying SaaS, PaaS and IaaS And I've got 2 questions:   1. Is Google App Engine considered PaaS or IaaS?   2. Is HaaS a subset of IaaS or is HaaS really just another name for IaaS?


title: How To Document an Object Oriented Design in Text

text: For my next project, I'm looking to document my Object Oriented design in simple text before jumping the gun to code it up. I want to do this for two reasons.   1. I want to give proper thought to my design and possibly revise it several times.   2. I haven't exactly decided which language I want to implement my project in. I'm looking for a convention to outline my design in simple text, instead of a UML diagram. I like the convenience of text. I can version control it and easily put in a blog or wiki to share it. I am thinking something concise e.g. how you might code in Python. However, I want the representation to be language independent. I've looked around the internet but couldn't find anything. The closest would probably be how properties and methods are defined in the box representing a class in a UML Model. **Update:** I just wanted to clarify "in Text". My goal is to be able to outline the object model in a github wiki. I imagine it being kind of an open source design in addition to code. Thus, I can create a Wiki page per entity and identify the relationships using links and formatting etc. However, what I wanted suggestions on was how to outline the specification of an entity on its page.