Thursday, 22 November 2012

FireFox Troubleshooting | Addon Disappeared | Extension Disabled

Hi Friends,

Last night i was updated my FF to v17 and faced some issues. That addons suddenly disappeared from my list.

So, if you face similar issue you can proceed like this (updating for linux - same goes for windows)

Step 1 - First check your add-on list at about:support if the things are visible there, then just start the firefox into safe mode and try to enable them.

Step 2 - To open firefox in safe mode enter this command in the terminal firefox -safe-mode and it will open firefox in safe mode, and check your extension list. If you are able to do it, then all good else proceed to next step.

Step 3 - Open error console (Ctrl+Shift+J) , and clear all the logs, Now try to open your addon manager.

Step 4 - If the error is caused due to any extension then try to delete it and delete all the files related to extensions, present in your profile (/home/<username>/.mozilla/firefox/<profile-name>/) (extension.ini & extension.sqlite).

Step 5 - Restart the FF. Hope it solves your issue.

Step 6 - If you are still facing the problem, then open about:support , reset your Firefox, the old data will get saved at your desktop.

Step 7 - Now open terminal and enter the command firefox -P and create the new Profile. -P is used to create, delete, rename the firefox profile and start the firefox profile. Copy the content from folder Old Data to New Profile.

Step 8 - Enjoy your Firefox, and do www.mozilla.org/plugincheck/ Plugins check. (recommended by firefox)

Have a nice day.

Aksshay Sharma
aksshay@live.in


Thursday, 15 November 2012

Make bootable USB of Windows 8 using DISKPART command, no 3rd party tool

So you want to make a bootable USB for windows 8, and don't want to use 3rd party tool.

So DISKPART utility is the solution of your problem.

Tools needed :-

1. Windows 8 DVD (Ofcourse, dont ask why :-P)
2. USB Drive (4GB or 8GB)

Steps to follow :-

Step 1 :- Open CMD (command prompt) using administrative privileges.
Step 2 :- Give the command DISKPART.
Step 3 :- Enter LIST DISK command & it will show all the drives present in your PC, hopefully your USB drive, if its working properly.
Step 4 :-Select your SELECT DISK X (Replace X with USB drive number).
Step 5:  Type CLEAN. It will delete all the information present on USB.
Step 6 :-  Enter CREATE PARTITION PRIMARY. For creating primary partition.
Step 7 :-  Enter SELECT PARTITION 1. Selects primary partition created above.
Step 8 :-  Enter FORMAT FS=FAT32 QUICK. Fast format the partition with FAT32 file system. You can skip QUICK, if you have so much of time. :-)
Step 9 :-  Enter ACTIVE. It activates the partition.
Step 10:-  Enter ASSIGN. It will assign drive letter to your USB.
Step 11:-  Enter EXIT. It will make your exit from DISKPART utility.
Step 12:- Insert your Windows 8 DVD in the DVD ROM.

Step 13:-  Now copy the contents, enter XCOPY A: B: /S/E/H/K/C. Replace A with DVD ROM drive letter and B with USB drive letter.
Step 14:-  Type EXIT to  exit from process. Exits copying section.Your USB is done and bootable now.
Step 15:- Go and intall windows 8. :-P

Thanks
Aksshay Sharma
aksshay@live.in

Tuesday, 13 November 2012

Transfer PDF files from PC to Nokia LUMIA. :-D


-->
Nokia Lumia – Easy, not the easiest :P way to transfer PDF files to your Phone, as there is no option in ZUNE, so its much better ;)
As i was using Nokia Lumia from past few months, and facing difficulties in synchronizing pdf files, I came up with the solution.
Tools required :-
  1. Wifi Connection.
  2. XAMPP (For creating server)
Step 1:- Download and install XAMPP. (Everything is provided there, even how to start it)
                 http://www.apachefriends.org/en/xampp-windows.html
Step 2:- Start the XAMPP.
Step 3:- Go to your C:\xampp\htdocs\ and delete all the contents from there.
Step 4:- Create a folder named Nokia-Lumia inside it.
Step 5:- Open cmd & find the IP(a.b.c.d) of your machine.

Step 6:- You are almost done. Copy all the PDF files into the Nokia-Lumia folder (You want to transfer to the phone).
Step 7:- Connect the phone with your wifi connection to the network.
Step 8:- Open Internet Explorer (IE) in your phone.
Step 9:- Go to http://a.b.c.d/Nokia-Lumia/ (in my case it is 192.168.1.10) you will find all your PDF files here, download them with speed of 54 Mbps :-D.
Step 10:- Start reading PDF in your phone.
Step 11:- For uploading, you need PHP script. Message me if required.

Thanks
AKSSHAY SHARMA
(aksshay@live.in)

Sunday, 6 November 2011

About Google

There are lots of interesting things about google, there are some easter eggs which you definitely try with google, so the first one is :-

1. Go to "google.com".
2. Type "Where is Chuck Norris".
3. Click on I'm feeling lucky.

And you will be amazed by the search result, google will respond/result a search written ...

Google won't search for Chuck Norris because it knows you don't find Chuck Norris, he finds you.


The second one 


1. Go to "google.com".
2. Type "z or r twice" ("do a barrell roll") without quotes.
3. Click on search.

You will be amazed by the result.

Ques- How google chrome invented?
Answer -  Google chrome logo is the idea borrowed from Microsoft , the following image will clear it.



So thats it.

Tuesday, 1 November 2011

Magic Square (Code PHP)

Hello Friends, in my previous post i discussed about the logic for Magic Square. In this post i am posting the code for Magic Square. Save the code in a file named code.php and upload it on your server and see the result. It will definitely work ;) Good luck

Code :-


@author - Aksshay
<html>
<head>
<title>
Magic Square
</title>
</head>
<body>
<!-- Take input from the user and
create the magic square of that dimesion --!>

<form action="code.php" method="GET">
<br />
Enter the dimension for magic square (2-9) :-
<br />
<input type="text" value="3" name="dime" />
<br />
<input type="submit" value="GO" />
</form>
</body>
</html>

<?php

// Magic square
// @ Author : aksshay


if(isset($_GET['dime']))
{
$dime = $_GET['dime'];
$number_of_elements = $dime * $dime;
$values = 1;

for ($row = 0; $row < $dime ; $row++)
    for ($column = 0; $column < $dime; $column++)
        $array_a[$row][$column] = $values++;
       
$middle = $dime/2;
$middle = ceil($middle) - 1;

for ($column = 0; $column<$dime; $column++)
    $array_b[$middle][$column] = $column+1;
   
$temp_b = $middle-1;

while($temp_b >= 0)
{
   
    for ($column = 0; $column < $dime; $column++)
    {
       
        if ((($array_b[$temp_b+1][$column])-1) != 0)
             $array_b[$temp_b][$column] = $array_b[$temp_b+1][$column]-1;
        else
             $array_b[$temp_b][$column] = $dime;   
                   
        }
       
    $temp_b--;
}
   
$temp_b = $middle+1;   
while($temp_b < $dime)
{
   
    for ($column = 0; $column < $dime;$column++)
    {
        if ((($array_b[$temp_b-1][$column])+1) <= $dime)
        $array_b[$temp_b][$column] = $array_b[$temp_b-1][$column]+1;
        else
        {
            $array_b[$temp_b][$column] = $array_b[$temp_b-1][$column]+ 1 - $dime;
                    }
       
        }
       
    $temp_b++;
}

$swape = $dime-1;
for ($row = 0; $row < $dime ; $row++)
{
    for ($column = 0; $column < $dime; $column++)
    {
        $array_c[$row][$column] = $array_b[$swape][$column];
}
$swape--;
}

for ($row = 0; $row < $dime ; $row++)
    for ($column = 0; $column < $dime; $column++)
    {   $row_element = $array_b[$row][$column]-1;
        $column_element = $array_c[$row][$column]-1;
        $magic_square[$row][$column] = $array_a[$row_element][$column_element];
     }
  
?>

<table align="center" width="500" height="100" cellpadding="2" cellspacing="2" bordercolorlight="#159C18">
<?
for ($row = 0; $row < $dime ; $row++)
{
    echo "<tr>";
    for ($column = 0; $column < $dime; $column++)
        echo  "<td>".$magic_square[$row][$column]."\t"."</td>";
    echo "</tr>";
        }
       
        ?>
        <br />
        </table>
        <?php
       
    
}

else
{
echo "Dimensions aren't set";
}
?>

Thanks.

Sunday, 30 October 2011

Magic Square

My next post is about Magic Square :-

What is Magic Square?

The magic square is matrix of n*n elements in which the addition of any row elements, column elements or diagonal elements will produce the same result.


There are many ways to generate the Magic Square, and the logic i used is explained below :-

There are 3 arrays.

1st array contains the number written in array, for example if we have to generate the 3*3 square , then array 1 contain these elements :-

1     2     3
4     5     6
7     8     9

Array 2nd is written in such a fashion that the middle column occupy the elements in order and its adjacent rows are incremented/decremented order.

3     1     2
1     2     3
2     3     1

Array 3rd is exactly the image of array 2nd, so the array 3rd is

2     1     3
3     2     1
1     3     2

Now with the help of these 3 arrays, we are able to create our magic square.

Magic Square [row][column] = Array 1 [array 2 [row][column]][array 2 [row][column]

 Magic Square [1][1] = Array1[3][2]

because, array2 [1][1] = 3, and array3 [1][1] = 2

So, in this manner we are able to calculate all the results. :)

Thats it. The code will be in my next post.

Thanks.

Saturday, 8 October 2011

The Starting of Journey

Well, i am starting this blog from the first entry i created at IVAN's My friend blog related to Image WaterMarking using PHP to protect your images from others.

So here is my first code

example below to make image watermarking using php:


<?php
//// By aksshay sharma - to create watermark images (runtime) using php
// Telling browser that the content is of image type
header('content-type: image/jpeg');
// Setting our watermark image (company logo)
$watermark_image = imagecreatefrompng('watermark_logo.png');
// Calculating Dimension of our watermark
$watermark_width = imagesx($watermark_image);
$watermark_height = imagesy($watermark_image);
$your_image = imagecreatetruecolor($watermark_width, $watermark_height);
//Set the image on which watermark is to be made
$your_image = imagecreatefromjpeg("my_image.jpg");
$size = getimagesize("my_image.jpg");
$final_x = $size[0] - $watermark_width - 5;
$final_y = $size[1] - $watermark_height - 5;
imagecopymerge($your_image, $watermark_image, $final_x, $final_y, 0, 0, $watermark_width, $watermark_height, 100);
// Generating image having watermark
imagejpeg($your_image);
// Destroying temporary images
imagedestroy($your_image);
imagedestroy($watermark_image);
?>

Example for watermark image with text using PHP:

<?php
//Using imagecopymerge() to create a translucent watermark
// Load the image on which watermark is to be applied
$original_image = imagecreatefromjpeg('pic.jpeg');


// First we create our watermark image manually from GD
$watermark = imagecreatetruecolor(100, 70);
$original_image = imagecreatefromjpeg('pic.jpeg');
//Set the hex color code for your watermark and dimension
imagestring($watermark, 5, 20, 20, 'Aksshay', 0xFFFFF);
imagestring($watermark, 3, 20, 40, 'Sharma', 0xFFFFF);


// Set the margins for the watermark and get the height/width of the watermark image
$marge_right = 10;
$marge_bottom = 10;
$sx = imagesx($watermark);
$sy = imagesy($watermark);


// Merge the watermark onto our photo with an opacity (transparency) of 50%
imagecopymerge($original_image, $watermark, imagesx($original_image) - $sx - $marge_right, imagesy($original_image) - $sy - $marge_bottom, 0, 0, imagesx($watermark), imagesy($watermark), 50);


// Save the image to file and free memory
imagepng($original_image, 'watermark_image.png');
imagedestroy($original_image);
?>


The first code will watermark an image with another image, so it’s like to stamp the other image with your digital sign. And the second example, it will stamp your image with your text. Basically the text will converted to image then stamp to the original image.

To use the code don’t forget to enable php gd library in your php.ini:

extension=php_gd2.dll

Note: Your watermark image is of 8-bit PNG. To make your image 8-bit PNG you can use imagemagik.

Copy the complete code from here -

Complete Code