July 22, 2008
I posted over at http://mashable.com/2008/07/22/3-ways-to-make-more-money-blogging/ but wanted to expand on the idea there in more detail. The mashable article was linked to http://www.centernetworks.com/online-advertising-interaction which has a few more comments on the same topic: Advertising as monetization for blog content.
The author from centernetworks does a reasonable job of pitching his case - the trend, especially in tech circles, to block ads and avoid ever clicking on ads is hurting and will further hurt ad- and sponsor-driven content. One might question the wisdom of getting in to a business whose entire revenue model is ad-driven, and which hasn’t been ‘proven’ except for a handful of sites which tend to prove the exception to the rule more than anything else (slashdot, techcrunch, readwriteweb, gigaom, etc.). But, many people are choosing to go down that route anyway, whether part time or full time. So what’s a blog author to do?
I’ve experimented multiple times with text and banner ads, and they never do well enough. I don’t get huge amounts of traffic - perhaps 5-10k page views on my blog per month. I’ve noticed there are times when I write a lot where I get more traffic, but it’s not a direct relationship, at least in my case. I’ve written a lot of what I considered to be reasonable quality material which never gets visited, then some months I get a lot of traffic from stupid one-off posts. I’ve recently turned to a ‘buy me a coffee’ donation solicitation approach (well, buy me a hot chocolate, too much coffee makes me sick!) and we’ll see how that goes. I do know that I used to take donations on a reasonably popular search engine tool (keywordcount.com - very popular back in the day) and after about 50,000 unique visitors I’d had about $42 in donations. Even a $5 CPM (wouldn’t have been hard in those days at all) would have been $250. Donations didn’t seem the way to go then, and I’m not sure now either, but again, we’ll see.
But that got me to thinking about the donation model re: blogging. The model is pretty inefficient, in that paypal (for example) is taking a moderate cut (especially on $3 donations), and the donator has to donate in singular fashion to multiple sites which they might want to support. Wouldn’t a group ‘tip jar’ approach make more sense? There are a few ways I can see this happening, and I’m not really anxious to start ‘yet another project which needs large amounts of eyeballs and buy-in to make any headway at all only to be copied by someone else in 2 days’ ™. This idea could be implemented through someone like bloglines in a fairly straightforward fashion.
Anyone who wants to accept donations for content in a feed would register with bloglines (for example). Readers viewing those feeds which accept donations would see a ‘make a donation’ button. Seems simple enough, and not much different than individual donations, right? The main twist I see here is that bloglines could allow the visitor to make donations to multiple feed authors at the same time. So my $12 donation could be split up amongst 10 feeds I select. Or let me make a one time donation of $80, split across everyone in my OPML (which accepts donations).
The ‘registration’ part would be even easier, because the information could be embedded right in the feed. Devising a standard ‘<rss:donate’ info tag shouldn’t be too hard. Either info directly embedded in the feed itself, or a link to a file on a particular site, and donation info is ‘registered’ with the particular donation-handling service.
A standard fee of 10% or something similar to cover the processing and adminsitrative costs would be taken off, and the rest split up however the donator wished. All to one feed, evenly split amongst all feeds in my reader, manually entered percentages, etc.
Perhaps there are services out there that could be adapted to fit this idea quickly? Or perhaps bloglines, newsgator, Google reader or some other established reader program could run with this idea?
What do you think?
Did you like this post? Buy me a hot chocolate!
Posted in Business, Ideas, Software, Web
1 Comment »
July 21, 2008
I currently find myself with a client who owes a substantial amount of money (over $8000) and I’m at a bit of a loss over how to approach collecting on this debt. Emails and phone calls have not worked so far. This was billed over two invoices, and the first invoice is now five weeks past due.
Interestingly, 3 weeks ago when I sent an initial inquiry (2 weeks over due) I was told that the client had never recieved the first invoice. Sounded convincing enough, but I had a return email from him on May 22 in which he’d acknowledged receiving the first invoice, with instructions to only email it to him in the future, instead of his CC’ing someone else as well. So there’s some trail of evidence that this wasn’t completely ‘lost’ or ‘never recieved’. At the same time, there was *a lot* going on on the project at that time, right before Memorial Day weekend, and we were trying to do a project launch. Someone else at the client’s company had quit right around that time as well, so I was giving the benefit of the doubt.
I followed up with an email, which inquired about the invoices status. I was told the client was ‘waiting on some checks to come in. Hopefully late this week, but more likely mid next week’. I wasn’t sure if he meant that he’d send a payment the middle of the following week, or if he expected those checks in the middle of the following week. Whichever was intended, I still haven’t seen payment yet.
I’m reviewing options here, and none look pretty.
1. File a small claims court claim. There’s a limit of $5000 on this, so already I’m losing out.
2. Hire a NY attorney to file a larger claim. This will likely be expensive. (I’m in NC and the client is in NY, making it more complicated still).
3. Hire a collections agency - this doesn’t seem like the right option, but it’s on the list.
4. Forget about it.
#4 is the least attractive, which probably goes without saying.
I’ve considered a ‘name and shame’ approach - naming the particular client in question - but I don’t think at this point that will do anything positive except make me feel good. I have our original contract which called for payment within 21 days (3 weeks) unless the work was noted to be unsatisfactory. Bad clause in there, and the whole agreement was very one-sided, but I signed up for it, so I’m stuck with it. In the 2 months of working with this client, I had no written or verbal indication that my work was unsatisfactory, so I don’t think there’s a leg to stand on there. I’ve not yet sent a ‘final’ letter via certified mail yet, which I believe would be a good next step to take to document my efforts thus far.
The topic of collections is covered in my book, and was based on some previous experience and that of some colleagues of mine over the years, but I’ve never experienced it this personally before. I will need to take my own advice next time and require some form of down payment for most future projects of any substantial size.
I’ve been on both sides of this situation - not being able to pay someone, and not being paid. I’ve never had a client not pay this much though. The one previous non-payment was for a few hundred dollars, and it was something we worked out over a phone call (not really a big deal).
What would be your advice in this situation? If you’ve been in this situation before, how did you handle it?
For anyone wondering, this was not something that dragged on for months - this all happened within 2 months, but about 95% of the work was carried out over a 6 week project. Perhaps invoicing weekly would have helped bring this to a head earlier???
Did you like this post? Buy me a hot chocolate!
Posted in PHP
32 Comments »
July 9, 2008
I’ve putzed around with it before, went through some example code, etc., but yesterday picked up the “Programming Erlang” book from Pragmatic Programmers. Might still return it if its too dense, but doesn’t seem to be so far.
The biggest takeaway I have is that Erlang is good for concurrent programming because of it’s ’shared nothing’ approach (my words, not theirs). Actually, there’s quite a bit on Erlang at Wikipedia. For example: “Process communication is done via a share-nothing asynchronous message-passing system: every process has a “mailbox”, a queue of messages sent by other processes, that are not yet consumed.“ What does that sound like? How can I tie this in with PHP?
PHP and Perl for sure (and I believe Python and Ruby, though I’m not sure) use the “shared nothing” approach in web development (for the most part, mod_perl notwithstanding). This has demonstrated that it’s very easy to ’scale out’ web sites that need it usually by simply adding more front-end web servers. Scaling out the database does become a more difficult bottleneck problem, but it’s not impossible. Contrasting this with the complexities that Java has when trying to ’scale out’ applications. This isn’t saying Java apps can’t scale. However, specifically in the web domain, the Java code I’ve come across has tended to use threads for many problems, and threadded applications are harder to ’scale’ across multiple machines. Again, not impossible, but harder to manage.
Should the VMs just get more advanced and manage the threads across multiple cores (or multiple physical machines) for you behind the scenes? Or should programmers be required to think about app design fundamentally differently than the traditional ’spawn multiple threads’ approach that Java (and others) take?
This is not me necessarily saying that PHP is the be-all and end-all. It’s not - it certainly has its share of problems. But I’m finding it interesting that one of the key tenets of Erland - shared nothing processes - has been a key factor in what’s allowed PHP to become as dominant as it has. This is also what allowed Perl CGI apps to become as popular as they did in the mid-to-late 90s as well. Process and queue management in PHP6 would, imo, make it a viable contender to Erlang for the ‘concurrent processing’ market. The ‘o’ in the ‘imo’, however, is based on a very early understanding and basic experience with Erlang - that ‘o’ may change in the next several months.
What are your thoughts regarding the pros and cons of PHP compared to other languages/platforms?
Did you like this post? Buy me a hot chocolate!
Posted in Development, PHP
7 Comments »
July 8, 2008
I was looking at hosting provider mosso.com this morning. No particular reason - just saw an ad and clicked on it to poke around. The pricing seemed reasonable, but because mosso is a ‘cloud computing’ sort of provider, I dug a bit further. You’re charge $100/month for “10,000 compute cycles”. Seemed a bit nebulous, so I dug in the the FAQ.
For example 10,000 compute cycles would power:
- about 2.1 million page views using a database-driven content management system
- about 11 million page views of mosso.com
- about 25 million requests for a static 15KB image
and then:
What goes in to calculating a compute cycle?
Mostly, CPU processing time. However, compute cycles also account for the disk I/O your application’s operations consume. For example, a page with heavy database queries will consume more compute cycles in part due to the larger volume of disk I/O it requires.
So, for people who are used to “just get it done” coding (a valid approach, I might add), a move to cloud computing may ultimately end up costing more than being faced with CPU limits on one initial box.
Obviously, more traffic will increase your site usage, and you’ll eventually need more boxes (if you’re using a traditional server approach). But by watching the stat usage on that single box, you’re more likely able to determine where some bottlenecks may be. You’ll likely get a better idea of what’s *causing* the box to use CPU time - is it user code or database calls? Working at that level first, and optimizing there, might be a better approach before moving systems to cloud computing systems.
Because a system like mosso transparently expands to whatever your needs are, you may just get hit with a bigger bill than you bargained for without necessarily being aware of it beforehand. It does seem they offer a ‘used compute cycles’ counter on their dashboard though, which would help monitor the situation.
This isn’t to pick on mosso.com - I like the look of their offerings. It’s more to point out that optimizations, both code and database, will likely become ‘in fashion’ again as people move to cloud computing systems with an eye towards keeping the costs down. Database optimizations in particular will probably become key for many projects.
Related story: back many years ago I was working with a company who was growing ASP projects like gangbusters. Scaling up meant throwing more servers in to a farm. Everything was built with MS Commerce Server. Well, one day MS comes knocking and says “oh, you can’t use the dev versions of Commerce Server for production”. We were paying for the ‘developer program’ where you get copies of everything for a yearly license fee. I’m not sure if we all knew we couldn’t use them in production or not at the time or not, or just assumed that because they weren’t crippled, they were fine to use. Either way it was something like $8k per server we needed to pay per server running a production copy of Commerce Server. We had about 150 servers running at that point. Next day the owner came in to the engineering meeting and said “we need to focus on optimization!”. I’m not sure how many optimizations were done, but it became a big priority for a few weeks - even a 10% reduction in servers would have saved $120,000 at that point.
Perhaps most people won’t be dealing with projects on such a large scale to start with, but part of the attraction of cloud computing is that you can scale up to those levels while leaving the infrastructure headache to someone else. They’ll gladly provide it to you, for a fee. Just make sure you really need what you’re being charged for, or if easy optimizations would be able to save you a bunch.
Did you like this post? Buy me a hot chocolate!
Posted in Development, PHP, Software, Web
4 Comments »
July 7, 2008
I didn’t want to steal the title “Is your MVC MIA when it comes to 404s?“, cause it’s just too good to plagiarize. My brother’s written a post that he’s looking for some feedback on.
Excerpt:
Usually, a request into a PHP framework is something like this
example.com/some/thing
… which gets re-written by mod_rewrite into
example.com/index.php/some/thing
The index.php uses the remaining “/some/thing” as instructions for which bit of logic to run. Failing to find the requested code can be akin to not finding a regular page in the traditional Web world, which would result in a 404 error. But, shouldn’t we expect a bit more from an advanced Web framework nowadays?
What do you think?
Did you like this post? Buy me a hot chocolate!
Posted in PHP
9 Comments »
July 7, 2008
My wife recently recieved an email which, while poorly written, had enough information in it to potentially cause someone monitoring emails (if that really happens) to look twice and read on.
Long story short, my wife is originally from the UK.
OK - maybe not *that* short.
One of her friends there is having a fight with her uncle over the care of her grandmother (the uncle’s mother). Following me so far? He’s been harrassing my wife’s friend for several months, and had told her he would start to involve my wife. Today he did that.
She received an email asking if she could “put Semtex (sic) in her mini foods”. Implying that might wife could (or might) smuggling explosives on an international flight would be enough, but he went further, suggesting he was going to prevent her friend from coming to America by alleging Bin Laden and Muslim sympathies. He then suggested that he wished they would all die in a car crash, and that they (my wife’s friend and family) “should be wiped off the face of the earth”.
The email also said “I will be sending you more emails with trigger words in them to make sure they are picked up by the CIA…” and various other agencies. The man in question is being investigated by the UK police for earlier harrassment, and now it’s extended to my wife. So I called the local FBI office.
fbi.gov showed the closest office was Charlotte, which is strange, because Raleigh is the state capitol. Why not have a Raleigh office? Anyway, I called, and after explaining, was put through to an agent who said I should talk to the Raleigh office. He transferred me. Great! The operator there put me through to a field agent, but suggested I also email in the offending email. “Send it to raleighfbi@bellsouth.net”. What the heck!!? Our gov’t is too poor to set up email for a field office with a .gov domain? Or does this just make it easier to filter and track all emails? Or to perhaps nab *all* bellsouth.net email data whenever they need something?
The FBI agent I spoke with suggested I just write back to the original author and tell him to stop all contact. Really, at this point, because he’s in England, and it appears to be a domestic dispute, there’s little that the FBI can do right now.
I can have a level head about this all I want, and dismiss it as the ravings of a nut. *My* levelheadedness, though, is not what concerns me. It’s the PATRIOT act, TSA, FBI and other agencies’ attitudes towards something they might pick up scanning communications (Echelon, anyone?). Perhaps normal emails aren’t routinely scanned, but given that he’s already under investigation, and it’s an international email, and the often general incompetence of low-level government workers, I rather feared the worst. My wife and I both travel internationally, so I wanted to nip this in the bud. Having spoken to someone last year who was under investigation under the PATRIOT act, he had about 9 months of pure limbo (travel, work, personal life all affected) for an absolute goose chase.
I feel like we’re in an arms race of paranoia, and no matter how rational I can be about things, very little may be under my control when it comes down to it. Perhaps I overreacted slightly, but given the state of the nation these days, I’m not sure this was an overreaction.
Did you like this post? Buy me a hot chocolate!
Posted in Personal
5 Comments »
June 28, 2008
What? Another URL redirection service? What’s the point? Well, there’s a couple of points.
1) I hadn’t done one yet, and it looked like a simple yet difficult enough challenge to get me thinking about coding again.
2) I didn’t see anything that offered usage statistics. I tried one that claimed to offer them, but it appeared broken. I’m pretty sure I’ve heard of some others that do, but I couldn’t find them.
So, today I put up http://ewerl.com. It’s a play on the word “ewe” pronounced as “you”, as in “YOU R L” (URL). Yeah, I probably shouldn’t have to explain it, but the picture of cartoon sheep should help drive the point home. Otherwise one might read it as “e-whirl”. Not what I was going after
I asked for some feedback on Twitter and already saw someone poking XSS holes in the supplied data. Completely my fault, as I wasn’t cleaning the data for security (see, needing to get my head back in the game, so to speak). I’m using the PHP PDO library, and binding data with prepared statements, so I’m not *as* worried about SQL injection, but the XSS was a bit of an eye opener (thanks, whoever you were). That’s plugged temporarily while I come up with a better long term solution. It’s *workable* now, but I want to see if there’s a better approach than what I took.
On the stats end, any URL you shorten with the service has stats publicly viewable by adding “/stats” at the end of the URL. If you’d prefer to get them in RSS form, add “/rss” instead of “/stats”. The ewerl.com/faq/ page has a link to an example stats page and that has a link to the RSS feed.
If there’s any features you’d like to see in a service like this, please comment here or drop me an email. Please test it out, bang on it, poke holes in it, and send me any feedback (good or bad) that you have.
Thanks!
Did you like this post? Buy me a hot chocolate!
Posted in Development, PHP, Software, Web
10 Comments »
June 27, 2008
Two evenings ago I wrote a post about browsers still not having upload progress meters. The blog post was voted up on reddit, and the server got slammed. So slammed, in fact, that it was unusable for a few hours while I investigated the problem. I didn’t know the post was on reddit, but I knew I was getting some traffic. Unfortunately, the day before, I’d installed ‘piwik‘ - a tracking/analytics package. Given that was the most recent change, I spent some time looking at that avenue first.
Actually, I spent most of my time trying to stop Apache so that I could have a usable machine. I’d then make a change, restart Apache, and within 5 seconds the machine would be unusable, and it’d take 2-3 minutes for the hastily typed ‘httpd stop’ command to do its thing. Then I’d start again. I spent some time trying some MySQL tuning options. I shut off my Tomcat processes and a separate SOLR Jetty server process. The machine’s only got 1 gig of RAM, and is ‘only’ a 1.7 ghz processor, so luxuries like Java apps couldn’t be running while I sorted this out.
Finally I realized my APC cache wasn’t on. I’d put it on the server months and months ago, or thought I had. I’d moved servers, and can not remember if I’d reinstalled it or not. The php.ini file had it listed in there, but commented out. Turning it on and restarting didn’t work - APC had been compiled against a different PHP API version. I think what had happened was I’d upgraded from PHP 5.1.3 to 5.2.5 and the internal API structure was different enough that APC didn’t work anymore, and I must have commented it out in the php.ini file. It’s been so long that I finally forgot.
So, trying to recompile APC was an issue in itself, because “pecl install apc” didn’t work. It was already installed as far as pecl was concerned. “pecl uninstall apc”, then “pecl install apc”, then wait for 6 minutes for it to grind all the way up to where it complained about not being able to find ‘apxs’. I had an ‘apxs’ on the machine, and in my haste, I just copied that one in to the path where the compiler could find it. Everything compiled and APC started up. Except it wasn’t caching anything (except itself). The apxs I’d copied was a ‘psa’ one - specific to Plesk’s administative Apache version. So, that took an extra half hour to sort out (actually, I was taken away to something else, so my brother Mark stepped in and recompiled APC for me with a new apxs).
Turning on APC and getting Apache running again solved much of the problems, even though the load on the machine still hovered between 15 and 20 for the next hour or two. By this point much of the traffic spike had died down. I guess people coming to a non-responsive server eventually stop trying!
What I’d ended up doing at the top of the Wordpress index.php file was a rand() call to allow 40% of the traffic in during the ‘bad’ times whilst this was being sorted out. That let some people in, and gave the other 60% of visitors a terse “server is under heavy load, try back later” message. Sorry if that was what you experienced yesterday, but it was the best I could do at that point.
We (Mark and I) had spent a bit of time tracing through some xdebug outputs of Wordpress logs during this time (I turned on xdebug cachegrind output for about 10 seconds and got quite a few dump files!). Wordpress itself is just horribly inefficient under the hood. Somehow I always knew it, but its done for the sake of flexibility. At least that’s what I tell myself. Anyway, I’d spent some valuable time tracing through some of the function calls and I just couldn’t believe how wasteful it is in there. Obviously the APC code cache helps immensely, but that’s only part of the solution. However, given the ecosystem around Wordpress, its hard to immediately jump ship to something else.
Anyway, that’s the quick analysis of what happened yesterday. There were over 8000 visits from reddit alone, and a few thousand from various other sources. However, as I said, more than 60% of visitors were getting ’server overload’ messages, so many of those visitors wouldn’t have been counted.
By the way, the Wordpress “super cache” plugin thing did absolutely 0 in the wake of hundreds of concurrent reddit visitors. Not sure if I had set it up wrong, but it looked like there was only one way to set it up. See comment below - I didn’t finish configuring properly - my fault.
Lesson learned, I’m more prepared now than I was a few days ago. I doubt I’ll see that much of a surge again any time soon, but I’m ready for it. Bring it on (in moderation, of course).
On a completely unrelated note, if you’re looking to hire someone, or looking for a new position, check out the new http://webdevjobs.com job board. Thanks.
Did you like this post? Buy me a hot chocolate!
Posted in PHP, Web
9 Comments »
June 25, 2008
It’s 2008.
Firefox 3 was just released - years of work, thousands of bugs fixed, new features thrown in. No file upload progress meter.
IE7’s been out for awhile, but I don’t have a copy here handy to test. My memory is telling me it doesn’t have one, or if it does, its very unobtrusive and not immediately apparent.
Opera 9.5 was recently released. No file upload progress meter.
Konqueror 3.5 - no file upload progress meter.
It’s too late for me to check Safari2 - but I don’t think it’s got one. I don’t have Safari3 on a Mac, so *maybe* it’s got one, but I doubt it. I think I’d have heard about it if it does.
This current tirade stems from implementing a file upload progress meter in PHP5. Yes, PHP5.2 has some hook, and there’s a PECL extension. However, there’s *0* documentation on it, and the few pages Google turns up are mostly people saying “it doesn’t work!” and a few “hey it works!” with little in between. I have one other option, I think - the APC cache system apparently also has file upload progress functionality in it now. I was hoping to avoid it, because 1) I think it might have conflicted with the ioncube encoder on the machine and 2) I was really hoping to use an extension that just did the one thing I needed, not a bunch of other stuff as well.
I realize this is partially a PHP issue I’m ranting about, but it’s ultimately a hacky workaround to a basic piece of functionality that browsers should support. The browser is pushing the file up - it has a notion of how many bytes have been pushed out to the network. It is in a position to know the accurate size of the file in question. Showing a local status of that information would be a faster experience, rather than adding a layer of AJAX calls to an upload screen.
I was at a developer panel in Ann Arbor back in 2003 and someone from MS was on the panel. He had been on the IE team at one point, and I remember making the suggestion to him to pass the ‘upload progress bar’ back to the IE team. It was a bit of an odd response - it wasn’t a ‘no’, but a bit of a bemused look, as if to wonder why people would want that. He didn’t *say* that, and was cordial enough to take the suggestion, but it obviously did bugger all. I was sort of figuring IE would have included it in IE7, then FF would eventually make it available as an extension, adding yet “one more extension” to the list of ‘gotta haves’, then they’d talk about how innovate FF is. :) Or perhaps even Opera might just slip it in under the radar in the past 5 years.
Alas, it seems that people that write browsers are somehow oblivious to the need app developers face in this area. Perhaps they all live on petabit connections and/or only do development with local servers, and uploading 10 meg files takes 2 seconds. In the real world, for most of us, it’s considerably longer and more painful, both on the development side testing, and for end users uploading.
Did you like this post? Buy me a hot chocolate!
Posted in PHP, Software, Web
55 Comments »
June 25, 2008
Can I do it? I don’t know for certain, but I’m going to give it a try. This might replace my ‘run a marathon’ ‘new year resolution”, as it’s more attainable, and I need to take things a step at a time (no pun intended).
A few days ago I was invited to join some other PHPers in taking this challenge. The ’support group’ is on Facebook here. I’m only 2 days in to it, and feeling sore all over. But I do think this is something I’ll be able to keep up. Doing 10 on the first day was a stretch, but 10 today is more doable, and I hit 20 today in my last set.
Join up at our Facebook site if you’re interested in taking the challenge with us, or just go to hundredpushups.com directly and take it from there.
I’m putting this in the PHP category as well to let other PHPers (via planetphp) who don’t yet know about the challenge hear the word.
Did you like this post? Buy me a hot chocolate!
Posted in PHP, Personal
17 Comments »