archive-be.com » BE » B » BENNYMICHIELSEN.BE

Total: 348

Choose link from "Titles, links and description words view":

Or switch to "Titles and links view".
  • July 2008 – Benny Michielsen
    the application you are using Author BennyM Posted on 13 07 2008 Categories Computer Tags blog blogengine tools 1 Comment on Blogging tools Initializing an array with arrayWithObjects If you re creating an array and adding objects to it at initialization in Cocoa don t forget that the last element of the list needs to be nil it ll save you debugging time NSMutableArray array NSMutableArray arrayWithObjects one two three four nil Developer reference Author BennyM Posted on 13 07 2008 Categories Software Development Tags cocoa Leave a comment on Initializing an array with arrayWithObjects Cocoa Programming for Mac OS X Ch 19 21 After a little Cocoa break I m back while continuing through the book I seemed to have forgotten some stuff already not good So next up Keyboard Events This chapter explains how the events are used for handling keystrokes as well as the first responder concept The first responder being the active view element button text area and there s a whole mechanism working in the background when the first responder changes Not a lot of ground breaking material here probably the most important piece of code here is an example of how to code the fuzzy blue box around an active custom view Chapter 20 Drawing text with attributes Here we are taught how to show strings in various formats not that interesting One nice feature however is that all the drawing commands you write can be converted into PDF by the AppKit framework Chapter 21 Pasteboards and Nil Targeted actions The clipboard in Windows pasteboard in OS X Different name same concept although I ve never read about it in any Net book I ve seen but you know what it does What you need to remember from this chapter is that you can do a lazy paste Meaning that you don t have to put it in the clip errr pasteboard when the user presses the copy command You can wait until he presses paste very valuable if you re working with large quantities of data Nil targeted actions are best explained with an example You can set the selector method signature for net people of a menu item to anything you want say removeEmployee when the menu item s target is nil and the menu item is invoked it will traverse the responder tree until someone acts upon it Nothing fancy was covered in these past chapters but you need to know about these things I did spend quite some time on the applications probably because there was a two week pause For those interested I ve attached all the source code As always you can get the book here TypingTutor Chapter 19 zip 46 44 kb TypingTutor Chapter 20 zip 53 47 kb TypingTutor Chapter 20 Challenge 1 zip 53 73 kb TypingTutor Chapter 20 Challenge 2 zip 57 89 kb TypingTutor Chapter 21 zip 53 58 kb TypingTutor Chapter 21 Challenge 1 zip 53 75 kb RaiseMan Chapter 21 Challenge

    Original URL path: http://blog.bennymichielsen.be/2008/07/ (2016-04-29)
    Open archived version from archive


  • June 2008 – Benny Michielsen
    OS X Ch 13 16 I ve been busy at work so haven t made as much progress in the book as I wanted the chapters I did cover however were great Chapter 13 User Defaults In chapter 12 a preference screen panel was introduced a preference menu item is standard in a default application In OS X preferences are automatically stored under Library Preferences To access them you can use the NSUserDefaults class which has a standardUserDefaults method and returns an NSMutableDictionary When the application starts you need to enter your defaults in that dictionary and call the registerDefaults method Any changes the user makes are persisted to the location stated above just make sure whatever you put into it can serialize itself In the rest of your application you can just read or set values in that dictionary it s automatically saved In Net you d use user specific application settings which are stored in the app config Chapter 14 Using Notifications Something which is definitely missing in the Net framework is a Pub Sub mechanism There is one available in the EnterpriseLibrary and in Spring Net but it s great to see this in Cocoa Every running application has an instance of NSNotificationCenter an observer can ask to be notified of certain events certain events of a certain object or all events of a certain object A publisher will tell the NotificationCenter about the notification it wants to send The NotificationCenter will look up the observers and call the method that was supplied when they subscribed I just recently needed this in a very large application having it at hand would certainly have saved time Chapter 15 Alert Panes In the Net world the MessageBox The only big difference here is that here they can be run modally meaning no other windows will receive events until it is closed or as a sheet meaning it s specific to a certain form Chapter 16 Localization Again this can be compared to the work you need to do in Visual Studio and Net the main difference here is that you can pretty easy extract the strings that need to be localized This is probably possible in the Net world too with some sort of plugin but it s always nice to see it build in like the notifications I m now half way through the book and can say that it s a very pleasant one to read you can get it here I ve also adjusted my view on Objective C and Cocoa while at first it seemed a bit rough and basic I m beginning to see that it s full featured language and framework with very advanced capabilities which don t require a lot of code Though the real challenge will be to build a real application after I ve completed the book I m still staring at the screen sometimes wondering why I got three errors when there s only a missing Oh yeah thanks

    Original URL path: http://blog.bennymichielsen.be/2008/06/ (2016-04-29)
    Open archived version from archive

  • May 2008 – Benny Michielsen
    base type is done in the Objective C world by using the super keyword Chapter four talks about memory management This was fairly new for me I knew about it but I ve only written programs in Net C Vb Net managed C or J2EE Java and both environments come with the garbage collector GC which manages memory for you Mac OSX 10 5 introduced the GC as well but it s an option If you turn it on your application will only run on 10 5 and later so if you want to target previous versions you ll have to release and retain yourself It was an interesting read I never had seen an example of how memory can be managed in code you write I ll probably just turn the GC on for stuff I write The chapter ends with stating that you should now have a basic understanding of Objective C and Cocoa and that the next chapters will focus on the different frameworks you can use to build your applications Chapter five introduces some user interface components available in the IB buttons textboxes nothing big here although I encourage you to write the challenge application Challenges in the book are exercises which you should be able to write Attached you find the challenge exercise from chapter five countline the guided application speakline also from chapter five and the lottery application from chapter three and four CountLine zip 55 52 kb lottery zip 16 43 kb SpeakLine zip 52 62 kb Also I apologize for the layout of the code in this post I ll fix that as soon as I can Objective C isn t supported by default Author BennyM Posted on 28 05 2008 Categories Software Development Tags book c cocoa development objective c programming Leave a comment on Cocoa Programming for Mac OS X Ch 1 5 Select boot type Got a new desktop at work a massive quad core and during the installation I was greeted by the following message Author BennyM Posted on 24 05 2008 Categories Computer Tada Tags bug crash Leave a comment on Select boot type Mac keyboard and mouse I wanted to use my PC screen when I m sitting behind my desk and working on the MacBook choosing between 13 and 22 display is easy The side effect of that was that my head is constantly on a 45 degree angle compared to my body which tends to be less than comfortable after a while I couldn t connect my keyboard with a PS2 connector since there is no port of that type on the MacBook or for that matter any laptop I know of So the Apple stakeholders just got a bit richer and I now have a wireless Apple mouse and keyboard Installation is child s play unbox the items add the included batteries in their container set up the bluetooth devices can be found on the upper right corner of your desktop turn the

    Original URL path: http://blog.bennymichielsen.be/2008/05/ (2016-04-29)
    Open archived version from archive

  • April 2008 – Benny Michielsen
    mini itx based system scared me I also didn t find any case which would take two 3 5 devices DVD BD ROM and hard disk and two full sized expansion cards So I just went for micro atx the path others had taken before me These sites proved to be very informative Vista XP Media Center Community AVS Forum Silent PC Review I read through the links above googled asked my colleagues and compiled my final list of components Case Antec NSK2480 Black Motherboard Asus P5B MX CPU Intel Core 2 Duo E4600 RAM 2GB Kingston 667 Mhz Harddisk Samsung HD SpinPoint T133 500GB SATA II 7200 Optical Drive Pioneer BDC 202BK Wlan DLink DWL G122 GPU Asus Radeon 3450 256 MB Let me comment on these I did not want the case to look like a computer this one has more of a HIFI look and it comes at a reasonable price The only thing I feared was that the front panel is silver while my optical drive is black The two did however fit together For the motherboard I went for the most basic around with enough connection abilities Asus has a variant of this one with onboard wifi but since I ve had problems in the past with wireless products of different manufactures working together I chose this one and added a wifi dongle to the shopping list I maxed out the RAM since memory these days has never had such low prices The hard disk with 500GB is more than enough I don t plan to use it to store data indefinitely but you can never have enough space The graphics card had to be able to play back high definition content but nothing more I was not going to play games or do any photo editing on this machine Now the only thing left was an affordable optical drive the Pioneer BDC 202BK was just what I needed It can play Blu Rays DVDs and CDs and burn DVDs and CDs Perfect As operating system I chose Windows Vista Home Premium since that s the model that comes with Media Center The end result is actually quite a powerful device which can play high definition content up to 1080p from it s hard drive the internet or from it s optical drive It can do all I that I was looking for and more The only improvement you can make on this build in my opinion is removing the CPU cooling unit that comes with the processor and place either the Antec board that controls the airflow for more information go to the product page or use a more silent cooler from Zalman or Scythe since the only noise that comes from the machine is the standard Intel cooler But I only hear it when no movie is playing so it s not that big of an issue for me Should you use this as reference for your own build don t forget to

    Original URL path: http://blog.bennymichielsen.be/2008/04/ (2016-04-29)
    Open archived version from archive

  • March 2008 – Benny Michielsen
    plenty more I could talk about but you ll be able to find all of it on the internet a good place to start is the Apple site So what s my advice on this new toy Great device it has a nice user interface is more stable than my Windows Mobile device doesn t hang as much as the htc but it isn t perfect There are improvements that should be taken care of for instance the keyboard doesn t follow the rotation of your iPhone in all applications Also I don t think the device is for everyone while I enjoy having my mails with me all the time and have the capability to go online everywhere anytime I m not Mr everyday consumer Most people will settle for a simple cell phone and MP3 player which you can both get for 1 4th of the price But hey don t listen to me you won t regret having the device and the Apple marketing machine will probably do it s best to convince you it s the next best thing Below is a side by side comparison for the size From left to right a Nokia 5510 a HTC s710 an iPhone There s a screen protector with some air between it and the screen on the htc and some fingerprints on the iPhone All can be removed easily Author BennyM Posted on 31 03 2008 Categories Computer Tags apple htc iPhone mobile phone review smartphone windows Leave a comment on The iPhone has landed H A A R P Want to listen to a cd that will blow you away Get it now Nuff said maybe I m a little biased but still Author BennyM Posted on 31 03 2008 Categories Music Tags cd mind blowing muse Leave a comment on H A A R P Windows update problem For some reason if you ve studied informatics people tend to believe you can fix their computers I really don t like cleaning up the mess other people create since most of the time it s a trivial task Just read the error message or go to the all mighty google and you ll be able to fix most problems However the latest problem I encountered was more of a challenge After formatting the hard disk and installing a fresh copy of Windows XP I let it update itself leading from one error to the next So I turned off automatic updates went to the update site myself selected all the available updates crash Although some updates were installed successful some kept on crashing the windows update process After trying several things the solution that worked in the end was to create two folders c temp and c wutemp and clear all the contents of the folder SoftwareDistribution which is under the root directory of where you installed Windows Note that for this last step you need to turn off the running Automatic Update service To do

    Original URL path: http://blog.bennymichielsen.be/2008/03/ (2016-04-29)
    Open archived version from archive

  • Benny Michielsen › Log In
    Benny Michielsen Username Password Remember Me Lost your password Back to Benny Michielsen

    Original URL path: http://blog.bennymichielsen.be/wp-login.php (2016-04-29)
    Open archived version from archive

  • BennyM – Page 2 – Benny Michielsen
    model binder will use all the registered value providers to create a match Since we ve registered our IfModifiedValuesProviderFactory in the WebAPI configuration it will be automatically picked up If a user of our API uses a query string to pass along the ifModifiedSince value that will keep working as well If we add a CookieValueProvider in the future we will only have to implement the value provider and add it to the configuration of our application We will not have to inspect every method to see where we should add them explicitly Best of both worlds There s a nice poster of the lifecycle of an HttpRequestMessage on MSDN which includes an illustration on how model binding works Author BennyM Posted on 17 11 2013 17 11 2013 Categories Software Development Tags binding WebAPI 2 Comments on Model binding with Headers in ASP NET WebAPI Exposing iCal data in WebAPI With ASP NET Web API it s now easier than ever to create lightweight HTTP services in NET Out of the box the ApiControllers you implement can read json xml and form encoded values from the HTTP request but also write xml and json to the HTTP response HTTP has the concept of content negotiation This means that when a client requests a resource it can tell the server that it wants the result in a specific format Below you can see an HTTP request that requests json And in the HTTP response the data is formatted accordingly If the client requests the response to be formatted as xml Then the result will be returned as xml This mechanism can be extended to support different kind of formatters to read from or write to the body of a request or response Let s say we want to support an additional format that can write appointments in iCal format To create a custom formatter you inherit from BufferedMediaTypeFormatter or MediaTypeFormatter For this example I chose the first one The code is pretty straightforward and represents a very simple implementation of the iCal standard The only WebAPI specific code can be found in the constructor There we add the mapping for the headers we want the formatter to be invoked for After we add the formatter to the configuration object it will be invoked automatically whenever a client says it accepts text iCal The current setup works fine in Fiddler or when you use a custom client JavaScript or HttpClient But for a true end to end sample I want to use Outlook to connect to my appointment service Unfortunately Outlook does not send an accept header with text iCal when it requests resources from an internet calendar So we need to work around this problem Here another extensibility point of ASP NET Web API comes into play MessageHandlers MessageHandlers allow you to plug into the request processing pipeline on its lowest level You can inspect the request and response message and make changes In this case we can inspect the user agent that is added to the request when Outlook contacts our service When we find a match we will add an additional header to the incoming request We also add this message handler to the configuration object We now have everything in place to add an internet calendar in Outlook and view the appointments in our WebAPI Open Outlook Go to Calendar In the ribbon click on Open Calendar and then From Internet Fill in the url of the AppointmentService in WebAPI i e http localhost 58250 api appointments Click Ok You now have one AppointmentController serving json xml and iCal The complete source can be downloaded here Author BennyM Posted on 11 11 2013 Categories Software Development Tags iCal outlook WebAPI 2 Comments on Exposing iCal data in WebAPI Update MVC4 project to MVC5 within Visual Studio If you are using VS2012 and start a new ASP NET MVC4 project you will be greeted by an enormous list of packages which can be updated when clicking through to the NuGet package managers With the new release of Visual Studio 2013 MVC5 WebAPI2 a lot of new binaries are ready to be used in your application So updating the packages in Visual Studio should get you going After clicking yes and I agree several times though you will receive this error message If you now close the NuGet package manager and then open it again only one package needs to be updated at the moment ANTLRv3 So click update once more If you now start the application instead of receiving a nice MVC start screen you will run into a yellow screen of death We are almost there Navigate to the Web config inside of the Views directory and change all references from MVC 4 0 0 0 to 5 0 0 0 and the Razor version from 2 0 0 0 to 3 0 0 0 I ve included the changes in this gist You are now ready to go UPDATE Ran into t his MSDN article which shows you the steps I mentioned and more Author BennyM Posted on 02 11 2013 11 11 2013 Categories Software Development Tags mvc visual studio Leave a comment on Update MVC4 project to MVC5 within Visual Studio MetroMvc with dotless I ran into the MetroMvc GitHub project a week ago It contains stylesheets to give your web application a Metro look The only downside being it uses a 3rd party tool to convert the less files into css In order to address this issue I ve forked the project and made the necessary changes to make it work with the dotless NuGet package You can get it here Author BennyM Posted on 17 08 2012 17 08 2012 Categories Software Development Leave a comment on MetroMvc with dotless SignalR Ninject and WebActivator sitting in a tree On a project I ve been working on I ve been having some issues with combining these technologies We already had an MVC application

    Original URL path: http://blog.bennymichielsen.be/author/bennym/page/2/ (2016-04-29)
    Open archived version from archive

  • BennyM – Page 13 – Benny Michielsen
    on its side and you get a panoramic view it s just amazing boom This is significantly better than on the htc but webmasters should still think about the footprint of their site on smartphones I read the news on the mobile version of tweakers and while I could use their normal version I still prefer the lighter one It loads faster has less graphical content just because the iPhone can display a full web page in all its glory doesn t mean you can forget people are using other devices to visit your site The Youtube integration is a cool feature as well I was able to get youtube content on my htc with vTap but no way near the sound and video quality I now have Sending mail nothing special here Except ofcourse the touchscreen enables the nice scrolling feature which you have in all iPhone applications There is integration with for instance google mail and you get imap integration if supported by the mail provider But I just stick to the regular pop3 Music playback the iPhone is an iPod so you get all of the features they have and more Most notably is the coverflow which is a visual representation of your music albums So instead of moving through the folders on the disk you get more of a real life experience of going through your cd collection There is plenty more I could talk about but you ll be able to find all of it on the internet a good place to start is the Apple site So what s my advice on this new toy Great device it has a nice user interface is more stable than my Windows Mobile device doesn t hang as much as the htc but it isn t perfect There are improvements that should be taken care of for instance the keyboard doesn t follow the rotation of your iPhone in all applications Also I don t think the device is for everyone while I enjoy having my mails with me all the time and have the capability to go online everywhere anytime I m not Mr everyday consumer Most people will settle for a simple cell phone and MP3 player which you can both get for 1 4th of the price But hey don t listen to me you won t regret having the device and the Apple marketing machine will probably do it s best to convince you it s the next best thing Below is a side by side comparison for the size From left to right a Nokia 5510 a HTC s710 an iPhone There s a screen protector with some air between it and the screen on the htc and some fingerprints on the iPhone All can be removed easily Author BennyM Posted on 31 03 2008 Categories Computer Tags apple htc iPhone mobile phone review smartphone windows Leave a comment on The iPhone has landed H A A R P Want to listen

    Original URL path: http://blog.bennymichielsen.be/author/bennym/page/13/ (2016-04-29)
    Open archived version from archive