Ruby performance improvement of 63% in 1.9.1

Ruby is very powerful object-oriented language. new Ruby performance improvement. Working with pure Ruby is really fun and interesting to me. I am the real fan of Ruby language.

Ruby performance improvement

I am working Ruby on Rails for around last four years. There is always I am thinking and all ROR developers are thinking about performance of application.

We always compare Ruby on Rails with PHP, Java, Python, dot net. We came to know that where we are lacking in ROR. Just one issue performance and memory issue.

When we got news about Ruby 1.9 is comming with performance improvement of 63%. Yes, It is not a joke. This is really great news for every ROR developers. Ruby 1.9 and Rails 3.0 is the future of internet.

Now I will talk about Ruby Software engineer who developed and worked on the Ruby 1.9.

Masahiro Kanai, who improved the performance of several methods in Ruby 1.9. He is the age of high school, just 17.

This year, Ruby 1.9 by the Fibonacci sequence of operations (multiple-precision addition) is,
Ruby 1.8 is slower than I realized Mr. Kanai is a challenge to freedom of choice camp Ruby faster.

In front of all the participants had a similar problem occurring, Ruby of type String, Array types (structures that may have an embedded data structure type object itself) and some of the faster method, attention collection. Oden’s is known to be well-covered tongue teachers. Ruby continued even after the camp’s efforts to speed up to approximately some methods to remove the macro in a constant loop of 63 percent to about 8 percent of success in speeding. This patch has been adopted by the community of developers Ruby, Ruby has been incorporated into the trunk (October 5, 2009).

many professional engineers and developers, with patience to hold out that the problem is resolved, probably as a programmer in one or two talents.

Ketai that builds skills and career tips for the professional engineer. Interviewers are already familiar with this series, the Mr. Ikuo Takeuchi, Professor Department of Creative Informatics, Graduate School of Information Science and Engineering, University of Tokyo. This time, who undertook the voluntary and discover if training for a talented programmer.

His mentor was Koichi Sasada (ko1). The performances of the methods he worked have been bumped up 63% in maximum, 8% in average. His patches were applied to Ruby trunk in Oct. 5 this year.

What he did for Ruby Performance tuning?

He took unnecessary macro references out from a loop. Masahiro spotted macros below in array.c, string.c, and struct.c were referred every time Ruby checked whether data was hold in a structure or not. Even though data were constants, Ruby saw the macros to judge data’s presence in every loop.

What I say now more… I am really happy and I can say this is the biggest news of 2010 in IT world.

One thing I want to mention here about Ruby on Rails. This thing is in mind of all ROR developers.

“Thank God, No need to look Jruby”

He took unnecessary macro references out from a loop. Masahiro spotted macros below in array.c, string.c, and struct.c were referred every time Ruby checked whether data was hold in a structure or not. Even though data were constants, Ruby saw the macros to judge data’s presence in every loop.

Ruby on Rails 3.0 released with new features

I am working on Ruby on Rails for past three and half year. It is really great to working with Ruby on Rails. Because working on Ruby on Rails is a really great feeling daily inventing new things, trying new things and contributing to ROR community. Discussing new things with ROR developers is really great.

Ruby on Rails 3.0 released with new features
Ruby on Rails 3.0 released with new features

On 5th Feb we got news about release of Rails 3.0 beta. We all developers are really waiting for that day. We checked the new version of Rails but what is more interesting.

The interesting part is what is new in Rails 3.0. So many developers contributed in Rails 3.0. They really worked and planned so hard.

Here I am making list what Rails 3.0  has, means new features:

  • Brand new router with an emphasis on RESTful declarations
  • New Action Mailer API modelled after Action Controller (now without the agonizing pain of sending multipart messages!)
  • New Active Record chainable query language built on top of relational algebra
  • Unobtrusive JavaScript helpers with drivers for Prototype, jQuery, and more coming (end of inline JS)
  • Explicit dependency management with Bundler

If you want to use the Rails 3.0 then you should install first following gems.

#gem install tzinfo builder memcache-client rack rack-test rack-mount erubis mail text-format thor bundler i18n
#gem install rails --pre

Or you can use following command to install whole Rails 3.0 with dependencies

gem uninstall rubygems-update
gem update --system
#gem install rails3b

Important Note: Rails 3 requires Ruby 1.8.7+ , you should install latest Ruby version. You can download latest Ruby version from here.

Ruby 1.9.1

Here I am giving the list of gems and plugins which are compilable of Rails 3.0. you should check the following URL:

http://wiki.rubyonrails.org/rails/version3/plugins_and_gems

Now I am started working on Rails 3.0 and I am searching for the issues with Rails 3.0 because Rails 3.0 is in Beta so all ROR developer need to come up with issues of Rails 3.0 and try to fix that or submit that issue to community.

wordpress migration to new hosting service or domain

how to do wordpress migration to new hosting service – This question always came to web developers. After searching on Internet I really did not found satisfied answer for this question. Using our steps wordpress migration to new hosting service or domain made easy

wordpress migration to new hosting service or domain

Earlier I did wordpress migration to new hosting service or new domain so many times. It was like 5 minutes job for any web developer. Don’t be afraid about wordpress migration at all.

Many people suggest to use wordpress utility which import and export xml. This is given by wordpress itself. But I strongly say don’t use that tool. that is not really full proof.

Just follow my steps to do wordpress migration to new hosting or domain.

1. First take backup of file system of your wordpress website using FTP credential.

2. Open wp-config.php file and change database name(what you want)

3. wp_options -Table name
option_name column – change(siteurl and home)

4. wp_blogs- Table name
domain column – change to your domain name

5. wp_site- Table name
domain column – change to your domain name

6. wp_usermeta
meta_key column – change(source_domain)

Most important part of migration. Fixing the image path of wordpress website

7. Just run following query using phpmyadmin or command prompt and any sql editor.

UPDATE wp_posts SET post_content = REPLACE(post_content, ’NEW_DOMAIN.com’, ‘OLD_DOMAIN.com’);

For changing the mysql queries you can use the following URL:

https://purabtech.in/mysql-queries-wordpress-website-migration/

Follow above steps and your are done with migration.

wordpress migration to new hosting service or domain
wordpress migration to new hosting, question always came to web developers. Using our steps wordpress migration to new hosting service or domain made easy

That sit!

fetch wordpress posts which starting with specific word or alphabet

If you want to fetch wordpress posts which is starts with specific word or alphabet. That is really easy to achieve in wordpress.

Article for fetch wordpress posts which starting with specific word.

Just follow my steps:

Open your functions.php file from your wordpress theme folder.


add_action( 'posts_where', 'starting_word' );
function starting_word( $sql ){
 global $wpdb;
 $starting_word = get_query_var( 'starting_word' );

 if( $startswith ){
 $sql .= $wpdb->prepare( " AND $wpdb->posts.post_title LIKE %s ", $starting_word.'%' );
 }

 return $sql;
}

Open your index.php file or any file where you want show the wordpress posts which is starting with specific word or alphabet.

Use following code in that file.


<?php  query_posts('paged='.$paged.'&starting_word=wordpressapi&category_name=Your Category&posts_per_page=10'); ?>
<?php while ($my_query->have_posts()) : $my_query->the_post(); ?>

<a href="<?php the_permalink() ?>" title="<?php the_title(); ?>">
<?php the_title(); ?></a>

<br />
<?php the_content(); ?>
<?php endwhile; ?>

fetch wordpress posts which starting with specific word
fetch wordpress posts which starting with specific word

WordPress vs Joomla vs Drupal, Which is more popular and user friendly

Which CMS is most popular and most user-friendly in the world. WordPress vs Joomla vs Drupal all are best cms. you need to decide what type of site you want.  This is most common question among the developers and clients.

So many times this question is questioned the answered But still I am going answer this question with my opinions.

WordPress vs Joomla vs Drupal

Biggest growth of jobs is WordPress. I am wordpress developer and  I can feel this trend today.
We can this graph that displays the growth of wordpress. Seeing this graph We can say that in 2009 and 2010 wordpress is really rocking.

Wordpress vs Joomla vs Drupal
WordPress vs Joomla vs Drupal

I worked on all the  cms like wordpress, drupal, joomla and many more. But in this year I worked on wordpress for quite some extra time.

When we choose CMS we consider following points.

1. Which CMS will provide you Best Seo options

Ans: When we see and check the all CMS then I can easily say that wordpress has ability to provide you best seo option. After that I will must say Drupal is best option to go with. This will also provide you best seo option.

2. Which CMS is easy to make custom theme from custom design PSD

Ans: I can say with wordpress and drupal both creating a theme is very easy. any web developer who have very basic knowledge of PHP they can develop custom theme very easily.

3. Which CMS is easy  for developer to make custom plugins, modules and components easily

Ans: If you started learning API’s of both the CMS. All are good and easy and all provided good amount of help on internet. But I can rate myself as follows:

a. WordPress

b. Drupal

c. Joomla

Anyways that is depending on your knowledge and understanding. All you need to spend some time to understand the API’s of all CMS.

4. Which CMS admin is most user-friendly and easy to use for non-technical people

Ans: For this point I must say wordpress is the best tool. Drupal has admin panel but little complex to understand and same with joomla.

5. Which CMS is most good for  E-commerce site, Blog, Small site, News sites and company website.

Ans:  I recommend again wordpress here. you can set up wordpress very easily and quickly with minium effort. For big websites like magazine and news sites wordpress is the great tool.

Next point is,  for ecommerce and blogging wordpress is the great tool. If you are aware with wordpress then go with drupal.

Conclusion:  If you want to develop very complex website with multiple features like ad management, forums, client support, video gallery, media gallery then go with Drupal.

So many very big websites are built-in Drupal and WordPress. Choosing the CMS is all depending on your client requirement.

How to use Seo Meta Tags wordpress plugin

we created Seo Meta Tags wordpress plugin. We really happy to announce this news. This is our fourth wordpress plugin by our team which helpful for seo.

How to install SEO meta Tags?

Follow the usual routine;

  1. Open WP admin – Plugins – Add New
  2. Enter “Seo Meta Tags” under search and hit Enter
  3. Plugin will show up as the first on the list, click “Install Now”

Or if needed, upload manually. Follow the steps below to install the plugin.

  1. Upload the seo-meta-tags directory to the /wp-content/plugins/directory
  2. Activate the plugin through the ‘Plugins’ menu in wp
  3. Go to “Seo Meta Tags” option to configure the button

Launched the Seo Meta Tags wordpress plugin

Seo Meta Tags

Using this plugin you will get following features:

We ensure you that Seo Meta Tags plugin will increase your website SEO with two week so drastically.

You can enter your meta keywords and description for your homepage.
This plugin will add different Meta description for each individual post as your excerpt of your post.
This will help your blog to rank better in google. You can easily increase your blog traffic using this plugin.

Using SEO meta tags you can create sitemap for google, yahoo, bing, yandex. It has facility to add  Google, Bing Verify ownership with wordpress website.

This plugin is really helpful to SEO. Search engine will read meta description for each page.
Using this plugin your blog will have different meta description and relative meta description as per your single post.
That is really helpful to your blog.

Here you can see the screen shot of Seo Meta Tags Admin panel:

How to use Seo Meta Tags wordpress plugin
How to use Seo Meta Tags wordpress plugin

You can download Seo Meta Tags from following URL:

Add Webmaster Tool Information.

Official URL of Seo Meta Tags wordpress plugin:

http://wordpress.org/extend/plugins/seo-meta-tags/

How to find wordpress posts by category name

You can fetch the wordpress posts by category name. We have given simple code snippet for find wordpress posts by category name.  Many developer want to do this. I will show how easily achieve this.
You can control the per page post showing and pagination also. You can use following code in any of your page.

How to find wordpress posts by category name

Use following code :

<!--?<span class="hiddenSpellError" pre="" data-mce-bogus="1"-->php  query_posts('paged='.$paged.'&category_name=Your Category&posts_per_page=10'); ?>
<!--?<span class="hiddenSpellError" pre="" data-mce-bogus="1"-->php while ($my_query->have_posts()) : $my_query->the_post(); ?>

php the_permalink() ?>" title="<!--?php the_title(); ?-->">
<!--?<span class="hiddenSpellError" pre="" data-mce-bogus="1"-->php the_title(); ?>

<br />
<!--?<span class="hiddenSpellError" pre="" data-mce-bogus="1"-->php the_content(); ?>
<!--?<span class="hiddenSpellError" pre="" data-mce-bogus="1"-->php endwhile; ?>

find wordpress posts by category name
find wordpress posts by category name

Best IDE for WordPress, Drupal Plugin and Theme development

Many developer who are experienced in development. But with another CMS development. we look for Best IDE for WordPress, Drupal Plugin and Theme development.  But still that comes to another cms or project development. We are always search for good IDE which are free and open source that is the first requirement.

Best IDE for WordPress, Drupal Plugin and Theme development

Our basic need are as follows in any IDE, the IDE need to support following things:

  • CSS
  • XHTML/HTML
  • JavaScript
  • PHP
  • MySQL

I created a list of IDE which I used daily  to do a development. Here I need to clarify IDE is language specific. I work in PHP, Ruby on Rails, Adobe Air, Flex, Javascript, CSS.

I recommend following IDEs which I really found useful for all the developer who are working in wordpress, joomla, drupal development.

1. eclipse (Compatible  on Windows and Linux)

Best IDEs for WordPress, Joomla, Drupal Plugin and Theme development
Best IDE for WordPress, Drupal

Description: Eclipse is best IDE for all language development. Eclipse IdE is basically Java development but still that provides PHP, ROR and other language support. I like this IDE for java development but I did not recommend for PHP or Ruby on Rails.

2. NetBeans (Compatible  on Windows and Linux)

Best IDEs for WordPress, Joomla, Drupal Plugin and Theme development
Best IDE for WordPress, Drupal

Description: This IDE has also all language support. I specially like this IDE from Ruby on Rails development. I Used this IDE for Ruby on Rails development as well as some times for PHP development. Among the Ruby on Rails developer this IDE is so popular.

3. Komodo (Compatible  on Windows and Linux)

Best IDE for WordPress, Drupal
Best IDE for WordPress, Drupal

Description : This IDE is also support for all languages. This IDE is really good support for PHP. I really love this IDE for PHP development. Simple and fast and still nice features about PHP. This IDE is really popular among the PHP developers.

4. Aptana (Compatible  on Windows and Linux)

Best IDE for WordPress, Drupal
Best IDE for WordPress, Drupal

Description : This IDE is mainly made for Ruby on Rails development. This is also popular among Ruby developers. This IDE has features like eclipse. I like this IDE for Adobe Air and flex development.  This IDE has also PHP support.

5. EditPlus (Compatible  on Windows)

Best IDE for WordPress, Drupal
Best IDE for WordPress, Drupal

Description: This IDE is plain simple text editor. Shows you simple color highlight features. I specially recommend this IDE for PHP development and new PHP developer always start with this IDE so they will get filmier with PHP functions and methods because this IDE is does not provide any help. I love the use this IDE in daily use for any language development.

If you want to add any more IDEs. You can comments on this article.

how can we execute custom queries on wordpress

We can use the custom queries in wordpress. Using the custom queries we can fetch the wordpress table data as per our custom requirement.

how can we execute custom queries on wordpress

We you create your table then you can fetch values from that table using following command.

$ourdata = $wpdb->( "SELECT id, name FROM yourtable" );

If you want to create the table in wordpress then use following article.

https://purabtech.in/create-add-tables-wordpress-theme/

More example about executing the own custom quries.

$wpdb->query("
	DELETE FROM $wpdb->postmeta WHERE post_id = '123'
	AND meta_key = 'google'");

another example about adding the data into table which is from wordpress:

$table_name = "your_table";
 $welcome_name = "Mr. WordPressapi";
  $welcome_text = "Congratulations, you just completed the installation!";

  $insert = "INSERT INTO " . $table_name .
            " (time, name, text) " .
            "VALUES ('" . time() . "','" . $wpdb->escape($welcome_name) . "','" . $wpdb->escape($welcome_text) . "')";

  $results = $wpdb->query( $insert );

Getting the single value from any table

$user_count = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM $wpdb->users;"));

Get the single row value from wordpress table

$mylink = $wpdb->get_row("SELECT * FROM $wpdb->links WHERE link_id = 10", ARRAY_A);
how can we execute custom queries on wordpress
how can we execute custom queries on wordpress

you can use inner join, outer join and multiple join in wordpress custom queries.

footer stickable to end of the browser window without fixed position

Many web developer always think about why footer is not sticking to end of browser. In this tutorial we will show you to footer stickable to end of browser.

This is scenario:
If content is less than footer need to go bottom of browser and if content is more than footer will go down as per content.

Many people think this is CSS developer’s But I am not think that way. because this is totally different problem.

Some people suggest to use header, middle container and footer height in percentage. But that is wont be possible for all the time.

Here I will give you the solution. Use following JavaScript in document.

<script type="text/javascript">
 var header_height = 150;
 var footer_height = 100;
var reduce_height = header_height+footer_height;
 browserHeight = 0;
 if( typeof( window.innerHeight ) == 'number' ) {
 //Non-IE
 browserHeight = window.innerHeight;
 } else if( document.documentElement &amp;&amp; (  document.documentElement.clientHeight ) ) {
 //IE 6+ in 'standards compliant mode'
 browserHeight = document.documentElement.clientHeight;
 } else if( document.body &amp;&amp; (  document.body.clientHeight ) ) {
 //IE 4 compatible
 browserHeight = document.body.clientHeight;
 }
 // window.alert( 'Height = ' + browserHeight );
 var min_height = browserHeight-reduce_height+ +"px"
 document.write('<style>#middle_container{min-height:'+ min_height +'}</style>');
 //document.getElementById("middle_container").style.minHeight = browserHeight-146+"px";
</script>

Here in this JavaScript I am assuming middle_container is your main block of content. You can change the variables as per your need.

footer stickable to end
footer stickable to end