instruction
stringlengths
34
19.9k
I am researching ways to classify words in text and I'm wondering what options there are and which are best suited to this job. I'm mostly interested in keywords which are most often nouns. So far I know I could use a Bayes classifier, blacklist, or whitelist. However, I haven't had the best of luck with each of these ...
This is a continuation of this Code Review question. What was taken away from that post, and other aspect oriented design is it is hard to debug. To counter that, I implemented the ability to turn tracing of the design patterns on. Turning trace on works like: //This can be added anywhere in the code Run::setAdapterTra...
I work with a few different web platforms, and my actual projects are typically quite small, and live within those platforms. The project files are scattered throughout the platform tree, which makes versioning a little awkward. I've been keeping one repository per platform, which gets out of hand quite fast... The b...
I used to think I knew what this was, until I really started thinking about it... "maintainable"... what exactly makes code maintainable? To me, if code must be maintainable that means we can expect to revisit the code to make some sort of change to it in the future. Code is always "changeable" no matter what state it ...
What are the internal structural differences between distributed (e.g Git & Mercurial) and non distributed (Subversion) version control? The question came from a discussion group where a tool was interacting with CVS and it was argued whether it would be easily ported to other systems or not.
Working on a problem that uses the percent change formula: percent change = 100 * [(new value - old value) / old value] How would I explain the difference if new value or old value = NULL, rather than 0 to someone who might not be a programmer? My boss is wondering why there is an empty string in the TextBox rather t...
Recently I began a new project to re-implement a core part of automation. Since it is very important, I'm TDDing it so that I can tests various basic scenarios as well as things we know the old system doesn't do. In doing this, I find myself creating a few "sandbox" tests, which exercise "candidate" algorithms in compl...
At school we started learning C this year, despite the fact I'm way ahead of class, and I learned Java, C++ and C while the class is at the base of C. Anyhow, I've been documenting myself, reading books, articles, and I've asked my teacher why I should learn C, and she said it was the foundation of C++. When I first st...
I have no previous experience on creating a project for a seller which will use barcode reader. I am trying to put together a small project but I cannot figure out how the pieces should glue together. I will create a sample with Motorola Scanner SDK to read barcodes and from that point, I have couple of questions: How...
While some platform in some languages already address this issue, I would like to keep this semi-language agnostic and to focus on patterns associated with this issue. I have a data model that contains FirstName, MiddleName, and LastName (to keep things simple). First and Last names are required and may have other rul...
To debug my programs I mainly use the following methods: Use printf (or equivalent in other languages) to check the value of a variable after a particular statement or to check whether the program enters a conditional statement or a loop. Use watch/breakpoints when using IDEs. I am able to solve the problems using th...
I'm creating a sequence diagram for a simple program I'm working on for work. The diagram I'm currently working on is very high level - it defines the interface with lots of alt paths, but does not exemplify any specific use cases. I was wondering whether would it be more appropriate to instead make several diagrams wh...
Is there a license "wizard" question system that asks you questions about how you would like to use the software, and then either allows you to compare it against one or more license types. Background: In asking a question that requires the open source image recognition software to have a license commercial internal di...
I am new to web development. While studying the Play framework and JSP, I noticed that they both give an option to place script (in jsp scriptlet) inside HTML, but in both books I am reading they both say it is bad practice and don't give an explanation as to when should I use scripts, only writing not to. My question...
I work using Reporting Services 2008 and I'm constantly creating ad-hoc reports. We'd like to use PowerPivot on Sharepoint but we're stuck on Sharepoint 2007. Using easy reporting software like Tableau Server would be fantastic but we can't afford it SSRS Report Builder hasn't proved to be very helpful, unfortunately. ...
How to go about getting the number of combination ( C(5,4) ) without using recursion in C? Is there any other method or inbuilt library to do this?
Where I work, we have a lot of developers and an awful lot of code running our proprietary applications used by staff & customers alike. We also have a lot of smart support staff that like to understand the inner workings of our systems to better support our customers, and perhaps even submit a patch from time to time....
Possible Duplicate: How to promote an open-source project? I've done quite a lot of work in my spare time on a project that was mostly for my own learning experience and I'm quite pleased with the results. I've used github as a source control management, so the code is already public in a sense. The code in question...
What is the difference between public delegate void SecondChangedHandler(Object clock, TimeInfoEventArgs ti); public event SecondChangedHandler OnSecondChanged; and public event EventHandler<TimeInfoEventArgs> OnSecondChanged; When should you use which and is there any best practice?
I've recently watched Integration Tests are a Scam by J. B. Rainsberger and am now looking for more material on the subject. I have to say, I'm shocked by how much we're doing wrong, (i.e. integration testing when we should unit test), intrigued by the concepts described by Rainsberger but also confused about how to ap...
I seem to recall that there is a specific term for an accessor method that returns a Boolean value but it escapes me. For example: typical methods such as: class Example { bool isDirty(); bool hasChildren(); bool isValid(SomeType obj); }; I will also settle for such a term as applied to a non-member functi...
I have an AuthenticationManager.authenticate(username,password) method that gets called in someMethod of a SomeService under test. The AuthenticationManager is injected into SomeService: @Component public class SomeService { @Inject private AuthenticationManager authenticationManager; public void someMetho...
The place I'm working at is trying to establish some ground rules, and the debate we're having now is local libraries vs web services for code reuse. Web services seem to be the popular pick in most companies, and that's what most of the developers here are leaning toward. I just can't see how you can effectively use w...
Quite a lot of applications require records in their tables to have a status, such as 'complete', 'draft', 'cancelled'. What's the best way of storing these statuses? To illustrate what i'm getting at here is a *very short) example. I have a simple Blog application and each post has a status one of: published, draft or...
I have a system I've been working on this week where I'm having a hard time balancing separation of concerns with easy extensibility. I'm adding new types to the system, and it feels like shotgun surgery. The basic idea is that data is collected (polled) from a remote system and then made available to a number of diff...
I'm just now learning TDD. It's my understanding that private methods are untestable and shouldn't be worried about because the public API will provide enough information for verifying an object's integrity. I've understood OOP for a while. It's my understanding that private methods make objects more encapsulated, thus...
I am writing an system for the company to put their promotion material on the site, which is like some kinds of CMS. So, I need a database that store their data, but I am considering how to store their data.... First approach is use a single table to store their data, but use a column, like 'company_code' to distinguis...
I'm a software developer. What do I need to know about software testing (apart from TDD, unit-testing and stuff) to make my software work as it should? For example, there are cases when TDD is not applicable. Therefore, I need to do simple smoke testing of my code every time it is deployed/changed. In order to prevent ...
I've read many comments about GUI programming, in both, C# and C++. And I noticed that Microsoft's .NET framework is powerful for GUI programming. So is it possible to use C++ and .NET framework? I think it will be a great combination since C++ is powerful language, and .NET framework is preferred for GUI programming ...
I am developing an application which is based on the quiz contest for competetive exams. The user can give different categories of tests, which will contain different types of questions of following types: Single select, Multiple select, Match making, Comprehension (the quetion will be a paragraph and on the basis of ...
I've got a catalog at work and I want to juke it up a bit because I'm tired of it being extremely slow. I'd like to support the modified preorder tree traversal storage method for the category tree of the catalog but i'd have to support dated versionning. I've thought about creating versions of trees based on dates, so...
Myself and another developer with the go ahead from our IT director have started a general purpose library in .NET with the intention that it will provide many common purpose classes that we use in our day to day development. During discussions and design of the library we have come up with a set of standards that we w...
Take a User class and the idea that a User is to be profiled. I see four ways to handle this: Write the code for the profile into the User class. I am dismissing this right away. Create a Profile class and make it a property of the User class. Write a User class (with the boiler-plate name, address stuff), write a Pro...
In a test I was asked: What elements present in the general form of a rendezvous are not present in Ada language? I was a bit stumbled as I thought Ada fully supported rendezvous. Now it seems it doesn't. Can anyone tell me what are those elements?
Is it ok to suggest pre-built scripts from a place like codecanyon to a programmer who is building a startup web app? Or is it more likely to offend? I don't expect that a whole web app could be built from bits and bobs purchased from a site but I'm unsure of whether its the right thing to ask someone to do. Also, I am...
I am trying to get an entry-level developer job, but have no relevant experience. I am able to code C#, SQL, HTML, and CSS and understand principles of OOP and have completed a couple of applications both in WinForms and WebForms. I've tried applying to graduate roles, but I get blocked by recruiters who don't like my ...
I've been reading about selective mutual exclusion (SME). The idea I got is that if a process competes for its resources against a subset of all the other process instead of competing with all the other processes then I'm facing a SME problem. 1) Can you confirm my definition is right? Now, the dining philosophers prob...
We are an outsourcing company. We develop firmware and software for our client. They have a hardware engineer team with whom we, firmware developers, work. Our client has a strictly defined process to release a firmware. A change in firmware version number has a big impact in that process. When we release a firmware to...
I have a server which is returning very big JSON message and my client application is only dependent on part of this response. Client application needs to check if "xyz" property exist in JSON message and depending on the result run a specific usecase. For this requirement converting the whole JSON message to object so...
I have been recently studying more on the dynamic types in C#. With some examples I understood once the code is compiled, it does not need to be recompiled again but can be executed directly. I feel the flexibility provided by the keyword to actually be able to change data type at will is a great advantage. Question,...
I understand that to measure a project or code, we can use The Joel Test, but is there any simple standard test (like The Joel Test) that is able to measure and filter how good a programmer is? My plan is to have this test as a quick filter first before going to a more detail test.
So I have this issue. The Operations team where I work has taken over TFS because they are using MS Build to build and deploy code to production servers. As a result developers have lost A LOT of functionality from TFS (see earlier question.) Essentially the operations team has taken owner ship of Trunk in order to m...
Google developed a cross-compiler from Java to JavaScript. Why did they do this? Does this mean that JavaScript is not good enought for developing advanced web apps?
I have been learning writing test cases for BDD (Behavior Driven Development) using specflow. If I write comprehensive tests with BDD, is it necessary to write TDD (Test Driven Development) test separately? Is it necessary to write test cases for both TDD and BDD separately, or are they effectively the same thing? It ...
Currently for school we are working on a research project. The central question of this project is: Which architectural patterns can be detected using static code analysis? With architectural pattern is meant the architectural patterns from the book: Patterns of Enterprise Application Architecture written by Martin Fow...
I am currently employed with a company for 2.5 years and I have been working with the .net stack for the entire duration mainly on the MVC framework. I believe I have some cool ideas for a startup but I am not sure if I should continue in this stack or switch to some other stack like Ruby on Rails. The reason why I am ...
I have been reading the advice on this question about how an exception should be dealt with as close to where it is raised as possible. My dilemma on the best practice is whether one should use a try/catch/finally to return an enum (or an int that represents a value, 0 for error, 1 for ok, 2 for warning etc, depending ...
I couldn't write a book on Agile. I have worked in several shops that call their process Agile. One of the main points of Agile development is regular client involvement. After a sprint, the work can be demo'd to the client to obtain their feedback. Rinse and repeat. The problem I come across is that many clients d...
I am starting a research project and need to nail down a programming language and 3D graphics API where I will be creating an environment in the field of molecular cell biology where I will be simulating a large range of experiments in silico. This will be an ongoing project which will keep expanding and growing in siz...
We have about 3/4 different projects, each sharing a certain level of data. Some data is not shared, but all the data access has ended up in a single namespace that is included in every project. Utility methods and other "shared functionality" is continually added to this root namespace, and is ultimately fairly organ...
I've been trying to revise the structural design of the C#.NET-based system I'm currently working on. The new design involves a rather light-weight object-relational mapping framework (we're trying to stay away from ADO or linq2sql). Sorry, this came rather lengthy, but I cannot describe it shorter - it's a bit comple...
There is a server that responds to requests on a socket. The client has functions to emit requests and functions to handle responses from the server. The problem is that the request sending function and the response handling function are two unrelated functions. Given a server response X, how can I know whether it's a ...
I was wondering whether it is possible to give any advice as the the maximum number of lines of code at which one should consider switching from say MATLAB to a more low level language? Is it even the case that at a certain point it makes more sense to manage a certain degree of complexity of a given program in a prope...
My company is looking to add Bluetooth functionality to our hardware, so that we can integrate connectivity to our products with various tablet devices. To do this, we are looking to purchase an all-in-one chip that we can integrate into our boards. Everyone within the development team is new to Bluetooth integration a...
I've heard about software and apps going into Generation 1.2 or 2.6, is there an actual methodology behind this? or it's more of a marketing thing? Currently we are using Scrum as our methodology in agile software development and it's based on sprints, but I haven't been able to find any information detailing what's ac...
I am working on a program with two views, html and ajax (which will be html transmitted via json). The HTML view is the standard, and by default the ajax should look the same. However, the ajax view is also meant to have options configurable on the client side for which components of the page should be displayed. I'm h...
Can a software program licensed GPL (version 2) rely upon libraries licensed under APLv2 without running afoul of the GPL? The language here suggests to me perhaps not. In my specific case I'm looking at a daemon that uses some APLv2-licensed external libraries. UPDATE (In response to answers/comments.) For the purpo...
I am doing legacy software programming in Visual Basic 6.0. How do I unit test it?
I know what an "applicative Functor" is, but I've been reading papers recently that refer to other "applicative" things, particularly "purely applicative data structures". The trouble is, I'm not sure precisely what "applicative" means in this context, and Google has so far failed me. I can get a general English (ie us...
This is probably something everyone has to face during the development sooner or later. You have an existing code written by someone else, and you have to extend it to work under new requirements. Sometimes it's simple, but sometimes the modules have medium to high coupling and medium to low cohesion, so the moment you...
Suppose I am working on an existing, reasonably large system. I have an object, myObject of class MyClass (for the example's sake, suppose I'm working in Java). myObject is a composition containing a Collection, say, a List and other objects which (I think) are irrelevant. It contains delegate methods which just serve ...
I have an interface that has a certain amount of well-defined functionality. Let's say: interface BakeryInterface { public function createCookies(); public function createIceCream(); } This works well for most implementations of the interface, but in a few instances, I need to add some new functionality (like perh...
I have an assignment to implement a priority queue in C as well as make an app that uses it. I, however, only know basic-level C (I do know Java). My intuition says that I need to learn pointers. What other stumbling blocks should I expect or prepare for? How do I go about making this secure?
I just saw a video showing how Notch (of Minecraft fame) is debugging and changing Minecraft while it is running. He pauses the game, changes something in the code and then unpauses the game where the change takes immediate effect without the need to restart the program. How does this work? Which kind of technique is ...
I'm aware that this is a rather broad question, but here it goes anyway... What is, in your opinion, the most practical way to create own C# implementation with minor additions to the existing 4.0 feature set? For context: I'm thinking about adding a couple of (mostly syntactic) niceties to the dynamic feature set that...
I have the following situation. Imagine you have a MainWindow object who is layouting two different widgets, ListWidget and DisplayWidget. ListWidget is populated with data from the disk. DisplayWidget shows the details of the selection the user performs in the ListWidget. I am planning to do the following: in MainWind...
I am currently doing my Honours in Computer Science and taking Artificial Intelligence as a subject. As part of completing the subject I have to develop my own basic intelligent agent. I have yet to wrap my head around what I actually have to do for this project. I am not the most technically gifted programmer and I ha...
I have a fair amount of experience with WPF (C#) and XAML. I might soon be asked to create a Silverlight 5 application. I have no experience with any version of SL. What sort of learning curve could I expect in creating a SL 5 app, given that I have some experience with WPF?
I'm developing a DBMS that should be able to connect to IBM DB2 via the DRDA protocol. I found a DRDA reference manual that mentions "DRDA Implementation Programmer's Guide, SC21-9529" as a publication about DRDA, and seems that this manual is exactly what I was looking for. The problem is, I am unable to find it on th...
I've allready created small desktop CRUD applications using Java/Swing. In hindsight I'm not quite sure if the overall design of these applications is good. I've also done some reading on MVC and looked at different Swing-tutorials. My problem is, that I've got a very theroatical knowledge of MVC and on the other hand,...
Possible Duplicate: Are debugging skills important to become a good programmer? I'm a young Java developer and I make a systematic use of the Netbeans debugger. In fact, I often develop my applications when I debug step by step in order to see immediately if my code works. I feel spending a lot of time programming t...
From http://www.microsoft.com/download/en/details.aspx?id=28942 ASP.NET MVC 4 also includes ASP.NET Web API, a framework for building and consuming HTTP services that can reach a broad range of clients including browsers, phones, and tablets. ASP.NET Web API is great for building services that follow the REST ar...
Assuming a system where there's a Web Application with a resource, and a reference to a remote application with another similar resource, how do you represent a bi-directional sync action which synchronizes the 'local' resource with the 'remote' resource? Example: I have an API that represents a todo list. GET/POST/PUT...
According to the wikipedia page for the MVC architecture, the view is free to be notified by the model, and is also free to query the model about its current state. However, according to Paul Hegarty's course on iOS 5 at Stanford, lecture 1, page 18 all interaction must go through the controller, with Model and View th...
I have programmed for a few years in php and now I'm going to learn zend framwork. Zend is very popular and there are a lot of tutorials, books and documentation out there. But I saw in the last months that there is a second version of Zend, but it's not so used and popular, not yet. I think it is better to start with ...
Quite often in my work the idea of 2-way data synchronisation between database systems crops up. The classic example is two slightly different CRM systems (say, Raiser's Edge and Salesforce) and the need to have a two-way sync of Contact data between them. API considerations aside, assuming you have a shared key to syn...
Background So I have a REST API that allows for client applications to access and manipulate users' data. I'm in the process of writing an Objective-C class for simple utilization of this REST API, but I'm stuck between two methods of implementation. Method 1 class MYClient string username string password m...
I have a bit of code which uses a plugin and core model, revolving around four major objects: the Core, Server, Logger, and Parser, in slightly particular order. The Core acts as the central factory, with a catch: it's bound to a single render context (much of this is graphics related, but the other details are not imp...
Im not a paid developer, I spend two or three hours a day working on a development project as a hobby. As time goes by, I come up with "good-ideas" for the project, that are generally features or bug reports. I would like to manage them using a ticket database. My question is about the "scope" of a ticket. I see fr...
How would one use the Decorator design pattern for anything other than trivial toy problems, in a deep class hierarchy? For example, let's say you have the class class Decorated : public Foo, Bar, Baz { public: void operation(); }; You would decorate it like this class Decorator : public Decorated { void operatio...
I am creating an application which I would like to have communicate with my website. The app will have to get data for a particular app user from the website's database. I am unclear as to the best way to do this. I have seen one way of doing this for example is creating a login page on the app which then hits a login....
Is it possible to construct a parser combinator library that reads like a BNF grammar? I don't know of any, so I started wondering if there are reasons it's impossible or undesirable to do so. It seems to me it would be the best of both worlds. Functional languages such as F# allow operator overloading. Is it just a ma...
How is it legally possible to take a project initially released as open source back to closed source? Especially one licensed with the GPL any version.
Most of programmers who are involved into development of more or less large project(s) know how annoying the process of compilation can be. There are some other things which are dependent on compilation, for example unit tests. TDD requires tests to execute fast, otherwise developers tend to run them rarely. The proces...
I've a c# file that will contain, most likely 10,000+ lines of code. I'd like to break this file into tabbed segments, so I can organize each method into a certain tab and label the tab something like : initial setup, helper functions,execution logic,list structures,global variables, etc. If I were using PHP I would h...
We have an app that's currently only got about 120 users. The userbase will probably grow by 50% over the next 12 months - but we're going to have to separate storage etc. because we're looking at several TB of data. Later this year, we will move to cluster based hosting. The app will also be provided in multiple langu...
After having worked with a Microsoft stack - VB.Net, ASP.Net, SQL Server - for the past 10 years, we are now faced with having to develop an application for both Windows and Mac environments. It has been suggested that MySQL, for the database, is available on both platforms. I've been under the impression that MySQL is...
Do they mean the same thing (attaching URLs to actions, or actions to URLs) or is there any difference I'm missing? Example: http://github.com/dannyvankooten/PHP-Router vs. http://konstrukt.dk
Until today, I have always used the terms open source and open source software interchangeably. But then I read Phil Haack's blog post in which he suggests that the two terms are not necessarily referring to the same thing. He proposes the following definitions: Open Source Software is source code which is licensed un...
Coding a new website. Basically, for position elements using CSS I would use percents and figured that was the best thing to do since everyone's monitor was a different size. But I noticed a lot of big websites use pixels. I don't understand how you can use pixels to position things since we all have a different size s...
I 'discovered' interfaces and I started to love them. The beauty of an interface is that it is a contract, and any object that fulfills that contract can be used wherever that interface is required. The problem with an interface is that it can't have a default implementation, which is a pain for mundane properties and ...
We recently had a discussion in the office because of conflicting views between developers. One side (side S) argued technical solutions -generally- need to be a specific as possible, while the other side (side G) argued generalized solutions are preferred. I'll try to keep it short; we deal with file transfers and we ...
It is my perception that whenever new JEE projects start (where these technologies would be applicable), people prefer to use a combination of Spring + Hibernate instead of EJB 3. It seems junior programmers are even advised to go for that instead of EJB. Is this personal preference or are there pertinent reasons for i...
I've city names, like Newyork. Somebody may misspell it and write it as Newyoork. I want an algorithm or library which can match such patterns with some confidence level. Any idea how to do it or if any pattern recognition library is present? It is same as when we type something in Google with spelling mistake in it bu...
Can someone confirm good performance using PHP + Java webservice (for heavy duty tasks) running on NGINX (or Apache) because PHP is slow in completing some heavy tasks and I want to make a web service in java to communicate with PHP via SOAP or REAT or JSON. The fact I'm asking this question is that I already know PHP ...
The Top 10 programming languages, according to the TIOBE index seem to be heavily influenced by C: 1. Java The language derives much of its syntax from C and C++ but has a simpler object model and fewer low-level facilities. - wikipedia.org 2. C C is one of the most widely used programming languages of all time and ...
Problem: I'm working on coding a few light-weight touch-tablet games and often get stuck with difficulties naming my user interaction/interface classes and their relationships with each other (architecture?). I'm rarely satisfied with any of my solutions, thus doubt and change them several times on down the line. For ...
I'm going to develop a Kakuro (Cross-Sums) game for Android, and have got the algorithm right. But I can't seem to get the user-interaction part right- i.e. The puzzle is very large. So only a portion is shown at a time to a user depending on their device (eg: HVGA smartphone vs XGA tablet). It should be scrollable. To...
I am familiar with writing Software Requirements Specification, but not quite sure how to write the requirements for a specific module. Let's say I need to develop a Reservation System and there will be a module to perform validation. Now, an SRS is already available for the entire system, but prior to designing(API S...
I'm basically looking for arguments to persuade the internal "consultants" at work as the following are not working: What happens if you do a Cartesian join and crash the server? You don't need to do selects from that server. You have other servers for that. It's not for you it's for the clients. We're going to be im...