moopoo.net
Fishing, technology and anything else

Using Custom Masterpage in _layouts directory

August 24th, 2009 by Matt

To use a custom or the default masterpage in custom aspx pages located in your _layouts directory use the following code in the code behind for the page.
N.B I didn’t declare any masterpage useage in the actual aspx file.

protected override void OnPreInit(EventArgs e)
{
    base.OnPreInit(e);
    // Set the masterpage to the default.master.
    using (SPWeb webCurrent = SPControl.GetContextSite(Context).OpenWeb())
    {
        string strUrl = webCurrent.ServerRelativeUrl + "/_catalogs/masterpage/default.master";
        // custom.master is your same default or main master page 
        // being used for main portal pages. Change that path according to your need
        this.MasterPageFile = strUrl;
    } 
}

Posted in Mobile, SharePoint | 1 Comment »

Apple Airport Extreme Disk Access and Windows 7

August 18th, 2009 by Matt

I was having issues accessing the drive I had hooked up to my Airport Extreme from Windows 7. Every time I would try to connect I would get the following error:

“unknown user, incorrect password, or login is disabled. Please retype the login information or contact the disk’s administrator (67)”

I eventually came across this thread on the Apple Support forums which offered the solution below.

Goto Start Menu
Search for: security
Click on Local Security Policy
Goto Local Policies> Security Options
Double Click on Network security: LAN Manager Authentication
Change level to: Send LM & LTLM Responses

Then, scroll down to Network security: Minimum session security for NTLM SSP
De-select Require 128-bit encryption
Hit OK

This worked for me, now I get full access to my HFS formatted disk from windows 7 and all other computers on the network.

Posted in Mac | 3 Comments »

Dell SX2210 Monitor

August 18th, 2009 by Matt

I had been toying with idea of getting a new monitor for a while. My requirements were pretty straight forward I think, I wanted something at least full HD on as small a monitor as I could get away with. I was originally looking at a 24″ but I wasn’t sure I had the desk space for it, I already have a 21″ widescreen Acer on there.

Then a few nights ago I came across the Dell SX2210 on the Dell website. It seemed to tick all the boxes, full HD (1920×1080), was a 22″ screen (well 21.5″ but who’s counting) and it looked the part. Best part was it had nearly £45 off so was only £175. There were some decent reviews of it on the dell review site so I decided to take the plunge.

Delivery was quick, ordered very late Thursday Night and it arrived Monday morning.

First impressions

The monitor looks very stylish, and has a white back with small white trim noticeable at the front bottom.
I can’t see any dead pixels on there which is a bonus.
The screen is very clear and bright. The monitor is setup at the side of an Acer AL2016W and is noticeably brighter with better colours. The Acer seems dull and the whites don’t seem as crisp.

I’m hoping to hook the Xbox 360 up via HDMI to see how it looks playing games b ut for day to day use I’m more than impressed.

It does have a glossy screen, which I tend to prefer and I don’t really have any issues where it is sat in my office.

I would definitely recommend this monitor so far, I may even treat myself with another one to replace the Acer which is a poor monitor in all honesty.

Posted in Technology | 2 Comments »

WordPress for iPhone

May 18th, 2009 by matt

Just having a play with WordPress for iPhone to see how it is.
Seems pretty good so far although I noticed with 3.0 if I want to write the post in landscape mode, I can’t scroll to modify
other fields I have to put it back to portrait mode to get to them.

var test="my JavaScript test";

Posted in Fishing | No Comments »

Highlighting row on form error with jQuery

May 18th, 2009 by Matt

When showing errors in web forms, I thought it would be useful to highlight the row where the error occurred so the user can visually see where they they need to make changes. jQuery is the ideal way to do this for me as I didn’t want to do it server side.

To begin I set a CSS class on the error messages that were displayed in the td with the form element. An error message could be in the form of

<span class=".valError">You have selected an invalid date.</span>

Now all we have to do in jQuery is find all elements which match the class, remove any classes that may be on any of the td tags, then add a class to the tr in which the error exists.

$(".valError").each(function() {
    // remove all classes from any td's of the below the parent row
    $(this).parent().parent().find("td").removeClass();
    // set the class on the tr
    $(this).parent().parent().addClass('ms-informationbar');
})

That’s it.

You could optionally set the class of the td rather than or as well as the tr. The following line would help you achieve this.

$(this).parent().parent().find("td").removeClass().addClass('myErrorClass');

Posted in jQuery | No Comments »

iPhone 3.0 beta restore error 1602 or 1604 solution

May 1st, 2009 by Matt

After downloading and trying to update 3.0 beta 4 and iTunes pre-release 8.2 to go with it, I was prompted with a nice error 1602 from iTunes and a pink screen on my iPhone. Trying again got me a lovely 1604 error instead.

You’ve never seen a man panic…

So, to get it working again here are the steps I took:

  1. Uninstall iTunes & QuickTime
  2. Backed up the iTunes folder in C:\Documents and Settings\[username]\Application Data\Apple Computer\, then deleted the original
  3. Rebooted the PC
  4. Re-install iTunes 8.2 pre-release
  5. Run the restore again from iTunes

Not sure how mandatory step 2 above is but I did it and it worked for me, plus I didn’t have anything in the iTunes folder that I needed to keep.

Posted in iPhone | 1 Comment »

CAML Querying using DateTime.

January 13th, 2009 by Matt

Caml queries on DateTime fields by default do not use the Time portion of the field. To overcome this use the attribute IncludeTimeValue=’TRUE’ in the value tag. For example:

<Value Type=’DateTime’ IncludeTimeValue=’TRUE’><Today /></Value>

Posted in SharePoint | No Comments »

SharePoint Web Part Properties

December 3rd, 2008 by Matt

When creating a WebPart inheriting from System.Web.UI.WebControls.WebParts.WebPart, use the following code to add a custom Integer property that will sit in it’s own Category when you modify the properties of the web part.

private const int _intMaxShiftsPerDay = 0;
private int IntMaxShiftsPerDay = _intMaxShiftsPerDay;
[Category("Custom Properties")]
[DefaultValue(_intMaxShiftsPerDay)]
[Personalizable(PersonalizationScope.Shared)]
[WebDisplayName("Maximum Shifts Allowed Per Day")]
[WebDescription("Type in the maximum allowed shifts per day for each person")]
[WebBrowsable(true)]
[XmlElement(ElementName = "intMaxShiftsPerDay")]
public int intMaxShiftsPerDay
{
    get
    {
        return IntMaxShiftsPerDay;
    }
    set
   {
        IntMaxShiftsPerDay = value;
    }
}

Posted in SharePoint | No Comments »

Deploy a sharepoint solution with stsadm

October 31st, 2008 by Matt

First off we need to add the solution to SharePoint

stsadm -o addsolution -filename c:\path-to\filename.wsp

Next, we deploy the solution to the site

stsadm -o deploysolution -name filename.wsp -url http://myurl -immediate Optionally if you use Code Access Security add the following to the above

-allowcaspoliciesand if you have assemblies that deploy to the GAC, add this line to the deploysolution statement above

-allowgacdeploymentThis will create a timer job, we then simply need to execute this job

stsadm -o execadmsvcjobs

Posted in SharePoint | No Comments »

Using the Rive Hooktyer

January 21st, 2008 by Matt

The Rive hooktyer is a great system for getting your hooklengths the perfect length every time, but it can be tricky to get going with, especially with the instruction supplied in French and the diagrams not particularly helpful. Well fear not, this guide will help you.

Firstly tie set the length bar on the tyer to the length you require. To speed up the process and reduce line wastage I tie as many loops on the line as I require enabling me to quickly cut off the line above the loop when I need to tie the next hook. Remember to leave enough extra line between each loop for tying.

 

Insert the brass pin through the hole and put the hook in with the shank at the bottom.

Attach the loop to the end of the tyer and and wrap the line around the far side of the pin and beginning whipping the line around the hook, making sure the the line comes off the front of the shank as you tie.

Whip down the shank for as many turns as are required then pass the line between the flat side of the brass pin and the bent pin.

Photograph of hook ready for the tag to be trimmed

Keeping the line under tension, remove the brass pin pulling through the line with it, again making sure you keep tension on as the line comes through the other side.

Moisten the knot and slowly pull from the top side to tighten the knot.

The finished hook

Job done. Once you have tighened the knot, trim the tag to size and the hooklength is the the perfect length.

After a bit of practice you should be able to tie many hooklengths in no time at all.

Posted in Fishing | 1 Comment »

« Previous Entries Next Entries »