Year: 2013

Installing Internet Explorer on Mac

Edit (2014-07-11): Fixed URLs

When you need to develop/design a solution for the majority of corporate users, you will need to test it on Internet Explorer. If you have a Mac, setting this up on your machine is easy.

The original source for this information was OSXDaily. I cleaned it up and added additional information.

Intended Audience

TerminalIf you’re unfamiliar with using the terminal, these instructions will not help you. The point is to allow you to install Internet Explorer on Mac for the purposes of testing and developing web applications and sites. Ideally, you are one of the following:

  • Web Developer
  • Web Designer
  • QA Tester

If you plan on running Internet Explorer for other purposes (such as working with an IE-only site), then this is probably not the best solution for your needs.

Required software

  1. Oracle VirtualBox
  2. curl (from Mac Ports or other)

Procedure

Be aware, this process can take HOURS to do, may crash in the middle and cause you to start over, take up inordinate amounts of disk space, etc.

Install IE7 Only

curl -s https://raw.githubusercontent.com/xdissent/ievms/master/ievms.sh | env IEVMS_VERSIONS="7" bash

Install IE8 Only

curl -s https://raw.githubusercontent.com/xdissent/ievms/master/ievms.sh | env IEVMS_VERSIONS="8" bash

Install IE9 Only

curl -s https://raw.githubusercontent.com/xdissent/ievms/master/ievms.sh | env IEVMS_VERSIONS="9" bash

Install IE7, 8 and 9

curl -s https://raw.githubusercontent.com/xdissent/ievms/master/ievms.sh | bash

Notes

Once you have the virtual machines installed, fire them up, set up the Windows instance (install drivers, etc.), then take a snapshot. This is the one you will always use.

When you get a ‘you must activate’ notice, open a Windows cmd line and run

slmgr –rearm

You can rearm two times before it won’t work anymore. At that point, roll back to your snapshot and you can rearm again when you get the message. Obviously, when you roll back to your snapshot all changes will be discarded (that’s the point), so make sure you save any data on your host’s drive.

FAQ

Q. Where is the command line on my Mac?
A. It is not recommended that you use these instructions; instead try another solution such as Apple Boot Camp.

Q. How do I install/uninstall Oracle Virtual Box?
A. You can try looking for information on the Oracle Virtual Box website or contact the Genius Bar at your local Apple Store for assistance.

Q. Where are the windows snapshots stored?
A. In ~/.ievms/

Q. The download stalls or crashes.
A. If it stalls, check your internet connection; you may have to restart the install. In the event of a crash, examine the error message to determine the cause of the problem.

Q. Can you just install it for me?
A. Sorry, no.

Don’t hate your users

If you want to enable your users to do something, such as create an account on your system, DO NOT MAKE IT IMPOSSIBLY HARD.

Case in point:

This image will make you cry
Go ahead and register, I dare you

If algebra is too hard, just refresh and you’ll see something else.

Another scary image
I laugh at your feeble Calculus skills!

Woah, better refresh.

You can't escape the Maths
Make your time

You know what this does? It not only keeps out any bots, but turns a normal human into something else:

rageface
Apoplectic: overcome with anger; extremely indignant.

With a zillion other websites out there, are you sure yours is compelling enough or contains such rare information that people will jump the gorge to get to it?

https://www.youtube-nocookie.com/embed/P7vte1epVpE?rel=0

 

How to ask for help the wrong way

When submitting  bug reports, it is a good idea to

A room full of computers all showing the BSOD

  1. Realize that you’re asking for help from people who (usually) have day jobs, and
  2. Expend at least some amount of effort to show you’re not expecting someone else to do all the work.

With that in mind, let me introduce to you the Best Bug Report Comment, Ever

First the bug report:

[snip]

I don’t have the exact errors to post because I deleted my compile log, but they are the same errors you get if you don’t have the bzip2 development libraries installed, which of course I do in /www

[snip]

Then someone helpful asks for more information.

Please recompile so that you can tell us te exact errors.

Derick

And then, GOLD:

The php developer who added/maintains bzip2 support will know what I am talking about. I am not going to compile when I know this! It would be a waste of my time.


Wow.

Now, not to worry; a few minutes later the submitter saw the error of his ways, compiled his code, posted the exact error message and got help.

Learning how to ask questions is a skill. Mastering this skill can only help, because everyone (even the Super-cool techno guru) has to ask for help at some point, so why not be as effective as possible?

Until I find another one. That place is GOLD!

Enhanced by Zemanta

Decoupling presentation from content

Box model in CSS
Box model in CSS (credit: Wikipedia)

I recently ran across the anti-pattern of what I see as a common problem amongst designers and developers: coupled presentation and content. I’ve found that decoupling the presentation from the content makes things much easier to write, maintain and expand.

Here’s a simple example:

HTML

<section>
    <div class="margin-top-10">Lorem Ipsum</div>
</section>

CSS

.margin-top-10 { margin-top: 10px };
.margin-top-20 { margin-top: 20px };
(etc)

Take a look at what is going on here: we’re adding a 10px margin to the top of the div. DON’T DO THIS. You want your class names to be contextual, not descriptive of the style.


Rule of thumb

To change the layout, you should only have to edit the CSS, not the HTML.

Here’s where our anti-pattern falls down and will cause grief.

  1. You decide to adjust the positioning of the section. You can:
    • Edit the CSS, changing the class’s margin value and breaking every other element that uses that class.
    • Edit the HTML create a new class, then edit its CSS class definition. If you have to experiment with different margin values, you’ll need a LOT of classes. “Will 14px work or 15px? What about .25em? Argh!”
  2. You can’t have too many attributes in each class, because they will have unintended consequences for the other elements that are using them. Add a red border to one class because you need a border for a specific element, now you have red borders on ALL the elements that share that class. So, you’ll have to have many single- (or few-) attribute values, and include all of the necessary ones on the required HTML elements.
  3. The violent psychopath maintenance programmer (who knows where you live) will kill you in your sleep. You have made her job insanely hard by turning this:
<div class="margin5 blueborder mediumwidth floatingleft" ...

into this

<div style="margin:5px;border:3px blue outset;float:left;width:75%" ...

for no good reason.

The Cure

Think about the element in terms of content or a functional space. What is it and what does it do? In our example above, let’s assume it is the lede section of an article. Then we would do:

HTML

<section>
    <div class="lede">Lorem Ipsum</div>
</section>

CSS

.lede { 
  margin-top: 10px;
  border-bottom: 2px #9fe2f9 outset;
  float: right;
  position: relative;
  width: ...
};

By decoupling the content (div) from the presentation (style-dependent class), we are free  to adjust the style of that element by making whatever changes to the CSS and leaving the HTML alone.

“But,” you shriek, “I have common elements for everything! Rounded corners! Gradients! (except IE…) Et cetera!”

 

For this, we will turn to our trusty companions Less and/or Sass in a future post.

SASS: Style w/ Attitude
SASS: Style w/ Attitude
Enhanced by Zemanta