Archive | Articles RSS feed for this section

How my iPhone made me miss my first flight of the year

It was 2:00 AM on a brand new and sparkling year, 2011 to be exact. I was aware that I had to wake up at 3:30 am to get ready and head out to the airport by 4:00 AM, this would give me plenty of time at the airport to check-in and to make it to my flight since my flight was not taking off until 5:40 AM. This was a business trip that had been planned months ahead and that it was necessary for me to fulfill without any error. If I remember correctly I was on a conference call 6 months earlier talking about how I already had to reserve January 1st for this business trip. That is how far in advance my schedule for this trip was set up.

As an iPhone owner that has grown to rely on the integrated alarm clock I set up my alarm but something was telling me that I was going to miss the flight and I was going to wake up late, I guess its the same feeling everyone has when traveling and all of the sudden feels the fear of missing a flight. So my wife set up her alarm clock on her iPhone as well, this would help us have double assurance that everything was going to work out as planned. Now, lets remember that this is January 1st at 2:00 AM and we received the new year with two kids in bed, watching a TV show and chatting about the new events of the new 2011 so it is not like my fear was grounded due to excess of partying but rather it was probably only due to all the planning that was involved ahead of time was keeping me on my toes for this day.

When I was laying in bed trying to fall asleep at some point I considered going to the living room and doing some preliminary work which would keep me awake until 3:30 AM to get ready for the flight but I figured an hour and a half of sleeping was well worth it since I was going to be working and traveling at least until 10:00 PM the same day. Besides we had two alarm clocks, What could go wrong?

Fast forward to 6:09 AM. An email from my bank came in to report the current balance of my personal account as it does every day but this time was different, it came in with a "Bing"! which woke my wife and I. At this time I was not aware of what time it was but I knew it was later (or earlier depending on how you see it) since a glimpse of light was coming through the bedroom curtains. I knew I was in trouble. I quickly picked up my iPhone and saw it was after 6:00 AM and that there was no way I was making it to the airport to my flight, rapidly I started running ideas through my head trying to figure out what to do and how to "fix" this issue. While I was trying to figure out what to do I kept repeating to myself - I knew I was going to oversleep - I fired up the Delta iPhone app and checked for the next flights available from my city to my destination. The next flight was at 6:45 AM, I knew it would take me at least 30 minutes to get to the airport plus the flight change at the front desk and going through security there was no way I was going to make it. So I browsed through the app and the next direct flight was not until 11:45 AM. Too late.

I realized it was time to do damage control, I fired off some emails and waited for everyone else to wake up in my destination area so I could let them know that I definitely missed my flight and that I was not going to fulfill this business trip.

While I was in my home office browsing through the world news, waiting for email responses I ran across a post that stated that there is in fact a software glitch on the iPhone for January 1, 2011. After reading the post it all made sense,

1. There was not a "Snooze" screen on my phone indicating that I had slept through the alarm clock and that it tried to wake me up.
2. How was it possible that the one sound of an incoming email woke us up but not the continuous sound of an alarm?

We had been victims of the software glitch.

I fired up twitter and there multiple reports of people missing work or similar due to the alarm issue so I knew I was not alone. If you do a search in google you can find multiple sites describing the issue.

Interestingly enough some people are replying to the posts with "Give it a rest" or "It's just an alarm clock, no a big deal".

I will agree with some people who say it is not a big deal since it is just an alarm, but when you have grown to rely on the alarm for important occasions, it becomes a big deal. I did learn my lesson and for the important dates I will go back to a good old battery-powered alarm clock, or maybe two.

What a great way to start the sparkling new year!
* Missed first flight of the year [check]
* Missed first meeting of the year [check]

If you were in my shoes would you attribute these issues to a wonderful software glitch by Mr. Jobs or would you assume it is all your own fault?

How to use Read More in Custom Type pages

The same rule applies for Custom Types as regular pages:

PHP:
    < ?php
    global $more;
    $more = 0;
    ?>
    //The code must be inserted ahead of the call to the content

    < ?php the_content('Continue Reading'); ?>

From the WordPress docs:

Please remember that the "Read More" tag is used only on the Home page which shows the latest posts. It does not work in "Pages". If you want to turn it on in Pages too for showing a set of partial posts, use the following code inside the loop for the dynamic content:

More info in the documentation

Optimizing SWF files with Flex Optimizer

I found a reference to optimizing SWC files with Flex Optimizer and I figured I would run some tests through SWF files and see what effects it had in it.

To my surprise the Optimizer tool did optimize the SWF files but just by a few bytes:

Test 1:
..._concept1_v1_alt.swf (56569 bytes)
..._concept1_v1_alt_optimized.swf (56456 bytes)

Test 2:
...600_Flash_v1.swf (38164 bytes)
...600_Flash_v1_optimized.swf (38127 bytes)

I also ran a test against a custom SWF file inside a SWC file and this is the result:

...DropDown/library.swf (14810 bytes)
...DropDown/library_optimized.swf (11723 bytes)

So the SWC files are bloated with extra information no needed and can be compressed quite a bit but SWF file no love. And it does make sense since the SWF files that I was testing contain a lot of graphics but I still gave it a go.

Here you can ind more information about Optimizing RSL SWF Files.

Some things I didn’t know about TextMate and ActionScript 3

I have been using TextMate for a couple years now and I am used to write almost everything by hand. Since AS3 I have been using the AS3 Bundle and mainly it has been to highlight my code and create new documents from the Templates. But I noticed that there are a couple features that might speed up your coding by a bit.

List imported classes

After the ":" you will get a list of the already imported classes that you can use to declare the type of variable you are declaring.

Auto Import classes

If you Hold down Shift+Option+I after highlighting a Class name on your application. The class you are highlighting will be imported at the head of the file. This is helpful because you can keep coding your class and as you are making your declarations you can import the classes necessary for the application.

List class Members

If you type this.[TAB] you will get a list of properties and parameters that are available for that specific class. Useful if you forgot something, but you are a professional so you probably won't need that.

Insert Color

Ah! You need that color but you don't remember the hex value for it, no problem just do Shift+Command+C and you will get a color picker component where you can select the color you need and it will insert the hex value into your document. This works for HTML/CSS as well!

Documentation for Selection

My favorite by far! Highlight a word on your application, then key combo control+H and you will get a new window with options to select the right property/method you have selected and you can access the documentation directly. It can't get easier than that.

Change Document Type

Hold Option+Control+Shift+(Letter for Document Type) and you can change document types rather quickly. When would you need to do so? Well say you are working on a HTML/CSS/PHP (or ASP) project. Now you can use the shortcut to switch document types fast.

Conclusion

There you have it, some shortcuts that might help you speed up the way you code in TextMate, Also remember you can add your own behaviors for a specific language, for example I created couple snipplets that would allow me to navigate up/down between method names (Shift+Command+UpArrow or Shift+Command+DownArrow).

YouTube Will Be Next To Kiss IE6 Support Goodbye

Accordingly to TechCrunch YouTube will stop surpport for IE6.

"Judging by this screenshot taken by an IE6 user who was watching some videos on YouTube, it appears the Google company will be phasing out support for the browser shortly. I don’t have Internet Explorer 6 installed on my computer, so I can’t verify this first hand, but illogical it seems not and a simple Twitter search shows multiple people confirming the news. Heck, some are even downright ecstatic over the news."

For many developers it has been a nightmare to apply hacks to their code to make design fit IE6 standards and this move might help other big players help users upgrade their browsers and make the web a "better" place. With YouTube encouraging users to install other browsers such as Google Chrome or FireFox we can only hope that people understand that Internet Explorer is just a piece of software that that there are other alternatives for online browsing that give you a better experience.

WordPress VS Drupal User Management

Having the ability to create different users and give each a different role is one of the most important things within a CMS, you need to be able to control all aspects of the site (super users) and also give other users the ability to control display or content within the site without breaking it.

In our CMS test I will have 6 type of users.

  1. Super Administrator:
  2. Responsible for all the aspects of the site, create/delete/edit/publish/unpublish content, change themes and create or edit other users

  3. Site Administrator:
  4. Responsible for create/delete/edit/publish/unpublish any content from the site, change themes, create or edit other users but is not able to change the layout of the site.

  5. Author:
  6. Creates/edits/publish/unpublish own content.

  7. Editor:
  8. Creates/edits own content but can't publish the content, they notify the Site Administrator to do so.

  9. Subscriber:
  10. Receives notifications when site content changes and is able to comment on content if content is enabled to receive content.

  11. Visitor:
  12. Access to all content that is published but is not able to edit any part of the site

WordPress and Drupal do a good job in allowing you to create different kind of users and this is where we start to see some separation between the two systems and this might be one of the main reasons why you may choose one after the other but lets see them in detail:

WordPress:

WordPress comes with 5 predefined roles (or user types) and one user, WordPress has a page that explain the roles in great detail but lets see their "Summary of Roles"

  • Administrator - Somebody who has access to all the administration features
  • Editor - Somebody who can publish posts, manage posts as well as manage other people's posts, etc.
  • Author - Somebody who can publish and manage their own posts
  • Contributor - Somebody who can write and manage their posts but not publish posts
  • Subscriber - Somebody who can read comments/comment/receive news letters, etc.

This is great specially when you are starting and you want to create your content and define users rather quickly. In the default installation since I was the one installing the software I was automatically added as a site Administrator.

Wordpress_Users_Default

I went ahead and created the different users that we need and with WordPress was a breeze since the roles were already defined as an option.

Wordpress_Users_Added

There was one major issue with the default set up and that is the Administrator role could not be edited in a way that the role was not able to edit the layout of the site. So I still wanted the site administrator to have full control of the site content and users but not to have control of the layout. I am sure I could go into the database and alter this setting by creating a new role and applying new rules but for this experiment I am not going to go that far. I went ahead and did a quick search in Google for a plugin or similar that would allow me to create custom roles and there were about 21,500,000 results on my search (wordpress+custom+roles), so it seems to be some sort of demand for the feature.

Drupal:

Drupal has 2 predefined roles and one user each of the roles are explained within the role's page:

  • Anonymous user: this role is used for users that don't have a user account or that are not authenticated.
  • Authenticated user: this role is automatically granted to all logged in users.

Here is where we start to see a small gap between WordPress and Drupal. Drupal allows you to create custom roles where you can define and alter the different access levels for the users. Drupal starts to show some "muscle" here by giving you different categories for User Management, such as Access rules, Permissions and User settings.

Drupal_Users_Roles

Drupal_Users_Default

Creating roles has a lot of advantages because you can customize exactly what each user is allowed to see and do, but also you are responsible for what you allow the user to do. It is a good idea to create test accounts that will allow you to see what the new role will be able to access.

Drupal_Users_Roles_Edited

One more benefit for Drupal users is that you can customize the different emails that the user is going to recieve when new accounts are created, forgot password, no approval required, awaiting approval, blocked email and deleted email. For many of us this might not seem like a huge benefit but if your CMS is going to have your (or your client's) personality, it is great to see that you can customize these type of details.

If the administrator creates a new account you have an option to notify to the user of their new account, WordPress doesn't have this option.

Drupal_Users_Added

We can see how both systems have their own way of handling user management and it is evident that when it comes down to a robust CMS where you need detailed user management Drupal gives you the flexibility you need. WordPress is the "out-of-the-box" solution that allows you to create predefined users, in a blogging environment this is perfect but for a more complex setup you will need to rely on plugins or hack the software directly.

to be continued (templates)

Disable extra fields in CCK for Drupal

There are times when you want to allow the Super Admin to edit those extra fields but not the editors/contributors of your site so this is one way to do it:

PHP:
    < ?php
    /**
    * Change the node form
    */
    function phptemplate_node_form($form) {
      // echo "<div style='direction:ltr;'>"; dprint_r ($form); echo '';
     
      // Hide 'Log message' text area
      $form['log']['#access'] = FALSE;
     
      // Hide the author collapsable box
      $form['author']['#access'] = FALSE;
     
      // Hide the publishing options collapsable box
      $form['options']['#access'] = FALSE;
     
      // Open the file attachments collapsible block in a full state
      $form['attachments']['#collapsed'] = FALSE;
     
      return drupal_render($form);
    }
    ?>

WordPress VS Drupal Creating Content

One (if not the most) important subject in any CMS is going to be creating content. You want to be able to allow you user to create content quickly and efficiently, while at the same time the developer wants control over how the content is going to be displayed in the front end.

Creating content in Drupal

Drupal Creating Content 1

Creating content in Drupal is very straight forward and I really like how they explain each default section. Immediately you can tell Drupal is not worried about winning the Blog wars since they do not even have a blog option as part of their default system. Although you can use the "story" as a blog post ("and informal blog-like entries may all be created with a story entry. By default, a story entry is automatically featured on the site's initial home page, and provides the ability to post comments.") and they also have a Blog module but is not one of their default settings.

Drupal Creating Content 2

Here is the default view for a Page in Drupal, straight forward that allows you to enter the Title and Body of the page. One draw back on this default interface (at least in my point of view) is the simplicity of the page, we do want simplicity but right of the back you cant upload pictures or have a pretty interface that you can use to edit test, which a lot of people have been accustomed to. Again, that is my point of view as if I were to give this application to a client as it is they probably would feel the same way.

On this page you can also allow the page to be part of the main menu or leave as is and you can enter HTML (something that can be changed and more about that in a different post)

You also get to create the revisions for that specific page and view/revert in the future if you desire to do so.

It is important to note that as these settings are optional and you can turn them on or off depending of your specific needs for the content. You also get a preview of the page with all the edit section at the bottom of the preview and then you can save to make your page live.

Creating content in WordPress

WordPress Creating Content 1

WordPress is a content-creation machine, as soon as you login to the dashboard you can do a quick-post which is similar layout to what you find in Drupal but immediately you are able to also upload media such as images, video, sound or media in general. Right away you can tell why WordPress is so "loved" in the blogging community.

But again, I need to create a page and that is one of the options in the main navigation bar. Create pages is 2 clicks away (1. Pages and 2. Add New)

Some of the features in WordPress is that you have the usual interface when creating content even with spell check. Which it was not available by default in Drupal. Also you are able to switch from Visual and HTML for the users who want to take advantage of that functionallity.

WordPress Creating Content 2

Another nice feature is that WordPress will save Drafts as you are editing your Pages, which allows you to keep the content you are working with in case something goes wrong with your computer, lose internet connection or are in the run.

You also are able to upload media in this section and create custom fields. Custom fields are used for more advanced site layouts that need this extra information to make your layout unique. Here is some information about custom fields. Can we create custom fields in Drupal? Absolutely but we are just covering the default behaviors in WordPress at the moment.

One more thing that WordPress does well, is providing feedback and information that to some might be overwhelming but that it is informative for the user such as word count and when the last draft was saved.

You can preview your changes which will be launched in a new page with your theme in a very realistic manner. Drupal does something very similar but all the editing tools live under the items you are reviewing.

Continue to WordPress VS Drupal User Management

WordPress Vs Drupal Installation

Download and installation for both was a breeze. Granted Drupal gave me a little bit more of problem since I had to create new directories and set the right permissions to the newly created directory and a settings file.

On the other side I also had to create a file in WordPress directory. Here are the steps on more detail

WordPress Installation

Wordpress_271

  1. Download WordPress
  2. Upload to server with FTP program
  3. Duplicate/Rename wp-config.php file (you can also let WP do this for you)
  4. Update settings in the file such as Database/Login credentials
  5. Add new Authentication Unique Keys*
  6. Enter Blog Title and your email
  7. Receive your Username and Random password.

WordPress Success Page

*It was nice that WordPress has a site dedicated in creating those unique keys and no way around it, once you hit the site you get the set of key numbers you need and continue working.

Drupal Installation

Drupal_610

  1. Download Drupal
  2. Upload to server with FTP program
  3. Create 2 files and set permissions to them (settings.php & /files)
  4. Enter database information on online form
  5. Submit Username and Password for admin and set some other basic settings such as site name

Drupal Success Page

Here you have it, the installation in a few number of steps for more advanced users. Granted, for some one that has never installed any package maybe you will have to browse around and find answers to basic questions but in the end you should be able to acomplish the same task in this few steps.

Continue to WordPress VS Drupal Creating Content

WordPress VS Drupal Intro

WordPress VS Drupal has been done, I know. Just by running a simple query in Google you will get a lot of information in the subject but for me it was still not quite what I was looking for. For one thing, I don't know much about the people who made the reviews or their credentials and some reviews lacked the basic information I was looking for.

To start let me give you some of my professional information so that you know who I am and where my review is coming from.

12+ years in Web Development
WordPress user since 2003
Drupal noob since April 2009 (about 5 days at the time of this writing)

Programming Languages and Frameworks that I either use or I have experimented with: ASP, PHP, AS(1-3), Flex, Objective-J, JQuery, JQueryUI, CodeIgniter, Kohana (fork of CI), Zend Framework, AMFPHP, HTML, XML, JavaScript, CSS, and more...
Online packages that I have worked with: WordPress, b2b, MovableType, Habary, Mambo, Joomla, SugarCRM
I would also like to note that I have created my custom CMS for clients, couple have been done with pure PHP and some with the aid of a framework such as CI, or Kohana. Also I have been fortunate into creating CMS that would have Flash front end and PHP/Framework backend.
Writer: 0 experience, just my blog .

(Disclaimer: I am not here to defend the packages themselves)

Now with that aside, I want to take a minute and put WordPress VS Drupal in a small duel where I will register my findings and give some feedback in different aspects of both pieces of software such as installation, upgrading, templates, 3rd party elements integration and whatever else comes along.

Continue to WordPress VS Drupal Installation