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
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
    apple, boneheads, technology

    iOS 5: Why I finally Jailbroke My iPod

    First, I want to say that I love my iPod Touch. In Japan it was a constant companion. It was my map, my music, my entertainment during long commutes, my study aid, and a few other nice things along the way. Each very of iOS has brought with it a slew of enhancements that make it easier and more enjoyable to use. Unfortunately, each iteration of iOS brings something else as well, preloaded BS apps. While the available storage options have climbed, there is still just a scant 64gb peak. That means the iPod Touch and iPhone is more of a storage hill than a mountain.

    This is a minor inconvenience. In the first version of iOS Apple decided users needed to have an app that let you watch YouTube (rarely use YouTube), write crappy Notes in sub-standard font, and told you about Stocks (I have better options) and the Weather (same as stocks). At first it didn’t seem so bad, but then came FaceTime and Game Center (neither have felt so much a single tap from my fingers).

    Now comes NewsStand, yet another thing that I won’t use trapped on my iPod. This time Apple outdid itself, though. While none of their crappy and useless (to me) app are deletable, they at least allowed those apps to be put out of the way in a folder that I never had to worry about opening. NewsStand, on the other hand, spurns every effort to tuck it away.

    Fast-forward to this very instant. As I type, my iPod is restoring from a backup. Once that finishes I’ll be the proud owner of a jailbroken iPod Touch. For the longest time I ignored jailbreaking, because it was just too much of a hassle for me. That changed with iOS 5. I want at least a third as much control over the device I own as Apple current holds over it. Hopefully, I’ll get that.

    I really hope that Apple gets their act together. Until then I didn’t really see anything in iOS 5 that was worth the annoyance of the new crap they jammed it up with.

    iPod Touch, I love you, but if you keep it up, it might be time we see other people.

    Standard
    business, technology

    Paywalls and Crowdsourcing

    I saw this in the NYTimes recently:

    The Lede is tracking reports of the damage and the tsunami warnings. Are you in an affected area? What are you seeing? Send your photos to pix@nyt.com

    What’s interesting to me is that they are basically asking people to work for the NYTimes for free. This isn’t a new idea, it actually already has a name, it’s called crowdsourcing.

    What makes it interesting is this:

    Taking a step that has tempted and terrified much of the newspaper industry, The New York Times announced… that it would charge some frequent readers for access to its Web site

    I seems that the crowdsourcing was popularized on a paradigm of openness and freeness (ex. wikipedia). It’ll be interesting to watch how (if) the goodwill of the “crowd” changes when The New York Times’ paywall comes up.

    Standard
    apple, business, iphone, ipod touch, mac, music, technology

    Thoughts on "Stopping Piracy"

    There is no way to stop people from stealing. Humans have been stealing since well before computers came around, and they’ll never stop (at least not in our lifetimes). It’s better to let go of the idea of stopping it and figure out ways to work around it.

    Theft is an unstoppable force. If you see a car speeding towards you and you want to live, you don’t think of how to stop the car, you just get the hell out of the way.

    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
    politics, technology

    Will Yahoo! and the Others Change Their China Policies Now?

    Shi landed in trouble three years ago when the Chinese government prohibited journalists to report on the anniversary of the Tiananmen Square crackdown on pro-democracy protesters in 1989.

    When Shi forwarded the notice to human rights groups, the Chinese government pressured Yahoo to give them the name of the account holder, and they did so. Shi was also sentenced to 10 years in prison.

    CNN: Yahoo settles dissidents suit

    Yesterday’s announcement that Yahoo! is settling with the families of a men imprisoned and tortured with Yahoo!’s help sends a nice message, but is it enough to change the policies of companies like Yahoo!, Google, News Corp, and Microsoft which aid the Chinese government in suppressing democracy and commit human rights violations? Probably not. But that change is getting closer.

    Yahoo! has tried to excuse their reprehensible actions by explaining that non-compliance with Chinese authorities could land their Chinese employees in jail. Clearly, the US needs to apply an equal pressure here. American companies must not be allowed to break national and international laws without consequence. NPR has reported that Congress is taking steps towards making this happen with something called the Global Online Freedom Act, which would make it an explicit crime for US companies to aid China’s effort to suppress and torture its people. The act finds that:

    Technology companies in the United States that operate in countries controlled by authoritarian foreign governments have a moral responsibility to comply with the principles of the Universal Declaration of Human Rights.

    Technology companies in the United States have succumbed to pressure by authoritarian foreign governments to provide such governments with information about Internet users that has led to the arrest and imprisonment of cyber dissidents, in violation of the corporate responsibility of such companies to protect and uphold human rights.

    Technology companies in the United States have provided technology and training to authoritarian foreign governments which have been used by such governments in filtering and blocking information that promotes democracy and freedom.

    The act also decrees that “A United States business may not locate, within a designated Internet-restricting country, any electronic communication that contains any personally identifiable information.” and that “Any information that may be provided under subsection (a) for legitimate foreign law enforcement purposes may only be provided through established legal channels as determined by the Department of Justice.”

    The act basically says that America companies operating in China have conducted themselves in a way befitting of American values and laws. And since these companies are unable or unwilling to act in a lawful and moral manner the US Government will make them. While it would be nice if companies like Yahoo!, Google, Microsoft, and News Corp did what was right on their own it is good to see that at least Congress is trying to make sure US companies acting as the henchmen of dictators. That is, if the act ever gets voted on.

    Standard
    design, technology

    Running IE 6 and IE 7

    Anyone who does web design learns quickly that Microsoft Internet Explorer is a pain in the butt. Why Microsoft has decided to create its own bizarre standards is a question that only Microsoft can answer, but it’s the web designers who have to deal with it. With the emergence of IE 7 a Microsoft created yet another fun problem to deal with. IE 7 is far far better at following the standards set for web browsers, but that doesn’t help for IE 6. But that isn’t the problem, the problem is that IE 7 copies over IE 6. It is very difficult to get the two running side by side without help, which is annoying since web designers need to test sites is both browsers. Microsoft’s solution to this problem was to release versions of Virtual PC that only run IE 6 and expire after a few months. Meaning that designers need to download a +500mb file every few months and dedicate a huge chunk of hard drive and system resources just to test IE 6.

    But there is a better way and Tredsoft has found it. They have released an installer that lets you have multiple versions of Internet Explorer on your PC, they call it Multiple IE installer. While the name doesn’t leave much to the imagination the app does exactly what you’d want. It can install IE 5, IE 5.5, IE 6, or any combination thereof.

    Standard