Thursday, December 04, 2008

LinkRotatr - Show Random Links on your Site

I needed a way to show random links on any web page on any of the sites I own. I'd been manually updating them as I created new sites or got rid of old ones, but it was tedious. SO being the good little robot developer I am, I decided to build a web app. LinkRotatr.com was thus born.

  • Create an account (free)
  • Add your anchor text and URLs (25 links for free, $12 a year for unlimited)
  • Set if you want the links to be rel=nofollow
  • Set 2 variables (# of links to show and the HTML you want before the text)
  • Put the correct snippet of code on the web page you want the links to appear on (PHP, ASP, JavaScript (for HTML pages), or .NET)

Now every time that page load, it will pull random links from your LinkRotatr account and display them on the page. If the page is not a static HTML page, then the links will be visible to search engine spiders.

There are a couple of things you could do with this:

  1. Sell links: if you have a popular site, you can sell links, add the links to LinkRotatr with the rel=nofollow, then put the script to show the links randomly on your page
  2. If you have a bunch of sites this is an easy way to interlink them
  3. If you have a fairly large list of favorite sites, you could use this to generate random links for a a My Fav Links list

I'm sure there are other uses as well some people might think of.

So check it out and let me know what you think.

Thursday, August 28, 2008

The Development Lab

There's a new initiative being pushed down by the Big Heads, but first some background:

In our development shop, we each have our own development box. All the developers have local admin so they can install software and do other things developers need to do in order to be able to develop. The development machines are on the Intranet, as are our test servers, both web and database. Some of the applications we develop depend on connecting to existing applications for their data sources.

We develop, test, and deploy sandbox installs on our development servers for customers to review, repeating this processes as best we are able until we're done with whatever it is we're building.

The completed (and development tested) application then goes to Test and Integration, were the eventual users perform their test cases (which the developers wrote BTW) and the network guys make sure it will integrate into "production", i.e., that it won't screw up anything already out there.

Once they rubber stamp, it goes to Configuration Management, who versions it and then releases it to production, who installs it on the "live" Intranet.

Barring the typical development stupidity and ignorance one runs into almost anywhere, this process (eventually) works well enough for us to complete applications and get them deployed and in use.

Well now someone has decided it's a "risk" to do development on machines that are connected to the "live" Intranet. The proposed solution is an isolated Development Lab, where there's a single development "server" upon which each developer has his or her virtual machine set up to develop on. The developers will have admin permissions be able to install/uninstall software and changing settings just like now on his or her VM. There's a single development database server we are all supposed to use.

So far, no adequate answer to my questions:

How are we supposed to connect to existing web services on the Intranet if the app we're building requires it? This is the biggest concern, as many of the apps we build connect to existing services for data. The floated solution so far is to buy additional servers and stand up copies of the production systems in the lab environment that we then develop against. Brother, I'm here to tell you I can's get $3 for a ream of paper, and now they're are going to buy servers for standing up production copies? I wonder what the vendors of these systems will think of us running additional instances of their software?

How are geographically separated customers supposed to review milestone installs of work in progress? Right now, customers can log into the Intranet from anywhere and view apps in progress. In the Big Heads' Dev Lab, they won't be able to do that, so customers will have to physically travel to the Dev Lab to view.

Lastly, and this sort of ties in with the whole $3 ream of paper thing, we've been given a VM to do "proof of concept" against. We're supposed to set it up with a baseline install of all the stuff a developer needs. The VM they gave us has 18 gig disk space. Visual Studio 2005 needs 6 gig right from the git-go. VS 2008 needs even more. Plus whatever apps we're working on. Plus helper apps like Infragistics. And SQL Server Developers edition. And the OS. And, and, and... We need 80 gigs I told them. Sorry, don't have the resources. So you gong to stand up dupe servers of all the apps we develop against, but you can buy some more disks so the developers can have enough space to set up their dev environments? Yeah, that'll fly.

Anyway, just needed to vent. Processes, over time, are supposed to get simpler and more streamlined. Why is that software development always seems to go in the other direction and become more complicated?

Thursday, August 14, 2008

Customers Don't Care

The development shop I lead is firmly shackled to Microsoft. We write applications using .Net, mostly in C# (occasionally in VB) on the .Net 2.0 framework with Visual Studio 2005 as our IDE. Our apps are hosted on Windows Server 2003 boxes, and our backend is SQL Server 2000.

Most programmers have a language of choice, along with the tendency to denigrate the languages they didn't choose. It's no secret that certain languages are better at certain things, but mostly people tend to stick with what they know. That's why I still write some ASP after all these years.

We have a running joke around the office. Web development is easy, all you're doing is putting stuff into a database and getting stuff out. Put data in, get data out. In, out. Easy-peasy. Cake.

The company I work for went through a big push about 4 years ago to move to .Net, but when asked why, one got the typically weasel-like management answers:
  • That's the way the industry is moving
  • It's more powerful
  • It's faster
  • It's easier
  • More value added
  • We have a Microsoft Enterprise license and we need to get our money's worth
At least the last is honest.... The rest came from.... well, I don't know where they came from. But the people announcing these declarations were probably the least qualified to voice a technical opinion.

Shortly after management announced all new development had to be done in .Net, they also decided some of the 'critical' applications should be redone in .Net as well. I fought that, because, well, it was stupid. But mostly I lost. So we spent a good amount of time rebuilding things in .Net that did something a previous applications not in .Net did perfectly fine. Which pretty much boiled down to putting stuff into a database and getting stuff out.

While everyone associated with application development has an opinion on which language to use, guess what? The customer couldn't care less. Oh, there are some customers who want you to use the latest and greatest so they can brag to their competition that they are using the latest and greatest (or most obscure, or most complex, or most [whatever]), but mostly, when it comes to web application development, the customer just doesn't care what language you code in.

They want:
  • certain information
  • to appear on certain web pages
  • in response to certain actions
Beyond that (and how much it costs and how long it takes) they don't care. The last thing they're going to notice is the extension on the file getting loaded into the browser.

Monday, July 28, 2008

War on drugs

The occasional glass of merlot is about as far as I dip into drug use, but I'm intelligent to recognize when something doesn't work, and to perceive the cause and effect cycle that seeds drug related criminal activity.

There's no doubt that the US is in a drug use epidemic, yet upon closer examination, the majority of drug users are non-violent. Despite more and more draconian drug laws, the US still has one of the highest incidents of drug use in the world.

Drug use is not a criminal problem, it is a social and addiction problem. Locking up non-violent drug offenders with violent criminals and not giving them treatment for their drug addiction isn't going to do anything except turn some of them into violent criminals with a drug problem.

Which brings us to the root of drug-related crime. Ultimately, it's a vicious circle. The more laws there are, and the more the police try to enforce the law, the worse a problem drug related crime becomes. But why?

Simple. As more law enforcement effort is focused toward prohibiting something, the more profitable that something becomes.

Ultimately, the only reason drug crime (and other 'vice' crimes such as prostitution and gambling) exist is because of government prohibitions. A free market in drugs would reduce the level of profitability to a point where it would not longer enable criminals to reap huge rewards.

The best way — really the only way — to end drug crime is to end the prohibitions against them. Once drugs are legal, they will no longer provide the huge profit they now do and related criminal activity will dissolve. Drugs can be regulated and taxed. Drug use and users can be tracked through registration and distribution programs. Ninety percent of crime would disappear overnight.

But that's not what our government does. Instead, it continues to fight a war it can't win. The very effort to prevent drug sales and use drives them underground, thereby guaranteeing enormous profits to those willing to take the risk to be part of the market. The riches are then used to bribe public officials and gain a certain amount of protection from the public sector. And that doesn't include the money spent on drug enforcement, which is a business unto itself.

This cycle is doomed to continue indefinitely until our leaders wake up and admit they are wrong and do something to change policy.

Friday, July 25, 2008

Found Some Cool T-Shirts


I'm not a raging liberal, but I'm certainly no fan of Bush and the administration that's driven this country into the ground over the last 8 years. If pressed, I'd profess to be a humanist. The short version: I believe there's enough for everybody, violence and hate are counter-productive and demean those who perpetrate it, we should be better care-takers of our planet, and we worry to much about stuff and not enough about each other.

So I'm poking around the web the other day, as I am wont to do, and I found some T-Shirts in CafePress store that express a lot of the values I hold. The store is called ClosingTagTees, and whomever created it found a unique way to present a variety of social statements; using code syntax.

Take for example </mccain>, which, as anyone who's ever written code knows, means 'end mccain'. I thought it a pretty succinct way of expressing one's opinion. Given my chosen profession, it stuck a particular affinity in me and I thought it quite clever.

CafePress prices, IMO, are a bit high, but I'm going to pick up </mccain> and maybe one or two others, like </hate> and </war>. is too trite....

Maybe one day the opinions expressed by these shirts will actually be realty, though given human history and nature, I doubt it.

Wednesday, July 09, 2008

JavaScript - Close Window and Refresh Parent

I've run into this scenario more than once: I have a button or link that spawns a new window, usually a window with some sort of form in it, like a rating or comment. After the user make his or her rating or comment and submits it, I want the new window to close ad the window underneath to refresh to show the new rating or comment. So here's a JavaScript that will close a new window and also refresh the parent window.

The function:
<script language="JavaScript" type="text/javascript">
function CloseAndRefresh()
{
opener.location.reload(true);
self.close();
}
</script>
You can call the function a couple of ways. You can use a link:
<a href="#" onClick="CloseAndRefresh(); return:false;">Close</a>
Or a button:
< input type="button" value="close" onClick="CloseAndRefresh();"
Or you can make it part of the submit:
<input type="submit" value="submit" onClick="CloseAndRefresh(); return:true;"

JavaScript Open New Window

Here's the JavaScript I use when I want to spawn a new window:

Using a button:
<input value="submit" 
onclick="javascript:window.open
('NewPage.html', 'WindowName',
'width=450, height=350, top=100, left=100, toolbar=0,
menubar=0,location=0,status=0,scrollbars=0,resizable=0');"
type="button">
Using a link:
<a href="#"
onclick="javascript:window.open
('NewPage.html','WindowName',
'width=450, height=350, top=100, left=100,
toolbar=0, menubar=0, location=0, status=0, scrollbars=0, resizable=0');
return:false;">New Window</a>
The return:false; at the end keeps the link click from completing, so you can use a # as the link destination.

New Stuff

Didn't do much for a while there after converting SFReader to the DoNetNuke platform. It's been stable for a couple of months now. I had some problems with SQL injection, but was unable to identify the source. Ultimately I ended up writing a scrubber script that I call every few minutes.

The SQL injection problem was an epidemic. Many of my sites ended up getting attacked and I saw posts all over the web about similar injection attacks happening all over the place. I had to take a couple of days and go through my site, making sure I was checking querystring and form values, stripping out/replacing the single quote and performing the IsNumeric check to make sure values were valid. Since I did, I've suffered no more injections.

I've got two new sites up"

TagaSite.net - I've been having fun with tag clouds recently so I built a free web directory that replied on a tag cloud instead of the normal category selection almost all other directories rely on.

Nollij.net - The name (pronounced 'knowledge') comes from Calvin and Hobbes. Nollij is a directory of freebies on the Internet: free samples, free trials, special savings and other unique offers. Another tag on my using a tag cloud classification system.

Check them out, let me know what you think.....

Thursday, May 29, 2008

Update After Long Time, No Post

I haven't been doing anything new in terms of programming, either in ASP or otherwise, hence the lack of posts.

My biggest project has been migrating SFReader to the DotNetNuke platform.

SFReader was the first site I ever did, and the site I used to teach myself ASP. It's been online for 7 years and has become pretty popular in the speculative fiction community. As members have asked for things, I've sort of tacked them in in a haphazard way: forum, member pages, chat.... what I wanted was a full-fledged CMS/portal systems that could give me all the goodies popular community site have these days. And I didn't want to pay much (if anything) for it. SFReader might be seeing 3,000+ visitors a day, but it oftentimes doesn't even make enough to pay for its hosting!

So I tried Joomla (hated it), Drupal (hated it), Wordpress (not powerful for a portal , great for a blog), and ended up at DotNetNuke.

DNN has been around a while. I remember, faintly, tinkering with it, but it was took complex to get going. Or I was too lazy. IN any case, I was reading good things about 4.8, so I downloaded it and set up a test site on my server.

Install and set up could have been easier. If about 20 minutes I had a base install DNN portal set up and running. I played with it for a few days, then decided I'd use it for SFReader.

Install and set up was again cake. I did have to buy some custom modules to do everything I needed SFReader to do, mainly interface with the existing review database and easily display articles and interviews. It took me quite a couple of weeks to get all the content ported over and to custom write some T-SQL stored procedures to work with the reporting module I'd had to buy.

I officially announced the new site as live about two weeks ago, and except for a few minor hiccups, it's been smooth sailing.

So now SFReader is on an enterprise class CMS/portal management system. Hopefully the new features will promote even more growth in the site and the enjoyment of the community..

Wednesday, February 27, 2008

Life Code

I was working out in the gym today with a buddy and were were having fun making up some pseudo code for live. It obviously doesn't cover all the variables, but you get the idea.
<%
On Session Start Call LifeCode

SUB LifeCode
dim dbConn, strSQL, rs

Set dbConn = Server.CreateObject("ADODB.Connection")
dbConn.open "PROVIDER=SQLOLEDB;DATA SOURCE=YourLife;UID=YourName;PWD=YourName!;DATABASE=YourLife"

strSQL = "SELECT *, SUM(col_Money) as NetWorth from tab_Life GROUP BY col_Money WHERE col_DateToday = "&DATE()&""
set rs = dbConn.Execute(strSQL)

'run below code every day
If Not rs.EOF Then
If rs("NetWorth") > "2000000" then
response.write("Congrats! Stop working and go enjoy yourself!")
Else
If INT(DATE() - rs("col_DateOfBirth")/365) >= 65 then
response.write("Collect Social Security live in a trailer with cats.")
Else
response.write("Get your lazy ass out of bed and go to work.")
End If
End If
Else
response.write("You're Dead")
End If
End Sub
%>

Tuesday, February 19, 2008

RetroWebDev Update

Even though I've been remiss in adding to my RetroWebDev blog, I haven't been resting on my laurels.

On other project fronts:

Bloggertizer (keyword phrase: advertise on blogs) now has 550+ blogs listed. If you are looking to hie a blogger to write a customer post, or want to get links on blogs, check out Bloggertizer. Totally free for both the blogger and advertiser.

Tuesday, February 05, 2008

GoDaddy Coupon Codes and Updates

I haven't been up to much (at least nothing worth blogging about), hence the infrequent updates to this blog. Just because I haven't learned anything interesting doesn't mean I'm not pecking away at a few smaller projects, and it seems like I'm always buying a domain name or two. So I thought I'd post the GoDaddy coupon codes I use. They were all working as of this morning:
chill1 - save 10% on any order
chill2 - save $5 on any order of $30 or more
chill3 - register a new .com domain name for $6.95 a year
Just type your code of choice in the code box when you check out to get your savings.

Bloggertizer is going strong (keyword link: Blog Advertising). There are over 500 blogs registered now and people are using the service. So far, nothing but happy customers.

Friday, January 04, 2008

Make a DIV Transparent

Yes, yet another site: Memories and Music. I can't take credit for developing the platform for this one though. I wanted a strong and flexible blog/CMS solution, so I went with a hosted WordPress setup.

I picked a pre-made template, but had to do some extensive CSS editing to get it to look the way I wanted. One of the things it had was a semi-transparent png image as the background in both the left and right sections. I guess there's some deal gere with Internet Explorer 6, because in IE 6 the images weren't transparent. Too bad, because one of the cool effects was being able to see the image through the two content layers.

So I dug around a little and uncovered how to make layers (DIV or SPAN sections) semi-transparent. There's a method for IE 6 and one for FireFox adn (I'm assuming) other browsers.

Your div:
<div id="TheDiv:></div>
Put these in the style declarations IE 6:
#TheDiv {filter:alpha(opacity=60);}
The opacity runs on a scale of 0 - 100, so 60 percent - 60% opaque.

For FireFox:
#TheDiv {-moz-opacity: 0.6;opacity: 0.6;}
In this case, the opacity runs from 0.0 to 1.0, so a .6 corresponds to 60%.

At Memories and Music, I ended up removing the background png images, setting the background-color to white and using an opacity setting of 90%. So I was able to keep the cool semi-transparency effect in both browsers.