HI,
I'm David Glatzl
Software Engineer
About me
Welcome to my Web Portfolio! I am David Glatzl, software engineer. In 2012 I graduated with highest distinction, Summa Cum Laude from the College of Westchester located in White Plains, NY obtaining my AAS Degree.
My major was in Digital Media. I learned Web Design and Development which is one of my passions. My experience as a software engineer for Simply Sacred Oils for the past ten years has given me the opportunity to really make a significant contribution to growing this entrepreneur’s businesses.
My Work
Simply Sacred Oils
Skills
WordPress
Code Samples
This section contains JavaScript, PHP and C++ code samples written by me, website author David Glatzl. The purpose of this code sample portfolio is to demonstrate my knowledge and skill of these programming languages.
JavaScript
Accordion Menu
/* Start JavaScript */
/* End JavaScript */
Added Button Functionality
By using this website you have read and agree to our Terms of Use
/* Start JavaScript */
/* Start JavaScript */
Search My Site
Search My Site
Search This Site: https://www.dgsddpro.com
Choose engine:
/* End JavaScript */
Alert Box
In the code below, the keyword "return" that is highlighted in blue (on line 38), has the word "javascriptMessage" placed after it. The word "javascriptMessage" is the value of the userAccess function. This is the value that is to be returned.
When it is returned an alert box wil pop up with a message about JavaScript contained inside of it. (Please refer to the code on lines 53 - 55.)
function userAccess() {
var javascriptMessage;
javascriptMessage = document.retrieveMessage.value;
return javascriptMessage;
}
onclick="alert( 'JavaScript is a very important programmming language.
It brings faster user experiences, user interface interactivity and
plays a big role in making websites responsive.', userAccess() );" />
The output of this program is ->
The Browser Object Model (BOM)
The objects that make up the BOM include the window object, navigator object, screen object, history object, location object, and the document object.
In the code below on lines 10 - 19 is where JavaScript is used to access the browser's objects.
JavaScript Browser Objects Examples
Your screen width is pixels.
Your screen height is pixels.
____________________________________________________________
Your user agent is .
Your platform is .
____________________________________________________________
Your page width is pixels.
Your page height is pixels.
____________________________________________________________
This page was last modified on .
____________________________________________________________
This page title is .
____________________________________________________________
This page URL is .
____________________________________________________________
then click
PHP
An associative array with a while loop and for/each loop.
"General:", "\n . Second rank\n . Glock hand gun and M27 rifle\n . Silver collar insignia \n\n\n" => "First Lieutenant:", "\n . Third rank\n . M27 rifle and Remington shotgun\n . Embroidered green on red badge\n\n\n" => "Sergeant:", "\n . Fourth rank\n . M27 rifle and Marine sword\n . Embroidered gold on red badge\n\n\n" => "Corporal:");
$i = 0;
while( $i < sizeof( $military ) )
$i++;
foreach ( $military as $attribute => $ninja ) {
echo "Attributes of the $ninja \n $attribute";
}
?>
An associative array with two - for/each loops.
array(' Role' => 'Leader', ' Weapon' => 'Beretta hand gun', ' Rank' => 'Four star' . "\n\n\n"),
'FIRST LIEUTENANT' => array(' Role' => 'Second in command', ' Weapon' => 'Glock hand gun and M27 rifle', ' Rank' => 'Silver collar Insignia' . "\n\n\n"),
'SERGEANT' => array(' Role' => 'Third in command', ' Weapon' => 'M27 rifle and Remington shotgun', ' Rank' => 'Embroidered green on red badge' . "\n\n\n"),
'CORPORAL' => array(' Role' => 'Fourth in command', ' Weapon' => 'M27 rifle and a Marine sword', ' Rank' => 'Embroidered gold on red badge' . "\n\n\n")
);
foreach ( $military as $ninja => $attribute ) {
echo "$ninja-\n\n";
foreach ( $attribute as $label => $attr ) {
echo "$label: $attr\n";
}
}
?>
Numeric Array
Numeric Array
Comparison Function
$num2) {
return $num1;
} else if($num2 > $num1) {
return $num2;
}
}
var_dump( integer_comparison( 2219, 4196 ) );
var_dump( integer_comparison( 23, 22) );
var_dump( integer_comparison(743, 734 ) );
?>
c++
Bubble Sort Algorithm
When you look at the output of this program you can see the group of numbers have been put in decsending order starting from the highest number to the lowest number.
// Bubblesort Algorithm.cpp
// Author David Glatzl
#include
using namespace std;
const int MAXSIZE = 10;
void bubbleSort(int arr[], int size);
void swap(int& x, int& y);
int main()
{
int nums[] = { 1, 7, 5, 3, 15, 11, 13, 17, 21, 19 };
int k;
cout << "BEFORE SORT: ";
for (k = 0; k < MAXSIZE; k++)
cout << nums[k] << " ";
bubbleSort(nums, MAXSIZE);
cout << endl << endl;
cout << "AFTER SORT: ";
for (k = 0; k < MAXSIZE; k++)
cout << nums[k] << " ";
cout << endl << endl << endl;
system("PAUSE");
return 0;
} // end main()
void bubbleSort(int arr[], int size)
{
int last = size - 2;
int isChanged = 1;
while (last >= 0 && isChanged)
{
isChanged = 0;
for (int k = 0; k <= last; k++)
if (arr[k] < arr[k + 1])
{
swap(arr[k], arr[k + 1]);
isChanged = 1;
}
last--;
}
}// end bubbleSort()
void swap(int& x, int& y)
{
int temp;
temp = x;
x = y;
y = temp;
}// end swap()
Array Sort User
Then, after the numbers are sorted, the program will ask the user to enter any number that is within the array.
After that, the index number of the element (the number that the user chose) will output or be displayed in the console window.
// File: ArrayUser.cpp
// a pgm that sorts an array and asks the user to find an element by calling the index number.
// Author: David Glatzl
#include
#include
using namespace std;
const int MAXSIZE = 10;
void sortArr( int arg[], int size );
void swap( int& x, int& y );
int findIndex( int x[] );
int main()
{
int num[10] = { 45, 9, 23, 100, 90, 6, 86, 17, 3, 5 };
int i;
int index;
cout << endl;
cout << "The elements in the array before they are sorted: ";
for( i = 0; i < MAXSIZE; ++i )
cout << num[i] << " ";
sortArr( num, MAXSIZE );
cout << endl << endl;
cout << "After the elements are sorted: ";
for( i = 0; i < MAXSIZE; ++i )
cout << num[i] << " ";
cout << endl << endl;
for( i = 0; i < 1; ++i )
{
cout << "Enter any number within the array: ";
cin >> num[i];
}
index = findIndex( num );
cout << endl;
cout << "The index for the element you entered is: " << num[index] << endl;
cout << endl;
return 0;
}
void sortArr( int arg[], int size )
{
int last = size - 1;
int isChanged = 1;
while (last >= 0 && isChanged)
{
isChanged = 0;
for(int i = 0; i <= last; ++i)
if(arg[i] < arg[i-1])
{
swap(arg[i], arg[i-1]);
isChanged = 1;
}
last--;
}
}
void swap(int& x, int& y)
{
int temp;
temp = x;
x = y;
y = temp;
}
int findIndex( int x[] )
{
int i = 0;
for( i = 0; i < 10; ++i )
{
if( x[i] == 3 )
{
x[i] = 0;
break;
}
if( x[i] == 5 )
{
x[i] = 1;
break;
}
if( x[i] == 6 )
{
x[i] = 2;
break;
}
if( x[i] == 9 )
{
x[i] = 3;
break;
}
if( x[i] == 17 )
{
x[i] = 4;
break;
}
if( x[i] == 23 )
{
x[i] = 5;
break;
}
if( x[i] == 45 )
{
x[i] = 6;
break;
}
if( x[i] == 86 )
{
x[i] = 7;
break;
}
if( x[i] == 90 )
{
x[i] = 8;
break;
}
if( x[i] == 100 )
{
x[i] = 9;
break;
}
}
return 0;
}
Contact
Contact me...
I am the kind of software engineer that can also manage your web hosting, database and do all the backend maintenance work that your website requires.
Thank you!
David