instruction stringlengths 34 19.9k |
|---|
I have developed a habit of writing comments in my code by putting the comments on the same line as the opening brace, after the brace. I've found that this saves vertical space. It also leaves a hint why something was done, but I'm wondering if it's readable for others.
Example:
void DoSomeInterestingImageManipulation... |
We are using ASP.NET MVC 2 with a Controller/View Presentation Layer and Model consisting of A Business Logic Layer, Data Access Layer [Stored Procedures and classes/methods to talk to the stored procedures].
In the business layer and above for most purposes Edit seems to be capable of representing both the creation of... |
In different design books that I read, sometimes big emphasis is put on the number of methods that a class must have (considering an OO language, as java or C# for instance). Often the examples reported in those books are very neat and simple, but rarely they cover a "serious" or complex case.
However the range seems t... |
So, I have this big project, which is in the process of being refactored by me. I am changing a lot of stuff, so there is no chance to get it to compile some time soon. I am living in a special git branch which I named cleanup (which is going to get merged into master eventually, of course).
The problem is, that I/we h... |
I work for a small software company which is responsible for delivering roughly a thousand custom software packages for roughly 100 customers.
We are struggling at tracking the release process. The entire thing is pretty repeatable but, because of the different distribution processes, there are about 2 dozen steps fro... |
I'm in a long debugging task, I need to figure out where to hook up some extra functionality I need.
It's cumbersome work, and I've been debugging 2 whole days, and I'm on my third, but I work in multiple projects, and I'm returning to this after almost a week, and it's been hard to get back to the point I left at, and... |
I know most RoR programmers are testing addicts and I understand the advantages of a large testing suite but when I start testing, I never get such a large suite and I always wonder "Am I testing the right way? Are there really efficient?". I'm often dealing with integration tests testing only the way the application b... |
So I thought I had a perfect use-case for a CLR SQL Procedure. I've search the Net for perhaps a similar example where data is retrieved, records added and updated. I have not looked at a SQL CLR procedure for awhile, but since it was released in 2005 (some 6 years ago!) I would have hoped there were plenty of examples... |
In web development the terms "server" and "client" are often refered to when discussing how pages are requested on the web. It is also used exstensively when talking about PC, phone, tablets, etc. The question that came to my mind was what qualified a computer to be considered a client?
I took a look at this article fr... |
There are a million-and-one file-system structures that go into the myriad of Open Source projects available. Things like modules, language files, domains, third-party libraries, migrations, internationalization, backups, and syslinks to other parts of the system have given rise to many approaches to organize the files... |
Chrome and Firefox have now rapid release cycles. Also Opera is starting to get speed and Internet Explorer should take the high road soon. I am a web developer. What does that mean for me? What consequences does it have for me? Will it be an advantage for my work or another burden?
|
In my current development situation, we have a lot of DLLs, executables, and static libraries. How do you decide what should go into a DLL? What should go into an executable? Why have separate functionality in different executable files? I'm hoping the answer will be concise, but this is a largely opinionated topic it ... |
I heard many people saying that when developing algorithms you should first use pen and paper, flowcharts and what not, so that you can focus on the algorithm itself, not worrying about the implementation of said algorithm (i.e., you deal with one problem at a time).
However, most of the time I find it easier to actual... |
As a new programmer, it has always been hard to create applications, because I am still at the learning stage.
I understand that to achieve a particular affect or function in an application, there will be numerous ways to achieve the same result.
However, should I just purely create a function to it's working state, wh... |
Currently I am working on creating a new database schema as part of a major new product. Our previous customer address records (in a previous product) look something like this in our current schema (not all columns shown):
AddressID, AddressLine1, AddressLine2, City, State. Zip, Country, Etc.
I want to normalize thi... |
Possible Duplicate:
Where did the notion of “one return only” come from?
Which is better? I see pros and cons for both, so I can't really decide on which one to stick to.
Wrap in if clause
function doIt() {
if (successfulCondition) {
whenEverythingGoesWell();
}
}
Pro: Shows programmer's intention thro... |
In a web application that has a significant ajax component, where is the best place for the client-side concurrency responsibility to lie?
We're trying to use MVC on both the server application (LAMP stack) and the client application (ajax, mostly jQuery and unobtrusive js).
On the server-side, our model throws an exce... |
I am fairly new to web-application development. I just can't shake the feeling that it takes me forever to do anything of even remote complexity. In c++ and java I could write the same applications in a matter of hours.
On the web debugging is painful (especially if complex json-ajax) is involved. IDEs suck. The la... |
I need to determine the ranking of values in an array without altering their position, so that I can print the position of each split time next to the actual value of the split time in a table like so.
<table>
<tr>
<th>Split 1</th>
<th>Split 2</th>
<th>Split 3</th>
</tr>
<tr>
<td>4.66 (1)</td>
<td>5.12 (3)</t... |
In many freelancing websites, you see many job ads for PHP (backed by MySQL). However, job ads for .NET, Java, Ruby, etc. are not that much. What are the reasons which make PHP so popular for freelancing? Is it because of its importance? Or is it because PHP is free?
The reason I'm asking this question is that, I'm an ... |
We use Integer type represent index variables most of the time. But in some situations, we're forced to choose
std::vector<int> vec;
....
for(int i = 0; i < vec.size(); ++i)
....
This will cause the compiler to raise the warning that mixed use of signed/unsigned variables. if I make the index variable as for( size_t... |
Curious how other developers feel about this. I come across some pretty nasty sql joins, as we all do I'm sure. I would prefer making more database calls for the sake of readability and simplicity rather than have a large SQL statement to maintain; about 3 - 4 joins. For the performance argument, I will give up a littl... |
I'm a dev at one of the big-name tech companies. I like the job for many reasons:
I do interesting work on a cool product
I solve challenging problems and use a lot of high-level skills (quantitative, creative, writing, presenting)
It pays well
The problem is that I feel I need a more relaxed atmosphere (shorter hour... |
I'd like to build a bitmap during runtime. The bitmap should be scalable on all sides and pixel access should be quiet efficient.
Some illustration http://img546.imageshack.us/img546/4995/maptm.jpg
Between and after the commands shown in the picture, Map.setPixel() and Map.getPixel() should set/return data saved in the... |
I'd want to implement a Real-time chat for my Rails app but I can't really host the server which handles the sockets. I've tried Faye but it needs a server. I've also heard of pusher but it's limited to 20 users at a time on the chat and I can't really be sure they won't be more.
I've thought of IRC but I think I can't... |
During my years of web development with JavaScript, I come to the conclusion that it's an incredible powerful language, and you can do amazing things with it.
It offers a rich set of features, like:
Dynamic typing
First-class functions
Nested functions
Closures
Functions as methods
Functions as Object constructors
Pro... |
Whilst installing Ruby on OsX I noticed I could do so by using a package manager called Homebrew. This seemed like an easy option, so I took it. Everything worked smoothly. Life was good.
Being a curious fellow, I looked into what other benefits having homebrew installed would give me, and in my study found that Homebr... |
I have this weird scenario in which some Java property is used to build and HQL query, and the type of the field is Boolean, i.e. it is boxed. I wondered why because I don't really like to think of booleans as having three possible values, true, false, and null. I recently found out the null value actually has semantic... |
I have currently reading Grails and I love it. In order to get hands on experience with Grails I decided to create a web application for some Management System. Ya as you can guess there are plenty of entities that goes into the domain model for my web application. Any how as a novice in Web development, I just thought... |
I was recently reading The Pragmatic Programmer for the first time and I came across the concept of Tracer Bullets. I realized that I had coded according to this model in the past and just kind of filed the way I was working away in my brain as "agile".
They only give one example of where they had used it in the pas... |
Here at the office our Scrum roles are a bit mixed up, so I would appreciate any advice on how to improve it.
We are a small team of 4 developers (one of which is a de facto scrum master) and we also have a line manager and a Product Owner. The line manager simultaneously embraces Scrum and has a hard time "letting go"... |
I'm putting together a presentation to deliver to some of my teammates (all developers), and I'd like to include a short team building activity that focuses on improving estimation skills. Does anyone have any suggestions or know of any team building activities I could use?
|
In science, intellectual contribution to a project is sufficient for someone to be the author of a document. When writing software documentation, this would imply that almost everyone involved in the software development would be included as co-authors.
Unlike in science, it seems odd to include the names of people who... |
As far as my understanding goes, compilers are meant for developers compiling their code into executable (machine-code) files. Compilers don't extend to a client's machine or end-user system.
Instead, developers just use the compiler to convert their code into machine code, which is then transported to the other machi... |
I work with code, where data is stored/exchanged in Hashtable/Dictionary/Associative-Array-like structures, like this
{
'alpha': None,
'bravo': '',
# 'charlie' is not given
}
there is not much standartization, which field is 'given', and when given, if it may be given as None/Null/Nil or an empty string. As a... |
I am finalizing development of a desktop Java application that communicates with an outside web server, and now I need to start seriously considering deployment.
This application will run on a large touchscreen all-in-one workstation running Windows 7.
It will be located in a public-area and thus must be LOCKED-DOWN Ha... |
I've inherited the code maintenance of a complex web site for a customer that continuously requests enhancements for it. This application took years to develop and I'm facing increased difficulties to enhance it. It's organized but at the same time the .net code is mixed with ajax, javascripts and old school html that ... |
An associative array has many common similar names, hash, keymap, map, table, index.
It's a map of keys and values but I cannot find a reputable definition of the phrase which tells me whether a map has to have order to be an associative array.
What is a reputable definition of the term "Associative array"?
Is an asso... |
I started teaching myself programming half a year ago, and I've noticed I keep using a few basic techniques over and over again, is this the onset of a style or just ignorance of variation?
|
I am writing an application that will use many tables and I've been told that I must not use stored procedures in this project because it will be too slow.
It has been suggested that I use TSQL. I have only used stored procedures until now.
Is using TSQL different? Is this the way to go for faster data access or are th... |
I need to get a e-commerce site up and running, but I really don't want to program it from the bottom up if I don't need to. I want to program it using ASP.NET MVC.
I'm looking for a good open source alternative (or one for purchase if it's modular enough) that I can use as a base and enhance with the needed functions?... |
Ill explain my problem,
I am currently using an in-house install of gitorious using git. I would like to begin testing FogBugz and Kiln from Fog Creek which uses mercurial. I would like to for at a least a short while continue development using both solutions.
Does anyone know of any long term serious effects of havin... |
With popular software out today like Node.js, Celery, Twisted, and others boasting about being asynchronous, what does it mean?
I've gone through the basic Node.js tutorials and written a few Node.js scripts, but still don't feel comfortable with the topic. Please note that I haven't had I had any formal introduction ... |
I recently turned all possible error-messages on with error_reporting(-1);, on my PHP project. Of course, right away I got alot of messages. For example:
Notice: Undefined variable: foo in /.../file.php on line 205
So I started updating my code to get rid of all the notices. Mostly, by adding isset($foo) and making t... |
I'm interested in expanding my knowledge of security issues: things like buffer overflows, format string vulnerabilities, etc. I'd like to be able to go through a language and understand its security implications and pitfalls to get a better understanding of secure coding practices in general.
Are there certain languag... |
What do people in IT consulting firms do?
Ok I can guess they consult, provide answers to questions, but exactly what kind of questions do they answer that it is even possible people will pay enough for them to sustain their company expenses?
|
I am working with a team of 5 persons. We are using SQL Server as our database.
Since long time I want to store the Stored Procedures in SVN so that the versions can be maintained. Is there any tool which can be used as a plugin with SQL Server Management Studio and allows checkin from there.
|
I just got started on some web development, and got my feet wet by creating a basic facebook app using Django. I am thinking of publishing the app, and consequently now need a development app that I could make subsequent changes to and roll them out to the production app. I'm completely new to this, and would be really... |
I can't see the difference between MVC and MVVM clearly. I feel the Command in a ViewModel is just like the Action method in a Controller. And both the Controller and ViewModel will notify the View to refresh itself after modifying the state of the Model through Data Binding. What is the main difference between the two... |
Suppose, I have an idea and I have to put it into code quickly. And then I am presenting it to someone who is not so computer savvy. Which language should I use for quick and dirty coding? And which GUI toolkit should I use so that the the computer semi-literate find it easy to use (read shiny-eye-candy). It is a deskt... |
When you arrive in the morning, you find that your software does not work anymore, even though it did when you left yesterday evening.
What do you do? What do you check first? What do you do to stop being angry and start working on your problem? Do you blame your colleagues and go directly to them? What can be done to ... |
I've been searching for good presentations (slides+audio or video preferred) on Unit Testing but all I seem to find are books and blog posts. The presentation should not be longer than 50 minutes since it will be shown at a brown-bag lunch. General concepts or how to do it on the .NET-platform is what I'm looking for.
... |
I'm in a team of fifteen people and the team is in transition after a few changes of management. The current line of management is pushing for an agile approach to developing software but without providing any lead. The team suffers from a big communication problem both inside and with other departments in the company ... |
I'm developing a desktop application (a File Manager) in C#.
For copy/cut and paste operations I will use the default methods in .NET like
System.IO.File.Copy()
System.IO.File.Move()
Are there any limitations of these methods that I should know about ? and if there are, what are the alternatives of these methods ?... |
Here is an example: early in the morning of the second day of the Sprint (during the stand up) I go to the board and see that the story I worked the previous day (first day of Sprint) contains a big "1 IDEAL DAY" written on it (estimate). Right now (early in the second day of Sprint) the story is not completed and I gu... |
Take a typical Line-of-Business Silverlight applicatioin for example.First,We have a Product table in database,which has fields of ID,Name,Price,etc;
Then, on the server side,we should have a Product Entity class in the Data Access Layer,which has properties of ID,Name,Price,etc;
Then, we should have a Product DTO Cla... |
Background of my working environment
My manager has no background or understanding of computers or software whatsoever. It is highly likely he hasn't seen code in any form (not even from a physical distance of 10 feet or less) in his life.
There is no one who understands the complexity of what I am asked to implement. ... |
I just finished learning the basics on data structures and algorithms using Python and C, completing some of the exercises from the book I read. I feel that it is necessary to implement some of these data structures and algorithms to enhance my understanding about the material that I just learned, such as the red-black... |
In a new project, a friend had to write tests where the time required to write them was calculated by an Excel macro written by his non-developer manager.
In such circumstances, should a developer accept the responsibility to write and run the tests in the calculated time? Are the results of these test trustworthy?
For... |
I am looking for the current, state of the art, coding standards for web development (mostly PHP). Since I do not want to reinvent the wheel I would like to reuse libraries written by people much clever than I am.
I know about OWASP which is a wonderful source of best practices and brilliant information. Their web site... |
It was suggested that I take my project open source due to its size and my lack of skills, so I checked out Google Code, and started making a project and now it's asking me if I want the project to have Git, Mercurial, or Subversion code hosting.
I don't even know what code hosting is, and a search just confused me mor... |
I've been interested in iPhone development since the release of the iPhone, however, I am on a limited personal budget. I've never been willing/able to fork out the money necessary for an iPhone and a Macbook. I know, some may argue that it's not that expensive, but for a hobby it hasn't been worth the price.
By some... |
This question is not about Unit Testing Frameworks.
This question is not about writing Unit Tests.
This question is about where to put the UT code written and how/when/where to compile and run it.
In Working Effectively with Legacy Code, Michael Feathers asserts that
good unit tests ... run fast
and that
A unit... |
I have a rest webservice with an endpoint www.foobar.com/service.svc/MAC (migration authorisation code). Posting and getting to that adds and gets one MAC respectively. I now need to impliment a new enpoint for all MACs. What would that be? www.foobar.com/service.svc/MAC/All seems wrong. What would be correct and why?... |
I know most people hate flat and long functions, and hate when code is not full of ISomethings.
The problem is that I guess my mind works in different way, and I always have problems with that type of code in any non-trivial solution.
So, since most of people enjoy explosive number of functions, can you describe what i... |
I created a private validation method for a certain validation that happens multiple times in my class (I can't store the validated data for various reasons). Now, ReSharper suggests that the function could be made static. I'm a little reluctant to do so due known problems with static methods. It would be a private sta... |
What are some common mistakes/pitfalls, specific to Silverlight development, that developers should avoid?
PS: Please, if you don't have hands on experience with Silverlight and want to simply state that people should just not use it, refrain from doing so.
Thank you for you time and consideration.
Here is a compilatio... |
Off course this doesn't apply to all languages. But I was wondering if some languages only exists due to the market culture of concurrence.
For example, we all know that C is widely used for built in and light weight systems. And, as far as I know, no one bit them.
But how about JAVA, C#, Ruby, PHP, ASP.NET, Python, Pe... |
I am trying to get an idea of what would be a better practice / implementation for the users of an application that I am going to localize.
Which would be better and why?
Read the culture info (preferred language) from the browser.
or
Have a language selection option in the application, commonly
implemented using f... |
I'm currently in discussions with my boss about getting a new pc since my old one is getting ... old...
I am the only "real" developer in the company (it's not a software company) and as such they haven't really bought any pc's with these kind of specs before.
So, I made a list, because building my own, is cheaper than... |
Possible Duplicate:
Open Source but not Free Software (or vice versa)
I recently was at talk were Stallman was the keynote speaker, and he stated he hated the term open software, because it was geared to confuse people.
Now, I have since then read on to understand his stance, but I am unable to draw a line where fr... |
Is there someone who could shed a light on why ambiguous methods are not allowed in ASP.Net MVC?I updated my question just to clarify it (using Carson63000 example from his answer), the question itself remains the same.
So, lets say we have the following action
/article/list/sport
which calls
public ActionResult List... |
When dealing with Azure instances that are under-performing, how do you decide when to scale the instances? Do you scale horizontally by adding more instances or vertically by making the existing instances more powerful?
|
I've written an Integration program that produces files from a source set of data and converts it to a target data file. These files contain field/record information that must be validated by our clients using their validation methods.
I plan to create numerous test cases and expect to receive information on how well t... |
This is sort of a follow-up to my previous question Should we quit trying to do agile if QA takes 12 weeks?
For the second time in as many sprints, we've set a sprint review that is scheduled to feature just a single issue that essentially amounts to an obscure bug fix or at most an esoteric enhancement to some small p... |
I like Haskell, plain and simple. While Haskell is used in production software, it's not especially widely deployed from what I've seen. What is the most similar and still widely used language in regards to production projects so that I might have a snowball's chance of using something similarly awesome in industry?
A... |
Is it a bad sign if users submit bug reports for things that are by design?
Does it typically mean that the application is confusing or unclear, or should I just chalk it up to a one-off user mistake unless specifically stated?
(I don't actually have any such reports. This is a purely hypothetical question about wheth... |
I left a job (to relocate to another country) where I programmed in Javascript and Haskell (some python) most of the time. I really liked it because people were objective, positive, mathematical, and yet got a bunch of stuff done. This was a truly professional shop.
Now I work at an Agile/XP shop. While this is good a... |
Take a look at this link: https://math.stackexchange.com/questions/60766/what-is-the-result-of-infinity-minus-infinity
What is the reason for transforming the symbols ∞ on the client side?
Because if someone disable javascript, this is what they see:
So right now I'm pondering what may be the reasons for that decision... |
Not a trial, but a truly free version that they offer users to download....
I was wondering in case I somehow missed the option on their website. Any version of Visual Studio will do.
If not, are there any open-source alternatives (that have similar functionality, or possibly degraded equivalent) of Visual Studio? I am... |
I've been assigned an in-house web application that is basically an Employee and Project Management System.
I'm getting confused as to where I should really start with this assignment (I mean I'm my own development manager and I really don't have experience with making a project alone) and I'm hoping that you guys coul... |
I am looking for a wiki or wiki-like system for writing and managing specification and documentation for a software project.
I know there are lots of wiki-implementations available, but are there some that are especially well-suited for this kind of task?
Actually it doesn't have to be a wiki, just a system that makes... |
Is it appropriate to store the image files in the database? Or it would be better to store only the path of the file in the database, while keeping the file itself on the server?
Are there any other methods for doing this right?
|
Possible Duplicate:
Interviewing a developer who's skilled in a language you don't know
I must interview people for a C# position we have. I work on the java side of the project, and master it quite well. When I interview for java position, I ask some technical-questions/programming-problems so I can make sure the c... |
I am facing a similar problem as the OP of this question where my environment is good, but I feel like my learning is stagnating and I don't have the ability/resources to change positions/quit my job at this time nor am I sure I would want to if I did have the ability to.
The day before yesterday, I was assigned to hel... |
I'm using SVN. Sometimes I miss something when I write a commit message. But once it's been committed, it cannot be reverted, and even I can't edit the message. Why they didn't put the edit function in it?
|
New to agile and I'm not sure how to start. The idea is to create small parts of the project in sprints. However the project I'm working of requires a database and the database must be almost functional to do anything with the project.
So how do Agile projects handle this, do you start by creating the database?
How wou... |
When you work with ORM which implement UnitOfWork pattern (NHibernate's Session, Entity Framework's ObjectContext, etc.), there are two types of data services methods: those which save/commit changes and those which just modify model properties.
In some time it becomes difficult to support this mess: when you call a me... |
I want to use Windows Workflow to provide a validation service. The validation that will be provided may have multiple tiers with chaining and redirecting to other stages of validation. The application that will generate the data for validation is a Silverlight app.
I imagine the validation will take longer than the b... |
I'm trying to solve a complex bug in our codebase , but the problem seems to be coming from a lot of places to the point that i dont know what to change first .
do you have any procedure or guidelines todo in such a situation ?
|
I've been given the task for creating a performance model for a legacy product. The product is about 10 years old and has never had any performance requirements or performance models before. Generally whats happened in the past is a customer will complain that a particular feature is slow or they are not getting the th... |
I've been programming 8 years for a company. We build business intelligence software systems. Since I thought working is learning, I've always studied in terms of what I was doing at the company while working for 60 hours per week. These days, however, I am looking for a new company for employment, I can see that thoug... |
I have completed a web application which is basically developed in PHP and is just another regular web application. Usually when I deliver the final production release I just handover the code documentation and the architecture information to the client. However, for this particular project the client insists on having... |
Currently I'm in my dream job in a research lab as the only developer in a multidisciplinary team. I'm getting a little bit worried because I'm forgetting about coding in a team (I don't have legacy code, I maintain my own code, I handle my own agenda, etc). Although I try to follow some of the the best practices like ... |
Possible Duplicate:
Weeding out real agile from buzzword agile in an interview
I went for an interview. The company really wants to take me on. However my sticking point is that I have not received clear information on whether they are using Agile and Scrum methodologies.
I have arranged a telephone chat with the co... |
I've seen/used some objects that have a structure like so, designed to let children extend the functionality of functions without having to override them. Is there a name for this pattern?
code example:
class CrudModel {
public function create($data) {
$data = $this->pre_create($data);
//create logic
}
p... |
Is there a valid reason for the browsers to prefix new CSS features, instead of letting the webmasters use the non-prefixed version?
For example, a sample code for the background gradient looks like:
#arbitrary-stops {
/* fallback DIY*/
/* Safari 4-5, Chrome 1-9 */
background: -webkit-gradient(linear, left top, ... |
I am new in a enterprise level application project and discovered that 99% of everything I've seen in code is static methods, static properties.
The application at hand is a distributed app consisting of about a handful of WCF services that communicate through a business layer with a data access layer. The data access ... |
Stroustrup claims that Cfront, the first C++ compiler, was written in C++ (Stroustrup FAQ).
However, how is it even possible that the first C++ compiler be written in C++?
The code that makes up the compiler needs to be compiled too, and thus the first C++ compiler couldn't have been written in C++, could it?
|
The Open Source Initiative lists 9 different licenses in their list of "License that are popular and widely used or with strong communities".
I want to license my project as open-source. Unfortunately, I do not speak legalese. Is there some chart I could consult that will help me make the right choice, or at least poin... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.