Totally ignoring (skipping) a page in LaTeX

To include a dedication page in my thesis, I have to not number the page and not include the page in the numbering scheme. That is, if the dedication is on the 10th page of the thesis, the page before is numbered ix and the page after is numbered x.

To do this, use the \addtocounter command to add a negative value to the page counter when you start the page, and then don’t print the page number with \thispagestyle{empty}.

My dedication page:

%Dedication
\chapter*{} %blank chapter, no title, not included in table of contents
\thispagestyle{empty} %no page number
\addtocounter{page}{-1} %ignore this page when counting
\vspace{2.5in} %start the dedication halfway down
\begin{center} %center everything
\hl{Dedication} %the wonderful words
\end{center}

 

Source: Help On LaTeX \addtocounter: “\addtocounter{counter}{value}”

 

Posting with my real name

[I just wrote this over at The City Beat. I’m still working through some things.]

Ben T., Information Architects had some good things to say about posting comments with your real name.

http://informationarchitects.jp/use-your-real-name-when-you-comment/

I go back and forth on this, and I think it’s a really interesting topic. For one, I like knowing what I said, and now that Google has just about everything I’ve ever written on the Internet, if I always posted with my real name, I could go back and check up on it. So could other people, and this is what irks me about myself: do I want other people to be able to dredge up what I’ve said? A lot of it’s opinion, some of it’s having fun, and some of it reflects me having a bad day, or a bad year (I started blogging in high school, which means all sorts of “angry at the world” stuff.

What bothers me is that I have a problem with that. Shouldn’t I be able to stand behind everything I say, or everything I’ve ever said? I think I should, and yet I still post under a (normally transparent) pseudonym. I know that I want to be proud of everything I say, but it seems like things get blown way out of proportion online, compared to in person. If we met in person and I said “I’m just so pissed off, I’m never eating pickles again” (or something more serious), you could tell that I was momentarily pissed off, and that I probably would eat pickles again. Online, words have staying power, and no matter what you were thinking when you wrote them (“I hate you, I hope you die”), they can get dredged up by someone else and used against you.

This is possible to do in real life as well, but then when I say “I wasn’t serious, I was having a bad day,” how can you believe me, and how can I believe you when you say “I understand, we all have bad days sometimes”?

I’ve said some pretty stupid things in my life, online and off, and I’m trying to stop doing that (things like insulting people because they disagree with me). I’ve found that it’s immensely helpful to post under my real name, because it prevents me from going off half-cocked.

[Later]
Another question is whether or not I want to have an online presence at all. For someone as opinionated and communicative (sometimes) as I am, that’s a simple question to answer, but things are much more difficult online than they are in person, because you’re interacting with a much larger number of people.

I also forgot to mention that it seems weird to me that people use “throwaway” identities rather than a standard alter ego. If I did that, I’d forget what I wrote if I went back and read something again. Maybe that’s another issue: I go back and read things again, while others seem to do drive-by postings, where they drop their opinion, run, and never look back to see if anyone had something to say in reply. Why post if you don’t want to hear what the other person has to say?

How to edit a layer if you’ve never edited a layer before in QGIS

Remember, you have to set the snap tolerance of each layer individually for each layer you want to edit. To do this in 0.11.0 Metis, select Settings -> Project Properties and click “Snapping options…” under the “General” tab. Make sure the checkbox next to the layer you want to edit is selected. I have not needed to change the tolerance from “0” yet. This is set in map units (see Project Properties, General tab).

Really, this is an annoying step, and something that probably frustrates noobs like me (who jump in without reading the whole guide) a whole lot.

Source: QGIS User Guide for 0.9.1 Ganymede, Chapter 4.4 Editing (about page 47 of the PDF). This PDF should have come with your install.

QGIS Community

Fun extras with the OS X terminal

I’m writing some more R scripts today to make up for the discrepancy between different people’s interpretation of the concept of disparity and variance, and I felt the need to add a signal that the script was done running. I’ve used play() in the past, but it seems silly to use an extra library when I have other methods…

system("say All done!");

I was also playing with the system volume, but decided not to do too much, since I’m usually listening to music, and blowing my ears out is not my preferred method of learning that my function has completed running.

Change the system volume from the command line – OS X Daily Check out Kevin’s comment for some more tricky things.

Of course, you can always just play a sound without the play() function–just use Terminal! http://forums.macosxhints.com/showthread.php?t=33962

Tricking a new computer into working (maybe)

UPDATE: Oh never mind, I’m just using a different hard drive now.

I have a recently acquired Gateway Pentium 4 that I am trying to upgrade to from the HP PIII I’ve been using for my programs that just have to run on a PC.

Problem 1: The Gateway wouldn’t boot from the CD-ROM drive so I could use the Windows XP installer to format the drive.

Solution 1: I attached this drive as a slave to my HP and formatted it there.

Problem 2: The drive wouldn’t format correctly.

Solution 2: Somehow, I just had to get the right combination of things in the Disk Utility (whatever it’s called) in Windows. Delete the current partition, create a new partition, leave the defaults, and do a quick format. Took me a while to figure this out, otherwise it would tell me that the disk would not format correctly.

Problem 3: The Gateway gets stuck at the Gateway splash screen and won’t let me into BIOS to set the boot device.

Solution 3: Unplug all the drives, or even unplug just the floppies and the hard drive, and I can get into BIOS just fine to set the boot device.

Problem 4: I still can’t get into BIOS when the HD is attached. I can, however, boot from the CD-ROM drive and start the Windows installation (up until it looks for a HD).

Solution 4: Here’s the fun part: I unplugged the HD cable and booted from the CD. Then, before it asked if I would like to install Windows, I plugged the HD in. Don’t try this at home, kids! Setup then located the drive, and by the time it got to asking if I would like to install, it found the drive and away it went!

Problem 5: Rebooting during install, not so good. I got a long low beep that wouldn’t stop.

Solution 5: I hit the power button and manually restarted.

Problem 6: Intel boot somethingy found a problem, so I had to boot from the CD again. Uh oh…

Solution 6: Trying recovery at the moment, more news later.

Later:
Installed again, didn’t give me a long beep at restart, but I got the same Intel Boot Agent media failure. Changed the boot order around in BIOS. Now it goes to a cursor (that I can’t do anything with) after the Gateway flash screen.

Things I wish I had time to write more about

Good news.

Related news, from one of the owners of Small Dog Electronics:

Start Soapbox

*****

Fossil Fuel Free by 2018?
By Don, don@smalldog.com

I read with great interest about the challenge that former VP and current Apple board member Al Gore tossed out yesterday. He challenged the USA to completely shift its entire electricity production to renewable energy sources and eliminate the dependence upon oil and coal. Challenging the auto industry to have all electric cars in 10 years and power those vehicles with electricity powered by hydro, wind, solar and geothermal energy is not only a very ambitious plan, but it is an achievable plan that will provide immense benefits to our country. Oilman T. Boone Pickens (don’t you love that name!) also proposed a far-reaching plan to build massive wind energy capacity and has launched a big advertising campaign.

I have some experience in the wind industry as I started a wind energy company in the seventies and did a comprehensive study of the wind industry in the USA in the ’30s and ’40s while I was at Goddard College. Probably a bit ahead of the times, I worked in that industry for fifteen years and know first-hand that the potential for electrical generation by wind energy is simply HUGE. There is no technological barrier to Al Gore’s plan, the technology to harness renewable energy exists now, the technology to produce electric cars exists now and it really does only take a massive commitment on the part of the people to get it done.

The benefits are significant. We are now importing 70% of the oil we utilize and the world’s oil supplies are rapidly diminishing, prices are escalating (and they are not EVER going to come down) and the competition for this scarce resource is and will continue to be the source of conflict around the world. The escalating price of fossil fuels is hurting our economy, it is making it more expensive to commute to work, it is making home heating this winter an emergency situation and is causing the loss of jobs. Contrast that with the massive effort to completely convert to renewable energy. We would be creating thousands of new jobs, new industries and would be buying energy security for our country. Not only that, but we will be significantly reducing the carbon being emitted into the atmosphere. No longer will the USA be the barrier in the battle against global warming, but instead, we will be the leader.

I was pleased that both presidential candidates supported this goal. Now we have to get into the details of how this can be done. This must be a much higher priority than an erroneous war in Iraq that is consuming our resources, both human and financial! The country currently relies on coal for about half of its electric power (49 percent), followed by natural gas (22 percent), nuclear (19 percent) and hydropower (6 percent), according to the U.S. Energy Information Administration. Renewable power accounts for 2.5 percent, although it’s growing rapidly in many states, especially California.

This is really the answer to $4 gasoline today and $10 gasoline tomorrow. We need to shift the prevailing paradigm and realize that with a united effort and an intelligent goal we can once again claim true independence. Al Gore’s plan is more than a remedy for global warming and diminishing fossil fuels, it is a blueprint for a massive economic development program for our country.

*****

End Soapbox

Something I agree with wholeheartedly.

Something depressing.

Something expensive, but worthwhile (especially since we supposedly can’t spend any money on domestic issues until we get a new president, according to my AAAS updates).

 

 

Alliance p2p notes

I’m working my way through this program. I think it works really well, these are just my notes. I haven’t gotten around to posting these in the official forum or bug tracker yet.

Invite Codes
*The only thing the LAN checkbox affects is new invite codes. It does not change how your computer accesses anything else.

*Leaving LAN unchecked uses the web-accessible IP address of the computer. Checking LAN uses the local address (192.168.XXX.XXX).

*You can create two invite codes for each computer: a LAN code and a web code. Sometimes one will work where the other one will not, depending on the relationship between the two computers.

Moving Around
*Switching one computer from one network to another (e.g., from a wireless access point to a wall jack) sometimes results in loss of connection between the machines that cannot be repaired without a)changing the hostname of the buddy to either a local or web-accessible IP or b)deleting a buddy and re-adding them with their invite code.

*It may be the case that Reconnect has to be pressed by users on both ends of a connection after one person has switched networks in order for the change in IP address to register and the connection to be reestablished.

Miscellaneous
*It is unclear what “Reconnect” actually does.

*It is unclear how long it should take for certain things to happen. Sometimes it takes a couple minutes for everything to get situated after starting Alliance or switching networks. It also lags a couple minutes when someone leaves the network before removing them from the active users list.

*Should you be able to add friends of friends with whom you cannot connect? There is no dialogue or notification when they are unavailable after clicking “Finish.” I know that not everyone’s friends of friends will be online all the time, but if they are, and are not accessible from the current location, that should be reflected somewhere for the user.

*What port is being used to send invite codes? Is it possible that the router is getting mixed up and using the wrong port? Is this encoded into the invite code?

*When downloading, then disconnecting, then attempting to download from a different buddy, download will not begin. After removing everything in the download queue, restart is still required before downloading will commence. This may be related to switching networks too.

*Is there a limit on number of files that can be shown per directory? Alliance will not display a folder with 4840 files (kicks the connection for a few minutes), but when searching will display files in that folder that match the search criteria. This may also be related to funky characters in a filename within the folder–since those files weren’t part of the search results, the folder displayed just fine. It was the number of files–keep it under about 1,000.

*Sometimes the checkbox to browse a folder just disappears. Why is this? Because the shared directory name has been changed and the folder doesn’t exist anymore.

*When you have two laptops on the same wireless network and very few people using Alliance in general, it acts like there needs to be a critical mass in order for sharing to really occur. Such as, A and B are in the same room, on the same network, and can see each other. B can see a third computer C, on a different part of the network (outside the wireless access point), but A cannot. In this case, Friends of Friends seems to work, but user C never shows up for A.

Passing and using variables in SMARTY tags (among other things)

I’m posting this because I could find NO answers to this question anywhere.

I wanted to pass a Smarty variable (for example {$hello}) through to the PHP side in Serendipity, get an extended property from the Serendipity database, run a query on the SMF database based on that property, and echo the output.

Comments are ***, which should be removed when copying and pasting.

In entries.tpl:

***Checks if the entry is one its own page or not.
{if !$is_single_entry}

***Assigns a new variable from a Smarty variable  {$entry.id}.  Note the backticks (``) around the variable name.
   {assign var='entryid' value=`$entry.id`}

***Capture the output of the Smarty function, within which is passed the variable $entryid
   {capture name=plural}
        {numbersmfcomments entryid="$entryid"}
   {/capture}

***Outputs some HTML with the Smarty function.  Distinguishes "Comment" or "Comments" based on the capture output.
   {numbersmfcomments entryid="$entryid"}
   {if $smarty.capture.plural == 1}
        Comment
   {else}
 Comments
   {/if}
   --Add yours!
{/if}

 

In config.inc.php:

 

 

***Makes a new Smarty function
$serendipity['smarty']->register_function('numbersmfcomments', 'numbersmfcomments');
function numbersmfcomments($params, &$smarty)  {

***Gets access to the SMF database and Serendipity globals.
require_once('/home/pmp6nl/public_html/talk/SSI.php');
global $serendipity;

***Gets entry id out of passed variable in Smarty function.
$id=$params['entryid'];

***Gets extended info about entries, which is where the SMF topic ID is stored.
$props = serendipity_fetchEntryProperties($id);
$SMFTopic =  $props['ep_SMFTopic'];

***Run a query to count the number of messages in that SMF topic.
$result = mysql_query("SELECT * FROM pmp6nl_talk.smf_messages WHERE ID_TOPIC = '$SMFTopic'");
$numbercomments = mysql_num_rows($result);

***Output that number, minus the original message.
echo $numbercomments-1;
}

I hope this may be helpful to someone in the future.

References:
http://www.s9y.org/78.html#A4
http://www.smarty.net/manual/en/language.custom.functions.php#language.function.assign
http://www.programmingtalk.com/showthread.php?t=11586
http://www.smarty.net/manual/en/language.builtin.functions.php#language.function.capture