So on the 2010 x-mas season i received plenty of money to put towards books to get me started, all thanks to my girlfriends loving family. I don't remember how much in Barnes & Noble gift cards i got, but i was ready to roll. the first books I orders were:
1. O'Reilly Media: Learning PHP, MySQL, & JavaScript; by Robin Nixon.
2. Beginners Guide to Programming C/C++/C# i don't have the book at hand but if you want to know what one just mail me i can give you the ISBN.
3. O'Reilly Media: AJAX the definitive guide.; by Anthony T. Holdener III
There where two other cool thing i found on B&N as well they are called sparks charts, one i got was for HTML and the other JAVA, neither are a learning guide just a cool on hand reference sheet.
But lets go back in time first....
So when i started "coding" it was on the release of Myspace, that was the best way to polish your technique.
that with W3C open in another window, because back then we didn't have "tabbed browsing" i was able to hone the main structure of HTML coding. and had a pretty neat Myspace page. this was quite some ago though.
This year i happened to pick up the developing thing heavily, to the point where i have a hard time sleeping if i cant figure out my bug.. and it all started in VBScript.. dont let me fool you Microsoft Visual Basic Scripting is now one of the easiest things for me to do, it takes little or no effort for me to accomplish my task which really VBScript can do anything you ask it to on a Win OS (duurr)
While working for this security company all computer related tasks for them were very ancient.. soo it was time to implement so new work ways of doing things there that would help increase productivity and simplicity by 10x easily. The first thing that was done was not even coding had someone played around with MS Word for a little they would have found Words nifty little built in tool called "Auto-Correct".
the task was simple to do simple edited the auto correct options and typing something like (with out quotes here) "odh dcc" would be == (equalto) (Officer Hazelett conducting Data Center Check".
that took me about one to fully implement through the entire campus that i worked at, and stayed internal and didn't go anywhere else. And because not all the people who work for the company are super computer savvy I also created a simple spread sheet listing all possible work related "macros" (if you would) for anyone to learn in a matter of time, so now typing a radio transmission into the "DAR" (Daily Activity Report) takes no longer than it does for the person transmitting to spit out what they are saying. most transmissions fall along the line of 400 (control center) this is 40X (where X is == the officers call-sign pending there position) departing Y campus for Z campus (where Y and Z are obviously == there current place to there destination) so something that could take some people up to 20sec. to type could now be done in a matter of 5sec no matter your computer skill level, using the form of 40x YY2ZZ (where YY is the two digit inital of the current campus and ZZ is the 2 digit initial for the destination campus) and when the arrive at there destination aaZZ where aa == arrive at ZZ.
like i said simple stuff there was just alot to get put into the system and trying to think of every type of possible radio transmission that could come in so it would be readily available took the longest time as well as trying to decide the best format and shortest that made sense so know one was confused..
The next thing i did for them was a game changer there..
1. New managment arrived to replace the recently let go
2. a certain manager introduced me to an employee at the campus she came from, who as well was a developer, that was based on VBS like myself...
3. After finally convincing him to share some of his work with me, i finally got my hands on his master piece.
it was one of the coolest things i had seen in my time of VBS!
4. One month after receiving a copy of the application i had fully read all his lines of code with minimal questions to him and his Algorithm was easy to understand, he commented his code to a decent enough level that i could understand parts of the code i had never seen before, which one I had never heard of an application in a "*.HTA" format before so that was eye opening i could not believe it! I dont have to compile my scripts or anything and I didnt have to use a web browser with limited ActiveX controls so now i was free to do what ever i wanted on the company PC's (bar the Admins blocks on certain things)
what I did next took it to a whole new level my new boss had set me on a task to renew there "matrix's" which in short is there "Emergency procedures". So after getting them all electronically for update (which was also apart of my task) I set forth to revise everything possible, and with the help of a few co workers later on they where finished, but the application was not, for one because I didn't have a deadline on that.. those did.
My next step was to implement the Matrices into the app.
Now the hard part about this was one of the apps Author said "NO EXTERNAL USE" i.e. only our company could lay eyes on it, and mind you this was binded by word over email, not a GNU License or anything. But i held my word and did not outsource help what so ever. within one week of the implementation period and constantly staring at the app I grew VERY bored with the look.. pressing F5 every time i made a change to make sure what i just coded worked did it for me.. and this is all in dHTML so it was actually along the lines of:
<html>
<head>
<HTA: Application
property
property />
<title>App Title</title>
<script type="Text/VBScript">
SUB Header()
DIM shtml, x,y,z
shtml = shtml
shtml = shtml = & "<table border='0' elements>Title</table>"
shtml = shtml = & "<tr>"
shtml = shtml = & <td>"
shtml = shtml = & "<table elements>"
shtml = shtml = & "<input type='button' elements>button</input>"
shtml = shtml = & "<contents>"
shtml = shtml = & "<contents>"
shtml = shtml = & "<contents>"
shtml = shtml = & "</table>"
shtml = shtml = & "</td>"
shtml = shtml = & "</tr>"
shtml = shtml = & "</table>
header.innerHTML = shtml
</script>
<head>
<body>
<span id="header"></span>
<more-code />
<more-code />
<more-code />
</body>
</html>
so as you can see html output through vbs's dHTML was not as fast to type as without but the benefits of it are great. and if your good with copy paste home and end buttons it can be a fast easy task.
So back on track i now had the new section implemented, but the look was drab... as well it was Winter soo of course the company is on high alert for the weather so we where paying close attention to the internet and the weather reports for hazardous conditions. Well i had enough of typing web addresses and area codes into weather.com and weather.yahoo.com, which also uses weather.com it was just my preferred way of doing it, i thought to myself there has to be and easier way.. and what else but RSS incorporation... so here when my new task the first thing i did was read a little on YUI! (yahoo coding) nothing that was gonna help me seeing how i was not using there API's. so it was back to the drawing board, first i remembered "WshShell" and the "Sendkeys" method so of course i though i'll write a script to open IE and go to yahoo.com and go to the desired area code, also thinking that later i would implement a text field to ask of course, "what area code?"
well turns out that IE doesn't not cope well with "sendkeys" and if it did i could not figure it out.. so again back to the board.. heres where i did a little studying on XML forms because i knew that RSS was a shaped form of XML i just needed to figure out a way to put it all together now..
step one:
Have a script that will auto download the .xml form, for the area code specified
step two:
HTML w/ script to display the info.
it all came together after a week of countless tries at things i had never tried in VBS before, trying my known functions to do stuff that wasn't working out for me.. then I did it i got it to tell me the last time of update displayed in a new .hta (html application) so now my new app said, "Last Updated: XX,XX,2010 @ XX:XX:XX"
Here's how it goes on the actual HTML side:
<html>
<!-- Sample product by XDev of DevXDev.com
Re-Distribution is not ok w/o permission, all files from XDev are
protected under Open Source License's check
the about page for more info.
//-->
<head>
<Title> XDev Weather</Title>
<META http-equiv="Content-Script-Type" content="TEXT/VBScript">
<link rel="stylesheet" type="text/css" href="css/mainstyle.css" />
<script type="text/vbscript" src="scripts/update97124.vbs"></script>
<script type="text/vbscript" src="scripts/mainfunction.vbs"></script>
<script type="text/vbscript" src="scripts/updXML.vbs"></script>
</head>
<body>
</body>
</html>
One of the simplest looking things in the world right? well the HTML form was easy when i finally honed the app but at first it was a disaster becasue i was just trying to get it to output ANYTHING!!
Well you also might notice that all the work is actually linked into it (src="path_to_file") so the HTML form is clean.. (it saved me hours of work later once i got it this condensed) now here comes the part that was the most dreadful part of my development life upto that date.. this is the "mainfunction.vbs" code that is called above:
SUB Window_OnLoad
window.resizeTo 450,550
window.moveTo 400,250
END SUB
DIM yXML
DIM strXMLFile
'locational
DIM LUPD
DIM yWetCity
DIM yWetState
DIM yWetCount
'Conditional
DIM yWetCon
DIM currTemp
'Forecasters
DIM highTemp
DIM lowTemp
'Winds
DIM windChill
DIM windDir
DIM windSpeed
'atmospherical
DIM atmoHum
DIM atmoVis
DIM atmoPre
DIM atmoRis
'astromical
DIM astrRise
DIM astrSet
DIM CDATA
strXMLFile = "E:\HTA\WeatherCast\XML\97124.xml"
SET yXML = CreateObject("Microsoft.XMLDOM")
yXML.async = "False"
yXML.load(strXMLFile)
' Astromical
astrRise = yXML.getElementsByTagName("yweather:astronomy").item(0).attributes.getNamedItem("sunrise").value
astrSet = yXML.getElementsByTagName("yweather:astronomy").item(0).attributes.getNamedItem("sunset").value
'Locational
yWetCity = yXML.getElementsByTagName("yweather:location").item(0).attributes.getNamedItem("city").value
yWetState = yXML.getElementsByTagName("yweather:location").item(0).attributes.getNamedItem("region").value
yWetCount = yXML.getElementsByTagName("yweather:location").item(0).attributes.getNamedItem("country").value
' Conditional
LUPD = yXML.getElementsByTagName("yweather:condition").item(0).attributes.getNamedItem("date").value
yWetCon = yXML.getElementsByTagName("yweather:condition").item(0).attributes.getNamedItem("text").value
currTemp = yXML.getElementsByTagName("yweather:condition").item(0).attributes.getNamedItem("temp").value
' Forecast
highTemp = yXML.getElementsByTagName("yweather:forecast").item(0).attributes.getNamedItem("high").value
lowTemp = yXML.getElementsByTagName("yweather:forecast").item(0).attributes.getNamedItem("low").value
' Winds
windChill = yXML.getElementsByTagName("yweather:wind").item(0).attributes.getNamedItem("chill").value
windDir = yXML.getElementsByTagName("yweather:wind").item(0).attributes.getNamedItem("direction").value
windSpeed = yXML.getElementsByTagName("yweather:wind").item(0).attributes.getNamedItem("speed").value
'Atmosperical
atmoHum = yXML.getElementsByTagName("yweather:atmosphere").item(0).attributes.getNamedItem("humidity").value
atmoVis = yXML.getElementsByTagName("yweather:atmosphere").item(0).attributes.getNamedItem("visibility").value
atmoPre = yXML.getElementsByTagName("yweather:atmosphere").item(0).attributes.getNamedItem("pressure").value
atmoRis = yXML.getElementsByTagName("yweather:atmosphere").item(0).attributes.getNamedItem("rising").value
CDATA = yXML.getElementsByTagName("item").item(0).childnodes(7).nodevalue
document.write CDATA & ("<br />")
document.write ("<div class='XDWet_Title'></div>")
document.write ("<div class='XDWet_Update'><b> Updated At:</b></div><div class='XDWet_Info'>") & LUPD & ("</div>")
document.write ("<div class='XDWet_Title'><b> Weather For:</b></div><div class='XDWet_Info'>")
document.write ywetcity & ", " & yWetState & ", " & yWetCount &("<br /><br /></div>")
document.write ("<div class='XDWet_Title'><b>Current Conditions:</b></div><div class='XDWet_Info'>")
document.write yWetCon & ("<br /><br /> Current Temp: ") & currTemp & (", High: ") & highTemp & (", Low: ") & lowTemp & ("<br />")
document.write ("<div class='XDWet_Title'>Wind Conditions:</div><div class='XDWet_Info'>")
document.write ("Wind Chill: ") & windChill & ", Direction: " & windDir & ", Speed " & windSpeed & ("<br /><br /></div>")
document.write ("<div class='XDWet_Title'>Air:</div><div class='XDWet_Info'>")
document.write ("Humidity: ") & atmoHum & ", Visability " & atmoVis & ", Pressure " & atmoPre & ", Rising " & atmoRis & ("<br /><br /></div>")
document.write ("<div class='XDWet_Title'>Sun:</div><div class='XDWet_Info'>")
document.write ("Sunrises at ") & astrRise & ", Sunsets at " & astrSet & ("</div>")
document.write ("<br /><br />")
document.write ("<div class='Ads'><a href='http://weather.yahoo.com/united-states/oregon/hillsboro-2422084/' alt='Yahoo! Weather'>From Y! Weather & Weather.com<a/>") & ("<br /><br />")
So for starters you may notice that theres no HTML tags holding the code in place it just starts well in a VBScript there is no <tags> that hold any thing in place, its a compilable language unlike <HTML> so you can begin to immediately start to make your vbs calls/functions/subs
next i had to write the "updXML.vbs":
Dim objShell
Set objShell = CreateObject("WScript.Shell")
objShell.exec("cscript E:\HTA\WeatherCast\Script\update97124.vbs")
Yea it was that simple... but its not as obvious when your coding...
next we have "update97124.vbs" :
CONST adSaveCreateNotExist = 1
CONST adSaveCreateOverWrite=2
yXML = "http://weather.yahooapis.com/forecastrss?w=12798480&u=f.xml"
SET yXMLHTTP = CreateObject("MSXML2.XMLHTTP.3.0")
yXMLHTTP.Open "GET", yXML, FALSE
yXMLHTTP.Send
IF yXMLHTTP.Status = 200 THEN
SET yStream = CreateObject("ADODB.Stream")
yStream.Open
yStream.Type = 1
yStream.Write yXMLHTTP.responseBody
yStream.SaveToFile "E:\HTA\WeatherCast\XML\97124.xml",2
yStream.Close
SET yStream = NOTHING
SET yXML = NOTHING
END IF
So there we go here was my pain and agony of the whole application.. using the "MSXML Object-Model"
it was done i had the whole thing outputting: "
Updated At: "time/date"
Weather for: "location"
Current Conditions:
Current temp.: "x"° , Highs: "x" ° ,Lows: "x"°
Wind Conditions:
Wind Chill: "x"°, Direction: "N,NE,E,S,SE,SW,W,NW", Speed: "x"MPH
Air:
Humidity: "x"°, Visibility: "x" mi, Pressure: "x", Rising "x" "||'
Sun:
Sunrises at: "time" Sunset at: "time"
color:#F4A460;
text-align:left;
font-size:10pt;
font-Family: Neo Sans Intel Medium;
font-weight: BOLDER;
}
.XDWet_Title{
color:#FFD700;
text-align:left;
font-size:10pt;
font-Family: Neo Sans Intel;
font-weight: BOLDER;
}
.XDWet_Info {
color:#DAA520;
text-align:left;
font-size:8pt;
font-Family: Neo Sans Intel;
font-weight: BOLDER;
}
.Ads {
color: #000099;
font-Family: Neo Sans Intel light;
font-size: 6pt;
text-align: center;
}
Believe me it was flashy as hell now!!! I was over joyed now it took less that 2 sec to check the weather!
Now all i had to do was again implement it into the app... there where a couple of bumps in the road with the linked scripts so now i had to implement the scripts into that app to but make it so they only call when you look at that section of the app.. Done in about 2 days.. (theres alot to re-working apps into eachother..) so as of two days later I felt ready to release the application to the company's computer terminals that would use it.. well now we are at the point i started with all the books.. i had the knowledge of PHP, mySQL, and JavaScript (which I already knew JavaScript) as well as now knowing AJAX.
So what did I learn using my books, well that my friends was the awesomeness of chat rooms... i now had the power to create a chat room.. and what else was there to to but write one! this one im not sharing the code on for the simple reason that people can pay $1000's of dollars to have one made for there company's website... and i don't want to see my slaved out month in a halfs work of creating this chat room/client on the net... so this one stays internal lol. <-- first one of those amazingly!!
Lets just say i was SOOOOO successful at this app that the security company is planning to stop using the VOIP that is provided at a decent rate per caller, per minute etc, but what saves a company more more than free? nothing so it was an instant hit with the big leagues, and now suddenly the attention of the company was on me all campus's had heard that we had an internal dev. working on a "project" for the companies use.. the only problem was that it was nearly ready for more than 1on1 chat.. but with all the hype i couldnt resist to break it to them that its not as it seemed..
The chat that i created was just a simple chat that used an HTML to talk over the computer/networks open ports. using "WinSock" thus is the reason "I" could only figure out how to make it 1on1
Well in fear of managment turning there backs and laughing I readily set forth to create what they though had already existed... my only problem is that 1 i had zero access to any sort of database on the Network, but in no time flat i found XAMMP which was awkward to my and foreign because once again in the life of a developer what did I have to do? Thats right learn yet another language/development field.. "APACHE." But there wasnt much to it just install on the terminals that would have chat simple right? guess again.. no rights w/o admin.. >:| even though there is portable version for some reason it still did not connect APACHE..
So next it was off to the drawing board for how in the world am I going to do this? well i found my answer! easyPHP it worked portable off my flash drive and everything after the install it booted straight yes even apache for unknown reasons..? but hey i could now dev. my own databases that would hold ALL chat info and now i was up to the task of creating the html form for the chat and what better way than of course another .hta app! to this date i have three different versions for the security company to choose from, and all in all it probably took me about two weeks to write them all, but there was one that stood out to me more than the rest it was written in dHTML (by the by i don't think I've mentioned dHTML is "Dynamic HTML") and AJAX (also that is Asynchronous JavaScript And XML) it used a bunch of CSS to style it and I implemented images into it so of course i was drawn to it, i spent another week or so tuning it to my liking and FINALLY i had something to show! well the excitement of a internal dev. had already died down becasue of the time it takes to write this stuff and debug it, for one the chat i loved had an issue for a while that when ever i made a post to the chat, it also made a blank post that had input properties that looked like: (the line are actually a box when using the app but i showing it here to separate the messages.)
________ _____________ ______
Name: |________| Message: |_____________| |submit|
--------------------------------|
$user: |
$text: |
--------------------------------|
--------------------------------|
_guest_1523 wrote: |
Hi! Cool Chat!!! |
--------------------------------|
And that just plained sucked and haunted me for about another week... but eventually it was gone and a thing of the past..the cool thing to was implementing "randomize" to the extension "guest." so if you didnt enter a name in the box you where just labeled "_guest_xxxx."
At this point it seemed like I had dropped out of the lime light which was ok because i had ALOT of pressure on me for a one man team that was coding like a small contracted business would..
So at the end of December officer of the Month nominations where put in and my campus had spent there time writing what ill call a peer review about me they were all submitted to my supervisor who had also written a peer review for me and she then compiled all the reviews and took various aspects from everyone all into one BIG write up, it then when to the campus manager for the security company and and he had some additions and then it went off to an anonymous person in the security company (my guess is somewhere in HR) for them to review against one person or more from each other campus. we wouldn't foind out the "winner" until two weeks into January of 2011. well what do you know i didnt get it, i wasnt expecting to win let alone was i even expecting to be nominated but apparently the people from my campus had been VERY appreciative of my work and make thing "smooth sailing" as well as simple. but it wsa ok i still got a bonus check for half the amount the winner got. That wasnt enough for the people at my campus, they knew how much time and effort i put into my work so what did they do they wrote dispute letters and submitted them, this was partly because the winner had won by doing something that is done by just about every patrol officer, and they felt that some one should not win OOM for doing there job it should go to someone whoe stands out and goes above and beyond.. come February of 2011 the January OOM had been announced but t my surprise coming back from my weekend, the December OOM had been re-announced.. I was indeed the winner! well it felt god to "win" but I'm not about gloating, i have every right to but its just not me. I said my thank you's to everyone and life at work went on.
this brings me to pretty much today.. which i will start covering asap, because i have never had so much fun writing i cant believe i have never blogged before.. my next topic will be about my struggle to find the perfect "budget friendly" Home Server setup using an old PC... which has recently brought me back to a former employee of the Security Co. who is a Linux Whiz!
No comments:
Post a Comment