I have several MS Access queries (in views and stored procedures) that I am converting to SQL Server 2000 (T-SQL). Due to Access's limitations regarding sub-queries, and or the limitations of the original developer, many views have been created that function only as sub-queries for other views.
I don't have a clear business requirement...
I have a following method
private void SetProcessDocumentStatus(string status)
{
var setStatusWith = new Action<string>(
statusValue => processDocumentStatusLabel.Text = statusValue);
if (processDocumentStatusLabel.InvokeRequired)
processDocumentStatusLabel.Invoke(
(MethodI...
I am trying to refactor some Entity Framework code where I have a Products entity and related entities for the Product's series, family, brand, etc. The series, family, and brand entities all have the same basic structure with an Id and Text property.
The two methods below are very similar and should be able to be refactored to a sin...
So you've got some legacy code lying Python around in a fairly hefty project. How can you find and delete dead functions?
I've seen these two references: Find unused code and Tool to find unused functions in php project, but they seem C# and PHP specific, respectively.
Is there a Python tool that'll help you find functions that aren't ...
UPDATED I've updated the example to better illustrate my problem. I realised it was missing one specific point - namely the fact that the CreateLabel() method always takes a label type so the factory can decide what type of label to create. Thing is, it might need to obtain more or less information depending on what type of label it wa...
Just speaking to a colleague of mine. He was walking with a hop in his step, on the way to the coffee machine.
I asked him "what's with the 'swarmy' walk?", he said, "I just reduced a two hour long query down to 40 seconds! It feels so good".
He altered a stored procedure, that was using cursors and introduced a temp table, that was re...
I use vim as my editor but I would like to get some of the same power of the IDE's for java when it comes to refactoring. Are there any commandline tools for refactoring java? I could probably hack something together using perl or vim scripting but if there is something already out there I'd rather use that.
...
Hi,
I tried the above but when I attempted to rebuild I received errors as the compiler couldn't find the dataset by it's old name.
I know it might be lazy, but I'm used to being able to rename an item in it's properties window and have the refactoring happen silently behind the scenes for me. Is there a way I can do the same thing w...
Hi,
I make very heavy use of the Java code refactoring tools provided by Eclipse (extract interface, rename method, etc.). Does anyone knows of other similar tools (preferably Eclipse plugins) that can perform Java code refactorings that are not available in Eclipse by default, or that can perform the same refactorings better?
I'm awar...
In my department, we are currently using ReSharper 4.0 and deciding whether to upgrade to 4.5 upon its release next week. I personally am a huge fan of ReSharper however a number of my colleagues have pointed out that they have been using a plug in from DevExpress called Refactor Pro that performs similar functionality.
http://www.devex...
Hi All,
A common idiom that my camp uses in rails is as follows:
def right_things(all_things, value)
things = []
for thing in all_things
things << thing if thing.attribute == value
end
return things
end
how can I make this better/faster/stronger?
thx
-C
...
In fairly large Ruby application, we have a situation where a given object is identified by a couple of things: name and id, say. Each of these value types serves a somewhat different purpose and so are not exactly equivalent (id and name persist in different places). So we wind-up with a variety of values being passed around the applica...
For about a few months i'm programming ASP C#. I always program a lot code in the events and in the load event i check the querystring for valid data. This is some sample code i have in one of my projects:
protected void Page_Load(object sender, EventArgs e)
{
if (Controller.Manual == null)
{
Response.Redirect("login.asp...
When I use the option : Organize Usings -> Remove and sort from Visual Studio 2008 I would like to clear all unused references but to keep some like System; Is there an option I can set to do that ?
...
I'm in the process of reviewing a code base (~20K LOC) and trying to determine how to migrating it from 1.4.2 to 5. Obviously, it's not an overnight project and the suggestion which I have received is to write new code against Java 5 and migrate the old code in a piece-meal fashion. Also, I'm no expert in the new features in Java 5 (i.e....
I'm working on some classes that get part of their configuration from global variables, e.g.
class MyClass {
public void MyClass(Hashtable<String, String> params) {
this.foo = GlobalClass.GLOBALVAR.get("foo");
this.bar = GlobalClass.GLOBALVAR.get("bar");
this.params = params;
}
}
This is bad for a coupl...
I've got a DataGridView using a DataTable as it's DataSource. I'm allowing the user to alter the visibility, order (and width though that's not relevant to this question) of the DataGridView columns, but not the underlying DataTable. This means I don't have to recreate the DataTable every time the user makes a change to the view.
The us...
I am programming in Java in Eclipse. I was wondering if there is a way to search for all non final static variables in my code base.
For example:
private static int MY_VAR = 0;
But not:
public static final int MY_CONSTANT = 1;
...
I'm trying to get my head around TDD methodology and have run into - what I think is - a chicken-and-egg problem: what to do if a bug fix involves the changing of a method's signature.
Consider the following method signature:
string RemoveTokenFromString (string delimited, string token)
As the name suggests, this method removes all ...
I have two methods that basically converts underlying checkboxes' text or tag as CSV strings.
These two methods
GetSelectedTextAsCsv()
GetTagAsCsv()
differ only by which property to extract value from SelectedCheckBoxes, which is of type IList<CheckBox>
public string GetSelectedTextAsCsv()
{
var buffer = new StringB...