12 November 2018

My Very First R Script!

After over a decade of always defaulting to Matlab for all my data processing tasks, I finally work at a place that does everything in R - and I finally have an excuse to learn it. So, behold!

envdist = read.csv("EnvDist-Input.csv")
testdist = subset(envdist, Country == "ISR" | Country == "FJI")

distance <- matrix(data = 0, nrow = nrow(testdist), ncol = nrow(testdist) )
rownames(distance) <- testdist$PortName
colnames(distance) <- testdist$PortName

for (i in 1:nrow(testdist)) {
  for (j in i+1:nrow(testdist)-i) {
    # d(a,b) = sqrt( (a1-b1)^2 + (a2-b2)^2 + (a3-b3)^2 + (a4-b4)^2 )
    distance[i, j] <- sqrt(
    (testdist[i,5] - testdist[j,5])^2 + 
      (testdist[i,6] - testdist[j,6])^2 +
      (testdist[i,7] - testdist[j,7])^2 +
      (testdist[i,8] - testdist[j,8])^2 )
    }
  }
print(distance)

It does some fancy math to four columns of numbers and puts the result into a matrix.

The general point of this exercise is to compare environmental similarities between each and every port in the world, based on temperature and salinity. There are over 6600 ports to compare between, so when I do the real run, the matrix will be very large... but for starters, I just needed to make a functional FOR loop in R.


14 July 2014

A review of my 2014 Prius V

It has been almost exactly one month since I started driving my new Prius V. I've driven to and from work, around town, and gone on a lengthy roadtrip - from Alabama to Indiana and back. So, time to put down some detailed thoughts!

So to start with some background, I have a 40-minute mostly-highway commute to my current job. My previous car was a 1998 Saturn wagon. My main reason for buying a new car was to see if I could cut down on the amount of gas needed to get to and from work. Prius is still topping the charts for miles per gallon, and Toyota has a longstanding reputation for making good cars. Therefore, I wanted a Prius. (I don't buy cars to make political statements and I don't care what people think of other Prius drivers. I am not them.)

But I didn't want the standard liftgate Prius. It's pretty obvious from the outside that there is no way I'll be able to see out the back of that from the inside, which is kind of important for things like left turns and lane changing. Style is great and all, but not if the back window is a slit. :p

Then one day I saw the Prius C. Same super high MPG, but with an actual back window! I test drove it and overall liked it, but the engine felt really wimpy, which was disappointing (though perhaps not actually surprising). It also felt much less like I was in a barrel, which was my impression from sitting in the liftgate Prius. I started making mental plans to buy one anyway despite the engine being less powerful than the Saturn.

Then my next-door neighbor argued in favor of the V. He used to work at a Toyota dealership and in his opinion, the price tag on the C is not worth the amount of car you get, and the V was the best option. I looked it up. Lower on the MPG, but lots of features and more space for when I need to do house moves or buy furniture and etc. Better engine than the C. I got one.

Things I like

It has millions of cupholders. Finally, I own a car where I'll never run out of places to put cups.

Technologically, it's a big step up from the Saturn, which has manual rolldown windows and a cassette deck. (Do they even make cars with manual windows anymore?) It has a big entertainment console with many buttons.

I can open the driver door without having to pull out a key. The manual indicates that this should also be possible for the other doors (I'm particularly interested in doing that for the back), but I haven't figured out how yet.

It can make tighter turns than both the Saturn and the 1988 Plymouth Voyager before it (and for that matter, the 1985 Camaro before that). This was something I definitely looked for in the newest car - after 20 years, I am tired of not being able to do u-turns.

The built-in braking safety features has already helped me avoid a head-on collision. Idiot was trying to pass several cars while he had no actual room to maneuver, and I had to come to nearly a full stop on the highway (from 60).

The moonroof that I paid extra for. I open that in the evenings when it's cooler, because I like being able to see the trees overheard as I'm driving along. I foresee some stargazing in my future (not while driving). A note: the actual roof doesn't open to outside air - it's just the shades that slide back and forth.

The back seats are independently adjustable like the front seats, instead of being basically a bench. It's unlikely I'll personally ever enjoy these, but nice to have for my passengers.

The dashboard is low enough for me to not feel like I'm in a car made for much taller people. (I'm not that tall.) It's a nice change from when I last drove a minivan. Getting in and out in general is very carlike rather than vanlike.

For the front two-thirds of the car, it's a lot bigger on the inside than it looks from the outside.

It has a rear outlet for plugging in electric coolers. That will certainly make long-distance food transport more convenient.

Fuel Efficiency Observations

I probably should've expected it, since the V's MPG is rated lower than the C's, but I am still buying more gas than I was aiming for. In the Saturn during a normal workweek and weekend activities, I would have to get more gas every 5-6 days. In the V, I'm refueling about every 10 days.

Interstate travel doesn't really save any more gas than in a standard car. When driving between Alabama and Indiana, I had to stop for gas the same number of times as I did with the Saturn (which is actually no slouch in the fuel efficiency dept). On the other hand, I did drive faster than I normally did in the Saturn. On the other other hand, based on the graphics on the V's console, fuel efficiency is actually the same at 80 mph as it is at 70 mph, which is never the case in normal cars....

I was hoping that the electric-only would really shine during traffic jams. I mean, on paper, you wouldn't need to use any gas at all as you coast along at low speeds, right? Unfortunately, the battery loses its charge quite fast, and then the engine has to come on to recharge it. You conserve the most energy at a full stop, and you have to coast at a speed of 8 mph or higher for the battery to charge. In all the traffic delays I was in on my roadtrip, we spent a lot of time doing 5, which seems to be the worst for battery drain.

The car is at its most fuel efficient when driving around in a city without going faster than 30 mph. At that speed, it spends most of its time running off the electric motor and hardly at all on the gas engine. I sadly don't live in such a city. Most of the time I'm going at least 40.

The V can compete with pickup trucks when the light turns green. It just isn't very fuel efficient when I do that.

Things I'm not as fond of

The back compartment is actually smaller than the Saturn's, with a higher floor. There's a pull-cover device that can be used to keep people from seeing your stuff, but when it's set up, the bar reduces the depth. The higher floor also means that it's harder to get large bulky items in and out (did I mention I'm not very tall). The Saturn also has a wide flat surface on the way in, which is great for sliding things, that the Prius V doesn't have.

It is still really hard to see out the back. The rear right blind spot is gigantic. It makes lane changes a major problem, and I spend a lot of time wishing that there was more window and less wall in that back corner. And here I thought that rear visibility was a step down when I went from the Voyager to the Saturn, but by comparison, the Saturn is much better than the Prius. Maybe ten years from now when I'm ready to buy the next car, someone will have made a hybrid with fuel efficiency like the Prius, but with real back windows.

The car came with three years of free Entune. I tried to use it during my roadtrip. Unfortunately, it requires Internet access via my phone, and my phone is old with a weak antenna. There is no such thing as signal in the hills of southern Tennessee. I don't spend a lot of time needing Internet features in my car on a daily basis, so likely I'll just let that expire when the time comes.





01 January 2014

What was the best part of 2013?

Someone on Facebook put that question out there as his status, and I couldn't actually think of any one thing that really stood out as "best."

I can think of lots of things that were good, but they mostly weren't individual events.

I can also think of lots of things that were bad, many of them actual events, but nothing that stands out as "worst."

I guess overall my life chugged along nicely. :)

Single most eventful event? Well, I finally decided it was time to quit Battle Pirates, after 2.5 years of devoting nearly my entire life to the community of people that had built up around the game. The game itself had stopped being much fun a long time ago, but it took a while before I was ready to try to leave my people. That was Dec 28. So far I'm still holding strong. I can't call it best or worst yet, because it isn't done happening.

22 December 2013

Why I think I'm better than everyone else

So I just read Why you think you're better than everyone else on io9.com, and decided to put my response to it over here instead.

The last good book I read was a Pratchett Discworld, and I read it because it was easy and entertaining. I don't know what other people read or why. I assume they read things because they like them.

I now think I'm better than everyone else because the point of view described in that article is completely foreign to me. I don't really grok being that judgmental about what strangers do, nor that level of lying to myself.

There is probably only one thing I'm really good at, that I'd call intrinsic. I'm outstanding at evoking epiphanies in other people. Doesn't happen often, but recognizing the moment that someone is at the right crossroads for me to say the right thing (what they need to hear to cross to the other side, even if I don't understand it myself) at the right time, is something that happens to me a lot.

I am also happy once again to not work in the corporate world. A while back I read some articles in a magazine aimed at for-profit middle management type people, and the kind of thinking that goes on with them, with all the convoluted mental games, is something I'm glad to continue to avoid.

05 November 2013

On Thankfulness

I'm not thankful for anything.

There are a lot of good things about my life. I am where I am today for many reasons. Some of them were from actions taken by individual other people, and I am grateful to them for the specific things that they did for me.

But gratitude in general for being alive and well?

The choices I made along my life path, that have led me here, were my own. The luck I've had has been both good and bad. There was not some fundamental sentient force that has caused my good fortune, to which I owe anything. And I resent the implication, in the whole concept of thankfulness, that I should believe that there is.


02 November 2013

Turning over a new leaf in dietary habits

My father died of a sudden heart attack when he was 53. He was not overweight and did not have high blood pressure, so everyone figured he was fine. But when they checked after the fact, they found he had lots of bad cholesterol.

I've just passed 40. I'm not overweight, don't have high blood pressure, and all my blood stats are fine - except for the bad cholesterol. For some reason I have lots of bad cholesterol.

After a quick degree from the University of Google, I've decided I need to somehow add a ton of bird food to my diet.


  1. oats
  2. olive oil or canola oil
  3. nuts and peanuts
  4. beans and lentils
  5. barley
  6. pears, apples, fruits with lots of pectin (soluble fiber)
  7. anything with omega-3 fatty acids (fish, flaxseed)
  8. soy (tofu, edamame)
  9. things fortified with plant sterols/stanols (check the OJ)
  10. okra
  11. tomatoes
  12. avocados


Lots of things that are plant seeds of some sort. The hardest part to add will be the fresh fruit - I just don't normally eat fruit. The hardest thing to subtract? I'm really going to miss cheese.

12 July 2011

Behold, Some Code!

Since my life reboot, my leet code skillz have gone to whole new levels. Here's a representation of the kinds of things I've been doing for the past three months:

s = 1; %blort-cell counter
interpnum = cell(1,6);
for t = {East_u, North_v, Vert_w, VelError, Mag, DIR}
    blort = t{1};
    k = 1; %within blort-cell counter
    for i = 1:length(SerYear)
        badeast = find(isnan(blort(i,:)));
        for j = 1:length(badeast)
            m = badeast(j);
            while isnan(blort(i, m))
                if m > 1
                    m = m - 1;
                else
                    break
                end
            end
            n = badeast(j);
            while isnan(blort(i, n))
                if n < SerBins(end)
                    n = n + 1;
                else
                    break
                end
            end
            interpnum{s}(k, 1) = i;
            interpnum{s}(k, 2) = badeast(j);
            if n - m < 5 && ~isnan(blort(i, m)) && ~isnan(blort(i, n))
                interpnum{s}(k, 3) = interp1([m n], [blort(i, m) blort(i, n)], badeast(j));
            elseif n - m < 5 && isnan(blort(i, m)) && ~isnan(blort(i, n))
                interpnum{s}(k, 3) = blort(i, n);
            elseif n - m < 5 && ~isnan(blort(i, m)) && isnan(blort(i, n))
                interpnum{s}(k, 3) = blort(i, m);
            else
                interpnum{s}(k, 3) = NaN;
            end
            k = k + 1;
        end
        clear badeast j m n
    end
    clear i blort k
    s = s+1;
end
badeast = interpnum{1};
badnorth = interpnum{2};
badvert = interpnum{3};
baderr = interpnum{4};
badmag = interpnum{5};
baddir = interpnum{6};
clear s t interpnum

It looks at a big block of numbers, one row at a time, and interpolates for any missing values - assuming that there are no more than four missing in a row (in the row). It does this for six individual same-sized blocks.

It's in Matlab. There might actually be a simpler way to do this, but if so I don't know about it. (Obviously.) The fun part is: it only took me two days to work all that out. Leet skillz progress! :D

20 May 2011

Things Learned from a Gulf of Mexico Science Conference

One

The preliminary results are in on the Deepwater Horizon oil spill.

There basically wasn't any hugely negative impact to wildlife in the immediate aftermath of last summer's oil spill. Some stuff died because the oil was toxic, but other stuff stepped right up because the oil was food. A lot of stuff that looked like it ought to be affected ... wasn't. The stuff that was knocked down recovered within a few months after they capped it. In short, some short-term changes in ecological composition occurred, but no overall increases or decreases of anything.

Also, commercially important fish had an outstanding year due to the lack of commercial fishing.

This is not to say that the Gulf ate the oil and is just fine now. Although there weren't immediate effects, the oil is still there and will likely have longer-term chronic effects. Some fisheries might not collapse until a couple years later, depending on how long the life cycles work for the seafood involved.

Two

The next time I find myself on the job market, all I really have to do is show up to a science conference and talk to people about what I can do with their CTD data. Voila, jobs will magically appear! Send out resumes? Phhht.

16 May 2011

New Chapters Begin, Old Chapters End

In mid-2008, my friend Robert talked me into signing up at eHow to write articles. He was making some serious pocket money and thought I could too.

Two years, ten months, and 44 articles later, I have $478.57 more than I did before. Some articles made a lot - one of them over $130. Others made diddly squat. In the process, I learned all sorts of things about freelance writing for content sites. Most importantly:

  • A whole lot of people make living-level wages doing it, for example this guy. Over at Demand Studios, the people who qualify to write the $30 medical/health articles, and who can crank out 10 of them per day, 6 days per week, from home while watching their toddlers, and without having to do any of the pitching/rejection of traditional freelancing, those people have it pretty good.
  • I'm never going to be one of them. In the end, I'm just not that fast.

    So, what's next? Who knows. I sure know lots more about SEO than I did before. But not enough about any actual topic to write a good-sized website of my own. My friend Robert keeps trying to talk me into making one about something marine biology related, but I've long since passed into the "I know enough to know I don't know anything" phase about that.

    In the meantime, Bright Hub is reeling but still standing after the Google Panda smackdown, most of my extant articles are now there (including several of the eHow refugees I had to move in the past ten days), so maybe I'll just watch what happens for a while...
  • 14 May 2011

    A Tall Shorebird

    Coastal Alabama has a lot of birds of all kinds. Here's one I saw yesterday morning:



    It's a great blue heron. Very common over most of North America. This one let us get real close. There were four of us out there talking, and it just stood there, so I took a picture. :)

    08 May 2011

    Newest Toy

    When the apartment management first told me about my new apartment, they said it wouldn't have any washer/dryer connections. But after I moved down here, they neglected to tell me that there were washer/dryer connections after all - and they especially didn't mention it was going to cost me an extra $10 per month.

    Right around the same time, someone mentioned how they'd just bought a small portable washer. Just like a regular-sized washer, they said, but smaller! Possibly small enough that even I can move it by myself! (This is a plus because I'm a firm believer in only having furniture and appliances that I can personally move by myself.)

    And so, after some shopping around I bought:



    It's a Haier pulsator portable washer. It turns out that I can lift the thing, but just in case I can't it comes with wheels. It's also a lot more roomy on the inside than it looks because it doesn't have that big column thingy up the middle. It's also cute. Cuteness is key when it comes to wanting to do laundry. :)

    30 April 2011

    Life is Grand Again

    Part of my view into work:



    Yes, I think in terms of workplace, I've definitely traded up. :)

    Also, in the hopes that I really am about to resurrect this blog, a picture of a cat:



    Specifically, it's this cat. I got back in touch with his owner, who sent me a more recent picture. Ten years later he's doing well and looks the same. :)

    09 April 2011

    From GA to AL via IN

    BEFORE

    I loved my work and my boss, I liked most of my coworkers, and I had come to hate my workplace.

    AFTER

    I'm doing the same work that I still love, so far I like my boss and coworkers, and I love my workplace.

    All in all, despite two very strange years in between, I think I've traded up. :)

    28 January 2011

    An Idea for Modern Education

    Step One

    Do a traditional lecture on the topic.

    Step Two

    Assign standard homework. But for each question, ask where and how students arrived at their answers.

    You can hope all you want that students will learn the material by attending your lectures, reading things you've assigned them to read, and getting a broad background on the topic from which they can draw to answer specific questions. But this is a day and age where they will just copy/paste the entire question into a search engine (including any misspellings). And there are lots and lots of people on the Internet who will happily write a direct answer to it if enough students input the exact same one. Yay for SEO longtails and ad revenue share.

    Step Three

    Do a second lecture about all the online sources on the topic that students have found. "This one is right because..." "This one is wrong about..."

    In this way, not only do they still learn the actual material, they also get some insight into evaluating sources on their own. And you learn where all the cheat sources are without having to look yourself. Win-win? :)

    Note: I have no education background whatsoever except as a student.

    01 January 2011

    2010 Retrospective

    In January, I was still receiving unemployment money while sending out job applications and receiving rejections. I was in the middle of sorting through nearly two decades' worth of life's paperwork detritus and preparing for a move, whenever that might be. I was waffling about where I wanted to go with content-site freelance writing. It passed the time while I waited for the next part of my path to magically appear, but was it worthwhile to do? Was I in or out on the challenge Bright Hub laid out for me with their new standards? Could any of this possibly make me a living?

    In March, my friends with the seafood market invited me to move into their house and (more or less) join their family.

    In April, eHow's WCP shut down, Demand Studios invited me in in its place, Bright Hub was really starting to grow on me, and all signs pointed to Go on the freelance writing.

    In May, I moved from Savannah to Indiana. Then I spent the next five weeks in Taiwan, two weeks in Hong Kong, and half a week in San Francisco. I went places, saw longlost relatives, and met new people (including my niece). It was both a vacation and a form of imprisonment as I couldn't go anywhere or do anything without other people's approval.

    In July, I finally completed my move to Bloomington. Bright Hub promoted me to Senior Writer (so I met and surpassed the challenge of their standards). Between them and Demand, I started making about half the money I needed to go back to living independently.

    In September, I got a job: to go out on boats in the Gulf of Mexico in support of NOAA's oil spill damage assessment. I went on three cruises before fall sampling shut down for the winter.

    In December, after weeks of no word from the cruise people, I began wondering whether I'd done such a terrible job that I would never hear from them again. Even though I know there's nothing going on until spring sampling begins. Writing continued in the meantime to pass the time.

    And now we're back to January. I'm still living in someone else's house. Nearly all my stuff is packed away in storage. I'm doing really well at Bright Hub, and Bright Hub is doing extremely well on the searchable internet.

    Where am I going next? Well, if all goes according to plan, I'll be working a lot of cruises in the spring and summer, and writing in between - both for Bright Hub and fiction. If all doesn't go that well, Demand Studios is still there as the backup plan. Will my finances become stable enough to move back out to a place of my own? I think that's the goal for 2011. I guess we'll see what happens from here.

    25 October 2010

    Ahh, Prejudice

    On the one hand, I'm really flattered that someone could be so comfy including me in their "us" category that they'll use words like "fag" while talking about their "them" categories. I haven't been part of any offline "us" categories in years.

    On the other hand... well... umm, "fag." T.T

    19 July 2010

    Slice of Life Reprise

    After having lived for several years in a place where people commonly did their best to avoid acknowledging my existence, I can't say how nice it is to be somewhere where people actually look at me and sometimes even randomly talk to me like I'm a normal person, and where service staff actually want to help me. Even if they're old white people! Thank you, Bloomington Indiana, for reminding me what that's like - and restoring some faith that there are at least small pockets of midwestern U.S. where people are decent, even to people who aren't exactly like them.

    (Slice of Life)

    22 April 2010

    Today's Insipid Thought

    At some point your potential is supposed to turn into kinetic. If it hasn't by the time you've reached 30, you've lost it all.

    11 April 2010

    Two Roads Diverge in a Wood, and I

    On one side lies the Science Academia path. I can get another job as a data analyst and continue my endless string of research tech jobs. Or, if I want to actually advance, I can get a PhD in something. So far I've narrowed the "something" down to ecology, which is still kind of broad. Then, once I have a PhD, expectations rise steeply about what I do next: develop a research program and find ways to fund it. This would be exactly what I was avoiding for the past ten years.

    On the other side lies Freelance Writing. Bright Hub has seemingly endless stuff for me to do, and it's certainly a place where I can help them grow. There are lots of other content sites I can write for as well. For that matter there's "real" freelance writing where I query to write stuff for a lot more money than content sites pay. The pay is very low at the start, but then there are my friends with the seafood market who have offered to let me move into their house for free room and board - so I'll stop having any living expenses to speak of. And just as I was waffling about where I should go, eHow folded up its ad-revenue-share program, and suddenly I'm a part of Demand Studios. Suddenly I can actually make decent money at this.

    To go one way, I'd really need to find the right kind of passion for my work. Good scientists don't just go to work, they live and breathe what they study. I don't have that.

    To go the other way, I'll basically lose all my credentials to go back to science later. My degrees are already stale, and my leet skillz will go too. I won't be able to go back.

    Two roads diverging. I can't keep going up the middle or I'll just hit a tree. I don't know that the one I'm choosing is the less travelled, but it certainly seems to be the path of least resistance.

    01 April 2010

    March articles

    My friends with the seafood market have managed to drag me into helping them on the busier weekends, and also at month starts when they have huge hordes of rabid customers rushing to spend their EBT funds. March was extra busy because of Lent, when people stop eating land meat and therefore more seafood. Plus they were down a worker who had to be out of town all month. So, all in all, I wasn't online a whole lot.

    Still, I managed to write four articles for Bright Hub, one for eHow, and one for Bukisa.

    Life Cycle of Seahorses - Seahorses are small fish with a life span of one to five years. The seahorse life cycle includes males that get pregnant, which is as extreme as it gets for male parental care in the animal kingdom.

    Intertidal Zone and Habitat Functions of Estuarine Marsh Areas - Salt marshes in estuaries have two main functions of interest to humanity. They provide crucial nursery habitat for the young of a great many fish, shrimp, and crab species that we like to eat. They are also Nature's septic system for all the organic waste we produce farther upstream.

    How to get ingredients in Restaurant City - there are six ways. I screenshot them all, including pics from inside mine, Anne's, and Carol Elaine's restaurants. :)

    Origin and Phylogeny of Vultures - this one is based on "black vulture phylogeny 'animal diversity web' " which lots of people are running searches on for some reason. So I tried to write an answer. :) There didn't seem to be one when I tried the search myself, at least. (If you've landed here by searching on it, please drop me a comment explaining what you're trying to find, and whether the article I wrote was it... if it isn't, I'd be happy to try again.)

    How to set up housing in Emperor: Rise of the Middle Kingdom - the second in a four-part strategy guide series I'm working on (apparently at the rate of one per month).

    How to remove sticky oil residue from nonstick pans - eHows have the advantage of being quick to write with minimal paperwork overhead fuss. This one, I figured out how to do because I had some uncleanable pans, and then I wrote it down for everyone else.

    As for April, so far I've claimed one slot about ecosystem changes. I have lots of ideas for more gaming articles (which, although less fulfilling to write, are a lot faster and certainly entertaining to research...). It all depends how busy the seafood market keeps me.