Forgive me for yet another question on Python decorators. I did read through many of them, but I wonder what the best solution to the specific following problem is.
I have written several functions that do some form of gradient descent in numpy/scipy. Given a matrix X, I try to iteratively minimize some distance, d(X, AS), as functions ...
Hi,
I'm trying to refactor aspectJ code in order to avoid collision with other jars.
I took the source code from the eclipse CVS and refactored all the source code (including build scripts etc.), but it seems that I need to refactor the eclipse plugin jars as well (which I'm not sure I need at all)
Can anyone recommend a good way of re...
Let's say I have a static method called Logger.log(), which calls another static method, CurrentUser.getName(), to get some additional information to log:
public static void log(text) {
String[] itemsToLog = { text, todaysDate, ipAddress, CurrentUser.getName() };
Now obviously this isn't an ideal situation, especially with the stati...
Perhaps I am limited by my experience with dynamic languages (Ruby on Netbeans and Groovy on Eclipse), but it seems to me that the nature of dynamic languages makes it impossible to refactor (renaming methods, classes, pushing-up, pulling-down, etc.) automatically.
Is it possible to refactor AUTOMATICALLY in any dynamic language (with a...
Possible Duplicates:
How to convince my boss to do refactoring?
How can I convince skeptical management and colleagues to allow refactoring of awful code?
How do you justify Refactoring work to your penny-pinching boss?
I have been an independent software contractor for a couple years now, straight out of university. The c...
I have the methods:
public MyReturnType MyMethod(Class1 arg)
{
//implementation
}
public MyReturnType MyMethod(Class2 arg)
{
//implementation
}
//...
public MyReturnType MyMethod(ClassN arg)
{
//implementation
}
decimal, string, DateTime in [Class1, ... , ClassN]
and one common method:
public MyReturnType MyMethod(object obj)
{...
How do you organize your Matlab code? I've come into ownership of several thousand lines of Matlab code, some as >900 line functions and a few directories full of function_name.m files. It's hard to figure out what everything is doing (or relating to) or figure out the dependencies. I'd like to reorganize things as I figure out what d...
Hi,
I am currently trying to fix a few weaknesses in our code base by introducing the use of smart pointers. The code base is very large, and interlinked like a spider who's had one to many coffee's.
I was wondering if people had tried the before and what their approach was.
My first step has been to typedef classes, as follows.
#ifn...
I haven't counted but its a lot. How do i refacter a 100 function class?
This is for a website, i use to have a PageView, Backend, DB layer where PageView calls the backend, every backend public function checks if the user meets the required authority then calls the DB or any other code. It wasnt as nice as it may sound, each of them ha...
So I made a mistake.
When originally writing a signature for an API, I created something like this:
public JellyBeanResult getJellyBeanReport();
Now, it turns out that I would like to re-use the more specific JellyBeanResult object because of its functionality, but it would be confusing to have other functions return a type named for...
I have several interfaces and classes that i have in my business layer project and i want to move them into a brand new project. I am using Resharper 4.5.2. Is there any way I can do that easily and with no pain? I know about the move type functionality, but it seems like it will only do it within the same project.
Any help would be ...
Hi
My routes are getting out of hand due to the fact that this isn't possible (correct me if I'm wrong):
map.resources :english_pages, :as => :english, :spanish_pages, :as => :spanish do |article|
Due to nested routes things are spiralling out of control (tidiness).
map.resources :english_pages, :as => :english, :member => {:manage ...
There seems to be some debate over refactoring to utilize java generics within my current team. The question I have is what are the current industry standards in terms of refactoring older Java code to take advantage of some of these features? Of course by industry standards I am referring to best practices. A link to a book or a site...
I've just inherited a project, and been told that an entire folder, "includes/" needs to be removed due to licensing issues -- We don't have the right to redistribute the files in that folder, so we need to cut our dependencies on them, and fix whatever breaks. I've been told "Less than 5% of the lines in that folder are ever even called...
Hi guys,
I don't know how to use the "T" and I never understood it quite well, but I'm sure that the answer will reside in anything around it ...
I have a huge switch that all it does is apply an Attribute to an object and add the control to a collection, kind of Extract > Apply Attribute > Add, like:
1st switch
foreach (AdwizaContr...
Hi all,
My application uses an int as id to identify objects in both in-memory and persistent registry. Functions in the application receive the id as argument, retrieve the object from the registry and do their job, e.g.
void print( int id, int bar, double zip, int boo )
{
Object *obj = get_obj_by_id( id );
obj->print( bar, z...
Hello,
In an example I am having this structure (small example):
<table id=example>
<tr class="blah test example"><td>Test1</td><td><a href="url">LINK</a>Test11</td></tr>
<tr class="blah test example"><td>Test2</td><td><a href="url">LINK</a>Test22</td></tr>
<tr class="blah test example"><td>Test3</td><td><a href="url">LINK</a>Test33</td...
I inherited some large batch files, and I'd like to rewrite them to a more "developer friendly" language.
I'd like to find out the following things:
what other scripts it calls
what other processes it starts
what files does it write to
what environment variables it uses, which ones does it set
For the last point, I'm aware I can do...
Hi,
I have a method for validation that has many conditional statements. Basically it goes
If Check1 = false
return false
If Check2 = false
return false
etc
FxCop complains that the cyclomatic complexity is too high. I know that it is not best practice to have return statements in the middle of functions, but at the same time...
Hi
I wondered if there's some way to do this
polymorphic_path([@page, @image])
but like this
polymorphic_path([@page, :image_id => 1])
It's for the purposed of refactoring where I'd like to throw various params into the array and where they're null, they're ignored, but otherwise they generate the relevant nested url.
Thanks in ...