instruction
stringlengths
34
36.1k
We've introduced a code review process within our organisation and it seems to be working well. However, I would like to be able to measure the effectiveness of the process over time, i.e. are we not finding bugs because the code is clean or are people just not picking up on bugs? Currently, we don't have an effective ...
I barely passed my Java programming exam today. I had to answer some general questions about threading which I did well and to write a little threaded program which was worse. I had to connect my laptop to the projector screen and write the program right away. My first attempt was to use anonymous classes but I forgot ...
I am going to try CGI scripting for implementing a web based Graphical User Interface on an embedded device. What advantages does LUA scripting have over shell scripting or C for implementing dynamic HTML files? Which one do you think is easy-to-use from developer's perspective. My GUI will comprise of some form based ...
I recall a methodology that emphasized making functions short and numerous. It said that if a section of code can be separated at all, it should be, even if the resultant functions are only used once. Some argue that it's DRY taken too far, and that this kind of obsessive refactoring is counterproductive. Does anyone...
I've seen objects created in Java code without storing a reference to the object. For example, in an eclipse plugin I've seen a SWT Shell created like so: new Shell(); This new Shell object is not stored in a variable, but will remain referenced until the window is disposed which [I believe?] happens by default when ...
We are hiring for a small development department within a medium sized company for which software is not the main line of business. As such, we are attempting to recruit what we have labeled a Senior Programmer. The goal is to find someone that can design, implement and maintain entire new and existing systems from t...
I'm looking to get a job as a Python programmer. I know the basics of the language and have created a few games with it using pygame. I've also started to experiment with Django. However, looking at the job market, it doesn't seem very many Python jobs are web-related. On the desktop side of things, it doesn't seem lik...
I want to write Javadoc in DRY way. But the oracle document about Javadoc says write same thing again in overload method comment. Can't I avoid repetition?
From my understanding SVN is 'Easy to branch. Difficult to merge'. Why is that? Is there a difference how they merge?
Let's say, we have... 50k points randomly allocated in 3D space, according to some volumetric function, so that in some parts of the space, points are closer together, but in other parts, they are further away. Every point has a random color (represented by an integer, for example) I would like to find all points that:...
A principle that I follow is that, when an identifier is established, it should be a signal to the reader that the value referred to is indeed an abstraction which will be used more than once. That is, the identifier is defined or assigned once, and the value is read more than once. However, a common idiom exists where...
I have some experience with Perforce, SVN, and TFS. For SVN, The source files were by default writable after synchronization. However, they were readonly for Perforce, as well as TFS if memory served me. Meanwhile, 'checkout' means source sync for SVN but its meaning is quite different for other popular tools. I'm wond...
I noticed some redundancy in a script I ran through Google Closure Compiler. (function(){function g(a){var k;if(a){if(a.call)a.prototype=j,a.prototype[e]={}}else a= {};var c=a,b,c=(a=c.call?c:null)?new a(a):c;b=c[e]||{};var f=b.extend;b=b.a;var d=c.hasOwnProperty("constructor")?c.constructor:b?b:f?g.b(f):new Function;...
Possible Duplicate: How do I improve my coding skills? I'm a 4 yrs experienced programmer with JAVA being the strong point of mine. I know basics of web, C++ android, blackberry programming. Was wondering how should I improve myself. Does learning new languages help or learning design stuff and learn to become a ar...
Currently I'm working a bit with ASP.NET and trying to find the best way to navigate through pages. Right now I have an UpdatePanel which has a Placeholder inside it. This Placeholder will then add the usercontrol I need. I've been looking around on the internet and some say that this is a really bad thing to do, whil...
The webpage of Converge states that: Converge has a macro-like facility that can embed domain specific languages with arbitrary syntaxes into source files. I am most intrigued by the possibility to create domain specific languages. My understanding of the purpose of such languages, is that they enables the developer ...
Over last one year or so, I have driven my team towards the release-early-release-often mode of development (AKA: Rapid Application Development, not Agile). For more information about the manner in which we close the build, see my answer here: A simple ways to improve the release quality in RAD environment When we ado...
I have a strange situation at work, where a colleague of mine often asks me and other co-workers for working code. I would like to help him, but this constant request of trivial snippets interrupts my thoughts and sometimes makes it hard to concentrate. Plus, I have the impression (...) that this requests are generate...
Possible Duplicate: Techniques to re-factor garbage and maintain sanity? What is a good way to refactor a large, terribly written code base by myself? Really open question here. I'm not after an answer.. only advice. Any past experience people have had with re-factoring legacy systems that they could pass on would...
An awkward, open question, but it's a problem I'm always bumping against: Software that's easy to maintain and work with is software designed well. Trying to make a design intuitive means naming your components in such a way that the next developer should be able to infer the function of the component. This is why we d...
In my application I have a set of jobs to execute: Each job goes through the states "not started", "started", "completed", "failed" etc. Each job has a set of pre-conditions and post-conditions. Job cannot start until the preconditions are satisfied and should be marked as failed if it doesn't satisfy the post condi...
Assuming you have functions which take an increasing number of optional parameters (and a pseudo language which does not allow optional parameters and an arbitrary number of parameters) like this: function doStuff(Param a) function doStuff(Param a, Param b) function doStuff(Param a, Param b, Param c) What is a good wa...
My question is rather a design question. In my program I got to a data structure that looks something like this: private ConcurrentHashMap<A, ConcurrentHashMap<B, ConcurrentHashMap<Integer, C>>> services = new ConcurrentHashMap<A, ConcurrentHashMap<B, ConcurrentHashMap<Integer, C>>>(); Is there a way to handle such a...
I have seen several applications that claim to convert Java code to valid C or even C++. Converting from a high level language to a low level language is possible, no doubt about it. At least in theory, can the reverse be done without any manual steps? For instance: Converting Assembly to C or Machine Code to Assembly...
It's not about security or something. There is a table to record user information, like username, password, postcode and so on, one record per person. There is also a table called post to record the posts the users posted. It's very easy to set a relation to identify the user who posted the post. But think of this situ...
So, I am getting some years under my belt in long term programming. I have noticed, however, when the frequency and duration started increasing in my coding sessions that when I actually went to write a paper, email, document, or anything else that required writing more than a few sentences that my writing quallity ap...
I have problems to give the right time complexity in O notation for the following loop: k := 0 for i := 0 to N for j := k to M // something k = k + 1 Where N = M. Without the modified starting value of j of the inner value this would be of course O(N * M), but with the decreasing running time of the inner l...
Possible Duplicate: How to productively spend “free time” at the office I am a Coldfusion Web Developer. I recently changed a company so that I can relocate to a different state. The current project I have is just a backup position for 3 months. I am not having much work, and the work I have also has nothing to do w...
Possible Duplicate: Scrum: how to handle backlog-items that are longer than one sprint I have a project with complex user stories which take way longer to implement than spring length. For example: user story sounds like this : "User is able to receive a report at 10:00 am daily" But behind the scenes, it require...
I know that null being added to every type in Java is a source of much frustration regarding the language's type system. At the same time I generally hear complaining about checked exceptions - that they clutter interfaces, encourage exception swallowing, etc. It seems to me like null inhabiting every type is a way aro...
In many cases, I want to write methods that have the same functionality for different types of inputs. This is easily accomplished by method overloading if the parameter types are different. But what's the best (most robust) way to go about resolving the case when the parameter types are the same (i.e. two different re...
I ported a library to Java, but am wondering what to do with the JavaDoc comments. The original library used javadoc comments too, so do I leave the @author tags from the original code? And how do I give myself credit as the person who ported it over?
I'm thinking of scientific applications that are mostly processor-bound and heavy on heap usage (at least several gigabytes). Any other time of the year I would happily go with C++, but in this case I wonder if the fragmentation natural to the C++ memory manager can be a serious issue versus the advantage of Java's com...
I recently started learning JavaScript and am looking for a good JavaScript Editor/IDE. I found dozens of them in a Google search but I would appreciate if users who have experience with using such an IDE could recommend one. I want an IDE with syntax highlighting, possibly IntelliSense and debugging support for JavaSc...
I am an undergrad studying Computer Science. When I tried reporting bugs to several projects, I came across the classification untriaged a lot. A web search didn't really explain what this means. Could you tell me what an untriaged bug is?
My production database is SQL Server 2008 R2 Express. It has limited features and I am testing it in a production environment. To better handle reporting queries in a highly concurrent environment, I want to use any open-source RDBMS with tables that will be acting as temporary tables to frequently fill recent records ...
The following principles of Agile development makes it look like Agile is mostly suited for services companies: Customer satisfaction by rapid delivery of useful software Welcome changing requirements, even late in development Working software is delivered frequently (weeks rather than months) Working closely with the...
This is more a learning question than coding, but I'm certain it's a common issue for anyone developing administration systems or applications in php/mysql/js etc. I've developed quite a complex application that lets users upload images, and define hotspots in them with associated actions. The images are stored in a ta...
I was wondering if php programmers keep error_reporting in php.ini on or off after delivering the website?
I have taken over the code base for a ruby-on-rails application which relies very heavily on ActiveRecord callbacks to perform domain rules. The application can be compared to a bank application, where a customer has an Account. On each account you can register a Transaction (an amount of money that is either inserted ...
While working on multitouch, one of the problems I've run into is the fact that nobody seems to do gesture recognition without some kind of init event, whether it's a mouseclick or contact with a capacitive touchscreen. Is it possible to do an "always listening" gesture handler? If so, how to do it without mirroring in...
Possible Duplicate: Why is Scala more scalable than other languages? The Wikipedia page on Scala says: The name Scala is a portmanteau of "scalable" and "language", signifying that it is designed to grow with the demands of its users. I've also read that: And that's Scala's dirty little secret. Scala is only scal...
Reading this other question makes me wonder if I (as an absolute beginner PHP programmer) should stick with WAMP and Notepad++ or to switch to some IDE like Eclipse. It's understandable that skilled developers will benefit from a big shiny IDE. But why should an absolute beginner use an IDE? Do the benefits outweigh th...
According to Wikipedia, about is an internal URI scheme (also known as a "URL scheme" or, erroneously, "protocol") in various web browsers to display certain built-in functions. It is not an officially registered scheme, and has no standard syntax. my question is... what "powers" these "interfaces"? there doesn't s...
Possible Duplicate: When should I start learning a PHP Framework I am an absolute beginner programmer. I've got lots of theoretical understanding from university a decade ago but no practical experience. I want to remedy that with a hobby project that would be similar to a real-world sellable web app. I've chosen PH...
is there a general method to evaluate the optimality of an optimization algorithm, for example an algorithm solving an otherwise NP-hard or NP-complete problem? The only method I came up so far is comparing the results of the algorithm against already known optimal solutions. If not, are there specific methods for some...
Once you escape the realm of electrical signals and are dealing with software, is there really such a thing as a "push" architecture where there isn't periodic polling? I can't think of any design where it's not polling at some level. It seems like it's always just a level or two beneath the actual abstraction/API you ...
After following buffer overflow examples and reading on them in various books/websites it seems there are lots of preventative measures in place to protect against them these days. ASLR, /GS flag security cookie, stack-protector in linux, etc, etc... Some of the examples I have looked at give instructions on how to dis...
I have read once in a book about exception where "an object of type Exception can be an instance of any subclassof Exception". I kinda get it, but there's still confusion can anyone clarify me the meaning of this?
We're launching a system, and we sometimes get the famous exception NullReferenceException with the message Object reference not set to an instance of an object. However, in a method where we have almost 20 objects, having a log which says an object is null, is really of no use at all. It's like telling you, when you ...
What would a system like BOINC look like if it were written today? At the time BOINC was written, databases were the primary choice for maintaining a shared state and concurrency among nodes. Since then, many approaches have been developed for tasking with optimistic concurrency (OT, synchronization primitives like v...
Has anybody done any real research on the probability of UUID collisions, especially with version 4 (random) UUIDs, given that the random number generators we use aren't truly random and that we might have dozens or hundreds of identical machines running the same code generating UUIDs? My co-workers consider testing fo...
I currently code in PHP. Recently I've been working on a project using PHP and Symfony that: reads large XML files (lots of DOM parsing/reading), converts large XML files to large arrays, merges 2 large arrays (lots of array sorting), takes the 2 large arrays and turns them into a large CSV file. I finished it in PHP...
I am not sure what exactly I am looking for here, but here are the facts: I will be offering a free to use software, free as in $0 cost only(not OSS). I need a piece of text included in the installer with agree/disagree, that would protect my rights. Specifically that I don't guarantee anything and shouldn't be held l...
When reading about best practices and code reviews, I have come across a word/phrase that people on forums have used to describe code that should be a warning sign that the programmer may have missed something or made a mistake. A sample sentence would have gone something like this: "Often if you see a single if statem...
I have always kind of wondered, but never took my time to actually ask these questions regarding licensing. Most of these questions are presumably pretty basic, but I have no idea what I'm dealing with here. The thing that baffles me the most is how exactly you "implement" the license for your OSS. Is just saying in th...
In a project where there are non-functional requirements which specify the maximum execution time for a specific action, QA must check the performance of this action on a dedicated machine using precise hardware under precise load, both hardware and load being specified in the requirements. On the other hand, some erro...
I'm trying to follow the MVVM pattern in a reporting / statistics application that I'm making in C# / WPF. I have made many model classes to hold properties as a starting point. Some of these models are made to encapsulate different statistics so that I can present data that can be cross refrenced. I'm thinking the ne...
I found a database structure for a CMS system and I want to copy it with the EF that this database is done in, is it OK to copy the database structure of open source software which is under GNU v2 lisence? I don't want the rest of the software only the database structure.
I'm building a grants management system where we're trying to find a list of lost users using a number of different means. The first attempt is email but if we do not have an email address, we will try SMS. Just wondering, before we get our business guys to start thinking up SMS messages, is there a maximum length or...
Is it good practice to have a main.c file that just has the main function in it and no other functions so that all other functions can be interfaced? If there is no definitive rule, when is it good to do so and not to do so?
Scala is billed as a scalable language, a feature that's even included in its name: The name Scala is a portmanteau of "scalable" and "language", signifying that it is designed to grow with the demands of its users. What does "scalable" mean in the context of Scala? What makes Scala more scalable than, say, Java?
Possible Duplicate: Does making source code available affect your ability to generate revenue? Initially I was going closed-source all the way, or at least until we have a good reputation, and open-sourcing will only improve that rep. Recently though, I've been thinking about open-sourcing the entire solution. Vario...
I have a project for university which I won't be starting immediately, but have been thinking about for a reasonably long amoung of time. I understand that University project development isn't like industry (I'm currently an intern myself) so the situation that I'll be pointing out at the moment will probably seem some...
I'm green at programming but not entirely noobish. I taught myself some Java about five years ago, and I learnt me some Objective-C recently. I was talking with a Unix guy a while back, and he said that if you do your object architecture and design very completely and correctly, cross-platform development becomes reall...
This query is related to application design the technology that I should consider during migration. The Scenario: I have a C#.net Winform application which communicates with a device. One of the main feature of this application is monitoring cyclic data(rate 200ms) sent from the device to the application. The request t...
I would like a schema to represent integer numbers starting with 0, without any limit (assuming access to infinite linear storage). Here's a schema that can represent numbers from 0 to 255: Use the first byte of the storage (address 0) to store the integer. Now, suppose I want to represent numbers larger than 255. Of c...
I am a newbie learning Java. In Java every source file must contain a public class and that source file should have the same name as that public class. Moreover, no source file can contain two public classes. Why is this restriction?
Possible Duplicate: At which point do you “know” a technology enough to list it on a resume I have been holding off adding Hibernate to my CV (resume, for American readers),but we are just coming to the end of a project where we have used it successfully and it might be time to add it. I don't know if we covered all...
We are planning to organize programming workshops for Java web developers with basic coding but no design experience. The goal of the workshops is to introduce these programmers to clean code. Focus Areas: TDD Four Rules of Simple Design runs all the tests contains no duplications expresses the intent of the programm...
Dart has been out for ages (in internet years), but judging by Google Trends , it hasn't gotten much hype, and the fact that it only works in Chrome doesn't help either. Nonetheless, Chrome is gaining market share every day, which lends itself to a better view on Dart. What is the big picture now? What state is the lan...
I develop personal projects on two machines without use of a shared server or a network connection between the two. Do any common version control systems reliably support use of portable storage (such as a USB flash device) as the shared repository?
Most organizations restrict access to the source code to engineers, and even at places like Google, the Android source code is kept off-limits to most engineers within the company. Why? Note: I am not talking about write access for everyone in the company, I'm talking about read access.
I'm trying to practice programing by creating a simple application which, I think, I can manage to do in .Net C# in Visual Studio 2010. I'm working on simple application which will let me to create small pictures (icons) in sizes such as 8x8, 16x16, 32x32 (etc) pixels. I will be creating a grid representing each size b...
I am starting a new Android application. What is the best structure to use? I am planning to make it a multi-package design as follows: Main package, including the Activity Service and data layer Entity package, including entity class. Any advice ?
I wanted to know the difference between agile lifecycle and agile unified process(AUP). I do understand that AUP is a modified version of RUP using agile methodology. Can you please elaborate on the differences between the two
I am developing my own programming language. It's a general purpose language (think staticlly typed Python for the desktop, i.e. int x = 1; ) not intended for the cloud. Do you think it's okay not to allow inheritance or Mixins? (given that the user would at least have interfaces) For example: Google Go, A systems lan...
Keep in mind, I know PHP as I learned it for this specific project. Also, I thought about just using magento, but as I went through it, I realized I would have to learn their framework. I am very opposed to putting more time into learning a framework rather than continue expanding my PHP knowledge. I took a computer sc...
On a uniprocessor, it is apparently optimal to schedule jobs that take less time first assuming non-preemptive scheduling - once a job runs, it must finish. Why? I am confused about how the ordering would change the overall latency. Since a uniprocessor can only take on a single process at a time, wouldn't the latency...
This is basically the same as Coding to interfaces, but played out in the real world of com when there are various engineering complexities such as immutability of published interfaces and implementations, etc. Consider the following situation: A OS-level object-oriented library with a set of published interfaces and ...
In 2011, I released some open-source code that was licensed using the Apache license. As such, all the source files have this boiler plate message at the top: /* Copyright 2011 My Name Licensed under the Apache License... <blah blah> */ So now it's 2012, and I am readying to release a version 1.1. As such, most...
I've been writing a few tools as standalone webapps for which I have written no server side code and it strikes me that I'm not sure what people call such things. I like them because they can be distributed as a single file that anybody with a web browser can run. Typically all the funky stuff is done by calling AJAX w...
I've been reading about Bayesian spam filtering and I think I understand the theory, but I just don't see why this approach is needed in order to calculate the likelihood of a message being spam, given that it contains a certain word. If we have a set of messages already classified by the user as either 'spam' or 'ham...
According to this page on MSDN the sql language used on Sql Azure is called transact-sql (the same as on sql server). But is this the only way to refer to programming on Sql Azure? The Sql Azure variant of transact-sql doesn't support a bunch of features including global temporary tables, distributed queries and syste...
I'm not exactly a new git user but I have never used any of its advanced features such as tags, branches, merging and others. I haven't even used anything equivalent features from other VCS software. My projects have been so simple that I have only needed commits and sometimes diffs. Now I'm planning to open-source a s...
I need to convert Powerpoint files to PNG in PHP. I can do the conversion with using COM in PHP but COM is only supported on Windows. I need to do this for both Windows and Linux. I am wondering if someone give me hints about that conversion.
As an example, let's say that I need to check for a certain usage of C# code and warn the user that that is a bad pratice. There are multiple usages that I want to detect, such as: Resource not being released by developer (in a heavy COM environment) Instance should be created using Activator instead of new (I don't h...
What could be the necessary prerequisites to be taken when developing an application with Unicode support in the context of Web applications Desktop applications Embedded applications Prerequisites to be taken care of relating to Type casting and conversion Data Storage Fallback in case of no Unicode support Transit...
Our system's main functionality is encapsulated in a service, let's call it X. There are requests coming in to X-Manager service which deal with all validations and security issues, and activates X's functionality after everything passed. We now want to extend X's functionality with a new module, let's call it Y, but w...
I want to create a static HTML file I can email to someone with a lot of data, and have that data sortable and filterable. What is the easiest to use library or package I can use to get this off the ground?
I'm currently coding a new application for my company that is rather involved. To meet the deadline, the functionality has been toned down quite a bit so that we can have something ready to go for launch. I've been given the task of getting version 1 up and running by the end of the month. I'm about halfway through de...
I know this may be a general question, but what exactly goes into scaling for all the users you will encounter, even if not in the next few months? I did some research and most of what is done is server side, with caches and other similar stuff. Any points in the right direction would be helpful.
I'm intrigued by the way Go abandons class hierarchies and seems to completely abandon the notion of class in the typical object oriented sense. Also, I'm amazed at the way interfaces can be defined without the type which implements that interface needing to know. Are there any terms which are/can be used to character...
While researching some information regarding managing state and session in web applications, I stumbled across this nugget of information: 67 is the first useful prime number after 60. (Yes, 61 is a prime, too, but it's too close to 60 to be of use.) Setting timeouts in durations of primes is common because it les...
Why was the property string foo = string.Empty included in the BCL? It seems more verbose and no clearer than just using an empty string (string foo = "")
I have been looking for a really good open source flash development environment with no success. The best I could find would help in the development of pretty much everything, but I still needed to have Adobe Flash Professional in order to compile my work. Is there a way I can develop Flash applications and not need ...
I've noticed that in most technical phone screens, programming questions tend to focus on inheritance. For instance: If a class is intended to be inherited, what should you do with the destructor? (Answer: make it virtual) What's the deal with public/private access? What's "protected" for? Etc. etc. It strikes me tha...
I just noticed that every modern OO programming language that I am at least somewhat familiar with (which is basically just Java, C# and D) allows covariant arrays. That is, a string array is an object array: Object[] arr = new String[2]; // Java, C# and D allow this Covariant arrays are a hole in the static type sy...
I'm working on an application that is going to replace a rather large spreadsheet. The spreadsheet is used to budget purchases and things like that. It is the largest spreadsheet I have ever seen, and it required a lot of manual data entry, so this application is going to automate much of that. But as I'm working on th...
I am trying to randomly generate a directed graph for the purpose of making a puzzle game similar to the ice sliding puzzles from Pokemon. This is essentially what I want to be able to randomly generate: http://bulbanews.bulbagarden.net/wiki/Crunching_the_numbers:_Graph_theory. I need to be able to limit the size of th...