<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Pigsflew.com &#187; Personal</title>
	<atom:link href="http://pigsflew.com/archives/category/personal/feed" rel="self" type="application/rss+xml" />
	<link>http://pigsflew.com</link>
	<description>Realization of a Dream</description>
	<lastBuildDate>Mon, 19 Dec 2011 13:51:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Settled! Somewhat&#8230;</title>
		<link>http://pigsflew.com/archives/623</link>
		<comments>http://pigsflew.com/archives/623#comments</comments>
		<pubDate>Sat, 26 Mar 2011 05:12:39 +0000</pubDate>
		<dc:creator>Pigsflew</dc:creator>
				<category><![CDATA[Geekdom]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[webOS]]></category>

		<guid isPermaLink="false">http://pigsflew.com/?p=623</guid>
		<description><![CDATA[Hello all! Things are finally settling down from the move, and while my work has of late been pretty crazy, I wanted to take a minute to post, so that I don't end up falling off the writing horse again.
My webOS adventures are moving along--I got my hands on an unlocked Pre 2, which is [...]]]></description>
			<content:encoded><![CDATA[<p>Hello all! Things are finally settling down from the move, and while my work has of late been pretty crazy, I wanted to take a minute to post, so that I don't end up falling off the writing horse again.</p>
<p>My webOS adventures are moving along--I got my hands on an unlocked Pre 2, which is a terriffic phone, to test some of my stuff on. I found that my favorite app idea, a WordPress App, has already been done fantastically well in <a href="http://developer.palm.com/appredirect/?packageid=net.nizzoli.poster&amp;ved=0CA8QFjAA&amp;usg=AFQjCNH2gvH5vTIhn5OKZM2M7fKzGdxcxg">Poster</a>, and with a bunch of features I hadn't planned on putting in mine, so I'm going to keep plugging away at my other ideas.</p>
<p>As I mentioned, my work life has been pretty nuts lately — I had done 58 hours this week before I stepped into the building this morning — so I've stepped out of my d&amp;d group for the time being. It's sad, my character in this particular game is a totally awesome assassin-mage, who, while I originally intended for him to be a quiet, stealthy poisoner, has turned into a rambunctious swashbuckling lover of all that is flashy. The other group members are a lot of fun to play with, too- the youngest is actually only 11, but she's the strongest fighter in the group and was the only person to get my UMass CS binary tree shirt. Yeah. She's about as cool as it gets. I could go on about the other players, and our DM, but let's just instead say I'm really going to miss playing until things cool off at work.</p>
<p>Anyway, I left off work at a reasonable time today and saw Sucker Punch. I thought it was good, but Mikah didn't. So we made another mistake. We rented The Last Airbender.</p>
<p>Now understand, I expected it to be bad; I expected it to break from the show in pretty dumb ways. But I never would have expected a movie featuring marial arts and <i>elemental magic</i>&nbsp;could ever be so exquisitely boring.</p>
<p>Apparently Shyamalan can't event make a magical <i>war</i>&nbsp;interesting. It could have been just about any other director and this movie wouldn't have been a freaking lullabye.</p>
<p>This is enough, I think, for now. Until next time, then!</p>
]]></content:encoded>
			<wfw:commentRss>http://pigsflew.com/archives/623/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New apartment!</title>
		<link>http://pigsflew.com/archives/603</link>
		<comments>http://pigsflew.com/archives/603#comments</comments>
		<pubDate>Mon, 07 Mar 2011 04:53:09 +0000</pubDate>
		<dc:creator>Pigsflew</dc:creator>
				<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://pigsflew.com/?p=603</guid>
		<description><![CDATA[Oh god moving all weekend. I will update tomorrow. Perhaps with pictures of the new place!
]]></description>
			<content:encoded><![CDATA[<p>Oh god moving all weekend. I will update tomorrow. Perhaps with pictures of the new place!</p>
]]></content:encoded>
			<wfw:commentRss>http://pigsflew.com/archives/603/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Little Trip</title>
		<link>http://pigsflew.com/archives/599</link>
		<comments>http://pigsflew.com/archives/599#comments</comments>
		<pubDate>Mon, 21 Feb 2011 15:56:20 +0000</pubDate>
		<dc:creator>Pigsflew</dc:creator>
				<category><![CDATA[Geekdom]]></category>
		<category><![CDATA[Music]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[War on Sloth]]></category>
		<category><![CDATA[webOS]]></category>

		<guid isPermaLink="false">http://pigsflew.com/?p=599</guid>
		<description><![CDATA[This week in the War on Sloth:
So I didn't do as much productive hobbies this week, though I did learn the chords to the main theme from Legend of the Seeker (the show somewhat loosely based on the Sword of Truth novels by Terry Goodkind) on the guitar, and later on piano.
Really, I spent my [...]]]></description>
			<content:encoded><![CDATA[<p>This week in the War on Sloth:</p>
<p>So I didn't do as much productive hobbies this week, though I did learn the chords to the main theme from <em>Legend of the Seeker</em> (the show somewhat loosely based on the <em>Sword of Truth</em> novels by Terry Goodkind) on the guitar, and later on piano.</p>
<p>Really, I spent my time here:<br />
<a href="http://www.flickr.com/photos/kcdstm/101627163/" title="Harper's Ferry WV by kcdsTM, on Flickr"><img src="http://farm1.static.flickr.com/38/101627163_b1e32fccca.jpg" width="500" height="375" alt="Harper's Ferry WV" /></a></p>
<p>This year, since leaving taking a 10 day vacation out of the country isn't an option given the craziness going on at work, Mikah and I decided to take a jaunt out to West Virginia to celebrate Valentine's day with a weekend at a nice B&#038;B. Mikah found us the <a href="http://maps.google.com/maps/place?cid=15093005554117100137&#038;q=Hillbrook+Inn,+WV&#038;gl=us&#038;view=feature&#038;mcsrc=photo&#038;num=20&#038;start=0&#038;ie=UTF8&#038;ll=39.253898,-77.931271&#038;spn=0,0&#038;t=h&#038;z=14">Hillbrook Inn</a> in Charles Town, a place which is exactly as it looks in the photos--remote, secluded, gorgeous. We spent most of Saturday wandering around Harper's Ferry, even exploring a Flea Market.</p>
<p>We were there only two nights, and I wish we could have been there longer, but I feel greatly refreshed, and am glad to have had the time to reset myself.</p>
<p>I did briefly stop at Micro Center and took a look at books for getting myself into a new development skill. I've been talking and talking about several things, including 3d game development, and mobile app development, specifically for webOS. Game development is very different from my actual development path, and it would almost certainly take a long time to learn to use the tools of that particular trade; therefore I decided a few weeks back to work on making an app for webOS. Now I'm running into some rough patches with that, because, while I can easily get through the various tutorials I've found and get some pretty pictures displaying on the screen, I don't actually know certain best practices for code organization and, well, mainly, how to fetch new information from an outside server.</p>
<p>This is certainly something that, with a little more time and patience, I could learn from the documentation and from reading through more examples, but to assist me on the path, I was thinking of buying a book on webOS development. Unfortunately, Micro Center only had one which had very low ratings online, so I left it. I'll just have to keep looking, and reading.</p>
]]></content:encoded>
			<wfw:commentRss>http://pigsflew.com/archives/599/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The War on Sloth Begins</title>
		<link>http://pigsflew.com/archives/587</link>
		<comments>http://pigsflew.com/archives/587#comments</comments>
		<pubDate>Sat, 12 Feb 2011 06:50:24 +0000</pubDate>
		<dc:creator>Pigsflew</dc:creator>
				<category><![CDATA[Artwork]]></category>
		<category><![CDATA[Geekdom]]></category>
		<category><![CDATA[Music]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Phlox]]></category>
		<category><![CDATA[War on Sloth]]></category>
		<category><![CDATA[webOS]]></category>

		<guid isPermaLink="false">http://pigsflew.com/?p=587</guid>
		<description><![CDATA[I think I had a pretty successful first week in the War on Sloth--despite having a particularly rough week at work (60 hours!) I managed to get in some music, a bit of drawing, and a personal coding project that I think is rather nifty. As I said, I'm going to be scatter-shot for a [...]]]></description>
			<content:encoded><![CDATA[<p>I think I had a pretty successful first week in the War on Sloth--despite having a particularly rough week at work (60 hours!) I managed to get in some music, a bit of drawing, and a personal coding project that I think is rather nifty. As I said, I'm going to be scatter-shot for a while as I figure it all out. If things at work calm down, maybe I'll keep it diverse and start doing a post per pursuit, but for now each one is relatively small.</p>
<p>For music, I sat down at the piano long enough to learn the introduction to Ben Folds' "Still Fighting It". It will take a bit more time to commit the whole song to memory, but the song is fairly simple, short, and calm--which is a good recipe for a song I can pick up fast and feel good about playing for others. Didn't spend any appreciable time on the guitar, but this is a good start.</p>
<p>I also spent a bit of time playing with Inkscape and drew a new pig. Here's the old one for comparison:<br />
<div id="attachment_589" class="wp-caption alignnone" style="width: 410px"><a href="http://pigsflew.com/wp-content/uploads/2011/02/Pigsflew-400.jpg"><img src="http://pigsflew.com/wp-content/uploads/2011/02/Pigsflew-400.jpg" alt="The Old Pig" title="The Old Pig" width="400" height="400" class="size-medium wp-image-589" /></a><p class="wp-caption-text">Phlox, the Phlying Pig</p></div></p>
<p>And here's the new one:<br />
<div id="attachment_588" class="wp-caption alignnone" style="width: 410px"><a href="http://pigsflew.com/wp-content/uploads/2011/02/newpig400.png"><img src="http://pigsflew.com/wp-content/uploads/2011/02/newpig400.png" alt="The New Pig" title="The New Pig" width="400" height="400" class="size-medium wp-image-588" /></a><p class="wp-caption-text">Phlox, the Phlying Pig</p></div></p>
<p>I still like the old one better (it's just a better drawing to start), but I like the new one's open eyes and more comic-like lines. I need a sharper version of Phlox for an icon anyway, for upcoming projects.</p>
<p>This is the biggest thing I've started: I'm making a Palm webOS app. There's a few of them that I have in mind, so my plan is to start with a very simple app and work my way up to more awesome ones after I get the gist of how webOS development really works. So I pulled down the Palm SDK and started tinkering. So far, I've got very little that I want to show off, but I've learned a lot! So we'll see what I can come up with for next week.</p>
<p>Until then, what's your free time like?<br />
Adrian</p>
]]></content:encoded>
			<wfw:commentRss>http://pigsflew.com/archives/587/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Back to the Blog</title>
		<link>http://pigsflew.com/archives/582</link>
		<comments>http://pigsflew.com/archives/582#comments</comments>
		<pubDate>Sat, 05 Feb 2011 04:01:53 +0000</pubDate>
		<dc:creator>Pigsflew</dc:creator>
				<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://pigsflew.com/?p=582</guid>
		<description><![CDATA[Well, hello!
It has been a long time. Nearly half a year, if I recall correctly. Allow me to reacquaint myself: I'm Adrian Sud; on the internet, I also go by Pigsflew. In the past I've described myself as a writer, a hobby guitarist, a gadget tinkerer, a software developer, and a general intellectual&#8212;if not all [...]]]></description>
			<content:encoded><![CDATA[<p>Well, hello!</p>
<p>It has been a long time. Nearly half a year, if I recall correctly. Allow me to reacquaint myself: I'm Adrian Sud; on the internet, I also go by Pigsflew. In the past I've described myself as a writer, a hobby guitarist, a gadget tinkerer, a software developer, and a general intellectual&mdash;if not all that geeky about any one particular thing. Lately, I can really only count myself in one of those categories: a software developer, I remain.</p>
<p>I'm a developer by trade; as with many in my field, I'm prone to long work hours, caffeine addiction, and forgetting even to put socks on in the morning, let alone take the time to practice on my guitar or put a pen to paper. But recently, I read an article which is stuck in my head: <a href="http://trentwalton.com/2011/01/26/you-are-what-you-eat/">"You Are What You Eat"</a> by Trent Walton. The concept is that, whatever you want to be, just start doing it. The rest will follow.</p>
<p>The simple fact is, I love being a developer, but what brought me to the field is the tinkering, the new technologies, the amazing sense that no matter how long you're at it, there is so much more to learn&mdash;but to take advantage of that, I have to learn on my own time, too. Beyond tech, I've always thought of myself as a versatile person, with about as much potential in creative endeavors as logical ones. If I don't exercise other parts of my head, switch to another mode and put some energy into it, I will&mdash;and do&mdash; find that potential greatly diminished.</p>
<p>So to that end, I'm coming back to my hobbies. I'm going to devote a bit of time to this blog and LiveJournal, hopefully about one hour a week, to talk about what I'm doing in my free time, and to make sure that whatever it is, I am doing *something*.</p>
<p>For a while, it'll be fairly directionless. I've got about five ideas for things I want to do in my head. All of them will be difficult, but at least two of them I think I could really do well, if I give it a shot. So look for a post in a couple of days, talking about what I've started.</p>
<p>Now, will it be technical or creative? Who knows. Perhaps both!</p>
]]></content:encoded>
			<wfw:commentRss>http://pigsflew.com/archives/582/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to fix Email</title>
		<link>http://pigsflew.com/archives/553</link>
		<comments>http://pigsflew.com/archives/553#comments</comments>
		<pubDate>Sun, 04 Jul 2010 23:59:27 +0000</pubDate>
		<dc:creator>Pigsflew</dc:creator>
				<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://pigsflew.com/?p=553</guid>
		<description><![CDATA[Recently some work I've been doing required me to send a little personal information along to a client. The personal information was of a delicate nature, and when I found out I was expected to send it by email, I was confounded, and finally convinced them to let me send it to them via courier [...]]]></description>
			<content:encoded><![CDATA[<p>Recently some work I've been doing required me to send a little personal information along to a client. The personal information was of a delicate nature, and when I found out I was expected to send it by email, I was confounded, and finally convinced them to let me send it to them via courier instead.</p>
<p>People seem to assume that Email is like regular mail only faster, and since it's a federal crime to tamper with postal mail, email communications must be covered the same way, and that the two are equivalently private. The problem is that a government employee (or several) are the ones that physically carry your snail mail from where you dropped it off to its final destination. Therefore the government has some ability to enforce that sanctity of mail--the postal workers are traceable sources of tampering, who can be fired or even legally punished for any evil they do. From there, the only thing you have to worry about is delivery mishap, and non-USPS hands at those weak points, before and after transit, where it might fall into them. These are relatively uncommon, and again, the fact that tampering with mail is a federal crime protects you in almost all cases.</p>
<p>But E-mail isn't carried by someone who has a stake in your privacy. The E-mail, as soon as it leaves your computer, is going to pass through dozens of other computers, some controlled by Comcast or Verizon, some controlled by Sprint or Level 3 Communications, some controlled by other companies you might not even have heard of. The fact is that these companies can easily monitor plaintext emails passing through. Even if you trust these companies, it is always a possibility that one of the servers happens to be compromised from without.</p>
<p>This is where a basic lesson comes in: don't send personal information by email. It is trivially easy to scan for certain things like phone numbers, Social Security numbers, credit card numbers, drivers license numbers, license plate numbers, just about anything else you might not want people to know. If you're sending these things to anyone via an unencrypted digital channel like email, it is very possible that it could be intercepted, identified, and later used for nefarious purposes.</p>
<p>Notice where I said "an unencrypted digital channel like email". That's the key thing. You see, it's safe (or at least much more safe) to enter things like that on an encrypted website, such as https://www.bankofamerica.com--because you trust Bank of America, and because the site has that handy "https" instead of "http", you know that there will be no computer between you and the Bank itself that ever sees your information in cleartext. Instead it sees something encrypted in such a way that it is virtually unbreakable--so that only you and the Bank see anything you type into that website.</p>
<p>So how do we fix it?</p>
<p>Effectively, there are two things you want to know about a message: #1, that it's from who it says its from. #2, that it remained unread until it got to you. This is why I propose that SMTP and IMAP mail servers all include a PKI server.</p>
<p>Here's how it works.</p>
<p>Example Smith (esmith@local.com) wants to send a message to Instance Jones (ijones@foreign.com). Example types up an email and sends it to his mailserver over an https connection, because he knows that he has to be careful about these things.</p>
<p>On a current smtp server, what happens now is that the mail is decrypted at smtp.local.com, and sent to the Instance's mailserver (mail.foreign.com) in plaintext, where Instance is free to access it through her client however or whenever she chooses.</p>
<p>Here's what should happen.</p>
<p>Example Smith sends the message via an encrypted connection to smtp.local.com.</p>
<p>smtp.local.com sends a message to mail.foreign.com asking for the public key of ijones@foreign.com. smtp.local.com then encrypts its message with Instance's public key, and signs it with its own private key for esmith@local.com.</p>
<p>When it gets to the other end, mail.foreign.com is able to decrypt the message using Instance's private key.</p>
<p>When Instance downloads the message (over https of course!) from her mailserver, she can now feel safe that Example's message was kept free from prying eyes during transmission. Her mail server can also decrypt the signature and read it using Example's public key by fetching it using the email in the "from:" email address. If mail.local.com sends back a key that successfully decrypts the signature, then she knows that Example's mail server certifies that the message was sent from Example's email account, through Example's outgoing SMTP server.</p>
<p>This would mean that nobody could send messages on some fake mailserver with the From: address of "someone@pigsflew.com"--because your email reader would be able to contact pigsflew.com on its mail port, find out that it signs its messages, and that it cannot verify that particular email's signature (if it even has one). And it means that the message is almost guaranteed to be safe from prying eyes, at least until it has been received by the receiving mailserver. And it has the added plus of being effectively transparent to the end users--they still send and receive messages on the web or through their email clients in exactly the same way.</p>
<p>Basically, if this feature was implemented, it would take only until Gmail, MSN, and Yahoo started using it, and then a good chunk of email would be safer, and the rest could be flagged as being unverifiable, unprotected, or both. If you had an email client supporting the extensions, you could set your send messages to require or prefer protection, in the preferential case having your SMTP server warn the client that the email will be unencrypted for transit if the recieving mail server doesn't support it. Assuming that you trust your mailserver administrator, the server administrator for the person you're sending the message to, the company that runs their e-mail, and the receiver him- or herself to treat your information with care, you could now effectively rest easy, although Social Security numbers and the like would still give me pause.</p>
<p>The major advantage is that you'd be able to make a more informed decision about whether you trust the information to this medium--since no hands should be able to touch the information.</p>
<p>It'd also be cool if your entire mailbox on your mailserver was encrypted with the user public key and the user's password, decrypted at user access time with their password and that user's private key. Then it'd be safe sitting at endpoints too.</p>
]]></content:encoded>
			<wfw:commentRss>http://pigsflew.com/archives/553/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Telemarketers</title>
		<link>http://pigsflew.com/archives/531</link>
		<comments>http://pigsflew.com/archives/531#comments</comments>
		<pubDate>Fri, 16 Jan 2009 22:25:28 +0000</pubDate>
		<dc:creator>Pigsflew</dc:creator>
				<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://pigsflew.com/?p=531</guid>
		<description><![CDATA[A lady just called me on my work phone asking if I was an engineer or an IT person. "I'm an engineer," I said, thinking perhaps it was someone else in Newton looking to contact IT. She then asked if I could give her the number of one of the heads of IT.
I said, "I [...]]]></description>
			<content:encoded><![CDATA[<p>A lady just called me on my work phone asking if I was an engineer or an IT person. "I'm an engineer," I said, thinking perhaps it was someone else in Newton looking to contact IT. She then asked if I could give her the number of one of the heads of IT.</p>
<p>I said, "I really can't give out that information, but you can send a message to their email address--they're extremely quick at getting back to people." I gave her the aforementioned address.</p>
<p>She responded callously: "Well, I spoke to"--and proceeded to name mispronunciations of several of my more senior coworkers--" and Raja, who I actually met in person recently"--here she probably meant a coworker of mine named Raju--" so my contacts are all in engineering, but can you cut me a break here and direct me to someone in IT?"</p>
<p>When I again declined to give her any specific information of my coworkers, she asked, "Your office is--the Boston office, you're in, what, Needham, right?"</p>
<p>And here I had the overwhelming temptation to say something I did not say, but am convinced would have been the right thing:</p>
<p>"Ma'am, I'm sorry, I have to stop you right there. You're not very good at this--I know, I know, cold calling is hard--but it sounds like you just incorrectly read off everyone listed on my LinkedIn profile. You should take a little time to try to pronounce names--like Raju. That's an Indian name, and means something completely different from the word 'Raja', which means 'King', and was incedentally the name of the tiger from Disney's Alladin. You should also sound confident in more details, like the name of my company, the location of my office, et cetera. I'm not going to ask you who you're calling for; I can't do anything for you anyway, but you should convince yourself before you call that my company needs what you're selling. Give it another try with someone else on LinkedIn, I'm sure you'll do great. Have a nice day, ma'am."</p>
<p>Instead I was more direct, and simply told her I couldn't give out any information further than the address I'd already given her.</p>
<p>One day I am going to be an old man who shouts inanities at telemarketers.</p>
<p>I look forward to that day with great relish.</p>
]]></content:encoded>
			<wfw:commentRss>http://pigsflew.com/archives/531/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Ruby URL Get/Set Field methods</title>
		<link>http://pigsflew.com/archives/526</link>
		<comments>http://pigsflew.com/archives/526#comments</comments>
		<pubDate>Thu, 15 Jan 2009 18:53:46 +0000</pubDate>
		<dc:creator>Pigsflew</dc:creator>
				<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://pigsflew.com/?p=526</guid>
		<description><![CDATA[I was writing a quick script and needed to modify a url quickly to change the fields on a url.
def url_get_field ( url, field )
  m=/.*[&#038;?]#{field}=(.+?)(&#038;.*)/.match(url)
  n=/.*[&#038;?]#{field}=(.+)/.match(url)
  if !m.nil?
    return m[1]
  elsif !n.nil?
    return n[1]
  else
    return ""
  end
end

def url_set_field [...]]]></description>
			<content:encoded><![CDATA[<p>I was writing a quick script and needed to modify a url quickly to change the fields on a url.</p>
<pre><code>def url_get_field ( url, field )
  m=/.*[&#038;?]#{field}=(.+?)(&#038;.*)/.match(url)
  n=/.*[&#038;?]#{field}=(.+)/.match(url)
  if !m.nil?
    return m[1]
  elsif !n.nil?
    return n[1]
  else
    return ""
  end
end

def url_set_field ( url, field, value )
  m=/(.*[&#038;?]#{field}=)(.+?)(&#038;.*)/.match(url)
  n=/(.*[&#038;?]#{field}=)(.+)/.match(url)
  if !m.nil?
    url = m[1] + value + m[3]
  elsif !n.nil?
    url = n[1] + value
  else
    unless /.+[?&#038;].+?=.+/.match(url).nil?
      url = url + '&#038;'
    else
      url = url + '?'
    end
    url = url + field + "=" + value
  end
  url
end

def url_remove_field ( url, field )
  m=/(.*)([&#038;?])(#{field}=(.+?))(&#038;(.*))/.match(url)
  n=/(.*)([&#038;?])(#{field}=(.+))/.match(url)
  unless m.nil?
    url = m[1] + m[2] + m[6]
  else
    url = n[1] unless n.nil?
  end
  url
end</code></pre>
<p>Now it's easy enough to do! check this out:</p>
<pre><code>irb(main):160:0&gt; url = 'http://pigsflew.com'
=&gt; "http://pigsflew.com"
irb(main):161:0&gt; url = url_set_field( url, 'test', 'omg' )
=&gt; "http://pigsflew.com?test=omg"
irb(main):162:0&gt; url = url_set_field( url, 'archives', '526')
=&gt; "http://pigsflew.com?test=omg&#038;archives=526"
irb(main):163:0&gt; url_get_field( url, 'test' )
=&gt; "omg"
irb(main):164:0&gt; url_remove_field( url, 'test' )
=&gt; "http://pigsflew.com?archives=526"
irb(main):165:0&gt;</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://pigsflew.com/archives/526/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Life We Lead: Part Deux</title>
		<link>http://pigsflew.com/archives/495</link>
		<comments>http://pigsflew.com/archives/495#comments</comments>
		<pubDate>Thu, 16 Oct 2008 03:59:22 +0000</pubDate>
		<dc:creator>Pigsflew</dc:creator>
				<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://pigsflew.com/?p=495</guid>
		<description><![CDATA[John FX Gaquin wrote at 2:47pm
I'm posting this from a browser running on a live cd image loaded in a virtual machine running on my desktop that i'm using through RDP from the VM image running on the linux machines at work.
]]></description>
			<content:encoded><![CDATA[<p><strong><a href="http://www.thejfx.net/2007/02/25/the-life-we-lead/">John FX Gaquin</a></strong> wrote at 2:47pm<br />
I'm posting this from a browser running on a live cd image loaded in a virtual machine running on my desktop that i'm using through RDP from the VM image running on the linux machines at work.</p>
]]></content:encoded>
			<wfw:commentRss>http://pigsflew.com/archives/495/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>United States Supremacy in an Empowered World</title>
		<link>http://pigsflew.com/archives/492</link>
		<comments>http://pigsflew.com/archives/492#comments</comments>
		<pubDate>Sun, 28 Sep 2008 20:50:43 +0000</pubDate>
		<dc:creator>Pigsflew</dc:creator>
				<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://pigsflew.com/?p=492</guid>
		<description><![CDATA[In the current presidential campaigns, the energy crisis always receives top billing in debates, interviews, and pundit musings--but few people ask exactly why it is imperative that we handle this now, and nobody talks about why we should handle it without oil at all.
The problem of oil is multifaceted. As of right now, it is [...]]]></description>
			<content:encoded><![CDATA[<p>In the current presidential campaigns, the energy crisis always receives top billing in debates, interviews, and pundit musings--but few people ask exactly why it is imperative that we handle this now, and nobody talks about why we should handle it without oil at all.</p>
<p>The problem of oil is multifaceted. As of right now, it is the most reliable, portable, and easily producible energy source on earth. The issue is that <em>it isn't ours</em>. Sure, we have some oil of our own, and we can increase drilling to use it, but then we're just competitors in a giant game of oil, and make no mistake, we will lose that game.</p>
<p>Going back, the United States has been very lucky. In World War II when supremacy had to be measured by firepower, we were on top because we could produce better firepower faster and in more quantity than anyone else--and our firepower that was just waiting to be used was considerably more than most of the other players in the war could even build. And we produced the Atomic Bomb, which demonstrated our prowess.</p>
<p>In the Cold War, when supremacy was measured by information and scientific prowess, we created satellites that mapped out every square inch of any place we thought might create a problem for us. Our central intelligence agency had files that grew quicker than the KGB could ever know. And we put a man on the moon to show that nobody could beat the scientific pace of this country.</p>
<p>The next moon landing, the next atomic bomb, my friends, is energy independence. We can't do this by using our own oil, because while we can sell weapons and space technology to our friends and use those infrastructures to keep ourselves on top, we can't use oil to that end. What we need is our own power source, one pioneered by and held by the United States. One that not only solves our problems, but we can sell it to our friends, and keep from our enemies, one that produces more income for our country, and reduces the GDP of our enemies who would otherwise compete, and pose a threat to our supremacy.</p>
<p>We need a scientific miracle. And the only way to get scientific miracles is to do what we did with the lunar landing: Contract it out.</p>
<p>What we should do is offer a multi-billion dollar semi-exclusive contract to the first United-States company that develops a decent working alternative to Oil for portable and potent energy generation and storage, and agrees to deploy it in ten major cities across the country. When those cities' demand for oil drops dramatically without significant cost increase to the average citizen, other countries around the world will look covetously at us for our ability to create what we need within our own borders.</p>
<p>What I mean by multi-billion dollar semi-exclusive contract: we are offering a competing company a fixed amount to offset their research and development for such an energy source, plus the energy demands of the United States for a set period of time exclusively to one company. We won't let you gouge us, we'll have to oversee your pricing models once your done, but you'll be allowed to be a five year monopoly on the energy business. The one provision is that you will not be allowed to sell the technology outside of the United States, though you are free to market energy produced by said technology. Any intellectual property you produce will be jointly controlled by your company and the US Military, and should be considered top secret except for your company's production and domestic distribution needs.</p>
<p>We need to stay on top. If we don't do this then in twenty years or so, it might be India or China in the world's center seat, and we will optimistically end up where Russia is now.</p>
<p>Now is where I get political: The policies of Senator McCain and Governor Palin are not terrible policies for the best of times. Work at defenses, decrease the budget, support the industry--fine. However these are not the best of times. Obama and Biden have policies that will cost money. They will in some ways be unpopular, and some things won't even go through the Legislature. But it is imperative that they take the white house, because theirs is the path that (at least) will not take us away from US Supremacy. McCain will focus on the defense system--which was important in World War II, but is no longer meaningful in a world where there are at least 5 countries (the permanent members of the security council) that are known to have the capability of leveling entire countries without incredible difficulty. We are also pretty damned certain that there are others with that capacity too. Let's face it, anyone who attempts to challenge the United States to a fair fight is completely stupid. So they won't fight fair.</p>
<p>They'll buy us. With oil.</p>
]]></content:encoded>
			<wfw:commentRss>http://pigsflew.com/archives/492/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

