instruction
stringlengths
34
36.1k
I have a project which involves re-writing pretty much all the back end of a legacy application. It uses XML for persistence and was originally written as a single user system. With one large XML file that could be accessed by multiple users and hence get corrupted, I was thinking about introducing a SQL database wher...
We have an XML tree which stores the relationship between folders and video files. So each folder could be the artists name and below it we have the videos of the artist. Also each folder can have other sub folders. This tree structure can be accessed by multiple users where some users could be deleting videos, others...
Do you find it easier to keep a branch for each company that uses software you support/develop? Each company will want "customizations" and I am just trying to figure out the best way to handle those changes. A branch for each company makes sense in the short term but I could see how this could cause issues with upgrad...
I recently took on a contract job that will largely involve generating data feeds from my client's data and sending it to external partners, via feeds and API invocations. I've always found this particular kind of coding to be frustrating, for a number of reasons: You have to rely on specs, which often diverge from th...
There's a lot of documentation out there on how to use the 'jvisualvm' profiler, but very little (if any) real-life advice on how to analyze all those charts and dumps. I'm just a little overwhelmed by all the graphs and having trouble making sense of it all. I know this is sort of a monolithic-type question, but there...
It's been said in other questions that jvisualvm sampling works as a "lightweight" profiling tool by calculating metrics directly from Java stack frames. Its almost unanimously agreed that such a technique is faster but not as accurate in terms of its "timings". My question: why is this method not as accurate? And, wha...
I've come across some comments and answers on Programmers.SE that decry the use of the phrase "Code Smell" and I've been wondering what the reasoning is for those who dislike it. I first encountered this term when I read Fowler's Refactoring back in 2000, yet it's only in the last year or two that I've heard any c...
To my understanding, a parser creates a parse tree, and then discards it thereafter. However, it can also pop out an abstract syntax tree, which the compiler supposedly makes use of. I'm under the impression that both the parse tree and the abstract syntax tree are created under the parsing stage. Then could someone ex...
For example, Process P is listening to events E(A) and E(B), but to process either of the events, P needs the other event available too. Naively, when P receives either of the events, it will check if the other event is already received. If not, it can wait. But 1) this does not sound very efficient, especially when e...
I am a developer at a bank where an 80/20 rule is implemented. 80% of the time you work on your assigned project and 20% you work on something that interests you. However, I'm not really sure how to do that. I'm hoping there are others out there who can provide me with advice on how to. My problem is that when I really...
I'm self-learning iOS development through the iTunes U CS193p course, and I often find myself stuck. I've been trying to get unstuck myself, but it might take me hours and hours to figure out what I'm doing wrong, be it missing a method or not really getting a whole concept like delegation. I'm worried that I might be...
I graduated in computer science. I had pretty good knowledge in Java. I have about a year experiences in ASP.net C# Web form. What other things do I need to know if I want become expert in ASP.net MVC which I able to do a complex eCommerce website?
Suppose a class allows some kind of configuration that has some well-known default values but also has the option of defining a custom value. For example, suppose you want to let users configure a person's title. They can choose from a set of standard values (Mr., Mrs., Ms., etc.) but they can also specify a custom (Dr...
I have a PBF file that contains the following information about a country: Nodes, each with their own longitude, latitude and properties; used to store points in a 2D space. Ways, each with their properties, they are connected through nodes; used to store roads, boundaries. While this file is only 80 MB in its compre...
I am working a project in delphi and I am creating a installer for the application, there are Three main parts. PostgreSQL installation/uninstallation myapplication ( setup of myapplication is created using nsi) installation/uninstallation. Creating tables in Postgres through script(batch files). Every thing runs fin...
I am trying to acquaint myself with different types of languages to understand the areas in which each one of them is extremely good at. So far, I have dabbled into C - a procedural language, C++ & java - static typed Object Oriented languages and groovy - a dynamic typed Object Oriented language. Every programming la...
Reading Eric Lippert's article on exceptions was definitely an eye opener on how I should approach exceptions, both as the producer and as the consumer. However, I'm still struggling to define a guideline regarding how to avoid throwing vexing exceptions. Specifically: Suppose you have a Save method that can fail beca...
I've been assigned a group project from my AP computer science class, and I am required to work with three other people. I've never talked to them before, I have no idea their skill level, and all I have is their email address. The assignment, summed up, is this: "As a team you will complete a minimum of three Modules ...
I'm looking to write a server side service, which will be accessed from a Javascript/HTML5 client. The client will likely be sending a bunch of restful messages over HTTPS. All other things being equal, which is better designed to support this kind of scheme on the serverside - WCF or MVC3 (ie., a controller with only...
I currently have an installer that works, but I have to repackage the open source apps and hack things together to get the installer to install them. I want to be able to use the apps installation method without having to hack and repackage. So I am thinking about rewriting it. It will allow a user with little to no te...
Do you have any pointers on how one should go about implementing the oAuth2 protocol itself? That is, the server side or the "provider" facet of OAuth2? If you have tried to implement (a part of) it, please share the issues and the solutions. Note that this is completely technology and programming language agnostic - e...
Product I've inherited has the following composition: MVC web site where the controllers make calls to Repositories to get, insert and update objects retrieved that are defined in the: Data access layer written using Linq2SQL This means that currently the controller for the action /Account/Add will perform the fol...
Let's say you have an application that has a boolean field in its User table called Inactive. Is there anything inherently wrong with just storing false as null? If so can you please explain what the down side should be? I have discussed this with someone a few months ago and we both agreed it shouldn't matter as long ...
Are there any modern programming languages where you don't have to specify types for each parameter in a function's definition? Ex: procedure P(a, b, c, d: integer) vs void P(int a, int b, int c, int d) Is there a good reason why the latter form is so popular? Why don't more languages allow you to specify the type ...
Basic pseudo class layout below... class Location(): # Class containing information about a location. id address_one class CustomerLocation(Location): customer_id account_rep class VendorLocation(Location): vendor_id drop_ship_cut_off_time Let's say you have locations which are going to be use...
I have quite a bit of Java code that I'm re-working to be re-used. The problem is that there are many pieces that are project specific so there are ends up being a higher level of coupling between the application project and the code base project. Compare to following situations where we use a class that implements th...
Consider the following JavaScript function: function Foo() { function getPreferences() { if ([there is an existing preferences object]) { return preferences; } return false; } } The calling code is: var foo = new Foo(); var prefs = foo.getPreferences(); if (prefs) { // do something with prefs }...
So my team and I are quite new to Scrum and today moved from estimating in Ideal Hours to Story Points. All seems sound rationale, BUT with timeboxed activities. Here is the case, we have an extremelly complex User Story that needs a spike so to explore underlying technical unknowns. With Ideal Hours it would be easy: ...
We are a small team of 4 devs rather green in Scrum. Coming from all over the country, we often take odd days off or whole weeks off to go home. Therefore our team capacity changes dramatically from one iteration to another due to annual leaves, which leads to very different velocities from one iteration to another. Ho...
I made a plugin for jQuery, which I think is quite useful. It combines an animated colours plugin with an easings plugin, and adds a completely new feature of being able to refer to colours numerically (more useful in hex notation, so 0xff00cc for example) and therefore manipulate them mathematically more easily. I cre...
I have designed/built a number of small web apps. Most have been used by clients who operate in a specific geographic area, mostly within the same state/province. For these I would follow best practices but normally didn't worry too much about issues caused by distance from the server. I have a potential client whose...
I've started using Emacs, and love it. Naturally, I'm thinking about ways of extending it. I' m particularly fascinated by the thought of creating browser based GUIs for some stuff I would otherwise do in emacs, particularly reviewing fairly static data. An example: I have a bunch of txt files (created and edited in Em...
I've been a professional programmer for many many years (20 years) and now I've lost interest, at the moment I have trouble even knocking out a few 100 lines of simple stuff. It will take me 3-4 days rather than 30-40mins Anyone have any tips how to get your interest back? Since I was a kid I've pretty much been into p...
I've been reading the book "The Drunkard's Walk: How Randomness Rules Our Lives" by Leonard Mlodinow and it's a truly enlightening read. The book deals with probabilities and human reasoning. And let's just say, for the record, that while some things sometimes work, there's a chance that the things you thought made it ...
I understand that C++11's uniform initialization solves some syntactical ambiguity in the language, but in a lot of Bjarne Stroustrup's presentations (particularly those during the GoingNative 2012 talks), his examples primarily use this syntax now whenever he is constructing objects. Is it recommended now to use unifo...
What essential questions do you have to know the answer for, about a prospective software development candidate, before hiring him/her? I'm not seeking specific interview problems (e.g. sort this 3D array of numbers in O(1) complexity), but simply for things you need to find about, for yourself, about a new hire. (e.g....
I'm developing some application with clojure(lisp) alone in my team. It starts as small application. No problem. But as it's having features and extending the area, it's becoming important program. I worried about maintenance or something. No one in my team knows clojure or lisp nor is interested in languages such as t...
In C#, with an inherited class set -- when calling a method should we use keywords 'base.methodname and this.methodname'... irrespective of whether it is a overridden method or not? The code is likely to undergo changes in terms of logic and maybe some IF-ELSE like conditions may come in at a later date. So at that tim...
I am pretty comfortable with dependency injection using NInject in MVC3. While working in an MVC3 application, I developed a custom Controller Creation Factory using NInject, so any controller that is created will have dependencies injected in it through this Controller Factory. Now I am starting to develop a windows a...
I need to create some Java interfaces to query some database tables and some web services for new framework I'm building. In a previous Java Spring web application, I used Java Beans to handle the results of the query. In this case, I need to write some interfaces to publish the methods that will be available to end us...
I am working on Application which goes and get's market data from different sources, I am using polling mechanism where vendor/broker put his data file and my application would go and hit that ftp location multiple times during the day to get data. Right now, we hit location every 5 mins and if data is not there then ...
I recently designed a time series module where my time series is essentially a SortedDictionnary<DateTime, double>. Now I would like to create unit tests to make sure that this module is always working and producing the expected result. A common operation is to compute the performance between the points in the time ser...
I am going to build a Windows Communication Foundation (WCF) service using Microsoft Enterprise Library for caching. I am wondering whether or not I should put the cache in the service layer. If I do this, do I have to use InstanceContextMode = Single for this to work? Are there better alternatives, because I prefer us...
Every few years someone proposes tighter regulation for the software industry. This IEEE article has been getting some attention lately on the subject. If software engineers who write programs for systems that expose the public to physical or financial risk knew they would be tested on their competence, the thinking ...
I want to write something that takes a sentence and identifies each word it contains and defines what part of speech each word is. For example Hello World, I am a sentence would return this verb noun, pronoun verb adjective noun Ideally, I'd like to eventually take it one step further and take a sentence and progra...
Possible Duplicates: Are there advantages to using a DVCS for a solo developer? As a sole developer (for now), how should I be using Git? I'm a solo developer, and I've been quite comfortable with SVN for a number of years. My workflow has been the following create a project on dev workstation and make changes commi...
I'm designing a programming language which has three kinds of quoted entities: strings and characters as in C, and symbols (interned strings intended for use as lookup keys and such) which I consider one of the most endearing features of Lisp. Currently I have the following syntax for these: "*" // String '*' // Charac...
A UserControl cannot be dragged-dropped onto a winform. Instead, I must compile the assembly add it to my toolbox, then I can drag it onto a Form. Doing this toolbox approach just to test out a control and then "tweak" it repeatedly is quite cumbersome. Right now, I plan to simply have this toolbox item pointing to ...
This was previously posted in StackOverflow, I just moved to here... I am using VS2008, MVVM, WPF, Prism to make a mutiple window CRM Application. I am using MidWinow in my MainWindow, I want Any ViewModel would able to make request to MainWindow to create/add/close MidChildWindow, ChildWindow(from WPF Toolkit), Wind...
We've been building a CRM for a client. Now that the first major phase has been finished, and a second one agreed upon, the client would like to pick up some of the work, making minor amendments to the database schema and business processes the first phase while we build the second. I'm undecided whether this is at all...
I know sessions are in PHP, ASP, ASP.NET and probably in many other languages. In most cases session solve a problem which the language itself fails to solve. I am wondering Who created sessions and when were they first introduced? Was it a feature of a particular language first? Is the use of sessions limited to web ...
This is more of mathematical question than an algorithmic one; nevertheless it will be implemented in php. I have an array of N tasks. Each task has taken t time to complete(e.g. task 1 has taken 5 hours to complete.) Now, in order to review that these tasks were completed correctly, I have to assign a certain number o...
A website I'm making has been growing larger and larger feature wise. Which means there's more URL parameters that get passed from page A to B or B to C, etc. Does anyone have any tips for how to keep track of and use parameter keys and expected values? Ex. Say a url I need to build is www.example.com?type=this&mode=a ...
In a blog post by Andrew Hay, the following axiom was posited: It costs significantly more to fix a bug at the end of the project that it does to fix the same bug earlier in the project. However, this doesn't seem certain, especially after reading a blog post on Less Wrong, and the data I've seen to back it up is ext...
I only have a verbal hosting agreement in place with a customer. Unfortunately the relationship has deteriorated to the point of no return, and I'd like to end the hosting agreement and hand them over the root password. This is a virtual dedicated server I pay for, and then they pay me. They are fine with this, but t...
I'm a professional C programmer and a hobbyist Obj-C programmer (OS X). Recently I've been tempted to expand into C++, because of its very rich syntax. So far coding I haven't dealt much with exceptions. Objective-C has them, but Apple's policy is quite strict: Important You should reserve the use of exceptions for pro...
Both Windows Phone/Xbox and Android lack support for generational garbage collection. This is frustrating for a lot of programmers. There seems to be a legitimate engineering reason to it, but I can't figure it out. Current phones have more memory and probably better CPUs than the desktops/laptops running .NET 1.1 with...
I think our company can create challenges designed to find software engineer candidates who are: Good at solving problems, not at wowing recruiters. More likely to be afraid to come up to us at a career fair. More likely to be underutilized in their current programming job but are too introverted to do anything about ...
I have been taking Advanced Placement Computer Science for this past year in high school. It seems as though we are taught simply to memorize code and functions and not how to be resourceful and efficient in using documentation and the like. Practically, I imagine many (if not all) programming jobs would allow you to f...
I'm building an app and the end user will be using an Admin screen to schedule content on the front page. They will be choosing two dates, a start date and an end date. Obviously I don't want to cycle through the entire collection to see if todays date is between any of the start or end dates every time the front page...
Suppose I have a PHP object, let's say: companyObj. class companyObj { private company_name; private company_address; public function print_contact() { //logic } } This is the object I wrote, and shared with the teammates. Now I would like to make it more powerful, like this: class companyObj { privat...
I'm working on an application and I need to use some existing components such as libraries and JavaScript frameworks that are covered by licenses. My application will be paid (not free) and closed-source. Can I use components in my app that are under one of following licenses: MIT Apache BSD
I was reading this transcript of an interview with a GitHub developer and he was describing how they use Redis: Q: You mentioned using Redis. How do you use that? A: We use Redis for exception handling and for our queue. We tried a lot of Ruby-based queuing mechanisms. Chris wrote an abstraction to the queuing ...
What is the best practice to manage the case where two customers add in the same time a product whose the stock was only 1 ? Must there be a check in the code of the basket to avoid one of these 2 customers to add the same product ? Or does this check must be carried out in the payment phase in doing for instance a se...
I'm writing a Java framework to manipulate a large amount of data in-memory, where many "cells" that are near each other will have the same value. I'm looking for algorithms and/or techniques specially designed to eliminate those duplication while maintaining fast in-memory read access speed. That is, techniques that k...
Possible Duplicates: How to approach refactoring an existing web application? Starting a coherent architecture in a legacy application We have a fidelity system running on the company I work for. It is written in C# and Flex and my boss want to change it to HTML5 and PHP to serve more customers and he is worried abo...
I am writing a non-web application (written in java) which will allocate cloud resources. I want to make it compatible with as many providers as possible. Is it wise to use OCCI interface? Will it be too complicated?
Today I found what looked to be my supervisor's password in some code in version control. The password is to a database. He is very experienced and has explained before how to avoid having passwords in the source code. How should I handle this situation? Is there a best practice about preserving evidence of a security ...
Comparing WPF and Asp.Net Razor/HtmlHelper I find WPF/Xaml to be somewhat lacking in creating views. With HtmlHelpers you could define in one place how you wan't to represent specific type of data and include elements set from the DataAnnotations of the property. In WPF you can also define DataTemplates for data but it...
I am new to programming, and at an interview I got a question on regular expressions; needless to say I couldn't answer. So I was wondering whether I should learn regular expression? Is it a must for every programmer of all fields? Or it is a must for programming for some particular fields? Related questions: Why are ...
I'm working on a client library to interface with my company's api, and we generate a user ticket when the user logs in using the api. Obviously I don't want to send the user ticket to the client for resubmission on subsequent requests - is it (relatively) safe for me to cache this value in $_SESSION for later calls?...
We're learning that most languages are classified as either of the two, "relation based" or "high level". I've never used SQL before, but from reading its syntax it seems more like the imperative/high-level syntax than functional/relation-based (Lisp, Haskell)?? Or it could just be that my interpretation of my professo...
Every time I start a project, I decide at crucial moments to completely change the core classes and get caught up in obscure errors. I try planning in advanced and usually start off on a good foot but then I go to it another day and decide I would like to do it 'another way'. Is there a standard, of sorts, when startin...
As a grad student, I find it more and more common for prestigious companies (like Google, Facebook, Microsoft,...) to put algorithm questions in their test and interviews. A few startups I applied to also asked about algorithms. I wonder if algorithms fluency is the most important thing for software developer in those ...
When working with annotations on entities in JPA, do these entities belong to the model layer or the persistence layer? Does there have to be some kind of clone of the entities (simple JavaBeans) in the model layer so it could be decoupled entirely from JPA? What is the best practice here?
By default, any file that PHP touches is usually suffixed with .php. It's universally understood by Apache / Nginx as the default for PHP files and most setups expect PHP files to end in this extension. In short, .php is the standard for everything PHP. However, I'm wondering if perhaps view files should have a differe...
So I'm curious: I've implemented Lua within C++ a few times before, and while it was relatively simple, it still didn't harness the power that I would have liked. I love how eclipse works, including javadoc locations, etc. and I was wondering if there was a way to integrate Java into a native application (that is cros...
One of my friends has been laid off. When I talked to him, he said they didn't let him take a copy of anything he worked on. When he asked how to show what he worked on to another employer in an interview, he was told that he will have some explaining to do. Should we, as programmers, be allowed to take samples of our ...
While researching Metro and WinRT I haven't been able to find anything regarding enterprise apps and database access. All I hear about is the front end development. Does anyone have any idea of how a Metro app will access a database server? Will this still be done through ASP.Net and ADO.Net? If not, then does anyone ...
I'm working on a view model for a view that presents a dialog with export options. The user selects options then clicks Export. When the view model completes the Export, the calling view model receives notification. I'm curious which is the better practice for implementing the notification: a traditional event or an Ac...
I am building a Java applet for a client. Yes, we have gone over all the options, and for the client's requirements and environment, this is the Right Choice. I am a big believer in using Apache Commons whenever possible to simplify my code and avoid reinventing the wheel. One part of the functionality I need for this...
Sometimes I find in the source code files comments have quotation marks like these ,notice the ` : `help' ``help" For example, these are comments from GNU cat source code file, cat.c: /* Plain cat. Copies the file behind `input_desc' to STDOUT_FILENO. */ > /* Select which version of `cat' to use. If any options...
Correct me if I'm wrong but I've heard that communicating with a database in Windows 8 will more than likely be done with WCF when working with C#/XAML. If this is true then will this also be the case when working with HTML5/JS?
I've seen this code referenced in two different places, yet I haven't seen anybody bring this up, but it seems that on line 00339 there is an empty if block and I just copied the code to compile try it out but it won't even compile cause of that. if (frame_count >= STREAM_NB_FRAMES) { /* no more frame to compress. Th...
I would like to create a budget app for Android. Obviously, to be competitive, I would need to allow users to get data from their bank. For [huge] security reasons, this stuff is not just freely given to any would be developer, but I know it can be done. There are budget apps that connected to users banks. My question ...
Where can I find the x86 instructions execution time? How to find out which instruction is faster or smaller?
Almost every public CMS out there uses a .php configuration file for the database settings and so on. For example WordPress automatically creates a .php config file when you install it. Why don't they just use a .ini file? PHP already has parse_ini_file() and I'm sure other languages have similar functions.
I always read that composition is to be preferred over inheritance. A blog post on unlike kinds, for example, advocates using composition over inheritance, but I can't see how polymorphism is achieved. But I have a feeling that when people say prefer composition, they really mean prefer a combination of composition and...
With a distributed cache, a subset of the cache is kept locally while the rest is held remotely. In a get operation, if the entry is not available locally, the remote cache will be used and and the entry is added to local cache. In a put operation, both the local cache and remote cache are updated. Other nodes in the ...
I work as an analyst for a financial institution, which, due to data sensitivity, will not store any data in the cloud. However, I'm having some success getting my team to use Git for code management. I was wondering whether there was any way to implement Github-like pull requests in our own server. The specific featur...
My workplace will soon be shifting to the concept of 'activity based working', which moves from the idea of IT teams, BA teams, PM teams, etc to project-based work where people from across all facets of IT and the business involved on a project sit and work together. As a result, you wouldn't be sitting with your norma...
I'm working in a team where each member is working on an user story. How can we avoid creating duplicate or conflicting functionality? For example, if my user story requires the creation of class A and my team member needs the same functionality and creates a similar class (maybe with a slightly different name), how sh...
I have an issue with Roles.IsUserInRole function. It take hell amount of time to just check if the logged-in user is in particular role(typ 3-9 sec). I searched to find a solution and arrived on this but I am not sure If I have fully grasped it. What I got from the above, A new derived class is created. Inside that cla...
I have no idea what these are actually called, but I see them all the time. The Python implementation is something like: x += 5 as a shorthand notation for x = x + 5. But why is this considered good practice? I've run across it in nearly every book or programming tutorial I've read for Python, C, R so on and so forth. ...
I have recently developed an application in C# which is supposed to run within the environment of the company i work for. I could technically generate a Setup or use ClickOnce to handle the deployment of the application, but I am considering basically copying the EXE file into a public directory and have everybody exec...
For a while I have been trying to learn to write unit tests for my code. Initially I started out doing true TDD, where I wouldn't write any code until I'd written a failing test first. However, I recently had a thorny problem to solve which involved a lot of code. After spending a good couple of weeks writing tests a...
I've been tasked with improving the software development process through the implementation of process improvements, of which we will most likely be using CMMI for Development, Version 1.3 as a guideline and adopting the best practices in whole or in part. What is the best way to introduce standards and process improve...
I am not so familiar with databases and now I am trying to understand the indexing mechanism. From what I know, in a RDBMS, indexing on a column makes searching by that column faster. This is also true for the triple stores, only there indices assume you will search(for example) mostly by the subject, then by object an...
Where previously there was only relational databases, the data store world is now rife with options like Key-Value, Document, and Graph datastores. Unfortunately, every datastore likes to show how it can be used for anything, but none of them really help people figure out when to use one model over another. So, the que...
I am currently creating an API and implemented a few basic REST actions such as get, update, search etc. Another program that collects data needs to synchronize these to this API. My current thought is: What would be good practice to synchronize this data? A few informations: The amount of data that needs to be synchro...