Ik geef training in frontend tools en stacks als HTML, JavaScript, TypeScript, React, Angular en Vue. Ik schrijf boeken en artikelen over tal van (ICT-) onderwerpen. Ik was lead developer en directeur bij Yindo - Jouw digitale bibliotheek. Je kunt mij volgen op Twitter(@PeterKassenaar).

In dit blog vind je persoonlijke artikelen, die niet noodzakelijk tech-gerelateerd zijn.

Views and expressions are my own.

Terug naar de algemene site.

03juli

Ervaringen MacBook Pro en Visual Studio op de Mac

Deze week ontving ik twee e-mailberichten die ik via dit blogbericht beantwoord. Ze hangen toevalligerwijs met elkaar samen en mijn ervaringen zijn waarschijnlijk voor meerdere lezers interessant. Daarom hier een gecombineerd antwoord ter vervanging van de losse e-mailtjes.

Tevreden met de MacBook Pro?

Ten eerste schreef 'Richard' het volgende

"Je filmpjes en tekst over de Macbook vond ik zeer interessant en hebben er mede toe geleid dat ik op dit moment aan het twijfelen ben ook een Macbook Pro aan te schaffen. Mijn vraag is eigenlijk of jij helemaal tevreden bent met je Macbook of dat je misschien toch liever niet de overstap had gemaakt."

(Zie hier een aantal blogberichten over mijn ervaringen met de MBP)

Ik schreef al terug dat dit een interessante kwestie is, die niet in één of twee zinnen te beantwoorden is. Mijn korte antwoord was "ik kan je in elk geval wel melden dat ik beslist geen spijt heb van mijn aanschaf, maar dat ik ook *zeker* geen Mac-zeloot ben geworden die stante pede alle Windows-machines het raam uit heeft gemikt."

En nu ik er over nadenk, zal dat ook ongeveer mijn lange antwoord zijn :-). De kern is hiermee namelijk wel genoemd. Ik kan er nog wel puntsgewijs een aantal argumenten aan toevoegen, maar deze veranderen de kern van mijn betoog niet echt. Ze geven hooguit inzicht in de manier waarop ik computers gebruik en waarop ik werk.

  1. Ik gebruik computers voornamelijk voor mijn werk. De MacBook Pro (MBP) is hierop een zeer waardevolle aanvulling. Ik kan sites en webapplicaties nu rechtstreeks testen op een ander platform – Mac OS X – en in een andere browser – Safari – zonder dat ik hiervoor afhankelijk ben van kennissen met een Mac ('ach, zou je even naar URL xyz willen kijken om te zien of het ook in een Mac goed werkt?") of van een site als browsershots.org om CSS-en andere lay-out-hickups te testen. In die zin is de MBP een productiviteitsverhogend gereedschap binnen mijn bedrijfje.
     
  2. Ook bij het geven van lezingen en presentaties heb ik erg veel aan de MBP. Het herkennen en instellen van de beamer als extern scherm is erg makkelijk. PowerPoint 2008 voor Mac schakelt automatisch naar een handige presentatie-modus waarbij op het externe beeldscherm alleen de slides worden gepresenteerd terwijl op het computerbeeldscherm extra informatie zichtbaar is zoals de aantekeningen, vorige en volgende dia, een klokje dat meeloopt enzovoort. Het schakelen tussen spaces (met diverse geopende programma's) en het in- en uitzoomen tijdens de presentatie met de multitouch trackpad is gewoon super.
     
  3. Zou ik de MBP hebben gekocht omdat het een MBP is – oftewel: een Apple? Bij de aanschaf moet ik eerlijk toegeven: Ja. Het heeft zeker een rol gespeeld. Zoals ik in mijn blogpost over de Tien pluspunten van Mac OS X al opmerkte is de computer een schoolvoorbeeld van goede integratie van hardware en software, design en usability. Ik kan niet ontkennen dat het status/imago-aspect zeker een rol heeft gespeeld.
     
  4. Interessant is natuurlijk de vraag of ik – op basis van inmiddels een klein half jaar gebruikservaring – opnieuw een Apple zou kopen? En dan moet ik ook eerlijk zijn, en zeggen "dat weet ik zo net nog niet". Ik geloof niet dat voor alledaags computergebruik een Apple met Mac OS X ontzettend veel voordelen heeft boven Windows Vista. Tekstverwerken, internetten, e-mailen, foto's bewerken; het kan op beide platformen even makkelijk.
     
    Natuurlijk heeft elk besturingssysteem zijn eigen sterke punten (Mac: Spaces, Spotlight, Time machine. Windows: startmenu, taakbalk, gigantische hoeveelheid software, om er maar een paar te noemen) en zwakke punten – of zelfs regelrechte irritatiefactoren (Mac: de Dock, Vendor lock-in bij iTunes/iPod/iPhone, Windows: omslachtige UAC-beveiliging, viruskwetsbaarheid), maar als er onder alle plussen en minnen een streep wordt getrokken ontlopen de besturingssystemen elkaar gewoon niet veel. Dat is een feit. En dan moet je zelf de afweging maken of je extra geld wilt uittrekken voor de Apple.

    En voor mij speelt dan punt 1) en punt 2) weer mee. Werk. Doet hij het? Ja. Op een prettige manier? Ja. OK. Dan werk ik er graag mee.
  5. Bottomline: ik heb geen spijt. Ik ben erg blij met mijn MBP!

Mythe ontkrachten

Laat ik dan op deze plek direct van de gelegenheid gebruik maken om een mythe te ontkrachten die ik de afgelopen tijden werkelijk als een mantra heb gehoord.

"Ja, maar de Mac is zo stabiel. Hij loopt nooit vast".

Nou, die uitspraak kan ik bij deze naar de prullenbak verwijzen. De stabiliteit (of instabiliteit, het is maar hoe je het bekijkt) van de MBP met Mac OS X zou inschatten op het niveau van Windows XP. Niet hoger. Ik maak regelmatig vastlopers mee, of rare dingen tijdens Software Updates waardoor een koude herstart noodzakelijk is.

Terwijl ik uitsluitend originele software draai en echt geen rare dingen doe of merkwaardige randapparaten aansluit (tenzij je een Nokia BT-verbinding of GPS Data Logger merkwaardige hardware vind). Het is zeker niet slecht hoor, maar laat het voor eens en voor altijd gezegd zijn: Windows Vista is stabieler dan Mac OS X 10.5. Punt.

Visual Studio 2008 op de Mac

In aansluiting op het berichtje van Richard ontving ik via het blog ook een commentaar van Bob Louwe (bij de post Dell XPS 1530 of MacBook Pro?). Hij schrijft:

"begrijp ik goed dat je inmiddels ervaring hebt met ontwikkelwerk met VS2005/8 op de Mac? Zelf ben ik .Net windows ontwikkelaar en ben benieuwd of de windows emulatie echt zo goed werkt. Wat zijn de ervaringen?"

Welnu, ook hierover kan ik in feite kort zijn.

"Ja, dat werkt prima".

Ikzelf gebruik VMWare om Windows te draaien op de Mac. Zie hiervoor de post VMWare Fusion installeren op Mac OSX, en dan vooral de commentaren hierbij. Hierin leg ik onder meer uit waarom ik heb gekozen voor virtualisatie in plaats van voor Apple's eigen oplossing BootCamp.

En gelukkig kan ik melden dat de prestaties ook met virtualisatiesoftware prima zijn. Het draaien van diverse servers (Internet Information Server, SQL Server 2005) en tamelijk zware applicaties (Visual Studio 2008 met de nodige plug-ins, Dreamweaver CS3, Flash) in de virtuele machine gaat prima! Hier ben ik erg blij mee.

Ik ondervind geen hinderlijke vertraging. Het gaat zelfs beter dan op mijn oude Dell Lattitude laptop waarop Windows native draaide. Maar goed, in de MBP zit natuurlijk ook de nieuwste dual-core Pentium processor en een flinke smak geheugen.

Vmware Fusion 2.0 (momenteel nog in de beta-fase) kan per virtuele machine worden ingesteld of bijvoorbeeld 3D-acceleratie of de tweede processorcore gebruikt moet worden (zie afbeeldingen).

Waarschijnlijk zullen de prestaties in BootCamp nog wat beter zijn, maar persoonlijk ben ik ook tevreden met de virtualisatie-prestaties.

Visual Studio on Mac OS X

En eigenlijk is het ook gewoon saai :-). Zodra je Windows via Fusion hebt opgestart, zit je gewoon in Windows te werken. Niets Apple-achtigs aan.

Wel – zeer – aangenaam is dat een eventueel tweede beeldscherm dat je aansluit ook in Fusion nu direct wordt herkend en als Windows-uitbreiding op het bureaublad aangesproken kan worden.

Zo draait bij mij thuis Visual Studio in het MBP-beeldscherm en test ik in Internet Explorer of Firefox op het externe beeldscherm. Terwijl Expose en Dashboard gewoon blijven werken. Zie bijvoorbeeld deze VMWare-video op YouTube.

 

Succes er mee allemaal!

Peter Kassenaar
-- 3 juli 2008

27juni

Clearing all items in a List Control

I am currently working on an ASP.NET project where the client needs to have a web form with about ten lists, each list containing anywhere from three or four to a couple of dozen options.

These lists are composed as a CheckBoxList, RadioButtonList or DropDownList, all based on the standard <asp:xxxList> control.

The selected items in the lists are used to build a Linq statement to query and filter a large database table. The (concept) UI of these lists are like the image below.

Clearing the list

In order to begin a new query, we figured it would be handy to have a button below each list to clear the selection of all items instead of manually deselecting every option. So I added a Clear button ('Leegmaken' in Dutch) and wrote the following code for the button. Sure, I looked through the Intellisense list for something like 'empty', or, 'deselect', but couldn't find anything.

So I assumed this was the easiest way to set the Selected state of every ListItem to false. Have a foreach() loop and loop through every ListItem in the control, setting the Selected property to false. (The bindConditionalGrid() method below the loop is for binding the GridView in the page again, to reflect the new criteria.)

Until yesterday.

ClearSelection()

By accident I was looking at the Intellisense list for a CheckBoxList control, when I stumbled upon the ClearSelection() method, which apparently had the exact same function as the little method I wrote above!

So now instead of four lines of code, I need only one. And this times ten, for the number of Clear-buttons in the page (I know, I think it is possible to write a generic method to clear a list and pass the button name or list name as a parameter, but this quick and dirty approach is suitable for now. If you have such a method, feel free to share it via a comment below :-).

Here is the MSDN page with the documentation for the ClearSelection method:

http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.listcontrol.clearselection.aspx 

Bottomline

Intellisense is your friend.

There might be prewritten methods for a task that you wish to accomplish. They might have other names than you expect :-), especially when English is not your mother tongue.

Peter Kassenaar
-- 27 juni 2008

19februari

Extending BlogEngine.NET with shadowbox

Last week I investigated options on extending the well known Lightbox 2 functionality with the ability to display other types of media files, in particular swf-files. This for the purpose of my blog, where I wanted to have a good user experience on viewing uploaded screencasts (or 'videotutorials', or 'webvideos', or whatever you call them). I fiddled with it a bit, but soon discovered it would take me quite some time to adjust it to my needs.

But behold, after just a minute of googling I stumbled upon Shadowbox Media Viewer by Michael J.I. Jackson, a piece of software released just a couple of days ago. And thankfully, it fulfilled all my needs (and quite a bit more than that!). What exactly is shadowbox? According to the site

"Shadowbox is a cross-browser, cross-platform, cleanly-coded and fully-documented media viewer application written entirely in JavaScript. Using Shadowbox, website authors can display pictures and movies in all major browsers without navigating away from the linking page."

Out of the box it works really great in static HTML, or even – semi static – ASP.NET pages. I wanted however to add it to my blog, wich is driven by BlogEngine.NET (I started this blog only on feb. 1st). It turned out to be pretty easy, and I wanted to share this experience to the world, so I dedicated a screencast to it.

Check it out - just click the image, it should load the screencast in a shadowbox itself (hey, what else did you expect :-). Please notice however that the audio quality is not optimal. It has some clicks and squeaks. I apologize for that. Other properties are:

  • A 17-minute walkthrough on extending a fresh BlogEngine.NET installation with shadowbox.
  • Starting with downloading the needed files, incorporating them to the blog, ending with adding a new post that contains 'shadowbox-ed' media like hi-res images and swf-files.
  • Please allow the video a couple of minutes to load. It should take a while, but I hope it's worth the wait. (Weird experience: Firefox loads the video a lot faster that Internet Explorer, given the same amount of bandwith…)

If this video is useful to you, or you have other comments, please feel free to leave a note.