Fun

A couple of easy sort algorithms for you. Look ma, no array subscripts! C is the shit, kiddies!


#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define ELEMENTS 10
#define ARRAY_ELEMENT_COUNT(array) (sizeof(array)/sizeof(array[0]))

//type-independent malloc
void *MyMalloc(size_t size)
{
void *vp;

if ((vp = malloc(size)) == NULL)
{
fputs("Cannot allocate memory for malloc.n",stderr);
exit(EXIT_FAILURE);
}

return(vp);
}

//swap void pointers
void SwapElements(void *pa,void *pb,size_t size)
{
//temp void pointer to hold an element to swap
void *tmp = MyMalloc(size);

//use memcpy to perform the swaps
memcpy(tmp,pa,size);
memcpy(pa,pb,size);
memcpy(pb,tmp,size);

free(tmp);
}

//bubble sort implementation, fancy-style.
void BubbleSort(float *first,size_t size)
{
float *current_offset,*current,*last = &first[size - 1];
int flag_swap;

do
{
for (flag_swap=0,current = first; current {
//set a pointer to pointer to current element of array
current_offset = current;

//increment the temp pointer
current_offset++;

//compare current element and current[1]
if (*current > *current_offset)
{
//cast to void pointers and swap
SwapElements(current,current_offset,sizeof(float));
flag_swap = 1;
}

}
}
while(flag_swap);
}

//just for fun
void ShuttleSort(float *first,size_t size)
{
float *current_offset,*current,*back,*last = &first[size - 1];

for (current = first; current {
current_offset = current;
current_offset++;

if (*current > *current_offset)
SwapElements(current,current_offset,sizeof(float));

for (back = current; back > first; --back)
{
current_offset = back;
current_offset--;

if (*back SwapElements(back,current_offset,sizeof(float));
else
break;
}
}
}

int main()
{
int i;
float arrToSort[ELEMENTS];

for (i = 0;i {
puts("Input a floating point number:");
scanf("%f",&arrToSort[i]);
}

//BubbleSort(arrToSort,ARRAY_ELEMENT_COUNT(arrToSort));
ShuttleSort(arrToSort,ARRAY_ELEMENT_COUNT(arrToSort));

puts("------------------------");
puts("Output of sorted array:");

for (i = 0;i printf("%fn",arrToSort[i]);

return(EXIT_SUCCESS);
}

GREATEST TROLL EVER

“Everybody who doesn’t buy, now, will be priced out forever. Anybody who does buy will be rewarded with a lifetime of riches, as their property will continue its 25% yearly price increase.

Renters, and anybody born in a future generation, will not be able to afford a $5,000,000 starter home in 15 years. They will live in tent cities, and hondas.

This asset bubble is different than all of the others – it will never slow down, or pop. The gains are permanent.”

– Longtime FC Troll

Tech Investors – A Blessing and A Curse

Working for a public company, I am able to see the other side of the tech investment equation. Our company needs investors to grow. But on the other hand, unhappy investors can actually hinder growth.

The problems with many individual and institutional investors are complex, but her’s a couple bullet point that can hopefully help you to spot the pitfalls and safely make money off tech stocks.

* It’s not the 70’s (or the 90’s) anymore.
There was a time, when all of a sudden, a whole bunch of companies came out of nowhere and created technologies that changed the world. The first wave of tech created the HP’s,IBM’s,Apples,Suns, and Microsoft’s of the world. Anyone sitting on those shares today is sitting on pure gold. If you are interested in trading in these kind of stocks check out this resource from SoFi

Similarly, the late 90’s internet boom saw the simultaneous birth of Ebay, Amazon, and Yahoo, which made a lot of money for a lot of people.

The danger here, is that many people seem to think that the ‘next big thing’ is just around the corner. Fact is, it’s most likely not. Technology is like any product, it takes years of slow growth and refinement before it hits the mainstream.

The key to knowing what the ‘next big thing’ is, is described in the next item.

* Be in the Know
The Internet didn’t invent itself. It grew slowly, and somewhat quietly. By the time it had hit mainstream, a mad dash was on to own a piece of these young companies.

If you had a friend in the business, you probably knew what was going on. If you had the foresight to see it’s potential, you probably did quite well for yourself.

The point here is, if you invest in tech, read the trade rags. Know what’s going on. The major media won’t be able to keep you informed. That leads us into our next point.

*Watch our for Market Trends
Analysts, journalists, and armchair brokers love trend-spotting. and Why not? It’s fun, just pick an industry, line up the charts, and watch.

The problem is, that many tech sectors, particularly in software, are not well-defined enough to be judged as a trend indicator. This is due to the great variation in the potential vs current valuation of any company at a given time.

Many investors see smaller companies with weaker bottom lines as shaky, but do not understand fundementals of the business, such as the margin on the product or the maturity of the sector.

As a result, innovators with poor margins and me-toos with identical products often dilute the trends and create misleading indicators of the value of a sector.

There is no substitute for homework, the title of our next section.

* Do your Homework
Know the facts. Know the financials, know the share dilution, know the executive track record. Call the IR people if you can. Familiarize yourself with the product. Know the history of the product, know the history of the company.

Great White North Summer 2k4

This year I decided it was time to do a proper vacation. Don’t get me wrong, Long Island is great, but I yearned for a real road trip, like those of my youth.

The ‘rents were doing the Trans-Canada rail tour, which would terminate in Vancouver for a 4-night layover. I had visited Vancouver before and knew it was the shizz,, so plans were hatched for a road trip from sunny SD to the wiles of the Pacific Northwest, via the 101 – 1.

In order to max out fun time, I decided to rent a car on the way up and fly down. We would camp along the way and then spend 4 nights in a hotel in downtown Van.

Day 1: Friday, July 9
Task one was procuring the rental. After a few false starts tracking down ‘rental car access road’, I wheeled into the bustling Hertz rental mecca.

I had reserved a sporty Ford Focus, knowing that twisty roads would be the norm. I was pleased to be upgraded as a freebie to a ‘sporty 2-door’ Chevrolet Monte Carlo for the same price. The Monte is a somewhat cumbersome lummox with big wheels and shiny gold paint. The V6 motor had plenty of power, and the leather seating was comfortable, by most accounts.

The Monte handles like a bicycle in 6 inches of water. The hyper-assisted poweer steering and ultra plushed out suspension make the car dip and push under accelleration. At 80-90 MPH the Monte had the distinct sensation of a boat swooning.

It actually handles most of the twisty sections admirably, but a smaller car would have been crisper in the turns.

Anyway, leaving SD, our first destination was Montana De Oro state park in Los Osos, California, near San Luis Obisbo.

Ruthless traffic in SD and LA caused us to question how anyone could tolerate living in Los Angeles. 8PM traffic jam on the 101 South (into the valley). Huh?

After a brief pitstop for fajitas in Santa Barbara, I barely was awake enough to track down our campsite, pitch the tentin the dark, and crawl in for some z’s.

Day 2, Saturday, July 10
After a somewhat chilly but not uncomfortable stay in the oceanside state park, we headed into SLO for bagels and coffee.
Unable to find a bagel spot, Starbucks was located, and bathroom routines commenced. Unfortunately for me, a homeless nutcase with the shits practically knocked down the door, interrupting my leisurly morning rituals. Coffee in hand, we hit the road again.

We hit Big Sur, checking the sights and putting the Monte through it’s paces on the turns. SUV drivers ran for the turnouts as they tried to lumber their monster trucks through 140 degree hairpins.

We were continuously amazed at the amount of people who actually live up there, houses clinging to the cliffsides, with not a Target in sight.

Next stop was Monterey, CA, for some clam chowder on the ol’ stinky pier. We managed to sit next to a white trash family who’s normal volume of speech would be considered by most to be yelling.

A heavy jam session by a toupee & tuxedo-clad entertainer was goin’ down as we split the scene.

Next stop was the great SF city with a nice cruise through good ol’ Silicon Valley. Dreams of the Sand Hill road fluttered through my head as we drove through. “ooh, there Oracle – look that’s Seibel”.

Our accomodations were the luxurious Marriot in downtown SF. Thank you Priceline! Although we were toasty from the road we managed to hit up some shopping and tool around the city for a bit before turning in.

Day 3, Sunday, July 11
THe AM started with a crosstown jaunt to the Haight for some cafe and bagels.

The Haight is still asleep at 10AM on a Sunday, so we grabbed some coffee and checked out a few of the freaky shops. I stopped into FTC skateshop’s new, boutique-style location and got plenty of attitude. “yeah bro, we got exclusive rights to photograph the whole thing…” was overheard as we departed.

We fueled up, and grabbed the 101 as we headed out of town and over the Golden Gate.

Our next stop was good ol’ Ukiah, California, a mildly decrepit outpost of civilization in the the pre-redwoods. Alas, the entire town was closed, so we stopped into a CrackDonalds for a piss and some fries before heading up to the Redwoods.

Within a couple hours we were on the Avenue of the Giants, chillin’ with the big trees, enjoying the quiet, and commenting on the abundance of broken down school buses in people’s front yards.

That night we camped in the Humboldt Redwoods State Park, just at the entrance to the treacherous and desolate Mattole Road, gateway to NorCals’ ‘Lost Coast’.

Stay Tuned for more!

EFFF YOOOOO

………………..//)
……………….,/../
………………/…./
…………//’…’/`
………/’/…/…./……./\
…….(‘(………. ~/’…’)
……..\……………..’…/
………”…\………. _.
………..\…………..(
………….\………….\….

The Sassbert Primer

* is a web developer
* lives in San Diego, CA
* born and raised in East Northport, NY
* graduated NHS 1994
* graduated SDSU 2003
* married nearly a year
* has 2 brothers also in SD
* loves kitties
* likes food, epecially steaks and pizza
* beer drinker (prefers lagers)
* 60’s rocker wannabee
* prefers his shirts ironed
* never wears pleats
* 15 1/2 shirt
* 36 x 32 pants
* 10 1/2 shoe
* only wears 100% cotton
* drives a 2003 Mini Cooper, but really wants that black 89′ 5-series
* no longer uses the word ‘party’ as a verb
* has been blogging since before it was cool
* has latent workaholic tendencies
* has a low bullshit tolerance
* cursed with a variety of foul stenches
* skateboards and doesn’t suck
* contemplates moving to NYC every day
* has hair that grows like a weed
* is his own worst critic
* stays up too late
* gets up too early
* works too many hours
* maintains a strict ‘no whiners’ policy
* is getting fatter by the hour
* gets a good night’s sleep whenever possible
* doesn’t really care about material success, but gets it when he can
* isn’t into scenes or scenesters
* avoids excessive time spent on hobbies
* hates to be broke, but has been more than once
* remembers everything he hears and sees
* encyclopedic knowledge of trivial crap
* too cynical for his age
* plays hardball when necessary
* mostly honest and trustworthy
* values personal responsibility above nearly everything else
* prefers reality to fantasy
* likes movies
* has been known to rock out
* is a news junkie
* still reads MAD magazine
* is ready to by a house and ‘setttle down’
* is hot for Gweneth Paltrow, Jennifer Aniston and J-Lo
* Likes rap, sometimes
* is never pedestrian
* eats bagels
* is not particularly interested in religion
* is not a pseudo-intellectual
* studied latin, philosophy & art
* is not impressed by bling
* prefers brunettes to blondes
* is not interested in 99% of modern art
* clings to the belief that skills matter
* could sell ice to eskimos but doesn’t want to be as salesman
* doesn’t own a cell phone, but is getting closer to buying one
* wishes he had gone to a good college
* likes finance and business
* stays hungry
* wants to start a business
* loves travel
* was a filthy hippie
* observes people’s habits even when they aren’t aware of them
* doesn’t want free stuff
* avoids cake before dinner
* is never, ever satisfied.