instruction
stringlengths
34
36.1k
I almost always do web development with a simple editor like Geany or Notepad++. Recently I'm starting with Aptana, and I'm a bit confused about the purpose/benefits of the workspace. Why is it useful? How do I use it?
I am working on a .NET 4.0 application, that performs a rather expensive calculation on two doubles returning a double. This calculation is performed for each one of several thousand items. These calculations are performed in a Task on a threadpool thread. Some preliminary tests have shown that the same calculations ar...
I develop a suite of productivity tools, for Mac, iOS and Windows. They all communicate with a sync server via a RESTful interface (using Protocol Buffers), but as we add new platforms, we realize the pain it is to recreate different versions of the same code just to communicate with the client, so we have thought of u...
I have been a hands-on developer for my entire career and love working with code. I have always resented the team lead who has little or no expertise regarding a particular technology and yet insists on a certain implementation. Now I find myself on the other side of the looking glass. I am the lead developer of a fa...
I ask this to the pros out there - Is it feasible to build a new LOB(Line Of Business) application with VS Shell as an stand alone application. There are some points that I thought needs to changed, but I'm unaware how, like - There will be no document. Instead there will be windows with controls where people enter dat...
While reading about Java EE applications, somewhere I have seen people saying they're enterprise scalable, I am confused as to what that really mean? Are Java web applications mainly written & suitable for building enterprise management tools, not for the high traffic websites of today's world, that need to scaled to ...
I've seen a lot of mentions of Pseudocode lately, on this site and others. But I don't get it: What is Pseudocode? For example, the Wikipedia article below says "It uses the structural conventions of a programming language, but is intended for human reading rather than machine reading." Does this mean that it isn't ac...
Modular programming and reusable software routines have been around since the early 1960's, if not earlier. They exist in every programming language. Conceptually, a software library is a list of programs, each with its own interface (entry points, exit points, function signatures) and state (if applicable). Libraries ...
In Visual Studio I can right-click on an interface and choose to Implement Interface, or Implement Interface Explicitly. public class Test : ITest { public string Id // Generated by Implement Interface { get { throw new NotImplementedException(); } } string ITest.Id // Generated by Implement I...
I've seen an interview with Richard Stallman some time ago, and he was asked a question about security and Windows OS which he answered saying that there are some relatively bad design decisions that were made when creating the Windows OS. These design decisions (according to R. Stallman) were known at the time for cre...
I'm working on an iPhone application and I created a component diagram. I defined interfaces for each component. For example I have an AI component and I have made some interfaces for it. How should I carry on? Should I create a class diagram to go into details, should I go into details of each interface or should I j...
I'm a PHP developer and I recently started to work with CodeIgniter. It seems that whenever I search for something related to CodeIgniter, the blog posts and what not are usually from '09 or '10, so it got me thinking, is CodeIgniter still relevant and is it going to be in the future? Is there another framework that is...
I am having a lot of trouble writing recursive functions related to trees. I can't just use google for these functions as they are not general and I won't be able to use google in an exam setting! Is there some 'trick' to successfully coming up with an algorithm/writing psuedocode for recursive functions? Is there a ce...
I was a full time java developer, now I'm also working with JavaScript and Android. A couple of years back when I started learning JavaScript, the first library I tried was jQuery. But it made my life harder, and after sometime I started writing fairly large a JavaScript app. It wasn't coming together for me using jQue...
Possible Duplicate: Is it worth being computer languages polyglot? I am half way through my first year at university studying computer science. I have been learning Java on the course and also have experience for Visual Basic from my A-Levels. To give you an idea of my level of understanding the most recent topic on...
So I'm trying to make my Unit Tests as by-the-book as possible, but it becomes troublesome when I'm testing some simple Add/Delete methods. For the add method, I basically have to create a dummy object and add it, then after the test is successful, I have to delete the dummy object. And for the delete test, I obviously...
We are about to start a new project using an existing SQL DB, but this project is going to need to reuse a number of core features from an existing vb6 app that uses the same database. The approach I would like to try: Have the existing vb6 application be the entry point, but immediately call a .net class to present th...
I'm developing a Java application that utilizes several third party open source libraries. I'm adding a section to my app's "About" dialog that lists the components and their license notices. For those that use the same license, do I have to repeat the same license text for each one? For example, I use several componen...
When writing integration tests for business logic objects and data access objects, what makes the most sense to use for setup and validation? In my case, I'm using an ORM in the implementation of my data access interface that will be used in production, and I plumb that ORM implementation together with the business lo...
I was asked to profile (using some tool, such as YourKit or JVisualVM) a couple of implementations of the Traveling Salesman Problem (find the minimum path that visits all the given set of cities), in the context of a Algorithms Analysis and Design graduate course. Taking in consideration the brute force approach of th...
I'm writing a parser for a markup language that I have created (writing in python, but that's not really relevant to this question -- in fact if this seems like a bad idea, I'd love a suggestion for a better path). I'm reading about parsers here: http://www.ferg.org/parsing/index.html, and I'm working on writing the le...
I work on a small team of 4 developers. We are implementing a version of Agile that seems to continuously provide us with the same difficulties, week after week, and I'm looking for suggestions that can help us improve our process. The background: We generally do 2 week sprints, and each sprint we tend to underestimate...
I saw an interview with Joel Spolsky, where he says that Fog Creek Software intentionally keep their teams small (I believe as in four-five guys). The reason for this is to avoid a lot of the communication needed between the team members if the teams are larger. If one compares this to open source projects, where there...
I'm wondering if I wanted to implement a web service based on java that does web analytics, what sort of architecture should I use. The actualy processing of the Big Data would be done by Hadoop. However I am not sure what I would need to do to make it asynchronous, or is Hadoop already asynchronous by nature? Could ...
Please have a look at following snippet: public class Foo { int digit; String name; Foo (int d, String n) { this(d); // cannot do following. //compile-time error: Constructor call must be first statement in a Constructor //this(n); } Foo (int p) { digit = p; } Foo (String q) { name = q; } W...
I'm starting a 12 week Java course next month through my local junior college. I'm starting from square 1. I have a basic understanding of OO and Java will be my first OO language. My Google-Fu returns way too much and I can't tell which is good, bad, etc. As far as learning the language, is it best to use a plain edit...
I've always launched builds after each commit, but on this new project, the architects just asked me to change the frequency to "one build every 15 minutes", and I just can't understand why that would be a good reason vs "building on each commit". First off, some details : Objective-C (iOS 5) project 10 developpers ea...
In unit tested code I often have multiple checks on the arguments on any method before the actual "work" of the method is begun: public void DoSomething(string test) { if (string.IsNullEmptyOrWhiteSpace(test)) { throw new ArgumentException("Test must not be empty", "test"); } } In my corresponding test...
It's always been looked at that using width/height attributes on images which aren't what the original image actual is is a bad idea. It could mean pixalated images or download sizes bigger than nessary. But, is this still an issue? I wouldn't suggest up-sizing photos, but downsizing shouldn't be an issue provided that...
I've started working for a company that maintains a small/medium sized commercial website. The website is written in c# asp.net, and uses SQL Server as a database. The structure of the code is very messy at the moment (for instance, ~5000 line Utility.cs file) so I want to move towards a better design on the asp.net si...
Many, many, moons ago, I did my masters in Object Orientated Software Engineering. I covered everything: project initiation, requirements, analysis, design, architecture, development, etc, etc. My favourite IT book of all time was Developing Object Oriented Software, an Experience Based Approach (IBM-1996). A book crea...
While I learning C#, I found that, the C# supports operator overloading. I have problem with good example which: Make sense (ex. adding class named sheep and cow) Is not an example of concatenation of two strings Examples from Base Class Library are welcome.
I am creating use cases for a project. A generic user is extended by user "categories" which then is extended by an administrator (that can do all tasks possible). Is the following acceptable to portray? Is there a better way to portray such info?
I'm really lost here so I hope some can help me. I have to develop a phone application on every platform so i tough of using phonegap. Seems pretty nice. I have a web application coded in classic Asp and it's this webApplication that i need to strip down to be a phone app. At first at thought it will be simple, my clas...
In Java (or probably most other languages targeting the JVM) what is a reasonable number of threads to use? Presumably, this will be expressed as a ratio to the number of cores/processors available, is that correct? At least initially, it seems like twice as many threads as cores might make sense, but 20+ times as many...
I'm learning Silverlight, and I know that if I master it, I can apply the same concepts to WPF, which means I can do either web or desktop development pretty easily. But I've read articles and followed the discussion online, and I understand HTML5 is gaining traction for being cross-platform, and a lot of people seem t...
I have been arguing with a friend about the necessity of comments, and the efficiency of different comment styles. The argument ended quite fast, as we could not find any research - or essay - that support either claim. Has any serious research been conducted regarding the efficiency of different commenting styles? If ...
As I'm getting more organized, and getting more projects, I'm starting to wonder how to best manage time between them. Especially in regard to how I give estimates to the PHBs. So if the project is broken up into small tasks, say 2-3 hours each, then is it just as productive to work on one task per day as opposed to...
I've recently done some Java programming for an android app (though my question is not android specific), and was wondering if what I was doing was just a lot less complicated, but generally the same as what a professional mobile app designer would do. I kind of asssumed that an app designer working for, say, the BBC w...
I could not differentiate between FreeBSD and GPL liecense. Can anyone tell me the in what respect these two liecense are different. Is it legal to use some source based on GPL license and release the new product as FreeBSD license? In particular, I have following scence: I would like to follow some of the implementati...
For instance, I have a file with poor indentation (at least incoherant with the rest of the project). If I correct the indentation and commit, there will be a serious change in the file at a certain point in time, causing the diffs between versions before and after that serious change to be hard to read. How do you han...
Back in my C programming days I thought there was a constant or function (I can't remember what it was called, let's call it SMALL) whose value was the smallest possible positive value. (Imagine the LSB=1 and all other bits = 0.) It was used to avoid a divide by zero error. For example, let's say you want to compute ...
I was wondering how you'd be able to map the following criterias to common design patterns. I use PHP 5.3 and MySQL 5.5 and have my own mvc framework for my company but some parts could be better and here are the requirements: (Take the concept of a catalog since it's the first app that would be affected in our applic...
In a functional application, should you wrap common higher-level functions in domain-meaningful names or should you leave them "bare"? For instance, if you have a list of Addresses, and "sorted by zipcode" is a common domain-meaningful ordering (targeted mailers, etc.), is it preferable to write: val sortedCustomers =...
Possible Duplicates: git / other VCS - how often to commit? How often should I/do you make commits? The usage of source control is very different from one developer to another and from project to another. Some commit very often; others can spend a whole day or several days without committing (especially when they wor...
It happened frequently that I have to provide access to a bunch of files organized in a directory tree according to some (sometimes loosely specified) rules. My standard pattern is to provide a Database class which is initialized with the root directory. This class provides getX()-like (example: getStructure()) methods...
What is the proper terminology for a small (2-4) set of tightly coupled classes? These classes can't work independently. I was thinking system, but after googling for a bit, I've determined that the word is typically used to describe the software as a whole. Then, I thought of subsystem, but I don't know if the term ap...
While developing (either features or bug fixes) I sometimes happen to discover bugs that are not directly related to what I'm working on. What should I do in that situation. Just fix it? Try to remember to fix it later? Write it down somewhere? Or enter it into the bug tracking system? I generally enter it into th...
Interested to know how people deploy software to their customers I have the following requirements: Customers on various OS's prob. linux and Windows Can't release the source code Ideally want option to develop GUIs not just cmd line stuff Can't assume anything is pre-installed on customers machines Would like to use ...
Possible Duplicate: How do I approach a coworker about his or her code quality? My development colleague is producing numerous blocks of code which I am a bit concerned doesn't really make for easy reading and potential issues in the future. I've tried giving little tips along the way without blantantly saying what...
I have watched a couple videos on JavaScript where the presenter mentioned "caching" a variable but I didn't see them do anything in the code that would "cache" it beyond normal assignments. When I think of cache I think of something stored in local memory in which case aren't all JavaScript variables cached by definit...
I've been trying for years to come up with a good way to organize the massive amounts of notes and material I generate when designing, coding, and testing software. My desk is usually overflowing with tons of sheets of paper with notes scrawled all over them. I've usually got at least the following items spread out all...
In C, C++ and some dialects of BASIC, goto labels are declared with the syntax label:. I'm working on a language that uses name: type as the syntax for variable declarations, so I'd prefer if possible to use something a bit more distinctive for labels. I am or at some point was passingly familiar with many languages th...
Let's say we have a company and we release our project under LGPL && GPLv3, as you know the only thing here is about contribution. People commit bug-fixes/features to the project, it's fine and we are GPL fans. Basically company makes money by this project. So what about contributors ? I know they commit code and softw...
If you are starting up a web, mobile, or standalone application, how well must you know the rest of your collaboration team? Would it be a bad idea to ever work with someone unless I've met him personally? Is it okay to sometimes accept small public contributions such as code snippets and artwork without meeting the co...
I have some confusion understanding the OpenUp/Basic process. It is described as an iterative process consisting of four phases: Inception, Elaboration, Construction, and Transition. I am not clear if a single iteration consists of all these phases or if we make several iterations within a single phase and then move...
I find myself aiding novice programmers relatively often; explaining why their code won't work when they ask, suggesting solutions and the like. The people I'm helping do have a formal education in programming from a first-year degree-level module, in Java, but I feel like I can't communicate with them very well. For e...
This is an abstract question to clarify a refactoring concept in the ruby language. Assume in the real world that there would be many more variables and method in the Furniture Class and Refinish method. I have a Class called Furniture. It has a method called 'refurnish(VarnishToUse, TimeToTake)'. This method has va...
This question has been on my mind for probably 10 years. Ever since I've started programming for a living. And I've seen multiple discussions about good fit, distractions, being in the zone, etc. But I haven't seen links to some information/research that could give an objective self evaluation measure/tool to understan...
I have written one web services using Java. Its already live (up and running). During development I have SVN (repository) + Jira for task maintenance + Maven for building the web services. Now I have some small update for my web services and I have created that task in Jira and committed the files in svn with respect ...
I am planning to develop a commercial software using a LGPL software. In the LGPL software that I am using some functions in a class are not fully implemented. I want to modify the LGPL code so that the class and not-implemented functions are made visible outside the dll by adding dllexport infront of class and by add...
I am not sure how to phrase this, but in asp.net there is the notion of a "web application" that is fundamentally just a DLL that the web server loads. It has the ability to dynamically discover and load user controls at runtime (e.g. a customized button), using something called MEF (which can discover dlls and load t...
I recently picked up a macbook and want to start doing some apps for my ipad. I have a chat client written in c# that interfaces a game I play. What I would like to do is write an app for the ipad that would communicate somehow with my c# app. What would be the best approach to this? I have never used JSON but is this ...
Our company is about to acquire a source code of a huge product. What are thing to take into consideration when the handover starts, to make sure we have everything and be capable to maintain that product in the future?
I with 2 other friends are new to web development. We are learning HTML, CSS, Javascript and are creating simple websites to get a feel of different things. And as HTML is only a markup and not a programming language we have very different styles evolving. I mean whenever we look at each other's code, we tend to put a ...
The major online IDEs are hosted on the service provider's server. Examples are Kodingen, Cloud9, ShiftEdit. Hence they would be unavailable if the external server was down for some reason, and I prefer to do my computing on my own computer anyway. Does anyone know of an online IDE or editor (preferably just an editor ...
Initial note: This question got closed after several edits because I lacked the proper terminology to state accurately what I was looking for. Sam Tobin-Hochstadt then posted a comment which made me recognise exactly what that was: programming languages that support intersection types for function return values. Now t...
I realized there could be a lot of bad code in a system while writing Java. I wonder why schools don't teach what programming practices are bad. For example, in Java, using a big try/catch block that catches Exception is bad, but no one told me. And we see the typical "String + String" concatenation appear in every cor...
I am currently learning about bitwise operation, so bear with me. I understand AND, OR, and shifting. What I don't understand is bit flipping. So, 5 is 0101. When someone says to me "flip those", it would result in 1010 which is 10. So why does ~5result in -6? I think I got this very wrong. Can someone enlight me? (I...
Suppose you were given an integer number in decimal notation. This when represented in binary will be a series of 0's and 1's. This sequence varies in length with the magnitude of the number. Now suppose you wanted to flip the 'n'th position bit in this sequence of binary numbers, how would you do it? The result of the...
Is it necessarily if a software released under both of LGPL3 && GPL3 terms have to include both license header notice top of each file? Or just put GPL header notice? or simply put LGPL3 license text in some file like COPYING.LESSER ? EDITED: I am the copyright holder of the project!
We're in a bad situation of having very little documentation on customization our past workers made to a business critical system. Lots of changes were done to Crystal Reports, database entities, and proprietary configuration/programming files for our ERP software. The current documentation generally reads something li...
After browsing the apple docs, I came across this sample of their MVC pattern: Using NSNotificationCenter and without using KVO, would this diagram below represent a correct implementation of the MVC pattern? If not, what’s wrong and how can it be corrected or improved? App starts with the left light set to on, and...
At my company, we have a quagmire of disparate cron jobs (on multiple systems) and manually kicked off processes which keep our business functioning that is a result of years of expedient development and subsequent neglect. Someday, we will need to come up with a more centralized solution for obvious reasons. One thoug...
I am writing an application that takes some file specifying an adjacency matrix and uses this to construct a graph (in this case, a directed social network). What I would like to do is specify the size of the matrix and then have it generate an adjacency matrix with one of these topologies: ring, hierarchical, fully-co...
I don't know if it's the right place to post this question but, to improve my productivity I need to install an open source issue-tracking system to keep tracks of all bugs and information about the completion. There are a lot of open source systems to do that but I'm looking for one which could be hosted on PHP / MyS...
We've recently moved to a better password storage strategy, with it came all the good stuff: Passwords are stored after going through bCrypt User is sent an activation link on account creation to confirm ownership of address Forgot password without security question, a link is sent to their email. The link expires aft...
I've been wondering about code reviews recently, based on how many questions I've seen on here talking about them. Between my internships, contracts, and full time jobs, I've worked for six different companies, and only one of them has done code reviews. At the last two places I've worked, code was good (or at least go...
Usually in a domain model, you'll have objects, and those objects will have properties that are mutable and properties that are immutable - for instance, a instance id/name will be immutable, while some other properties (specially properties that depend on relationships with other objects) can vary in the lifetime of a...
Possible Duplicate: Library vs. framework vs API? I am having hard times understanding what these concepts really mean. This software stack thing is very confusing. Can you please help me with this question, or if you can refer me to some article/book where I can learn in details about this software stack and how th...
Given a binary search tree, I understand why I can use breadth-first and pre-order traversal to list the entries of the tree in such a way as to reconstruct the tree in the order in which its traversed. However if we now consider an AVL tree and we want to traverse the tree in such a way as to recreate the same AVL tr...
I got one project with some requirements. Basically my client provide data entry work. In that he converts image files(scan copy of articles, forms etc) to document file (MS word) by typing manually. For maintaining quality of that work he set some roles on documents text formatting like specific font, font size, pap...
Context I'm developing an application using a Domain Driven Design approach. I want to use a design pattern wherever appropriate and apply all SOLID principles. Scenario I have an order and I want to allow clients to add order lines to it. Consider the following pseudo code: class Order OrderLines[] (readonly) ...
Is it a good practice to call a method that returns true or false values in an if statement? Something like this: private void VerifyAccount() { if (!ValidateCredentials(txtUser.Text, txtPassword.Text)) { MessageBox.Show("Invalid user name or password"); } } private bool ValidateCredentials(string ...
A comment on this question: Checking if a method returns false: assign result to temporary variable, or put method invocation directly in conditional? says that you should use !boolean instead of boolean == false when testing conditions. Why? To me boolean == false is much more natural in English and is more explicit. ...
I was reading Paul Graham's essay - Beating The Averages (2003) and here's what he had to say: The more of an IT flavor the job descriptions had, the less dangerous the company was. The safest kind were the ones that wanted Oracle experience. You never had to worry about those. You were also safe if they said th...
I am using PHP. I'm building a fully modular CMS, which is destined for the public. Some people might view this as a framework, but I intend to write a set of extensions for it, extensions that will make it a CMS :P Because it's completely modular I have a problem figuring out how to load extensions. Practically I nee...
The model is defined first, then the controllers are fired based on the user request, and they will generate the views (the output). So it should be M->C->V, right?
Just wondering (now that I've started with C++ which needs a compiler) why Python doesn't need a compiler? I just enter the code, save it as an exec, and run it. In C++ I have to make builds and all of that other fun stuff.
I am working with a history teacher on a history app. He has like 200 flowcharts that he wants to put into the app (among other things). The two likeliest-looking ways to do it: HTML/CSS. The big minus here is that neither one of us is a big HTML/CSS person. Though I do know a bit about them. Adobe Illustrator. The in...
My friend and I usually don't have time to meet up in person to do some real pair programming. Since we want to program together anyway, we turned to the world of collaborative software editing. Sadly, most of the solutions we have tried are either lackluster or don't work at all. Cloud9 (fusion of Mozilla Skywriter, ...
If I have a number of classes, lets say a variety of buildings of some sort. Each of these buildings have various properties and do some stuff etc Now there is a set of operations I need to do on these buildings that are all conceptually the same. Lets call this conceptual group of operations Move building effluent...
I just started a diploma in software development. Right now we're starting out with basic Java and such (so right from the bottom you might say) - which is fine, I have no programming experience apart from knowing how to do "Hello World" in Java. I keep hearing that mathematics is pertinent to coding, but how is it so?...
A lot of questions get asked here about interpreted vs compiled language implements. I'm wondering whether the distinction actually makes any sense. (Actually the questions are usually about languages, but they are really thinking about the most popular implementations of those languages). Today almost no implementatio...
I've started toying with some Mac development and wonder where the best place to store the code is? Generally on my windows box, I'd store all my code in c:\Code\ On the Mac it's in /Users/Liam/Code/ Will this cause me any issue with permissions when running web code?
Possible Duplicate: Is there any reason to use C++ instead of C, Perl, Python, etc.? When to use C over C++, and C++ over C? I am going to enter university next fall in computer sciences, but have been programming already for a few years. I am currently doing web application development. I use Python and Java mainl...
I have essentially a data model class that represents an XML data structure that we use to model our system. The model class is in a shared project that is used by a number of different solutions in order to generate a common XML data structure for usage by any number of applications. In one application I am involved ...
So I've been creating a data access layer via TDD and have approached somewhat of a concern. I'd rather not start down the wrong path, so I figured I'd ask you guys to see if my thoughts were in line with a clean architecture. The methods within my Data Access Layer (DAL for short), are pretty simple. They are in line ...
We are designing a website/web application where we hope to to achieve high user counts and, in general, lots of use. More specifically, we intend to be using PHP as the programming/scripting language and MySQL for the relational DB needs as a start. We have not yet figured out whether to use a NoSQL database or not. R...
In C, I often come across errors with code like this prio_queue->head[index] = newEntry; Yields a " "Cannot assign Entry** to Entry* " How do you prevent/debug errors of this type, in general?