About/Contact

Steve Trefethen

Steve Trefethen is CTO at Wanderful Media.
Contact me

View my LinkedIn profile



Calendar

<<  May 2013  >>
MoTuWeThFrSaSu
293012345
6789101112
13141516171819
20212223242526
272829303112
3456789

View posts in large calendar

Disclaimer

The posts on this weblog are provided AS IS with no warranties, and confer no rights. The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.



Setting up a new SVN repository

January 12 2011 11:48AM

Since I rarely tend to setup new $g(SVN source repositories) I find myself googling for the syntax of the various commands so I'm writing this post to myself for future reference. I'm starting a new website project at work and needed a new repository created with a few external folder references to another project. After creating a bootstrap set of directories and files from pieces of another project then needed to create the new repository. My folder structure looks like this:

~/work/publishing <- location of new project files/folders

cd ~/work
svn import -m "Initial revision" publishing https://svn/repos/publishing/trunk

The project has two folders which will come from an existing project that won't be modified in this new project so I'm using svn:externals to reference those folders. I'm not sure this was the best way to do it but since I have several other people who will be using the repository I decided to check it out locally:

cd ~/work
svn co https://svn/repos/publishing pub

Next, I changed to the subfolder where the two external folders are located:

cd ~/work/pub/trunk/application

Then using svn propedit I created two external links though the first time through I got it wrong. Note, the quotes are important here:

SteveT:application strefethen$ svn propset svn:externals 'model https://svn/repost/proj/trunk/application/lib' .
property 'svn:externals' set on '.'
SteveT:application strefethen$ svn up
svn: warning: Error handling externals definition for 'model':
svn: warning: OPTIONS of 'https://svn/repost/proj/trunk/application/model': 200 OK (https://svn)
At revision 24431.

The problem in this case was my mistyping "repos" adding a "t" (bolded above). Next, I made the mistake of using propset twice for two different externals (model and lib) which yielded the following when I tried to update:

SteveT:application strefethen$ svn up
svn: warning: Error handling externals definition for 'model':
svn: warning: URL 'https://web.merchantcircle.com/repos/proj/trunk/application/model' at revision 24431 doesn't exist
At revision 24431.

At this point, I needed to use svn propedit to create two external folder references but I didn't have any editor set to make these changes which yielded:

SteveT:application strefethen$ svn propedit svn:externals .svn: None of the environment variables SVN_EDITOR, VISUAL or EDITOR are set, and no 'editor-cmd' run-time configuration option was found. I edited my .bash_profile adding an SVN_EDITOR environment variable
mate ~/.bash_profile

Adding:

export SVN_EDITOR="mate -w"

Save an close TextMate. Then source my .bash_profile to get the changes:

source ~/.bash_profile

Now I could finish editing the svn:externals as follows:

svn propedit svn:externals .

The lib external was already defined from my previous propset command so I just needed to the model external making my svn:externals look like this:

lib https://svn/repos/proj/trunk/application/lib
model https://svn/repos/proj/trunk/application/model

Now when I update both external folders are updated:

SteveT:application strefethen$ svn up
Fetching external item into 'model'

External at revision 24431.

Fetching external item into 'lib'
External at revision 24431.

At revision 24431.

Finally, I committed my changes to the application folder for these externals. 

SteveT:application strefethen$ svn commit
Log message unchanged or not specified
(a)bort, (c)ontinue, (e)dit:
c
Sending        application
Committed revision 24432.

Not sure this is going to be helpful for anyone else but I can certainly make use of it in the future.

FacebookDel.icio.usDigg It!

Useful Facebook FQL queries

January 05 2011 5:11PM

This is a post for me to aggregate various FQL queries.

Fetch the Facebook like count for a given URL

SELECT like_count FROM link_stat 
WHERE url="http://www.stevetrefethen.com/blog/"

Facebook user's connections

SELECT target_id,target_type,is_following 
FROM connection WHERE source_id = facebook_userid

Facebook Share count on a page

SELECT share_count, like_count, comment_count, total_count 
FROM link_stat 
WHERE url="http://www.stevetrefethen.com/school/"

Fetch open graph id for a url:

SELECT id,type,site FROM object_url 
WHERE url="http://www.stevetrefethen.com/school/"

View which groups a user belongs to

SELECT name,gid FROM group 
WHERE gid IN (SELECT gid FROM group_member 
WHERE uid = facebook_userid)

Fetch a "friend map"

Replace UID with logged in user id. Via this page.

SELECT uid1, uid2
FROM friend
WHERE uid1 IN (SELECT uid1 FROM friend WHERE uid2=UID)
AND uid2 IN (SELECT uid1 FROM friend WHERE uid2=UID)
AND uid1 < uid2

Names of the places you've checked in

SELECT name FROM page 
WHERE page_id IN 
(SELECT page_id FROM checkin WHERE author_uid = me())

Names of the Places your Friends have checked in

SELECT name FROM page 
WHERE page_id IN (SELECT page_id FROM checkin WHERE author_uid IN 
(SELECT uid2 FROM friend WHERE uid1 = me()))

You can play around with executing these here including your Facebook user id if you're logged in.

FacebookDel.icio.usDigg It!

Enabling Facebook Insights aka Social Analytics for your Domain

January 02 2011 9:04PM

As a follow-up to my previous post Facebook allows you to tie your domain to an application, page or Facebook account allowing you to track usage through Insights which is Facebook’s version of Google Analytics on their platform.

Facebook Insights

The green button at the top right reads “Insights for your Domain” where you can specify where you want to track statistics. By tying your domain to one of the three choices you can gain insight into your visitors. When I went to setup my domain tied to an application I ran into a message indicating that I needed to have “Connect Base Domains” enabled. I recalled a Facebook application setting that mentioned connect so I used the Developer’s application to edit the Facebook application that I was trying to tie Insights too.

To set this correctly, you need to:

  1. Browse to /developers on Facebook
  2. Click on your application (or create a new app)
  3. Select Edit Settings
  4. Click the Web Site tab
  5. Set the Site URL and Site Domain fields accordingly for your domain
  6. Return to the /insights page and setup Insights for your domain
FacebookDel.icio.usDigg It!

Tags:

Does Facebook's Like button really help drive traffic?

December 31 2010 12:37AM

I’ve been looking at the Facebook API lately in relation to how search in the coming years will likely be increasingly impacted by the terabytes of personal data Facebook is collecting on some 500 million of us. To that end, if you read this blog with any regularity and you’ll notice that I’ve added a like button in the top left hand corner. I want to understand the affect of the Like button on a page/site and whether it helps drive traffic to that page/site or if it’s just a piece of information useful for Facebook.

Facebook recently wrote a post expounding on the benefits of leveraging their social graph to help drive traffic claiming both astronomical increases in traffic and engagement. Unfortunately, the post neglects to mention specifics regarding things the various sites did to see such huge increases. I’m looking for examples where non-Facebook sites are leveraging the Like data and actually benefiting from including it.

My request is that if you actually like this blog can you have a Facebook account if you wouldn’t mind clicking that button. I thank you in advance.

For those of you picking this up via an aggregator I’ll stick the button right into the post so you don’t have to browse there.

FacebookDel.icio.usDigg It!

Tags: , ,

Upgrading from BlogEngine.NET v1.5 to v2.0

December 30 2010 11:55PM

Warning: If you’re not a BlogEngine.NET user you may want to continue looking for other interesting stuff on the intertubes.

I’ve been running BlogEngine.NET v1.5.1.28 for quite some time with a number of extensions I’ve either added or written. Additionally, I created a custom theme and including things like a ScriptCombiner and SyntaxHighlighter, the later of which is included with v2.0. In order to move to the v2.0RC I’ve been slowly upgrading in a separate directory and I’m using this post to keep track of the changes required to upgrade.

Beyond the upgrade steps here I had to make a few minor changes to some of my widgets. Primarily the problems boiled down to adding a few using clauses:

using App_Code.Controls; 
using BlogEngine.Core.Web.Extensions;

As I’ve already mentioned I’m really looking forward to the improved comment handling.

I’m updating this post as I go so last night I tried to pull the trigger on the upgrade only to realize that I’d made a tweak to the BlogEngine.Core assembly to change the URL handling. Previously, when I upgraded from dasblog I needed to preserve my URLs and BlogEngine.NET uses the format /blog/post/postname.aspx which for me means I have to get rid of /post as that’s not compatible with my old URLs. After restoring my v1.5 version I’m now working to isolate the changes I made October 2009 and patch v2 so I can upgrade. I only wish I’d included a bit more detail at to exactly what I changed. :)

Btw, thanks to the group of people working to maintain/upgrade BlogEngine.NET.

FacebookDel.icio.usDigg It!

Advice on purchase of 35mm DSLR with HD Video

December 27 2010 9:42PM

I have a $l(Nikon D70) which I’ve taken +30K photos with and a few weeks ago I took a bunch of pictures of the kids hanging Christmas ornaments which for some reason were nearly all corrupt when I went to download them from the flash card. I’m not sure if the issue was the card or the camera but I’ve been wanting a new camera with support for HD video and have been since looking around.

My first thought was to stick with Nikon but since I don’t have a huge investment in lens it’s not a requirement so I’m opening it up to other options. The first two cameras I sought reviews on were the $l(Nikon D3100) and $l(Canon EOS D60). I’m also looking at the $l(Nikon D7000) and $l(Canon EOS 550D).

I know the price range here is pretty wide but I’m really interested in the addition of HD video so a good combination of still and movies is my preference. My shooting will be largely kids and various birthdays/sports/activities over the coming years. I’d also like something that can shoot video of the occasional holiday event in low fairly low light conditions.

Anyone with experience/thoughts on any of these or other cameras I should consider?

FacebookDel.icio.usDigg It!

Tags: , , ,

Properties of a webform causing inline errors using <%= %> style markup

December 22 2010 11:43AM

I’ve been looking at the latest Facebook Developer Toolkit samples and tried to add a property to the Default.aspx.cs using the IFrame sample application like this:

<%=this.MapCanvas %>

Which yielded this error:

Error    28    'ASP.default_aspx' does not contain a definition for 'MapCanvas' and no extension method 'MapCanvas' accepting a first argument of type 'ASP.default_aspx' could be found (are you missing a using directive or an assembly reference?)    C:\Users\SteveT\Documents\Visual Studio 2010\WebSites\FBIFrame\Default.aspx    38    17    C:\...\FBIFrame\

The problem is that the @Page tag reads:

<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/IFrameMaster.Master" CodeBehind="Default.aspx.cs" Inherits="IFrameSample.Default" %>

Changing CodeBehind to CodeFile gets things working.

<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/IFrameMaster.Master" CodeFile="Default.aspx.cs" Inherits="IFrameSample.Default" %>
FacebookDel.icio.usDigg It!