instruction
stringlengths
34
36.1k
I'm looking for an open source license that lets people do whatever they want - just like the MIT license - just as long as they attribute the original author, i.e. me. Does a common license exist for this? If so, what is it?
A core part of Domain Driven Design is the consistent use of a ubiquitous language across the system - in conversations, code, database schema, UI, tests, etc. I'm involved in a project in which there is a well-established domain language already, defined by an international standards organisation. However, the work we...
And then to automatically re-indent after that? I've tried copying code from one terminal screen to the other, but the tabulation got all messed up. I didn't know what to call this functionality, so it was hard for me to find it on google (which generally returned things related to how to set tab size, which wasn't wha...
I am writing a multiple-filed program right now, and apparently running only 'make' (as one would intuitively think needs to be done in most situations) for some reason causes my program to fail. I guess I can provide more detail of the problem, but the important thing is that it does run when using 'make clean'. So I ...
I am writing an iPad application. The main view of the application will be a PDF. I have made considerable progress in parsing out the contents of the PDF. The application will also have at least two "side views". These side views may or may not themselves be driven by PDF files. That is part of what I am trying to...
Are there are any specific rules and regulation to follow while developing a custom membership provider. Like, implementing a particular Interface or Abstract class. Or a definite model architecture to follow. If yes, then what are the rules or I am free to design, model and code anything ?
I'm curious after reading today about a minor code leakage from a large project to some blogs & forums (to say it short: the guys forgot to anonymize the code before asking for help), all detected and (angrily) complained by the customer who reasonably wanted to protect the IP they paid for. First of all, I know it's a...
During TDD training based on medical software case we are implementing the following story: "When user presses Save button, system should add patient, add device and add device data records". The final implementation will look something like this: if (_importDialog.Show() == ImportDialogResult.SaveButtonIsPressed) { ...
I have a class with one public method Send() and a few private methods. It calls a couple of webservices and processes the reponse. The processing is done in private methods. I want to unit test the code. My understanding is that unit tests should test my code in isolation (ie mock up supplier responses). I also believ...
Alan Cox once said "A Computer is a state machine. Threads are for people who can't program state machines". Since asking Alan directly is not an option for humble me, I'd rather ask here: how does one achieve multi-threading functionality in high-level language, such as Java, using only one thread and state machine? ...
From a .Net programmer perspective, what are the consequences of still sticking with Windows XP despite there are Windows Vista, 7 and very soon 8? How does having windows XP limit programmers development in .Net platform?
Some of the hottest topics in the software world atm are: Domain-Driven Design SOLID principles Agile methodologies ORM Now assuming that you are not currently using all of these in your team, if you were to go and ask your team (individually, not as a group) what they knew about the topics they were not applying ...
How do you guys know that you are writing the most robust code possible without overengineering? I find myself thinking too much about every possible path that my code can take, and it feels like a waste of time sometimes. I guess it depends on the kind of program you are writing, but I don't want to use too much of m...
Possible Duplicate: Is it essential to learn algorithms to be a real programmer? This question is, perhaps, related mostly to web developers who, like myself, code enterprise applications and use high level languages like Java, C# mostly. Due to nature of enterprise web-apps, which essentially do CRUD operations, an...
For the past few months I've been looking into developing a Kinect based multitouch interface for a variety of software music synthesizers. The overall strategy I've come up with is to create objects, either programatically or (if possible) algorithmically to represent various controls of the soft synth. These should h...
Should database files(scripts etc.) be on source control? If so, what is the best method to keep it and update it there? Is there even a need for database files to be on source control since we can put it on a development server where everyone can use it and make changes to it if needed. But, then we can't get it back ...
My organization finally upgraded to MS Visual Studio 2010 this year. One of the big new features that Visual Studio 2010 offers is the F# programming language. I understand that F# offers a functional programming paradigm, similar to Lisp. Unlike Lisp though, F# is compiled into managed code for the .net framework. R...
Could anybody help me to find a good tutorial about how can I implement DAO pattern and also tools that help me to create this classes in automated way.
I am trying to create a site that will allow you to type a sentence or passage of text, then click on words to bring up a list of synonyms (from an online API) and possibly authorized abbreviations from a list that I provide. Once clicked, it would replace that word with the word that was clicked on. It would function ...
I've recently worked on a Java class that generates permutations per list of objects. In any case, I would like to have this library offered to the public, so I have several questions: Most libraries I see have this complicated package naming, specifically including com/org. Is there a convention for these or is a per...
I regularly come across situations where I need to Add or Edit an item, and sometimes I use separate methods for Add and Edit, and other times I combine them into a single method. Is one method preferred over the other? If so, why? public void AddItem() { ShowEditingPopup(new Item(), "Add Item"); } public void Edi...
The SQL92 and SQL99 standards define CREATE DOMAIN DDL constructs. Not all databases support this, or have a different name for it (SQL Server has User Defined Types, for example). These allow one to define a constrained data-type to be used in their database, to simplify and enforce rules pertaining to the allowed val...
Lets say you have to write some code to fix a bug that on first glance by another engineer would seem weird or unnecessary. Would it be good or bad form to put the code in a method named for example "preventWindowFromJumpingWhenKeyboardAppears" or just name it "forceSpecifiedWindowPosition" and then add a comment about...
Does anyone have any advice for making an "attractive" software architecture diagram? My manager told me to make my current architecture diagram (which was built just using Visio and basic icons) more "attractive" for a presentation I have to give to executive level types who are non-technical. I'm guessing he meant to...
I am about to enter the world of consulting for the first time and am having to write my first contract. One problem I have is regarding open source work and intellectual property. I love working on open source projects, whether it's an existing project or a project that I start on my own. The question is: how can I wr...
I'm wondering is JSP a safe alternative to PHP? Some things I'm concerned about are cpu usage, memory usage, and security.
I'm a solo iOS developer - mostly self taught, but have made several successful apps so far and potentially starting some slightly bigger projects. What I want to do: As I'm working on some bigger and more complex apps now, there's some things that I want to do - which from what I gather, repositories are what I should...
Soon, I'll be starting Android development, as I know a bit of Java. I'll also be getting an Android phone. My two options are the Nexus S and the Atrix 4G. I've heard the Nexus series is ideal for developers - can someone tell me why? Why is getting the Atrix bad as a developer?
I have built a number of websites for friends, family, etc. and I have put them all on a single shared web hosting account. Now that they are built, I want to get out of business of supporting them and paying for them (my friends are reimbursing me but I am paying for the actual bill) so I was thinking of having them c...
Can I (legally) use a program that is released under GPL from another program that I'm writing and not have to respect the GPL (for the program I'm writing)? For example, I have a GUI that uses a program (which is under GPL), can I hide the code in the GUI and even sell it?
I am having a memory leak when running a test suite due to singleton objects are created and not cleared after each test case. And these singleton objects are holding references to heavy objects. So I don't know if there is a better solution than clearing the singleton objects in the tearDown() methods in each test cla...
What is the math to identify a gesture for the motion made by two fingers turning a knob (tracking two sets for xycoords)? Is there a library/api anyone is familiar with that contains a good library of gestures for multitouch applications?
In a django project, if a situation comes that Django ORM is not able to execute some complex queries then there are 2 options: Use Raw Sql queries Use SqlAlchemy I want to know if there are some rules like some pros and cons of both which can guide me to choose one of the above 2 options. Or is it entirely depend...
In asymptotic notation when it is stated that if the problem size is small enough (e.g. n<c for some constant c) the solution takes constant time and is writen as Theta(1). Why we write 1 inside the Theta? What does the 1 mean? Why not Theta(c)?
I seem to have a never ending stream of more-or-less original, more-or-less cool ideas for software/apps/stuff yet to be written on my mind. Sometimes, I decide to just start implementing my idea. Several hours later, I end up with a decent, more-or-less working prototype of what I'm trying to build. Then, my alarm clo...
What licensing issues arise if I install and use Microsoft Office software (in this case Visio) as part of my web service backend? My company's flagship piece of software can convert Microsoft Visio files for use in their environment, but of course requires a local install of Visio to decode the files. The system I'm t...
Sometimes, a header file uses objects that are in declared in other header files. The user of this header file would have to include the dependency anyway and get the order correct too.
I have been interviewing candidates lately for a developer position requiring 10+ years experience and have come across a couple of CVs that I am not sure how to understand: I have interviewed a few of these people and so far have had no luck. What are people's experience with developers with about 10 years experience,...
During the sprint review the product owner may say that a particular story is incomplete or the team itself may not have completed some committed tasks. In what situations do you leave the code in the build? If the code is left in the build, is this a conscious decision made during the review? In other words, do you ...
Possible Duplicate: Version control for independent developers? I have a folder containing all my code (working code, experiment code). I'd like to back it up to a zip file on an external hard drive or whatever is best. How do you guys backup your code? Do you setup your own source control server? Do you use a scrip...
Possible Duplicate: Why programming open source? I've seen a lot of, for example, where prospective employees put open source projects on their resumes. However, I don't really understand the practice of open source projects. If I have an idea, then however little value it has (being realistic here), that value belo...
I'm writing an application and a set of many small plugins—where “many” means dozens and “small” means one or two sources. It's not necessarily going to be possible to divide the plugins into neat, non-overlapping categories. Which would be the best strategy for source control: Many repositories, one for each plugin; ...
Working as a freelancer, I often see strange requests from my customers, some of which can negatively affect my daily work¹, and others trying to set some sort of control. I usually encounter those things during preliminary negotiations, so it's easy enough at this stage to explain to the customer that I do care about ...
What is the best way to annotate who authored a file and subsequent changes that were made? I'm a contractor on a new project, one that's just starting, which is using Subversion. The other day I noticed a team member had updated a script written by an outside consultant, and he updated the header from "Written by X" t...
I am looking for a software platform/programming framework which can do the following: INPUT: a user inputs some text PROCESS/REFERENCE DATA: the user is then asked to answer a list some questions regarding the INPUT and attribute the answers either to the whole INPUT or to some parts of the INPUT OUTPUT: the list of ...
While reading a book, I came across DI(dependency Injector) and the subsequent DI Container tool. Previously, I developed an application following a tutorial on asp.net website which never used such tool. So, my question can be summed-up in following two concerns :- How often do you use DI Container ? What requiremen...
When developing for embedded devices and other odd worlds, it's very likely your build process will include multiple proprietary binaries, using very specific versions of them. So the question is, are they part of your source control? My offices goes by the rule of "checking out from source control includes everything ...
If I want to use the data on Twitter in my application, what are the restrictions? What user data should I avoid touching? For example, if I want to collect information from certain type of tweets about users and use this information on my site as profiles for these users in my site, does this require permission from t...
I have built a Ruby gem, which allows programmer (or whoever) to change wording on their Rails website. When the edit mode is activated, every text on the website will have an edit icon. User can click on that edit icon and change the corresponding text immediately. It works with text, attributes of any element, select...
A developer on our team litters his code with debug outputs. He passes many parameters into methods that are only used for debugging. Personally I find this clutters up the code. If I need to debug something I prefer to use breakpoints and the watch window instead of reading through all the debug output. I am making ma...
Our team is trying to understand and adapt Scrum and other agile practices, but we can not figure out how to deal with customer feedback when there is no customer. Every document about the subject emphasizes how important is having the customer involved in every sprint and how having early feedback helps correcting pro...
I am doing some personal research on Byzantine Faults. I am trying out algorithms from various research papers which present algorithms for consensus in distributed systems like this one. For this i need a small scale simulation environment of a distributed system. How do i approach this problem ?
I want to distribute my software under license like Creative Commons Attribution - Non commercial - Share Alike license, i.e. Redistribution of source code and binaries is freely. Modified version of program have to be distributed under the same license. Attribution to original project should be supplied to. Restrict ...
I've been a programmer now for over 11 years, and am just starting to get into version control for real. The places I've worked at have never really used version control (one committed at the end of each day, the others simply haven't bothered). I am not happy with the way that I've been taught to version control (pro...
I am reading this post on Big-O It says that the following code is O(n^2): bool ContainsDuplicates(String[] strings) { for(int i = 0; i < strings.Length; i++) { for(int j = 0; j < strings.Length; j++) { if(i == j) // Don't compare with self { continue; ...
A great lathe operator commands several times the wage of an average lathe operator, but a great writer of software code is worth 10,000 times the price of an average software writer. - Bill Gates Say there's a "great" software engineer and an "average" software engineer on the same team. How can you account for one ...
Sometimes Java outperforms C++ in benchmarks. Of course, sometimes C++ outperforms. See the following links: http://keithlea.com/javabench/ http://blog.dhananjaynene.com/2008/07/performance-comparison-c-java-python-ruby-jython-jruby-groovy/ http://blog.cfelde.com/2010/06/c-vs-java-performance/ But how is this even p...
I am reading the official Your first NHibernate based application. While the tutorial is good and easy to follow, I am wondering why the Repository pattern is used. In the various Add, Update, Remove methods in the ProductRepository implementation, the code is nearly identical - they are all using transactions, and the...
Nowadays, the common phenomena is to develop a website for a browser and then corresponding apps for Android phones, iPhone, tablets and so on. Since all the platforms come with a browser, why aren't companies using CSS to accommodate them? Surely we can detect from the request which browser was used and from which pl...
Once in a while C++ code will not work when compiled with some level of optimization. It may be compiler doing optimization that breaks the code or it may be code containing undefined behavior which allows the compiler to do whatever it feels. Suppose I have some piece of code that breaks when compiled with higher opti...
I have been told, and have found for myself, that lots of developers are not good at UI design (I don't know how true is this) but it is true about me at least. In web development good code development skills are not enough without great skills in UI design to go with them. So for me, and many developers like me, th...
I am starting working on a web project using django. While researching whether to use Sqlalchemy or raw sql when django orm is not sufficient which is also a question I asked here Raw Sql vs SqlAlchemy when Django ORM is not enough One question bugged me. As the load on the website increases and we find out that sql q...
This is a discussion myself and some of my colleagues are having and thought I'd come out here and see what if there's a general consensus on it. It basically comes down to the following 2 opinions on database calls: 1. Make one large call to get everything that may be needed to reduce database the number of DB calls ...
Possible Duplicate: Defend zero-based arrays I'm running code that loops through an array of HTML IDs. With the HTML IDs named content1, content2, …, content12, my loop looks like: for (var i = 1; i<13; i++) { var contentFind = $('#content'+i)[0]; I know that the usual way to run loops is to start at i = 0. Is ...
In ASP.NET Web Forms if you want to use jQuery and call a method directly, you should either implement a web service, or use Page Methods. Also you can use Generic Handlers (.ashx files). However, in ASP.NET MVC, a controller action (a method in nature) can be called directly from jQuery. What web services has to offer...
So i've been trying to learn some Embedded/Assembly programming for a bit here lately, as well as going far as trying to learn the lowest level (gates and such). One thing puzzles me though....is how do we "get" instruction sets. I understand somewhat how gates/TTL and such works, but I don't see how we get from that t...
Can someone explain what this means? Unicode defines a codespace of 1,114,112 code points in the range 0hex to 10FFFFhex. http://en.wikipedia.org/wiki/Unicode
Ruby gems have LICENSE file with the license text in each gem. Cocoa[Touch] open source frameworks (say ShareKit, StackKit, etc.) have license at the very beginning of each file (.h and .m). I am not sure about .NET or other interpreted languages (except ruby), but I'm pretty sure there are own choices at hand. I am wo...
I've mostly used the waterfall methodology on my projects, but now I'm expanding my horizons into agile methodologies. From what I've read so far, and maybe I've read the wrong things, agile means small waterfalls. Instead of a big waterfall spread over one or two years, you have small waterfalls that last weeks or may...
I've been designing and developing with Wordpress for about two years (and I love it). Recently, a respectable designer told me that I could work for him. He works with Joomla! My job was to create a Joomla! template. I didn't feel myself comfortable using it. I don't like the back-end's UI, the way you add elements an...
My company is investigating hiring a University Computer Science co-op student (BSc year 3) for a 4- or 8-month work term. (I'm not sure how internationally-recognized the term co-op is - it's essentially a paid internship, after which the student returns to their studies.) My team develops a web application in ASP.NET...
My web server uses PHP as do 77.7% of web servers according to W3Techs, as of 14/03/2022. The reason I use PHP is an inertia born out of seeing everyone else using it on web servers. What is it about PHP that would make it so ubiquitous on web servers? (Note that this question is similar to the following question but t...
A question asked here reminded me of a discussion I had with a fellow programmer. He argued that zero-based arrays should be replaced with one-based arrays since arrays being zero-based is an implementation detail that originates from the way arrays and pointers and computer hardware work, but these sort of stuff shoul...
When I graduated, I thought getting into a web development job meant I get to work in a group of at least a handful of developers, and seniors can teach this young Padawan their tricks of the trade. In my experience, when I get hired as a junior web developer I'm usually have really limited contact and collaboration wi...
I've been studying couple of books of how to exactly implement agile. I am confused about release planning. Our application is a Insurance System consisting of different modules (Quoting, Policy Management, Claims management etc). During the first phase we are just planning to release Quoting and we are estimating app...
I'm trying to wrap my head around the general workings and principles of event dispatching in event-driven (sub-)systems. Although I have used it on quite a few occasions in for instance Javascript, Flash (Actionscript 2 and 3) and have even made a simple event dispatching system in PHP for myself at one time, I've nev...
I have been using jQueryMobile for a bit now, and there are some things I like about it and others I do not. First I will give a bit of background. I have a light weight mobile application that has a few configurations and 6 pages. Ideally I Would like to load all pages into the DOM (they interact with each other quite...
We release a number of small plug-ins that go along with our software. Each plug-in allows our software to talk to a single manufactuer's hardware. I would like to devise a system for keeping track of plug-in releases. Example info that should be stored: Hardware manufacturer name 32-bit? 64-bit? both? What modes of...
As I get more and more involved with the theory behind programming, I find myself fascinated and dumbfounded by seemingly simple things.. I realize that my understanding of the majority of fundamental processes is justified through circular logic Q: How does this work? A: Because it does! I hate this realization! I lov...
Following up on this question of mine, where I wanted to know the general principles of implementing an event dispatching system that allows for events to bubble (and capturing I've come to learn); does such an implementation make any sense for non-GUI related objects? I'm asking, because I want to try and build a gene...
I've recently come across Cyclomatic Complexity and I'd like to try to understand it better. What are some practical coding examples of the different factors that go into calculating the complexity? Specifically, for the Wikipedia equation of M = E − N + 2P, I want to better understand what each of the following terms ...
I was reading a book today called "Clean code" and I came across a paragraph were the author was talking about the levels of abstraction per a function, he classified some code as low/intermediate/high level of abstraction. My question is what is the criteria for determining the level of abstraction? I quote the paragr...
When I first started programming Javascript after primarily dealing with OOP in context of class-based languages, I was left confused as to why prototype-based OOP would ever be preferred to class-based OOP. What are the structural advantages to using prototype-based OOP, if any? (e.g. Would we expect it to be faster...
I am at the moment messing around with clients and servers in C# winforms and I'm trying to implement it all asynchronously. However, I'm beginning to wonder, should I use asynchronous code for everything? Here's a list of what I'm doing asynchronously at the moment: TcpClient.BeginConnect with TcpClient.EndConnect Ne...
I hear a lot about this term "Graceful degradation". For example , "An application server should gracefully degrage when it is under heavy load " "Graceful degradation of user interfaces.... " The term looks like an abstract thing to me. Any concrete example of what it means?
Recently it came to my attention that hierarchical inheritance may be a relic of thinking of classes as "structs with functions" rather than a product contract-driven mentality. Consider, as a simple specimen the implementation of "Unmodifiable Iterator" from Guava. http://guava-libraries.googlecode.com/svn/trunk/javad...
I suspect there're programs that instead of emitting machine code instead emit C++ code and then start a mainstream C++ compiler to compile it to machine code. I can't find any notable examples except MIDL which emits some rather primitive code. What are notable examples of such systems?
I like to draw a UML sequence diagram to display the sequence of actions and interactions of different parts of my system (I think they called actors). However, I need to include if then else statements here. Do I do something wrong? Can I use conditional if statements in my UML sequence diagram? How?
My team (~10 devs) has recently migrated to Maven (multi-module project, ca. 50 modules) and we now use Jenkins for continuous integration. As the overall setup is running, we are planning to include code analysis and reporting tools (e.g., Checkstyle and Corbertura). As far as I can see, we basically have two options ...
I have programmed pretty much exclusively in compiled languages, particularly Java, for most of my career. One of my favourite things about Java is how productive you can be, and how little code you actually have to write, when using tools like Eclipse. You can: Easily and automatically refactor your methods and clas...
we wrote and still maintain a large E-Commerce application. Our feature list resembles what you would expect from most shops. We'd like to improve some of our features, and now the search/suggestion list functionality (enter some letters, a JScripted suggestion list appears) has caught our eye. Currently, we use http:/...
When you track down and fix a regression—i.e. a bug that caused previously working code to stop working—version control makes it entirely possible to look up who committed the change that broke it. Is it worth doing this? Is it constructive to point this out to the person that made the commit? Does the nature of the mi...
As the title suggests I'm wondering whether bools or bits are faster than using integers (1 and 0)? Specifically I thinking about their speed in CASE statements, even more specifically in T-SQL (although it would be interesting to hear about experiences from other languages). For some context, I have a pretty big SELE...
This is the excerpt from the project's Github page. Gremlin provides graph traversal related syntactic sugar to Groovy. Groovy provides dynamic language syntactic sugar to Java. Realize that anything you can do in Java or Groovy can be done in Gremlin. The documentation keeps referring to Groovy & Java. I need to lea...
Assume one wants to create a simple .NET language, or slightly more difficult, a compiler for an existing .NET language. Do you absolutely need to be familiar with the CIL (Common Intermediate Language) to implement a compiler? And do you have to translate the syntax of your language to CIL by hand? Or is there another...
I graduated from university about five months ago, and have been working in a local startup for past four months. While at university, I studied Haskell, F# etc on my own. We were taught Java at the university, but I was exposed to functional programming very soon, and have spent far more time with it than I did with i...
While responding to this question, I began to wonder why so many developers believe a good design should not account for performance because doing so would affect readability and/or maintainability. I believe that a good design also takes performance into consideration at the time it is written, and that a good develop...
My company is developing software that has a lot of technical debt that has existed for more than 20 years. It's a mix of C++ and C and consists of about 2M LOC. I would like to make some suggestions how we can advance our project and get rid of technical debt while using modern design principles. This application is h...
I've been seeing a lot of code recently that looks like this: public interface IFoo { int Bar(); } public static class Foo { public static IFoo Create() { return new FooImpl(); } private class FooImpl : IFoo { public int Bar () { ... } } } Basically, there is a contract defined by an interfac...
I was creating a class diagram for an application I was working on today and I didnt include the JPA entities since I had all the information I thought was important in my DAOs, for example, I just care about how to register a user regardless of what information does a User object contain, so I only included the UserDa...