Someone16

PHP: file_get_contents timeout

by someone16 on Oct.30, 2009, under Programming

How to set timeout when fetching content from web site with file_get_contents?
<?php
$context = stream_context_create(array('http' => array('timeout' > 1)));
echo file_get_contents("http://example.com/", 0, $context);
?>

It's a good idea to use it with timeout, because otherwise default timeout from php.ini will be used.
Leave a Comment :php more...

PayPal

by someone16 on Oct.29, 2009, under Life

PayPal is great. You can pay on the Internet without revealing your credit card information. I use it almost everywhere.



I just don't understand why the heck not every online shop supports it? Maybe they are worried about frauds? However, AFAIK PayPal can tell them if you are verified user or not. At least that's the case when using PayPal at GoDaddy.com.

With credit card, they get at least one information by which they can identify you ... and PayPal account can be opened by anyone. But on the other hand, one can easily steal credit card number, CCV and expiration date. So, it's PayPal really that insecure or is there actually no difference between those two?

BTW what's up with GoDaddy's $500 month limit?
Leave a Comment :paypal godaddy credit card payment more...

Home Automation

by someone16 on Oct.28, 2009, under

Nothing here ...
Leave a Comment : more...

RFM12B Module

by someone16 on Oct.28, 2009, under

In the following files you can find code for AVR micro controllers to use this modules.

Source (.c) file: hopeTx

Source (.c) file: hopeRx

PDF file: RFM12B

RFM12B and AVR - quick start
I found this tutorial when I searched for connecting this module to AVR.
You can download the tutorial at: PDF file: zenburn.net

My Experience
My attempts to get this module working were all unsuccessful.
3 comments :rfm12b avr electronics more...

Electronics

by someone16 on Oct.28, 2009, under

Nothing here yet.
Leave a Comment : more...

Webmaster Tools

by someone16 on Oct.28, 2009, under Life

Google usually makes good stuff, but I only had problems with it so far.

If I understand right, this is how it goes:

- I own a site or domain

- I add site to my Dashboard

- I verify site by uploading a file to the server or add A record in domain's DNS server

- I can do a lot of things with my domain, see search queries, who is linking me, etc.

Everything is simple to point, where I don't want a "disk space wasting" file. I just want everything tidy and clean, so I always delete unnecessary data/code/files. But if I delete this thing, then Google says that my website isn't verified. WTF??

Can't Google remember, that it had verified my site already? Cause I don't want to go trough all of these steps to verify my site again, every time I use webmaster tools.

Apart from this, Webmaster Tools have other problems too. For example, you cannot use "Change of address" feature with .eu domains. What's wrong with this TLD, Google?

Why the heck do I need to verify www and non-www address? Isn't that the same thing? I know that you can have different content on those two subdomains, but still ... who uses that? The best practice is to redirect it to one or another, this is good for SEO too.
Leave a Comment :Google Webmaster Tools domain tld dns more...

Windows VDS

by someone16 on Sep.20, 2009, under Uncategorized

Hi all,

I know my way around Linux server configuration and PHP programming, because I have a lot of experience. However, I always wanted to try programming in ASP.Net 3.5 and deploying that application to Windows Server 2008.

And so I rent Virtual Dedicated Server (apparently that's another name for Virtual Private Server) with Windows Server 2008 installed for 1 month. First of all, I had to get familiar with Windows way of work (point & click). I managed to get the idea about how to configure IIS and other tools. In Linux environment, you just connect to SSH and start typing commands. In Windows environment, you connect to a server via RDP. It's like working at a physical computer loaded with Windows.

After I successfully configured that, I started to "write" web site in ASP.Net. It is more clicking that writing source code. I had some previous experience in Classic ASP and ASP.Net 2.0, so it wasn't that hard. But more that I was programming that website, more I thought what's the point of this thing?

Yes, you can write applications, and usually you succeed. But what's with that clicking? I want to write code, not click through this and other wizard. I rented a VDS, so I guess there is no way back. And with that thought I continued with my work ... Until I realized that this is going nowhere. I rather use PHP and actually do the programming thing. Next thing is the cost. Linux VPS is not that expensive and Windows VPS can cost even a double the Linux VPS's price.

So a decision was made. Let's get back to PHP & Linux. And yes, I will cancel my Windows VPS.
2 comments : more...

Nokia Booklet 3G

by someone16 on Aug.24, 2009, under Computers

Nokia today announced their first laptop, Windows based Nokia Booklet 3G. The Nokia Booklet weighs 1.2 kilograms and is 2cm thick (as opposite to Apple MacBook Air which weights a little bit more but is thinner with it's 1.94 cm in height). It supposed to have 12 hour battery life, 10" glass HD-ready display and integrated GPS.

Key hardware information



  • Intel Atom Chipset (Z530 running at 1.6 Ghz). No fan, which means near silent running.

  • 120 GB hard disk

  • 3G / HSDPA and WiFi connectivity, plus integrated Bluetooth for local wireless communication

  • 12 hour battery life

  • 19.9 mm thick x 264 mm width x 185 mm depth

  • 10.1 inch glass HD ready display

  • Front facing video camera mounted, on top of the screen, for video calling

  • 1 x HDMI port (for HD video out), 1 x integarted SD card reader, 3 x USB ports, 1 x audio port

  • Integrated A-GPS

  • Stereo speakers mounted on the front right and left corners


Leave a Comment : more...

Your location online

by someone16 on Aug.22, 2009, under Computers

Hi,

If you have an iPhone and a MobileMe subscription it's very easy to publish your location online.

Firstly you need to turn on "Find My iPhone" function on iPhone in Settings application and you need to make sure you have data pushed to the iPhone.

Then you need a PHP class for fetching your iPhone location through me.com (http://clickontyler.com/blog/2009/06/sosumi-a-mobileme-scraper/).

Code for fetching data from the server:
// Get the iPhone location from MobileMe
echo "Fetching iPhone location...";
$mobileMe = new Sosumi ($mobileMeUsername, $mobileMePassword);
$iphoneLocation = $mobileMe->locate();
echo "got it.";
echo "iPhone location: $iphoneLocation->latitude, $iphoneLocation->longitude";
echo "iPhone accuracy: $iphoneLocation->accuracy";
echo "<br />";
if($iphoneLocation->latitude > 0) {
echo file_get_contents("http://example.com/update-location/?latitude=".$iphoneLocation->latitude."&longitude=".$iphoneLocation->longitude."&accuracy=".$iphoneLocation->accuracy."&key=auth-key");
}
// Now update Google Latitude
//echo "Updating Google Latitude...";
//$google->updateLatitude($iphoneLocation->latitude, $iphoneLocation->longitude,
//<span style="white-space: pre;"> $iphoneLocation->accuracy);
// All done.
echo "Done!";

<?php

include("sosumi.php");

$mobileMe = new Sosumi ("MobileMe User Name", "MobileMe Password");

$iphoneLocation = $mobileMe->locate();

if($iphoneLocation->latitude > 0) {

echo "iPhone location: $iphoneLocation->latitude, $iphoneLocation->longitude\
";

echo "iPhone accuracy: $iphoneLocation->accuracy";

}else{

echo "Error occured while fetching iPhone location data. Please try again later.";

}

?>


When you visit this script, you should see your iPhone location. So now you can display this data on your page or use Google Maps API to show it on the map.

If you are outdoors, your location is usually shown to a few feet accurate. On the other hand, indoors the GPS signal is weak and this feature is not really usable (accuracy is about 2000 of something - it can be off for about 1000 feet).
Leave a Comment :iPhone location php more...

About

by someone16 on Aug.21, 2009, under

Astrological Sign: Cancer

Music: Simple Plan, Linkin Park

TV Shows: NCIS, Numb3rs, Psych, The Mentalist, Fringe, Two and a Half Men

5 Last Movies I've Seen:

  • Dude, Where's My Car (2000)

  • Traitor (2008)

  • Eagle Eye (2008)

  • Burn After Reading (2008)

  • Pineapple Express (2008)

Leave a Comment : more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...