Hey I'm Lee. My blog was put up to house my strange thoughts, ramblings, nuggets of information I can refer back to and document my learning curves on new dev stuff and fitness regimes.

All thoughts and comments on here are my own, and in no way reflect my employer - I also take no responsibility for spelling, grammar, terminology, accuracy of facts etc... So read at your own risk!

Blogs I Read

Sites I Like

New Training Routine

I've been doing pretty much the same training regime for a while. I had little variations, where I'd try a kettle bell session of some other session that was on at the gym. I was doing some reading at the weekend and I found Arnie's basic mass routine, which looks like it might be doable within my time constraints. I also found his advanced routine… But you'd need 4+ hours a day to do that lol!! So we'll leave that for the moment. Anyway, f...

Read More
Posted by
Lee

Getting IPublishedContent In A Custom Action / Class

If you want to make use of the cool new Querying/Api that came with Umbraco MVC. Then its as simple as getting an instance of the UmbracoHelper like so. var uHelper = new UmbracoHelper(UmbracoContext.Current); Then just use it like you normally do within a View and get your IPublishedContent back and use it however you need. uHelper.TypedContent(); uHelper.TypedMedia(); etc.. etc…

Read More
Posted by
Lee

Which w3wp.exe Belongs To Which Application Pool In IIS7

If you have a few sites running on your server, and want to know which worker process/application pool is taking up the most memory. There is a very simple script you can run. 1.) Make sure you have the PID column showing in your processes tab. 2.) Open the cmd window and type the following to get you into the 'inetsrv' folder cd C:\Windows\System32\inetsrv and then type the following appcmd list wp This will give y...

Read More
Posted by
Lee

Unable To Create Database Diagram - No Valid Owner

When restoring databases locally from other servers, you often can't get the database diagram to load and get the following error. Database diagram support objects cannot be installed because this database does not have a valid owner. A simple fix for this is to use the following SQL Query. ALTER AUTHORIZATION ON DATABASE::YourDbNameHere TO sa GO

Read More
Posted by
Lee

Useful Script To Clear/Drop All Tables In A Database

Thought I had dumped this up here before, but seemingly not! Very useful (And dangerous) little script to quickly clear out a Db of tables. If you get constraint errors, just keep running it and it will clear dependencies and then the children. EXEC sp_MSforeachtable @command1 = "DROP TABLE ?"

Read More
Posted by
Lee

Using Linq Select To Cast/Map Objects

I'm always looking for cool snippets of code using Lambdas to reduce my code, I have opted for using Linq Select() extension method to cast objects to a different type or Map one object to another one.  These are really simple examples of how to do this but pretty useful. Casting An example of take a string CSV and casting to a List<int> using the Linq Select() extension method. var intList = csvString.Split(',').S...

Read More
Posted by
Lee

Dealing With 1000’s Of Members In Umbraco Without The API Or Examine

I had a situation recently with a client site that has literally 1000's of members, and was getting about 20 new members sign up per day. I initially started off with the built in API, but each 'group' has around 20+ custom properties and even with a cache it started to creek when searching and mass downloading members into CSV files (Watching with SqlProfiler made your eyes wince). So I opted for Examine next. I wrote a really nice ...

Read More
Posted by
Lee

Hashed Links & Value cannot be null - Parameter name: attribute

********************************************** IMPORTANT UPDATE This is actually a bug in Umbraco, and you need to fix you need to upgrade to the latest version 4.11.4+ and also run this tool if you have the problem. http://our.umbraco.org/projects/developer-tools/path-fixup You could run and install the patch above anyway, BUT you run the risk of it happening again if you don't upgrade your website *********************...

Read More
Posted by
Lee

Win 2008 Task Scheduler With Return Code 1 (0x1)

I recently had the most infuriating issue with a scheduled task on a Win 2008 R2 server. All I wanted it to do was run a .bat file once a day which fired a WGET script. If I logged into the server and clicked the bat file, it fired and triggered the WGET script and everything worked. But whenever I tried to run it from the Task Scheduler (Either manually pressing run or letting it fire off the schedule), it failed and returned th...

Read More
Posted by
Lee

Geeks Can Shape Up Too, Just Stop Making Excuses

Over the past year I have been trying to get myself in shape, well more than in shape.  I have been trying to grow some muscles and get a bit ripped ready for the summer, but it hasn't quite gone how I expected (But that's a story for another time). Being a Geek/Developer, I know how hard it is to stay in shape! Our job is to sit there and 'get this shit done' for however many hours it takes.  And what's more, once the 'pa...

Read More
Posted by
Lee
Back to top