Archive for the 'The Art of Programming' Category

How to delete GPT Protective Partition

Posted in Windows Details on December 10th, 2009

I loaned a portable USB 1 TB drive to someone recently and they accidentally horked it up pretty well. They attempted some fix up on it but when I mounted it on my system it did not appear in the list of disks under My Computer but it was listed as a device off the USB hub.

Opening Computer Management under XP Pro the disk was listed as a “GPT Protective partition” and no options were available for doing anything to it under the Disk Management applet. A GPT partition is a GUID Partition Table and is usable by Macs and Windows Vista and greater — but not XP which is what what I’m running.

A quick search found this procedure:

In Windows XP Professional, if you cannot access or modify GPT disk, you can convert a GPT disk to MBR by using the “clean” command in the command line application DiskPart, which will remove all data and partition structures from the disk.

1. Go to the DOS command line (click on “Start Menu”, then “Run”, type in “cmd” in textbox, and hit “OK”)

* Type in “DiskPart” in command line.
* Type in “list disk” in command line to show all disks in this machine.
* Use “select” to set the focus to the specified partition, for example “select disk 1″.
* Use “clean” command to remove GPT disk from the current in-focus disk by zeroing sectors.

2. Go back to Disk Management, the disk should be “unallocated” now. Right click on disk info, choose “Initialize Disk” then format it.

Warning: Duh: This command will of course erase all data on the disk, but if you got here, you couldn’t access it anyway!

Windows Command Line stuff

Posted in Essential Tools, The Art of Programming, Windows Details on July 10th, 2009

Creating scripts to automate administrative or programming build tasks is GOOD. It centralizes details and reduces errors.

I find I need to re-learn DOS (and *nix) command line stuff every few years and then I completely forget how to do it and have to learn again.

Resources that I find useful:

The Windows Command Line

Microsoft Windows XP – Using batch files

The Wumpus lives

Posted in On the coffee table, The Art of Programming on June 10th, 2009

This is a great PHP version of the classic Hunt the Wumpus game of the 1970′s.

page247

This will make a great programming-class homework problem.

Teaching programming – part 2: how I tried it

Posted in Campfire Stories, The Art of Programming on June 10th, 2009

So I’m teaching a kid to program. “A kid” to me meaning anyone born after 1980 – ’cause I’m old.

Here are the choices I made.

Start with C++

If you want to be a professional programmer for the rest of your days, you should be an expert in C++. It’s all there: pointers, Object Oriented Programming, complex build issues: all the experience you’ll need.

Get a book to structure the “class”

All books suck to some extent. Just pick one and go. I chose Sams Teach Yourself C++ in One Hour a Day (6th Edition). It is big on C++ syntax, light on Computer Science topics.

Assign outside projects

I’m assigning tasks like a console Hangman game, The Game Of Life, things like that. Nothing makes concepts concrete like actually building a program that does something.

Teach Computer Science as taught at a great university

To be a professional programmer you need to be literate in computer science. Like any other self respecting astrophysicist (and therefore professional know-it-all) I tried for years to avoid it but finally gave in and learned CS.

After my student makes a pass through the Sams book above, I’ll start using the curriculum available free online at MIT’s Open Courseware. We’ll be starting with 6.00 Introduction to Computer Science and Programming

Teaching programming – part 1: how I learned

Posted in Campfire Stories, The Art of Programming on May 14th, 2009

A young person asked me recently: “Could you teach me how to write programs?”

Could I ever! I don’t know. Could I??

I’m old. I’m not so sure I’m a good example. The generations of my programming learning:

1. 1970′s — Poking around using BASIC on pre-PC microcomputers.

2. 1980′s — Writing a fair bit of software on my Timex ZX-18 using their BASIC.

3. 1980′s — Fortran 77 on PC and SunOS.

4. 1980′s — Writing a fair bit of software on PCs running DOS with Turbo Pascal.

5. late 1980′s — FTP, lots of ftp. Starting to use email. Writing Fortran apps on mini computers and using my PC as a VT-100 terminal with Kermit and a 1200 baud modem. Learned vi. Turbo C 1.0 (pre-ANSI standard).

6. 1990′s — Lots of Fortran 90 written under HP-UX and VMS. Starting to use C to interface with hardware.

7. 1990′s — CDROM based “Multimedia” projects. Silly aquarium games. Very painful under Windows 3.11.

8. 1990′s — WWW, the internet, HTML, cgi-bin scripts in Perl. Spending lots of time configuring web servers.

9. late 1990′s — The dot-com boom. All web, all the time. Microsoft ASP (classic: VBScript). Learned COM, ATL to enhance big MS technology web servers.

10. 2000′s — Big non-Microsoft web technologies. Linux, Java, Tomcat, other application servers.

11. 2000′s — Post dot-com: back to Microsoft with .NET! Love it. Back to client applications.

12. 2000′s — back to the web: ASP.NET. Love it.

13. 2000′s — set your way back machine: A huge project pulls me back to ATL/MFC/C++. Coding like it’s 1990 (Vista systems).

14. 2000′s — Computer game technology: classic C++, wicked algorithms, cool deep technology stacks like rendering pipelines, AI, terrain.

Looking back, what have I learned? A lot and especially that not all learning pain is gain.

I have growing respect for technologies that have evolved and stand the test of time. Looking down the list the Internet, client applications, and web-connected applications ebb and flow but feel like they will be around for awhile.

C++ is awesome. C#/.NET is way up there too. C# feels like C++ but someone has been in and tidied everything up. HTML has got to be one of the most ubiquitous formats on the planet.

Government computers and security settings

Posted in Essential Tools on May 7th, 2009

Recently we were asked to test our software on systems that had enhanced security settings. These are the result of (very) numerous configuration changes to the system so I looked around for some tools to help manage and apply these changes.

Bruce Schneier pointed the way on his recent post May 6, 2009
Secure Version of Windows Created for the U.S. Air Force
.

The Federal Desktop Core Configuration (FDCC) is described here.

Some nifty tools are at Blogs.Technet: Federal Desktop Core Configuration and Blogs.Technet: Utilities for automating Local Group Policy management.