instruction
stringlengths
34
19.9k
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...
I was considering taking up the challenge of learning C++ for designing Metro apps and that's when I came across C++/CX. Can Metro apps be coded in C++ 11? Do they require C++/CX to work? And what exactly is C++/CX? Is it possible to create a Metro app using only C++, or is C++/CX required? Also, how does C++/CLI tie i...
Many years ago, I wrote a small Access 2003 database for a non-profit to track the donations they received. They recently wrote me asking for some new features (I was shocked it was still in use, honestly) and I'm wondering if I could rewrite the application with a newer technology/framework. Here are the machine specs...
Some (at least Mono's and .NET's) garbage collectors have a short term memory area which they scan often, and a secondary memory area which they scan less often. Mono calls this a nursery. To find out which objects can be disposed of, they scan all objects starting from roots, the stack and the registers and dispose al...
I'd never heard of this before, so shame on me, but programs like UPX can compress my files by 80% which is totally sweet, but I have no idea what the the disadvantages are in doing this. Or even what the compressor does. Website linked above doesn't say anything about dynamically linking DLLs but it mentions about...
This is my first time choosing a hosting company. It is for a web site made in asp.net mvc3. So I was thinking choosing a provider would be easy since I found this page http://www.microsoft.com/web/Hosting/Home which contains hosting offers. Now hours later, I am still searching. The reason is that as soon as I start i...
When we think about maintaining a software solution holistically, we have to think about things like non-code change control and configuration management, in addition to the actual source code. For example, for maintaining a large web application, tracing: "Make the following (manual) configuration change to the farm,...
I'm currently thinking about an interface to a class I'm writing. This class contains styles for a character, for example whether the character is bold, italic, underlined, etc. I've been debating with myself for two days whether I should use getters/setters or logical names for the methods which change the values to t...
I have been working on an open source Museum Collections Management web application that is to be used to keep track of a museum's accessioned, donated, loaned or otherwise acquired artefacts. This involved designing and creating a rather large database (in relation to my previous experiences), which stores all kinds ...
I'm trying to come up with a personal workflow. I've put together a flowchart of the hypothetical lifespan of a release: one developer pushing to a public github repo + a friend helping with some feature and fixing a bug. Is this a reasonable approach to version control? The main idea is to keep the public repo tidy: ...
In C and C++, it is very easy to write the following code with a serious error. char responseChar = getchar(); int confirmExit = 'y' == tolower(responseChar); if (confirmExit = 1) { exit(0); } The error is that the if statement should have been: if (confirmExit == 1) As coded, it will exit every time, because the...
Linux OS developers : do they unit test their code ? If yes : since this OS is coded in C, how do they manage to write effectively unit tests in this language ? what are the "zones" in OS where unit testing is easier to write ? where is it harder ? where is it valuable ?
While I'm a professional programmer, I've never been formally trained in software engineering. As I'm frequently visiting here and SO, I've noticed a trend for writing unit tests whenever possible and, as my software gets more complex and sophisticated, I see automated testing as a good idea in aiding debugging. Howeve...
In real world networking software following c/s model, there are always proxy server processes between clients and server processes dealing with business logic, why we need proxy to isolate the logic part and clients? What's the benifit of this architecture?
I had an idea for a website. After much coding and thinking out the idea, I've got it to a decent stage. If I were someone else, potentially a more commercially-minded person, I might want to sell it, or slather it with ads. However, I've fallen somewhat in love with open-source, and I'd like to host the project on Git...
With the some most common languages (Java, C#, Java, etc) it sometimes seems that you are working at odds with the language when you want to fully TDD your code. For example, in Java and C# you will want to mock any dependencies of your classes and most mocking frameworks will recommend that you mock interfaces not cla...
In our CI environment we build all the cs projects and then build the deployment projects. The deployment projects do an extra step of compiling the aspx & ascx files and often catch errors that would normally be caught at run time. 1) Is there a name for this step or process? 2) Can I get it in the regular project b...
I've always liked physics, and I've always liked coding, so when I got the offer for a PhD position doing numerical physics (details are not relevant, it's mostly parallel programming for a cluster) at a university, it was a no-brainer for me. However, as most physicists, I'm self taught. I don't have broad background ...
Joel Spolsky characterized C++ as "enough rope to hang yourself". Actually, he was summarizing "Effective C++" by Scott Meyers: It's a book that basically says, C++ is enough rope to hang yourself, and then a couple of extra miles of rope, and then a couple of suicide pills that are disguised as M&Ms... I don't have...
I have grown into using a principle for designing and consuming interfaces that says basically, "ask for only what you need." For instance, if I have a bunch of types that can be deleted, I'll make a Deletable interface: interface Deletable { void delete(); } Then I can write a generic class: class Deleter<T exte...
I work in c++ mostly as a hobby (I'm still in school and therefor don't have a real job). The IDEs generate the makefile for me and so I'm wondering if it's worth learning how to make them myself. By "worth learning" I mean, should I drop everything and learn how to write them before continuing to learn c++? Is learnin...
What are the conventions for item batch identifiers in inventory management systems? For example: A retail supermarket can order 'Item X' from either 'Supplier A' or 'Supplier B'. When it completes an order for the item from either supplier, it needs to store the record of the receipt. Inventory quantity for the item i...