Ranting, Raving Lunartick.
a blog about what I do, think, forget and fiddle with
Why the Internet does not kill music
Posted by on September 16, 2011
The record industry is constantly complaining, suing and threatening that the Internet is killing music with it’s low cost modernistic ways of distributing media. Bu-huu. But I came across this very interesting interview with Dave Grohl (Nirvana, Foo Fighters) where he says:
“It’s the music,” said Grohl on the sales slump. “People are blown away that Adele is selling so many records. I’m not. That record is great! She’s got a beautiful voice, and people are shocked when they hear actual talent.”
Music in the recent years have been boring, auto-tuned, and lyrics are as interesting as watching grass grow. Actually, I retract that statement; watching grass grow is more interesting. A lot of the main stream music the record company is pushing our way is simple, fast produced, easy club/radio friendly music (including Norwegian superproducerduo Stargate; you make suck-ass music too), where as the genuine artists are pushed aside or hipped up and called “indie”. I find myself listening to older music more and more, as the newest music rarely finds it way to my ears. MTV and (unfortunately) VH1 have sold them selves out to commercial forces and plays only crap music these days, the Norwegian radio channel P3 is impossible to listen too as well (that said, channels P1 and P2 plays some really weird stuff too, for really old people).
Grohl brings up Adele as a very good example. She was fairly unknown and I have not seen any pushing from the record companies, until now when they realize that pure talent is popular again. I hope Adele, and bands like Foo Fighters and other hard working, touring bands, will get popular again, and the general populace will embrace music free of computer assisted voice correction, drum machines and GarageBand bass-lines set to “R&B”.
Living without Flash
Posted by on September 7, 2011
The recent weeks and months have included a stream of updates to my Flash players on various devices. It almost seems that every time I fire up a computer I need to update Flash (and Air), and it is starting to annoy me. And then I started to think about what Flash is needed for, and the first thing that comes to mind is Advertising. Annoying, slow, heavy interactive adverts, that frankly I can live without.
I bought the Samsung Galaxy 10.1 tab a few days ago, and Android does support Flash, if I want to download the Flash player. But, I’m beginning to see that I don’t want Flash on my devices. If I can choose between bloated Flash adverts, or HTML5 solutions (that are slow and sluggish too, so far) that are by far preferable, I make my choice now.
Good bye Flash, and good riddance.
Indent CSS for readability
Posted by on June 1, 2011
Reading CSS can be a hassle some times, and when you are a developer used to writing code that has indenting as a true and tried method of readability this should also apply to all other forms of text that has a hierarchical form, like CSS. The CSS example below is easy enough to read, but when this is 10 lines out of 2000, it’s some times hard to see where a particular style is belonging.
#layout-header
{
background-color: #848975;
height: 125px;
}
#layout-branding
{
width: 960px;
height: 125px;
margin: 0px auto 0px auto;
}
Using indentation in the CSS in addition to good grouping of text (context) you can get a result like this, which in my opinion is much easier and faster to read.
#layout-header
{
background-color: #848975;
height: 125px;
}
#layout-branding
{
width: 960px;
height: 125px;
margin: 0px auto 0px auto;
}
#layout-branding-home
{
display: block;
position: relative;
left: 11px;
top: 21px;
width: 235px;
height: 80px;
background-image: url(logo.png);
background-repeat: no-repeat;
}
#layout-basket-area
{
float: right;
margin: -30px 20px 0px 0px;
}
#layout-navigation
{
background-color: #27320A;
height: 35px;
}
#layout-navigation ul
{
display: block;
padding: 0px;
margin: 0px auto 0px auto;
width: 960px;
}
#layout-navigation ul li
{
display: inline-block;
padding: 5px 12px;
margin: 5px 15px;
}
Original CSS and idea from Tony Johnson at http://www.deepcode.co.uk
Why a project is like a Rubik’s Cube
Posted by on May 30, 2011
I had a thought at lunch today; A project is like a Rubik’s Cube. A project is defined as “a time limited one off task” (read more here), where someone wants something smart done, at this cost in this time span. Most likely it’s supposed to be done very fast at very little cost. Managing a project will give you grey hairs on your head, a stiff neck and lots of overtime, but in the end it is for the most time worth it, when a customer says things like “The result is amazing”, “It is a fantastic site”, and you even win prizes for you project.
But a project can be a beast you have to tame. There are a gazillion tasks to be done, some are easy to handle, some tasks live their own life and grow to new projects, some must be stopped and some are never resolved. Like a tree growing branches, a project managers job is to reel all the branches in to come to an end. See my fabulousous illustration.
This may not always be an easy task, and don’t worry about failing, you some times will. It’s a matter of persistence, tools, experience and luck that helps you along the way. As Harold Kerzner writes in the book “Project Management: A Systems Approach to Planning, Scheduling, and Controlling”
So, what does this have to do with Rubik’s Cube? Well, I look at it like Newton’s third law of motion: To every action there is always an equal and opposite reaction (more). When you take an action on a Rubik’s Cube, by rotating one or several axis, on one surface you see the desired change but here is also other sides of the cube that are changed. This may apply to projects as well. In my experience, an action you take will affect some other part of the project, intentionally or not (this is of course dependent on the size of the project), and will have a consequence – a reaction if you will.
So there it is, my idea that a project is like a Rubik’s Cube. If you understand how to solve a Rubik’s Cube you may not necessarily be to run a full project, but you get the idea. So, go forth and solve them Cubes!

Rubik's Cube - If you got a problem, Yo! I'll Solve it!
Why would you tell me, by script, that You suck?
Posted by on May 25, 2011
I recently visited an old favorite MTB company called Haro Bikes. After the initial selection process of wether I would like to look at this or that (splash screen), I opted for the MTB/Asphalt web site. And then I got a javascript popup from the site telling me that I am using an unsupported browser (see image)
Needless to say I was a bit annoyed by this, until I started thinking about the popup, and then I got even more annoyed. My browser, Opera 11, is not unsupported. It renders HTML, CSS, even javascript apparently, and it is used by some 2 % (http://blogs.sitepoint.com/ie6-usage-below-5-percent-browser-trends/) of the browsing population, and it is a good browser. The problem is basically that the web site does not need to use javascript to pop a message to me telling me that their site does not guarantee that all content will be shown 100 % correctly in my browser. Use the footer for that! Don’t alert me that my browser does not work, but write a short footnote that you can’t guarantee that all browsers will display the contents in the exact same way across all platforms – they won’t what ever you do (unless you code pre html text and no images, and make a really crappy site)!
Reactivation in 3, 2, …
Posted by on May 16, 2011
Advanced Property Access with PageTypeBuilder
Posted by on August 30, 2010
When using PageTypeBuilder you can do some really cool and advanced property access where you can get pages and return a list and make your aspx.cs files easier to read.
MyRepeater.DataSource = MyPageType.PagesToList; MyRepeater.DataBind();
This code will return a PageDataCollection with pages because in our MyPageType class we have defined that PagesToList should do a GetPages() call and return a list. Here is that code
public IEnumerable<PageData> PagesToList
{
get
{
return DataFactory.Instance.GetChildren(ListRoot ?? PageLink)
.Where(page => page.CheckPublishedStatus(PagePublishedStatus.Published));
}
}
Usually this would work fine when you set PagesToList as the datasource to a Repeater, however, I discovered that when using this method to set a datasource to an EPiServer control we get a failure on the DataBind method. I haven’t had the time to dig into it, but I suspect this is due to the Linq query, and maybe the EPiServer controls are missing a Linq reference – but don’t take my word for it! 🙂
But, this is easily solved by using EPiServers own GetChildren together with filtering, to return a collection of pages that is available for the PageList or NewsList controls that EPiServer provide, using this code
public IEnumerable<PageData> PagesToList
{
get
{
return FilterForVisitor.Filter(DataFactory.Instance.GetChildren(ListRoot ?? PageLink));
}
}
By using FilterForVisitor we get both Access filtering on who’s allowed to read the page, and it is filtered on PageIsPublished aswell. Quite nice and saves some codelines.
Does anyone have other/better ideas?
EDIT/UPDATE:
Tore Gjerdrum, at Epinova, had some ideas about IEnumerable and PageList, saying that PageList is not a very good friend of Linq and that may cause some issues. Things will compile even if you use IEnumerable and even the Where() chained method but it will fail runtime because of PageLists lacking Linq support. To remedy this he suggested to call ToList() on the datacollection and return the datacollection. I would even think that just returning a PageDataCollection instead of IEnumerable<PageData> is a good solution.
Relate+ and PageTypeBuilder
Posted by on August 19, 2010
Recently I started a new EPiServer Relate+2 project and wanted to use the fabulous PageTypeBuilder. I realized fast that this was no easy feat due to the extra inheritance from TemplatePage to PageBase that is introduced in Relate+ and the use of generics. I am no racer in this field and together with Joel Abrahamsson and Håvard Grendal, I explored some solutions. Thanks to Joel for giving us some tips and hints we found the solution (yet not thoroughly tested but proof of concept is established); make another layer of inheritance. We (mostly Håvard Grendal) looked into the EPiServer TemplatePage class and the PageTypeBuilder TemplatePage class and found we needed to add this class to our project and set our pages (the ones that we wish to use PTB on) to inherit from this class.
public abstract class CustomTemplatePage<T> : PageBase where T : TypedPageData
{
// Methods
protected CustomTemplatePage()
: this(0, 0)
{
}
protected CustomTemplatePage(int options)
: this(options, 0)
{
}
protected CustomTemplatePage(int enable, int disable)
: base(enable, LoadCurrentPage.OptionFlag | disable)
{
base.CurrentPageHandler = new LoadTypedCurrentPage<T>(this);
}
// Properties
public T CurrentPage
{
get
{
return (T)base.CurrentPage;
}
}
}
Now we can intherit from CustomTemplatePage and use a PTB class on our pages like this:
public partial class MyTypedPage : CustomTemplatePage<PageTypes.MyTypedPage>
We also set PageBase to be an abstract class and implemented two constructors in this class
public PageBase(int enable, int disable) : base(enable, disable)
{
}
public PageBase()
{
}
Thank you Joel and Håvard for your invaluable help!
Me loves PageTypeBuilder Snippets long time
Posted by on August 18, 2010
I’ve been using the amazing PageTypeBuilder extension to EPiServer CMS written by Joel Abrahamsson for a couple of projects now, and as a lot of other developers, I love it. Life just is better with PTB. But, writing out all those PageTypeProperties can be a bit tedious but there is an answer, and the answer is Snippets!
I’ve never been an avid snippet user, save the old built in Visual Studio shortcuts for for, if, foreach and try, but I discovered Erik Nordins snippets that he made for PTB, and now I am a happier person!
For instance writing “ptpstring” will write out at PageTypeProperty of a string, with all the wondrous attributes one may need, and the writeout is tabable, so you need only tab and type 🙂
As an example, writing ptpstring gives you the following code:
[PageTypeProperty(EditCaption = "Headline for property",
HelpText = "Help text for property",
SortOrder = 100,
UniqueValuePerLanguage = true,
Required = false,
Searchable = true,
Type = typeof(PropertyString))]
public virtual string PropertyName
{
get;
set;
}
Easy, peacy, lemon squeezy 🙂






