Certified : Exam 70-480 My Experience

Yesterday i appeared for Microsoft Exam 70-480 (Programming in HTML5 with JavaScript and CSS3 Specialist certification) and yes I cleared it. Now I’m Microsoft Certified Professional, feels great. Last time I gave certification Exam and I failed i scored 680 something and the passing was 700, I was very disappointed at that moment but Dhananjay Kumar sir (DJ – awesome person) motivated me and now when I have got this, I would like to dedicate it you DJ sir.

Microsoft offers Microsoft Specialist certifications for exam 70-480 and 70-483, so now I’m certified specialist in Programming with HTML5.

Microsoft Specialist 70-480

 

My Experience : This exam was not so tough, It had HTML5 questions and the maximum part was covered by JQuery and Javascript. HTML5 part was easy, and yeah you need to be strong in JS and JQuery part. Here are some reference I’m posting for preparation.

1 – W3schools for HTML5

2 – Channel9 for Javascript

Hope you do well, cheers. :)

TCS Campus Drive 2013 Batch: My Experience

Date of Drive : 12-13th Oct, 2012

Venue : Hindustan College of Science and Technology, Mathura

Appearing for TCS was fun, as it was the first company in our college so was full with enthusiasm. I would mention that all the rumors that say that the aptitude test is hard this time are actually true. The level of aptitude question are different this time, some of them are so lengthy that before attempting the question you will think 5 times shall I attempt it or not. The major topics they covered in aptitude test were Time and Work, Statements, Reasoning and Probability.

Tips: Do not go in the first slots of aptitude tests, wait outside and ask students about the aptitude questions they are getting and prepare those questions because in the end you will get almost all the repeated questions. Never forget to check Fresherworld.com for the latest aptitude papers, the questions which came in my test were updated on FresherWorld.com on the same day morning (I checked them after I gave the paper ). And the ones who say R.S Agarwal is of no use don’t trust them, brush up your skills with R.S Agarwal.

Technical Interview: Apart from the 2-3 subjects you prepare as your favorite or major subjects, you should have sound knowledge of Operating System and Database Management System. It doesn’t matter that you are from Mechanical, Chemical, Electronics or any other branch they have high technical requirements this time. Sometime they ask silly questions also like :

  • What is the difference between Activa and Bike ?
  • How satellite is made ?
  • How pen works ?
  • How is the data refreshed ? (some of them answered by pressing F5 and to my surprise he was impressed.)

Some technical questions included :

  • What is sealed class in ?
  • What is friend function ?
  • Types of JOIN in DBMS ?
  • Simple pattern programs ?
  • TRY and CATCH block

Tips: Do not try to fool the interviewer if you don’t know the answer simply say “Sir, I haven’t prepared could you please ask me from these topics”. It doesn’t gives a bad impact but in this case be ready for high level of questions on the topics you mention.

e.g In my interview he asked me any experience with database I said have done some SQL queries but in his assessment form he mentioned DBMS and started asking me questions from DBMS, I tried my level best to answer as many questions as I could but then I said “Sir in DBMS I have done SQL queries only”, no problem he said but then the query he gave was not the normal SELECT or UPDATE query, he asked me to write the query for INNER JOIN. Same happened with me in C and JAVA, I frankly told him I’m much comfortable with C as I studied CORE JAVA in my first year of B.Tech.

MR Interview: This interview was completely focused on the summer industrial training, they expect you to speak about your project as much as you can, I explained my project for about 20 mins (I told him the things which were not implemented in my project). Be ready for the common question in MR round i.e What are your strength and what are your weakness ?

Tips: Be loud and clear and confident about your project, this interview tests how much you can speak, he will ask you to start your project and will not ask you to stop, explain him as much as you can.

HR Interview: This was the easiest of all, I would mention here that HRs from TCS are very sweet, they are polite while talking and never stress you. A female took my HR interview and she was very sweet, I don’t know I impressed her or not but she surely impressed me, firstly she made me feel relaxed then our interview started. You must have a long intro ready for yourself. Learn TCS values, mission, goals, vision and all the things mentioned about them on recent news. Try to gather knowledge about TCS as much as you can.

Tips: Always have an eye contact, match up to the pitch of the interviewer. Few general questions include, your strength, are you adaptable, ready to work on different locations. This will be the easiest one trust me.

At the starting I thought my technical will be the best and HR will be so so, but it went totally opposite. Finally got selected feels good I’m a TCSer now. Hope this helps you. Best of luck.

If anyone wants sample interview questions and aptitude questions from my campus drive questions, mail me at shubham0987@gmail.com.

Rotate and Flip Images in Windows Form

One of my friends asked me how to rotate an image to a particular angle, so I just thought of writing an article on it. Below is the step-wise process on how to use the inbuilt functions for rotating and flipping the image.

Step 1: Create a blank windows form application

Step 2: Add a pictureBox from the toolbox and add a source image to it.

Now comes the real part, using Image.RotateFlip we can rotate the image by standard angles(90,180,270 degrees) or flip the image horizontally or vertically.

The parameter of RotateFlip is System.Drawing.RotateFlipType, which specifies the type of rotation and flip to apply to the image.

e.g : pictureBox1.Image.RotateFlip(RotateFlipType.Rotate180FlipNone);

the above code will rotate the image in pictureBox1 by an angle of 180 degree.

Step 3: Now back to our code, add namespaces we will use here

using System.Drawing.Imaging;
using System.Drawing.Drawing2D;

Step 4: We will make a function RotateImg with two arguments one is the Bitmap Image and the other is the float angle. Code snippet is as follows :

public static Bitmap RotateImg(Bitmap bmp, float angle)
{
int w = bmp.Width;
int h = bmp.Height;
Bitmap tempImg = new Bitmap(w, h);
Graphics g = Graphics.FromImage(tempImg);
g.DrawImageUnscaled(bmp, 1, 1);
g.Dispose();
GraphicsPath path = new GraphicsPath();
path.AddRectangle(new RectangleF(0f, 0f, w, h));
Matrix mtrx = new Matrix();
mtrx.Rotate(angle);
RectangleF rct = path.GetBounds(mtrx);
Bitmap newImg = new Bitmap(Convert.ToInt32(rct.Width), Convert.ToInt32(rct.Height));
g = Graphics.FromImage(newImg);
g.TranslateTransform(-rct.X, -rct.Y);
g.RotateTransform(angle);
g.InterpolationMode = InterpolationMode.HighQualityBilinear;
g.DrawImageUnscaled(tempImg, 0, 0);
g.Dispose();
tempImg.Dispose();
return newImg;
}

Step 5: Now we have a function which will rotate and image to the arbitrary angle, I’m adding my code now to the form_load event so that as soon as the form loads my code gets executed.

Bitmap bitmap = (Bitmap)pictureBox1.Image;
pictureBox1.Image = (Image)(RotateImg(bitmap, 30.0f));

the above two line code will first convert the image in pictureBox1 to a Bitmap image and then it will call our function RotateImg to rotate the image to 30 degree (example).

Here is the snapshot of the output window.

 

Giveaway for Cloud Computing Fans (those who hate IRCTC)

I have always heard my friends talking about shifting IRCTC to cloud computing specially from my MSP friends, last Monday I had a meeting with Executive Director of computer wing in RDSO (Research Design and Standard Organization), he needs a presentation on how cloud computing can serve better. I’m planning a giveaway for the one who helps me in this.

The goodies to be won are:

  • Microsoft Cloud Computing T-shirt.
  • Authorization to various Microsoft Software (DreamSpark Keys).
  • T-Shirts from PHP fan club.
  • Goodies and t-shirts from various sponsor partners.
  • And a bumper giveaway which may include a Windows 7 Ultimate Edition.

There are simple steps which you can follow to make yourself eligible for these giveaways, the more steps you follow more are the chances of you winning and of-course creativity will be another aspect. Steps you may follow are :

  • Like author Shubham Saxena on facebook.
  • Follow me on twitter @shubham0987.
  • Share this post (fb group, pages, blogs etc).
  • Create a PPT on how cloud computing can improve IRCTC , what are its benefits and how it overcomes the present scenario. This presentation should be informative and include all the source from which the data has been taken if any. (this ppt is to be mailed at shubham0987@gmail.com)
  • At last leave a comment here.

Cpanel error IP address has changed

I’m getting IP address has changed! errors

cPanel will sometimes throw out the error: IP address has changed!

This is usually due to you using some kind of proxy or VPN that changes your IP address every few seconds/minutes.

I found a fix for this issue which troubled a lot to me in my college.

You can try going to http://cpanel.mydomain.com as sometimes that will fix things.

If you’re still getting those error messages, you will need to find another connection to connect into cPanel.

And, If you are unable to access http://cpanel.mydomain.com, contact your service provider.

Use Anyone’s Face As a Facebook Chat Emoticon

Custom Emoticon
Facebook is like a trend changing, Now through Facebook chat we can use anyone’s face for Emoticon instead of using normal smile, sad, hurrah etc… the friends face will be come from their profile pictures.

Here is the way to do it, It will look very simple just in few steps.

Go to anyone’s profile, official Page, or event that you want to use as an emoticon.

Now just look at the url bar, you will find their username or their profile ID, The last thing will be their username example : http://www.facebook.com/innovationescalator.in here the “innovationescalator.in” is the profile name
copy the username or number in double brackets like [[innovationescalator.in]],
Now paste that in to Facebook chat or in the message field their faces will appear as the emoticon.

P.S : Till now Facebook has only one custom smiley, :putnam:

Custom Tag on Facebook

A couple months a go, facebook added a new function that enables users to tag their friends on their comment system (status update and wall comment). By default you can do that simply by typing @ and type any letter then list of your friends with that particular letter will show up. But how about create a custom tag for your friends name? for example, You have a friend named John, you can tag John with another name, for example michael. Interesting, right? You can play more with this trick, for example make your comment fully clickable to your own fan page, etc. Just be more creative.

With this trick, you can even tag people who are not friends with you, as long as you have their facebook ID. Ok, let’s start to show you how to do this. Simply put your comment with this format :

@@[0:[Facebook ID:0:Tag Name]]
  • Facebook ID is the unique id identifying every facebook profile, you can read and find out how to get the facebook id on this post : How To Find Facebook ID
  • Tag Name would be your custom text, this way you can link to your friends’ facebook profile but with whatever text you want.

For example :

@@[0:[1629700400:0:Rajnikant]] your text here…

With this code, you can tag my profile (Shubham Saxena) but with ‘Rajnikant’ as the anchor text. Preview :
Snapshot

Cool isn’t it? Please note that if it doesnt show as it should be, the tag is not clickable or not on the blue colored format, you need to refresh the page, it will show you what you want to see.

Finally I got the way to tag Rajnikant while he is not on my friend list… :D :D

1629700400

D Programming Language

What is D?

D is a general purpose systems and applications programming language. It is a high level language, but retains the ability to write high performance code and interface directly with the operating system API‘s and with hardware. D is well suited to writing medium to large scale million line programs with teams of developers. D is easy to learn, provides many capabilities to aid the programmer, and is well suited to aggressive compiler optimization technology. D Man

D is not a scripting language, nor an interpreted language. It doesn’t come with a VM, a religion, or an overriding philosophy. It’s a practical language for practical programmers who need to get the job done quickly, reliably, and leave behind maintainable, easy to understand code.

D is the culmination of decades of experience implementing compilers for many diverse languages, and attempting to construct large projects using those languages. D draws inspiration from those other languages (most especially C++) and tempers it with experience and real world practicality.

Why D?

Why, indeed. Who needs another programming language?

The software industry has come a long way since the C language was invented. Many new concepts were added to the language with C++, but backwards compatibility with C was maintained, including compatibility with nearly all the weaknesses of the original design. There have been many attempts to fix those weaknesses, but the compatibility issue frustrates it. Meanwhile, both C and C++ undergo a constant accretion of new features. These new features must be carefully fitted into the existing structure without requiring rewriting old code. The end result is very complicated – the C standard is nearly 500 pages, and the C++ standard is about 750 pages! C++ is a difficult and costly language to implement, resulting in implementation variations that make it frustrating to write fully portable C++ code.

C++ implements things like resizable arrays and string concatenation as part of the standard library, not as part of the core language. Not being part of the core language has several suboptimal consequences.

Can the power and capability of C++ be extracted, redesigned, and recast into a language that is simple, orthogonal, and practical? Can it all be put into a package that is easy for compiler writers to correctly implement, and which enables compilers to efficiently generate aggressively optimized code?

Modern compiler technology has progressed to the point where language features for the purpose of compensating for primitive compiler technology can be omitted. (An example of this would be the ‘register’ keyword in C, a more subtle example is the macro preprocessor in C.) We can rely on modern compiler optimization technology to not need language features necessary to get acceptable code quality out of primitive compilers.

Who D is For

  • Programmers who routinely use lint or similar code analysis tools to eliminate bugs before the code is even compiled.
  • People who compile with maximum warning levels turned on and who instruct the compiler to treat warnings as errors.
  • Programming managers who are forced to rely on programming style guidelines to avoid common C bugs.
  • Those who decide the promise of C++ object oriented programming is not fulfilled due to the complexity of it.
  • Programmers who enjoy the expressive power of C++ but are frustrated by the need to expend much effort explicitly managing memory and finding pointer bugs.
  • Projects that need built-in testing and verification.
  • Teams who write apps with a million lines of code in it.
  • Programmers who think the language should provide enough features to obviate the continual necessity to manipulate pointers directly.
  • Numerical programmers. D has many features to directly support features needed by numerics programmers, like extended floating point precision, core support for complex and imaginary floating types and defined behavior for NaN‘s and infinities. (These are added in the new C99 standard, but not in C++.)
  • Programmers who write half their application in scripting langauges like Ruby and Python, and the other half in C++ to speed up the bottlenecks. D has many of the productivity features of Ruby and Python, making it possible to write the entire app in one language.
  • D’s lexical analyzer and parser are totally independent of each other and of the semantic analyzer. This means it is easy to write simple tools to manipulate D source perfectly without having to build a full compiler. It also means that source code can be transmitted in tokenized form for specialized applications.

Who D is Not For

  • Realistically, nobody is going to convert million line C or C++ programs into D. Since D does not compile unmodified C/C++ source code, D is not for legacy apps. (However, D supports legacy C API’s very well. D can connect directly to any code that exposes a C interface.)
  • As a first programming language – Basic or Java is more suitable for beginners. D makes an excellent second language for intermediate to advanced programmers.
  • Language purists. D is a practical language, and each feature of it is evaluated in that light, rather than by an ideal. For example, D has constructs and semantics that virtually eliminate the need for pointers for ordinary tasks. But pointers are still there, because sometimes the rules need to be broken. Similarly, casts are still there for those times when the typing system needs to be overridden.

~source D-Programming-Language

Php Tutorial 3 – Form Validation in PHP

Welcome to tutorial 3, where we will learn to validate a form’s data through PHP.

Forms are a crucial part of a webpage without which, no significant input from the user can be expected. Before submitting a form’s data to the back-end, it needs to be validated due to certain issues. Form validation through PHP is a process where the form data is posted to the server and server returns the respective messages related to the validation.Validation of a form’s data is generally practiced with the aid of JAVASCRIPT because the form’s data is validated by the browser only, showing respective messages without returning to the server. Here, we will stick to the form validation process through PHP only.

So the webpage containing the form, index.php, will go like:

<?php include("form.php"); ?>
<html>
    <head>
        <title>PHP Tutorial 3 - Form Validation Demo</title>
    </head>

    <body>
        <?php
        /* Form submitted without errors */
        if(isset($_SESSION['submit']))
        {
            if($_SESSION['submit'])
            {
            ?>
                <h1>Form Submitted!</h1>
            <?php
            }
            unset($_SESSION['submit']);
        }
        else // error in the form or first load of the page
        {
        ?>
            <h1>Login</h1>
            <?php
            /* If errors occurred, they will be displayed. */
            if($form->num_errors > 0)
                echo "<font size="2" color="#ff0000">".$form->num_errors." error(s) found</font>";
            ?>
            <form action="process.php" method="POST">
                <table>
                    <tr>
                        <td>Username: </td>
                        <td><input type="text" name="user" maxlength="30" value="<?php echo $form->value("user"); ?>"></td>
                        <td><?php echo $form->error("user"); ?></td>
                    </tr>
                    <tr>
                        <td>Password: </td>
                        <td><input type="password" name="pass" maxlength="30" value="<?php echo $form->value("pass"); ?>"></td>
                        <td><?php echo $form->error("pass"); ?></td>
                    </tr>
                </table>
                <p>
                    <input type="hidden" name="sublogin" value="1">
                    <input type="submit" value="Login">
                </p>
            </form>
        <?php
        }
        ?>
    </body>
</html>

in the above codes, under the form section, each field is followed by error message of the corresponding field. At the first load of the page, all the messages are blank therefore no message can be seen. But once a form is submitted to the page process.php, the data corresponding to every field is validated and the error messages for the corresponding fields are altered. After the validation of entire data, the server is again redirected to the page index.php. At this load of the page, the corresponding ‘new’ error messages are visible along with the count of the number of errors.

The contents of process.php goes like this:

 <?php
include("form.php");
class Process
{
    function Process()
    {
        /* User submitted login form */
        if(isset($_POST['sublogin']))
        {
            $this->procLogin();
        }
        else
        {
            header("Location: index.php");
        }
    }

    function procLogin()
    {
        global $form;
        /* Username error checking */
        $subuser = $_POST['user'];
        $subpass = $_POST['pass'];
        $field = "user";  //Use field name for username
        if(!$subuser || strlen($subuser = trim($subuser)) == 0)
        {
            $form->setError($field, "* Username not entered");
        }
        $field = "pass";  //Use field name for username
        if(!$subpass || strlen($subpass = trim($subpass)) == 0)
        {
            $form->setError($field, "* Password not entered");
        }
        /* Errors exist, have user correct them */
        if($form->num_errors > 0)
        {
            $_SESSION['value_array'] = $_POST;
            $_SESSION['error_array'] = $form->getErrorArray();
        }
        else
            $_SESSION['submit'] = true; // No errors, form can be submitted now

        header("Location: index.php");
    }
};

/* Initialize process */
$process = new Process;

?>

A file form.php is included in both the pages above. It includes various functions that are called by both the pages. Let us consider the following segment from process.php :

$subuser = $_POST['user'];
$field = "user";  //Use field name for username
if(!$subuser || strlen($subuser = trim($subuser)) == 0)
{
    $form->setError($field, "* Username not entered");
}

The ‘if’ condition validates whether the data posted under ‘user’ field is null or not. If the condition proves to be valid, the error message for the ‘user’ field is set to be ‘*Username not entered’. This is carried out by calling the function ‘$form->setError($field, “* Username not entered”);’ from the page form.php. Here ‘$field’ contains the name of the field, the data of which is being validated, followed by the message which needs to be set for the current field.

The contents of form.php goes like:

<?php
class Form
{
    var $values = array();    //Holds submitted form field values
    var $errors = array();  //Holds submitted form error messages
    var $num_errors;   //The number of errors in submitted form

    function Form()
    {
        session_start();
        /**
        * Get form value and error arrays, used when there
        * is an error with a user-submitted form.
        */
        if(isset($_SESSION['value_array']) && isset($_SESSION['error_array']))
        {
            $this->values = $_SESSION['value_array'];
            $this->errors = $_SESSION['error_array'];
            $this->num_errors = count($this->errors);

            unset($_SESSION['value_array']);
            unset($_SESSION['error_array']);
        }
        else
        {
            $this->num_errors = 0;
        }
    }

    /**
    * setError - Records new form error given the form
    * field name and the error message attached to it.
    */
    function setError($field, $errmsg)
    {
        $this->errors[$field] = $errmsg;
        $this->num_errors = count($this->errors);
    }

    /**
    * value - Returns the value attached to the given
    * field, if none exists, the empty string is returned.
    */
    function value($field)
    {
        if(array_key_exists($field,$this->values))
        {
            return htmlspecialchars(stripslashes($this->values[$field]));
        }
        else
        {
            return "";
        }
    }

    /**
    * error - Returns the error message attached to the
    * given field, if none exists, the empty string is returned.
    */
    function error($field)
    {
        if(array_key_exists($field,$this->errors))
        {
            return "<font size="2" color="#ff0000">".$this->errors[$field]."</font>";
        }
        else
        {
            return "";
        }
    }

    /* getErrorArray - Returns the array of error messages */
    function getErrorArray()
    {
        return $this->errors;
    }
};

/* Initialize form */
$form = new Form;

?>

A combination of these three pages: index.php, process.php, form.php will help you out in validating a forms data through PHP. Click here to download a working script.

Keep looking for more posts regarding PHP.

Php Tutorial 2 – Hello World Program

Welcome back to the tutorial 2, here we will start our programming in php. We will make different folders for different tutorials, so first make a Tutorial 2 folder in www directory. We will do our programming in notepad or for your use you may use different user friendly text editors like notepad ++. Php files have .php extension, index.php is the file which is automatically executed in a folder, so make a index.php in Tutorial 2 folder and type the below code in .

In a php file we can add HTML, CSS, JAVASCRIPT or anyother language so we have php tags which tell the server that the lines inside these tags are php codes, opening tag for php is <?php and closing tag is ?>

e.g.

<?php

……

code

……

?>

now lets code for a simple hello world program.

<html>

<head>

<title>Innovation Escalator Tutorial</title>

</head>

<body>

<?php

echo “Hello World”;

?>

</body>

</html>

echo command is used for printing, and each and every statement is terminated by a use of a semicolon.

Use of variables, loop and if conditions in php:

<?php

for($i=0;$i<10;$i++)

{

if($i%2 == 0)

echo “Hello<br>”;

}

?>

the above php code prints hello only when the value of variable i is even. In php we just use a $ sign before a variable moreover we don’t need to define the variable type its up to you what data type you want to store, its a kind of flexibility.

This is all about basic of php… wait for next. Till then if you have any queries you make post them.