questions
Giannii has an irritating MySQL question (April 6)
I'm trying to create a MySQL database while ssh'ed into cs from my own computer.
The line I'm trying to use is "$ mysqladmin -u db_user -p create HelloData".
I enter this command, and then I am prompted for the password for db_user. Any of the passwords I enter are incorrect. Is there a password I should know? Should I be installing this database using another username in place of "db_user"?
Return of Abben (March 2)
Another thing- I've uploaded some animated gifs, but when the display on
the page, they are not always animated (you may need to refresh before you see non-animated gifs... they are all supposed to be animated). What happened?
Question from Abben (March 2)
Something I've been banging my head over- In xml feeds, the <title> tag is used for two different things- the title of individual items appearing within the feed, and the title of the RSS feed itself. My script just assumes that the first title it finds is the feed title. This is probably ok to do and will probably work for every feed I encounter, but I really made a serious attempt for my script to be able to handle this and now I really want to know how to do it.
What I want is to make sure the first title I get is not inside an item tag. So, I want to do a regex search where I find <title> but I *don't* find <item> in front of it.
I found this handy piece of regex which looks built for the job:
($string =~ /(?<!bar)foo/)
but it only matches if bar immediately precedes foo and doesn't accomodate variable length expressions (I can't do (?<!bar.*) for instance). So, I did this:
($string =~ m/(bar(.|\s)*)(foo)/)
($string =~ /(?<!$1)foo/)
This worked with my little sample string I was testing it on, but then failed (or: didn't match the *first* title tag) when I tried it on the xml file. My script "regex_issues.pl" and a sample xml file I was using "salon.xml" are included.
Dia file format? (Feb 28)
The native Dia file format (extension .dia) is XML compressed with GZip.
You can select not to compress the files in the Preferences or in the save dialog.
So from the command line
$ cd /var/www/cs/htdocs/courses/spring2008/web/wiki/feb_28.attachments
$ cp course_registration_database.dia database.dia.gz
$ gunzip -c database.dia.gz > database.dia
And now the database.dia file is XML text.
TextWrangler displayed the gzip'ed orginal as text,
so I guess it uncompressed it automatically.