Archive for August, 2009
Where did my Immidiate window go!?
I’ve had this trouble on my home machine and occasionally at work- my immediate window seems to just disappear! All trace of it gone, and no sign of it in it’s usual location in the menu- however the command window is still available. Turns out that you can invoke the immidiate window from a command window by typing;
immed
It’s that simple!!
Premailer — preflight for HTML e-mail
Stumbled across a handy on-line tool for processing html used in email’s- which is notoriously picky. This tool converts all your css declarations to be inline as well as update all your links and image paths to be absolute- not masses but saves you picking through and doing it manually.
Premailer — preflight for HTML e-mail — dunae.ca.
There’s another site up which guides you through standards which should help you get the best results from your email across all the main email clients ; www.email-standards.org
Holiday!
Posted by shawson in Uncategorized on August 5, 2009
Things will be quiet on here for the next 2 weeks as I’m on holiday! I will try and post a few updates to our holiday Blog over at www.shawson.co.uk/travelblog/
Referencing custom properties on a Master page from the Child page
We have an optional menu which appears on a few of the pages in a site I’m working on at the moment- this additional menu is on the master page and shown/hidden as needed. We’ve added a public property to the master page’s code behind;
public bool DisplayGrownUpsMenu { get; set; }
On the child pages you can then reference the switch in code like so;
this.Master.DisplayGrownUpsMenu = true;
However, this didn’t initially work- dot net assumed the master page to be of the generic base master page type (System.Web.UI.MasterPage) as opposed to my specific instance of that master page with the extra property (Orchard.Master). As a result, the new DisplayGrownUpsMenu property didnt appear in intellisense and the compiler flagged this as an error. To resolve this you have to add a reference to the specific Master Page type in use, on the aspx side of things by wacking this at the top of the page;
<%@ MasterType VirtualPath="~/Orchard.Master" %>
WordPress import from WordPress.org – 500 Server Errors & Timeout’s!
I’ve recently setup a wordpress blog to use when we’re on holiday to post pictures and let people know how we’re getting on. I had an existing hosted blog up at shawandtashinjapan.wordpress.com which I wanted to import to my new self hosted blog, but ran into a whole world of pain while trying to run the built in importer.
I ran an export from the wordpress.org hosted blog which gave me an xml file which contained wordpresses own variant of rss. I then selected import from my new wordpress’s tools menu and gave it the xml file- all went well but when i asked it to download the attachments it all started to go to shit!
There were two main issues which i had to fix- the first was wordpress goes mental when it hits a 302 redirect when trying to grab an image, but there is a fix available for the download function in wordpress;
From : http://en.forums.wordpress.com/topic/downloading-images-for-import?replies=4
1052c1052 < //ini_set("display_errors", true); --- > 1061,1069c1061 < $response = wp_remote_request($url, $options); < $headers = wp_remote_retrieve_headers($response); < < $cd = (string)$response['response']['code']; < < if ($cd == '301') { < $response = wp_remote_request($headers['location'], $options); < $headers = wp_remote_retrieve_headers($response); < } --- > $response = wp_remote_request($url, $options); 1074c1066 < //$headers = wp_remote_retrieve_headers( $response ); --- > $headers = wp_remote_retrieve_headers( $response ); 1077d1068 <
Then i’m hit with timeouts coming from the FastCGI module- I’m running PHP 5.2 under IIS7 on Windows 2008 Web Edition- the error I was now getting when trying to run the import was;
The FastCGI process exceeded configured activity timeout
I found the fix for this one here: http://forums.iis.net/t/1076662.aspx. It was down to the FastCGI module timeout being hit, so it was just a matter of increasing that from the command line i executed;
%windir%\system32\inetsrv\appcmd set config -section:system.webServer/fastCgi /[fullPath='C:\php5\php-cgi.exe'].activityTimeout:600
In the end, I STILL didn’t get all the images over as some of them were quite large and the wordpress file server timed out while the script was trying to grab them, but i thought i would post this none the less, to save anyone else having to experience the evening i just had.
ergh…
Running vb.net alongside c# in a web app
via The ASP.NET Capsule #18: Running C# & VB.NET in the same web application – Jose R. Guay Paz.
Great snippet to wack in the web.config file, which allows you to run c# and vb.net code (*spit* ) in the same web project;
<system.codedom> <compilers> <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="4"> <providerOption name="CompilerVersion" value="v3.5" /> <providerOption name="WarnAsError" value="false" /> </compiler> <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="4"> <providerOption name="CompilerVersion" value="v3.5" /> <providerOption name="OptionInfer" value="true" /> <providerOption name="WarnAsError" value="false" /> </compiler> </compilers> </system.codedom>
Mastering CSS, Part 1: Styling Design Elements | CSS | Smashing Magazine
Excellent set of links to various cool technique and common CSS problems and their solutions, including the one that always gets me- verical centering!
Mastering CSS, Part 1: Styling Design Elements | CSS | Smashing Magazine.