Kai Staats: writing

Genetic Programming 101

Getting Started with GP by Emmanuel Dufourq

Epilogue
“Well, this is where it all started. A few lines of Java loosely translated to Python, the first three chapters of the “Field Guide to Genetic Programming“, and guidance from fellow researcher Emmanuel and officemate Arun, when I took wrong turns.

Had I known the effort would be not just six weeks, but six months, resulting in more than 2300 lines of Object Oriented code producing an extensible, multi-core platform for both symbolic regression and classification, with a user interface, well, I would have either been pleasantly surprised or run away screaming mad.

Either way, I look back and recognise how far I have come as a programmer, how much I have gained in training as a researcher, and how good it feels to have dedicated myself to a substantial task and followed through.” –kai, 26 September 2015

public Node createTree(int maxDepth, String type){

int random = gen.nextInt(4);
Node root;

if(random == 0){
root = new And();
}
else if(random == 1){
root = new Or();
}
else if(random == 2){
root = new If();
}
else{
root = new Not();
}

treeSize = 1;

populateTree(root, root.getLabel(), type, 1, maxDepth);

return root;
}

To read only essays and entries about my work in genetic programming and machine learning, select the category Ramblings of a Researcher.

By |2017-11-25T00:02:25-04:00February 17th, 2015|Ramblings of a Researcher|Comments Off on Genetic Programming 101

LIGO Generations

Funded by the National Science Foundation through the University of Mississippi, LIGO Generations shares the passion and the motivation of individuals who have worked for nearly three decades on a single science experiment. We engage in the stories of those who motivated a new branch of physics in order to prove the last piece of Einstein’s theory of general relativity, and to hear the universe in a new way.

Read more …

By |2017-04-10T11:17:35-04:00January 30th, 2015|Film & Video|Comments Off on LIGO Generations

A Daily Unfolding

My time in South Africa has been one of constant adjustment, of intentionally holding doors open in order that they do not prematurely shut; and sometimes being surprised by those which present themselves without even the sound of a key being inserted nor the turning of the knob.

The beach has become my home. It’s daily redesign by wind and water presents a new realm to explore. I no longer find the need to move from place to place, for each day there is something new unfolded before me.

Massive piles of kelp appear overnight while some mornings bring a scattering of snails, blue bottles, or sharp, black shells. What would require a labour force of hundreds of pairs of human hands coupled with powerful engines, scoops, and locomotion is undone in a matter of hours by the liquid fingers of the wave, tumbled foam, and gravity.

Sometimes the ocean brings a baby seal onto shore, separated from its mother, abandoned for reasons unknown, or orphaned by the success of the sharks which reside just past the surfers’ backline. The seal swims onto the beach, is rolled by the next wave, and while curious about the human lookers on, any approach is met by its bark and retreat.

Unfortunately, it is not only the sharks that torment these young, for humans too seem to share a propensity for harming those things which should be left alone. Last month a surfer rescued a baby seal not from the sharks, but from kids who kicked it and threw stones while it moved along the shore. It seems respect for life is gained only after our inherent curiosity about death is explored.

As when I lived at Buffalo Peak Ranch in the Rocky Mountains of Colorado, I have again learned to shape my day based upon what happens out of doors. The weather, the motion of the sea, the rise and fall of the tide. Running, surfing, or swimming based upon what is presented, but combined, a daily routine that carries me from week to week, month to month, for nearly a year.

I have learned to find joy in a place that is not always easy for me.

I have learned to find comfort in the waves that once scared me.

I am again learning to accept what I am given for a day, knowing it may be gone the next.

By |2017-08-12T04:53:07-04:00January 13th, 2015|From the Road|Comments Off on A Daily Unfolding

St. James Tide Pool

Kai Staats: St. James Tide Pool A day of good intentions started at 7 AM. After five days of editing the LIGO film, hour after hour sitting on my back side, it seems a day of simply re-organising, of catching up was in order. I sorted hundreds of photos and some documents, conducted a full computer backup (minor backups conducted every Friday evening), and then ventured to the St. James Bay tide pool.

One of the perks of living here is a two minutes walk to the waves, surf board under arm. But on those days which are overcome by wind (November through January), the St. James Bay tide pool offers a respit, warm(er) water, and the company of hundreds of families from across this part of Cape Town.

After lunch, I walked the fifteen minutes to the tide pool for a swim. I asked a local stranger to watch my bag which contained only my shoes, towel, and shirt. It is simply too easy for things to be stolen here.

I swam across the pool and pulled myself up onto the wall. I sat next to a man who introduced himself, our backs to the ocean and feet dangling in the protected water. At just one and a half meters deep, I was astounded by the dives the local kids were performing. I would have cracked my head open if I were to have attempted these–but they have a trick, a kind of ‘spring’ in their upper body which releases when they hit the water. No matter how high they jump or how far they twist, roll, and dive, they enter the water nearly flat, compressed, and then open on impact. This keeps them from hitting bottom. The guy who was watching my bag promised to teach me when I returned.

One of my classmates from Madagascar swam up while we were talking. I had seen her coming, but did not recognise her with only her backside to the sky. I joked, “Not to hard to find the white guy in this crowd, huh?” She laughed. The man to my right noted, “It’s funny, eh, how each beach, each place has a majority. This is where the coloured and some blacks go. But just over there, at the next bay, the beach is almost all white. And back at Muizenberg, you have your white tourists and a mixture of locals. But it is a good mix, there.”

He was right. It’s strange how that happens. Comfort in the familiar.

We discussed comfort zones, independent of colour. I commented on how much personal space I grew up with, never in a crowd but for certain occassions. He laughed, “In Africa, you are always near someone. You are always in a crowd. If you leave, you miss the energy and want to come back.” The same could be said for all big cities, for Africa has many small towns and villages with open space. Yet here, people are more … visible, not indoors nearly as much. I told him about the fist time I returned from Kenya to Colorado. I felt I had come upon the scene of a nuclear holocaust sci-fi, everyone hiding or obliterated.

Indeed, there were hundreds of individuals, yet there were maybe a handful of whites, only two of us in the water. It’s part of what I love about living here. My comforts have changed considerably, what I find normal was, perhaps, even uncomfortable at one time.

Yet yesterday was the opposite, for among the thousands who attended the “Hot Water” concert (which was astounding), the number of black people could be counted on two hands.

Time to edit, edit, edit … LIGO awaits.

By |2017-04-10T11:17:35-04:00December 29th, 2014|2014, Out of Africa|Comments Off on St. James Tide Pool

Homeless in Cape Town, part V

Growing up as the son of a Lutheran pastor meant that our family was integrally involved in the Christmas season. There was planning and orchestration in preparation for the celebration. All of us played a part, while my father’s days were spent mostly away from home for the week preceding.

Being a part of the team that made it all work carried a sense of pride, in part because it was a church organisation, in part the theatrics themselves were not unlike a stage production.

When I was but 3 or 4 years of age my father built a wood and cardboard extension on the back of my tricycle. I rode this through the makeshift isles of folding chairs in Springfield, South Dakota, where my parents managed a Christian dormitory. I first distributed then collected the hymnals each Sunday morning.

More than a dozen years later, at Faith Lutheran in Phoenix, Arizona, I ran the lights, making certain they were dimmed at the right time for the candle light service. The pipe organ was one of the finest in Arizona, the fruition of my father’s effort to have it shipped, rebuilt, and installed. Often, I wished the Christmas service was without accompanying vocals, for the pipe organ alone was enough to invoke the desired emotion.

Christmas Eve was a busy time for us, but most of all for my father. He was at the church all day, preparing for the service while my mother, brother and I prepared food for dinner. Our tradition for this occasion evolved to include manicotti, a zesty, frozen fruit salad, spiced green beans, and a light desert. The aroma of apple cider spiced with cinnamon sticks, cloves, and an orange slice permeated the entire house.

We joined my father at church for the first service, then came home and waited for his later arrival to eat dinner. Back to church for the second, midnight service. Finally, home for opening gifts into the early morning hours. 1:30 or 2:00 A.M., the only time I recall my parents staying up that long. Last night, I received a WhatsApp message from my mother at 12:30 am, her time. The tradition continues.

Even when one or more of us slept in the living room, as kids near our gifts or as visiting adults on the sofa, somehow, Santa managed to sneak into the living room and fill the stockings which hung from the 1800s pump organ.

With Thanks Giving and Christmas both, we always sat with guests, relatives, church members, or friends of friends who didn’t have a place to call home that year.

We often discussed the street population in Phoenix, and how we could assist those without a home. One year I served food at the shelter in down town Phoenix; years later in Denver Colorado. Each year I would suggest that we invite one or two of the homeless, total strangers easily found on a street corner our home. Each year the expressed concern was for the safety of our family, and of course, the potential drama.

As my father spent the better part of his career serving the homeless population (as all inner city pastors do), it was not for lack of desire nor effort, rather, our Christmas celebration was a time for family.

We did our best to keep it simple, quiet, and familiar. Some of my most fond memories are of those Christmas eves, both as a child and adult.

Last night, Christmas Eve, I hosted a dinner for nine friends here in Muizenberg, South Africa. It was a spontaneous gathering, and an eclectic mix of people.

Two from the States, one from Ethiopia, one from the African country of Benin, and five from South Africa. We gathered with only two days notice, quickly organising a menu which in the end was more food than planned and all quite tasty.

I baked three home-made pizzas, an apple crumble, and a dozen cinnamon rolls from the left-over pizza dough. Zoe helped prepare the pizza sauce, Zama the fruit salad. Gilad and Fran brought a chick pea salad and Sam, summer greens.

Four of us are student researchers, one a tutor, three working professionals, and two without a home, living on the mountain, just above Boyes drive. Combined, we speak at least ten languages with one individual fluent in five. The diversity of backgrounds generated a wonderful unfolding of stories.

As I had desired many times as a child, I invited relative strangers to my home. Just twenty four hours prior a fight had broken out between two car park attendants, one having taken the job of the other. I broke up the fight, physically carrying Eurica away from the man she was hitting.

No, that drama did not find its way into my home, nor our unique dinner.

We all told stories. Stories of our childhood, stories of where and how we grew up. Surely, there were difference from Chicago to Nebraska to Ethiopia and Benin. Each was unique, rich in the telling. But it was when Eurica spoke that we the room grew totally silent.

She grew up in a township of South Africa. She lived in constant fear of being attacked, of being raped. Her childhood was spent with the gangs, shooting guns as a past time. She said, “We didn’t know any better. We’d go out shooting at people. We didn’t expect to live long. There was no future. That’s all we knew.” She paused, then continued, “I don’t think it’s change much. It’s just about the same for them. I got out, praise the Lord, but my son, he’s getting involved with the gangs too.”

Mixed conversation slowly rose again. Two, three threads quietly entertained. Sam engaged Eurica and her friend for more stories. I baked cinnamon rolls while I imagined her childhood, growing up like that.

For me, it was perhaps the best Christmas holiday I had ever spent. It was, in many ways, an engagement of the holiday as intended, a celebration of diversity under one roof.

By |2015-09-24T12:11:42-04:00December 28th, 2014|2014, Out of Africa|Comments Off on Homeless in Cape Town, part V

Homeless in Cape Town, part IV

“Where do you sleep at night?” I asked.

“On a stoop,” he responded.

“Someone’s porch?”

“Yes, that’s right.”

“Are you safe there?”

“Yes, I am safe. Thank you Lord,” he concluded.

Would you like to come over to my apartment, to take a shower. I am fixing dinner, and you can join me.”

He paused, shook his head, and then made direct eye contact with me for the first time, asking “Wow. Wow … Do you believe I need a shower?”

Realising I may have offended him, I laughed, saying, “You don’t smell bad, I just thought that–”

He cut me off, lowering his head again.

“The Lord said that we should be worry not for how we appear on the outside, but how we appear on the inside. Those who are clean, shiny, and washed may have minds that are thinking unclean thoughts. They think of steeling, of hurting, of sinful things, and yet, we believe they are clean.

I nodded.

The Rasta continued, “Thank you. Yes, thank you,” shaking his head, “But I choose to not come with you for I must remain true to the word of God. I must remain without these things, and clean on the inside.”

By |2015-07-26T06:52:34-04:00December 22nd, 2014|2014, Out of Africa|Comments Off on Homeless in Cape Town, part IV

Homeless in Cape Town, part III

I have a new friend. Her name is Eurica.

Eurica has been homeless for a nearly ten years, she says. She has two children cared for by a step-mother, one in his early twenties, tempted by the gangs in neighbourhood. As with all homeless whose stories I have received, she has family near-by, an aunt with a proper house in the next town Kalk Bay.

Eurica no longer sells her body. She is a ‘car-park girl’, making roughly $1.35 a day (500 SAR per month) helping people find parking, and then protecting their cars while they eat at local restaurants. She sleeps in the mountains, a half hour walk from the beach. The local law enforcement are encouraged to rob the homeless of what little they have, taking blankets, tents, beds–everything as a kind of punishment for sleeping on public land, on the mountain or beneath the train bridge.

She speaks of losing hope. She tries to remain humble. She feels her prayers to God are unanswered, that somehow, she it not trying hard enough for him to acknowledge. I am carefully guiding her to consider how she can better use her time, to learn skills and improve her English rather than read the Bible over and over again. She calls me Master, which I despise. It is a common saying here, I assume left-over from apartheid.

Tonight, I did her laundry. I washed, dried, and folded her white jeans with sparkles sewn into the pocket linings, her tank tops and jumpers. Her pajamas have pink hearts and the words “love” and “chocolate” printed over and over again. The washing machine was filled with grass and twigs when done. I delivered them back to her, warm, in a plastic bag with a roll of toilet paper, soap, and cotton swabs.

This was perhaps the single most important thing I have done since my arrival on this continent. Through that intimate interaction, through my serving her in that way, I was forced to realise that she is like all other women I know–wanting to feel feminine, wanting soft, comfortable clothes. Even as she sleeps in the open, on the mountain, she desires to be … human.

By |2017-04-10T11:17:35-04:00December 20th, 2014|2014, Out of Africa|Comments Off on Homeless in Cape Town, part III

The man in the seal suit

During my run this morning, I came across a dead seal rolled onto the beach by the waves. I touched it, to see if it was yet warm. But it was cool and slightly bloated. I recognized the opportunity to learn more about this animal, one I had never encountered this closely before.

I spread its front flippers and counted the fingers contained within the webbing. Five, just like mine, with what I believe are the same number of joints. Its rear flippers have toe nails. Not flat like ours, but tubular like a dog. Some just barely pressing through the skin, others nearly an inch in length.

The wave came in and rolled the seal higher than lower on the beach again. The seal was presented anew.

I bent the fingers at each joint, making a fist the size of my own. I was amazed at the similarities, the distance between knuckles nearly identical on the lower digits. Thin, strong bones suspended in a cape of black felt, cool to the touch in this inanimate form.

So very familiar. I half expected a small man to jump out from the suit.

The nose is so much like the snout of a dog, with stiff whiskers and familiar teeth. Large eyes left open when the life no longer occupied this creature, alone on the beach.

By |2015-10-06T23:19:01-04:00December 15th, 2014|2014|Comments Off on The man in the seal suit

Kruger National Park, a photo essay

Kai Staats: Kruger National Park, South Africa

zebra lion hippo giraffe elephant Kai Staats: Kruger National Park

The CHPC conference was this year hosted in the Kruger National Park, South Africa. It was a stark contrast in so many ways, as software engineers, technologists, and high performance computing specialists gathered to discuss the finer points of the current and future state of computers in the midst of South Africa’s largest national park.

Yet, the contrast was engaging. I rose at 4:00 am in order to venture into the park on a game drive or guided hike, returning in time for breakfast. While I find it difficult to rise at 6:00 some days here in Muizenberg, I looked forward to driving in the chilled morning air, the open vehicle invited wind against my face, onto my chest through my thin, fleece jacket.

The prospect of seeing animals I have only a few times before, or may never again, was ample motivation.

Kai Staats: Kruger National Park Personally, I find the elephants the most stunning. I could watch them all day, every day, and never grow wary. Of course, they are also one of the most dangerous. Incredibly smart, and highly protective of their young, Gilad and I experienced the very real threat of a young bull when he turned, squared his chest, and flared his ears as I brought our small car too close.

I quickly put the vehicle into reverse, and was able to ease the tension. A bead of cold sweat rolled down my neck, my hands shaking as I knew I had pushed too far, across his boundary.

A drive-through game park is at first consideration, an odd experience. One may ask why you would desire to spend days sitting in your car. Is this not similar to taking a golf cart through a zoo? While I prefer to be out on-foot (and this is an option, with a hired guide), there are certain benefits.

The animal population in parks such as Kruger in South Africa and Etosha in Namibia have grown-up for multiple generations in the presence of roads and vehicles. Because humans are not allowed outside those vehicles, most of the animals do not associate the vehicles with humans, and are relatively unafraid as every day their interaction is non-harmful. The chance of seeing elephants, zebra, hyaena, a great diversity of antelope, wildebeest, cheetah, lions, and many more are far greater from the comfort of your car, on designated roads, than if you are out on foot, even with an experienced tracker.

But from the North American point of view, the Kruger is an oddity, a national park with an airport and camp grounds with swimming pools, car washes, gas stations, and a restaurant chain which serves greasy burgers, fries, cake and beer.

sunset The lower 48 States do not have a park this large. At 19,633 square kilometres, the Kruger is similar to the area of the country of Holland. In California lies Death Valley National Park and wilderness, a smaller 13,650 square kilometres in comparison. With temperatures as high as 135F / 57C, Death Valley sees nearly one million tourists per year (and does not offer a full service airport, restaurant chain, or swimming pool).

It is of course unfair to make further comparisons between U.S. and South African parks. The size, type of tourists, and funding are completely different. Yet, I find myself frustrated, perhaps, for what is an obvious lack of sustainability in Kruger. Office mate and friend Gilad and I were never, not once asked to show ID as we drove into the walled camps at night, nor were we checked for our camping permit at the camping site. We could have come and gone freely, during the entire four days, likely far longer.

I have to wonder how this lack of attention to security is present at a larger scale, and how it relates to the well-known issue of rhino and elephant poaching?

According to the Kruger National Park, “Out of the 631 rhinos that had been killed by poachers between January and 6 August 2014, a shocking amount of 408 were killed in the Kruger National Park. Ferreira said that in order to protect these species, they would have to be removed from areas where they are in threat of being poached.”

With the Asian black market growing, where the astounding $65,000 USD per kilogram paid to poachers is far greater than a lifetime of earning for the average South African, the motivation to continue to kill these animals for their horns is impossible to ignore.

One possible solution includes an increase in armed response, with international policies enabling cross-border pursuits. But poachers are well armed (and well connected), the odds are in their favour. Ranchers more often cross fire with poachers than do Park officials, resulting in unfortunate fatalities. In Namibia, ranchers are reluctant to bring rhino onto their farms, despite the financial benefit, for the lives of their families are at great risk.

An effort to move hundreds of rhinos to other national parks, inside or outside of South Africa, and private game preserves is under way. But transporting one rhino out of South Africa will cost approximately $45,000. Further more, this would need to be conducted in secret in order that poachers do not know the new locations. In a country ripe with corruption, for how long will the locations be unknown?

Many rhino are de-horned, in order to curb the poachers appetite to kill these animals. Analyst are studying the effect of moving a vast storehouse of rhino horns in the hands of the Parks service into the black market, in theory reducing the value, over time, and offsetting the pressure on live animals. The long term effect is yet being conclusively determined.

At current counts, only 29,000 rhinos of the estimated 500,000 in the early 1900s remain on the planet. In 2011, the Western Black Rhino was declared extinct. Confrontation between poachers and Park officials, and more often private ranchers often prove fatal. There is no concern for human life when the stakes are so incredibly high.

It is unclear how this will end, as the park is simply too large to patrol by vehicle or on foot. Perhaps use of drones will give favour to the wardens. The NBC article “Drones Used to Stop Elephant and Rhino Poachers in Africa” discusses one attempt to put drones to use. National Geographic offers, “NatGeo: Fighting Poachers with Guns, Dogs, and Drones” as an overview of the current situation. And the BBC tells the story of “Poachers, We’re Watching You“, a camera and bio-monitor embedded in the rhino’s horn which alerts a stand-by, helicopter team to the death of a rhino such that the poachers may be apprehended before they take the life of many more animals that same evening.

The consensus is that we must reduce demand in the countries in which rhino horns and elephant ivory are consumed. But that takes time. We must protect these animals for as long as it takes, else we risk losing them permanently.

(Gilad and I did not see a rhino in Kruger National Park)

On a positive note, thank you Gilad for an incredible four days. I enjoyed every minute of your company. Let’s be certain to do it again, some day soon.

elephant elephant elephant lion
tortoise millipede wart hog dung beetle
impala Kai Staats: Kruger National Park hyaena crocodile
fervent monkeys bird water buffalo dung beetle on human hand
humans talking humans walking, afraid human baboons

By |2017-04-10T11:17:35-04:00December 12th, 2014|2014, Out of Africa|Comments Off on Kruger National Park, a photo essay

Best feature of Apple hardware

Apple firmware (bios) enables a total, bootable system copy and restoration with but a few clicks of the mouse. This is perhaps the most underutilised, little known feature of Apple computers. Interested? Follow these instructions:

1) Attach the USB drive and make certain it shows up.

2) Reboot the computer. The moment you hear the chime, press and hold ALT (newer) or CMD-R (older), depending upon age of your Mac.

3) A simple graphical interface will appear with what should be 3 or more icons. 2 of which will be for your internal drive, 1 or more for the USB.

4) Using the cursor controls, choose the “RECOVERY” partition of your internal drive and hit ENTER or the button at the bottom.

5) Select your language.

6) Select “DISK UTILITY” (see screenshot.png)

7) Select the icon on the left which is your internal drive.

8) Select “RESTORE” from the upper-right of the 3-4 options. This drive should now be in the SOURCE entry.

9) Drag the icon for the USB drive to the DESTINATION entry.

In this step, you can backup to a partition on the backup USB drive and ONLY replace the partition. This is what I do. But that would be ONLY if the backup drive is substantially larger than the internal drive and you don’t want to waste the space.

Else, if the 2 drives are closely matched, then select the primary (not indented) and see what happens. It may reject it. In which case you simply use the indented instead. It will rename that partition anyway, to match the drive it is copied from.

10) Double-check that the SOURCE is your internal drive and that the DESTINATION is the external, USB drive. Else, you will wipe-out your entire computer. Not good.

11) Press RESTORE and accept the warning for total doom.

12) Between 35 minutes and an hour and a half later, your computer will have made a complete, bootable copy.

What’s more, the external USB drive will now have 2 partitions, one which is a bootable copy of your internal drive, and the other a RECOVERY partition. When next you conduct this backup, you will again boot from the internal RECOVERY partition, not that of the external USB drive, just to play it safe (and it is faster).

By |2017-04-10T11:17:35-04:00November 15th, 2014|Critical Thinker, Humans & Technology|Comments Off on Best feature of Apple hardware
Go to Top