I changed domains and wanted all my pages to redirect to the new domain seamlessly, so I implemented the below code in the master pages:
if (Request.Url.ToString().Contains(“domain you don’t want anymore”))
{
Response.Status = “301 Moved Permanently”;
Response.AddHeader(“Location”, Request.Url.ToString().Replace(“domain you don’t want anymore”, “new domain”));
}
This worked for most pages but some pages (particularly those that were being directed from Google) were not being redirected to the new domain. So I added an additional line:
if (Request.Url.ToString().Contains(“domain you don’t want anymore”))
{
Response.Status = “301 Moved Permanently”;
Response.AddHeader(“Location”, Request.Url.ToString().Replace(“domain you don’t want anymore”, “new domain”));
Response.Redirect(Request.Url.ToString().Replace(“domain you don’t want anymore”, “new domain”));
}
And all is well for now…
Tags: Cosmos · Design
But they write very entertaining, intriguing books. “The Game” is one of those. It will disgust you by revealing a dark, seedy side of men–that which responds to sexual failure and social shunning with an array of clever but misogynist techniques designed to lure women into bed with them by making them want to want it. The book will disappoint you by giving examples of how that seedy side of men works on some women. And it will also make you reflect on your own behavior in what the pick-up artists (PUAs) in the book call “target-rich environments.”
I was fascinated while reading to find that I naturally did a lot of the same things that the PUAs did, though without the same nefarious purpose. When I meet a group of new people, I pay attention to an entire group (not just the most attractive girl). I do so because I’ve found that everyone has value; the PUAs do so to make the pretty girl comfortable and wonder why he’s not paying more attention to her. I like to discuss interesting topics (usually a fascinating pop psychology book I’m reading–”The Game” is a great conversation starter by the way). I do it because it’s more interesting than talking about how drunk you were the previous night; the PUAs do it because it “demonstrates value.” I also conduct quick psychology experiments on people to tell them things about them they might not have already known because it’s fascinating. PUAs conduct silly magic tricks in order to fool the girl into being impressed.
So, I can attest to the validity of the techniques and if I was a depraved reprobate, I’m sure I could attest to the efficacy of them as well in the resultant coupling. And that’s what infuriates me the most about the ideas in this book. The sick people who use these techniques in order to trick women into sex ruin the female population for decent gentlemen. “You’re so full of s*t. Are you a player?” “No, I’m just interesting.”
And while Strauss misses the big picture (he leaves spiritual out of the types of attraction), he does acknowledge the ultimate downfall of a mentality designed to manipulate people into affection. It doesn’t work and people end up going crazy. There are excellent techniques in the book to help people become more socially valuable, but if they’re used for the wrong reasons, they will only enlarge the moral cavity that underlies the facade.
Tags: Literature

“From Bailouts to Beer Summits” skewers the President using his own words
Two longtime friends spent hundreds of hours reading virtually every word that President Barack Obama ever has written, watching scores of his YouTube videos, and fighting over which Joe Biden gaffes transcend mere hilarity and rise to the realm of true legend. Now Mike Paranzino and Mike Dunnigan have just released the product of their research: a 2012 daily desktop calendar called “From Bailouts to Beer Summits: This Day in Obama History.”
The calendar chronicles hundreds of Obama milestones, from his promise to spread Joe the Plumber’s wealth around, to his gift to the Queen of England of an iPod pre-loaded with his own speeches . . . from his signature diplomatic achievement – the Beer Summit – to his dismissal of small-town Americans as bitter gun-toters and religion-clingers.
The authors expect their calendar to appeal especially to conservatives, Tea Party members, and independents. However, they’re not writing off liberals entirely. “If they have a sense of humor,” Paranzino says, “we think that even a few liberals will laugh nervously under their breath.” Dunnigan agrees, “The First Lady famously called America ‘downright mean.’ We don’t think that our calendar is mean, but it’s definitely for people who have a wicked sense of humor.”
The calendar is available exclusively through Amazon.com at this link: www.TheObamaCalendar.com. A Kindle version also is available.
Paranzino and Dunnigan formerly practiced law together in Arizona. Paranzino now lives in Maryland, and Dunnigan lives in San Antonio, Texas.
Tags: Literature
September 12th, 2011 · No Comments
Amazon is great. It has completely revolutionized commerce, production, and even the shipping industry. But the website has been ugly and awkward for a very long time. That’s why I was glad to see the new design pop up on my PC Firefox browser today:

As you can see, they’ve only updated the top bar (supposedly to cater to the tablet generation), but it’s a welcome change. Gone are the hideous, rounded blue and orange shiney blobs that constituted buttons from the old Amazon site and in their stead we have clean hierarchy of simple buttons and dropdowns seamlessly integrated into a singular background.
Here’s the comparison that you may still be seeing on some browsers:

The new stuff is really a breath of fresh air! Check it out here: Amazon
Tags: Design
I was enjoying some success with my website, ranqit.com when, after a spike in traffic on the 4th of July, I noticed a substantial decrease in traffic shown in this graph:

I wondered if there was a lack of interest in the site. Was there a new competitor? Had Google stopped sending me search traffic?
A quick search on Google’s Webmaster Tools showed that search traffic was consistent throughout the slump, so I ruled out lower clicks. Bounce rate was consistent, there were just fewer visits. What was up?
One thing I noticed was that my site was taking considerably longer to load each page. Using a webpage speed test analysis tool (free), I was able to determine that it took over 20 seconds to load each page and most of that time was the .Net engine hitting the database and building the page (what they call “Time to first byte”) so the user doesn’t even see anything on their browser. This was clearly unacceptable, so I looked for a solution.
What I came up with was page caching or the ASP tag OutputCache. This setting stores the output from the .Net engine for the page in a cache so that it doesn’t have to recreate the page every time a user views it. This is fine because, while the site is dynamic and user-driven, most of the pageviews are from people just looking to view content, not change content.
But Ranqit uses one URL for many different content pages with a query string. I was able to get around this by utilizing the “VaryByParam” parameter in the code so that the engine considers every page with a unique set of parameters a different page. So that:
http://ranqit.com/Ranqings/Default.aspx?currentRanqing=logos
and
http://ranqit.com/Ranqings/Default.aspx?currentRanqing=facebook status messages
are cached separately.
Here’s the code (placed above the ASP:Content tag:
<%@ OutputCache Duration=”165000″ VaryByParam=”*” Location=”Server” %>
But I still wanted the page to refresh every time a user did change something, so I forced refresh of the page using:
string cachedURL = “/Ranqings/Default.aspx”;
HttpResponse.RemoveOutputCacheItem(cachedURL);
The result is a perfectly functioning site without an obnoxious wait time. Revisiting the analysis tool showed that the “Time before first byte” was cut to nearly zero after this implementation. Woo hoo! And, traffic resumed, showing a marked increase after implementation (early August):

Tags: Design