. Topicala Page Index Token

A Journal about the experiences I have developing little applications in C#, Perl, Html and Javascript and talking about things new things that I use. Always Geeky; Always Nerdy; Always poor Grammer!

I am a Software Analyst Developer working in Southport, England but living in Liverpool. I develop mainly in C# and ASP.Net. I have been developing comercial software for several years now. I maintain this site (hosted at SwitchMedia UK) as a way of exploring new technologies (such as AJAX) and just generally talking about techie geek issues. This site is developed through a host of Perl scripts and a liberal use of Javascript. I enjoy experimenting with new technologies and anything that I make I host here.

Quick Search

Web www.kinlan.co.uk

Friday, February 24, 2006

C# CSS Classname Regex

As promised, although a little late I have updated the Regex to get CSS classnames via C#. The problem I had was that it would find file extensions in a url specified by the "url(xyz.png)" in an attribute.

I added a little negative look behind and now it seems to work prety well:

string css = @"
.someclass
{
background: white url(someimage.png) repeat-x top left;
}
.someclass2
{
background: white url ( someimage.png) repeat-x top left;
}
";
MatchCollection arr = Regex.Matches(css, @"(?<!url\s*\(.*)(\.[-]?[_a-zA-Z][_a-zA-Z0-9-]*|[^\0-\177]*\\[0-9a-f]{1,6}(\r\n[ \n\r\t\f])?|\\[^\n\r\f0-9a-f]*)");
string class1 = arr[0].Value;
string class2 = arr[1].Value;

Technorati Tags
[feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed]

Related Wikipedia Documents
, , , , , , ,

My Related Documents
, ,

Related Amazon Books
Compressed Image File Formats: JPEG, PNG, GIF, XBM, BMP (ACM Press S.): / PNG: The Definitive Guide: / Web Designer's Guide to PNG, GIF, JPEG: / CSS Pocket Reference: / Professional CSS: Cascading Style Sheets for Web Design: / Regular Expression Pocket Reference: / Regular Expression Recipes: A Problem-Solution Approach: / Regular Expression Recipes for Windows Developers: a Problem-solution Approach: /

Related Images From Flickr

Wednesday, February 22, 2006

Not going to update the style of this site

I was thinking about it, like I said in my previous post, but I have still couldn't think of a design that I really really liked, something really simple but wouldn't make people go "ick".

Ah well, if I get time I will update the style :)

Technorati Tags
[feed], [feed], [feed], [feed]

Related Wikipedia Documents

My Related Documents
, ,

Related Amazon Books
Agile Web Development with Rails: / Head First HTML with CSS & XHTML: / Don't Make Me Think!: A Common Sense Approach to Web Usability: / Stylin' with CSS: A Designer's Guide: / The ZEN of CSS Design: Visual Enlightenment for the Web: /

Related Images From Flickr

Saturday, February 18, 2006

Coding Horror

Coding Horror [http://www.codinghorror.com/blog/] is a brilliant blog. It is the kind of blog that I like to read at the moment, it has some insighful entries and is just generally a good blog to read. I wish I could style myself around this Blog.

I might try the layout of that site in my own blog because it is very crisp and clean, my site is bloated, slow and ugly colours.

I am pretty sure people find my entries hard to read.

I know having a good looking blog doesn't make a good blog, but I think a blog that is easy to read and to follow is far better.

Anyway over the next week I will take a backup of this template and try a simpler much crisper layout.

Technorati Tags
[feed], [feed], [feed], [feed], [feed], [feed]

Related Wikipedia Documents
, , , ,

My Related Documents
, ,

Related Amazon Books
Effective STL: 50 Specific Ways to Improve the Use of the Standard Template Library (Professional Computing S.): / The STL Tutorial and Reference Guide: C++ Programming with the Standard Template Library (Professional Computing S.): / Generic Programming and the STL: Using and Extending the C++ Standard Template Library (Professional Computing S.): / Perl Template Toolkit: / MAC OS X Web Services: Using Applescript, Cocoa, Sherlock and the Webobjects Template: /

Related Images From Flickr

Thursday, February 16, 2006

Openseach and IE7 Beta 2 update

The Opensearch spec that I wrote the other day was a little inaccurate, thanks to Michael Fagan for the comment.

Nice. I look forward to the day when all blogs offer this.Btw, your
ShortName is much longer than 16 characters, the maximum, so you should be using
LongName instead.

See http://opensearch.a9.com/spec/1.1/description/#longname
. Also, while your OpenSearch Description file is correct, your display on the
blog post uses some lowercase characters when they should be in uppercase.
Somebody might get confused if they copy that and find out it doesn't
work.



I have ammended the XML so that it is more in line with the spec and includes along name. I have also added in a URL for RSS results based off Google's Blog search.

One thing it doesn't do is integrate into http://www.A9.com because the search engine is not on my domain. It is a pity really, but I can see why they do it. I could route all the search results through a proxy script but I think that would be even more unfair to Google.

Technorati Tags
[feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed]

Related Wikipedia Documents
, , , , ,

My Related Documents
, , , , ,

Related Amazon Books
The Search: How Google and Its Rivals Rewrote the Rules of Business and Transformed Our Culture: / The Google Story: / Winning Results with Google Adwords: / Building Your Business with Google for Dummies: / Beginning RSS and Atom Programming: / RSS and Atom: Understanding and Implementing Content Feeds and Syndication: / Content Syndication with RSS: / RSS and Atom Hacks: /

Wednesday, February 15, 2006

New Site Partner

This site has a partner for the while. Check out Shopzilla UK at the top right of the page if you are interested in Laptops or Price Comparisons in the UK.

Technorati Tags
[feed], [feed], [feed], [feed], [feed], [feed]

Related Wikipedia Documents
, ,

My Related Documents
, ,

Related Amazon Books
Laptops for Dummies (For Dummies S.): / Upgrading and Repairing Laptops: / Upgrading and Fixing Laptops for Dummies (For Dummies S.): / Why We Buy: The Science of Shopping: / Constructing Usable Shopping Carts: Designing and Building Great E-Commerce Applications: /

Related Images From Flickr

Google Adsense for Search and IE7 Openseach Provider

I managed to speak to the Google Adsense for Search team about using my Google Adsene Account in the SiteSearch in IE7, suffice to say I was correct in my first guess: You are not allowed to use anything but their search boxes. I think this is a bit limiting, but the person I spoke to said they would pass it to their product team for consideration.

So in summary, using IE 7's open search provider with Adsense is a no no.

Technorati Tags
[feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed]

Related Wikipedia Documents
, , , , ,

My Related Documents
, , , ,

Related Amazon Books
Make Easy Money with Google: Using the Adsense Advertising Program: / The Search: How Google and Its Rivals Rewrote the Rules of Business and Transformed Our Culture: / Winning Results with Google Adwords: / Google Pocket Guide: /

Related Images From Flickr

Google Search and IE 7 Search Provider

If you are using IE7 Beta 2 and you are looking this entry from my site you should notice that I have provided a customer search provider.

The search provider hooks up with Google search, so you can now search my site for specific text. I am not too sure if this breaks any T's & C's of Google but I will take it down if anyone complains.

This is just a showcase really to show you how easy it is to set up a custom site search provider in Internet Explorer 7 Beta 2.

There is an OpenSearch file at http://www.kinlan.co.uk/opensearch.xml which contains the following:

<opensearchdescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
<shortname>Paul Kinlans Blog: Google Search</shortname>
<description>A Google Search from Paul Kinlans C#, .Net Framework</description>
<url template="http://www.google.com/custom?q={searchTerms} &domains=www.kinlan.co.uk& sitesearch=www.kinlan.co.uk&amp;forid=1&ie=ISO-8859-1&oe=ISO-8859-1&safe=active& cof=GALT:#008000;GL:1;DIV:#336699;VLC:663399; AH:center;BGC:FFFFFF;LBGC:336699;ALC:0000FF; LC:0000FF;T:000000;GFNT:0000FF;GIMP:0000FF; FORID:1;&hl=en" type="text/html">
</opensearchdescription>

And each page has the following <link> in the section.
<link title="C#, .Net Framework: Google Search" href="http://www.kinlan.co.uk/opensearch.xml" rel="search" type="application/opensearchdescription+xml" />

Hope this helps anyone who wants to set up search providers.

Technorati Tags
[feed], [feed], [feed], [feed], [feed], [feed], [feed]

Related Wikipedia Documents
, ,

My Related Documents
, , , ,

Related Amazon Books
The Search: How Google and Its Rivals Rewrote the Rules of Business and Transformed Our Culture: / Make Easy Money with Google: Using the Adsense Advertising Program: / Google Hacks: / Google Maps Hacks: / Windows Longhorn Developer Beta Preview: /

Related Images From Flickr

Tuesday, February 14, 2006

A Quick C# Question: Sealed classes

If you have a sealed class are all the methods inside the sealed class also typed as sealed.

I am asking this because I have some virtual functions inside an abstract class that I would like to seal, I don't want the class to be extended so sealing the class makes sense. Therefore if I just seal the class can all the methods be considered sealed by the JIT'er or do I have to seal the methods too.

Technorati Tags
[feed], [feed], [feed], [feed], [feed]

Related Wikipedia Documents
, , , , , , , ,

My Related Documents
,

Related Amazon Books
Professional ASP.NET 2.0: / Programming C#: / Pro C# 2005 & the .NET 2.0 Platform: / Framework Design Guidelines: Conventions, Idioms, and Patterns for Reusable .NET Libraries: / Windows Forms Programming in C#: /

Related Images From Flickr

Monday, February 13, 2006

Rabbits

This is just a shout for one of my friends.

If you are into rabbits [i.e the animal] the check out http://nibblin.com, it is a forum for rabbit owners and enthusiasts. It has a nice comunity already.

Technorati Tags
[feed], [feed], [feed]

Related Wikipedia Documents
, , ,

My Related Documents

Related Amazon Books
Pippin and Peanut: The Adventure Begins: /

Related Images From Flickr

Internet Explorer Browser Objects in C#

Rich Crane reports that he has posted the Code to Internet Explorer Browser Modules along with some examples.

It looks like a pretty cool framework for getting .Net to interact with Internet explorer. I can't wait to have a play, and not have to worry about me handling all the COM interop etc [it is already done in this framework]. I did notice that the number of Browser Events that are available seems to be less than what IE exposes. Maybe I am wrong though.

Staying on the subject, Sky Software who produce EZShellExtensions.Net and the Shell MegaPack.Net have produced new versions of their software for developers. The EZShellExtensions.Net software allows you to create Internet Explorer toolbands and Internet Explorer vertical and horizontal bands and most things you would want to do via Shell Extensions in .Net. The ShellMega pack is a collection of their own Shell Extensions that they have created ready for you to use.

Both packages support VS.Net 2002 - 2005 so that means it supports the .Net framework v1.0 - v2.0, whilst Rich Cranes project only supports VS 2005 from what I can tell. The prices of the product is quite reasonable for the stuff you get.

Technorati Tags
[feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed]

Related Wikipedia Documents
, ,

My Related Documents
, , ,

Related Amazon Books
Classic Shell Scripting: / Microsoft Content Management Server 2002: A Complete Guide: / Windows NT Shell Scripting: / Ajax in Action: / Essential COM: /

Related Images From Flickr

Google Search Query: internet explorer 7 favorites

A user visited my site with the Query "internet explorer 7 favorites". My original content for IE7 favorites was with Beta 1, so I thought that it was only fair that I provided an update not that Beta 2 is on the streets.

I had two major problems:
  1. The favorites menu when open would crash IE7 Beta 1
  2. The favorites menu when extremly large would file the screen and you couldn't see what was happening.

It seems that both of my issues have been fixed in Internet Explorer Beta 2, the menu now doesn't take the entire screen, it works a similar way to the IE 6 browser where it is one long scrollable menu. And also it doesn't crash anymore. :)



Technorati Tags
[feed], [feed], [feed], [feed], [feed], [feed], [feed]

Related Wikipedia Documents
, ,

My Related Documents
, , ,

Related Amazon Books
Microsoft Internet Explorer 7: Introductory Concepts and Techniques: / Course Ilt Internet Explorer 7: / Internet Explorer 7: Basic: / Explorer's Guide to the Semantic Web: /

Related Images From Flickr

Friday, February 10, 2006

Microsoft Feed Manager Events Example

Thanks to Matt Dotson, who gave some code up on GotdotNet that shows how to get the GetWatcher in the Feed Management Api to work.

I had a problem the other day with it. I couldn't get the Watcher attached to the feed. It was a simple casting problem and my misunderstanding of Interop.

Here is my code

FeedsManagerClass fmc = new FeedsManagerClass();
IFeed f = (IFeed) fmc.GetFeed("Internet Explorer Team Blog");
IFeedEvents_Event ife = (IFeedEvents_Event) f.GetWatcher(FEEDS_EVENTS_SCOPE.FES_ALL, FEEDS_EVENTS_MASK.FEM_FEEDEVENTS );
ife.FeedItemCountChanged += new IFeedEvents_FeedItemCountChangedEventHandler(ife_FeedItemCountChanged);
ife.FeedDownloadCompleted += new IFeedEvents_FeedDownloadCompletedEventHandler(ife_FeedDownloadCompleted);
f.Download();

Now my code works. I was casting to an FeedsWatcherClass rather than the IFeedEvents_Event interface.

Silly me.

Technorati Tags
[feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed]

Related Wikipedia Documents
, , , , , ,

My Related Documents
, , , , , ,

Related Amazon Books
User Interface Design for Programmers: / Designing the User Interface: / Essential COM: / Developing Feeds with RSS and Atom: / Syndicating Web Sites with RSS Feeds for Dummies (For Dummies S.): / Beginning RSS and Atom Programming: / Hacking RSS: / Filtering the Web to Feed Data Warehouses: /

Related Images From Flickr

Thursday, February 09, 2006

Microsoft Feed Management API c# problems

I am trying to use the Microsoft Feed Management API in IE7 Beta 2 and I am trying to hook up the a feed watcher event to see when the counts of items in a feed change.

However, I can't get past the following line:
FeedFolderWatcher fwc = new FeedFolderWatcherClass();

I get the exception:
Retrieving the COM class factory for component with CLSID {281001ED-7765-4CB0-84AF-E9B387AF01FF} failed due to the following error: 80040154

Which from what I can tell the CLSID is not installed on my system.

What can I do? Is this an install problem or a problem with the MFM API?
Does anybody have the full screen saver c# example so that I can see what is going on?

Technorati Tags
[feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed]

Related Wikipedia Documents
, , , , ,

My Related Documents
, , , ,

Related Amazon Books
Programming C#: / Filtering the Web to Feed Data Warehouses: / Developing Feeds with RSS and Atom: / Beginning RSS and Atom Programming: / Hacking RSS: / RSS and Atom: Understanding and Implementing Content Feeds and Syndication: /

Related Images From Flickr

A Question about RSS Readers

Does anyone know of any RSS readers that can filter out languages?

That is I would like an RSS reader that will only display English RSS items [or any other language that I choose to filter by]

Currently I use SharpReader which implements IBlogExtension, but that is about it. It doesn't provide an API to filter individual posts.

Maybe the Microsoft Feed Management API can help me out?

Technorati Tags
[feed], [feed], [feed], [feed], [feed], [feed], [feed]

Related Wikipedia Documents
, , , , , , ,

My Related Documents
, , , , ,

Related Amazon Books
Syndicating Web Sites with RSS Feeds for Dummies (For Dummies S.): / Beginning RSS and Atom Programming: / Hacking RSS: / RSS and Atom: Understanding and Implementing Content Feeds and Syndication: / Content Syndication with RSS: /

Related Images From Flickr

Note To Self

http://blogs.msdn.com/heaths/archive/2006/02/08/528077.aspx

Google Adsense For Search Limits Use [In a Bad Way]

With the introduction of IE7 Beta 2's custom search providers, I was hoping that I could implement an opensearch specification that will use all the parameters that hook up to my Google Adsense for search account. This way I could provide a site search directly within IE7 that hooks up with google's adsense for search and perhaps generate a little extra revenue.

Google does not allow it!


AdSense for Search. If You have elected to receive Search Results, You will display on Your Site(s) a Google search box (a "Search Box") in accordance with the specifications provided by Google. Each Web page(s) that contains a Search
Box must also contain other content related to Your Site. Except for related Google queries, all search queries (including queries entered into an Ad search box) must originate from individual human end users inputting data directly into a Search Box (or Ad search box, as applicable) on Your Site(s). You will send any and all queries (without editing, modifying, or filtering such queries individually or in the aggregate) to Google and Google will use commercially reasonable efforts to provide You with corresponding Search Results and/or Ads, as applicable and as available. Search Results and any accompanying Ads will be displayed on Web pages hosted by Google (each, a "Search Results Page"), the format, look and feel of which may be modified by Google from time to time.

If only Google allowed you to do this it would be great. Opensearch is an amazing idea, but google are stifling what I can do.

Ah well.

Technorati Tags
[feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed]

Related Wikipedia Documents
, , , , ,

My Related Documents
, , ,

Related Amazon Books
Make Easy Money with Google: Using the Adsense Advertising Program: / The Search: How Google and Its Rivals Rewrote the Rules of Business and Transformed Our Culture: / Google's PageRank and Beyond: The Science of Search Engine Rankings: / Search Me: The Surprising Success of Google: / Winning Results with Google Adwords: /

Related Images From Flickr

IE Developer Tool Bar Beta 2

A Quote From the IEBlog.

Beta 2 of the developer toolbar is now available. Beta 2 includes numerous fixes to improve stability, usability and performance along with a couple of additional features such as the ability to enable and disable CSS on the page.

The developer toolbar has become an essential tool for us in diagnosing issues with web pages. Being able to click on an element in the page and find out where it is in the element hierarchy is just one of the invaluable facilities it provides.

Let us know if you have any feedback either here or at the Wiki on Channel 9 about the toolbar. We’d certainly like to hear of issues and suggestions for further improvements.

We did hear one report that the previous preview of the developer toolbar did not work with the recently released preview of beta 2 of IE7. However we have been unable to reproduce the issue. Do let us know if you have any issues with either IE6 or the IE7 preview so that we can thoroughly investigate them for final release.
Thanks
- Dave

It is a really handy tool, but it suffers from some serious flaws which bug me like crazy. [I have reported them too]. It simply can't outline elements in a frame correctly, all the offsets for the outlines are completly shot. Also, scollable div's seem to suffer from the same problem.

I also found if you disable CSS and then reneable it, the page is not rendered how it was originally.

Great tool but too many bugs still. Sort these issues out and I would say it is one of the best Developer tools ever :)

Technorati Tags
[feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed]

Related Wikipedia Documents
, , , , , , , , ,

My Related Documents
, , , , , , , ,

Related Amazon Books
The ZEN of CSS Design: Visual Enlightenment for the Web: / Bulletproof Web Design: Improving Flexibility and Protecting Against Worst-Case Scenarios with XHTML and CSS: / Head First HTML with CSS & XHTML: / CSS Advanced Web Standards Solutions: / Professional CSS: Cascading Style Sheets for Web Design: / Eric Meyer on CSS: / The Computer Insectiary: A Field Guide to Viruses, Bugs, Worms, Trojan Horses, and Other Stuff That Will Eat Your Programs and Rot Your Brain: / Fatal Defect: Chasing Killer Computer Bugs: / No Bugs!: Writing Error-free Code in C and C++: /

Related Images From Flickr

Tuesday, February 07, 2006

Google Search: Are switchmedia any good

One of the Google searches that came to my site was "are switchmedia any good?"

I have been a customer for a while now and I have had no problems at all. They are very web hosting company. I have seen some of the sites they have done, and they look great too.

This site is a template off Blogger that I use.

Technorati Tags
[feed], [feed], [feed], [feed], [feed]

Related Wikipedia Documents
, , , , ,

My Related Documents
,

Related Amazon Books
Web Hosting Manual - How To Start Your Own Web Hosting Business: / Strategies for Web Hosting and Managed Services: / The Web Hosting Manager: / Web Hosting: A Complete Strategy: / Understanding Web Hosting on Linux: /

IE7 Beta 2 Select Boxes

Remember how in IE6, when you had a SELECT box on the screen it would be rendered as the top most element, this affected menu systems because the select box would appear over the menu and it would look really bad.

Well not anymore, IE7 Beta 2 seems to have fixed this.

Read http://blogs.msdn.com/ie/archive/2006/01/17/514076.aspx for more information, I have checked it out and it works pretty well it seems.

I have not tried any extra CSS styles but I hope they work.

Technorati Tags
[feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed]

Related Wikipedia Documents
, , ,

My Related Documents
, , , , , ,

Related Amazon Books
The ZEN of CSS Design: Visual Enlightenment for the Web: / Bulletproof Web Design: Improving Flexibility and Protecting Against Worst-Case Scenarios with XHTML and CSS: / Head First HTML with CSS & XHTML: / CSS Pocket Reference: / HTML for the World Wide Web with XHTML and CSS: Visual Quickstart Guide: / Explorer's Guide to the Semantic Web: / Windows Longhorn Developer Beta Preview: / Microsoft Internet Explorer 7: Introductory Concepts and Techniques: / Course Ilt Internet Explorer 7: / Internet Explorer 7: Basic: /

Related Images From Flickr

Monday, February 06, 2006

Microsoft Feed Manager API

Is it me or is the Microsoft Feed Manager API not a Managed API? I have just read through it and it all seems to be COM based.

What has happened to Microsoft "policy" of creating nearly everything for Vista via Managed Code? Additionally, condsidering RSS is XML and .Net Handles XML like nobodies business I would have thought a managed API was a no-brainer. All this means that I have to Interop just to use this new feature.... give me a break.

Am I being silly?

Technorati Tags
[feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed]

Related Wikipedia Documents
, , , , , , , , , ,

My Related Documents
, , ,

Related Amazon Books
Professional ASP.NET 2: / Programming C#: / Build Your Own ASP.NET Website Using C# and VB.NET: / Service-Oriented Architecture: Concepts, Technology, and Design: / MCAD Training Guide 70-320: Developing XML Web Services and Server Components with Visual C#.NET and the .NET Framework: / Content Syndication with RSS: / RSS and Atom Hacks: / Secrets of RSS: /

Related Images From Flickr

IE7 Font Rendering

I have been playing around a bit with Internet Explorer 7 Beta 2 and one of the first things that I noticed about it [other than the new UI] is that the fonts seem to render with ClearType. It was a bit of a shock because it was really subtle at first but now I really notice the difference. If you have IE7 Beta1 and goto http://news.bbc.co.uk and then try it with Beta2 you will see exactly what I mean.

Sweet.

I also found a link on the IE Blog about what has changed [http://blogs.msdn.com/ie/archive/2006/02/03/524367.aspx].

Technorati Tags
[feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed]

Related Wikipedia Documents
, , , , ,

My Related Documents

Related Amazon Books
Microsoft Internet Explorer 7: Introductory Concepts and Techniques: / Course Ilt Internet Explorer 7: / Internet Explorer 7: Basic: / New Perspectives on Microsoft Internet Explorer 7, Brief: / Windows Longhorn Developer Beta Preview: /

Related Images From Flickr

Updated Answer to CSS Regex Question

I gave out a bit of duff information in my last post. Thanks Rasmus!

The code should have been:

string css = @"
.class1{
color:pink;
}
.class2{
color:blue;
}";
string patt = @"\.[-]?[_a-zA-Z][_a-zA-Z0-9-]*|[^\0-\177]*\\[0-9a-f]{1,6}(\r\n[ \n\r\t\f])?|\\[^\n\r\f0-9a-f]*";
MatchCollection arr = Regex.Matches(css, patt);
}


The "arr" Collection will contain all the class names found in the input string. arr.Count will be the number of matches, and it can be indexed like so: arr[0].Value etc. etc.

Sorry about that :)


Technorati Tags
[feed], [feed], [feed], [feed], [feed], [feed]

Related Wikipedia Documents
, , ,

My Related Documents
,

Related Amazon Books
The ZEN of CSS Design: Visual Enlightenment for the Web: / CSS Pocket Reference: / Professional CSS: / Eric Meyer on CSS: /

Related Images From Flickr

Answer to CSS Regex Question

I have had a question in my Comments by Rasmus about CSS Regex for obtaining CSS class names. And rather than post it in the comments, I will post it as abn entry just so everyone can see it.

The Regex I gave was
\.[-]?[_a-zA-Z][_a-zA-Z0-9-]*|[^\0-\177]*\\[0-9a-f]{1,6}(\r\n[ \n\r\t\f])?|\\[^\n\r\f0-9a-f]*

I think this is nearly correct and the C# that it is not supposed to work with is:


string css = @"
.class1{
color:pink;
}
.class2{
color:blue;
}";
string patt = @"\.[-]?[_a-zA-Z][_a-zA-Z0-9-]*[^\0-\177]*\\[0-9a-f]{1,6}(\r\n[ \n\r\t\f])?\\[^\n\r\f0-9a-f]*";
string[] arr = Regex.Split(css, patt);
}

I tried the above code and it worked as Expected, there is an array entry in arr at the index of each class. Therefore each entry in arr contains the text between the class names.

Try Regex.Match if you want to get at the names of the classes. And Check that the | character comes out correctly.

Technorati Tags
[feed], [feed], [feed], [feed], [feed], [feed]

Related Wikipedia Documents
, , ,

My Related Documents
,

Related Amazon Books
The ZEN of CSS Design: Visual Enlightenment for the Web: / CSS Pocket Reference: / Professional CSS: / Eric Meyer on CSS: /

Related Images From Flickr

Thursday, February 02, 2006

Simple List Extensions

Does anyone know if there are any applications that implement and use Microsoft's Simple List Extensions for RSS? I am trying to work out how the extensions could be used to good effect.

Technorati Tags
[feed], [feed], [feed], [feed], [feed]

Related Wikipedia Documents
, , , , , , ,

My Related Documents
, , , , , , , , ,

Related Amazon Books
Build Your Own ASP.NET Website Using C# and VB.NET: / XML in a Nutshell: / Developing Feeds with RSS and Atom: / Syndicating Web Sites with RSS Feeds for Dummies (For Dummies S.): / Hacking RSS: / RSS and Atom: Understanding and Implementing Content Feeds and Syndication: / Content Syndication with RSS: / RSS and Atom Hacks: / Secrets of RSS: /

Related Images From Flickr

Wednesday, February 01, 2006

Regex To Get Class Names From CSS 2.0

I have just read part of the CSS 2.0 spec and to tie in with one of my side projects about creating a CSS 2.0 parser in c#, I have created a regex [based off the spec] that should find all the class names in a CSS file.

\.[-]?[_a-zA-Z][_a-zA-Z0-9-]*|[^\0-\177]*\\[0-9a-f]{1,6}(\r\n[ \n\r\t\f])?|\\[^\n\r\f0-9a-f]*

I intend to create more regex's over the next few days to parse all the other elements that appear inside the CSS spec. Then once these are done I should be able to have a stab at creating a full CSS 2.0 parser.

Technorati Tags
[feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed]

Related Wikipedia Documents
, , , , , ,

My Related Documents
, , , , ,

Related Amazon Books
Microsoft Log Parser Toolkit: A Complete Toolkit for Microsoft's Undocumented Log Analysis Tool: / XML Programming Using the Microsoft XML Parser: / Regular Expression Pocket Reference: / Regular Expression Recipes: A Problem-Solution Approach: / Regular Expression Recipes for Windows Developers: a Problem-solution Approach: / Programming C#: / CSS Pocket Reference: / Professional CSS: / Eric Meyer on CSS: /

Related Images From Flickr

IE7 Beta 2

In the past I have written about the IE7 Beta's. Well, it is time to do it again :) By Following from the IEBlog post you can download Beta 2 of Internet Explorer 7 [http://www.microsoft.com/windows/ie/ie7/].

Stay tuned for my impressions. :)

Technorati Tags
[feed], [feed], [feed], [feed], [feed], [feed], [feed]

Related Wikipedia Documents
, , , , ,

My Related Documents
, , , , , , , , , , , ,

Related Amazon Books
Internet Explorer 6 for Dummies (For Dummies S.): / Explorer's Guide to the Semantic Web: / Internet Explorer 6.0 Resource Kit: / Microsoft Internet Explorer 7: Introductory Concepts and Techniques: / Course Ilt Internet Explorer 7: / Internet Explorer 7: Basic: / New Perspectives on Microsoft Internet Explorer 7, Brief: /

Related Images From Flickr