Wednesday, November 30, 2005

CSS CODE

Since I am posting code today I will post one more piece of code. This is a bit of CSS I have used to make a 3X3 grid using only divs with no tables. I am a CSS zealot and I love to build without tables. I am working on incorporating this into the current sites I work on and since its so simple I thought I would share it with everyone. The way it works is I build a container div for my products I think of it as a self contained code block in that container I build a few other divs to help control the flow of the piece. Once that piece is finished I dump them into a larger container div that holds all of my product blocks. The width of each product block is set and the width of the container div is also set. In this example you would to have to set the width of the container if you wanted a liquid layout this would allow you to have products fill up the width of the users browser. Since my layout is not as liquid as it could be I have set the width to be wide enough to display only 3 product blocks across. Once there are three blocks in the container the float property causes the boxes to float down to the next line. This is an easy solution and I am sure I will use it n many places. I only put one product block in the code in this post but you can look at the live copy and see it with more.


<style type="text/css"
media="screen">
.prodContainer { width: 560px; }
.prodBox { width: 180px; float: left; }
.smallHero { text-align: center; }
.smallDetail { }
.buyButton { width: 89px; height: 23px; float: left; text-align: center;
padding-top: 4px; }
.prodInfo { float: right; font-family: Arial, Verdana, Helvetica; font-size:
11px; width: 89px; padding-top: 2px; }

</style>


</head>


<body>


<h1>Body Content here</h1>


<div class="prodContainer">


<div


class="prodBox">


<div class="smallHero">


<img src="prod.jpg" alt="" />


</div>


<div class="smallDetail">


<span class="buyButton">


<img src="buy.gif" alt="" />


</span>


<span class="prodInfo">


$55.00 - [TF76-1]<br />Fresh Fall Magic


</span>


</div>


</div>


</div>


</body>


</html>

301 redirect with asp.net

Something simple and very common with most SEO projects is the 301 redirect. In the past a company would buy as many domains as they could and point them all to the same site. This gave them better odds of being found as well as making sure someone didn’t get a similar domain name and ranking well for your company. Then the search engines got wise to this trick and started knocking people down in the rankings for duplicate content. There were now two options, release the extra domain names or do a redirect to the one domain name you wanted as your main one. There are two types of domain names one is a 301 redirect and one is a 302 redirect. The 302 is used for moving a resource temporarily it sort of says “hi im over here now but I will be back sometime in the future” this causes the search engines to keep the original url in the index. The other type of redirect is a 301 this says “I am no longer at that address I am now at this new address so don’t look there for me any more” this is the main way you tell search engines you want to have many domain names pointing to one site but only have the content indexed under one of the names. In the linix world and the classic asp world this is very easy. You can just change the .httaccess file. It is also easy on windows 2k3 if you have direct access to the server and are not running in a cluster environment. The sad part of my life is I live n a world where developers do not touch the production boxes and network ops does not make changes to IIS for us on the production boxes for something as trivial in there mind as a 301 redirect. So I had to solve it in code. The basic part of this is simple you just simple need to put in

Response.Status = "301 Moved Permanently";
Response.AddHeader("Location","http://www.redirectdemo.com" + urlPath());

And you are done. In a perfect world this would be all you needed (in a truly perfect world I would have access to a .httaccess file). But I am also running in three different environments also I want to keep the original path typed in by the user so they don’t just end up back at the home page and have to start over. So this is what I built. First I find there requested path and check to make sure there not requesting the default.aspx file (sometimes google will index the root and the default.* file as different pages). If it is default then I set urlPath to “” if not I set urlPath to the requested url. I then check the domain and make sure it isn’t any of the domain names I want to allow at the step I have to include the domain name I want them to land on if not it will stick in a loop of constantly sending the user back to the original domain name. I built this into a switch just because I don’t feel there will ever be more then a few domains I don’t want to redirect on. If this list was going to be large or if I was going to redirect different domains to different places I would put this into an array. This is all built into a user control so I can simply add it to every page on the site and if I ever want to add a domain name to this I simple have to update the user control and it updates everything at once. This is the first piece of code I have ever released to the public but if this helps anyone please feel free to use it all you want. Also if you do use it or find it useful please let me know.

The full code listing



namespace redirectDemo.controls
{
using System;
using System.Web;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
///
/// redirect usercontrol. this will redirect all production domains to http://www.redirectdemo.com
///

public class redirect : System.Web.UI.UserControl
{
private void Page_Load(object sender, System.EventArgs e)
{
checkDomain();
}
public string urlPath()
{
string redirectPath;
redirectPath = HttpContext.Current.Request.RawUrl.ToString();
if (redirectPath == "/default.aspx")
{
redirectPath = "";
}
return redirectPath;
}
private void checkDomain()
{
switch (Application["domain"].ToString())
{
case "localhost":
case "site.dev.server":
case "site.stag.serv":
case "www.redirectdemo.com":
break;
default:
Response.Status = "301 Moved Permanently";
Response.AddHeader("Location","http://www.redirectdemo.com" + urlPath());
break;
}
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}

///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///

private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
}
}

Monday, November 21, 2005

I've got to slip it up before the rush gets gone.

I built a KICK ASS BOX about 3 years ago for my home machine. I have then upgraded every piece in it to the max the system will take other then the CPU’s which I had upgraded once but blew out and had to go back to the old ones. Now I want to make one last upgrade to a new set of 2800 procs then let it stay there for the rest of its life. It has 2gb of ram which I could max out at 4 but I would have to pull out the current 2 and replace it all which I don’t want to do. But now that I am looking at a new box I have to really decide if I want to go mobile or keep the desktop. I have not found any good reason to go with a desktop. I can have the power I need on the mobile platform and also not have to worry about the things like upgrades and being tied to the desk. But it feels strange this will be the first big box I have bought for myself that I didn’t spec out and then put together. I must be getting old I am in a phase of my life where I want to worry about my piece of things and let others worry about the rest.

Wednesday, November 16, 2005

Marketing

Lets see if I can get through a diatribe about marketing with out using anything that would be considered profane. I have done sales at almost every level and I understand the need of sales and marketing. I have a firm belief that with out marketing there would not be the internet that there is today. It ids driven by ad revenue. Now that isn’t to say that every aspect of the business is driven directly by ad revenue but the internet as a whole is all driven by ads. Take my position for example I work on natural SEO. That means that I don’t work with ads at all, but I still depend on ads for my job to work. If it were not for the revenue that google generates from its ads they would not provide all the great new features they offer and the standard internet price for wizbang ($0.00). if google didn’t provide the features they provide then less people would use there service. If less people used there service then that would be less people looking there for what I sell. Less people looking means less people buying. So I would be useless or my job would be less important and would get rolled up into someone else’s job duties. So I am thankful for ads and marketing but at the same time I have to say that I hate being inundated with ads everywhere I turn. I got a marketing call yesterday on my cell. I asked them to call me back later (I know that was stupid but I wasn’t sure it was a marketing call for crap or some of the internet ,marketing firms I have talking to the last few weeks). This morning I got the same people calling but I was still busy so I didn’t answer. Within 30 minutes I got 4 calls from the same firm! What is that now it might just be me but as my wife tells my son from time to time if you pester me I don’t even think about it before I say NO! and I find that most people are the same way even if its to a lesser extent then myself. So how did this person think that I would decide to answer and be in a receptive mood? Well on the last call I answered and the same person that had called me yesterday starts belting out the same crap sales pitch (see that I had a good spot to through in the word ass and I refrained from it) that they had used the day before. They went through it word for word. Then when it came to the question and answer phase they tried to use leading questions but I have been through this and have lead many a sheep through this same trap so I was a little stubborn and forced them to lead. At that point they failed which to me says they don’t know more then the simple script that they are handed. And that makes me madder then anything else. What is it that makes people think that anything can be watered down to its base elements and then accomplished by anyone. Sales isn’t following a script. I doubnt this person has ever heard of Zig Ziglar he is the god of true sales people. But someone thought they could give any random person off the street a cue card and a dialer and they would be good to go. They might get sales and this person might be happy with there commission but think about what could be gained with a little investment in training and good people. Think about all the thought that goes into a large ad campaign and then think about how small the portion of that you spend on getting the right people to do it for you. You see it everywhere like the guys with the sandwich boards I know everyone has seen the guy out there making an ass of himself and thinking something like “that fool” but what you may have missed is that you saw him and you saw his ad now think about the guy that was just standing there you didn’t notice him for that long and you definitely didn’t notice his message. That’s the difference between being a shmo doing a schtict and a professional doing your craft. I don’t sell anymore because I don’t have the heart to do that with the energy that it takes so rather then do it half way I do something else I can do full tilt and win at.

Tuesday, November 15, 2005

more on Google Analytics

I have looked more and more at the analytics from google. I have seen some people that think it’s a bad idea to allow google to know what your making. And it might be but for a small non ecommerce site on an ecommerce site that doesn’t depend on large adsense campaigns to survive I don’t see the problem. It is collecting stats about my visitors which it has other ways of doing already. That is why I don’t use gMail even I have an account (something like thewookie@gmail.com) but I never use it for anything I don’t even know the password anymore its just a dead account.

Back to the day job.

Monday, November 14, 2005

What I want to be when I grow up

When I grow up I want to be a 12 year old. And stay there. 12 was the perfect age.
By 12 I had learned
  • how to read comics
  • how to buy them without my parents being in the store at the time
  • how to use the vcr and tape player (I feel old when spell check knows dvd but not vcr)
  • how to drive (not that I was allowed to do so on the road)
  • and why girls look different and how that’s a good thing
And by 12 I had not truly learned
  • to hurt so bad that you thought your heart would burst
  • how to be afraid of what someone else might think
  • moderation
  • how to function with enough alcohol in my blood that I should be dead
  • how to worry
  • and why girls look different and how that’s a good thing (I don’t know if you ever know if you know this and that’s why its fun)

Along with this I will list the things I have learned from someone who is not yet 12 (my son)
  • that there is someone more important then me
  • how to worry
  • who to look at the world again for the first time and be amazed by how it looks
  • there are really only two food groups that importantiant
    • MAC
    • cheese
  • when I was a kid and my mom said a hug would make it better it helped her as much as it helped me
  • you carry the memory of every rotten thing you did to your parents when you were young in your genes so that your children are born with knowledgeadge to BRING YOU DOWN when ever the time is JUST RIGHT

Google analytics

I have used omniture at my day job. I have also looked at urchin a few months back but now google is back to its new game of giving away everything kewl for FREE. I have not yet gone through it all but it looks to be a great tool from google in place of the thousands you can pay to some people for good analytics from someone else. I will play with this more in the weeks to come and see how good it is but if the past is any indication this will be great. Google doesn’t create the best ideas but they do rebuild ideas very very well. Its like BASF google doesn’t create the things it will rule the web with they just make them better. I use all of there services except for gMail (that is a different post) and they are all great (including the gMail but again that is a different post). If they would just enter the bottle water industry and the hardware manufacturing industry then I would be set. Its time to go kick fenny off the DVR and clean it off so there is room for my stories this week.

all about flowers

I have a florist friend of mine working on posting a blog about flowers and being an online florist. It looks like this is going to be a good site in a few months as he starts to add the content pieces that he is talking about. For now I will watch and see how it goes.

Some times it just clicks

I have been working on a small bit of code for close to two weeks. Then today I started over and from the ground up wrote the code I had been working on in 2 hours. Its nothing big its just a CSS version of a table layout that I have to convert to CSS. The part I had been having trouble with was the main body of a site that displays a 3X3 grid of image. Under each image I needed a buy button and next to the buy button a price, item number, and item name. in tables I could write it in my sleep but using CSS I just couldn’t ever get it to work. Then today I walked into work and sat down. As soon as I turned on my system (if you can call it that) I thought of a simple solution. This is a demo of the Layout. a small few things and I can launch my whole new site using nto one table element. So far the estimates are that I will cut 70% off of my total page size by making the CSS switch.

Sunday, November 13, 2005

XSLT ROCKS!!!!!

I have been playing with XSLT the last few days and it’s the best thing since sliced individually wrapped cheese. The biggest benefit of XSLT is the separation of business logic and presentation logic. This means that I can build the code and then change the code as many times as I need and not worry about what happens on the presentation side. I also have the ability to do the same thing on the look and feel side of things. The hardest part of working this way is keeping my logic out of my XSLT. I keep finding myself placing logic in the middle of my layout and then going back over it nad pulling those pieces back out. Now that I have a working model I am going back through the xslt and working on ditching the tables. That is another benefit of using XSLT it will allow my pages to be more standers compliant. All of this together and I have a clean easy site that is search engine friendly to boot. Once I have it finished it hope to be able to market this code to help market my soon to be built small SEO firm. If every thing goes well I will be bringing the beauty of XSLT to the masses with my own brand of SEO.

Thursday, November 10, 2005

I get it

I remember the day I got girls. I also remember the day I got driving. I don’t remember the day I got high but there are reasons for that. But all and all there are moments when you get it and I just had one of those. I was clicking on the “next blog” button today and started finding myself drawn into some of the words on these blogs. On a few of them I posted a few comments. Then about 10 minutes ago I had to pick up an email from my wife and in my inbox there was a message saying I had a post on my blog. I was thinking kewl more spam I always did love email spam for the first few days when it was much like a new love still fresh and mysterious. But I look over the comment for a sec before I delete it and I notice it doesn’t look like spam it seems to make sense. I reread it and it dose make sense. IT’S A REALY COMMENT! FROM A REAL PERSON! It was a comment from a person whos blog I had just posted a comment on. And that was the moment I got this idea of user created content. This will change the world.

SPAM SPAM EGGS AND SPAM without the eggs

I have ignored the comment options on this blog so far. I went into the comments today and was excited to find that I had comment spam. I am both excited and disgusted at the same time. I am excited that somehow someone has found my blog worthy of spam. And I am also disgusted that somehow someone has found my blog worthy of spam. I don’t know what will ever happen to end spam but something will I am sure it is so much of a problem that it will have to be stopped by the industry or big brother will do it for us and I don’t want that. I don’t understand the profit model for spam. google has depreciated the value of crap links and really links in general and I am sure the other crawlers will do it soon also. Email spam is just as stupid if its porn how many of the sales end in charge backs and on the other types of spam how much trouble is it when they get sued.

I guess I just have to say wow. I also had to turn on comment moderation. And that sucks big donkey dick

Put away childish things

Today I made a decision to officially mothball my Little Big Toe site. It was started as a place to showcase my personal graphic design work. I have moved into web development full speed and have not touched the site more then to add a link or two in close to 3 years. I am going to leave to WIP directory as well as the OLD directory because amazingly both get a significant amount of traffic. I will do a quick redesign in the next few weeks nothing special just a little facelift and a little better set of directions on what the different links on the site are. Once I have time and energy I will start doing digital art again and at that point I will pick up little big toe again and start to post art. Its bith sad and happy all at once to make an offical statement that I am not a graphic artist but I am a developer. The sad part is that art has been such a huge part of my life for so long. Art is still something that is part of my everyday. Art is part of who I am and always will be. The happy part is that I am now embarking on a new journey of the life of a web developer. Development is a fun new world it’s a little different developing then it was designing. As a developer when I need something I can just make it where as a designer I was required to call a developer or muddle my way through it as best as me and google could. This will be fun. I think I have posted here before that I will use this as a place to talk about my trek into the land of developers and I will continue to do that as much as I have been I will also use it for everything else I have used it for in the past which is mostly just a place to type where people can see it. all in al its sort of like I am growing up somehow. how sad for me.

Tuesday, November 08, 2005

dot net data access app

So today I started on my first true .net project at my day job. It’s a small db app to allow me better and easier access to make updates to my content in production. But that is what programming is all about right? Making your life easier and faster. Its something small enough to allow me to also use it as a test bed for learning proper design and design patterns. Well fenny it looks like I will be late home the next few weeks. As long as I finish it by the December 5th when I have my next major code migration.

Saturday, November 05, 2005

I know the names of men they had to hang.

So it’s a choice do you do what’s right or do you do what’s asked of you. No this isn’t some huge moral question its just a question relating to code. Someone posed the question to me if they should spend 20+ hours writing a block of code and classes to make a project work the way it should or if they should just do a little code writing by copy and paste. I personally believe its worth the 20+ hours invested to make it right over the “git er done” bullshit you see everywhere. I hate the idea that quick is better then good just because it gets it done faster. Its midnight and I spent the whole afternoon away from my wife and son just to make my own project correct over quick and I feel very strongly that everyone should have the same type of self respect that they wouldn’t put out crap just so they can say its done. Now I am going to lose my audience by digressing into the pit of profanity. Its fucking lazy as crap like that fucking “git er done” as crap shit that makes so many products suck big donkey dick. And after that I have to say I am glad that this is no longer a company sanctioned blog. A salesman I know tells me all the time you can have it three ways good, fast, or right and you can have any 2 you want but you can never get all three at once. I feel this is true for example I am righting code on a machine that I wouldn’t give to my 6 year old son to use but I am writing .net code on it. I am also running 2 test data bases. On a machine I wouldn’t use for a small linux router its so much a stemming pile of dog shit. But its not in the budget to get a new machine. The fuckers that take calls and run a phone app can have 1g of ram and a new p4 but the guys that write the code get a huge cock right up the ass and are told its just as good. For some reason I feel a little when you piss down my back and call it rain. Now I have to ask myself why am I so mad I could just work my forty and go home what the fuck I am wasting a good 10 minutes writing this piece of terd fuck right? But I am typing this over 40 minutes between builds of my project. And I don’t do just enough to get by. I am a good contractor I believe I should work until the project is done then I should stop but not before. And the pukes that think they can work forty and go home can choke on my tiny hairy nut sack as I slave away doing what needs to be done. Now I am going to start my last build and let it process as I go home to take a nap and then start on the pieces of this that can be done disconnected from the network so I can use my 2 year PC that I thought was just enough when I bought it and now is ready to be put out of its burning fucking ass loving life. And as bad as my home pc is it burns huge fucking holes in this piece of crap I use at work. I figured one day I lose about 90 minutes a day watching my work machine spin it tires that’s about 7.5 hours a week 30 a month or 9 weeks a year watching an hour glass on heavy work day. Not every day is that bad some days I only have to close outlook 7 times to free up resources instead of 20 some days I only reboot 2 times instead of every hour. But when you look at it as a whole my ass starts to pucker in anticipation of the ass raping I plan on getting every time I try and run some large job or process.

Goodnight

Tuesday, November 01, 2005

Wal-Mart
always out to screw you
ALWAYS

I would like to start with a quote

Hey, don't be knockin' Wal*Mart. What other Corporate American titan do you know of that successfully helps its employees to take advantage of government programs such as food stamps that they qualify for?

I will say I have worked for walmat in the past and would never do it again. I refuse to shop there for anything no matter how much I need it I can always find what I need somewhere else for a reasonable price. But I will also say that they are in business to make money and to make there share holders money and more power to them for trying.

This is because I found these two posts on two new walmart movies coming out.



Not the Wal-Mart side
The Wal-Mart side


i am looking forward to seeing both of them