• Home
  • About George
  • Contact Me
Blue Orange Green Pink Purple

Archive for April, 2009

You can use the search form below to go through the content and find a specific post or page:

Apr 23

Design Considerations

So a few days ago a friend sent me this link from A List Apart that I found very useful In Defense of Eye Candy.  I found it a good read, and right on point.  There’s a lot to think about when it comes to good design.  I mean, when do we every see a bad looking site – aside from the original Plenty of Fish see this old version from the Internet Archive.  It worked because it was free.  Sometimes that helps out.  But I’m a developer – I can understand what the guy who designed Plenty of Fish was thinking.  Let’s get it working and take it from there.

To tie into this, I was recently reminded of an article I’d read quite some time ago when Hal Helms twitted about a design for developers article he’d come across.  It’s got some really good points in it.  Reset your styles so you’re forced to do things for yourself – which removes some of the unpredictability.  Set some line-height, etc.  I really enjoyed reading through it again.  I highly recommend it if you’re a developer and don’t know for sure what you’re doing when it comes to design.  My favorite point from the article by Stefano’s Linotype is when it mentions that most developers can look at two different designs and tell you which one is better.  We generally just don’t know how to do it for ourselves.

On a related note – if you’re as design challenged as I normally am, I recommend looking at templates to get an idea of what designers think looks good.  And then if you’re really feeling like taking the easy route – use the Skins from the YUI for your site.  Will give you some basic style without having to worry about what you’re truly doing.   They also have a reset stylesheet and a base stylesheet if you’re interested.

Apr 20

YUI Loader – “other is undefined”

So today I was getting the nice cryptic message of “other is undefined” when I was trying to call loader.require on an object.  Once I dug through my code I was trying to replicate from another section of the site, I realized that the details behind this was leaving out the loader.addModule section of code.  So if you come across this, take a look through your addModule sections to make sure you have all of the pieces you’re trying to add onto the code!

Apr 20

Replacement for JavaScript Split

So the other day I was working on some JavaScript processing and it was working great in Firefox.  When I went to use it in IE7 it didn’t do a darn thing right.  I couldn’t figure out what was going on until somewhere I read that the Split function wasn’t the same in all browsers.  That was one of those WTF moments for me, but after some digging I came across a script by Steve Levithan that really does the job well.  Since that site is currently down, I’m including a copy of the file here for people: NewSplit.js.  If you want to simply view and copy, here it is as well:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/*
Cross-Browser Split 0.3
By Steven Levithan &lt;<a href="http://stevenlevithan.com">http://stevenlevithan.com</a>&gt;
MIT license
Provides a consistent cross-browser, ECMA-262 v3 compliant split method
*/
 
String.prototype._$$split = String.prototype._$$split || String.prototype.split;
 
String.prototype.split = function (s /* separator */, limit) {
// if separator is not a regex, use the native split method
if (!(s instanceof RegExp)) {
return String.prototype._$$split.apply(this, arguments);
}
 
varflags = (s.global ? "g" : "") + (s.ignoreCase ? "i" : "") + (s.multiline ? "m" : ""),
s2 = new RegExp("^" + s.source + "$", flags),
output = [],
origLastIndex = s.lastIndex,
lastLastIndex = 0,
i = 0, match, lastLength;</code>
 
/* behavior for limit: if it's...
- undefined: no limit
- NaN or zero: return an empty array
- a positive number: use limit after dropping any decimal
- a negative number: no limit
- other: type-convert, then use the above rules
 
*/
if (limit === undefined || +limit &lt; 0) {
limit = false;
} else {
limit = Math.floor(+limit);
if (!limit)
return [];
}
 
if (s.global)
s.lastIndex = 0;
else
s = new RegExp(s.source, "g" + flags);
 
while ((!limit || i++ &lt;= limit) &amp;&amp; (match = s.exec(this))) {
var emptyMatch = !match[0].length;
 
// Fix IE's infinite-loop-resistant but incorrect lastIndex
if (emptyMatch &amp;&amp; s.lastIndex &gt; match.index)
s.lastIndex--;
 
if (s.lastIndex &gt; lastLastIndex) {
// Fix browsers whose exec methods don't consistently return undefined for non-participating capturing groups
if (match.length &gt; 1) {
match[0].replace(s2, function () {
for (var j = 1; j &lt; arguments.length - 2; j++) {
if (arguments[j] === undefined)
match[j] = undefined;
}
});
}
 
output = output.concat(this.slice(lastLastIndex, match.index));
if (1 &lt; match.length &amp;&amp; match.index &lt; this.length)
output = output.concat(match.slice(1));
lastLength = match[0].length; // only needed if s.lastIndex === this.length
lastLastIndex = s.lastIndex;
}
 
if (emptyMatch)
s.lastIndex++; // avoid an infinite loop
}
 
// since this uses test(), output must be generated before restoring lastIndex
output = lastLastIndex === this.length ?
(s.test("") &amp;&amp; !lastLength ? output : output.concat("")) :
(limit ? output : output.concat(this.slice(lastLastIndex)));
s.lastIndex = origLastIndex; // only needed if s.global, else we're working with a copy of the regex
 
return output;
};
Apr 18

OO Form Processing

Read a few interesting posts recently about Object Oriented Form work. Going to have to try this out myself. Here are some examples if you’re interested:

http://www.halhelms.com/blog/index.cfm/2009/4/8/Form-Processing–the-OO-Way–the-Movie

http://www.bennadel.com/blog/1557-Object-Oriented-Form-Helpers-And-Reusing-Form-Validation-On-The-Client.htm

Apr 07

Web Service Run Around

I was recently tasked by my bosses to make some changes to a web service that existed on one of our clients sites. I’m not an ASP.NET guy – but it turned out to be what it was currently written in so I wanted to give it a shot and figured it would save me time on actually getting it done. That should have been my first clue that I was way off!

So I started off by having to upgrade the .NET library – the old app was written on version 1 something of .NET and the free Visual Web Developer forced it into an upgrade in order for me to even look at the code. I had tried using Eclipse first but that just have any way to compile out the ASP code. So after upgrading, we went through some hoops getting the server upgraded and also one crash of the IIS Server by not setting the DefaultAppPool properly. Like I said – not an ASP.NET guy!

So after that’s all compartmentalized, we start running into 401 – User Not Authorized problems. Turns out we had the server set to accept client certificates and were unable to connect through with them. Got that changed over and both the old service and the new seemed to be accepting the login scheme I copied over without a problem. When I went to run my new functionality though I just couldn’t get it to work. So I changed the name of my .asmx file from the default Service1 to NewService and went through the associated hoops trying to get everything running and compiling again. That was fun in and of itself. After uploading it, I could no longer connect when pointing to NewService. It seems that even though Service1 was in a different directory and application for ASP.NET when I was calling them – the SOAP URLs were pointing to the right places – that my calls to the app that now had NewService had been calling the Old Service1 instead.

So again I ran into the 401 Unauthorized problems. Started digging some more and there were a couple of things that I was able to finally find after much reading on the Internet. It seems that most suggest using anonymous browsing for the web service application directory. We couldn’t do that because of security requirements on the project, so we had it set to Integrated Windows Authentication under the Directory Security tab. However ColdFusion wasn’t able to talk to it then. Once I added Basic Authentication and gave it the proper domain, I was then able to connect like a champ and hit the newly created service!

So don’t forget to make sure your IIS Settings are what they should be, and then add to that the name changes. Now I just need to figure out how to create a test environment for this so that I can compile and make changes without taking down the service for the clients while they are working!

Apr 01

CFDocument Style Fixes

Okay – so I had spent a good bit of time working on a few pages that I rendered as both HTML and PDF and they worked like champs, made it through one round with the client even.  Came back the next season – this week – to prep them for the next go round, add the changed fields, clean up some other code, and wouldn’t you know it but the HTML rendered fine and the PDFs didn’t.  This threw me for a total loop.  I wasn’t sure what had happened.  I found this post – cfdocument post by rip – and thought that may be the solution, but it wasn’t working either.  I got the pages to be XHTML strict even!

Then a co-worker suggested we just copy all the CSS into the pages.  Wouldn’t you know it but putting the CSS in a style tag on the page itself rendered the items as they should be.  So to preserve reusability I snapped them inbetween the style tags with a cfinclude.  That’s my suggestion for anyone else having trouble with this kind of thing. And make sure you have the media type with print in there too for your style declaration!

Web Development By George

  • Pages
    • About George
    • Contact Me
  • Tags
    Access Ajax asp.net ColdFusion coldspring cross browser CSS Databases Design errors firefox Flash Flex html ie7 JavaScript Merge Model-Glue PCI Compliance Personal server monitor split function Subclipse Subversion tab tabview web service YUI
  • Archives
    • February 2010
    • January 2010
    • November 2009
    • October 2009
    • August 2009
    • July 2009
    • June 2009
    • May 2009
    • April 2009
    • March 2009
    • February 2009
  • Search




Add to Technorati Favorites

Bad taste download movie A dog s breakfast download movie Entropy download movie Away we go download movie Once upon a time in mexico download movie Moon 44 download movie The escapist download movie Clubbed download movie Illegal Aliens download movie I Think I Love My Wife download movie I Capture the Castle download movie Hoodwinked! download movie Hatchet download movie Ghetto download movie Fantasia/2000 download movie F/X download movie Everything You Always Wanted to Know About Sex * But Were Afraid to Ask download movie Donkey Xote download movie Day of Wrath download movie Bad taste download movie A dog s breakfast download movie Entropy download movie Away we go download movie Once upon a time in mexico download movie Moon 44 download movie The escapist download movie Clubbed download movie
  • Home
  • About George
  • Contact Me

© Copyright Web Development By George. All rights reserved.
Designed by FTL Wordpress Themes brought to you by Smashing Magazine

Back to Top