Are you getting error code 67 when you try to share the Sprint Vision network on your phone with your computer (via USB or Bluetooth?) Here is the fix that actually works (tested on HTC Snap).
1) Download and install CE Registry Editor at http://ceregeditor.mdsoft.pl/ceregedit_setup.exe
[Mirror: http://www.4shared.com/file/131961139/a8a6fa59/ceregedit_setup.html]
2) Connect your phone to your computer via USB.
3) Run CE Registry Editor. In the top menu, click Connection -> Connect.
4) Navigate to the key "HKEY_LOCAL_MACHINE\Comm\InternetSharing\Settings"
5) The key "ForceCellConnection" should be set to "Phone as Modem". That is bad. Right click on the key, click "edit", and change the value to "Sprint PCS" (no quotes).
6) Click OK.
7) On the top menu, select File -> Save.
This should allow you to tether your HTC devices to your computer (like I said, tested on HTC Snap)
Friday, September 11, 2009
Tuesday, August 4, 2009
PHP - Get a list of a particular day of the week between two dates
This is a modified version of function in the previous post. I had to modify it for a project I was doing.
****************************************************************************
function dayOfWeekListDateRange($start, $end, $day_of_week)
{
$range = array();
if (is_string($start) === true) $start = strtotime($start);
if (is_string($end) === true ) $end = strtotime($end);
if(!empty($day_of_week))
{
do
{
if(strcmp(strtolower(strftime("%A",$start)),strtolower($day_of_week)) == 0)
{
$range[] = date('Y-m-d', $start);
$start = strtotime("+ 1 day", $start);
}
else $start = strtotime("+ 1 day", $start);
}
while($start <= $end);
}
else
{
do
{
$range[] = date('Y-m-d', $start);
$start = strtotime("+ 1 day", $start);
}
while($start <= $end);
}
return $range;
}
****************************************************************************
function dayOfWeekListDateRange($start, $end, $day_of_week)
{
$range = array();
if (is_string($start) === true) $start = strtotime($start);
if (is_string($end) === true ) $end = strtotime($end);
if(!empty($day_of_week))
{
do
{
if(strcmp(strtolower(strftime("%A",$start)),strtolower($day_of_week)) == 0)
{
$range[] = date('Y-m-d', $start);
$start = strtotime("+ 1 day", $start);
}
else $start = strtotime("+ 1 day", $start);
}
while($start <= $end);
}
else
{
do
{
$range[] = date('Y-m-d', $start);
$start = strtotime("+ 1 day", $start);
}
while($start <= $end);
}
return $range;
}
PHP - Get a range of dates between two dates
function dateRangeArray($start, $end)
{
$range = array();
if (is_string($start) === true) $start = strtotime($start);
if (is_string($end) === true ) $end = strtotime($end);
do {
$range[] = date('Y-m-d', $start);
$start = strtotime("+ 1 day", $start);
} while($start <= $end);
return $range;
}
Credit: http://boonedocks.net/mike/archives/137-Creating-a-Date-Range-Array-with-PHP.html
{
$range = array();
if (is_string($start) === true) $start = strtotime($start);
if (is_string($end) === true ) $end = strtotime($end);
do {
$range[] = date('Y-m-d', $start);
$start = strtotime("+ 1 day", $start);
} while($start <= $end);
return $range;
}
Credit: http://boonedocks.net/mike/archives/137-Creating-a-Date-Range-Array-with-PHP.html
PHP - Serialize an array for use in a MySQL table
This is the function I made to "serialize" a PHP array for dumping into a MySQL table into a readable, searchable format. It separates each value with an uncommon character , "|".
When you grab the "serialized" data out of the DB later, you should run the following to convert it back to an array --
$values_array = explode("|", $seralizedValues);
I'm aware that there is a PHP function to serialize data, but I wanted to make my own simpler, easier version that did not insert the array keys or any other junk into the array. Take it to leave it.
*******************************************************
function serializeArray($arr)
{
$temp = "";
if(!empty($arr))
{
$iter = 0;
$arr_size = count($arr);
foreach ($arr as $item)
{
$iter++;
$temp.=$item;
if($iter!==$arr_size) $temp.="|";
}
}
return $temp;
}
When you grab the "serialized" data out of the DB later, you should run the following to convert it back to an array --
$values_array = explode("|", $seralizedValues);
I'm aware that there is a PHP function to serialize data, but I wanted to make my own simpler, easier version that did not insert the array keys or any other junk into the array. Take it to leave it.
*******************************************************
function serializeArray($arr)
{
$temp = "";
if(!empty($arr))
{
$iter = 0;
$arr_size = count($arr);
foreach ($arr as $item)
{
$iter++;
$temp.=$item;
if($iter!==$arr_size) $temp.="|";
}
}
return $temp;
}
PHP - Format a variable for a MySQL query
This is my personal, very simple function I use to get a variable ready for use in a MySQL query.
*****************************************************
function sqlformat($var)
{
return "'".addslashes(trim($var))."'";
}
*****************************************************
function sqlformat($var)
{
return "'".addslashes(trim($var))."'";
}
PHP - Find min and max values in an array
/**
signature
array getMinMax( array )
returns an associative array with:
'min' -> smallest value in the given array
'max' -> greatest value in the given array
if the array is empty both fields are NULL
*/
function getMinMax($array)
{
reset($array);
if(FALSE === key($array))
{
return array('min' => NULL, 'max' => NULL);
}
$min = $max = current($array);
$val = next($array);
while(NULL !== key($array))
{
if($val > $max)
{
$max = $val;
}
elseif($val < $min)
{
$min = $val;
}
$val = next($array);
}
return array('min' => $min, 'max' => $max);
}
Usage:
$min_max_arr = getMinMax($myarray);
$min_val = $min_max_arr['min'];
$max_val = $min_max_arr['max'];(found here -- http://www.codingforums.com/showthread.php?t=130494)
Example application -- If you had an array of dates, you could turn each entry into a timestamp, run the array of timestamps through this function, and get the minimum and maximum timestamps. Then you could simply convert the min and max timestamps back to a string (using something like strftime).
Wednesday, April 29, 2009
Why the Swine Flu is more dangerous than the regular flu
Why is this strain dangerous?
*******************************
There are three reasons why this issue is more serious than the regular flu.
a) The main issue with this strain is that no one has a natural immunity to it, because it has never really been seen before this point in time in it's current genetic form. And a vaccine can take months to develop. Vaccines generally take at least 9 months to develop under normal conditions, and even the accelerated development of the vaccines for this strain will take until at least September to develop. You can see where problems are going to arise. People are just going to keep on catching it and not fighting it of effectively, and then pass it on to others, because we have nothing to fight it off completely yet. To be more specific, this new strain has taken on genetic elements from animal viruses, potentially making it (genetically) unique enough to pose a pandemic threat. Experts say that our current seasonal flu vaccines are not going to be effective against this strain at all.
b) This particular strain seems to attack the young and healthy, rather than the sickly, old, or extremely young. The people who died in Mexico were younger (healthy people in their 20s, 30s, and 40s). The problem with this is that when a virus attacks healthy people preferentially, it suggests that the strain is completely new and is causing overreactions in the immune system. Basically, the logic is that this strain is causing the body to create abnormally large numbers of normally helpful inflammatory antibodies, which are so abundant that they actually end up causing more harm than good. This is exactly what happened with the bird flu fairly recently.
c) It's all about the potential ... it's not about what's happening right now. Even though most of the cases so far in the United States have not been very serious (except for that one kid who died), the virus spreading across the U.S. is identical to the strain of the virus that is killing people in Mexico (genetically speaking), meaning that the possibility that there could be similar deaths in the U.S. is not completely unfathomable.
What is the main alarm bell?
******************************
Sudden onset fever. Watch out for this in particular.
Are there are signs of hope?
****************************
Influenza strains don't like the heat of summer. So this issue is going to die out somewhat (or significantly) during the summer months. This gives us a short window of a few months to develop a vaccine as rapidly as possible.
What's the best way to prevent getting this?
************************************ *********
All we can really do is use hand sanitizers and wash our hands with soap whenever we touch a public surface. Also, if you suspect someone has the flu around you, get at least 3 - 6 feet the heck away from them.
*******************************
There are three reasons why this issue is more serious than the regular flu.
a) The main issue with this strain is that no one has a natural immunity to it, because it has never really been seen before this point in time in it's current genetic form. And a vaccine can take months to develop. Vaccines generally take at least 9 months to develop under normal conditions, and even the accelerated development of the vaccines for this strain will take until at least September to develop. You can see where problems are going to arise. People are just going to keep on catching it and not fighting it of effectively, and then pass it on to others, because we have nothing to fight it off completely yet. To be more specific, this new strain has taken on genetic elements from animal viruses, potentially making it (genetically) unique enough to pose a pandemic threat. Experts say that our current seasonal flu vaccines are not going to be effective against this strain at all.
b) This particular strain seems to attack the young and healthy, rather than the sickly, old, or extremely young. The people who died in Mexico were younger (healthy people in their 20s, 30s, and 40s). The problem with this is that when a virus attacks healthy people preferentially, it suggests that the strain is completely new and is causing overreactions in the immune system. Basically, the logic is that this strain is causing the body to create abnormally large numbers of normally helpful inflammatory antibodies, which are so abundant that they actually end up causing more harm than good. This is exactly what happened with the bird flu fairly recently.
c) It's all about the potential ... it's not about what's happening right now. Even though most of the cases so far in the United States have not been very serious (except for that one kid who died), the virus spreading across the U.S. is identical to the strain of the virus that is killing people in Mexico (genetically speaking), meaning that the possibility that there could be similar deaths in the U.S. is not completely unfathomable.
What is the main alarm bell?
******************************
Sudden onset fever. Watch out for this in particular.
Are there are signs of hope?
****************************
Influenza strains don't like the heat of summer. So this issue is going to die out somewhat (or significantly) during the summer months. This gives us a short window of a few months to develop a vaccine as rapidly as possible.
What's the best way to prevent getting this?
**************************
All we can really do is use hand sanitizers and wash our hands with soap whenever we touch a public surface. Also, if you suspect someone has the flu around you, get at least 3 - 6 feet the heck away from them.
Subscribe to:
Posts (Atom)