instruction stringlengths 34 19.9k |
|---|
This is a somewhat subjective quesiton but I'd love to hear feedback/opinions from either interviewers/interviewees on the topic.
We split our technical interview into 4 parts. Write Code, Read & Analyse Code, Design Session & Code on the white board.
For the last part what we ask interviewees to do is write a small co... |
Our system has several utility classes.
Some people on our team use (A) a class with all-static methods and a private constructor.
Others use (B) a class with all-static methods (these the juniors).
On code analysis, (A) and (B) raise warning CA1052, which recommends marking the class as sealed.
Included in the MSDN do... |
TDD means to test before you start writing production code. So I start writing a test for MyClass called MyClassTest. It fails and I start to implement the wanted functionality in MyClass.
During the implementation phase of MyClass I encounter that changes on another class (e.g. MyClassUtils) are needed to be done. MyC... |
I am sure some else has experienced the problem of documentation regarding unit tests. I was wondering if anyone has used javadocs with their unit testing to generate their own internal javadoc files to keep track and document their unit tests? If so, did you find it successful? Or you think this a bad way to document ... |
I am interested in encoding a string I have and I am curious if there is a type of encoding that can be used that will only include alpha and numeric characters and would preferably shorten the number of characters needed to represent the string.
So far I have looked at using Base64 encoding to do this but it appears t... |
My problem
Our MVC based framework does not allow us to cache only part of our output. Ideally we want to cache all static and semi-static parts, and run dynamic parts. In addition, we need to consider data caching that reacts to database changes.
My idea
The concept I came up with was to represent a page as a tree of... |
At the moment we are writing modules for an open source cms.
We would like to sell these with a license.
But which are the best options?
Any suggestions and experiences.
|
At the place where I work, there are explicit guidelines for placement of declarations of variables. According to that, it is required to put them at the global level and / or at the beginning of functions, and not in inner blocks (such as a for loop). Since they've been specified by persons more experienced than I am,... |
Often, when I am initializing something I have to use a temporary variable, for example:
file_str = "path/to/file"
file_file = open(file)
or
regexp_parts = ['foo', 'bar']
regexp = new RegExp( regexp_parts.join('|') )
However, I like to reduce the scope my variables to the smallest scope possible so there is les... |
I apologize if this tends more toward design that programming, but here goes.
What design would you recommend for a database that is
Memory resident
Must run on windows, linux and (at a stretch) the mac
Accept multiple queries simultaneously
Have minimum overhead, since a search is expected to take <0.25s
This progra... |
We are currently migrating our Visual Basic 6.0 program to .NET. The target audience are just normal desktop users at home. Discussing this, we realized that we cannot come up with mainstream programs that seem to be written in .NET. Are we mistaken? Is there a good reason for this?
|
Possible Duplicate:
Dealing with frustration when things don't work
Something I find myself coding something difficult and after hours of struggle my mind goes blank and I don't know what I am doing anymore.
I'm not sure if this happen to a lot of programmers. Does this happen to you How do you deal with it?
|
I have seen this before. Management wants to be agile and be scrummified, but does not want to step out of the status quo. My latest observation is no different; here, the Scrum is 'tailored' to the organization; specifically into a weird many-people-process.
Here http://img684.imageshack.us/img684/6175/modifiedscrum... |
I am reading the epilogue of the Anniversary Edition of the Mythical Man Month. The author, Frederic Brooks, says
Still vivid in my mind is the wonder and delight with which I - then 13 years old - read the account of the August 7, 1944, dedication of the Harvard Mark I computer...
Which text is he referring to?
I wa... |
Im trying to work out if generic programming was a functional programming feature which was then introduced into Java, C++ and C# or did the latter copy it from the functional programming languages like Haskell, Lisp, OCaml etc?
Google is giving me lots on what generic programming is, but not where it originated. All I... |
Possible Duplicate:
I'm graduating with a Computer Science degree but I don't feel like I know how to program
I finished University around 4 years ago double degree in Software Eng/Comp Sci. Got my first job at a startup in my final year, was with them for 2.5 years then started my own business.
So far everything is... |
Except for a blog post here and there, describing the custom attributes someone created, but that do not seem to get any traction - like one describing how to enforce immutability, another one on Documenting Thread Safety, modeling the attributes after JCIP annotations - is there any standard emerging? Anything MS migh... |
I am a C# developer and had developed simple websites in regular asp.net(with asp.net controls) and a wpf application.
Nowadays, I am trying to learn Asp.net MVC3 and I have been exposed to HTML with the Razor view Engine. To be honest, my knowledge of HTML and CSS is limited. Therefore, I keep posting questions now a... |
I’m developing a simple peer-to-peer app in .Net which should enable users to share specific content (text and picture files). Inappropriate content can “relatively” easily be identified / controlled in a centralized environment. But what about a peer-to-peer network, what are the best methods to protect a decentralize... |
Though I use and like DVCS for my personal projects, and can totally see how it makes managing contributions to your project from others easier (e.g. your typical Github scenario), it seems like for a "traditional" team there could be some problems over the centralized approach employed by solutions like TFS, Perforce,... |
My workplace recently switched to Git and I've been loving (and hating!) it. I really do love it, and it is extremely powerful. The only part I hate is that sometimes it's too powerful (and maybe a bit terse/confusing).
My question is... How was Git designed? Just using it for a short amount of time, you get the feel t... |
I recently came across the following code (from liferay.js) when I was working with Liferay:
....
if (!Liferay._ajaxOld) {
Liferay._ajaxOld = jQuery.ajax;
}
if (Liferay._ajaxOld) {
jQuery.ajax = function(options) {
if (Liferay.Util) {
options.url = Liferay.Util.getURLWithSessionId(options.u... |
I'm not new to programming and I've even worked with some low level C and ASM on AVR, but I really can't get my head around a larger-scale embedded C project.
Being degenerated by the Ruby's philosophy of TDD/BDD, I'm unable to understand how people write and test code like this. I'm not saying it's a bad code, I just ... |
I am taking the Stanford Online Machine Learning class which is outstanding. http://ml-class.org
Is anyone taking the Stanford Online Database class: http://www.db-class.org? Does it seem useful if you have a few years of fairly simple database experience, but no formal education in the area? Or is it mostly academic a... |
Is it fine to code PHP on Windows and host it later on a server running Linux? Can there be any problems in the migration of such a project?
I would think that there really can't be any problems, especially since I am a beginner in PHP and I won't use any of the advanced functions that may be OS-specific. However, I wo... |
Recently I started releasing an open source project, while I was the only user of the library I did not care about the names, but know I want to assign clever names to each methods to make it easier to learn, but I also need to use concise names so they are easy to write as well.
I was thinking about some guidelines ab... |
I'm interested in whether ActiveRecord pattern, made famous from Ruby on Rails, encourages or discourages the use of SOLID design principles.
For example, it seems to me that ActiveRecord objects both contain domain logic, and persistence logic, which is a violation of Single Responsibility.
|
As I was reading Martin Fowler's famous blog post Is Design Dead?, one of the striking impressions I got is that given the fact that in Agile Methodology and Extreme Programming, the design as well as programming is evolutionary, there are always points where things need to get refactored.
It may be possible that when... |
I asked a question here on programmers yesterday about learning HTML & CSS and the community was pretty generous to provide great answers. One of the answers was given by Emmad Kareem and that was : "if you can't do HTML, don't give up. Consider using Silverlight".
This answer made me visit Silverlight.net and I came ... |
I'm working on a small side project using CGI and Python (scalability is not an issue and it needs to be a VERY simple system.)
I was thinking of implementing authentication using cookies, and was wondering if there were any established best practices.
When the user successfully authenticates, I want to use cookies to ... |
I want to know if the service test classes should use real DAO objects and connect to the database or it should use mock objects to test only the business logic it do?
|
The definition for directed acyclic graph is this: "there is no way to start at some vertex v and follow a sequence of edges that eventually loops back to v again."
So far so good, but I am trying to find some premises that will be simpler to test and that will also guarantee the graph is acyclic. I came up with those ... |
I find it hard to describe this problem in words, which is why I made a video (45 seconds) to illustrate it. Here's a preview of the questions, please have a look at it on Vimeo: http://vimeo.com/epologee/perfect-crossfade
The issue of creating a flawless crossfade or dissolve of two images or shapes has been recurrin... |
I'm currently starting a new sub project where I will:
Retrieve the order information from our mainframe
Save the order information to our web-apps' database
Send the order as EDI (either D01b or D93a)
Receive the order response, despatch advice and invoice messages
Do all kinds of fun things with the resulting datase... |
I've been thinking about interview questions lately and I've been reflecting on bad interview experiences I've had in the past. One of particular note is where I had asked the interviewer why the team chose to use EJB 3 over Spring in their product. The interviewer pretty much tore my face off, yelling "Because Spring ... |
I've developed a website using PHP but I implemented it on Windows OS and hosted it on Windows server.
I just searched the PHP job market to know the on-going technology requirement and to keep my knowledge up-to-date accordingly with the job market.
I see more are asking for LAMP stack. I understand the sort of s... |
OK - I am studying Prism a little because of a "free weekend" offer on Pluralsight. As this is proving too complex for me, I went to the Prism book and looked at the forward, and this is what it said:
What comes after “Hello, World?”
WPF and Silverlight developers are
blessed with an abundance of excellent books.... |
I just finished reading this recent article. It's a very interesting read, and it makes some great points. The point that specifically jumped out at me was this:
The difference was in how they spent this [equal] time. The elite players
were spending almost three times more hours than the average players
on deliber... |
Assume the following situation similar to that of Stack Overflow: I have a system with a front-end that can perform various manipulations on the data (by sending messages to REST back-end):
Posting
Editing and deleting
Adding labels and tags
Now in the first version we created it well modularized but the need as of n... |
I'm currently doing R&D for a web application which we plan to host ourselves initially and then allow customers to self host.
My task has been evaluating web frameworks to see which would give us the biggest productivity initially and ease of maintence while also allowing us to easily support deployment to customer co... |
Oracle seems to license all their Java-related open source code under the GPL with a classpath exception. From what I understand, this seems to allow to combine these libraries with your own code into products that do not have to be covered by the GPL.
How does this work?
What are examples of how I can and cannot use ... |
Other than programming, I'm addicted to sports. I'd like to integrate the two together. What are different programming languages that companies like ESPN use to work with stats? What techniques are used to do this, and how can I get going with it myself?
|
We have a small dev team (only 3 developers) and we recently got
a new team member. While he is a smart coder, his coding style is
completely different from ours. Our existing code base contains
mostly readable, clean and maintainable code, but the new team
member is quickly changing many files, introducing ugly hacks ... |
As the number of "visual" OS's such as Android, iOS and the promised Windows 8 are becoming more popular, it does not seem to me that we programmers have new ways to code using these new technologies, due to a possible lack in new visual programming languages paradigms.
I've seen several discussions about incompatibil... |
Possible Duplicate:
When to favor webforms over MVC
ASP.Net MVC has been around for some time now. The latest one, i.e MVC3 comes with Razor View Engine.
My question: How long is traditional ASP.Net here to stay. Does Microsoft have any plans to eliminate it in aid of ASP.Net MVC in the future and will the next rel... |
A lot of students when they graduate and get their first job, feel like they don't really know how to program even though they may have been good programmers in college.
What are some of the differences between programming in an academic setting and programming in the 'real world'?
|
In various open source CMS, I have noticed that there is a separate table for mapping two relational tables. Like for categories and products, there is a separate product_category_mapping table. This table just has a primary key and two foreign keys from the categories and product tables.
My question is what are the b... |
I am working on a project in Asp.net MVC and need to work with images. There is an SQL database with a Product table. Every product in the table will have it's own image. I have two ways to do this :
1) Save the image in a web directory and store the URL on database.
2) Store the image in SQL itself in binary format an... |
I've come across a situation at work where I have to justify why I need one (or more) mobile developers per platform.
Although I'm quite aware of the why (each platform is substantially different, has its own philosophy, etc.) I can't seem to come up with more than that.
Are there any articles I can read or even books ... |
I'm working at a site similar to Foursquare and Yelp, with approximately 100000 unique requests each week that generates content, growing steadily. We are currently using:
Seam as Java web framework.
MySQL as DB
Hibernate as ORM
Hibernate Search as Index
EhCache for Caching.
Since our site is slowly growing out of th... |
I know some projects and web pages for practicing algorithms like TopCoder and Project Euler.
However, they just dictate the solution of a particular problem. I wonder if there is a resource, website or any material, that doesn't only give away the code, but also explains the solution thoroughly ?
|
So traditional scrum board looks something like this
Backlog | Story notStarted inprogress Done
story 1 Story1 tasks
Story 2 Story2 tasks
Story ..
Story n
Epic x
Epic x+1
However in general a story has many scenarios and when working with BDD you want to wri... |
I personally find reading code full of Unicode identifiers confusing. In my opinion, it also prevents the code from being easily maintained. Not to mention all the effort required for authors of various translators to implement such support. I also constantly notice the lack (or the presence) of Unicode identifiers sup... |
A C or C++ compiler looks for header files using a strict set of rules: relative to the directory of the including file (if "" was used), then along the specified and default include paths, fail if still not found.
An ancillary tool such as a code analyzer (which I'm currently working on) has different requirements: it... |
In short, for simple games:
Is Flash still a good option for browser-based PC clients? It still has 90%+ penetration.
What is a good alternative for mobile devices? Is HTML5 + JavaScript the choice for mobile? Or does one have to learn a new native language for each target platform? (Android, Apple, Windows Phone)...
... |
What if I want to also decouple my application, from classes like Product or User? (which usually have more than one instance)
Take a look at this example:
class Controller {
public function someAction() {
$product_1 = new Product();
$product_2 = new Product();
// do something with the produ... |
I've been working by myself on a fairly large open source project for quite a while and it's nearing the point where I'd like to release it. However, I'm self-taught and I don't really know anyone who could adequately review my project.
A few years ago, I had released a small bit of code which pretty much got ripped ap... |
I want to write my first Java program, for example Phonebook, and I wonder what to do first. My question is should I write GUI classes first or util classes first?
I am database developer and want to know best practice in building program.
|
I have started learning about C# and I come to what is called 'Automatic memory management' or 'Garbage collectors' and I'm wondering if Java contains something like this as well? and if it does, does it do that as effective as C# when it comes to windows desktop application and web applications?
|
Why can't we put them in the same page, like each action paired up with its view? Not using code island, but controller code at top then view code at bottom? What are the problems with this approach?
By MVC, I am referring to frameworks such as ASP.NET MVC and Ruby on Rails, and I am under the impression that the V and... |
I have the following example for a user story with acceptance criteria.
I would like to know if I am allowed to describe how the GUI must be changed to support the new feature. How much detail can acceptance criteria have?
This is my example:
User Story:
As forum administrator I will connect persons in groups, so that... |
Is there a definitive guide to writing code comments, aimed at budding developers?
Ideally, it would cover when comments should (and should not) be used, and what comments should contain.
This answer:
Do not comment WHAT you are doing, but WHY you are doing it.
The WHAT is taken care of by clean, readable and simple c... |
I am currently tasked to write a software to help engineers design standard compliant designs. If there is a bad design, software will report an error or warning.
Maybe it's just me, but anyone who has done this should be familiar with the massive amounts of ANSI standards tables like this one: http://en.wikipedia.org/... |
I have been told that when there are multiple buttons on the page for same purpose but targeting different item e.g. delete item on a grid of items, they say it is recommended to just register for click handler only on the top most element like 'body' and check what was clicked instead of hooking up click with every de... |
My question is about the architecture of my application. I have a Rails application where companies can administrate all things related to their clients. Companies would buy a subscription and their users can access the application online. Hopefully I will get multiple companies subscribing to my application/service. W... |
When QA or UAT comes, should the developer still be involved in setting up data or finding test data for the QA tester or business user? Or will this introduce bias to the developer who coded the system changes that are being tested in the said environments?
|
I've got a question concerning node.js performance.
There is quite lot of "benchmarks" and a lot of fuss about great performance of node.js. But how does it stand in real world? Not just process empty request at high speed.
If someone could try to compare this scenario:
Java (or equivalent) server running an applicatio... |
I work in the field of accelerator physics and synchrotron radiation. High energy electrons circulating in large rings of magnets produce x-rays that are used for a variety of different kinds of science.
Running and improving these facilities requires controlling and modelling the electron beam as it circulates in the ... |
I am just finishing the second semester of my CS degree. So far I learned C, all the fundamental algorithms and data structures (e.g., searching, sorting, linked lists, heaps, hash tables, trees, graphs, etc).
Next year we'll start with OOP, using either Java or C++.
Recently I got some ideas for some iPhone apps and g... |
In the past, the Numerical Recipes book was considered the gold standard reference for numerical algorithms. The earliest Fortran Edition was followed by editions in C and C++ and others, bringing it then more up-to-date. Through these, it provided reference code for the state-of-the-art algorithms of the day.
Older ... |
Preliminary notes
I'll not go into the distinction of the different kinds of test there are, there are already a few questions on these sites regarding that.
I'll take what's there and that says: unit testing in the sense of "testing the smallest isolatable unit of an application" from which this question actually deri... |
If throwing System.Exception is considered so bad, why wasn't Exception made abstract in the first place?
That way, it would not be possible to call:
throw new Exception("Error occurred.");
This would enforce using derived exceptions to provide more details about the error that occurred.
For example, when I want to pr... |
I'm creating a web application on GWT. I'm using MVP pattern with activities and places. I have a xml config file containing some parameters to be used by the application. Content of this xml file is sent to the client using HttpRequest; I'm using a singleton class to hold the information from the xml file.
Right now,... |
I will briefly explain my situation.
I have a website in PHP, this website is powered by a custom framework + some "plug-in" made ad hoc for it.
I am the only developer of this. Until now I just test locally any changes than I upload the php files via FTP.
I don't feel confortable anymore with this. The code base has g... |
We're looking at exposing some of our internal application data externally via a website. The actual details of the website aren't that interesting, it'll be built using ASP.NET/IIS etc, that might be relevant. With this, I'm essentially I'm looking for a mechanism to authenticate users viewing my website.
This sounds ... |
My boss uses the term "portal" for the project I work on all the time.
To me, the word makes me think of Yahoo in the late 90s. Does the word "portal" have old-school connotations, or is it just me? Do you think it's ok to use it or will it drag our client's perception of the product down into the middle-ages?
|
When should I used interpolation search instead of binary search?
For example, I have a sorted dataset, in what situations would I use binary search to find an item in this dataset or in which situation should I used interpolation search?
What properties of the dataset would be the determining factor?
|
I currently am a programmer, I'm almost 16 years of age and have pretty much narrowed my careers down to something involving a Computer Science degree or Electrical Engineering degree (I know they are quite different but this question is about my friend) but my friend isn't so sure.
He is very interested in maths and i... |
For reasons "above my pay grade", we're developing an issue/project tracking system where I work (similar to Trac, FogBugz, etc). The managers want a useful tool to be able to track the overall health of the project (e.g. How much time left, how are we performing vs estimates) and one of the features that has been requ... |
I have a processing problem that I am thinking is a classic producer-consumer problem with the two added wrinkles that there may be a variable number of producers and there is the restriction that no more than one item per producer may be consumed at any one time. I will generally have 50-100 producers and as many con... |
Firstly, I would like to state that I already understand the 'vx' applications for Metamorphic code. I am not here to ask a question related to any of those topics as that would be inappropriate in this context.
I would like to know if anyone has ever used 'Metamorphic' code in practice, for purposes other than those p... |
I still looking best practice for domain model validation. Is that good to put the validation in constructor of domain model ? my domain model validation example as follows:
public class Order
{
private readonly List<OrderLine> _lineItems;
public virtual Customer Customer { get; private set; }
public vi... |
I'm really interested in playing around with the electronic paper technology, but I don't really want to program any commercial device (kindle or whatever).
I have some ideas and I want to start. How do I get a screen of electronic paper, a chip and how to start programming for it (language, interface)
|
I find git hard to understand as I could not find the meaning of the words used for the actions. I have checked the dictionary for the meaning of 'stage' and none of the meanings were related to source control concepts.
What does 'stage' mean in the context of git?
|
Sometimes I hear people saying something like "All committed code must be working". In some articles people even write descriptions how to create svn or git hooks that compile and test code before commit.
In my company we usually create one branch for a feature, and one programmer usually works in this branch. I often ... |
We are trying to have our own startup, with a middleware application to glue small applications with enterprise legacy systems.
for such middle-ware to function properly, we will need some sort of messaging system to make different components talk to each other in a reliable way.
the alternatives are:
use an existing... |
I have a situation where I think I might need dynamic class inheritance in PHP 5.3, but the idea doesn't sit well and I'm looking for a different design pattern to solve my problem if it's possible.
Use Case
I have a set of DB abstraction layer classes that dynamically compiles SQL queries, with one DAL class for each... |
I want to create a financial planning application (for personal use), for which the overall functionality will be this:
User (me..) can create different 'scenarios'.
Each scenario is configured with different incomings/outgoings.
Scenarios can be 'explored' in a calendar format with projections taking into account tax... |
At work, we've just started on a heavily Javascript based application (actually using Coffeescript, but still), of which I've been implementing an automated test system using JsTestDriver and fabric.
We've never written something with this much Javascript, so up until now we've never done any Javascript testing. I'm un... |
Lots of specialized mobile devices use Windows CE or Windows Mobile.
I'm not talking about smart phones here -- I know that Windows Phone 7 is Microsoft's current technology of choice here. I'm talking about barcode readers, embedded devices, industry PDAs with specialized hardware, etc... the kind of devices (Example ... |
I got this question in an interview and I was not able to solve it.
You have a circular road, with N number of gas stations.
You know the amount of gas that each station has.
You know the amount of gas you need to GO from one station to the next one.
Your car starts with 0.
You can only drive clockwise.
The question ... |
I know that the mobile bookmark bubble might sort of work for iOS, but it isn't going in the same section. And for Android, bookmarking is really not going to cut it for a mobile HTML5 application install since users just don't think to go to their bookmarks and that bookmark process takes two or three steps.
To me th... |
A well-known shortcoming of traditional class hierarchies is that they are bad when it comes to modeling the real world. As an example, trying to represent animals' species with classes. There are actually several problems when doing that, but one that I never saw a solution to is when a sub-class "loses" a behavior or... |
We use pthread for thread management in C based systems. pthread is in general compilable by C++ compiler (like g++). However, what are the better ways of abstractions for threads in C++?
Also, for making any system to be working in a multi-threaded system, it is also important to make thread safe. What are the stand... |
Has anyone used Sproutcore for a web application? If so, can you give me a description of your experience? I am currently considering it, but I have a few concerns. First, the documentation is bad/incomplete, and I'm afraid that I'll spend lots of time figuring things out or digging through source code. Also, I'm a bit... |
I'm doing research into software evolution and C#/.NET, specifically on identifying refactorings from changesets, so I'm looking for a suitable (XP-like) project that may serve as a test subject for extracting refactorings from version control history.
Which open source C# projects have undergone large (number of) refa... |
For string constants its usual to use a class with final String values. But whats the best practice for storing string array. I want to store different categories in a constant array and everytime a category has been selected, I want to know which category it belongs to and process based on that.
Addition : To make it ... |
I always see sites that only keeps fresh content on the home or subsections, and the rest of the content is kept in a separate section called 'archive'.
Recently I have also heard that NoSQL DB's like MongoDB are good for archiving (which makes me think this is related to performance)
So why do sites archive their cont... |
Let's assume we have an XmlDoc class that contains basic functionality for dealing with an XML data structure and saving/loading data to/from a file. Now we have several subclasses, A, B and C. They all inherit from XmlDoc and add component-specific methods for setting and getting lots of data. They are like "interface... |
I have a class that defines a private (well, __container to be exact since it is python) container. I am using the information within said container as part of the logic of what the class does and have the ability to add/delete the elements of said container.
For unit tests, I need to populate this container with some... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.