instruction
stringlengths
34
19.9k
I find that oldstyle (or text) figures are much easier to read in any context outside of simple assignment. Are there any low-ambiguity fonts, monospaced or proportional, that have text figures and other programming-friendly features, such as marked zeroes; aligned braces, operations, and other symbols; and bold and it...
I've been trying to read through the RoR API to try to learn things that the tutorial missed, and I haven't been able to follow it at all. The only time I've read documentation was when I needed to look up a Python module, and that was easy to understand, but I can't understand the docs for Rails. How do I read through...
Azure ACS offers OAuth and OpenID providers, and now that ASP.NET 4.5 offers the same thing, without the added cost, is there any reason for a .NET developer to consider ACS? (Disclaimer, I don't know what version of oauth each service provides)
Programming languages and programs (as wells as individual functions, objects, etc.) are often described as being "safe" in one way or another. For example, they could be "type safe", "memory safe", "exception safe", "thread safe" - even "reentrant". Each of these concepts is about preventing erroneous or damaging code...
I am going to be a third year computer science student and I have read Head first Java, Head First C, and I am currently reading C++ which is the language that I like the most since it has a good teaching style for people with experience. I am planning to either learn to make software with QT, learn objective-C(for iph...
A study shows that lines_written/time is language-independent and application-independent for most programmers. If this were true it would imply that the most terse a language is, the more productive a programmer can be on it. Where can this study be found?
I was wondering if there was a valid use case for being able to properly define the specific internal properties and functions of a class in a way similar to how an interface defines the public properties and functions of a class. Imagine the task that you have to build a class that describes a human being. Obviously, ...
I've been thinking about that for quite a while actually. I am not a native English speaker myself but still, I have years of programming experience and I always asked myself this. Why is it named as Exception but not Error since they are errors? It could be PageNotFoundError instead of PageNotFoundException!
I am a mercurial person. I even use it as an incremental backup tool. I used to use SVN and CVS. In a recent project, I had to to use clearcase and encountered lots of issues with it. For example, I could not figure out how to recursively include a whole tree of code without writing a script or using awk or find. Is th...
My problem is the following; I need to get to know a totally new system, for example Wordpress, Drupal, or a framework like Symfony, or maybe a big forum system like PhpBB. Let's suppose it has no documentation at all, but the code is good. What I end up doing is that I start at index.php and click the first include,...
In programming we're often faced with a choice: cover each conceivable use case individually, or solve the general problem: Its obvious that solving the immediate problem is faster, however creating a generalized solution will save time in the future. How do I know when it's best to try and cover a finite list of case...
Besides logical and physical architecture diagrams, comps / mockups and tables for expected network load between components and various data schemas, what kinds of visual content, tables or diagrams might I want to include in my Project Architecture Document? The specific project is an integration of 3rd party social n...
We have a business logic layer (BLL) that is tightly coupled to our data access layer (DAL). We make calls like this: using (FooData data = new FooData()) { data.DoSomething(); } It's important to note that all of our data classes are internal, and they're in the same assembly as the logic classes, so that only the ...
The IO monad in Haskell is often explained as a state monad where the state is the world. So a value of type IO a monad is viewed as something like worldState -> (a, worldState). Some time ago I read an article (or a blog/mailing list post) that criticized this view and gave several reasons why it's not correct. But I ...
I work better when I have some firm foundations. This helps me to solve everyday problems better, because I can generalize them. The thing I find in programming is so many things are black boxes. Logic is scientific, but commands are not. A command in a language is just "something that does something". It is very hard ...
We have list of players, which is represented in form like this: <div class="players_list"> <div class="player" data-points="500"> <div class="name">Player1</div> <div class="position">1</div> </div> <div class="player" data-points="400"> <div class="name">Player2</div> <d...
I've got a little bit of history with programming, having gotten my start with Visual Basic. I let it slide as a hobby from a little after VB6 up until just a year or so ago when I got on the iPhone bandwagon, when I decided to take up Objective-C programming. I now have what I feel to be an intermediate level of knowl...
I have a requirement to allow users to fill in journal/diary entries per day. I want to provide a handful of known journal templates with x columns to fill in. An example might be a thought diary; a user has to record a thought in one column, describe the situation, rate how they felt etc. The other requirement is that...
I need to design a function to perform the basic arithmetic operations that are addition (+), subtraction (-), multiplication (x), and division (/) between 2 numbers. That function takes 3 arguments: -number1: composed of a value and a unit. -number2: compoased of a value and a unit. -operation_type: one of the 4 afore...
QUnit advertises itself on its web page like this: ...capable of testing any generic JavaScript code, including itself! Can you really use unit testing software to test itself? Wouldn't defects in the software mean that the results are unreliable?
I'm reading The Art of Unit Testing by Roy Osherove. I'm at section 7.2 Writing maintainable tests where the author has this note about code smell: NOTE: When you refactor internal state to be visible to an outside test, could it be considered a code smell (a sign that something might be wrong in the code's design...
I recently started using arguments in my main program (here written in C++ but could be any programming language) #include <iostream> int main(int argn, char* argv[]) { // do stuff depending on argv[1], argv[2], etc. } For now I am using mostly random naming conventions like -t for testing, -d for debugging, -l f...
Our company runs a SaaS application where users log in from across the world (although mostly in the US). We store all our time relevant information as UTC, but we need to display times using local time. The application is web based, and we would like to "auto-detect" the user's Time Zone by using javascript to deter...
I have an android app that fetches a list of about 100 Items. Trying to get the server load down, I've built a filtering feature that does everything offline, so basically instead of calling the server (and thus a MySQL query every call) It filters on its own. However I've noticed the app tends to lag (while the on...
I'm building an n-tier application, I have UI, BL, DAL & Entities (built from POCO) projects. (All projects have a reference to the Entities). My question is - how should I pass user input from the UI to the BL, as a bunch of strings passed to the BL method and the BL will build the object from the parameters, or shoul...
I wanted to add timezone support to my blog app but got stuck with a design problem. Every post has a published_on field which stores the publication date in a timezone aware format (UTC converted to user's timezone). So far so good. But the permalink of a post is created from the publication date as well. It has the f...
I'm building some custom web controls in .NET using C#. The controls inherit from the standard web controls, and add additional properties and functionality (e.g. I'm creating an 'extendedTextBox' and I'm adding a 'required' property, which if set to 'true' will add a .NET required field validator to the control autom...
Currently I have some code like this: OntologyGenerator generator = new OntologyGenerator(); generator.AddOntologyHeader("Testing"); generator.AddClassDeclaration(owlBuilder); generator.AddSubClass(owlBuilder); generator.AddAnnotationAssertions(owlBuilder); where that OwlBuilder param you see being passed has collecti...
Well, the title really says it all, but to elaborate a bit, can you take a random, typically effective QA department and have them learn to work in an XP environment (with a learning curve to pick up the XP workflow of course) or would they need more programming skills to be effective? If so, what would they need to k...
Can a loosely typed programming language like PHP be really considered object oriented? I mean, the methods don't have returning types and method parameters has no declared type either. Doesn't class design require methods to have a return type? Don't methods signatures have specifically-typed parameters? How can OOP t...
I am thinking of integrating the openfire chat server with my custom website. Openfire server and the smack client library is licensed under Apache License, Version 2.0. If I decide to use openfire, will it require my website source code to be also made available under the Apache license? Tried going through the licens...
The user will fill out information in page 1, and the data will be seen in the other page listed in a listbox. Is it advisable to use data binding? I've been studying/researching about data binding already for about 2 days and still couldn't understand it. Simple example would really help.
I've spent the last year becoming really comfortable with MySQL, but due to its increasing trendiness and my desire to homogenize my web-apps with Heroku, I'd like to start using PostgreSQL for my web apps instead. There are a resources out there for learning PostgreSQL, but I don't really want to have database concep...
I am a web developer, working mostly with ASP.Net(webforms + MVC), C#, javascript and so on. As you know, continuous learning is very important for us, but time is not infinite. I do dabble with the odd technology every now and then that has nothing to do with web but mostly I try to learn more about my field in order...
I wrote a program which scrape internet sites. It is pretty straigtforward because it process link one by one. With the limiting factor of the internet speed, the process is rather slow. I wonder, how can I make it multiprocess? The modules of python is confusing. I don't know the difference between subprocess and mult...
I have a video on demand style site that hosts series of videos under different modules. However with the way I have designed the database it is proving to be very slow. I have asked this question before and someone suggested indexing, but i cannot seem to get my head around it. But I would like someone to help wit...
We are in the process of constructing an API (using WCF). So far I noticed 2 ways in which methods could go wrong due to problems with the parameters sent. wrong format, for example we have a string date parameter which should be in a certain format, if it's in a different format the method cannot continue. if a metho...
We have big enterprise projects they normally involve copying data from a source database to a destination database and then setting up a number of additional applications that sync this data etc. The last project contained 250,000 items (rows of data). The next project will only contain 4,000 items. Project managers /...
Basically, I develop websites, some large with many crud operations, etc... However I've gotten into the habit of storing re-usable data as a constant in my PHP applications I currently have 44 constants defined in one application. These range from: Database config Home page for admin and guest url slug names declarin...
I am a Jr. ASP.NET/C# Developer and I have been working with a Company for the past 9 months. I have been appointed to try and develop their Legacy System (built in Visual FoxPro) in ASP.NET/C#. I am the only developer working on this project and it's a bit overwhelming, but I complete the tasks assigned to me within a...
I am used to Java and therefore always think conditions are interpreted from left to right, i.e. there is a vital difference in null != $obj and $obj != null Now this seems not to be the case with PHP. Can I do something wrong in PHP when I always start with null on the left-hand side? Can I keep my behaviour from Jav...
I am working on a Java application (an ERP) that has grown pretty large, and will continue to grow for the next couple of years. We have been using Spring-JDBC for our DAO layer. But the amount of boilerplate code that needs to be written is slowing us down significantly, not to mention introducing silly bugs in the sy...
I've recently been tasked with testing some COM objects of the desktop app I work on. What this means in practice is writing a large number (>100) unit tests to test different but related methods and objects. While the unit tests themselves are fairly straight forward (usually one or two Assert()-type checks per test),...
We are a team of developers working on multiple small projects - a developer could have 3 or more 1 man projects to work on and keep moving. It can feel like your time is pretty fragmented & interrupted moving between project to project. Sometimes frustrating, stressful & overwhelming. In an ideal world it wouldn't be ...
What is a good way to name a method that checks if X needs to be done, and does X it if necessary? For example, how to name a method that updates a user list if new users have logged in? UpdateListIfNeeded seems too long, while simple UpdateList implies a possibly expensive and unnecessary operation is done every time....
In the past I did a freelancing project for someone where I wrote a couple of image filters. Nothing fancy, and a very very low cost project for them. I was wondering, if I wish to use these in a project of mine, would I legally/ethically be allowed to do that? If I couldn't use the exact code, could I at least use the...
I am looking for a way for SQL Server Management studio to show me the last SQL query that was run. For example, when I make modifications to a table in the designer mode, I will eventually want to make the same changes to the production DB without recreating the entire table. I'm looking for functionality similar to P...
(Written against GPLv2.) It is always said that GPL does not prohibit selling the software, as long as its source code is provided under the same license (GPL). Now, I do not understand how it is consistent with Section 2b: You must cause any work that you distribute or publish, that in whole or in part contains...
In Scrum, work is delivered to customers through a series of sprints in which project work is time boxed to a fixed number of days or weeks, usually 30 days. In lean software development, the goal is to deliver as soon as possible, permitting early feedback for the next iteration. Both techniques stress the importan...
I have the requirement that users should be able to specify filter conditions for one kind of entity through a GUI on a thin client. These conditions must be convenient to generate, meaning the GUI should guide users as much as possible. They shouldn't have to write SQL or anything. stored with a time stamp, a user ID...
Long story short, I've spent the last two years in an entirely new career, transitioning from academia to a data analyst role (working towards a data scientist). Before starting at my current company, I knew next to nothing about coding, save for teaching myself SQL for a few hours per week over a couple of months. Bes...
In Code Complete page 25, it's said that it's a good idea to be able to easily replace the regular user interface classes by a command line one. Knowing its advantages for testing, what about the problems it may bring? Will this extra work really pay off for web and mobile projects? What about small and medium projects...
I read several related questions about the use of GPLv3 in a commercial app but they don't say anything about a freemium app. I would like to use a GPLv3 library in two apps, a free one (with limited features) and a paid one. Basically, the free app will allow to use the library without limitations, and the paid one wi...
I'd like to read the opinion of experts on whether compiled, strictly-typed languages help programmers write robust code easier, having their backs, checking for type mismatches, and in general, catching flaws in compile time that otherwise would be discovered in runtime ? Has unit testing in loosely typed, interpreted...
Possible Duplicate: What is a normal “functional lines of code” to “test lines of code” ratio? I've found that more often than not, when you write lots of unit tests, and have good coverage (80% or so), the test suite ends up being larger than the code itself. Do my observations match that of everyone else? I've a...
I have a project I shelved a while back- it was essentially a working web app built in django but I stopped working on it to work on something else. I plan on starting it up again in my spare time, but I'm wondering if it's worth converting a django project with about 5kloc to Rails. I'm considering this because I've b...
Personal context: I've been learning C++ formally the last 6 months at university. Prior to this I dabbled in JavaScript for a year. Now I am considering learning Python during a month off school. By splitting my focus early in the learning process am I degrading the efficiency of my learning? Should I spend the month ...
Code Exploration (CE) is quite a new term and I wonder if there already any successful examples of implementing this techniques in terms of Continuous Integration principles? In short, Code Exploration can be described as the process of testing your code using different parameters to achieve high code coverage. The one...
I have a big database of data which we can consider today's system. The data has a web front-end which allows my users to update the data. Let's call this "original solution" When new users come in they come as a set of new users. These users need their own data and their own web front-end. Let's call this a "solution"...
Is there a common name for the practice of keeping a version number on your data, so that different versions of your program can identify, for example, "current", "legacy", and "too-old-to-deal-with" versions of the same type of object? As discussed here: Strategy for backwards compatibility of persistent storage.
I like how "Introduction to Algorithms" by Cormen et al. conveys knowledge. One reason is that everything has to do with programming problems and the book is not implemented in any particular programming language. This language independency provides focus on the ideas in general. So my question is, as it says in the ti...
I am confronted with the problem of migrating a huge monolithic java web application towards a more service oriented approach. The application has grown for years from what it was originally desinged for and is still growing. That means a lot of changed customer requriements where development under time pressure with f...
What's the difference between the RPL licence and the AGPL licence? Which one is more restrictive?
I have two client types, an "Observer"-type and a "Subject"-type. They're both associated with a hierarchy of groups. The Observer will receive (calendar) data from the groups it is associated with throughout the different hierarchies. This data is calculated by combining data from 'parent' groups of the group trying t...
Google's Dart language is not supported by any Web Browsers other than a special build of Chromium known as Dartium. To use Dart for production code you need to run it through a Dart->JavaScript compiler/translator and then use the outputted JavaScript in your web application. Because JavaScript is an interpreted langu...
When looking at examples of definitions of done in various sources, they usually include points like code completed unit tests run code peer-reviewed or paired code checked in documentation updated … In our team, we have a similar list, but nobody ever looks at it because those points seem so blatantly obvious that i...
I'm writing documentation for some interactive Ajax user interface but instead of writing everything in words I would rather provide diagrams that are faster consumed than whole paragraphs of text. I did provide page navigation flow diagram but that's very high level before you drill down to individual pages and their ...
I'm currently contemplating writing an OS X version of my Windows software. My Windows application still supports Windows XP, and I know that if I drop support for it now, our customers will cry bloody murder. I'm new to OS X development, and as I learn the technology, APIs, etc., I realized that if I'm going to provid...
Would this be considered dependency injection, or delegation or object collaboration? https://gist.github.com/3428071
Dear fellow programmers, We're developing software which simulates vehicular traffic. Part of the process called "assignment" is concerned with assigning vehicles to their routes and has to use some kind of shortest-path-finding algorithm. Traditionally, people do this with Dijkstra's, and certain scientific literature...
I'm reading Skiena's Algorithm Design Manual and there is a problem on page 5, "Robot Tour Optimisation", where he says this about the sample problem: "Suppose we are given a robot arm equipped with a tool, say a soldering iron. In manufacturing circuit boards, all the chips and other components must be fastened onto t...
I'm designing a software as a service project which will only be accessed online. I may have a hard dependency on an executable which is covered by GNU GPL (v2 or later). I understand that my code, if I were ever to distribute it, must be distributed under the GPL terms as well. I am pretty sure that running the servic...
So a client comes to me and says it needs some work done. Basically 4 tasks, which I agreed to perform for a certain price. The customer creates the job offer (a fixed time and price job) on ODesk, I accept it, but it took some days and constant reminding for the customer to initiate a contract based on that job. The p...
For an upcoming XCode iOS project I'm planning on writing my views and view controllers in Objective-C. My model will be provided to me in C++. I am aware of 2 ways of using C++ in an objective-c project. They are described below. What are the pros and cons of each method. Is there any other recommended way, and what a...
This is just a consideration for a site am creating and for other big sites out there. I am using Identity Column to store the ID of some of my tables and I have classes whose Id are decorated with Int32 to hold the value of the ID retrieved from database. My worry is that as the site grows bigger, some tables that gro...
I am referring to the article Mocks aren't Stubs by Martin Fowler. When naming cases when he think "mockist" TDD will be advantageous, he said It's particularly worth trying if you are having problems in some of the areas that mockist TDD is intended to improve. I see two main areas here. [...] The second area is...
Is there a term for a 24-bit (3-byte) integer? I know uncommon bit counts (such as a "nibble" or "nybble" for 4 bits) have names, and having 24-bits in both video and audio technology, for instance, is very common.
For the sake of readability I often find myself defining temporary variables while calling functions, such as the following code var preventUndo = true; doSomething(preventUndo); The shorter version of this to this would be, doSomething(true); But when I come back to the code I often wonder what true refers to. Is th...
I'm quite new to working in Agile and with user stories and scenarios in the BDD tool Cucumber and ideally I'll need to go on a course of all of this. I have a set of user stories that need to be edited for an upcoming release. As an example one of the user stories is: 'As a user I want a visual indicator on entry in...
I come from a background of making MVC websites and HTML5 applications, and have recently decided to dive into the sort of stuff i wasn't taught at university, namely the things most people would learn on a computer science course. I've been reading a book on algorithms, and the first one it mentions was the Insertion ...
I am an intern for a health company (unpaid), let's call it Company A and I noticed that they are using a lot of paper form for things that can be done on the computer. Excel files for things that shouldn't be in Excel. So I wanted to improve on my programming and figured that it was the best opportunity to do. I devel...
I've got a bit of an argument at my workplace and I'm trying to figure out who is right, and what is the right thing to do. Context: An intranet web application that our customers use for accounting and other ERP stuff. I'm of the opinion that an error message presented to the user (when things crash) should include as...
Up to now I have always worked with imperative languages like Pascal, C, C++, Java in a production environment, so I have experience with debuggers for these languages (Turbo Pascal, Turbo C, GDB / DDD, Visual Studio, Eclipse). A debugger for an imperative language normally allows to Set break points on statements, an...
Problem I'm trying to solve, apologies in advance for the length: Given a large number of stored records, each with a unique (String) field S. I'd like to be able to find through an indexed query all records where Hash(S) % N == K for any arbitrary N, K (e.g. given a million strings, find all strings where HashCode(s)...
We have some back end processes that runs* on our sql server (SQL Server), they involve processing claims. This requires both data manipulation (biz logic) and data read/write to tables. The biz logic contained should never be used by any of our end user (web/fat client) applications, just for this (runs once, nightl...
I'm looking at backbone.js and noticed that it supports various templating systems (they specifically refer to Mustache.js, Haml-js, and Eco, but I understand it can support even more)(like Pure and dust.js) Why are there so many of these? What makes one better or different to the others? Can anyone shed light on what ...
I realise that this question may be down to personal preference but I'm pretty new to Bash / shell scripting so thought it'd be worth some research to see if there's some sort of standard/best practise or agreeable consensus. I'm working on a few scripts that I'd eventually like to release open source (probably MIT lic...
What is the process for leaving a company (or even a group/division) in terms of code support? Is it best to handle all questions? Do you give the remaining developers access to yourself as a future resource? If so, is there a way to not give full access? I've experienced first hand where answers about the general soft...
I am trying to find a piece of hardware that will signal a program to start a timer when it is moving and stop when it stops. The hardware can just be a ball that moves and is connected to the computer through USB, I was thinking of something similar to the way a mouse would work. For the programing I would like to use...
Suppose we have two peer nodes: the first node can send a connection request to the second one, but also the second one can send a connection request to the first one. How to avoid a double connection between the two nodes? To resolve this issue, it would be sufficient to make sequential the operations performed for cr...
I am the Lead Developer for a small software company. Over the past two years, my team has grown from one developer (me) to a group of about nine people. Most of us are very capable, senior engineers (20+ years of experience building software per person), so very little hand-holding is generally necessary. We use Scrum...
Assume we are developing a REST system for an enterprise company to expose the companies resources in a Java based application. Ultimately you have one web application, and domain libraries. My question is to where components and services should live in these domain libraries and what should exist in the application it...
I have found a need for a standardization for storage and recording of data relating to diabetes information (I don't think there's any, but I may have missed it). To that end I made this github project because I want to create one.. but I don't really know how to go about it, or even for sure what I want to create is ...
In asp.net webforms I have a home aspx page that has a “Go” button. [This is the only control in this page]. When this button is clicked, the user is redirected to “UserProfile.aspx” page. How can we represent this redirect action in sequence diagram? Any reference articles/blogs for this?
In the past few months, I recognized a big excitement about client-side scripting in web development. But while server-side technologies are mature, stable and well accepted by backend-developers, client-side technologies are immature (i.e. compared to big server-side framework) and disliked by many long-established de...
TL;DR Sort of brainstorming: why integrating systems by means of exchanging loosely-structured files (as opposed to XML web services integration) is a bad idea? TL Part We're offering an online solution for enterprise customers (big ones) and in implementing this we often need to integrate with their internal systems (...
I have a sequence diagram for the following operation. The Activity class uses method present in ActivityBL class. The method is: GetActivities(ActivitySearch objt) The result message is a collection of Activity objects. (Colletion in C#). How do we represent the return message in the sequence diagram? At present...
I'm just wondering if we should assign story points to bug fixing tasks or not. JIRA, our issues-tracking software, does not have story point field for Bug type issues (it's only for Storys and Epics). Should we add the Bug issue type to the applicable issue types of the Story Points field? What are the pros and cons...
Last time I tried to use C++ several years ago I remember having to include different libraries between different IDEs even though I was using the same operating system, which left me somewhat confused about the C++ language. Are there different standardizations of the C++ language? And if so, what branches of the lang...
So in a GUI program I have multiple events that trigger a update of a workspace. This update call is costly so I would want it to not happen very often. A user might pick something from a dropdown ( triggers a refresh ) and then put a check in a checkbox (also triggers a refresh ). If he does this in a short time inter...