Daily Archives

Articles indexed Friday May 28 2010

Page 23/107 | < Previous Page | 19 20 21 22 23 24 25 26 27 28 29 30  | Next Page >

  • How to restrain one's self from the overwhelming urge to rewrite everything?

    - by Scott Saad
    Setup Have you ever had the experience of going into a piece of code to make a seemingly simple change and then realizing that you've just stepped into a wasteland that deserves some serious attention? This usually gets followed up with an official FREAK OUT moment, where the overwhelming feeling of rewriting everything in sight starts to creep up. It's important to note that this bad code does not necessarily come from others as it may indeed be something we've written or contributed to in the past. Problem It's obvious that there is some serious code rot, horrible architecture, etc. that needs to be dealt with. The real problem, as it relates to this question, is that it's not the right time to rewrite the code. There could be many reasons for this: Currently in the middle of a release cycle, therefore any changes should be minimal. It's 2:00 AM in the morning, and the brain is starting to shut down. It could have seemingly adverse affects on the schedule. The rabbit hole could go much deeper than our eyes are able to see at this time. etc... Question So how should we balance the duty of continuously improving the code, while also being a responsible developer? How do we refrain from contributing to the broken window theory, while also being aware of actions and the potential recklessness they may cause? Update Great answers! For the most part, there seems to be two schools of thought: Don't resist the urge as it's a good one to have. Don't give in to the temptation as it will burn you to the ground. It would be interesting to know if more people feel any balance exists.

    Read the article

  • Flash uploader that can handle >2GB files?

    - by Alvin SMith
    Is there an open source Flash uploader that can handle files larger than 2 GB? ASP.net implementations like SlickUpload are not an option, and SWFUpload (and others that I've seen) do not handle files larger than 2 GB. Nor is requiring the user to have Java installed to run applets. This would be for both IE and Firefox. I've seen a couple "large file transfer" sites that have a Flash uploader and claim to go past the 2GB limit (which is the limit for http uploads for most browsers) so I know it is technically possible.

    Read the article

  • Issue in exec method

    - by mukul sharma
    Hi all, I am a having two python files file1.py and file2.py. I am using exec() to get the method/Variables defined in the file2.py. file1.py have a class as given below class one: def init(self): self.HOOK = None exec(file2.py) self.HOOK = Generate ### call the hook method #### self.HOOK() file2.py looks like as (There is no class define in file2.py) def Generate() do 1 do 2 Hello() def hello() print "hello" Now the problem is as When i run script it is giving a error global name Hello not found. If i remove Hello() from Generate method in file2.py then its work fine. I cant use import file2.py in file1.py,because in file2.py the only one method name (Generate) is fix (its taken as requirement). So apart from Genarate method user can define any method and can call this in generate method, because this approach is not working so i have to write whole code into generate method only and code is also repetitive. Any help is really appreciable...

    Read the article

  • How to keep plug-in manifest version and pom version in sync in Maven with Tycho

    - by abhin4v
    I am using Maven with Tycho to build an eclipse plugin. Tycho generates the pom.xml file for Maven by inspecting the manifest file of the plugin. Now both the manifest file and the pom file have the version of the plugin and they need to be kept in sync manually. This is because I have done some customization in the generated pom file and cannot overwrite it every time I change the version in the manifest. My question here is, is there a way to keep these versions in sync automatically using Tycho?

    Read the article

  • XSD generation from a MS SQL database using schemas

    - by madprog
    I'm willing to use NDbUnit on a MS SQL database which uses schemas. I have to generate the XSD schema from the database. Visual Studio has a tool to do that, but Visual Studio 2005 doesn't include the schema information in the generated XSD. Therefore, NDbUnit fails because the generated SQL queries do not match the database. Worse, when I try to use Proteus, the XSD schema doesn't validate against the database, and Proteus fails with a warning telling that data could be lost if this check was skipped. So, my question is: is there any tool that would generate my XSD schema properly and from the database information?

    Read the article

  • UINavigationController from UIViewController

    - by 4thSpace
    I currently have this workflow in a tab based app: Tab1 loads... ViewOne : UIViewController >> PickerView : UIViewController >> DetailView : UIViewController "" means loads based on user action. I'd like navigation bars on PickerView and DetailView. PickerView just needs a cancel button in the top left of its nav bar. DetailView needs the normal navbar back button. I already have PickerView's nav bar wired up through IB and working. I'm not sure what to do with PickerView's nav bar. PickerView is also loaded from Tab2, who's main view starts as a UINavigationController. PickerView's nav bar works fine in that case. ViewOne should not have a navigation bar. Any ideas?

    Read the article

  • Most precise way to calculate server response time.

    - by Quintin Par
    What's the most precise way to calculate the time taken by my server to execute a HTTP request. I don’t want to know the DNS resolution or the traceroute time, but just the server execution time. The is a follow up to my previous question to detect whats causing the delay between entering a domain name and load of the page

    Read the article

  • Cannot 301 redirect with IIS URL Rewrite Module

    - by Justin
    I am trying to troubleshoot my issue with the URL Rewrite Module on IIS 7. I migrated a Wordpress blog over to BlogEngine.net. There were only about 5 entries that I wanted to use 301 redirects to the new blog, so I wanted to simply create 5 exact match redirect rules using the rewrite module. For some reason the exact match rule never seems to take effect, I always get a 404 error when the original url is navigated to. I verified that my exact match pattern matched the existing backlinks and it does. I then tried a simple test and got the same behavior, no redirection. I created a page, test.html, on my site, I then created a second page, test2.html. So my exact match pattern is: "http://www.mydomain.com/test.html" And the rule is supposed to do a 301 redirect to "http://www.mydomain.com/test2.html " The redirect never happens. I created the steps for the rule based on the instructions in this page: http://learn.iis.net/page.aspx/461/creating-rewrite-rules-for-the-url-rewrite-module/ I don't see that I left out a step. After I apply the rule I've even gone as far as doing an IISReset to make sure it would be in effect but still no luck. Any thoughts on what I might have left out? (Note: my rewrite rules dont include the " " around them but I had to add since serverfault thinks I am trying to spam the system with multiple urls.)

    Read the article

  • Strange overloading rules in C++

    - by bucels
    I'm trying to compile this code with GCC 4.5.0: #include <algorithm> #include <vector> template <typename T> void sort(T, T) {} int main() { std::vector<int> v; sort(v.begin(), v.end()); } But it doesn't seem to work: $ g++ -c nm.cpp nm.cpp: In function ‘int main()’: nm.cpp:9:28: error: call of overloaded ‘sort(std::vector<int>::iterator, std::vector<int>::iterator)’ is ambiguous nm.cpp:4:28: note: candidates are: void sort(T, T) [with T = __gnu_cxx::__normal_iterator<int*, std::vector<int> >] /usr/lib/gcc/i686-pc-linux-gnu/4.5.0/../../../../include/c++/4.5.0/bits/stl_algo.h:5199:69: note: void std::sort(_RAIter, _RAIter) [with _RAIter = __gnu_cxx::__normal_iterator<int*, std::vector<int> >] Comeau compiles this code without errors. (4.3.10.1 Beta2, strict C++03, no C++0x) Is this valid C++?

    Read the article

  • How to prepare for an interview for Ruby on Rails?

    - by Snehal
    Background about myself: I have about 3 years experience working in Java/J2EE. I am currently pursuing MS in Software Engineering at a reputed university. I have done several classwork projects on Ruby on Rails and can be considered at Intermediate level expertise with ROR. I have an interview coming up next week for a Ruby on Rails developer position at a startup. I have already prepared all the basics of Ruby on Rails but didn't get a lot input on the questions asked for ROR developers. Can you guys help me with the preparation? Any materials, suggestions would be welcome.

    Read the article

  • router connect configuration in cakephp 1.3

    - by Gaurav Sharma
    Hello everyone, I have defined the following rule in the router.php file of my cakephp 1.3 based application Router::connect('/tags/*',array('plugin' => 'tags', 'controller' => 'Tags', 'action' => 'index', 'admin' => false)); I have used the tags plugin. When I display the tags related to a topic then the URL on the tags appears something like this http://localhost/testapp/tags/Tags/view/{tag_key_name} I want to make this url for any action to tags plugin like this http://localhost/testapp/Tags/{action}/{tag_key_name} for (view, admin_view and admin_edit) and http://localhost/testapp/Tags/{action} for (index, admin_index and any other action that does not require an id or keyname for execution)

    Read the article

  • Should I go vor Arrays or Objects in PHP in a CouchDB/Ajax app?

    - by karlthorwald
    I find myself converting between array and object all the time in PHP application that uses couchDB and Ajax. Of course I am also converting objects to JSON and back (for sometimes couchdb but mostly Ajax), but this is not so much disturbing my workflow. At the present I have php objects that are returned by the CouchDB modules I use and on the other hand I have the old habbit to return arrays like array("error"="not found","data"=$dataObj) from my functions. This leads to a mixed occurence of real php objects and nested arrays and I cast with (object) or (array) if necessary. The worst thing is that I know more or less by heart what a function returns, but not what type (array or object), so I often run into type errors. My plan is now to always cast arrays to objects before returning from a function. Of course this implies a lot of refactoring. Is this the right way to go? What about the conversion overhead? Other ideas or tips? Edit: Kenaniah's answer suggests I should go the other way, this would mean I'd cast everything to arrays. And for all the Ajax / JSON stuff and also for CouchDB I would use $myarray = json_decode($json_data,$assoc = false) Even more work to change all the CouchDB and Ajax functions but in the end I have better code.

    Read the article

  • Convert user title (text) to URL, what instead spaces, #, & and other characters?

    - by Thomas
    I have some form on the website where users can add new pages. I must generate SEO friendly URLs and make this urls unique. What characters can I display in url, I know that spaces I should convert to undescore: " "-"_" and before it - underscores to something else, for example: ""-"()" It is easy make title from url back. But what in my specific title can be all characters from keyboard, even : @#%:"{/\';. Are some contraindications to don't use this characters in URL? Important for me is: -easy generate url and title from url back (without queries to database) -each title are unique, so url must be too -SEO friendly URLs

    Read the article

< Previous Page | 19 20 21 22 23 24 25 26 27 28 29 30  | Next Page >