Hi I'm Looking For a tool that help me to extract all strings of my code files to Resource File. I Used Coderush and Microsoft add on(resourcerefactoring.codeplex.com) for working with Resource files. but i had to extract strings to resources one by one.
Is there any better option?
...
Hello all,
I have some relatively large legacy method that I would like to refactor. It fits "Bulleted method" type as specified in Michael Feathers' "Working Effectively With Legacy Code" and thus it could be split in several sequential methods in rather straight-forward way . But each of its sequential steps outputs some log message a...
Has anyone of you done evaluation of a django project and how to improve/refactor it's code base? A pet project in company I work at is becoming more widely used and it would be good to improve its quality before further development. Are there any techniques or methodologies of analyzing django projects before we start putting more and m...
I have a simple ViewModel class like
public class TestViewModel
{
public String Information { get; set; }
}
My View inherits from it and I got Intellisense kicking in. So far so good.
I have written these for tests in the View:
<%= Html.Encode(Model.Information) %>
-- <%= Html.Label("Information") %>
-- <%= Html.LabelFor(m => m....
I'm using the Resharper trial and VS2008. Is it possible to extract all classes from one file into a separate file? I'm able to do this using Resharper but it only seems to work for individual classes. This is to be used on a file that was auto-generated that is 65,000 lines long.
...
I just wrote this piece of code but I'm not quite happy about it.
data = {}
options.each{ |k,v| data.merge!({k.to_s => v}) }
Basically I have:
{:a => "something", :b => "something else", :c => "blah"}
... and I want ...
{"a" => "something", "b" => "something else", "c" => "blah"}
... in order to send it to a gem that do not hand...
I have been hearing a lot about Project Euler so I thought I solve one of the problems in C#. The problem as stated on the website is as follows:
If we list all the natural numbers
below 10 that are multiples of 3 or 5,
we get 3, 5, 6 and 9. The sum of these
multiples is 23.
Find the sum of all the multiples of 3
or 5 be...
Sorry, I am pretty much an SQL noob. This has to work in MSFT SQL, Oracle as well as Sybase. In the following snippet I need to change an inner join between IJ and KL on IJ.PO_id = KL.PO_id into a left join also on IJ.PO_id = KL.PO_id. So, I believe I have to re-factor this. Well, implicit joins are not the most readable, at least in my ...
Hello everyone!
I have inherited a project that has an awkwardly big interface declared (lets call it IDataProvider). There are methods for all aspects of the application bunched up inside the file. Not that it's a huge problem but i'd rather have them split into smaller files with descriptive name. To refactor the interface and break i...
This seems like it should be fairly straight-forward, but I can't see anything obvious. What I basically want to do it to point at a method and refactor->extract class. This would take the method in question to a new class with that method as top level public API. The refactoring would also drag any required methods and variables alon...
I am currently refactoring some old code. I am looking for directions on the best design pattern to use here.
I am thinking of the factory pattern but I am not sure if that's the best way to go or not.
So here is a brief outline of the pseudocode. Class Foo has the core business logic in it.
Class Foo{
private List<Things> stuff;...
Our core domain so far has an abstraction called PersonName with methods for firstName, lastName, middleInitial etc. As we are expanding the domain to Spain, we figured that they only talk in terms of name, firstSurname and secondSurname i.e. middleInitial etc have no significance to them.
The PersonName interface is currently being use...
I face a situation where we have many very long methods, 1000 lines or more.
To give you some more detail, we have a list of incoming high level commands, and each generates results in a longer (sometime huge) list of lower level commands. There's a factory creating an instance of a class for each incoming command. Each class has a proc...
I have something like the following in the header
class MsgBase
{
public:
unsigned int getMsgType() const { return type_; }
...
private:
enum Types { MSG_DERIVED_1, MSG_DERIVED_2, ... MSG_DERIVED_N };
unsigned int type_;
...
};
class MsgDerived1 : public MsgBase { ... };
class MsgDerived2 : public MsgBase { ... ...
Hello everybody,
I have an old personal project written in Java 1.4 that I am porting to 1.5 (in which I am a still newbie) for version 2. Besides adding new features to it and refactoring code, I am also migrating to generic collections, annotations etc.
There is a particular piece of code that I don't know how to change to 1.5 and do...
So I was writing a mergesort in C# as an exercise and although it worked, looking back at the code, there was room for improvement.
Basically, the second part of the algorithm requires a routine to merge two sorted lists.
Here is my way too long implementation that could use some refactoring:
private static List<int> MergeSortedList...
Having 2 different interfaces is a must.
How would you refactor this?
Should I refactor this code at all?
private void CreateInstanceForProviderA()
{
a = FactorySingleton.Instance.CreateInstanceA("A");
if (a == null)
{
ShowProviderNotInstanciatedMessage();
return;
}
a.Owner = Handle.ToInt32();
...
I just came across an error when using NetBeans, and I wanted to post my findings (possible this is old news). Perhaps this will save some people the headache of debugging a similar problem that I just encountered. I don't think I'm abusing anything here... stack overflow's SEO is pretty good :)
I refactored a class in NetBeans (JavaFX ...
I was trying to create this helper function in C# that returns the first n prime numbers. I decided to store the numbers in a dictionary in the <int,bool> format. The key is the number in question and the bool represents whether the int is a prime or not. There are a ton of resources out there calculating/generating the prime numbers(SO ...
Hi All,
I have a WinForm and few properties that are set on it.
for example : Name,Address are accepted on the Form.
(many more properties in actual example)
The current implementation is somewhat similar to
frmName frmView = new frmName (); //frmName is WINFORM
frmView.Name= "ABC"; //any valid string or read this from file
frmV...