instruction
stringlengths
34
19.9k
I'm currently testing Visual C++ 10 on some trivial pieces of code. For example, like this one (taken from here): int main() { int i; clrscr(); for(i=0,i++,i<=5;i++,i<=2;i=0,i<=5,i+=3){ printf("%d ",i); } return 0; } For the code above the compiler emits machine code that in effect does thi...
I have been studying and coding in C# for some time now. But still, I can't figure the usefulness of Interfaces. They bring too little to the table. Other than providing the signatures of function, they do nothing. If I can remember the names and signature of the functions which are needed to be implemented, there is n...
A meeting today went well where I explained that cloud computing which one of the persons recognized was something else than a traditional RDBMS and I said that cloud computing is that everthing is software. It didn't seem like "Aha!" when I said it so I wonder what I should say. I thought the main specifics of cloud c...
In agile (scrum), how should one ideally break down things into a user story. The team size is about 6 developers if that makes a difference, and iterations are 3 weeks. Is breaking a user story with points and hours considered agile, or is it ONLY user points for a given user story? Should we break a user story into t...
A computer science degree (like any undergraduate degree) does not prepare you to be productive immediately. And my sense is that employers are less and less willing to provide that initial training. (Or at least if you DO have those core skills*, you have a broader selection of "first jobs" to choose from). What skill...
A web application is often designed to be layered. Typically there would be a Repository (Dao) layer, a Service layer and a Control (web handling) layer. The Control layer uses the Service layer which in turn uses the Repository layer. Often you'll see the Control layer using the Repository layer directly. Also quite p...
Often I come across documentation that says "use a regular expression here" I have to spend quite some time digging around trying to work out which regular expression format they are expecting. As far as I can tell, there are many types of regular expression. But, at my last place of work I was made to feel stupid whe...
I am working a project that is licensed under the MPL 1.1 and would like to incorporate some code that is licensed under the APL 2.0. I know in 2010 Mozilla announced they were updating the MPL to make it more "Apache compatible" among other things. I'm no lawyer. Exactly what part(s) of the MPL 1.1 don't jive with the...
I am trying to get a job as Java developer. I have been developing web pages with Java for a while, but now trying to go to another path and develop server-client solutions. In this specific company they are using these technologies for web developing: Spring, Hibernate, Ant, Velocity etc. All of the hot techs for Java...
I've read through the previous posts on freelance websites and used most of them. I'm looking for a website dedicated to high-end professionals and high-end work. Such as writing software compilers, designing database engines, etc. Probably no such website exists (there would have to be some kind of moderation), but I'...
I had an interview yesterday with a member of our organization who wanted to create a system to help him to do his job, the problem I had with him was that he had only a general idea about what he want. I tried to get more information from him by asking him specific questions which he had no answer to, such as what he ...
Can you recommend a free compiler/IDE for writing some simple Io programs? I want to learn the language at home in my spare time.
I have developed a web application that is used mainly for archiving all sorts of textual material (documents, references to articles, books, magazines etc.). There can be any given number of archive tables in my system, each with its own schema. The schema can be changed by a moderator through the application (imagine...
My friend and I are relatively new TDD and have a dispute about the "Obvious Implementation" technique (from "TDD By Example" by Kent Beck). My friend says it means that if the implementation is obvious, you should go ahead and write it - before any test for that new behavior. And indeed the book says: How do you impl...
What's the historical significance of abbreviating say, an L1 cache as L1$?
I've recently reviewed a resume for a very promising student who is not a native English speaker (I believe his native language is Bengali). His academic record has some gaps, too - he could use a couple of solid data-structure and algorithms type courses. Where would you advise this student to look, in order to find ...
I just accepted a new job. Our application is in the 50,000 lines of code area. None of which is commented. I am finding it difficult to understand how the application works. Id like to prevent this for the next person that joins the project by getting the team to start to use comments. Forget about if you support com...
Since I discovered the powers of the final keyword in Java a few years ago, it helped me to make my codes a lot more readable, since people can easily see what are read-only variables. It may also provide a little boost to the JIT, and while that's a very limited one, it can't harm, especially when targeting embedded d...
I have a 3-tiered .NET solution. Database (SQL SERVER 2008) Web Service (SOAP Service - *.asmx) WPF Client I am comfortably writing Unit Tests within (3) The Client. I am currently working on writing tests between (1)Database & (2)Service. My question is, what are some useful ways to run integration tests across all ...
In programming, various terms like abstraction are mentioned quite heavily. What, however, is composition? What is a basic but effective example of composition at play to result in good quality code (good quality meaning easy to understand, short and concise, etc).
Let me preface this by apologizing if this has been covered elsewhere, but I was unable to find sufficient information in my searching. Background information I work at a non-software company developing desktop applications in a team of four members, where I have been employed for more than 18 months. Being my first jo...
Is the time spent refactoring a code base worth it in the long run, in terms of developer productivity? It seems pretty clear to me that modifying a clean, well designed system is much simpler and faster than working on a poorly designed one, but I'm after some solid evidence. Are there any studies around this topic?
I was asked the following question in an interview today and I've been thinking about it ever since. I was not able to answer it and haven't been able to find a solution online. Given a chess board with dimensions X by Y and N queens, determine whether it is possible to arrange these queens on the board such that they ...
What should be the core functions of games which represents an excellent game? What quality goals it should achieve to become successful game? Any concise formed answer will get me on track.
One of the goals of modular frameworks like Kohana or Alloy is to make it easy to add and remove components (i.e. "plugins" or "modules"). However, in all the larger projects I have ever worked - the system often becomes dependent on the modules it is built on. After all, that is why they are there - to build with them...
I've been given a non-disclosure agreement (NDA) to sign by my current employer that I do not want to sign. It is incredibly open ended and I feel that it should have been a condition of my initial employment agreement, which I signed three weeks ago. The document contains very many definitions in the form of "includi...
I would like to run SVN server on my local machine along with WAMP. All SVN server binaries include Apache. Whereas I don't need Apache as I'm already running WAMP. Please let me know if there are any installs available that includes only the SVN server. If there are none available, shall I go ahead with what's availa...
Why or when is "explicit" preferred when implicit solutions often are more readable and less code? It says "explicit is better than implicit" when for example an implicit loop is better than an explicit loop isn't it? for every in all: every.updated = True The above looks implicit to me and better than an explicit ...
Possible Duplicate: Thoughts on Development using Virtual Machines My boss has been singing the praises of leveraging virtualized desktops for all our developers in the company - about 100 people. I think this is a horrible idea and can think of no other companies pursuing a similar course of action. He believes th...
I know the "I" convention has been around since COM, but I've never understood why it hasn't been reconsidered like every other naming convention before .NET has. Consumption wise, the only thing that separates an interface from, say, an abstract class, is that they can be multiply inherited. But everything after Visua...
I am a developer of an open source project which is hosted in SourceForge. It started out as a little app then after some releases, it got more and more popular and it started consuming more time and responsibility from me. So I have enabled the donation option in SourceForge. I'm passionate to continue developing it f...
I'm trying to get into web development, so I started learning HTML, CSS, and javascript. I've been coming along really well with javascript, but I still can't make anything with HTML and CSS to save my life. I was going to ask for some places or tips to improve, but I know the question has been asked countless times an...
I'm trying to make a point of documenting my code better, especially when it comes to the XML comments on class members, but often it just feels silly. In the case of event handlers, the naming convention and parameters are standard and clear: /// <summary> /// Handler for myCollection's CollectionChanged Event. /// </...
A problem that I am facing and would like some input into is; a Product Owner introduces ungroomed (unfamiliar, not estimated) User Story(s) into the Sprint Planning meeting. The issue that this has caused is the team rushes to understand and estimate the User Story(s), which puts significant time pressure on the comm...
Say I'm a .NET developer and want to build my application on WinRT. What I've read is that it is a completely new API for Windows 8, strongly related to Metro-style apps. I'm assuming that I can develop for WinRT in .NET/C#? How does it relate for example to WPF or Silverlight? Does WinRT provide it's own UI framework,...
While trying to figure out how to implement a Producer/Consumer Queue in Qt, I stumpled upon several SO answers, blogs and sites linking to this site: You're doing it wrong... I got the point of this site, but people are usually referring to the code example which is in the referenced blog: Threading without the headac...
Possible Duplicate: Version control for independent developers? I work as a Junior Programmer in a team of 1. I am looking for suggestions of what open source/free Project Management(I cant remember the correct term?) programs, ie things like Github would be suitable for my & the companies needs. I create websites u...
I have a code where I have to work on Half precision floating point representation numbers. To achieve that I have created my own C++ class fp16 with all operators(arithmetic logical, relational) related to this type overloaded with my custom functions, while using a Single precision floating point number with a Half p...
While it is relatively new now (2011/09/15), are there any resources for explanations of Metro applications for Windows8? I've not seen anything at the moment that summarises an "elevator pitch" for them.
I was coding a function to remove a day from a date value in javascript and i was kind of surprise that javascript's getMonth() starts from 0 for January to 11 for December. Why javascript's getMonth() starts with 0?
At the company I work we use SVN. The SVN repository resides on the local server. When developing we commit the changes to SVN on the local server which transfers the changes via ftp to a testsite remote test server. The whole team uses the same testsite. We use a remote testserver so that we don't have to setup anyth...
Possible Duplicate: What's the history of the non-official pronunciation of SQL? I hear it every so often, "In sequel server...", and for some reason I cringe every time. Maybe it's because SQL doesn't mean sequel, it means Structured Query Language. However, I hesitate to mention anything because it is a little bit...
I've read a lot of books and articles about functional programming and still ashamed of not being able to understand for sure some very basic concepts. One of the main ideas of functional programming is that same input always should produce same output. Therefore, say, querying database or writing file could not be don...
I've decided to completely rewrite a PHP framework (Using MVC) that I've been working on, on and off, for years. My problem up until now was that I would just come up with ideas, throw them into Trac as tickets, and add them later - without worrying about the design of the framework itself. Over time this has caused so...
So I'm reading up about the differences between the old and the new APIs, and I can't find whether the new WinRT API will provide for desktop apps, so far it seems its only available to write Metro apps - ie the full screen, 'phone style' apps. Does this mean that I can write a WinRT-based app and it will be invoked f...
What is the need for garbage collection (GC) in a stack-based language? In a language like Forth or RPL (on HP calculators), is there a need for garbage collection? I would think, since output is popped off the stack, that there wouldn't be any need. Am I missing something?
To elaborate I am interested in knowing what people think you need to put in place while still a one man project (team source control, documentation, builds etc) and what things don't need to be done until that point when the second person comes onto the project. Anyone with any experience of moving through this scenar...
My research group is developing some software for research purposes. The project leader wants the software to be open source and likes the GPL, but wants to ensure that they software cannot be sold. Are we reading the GPL correctly? The software can be freely modified, (re)distributed, and sold? If so, I see why it wou...
I have read some information through internet...i found that somehow suffix tree is quite similar to suffix array but somehow they are no the same thing.. Given a string, a suffix tree construction algorithm looks something like this (I copied the algorithm from a website) FOR i ← 1 to n-1 FOR j ← 1 to i+1 ...
I going to start a new project in my company in which are involved the use of MVC 3, now this is the first time that we are using this framework, and i have a couple of questions, It's recommended to start with MVC3 and not from the MVC2? Any Tutorials in specific that you can recommend? This framework have full integ...
I am currently a software developer. As a next milestone in my career I am thinking I must establish myself as team leader which leads a small development team in order to meet deliverables, deployments, etc. I've read various post in this site itself which discusses the pros and cons of working from home. But I am not...
The descriptor 'Engine' gets thrown around a lot: graphics engine, RegEx engine, AI engine, etc. but what actually makes a piece of software an Engine? Design, Input/Output, Purpose, Size?
Just wondering why Java and .NET Framework uses different sorting algorithm by default. In Java Array.Sort() uses Merge Sort algorithm by default and as Wikipedia.com says: In Java, the Arrays.sort() methods use merge sort or a tuned quicksort depending on the datatypes and for implementation efficiency switch to ...
I have been studying design patterns and came accross the fly weight pattern. I have been trying to see opportunities to use the pattern in my applications but I am having trouble seeing how to use it. Also, what are some signs that a fly weight pattern is being used when I read other peoples code? According to the d...
Is the execution time of a unit test useful for anything? Is a unit test an appropriate place for any sort of code profiling? Why or why not? Sample Use Case: Every unit test lists name, pass/fail, and execution time. Time is also calculated per unit test class and total test suite execution time. How could I use thi...
I am developing a very simple iPhone game with this view hierarchy: Main Menu View └> New Game View | └> Player vs Computer Game View | | └> Pause View | | └> End Turn View | | └> End Game View | | | └> Player vs Player (offline) Game View | └> Pause View | ...
For websites that need to be highly scalable, such as social networks like facebook, what's the best way to design the website? Should I have a web service which the site queries to get data that it needs? or Should the site query databases directly? (can be done using built in language constructs to fill tables autom...
I have seen this question but does not answer me. It have a brand new project. I have almost always used Log4J but now I am seeing SLF4J making some waves. What is it that Log4J could not do and we needed SLF4J? Is it really an upgrade. Should I use it in a project which will also have an API for other to extend upon?
I have already done a PHP project, and I did a number of things pretty wrong :) I just had all pages as scripts with php mixed in with html. I also wasn't using a framework like cakephp. And I didn't really use objects, nor had any sort of test suite. :) This time around I want to get it right. What should I do in ter...
Several times after posting over at Stack Overflow, I have found that the problem I have is somewhat specific, and may have issues rooted elsewhere in my code. These are very difficult to solve with a question, and I often end up getting poor or irrelevant answers. When a problem is just too localized or to complex fo...
No question too stupid right :) Came across this on wikipedia The Java Persistence API replaces the persistence solution of EJB 2.0 CMP (Container Managed Persistence). My understanding was the CMP is still there i.e Pooling,Transactions etc can be done via CMP where as JPA is ORM for me. I did not think there are ...
There are numerous websites that allow users/visitors to post content (such as comments to blog posts or news). The published post can be edited by the poster, but only for some amount of time (typically in the order of minutes). After that, the "Edit" button no longer appears and the post can't be edited. My question ...
I am interested in research that detects and recover from deadlocks. In other words the system is able to recover from deadlock faults. I'm interested in shared memory multicore processors. Uptill now I have only seen research for distributed systems. Can anyone guide me on this.
I'm sure lots of developers are familiar with XML and JSON, and they've used both of them. Thus no point in explaining what they are, and what is their purpose, even in brief. If we try to map their concepts, we can say (correct me if I'm wrong): XML tags are equivalent to JSON {} XML attributes are equivalent to JSON...
Question What kind of documentation and other artifacts would you expect to get in case of taking over existing Java webapp (probably it uses JBoss Seam framework) made in-house? I would expect to get: Source code in form ready to open in specified IDE. All external elements (i.e. DB schema as SQL scripts, installatio...
I got involved in a discussion recently on how to handle refactoring in general (which is an interesting topic in itself). Eventually the following question was brought up: How does one handle merge conflicts that occured due to that someone did a refactoring of a part of the code, while someone else was working on a ...
At which point should YAGNI take precedence against good coding practices and vice versa? I'm working on a project at work and want to slowly introduce good code standards to my co-workers (currently there are none and everything is just kind of hacked together without rhyme or reason), but after creating a series of ...
I am a software professional with about 1.6 years of experience in Java. Due to personal reasons, I had to quit my job, and now after 5 to 6 months, I am about start my career again. I am planning to attempt to take the SCJP exam, but some of my seniors suggested that I should learn Spring and Hibernate. I am totally n...
I'm looking for some advice on interviewing technical candidates. I touched on this briefly in a question I previously asked: template questions in a technical interview and was informed that FizzBuzz questions are designed to weed out candidates you definitely don't want coming near your code. Moving on from that, I'...
Which Java framework meets these requirements? What set of frameworks would be best suited to meet these requirements? The requirements are: oriented for web support for transactions support for creating RESTful web services support for security, levels of security integration with some kind of ORM framework like Hibe...
After seeing this question today on variation of the FizzBuzz interview question, as well as seeing other questions related to it around, I have to ask: is there any formal research on how effective this is as an interview technique? There are plenty of folks who say that it filters out some crazy-sounding percentage o...
I know that CRM stands for Customer Relationship Management, CMS stands for Content Management System and ERP stands for Enterprise Resource Planner. I would like to know what each of things does best and which scenarios they are used in. So basic understanding of the three with differences among them and the environme...
The reason I am asking this question is I want to know how to properly call an architecture where classes have either data or logic but not both. I know this goes against object orientation and encapsulation. I want to use the proper terms for discussing this architecture. EDIT: By reading the answers I have received,...
I know design principles and design patterns in theory. But it's embarrassing to realize that it's not clear when applying it in practice. For example, let's think about simple tic tac toe console game. How would you decide what class is for certain responsibility and how do you determine that responsibility/class is n...
Why don't many code review tools seem to be syntax aware or provide more in-depth analysis of changes? Is it simply too hard to do? I find this to be a major hole of most programmer's toolkits. From what I have seen, which admittedly is not much, code review tools just compare code line-by-line with many of them not ev...
I was raised in a part of web developmentland where the creation of websites is mostly synonymous with Wordpress, FTP, Joomla, and procedural code, instead of things like TDD, A/B testing, Doctrine, and design patterns. Having not traveled this area much, I'd like to know when object relational mapping and ORM tools ar...
Did a search for Patchers and didn't find anything. But seriously Patchers: How do they work? I've done some googling, and i've gotten mixed results. I mean it seems they probably have some way of going in and changing the files (maybe comparing what is different between the files) but it seems like there is probably m...
For the sake of argument: Let's assume the application we are building is an amortization schedule. Let's also assume that the database has a table called tblAmortizationPayments that stores the information about each monthly payment in a separate row. Let's further assume that the database language can support the ...
Often it is not obvious how to implement a given design pattern in a language. Sometimes it is difficult or cumbersome. Are there any languages built to make using design patterns easy and effective?
Is it useful to learn CVS before learning SVN? Does much of that knowledge carry over to SVN or are they too different?
When I hear the term memory leak by that I mean a bug in a program that doesn't cause any problems except that it doesn't free memory resource and if it continuously does that it can eat a lot of memory, hurting system performance and in the worst case crash the program (or an other program, if the OS decides to choose...
Is there any formal work attempting to measure ease of maintenance for complex programs, comparing at the programming language level? Are there any formal measures for ease of maintenance, at any level? I'm looking for a method to obtain formal measurements of ease of maintenance (or any related work) for a pet project...
I am not sure whether it is a personal perspective or just a common feeling. I think in most cases, python's API is much more intuitive than C++ STL library APIs. If it is not a subjective judgement, could anyone explain why?
In a traditional GoF Proxy, you have an Interface, an Implementation, that implements the Interface, and a Proxy that also implements the Interface, references an instance of Implementation, and delegates the calls on the Interface methods to the same methods in the Implementation instance. Say you would call the Inter...
When I want to test something in JavaScript, I open up a new browser window (mostly Firefox) and start writing code in the provided console (mostly Firebug). However, this tends to be really tedious and slow. Is there an environment, like an IDE with self-execution capability for example, in which we can test JavaScri...
I am trying to understand the concept of using 3rd party web API. From what I understand so far, web API look like regular URLs with some parameters etc. Will the client program need to download and install any package/bundle etc from the website/server etc providing APIs and include it with their product or no bundle...
Are there any common expectations from perspective employers when they hire a Perl developer? For a student who likes Perl and Linux and would like to get a job as Perl developer, what would you recommend to learn? I am looking for things that are generic and applicable to most/all Perl positions, as opposed to specif...
I am not much of a JS developer, but I stumbled upon this site called Google Gravity (those who haven't used it, try doing a search there - you'll be amazed), which is a remastered Google homepage. From then on, I've been thinking and wondering about learning more on how the guy implemented it. I tried googling, but co...
I am tutoring a few students who are having significant trouble learning the basics of their first programming language: C++. I have known many excellent and bright students who have failed or dropped their first CS course. Everyone I am tutoring gives a similar account of his or her experience in class: the instructor...
Simple question that will help me understand my OS class... thanks! Basically, why is it unsafe to have an interrupt within an interrupt? (or exception within exception)
What are some strategies that could be used to automate the creation of unit test cases? What aspects would you need to look at in each class to be able to generate at least a decent test case skeleton? I realize a comprehensive automatic solution isn't practical, but I'd like to speed up the test creation a little at...
It's not uncommon where I'm working on a site that includes things like binary (or effectively undiffable due to factors outside my control) specification documents (e.g., PDFs, Word Documents, Excel Spreadsheets) and multimedia source files (e.g., FLA source files, Photoshop files, Illustrator files). How should these...
I'm starting a gaming project on the side of my normal school/work projects and I'm wondering if I should start planning out the user interface before starting an actual project in code. I see some pros/cons to doing both first and was wondering what advice some seasoned developers could suggest.
I want to start working on a project where I want to build a intranet website and mobile app for people working in my office for car pooling. The basic idea is that if anyone is interested in looking for someone to carpool with should make a posting of going from A to B at time X.People can then reply to it. I've narro...
Google created Google Web Toolkit (GWT) and doesn't use it when building their own web applications. Does this mean GWT is not suitable for building dynamic applications? Or have caching problems? Or have RPC problems? Or are there other concerns that prevent Google from using this technology? EDIT: I don't say here th...
I have programmed for several years. And I found it is always difficult to master an algorithm(What 'master' mean here is to understand how the algorithm works and could implement independently in some programming language). I could implement some easy algorithms(such as bubble sort, binary search, basic graph traversa...
I'm curious to know what the prevailing best practice is. Should git commits be enforced such that the project is in a working state (builds properly, all tests pass etc), or is committing broken code OK? For example, if you waive this requirement you can be more flexible with commits (use them as logical chunks, even ...
I want to manage outsourced contractors to help develop our code. The code sits on Github. I wish to use a simplified version of this branching model: http://nvie.com/posts/a-successful-git-branching-model/ For now, the code is not modular, so I cannot hide parts of it from some developers, a la https://stackoverflow.c...
I'm working on an installation script, and especially there I have many things that need to be checked and actions that only need to be performed in case of related outcomes. For example, a folder only needs to be created if it doesn't exist: MyDesktopFolderPath := AddBackslash(ExpandConstant('{commondesktop}')) + ...
I have a .NET web server application I'm building that I plan to host at a .NET cloud hosting platform, like AppHarbor with SQL server. It will be used by multiple small groups of people to record and processes votes at an election (the current system is called TallyJ). I also need my users to be able to set up a self-...