code-review

Is there a support tool to make the code review task more interesting?

I'm so bored with the way I have to open my colleague's changesets and right click on a specific file and select "compare with previous/latest version" - only here will I reach the compare dialog ! I want this dialog as a side-by-side pane when viewing the changeset so that I can see quickly what changes my colleagues have made to the f...

Looking for an ebook about Code Review specifically for .net applications?

Hi all. I'm looking for an ebook about Code Review specifically for .net applications. Any Suggestions? ...

How to check Stored Procedures update result on C#

Looking on some source code I've inherited, there's a snippet of code that calls a SQL stored procedure making an Update. The stored procedure returns -1 in case something goes wrong: IF @@Error <> 0 BEGIN ROLLBACK TRAN SELECT -1 RETURN END COMMIT TRAN SELECT 0 The C# code is something like this: ...

How can I clean up this code?

I want to make my code look cleaner and 'express its intent' more.. The following method is reflecting over two types and checking that if there is a property in one type, then there is a corresponding property of the same name in the other type. If there is then it sets the value of the property to the index variable. otherwise it thro...

Zend code standard, how I can check it?

What's the best way to check zend code standard? I'm thinking the PHPCS (PHP Code Sniffer) not efficiently because it not complain about php doc and many other things :( Doc: http://framework.zend.com/manual/en/coding-standard.html ...

How should I approach code review from the public?

I'm currently working on a GAE CMS project and one thing that's been troubling me quite a bit each time I trying something new it's the fear of "I'm a doing this right". What I'm looking for is idea/links of getting my code review by the public. I've found one site Refactormycode.com that I like. But from what I've seen soo far it's mo...

Fastest way to convert an iterator to a list

Having an iterator object, is there something faster, better or more correct than a list comprehension to get a list of the objects returned by the iterator? user_list = [user for user in user_iterator] ...

Are You A Prime Number

I've been interested in the problem of finding a better prime number recognizer for years. I realize this is a huge area of academic research and study - my interest in this is really just for fun. Here was my first attempt at a possible solution, in C (below). My question is, can you suggest an improvement (without citing some other...

The Cost of SQRT in C

How do you determine what the cycle cost is for a given C library function? Specifically, how expensive is it to call sqrt()? I should clarify here, I'm just looking for a general idea of the cost associated with calling certain C library functions. I'm assuming that professional C programmers just have a basic idea of function cost f...

How to diff all changes by an author in an SVN branch?

Hi. As part of a code review, I need to review all the changes made by a single person to an svn branch. Is there a single command that can do this? Or will I have to just go through each revision marked with their name one by one. ...

PHP HTTP Post to REST Service not updating database

Hi guys, I have this curl request below, which was successfully troubleshooted in another post. Right now, my PHP seems to work through this code without any errors, moves onto the next part of the IF statement and sends the confirmation email. It just doesn't update the database as it should from the web service. I will have to email ...

How does a lone developer code review?

I've had an epic google on this topic and also looked long and hard through the suggested answers to this quandary so please I just want some concrete advice if such exists. Here's my situation. I work as the sole developer at a very small company, my boss used to hack a bit of classic ASP but no longer uses and thus has lost most of his...

Should I insist that we perform code reviews before merging back to trunk or am I just a code quality bitch?

I'm working in a small development time with very limited time for development. We develop a tool that is important for the result of our work, but not used daily. I am the only person in the team that has a background as a programmer. My problem is that I have been pushing for code reviews before merging back to trunk for over a year. ...

Mark Parameters as Final in Java?

Possible Duplicate: Do you finalize local variables and method parameters in Java? In its default warnings, PMD is telling me to mark all of my method parameters with final. This seems to be obvious and redundant. Should my code be littered with the final keyword? Why? ...

How can this IF statement code snippet be Refactored?

I've read a lot of Refactoring literature as of late and a common theme I see in examples is the reduction of lots of IF statements. The below is a very simple code block that first checks to see if an email address is supplied and if so, then proceeds to validate the email address. I typically see a lot of this type of code which always...

How to review a web app for quality?

I'll soon have to review a bolt-on to our existing site, which has been written by an outside developer. While I've been made to squirm over my own code before now, and I've reviewed individual methods or classes, I've never been faced with reviewing what's essentially an entire application. I need to cover both code quality and UI quali...

Programming question --

What would be the best solution for this problem?? if we have a question say by the pythagoran theorem. x^2+ y^2 = c then according to that if we are given the value of c, what shall be the best way to deal and find the values of x and y? x and y can be negative. Also, suppose c=0 then x=0 and y=0. Moreover, if we have c=1 then we hav...

Optimum algorithm to calculate pythagorean triplet

I have a question for everyone. I have this problem statement where in given, x^2 + y^2 = c is the equation, you have to optimally find the tuples (x,y) such that the equation holds true. Given a variable c, whose value is known, you have to find the values (x,y). So suppose if you have c=0, then x=0 and y=0. Suppose you have c=2, then...

dominator code to be reviewed in Java/C++

Dominator is a value which occurs on more than half positions in an array. For instance in the array: [3, 4, 3, 2, 3, -1, 3, 3] 5/8 > 0.5 The value 3 occurs in 5 out of 8 positions. , so 3 is a dominator: In this array the dominator occurs on indexes : 0, 2, 4, 6 , 7. Write a function int dominator(int[] A); that given an array return...

algorithm to find complementary solution to this problem

I had this coding question in an interview.I couldnt find an optimum solution to this. what I did was, for(i=0;i<n;i++) for(j=i;j<n;j++) if(a[i]+a[j]==k) print a[i], a[j] But that would give rise to a O(n2) complexity. Is there a better way to solve this?? Array A contains n integers. A pair (i,j) of indexes of the array A is called ...