Saturday, July 20, 2013

Web Programmer, Tech Levels

Web Programmer, Tech Levels

What do you mean by Senior Web Programmer? After spending several years in the web development field, I think there needs to be a clarification on what a Senior Web Programmer is.  I have met people who's scripting ability is nothing less then beyond mortal.  And I have met some "Senior Programmers" who have code so dirty that it might be likened to a mud pit.  So I present to the general population of the world and, anyone else who might care a better scale to rate people on then Jr, and Sr, programmers.

Wanaabe

Yes I have built a website and it was legit.  I used a website builder and even went in to the code and added a <br>

Neophyte

I took some classes/read some books and learned html.  I use Dreamwaever, Druple, and Wordpress.

Web Guy

I build tons of web pages, I still might use Dreamweaver, Druple, or Wordpress. I have been working with libraries and frameworks.

Grunt

I have written some extensions for some frameworks and have started building up my own libraries

Minion (right hand man/women/igor)

I have extensive libraries, and am building my own framework.

Overlord

I have my own framework, and it has been used on several projects.

Neo

I don't believe in frameworks I just believe in me. Coo Coo Ka Choo.


And those looking to hire me I fall in to the Grunt catigory, and am on my way to Minion

Tuesday, June 18, 2013

Live!

I went Live with www.fracturednations.com today.  It is live with the release of my first solo Opencart extension Dynamic CSS.  Dynamic CSS allows CSS changes without scripting from the admin system.

You can also check out out the demo site to play with the CSS extension.
www.fracturednations.info 

Friday, April 19, 2013

I just wrote this the other day and thought it might be helpful for any one else that is working with google maps.  Its an earthquake map the queries the USGS for the latest earthquakes.  Check it out.
We show earthquakes that have happened around the world within the last 7 days. This map contains all earthquakes with magnitude greater than 2.5 located by the USGS in the last week.
<style type="text/css">#map-canvas { margin-top:10px; margin-bottom:10px; width: 720px; height: 480px; background-color:#ccc; } #map-text { width: 720px; } </style> <script src="https://maps.googleapis.com/maps/api/js?sensor=false&libraries=visualization"></script> <script> window.onload=function() { var map_canvas = document.getElementById('map-canvas'); var map_options = { center: new google.maps.LatLng(40,-98), zoom: 2, mapTypeId: google.maps.MapTypeId.TERRAIN, } var map = new google.maps.Map(map_canvas, map_options); var script = document.createElement('script'); script.src = 'http://earthquake.usgs.gov/earthquakes/feed/geojsonp/2.5/week'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(script, s); window.eqfeed_callback = function(results) { for (var i = 0; i < results.features.length; i++) { var coords = results.features[i].geometry.coordinates; var latLng = new google.maps.LatLng(coords[1], coords[0]); //build infowindow var d = new Date(parseInt(results.features[i].properties.time)); var month = Get_Month(d.getMonth()); //find id var id = results.features[i].properties.ids.substring(results.features[i].properties.ids.indexOf(',') + 1, results.features[i].properties.ids.indexOf(',', 2)); var contentString = '<div>M: ' + results.features[i].properties.mag.toString() + ', ' + results.features[i].properties.place + '</div><div>Time: ' + d.getDate() + ' ' + month + ' ' + d.getFullYear() + '<div><br><div><a href="http://earthquake.usgs.gov/earthquakes/eventpage/' + id + '" target="reqeventpage_' + id + '">Earthquake Details &#187;</a></div>'; var marker = new google.maps.Marker({ position: latLng, map: map, icon: getCircle(results.features[i].properties.mag), title: "M: " + results.features[i].properties.mag.toString() + ", " + results.features[i].properties.place, }); addInfoWindow(marker, contentString, map, latLng); } } } function Get_Month(month_num){ switch(month_num){ case 0: month = 'Jan' break; case 1: month = 'Feb' break; case 2: month = 'Mar' break; case 3: month = 'Apr' break; case 4: month = 'May' break; case 5: month = 'Jun' break; case 6: month = 'Jul' break; case 7: month = 'Aug' break; case 8: month = 'Sep' break; case 9: month = 'Oct' break; case 10: month = 'Nov' break; case 11: month = 'Dec' break; } return month; } function addInfoWindow(marker, message, map, latLng) { var infoWindow = new google.maps.InfoWindow({ content: message, position: latLng, }); google.maps.event.addListener(marker, 'click', function () { infoWindow.open(map, marker); }); } function getCircle(magnitude) { var fill = '#12ff00'; if(magnitude >= 2 && magnitude <= 4){ fill = '#aeff00'; } if(magnitude >= 4 && magnitude <= 6){ fill = '#fffc00'; } if(magnitude >= 6 && magnitude <= 8){ fill = '#ff3c00'; } if(magnitude >= 8 ){ fill = '#ff0000'; } var circle = { path: google.maps.SymbolPath.CIRCLE, scale: 1.75 * magnitude, strokeColor: fill, fillColor: fill, strokeOpacity: 0.5, fillOpacity: 0.5, strokeWeight: 1 }; return circle; } </script> <div id="map-text">We show earthquakes that have happened around the world within the last 7 days. This map contains all earthquakes with magnitude greater than 2.5 located by the USGS in the last week. </div> <div id="map-canvas"></div>
Joseph Tveter - Fractured Nations

Thursday, January 17, 2013

Embed Flash with PHP.

Its been a while. I figured I should put something up. Here is a class I wrote to put Flash on a page with PHP. Enjoy.


<?php
/**
 * Description of flash
 * @author Joseph Tveter
 *
 * This will build the object to embed a swf in.
 */
include_once 'view/html/HTML.php';
class flash {
    private $embedAttrs = array(
        "src"               => "flash_obj.swf",
        "quality"           => "high",
        "bgcolor"           => "#ffffff",
        "width"             => "1024",
        "height"            => "600",
        "name"              => "flash_obj",
        "align"             => "middle",
        "allowScriptAccess" => "sameDomain",
        "allowFullScreen"   => "false",
        "type"              => "application/x-shockwave-flash",
        "pluginspage"       => "http://www.adobe.com/go/getflashplayer",
        "vspace"            => "",
        "hspace"            => "",
        "class"             => "",
        "title"             => "",
        "accesskey"         => "",
        "tabindex"          => "",
        "flashvars"         => "",
    );
    private $params = array(
        "allowScriptAccess" => "sameDomain",
        "allowFullScreen"   => "false",
        "movie"             => "lobby.swf",
        "quality"           => "high",
        "bgcolor"           => "#ffffff",
    );
   
    private $objAttrs = array(
        "classid"            => "clsid:d27cdb6e-ae6d-11cf-96b8-444553540042",
        "codebase"           => "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0",
        "width"              => "1024",
        "height"             => "600",
        "id"                 => "flash_obj",
        "align"              => "middle",
        "onafterupdate"      => "",
        "onbeforeupdate"     => "",
        "onblur"             => "",
        "oncellchange"       => "",
        "onclick"            => "",
        "ondblclick"         => "",
        "ondrag"             => "",
        "ondragend"          => "",
        "ondragenter"        => "",
        "ondragleave"        => "",
        "ondragover"         => "",
        "ondrop"             => "",
        "onfinish"           => "",
        "onfocus"            => "",
        "onhelp"             => "",
        "onmousedown"        => "",
        "onmouseup"          => "",
        "onmouseover"        => "",
        "onmousemove"        => "",
        "onmouseout"         => "",
        "onkeypress"         => "",
        "onkeydown"          => "",
        "onkeyup"            => "",
        "onload"             => "",
        "onlosecapture"      => "",
        "onpropertychange"   => "",
        "onreadystatechange" => "",
        "onrowsdelete"       => "",
        "onrowenter"         => "",
        "onrowexit"          => "",
        "onrowsinserted"     => "",
        "onstart"            => "",
        "onscroll"           => "",
        "onbeforeeditfocus"  => "",
        "onactivate"         => "",
        "onbeforedeactivate" => "",
        "ondeactivate"       => "",
        "type"               => "",
        "vspace"             => "",
        "hspace"             => "",
        "class"              => "",
        "title"              => "",
        "accesskey"          => "",
        "name"               => "",
        "tabindex"           => "",
        "devicefont"         => "",
        "flashvars"          => "",
        );
   
    public function __construct($args) {
        foreach($args as $k => $v){
            foreach($this->embedAttrs as $key => $val){
               if($k == $key){
                   $this->embedAttrs[$k] = $v;
               }
            }
            foreach($this->params as $key => $val){
                if($k == $key){
                    $this->params[$k] = $v;
                }
            }
            foreach($this->objAttrs as $key => $val){
                if($k == $key){
                    $this->objAttrs[$k] = $v;
                }
            }
        }
    }
   
    public function draw(){
        $html = new HTML("object");
        foreach($this->objAttrs as $k => $v){
            if($v != ""){
                $html->addValue($k, $v);
            }
        }
       
        foreach($this->params as $k => $v){
            if($v != ""){
                $pram = new HTML("param");
                $pram->addValue("name", $k);
                $pram->addValue("value", $v);
                $html->addChild($pram);
            }
        }
        $embed = new html("embed");
        foreach($this->embedAttrs as $k => $v){
            if($v != ""){
                $embed->addValue($k, $v);
            }
        }
        $html->addChild($embed);
        return $html;
    }
}

?>

Wednesday, October 31, 2012

I felt inspired to go back to my animation roots for an evening.

When I heard that Disney is reacquiring the Star Wars Franchise I felt inspired to edit the Imperial March to Steamboat Wilie.  Enjoy.
http://www.youtube.com/watch?v=xdqH85LSuGE

Wednesday, October 24, 2012

Web Page Update

Updated the Fractured Nations page.  I now have a timeline till go live.
www.fracturednations.com

Tuesday, October 16, 2012

E-mail attachments with php

      So the boss wanted to get a bunch of stats out of the database on a daily basis.  Our server guy has been doing it for her, and he complains that it takes time, which it does.  And he does not pull all the data she wants because some of it needs to be cleaned before it will display nicely.  So I figured it would be better done with a php script set to execute in a daily CRON.  I got put to this because she really wanted  the data that was dirty.  I could see my way threw the project but I had to figure out one or two things.  The main being how do you sent an email with an attachment with code.  So the next few posts will be addressing e-mailing with code, and data cleaning.