Friday, October 28, 2011

HTML image Tag and Firefox are now friends

I have seen a lot of these questions on the web
  • Images not being displayed in Firefox
  • Images on local folders are not loading in Firefox
  • Image tags <img> don't work on Firefox
  • Images from local folders are displaying on IE and Chrome but not on Firefox and Safari
  • Firebug error: Failed to load given URL (usually an image)
I too ran into this while building a webpage. I had this simple code in my HTML file but the image won't load.

<div id="logo">
<img src="C:\xampp\htdocs\HelloNB\images\templatecompanylogo.gif" />
</div>

Why images don't load?

Due to security reasons Firefox prevents images from loading on your webpage. This restriction is on images stored in the local folder and most developers have faced this issue.

How did I solve this issue?

First off, I hit the Google road. Found a couple of suggestions from couple of people. Well, I took those few simple steps and was convinced that I was heading towards the solution. It took these for the images to appear.

I defined the source (src) property of the image (<img>) element as src="file:\\c:\< path-to-your-image-file >". (Notice the file:\\)

Like, the above code was altered and re-written as

<div id="logo">
<img src="file:\\C:\xampp\htdocs\HelloNB\images\templatecompanylogo.gif" />
</div>

For many out there, this would be it. This would work. If it doesn't, I really don't have to instruct you your next move :)

Install NoScript extension for Firefox. Navigate to Tools > Add-ons > Extensions > NoScript > Options > Advanced > Trusted > Check "Allow Local Links"

The images must now appear on your page. In case they still don't appear ................. :)

Right-click the image (un-displayed image) on your webpage, select NoScript and select "Allow http://localhost".

This worked for me and I hope this has helped you as well. If however, you had another workaround to this issue, please leave a comment or a link to the website that sourced you and thank you for doing that.

Wednesday, October 19, 2011

Running Joomla for the first time

You're almost done with the configuration and as excited about running Joomla as I was and then you see -
"Strict Standards: Only variables should be assigned by reference in C:\xampp\htdocs\joomla16\administrator\components\com_hikashop\views\menu\view.html.php on line 15

Strict Standards: Creating default object from empty value in C:\xampp\htdocs\joomla16\administrator\components\com_hikashop\views\menu\view.html.php on line 22

Strict Standards: Non-static method hikashop::completeLink() should not be called statically, assuming $this from incompatible context in C:\xampp\htdocs\joomla16\administrator\components\com_hikashop\views\menu\view.html.php on line 24

Strict Standards: Creating default object from empty value in C:\xampp\htdocs\joomla16\administrator\components\com_hikashop\views\menu\view.html.php on line 26

Strict Standards: Non-static method hikashop::completeLink() should not be called statically, assuming $this from incompatible context in C:\xampp\htdocs\joomla16\administrator\components\com_hikashop\views\menu\view.html.php on line 28............................................................
You immediately Google and you reach here; or may be not, you found a link to this page. :)
Well here's what you do next.
  1. Open file php.ini (C:\xampp\php\php.ini). I hope you know your location path? Or find out.
  2. Search for term error_reporting = replace it with error_reporting = E_ALL & ~E_NOTICE & ~E_DEPRECATED
  3. Search term display_errors = On and replace it with display_errors = Off
  4. Stop XAMPP and restart it
  5. Run Joomla in your browser. Congratulations!

Info on phpinfo()

phpinfo() is a function (so it looks like :) which returns information about your PHP environment.

Create and save and run it. Here you go.

  1. Open your text editor (notepad application)
  2. Write this piece of code  and save the file. Say you named it (phpinfo.php)
  3. Upload the file on to your web content folder of your domain. (htdocs, if localhost)
  4. Open your browser and type in www.domainname.com/phpinfo.php (if it's on your domain) or localhost/phpinfo.php (if it's on your local disk)

Sunday, July 17, 2011

Sync'ing Multiple Google Calendars with your iOS device

iPhone, iPod touch and iPad users can now get their multiple Google Calendars on their iOS devices. It took me a while to figure this out but now since I did, I thought why not benefit the world.

By default Google synchronizes the primary calendars to your iOS device, but now with different projects running on different calendars, you find yourself in a fix.

The solution: Once you've successfully setup your Gmail Account with an iOS device (make sure you have your calendar service on as shown in the below screenshot)


Now open your safari browser and navigate yourself to http://www.google.com/calendar/iphoneselect. Select the calendars that you want on your device and click Save.

Did you get there? Cheers!!

Wednesday, January 19, 2011

Using Switch Function in Crystal Reports

I haven't found much about crystal reports on the internet which made me wonder. It is one of the most widely used reporting tool. Here (through this blog) I intend to keep a journal of my learnings. How better can it get if someone else can utilize and learn! There's no better feeling.

So here is my first post on Crystal Reports.......
  • Want to use a formula to filter your report?
  • Don't know how to use the Switch function in crystal reports?
  • You are always using range parameters (like the one in the below screenshot) and wondering if you could use just on parameter to accomplish the filter?


Using 2 parameters (From and To) to filter the report using a range


 You are in the right place!

While range parameters do have their pros, you must be clear on what you need to accomplish. Let me get on to Switch now.

The Switch statement has a very simple crystal syntax
Switch (expr1, value1, expr2, value2, ...., exprN, valueN)

{Command.is_Facility_ID} in {?From Facility} to {?To Facility} and
{Command.is_Insurance_ID} in {?From Payer} to {?To Payer} and
Switch ({?Coding Stts} = "Coded", {@Coding Stts} = "Coded",
{?Coding Stts} = "Un-coded", {@Coding Stts} = "Un-coded",
{?Coding Stts} = "All", {@Coding Stts} in "Coded" to "Un-coded")

While I use the switch statement, I do not have to mention the range. I can achieve almost the same thing using a single parameter.

Above here I am trying to display all the records that are "Coded" if the parameter selected by the user is "Coded" or "Un-coded" in case of "Un-coded" selection. If the user selects "All", I am displaying all between "Coded and "Un-coded".

Now what if there were more options between "Coded" and "Un-Coded" like "Re-coding", "Coded but not finalized" etc. in that case the final statement could look more or less like
{?Coding Stts} = "All", {@Coding Stts} in "AA" to "ZZ")
This will pretty much display everything that's between, which literally means "All" :)

Advantages:
  • Saves development time.
  • Users don't have to enter parameter values twice while running the report. Saves their time.
  • Saves A4 real estate.
You've got something to share? Comment and let us all know.