instruction
stringlengths
34
19.9k
Our front-end developers have requested that the RESTful Java web services to support delta queries. The use case for this is to handle periodic ajax refresh of the screen to bring in new data (deltas). I can see a few advantages of this: Makes front-end logic simple (i.e. no complicated deduping logic) Reduce network...
I was looking at the customer list of a few ERP vendors like SAP. The companies in the list are mostly non IT companies. So, I'm wondering as to how IT companies approach the business process management problem. For example, any IT company with a few thousand employees across different locations will need software for ...
Possible Duplicate: At what point do immutable classes become a burden? This is something I never understood. When learning C++, for instance, I had lots of headaches with const issues, as it added lots of complexity to programming. Why is immutability important? And is it always necessary?
I am developing a mobile web application that may be browsed in an iPhone. I would like to test this application, but I lack a mobile web device. How can I test this mobile application on a Windows 7 PC?
I've been using Codeigniter a lot recently, but one thing that gets on my nerves is handling errors and displaying them to the user. I've never been good at handling errors without it getting messy. My main concern is when returning errors to the user. Is it good practice to use exceptions and throw/catch exceptions ra...
I was recently reading the Wikipedia article for Resource-Oriented Architectures (ROA) and stumbled across an article that made the assertion that, although REST is a technology that is very-well suited for web applications and web services, that it is nevertheless a standalone technology that can be used in non-web ap...
For 3 tables that are in 3NF, a many-to-many relationship, is there a standard name or term to describe the 3rd table, the one that associates the other tables? Basically, I'm looking for a semantic way to name the 3rd table. Example You have two tables: users and widgets. A user can have multiple widgets and a widget ...
If in a web app, let's say an app that has a table with stored street address (Strings), the admin of the app will be adding data often to grow his archive. The table (MySQL) has a primary key with AUTO_INC. The web app allows the users to add addresses themselves. Once a user enters an address say X, ALL of the users...
For a beginner web developer who is still doing web development the conventional way (PHP/J2EE/Struts on server side, HTML/CSS/Javascript on client side), I was bowled over by the recent blog post on Trello technology stack. I can't help feeling overwhelmed by the list of new technologies and frameworks mentioned in t...
Most programming languages appear to be designed to not allow one to declare an identifier that starts with a number. I was just curious to know the reason. I have already searched the web, but couldn't find a satisfactory explanation.
I have to develop an application for a gas agency where a database will store consumer numbers, names, addresses, and date delivered for a town with nearly 20,000 people. I only know PHP, MySQL, CSS, jQuery, and other web based technologies. Is it possible to deliver a package to the client using these technologies tha...
I've asked this question a few days ago about how much documentation should be made and now I realize I may have been asking only half of the question. My goal is to promote some sort of documentation in order to increase continuous knowledge inside the team. My team is working mainly on server-side services which exte...
I am in the middle of design an application to issue and store invoices for an organization. The problem is the organization is not stable at all. There are many types of invoices and they may increase and change. First, I tried to use tables in my DAL, one table to store invoices, one for invoice fields, and one for i...
In object-oriented programming, there is of course no exact rule on the maximum length of a method , but I still found these two quotes somewhat contradicting each other, so I would like to hear what you think. In Clean Code: A Handbook of Agile Software Craftsmanship, Robert Martin says: The first rule of functions i...
I'm currently trying to design a little application using Domain Driven Design but I'm afraid I don't really get the concept yet. Let me try to explain this as clearly as possible. public interface IMyDomainRepository { void Add(IAnInterfaceFromAThirdParty element); } The interface above is defined in my domain mo...
I've been asked this question as part of an assignment. The question is a bit vague, and after searching the Internet, I cannot seem to find any particular set of steps related to this question. The best I could find are the following: Design test cases Prepare test data Run program with test data Compare results to t...
Intuitively it seems like this might be the case. Is there real research or authoritative anecdotal data (yes, please) supporting (or contradicting) this theory?
So I've done some research on this but I couldn't quite come to a conclusion, so I figured I'd ask you guys to see if I could get some other opinions. All of my database access is currently done through stored procedures. I am going to make no direct calls using custom queries. Because of this, my DAL is going to be pr...
Like every author needs to read a lot of classical literature to develop his own style, and like every chess player read and analyze former champions games before, I think also every programmer needs to read a lot of high quality code. When it comes to Java source code, what are your recommendations as "reading". Whi...
My module is enabled by default (i.e. when you add the module). There's also a configuration you can optionally use, which supports an enabled="true|false" setting. This way the module can be disabled after it's been added, without the need to remove the module. But I realized the module doesn't play nicely with anothe...
I was reading some blog posts this morning, and stumbled across this one: If the only class that ever implements the Customer interface is CustomerImpl, you don't really have polymorphism and substitutability because there is nothing in practice to substitute at runtime. It's fake generality. That makes sense t...
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 ...