instruction
stringlengths
34
36.1k
I often feel that there's something wrong when I code blocks such as: function foo (arg){ // arg: a SomeClass object ... } or function foo (arg){ if (Object.prototype.toString.apply(arg) !== '[object Array]') throw new Error("Parameter must be an array"); ... } . With a statically typed language I...
It appears that many interview related questions on this site are focused on testing traditional CS knowledge, such as: Algorithms Data structures Programming language/environments Obviously the site is called "programmers", so that is to be expected. However, I'd also argue that there are many other aspects that m...
Herein, we consider a server-client architecture. Suppose we keep the details flexible, but there's more than one layer of servers supporting our hypothetical service. The general question is "When and how much do I validate client data?". From other questions and answers I've read, the answer may be summarized as one ...
I'm a PHP / Java / Objective-C programmer, looking to finally learn some MS technologies, to increase my marketability, etc. I am looking at these two books, can anyone experienced in the field suggest one over the other, or another book that'd be good for learning C# / .Net, etc? What impressed me about "Pro C# 2010 a...
We have a legacy database full of stored procedures. These stored procedures are somewhat CRUD-categorized but upon inspection of some procedures, they are not "simple" as they might update, delete, whatever other records in other tables. So to my mind (correct me if I'm wrong) it would seem that using an ORM would be ...
I have multiple projects on Git that I eventually want to bring others into. However, right now it's just me and I use Git and GitHub very simplistically: no branches and basically just using the commits as a backup to my local files. Sometimes I'll go back and look at previous versions of my files for reference, but I...
I'm a self taught programmer; I understand the foundations of programming and what classes are, but my code tends to be messy with class methods interacting with a half a dozen other classes, and my structure is terrible. If someone else were to look at my code, I don't think they would be able to understand what was ...
I wrapping up an application I'm writing that I'm hoping will get a decent user base. It will be free and open source, but I'm interested in collecting some analytic data on the install base. Essentially a small version of Google Analytics, but for a desktop application instead of a website. Details I would like to co...
Pretty simple question, but something I haven't been able to find out. Who was the first person to describe the idea of a pointer? The abstract concept itself?
I believe I have a very good understanding of programming logic fundamentals (passing around variables, nested conditional statements, etc). I am currently going through a book on ASP.NET and am pretty much lost on all the Page Rendering Model, Custom Rendered Controls, Composite Controls, etc. I understand how to use ...
Being a young and fairly inexperienced developer recently employed by a "real" software company I'd like some opinions and pointers on how to do the following: Approaches on how to get familiar with a companies products , especially when you've no idea how it all works. The company I'm at now has one HUGE product , con...
I have seen a lot of exceptions - custom or integrated in the language (PHP) itself that have no differences but their class name. When extending default exceptions to use within your own code, are there any other things you could implement that are useful besides the more specific exception name that do not violate th...
In our company we have to dismiss a software and introduce a new one. I have received the task to follow and take care of the whole data migration. We use 3 different data sources (each containing different kind of information), whose records have to be merged into a unique target DB. Since the new DB has a different ...
Back in school some 10+ years ago, they were teaching you to use exception specifiers. Since my background is as one of them Torvaldish C programmers who stubbornly avoids C++ unless forced to, I only end up in C++ sporadically, and when I do I still use exception specifiers since that's what I was taught. However, the...
Currently we are working on some storage problems for log data from various servers and communication message logs (HTTP(S), XMPP). There will be many write operations and for read operations we will use search queries with filters. Should we stick with the classic relation database schema solution or concentrate on Ca...
I need a tool (for in house usage) that will format SQL code (SQL Server/MySQL). There are various 3rd party tools and online web sites that do it but no exactly how I need it. So I want to write my own tool that will fit my needs. First question is there any standard or a convention for how the SQL code should be for...
Being careful is usually enough to prevent problems, but sometimes I need to double check the branch I'm working on (e.g. "hmm... I'm in the dev branch, right?") by checking the source control path of a random file. In looking for an easier way, I thought of naming the solution files accordingly (e.g. MySolution_Dev....
I have a general question about the placement of javascript code in a AJAX-driven web application. At a previous job, we tended to throw everything in one monolithic file. When maintaining that file became too difficult, we split it up into multiple smaller files and "glued" them back together with a php "loader" (pret...
It seems to be a naive question, but I was unable to find an explicit definition and difference in meaning of the words "software", "program", "application", and "gadget". What is the correct (at least theoretically) way to use each of these words?
I face a problem nowadays, I have a really good book that explain OOP but it uses a language which I do not want to learn which is Java because my goal is to learn C#. And I don't know if I should understand OOP with Java at first and then learn C# or should I find any C# book even if the Java book is excellent in teac...
Trying to implement chart API in Java. But I am unsure of the mathematical formulas/concepts used in drawing each of the chart type. Can someone specify the mathematical concepts to be known for drawing each sort of the chart.
This one might get me slaughtered, since I'm pretty sure it's bad coding practice, so here goes: I have an AJAX driven site which loads both content and javascript in one go using Mootools' Request.HTML. Since I have initialization scripts that need to be run to finish "setting up" the template, I include those in a fu...
(FYI: I've just moved this question over from Stackoverflow on recommendation.) I just received a few emails, informing me that softpedia.com has added some of my "products" to their "database of scripts, code snippets and web applications". My products are in this case some smaller open source projects, which I have h...
I am working on a product that requires devices to exists anywhere in the world hooked up to the internet though cell modems or on WLAN lines which communicates to a server(s) that exists elsewhere in the world. When deigning the networking portion of the program i cant figure what the best option is for securing the ...
My team and I are very keen on doing Scrum "manual"-style (with paper and scissors). Though, we are struggling to find a tool to manage our backlog. The main requirements are: To be able to print the backlog in cards to stick to the whiteboard To be able to assign backlog items to the releases manually So far we hav...
I am writing an app at the moment that has some pretty extensive business logic based around dates. I have several hundred thousand records to test and testers who want to see how those records are handled, which has worked well so far, however, some edge cases are difficult to replicate. The reason is that most of the...
Our supplier's webservice is returning address objects (~30 fields) and I'm using LINQ and reflection to store the returned data straight into the databse. I loop over the attributes and set the value from the object to the LINQ class. I'm fairly new to refection and I'm worried this may be bad practice; it saves ~30 ...
Today I was having a discussion with a colleague that ViewModel is a general concept and existed before MVVM pattern. I believe ViewModel term is used anytime you create a class with Model like properties for showing on View that supports data binding like in ASP.NET and even in WinForms. Is the opposite true? Did Micr...
Take the original Boyer-Moore paper, for instance. It seems every time I look for an algorithm the paper I see referenced is talking about implementation idiosyncrasies on a PDP-10 or PDP-11. I know these were popular machines at one time, but not so popular as to account for the large number of references I see. Is th...
Background At a medical facility, staff can remove patient records (file folders) from a room. The room is locked using a standard tumbler lock (i.e., no swipe cards). The medical facility does not have much funding available. All staff members have a computer in their office (some computers are several years old). All...
I'm working with a DB2 database and I can't help but notice - these table and column names are really confusing! I realize that good names are important in every facet of software development, and it's quite possible that the non-intuitive names are unique to my experience, but someone told me that DB2 places severe re...
There are a ton of questions on Programmers.SE about whether or not taking extended time off is a good idea and what to do during that time off to maintain your skill level: https://softwareengineering.stackexchange.com/questions/31536/will-taking-two-years-off-for-school-in-a-related-field-destroy-a-mid-level-devel ht...
Today at work I did an update to production. The update involved replacing old items from two tables with new data. I of course did a back up of the tables before that. Well, now 6 hours after getting home I realized at shower that there was a foreign key reference on cascade delete for many tables and when I replaced ...
In my application I have several event handlers that perform some action in response to user interface events such as a button click or menu selection. The code in these event handlers looks like this for example: void MyDialog::OnCommandLoadFile() { char strFilter[] = { "Text Files (*.txt)|*.txt|All Files (*.*)|*...
I think I remember reading somewhere that one of the principles of good OO design is to write methods which take the least derived type possible, but return the most derived type possible? First, is there such a principle and second, what name would it go by? I'm looking for the name so that when I mentor other devel...
Second of all, I was wondering if anyone knew what the difference was between exceptions (in the realm of exception control flow) and Exceptions (such as used in Java). But are they there to basically protect the system from crashing by terminating the user program?
I recently enabled two factor authentication for my Google account. One of the ways of getting the second factor (the key that I have) is to install an Android app on my phone that displays a key for a short duration of time. What does it take to create a web server solution paired with a smartphone solution? I am usin...
For the past year I have been working on a series of applications all based on the Zend framework and centered on a complex business logic that all applications must have access to even if they don't use all (easier than having multiple library folders for each application as they are all linked together with a common ...
If Javascript is only allowed to access scripts from the same domain, how can a website create mashups which must read and modify content from another domain?
Here's the job I want to do: My project is a website where there will be a lot of comments. Those comments will be moderated: a moderator will connect, see comments and accept or refuse them. I need those things: the comments won't have any "moderator" associated. Which implies that when a moderator connects, the syst...
Possible Duplicate: How important is Domain knowledge vs. Technical knowledge? I often hear from my colleagues and sometimes from interviewers that, "There is nothing so great in having excellent programming knowledge. One must gain the domain knowledge as the 1st priority. If you have a good domain knowledge, ...
I'm a .NET developer and I've used TFS (team foundation server) as my source control software many times. Good features of TFS are: Good integration with Visual Studio (so I do almost everything visually; no console commands) Easy check-out, check-in process Easy merging and conflict resolution Easy automated builds B...
I've never written a php class before from scratch. But I guess you have to start somewhere right? I've got an idea, but need help with logic. Please tell me what you think. Below is shorthand obviously. In the planning stages. Class - -> type (recurring, single, day) -> Recurring days (4,2,3,4,1,2....etc. for ...
Possible Duplicate: Should newbies use IDE autocomplete (Intellisense)? I have a friend at school who wrote a program in VB.net in notepad, took it home fixed any errors that came up, and then compiled it. He used a textbook to get the hang of the relatively basic methods and properties he'd need (nothing complicate...
I was reading a topic on SO: Why are scripting languages (e.g. ...) not suitable as shell languages?. Especially I liked the answer by Jörg W Mittag, from which I learned interesting things about Windows PowerShell. So after more than 20 years Windows finally has a well designed shell (Windows 1.0 - 1985, PowerShell st...
Our company is starting a fairly large SOA initiative. We're doing a lot of stuff right: there's good communication; money for tools where appropriate; and we have brought on some good expertise to help us with the transition. We're trying to develop standards that we can follow as a group, and one of the proposed sta...
A friend in academia asked me for advice (I'm a C# business application developer). He has a legacy codebase which he wrote in Fortran in the medical imaging field. It does a huge amount of number crunching using vectors. He uses a cluster (30ish cores) and has now gone towards a single workstation with 500ish GPUS in ...
I have developed this android application and I am looking to port it to iOS. My questions are: 1) I am planning to finance the iOS development with the money earn't from the android sales which is about $200 at the moment. Would it be reasonable to get the project done for this amount even if it is outsourced to elan...
Is there a language or language feature that can handle "when" cases? That is, whenever some condition becomes true, in any scope or context, that extra code could be specified to execute? Note that this is different from a simple if, which must be in a particular scope and explicitly written. This when clause would al...
Is it perhaps time for enterprise systems to be developed to strict enforced standards? Many books list optional 'standards' and best practices, but these are purely suggested practices. Still, every time I look at the code for an enterprise system I have not been a part of, I spend a lot of time trying to work out the...
Firstly, I realize that this is a programming Q&A site, and not a place for legal advice.... Just trying to get a basic idea of what the downsides to using an LGPLv3 library might be. What are the differences between GNU LGPL v2.1 and GNU LGPL v3? In particular, I know that regular GPLv3 has many anti-drm and anti-...
I heard somewhere that C# 5 async-await will be so awesome that you will not have to worry about doing this: if (InvokeRequired) { BeginInvoke(...); return; } // do your stuff here It looks like the callback of a await operation will happen in the original thread of the caller. It has been stated several times...
I am looking into developing a C++ application to parse xml (using the rapidxml framework), and I would like some advice on how to approach this. The file I want to parse is a XML game file that defines a set of addons for a starship ('outfits'), which have several attributes in common (like name and cost), but also fa...
People often claim that they are following a '3-tier (or n-tier) architecture', and sometimes they then claim to be switching to a Domain Model. But I really never have understood what this mythical '3-tier architecture' is. It seems to have no formal definition. Whereas there are numerous references and examples aroun...
Per the Official Google Blog: Code Search, which was designed to help people search for open source code all over the web, will be shut down along with the Code Search API on January 15, 2012. Google Code Search is now gone, and since that makes it much harder to understand the features it presented, here's my at...
I have a device that can measure different values over time, one sample per second. After one measurement run I can export the data in form of a CSV-file. One row per second with timestamp and about 20 columns (values). The question now is how to store these data masses to make the data accessable. I want to work with ...
This post by Rob Conery (note the slug) says that development environment should be run inside a virtual machine. I see what he's saying and tend to agree, but still feel a little uneasy. Now that virtualization is so mature that even production systems run inside VMs speed is pretty much a non-issue, but as I say some...
I am learning functionnal programming with Haskell, and I try to grab concepts by first understanding why do I need them. I would like to know the goal of arrows in functional programming languages. What problem do they solve? I checked http://en.wikibooks.org/wiki/Haskell/Understanding_arrows and http://www.cse.chalme...
I am looking into writing a web service API and I am thinking of creating a REST service. What does OData means in this context? Can you please explain the difference between OData and REST?
I'm interested in forking a project released under a two-clause BSD license: Copyright (c) 2010 {copyright holder} All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: (1) Redistributions of source code...
In my work the language used to write applications is Visual Basic .NET. I read on internet and almost all the examples and questions are about C#. Is there any comercial application written in Visual Basic .NET? Is there any field for a VB Net developer?
If one looks at (perhaps older) manuals of Drools or some other rule engines, one of the illustrations of their added value is solving puzzles such as the Miss Manners puzzle (listed in the Drools Documentation). Now, such puzzles are naturally formulated and solved using Prolog or the more recent Constraint Programmin...
I'm a big fan of Git sub-modules. I like to be able to track a dependency along with its version, so that you can roll-back to a previous version of your project and have the corresponding version of the dependency to build safely and cleanly. Moreover, it's easier to release our libraries as open source projects as ...
I am supposed to work on web Services (using Apache CXF and Spring ) I was asked to get familiarized with certificate generation, as we will need to generate certificates going forward for the web services. One thing I knew is that they are using Glassfish server. I googled , but I didn't understand anything. I know ...
Possible Duplicate: Should newbies use IDE autocomplete (Intellisense)? Is it wrong or bad to use autocomplete? Having used an IDE for the last 3-4 years, the other day a few of my coworkers and I came to a fairly sad realization that we had forgotten some basic Java methods/functions because we always relied on our...
My t-sql teacher told us that naming our PK column "Id" is considered bad practice without any further explanations. Why is naming a table PK column "Id" is considered bad practice?
Questions like this have been asked before (like here), but a lot can change in a year. My company is very interested in migrating core systems to the "cloud". Non-technical upper-management doesn't quite know what that means, but they are excited at the idea and have already started adopting cloud-based systems. Havi...
Both Mercurial and Git were created as a replacement for the same program and to solve the same problem which you can read about in Martin Beckett's answer to How did Git and Mercurial develop so similarly at the same time? question. These two tools are very similar and borrow from each other according to Scott Chacon ...
As a software developer, I find a frequent need to create icons for my applications. Nothing has ever worked as well as IcoFX for this purpose. Unfortunately, the program is no longer free - but I still have the installer for an older version. My question is whether or not I can distribute copies of the installer. The ...
Since the .NET Framework SDK is free, is Visual Studio anything more than an IDE? If yes, do I need to buy Visual Studio to deploy my ASP.NET web application (written in C#)? I'm using MySQL for the database. I'm a student that is going to graduate college soon, and I'm exploring technologies for a web application that...
I'm a self-taught programmer, just in case this question is answered in CS 101. I've learned and used lots of languages, mostly for my own personal use, but occasionally for professional stuff. It seems that I'm always running into the same wall when I run into trouble programming. For example, I just asked a question ...
A typical stack for a web application is a database, a server with server-side code, and a user with a browser with HTML/CSS/JavaScript. Before extensive AJAX, MVC in which the controller was the server-side code rulled. A server had to route answer requests for Dynamic web pages (i.e. templated html solutions like JS...
Are there any situations where it may not be a good idea to use the code of an open source project, even if your company might allow you to do so? Some cases that I think might be valid include: The code may be implemented in a different languages. It is not portable It may need some other close-source libraries What...
I posted this question on stackoverflow and it got a poor reception. In reality, the problems I'm facing are minor and any workaround can be considered impractical. However, I believe it might be of general interest in the abstract computer science domain, so I'm giving it a go here. I'm working with Drupal's automate...
I heard this number and a quick google search reveals a whole lot of touting this number and absolutely zero data (honestly most articles promoting COBOL read like 95% propoganda). Perhaps it's true in an extremely limited context of banking software or something, but with millions of applications coded in dozens of la...
I've been programming in C++ for a few years, and I've done a school project or two in C (as well as several other languages). However, I don't know C very well at all. I have a programming interview in two days, and I just realized that this interview will be in C. How do I approach this? How do I learn C well en...
I would consider myself a 9 to 5 programmer. What I mean by this, is that I have a programming job, but after I leave work, I leave my work there and do not take it home. I very much enjoy my career choice, and I enjoy the work that I do at my current job. I also enjoy learning new things in my field, such as new te...
Possible Duplicate: How do you dive into large code bases? Sometimes before developing new products we need to understand some existing products or existing source code. Sometimes to write another small module of that big project we need to understand that big source code. In our case we need to study and understand...
My understanding is that in the 1980s, and perhaps in the 1990s too, Pascal and C were pretty much head-to-head as production languages. Is the ultimate demise of Pascal only due to Borland's neglect of Delphi? Or was there more, such as C being a more robust language? If the latter, what were the perceived advantages ...
I'm 8 months into my first job as a developer at a mid-small company. The four development teams have about 7 developers each, the design team consists of about the same number, and the administration / sales / marketing / hr team is 4 people. We mostly develop web apps, a one-time deal, to run on the client's (usuall...
Using C#/.Net, I have a page where the user can enter data and save these data by clicking a button. To save data, the user needs to enter a valid date, this means a date which has a certain format. The page contains amongst others two modules. The ValidateDate-Event has the responsibility two check the format of the d...
The dry principle states: "Every piece of knowledge must have a single, unambiguous, authoritative representation within a system." However when writing tests for code you are describing the expected behavior for the system twice (once in the code and once in the test). I know both descriptions are from a different...
Just came through XPath. I got curious about this. Why is there a different way to select tags in XPath and CSS(selectors). Why cant there be a common way in both XPath and CSS?
Possible Duplicate: Choosing a functional programming language I am a C++ programmer looking to learn a functional language as a hobby and out of sheer curiosity. I am not looking to be an expert, but just to get a grasp on functional programming. This language should be simple to learn and have good tutorials and r...
Note: I'm coming from a Windows / Visual-C++ background. Note: I have already read Michael Feathers' Working Effectively with Legacy Code. Note: Broad question, asking for narrow answers, i.e. while I don't want to narrow this question down to a specific compiler/platform/make system, useful answers will likely only c...
I've always found it daunting and confusing how an OS hacker sets up their workflow. As a web-developer I find it easy to set up a workflow because web-sites run on servers and as such my OS is never touched. But an OS programmer, how do you do it? Do you develop on one machine and then somehow transfer code to the oth...
I found some software a while ago that claimed to execute ASP.NET applications on a Linux server, I remember that the information said that takes the code and converts it to Java. I never downloaded or tested the software. Does anyone know the name of this software? Also, is possible to execute ASP.NET on a Linux serve...
If I were to develop a Silverlight game and publish it to a site where you can play it for free is the use considered to be commercial or personal? What about if the site has adverts on, is it then considered to be commercial if the program is free but its hosted on a site that makes money? My reason for asking this i...
Many (perhaps most?) database applications today use B-Trees and variations to store data, because this data structure optimizes the read, write and seek operations on a hard disk (and these operations in turn play an important role in the overall efficiency of the databases). Should Solid State Drives (SSDs) completel...
If you add new configuration options to a program, it can often have tons of ripple effects in terms of getting the options to where they need to be acted upon. There are three basic ways to deal with this that I'm aware of: Pass all configuration settings to the parts of your program that need them explicitly as pri...
I'd like to open source a project of mine under GPL v3. Additionally, I'd like to sell a license for those who wish to use the code in a proprietary application. How do I go about releasing my source code under GPL v3, while also reserving the right to release it under another license of my choosing? Do I still put t...
In our startup, we've worked until now using the traditional waterfall model, but we want to try our next project using Agile Methodology. We are pretty much alien to the entire Agile process, so considering this, what is the best way to understand Agile (resources and a practical handbook can be of help), decide on a ...
Are there any libraries in Java that come close to providing the functionality of Linq?
We have purchased a fairly light-weight application that uses a database on SQL Server for its back-end. This application has no API. There is a small web-based feature we need to add, that can easily be added by connecting to the database directly. Generally speaking, and all issues relating to future schema changes...
I'm a Safari Books subscriber and have been for years. I like having all the books available immediately. I was wondering if there was a better competing service. Does anyone know if there's another comparable service that maybe has a better search function (my frustration with which is what prompted me to ask this ...
Possible Duplicate: How to prepare yourself for programming interview questions? I found older questions but I was wondering if newer, better books/guides have been published in the last two years. I am interviewing for a technology analyst position in finance and I expect to have a lot of technical questions based ...
I know this may come off as a flame-y / troll-y, but I hope you will take my word for it that it's not my intention. I am just trying to understand the PHP phenomenon. After looking at the many technical issues with the language design of PHP, I am hard pressed to find any redeeming technical advantages where PHP surp...
I can not see how a software project can make any meaningful progress under a waterfall methodology if the requirements cannot be clearly stated from the outset. Am I missing anything?
How often to you release during a sprint. Only at the end of the sprint or every time a feature is ready. And how to you handle bugfix releases?
A friend asked me recently about mobile applications and the security surrounding them. As he wishes to make a mobile app that would handle very secure information such as credit card numbers, I was starting to wonder about the issue of security surrounding these devices. Does it seem reasonable to store sensitive info...