- Password you stored in Web Browsers (Google Chrome, Chromium)
- Passwords stored in Chat and Mail Applications (Empathy, Pidgin, Evolution)
- and other passwords
This passwords should be unlocked each time you login but won’t automatically unlock when you login. To automatically unlock you can do as follows:
Open Terminal (CTRL + ALT + T) and do the following command:
Facebook Hacker Cup 2013:Beautiful Strings solution in PHP
$ip = fopen(‘input.txt‘, "r");
... [READ MORE]
$test_cases = trim(fgets($ip));
$c=1;
while($c!= $test_cases+1){
$case=preg_replace(‘/[^a-z]+/’, ", strtolower(trim(fgets($ip))));
$vals=array_count_values(str_split($case));
arsort($vals);
$beauty=26;
$max_b=0;
foreach($vals as $v){
$max_b +=$v*$beauty;
$beauty–;
}
print("Case #".$c.": ".$max_b);
if($c < $test_cases){
print("
");
}
$c++;
}
Advanced Rest Client : Create and Test custom HTTP requests.
You can also attach a file to the form. Ain’t that Awesome.
Every web developer must have this app. Install it from Chrome Webstore
Features
- – Integrated with Google Drive
- – It’s own backend service to store and share data between coworkers
- – convenient HTTP headers and payload editor thanks CodeMirror
- – Make a HTTP request (via XmlHttpRequest level 2)
- – Debug socket (via web socket API).
- – JSON response viewer
- – XML response viewer
- – set custom headers – even does not supported by XmlHttpRequest object
- – help with filling HTTP headers (hint + code completion)
- – add headers list as raw data or via form
- – construct POST or PUT body via raw input, form or send file(s) with request
- – set custom form encoding
- – remember latest request (save current form state and restore on load)
- – save (Ctrl+S) and open (Ctrl+O) saved request forms
- – history support
- – data import/export
... [READ MORE]
Connecting database to both mysqli and mysql entension
Create a file named config.php where you will connect to the database. Put the following code in it:
... [READ MORE]
$mysqli = new mysqli("localhost", "username", "password", "db");
if ($mysqli->connect_errno) {
echo "Failed to connect to MySQL: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error;
}
$bd = mysql_connect("localhost", "username", "password") or die(mysql_error());
mysql_select_db("db",$bd) or die(mysql_error());
?>
Check whether mysqli connection is made or not in php
if ($mysqli->ping()) {
echo ("Our connection is ok!n");
} else {
printf ("Error: %sn", $mysqli->error);
}
Hide File Extensions In Browsers Using .htaccess
Many of us programmers want to hide the file extension of server files such as .php, .jsp, .py etc….
<span style="background-color: white; font-family: inherit;"><span class="kw1" style="border: 0px; color: #2060a0; line-height: 18.200000762939453px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; white-space: nowrap;">RewriteEngine</span><span style="line-height: 18.200000762939453px; white-space: nowrap;"> </span><span class="kw2" style="border: 0px; color: #2060a0; line-height: 18.200000762939453px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; white-space: nowrap;">on</span></span>
<span style="background-color: white; font-family: inherit;"><span class="kw1" style="border: 0px; color: #2060a0; line-height: 18.200000762939453px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; white-space: nowrap;">RewriteCond</span><span style="line-height: 18.200000762939453px; white-space: nowrap;"> %{REQUEST_FILENAME} !-d</span></span>
<span style="background-color: white; font-family: inherit;"><span class="kw1" style="border: 0px; color: #2060a0; line-height: 18.200000762939453px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; white-space: nowrap;">RewriteCond</span><span style="line-height: 18.200000762939453px; white-space: nowrap;"> %{REQUEST_FILENAME}.php -f</span></span>
<span style="background-color: white; font-family: inherit;"><span class="kw1" style="border: 0px; color: #2060a0; line-height: 18.200000762939453px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; white-space: nowrap;">RewriteRule</span><span style="line-height: 18.200000762939453px; white-space: nowrap;"> .* $0.php</span></span>
<span class="kw1" style="border: 0px; color: #2060a0; line-height: 18.200000762939453px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; white-space: nowrap;">RewriteCond</span><span style="line-height: 18.200000762939453px; white-space: nowrap;"> %{REQUEST_FILENAME}.php -f</span>
HTML
<span class="kw1" style="border: 0px; color: #2060a0; line-height: 18.200000762939453px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; white-space: nowrap;">RewriteCond</span><span style="line-height: 18.200000762939453px; white-space: nowrap;"> %{REQUEST_FILENAME}.html -f</span>
JSP
<span class="kw1" style="border: 0px; color: #2060a0; line-height: 18.200000762939453px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; white-space: nowrap;">RewriteCond</span><span style="line-height: 18.200000762939453px; white-space: nowrap;"> %{REQUEST_FILENAME}.jsp -f</span>
ASP
<span class="kw1" style="border: 0px; color: #2060a0; line-height: 18.200000762939453px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; white-space: nowrap;">RewriteCond</span><span style="line-height: 18.200000762939453px; white-space: nowrap;"> %{REQUEST_FILENAME}.asp -f</span>
PY
<span class="kw1" style="border: 0px; color: #2060a0; line-height: 18.200000762939453px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; white-space: nowrap;">RewriteCond</span><span style="line-height: 18.200000762939453px; white-space: nowrap;"> %{REQUEST_FILENAME}.py -f</span>
JS
<span class="kw1" style="border: 0px; color: #2060a0; line-height: 18.200000762939453px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; white-space: nowrap;">RewriteCond</span><span style="line-height: 18.200000762939453px; white-space: nowrap;"> %{REQUEST_FILENAME}.js -f</span>
<span style="color: #2060a0;">RewriteRule </span>(.*).<span style="color: red;">html</span> $1 [R=301,NC]
Create Facebook Like System With jQuery, MySQL, PDO In PHP
Facebook have it’s own like system which pretty good. This post will tell you how to create a "Like system" like that of Facebook. All you have to need is jQuery, MySQL Database and PDO PHP extension. This technic is partially used in my social network, Open. See the demo there in the social network. But you have to signup.
<div>
<span style="color: red; font-family: inherit;">The table should be like this:</span>
</div>
Friendshood Update new feature – Post to Facebook
It was not quite easy. It was hard to make Picture uploading function along with the normal status update. Next I’m gonna implement twitter posting from Friendshood.
I’m gonna tell you how to post a status update in the following posts. Wait for it.
... [READ MORE]How to get Facebook PHP SDK and install it
Extract the folder src in the zip file to a folder named fbsdk in the home directory of your app.
Installation
There is no installation. You can run the functions in the file if you put this line at top of each file you run the SDK functions :
include(‘fbsdk/facebook.php’);
Facebook SDK requires the following to work properly :
- JSON PHP extension.
- CURL PHP extension.
How to get Current Time and date in Javascript
function ctime(){
var currentdate = new Date();
var time=currentdate.getFullYear()+"-"+(currentdate.getMonth()+1)+"-"+currentdate.getDate()+" "+currentdate.getHours()+":"+currentdate.getMinutes()+":"+currentdate.getSeconds();
return time;
}