www.SmarteGuru.com
  Home | Blogs | Recipe | Find a Friend | Discussion Board | Resources | Developers Area | Articles | Health |  Login | Register Now 

Archive for the ‘Development’ Category

Next CSIR UGC NET 2009 on June 21

Wednesday, March 4th, 2009

Next CSIR UGC NET 2009 on June 21

CSIR will hold Joint CSIR-UGC Test for Junior Research Fellowship and Eligibility for Lectureship (NET) June 2009 on Sunday, the 21st June 2009. The application Form and Information Bulletin for this test will be available in the designated branches of Indian Bank and Oriental Bank of Commerce from 12.03.2009 to 06.04.2009. >>. Read complete details >> CSIR UGC NET Notification
(more…)

Karnataka CET 2009 Entrance Exam Application Deadline – Feb. 10, 2009

Saturday, February 7th, 2009

The Karnataka Common Entrance Test (CET) 2009 examinations will be a two-day affair and will be held on April 29 and 30

The last date for submission of Demand Draft to the Principal of Schools and Colleges within Karnataka will be 10-02-2009.

Procedure to procure Brochure cum Application form for common entrance test – 2009 for admission to various professional courses for the year 2009-10, by the Karnataka candidates who are studying the 12th standard or equivalent examination outside the state of Karnataka (Horanadu and Gadinadu Kannadiga and other Karnataka candidates etc.)
(more…)

Translators were not loaded due to errors: Adobe Dreamweaver CS3/Dreamweaver 8.0

Sunday, November 16th, 2008

Problem
getting this error message on all my pages “the following translators were not loaded due to errors: XSLT.htm: has configuration information that is invalid.” while open, create and change something in file.. in Adobe Dreamweaver CS3/Dreamweaver 8.0

OR

The following translators were not loaded due to errors:
Spry.htm: has configuration information that is invalid.
XSLT.htm: has configuration information that is invalid.
(more…)

Get your PHP on the right Trax

Wednesday, September 24th, 2008

Hands on Ruby on Rails has become a popular framework for developing database-based web applications using the Model-View-Controller (MVC) pattern.

Before Ruby on Rails, though, PHP was hogging the web-development limelight. Problem was, there was no Model-View-Controller (MVC) framework for PHP.
(more…)

Do you know this blogging solution secret that only a few know?

Wednesday, August 20th, 2008

One of the major reasons why most people are poor and only a few are rich worldwide is that there are certain secrets that these few rich know that the majority of the poor do not know.

Same with blogging.

Is there any wonder why most bloggers still struggle without making a good income with their blogs, no matter how many they have… while there are few bloggers that make tons and tons of money with their blogs?
(more…)

Benchmarking php’s magic methods

Wednesday, August 20th, 2008

There is interesting set of benchmarks covering many of PHP’s magic methods. Results correspond pretty well to my own benchmarks in the area. The thing to take away is that its not necessarily the overhead of the magic methods, but rather what you do inside them. Its hard to do anything useful inside a magic method, such as __get or __call that isn’t 10 to 20 times slower than the “non-magic” solution.

There are probably more than a few naive programmers who would read results like this and start to avoid these constructs in their own code for performance reasons. These are the same kinds of people obsessing over a few single or double quotes, who eschew “slow” objects in favor of switch statements that are many times slower than the polymorphic method calls they are trying to avoid.

But, that’s not the end of the story. These benchmarks were using 2,000,000 iterations. The N really matters here. Sure, iterators are slower than arrays, but you aren’t going to be iterating over two million things. I tend to fetch my database records in lots of 25 or 50. You aren’t going to be making two million invocations of __call. But how many will you make? Under what value of N does the performance of these techniques cease to matter? Is it ten, one hundred, one thousand, or ten thousand? You may be surprised at how few calls your program actually does and how little impact it has on performance.

Profiling is the way to find out the potential impact and to discover your true N.

call_user_func_array appears to be a bottleneck, but it turns out that its the function being called, htmlspecialchars, not the calling process that consumes the balance of the time. In that case, the function was “only” called 300 times. I find that order of magnitude to be fairly typical. Something to be aware of, perhaps, but not something to obsess over.

ActiveRecord :select with :include

Tuesday, August 19th, 2008

ActiveRecord is an important element included in Ruby on Rails, writing a SQL database driven application without actually writing any SQL is really pleasurable.

The pain for me arrived when I was working on some reporting feature that was pulling various data across a quite long chain of has_many relationships.

I experienced a quite high load in the DB at the moment of the query and after that seconds of CPU full load eaten by my ruby process.
I checked what was going on in my log/development.log and I noticed the query was extracting all the columns of every table even if I specified a :select option, this turned a query originally quite light into a heavy one.

I googled a bit and I found out that with ActiveRecord, if you specify :select and :include option you don’t get anymore 100% joy but just 50%, your :select statement will be ignored.

Today I am going to put back some percent of the joy.

select_with_include gem will increase the joy level up to 80% (no, not 100% yet)

select_with_include will allow you to specify a limited :select statement like

"table1.column1, table1.column3, table2.column2"
  

or like

"table1.*, table2.column3, table2.column4, talbe3.*"
  

At the moment you can’t specify functions or calculated fields. There are reason for that and I’m going to discuss these reason in the next posts. I’ll try as well to explain how this gem works around the original ActiveRecord code.

For the moment you’re invited to get select_with_include gem using

sudo gem install select_with_include
  

and test it yourself specifying

require 'select_with_include'
  

in your config/environment.rb file.

If you’re a script/console user you can just try, while you

tail -f log/development.log
  

to launch the same find with :include and :select with and without requiring the gem.

If you find any issue you’re really welcome to use the issue tracker

Home - About Us - Help - Terms and Conditions - Site Map - Link to Us - Resources - Contact Us
Google Rank Calculator | Suggest developer resource | Suggest Article
All rights reserved © 2007 SmarteGuru.com.