Recommended TV

I just picked up my first Smart TV. This hooks up to my Galaxy S3 flawlessly. Here is a link and I would recommend without hesitation. Samsung UN40H5003 40-Inch 1080p 60Hz LED TV

My other toy is this Sound Bar. This hooks hooks up to TV and my Galaxy S3. I priced an Samsung Sound Bar but they wanted $249.99. I got this for $79.88 and it’s rated at 150W. Innovative Technology ITSB-201-37 37-Inch Bluetooth Soundbar

All I want for Christmas is this monitor for my Window 7 computer. Dell Computer S2240T Touch Panel H6V56 21.5-Inch Screen LED-lit Monitor

Check these Laptops out. Up to 40% off

Updated Wallpaper Calculator

WallpaperCal

Doing some home improvements. Here is a Wallpaper Calculator which will calculate how many rolls of wallpaper needed to do a room. I use a standard roll width of 21 inches and roll length of 396 inches in calculations but this can be changed. This also calculated with 5% waste. The price is a $1 and is easy to use. Goto Window 7 Apps on top menu.

Updated Password Generator

PasswordGenerator
I revamped my Password Generator it was too plain. It is still the same old simple password generator. Watch demo below to see basic operation. In demo I insert the copyright symbol which is Alt 0169 and the bullet symbol which is Alt 0149. One note when picking from Char. Map look for a ALT alternative. Press the <ALT> key followed by the numerical value given in chart(ex. <Alt> 0169 will produce ©).

Watch Demo

Belmont Stakes was good to me

My horse grading app is coming out really good. I have modified it since last year. Here is what it looks like now.

MyApp

As you can see I added a few more fields. Using only 40 dollars I hit the win and exactor and made over a thousand dollars. This app picked the Kentucky Derby, Preakness and Belmont winners. I knew to key in Chrome for the first two races and told everyone Chrome was going to get beat in Belmont and #11-Tonalist was my horse. Here is me enjoying my winnings. I actually would of hit tri and super too but I was tight on money. If I invested another $40 dollars and played tri and supper I would have made $7700.00 on top of my winnings.

Belmont_Stakes_2014My goal is to have this app on my site for purchase next year for the Kentucky Derby. The app will sell for 1 to 2 dollars. Here are a few things I am going to try to add to app. Better instructions and a graph so you have a visualization of who is  going to win.

Sorry, I can’t keep ftp downloads free

Up to this point all my programs were free using anonymous ftp. This is changing. I am going to imperilment a micro charge for any of my apps. All my apps will be under $10 and I am trying to set a goal of 1 to 2 bucks. I been operating this blog for a few years with no major comments concerning my apps.  Shutting down my ftp will come with regret but I feel people just use or get programs without leaving a comment or any questions about any of my apps. I will leave ftp open until I can develop my store page for my apps.

 

Thanks — Jim

Write an XML File

<?php
require("config.php");

// version and encoding;
$dom = new DomDocument("1.0", "ISO-8859-1");

// we create a XML Node 
$usersElem = $dom->createElement('users');

// Select all the rows in the names table
$query = "SELECT * FROM names";
$result = mysql_query($query);

if (!$result) {
die('Invalid query: ' . mysql_error());
}
// Loop through the rows, adding XML nodes
while ($row = @mysql_fetch_assoc($result)){

$usersElem->appendChild ( $dom->createElement('firstname', $row['firstname']) );
$usersElem->appendChild ( $dom->createElement('lastname', $row['lastname']) );
$usersElem->appendChild ( $dom->createElement('password', $row['password']) );
}
// add $usersElem to dom
$dom->appendChild( $usersElem );

// $dom has entire XML
$dom->formatOutput = true; // this adds spaces, new lines 
// save it as XML
$xmlSave = $dom->save('users.xml'); // returns true/false upon failure or success

if($xmlSave == false)
echo " Sorry you had a problem! ";
else
{
echo " File created! " . "<br>";

}

?>
<html>
<head>
<title> Demo : Write XML File </title>
<style>
li.L0, li.L1, li.L2, li.L3,
li.L5, li.L6, li.L7, li.L8
{ list-style-type: decimal !important }
</style>
</head>
<body>
<script src="https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js"></script>
<pre class="prettyprint linenums">
<code class="language-xml"><?php echo htmlspecialchars(file_get_contents("users.xml"), ENT_QUOTES); ?></code>
</pre>
</body>
</html>

This is basic example of writing an XML file in php. You can pretty it up with prettify.js.

JavaScript Calculator

JavaScriptCal

 

This is a mobile app which is a JavaScript Calculator. It has all the properties and methods options available. The result will be  displayed as you’re typing in a formula. An example is var a = 85; var b=72;Math.max(a,b) will result in 85. This calculator could easily be used for  algebra and most formulas. This is still in beta stage but has been released  for feedback.View Now!

Snapshot 3

Snapshot3I revamped Snapshot and made a delay timer and automated the whole snapshot process. I felt that all I really wanted was the end result the difference between Snapshot1 and Snapshot2.. With this change now all you need to know is how much delay do you want between the two snapshots. I find I can install new programs in less then 8 minutes but you can set a delay up till an hour. This program is ideal to use during any new program to monitor where and what is being installed. You still need Cygwin and some of the default basic install to use this program but it’s well worth it.

 

Insert MYSQL data into HTML Textarea

mysql_into_textarea
Follow the link below, the link will open new page to my demonstration.Insert MYSQL into Textarea

The concept is very easy and the main PHP code is below.

<html>
<head>

<?php
//make an object array
$arrayobj = new ArrayObject();
//connect to database
$con=mysqli_connect("localhost","username","password","db");
//check connection
if(mysqli_connect_errno())
{
echo "Failed to connect to MySQL:".mysqli_connect_error();
}

$result=mysqli_query($con,"SELECT * FROM table");

while($row=mysqli_fetch_array($result))
{
$arrayobj->append($row['firstname']);
}

mysqli_close($con);
?>

</head>
<body>
<textarea id="myTextarea" rows="25" cols="25"><?php foreach($arrayobj as $value){
echo $value . "\n";}?>
</textarea>
<br>

</body>
</html>

As you can see connecting to database is as usual. The key is the $arrayobj = new ArrayObject() which make this string into an array and the $arrayobj->append (appends) to that array.

Let’s turn this Ajax, PHP example into Mobil App

Let’s look at this example http://www.w3schools.com/php/php_ajax_php.asp. Click Here. I modified and changed some of the names in that code but most of it is the same.

Create a file called get_teams.php:

<?php
// Fill up array with names

$a[]='ARI|Arizona Cardinals|NFC-West';
$a[]='ATL|Atlanta Falcons|NFC-South';
$a[]='BAL|Baltimore Ravens|AFC-North';
$a[]='BUF|Buffalo Bills|AFC-East';
$a[]='CAR|Carolina Panthers|NFC-South';
$a[]='CHI|Chicago Bears|NFC-North';
$a[]='CIN|Cincinnati Bengals|AFC-North';
$a[]='CLE|Cleveland Browns|AFC-North';
$a[]='DAL|Dallas Cowboys|NFC-East';
$a[]='DEN|Denver Broncos|AFC-West';
$a[]='DET|Detroit Lions|NFC-North';
$a[]='GB|Green Bay Packers|NFC-North';
$a[]='HOU|Houston Texans|AFC-South';
$a[]='IND|Indianapolis Colts|AFC-South';
$a[]='JAX|Jacksonville Jaguars|AFC-South';
$a[]='KC|Kansas City Chiefs|AFC-West';
$a[]='MIA|Miami Dolphins|AFC-East';
$a[]='MIN|Minnesota Vikings|NFC-North';
$a[]='NE|New England Patriots|AFC-East';
$a[]='NO|New Orleans Saints|NFC-South';
$a[]='NYG|New York Giants|NFC-East';
$a[]='NYJ|New York Jets|AFC-East';
$a[]='OAK|Oakland Raiders|AFC-West';
$a[]='PHI|Philadelphia Eagles|NFC-East';
$a[]='PIT|Pittsburgh Steelers|AFC-North';
$a[]='SD|San Diego Chargers|AFC-West';
$a[]='SEA|Seattle Seahawks|NFC-West';
$a[]='SF|San Francisco 49ers|NFC-West';
$a[]='STL|Saint Louis Rams|NFC-West';
$a[]='TB|Tampa Bay Buccaneers|AFC-South';
$a[]='TEN|Tennessee Titans|AFC-South';
$a[]='WAS|Washington Redskins|NFC-East';
//get the q parameter from URL
$q=$_GET["q"];

//lookup all hints from array if length of q>0
if (strlen($q) > 0)
{
$hint="";
for($i=0; $i<count($a); $i++)
{
if (strtolower($q)==strtolower(substr($a[$i],0,strlen($q))))
{
if ($hint=="")
{
$hint=$a[$i];
}
else
{
$hint=$hint."<br>".$a[$i];
}
}
}
}

// Set output to "no suggestion" if no hint were found
// or to the correct values
if ($hint == "")
{
$response="no suggestion";
}
else
{
$response="<br>" .$hint;
}

//output the response
echo $response;
?>

Now create showteams.html:

<html>
<head>
<title> Football Names</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.css" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
<script type="text/javascript" src="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.js"></script>
<script>
function showTeams(str)
{
if (str.length==0)
{
document.getElementById("txtHint").innerHTML="";
return;
}
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("txtTeams").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","get_teams.php?q="+str,true);
xmlhttp.send();
}
</script>
</head>
<body>

<p><b>Start typing a name of a NFL team in the input field below:</b></p>
<form>
<input type="text" onkeyup="showTeams(this.value)">
</form>
<p>Suggestions: <span id="txtTeams"></span></p>

</body>
</html>

The key is pointing to JQuery Mobil. To test app start typing a NFL Team. It will display Team Abbeviations. Team Name and Division. Click Here