code-review

How can this verbose, unpythonic routine be improved?

Is there a more pythonic way of doing this? I am trying to find the eight neighbours of an integer coordinate lying within an extent. I am interested in reducing its verbosity without sacrificing execution speed. def fringe8((px, py), (x1, y1, x2, y2)): f = [(px - 1, py - 1), (px - 1, py), (px - 1, py + 1), ...

Can someone code review my small SDL app? Want to make sure I didn't make any beginner mistakes

In an effort to teach myself the SDL library (hence my stack overflow handle :) ) I wanted to try my hand at a side-scroller. My code is complete but I want some feedback (mostly because I have an atrocious amount of if and else statements for what seems like some simple logic). My "program" is a c++ side-scroller where you move a singl...

PyQt threads and signals - how to properly retrieve values

Using Python 2.5 and PyQt 4.4.3, I couldn't find any question this specific in Python, so sorry if I'm repeating the other Qt referenced questions below, but I couldn't easily understand that C code. I've got two classes, a GUI and a thread, and I'm trying to get return values from the thread. I've used the link in here as base to write...

How do I know if I'm being truly clever and not just "clever"?

If there's one thing I've learned from programming is that there are clever solutions to problems, and then there are "clever" solutions to problems. One is an intelligent solution to a difficult problem that results in improved efficiency and a better way to to do something and the other will wind up on The Daily WTF, and result in head...

Searching for empty methods

I am currently working on a security audit/code review of our system. This requires me to check all pages in the system and make sure that the code behind contains two methods that are used to check security. Sometimes the code in these methods get commented out to make testing easier. So, my question is does anyone know an easy way...

git workflow with review

I am in the process of implementing a review process for my small team (3 members). We are using git, and the model we want to use is integrator with blessed repository. Every developer has a public repo, and the integrator pulls the commits to include into the blessed repo. I see several alternatives for including reviews in this new ...

LINQ to SQL: NOTing a prebuilt expression

I'm building a library of functions for one of my core L2S classes, all of which return a bool to allow checking for certain situations. Example: Expression<Func<Account, bool>> IsSomethingX = a => a.AccountSupplementary != null && a.AccountSupplementary.SomethingXFlag != null && a.AccountSupplementary.Something...

Are there any code critique sites or similar resources?

I have noticed when people post example code illustrating some issue that they are having often they will gather a number of comments addressing the quality of the code they presented and not the actual problem asked. This is very helpful--if not well directed. Often, this is wasted effort since the asker is not receptive and the code ...

C# Code Smells. What are the most common and how to fix them?

Possible Duplicates: What are Code Smells? What is the best way to correct them? Entity Framework Code Smells Question Common programming mistakes for .NET developers to avoid? Possible Duplicates: What are Code Smells? What is the best way to correct them? Is global:: a bad code smell in C#? One thing I'd lik...

Cyclomatic Complexity vs project health

I have done the code analysis for my project using VS2010. Here is my results, Maintainability Index - 75% Cyclomatic Complexity - 213 Depth of Inheritance - 7 Class Coupling - 98 Lines of Code - 747 can any body, please explain about my project health. is it doing good, bad or average? How can we interpret these results? ...

Best way to simplify this code, more efficient

My question is, is there a way to make this code more efficient or write it in a simple way? javascript by the way. switch (tempvar1) { case 1: currentSlide = 'slide1'; showaslide('ppslide1'); break; case 2: currentSlide = 'slide2'; showaslide('ppslide2'); break; case 3: currentSlide = 'slide3'; sho...

Are there any code review tools that are easy to install?

I have solaris servers I tried to look throught the open source code review tools seens like most are quite hard to install is there any easy to install code review tools? ...

A tool for finding duplicate code in PHP

Are there any tools available that can scan multiple .php files and report back duplicated lines/chunks of code? It doesn't have to be really smart but basically give me a starting point for manual scans to improve the codebase of some of my apps. ...

Configure Code collaborator to assign reviewrs as per ownership

In our team it has been proposed to mandate the checkins to be reviewd by respective feature/class owners(Assuming the owners are the ones who checked in the file first) Can Code collaborator be configured such that on raising code review request respective class owners are added as reviewers by default ...

When to give in and start The Big Rewrite?

I've had my share of projects where the first thing I think is: "This code sucks; let's just rewrite it in framework X." Everybody feels the urge at some point. In fact, I think I've had the urge to rewrite pretty much every project I've ever been on. However, it is accepted wisdom that a total rewrite is generally a bad idea. The quest...

Could I be writing this code better?

Is there any website out there somewhere where a programmer such as myself might be able to post pieces of code to be looked at by more experienced people? I am thinking of something that programmers could use to have advice given on how to improve their ability. I really like the atmosphere here, but am not sure that posting code for ...

how to get SOURCE

i do some development with jena ontology API.my ontology file in my local machine..when i'm going to read the model.. there is an error.. and i made ontology with protege and tried to read that file. String SOURCE = "http://www.owl-ontologies.com/Ontology1275995702";(it's XML:base value) //String NS = SOURCE + "#"; //Inp...

Problem in arranging contents of Class in JAVA

Hi, I have some classes and I'm trying to fill the objects of this class. Here is what i've tried. (Question is at the below) public class Team { private String clubName; private String preName; private ArrayList<String> branches; public Team(String clubName, String preName) { this.clubName = clubName; ...

Details to log when starting an application

To help support and anyone who may use one of my applications I tend to log a few things during the application startup. Currently I log: Start Time App Name App Author App Version App Classpath Current working directory Java vendor Java version Max heap size Taking into consideration this application may be used / supported by a wh...

Review Board extension for mercurial not working on a Windows machine

I have installed mercurial and review board extension for mercurial on my Windows XP machine. In review board, I have added a repository say "MyRepo" which is on a central server. I cloned "MyRepo" to my local machine, modified a file for testing and committed to my local repo. I haven't yet pushed it to my central repo. Now I run "hg p...