Tuesday, December 31, 2013
Thursday, December 19, 2013
Game Development Links
HTML 5 game dev
Java Games
Facebook Game
Thursday, December 05, 2013
Wednesday, December 04, 2013
PHP and Class Variables
Variables set in the __Construct can be referenced throughout the class as $this->variable
Can be referenced outside the class as
$Class->variable
Variable Can be passed into a class function like Class::function(variable);
Saturday, November 30, 2013
Thursday, November 21, 2013
iPad Display Stand for POS
Thursday, November 14, 2013
C++ understanding fstream
basically
lets say you have a text file that is called names.txt and the file looks like this
Johnny Bobby Dave Suzy
Now you want to assign those values to variables using ifstream
Using 4 variables (name1, name2, name3, name4) you'd just say
ifstream inputFile;
inputFile >> name1 >> name2 >> name3 >> name4;
Just like it would look with cin
cin >> name1 >> name2 >> name3 >> name4;
C++ doesn't care if the input is coming from a text file or a keyboard. Duh.
C++ assigning values to arrays
ex:
const int ROW = 3;
const int COLS = 2;
int arrayN[ROW][COLS];
int counter1, counter2;
for(counter1 = 0; counter1 < ROW; counter1++)
{ for(counter2 = 0; counter2 < COLS; counter2++)
{
cin >> arrayN[counter1][counter2];
}
}
When spitting an array out
for(counter1 = 0; counter1< COLS; counter1++)
{ for(counter2 = 0; counter2 < ROW; counter2++)
{
cout << arrayN[counter1][counter2];
}
}
PHP Resources
Village Host Pizza Lexington KY
Christmas Chimes
Christmas favorites
Christmas Strings
Merry Christmas from Lawrence Welk and His Champagne Music
Monday, November 11, 2013
Asp.net Resources
Wednesday, November 06, 2013
Resources for Putting a SSD in an old Mac Book Pro
Corsair 360 GB SSD
Tuesday, November 05, 2013
Sitecore Rocks Resources
OverView of Sitecore Rocks
Of note is how to connect a VS solution to your sitecore layouts.
This is the mother load Simplify Visual Studio Project Creation
Create a Visual Studio 2010 Project for a Sitecore Solution
Sitecore website needs to compile?
C# Tutorials
Sitecoreblog by Alex Shyba
Monday, September 23, 2013
Returning Multiple Values with a Function in PHP
Anyways, one action you might want a function to do is return a value. To do this you may have a function fetch results from a database or perform some equation base on a value being passed to the function. For example I could make a function that adds 10 to a value.
function addTen($number) {In the above example I have a function called addTen that is passed a number and returns that number with 10 added to it. In order to have the code spit out the value you just echo out the function. Pretty simple
$sum = $number + 10;
return $sum;
}
echo addTen(5);
Returning Multiple Values
A function returning one variable is easy. Functions are meant to return a variable. Having a function return multiple variables is a little more complicated. The way it is achieved is with an array.Arrays are variables with multiple values. An example of an array might be a variable called $color. There are many colors, so it would make sense to create our variable $color using an array. To make an array you declare the variable and specify the values like so: $color = array(red,blue,green,black); You access the values by specifying the key (Pointing at which value you want). To access red you would: echo $color[0]; Arrays start with 0 as the first value. Another type of array are associative arrays. These types of arrays have user defined keys instead of the default numbered keys. For example I could have and array of the traits of a person: $person = array( 'name' => 'Jason', 'address' => '123 Main St.', 'age' => '25'); To access Jason's address you would echo $person['address'];
So that brings us to the main objective here: Creating a function that returns multiple values.
// This is handy if you had a function that could do a database call and return a bunch of values. You could then access those values as an arrayThis method has all sorts of uses. This is extremely useful when dealing with a database and you want to consolidate your fetch operations in a function but want to separate your styling code from the function.
function animals() {
$dog = "odie";
$cat = "garfield";
$rabbit = "bugs";
$donkey = "eeyore";
$animals = array (
dog => $dog,
cat => $cat,
rabbit => $rabbit,
donkey => $donkey
);
return $animals;
}
// set variable equal to the function returning the array
$animals = animals();
//access the values through the keys of the array
echo $animals['dog'];
echo "
";
echo $animals['cat'];
echo "
";
Hope you find this useful!
Thursday, September 12, 2013
Passing SESSION variables between Domain and Subdomain
The solution is to give your SESSION a Name! You need to name the session before you even start the session. So here is the code:
$some_name = session_name("some_name");I love the internet!
session_set_cookie_params(0, '/', '.some_domain.com');
session_start();
Monday, August 19, 2013
Make Subdomain a Variable with PHP
1. Setup Wildcard Subdomain at your domain Registrar
You can skip this step if you host your dns record locally or with your hosting provider. I don't so I had to add the Wildcard record. My registrar is Godaddy so I just logged in, edited my DNS record and added a new CNAME record. I set the Host to * and it POINTS TO @2. Setup Wildcard Subdomain with Web Host
My web host is Host Gator. I had to log in to the CPANEL and navigate to the subdomain settings. I added a new wildcard subdomain here for File-drive.com. So the settings again were * which is the character that means "any" just like a wild card in poker which can be any card. If this is an "add on" domain you'll need to point the subdomain to the proper root directory of your domain. File-drive is an add on so I had to point * to public_html/file-drive.com3. Use PHP to Pull out the Variable
Now that the wildcard subdomain is set my domain can have any and as many subdomains as I want. What we have to do from this point is to break apart the url and get the variable from the subdomain. Will use<?php $subdomain = array_shift(explode(".",$_SERVER['HTTP_HOST'])); ?>to get the subdomain and set it to $subdomain.
At this point you can do all sorts of things. You could echo or print out the subdomain. You could make a database call using the subdomain variable. You could do pretty much anything you want to.
Enjoy!
Tuesday, August 13, 2013
Add A Google Map to Wordpress Contact Page
Get your Map code
- Goto Google and Google the address you want to get your map for - click on the map picture that results. If that doesn't work goto https://maps.google.com/ and do your search.
- Once the result is displayed change your view to whatever you want to display on your page. You might change to a satellite view or a traffic. You may want to tweak other settings in this window. If it is displaying on this page then it will display on your page
- Click the Link Icon (photo below 1.)
- Click and copy the <iframe> code (Photo above 2.)
- Go to WordPress and click to edit the page/post you want to add your map to
- In your editor Click "Text" tab (Photo above 1.) If you have content on this page already you will need to place your cursor after/before the content you would like the map displayed
- Update or Save your page/post
To Resize the Google Map
If your map isn't the size you want you can edit the code that Google supplies and change the size.- In the code that you pasted above look for the Width and Height Parameters. It should look like: <iframe width="425" height="350" . . . . These parameters describe the size of the map that displays
- To make the width larger type in a larger number. I changed mine from 425 to 800. This is in Pixel increments. This number should be less that 1028
- To make the height of your map larger edit the height="350" value. Change the 350 to something larger. I used 700.
- Once you've set the correct sizes click Update and save your post
- Be sure to leave the "Quotation Marks" around the numerical value
Add Photo to a Word Press Post or Page
Here is a video: http://www.youtube.com/watch?v=FxxFt3a0T5w
Monday, August 12, 2013
Customizr Slider: Create and edit new slider
The customizr Theme for Wordpress features a very large slider on the home page that is somewhat difficult to edit. The theme has a demo slider installed with little to no direction on how to edit it. below are the steps necessary for creating and editing the slider.
1. Create and image for the slider
The dimensions the default slider is 1200 X 5002. Upload the image
Click the "Add new" link under Media.Select your file and upload (you can upload more sliders if you want to at this time. Adding them to the slider is the same once the slider has been created)
3. Click "Edit"
Editing Media: In this window you can add captions, descriptions and add this media to your slider. We first need to create a new slider. Near the bottom of the page there will be a section called "Slider Options"- By default this will be set to "No" - Change it to yes.
- The title - this will be the Main title of your slide
- Description - is the text below the title on the slide
- Link - You can choose the slide to link to a page of the site
- Choose a Slider - If this is your first time creating a slider you will have to make a slider to add your photo to. In the box type out the name of your slider and hit "Add a slider"
4. Add a slide from Media Library
Upload your new image and from the media library click "Edit". From the new window navigate to the slider options at the bottom. You can Add a title and description like described in number 3. above. This time though:- Instead of creating a new slider, use the drop down to select the slider
- You can delete the entire slider from this screen
- To arrange the items in the slide, just drag and drop them into order
Set Your New Slider to the Home Page
- Click Appearance on the left Bar - then select Customiz'it.
- Next Click "Front Page" from the left Nav
- choose your new slider from the "SLIDER OPTIONS".
- Save and close
Message board on theme
Thursday, August 08, 2013
Ambrotype Repair: Part 4
Overall now:
Theseus ship and teleportation
The idea behind teleportation is interesting. The process is to take the atoms that make up a person, pull them apart separately, then put them together again in a completely new location. Seems straight forward, but that brings up the philosophical issue; is rebuilding a person atom by atom creating the same person or just creating a copy. Is that copy the same person.
This problem first surfaced with philosopher Plutarch in a story called the ship of Theseus.
The ship of Theseus, also known as Theseus's paradox, is a paradox that raises the question of whether an object which has had all its components replaced remains fundamentally the same object. The paradox is most notably recorded by Plutarch in Life of Theseus from the late 1st century. Plutarch asked whether a ship which was restored by replacing all and every of its wooden parts, remained the same ship. Wiki PageJust something to think about. Do you think a teleported person would be the same after transmission or would the current arrangement of atoms that make us up be lost in transmission?
This was inspired by Reddit: What are the most mindblowing recent advancements most people still don't know about?
Wednesday, August 07, 2013
Deep Purple Song
So interesting to see all the different renditions of this song. In one instant it is very jazzy, the next very pop, and lastly it is very embellished and almost a waltz.
Deep Purple was written by Peter DeRose and published in 1933. It was originally just a piano composition however it was soon converted to big band orchestra.
The song took on another personality when Nino Tempo and April Stevens made song a pop hit. It hit number one on the US Pop charts in 1963 and actually won a Grammy for Best Rock and roll record. Aside from Nino Tempo and April, Donny and Marie Osmond recorded the song in 1976 and it hit the charts again.
Other interesting facts:
Ambrotype Repair: Part 3
Crack Repair
The most obvious damage to the photo is the enormous cracks that came when it was broken. Additionally there are some scratches and general wear that has occurred to the photos sensitive image. All of these things will be fixed as I use photoshop to clone and replace damaged parts of the image with parts that are not damaged. It is kind of like how a plastic surgeon might graft healthy skin to repair scarred skin. This process is rather laborious so there may be some delays in posts.Ambrotype Repair: Part 2
Ambrotype Photo Repair: Part 1
Mary and Aaron Kinslow were my Great-Great Grand parents on my Grand Mother's side. They had Ambrose Kinslow who had a daughter Ma (Not her name) Kinslow who married a Nunn who had a bunch of daughters. One daughter was Susie Nunn who married Gill Harbison. They had two kids, Kay and David Harbison. David was my dad. SOOOOOO yeah, I'm related to the old folks and I'm going to be fixing this picture. I'll post the progress here.
About the Photo
This Ambrotype was taken around 1840-60. Ambrotypes are a type of photograph that is taken on glass. The light-sensitive chemical compound is put on the glass, then exposed to the light through the camera lens. The actual picture is a positive image that is white. You wouldn't be able to tell much by holding the glass to light. In order to see the details you must put the glass over a dark background like black cloth or paper.This particular picture was broken and therefore was in many pieces. Since the photo has to be lit from the front, scanning was not an option.
To get the photo digitized I piece the broken picture together over a piece of black cardboard. I put a florescent light directly above the glass at an angle and took a picture of the photo using my Canon 6D. To repair the photo I will be using Photoshop.
Monday, August 05, 2013
Brachiopod 419.2–358.9 million years ago
Kentucky fossil Regions
Crinoid 358.9–298.9 million years ago
Mississippian Period of South Central Kentucky. Crinoids and blastoids are echinoderms. There still are crinoids in the present day oceans however over 600 varieties are extinct. The Mississippian period would have been Early Carboniferous which was 358.9–298.9 million years ago.
South Central Kentucky would have been shallow sea with lots of shallow sea plants. Crinoids are the fossil remnants of stems of flower like animals. Carboniferous period
Crinoids
Missippian Period of Kentucky
Celtic bracelet 400 BC - 600 BC
Sadigh Gallery
Ancient Resources Celtic
Raven Run Hike Lexington KY
Dick Contino: An Accordion in Paris
Two Loves Have I (J'Ai Deux Amours) 2:15 Mam'Selle 2:59 The Petite Waltz 2:15 Comme Ci Comme Ca 2:40 My Man 2:12 The Song From Moulin Rouge (Where Is Your Heart) 2:45 Beyond The Sea (La Mer) 2:55 Under The Bridges Of Paris 2:23 Symphony 2:46 Domino 2:43Here is some interesting Dick Contino trivia. He was drafted during the Korean War. He ended up fleeing his post at Fort Ord and got labled as a draft dodger. He was jailed but ended up serving in the Air Force and finally getting honorably discharged.
He was born in January 1930 and as far as I know is still living in Las Vegas.
Andre Kostelanetz and his Orchestra: Today's Golden Hits
The weirdest rendition is Unchained Melody. The beat is strange and it features odd instrument choices like marching toms and a balalaika.
Overall this is a great little snap shot of hit songs arranged with 60s orchestras.
Andre Kostelanetz and his Orchestra: I Wish You Love
Chances are you won't find this on iTunes or Rhapsody because they are symphonic covers to popular 60s songs. Licensing for the originals are hard enough in this digital age, so a cover is just going to get lost in the mix. That is what makes this record so fantastic.
Wednesday, July 24, 2013
Monday, July 22, 2013
Moqui Marbles
The iron oxide concretions found in the Navajo Sandstone exhibit a wide variety of sizes and shapes. Their shape ranges from spheres to discs; buttons; spiked balls; cylindrical hollow pipe-like forms; and other odd shapes. Although many of these concretions are fused together like soap bubbles, many more also occur as isolated concretions, which range in diameter from the size of peas to baseballs. The surface of these spherical concretions can range from being very rough to quite smooth. Some of the concretions are grooved spheres with ridges around their circumference.[4][5]
The abundant concretions found in the Navajo Sandstone consist of sandstone cemented together by hematite (Fe2O3), and goethite (FeOOH). The iron forming these concretions came from the breakdown of iron-bearing silicate mineralsby weathering to form iron oxide coatings on other grains. During later diagenesis of the Navajo Sandstone while deeply buried,reducing fluids, likely hydrocarbons, dissolved these coatings. When the reducing fluids containing dissolved iron mixed with oxidizing groundwater, they and the dissolved iron were oxidized. This caused the iron to precipitate out as hematite and goethite to form the innumerable concretions found in the Navajo Sandstone. Evidence suggests that microbial metabolism may have contributed to the formation of some of these concretions.[12] These concretions are regarded as terrestrial analogues of the hematite spherules, called alternately Martian "blueberries" or more technicallyMartian spherules, which the Opportunity rover found at Meridiani Planum onMars.[4][5]
Thursday, July 18, 2013
Apache Rewrites to hide variables
Example
Let's say you want to hide a variable in a clean url. I want http://www.store.com/catfood.html instead of http://www.store.com/product.html?p=1234233If you are dealing with apache servers then you'll be dealing with the .htaccess file. Here are the steps required to make that example happen.
Step 1: open .htaccesss. If you are on a linux server running Apache you should have one. If it isn't showing then it might be a hidden file. If you don't have an .htaccess file then you need to make one. It should be in the root of your public_html folder on your server.
Step 2: RewriteEngine On #you need this bit of code to turn on Rewrites
Step 3: RewriteRule PATTERN SUBSTITUTION FLAG and example would look like this RewriteRule ^(.*)?\.html product.php?p=%1$1 [QSA]
The Pattern is "^(.*)?\.html" which uses a regular expression to say Any characters before .html. So if someone types in toyota-camry.html it will take "toyota-camry" from the url - what it does with it is explained in the next part
The Substitution says "okay you have toyota-camry as a variable - we'll place that variable in your substitution and on the server we'll run product.php?p=toyota-camry. That means you with this rewrite we can obstruct the variable from view and the end user will just see the clean url. Pretty cool.
So this little .htaccess rewrite handles hiding the variable and give your site a clean looking URL. What this doesn't do is actually process the variable. If you are using PHP you'd need some $_GET methods to process the product id that is being passed to it. That is another lesson all together.
The Flag is [QSA]. There are lots of different flags, but what that flag means is "append query string from request to substituted URL". This way you can add on additional query items to the newly formed URL. Basically it means you could have catfood.html?t=wet and it would pass the varible properly without ignoring the variable.
Some other cool things you can do with rewrites:
- You are trying to create dynamic subdomains. Otherwise you'd have to setup each instance in the DNS record. (This one requires adding a wildcard A record on the DNS record)
- RewriteEngine on
RewriteCond %{HTTP_HOST} ^(.*)\.exampleDomain\.com
RewriteRule ^(.*)$ http://exampleDomain.com/%1/$1 [L] - You want to hide directories and file structure. http://www.domain.com/gallery.html instead of http://www.domain.com/pictures/gallery1/index.php
- RewriteEngine on
RewriteRule gallery.html$ pictures/gallery1/index.php [L]
Additional resources:
This is an absolutely fantastic resource by addedbytes Url rewriting for BeginnersSaturday, July 13, 2013
Robert Berger 460 train watercolor
Friday, July 12, 2013
Meteorite sliver. Sweden 800,000 YO
This fine specimen is an Octahedrite meteorite. It gets its' classification due to the crystal patterning of the iron in the meteorite. "Octahedrites are the most common structural class of iron meteorites. The structures occur because the meteoric iron has a certain Nickel concentration that leads to the exsolution of kamacite out of taenite while cooling." --view wikipedia This specific meteorite is probably a sliver from the Muonionalusta meteorite that struck northern Sweden around 800,000 years ago. Here is an awesome link about meteorites in the region, along with pictures of pieces being excavated.
Clay pipe conglomeration 1880s
Purchased in Metamora Indiana Fall 2012 - The pipe is originally from Point Pleasant Ohio. It was discovered in a creek in Clermont County Ohio. Here is a paper over the pipes from that region