All posts by Dave

About Dave

Designing websites since 1998.

Disconnecting Eclipse Project from SVN Repository

In Eclipse, in the event you have retrieved a project from an SVN repository and you would like to detach from the repository you need to do the following:

  • Open the Package Explore
  • Right Click on the project to be detached, a menu appears
  • Hover over “Team” in menu, options appear
  • Click option Team/Disconnect.
  • You are not detached from the repository

Android Error Message: System UI has stopped

After using Eclipse to develop Android Apps, I suddenly began receiving the error message “Unfortunately, System UI has stopped” when using the emulator. Generally, the configuration seems right and emulator seemed to work, this was a strange surprise after selecting to test against a device I had not used to test against previously. When I ran the emulator for the specific device, it would take to much time loading and an error dialog displayed on screen

Searching the net, I found my solution. To solve the problem:”

  1. Go to the device .avd directory. In Windows 7/x64, the directory is found at:
    C:/Users//.android/avd/.avd/
  2. Open the file config.ini in that directory
  3. Set hw.mainKeys=yes (instead of the current value no)

That seems to solve the problem.

Android: Add activity in Eclipse

Creating an Android Activity via Eclipse:

  • Double click on AndroidManifest.xml in the package explorer.
  • Click on the “Application” tab of the manifest editor
  • Click on “Add..” under the “Application Nodes” heading (bottom left of the screen)
  • Choose Activity from the list in the dialog that pops up (if you have the option, you want to create a new top-level element)
  • Click on the “Name*” link under the “Attributes for” header (bottom right of the window) to create a class for the new activity.

When you click Finish from the new class dialog, it’ll take you to your new activity class so you can start coding.

Drupal 7: Remove “No front page content …” message

Today, I noticed that that Google had found my website and the description showed the Drupal default message “No front page content has been created yet.” Definitely, the front page exists and contained content. However, I had not wanted to create an article page or other item and promote it to the front page. Therefore, Drupal was displaying that message. I had used CSS to hide the phrase, it seemed by a simple solution, but, hiding the content did not hide it from Google … Oops.

An option would have been to recreate the home page and in the administration area request the redefinition of the page to be used as the front page, a page that would not create that message. However, I did not want to recreate the page. I had already created several custom templates, including the page.tpl.php file. However, the message is embedded inside the $page content and printed by the line to render page content:

<?php print render($page[‘content’]); ?>

The question became, how do you remove the particular content and not damage the page as a whole. the answer is to unset the undesired content. the following command at the top of the page.tlp.php file removes the desired message without damaging anything else:


   
    <?php if(drupal_is_front_page()) {
              unset($page['content']['system_main']['default_message']);
          } 
     ?>

This same concept can be used to remove any unwanted text.

 

Adding js and css files to Zen Cart

If your doing some modifications to a Zen Cart template, you may need to add a css file or a javascript file to support the adjustment. There are simple ways to add new css and javascript files to a Zen Cart template.

Adding javascript files

To add a javascript file to all pages of a Zen Cart template,

  • Create a file or files with the naming convention jscript_.js
  • Place it(them) in a folder /includes/templates//jscript/

All jscript_<>.js files in the includes/templates//jscript/ will be loaded in the Zen Cart header.

Adding CSS files

To add a CSS file to all pages of a Zen Cart template,

  • Create a file or files with the naming convention stylesheet_.css
  • Place it(them) in a folder /includes/templates//css/

All stylesheet_.css files in the includes/templates//css/ will be loaded in the Zen Cart header.