instruction
stringlengths
34
36.1k
What's the best way to review a code before it's committed to the SVN trunk? One idea that I am thinking of is to having the developer to commit his code to a branch and then reviewing his code while merging the branch revisions into the trunk. Is this a good practice? If not, what else could be done to review a code b...
I'd like to know, why would I want to have a special prefixes for a function arguments, like "p_name", "p_age", "p_sex"? On the one hand it helps to distinguish parameter from local variable or field further in the function body, but would it help? On the other hand, I didn't saw such naming recommendations anywhere in...
Today I was asked this question during an interview: What will happen if we do not override the hashcode method for our class, then add it to HashTable and then try to get objects? What could go wrong?
I've been under impression, that monkeypatching is more in quick and dirty hack category, rather than standard, good programming practice. While I'd used from time to time to fix minor issues with 3rd party libs, I considered it temporary fix and I'd submit proper patch to the 3rd party project. However, I've seen th...
I am developing apps on my sparetime. I am the sole developer, and two non-programmer friends of mine provide vision, content, algorithms and ideas. We always agree happily on all the features, todos and prioritizations. But naturally, coding it is the biggest part. When selling, we agree on splitting profit equally, t...
In many User Interface libraries, we have concept of views and subviews. so according to MVC pattern every view should update the model as soon as it changes. For that view should have a reference of its model. If we have a subview and it does some calculation, then should that model also be passed to the subview or p...
I'm using CSS3 for the first time, but using specific styles with prefix for each browser looks strange. The need of using -moz-, -o-, -webkit- and another prefix turns the CSS bigger and harder to maintain. I want to know if the browsers are implementing some standardization to avoid the usage of prefix for styles.
Would a competent asp .net C# developer be disregarding a lot of their skills in order to have more concern with configuration and server-side coding when moving their career into the sharepoint 2010 arena? Or is asp .net C# in fact just a good base to begin the study of sharepoint on?
In this Stackoverflow anwer I dimly recall being taught that it's better to use as "wide" a condition as possible to terminate a loop, rather than testing for an exact termination condition. i.e. use: while (x < 10) rather than while (x != 10) however I cannot recall (or find) any formal basis or rationale for this....
I have some trouble getting a good folder structure in my project and i would like to know what other ways i could use to structure my files. I'm currently working in an MVC sturctured folder. www/ Controllers/ Models/ Views/ Nothing special so far. But i'm also using an ORM system. With it i can easily get an '...
It seems to me that the list terminator in Lisp could be any arbitrary value. For example, the string terminator in C is the null pointer. Is there a philosophical reason why the empty list was chosen to terminate lists?
I have worked in software development for over 10 years now, and it's dawning on me that I rarely get to create anything "new". I realize that "new" is a vague term, but I would define it as anything from an obvious new large-scale project to a new large feature in an existing project (say something that would require...
A little background. A developer I used to work with insisted on disabling Tempdata and using Session Flash for passing data in the return view. Question is, is there any advantage to doing it this way? using a flash message is great for returning data to the user but I've had headaches with passing data from one...
I'm working on a new programming language, which determines structure with indentation instead of braces in the manner of Python and CoffeeScript. Obviously placing lines indented with spaces next to lines indented with tabs will mess up that kind of syntax, so I'm disallowing that - any given source file must use one ...
I'm nearing the end of a prototyping/proof of concept phase for a side project I'm working on, and trying to decide on some larger scale application design decisions. The app is a project management system tailored more towards the agile development process. One of the decisions I need to make is whether or not to go...
I was reading about software inspection in Software Engineering by Ian Summerville and I came across the term Software inspection and I started reading about it on Wikipedia. I am unable to understand what is the difference between verification and software inspection?
I am developing desktop based GUI (single form) using wxPython and loads it using remote citrix access from client private network. Suppose, the GUI has certain group of select and text boxes which are loaded together when application starts. The value of select boxes come from database and on the basis of selection of...
I would like to organize my company's software releases by platform. I've looked at how Mozilla, Perforce, and Apache organize their releases, and it seems that I should partition by OS and processor architecture. I was thinking of something like this: Linux (x86-32) Linux (x86-64) Neutrino (x86-32) Windows (x86-32) W...
I'm coding in C++. I have a server that will have clients connect to it, and each client gets spun off into its own thread for communication. This server is hosting a game, so there is information that must be shared between all client threads, as well as any other threads I choose to spawn off. This data is like level...
I would like to group a population based on two criteria. I will use an analogy to simplify my question. Let's say I want n number of groups. I want to populate those groups based on person's age and weight, so that all groups contain about the same total age and are evenly distributed by weight (so that there are abou...
I'm not asking from a business sense exactly, but for example, both reddit and Twitter are completely open source. It is my understanding that at least the large majority of their profit comes from advertising on their website. So what exactly is to prevent someone from copying their code and making their own website...
I find whenever I work with GUI code, the code tends to bloat faster then other kinds of code. It also seems harder to refactor. Whereas in other kinds of code I can refactor pretty easily -- I find I can decompose a larger class into smaller pieces of functionality -- with most GUI frameworks I'm often bound to a fram...
I have been reading about MapReduce for a while -- but what I can't understand is how someone would make a decision to use (or not use) MapReduce. I mean, what are the problem patterns that signal that MapReduce could be used.
When I learned the C++ language for the first time I learned that besides int, float etc, smaller or bigger versions of these data types existed within the language. For example I could call a variable x int x; or short int x; The main difference being that short int takes 2 bytes of memory while int takes 4 bytes, a...
We've been having constant requirement changes of having to choose which graphic rendering library to use for our project. In a team of about 10 members, two of us are exploring the new graphic library. The team lead expects that we learn what's necessary within 2 days and introduce it to the rest of the team (wants ...
Background Recently, I have been fascinated about the possibilities of dataflow-based programming approaches - in particular, signal/event-based concepts as realized by functional reactive programming, Boost::Dataflow::Signals, and the like. Sample scenario: Consider a car that has four speed sensors, one at each of it...
I have a ASP.NET web based application that allows the end user to export data to a flat file format. (essentially taking a point-in-time backup of their work) At a later date they can re-upload (import) that data back into the web application. The actual format of the backup is pretty trivial. An object graph is seria...
I am working on a web application which operate with different types of objects such as user, profiles, pages etc. All objects have unique object_id. When objects interact it may produce "activity", such as user posting on the page or profile. Activity may be related to multiple objects through their object_id. Users m...
A situation that has arisen several times in open source projects goes like this: I notice a bug in our deployment, and figure out a quick hack patch. (For example, simply commenting out code that we don't actually need.) I spend a little bit of extra effort to figure out the real bug, come up with a patch, and submit...
We have various projects in source control for web and desktop applications. Invariably, many of them use third-party open source projects or even common libraries within our organization as dependencies. Should we include the full projects of these dependencies in our various solutions? Or should we just include the ....
I'm starting to check in the SQL files for creating/maintaining our database. Previously SQL files were kept totally separate from our codebase's version control. I'd like to pragmatically store my database construction/manipulation files with my other code. Do they make the most sense in a subdirectory of my Models or...
I just wrote my first SAX-based (Java) XML schema validator, where you pass it a schema URL (pointing to the .xsd file), and an XML instance, and it determines whether or not that instance is valid or not. I'm now looking to write several unit tests for the validator (TDD people, I know, I know!) and was wondering what...
Could someone help me understand what is the difference between blocking and non-blocking frameworks? So far, I understand that when request comes to a blocking framework it creates new thread for that request and processes it, if second request comes to server before the first one has finished it execution it will c...
My company is looking to implement a CI solution pretty soon, and I am worried about one thing in particular... we are scaling up, which means our solutions are growing with more projects. One thing I wanted to look into is to split off rarely changed projects into a separate project, and then having other projects sim...
Possible Duplicate: How to decide between using an existing eCommerce solution and building your own? I am starting a ecomm business and my site idea is pretty similar in functionality to ETSY. I am sure that I could build it in wordpress (or drupal or magento) and just use plugins to get all the functions i want - ...
Ok, I've been teaching a buddy how to program for a while now. He's a very fast learner, and he's quite good at programming so far. However, he has one "issue" I keep trying to correct. He jumps in and starts doing highlevel programming without learning some of the basics (He's created a full blown web application but ...
There seems to be a lot of buzz around software craftsmanship lately. Is it a well-defined concept? What does imply? To what extent is programming effectively a craft activity?
My current day job is mostly project management and client liaison work, but I sometimes get involved in actual coding. I do this either because I have a clear vision of what I want the result to look like (and it's easier to implement than to explain it), because I have relevant expertise, or simply to add resources. ...
I need to handle and process ~5 million news articles, an amount small enough to fit on a commodity desktop but too large to process serially. Thus far, I have been using Python/pickle for serialization, but this is easily getting out of hand. However, I do not have a server much less a cluster immediately available...
We are building a Windows Mobile based application to interface with a customer's existing web application. We are reading and writing data to the customer's SQL server 2008 database. The customer wants all reads to happen through SQL views, and all writes to happen through stored procedures. But taking a look at their...
I have a bunch "Property Sets" (which are simple structs containing POD members). I'd like to modify these property sets (eg: add a new member) at run time so that the definition of the property sets can be externalized and the code itself can be re-used with multiple versions/types of property sets with minimal/no cha...
Once upon time ago I asked a question on Stack Overflow about inheritance. I have said I design chess engine in OOP fashion. So I inherit all my pieces from Piece abstract class but inheritance still goes. Let me show by code public abstract class Piece { public void MakeMove(); public void TakeBackMove(); } p...
I am currently writing an extended report on a software library I have written. The reviewer will be a professor at my univeristy. He knows basically what I had to do, but the report will be evaluated. I have produced some samples results with the library which I already plan to include in the work. What I want to know...
I'd like to provide a very lightweight method to describe my web services. No WSDL, WADL or similar complex stuff. Just a mapping from the web service's base URL to a simple description which can be detected and parsed automatically. Basically The name of the service A link to some human readable documentation (option...
I have various windows forms applications that contain various controls that build up custom "group by" and "where" clauses for my class methods. I am thinking to pass a collection structure of some kind in order for the methods to be able to build the group by's and the where clauses. Let's say a list containing the ...
I found in legacy code a class which name is BucketService. Because english is not my native language I was trying to translate that, but it doesn't make sense. I found few termins like bucket sorting and so on, but I still don't get it. Actually this word is used quite frequently in programming I would be helpfull for...
Let me start this out by saying I've been a asp.net web forms developer for a while now and that I understand mvc is a new way of doing things. As I'm learning mvc and going through tutorials and training videos, I have questions that these tutorials don't address. This is my attempt to address them here... I started a...
I have a paid application on the android marketplace, however, I want to release a free ad-supported version. The easiest way I thought to do this was to set up a branch on my subversion repository that has the additional code to add the ads. However, when I went to submit this to the android marketplace, they require ...
Lately, I've been writing code in SAS Enterprise Guide, which produces "code" that looks like this (screenshot from the linked page): My question is twofold: Do you think it's necessary to perform code review on this type of code? My gut feeling is yes, given that (1) it's still code, just visually laid out, and (2) ...
In previous web applications I've built, I've had issues with users entering exotic characters into forms which get stored strangely in the database, and sometimes appear different or double-encoded when retrieved from the database and displayed back in the browser. I'm starting a new project now, and I want to preven...
I wanted to know if anyone had any tips for transitioning from small personal projects and coursework, to a large enterprise scale project? Im in my second year at university and have attained a placement with a large tech company, to work on a pretty large project, I'm just a little apprehensive about 'finding my way ...
Currently at my work place we use FogBugz for managing all our features and bugs for our different web applications. When a new feature is to be added to one of our web applications, a new Case is created. For example "Create CSV Upload Form". I then work on the case recording the amount of time I've spent on it. Once ...
I'm an Undergraduate Computer Science Student currently on a placement year at a company that produces and supports a large enterprise web application. I'm loving the experience of seeing how software is produced in the real world, and feel very lucky to find a company that offers a chance to not only maintain and exte...
How to decide if have to take the <<access>> or <<use>> notation for "-->" arrows in Component diagrams written in UML?
I have a situation where most people in my group come from an object oriented programming background with little to no understanding of functional programming. Not even basics like closures. Any suggestions about what might be a good way to introduce them to functional coding style? A lot of coding that we do can be s...
I've noticed a few functions I work with have 6 or more parameters, whereas in most libraries I use it is rare to find a function that takes more than 3. Often a lot of these extra parameters are binary options to alter the function behaviour. I think that some of these umpteen-parametered functions should probably be ...
Are there any open source applications that are developed using test driven development that serve as models of how good unit testing should work? I'd prefer to see examples in C# and .NET. (Note that I mentioned applications, not just libraries.) I'm a mid-tier programmer who really wants to believe in and practice ...
I am assuming the implementations/compilers/generated C code (referred to hereinafter as generic, 'interpreter') for most functional programming languages are written in non-pure functional languages. If this is the case, the underlying interpreter for any given functional programming language exhibits destructive upd...
If I am developing a Java library, is it good practice to issue log statements from within the library's code? Having logging within the library will make debugging and troubleshooting more transparent. However, on the other hand, I do not like littering my library code with logging statements. Are there any performanc...
Instead of compiling the source code for the respective OS (on which it is targeted), you compile once and run everywhere. For the sake of this question, I would call it VM (for example, both for Java and .NET). So this the execution of programs becomes something like ------------ ---- ---- | Executable | ...
I'm not a graphic designer. I'm pretty bad at drawing anything. I struggle to build things that look even as nice as "sample" applications bundled with development tools; primarily because I don't have squat in the way of art assets. What strategies might I take to mitigate this?
I have always preferred cross platform development over most other concepts as long as I can remember. Which is one of the reason I never got into .Net. Currently, I use php/javascript/python as my primary languages of choice for web development. Which I also have been using at work. But the need to learn c# has come u...
First, some background. I have an application that requires the use of several external geocoding providers which I don't control. It uses a central service layer inside the application to dispatch to the appropriate provider. I have a number of classes that are arranged in this way: GeocodingService: Responsible for ...
I see an emerging trend in "cloud" computing to move work load to a third-party server and get charged pennies for amount of work done in this way. This could be anything from file hosting to user authentication. So I thought about this for a bit and thought, why can't these services be offered in a peer-to-peer way ...
This question is appropriate only for programs created on the windows platform. If I build a release of my program with the /Zi option (create pdb file and store path to file in exe) then I don’t have to ship pdb file with release but we could retain for internal use. The pdb file would be retained for our internal Qu...
We are running 2 weeks sprints where the team will just barely finish development by the last day of the sprint but cards are not complete because testing is not finished. The definition of done is really "when development is complete" rather than "when the stories are complete." We have a 1 week delay between the la...
In our mostly large applications, we usually have a only few locations for "constants": One class for GUI and internal contstants (Tab Page titles, Group Box titles, calculation factors, enumerations) One class for database tables and columns (this part is generated code) plus readable names for them (manually assigne...
What is better to do in this type of scenario: populate fields or return an object? The situation is like this: I'm doing calculations to find the prices (inc tax, ex tax, discounted etc) of a product. Is there any advice or are there any guidelines on how to handle a return value? Populate fields: public class Product...
I am in the process of adding unit testing to a project I am working on at work and a suggestion came up that I should use VMs to populate the database with good data. This was suggested as an alternative to what I usually do which is use yaml fixture file to load the data. While I think that using a VM for the unit ...
I'm thinking of how we do JVM memory monitor in a low overhead way in production environment even under busy hour. Suppose I have two tomcat app server in production, load balance set up behind them. If I can see the jvm memory statistics I can tell load balance to stop sending the request to the server which will enco...
I have a .NET library, with some WebControls. These webControls have Embed Resources. And we declare them like it, in all webcontrols for each cs file: Something like this: [assembly: WebResource("IO.Css.MyCSS.css", "text/css")] namespace MyNamespace.MyClass { [ParseChildren(true)] [Persist...
I want to make a cross platform application, which will also have a website where the desktop applications (Windows, iOS, Linux) will talk to the server and keep the users data in sync. So far the options I see are: Write a native GUI for each of the 3 OS, so I would have 3 GUI codebases (and a single backend system) ...
If I create this method public void foo() And then I create an overloaded version like this public void foo( string bar ) Do we say that the second functions overloads the first, or are both methods equally "overloaded"? This would imply (I think), that there is a base type function, that is being overloaded, by anot...
I want to learn XP, TDD and DDD to improve myself. My problem is I have general ideas of what they are but I don't know which one should I learn first, do I need to learn something before other? Please suggest me which topic should I learn first, second and third.
I know you are thinking (or maybe yelling), "not another question asking where validation belongs in a layered architecture?!?" Well, yes, but hopefully this will be a little bit of a different take on the subject. I am a firm believer that validation takes many forms, is context-based and varies at each level of the ...
I have a team that without a single common language among all of the team members. The team is split across two locations (though the geography isn't the main issue). All team members in each location speak the same language and there are members in both locations that can speak both. I'd like to introduce scrum, but a...
We are about to hire 1-2 new engineers for the software team (consisting of 3 developers, 1 tester). What are the steps to integrate them into the team? My ideas are : read documentation (coding standards, documents in development methodologies we use) get them to read the existing code assign them some simple tasks a...
We have three internal web applications we use at my company. Unfortunately none of my predecessors had the foresight of sharing tables amongst those apps. It has become necessary to share some company data among the three internal web apps. As an example, each of the three websites have a companies table in their resp...
The current sql server database is overloaded and many transactions are failing. The powers that be have a proposed solution to build a separate database to handle/store transactions and then asynchronously insert them into the current system. Specifically persist new transactions to a new database then build routines...
The project I'm currently working on is using Trac, with SVN integration. It's worked great until now. Now, however, we've taken on some additional developers and we're running into issues with branching and merging. Because of this, I think a move to a distributed version control system is in order. The problem is th...
class A { static int foo () {} // ok static int x; // <--- needed to be defined separately in .cpp file }; I don't see a need of having A::x defined separately in a .cpp file (or same file for templates). Why can't be A::x declared and defined at the same time? Has it been forbidden for historical reasons? My main...
For a REST API that I am working on, I want to return JSON in a consistent layout: { "Data" : { "Id" : 123, "Email" : "charlie@somewhere.com" "Firstname" : "Charlie", "Surname" : "Brown", }, "Error" : null } The payload will always contain "Data" and "Error", where one or the other can be null....
When you're kind of fresh with Git (and DVCS in general), and you start exploring history-rewriting changes, you're safe if the repository is only local, but you might run into problems if you work with remotes and try to push such changes. A feature that I'd expect is the ability to enable a "safe mode" which would ba...
We had an assignment for our class where we had to create a Tic-tac-toe game. People like to complicate themselves, so they wrote complex games which included menus. At the end of the game, you had to have the option to play again or quit the program. I used an int variable for that, but I noticed some classmates using...
I have a WCF rest service that will be consumed by multiple clients. The information returned by the client requires me to know who they are, so that I can return information specific to them. Is the best way to approach this type of design to authenticate them and return a token for their session, then pass this toke...
Some programmers recommend logical seperation of layers over physical. For example, given a DL, this means we create a DL namespace not a DL assembly. Benefits include: faster compilation time simpler deployment Faster startup time for your program Less assemblies to reference Im on a small team of 5 devs. We hav...
For CS undergraduate students working on a 2-semester capstone course without any prior exposure to revision control systems, what would be a good one to use? Desirable qualities would be easy to use (ie this should be a tool they can use rather than spend a lot of time fighting it) and still be relevant for subsequen...
Let me begin by first apologizing for the length of the post, but I really wanted to convey as much detail up-front so I don't take your time going back and forth in comments. I am designing an application following a DDD approach and am wondering what guidance I can follow to determine whether an Aggregate Root should...
So, I've been working for a bank for the past 4 years. My main responsibility has been online banking. Over the past year, we've been implementing the scrum methodology. We've also changed to domain driven design. Now, my problem is regarding what management is planning on doing. They want to split the online banking t...
I had an argument yesterday with one of my colleagues. He (a business-analyst, previously a programmer) thinks that he should be aware of the technology used to implement the system, so he can take better design decisions. In my opinion (I am a programmer), an analysis should not be coupled in any way to the technology...
This strategy involves replacing the likes of this: public class Politician { public const int Infidelity = 0; public const int Embezzlement = 1; public const int FlipFlopping = 2; public const int Murder = 3; public const int BabyKissing = 4; public int MostNotableGrievance { get; set; } } Wi...
I understand that the hierarchy, in cppcms for templates, goes skin (topmost, representing a namespace), then view (representing a class) and finally template (representing a function). I want to know when I should use a skin and when I should use a view; would each page be a skin or would it be a skin per application,...
I have a paid Android app that I made by myself this past summer and I've been working on it throughout the year. The app is geared toward a professional niche market (but there are people all around the world who would buy it,) so it's priced highly. It is Mostly C++, some Java Built heavily on Qt (in the C++ code) 1...
I've been working with the Observer pattern in JavaScript using various popular libraries for a number of years (YUI & jQuery). It's often that I need to observe a set of property value changes (e.g. respond only when 2 or more specific values change). Is there a elegant way to 'subscribe' the handler so that it is onl...
I have a rather simple app in .net which uploads images in fixed intervals in an ftp server. The file name is specific. I need to have a web page that refreshes but i want this to happen only when the upload finishes. How i find a way to determine that the upload has finished? And if the solution has to do with renami...
Possible Duplicate: Why are interfaces useful? Like most faculty, my java faculty introduced interface without explaining or even mentioning its practical use. Now I imagine interfaces have a very specific use, but can't seem to find the answer. My question is: a class can directly implement the functions in an inte...
This one I heard when I was recently interviewing a person and asked him why he was looking for a change within an year of joining his previous company. Particularly a company which is known to be in the business of processing high volume transactions, 100s of 1000s of orders flowing through the system every minute etc...
I have a scenario where a local app is used to take snaps using the iphone camera and the local app can send the photo to a web server... Now when the user visits a website or another web app using his iphone, then the website/webapp invokes the local app to do its work. Do security/other restrictions on iphone prevent...
Quite frequently, I use an Adapter-like design to expose different aspects of data objects. For example, in a 3D modelling application I use an object hierarchy to represent the 3d models in the scene. This hierarchy contains lots of internal information and is quite complex to traverse. For exporting the 3D model data...
I need to get a list of valid addresses in 4 or 5 clusters (cities) in both the UK and US. It's to generate sample data for an application that will do geolocation and searching. At the moment I'm generating the addresses more or less randomly, which means I hit postcodes that don't exist and obviously the street and n...