Wednesday, September 23, 2015

Boolean Logic

Boolean logic is a way of describing relationships between ideas that can have the truth values TRUE and FALSE. We describe these relationships in a diagram called a truth table:

xyx OR yx AND y
FalseFalseFalseFalse
FalseTrueTrueFalse
TrueFalseTrueFalse
TrueTrueTrueTrue

Here is an example of boolean logic. Suppose we have a set of colored shapes. We might ask two kinds of questions. If we choose one of the colored shapes, we might ask: is it blue and a circle? If we choose a blue circle, it is blue and also a circle. If we choose a yellow circle, it is not blue and a circle, because it is yellow (not blue). If we choose a blue square, it is not blue and a circle, because it is a square (not a circle). So whatever shape we choose must satisfy both the requirements, that it be both blue and also a circle.

Tuesday, September 22, 2015

Useful Keyboard Shortcuts

These keyboard shortcuts are useful when working on the Mac. You can avoid using the mouse or trackpad, and save your wrists a lot of pain.

Windows has similar shortcut keys, but they use the Control key instead of the Command key.

⌘ Space Spotlight
⌘ Tab Switch application
⌘ S Save
⌘ D Desktop
⌘ Z Undo
⌘ X Cut
⌘ C Copy
⌘ V Paste
⌘ , Preferences
⌘ R Refresh
⌘ W Close Window
⌘ L Edit URL
⌘ N New file
⌘ F Find/Search
⌘ G Search again

Blogger lets you type HTML tables into the HTML tab, and it lets you add styles to your tables too.

Typing the Command Key (Cloverleaf) symbol

In an HTML document (web page), you can type the cloverleaf symbol by adding this string to your code:

⌘

It should look like this:


Make sure you include the ampersand, the hash (pound or sharp sign), and the semicolon at the end.

In a word processing document, such as Microsoft Word or Apple Pages, you need to go to the symbol insert function, and look for "point of interest" symbol. It is unfortunately not called the cloverleaf symbol, and you can't search for it within a word processing document that way.

In a pinch, you can always just search Google for cloverleaf symbol to get this information.


Running Windows on Mac

Running Windows on Mac is frustrating for two reasons. One, Windows itself is inherently frustrating if you are a Mac user. Two, the emulation software (Parallels, Fusion, Virtual Box) is slow.

Don't forget that in order to run Windows on a Mac, you must pay for the emulation software, and you must also pay for a legal copy of Windows. For the same price, you may be able to buy an inexpensive Windows laptop.

Which is more frustrating? Running Windows on a Mac, or running Windows on an inexpensive and possibly underpowered machine? Only you can decide. But be aware that you do have options.

If you use Windows relatively infrequently, running it on you Mac may be more economical.

Here are some reasons why I have Windows installed on my Mac:
  • To test my web sites on Internet Explorer.
  • To use Excel and PowerPoint functions that are not available in the Mac versions.
  • To compile C# code on Visual Studio.
  • To help my students who are running Visual Studio or WAMP on their Windows computers.
Here is some software you can run without actually installing Windows:
  • The Mac versions of Word, Excel, PowerPoint, and Outlook.
  • MAMP (the Mac equivalent of WAMP).
  • Eclipse or ADT for compiling Java programs and Android apps.
  • Mono for running C# code from the shell.

Blogger lets you insert styles and scripts

Click a color well to change the color of this text.

Red #ff0000
Orange #ff8000
Yellow #ffff00
Green #00ff00
Cyan #00ffff
Teal #008080
Blue #0000ff
Violet #ff00ff
Purple #008080
Black #000000
White #ffffff
Gray #808080

 

Macs I've known and loved

PurchasedModelComments
1985Mac 512KMy first Mac. Later upgraded to 512KE then Mac Plus.
1991Mac IIsiSJSU bookstore.
1992Powerbook 100Price Club (Costco).
1994Powerbook 165cMacWarehouse.
1997Performa 6400Ugly computer. Bought from Small Dog Electronics.
2003Power Mac G4 MDDPowerful computer at the time. Bought from Mac Pro in San Jose.
2005Powerbook G4 AluminumBeautiful computer. Mac Pro in San Jose?
2009MacBook Pro 15”Tech Restore in Concord. My first Intel Mac. I needed it to run Windows.
2012Mac MiniA little powerhouse.
2013MacBook Pro Retina 13”I use it for PowerPoint and teaching my classes.
2014iMac RetinaThe retina screen is beautiful.

This cool Tableizer web site lets you create an HTML table from spreadsheet data or tab-delimited data and you can then insert the HTML into your web site. In Blogger, you must paste the resulting HTML into the HTML tab on your post, not the Compose tab.


My advice for buying a Mac

(updated late 2017)

I first compiled this information in 2012 to help some friends who wanted to buy Macs. I updated it in early 2014 to help some students who were taking a class in Mac/iOS programming. (Such requires use of a Mac; it cannot be done on a PC.) Now I'm updating it again.

This is what entitles me to give this advice: I have used many different Macs since 1985, and I buy about one every other year, so I've been doing this for a long time. I have bought both brand new and refurbished. I have opened almost every Mac I've ever owned to upgrade it (except the new ones that can't be opened.) I am stingy, so I always look for the best deal and the best strategy.  

[1] Your friend who works at Apple may be able to get you a discount. However, Apple employees are inundated with such requests from their friends, and they have a limited number of discounts to use, so employees usually reserve the discounts for their family members.


[2] Don't be afraid to buy a refurbished Mac. Apple sells them for about 15% less than list price. A refurbished computer has been returned to a tech who checks everything and fixes what may be broken. Many new computers ship with problems or even DOA. A refurbished computer has been checked a second time beyond the normal factory testing. (This is true of other computer brands besides Apple too.) Be careful: you may be buying last year's model.

Tuesday, September 8, 2015

SVCTE

Today I started my third week teaching a high school class at Metro Ed / Silicon Valley CTE (Career and Technical Education). I am teaching Mobile App Design and Coding to high school junior and seniors. We have a classroom full of brand new iMacs and other Apple equipment. We'll be writing iPad and iPhone apps. 

We're starting out by learning about color, fonts, and layout. We're doing some practice coding by making small web pages with a little JavaScript.

The students are sharp and most of them seem to be having fun. I met some of their parents tonight at back to school night.

The position is currently only half-time, but I also teach two other programming classes in community colleges.


Saturday, July 25, 2015

Looking for a web hosting service

I'm looking for a web hosting service that has available all these facilities: PHP, Perl, Python, Ruby, C++, Java, C#, Swift, Golang, and MySQL available from all those languages. I've written a tutorial that shows how to do web programming in all those languages, but there is no hosting service that has them all available out of the box, and it's hard to find a custom installation that will handle both C# (a Windows technology) and Swift (a Mac technology). My Mac can do it all, but its connection to the net is slow. Dreamhost and A Small Orange say they can handle this with a VPS, which I'd have to set up myself, but I'm skeptical that Ubuntu could run Swift or xcrun, even if C# can be executed by Mono, so it's hard to see how I could get both those languages running together on the same server unless it's a Mac. Any other suggestions?