Developing New Paths - The Mojavi Project

Archive for September, 2011

Mojavi Project

September 30, 2011

Standard PHP extensions and limitations

Tags:

PHP
Image via Wikipedia

The majority of most file extension can be found online through various sites

There are multiple PHP functions that contain different  file extension protocols that can create issues for PHP 5.0.

Reblog this post [with Zemanta]

Blogging

September 23, 2011

Fans paying a lot for pizza

Tags: ,

I like pizza as much as the next guy but there does come a time when enough is enough. This is what Dallas Cowboy fans can expect when they try to order a pizza this upcoming season. The NFL season is just starting, but the people selling pizzas at the new Cowboy Stadium should be happy (if they get any takers). Even the Nascar fans have their limits on what they will pay for food even if their favorite driver is wearing a decal for that company on their uniform. They will be charging $90 for a pizza to the fans, companies, or organizations that rent out those nice luxury boxes. It’s still not clear what the extra toppings will cost and the $90 will get you a rounded piece of dough with some cheese on it. These high prices don’t stop with the pizza either and beer drinkers may want to drink sodas on football Sundays. A 12 pack of domestic beer will cost patrons about $66 at the new Dallas Cowboys football stadium. Most NFL fans will want to save their money and grab a team jersey. If you’re doing the math at home; then you and a buddy can get a pizza and 6 beers each for about $160! Prices like this should have a lot of Cowboy fans eating before the game and no one should pay $90 for a pizza.

A good seafood restaurant with salad bar and all the beverages you can drink will generally cost under $75 in most parts of the country (this includes Dallas too). Even the Dallas Stars the local NHL team has their limits on what they are charging their fans for tickets and food. Perhaps someone should have told the Dallas Cowboys fans that the new stadium will cost more than a day at Disney theme park and only last you about 4 hours. You could imagine the cost of disneyland tickets if they were to add a billion dollar addition to the park. There are fans that think Tony Romo is not a quarterback that can lead a team into the playoffs alone and his biggest weapon Terrell Owens now calls the Buffalo Bills home. The Cowboys started the year off with two straight losses and they want $90 for a pizza; may reflect how some people tied to the organization has no clue about the current economy or the residents of Dallas. I’m sure a few people could afford these $90 pizzas, but hopefully they will not give-in to these outrageous prices at the new Dallas Cowboy’s sports stadium this year. Texas is famous for their barbeque restaurants which I am sure is available within the stadium, but why they are creating premium priced pizzas is beyond me.  If I make any road trips for an NFL game this year, I may just want to see the Buffalo Bills play at home, where I can get $10 Buffalo Wings and get to see a better team too!

Blogging,Marketing

September 22, 2011

Understanding the Woodrow Wilson Teaching Fellowship

Tags: ,

With so many people looking for work or rethinking their current career path the job market has gotten much more competitive. In many jobs that are being made available the level of talent is far more qualified than what we were seeing 5-7 years ago. There are career paths that are facing a shortage and in order to be in the right position you need to look understand what options are available. That is why I wanted to do a quick discussion on the Woodrow Wilson Teaching Fellowship. They are currently taking applications from those that are fresh out of college or looking to make a career change. The area of interest is STEM ( Science, technology, engineering, and math) serving in rural or high-need secondary urban schools. This particular teach grant is available to those in Indiana, Michigan, and Ohio. The qualified recipients will receive cutting edge education and advanced degree to teach in these areas. You will receive a $30,000 stipend with the understanding that you will teach at least a minimum of three years in an under served area.

The recipients will receive paid preparation, ongoing support from the University they attend, and mentors to help in their ongoing career. This specialized training will prepare you to teach higher level math and science while helping to rewrite and improve upon current curricula. This new model is innovative and can help raise the standard for other teaching certificates to better prepare our students to be more competitive in their continuing education and eventually the work force. There are certain requirements for submitting your application along with final interviews for the top 20-30 finalists. If you are looking to make a career change and have the passion to teach and change lives then the Woodrow Wilson Teaching Fellowship may be the right move for you.

Marketing,Technology

September 21, 2011

Pick your blog hosting wisely and save money

Tags: , ,

If you are like millions of bloggers on the net you probably have your blog on either a free service or have your own domain on a web site hosting account. Either which way you want to make sure that your provider can support you and your customers and minimize any downtime. If you are with a unreliable host and your site is constantly unavailable it will cost you more than customers. There are many things that you can look for when deciding on a hosting account some of which include customer testimonials, industry awards, and live support. While you are on their site call their 1-800 number and see who picks up and what the wait time is. This can be a huge factor when you are starting your account and need some help. You can search the web hosting review section at Hostingposting.com to receive insight into what actual customers are saying.

We have  moved several of our blogs over to a new blog hosting company called Blue Host to help accommodate the growing traffic that we have been receiving and so far the results have been impressive. There are some great reviews and comparisons at webhostinggeeks.com where you can see how various companies stack up against each other depending on your needs. You can find hosting coupons for companies like Blue Host and others where you can save over a hundred dollars per year. This is a great deal if you have multiple blogs to help you save money and use that money to invest in social marketing and organic growth for your site.

Marketing

September 12, 2011

Win an iPad at DealFun

Tags: , ,

If you are looking to get a great deal on a tablet forget trying to get a $99 HP touchpad when you can get an iPad 2 for pennies on the dollar at dealfun.com. Besides the fact that the HP touchpad will not be supported and you are buying old technology you can have fun bidding on the latest technology and the most popular tablet on the market. At Deal Fun they offer iPad’s, laptops, and other technology systems through their auction system. This is what is called a penny auction site where you bid on an item and every bid raises the price by one penny. The starting price is always a penny so you could end up getting some items for up to 98% off retail. If you are new to the site you are given the advantage of getting your bids back if you do not win within the first 24 hours after your first bid is placed.
With their prompt and courteous customer service you will get your questions answered quickly. There are no win limits so if you are on a hot streak you can get some great deals. At Dealfun you can look at other similar auctions and plan your strategy to win that item with the least amount of bids. If you are bidding on an item and lose you can use the bids that you made towards the purchase price of the item. So get started today and purchase a bid pack and may the best bidder win.

Blogging,Marketing

September 10, 2011

Fishing at one of Canadas premiere BC Resorts

One of the most therapeutic outdoor activities that you can do is fly fishing along a stream with mountains as the backdrop.  There was even a movie that was filmed that centered around the bonding and family traditions of fly fishing. Now imagine taking this adventure at one of Canada’s premiere BC resorts where you can fish in some of the best salmon waters in the world. After your day out along BC Inside Passage, you come back to spend a few hours in the Current Spa relaxing and getting ready for your fine dining experience that evening. Voted the #1 luxury resort in Canada and offering an all inclusive package you are sure to create one of the best fishing trips you have taken.

Technology

September 2, 2011

Hybrids get a lift

Tags: , ,

If you are looking to repair one of the newer cars and looking for parts like a Ignition Coil then check out BuyAutoParts.com. As the technology advances and fuel costs remain concern for many Americans and those globally the need to make these cars more affordable and comfortable will become a priority.

There is even a new Porsche Cheyenne Hybrid model that is out for all those with some extra cash and looking to do something good for the environment. As hybrids become more of a mainstream vehicle you will see advancements in battery cell life that is part of the energy savings feature with the incorporation of different types of fuel sources. If you are unsure of what to get that person on your Christmas list that has just invested in a new hybrid vehicle then you may want to consider a gift card from companies like buyautoparts.com where they offer a great selection of parts for your vehicle.

Mojavi Project

Global Templating revisted

Tags: ,

Global Templating – The Decorator Pattern

* Enter Decorator
* Insert Here: Slots
* Let’s Decorate!
o Creating a Global Template
o Putting the ornaments up

Ever since Mojavi 3 was released earlier this year, people have been looking to create a flexible global templating solution. From using post filters and various drivers and page controllers, people have been looking for a way to create simple and manageable global templates that will allow for a great deal of flexibility without compromising the need for larges amount of duplicated code.
Enter Decorator

The Decorator design pattern, like every other pattern, is nothing more than a way to talk about a resuable concept, or pattern, that a programmer might encounter while coding applications. The Decorator pattern’s strength is it’s ability to serve as a wrapper for that particular object, while leaving objects like it in tact.

The Decorator pattern has been implemented in the View class, providing a number of new methods:

public function setSlot ($attributeName, $moduleName, $actionName)
public function setDecoratorDirectory ($directory)
public function isDecorator ()
protected function & getSlots ()
public function getDecoratorTemplate ()
public function getDecoratorDirectory ()
protected function & decorate (&$content)

Now a brief explanation of what each of these do:

* setSlot – Creates a slot entry based upon the results of a specially controlled controller->forward()
* setDecoratorTemplate – Sets the template that you’re going to use for your decorator. This method also automatically turns the decorator switch to true
* isDecorator – returns true is setDecoratorTemplate has been called, otherwise false.
* getSlots – Returns an array of the slots.
* getDecoratorTemplate – Returns the decorator template.
* getDecoratorDirectory – Returns the decorator directory.
* decorate – A method that must be implemented in derivate Views.

Note: these functions are in View, so all derivates of View (ie PHPView) have access.
Insert Here: Slots

Slots is a new name for an old concept. More or less, slots serve as placeholders that can be populated by the results of a $controller->foward($mod, $act) call. And, as you can see, the setSlot method takes three parameters:

public function setSlot ($attributeName, $moduleName, $actionName)

The first parameter, $attributeName, serves as the name of the slot. The next two parameters will be used to get the results of that Action, put it in a buffer, and place it into the internal $slots memeber variable.
Let’s Decorate!

The usage pattern of Views changes little with the implementation of the decorator pattern at the module level (though secondary View authors, ie SmartyView et al, do have a few things to play with).

Now let’s look at what you’re going to need to do implement the new, and NEW decorator features of Mojavi. Also a special note to make sure that your graphics ati drivers are up to date so that you are able to test and view the configurations with the latest version of PHP 4.0
Creating a Global Template

First off, we’re going to need a great big christma..ehh..template to decorate. While I won’t get into breaking down and factoring our global template, keep in mind that this is not the only way to do this.

Example 2: The Christmas Tree (myGlobalTemplate.php)

Side note: Sometimes you’ll have issues with that <?xml [....] ?> declaration, an easy
workaround is to disable short tags in your php.ini file, or to use ini_set() to disable
it.

<?xml version=”1.0″ encoding=”iso-8859-1″?>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.1//EN” “http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml” xml:lang=”en-us”>

<head>

<title><?php echo $template['title']; ?></title>

<meta http-equiv=”Content-Type” content=”application/xhtml+xml; charset=utf-8″/>
<style type=”text/css” media=”all”>

<!–Css slot–>
<?php echo $template['css']; ?>

</style>

</head>

<body>

<!–menu slot–>
<div id=”menu”>

<?php echo $template['menu']; ?>

</div>

<!–main content slot–>
<div id=”main”>

<?php echo $template['content']; ?>

</div>

</body>
</html>

Putting the ornaments up

So now that we have our decorator template, we need to decorate it. The decorating process is fairly simple, and consists of the following simple steps:

* Setting the decorator directory using setDecoratorDirectory() (Optional)
* Setting the decorator template using setDecoratorTemplate()
* Setting slots setSlot()

For example,

Example 3: In the View (IndexSuccessView.class.php)

class IndexSuccessView extends PHPView
{

public function execute ()
{

// set our template
$this->setTemplate(’IndexSuccess.php’);

//setup our decorator template
$this->setDecoratorDirectory(MO_TEMPLATE_DIR);
$this->setDecoratorTemplate(’myGlobalTemplate.php’);

//setup our slots
//(SlotName, Module, Action)
$this->setSlot(’menu’, ‘Content’, ‘PopulateMenu’);
$this->setSlot(’css’, ‘Content’, ‘PopulateCss’);

// set the title
$this->setAttribute(’title’, ‘Default Action’);

}

}

Now you might be wondering where the content slot is being populated. Well, content is a reserved slot that is automatically populated with the output of the originally requested Action/View pair. If you have any issues please report them and check your intel drivers and other settings to make sure your server is running all the latest patches.

To be Continued….

Mojavi Project

September 1, 2011

Mojavi 3 Part 2

This is a list of the methods you can use in an Action and an explanation of what they do
execute ()

Note: This method is required in your Action class. Also there are File Extension SVG which stand for scalable vector graphics

This will execute any application/business logic for the action. This method is reached only after the request methods have been checked and any of the parameters have been validated.

When leaving, the execute() method should tell the controller what view is to be used. This is done by returning a string containing the view name associated with the action or an array of the parent module for the view to be executed, parent action for the view and the name of the view. I will show an example of return both in a later tutorial.
getCredential ()

This is a new feature in Mojavi 3. Basically, a credentials are a privilege array that describes any level of security. They work hand in hand with the security aspects of the User class. For Mojavi 2 users, note that this replaces the old Privileges. But it is also important to know that it can do more than just handle privileges. I will handle the usage of creditials in a later section. For now, it is sufficient to know that we set the creditial requirements for the action inside this method and that it is set to NULL by default.
getDefaultView ()

This is the view that will be executed when a given request is not served by the action. This could happen when a form being displayed for the first time or if we are displaying a static page. Be sure to reset any variable in the graphic engine and search out the File Extension SVG portions by using a simple search.

Again, just as with the execute() methoad, a string with a view name or an array of a module/action/view is passed back to the controller. By default it will pass back View::INPUT
getRequestMethods ()

You can also return a view from another module. You do this by passing an array with the view information instead of the standard View::INPUT. When you use this you create a two element array. The first element is the module name. The second element is which view you want. It cannot be just the Action name, but the file extension Action name with the specific view.

Here’s an example:

class MyClass extends Action
{

function execute()
{

$returnView[0] = MyModule;
$returnView[1] = DoSomethingInput;
-or-
$returnView[1] = DoSomethingError;
-not-
$returnView[1] = DoSomething;

return $returnView
}
}

View

I’ll add more to this later, describing the View class.