Visit msnbc.com for breaking news, world news, and news about the economy
Visit msnbc.com for breaking news, world news, and news about the economy
You are using the styles dialog (F11 or Format -> Styles and Formatting) to keep all your paragraph/character/page styles straight, right?
Say you’re doing the layout for a fiction anthology and you need to have the story name and page number on the recto and the author name and page number on the verso for each story. Each story has a different title and is written by a different author.
No, you don’t have to set up different page styles for each story/author combination. Custom variables to the rescue!
Insert -> Fields -> Other -> Variables -> Set Variable (or Ctrl+F2)
Insert -> Fields -> Other -> Variables -> Show Variable (or Ctrl+F2)
Use set variable to create your own variables that will be linked to the header (or footer) display. For example, if you create a text field variable named “author” (on the novella’s opening page, where you want the author’s name to display) and fill it with the name of the author who wrote the first novella in the anthology, you can then use show variable in the verso header and it will correctly display the author’s name on the pages for the first story. Ditto for the recto header: create a variable named “title” at the beginning of the story using set variable, then use show variable in the recto header and it will display the correct title.
You’ll need to re-set the title and author variables as you get to the title page for each new story, but you won’t need to redo header references–they’ll update themselves. :)
The table of contents setup in OO is a royal pain in the ass. The user interface is not intuitive at all, and there are no instructions on how to do a TOC in the help file. (Online yes, but not in the basic user documentation.) Also, every time something changed and the TOC had to be updated to reflect changed page numbers, it erased the custom layout I’d created. Wow, that’s helpful. NOT.
So I used references instead.
Insert -> Fields -> Other -> Cross-references -> Set reference (or Ctrl+F2)
Insert -> Fields -> Other -> Cross-references -> Insert reference (or Ctrl+F2)
Highlight the title and author variables you set earlier, and choose set reference. You’ll end up with multiple similarly-named references (I did title 1, title 2, author 1, author 2, etc.), but if you only have a few items, it shouldn’t get too clunky. Use insert reference on your TOC page (make sure “insert reference to” says “reference” to display the text, or page number to display the, you got it, page number). I also used these references to list the titles and authors on the copyright page for their copyright statements. Simple, yes?
YAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY!
I knew I wasn’t going to make it through today without crying, but geez. *vbg*
Good luck, President Obama.
*happy dance*
What’s so bad about liking SQL? About enjoying the beauty of a really damned well-written and concise query? Seriously, I just don’t get the hype about ORMs versus writing the queries yourself.
Don’t give me the “but it makes everything portable!” argument. How many times have you designed something, only to have to switch to a different RBDMS partway through? Or had to switch to a new on after the project’s done? *snort* Yeah, that’s what I thought. If you’re that worried about this elusive and inchoate thing called “portability,” design the system so all the queries can be put in one directory or file, and provide a way to swap out the optimized queries for each database-specific version. You know, kinda like we already provide language translations.
Please explain to me how a system that takes hours (eight and counting) to debug and runs a separate query for each fucking result is superior to the single optimized query I can write in less than thirty seconds and which produces the exact results that I need and no more, with none of the tearing out of hair and hours of frustration?
Also, if you’re going to write a framework that alleges that the ORM can be easily decoupled from the framework so that you can write your own SQL? An easy and—most importantly—well-documented way to get the damned results into the format the rest of the framework expects would be really nice. (The crap that makes up 99% of all documentation for programs—open source or commercial—is a rant for another day.)
This is the code for a Django template tag I adapted (also posted here). It was based on this snippet, adapted to split a list into n number of sublists, e.g. split a list of results into three evenly-divided sublists to enable display of the results in three columns on one page with CSS.
(Continued)
I’ve been setting up nginx, qmail, vpopmail, ezmlm-idx, etc., on my new VPS on slicehost (yay, slicehost!), and figured I’d post my notes in case they’re useful to anyone else, since finding even tiny bits and pieces helped along the way and kept me from tearing my hair out while trying to work out how everything fits together. *vbg*
These are my (very brief) notes about how to set up a new mailing list in ezmlm, when using vpopmail’s virtual domains with a mysql backend. (Yes, I realize I haven’t posted about the parts of the server set up that came first, but these are the most complete notes I have at the moment. *g*)
I like CodeIgniter so far (I’ve been fiddling with it on and off for a bit), but I’ve run into an issue that is driving me insane, so if anyone sees a typo that’s causing the issue, I’d appreciate it if you’d let me know. *g*
I posted about the issue on the CI forums this afternoon, so all the relevant code’s over there.
The gist of the problem is this: I’m using the same form for both adding a record and editing it. The model, view and controller work fine for the form when adding a new record. They also work fine when I submit the edited information. However, where it doesn’t work is when I initially load the record to be edited by grabbing the data from the database and then filling the fields on form. Text and textarea inputs get filled in just fine, but radio and checkboxes do not get checked to match their stored values. *sigh*
Any ideas out there?
Online school directory for El Paso and Teller counties, Colorado, USA (broken now). (The much better, non-corporate mush version is here on my site. [Also dead now, as I don’t want to update the code for newer versions of php and mysql.]) I have a ton of additions and improvements that I want to add as I have time, not the least of which is point clustering and geocoding/adding an address marker and displaying schools within a certain radius.
To be added at a later date:
Suggestions and comments welcome, as they always are on everything I work on. :)
Found a batch geocoder for Google maps a couple of weeks ago. It’s pretty simple, and returns accuracy and status codes to help weed out the addresses you might need to check by hand. (Yay for not having to write one’s own geocoding interface for Google!)
References: API docs for the status codes and address accuracy
I tried to get all of the commands put down in this how-to, so that people of all skill levels could follow the instructions. Be sure to let me know if I missed any or something needs clarified. :) But as usual, use at your own risk, yadda, yadda. (Continued)