Black Beauties for Techies

Today I am listing some of the black beauties of tech world. which every techies dream to buy. For me Black is a color of new technology and gadgets. Every year the Black Friday online circulars hit the Web and lots of sites round up every tech deal under the sun. Some of the big giants like Apple and Amazon comes with lots of offers on "Black Friday shopping event".

Following are Some of Gadgets actually worth getting excited.


1) iPhone 5s


1) iPhone 5s is the first 64‑bit smartphone in the world. And iOS 7 was designed with that in mind, built specifically for 64‑bit architecture.
2) Beautiful industrial design and superb build quality is matched with a phone that feels almost impossibly thin and light.
3) This is the fingerprint scanner that sits under the surface of the Home button. 
4) 4-inch IPS 1,136 x 640 pixel screen
5) iOS 7 was the biggest update to the system since its birth back in 2007.  It made the OS look and feel more modern, with a new design and better-looking screen transitions.
6) 64-bit dual-core 1.3GHz Apple A7, 1GB RAM, PowerVR G6430 GPU
7) 8-megapixel camera, 1/3.2-inch sensor, dual-LED ‘true tone’ flash

2) Apple iPad mini 2 Retina

1) The 7.9 inch IPS display. 2,048 x 1,536 pixels with a stunning 324 pixels per inch (ppi)
2) 64-bit A7 system-on-chip processor and 1GB RAM
3) Come with IOS 7
4) 5MP rear camera5) bigger battery, from 16.3 Wh to 23.8 Wh



3) MacBook Pro


1) OS X Mavericks. The world's most advanced desktop operating system.
2) Thin. Light. Powerful. There’s innovation in every nanometre.
3) With fourth-generation dual-core and quad-core Intel processors
4) Every new MacBook Pro comes with better-than-ever versions of iPhoto, iMovie, GarageBand, Pages, Numbers and Keynote.
5) the latest graphics, PCIe-based flash storage, 802.11ac Wi‑Fi


4) Nikon D5300 DSLR Camera


1) 24.2-megapixel DX-format CMOS sensor with the optical low pass filter (OLPF) removed to improve clarity and detail in images
2) 3.2-inch vari-angle LCD screen
3) capable of capturing images at a 5fps rate
4) built-in Wi-Fi, the Nikon D5300 can transmit images and videos to any iOS and Android smartphone or tablet
5) GPS function, images can also be geotagged


5) Xbox One with Kinect 2.0



1) Advanced motion sensor
2) Voice commands
3) come with a full 1080p RBG camera for HD detection that may help with facial recognition
4) Xbox One takes on set top TV boxes
5) Multitasking
6) HDMI-IN PORT


6) Programming Black Book collection




This is Specially For Computer Programmers. Black books is a awesome book series from DreamTech Publication. This books are solid introduction, written from the programmer s point of view that contains hundreds of examples covering every aspect of programming languages.
Some of the Black books are as Follows.
i) Java 6 Programming Black Book
ii) C, C++, C# Programming
iii) Java Server Programming JAVA EE 7
Read more: - http://www.dreamtechpress.com/

Hope you will like this post. Please Comment Your Suggestions to improve this blog contents.
Thank You.

0 comments :

force download file using php



By default most of the file types (eg: txt, jpg, png, gif, html, pdf, etc.) displayed in browser instead of download. But we can force browser to download these files instead of showing them.This tutorial goes over how to force file download in php.

<?php
   //file path to download
    $file_name=$_GET['file'];
    $outputfilename = "<DOWNLOAD_FILE_NAME>";
    header('Content-Description: File Transfer');
    //set content type
    header('Content-Type: application/octet-stream');
    //file name to save it may be different from original filename
    header("Content-Disposition:  attachment; filename=\"" . basename($outputfilename) . "\";" );
    //sends file size header to browser
    header('Content-Length: ' . filesize($file_name));
    header('Content-Transfer-Encoding: binary');
    header('Cache-Control: public');
    header('Pragma: public');
    ob_clean();
    //outputs file content to download stream
    readfile($file_name);
    exit;
?>

0 comments :

Add Google Plus Share Button to your site



Simple Tutorial to Create Google Plus Share Popup Window.

function shareongplus()
{
 var url2='https://plus.google.com/share?url='+encodeURIComponent("<URL_TO_SHARE>")+'&title='+encodeURIComponent('<TITLE_OF_SHARE>');

    newwindow=window.open(url2,'<TITLE_OF_POPUP>','height=450,width=650');
    if (window.focus) {newwindow.focus()}

}

Note :- You can use encodeURIComponent('Text To Encode') javascript function to encode text into url format.

0 comments :

Import csv file in mysql using php


This tutorial will go over how to import CSV ( comma separated value ) file data into Mysql Database using Php . 

CSV file is should be like below



<!-- form to submit csv file -->
<form enctype="multipart/form-data" method="post" role="form">
    <div class="form-group">
        <label for="exampleInputFile">File Upload</label>
        <input type="file" name="file" id="file" size="150">
        <p class="help-block">Only CSV File Import.</p>
    </div>
    <button type="submit" class="btn btn-default" name="Import" value="Import">Upload</button>
</form>


//php code to process csv file and store data into mysql database
<?php
if(isset($_POST["Import"]))
{
    //First we need to make a connection with the database
    $host='localhost'; // Host Name.
    $db_user= ''; //DB User Name
    $db_password= '';  //DB Password
    $db= ''; // Database Name.

    //Create connection with databse
    $conn=mysql_connect($host,$db_user,$db_password) or die (mysql_error());
    mysql_select_db($db) or die (mysql_error());
    echo $filename=$_FILES["file"]["tmp_name"];

    if($_FILES["file"]["size"] > 0)
    {
        $file = fopen($filename, "r");
$count = 0;
        while (($emapData = fgetcsv($file, 10000, ",")) !== FALSE)
        {
$count++;
                        // ignore first row for column names
if($count>1)
{
                                //insert into database
$sql = "INSERT into demo1(id,name) values ('$emapData[0]','$emapData[1]')";
mysql_query($sql);
}
        }
        fclose($file);
        echo 'CSV File has been successfully Imported';
    }
    else
        echo 'Invalid File:Please Upload CSV File';
}
?>

0 comments :

Export MS SQL SERVER data in MS Excel using php



This tutorial will go over how to download MS SQL Server data into Excel file. This is Very useful for generating Excel Reports of Php and MS SQL Server Applications. 

<?php
$myServer = "host_name";
$myUser = "user_name";
$myPass = "password";
$myDB =  "database_name";

//create an instance of the  ADO connection object
$conn = new COM ("ADODB.Connection") or die("Cannot start ADO");

//define connection string, specify database driver
$connStr = "PROVIDER=SQLOLEDB;SERVER=".$myServer.";UID=".$myUser.";PWD=".$myPass.";DATABASE=".$myDB;
$conn->open($connStr); //Open the connection to the database

//declare the SQL statement that will query the database
$query = "SELECT col1, col2, col3, .... , coln FROM table_name";

//execute the SQL statement and return records
$rs = $conn->execute($query);

$num_columns = $rs->Fields->Count();
//echo "col:".$num_columns . "<br>";

for ($i=0; $i < $num_columns; $i++) {
    $fld[$i] = $rs->Fields($i);
}

$contents="<table border='1'>";

while (!$rs->EOF)  //carry on looping through while there are records
{
    $contents.="<tr>";
    for ($i=0; $i < $num_columns; $i++) {
        $contents.="<td>" . $fld[$i]->value . "</td>";
    }
    $contents.="</tr>";
    $rs->MoveNext(); //move on to the next record
}

$contents.="</table>";

$file="File_name.xls";
$test="<table border=1><tr><td>Cell 1</td><td>Cell 2</td></tr></table>";
header("Content-type: application/vnd.ms-excel");
header("Content-Disposition: attachment; filename=File_name".date('Y-m-d').".xls");
echo $contents;

//close the connection and recordset objects freeing up resources
$rs->Close();
$conn->Close();

$rs = null;
$conn = null;
?>

2 comments :

Display MS Sql Server Data using PHP



This tutorial will go over how to Display MS SQL Server datausing PHP.

<?php
$myServer = "host_name";
$myUser = "user_name";
$myPass = "password";
$myDB =  "database_name";

//create an instance of the  ADO connection object
$conn = new COM ("ADODB.Connection") or die("Cannot start ADO");

//define connection string, specify database driver
$connStr = "PROVIDER=SQLOLEDB;SERVER=".$myServer.";UID=".$myUser.";PWD=".$myPass.";DATABASE=".$myDB;
$conn->open($connStr); //Open the connection to the database

//declare the SQL statement that will query the database
$query = "SELECT col1, col2, col3, .... , coln FROM table_name";

//execute the SQL statement and return records
$rs = $conn->execute($query);

$num_columns = $rs->Fields->Count();
//echo "col:".$num_columns . "<br>";

for ($i=0; $i < $num_columns; $i++)
{
    $fld[$i] = $rs->Fields($i);
}

echo "<table>";

while (!$rs->EOF)  //carry on looping through while there are records
{
    echo "<tr>";
    for ($i=0; $i < $num_columns; $i++) {
        echo "<td>" . $fld[$i]->value . "</td>";
    }
    echo "</tr>";
    $rs->MoveNext(); //move on to the next record
}

echo "</table>";

//close the connection and recordset objects freeing up resources
$rs->Close();
$conn->Close();

$rs = null;
$conn = null;
?>

0 comments :

Add a Pinterest button to site





Another Simple Tutorial to Add a Pinterest button to site.

Pins are like little bookmarks. Whenever you find something on the web that you want to keep, add it to Pinterest. If your site have multiple images and you want give facility to users to bookmark this images for later use. you can use this Pinterest plugin.

Steps to Add Pinterest Button to site.

1) Add following pinterest script to your site.

<script type="text/javascript" src="//assets.pinterest.com/js/pinit.js"></script>

2) Create pin it button using simple Anchor Tag.

<a href="//www.pinterest.com/pin/create/button/?url=<SITE_URL>&media=<IMAGE_TO_PIN_IT>&description=<DESCRIPTION_TO_SHARE>" data-pin-do="buttonPin" data-pin-config="above"  target="_blank"><img src="images/btn_pinit.png" class="shares" ></a>

Its done. :)

for more information visit:- http://business.pinterest.com/widget-builder/#do_pin_it_button

Note :- You can use encodeURIComponent('Text To Encode') javascript function to encode text into url format.

0 comments :

Send Facebook Notification via Graph API using PHP



function fbnotification($userid,$message)
{
$app_id = "<APPLICATION_ID>";
$app_secret = "<APPLICATION_SECRET_KEY>";
$app_access_token = $app_id . '|' . $app_secret;

$facebook = new Facebook(array(
'appId'  => $app_id,
'secret' => $app_secret,
'cookie' => true,
));

$response = $facebook->api( '/'.$userid.'/notifications', 'POST', array(
'template' => $message,
'access_token' => $app_access_token
) );  
}

fbnotification($userid,$message)

0 comments :

Add LinkedIn Share Button




Simple Tutorial to Create LinkedIn Share Popup Window.

Sharing Any article on linkedin via your site or a web page is very simple. just follow below simple steps. linkedpopup() functions create a popup window for sharing content.

function linkedpopup()
{
var url1='http://www.linkedin.com/shareArticle?mini=true&url=<LINK_TO_SHARE>&title=<TITLE_TO_SHARE>&summary=<DESCRIPTION_TO_SHARE>&source=<YOUR_WEBSITE_NAME>';
      newwindow=window.open(url1,'<TITLE_OF_POPUP>','height=450,width=650');
      if (window.focus) {newwindow.focus()}

}

Parameter List:--

Parameter

Character Limit Description
mini

4 Must always be true
url

1024 The permanent link to the article. Must be URL encoded
title

200 The title of the article. Must be URL encoded
source

200 The source of the article. Must be URL encoded. Example: Wired Magazine
summary

256 A brief summary of the article. Must be URL encoded. Longer titles will be truncated gracefully with ellipses.


for more information visit:- http://developer.linkedin.com/documents/share-linkedin

Note :- You can use encodeURIComponent('Text To Encode') javascript function to encode text into url format.

0 comments :

Twitter tweet button



Simple Tutorial to Create Twitter Share Popup Window.

tweetpopup() function helps your visitor to create popup for tweeting content and connect on twitter.

function tweetpopup() 
{
      var url2='https://twitter.com/intent/tweet?hashtags=<HASHTAG>&text=<TEXT_TO_TWEET>&url=<URL_TO_TWEET>&via=<HANDLE_FOR_TWEET>';

      newwindow=window.open(url2,<TITLE_OF_POPUP>','height=450,width=650');
      if (window.focus) {newwindow.focus()}

}

for more information visit:- https://about.twitter.com/resources/buttons#tweet

Note :- You can use encodeURIComponent('Text To Encode') javascript function to encode text into url format.

0 comments :

Add facebook share button




Simple Tutorial to Create Facebook Share Popup Window.

function facebookshare()
{
var url2='http://www.facebook.com/sharer.php?s=100&p[title]='+encodeURIComponent(' TITLE_OF_SHARE') + '&p[summary]=' + encodeURIComponent(' DESCRIPTION_TO_SHARE') + '&p[url]=' + encodeURIComponent(' URL_TO_SHARE ') + '&p[images][0]=' + encodeURIComponent(' IMAGE_TO_SHARE');
newwindow=window.open(url2," POPUP_WINDOW_HEADING",'height=480,width=680');
if (window.focus) {newwindow.focus()}

}

Note :- You can use encodeURIComponent('Text To Encode') javascript function to encode text into url format.

0 comments :

Export Mysql Table in XML using php



This tutorial will go over how to download Mysql Table into XML file. This is Very useful for generating XML Data files when you have to work with javascript to get data.

<?php
$conn = mysql_connect('localhost', 'user_name','password');
mysql_select_db('database_name');
$xml = '';

//query the db
$query = mysql_query("SELECT col1, col2, col3, col4 FROM TableName");
    $xml .='<main>';
//loop through query results
while ( $row = mysql_fetch_array ( $query ) )
{
 //Add to xml
$xml .= '<group>';
 $xml .= '<col1><![CDATA[' . $row['col1'] . ']]></col1>'; 
$xml .= '<col2><![CDATA[' . $row['col2'] . ']]></col2>'; 
 $xml .= '<col3><![CDATA[' . $row['col3'] . ']]></col3>'; 
$xml .= '<col4 ><![CDATA[' . $row['col4 '] . ']]></col4 >'; 
$xml .= '</group>';
}

    $xml .='</main>'; 

//Write to xml and override
$handle = fopen('data.xml', 'w+');
fwrite($handle, $xml);
?>

Note:- Please Assign 777 permission to folder to write file into it.

0 comments :

Simulating Pencil Tool in AS3



var drawing:Boolean = false;
this.graphics.lineStyle(1, 0x000000);
this.graphics.moveTo(mouseX, mouseY);
this.addEventListener(Event.ENTER_FRAME, onLoop, false, 0, true);
stage.addEventListener(MouseEvent.MOUSE_DOWN, onDown, false, 0,true);
stage.addEventListener(MouseEvent.MOUSE_UP, onUp, false, 0, true);

function onDown(evt:MouseEvent):void
{
     drawing = true;
}
function onUp(evt:MouseEvent):void
{
     drawing = false;
}

function onLoop(evt:Event):void
{
     if (drawing)
     {
          this.graphics.lineTo(mouseX, mouseY);
     }
     else
     {
          this.graphics.moveTo(mouseX, mouseY);
     }
}

0 comments :

Get long lived access_token for facebook pages


Facebook API’s allows a developer to update a cover photo of a page through code. I am creating a Live Cover photo change App for One of the client. this apps mechanism is to change cover photo depending on the no of likes of page.

for such type of apps. you need a long lived access_token so you can run a script from server itself.

Following it the step-by-step process.

1)   Make Sure you are the admin of FB Page.
2)   Create a FB App with same user account.
4)   On the Top Right , Select the FB App you created from the "Application" drop down list.
5)   Click "Get Access Token" Button.
    Select Permission Window will open.
6)   Click on "Extended Permission" Tab and Check "manage_pages" permission
7)   type "me/accounts" in FQL Query Box.
    It show you complete listing of page details like category, name, access_token, permissions..
    This Access token is short-lived-token. you have to convert this short live token to long lived token.
8)   https://graph.facebook.com/oauth/access_token?client_id={fb_app id}&client_secret={fb_app_secret}&grant_type=fb_exchange_token&fb_exchange_token={short-lived-access_token}
9)   Grab the new long-lived access token.
10) Make A Graph API call to see your account using the new long-lived access token
      https://graph.facebook.com/me/accounts?access_token={your_long_lived_access_token}
11) Grab the access_token for the page.
12) You can use following link to https://developers.facebook.com/tools/debug/  to get Access Token Info. 
It will provide info like Application ID, Profile ID, User ID, Issued, Expires, Scopes etc.

This step-by-step process will give you Long Lived Access Tokens.


0 comments :