instruction
stringlengths
34
36.1k
In relational world we have Foreign Keys to reference other entities. But how do document-oriented databases like MongoDb, CouchDb, RavenDb implement references among entities? Update. StackExchange related example. We have Question entity and its tags. Each tag, is a separate entity so it has its properties (for examp...
I have heard people say that variables should be declared as close to their usage as possible. I don't understand this. For example, this policy would suggest I should do this: foreach (var item in veryLongList) { int whereShouldIBeDeclared = item.Id; //... } But surely this means the overheads of creating a new i...
This is actually somewhat related to the question I asked yesterday about why both a Stack and a Heap are necessary in the applications we use today (and why we can't just go with a Heap instead of both, in order to have a simple & singular standard to go by). However, many of the responses indicated that a Stack is ir...
I'm creating a system where items will have one or more tags. Now there will be an item table that will store each item, and a tags table, that will store all tags used in the system. My question is: What is the best design I can have that will allow me to link items to their respective tags, and record how many times ...
I've been introduced to Computer Science for a little over a year now, and from my experience it seems that C and C++ are both considered to be "ultrafast" languages, whereas others such as Python and such scripting languages are usually deemed somewhat slower. But I've also seen many cases where a software project or ...
So I've kind of been getting angry about the current position I'm in, and I'd love to get other developers' input on this. I've been at my current place of employment for about 11 months now. When I began, I was working on all new features. I basically worked on an entire new web project for the first 5-6 months I was ...
I do line of business apps where the all the other developers are used to doing basic CRUD apps or are focused solely on making pretty/functional interfaces and I am getting the following a lot. "With the way we use to do it Employee would have all the things you could possibly do with an employee." And it was true. T...
I'm currently reading a book, chapter about I/O, and one question came to my mind. Basically, when you program in C/C++, you have an amazing opportunity to optimize for hardware behavior. Using buffering for block devices, use streaming and async I/O for high latency network devices and so on. And if you're writing a s...
When you recommend updating jQuery/jQuery UI? Or in other words: what are the best practices for updating jQuery/jQuery UI? I’m working on a long project that will take at least one more year. In that time span, I’m sure that jQuery/jQuery UI will be updated many times. Do you recommend update my jQuery/jQuery UI files...
Just a quick question, but why are there so many file systems still competing and in use today? (ntfs, fat32, ext3(ffs), etc) It seems that file system designers could agree upon the best aspects of each type of system and implement a "best" filesystem, no? Just a thought, since these filesystems have been around for a...
There is always a debate over the topic - "Whether to put the business logic in Stored Procedure or Not?". If we decide not to use the ORM Tool and not to put the Business Logic in Stored Procedure then where would we put the Business Logic? In my previous applications I have always preferred putting all of the Busines...
Is there an exact, but simple and understandable defintion of the distinction between "use case", "User Story" and "Usage Scenario"? there are quite a bunch of explanation, but right now, I see no one that explains the differences in a single sentence, or two... (e.g. http://c2.com/cgi-bin/wiki?UserStoryAndUseCaseCom...
As an expansion from my previous question about using separate projects for seperate layers - Good practice on Visual Studio Solutions I now wish to know if I am putting the right functionality in the correct layers. Background I'm building a WPF application from scratch, that contains business logic and business objec...
In language like C or Java, there are things like functions/methods to modularize and abstract stuff. What is there in SQL, specifically for Oracle? I've seen people talking about using views to reduce the complexity in various blogs but there is only so much that can be done with a view. (For example, a bind variable ...
I'm using xml to store cross-program information. This information is used in some webpages and in C# programs. When the information is altered, these alterations are not displayed right away in the webpages, they keep on displaying the information saved in cache, it takes a few refreshes for the webpage to show these ...
Consider a typical Kanban board: Input, Analysis, Dev Ready, Development, Build Ready, Test, Release Ready How to specify WIP limits for each column? any formula?
I understand why it is a good idea to code to an interface rather than to a concrete class. I find it hard to implement though as other methods generally need to use properties of the given object. Have I got the wrong end of the stick?
So, something's been bugging me about the new async support in C# 5: The user presses a button which starts an async operation. The call returns immediately and the message pump starts running again - that's the whole point. So the user can press the button again - causing re-entrancy. What if this is a problem? In the...
I come from languages like Python or Javascript (and others that are less object-oriented) and I am trying to improve my working knowledge of Java, which I know only in a superficial way. Is it considered a bad practice to always prepend this to the current instance attributes? It feels more natural to me to write ... ...
I am using a DDD-like approach for a greenfield module of an existing application; it's not 100% DDD due to architecture but I'm trying to use some DDD concepts. I have a bounded context (I think that's the proper term - I'm still learning about DDD) consisting of two Entities: Conversation and Message. Conversation ...
We're currently working on a medium/large PHP/MySQL project. We're doing unit testing with PHPUnit & QUnit and we have two full time testers that are manually testing the application. Our test (mock) data is currently created with SQL scripts. We have problem with maintaining scripts for test data. The business logic ...
My background is electrical engineering, DSP to be more precise. The company I currently work for does a lot of diverse projects, mostly building analog hardware. Being somewhat closer to computers than everybody else around here I'm often the one writing code for both embedded devices (which I'm perfectly fine with) a...
In When to use C over C++, and C++ over C? there is a statement wrt. to code size / C++ exceptions: Jerry answers (among other points): (...) it tends to be more difficult to produce truly tiny executables with C++. For really small systems, you're rarely writing a lot of code anyway, and the extra (...) to which I a...
I want to code my next work project in a language I'm unfamiliar with (python). I can think of plenty of reasons from my point of view why its a good idea (not least of all because it sounds fun). However my manager will probably ask me why. I'm a little stumped on the advantages from his point of view. EDIT: I normal...
I have developed a system with one company profile. The system is built using WCF services, asp.net. Now another company wants to use our system as well. And they might need some customization and some of their data elements are different. So I am planning to create a separate database for the new company and branch t...
nolo.com says: "If you want to stop someone from using or otherwise infringing on your work, you must sue the infringer in federal court. However, in order to do so, you must first have registered the copyright with the U.S. Copyright Office." Is it true that the only way to take legal action against software copyrigh...
4-bytes = word; 8-bytes = 2x word Then why doesn't the heap just go with 4-byte alignment (because it will be grabbing a word at a time anyway, right?) If we went with 8-byte alignments, why not 12? 16?
Apparently, the two major judging criteria of the effectiveness of heaps are (1) how much we can minimize the amount of space it takes up and (2) how fast operations on the heap can be carried out, eg, malloc and free But I was wondering how these two criteria were related, namely, why there is a 'tradeoff' and why a f...
It seems that C has its own quasi-objects such as 'structs' that can be considered as objects (in the high-level way that we would normally think). And also, C files themselves are basically separate "modules", right? Then aren't modules kind of like 'objects' too? I'm confused as to why C, which seems so similar to C+...
A little background: I am one of two programmers for our department of 10 people (the rest are artists and management). The two of us do all of the coding required to make things flow well, and develop any projects that come up. I've been programming for about 4 years now, where this is his first "real" job (as he puts...
I do a lot of work in Python and Java, and both those languages have fairly common (though not universal) conventions on how capitalization should be used in identifiers: both use PascalCase for class names and ALL_CAPS for "global" constants, but for other identifiers a lot of Java code uses mixedCase whereas a lot of...
In Eric Lippert's article What's Up With Hungarian Notation?, he states that the purpose of Hungarian Notation (the good kind) is to extend the concept of "type" to encompass semantic information in addition to storage representation information. A simple example would be prefixing a variable that represents an X-coo...
I'm a great believer in clean code and code craftsmanship, though I'm currently at a job where this isn't regarded as a top priority. I sometimes find myself in a situation where a peer's code is riddled with messy design and very little concern for future maintenance, though it's functional and contains little to no b...
When I was in university, I participated in a programming contest; the problems turned out to be extremely difficult and boring, and they required previous knowledge about a particular set of problem, e.g. graph theory, algebra. Our team failed completely at that competition, without solving any problems at all. After ...
I've seen this a lot in our legacy system at work - functions that go something like this: bool todo = false; if(cond1) { ... // lots of code here if(cond2) todo = true; ... // some other code here } if(todo) { ... } In other words, the function has two parts. The first part does some sort of processing (...
I have a website that is about electronics. I want to make some functional calculators such as calculation for analog filters which will have to show lots of plots and stuff like that. This is a sample of what I am looking for and obviously it is only PHP and its graphic functions. I want to have similar thing but much...
Given T={CTAGC, GAGCG, AGCGG, CGGAG}, using a greedy algorithm, the superstring S will be CTAGCGGAGCG. From S, the combination of triplets will be given as s = {CTA, TAG, AGC, GCG, CGG, GGA, GAG, AGC, GCG}. Both GCG and AGC are repeated. If using s to retrieve the superstring by using Hamiltonian method, would the repe...
To start with some background, I took up a new developer position this summer and ended up being the newest member on the team, yet with most experience under the belt. So far I have managed to push sanity initiatives through easily enough because of low adoption costs (in terms of time and effort). However things have...
Had a conversation with someone about adding some initialization code on application startup and he complained about that causing an increasing in the startup time. He couldn't really state a reason (gut feeling or something, don't know). This is not a heavy use application and starts in about a minute or so, we deploy...
I am working on an application right now that needs a way for employees to log in to the back-end of the public facing application for some basic reporting. If you were creating this, would you put the admin interface on the public side or on the intranet side? Update: It is the back-end of our eCommerce application. ...
I noticed that overtime with experience that the curve of learning shifts from trying to learn a language or technology (the way it works) to how to develop applications faster and with less code. I am very interested to see how other developers have minimized the time it takes to get applications to market. I know for...
Possible Duplicate: What should every programmer know about web development? I'm 15 years old. I've been programming for 2 years. I suppose I am a good programmer (not designer). I can use PHP(Good), Css(simple), and JQuery(not too bad). What else can I learn related to web development (maybe system programming)? Th...
I have been doing some browser automation testing recently using Selenium (and Watin a bit too) and have reached a point where I am looking for recommendations on controlling the environment I'm testing. For example, if I have a test that registers a new user on site (or similar database dependent task); how do people ...
In my 2d destruction derby simulator I have a CargoTruck class and CargoTruckImpl that implement an interface called Truck. CargoTruck has a reference to CargoTruckImpl which is returned through the CargoTruckImplFactory. But then I decided to add to this chain by having CargoTruckImpl and CargoTruckMovementImpl use th...
When recieving data from clients how much data that you provided to them should you require back from them? For example when clients order a product from a webservice should they just need to provide a product code? The other alternative would be to require the product code product name and product price ect. I have al...
When we talk about source code and the file which contains the code like CSS, HTML, JavaScript and we also talk about performance of a web site or application, what is the differences between these terms? Optimization Compression Minification Tidying Concatenation
Right now I'm trying to create a Heap that requires 8-byte alignment, and was looking around online for some good methods that would minimize the amount of fragmentation. Less fragmentation is ideal, and even the ones that will slow down a lot are a consideration (but speed is also a sub-goal here) Has anyone had any e...
We are a team of about 15 employees, in a non-IT enterprise. Today, we mainly develop websites, using PHP, MySQL, etc. We run a bit less than 100 linux servers on ourselves. But today, we are confronted with a too-big-for-us-to-code project. We selected a great provider (yes, outsourcing), and now they ask us to choose...
Possible Duplicate: Is it necessary to create a database with as few tables as possible I've recently started to develop a database for a ~10 person office (it's an internship for me), and I've come up with a conceptual design I am quite happy with. My employers though, wish for me to simplify my design (less tables...
I have almost 5 years of experience as a web developer, and feel that I should be mid-level by now, but when I walk the walk I think I'm still pretty "junior" at it. Here's what I think is the problem: For most of my career, I seldom had any real guidance by a more senior developer and zero experience with developer te...
I am writing a functional specification for a software program (Mac OS X application to be exact). I want to improve this by looking at other (good) functional specifications, but I cannot find any. Are there any (open-source) projects that have their specs publicly available so I can learn from them and improve my spe...
In Dijkstra's paper "Humble Programmer", he mentions that he gave some volunteers a problem to solve: “I have run a little programming experiment with really experienced volunteers, but something quite unintended and quite unexpected turned up. None of my volunteers found the obvious and most elegant solution. Upon cl...
I thought that many object-oriented languages have a reserved keyword for methods which do not modify the state of an object. These methods often have names that start with get. AFAIK a "getter" is always related to a single object attribute and "accessor" is too general, so "readonly" may the right term for this kind ...
Which problems domains are more suited to functional programming solutions and why? Can anyone provide any examples? EDIT Just to clarify, I'm not asking for a list of problems. I want to know what type of problems are best suited to functional solutions. For example I have heard financial problems are solved well wit...
I currently have code like this to display some objects that meet some criteria in a grid: // simplified void MyDialog::OnTimer() { UpdateDisplay(); } void MyDialog::UpdateDisplay() { std::list<MyClass *> objects; someService_->GetObjectsMeetingCriteria(objects, sortField, sortDirection); for(std::lis...
I'm learning Java, and I found a great teacher. He explains everything perfectly. I understand it all. My problem, is that after learning a short section, for example "Nested If Statements" or "Many Methods and Instances", I can type it all great, but in 5 mins, after going on to a new section (when I'm comfortable wit...
Having this sentence (consider many sentences in the future) David Henderson Houston patented the first roll film for cameras in 1881. I can make questions like 1. Who patented the roll film? 2. When was the first roll film for cameras patented? 3. What did David Houston patent (in 1881)? The answer will return so...
It’s become an annoying factor of working with large teams: how do you manage checkins and prevent feature conflicts and manage dependencies with source control properly? Currently at my workplace we use TFS 2008 and we're migrating to TFS 2010 in early December. Firstly any source control is better than none but what...
I've always thought that referring to the syntax of a language was the same as referring to the semantics of a language. But I've been informed that apparently that's not the case. What's the difference?
I've been reading this article by Mike Cohn about Scrum task boards. One query I have is how this fits into a workflow where there is QA stage performed by testers who aren't developers. It seems that many tasks could not easily be QA'd in isolation. A practical alternative could be that the "To Verify" process should ...
My non-technical manager just paid for a license to use a tool which designed to pick mentions of your brand name at blogs, "social media", comments, etc. and gauge the sentiment (positive, neutral, negative) of the post. What he wants me to do is use it to do a task which can only be achieved with a certain level of n...
So we're pretty good at eliciting requirements from our end customers, business division and sales/marketing. We plan projects to add/enhance features to meet those requests and prioritize tasks to meet deadlines in most profitable order. Over time, the software product has grown, the market has changed and the origina...
I searched the forum, but I couldn't find the answers why it should be avoided, only why it's not a silver bullet. So I don't think this question is a duplicate. Is there a VALID reason why I should unlearn Systems Hungarian I'm used to? So far I see the following benefits in using it: Consistent variable naming You s...
How effective are unit tests in reality? I am under the impression that at some point unit tests turn into tests that test the dependency between the object under test and another object. Sure, one can always abstract dependencies using interfaces, but what happens when even the interfaces should be changed? What if t...
If you work with SharePoint, you'll see classes like SPList, SPSite etc. I've seen variations of this on other projects, in other technologies, e.g. for a CRM project, classes named CRMLoggingFactory, CRMEntity etc. This stands out when you look at the code and you know what the prefix corresponds to, but when do you d...
One limitation of a program that I maintain is that the end-users often don't know what changes have been made. To remedy this I would like to show my users a simplified list of changes made to their program. Is there a good methodology/approach to follow that would create a easy to update list that could then be fed ...
I'm working with an ASP.net developer, under a boss who doesn't have much technical knowledge. I'm doing the front-end work, and and a database expert doing the backend. However, recently, he said that he would be working on the API for our site- I asked why, thinking we should do the web version first, assuming the AP...
Based on my experience in technical interviews, I have found that most tend to be subjective because the interviewer already has his own answer. Even though the answer from the candidate is correct, because the interviewer was not prepared for that answer, the candidate does not get the job. In an interview recently I ...
This is the password policy I just got from UPS (just for package status checking): Your password must be between 8 and 26 characters long. It must contain at least three of the following character types: lowercase letters, capital letters, numerals, special characters, or spaces. The password may not contain yo...
As per the title of this question, for extremely performance critical situations, is storing a file's metadata (e.g. location, size, download on, etc) in a database going to allow for better performance than attempting to get it from the file system itself? Have there been any case studies into this problem? To provide...
I just finished a technical interview yesterday and the interviewer asked about graph theory, data structure, and traversals. This has nothing to do with iOS stuff. So I came un-prepared. This was actually for a social mobile gaming company, is this the reason why they ask these kind of stuff instead of iOS stuff? Now ...
Say I produce some software with a genetic algorithm. In order to be certain that the software works correctly in all situations, I would need to test all situations, which could be prohibitively (or infinitely) many. So I evolve the software with evolving test input (some fixed, some inherited, and some random). Now, ...
Possible Duplicate: Do people in non-English-speaking countries code in English? I have a development comming that is intended to be sold across Latin America (Spanish speakers), but I've heard from some partners that is a good practice to always code in English, I mean just code (methods, classes, pages names, etc)...
There doesn't seem to be that many good descriptions that go into the specifics about how dlmalloc works. The sources I have come across so far mention dlmalloc, but then only goes on to explain what malloc() and free() are, rather than describing dlmalloc. The Wikipedia description, on the other hand, was a bit hard f...
I've inherited a bit of code and saw something new. They have a data structure definition out in a .h file, and in various local files they'll declare: union globalStructOstuff localVar; Is there any merit to this? I could see some if the global was some placeholder and the local versions were going to be different e...
I think somehow building a language which compiles to another language feels like a bad idea from the start, instead of learning javascript properly from the start. Look into Douglas Crockfords Good Parts and then are you hooked. And javascript is not hard - writing good code is hard regardless of language! If you wri...
This is probably a stupid question, but do I need to Clean/Rebuild before Debugging or Publishing a Visual Studio project? I see other developers doing it all the time, and at some point I started doing it without even thinking. It seems habit to always go Clean, wait, Rebuild, wait, Publish. I know I didn't always do...
Sometimes when I have a problem that needs to be solved, I find that the easiest way to solve it is by writing a small program as a personal tool. I don't make it super usable or super robust, as I am the only one going to use it, and I don't have the time to refine it and test it thoroughly. Then a coworker sees the p...
I'm in a project with 4 other people, and I've been willing to fully adopt a collaborative tool in order to make it possible to share information and store data (PDFs, DOCs, etc.) in an online tool, rather than doing it by e-mail. The problem is that I'm the only one enforcing it; actually I'm the only one using it. Th...
Possible Duplicate: Importance of learning to google efficiently for a programmer? Avoiding lengthy discussions, as a senior level student in CS, how can I get away from Googling problems I run into? I find myself using it too much; I seemingly reach for the instant answer and then blindly copy and paste code, hopin...
In a company working on a long term software project, there are 6 to 9 developers working in the same office. The development team uses JIRA for bug tracking and CVS (and some SVN) for version control of different Java Web Apps related to the software application. The team uses REST to communicate between the Web Apps ...
I am creating a web application. I have primarily used Javascript specifically jQuery. Because of some very specific functionality, I am running into practical limitations of Javascript--they're not hard limitations but stuff that I would find easy in Java, like making an equation editor where you can edit directly a...
I have a method like this in my UI code: void MyDialog::OnCommandSaveData() { std::list<MyClass*> objects; service_->GetAll(objects); dataService_->SaveObjects(objects); AddMessage("Saved data.\n"); } Because this method can take some time, I want to kick off a thread to do this. I'm using C++ and I p...
My company is reevaluating what kind of web framework we want to use. We are currently using the Ext 4.0 framework but there are questions being raised that it may not be the right framework to use. I like what Ext has to offer (rich GUIs, data package and class system) are there other frameworks out there that are s...
I've been reading up a lot lately on various web application deployment processes using SVN or GIT, with a view to redesigning how we currently deploy where I work. As is the way with many flavours of Agile, it's assumed that anything committed to master or trunk is production ready. Both GitHub and Etsy, http://codeas...
In the past week I've been meeting and speaking with someone who's interested in finding help on developing a game (built using php and mysql, with a little bit of javascript). I agreed to help out, however, now that I've seen the code and file organization, I don't know if it's feasible for anyone (not just myself) bu...
I am reading this and I came across: The Golden Rule of Platforms, "Eat Your Own Dogfood", can be rephrased as "Start with a Platform, and Then Use it for Everything." You can't just bolt it on later. Certainly not easily at any rate -- ask anyone who worked on platformizing MS Office. Or anyone who worked on platform...
Possible Duplicate: VB.Net vs C# debate Are there any actual reasons why company should choose VB.NET over C#? I work for a company which develops medical software and switched from VB6 to VB.NET several years ago. There were two reasons to switch to VB.NET but not to C# at that moment: VB.NET is more similar to VB...
I am working in a software company where we are mostly working on websites which are based on open source like dotnetnuke or nopcommerce or any other and i am totally bored with all this as there is no scope for doing something new as most of the code is already done in these open source i know the open source are go...
I'm working on a WPF application with views that require numerous value conversions. Initially, my philosophy (inspired in part by this lively debate on XAML Disciples) was that I should make the view model strictly about supporting the data requirements of the view. This meant that any value conversions required to tu...
I have a problem that involves several machines, message queues, and transactions. So for example a user clicks on a web page, the click sends a message to another machine which adds a payment to the user's account. There may be many thousands of clicks per second. All aspects of the transaction should be fault tolera...
Should I care about moving invariants out of cycle scope if it worsens code readability? Let's take a look at a simple example: for (var i = 0; i < collection.Count; i++) { ... } vs. var collectionCount = collection.Count; for (var i = 0; i < collectionCount; i++) { ... } The performance of second piece of code...
We're using JIRA to keep track of issues in our software projects. One effect we noticed is that we often create a new issue but we don't knw yet when/if the problem is going to be fixed at all. So we invented a fake 'Distant Future' milestone which such issues get assigned to. As it happens, the pile of issues assigne...
Let's say, I have one or more web app I find interesting, and as I want to do something similar, I would like to know on which technology they are based (programming language, database, web server, framework, ...). Is there any site where such information is centralized? If not, where should I look for this information...
After reading the article- When to Use Delegates Instead of Interfaces (C# Programming Guide), I need some help understanding the below given points, which I found to be not so clear (for me). Any examples or detailed explanations available for these? Use a delegate when: An eventing design pattern is used. It is des...
My company is one which has grown up rapidly over recent years in multiple territories. We are not a software company per se, but a technical one who have developed various bespoke applications inhouse. Some of these are now sold as SAAS. I am personally responsible for 3 of these applications: all internal web applica...
HTML4 / XHTML1 allows only GET and POST in forms, now it seems like HTML5 will do the same. There is a proposal to add these two but it doesn't seem to be gaining traction. What were the technical or political reasons for not including PUT and DELETE in HTML5 specification draft?
At our shop we use SVN for source control and CruiseControl for CI on handling automatic builds and deployments to our development, test, and integration environments. This all works smoothly however due to hardware and resource constraints our integration environment is not a 2 server load balanced environment like ou...
We are currently developing a public API for our app. The methods on this public API are mostly putting together functionality in different corners of the system. An example would be: (names have been changed to protect the innocent) public String createAppUser(String app, String name, String email, byte[] pwd) { ...
We have to extend a huge java project that makes use of frameworks like maven, spring, struts, freemarker and closure templates. We do have access to source code but barely any documentation, and we have to extend this system. Our only solution is to find the place in the existing code, where something similar is alrea...