First off, let me say that I will probably be moving my sites off of 3shost sometime in the near futures. I apologize for the two hours of downtime the website experienced today at the hands of my web host. It seems as though "unlimited" bandwidth meant 9GB of transfer for the month. So when I hit that limit today, my site was shut down. Now it seems to mean 18GB of bandwidth. However, I can only take so much from a web hosting service. I've now had more bad customer service experiences with them than good ones, so it's time to move on. Thankfully, there's an awesome hosting service here in central MN called Babbage Technologies. It seems like they will be able to provide a much better customer experience than 3shost can.
All gripes about poor services aside, I have a neat REALbasic factoid for you. Have you ever found yourself needing a way to "slice" a MemoryBlock? For instance, let's say you have a memory block which represents a structure. The structure, laid out in C, looks like this:
struct someStruct {
int foo;
int bar;
};
struct someOtherStruct {
int lala;
someStruct wahoo;
int alal;
};
If you were wrapping this in REALbasic with a set of classes to represent someStruct and someOtherStruct, then you might want to take a slice of memory from your someOtherStruct class' MemoryBlock and use it to make a someStruct class.
Well, you're in luck! I never knew this before, but that's exactly what MemoryBlock.MidB accomplishes. It takes one MemoryBlock and creates another MemoryBlock using a subset of the first object's memory. The great thing about this is that it preserves endian data and accomplishes its goal quickly. You could sort of get away with it assuming that you used .StringValue, but the problem with that is you're converting the memory into a string object, assigning it, and then converting it back to a memory object. What's more, you have to remember to set the .LittleEndian flag of you new structure, or else you lose that information. MemoryBlock.MidB negates all of these issues, and just generally rocks.
That's my something new for the day, and hopefully it helps someone else out too!
Could you give an example of how you'd do it? For example, with the C structs you used up the page?
(Yeah, prolly simple, but my brain is at "fire bad. tree pretty" level right now :P)
I am renting a fancy dedicated server that you could use if you want. I am using like 1% of its capacity, so if you would like a free host, I could put you on that.
Whatever you do, DO NOT go with Yahoo! Web hosting. While their reliability is so-so, when there were problems, the response I'd receive from their support were always form letters telling me to delete cookies or clear my browser cache. Yeah, like that's going to fix an issue where Apache wasn't writing server logs anymore. Yeah, those darned Firefox browser cookies can wreak havoc with an Apache server 400 miles away, running on FreeBSD.
I basically had to threaten to take my business elsewhere before I got a more meaningful response, but even then, it seemed like I was communicating with a bot or some non-technical person who had chose 'Disgruntled customer template #3'.
I can't wait until I get a good connection and can serve my own stuff, even with the threat of all the script kiddies and bot nets out there...
@Jeff -- thanks for the offer, but I get a pretty high amount of traffic. I'd feel bad for tanking your server. ;-) I've been looking into going with Babbage, and they look like they're going to work out great (and them being local is a real bonus too).
@Will B -- yeah, but hosting your own has a big set of issues with uptime. If the power goes out (which it always seems to do), then you're stuck and customers can't get to your site. There's something to be said for hosting off-site, too.
@Scott -- I'd use it like this:
dim mb as MemoryBlock = theEntireContentsOfSomeOtherStruct // This holds the "big" struct
dim other as MemoryBlock = mb.MidB( 4, 8 ) // This holds the "inner" struct
So in this case, mb.Long( 0 ) refers to someOtherStruct.lala and other.Long( 0 ) refers to someOtherStruct.wahoo.foo
"@Will B — yeah, but hosting your own has a big set of issues with uptime. If the power goes out (which it always seems to do), then you’re stuck and customers can’t get to your site."
Well good grief, it's not like I'm going to be running a Stratus mainframe or anything ;) Modern UPS units work pretty well, so power interruptions wouldn't be an issue for me. I would just sketch about all the constant hacking attempts by aforementioned script kiddies and bot nets. I set up a Linux Apache/postfix honeypot once and was amazed at how many attempts there were.
UPS units work great for blips, but not for a constant supply of power over a period of time. I dunno about you, but around here my average power outage is an hour or more.
One time, the power was out for four hours. Can you imagine that? Four hours without the internet? It was scary.
(shudders)
Yeah, our outages aren't ever that long, but I guess if I got serious, I could buy one of those little Honda gas generators. I guess I need to get a house and some money first :P
@Aaron: 4 hrs with no Internet! You were lucky to survive! :)
But I know what you're talking about on the UPS side. Our building has a WALL of UPS batteries. That will only supply us power for about 30minutes (I think there's over 100 batteries).
We've got a diesel generator to kicks in automagically when the power switches to the UPS for more than 5 minutes or so.
Of course, we found out that we had a glitch in the building design. The servers A/C WASN'T connected to the backup power. So when the power died in the middle of the summer a few years ago in 30C weather, the fire dept had us send everyone home since we couldn't run the servers any more (fire risk with no A/C). It was funny.
Even here in high tech Silicon Valley, 40,000 people were without power for 4.5 days during last week's heat wave.
And even if you have a UPS to keep the server up, you're still dependent on all the network devices along the way being able to get power too.
I have a dedicated 100 megabit connection which is about 30 terrabytes of transfer/month, so 18 gigs is like a drip in the ocean. If you change your mind let me know.
@Jeff -- wow, no kidding! Thanks for the offer, I'll let you know if things with Babbage don't work out. :-)
Hey A-A-ron! I am looking for a new place for my work to host their web site b/c the current place suckus! Although it is only 124.32 a year, they get like less than a GB of space and their site looks like it came from 1990. Getting someone to re-design and searching for new hosting options. If you have some suggestions I'd gladly take them!
You might want to take a look and see what babbage-tech can do for you. Their rates are reasonable for what you get. And they have a web designer who can work with you to design your site.
I've usually just done my own sites, but I'm to the point where I'm willing to pay someone else to do it just so that I don't have to. ;-)
Then the site went down again last night. "Emergency maintenance" is what they told me and claimed it was off peek hours. Peek hours for what timezone??? I got my first email telling me that the site was down at 7pm. I got home from volunteering at the fireman's dance around 12:30 and the site was still down. They didn't close my support ticket until 3am. 8 hours of emergency maintenance? Screw that! Babbage, here I come!