instruction
stringlengths
34
19.9k
I've started working for a company that maintains a small/medium sized commercial website. The website is written in c# asp.net, and uses SQL Server as a database. The structure of the code is very messy at the moment (for instance, ~5000 line Utility.cs file) so I want to move towards a better design on the asp.net si...
Many, many, moons ago, I did my masters in Object Orientated Software Engineering. I covered everything: project initiation, requirements, analysis, design, architecture, development, etc, etc. My favourite IT book of all time was Developing Object Oriented Software, an Experience Based Approach (IBM-1996). A book crea...
While I learning C#, I found that, the C# supports operator overloading. I have problem with good example which: Make sense (ex. adding class named sheep and cow) Is not an example of concatenation of two strings Examples from Base Class Library are welcome.
I am creating use cases for a project. A generic user is extended by user "categories" which then is extended by an administrator (that can do all tasks possible). Is the following acceptable to portray? Is there a better way to portray such info?
I'm really lost here so I hope some can help me. I have to develop a phone application on every platform so i tough of using phonegap. Seems pretty nice. I have a web application coded in classic Asp and it's this webApplication that i need to strip down to be a phone app. At first at thought it will be simple, my clas...
In Java (or probably most other languages targeting the JVM) what is a reasonable number of threads to use? Presumably, this will be expressed as a ratio to the number of cores/processors available, is that correct? At least initially, it seems like twice as many threads as cores might make sense, but 20+ times as many...
I'm learning Silverlight, and I know that if I master it, I can apply the same concepts to WPF, which means I can do either web or desktop development pretty easily. But I've read articles and followed the discussion online, and I understand HTML5 is gaining traction for being cross-platform, and a lot of people seem t...
I have been arguing with a friend about the necessity of comments, and the efficiency of different comment styles. The argument ended quite fast, as we could not find any research - or essay - that support either claim. Has any serious research been conducted regarding the efficiency of different commenting styles? If ...
As I'm getting more organized, and getting more projects, I'm starting to wonder how to best manage time between them. Especially in regard to how I give estimates to the PHBs. So if the project is broken up into small tasks, say 2-3 hours each, then is it just as productive to work on one task per day as opposed to...
I've recently done some Java programming for an android app (though my question is not android specific), and was wondering if what I was doing was just a lot less complicated, but generally the same as what a professional mobile app designer would do. I kind of asssumed that an app designer working for, say, the BBC w...
I could not differentiate between FreeBSD and GPL liecense. Can anyone tell me the in what respect these two liecense are different. Is it legal to use some source based on GPL license and release the new product as FreeBSD license? In particular, I have following scence: I would like to follow some of the implementati...
For instance, I have a file with poor indentation (at least incoherant with the rest of the project). If I correct the indentation and commit, there will be a serious change in the file at a certain point in time, causing the diffs between versions before and after that serious change to be hard to read. How do you han...
Back in my C programming days I thought there was a constant or function (I can't remember what it was called, let's call it SMALL) whose value was the smallest possible positive value. (Imagine the LSB=1 and all other bits = 0.) It was used to avoid a divide by zero error. For example, let's say you want to compute ...
I was wondering how you'd be able to map the following criterias to common design patterns. I use PHP 5.3 and MySQL 5.5 and have my own mvc framework for my company but some parts could be better and here are the requirements: (Take the concept of a catalog since it's the first app that would be affected in our applic...
In a functional application, should you wrap common higher-level functions in domain-meaningful names or should you leave them "bare"? For instance, if you have a list of Addresses, and "sorted by zipcode" is a common domain-meaningful ordering (targeted mailers, etc.), is it preferable to write: val sortedCustomers =...
Possible Duplicates: git / other VCS - how often to commit? How often should I/do you make commits? The usage of source control is very different from one developer to another and from project to another. Some commit very often; others can spend a whole day or several days without committing (especially when they wor...
It happened frequently that I have to provide access to a bunch of files organized in a directory tree according to some (sometimes loosely specified) rules. My standard pattern is to provide a Database class which is initialized with the root directory. This class provides getX()-like (example: getStructure()) methods...
What is the proper terminology for a small (2-4) set of tightly coupled classes? These classes can't work independently. I was thinking system, but after googling for a bit, I've determined that the word is typically used to describe the software as a whole. Then, I thought of subsystem, but I don't know if the term ap...
While developing (either features or bug fixes) I sometimes happen to discover bugs that are not directly related to what I'm working on. What should I do in that situation. Just fix it? Try to remember to fix it later? Write it down somewhere? Or enter it into the bug tracking system? I generally enter it into th...
Interested to know how people deploy software to their customers I have the following requirements: Customers on various OS's prob. linux and Windows Can't release the source code Ideally want option to develop GUIs not just cmd line stuff Can't assume anything is pre-installed on customers machines Would like to use ...
Possible Duplicate: How do I approach a coworker about his or her code quality? My development colleague is producing numerous blocks of code which I am a bit concerned doesn't really make for easy reading and potential issues in the future. I've tried giving little tips along the way without blantantly saying what...
I have watched a couple videos on JavaScript where the presenter mentioned "caching" a variable but I didn't see them do anything in the code that would "cache" it beyond normal assignments. When I think of cache I think of something stored in local memory in which case aren't all JavaScript variables cached by definit...
I've been trying for years to come up with a good way to organize the massive amounts of notes and material I generate when designing, coding, and testing software. My desk is usually overflowing with tons of sheets of paper with notes scrawled all over them. I've usually got at least the following items spread out all...
In C, C++ and some dialects of BASIC, goto labels are declared with the syntax label:. I'm working on a language that uses name: type as the syntax for variable declarations, so I'd prefer if possible to use something a bit more distinctive for labels. I am or at some point was passingly familiar with many languages th...
Let's say we have a company and we release our project under LGPL && GPLv3, as you know the only thing here is about contribution. People commit bug-fixes/features to the project, it's fine and we are GPL fans. Basically company makes money by this project. So what about contributors ? I know they commit code and softw...
If you are starting up a web, mobile, or standalone application, how well must you know the rest of your collaboration team? Would it be a bad idea to ever work with someone unless I've met him personally? Is it okay to sometimes accept small public contributions such as code snippets and artwork without meeting the co...
I have some confusion understanding the OpenUp/Basic process. It is described as an iterative process consisting of four phases: Inception, Elaboration, Construction, and Transition. I am not clear if a single iteration consists of all these phases or if we make several iterations within a single phase and then move...
I find myself aiding novice programmers relatively often; explaining why their code won't work when they ask, suggesting solutions and the like. The people I'm helping do have a formal education in programming from a first-year degree-level module, in Java, but I feel like I can't communicate with them very well. For e...
This is an abstract question to clarify a refactoring concept in the ruby language. Assume in the real world that there would be many more variables and method in the Furniture Class and Refinish method. I have a Class called Furniture. It has a method called 'refurnish(VarnishToUse, TimeToTake)'. This method has va...
This question has been on my mind for probably 10 years. Ever since I've started programming for a living. And I've seen multiple discussions about good fit, distractions, being in the zone, etc. But I haven't seen links to some information/research that could give an objective self evaluation measure/tool to understan...
I have written one web services using Java. Its already live (up and running). During development I have SVN (repository) + Jira for task maintenance + Maven for building the web services. Now I have some small update for my web services and I have created that task in Jira and committed the files in svn with respect ...
I am planning to develop a commercial software using a LGPL software. In the LGPL software that I am using some functions in a class are not fully implemented. I want to modify the LGPL code so that the class and not-implemented functions are made visible outside the dll by adding dllexport infront of class and by add...
I am not sure how to phrase this, but in asp.net there is the notion of a "web application" that is fundamentally just a DLL that the web server loads. It has the ability to dynamically discover and load user controls at runtime (e.g. a customized button), using something called MEF (which can discover dlls and load t...
I recently picked up a macbook and want to start doing some apps for my ipad. I have a chat client written in c# that interfaces a game I play. What I would like to do is write an app for the ipad that would communicate somehow with my c# app. What would be the best approach to this? I have never used JSON but is this ...
Our company is about to acquire a source code of a huge product. What are thing to take into consideration when the handover starts, to make sure we have everything and be capable to maintain that product in the future?
I with 2 other friends are new to web development. We are learning HTML, CSS, Javascript and are creating simple websites to get a feel of different things. And as HTML is only a markup and not a programming language we have very different styles evolving. I mean whenever we look at each other's code, we tend to put a ...
The major online IDEs are hosted on the service provider's server. Examples are Kodingen, Cloud9, ShiftEdit. Hence they would be unavailable if the external server was down for some reason, and I prefer to do my computing on my own computer anyway. Does anyone know of an online IDE or editor (preferably just an editor ...
Initial note: This question got closed after several edits because I lacked the proper terminology to state accurately what I was looking for. Sam Tobin-Hochstadt then posted a comment which made me recognise exactly what that was: programming languages that support intersection types for function return values. Now t...
I realized there could be a lot of bad code in a system while writing Java. I wonder why schools don't teach what programming practices are bad. For example, in Java, using a big try/catch block that catches Exception is bad, but no one told me. And we see the typical "String + String" concatenation appear in every cor...
I am currently learning about bitwise operation, so bear with me. I understand AND, OR, and shifting. What I don't understand is bit flipping. So, 5 is 0101. When someone says to me "flip those", it would result in 1010 which is 10. So why does ~5result in -6? I think I got this very wrong. Can someone enlight me? (I...
Suppose you were given an integer number in decimal notation. This when represented in binary will be a series of 0's and 1's. This sequence varies in length with the magnitude of the number. Now suppose you wanted to flip the 'n'th position bit in this sequence of binary numbers, how would you do it? The result of the...
Is it necessarily if a software released under both of LGPL3 && GPL3 terms have to include both license header notice top of each file? Or just put GPL header notice? or simply put LGPL3 license text in some file like COPYING.LESSER ? EDITED: I am the copyright holder of the project!
We're in a bad situation of having very little documentation on customization our past workers made to a business critical system. Lots of changes were done to Crystal Reports, database entities, and proprietary configuration/programming files for our ERP software. The current documentation generally reads something li...
After browsing the apple docs, I came across this sample of their MVC pattern: Using NSNotificationCenter and without using KVO, would this diagram below represent a correct implementation of the MVC pattern? If not, what’s wrong and how can it be corrected or improved? App starts with the left light set to on, and...
At my company, we have a quagmire of disparate cron jobs (on multiple systems) and manually kicked off processes which keep our business functioning that is a result of years of expedient development and subsequent neglect. Someday, we will need to come up with a more centralized solution for obvious reasons. One thoug...
I am writing an application that takes some file specifying an adjacency matrix and uses this to construct a graph (in this case, a directed social network). What I would like to do is specify the size of the matrix and then have it generate an adjacency matrix with one of these topologies: ring, hierarchical, fully-co...
I don't know if it's the right place to post this question but, to improve my productivity I need to install an open source issue-tracking system to keep tracks of all bugs and information about the completion. There are a lot of open source systems to do that but I'm looking for one which could be hosted on PHP / MyS...
We've recently moved to a better password storage strategy, with it came all the good stuff: Passwords are stored after going through bCrypt User is sent an activation link on account creation to confirm ownership of address Forgot password without security question, a link is sent to their email. The link expires aft...
I've been wondering about code reviews recently, based on how many questions I've seen on here talking about them. Between my internships, contracts, and full time jobs, I've worked for six different companies, and only one of them has done code reviews. At the last two places I've worked, code was good (or at least go...
Usually in a domain model, you'll have objects, and those objects will have properties that are mutable and properties that are immutable - for instance, a instance id/name will be immutable, while some other properties (specially properties that depend on relationships with other objects) can vary in the lifetime of a...
Possible Duplicate: Library vs. framework vs API? I am having hard times understanding what these concepts really mean. This software stack thing is very confusing. Can you please help me with this question, or if you can refer me to some article/book where I can learn in details about this software stack and how th...
Given a binary search tree, I understand why I can use breadth-first and pre-order traversal to list the entries of the tree in such a way as to reconstruct the tree in the order in which its traversed. However if we now consider an AVL tree and we want to traverse the tree in such a way as to recreate the same AVL tr...
I got one project with some requirements. Basically my client provide data entry work. In that he converts image files(scan copy of articles, forms etc) to document file (MS word) by typing manually. For maintaining quality of that work he set some roles on documents text formatting like specific font, font size, pap...
Context I'm developing an application using a Domain Driven Design approach. I want to use a design pattern wherever appropriate and apply all SOLID principles. Scenario I have an order and I want to allow clients to add order lines to it. Consider the following pseudo code: class Order OrderLines[] (readonly) ...
Is it a good practice to call a method that returns true or false values in an if statement? Something like this: private void VerifyAccount() { if (!ValidateCredentials(txtUser.Text, txtPassword.Text)) { MessageBox.Show("Invalid user name or password"); } } private bool ValidateCredentials(string ...
A comment on this question: Checking if a method returns false: assign result to temporary variable, or put method invocation directly in conditional? says that you should use !boolean instead of boolean == false when testing conditions. Why? To me boolean == false is much more natural in English and is more explicit. ...
I was reading Paul Graham's essay - Beating The Averages (2003) and here's what he had to say: The more of an IT flavor the job descriptions had, the less dangerous the company was. The safest kind were the ones that wanted Oracle experience. You never had to worry about those. You were also safe if they said th...
I am using PHP. I'm building a fully modular CMS, which is destined for the public. Some people might view this as a framework, but I intend to write a set of extensions for it, extensions that will make it a CMS :P Because it's completely modular I have a problem figuring out how to load extensions. Practically I nee...
The model is defined first, then the controllers are fired based on the user request, and they will generate the views (the output). So it should be M->C->V, right?
Just wondering (now that I've started with C++ which needs a compiler) why Python doesn't need a compiler? I just enter the code, save it as an exec, and run it. In C++ I have to make builds and all of that other fun stuff.
I am working with a history teacher on a history app. He has like 200 flowcharts that he wants to put into the app (among other things). The two likeliest-looking ways to do it: HTML/CSS. The big minus here is that neither one of us is a big HTML/CSS person. Though I do know a bit about them. Adobe Illustrator. The in...
My friend and I usually don't have time to meet up in person to do some real pair programming. Since we want to program together anyway, we turned to the world of collaborative software editing. Sadly, most of the solutions we have tried are either lackluster or don't work at all. Cloud9 (fusion of Mozilla Skywriter, ...
If I have a number of classes, lets say a variety of buildings of some sort. Each of these buildings have various properties and do some stuff etc Now there is a set of operations I need to do on these buildings that are all conceptually the same. Lets call this conceptual group of operations Move building effluent...
I just started a diploma in software development. Right now we're starting out with basic Java and such (so right from the bottom you might say) - which is fine, I have no programming experience apart from knowing how to do "Hello World" in Java. I keep hearing that mathematics is pertinent to coding, but how is it so?...
A lot of questions get asked here about interpreted vs compiled language implements. I'm wondering whether the distinction actually makes any sense. (Actually the questions are usually about languages, but they are really thinking about the most popular implementations of those languages). Today almost no implementatio...
I've started toying with some Mac development and wonder where the best place to store the code is? Generally on my windows box, I'd store all my code in c:\Code\ On the Mac it's in /Users/Liam/Code/ Will this cause me any issue with permissions when running web code?
Possible Duplicate: Is there any reason to use C++ instead of C, Perl, Python, etc.? When to use C over C++, and C++ over C? I am going to enter university next fall in computer sciences, but have been programming already for a few years. I am currently doing web application development. I use Python and Java mainl...
I have essentially a data model class that represents an XML data structure that we use to model our system. The model class is in a shared project that is used by a number of different solutions in order to generate a common XML data structure for usage by any number of applications. In one application I am involved ...
So I've been creating a data access layer via TDD and have approached somewhat of a concern. I'd rather not start down the wrong path, so I figured I'd ask you guys to see if my thoughts were in line with a clean architecture. The methods within my Data Access Layer (DAL for short), are pretty simple. They are in line ...
We are designing a website/web application where we hope to to achieve high user counts and, in general, lots of use. More specifically, we intend to be using PHP as the programming/scripting language and MySQL for the relational DB needs as a start. We have not yet figured out whether to use a NoSQL database or not. R...
In C, I often come across errors with code like this prio_queue->head[index] = newEntry; Yields a " "Cannot assign Entry** to Entry* " How do you prevent/debug errors of this type, in general?
Greenspun's tenth rule (actually the only rule) states that: Any sufficiently complicated C or Fortran program contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of Common Lisp. My memory is that there are some papers on the topic, perhaps for Borland's Quattro (spreadsheet) project and p...
A large system has already been done in visual fox pro. They want to add more requirements to a module and make some changes to the system.At the same time they are thinking about migration to .net. Some parts like report generation has been done in .net using visual fox pro database and loaded in vfp. Is it a good ide...
I've heard it said that gantt charts are a relic of waterfall project management techniques. I typically use an agile-like approach to project planning and tracking progress which provides good visibility into feature-time trade-offs as the project progresses. We're at the outset of a project in in which, while the e...
I am in a distributed system project written in java where we have some classes which corresponds to very complex real-world-business objects. These objects have a lot of methods corresponding to actions that the user (or some other agent) may apply to that objects. As a result, these classes became very complex. The s...
I'm creating a vector editing program in C++, and I need a Shape interface which other concrete classes will implement. There is a requirement that no implementation inheritance is allowed. The design doc says that if you need polymorphism, use interfaces. If you need code reuse, use composition. The Shape interface is...
Code Complete states that you should aways code into a language as opposed to code in it. By that, they mean Don't limit your programming thinking only to the concepts that are supported automatically by your language. The best programmers think of what they want to do, and then they assess how to accomplish their obj...
Clean code recommends to name methods to be a verb, and classes to be a noun. I am developing an c++ application using boost::signal as some kind of event framework, and have defined various events, but naming them to make the code cleaner seems to be problematic. So, how to name event types?
I want to contribute to open source projects on Github. Mostly, I'd like to just start out fixing small bugs or adding features. I don't have a particular project in mind. I'd like to work on C, C++, Python, .NET, Java, etc projects. However, my problem is I can't figure out how to find anything on Github. I did find a...
Possible Duplicate: What does mathematics have to do with programming? How often do you have to solve pure mathematical or algorithmical problems? I heard that math can be very important in programming. I am a confident python programmer, and have started C++. So far I have not encountered anything where I need to us...
This is really perplexing me. We have a 'definition of done' and it includes dev 'done', unit tests 'done', dev test 'done'. However we also have a user acceptance test that needs to be 'done' but the business wants to know when users stories are complete so that they can see stuff (the uat really isnt a priority until...
I'm new at computer science and programming, and I was wondering, is there a difference between computer science and programming? and do you get to choose to study only one of them at the university, or both of them?
I was looking through the AvSol Coding Guidelines for C# and I agree with nearly everything but I'm really curious to see what other think of one specific rule. AV1500 Methods should not exceed 7 statements A method that requires more than 7 statements is doing too much, or has too many responsibilities. It also...
<HTML> <HEAD><TITLE>Login Page</TITLE></HEAD> <BODY> <CENTER> <FORM method="POST" action="http://yourserver/cgi-bin/login.py"> <paragraph> Enter your login name: <input type="text" name="login"> <paragraph> Enter your password: <input type=password name="password"> <paragraph> <input type="submit" value="Connect"> </FO...
I want to generate code documentation in a simple format. The key items are Method Signature, members, constructors, methods. I am taking various applications in .NET and creating documentation for them. I will be adding notes to each item. The end result should look similar to MSDN or Java API documentation. So, I...
In Java, which is more highly recommended, and why? Both types will throw exceptions, so in that regard handling them is the same. assert is slightly shorter, but I'm not sure how much that matters. public void doStuff(Object obj) { assert obj != null; ... } vs public void doStuff(Object obj) { if (obj == ...
The Problem I am hunting down a bug in a web application related to multi-uploads using a Flash movie/applet. Sometimes, the progress bar that is used in the Flash applet to indicate file upload progress will read over 100% for a progress and causes the entire upload system to halt. Aside from the logic errors associat...
I've been programming for a while, I've written some rudimentary programs, and I want to keep learning. I've reached that point where you just don't know what to learn next, and I'd like to ask a question for my own curiosity. The question, in a nutshell, is if you can combine multiple programming languages into 1 resu...
According to this Python code visualizer, Python strings are allocated on the stack and not on the heap. Why is this? I thought they would be similar to Java where Strings are allocated on the heap.
In this Stack Overflow question: https://stackoverflow.com/questions/9471332 I learned that Jscript is not dead after all. Yay! But what is JScript.NET good for? According to this article, you can use it to provide C# with an Eval function. That's neat, but it seems like kind of an edge case. If you were after fir...
According to this, "Scrum highly relies on a highly motivated, closely collaborating, cross-functional and self-organized teams." So how do you handle co-workers who may not be as motivated to take ownership of the code? How do you get someone interested in taking ownership?
A weird title, yes, but I've got a bit of ground to cover I think. We have an organization account on github with private repositories. We want to use github's native issues/pull-requests features (pull requests are basically exactly what we want as far as code reviews and feature discussions). We found the tool hub ...
This might be a little open ended, but I heard an explanation of this talk on how GP could be used to fix bugs, and I wonder: How does this differ from the infinite monkey theorem?
I have created several hand written compilers for very simple languages but now I want to try my hand at developing a dynamic language, similar to a simplified Python or Ruby. However, it was easy for me to wrap my head around how compilers work. Primitive compilers just translate. But I can't do this if the languag...
java.util.Arrays.sort(/* int[], char[], short[], byte[], boolean[] */) is implemented as a 'tuned quicksort' rather than a radix sort. I did a speed comparison a while ago, and with something like n>10000, radix sort was always faster. why?
Possible Duplicate: Should newbies use IDE autocomplete (Intellisense)? Since I moved on to actual IDEs for C++, Java and Python, I noticed they automatically try to complete my code. For example if I write System.out.pr[...] I am automatically offered a list from which I can select the item I want to use. As a begi...
Mocking the DAL/Repository that I pass to the BLL/ViewModels for testing purposes is not much different than creating an in-memory DAL. Right now I'm using an in-memory DAL in a new project instead of mocking it and it's working very well so far (even easier than setting up the mocks I'd say). Since I haven't seen this...
We have three applications developed in Flex and all these use BlazeDS. These applications have their own authentication implementations (Database). Also they will be deployed in tomcat. Deploying all these applications in the same tomcat instance is acceptable for us. We want to bring the authentication credentials of...
I am looking into designing a system where users build a template item and then create many instances based on this template.They then need to be able customise each instance but I also need for them to be able to make changes to the template and have all instances updated. These items are fairly complex, each consisti...
We are currently deciding on a consistent naming convention across a site with multiple web applications. Historically, I've been an advocate of the 'lowercase all the letters!' when creating URLs: http://example.com/mysystem/account/view/1551 However, within the last year or two, specifically since I began using ASP....