design, technology, tips

A Fix for when InDesign Split Columns Doesn't Work

Thanks to David at InDesign Secrets I’ve verified a little bug with InDesign’s Split Columns feature. Apparently if you try to split columns at the end of a story it just won’t work.

The solution is easy enough though:

  1. Add an extra empty paragraph to the end of the story.
  2. Split the column as you would normally.
  3. Delete the extra empty paragraph.

I can’t explain why it is that you need the extra paragraph there to make the column split, or why you can delete it immediately afterwards with no ill effect, but I am certain this method (while slightly cumbersome) works.

Standard
apple, mac, tips, windows

Getting Text From Apple Pages on a PC in a Pinch

The other day I brought a .pages file into a classroom. The problem is all the computers at the school use MS Windows, which can’t open .pages files. Did I panic? Yes. Was all hope lost? Nope.

It turns out that the .pages extension is just a fancy compressed file. That means you can simply change the “.pages” extension to “.zip” or “.rar” and get at the file contents.

The simplest way to get at the text from there is to look in the folder called “QuickLook.” There should be a PDF in that folder with everything in the file. If you need to edit the text, you could simply copy and paste it into a new file. If you are using adobe acrobat it will probably have formatting oddities, so another option is to upload the PDF to Google Docs, which will allow you to convert, edit, and print the file.

If you are feeling really adventurous, there is a final option. The “index.xml” file contains the text and styling of the .pages file. It will look mostly like a bunch of code, but if you go all the way to the end of the file, you’ll find the text is in there.

Of course, none of these are the ideal way to handle .pages files. It is obviously much simpler to export the file as a PDF, RTF, or DOCX file. Just know that if the options are limited, there is still a way to pull a save off.

Standard
code, technology, tips

Dead Simple PHP Calendar

I needed a calendar for a PHP project I was working on. I did a quick look around and found some promising solutions, but they all seemed way more complex than what I wanted. They also used tables, which are gross. This is a ridiculously easy way to get a calendar from php:function calendar($date=false){
$date_parts=(!$date)?preg_split("/[-]+/",$date):preg_split("/[-]+/",date('Y-m-d'));
$year=$date_parts[0];$month=$date_parts[1];$day=$date_parts[2];
$time=mktime(0,0,0,$month,1,$year);
$month_name=date('F',$time);
$days_in_month=cal_days_in_month(CAL_GREGORIAN,$month,$year);
$first_day=date('w',$time);
$calendar='

'.$month_name.' '.$year.'
  1. Su
  2. Mo
  3. Tu
  4. We
  5. Th
  6. Fr
  7. Sa
  8. ';
    for($x=0;$x< $first_day;++$x)$calendar.='

  9.  ';
    for($x=1;$x< =$days_in_month;++$x)$calendar.=($x==$day)?'
  10. '.$x.'':'

  11. '.$x.'
  12. ';
    return $calendar.'

';
}

How it works
It is actually pretty simple. If you feed the function a date it will make a calendar and highlight that day of the month. If you do not feed the calendar a date it will make a calendar and highlight today’s date.

How to use it
The simplest way to call this function is or if you are feeling romantic you can specify a date You must format the date YYYY-MM-DD (leading zeros are optional).

Making it look nice
Tables are not the worse thing in the world, but they are not even close to the best way to do this. Styling the calendar in CSS is a far better choice, especially if you want to go above and beyond with you calendar. If you just want a basic calendar you can use CSS like this:#calendar{position:absolute;top:6em;left:50em;width:14em;min-height:12.5em;margin:0 auto;text-align:center;font-size:0.6em}
#calendar h6{font-size:1em;margin:0 1em;display:inline}
#cal_body li{list-style:none;width:1em;height:0.8em;float:left;padding:0.2em;margin:0.1em;text-align:center}
.highlight{color:#E81490}

Of course we can make this more complex
For example, we could add navigation to get to the next month or previous month. We could also make the dates into links. For my purposes I did both.

Adding monthly navigation can be done by editing one line:$calendar='

< <

'.$month_name.' '.$year.'

>>

  1. Su
  2. Mo
  3. Tu
  4. We
  5. Th
  6. Fr
  7. Sa
  8. '

If you want to use that, you will probably need to edit the link so that it connects to whatever/wherever your calendar is located.

Making the dates into links is also just a simple matter of editing one (long) line:for($x=1;$x< =$days_in_month;++$x)$calendar.=($x==$day)?'

  • '.$x.'':'

  • '.$x.'
  • ';Again, you would need to edit that link so that it connects to everything to the function.

    Standard
    democracy, politics, privacy, technology, tips

    Verizon and the Sale of the Customer

    According to Verizon’s latest update to their privacy policy, they will now “share” (i.e. sell) lots of information that may make customers uncomfortable. Verizon’s changes to their privacy policy, one must assume the term privacy is being used ironically, includes sharing:

    Mobile Usage Information:

    • Addresses of websites you visit when using our wireless service. These data strings (or URLs) may include search terms you have used
    • Location of your device (“Location Information”)
    • App and device feature usage

    Consumer Information:

    • Information about your use of Verizon products and services (such as data and calling features, device type, and amount of use)
    • Demographic and interest categories provided to us by other companies, such as gender, age range, sports fan, frequent diner, or pet owner (“Demographics”)

    Verizon is trying to make users feel better about this by quietly offering a opt out and promising that no personally identifiable information is being sent. It should be noted that this doesn’t mean your personal information isn’t being held back, it just means your name, account number, and the like aren’t being sent.

    This is the loop-hole that corporations have carved out for themselves in order to commodify customers. Sell everything about the customer, except for their names. It is a good way to make money. Companies like Verizon are charging people to use the service and then having those customers create a product that it can sell. In return for the service the customer provides Verizon the customer gets nothing. Even as this erosion and commodification of privacy becomes common practice these days, there is not much customers can do.

    Corporations like Verizon have the upper-hand and can simply place the onus on the customer and the free-market. If you don’t like how they collect data, don’t give them your business. Never mind that the next company will do the same. Never mind that services like internet and cellphones are essential to modern society.

    Giving those who oppose regulations the benefit of the doubt, lets say they often miss this important fact— that corporations have only their best interest at heart, and that many (though obviously not all) of their services are not optional. A democratic society should protect its citizen from the corporations which have become micro-oligarchs.

    Standard
    technology, tips, wordpress

    The Perils of Using a Free WordPress Theme

    Take a look at what happened to this blog’s hit counts after switching (briefly) to a new and free WordPress theme downloaded from the official WordPress website.

    Before I used my own variation of the freely available sandbox theme. I switched after updating the template andlosing some of my work on it. Now I’ve gone back with though I haven’t put any real effort into making the site look “good.”

    Since replacing the theme, my site’s stats have returned to normal. I won’t name the theme that killed my blog’s stats for about a week, because that’s mean, but it should serve as a warning. By itself the sandbox theme is fairly SEO friendly, but with with a little tinkering you can get something that knocks the mittens off kittens. Sandbox is the exception though, not the rule. Many of the themes available out there a garbage. It is better to make your own or pay someone with brains to do it for you.

    Remember, free is sometimes good, but not always.

    Standard
    mac, tips

    Living with Leopard's Firewall


    I made the plunge and upgraded to Leopard. A CompUSA rebate of $30 (bringing Leopard down to a mere $99) was too much to pass up. I like a lot of Leopard and I haven’t had many problems so far, though I do see a good amount of room for improvement. One place that needs serious improvement is Leopard’s new Firewall system. I’d heard that you could now choose to open the firewall on the application level, and I thought that was nice, but I hadn’t heard that you *had* to do on the application level. That’s dumb. Application level rules are fine if I have a simple application I want to open a port for, but if I want to open a port for something like a custom build of apache it can’t be done.

    Thankfully you can still use the terminal to open ports in the firewall for Leopard. Not as easy as using the firewall in Tiger, but it gets the job done. Here’s a few helpful tips:

    to add a port:
    sudo ipfw add allow [udp or tcp] from [port] to [port]
    So, if you want allow port 80 with tcp you’d type sudo ipfw add allow tcp from 80 to 80

    to see your rules:
    sudo ipfw list

    to delete an open port:
    first type sudo ipfw list, you’ll get something like this

    33300 deny icmp from any to me in icmptypes 8
    33400 allow udp from 0.0.0.80 to 0.0.0.80
    33500 allow tcp from 0.0.0.80 to 0.0.0.80

    take the number proceeding the rule you want to delete and type sudo ipfw deletem [rule number], so if I wanted to delete the rule “33500 allow tcp from 0.0.0.80 to 0.0.0.80” I’d just type
    sudo ipfw delete 33400

    Hopefully Apple will realize that giving users no advanced options is dumb. But until then, start loving the terminal!

    Standard
    code, tips

    Hiding PHPSESSID

    I’ve built GlitterPony Magazine’s website so that it is dynamic. All I need to do is put the poems into the database fill in a field or two and I’ve got a functioning website. Of course the site is written in strict xhtml so that I can have a new look to each issue simply through modifying the CSS.

    This saves me a lot of time since I can focus on the design aspects and ignore most of the tedious stuff. In fact I’m completely satisfied with this solution, I’ve even written the rewrite rules so that our URL’s all look pretty and are SEO’ed (Search Engine Optimized). The thing I am not satisfied with is that under certain circumstances a vistor would get a url that has something like ?PHPSESSID=5ab080e5cff5dc130f9bec234b stuck to the end of it. Boy is that ugly. It also hurts our ranking in search engines. But there is a fix and it is very simple.

    All you need to do is add php_flag session.use_trans_sid off to the .htaccess file and bang! You got clean urls. Of course if you’d like you can add ini_set('session.use_trans_sid', false); to your php files, but why add that to all your files when you can add one line to your .htaccess file?

    Standard
    design, tips

    Using <object> in Internet Explorer

    As a web designer I hate Internet Explorer. Microsoft often makes their own rules despite there being rules in place already. I will say however that IE is getting better at following standards with each new version of its browser. The Big Problem™ is that sometimes IE interferes with a page remaining valid XHTML. There is a workaround for almost all of IE quirks, but it is often a long treacherous road to get there, and sometimes the fix is worse than the problem.

    One way IE makes life hard is when a person needs to embed a webpage inside a webpage. Admittedly this should almost never happen because it is usually a bad idea. However, sometimes it is a good idea. The only time I’ve found it useful is in my web chess program. It is a good use because I require two separate elements to refresh at different intervals. Also, by limiting what refreshes it cuts down on page load and makes it so the main page never has the refresh blink (that second of white before things load in the browser).

    Until now I’ve been using the <iframe> element to embed those pages because it seemed to be the only cross-browser solution. Today I discovered that someone took the long treacherous road and found a way to use the <object> element. The key is the classid:

    classid="clsid:25336920-03F9-11CF-8FD0-00AA00686F13"

    To learn more about using the element and making it work in IE read Brad Wrights discussion of the technique.

    update: using the classid above breaks objects in FireFox 3 beta 5

    Standard
    technology, tips

    Great (Free) Open-Source Script Writing Software

    So, you want to participate in Script Frenzy this June, but you know already that MS Word will give you an atomic headache just to get it to do its mediocre formatting job, so what do you do? You could go out and buy Final Draft for $229. Final Draft has been around for a long time, but lots of people don’t think it is so great (note the review is from 2004 and that Final Draft is still at version 7). If $229 is too much for software described as “buggy” with “poor technical support” you could try Montage for as little as $140 (download only price). But, you may not like that people don’t have much love for Montage and its bugs either, plus it is only for Mac.

    Maybe you want to write your script without paying for expensive and buggy software, hey, I don’t blame you. So what can a guy or gal do then? Where should a future scriptwriting genius turn? Well, you have no need to fear Celtx is here and it is open source (free!). Best of all, Celtx works whether you’re on a Mac (i.e. a clever person), Linux (i.e. a geeky person), or a PC (hey, no one is perfect).

    Celtx doesn’t just format your documents though, it has all sorts of neat features to help you write your blockbusting indie filck about a man who, while trying to discover the secrets of a lost civilization, discovers the power of love from a real live mummy princess. With features like storyboards, schedules, reports, media development (for characters, settings, animals, etc), and collaboration tools how can you pass Celtx up? It is already used by lots of people, especially folks in film schools.  One person even wrote to the Celtx team:

    I’ve taught, reviewed and used every editing system, compositing application, audio sequencer, production process, script-writing tool, storyboard system and imaging program known to humankind and I simply need to tell you that Celtx is the most efficient, effective, flexible and forward-thinking piece of software I have ever encountered in 15 years or making moving images…!

    While I’m no Cohen brother, I can tell you that Celtx is well worth trying.

    Standard
    technology, tips

    The Curse of the Deadly Scam Email of Death

    stick ‘em upThere is a creepy new scam in town folks. We all know that even supposedly smart people can be dumb, and sure, everyone makes errors in judgment now and again, so let me tell you now: if you happen to get an email from a person saying they’ve been hired to kill you, they are lying. This new email scam, lets call it the killer with the heart of gold scam. It reads something like this (as with most scam email, note the typos and use of English):

    I want you to read this message very carefully, and keep the secret with you till further notice, You have no need of knowing who I am, where am from, till I make out a space for us to see, I have being paid [lots of money] in advance to terminate you with some reasons listed to me by my employers, its one i believe you call a friend, i have followed you closely for one week and three days now and have seen that you are innocent of the accusation, Do not contact the police or F.B.I. or try to send a copy of this to them, because if you do I will know, and might be pushed to do what i have being paid to do, beside, this is the first time I turned out to be a betrayer in my job.

    Which sounds kind of laughable, except that when people respond to the email the scammers come back at them with person information, however special agent Bill Shore says, “recipients should not be overly spooked when scammers incorporate their intended victims’ personal details in their schemes.”

    In an even more fun turn of events, there is a new angle to the scam. Apparently, you may get contacted by the “FBI”

    inform[ing] recipients that an arrest was made in the case. The e-mail says the recipient’s information was found on the suspect and that they should reply to help further the investigation.

    If you’ve been had, or if people try to get you report it, contact IC3 or your local FBI field office.

    Standard