instruction
stringlengths
34
19.9k
As a beginner programmer I find myself spending hours and sometimes even days on my desk reading code, writing code, focusing, getting headaches and whatnot. I've documented myself on computer health and such, purchased an ergonomic keyboard & mouse, however since I wish to take a career in programming, this question k...
I currently have an assignment that is really pushing my limits so I need some help on how to approach this. We have a set of 25 results We are using a jquery plugin to vertically scroll through these 25 results, the container displays five results at a time. When viewing the source code of the page, you can see the...
Does anyone know if there is some kind of tool to put a number on technical debt of a code base, as a kind of code metric? If not, is anyone aware of an algorithm or set of heuristics for it? If neither of those things exists so far, I'd be interested in ideas for how to get started with such a thing. That is, how ca...
This question has been obsessing me for the past 2 months. A while ago a friend who is a great programmer gave me some example codes, and for the first time I've noticed a unique style of organizing comments. He took some effort to design comments in a way that would make me more comfortable with the code itself. For e...
I've been thinking a lot lately about the need for better form security, and good ways to accomplish that. We currently use captcha codes to screen for bots, but that's annoying to users and may not work forever. I think that we need a more intuitive, organic system for screening bad comments/contact form submissions. ...
Our database does not have any audit functionality. It does not records who inserts the record or who who changes it It does not keep a history of the changes made Nothing can be restored if something goes wrong There are many other short comings for example the database does not have any data integrity, anything an b...
If you are a Senior developer with say 8+ years experience, how much time spent doing programming is reasonable for competency on average? Specifically working with some library or framework associated with the core language they have worked with. For example, 2 years of Spring or Hibernate for a java developer. I un...
I'm looking at the basic strcpy function. It is char *strcpy( char *dest, const char *src ); Which reminds me of assembly language: MOV DEST, SRC
Let's say you have some automated processes that generally go through the following states; scheduled - initiated - validating - executing - completed On top of that these processes can prematurely end because of an error or explicit user cancellation. My first impulse is to simply add error and cancelled to the list ...
I'm writing an essay, and would like to have some empiric evidence, perhaps longitudinal data where the popularity of these technologies is compared over a period of some years. Are there any statistics that show the popularity of Git versus SVN?
I'm wondering, is music notation language Turing-Complete? My first thought is that there are loops in musical notation, but there is no way to write conditional branches, right? I'm not a musician, so perhaps someone can help fill in the gaps?
I'm applying to university very soon, and I have my mind set on programming. I narrowed down my program options to Web Services and Applications, Computer Applications, and Computer Games. I'm leaning towards Web, since I've been developing for Web since college. Question So, my question is, would it be very difficult ...
Which (if either) of the below is the more conventional/acceptable way to structure packages in a J2EE app? I'm trying to follow an MVC pattern as much as possible. foo.bar.users foo.bar.users.servlets foo.bar.users.DAO foo.bar.users.Entity foo.bar.orders foo.bar.orders.servlets foo.bar.orders.DAO etc... or foo....
I have a windows service program that is running on one of our servers. It has a memory leak of some kind within the program. When it first starts running it is using 20,000k memory. Within a few days it is up to 400,000k of memory. It is a fairly simple program that tracks running processes and writes the informat...
I'm probably butchering the terms, if someone knows the appropriate terms - that'd be great. But my question is: should I design my classes so that their methods' parameters be accessible from the outside, or should they be all self contained? For example, I want to set a domain name for a class, which will served as t...
After looking at the core data type for frameworks that deal with unstructured data in java: json java library: JsonObject Mongodb java api: BasicBSONObject SolrJ (Solr java client): SolrDocument the common theme seems to be that data are first de-serialized into Map, then transformed into an given class by reflectio...
I was recently hired to redesign a management system from scratch. This is my first business-scale project. I have assisted with business applications in the past, but I am the only one dedicated to redesigning and programming the system with the assistance of a company employee. This employee built the previous versi...
I'm quite proficient with Java, C/C++, JavaScript/jQuery and decently good at Objective-C. I'm quite productive with the languages and their corresponding frameworks too and do produce enterprise level systems (and also small scale ones) with sufficient ease all the while keeping code 'clean' and maintainable (yes, I c...
I'm working on a messaging system for two years now, the system was written by a long ago gone team and involves emails and document processing. The basic process is: Receive an email, parse it, save attachments to samba share. Notify message processor. We have a robust Java application doing this very well. Process t...
Sometimes my QA team reports bugs, but neither I or them have any idea on how to reproduce them. This leads to very long and frustrating debugging sessions which sometimes do not even yield results. My software is tied heavily with proprietary hardware so bugs can come from many directions at once. Should I expect mor...
Possible Duplicate: Whats the difference between Entry Level/Jr/Sr developers? There seems to be three common java programmer qualification levels: Junior Middle Senior What makes a programmer "junior", "middle", or "senior"? Does it mean the the programmer has a specific amount of certifications or job expertise...
I am an experienced iOS developer amongst other things. I have a good mastery of Objective-C and Apple's frameworks in the language. But when it comes to the C-based frameworks I often hit a ceiling with my knowledge, and often have to look up idioms and syntax. I learnt C from K&R but it's been a while. I did try lear...
If I wanted to start learning Prolog on Windows, is there any package that would integrate Prolog into Visual Studio 2010? That is, a compiler and templates and so forth for working with Prolog on Windows? Assuming there is no flavor of Prolog targeting the .Net platform, is there a GCC Prolog compiler for Windows?
I am using ColdFusion 8 and jQuery 1.7. ** This is a programming question, because the solution I am questioning requires programming. It may not be the right solution to the problem, but if it is, then I need to figure out how to best program the concept. ** When a user comes to our site, we track their session by wri...
I am working on a website which is using Skin templates everywhere in the page. Because of this all the controls, even labels, are server controls. I was wondering if it is worth changing at least labels to HTML controls and create CSS for them. Is there any advantage of using Skin over CSS?
Six months ago, I asked a question about modeling data for my app, and received some advice pointing me towards STI (see Rails data model - best practices question for the details). I played around with it, got it working somewhat, and then got distracted and put the project on hiatus. I just started developing it agai...
I've been looking around and I've found some questions similar to mine but have never been quite satisfied with the answers. I'm more or less a Java n00b, although I am moderately proficient with C++ and I would consider myself intermediate to advanced, as a programmer in general. I'm looking to write a program in Java...
I've read through the NetworkX tutorial and documentation, but was unable to find real world answers for this question. Usually when using NetworkX, I might use strings to define nodes, then set several attributes. e.g. G = nx.Graph() G.add_node('John Doe', haircolor = 'brown') G.node['John Doe'][age] = 22 However, it...
We're starting a medium sized PHP web app, written in MVC fashion, using CodeIgniter. Most of the functional specifications have been written, and there are a few features that will definitely be replaced with improved behaviour in later stages of the project. I'm tasked with writing a workflow document from a technic...
For the sprint backlog, I read that the stories are broken into tasks, and estimated. Are these estimates typically development hours only, or development + QA? What are these hours typically consisting of? Thanks.
I'm independently developing a physics-based game using HTML5 canvas and JavaScript; I've used no external code at all (including physics or game engines), and my code is about 5000 lines in length. The development is almost complete, and now I want to release it. I am planning to release the game as a paid app on the ...
Creating repeatable tests for BizTalk maps is frustrating. I can't find a way to handle testing them like I'd do unit testing, because I can't find ways to break them into logical chunks. They tend to be one big monolithic unit, and any change has the potential to ripple through the map and break a lot of unit tests. E...
I am currently doing my 1st accademic project where we have to work in groups of 4 to develop an application (java ...). Anyways, how might work be assigned so that there is less dependencies on each other and we can work separately instead of waiting on one another? I suggested 1 person develop 1 layer: Model, View, ...
As titled, take ASP.NET/Perl/PHP for example. Because I don't have chance to work with UI Designer/or know anyone like that, so I really wonder do they use any tools to do the UI design? I don't mean tools like PhotoShop or Flash to make the graphic, but I mean like writting CSS, Table layout/color, Div, JQuery animati...
My company has highly optimized scientific application which has become so big and complicated that new versions are literally taking t = infinity to produce. (E.G. I have an email which pre-announces a late 2007 release for something that has not been released yet.) New feature requests from the scientific team to t...
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 ...