Categories
News

Interview – Gautam Gupta on Winning Google Code-in Twice

Very early on when I joined Devils’ Workshop, I came across Gautam Gupta who was writing guest posts for us. I was surprised to find out that he was still in school. That was not all he, was also a pretty good programmer and even wrote a PHP Tutorial series for Beginners.

He won at the Google Code-in 2o11, at the young age of 15, which gave him the oppurtunity to visit Google’s Mountain View Headquarters in California, USA.

He won at Google Code-in again this year and will leave for another trip to Google’s campus in a few days. Before he did that, I thought of catching up on him about his journey so far and what his plans are in the future.

ADVERTISEMENT

Q: Tell us a bit about yourself?

I am Gautam, a 16 year old, XIth grader, geek, obsessed with coding and photography. Anything related to technology interests me, whether it be creating a small bot or open source projects like WordPress or artificial intelligence.

Q: How did you start getting interesting in programming?

I started programming way back in seventh grade by writing some bots in Visual Basic (Orkut bots, if someone remembers them :P) after reading some tutorials online and then trying out new things mainly related to hacking. Eventually I got into PHP and have been programming in it since then.

ADVERTISEMENT

Q: How did your participation in Google Code-In come about?

Google Code-in has been one of the most impactful experiences of my life, letting me know my potential and connecting to some of the greatest people in the field. I am now in contact with so many which wouldn’t have been possible without the platform that I got.

I have worked for about five open source organisations during the competition and completed about 75 tasks ranging from programming to documentation to translations, winning hundreds of points and securing a position in the top ten both times. I also got to know about some technologies which were completely new to me and using them in real time.

Q: How was it visiting Google Headquarters in Mountain View? Is it as good as some of the videos suggest online?

Google Headquarters is more wonderful than the videos online. You see the Googleplex, but you don’t get the feel. It is only when you’re in the complex that you feel it for real.

ADVERTISEMENT

We toured the whole complex, including the great big Android statue, Charlie’s Cafe and the list goes on. We also met many wonderful people including Chris DiBona, Alan Eustace, Josh Bloch, Jeremy Allison. Overall, it was just awesome.

Q: What attracted you to developing for WordPress?

I have been introduced to WordPress three times, never got introduced to Joomla or Drupal. I created my first blog on wordpress.com when I was about 10 by copy pasting content from other blogs – didn’t know that that was illegal – deleted it soon after getting bored. After a couple of years, got introduced to it again from a friend on Orkut running a self-hosted blog and it was then I got to know that WordPress was an open-source software.

But I still was only into Visual Basic back then. The third time, I got involved with a blog on Orkut called OrkutPlus which ran on WordPress too, for which I contributed by creating scripts and blogging.

I didn’t start developing directly for WordPress, rather with bbPress – I was setting up forums for OrkutPlus and decided to port a WordPress plugin SexyBookmarks as bbPress plugin Social It and then moved on to WordPress with time.

ADVERTISEMENT

Q. You are not just a techie, you also contribute time for a NGO. Tell us a bit about that part of your life?

Yes, that’s right. I’m one of the co-founders of an organization named Discover I, where we tap the hidden talent of the underprivileged children, for example dancing, singing, computers and other co-curricular activities. We associate them with teachers or students who are good in that field so that their creativity could come out too!

I particularly got excited about this as I always wanted to do something for the society and when some of my friends came up with this idea to open up a NGO, I quickly agreed and became a part.

Q. What are your plans for the future?

As an XIth standard student, I currently have plans to prepare for engineering institutions in India and give SAT for the universities in the United States, following which I see myself as a founder of a tech startup in India being covered on Devils’ Workshop. 😀

Thanks for your time and here is wishing you all the very best from everyone at Devils’ Workshop. We are incredibly proud of your achievements at such a young age and may you keep doing awesome things in the future. 🙂

Categories
Tutorial

MaxCDN – Updating IP Address when moving servers

If you use MaxCDN to speed-up your WordPress blog/site, then you may face one issue during server migration. The issue is – IP-address of new server will not get updated in MaxCDN automatically. You need to do this manually like below:

Steps to Update IP Address on MaxCDN:

  1. Login to MaxCDN account. Go to “Manage Zones”.
  2. Go to “Pull Zone” which you like to update.
  3. Then go to “Settings” tab.
  4. You will see a section titled “Origin Information”.  That will contain IP address of your old server. Click the “Edit” button in that section. (see screenshot) 
  5. Then enter new IP-address in “Origin IP” field and click the “Update” button.  (see screenshot) 

Why don’t MaxCDN update IP address manually?

Its common to perform some testing on a test server, and then use another server, a different one, for production site. So IP-address change is not something very uncommon.

ADVERTISEMENT

MaxCDN uses IP address to serve content faster. But rather than automatically updating their cache, say daily, they keep it forever! While I like the manual option to “Update” IP address is settings area, which gives advance users some control, it would be better if MaxCDN combine this manual option with automated cache-update.

Smart Auto-Update: A smart solution would be to update IP-Address when “Origin Server” starts returning HTTP 404-error. When there will be too many 404-errors, it may mean the server has been moved. Of course, CDN misconfiguration or origin server-downtime can also result in 404-error but “Smart” programs supposed too handle such cases as well!

Recommended Reading: How to Setup MaxCDN on WordPress using W3 Total Cache Plugin

Categories
Tutorial

Add Custom Headers to your WordPress.org plugins

Matt Mullenweg announced few days ago that, plugin authors will be able to put custom headers on their plugin pages. Soon the geeks across the globe got started with designing and customizing their header images.

Developers are happy as they have got an opportunity for a little branding. Our creative heads from rtCamp too got down to design the banners. You can see them here (For Bloggertowp redirection plugin and rtSocial Plugin)

How to change the header image:

You can also customize your plugin custom headers, as it’s a pretty simple process. All you need is to follow the steps below:

ADVERTISEMENT

(this tutorial was written while developing the header image for our BloggertoWordPress Redirection Plugin)

Step 1: Design  a 772×250 pixel jpeg or png image. (No animated GIFs)

Step 2: Adding it to plugin’s SVN Directory:

  • Create a directory in your system: mkdir b2w-plugin
  • Checkout the code from WordPress plugin Directory:

svn co http://plugins.svn.wordpress.org/blogger-to-wordpress-redirection/ b2w-plugin

Bloggerto WordPress redirection
  • Move it inside the directory: cd b2w-plugin
  • Create one more folder into it. : svn mkdir assets
  • Move inside that folder. : cd assets
  • Store the Image which you want to display for your plugin inside assets folder.
  • Use this command: svn add *
  • Now Commit the code from your system to WordPress plugin directory : svn ci -m “Added Banner”.
  • It will ask you for the svn username and password. Give it the proper authentication and you are done with the new banner updates for your plugin.

So, lets start getting creative and write your plugin links in the comment area for other readers to see.

Categories
Analysis

Gaurav Singh on Organizing WordCamp Jabalpur 2011

Something interesting happened in India for the WordPress community a week before Diwali holidays. A WordCamp was organized and it was not in one of bigger cities but in a smaller town of Jabalpur, Madhya Pradesh.

We decided to catch up with Gaurav Singh who headed the organizing committee of WordCamp Jabalpur 2011 and ask him questions on how to go about organizing a WordCamp.

Q. How did the idea of having a WordCamp in Jabalpur come into being? Who were in your group and helped out in organizing it.

I was introduced to WordCamp by my friend Aniket Pant when I was doing internship at Delhi Metro Rail Corporation in June this year. We were fascinated by the idea to organize WordCamps in our cities (Goa and Jabalpur) and applied for it. Unfortunately he was not granted permission and I managed to succeed.
After getting permission, I got warm support from my juniors in college, namely Roopal, Ankit and Apoorv. They were the real organizers whose efforts made this a success.

ADVERTISEMENT

Q: Jabalpur is not a metro in India, what had an disadvantage or an advantage?

Jabalpur not being a metro in early days felt like a big disadvantage as most of the tech guys and companies are based out of cities like Pune, Hyderabad and Bangalore. In beginning it seemed really hard to get some sponsors from Indian companies, who were not ready to support because it was organized in a tier-2 city. Some speakers had to cancel their slot because of 2-3 days long journey and non availability of tickets.

On a brighter side, we were able so cut down costs, as a tier-2 city is relatively cheaper when compared to metros. This made us save on infrastructure cost like venue charges, bandwidth(donated by BSNL at 1Gbps) and other such items. Above all, we are happy that we were able to spread WordPress and open source in a city which is not too involved in web development. WordCamp was covered in the local Hindi daily(Dainik Bhaskar) for 5 consecutive days. Now I get calls from people who want to shift their HTML sites to WordPress. I consider this to be a big achievement.

ADVERTISEMENT

Q: Were you all WordPress developers or just enthusiats?

I am a WordPress freelancer since 3 years and have my little contribution to WordPress community as well. Other organizers are WP enthusiasts and now trying to get more into it since WordCamp.

Q: What was your single biggest challenge in arranging a WordCamp?

The single biggest challenge was to convince tech guys from metros to travel some 500-1000 km to join us for WordCamp. Most of them were professionals and had to take leave from their day job to reach here. It was awesome meeting them all and would like to thank them for being here during WordCamp.

Q: Jabalpur being a smaller city, do you think more WordPress fans from other smaller cities would be inspired?

ADVERTISEMENT

Yes, it was managed totally by undergraduate students. We can hope to see more such events coming up in future. I had a e-mail conversation with Andrea, an Automattic employee who managed WordCamps across globe, told me that applications from India have increased exponentially since WordCamp Jabalpur.

Q: Your advice to anyone looking to organize a WordCamp in India and tell us about any India specific challenges?

I would suggest people, never start exporting speakers from outside your city. First look in the local WordPress group and see if someone is interested in being a speaker. Also as WordPress is not a very well known topic in most of Indian colleges, I would suggest offer some discount for students as they are the backbone of all tech developments in future.
The biggest India specific challenge is lack of WordPress community. We don’t have local WordPress meets and also developers are not on a common mail group for better discussions. If possible, try to form a community and keep that strong even after WordCamp.

Q. I was struck but the fact that WordCamp Jabalpur was held very close to Diwali. Considering a lot of bloggers and WordPress enthusiasts are college students, did having it during vacation time help or hinder the camp.

The weekend we choose WordCamp was the only feasible date from our side. A weekend before that meant we had little time for preparation and a weekend after meant no tickets for most of last-minute planners because of the Diwali rush. However the dates in end proved to be good for us as most participants being students, had this even at the start of festive season just before vacations in colleges.

Q. Finally who helped you organize WordCamp Jabalpur 2011?

The names of organizers and volunteers are Roopal Jain, Ankit Chansoria, Apoorv Anand, Arya Bhasin, Neha Nupoor, Ambar Khan, Kautuk Kashyap, Akaar.

Categories
Tutorial

Create Portfolio with Image Sliding Effect with jQuery


There are tons of tutorials already out there about creating portfolio image slide effect with jQuery. I wanted to create an easy-to-implement jQuery image slider for my portfolio page, you can check the live demo at Blogger To WordPress portfolio.

This slider requires the latest release of jQuery and functional knowledge of jQuery, HTML and CSS

So let’s start the implementation

Step 1 : Include the JQuery Library

ADVERTISEMENT

First, you have to include the JQuery library between ‘<head>’ and ‘</head>’ tags of your html page:

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>

Step 2 : Add HTML Code

Add HTML Code, this is the source code of our sample:

ADVERTISEMENT
<div class="image-container">
 <a title="Devils Workshop" href="https://devilsworkshop.rsites.dev6.rt.gw/" target="_blank"> 
  <span class="image-caption">image title</span> 
  <span class="image-content"><img title="custom title" alt="custom alt" class="attachment-rt-gallery" src="http://path-to-image.jpg" /></span> 
 </a>
</div>

Step 3 : Add Style/CSS code

Add CSS Code in your style sheet file, this is the source code of our sample:

.image-container {
  border: 1px solid #CCCCCC;
  float: left;
  height: 180px;
  margin: 0 25px 20px 0;
  overflow: hidden;
  padding: 5px;
  text-align: center;
  width: 300px;
}

.image-container a {
  color: #66A83E;
  display: block;
  font-size: 18px;
  height: 100%;
  overflow: hidden;
  position: relative;
  width: 100%;
}

ADVERTISEMENT
.image-container a span.image-caption { display: table-cell; height: 180px; text-align: center; vertical-align: middle; width: 300px; } .image-container a span.image-content { height: 180px; left: 0; position: absolute; top: 0; width: 300px; z-index: 5; } .image-container a span.image-content img { border: medium none; margin: 0; padding: 0; }

Step 4 : Add jQuery Code

You have to include the following jQuery code to work the image slider. To do so, embed it within <script type=”text/javascript”> /* Put the Code given below */ </script>, or even better, put it in a separate .js file.

jQuery( '.image-container' ).hover(
    function() { jQuery( '.image-content', this ).stop().animate( { left : '300px' }, { queue : false, duration : 500 } ); },
    function() { jQuery( '.image-content', this ).stop().animate( { left : '0px' }, { queue : false, duration : 500 } ); }
);

Screenshot

Hope this helps and saves your time, do drop in your opinions and comments below.

Categories
News

Creator of C and UNIX, Dennis Ritchie Passes Away!

 

Anyone who has read a book on C programming language, has probably come across the name Dennis Ritchie, in the first introductory chapters.

Dennis Ritchie passed away after a long illness. He was 70 years old.

Dennis Ritchie, created C Language. He worked with AT&T Bell Labs in the early development part of the language.

ADVERTISEMENT

Ritchie also before his creation of C language, had also teamed up with Ken Thompson to create the UNIX operating system.

Even though I am not a programmer, but I can understand the vast impact of C programming language.

Today, C is the second-most used programming language and led to development of newer languages like C++.

There is no doubt that the world has lost one of the most iconic name in the software programming.

(via TechCrunch)

Related: Infographic on Programming languages

Categories
Editorial

rtPanel–WordPress Theme Framework by rtCamp

(Cross-posted on rtPanel blog)

The past few weeks have been exciting for everyone at rtCamp thanks to launching a new product called rtPanel. rtPanel is a WordPress Theme Framework and is now officially available for download on WordPress.org directory. 🙂

rtPanel has been tested on more than 300 websites and blogs, as we have used it on all rtCamp client projects.

As rtPanel is a theme framework and not just a theme. The idea behind it is to make website development easy and provide standard codes for developers to work upon.

A dedicated support forum has also been started for rtPanel users, where more than 20 developers will be available to answer all questions and queries.

rtPanel is still very new and soon newer theme options and features will be provided to make it a lot easy for users.

Follow updates from rtPanel on Facebook, Twitter or via RSS Feed.

Link: Download rtPanel

Categories
Analysis

[Infographic] Quick Look at Programming Languages!

I am not a programmer, I don’t find poetry in code. But I do blog and appreciate what programmers have been able to do over the last 60 odd years. They have literally helped create a world where borders do not exist.

So what are programming languages and how did they evolve? How have they affected the programming world?  Here is an infographic from Rackspace which shows how programming languages have evolved over the years.

Thanks to Himadri Dimri for the tip. Do drop in your comments.

Related: Microsoft Vs Apple: History of Computer Giants

Categories
Tips

[How to] Get WordPress Login Form in Front End

Sometime admin decides the posts under certain category eg. “Subscriber Posts” must be  visible only for the subscribed users. For this he have to provide a login form at the front end, so that user can register them self and after login they can see those posts.
There are 2 ways to provide a login form.

  1. Create a custom menu from admin and give a URL of wp-login eg. http://www.example.com/wp-login.php
  2. User can log in to this url, however this will not be a good practice as user may distract his mind from your site.

  3. Provide a login form on front-end so user will be on your site only. To create the custom login form follow the steps given below.

Step 1:

Create a simple page template.

ADVERTISEMENT
<?php
/*
Template Name: Login Form
*/
?>
<?php get_header();?>
<?php get_sidebar(); ?>

    <div id="content" >
<!-- If user is not logged in the show the login form  -->
    <?php if(!is_user_logged_in ()) { ?>
        <div class="login-box" >
<!-- Login form start  -->
            <form method="post" action="<?php echo site_url(); ?>/wp-login.php" id="loginform_custom" name="loginform_custom">
                <table>
                    <tr>
                        <td>Username</td>
                        <td><input type="text" class="u-name" name="log" /></td>
                    </tr>
                    <tr>
                        <td>Password</td>
                        <td><input type="password" class="u-pass" name="pwd" /></td>
                    </tr>
                    <tr>
                        <td></td>
                        <td><input type="submit"  name="submit" value="Login" /><a href="<?php echo site_url();?>/wp-login.php?action=register">Register</a><a href="<?php echo wp_lostpassword_url(); ?>" title="Lost Password">Lost your password?</a></td>
                    </tr>
                </table>     
            </form>
<!-- End  of login form -->
            </div>
            <?php } else { ?>
        <?php
                 wp_get_current_user();
// Retrive the current user object. to check the user logged in or not.
                if ( 0 != $current_user->ID ) {
                        $subscriber_posts_cat = get_cat_ID('Subscriber Posts');
                        query_posts('cat=' . $subscriber_posts_cat.'&showposts=-1');
// Get all posts under Subscriber Posts category.
                        while ( have_posts() ) : the_post(); ?>
                        <div <?php post_class('post-box') ?>>
                                     <div class="post-date">
                <ul>
                <li><?php the_time('j'); ?></li>
                <li class="month"><?php the_time('M'); ?></li>
                </ul>
                </div>
                        <div class="post-title">
                            <?php
                            if (is_singular ()) {
                                ?><h1><?php the_title(); ?></h1><?php
                            }
                            else {
                                ?><h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2><?php
                            }
                           ?>
                            <div class="clear"></div>
                        </div><!-- .post-title -->
                            <div class="post-content clearp">
                                <?php the_excerpt(); ?>
                            </div>
                        </div>
                        <?php endwhile; } } ?>
    </div>

<?php get_footer(); ?>
ADVERTISEMENT

In the above template first we have checked weather user is logged in or not. If user is logged in then he is able to see the posts under category “Subscriber Posts”. Otherwise user can see login form with the Register and Lost Password links.
In the above login form “action” of form and the “name” of input fields of Username and Password is very important.

Step 2:

To handle the redirection of admin login and subscriber login we have to write the redirection function in themes function.php file. That is if user role is admin then show him the dashboard and if the user role is subscriber then he will directly redirected to “Subscriber Posts” category page.

 

/* check the role of current loged in user for redirection */
add_action('admin_init','rt_checkRole');
function rt_checkRole() {

ADVERTISEMENT
global $wp_roles; $currentrole =''; foreach ( $wp_roles->role_names as $role => $name ) { if ( current_user_can( $role ) ){ $currentrole = $role; } } if($currentrole == 'subscriber') wp_redirect (site_url().'/front-end-login/'); } /* redirect the user depending on role */ add_action('template_redirect', 'rt_redirectuser'); function rt_redirectuser() { if (!is_user_logged_in() && (is_category(get_cat_ID('Subscriber Posts')) || rt_is_subscriber_post_cat())) { //user check if wp_redirect(site_url().'/front-end-login/'); exit (); } } /* check the current category is Subscriber Posts */ function rt_is_subscriber_post_cat(){ if(is_single()){ global $post; $cats = wp_get_post_categories($post->ID); $cat_id = get_cat_ID('Subscriber Posts'); foreach($cats as $cat) { if($cat==$cat_id) return TRUE; } return FALSE; } } /* redirect the user to front end login form when he is loged out */ add_action('wp_logout', 'rt_logoutRedirect'); function rt_logoutRedirect() { wp_redirect(site_url().'/front-end-login/'); exit(); }

Step 3:

Once user logged in to your site, “Log Out” menu will automaticlly get added in your menubar by adding the below function in your themes header.php file. Now add a filter on wp_nav_menu if the user is logged in.

/* filter function */
function rt_menus($param)
 { return $param.'<li><a href="'.wp_logout_url().'" title="Logout">Logout</a></li>'; }
/* menu code on header.php */
if( function_exists('wp_nav_menu') && has_nav_menu('primary') )
 { add_filter('wp_nav_menu_items','rt_menus');
wp_nav_menu(array('container' => '', 'menu_id' => 'rt-nav-menu', 'theme_location' => 'primary', 'depth' => '3'));
remove_filter('wp_nav_menu_items', 'rt_menus'); }

Add and tweak CSS as per your sites requirement, as the form will look in the screenshot image above. 🙂

Categories
Analysis

[List] 5 Best Sites for Hosting Code Online

There are many websites which give you the platform for hosting your project codes online. I thought it would be nice to share a list with you.

#1. GoogleCode

The best place to keep your code is to put on the most trusted internet brand. Google Code not only hosts your code source but also provides various resources to you. Here you can find API and toolkits for various streams including the open source programs. It has a feature called code playground where, live online coding can be done and output can be seen. Google code is good platform for developers and for project hosting.

#2. Sourceforge

An open source code hosting site, here you can easily upload your code and downloads other code of your interest. The most popular code hosting site has suffered from many problem too. It is good site for getting open source software code. There is a high number of downloads of code through it daily.

#3. Codeplex

The codeplex is hosted by Microsoft but is not under it control. This is also a legitimate site for hosting your code. It is best when came for the .net projects. You can create, search,modify,download and uploads various projects here  with simplicity.  It too is an open source web host. The rawr is one of it best feature.

#4. Github

The Github provides the option of hosting the code as public or private. They took $7 per month for the private hosting. It supports for the multiple team management make it more versatile. Here you will able to plan your code and price it as well.

#5. Launchpad

The Launchpad is developed and maintained by the same company which supports Ubuntu  Canonical Ltd. This as is open source and code hosting is done by so-called Bazaar. Answer tracking  and mailing list helps the member interaction. It too supports for the translation as well.

Try out these sites which host code and do drop in your comments if you have more services to add to the list. 🙂