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".
  • BennyM – Page 3 – Benny Michielsen
    OnModelCreating DbModelBuilder modelBuilder not possible only executed once var tableName schemaService LookupTheTableName loggedInCustomer modelBuilder Entity Customer ToTable tableName base OnModelCreating modelBuilder Useless approach since the model isn t being build again MvcApplication1Context myContext new MvcApplication1Context customer1 schemaService var csts context Customers ToList will go to the same tables as before because OnModelCreating is only executed once myContext new MvcApplication1Context customer2 schemaService var otherCsts context Customers ToList There is a constructor though on the DbContext class that takes a compiled model and using that one does allow you to tweak the mappings you are using in your application This also allows you to work with models that have been generated with a designer from 4 0 to use with the DbContext API build config from scratch DbModelBuilder builder new DbModelBuilder DbModelBuilderVersion V4 1 builder Configurations Add new EntityTypeConfiguration Customer lets change something for each customer var schemaName schemaService LookupTheTableName loggedInCustomer builder Entity Customer ToTable schemaName use the constructor that takes a compiled model context new MvcApplication1Context builder Build context Database Connection Compile You could then cache the compiled model for each customer so you don t need to take that hit every time Works like a charm I ll try to make it a bit easier to use Author BennyM Posted on 21 05 2011 21 05 2011 Categories Software Development 18 Comments on Entity Framework 4 1 Change mappings at runtime Entity Framework 4 1 Supporting Enums One of those features you think are so trivial are hard to miss if you use that latest new tool One of those is enum support in Entity Framework 4 1 just like in all other versions of the framework it just isn t there There is though a way to get around it unfortunately it does mean changing your model just a tiny bit In the sample class model I used for my previous posts on mapping inheritance each movie had an enum value to hold its media type DVD Bluray You won t see it mapped by default in your database if you use Entity Framework 4 1 out of the box So having the enum property there isn t enough you have to explicitly add an int property like below Required public virtual EMediaType MediaType get set public virtual int MediaTypeId get return int MediaType set MediaType EMediaType value And change your model mapping a bit inside your DbContext class if needed protected override void OnModelCreating DbModelBuilder modelBuilder modelBuilder Entity Movie Property x x MediaTypeId HasColumnName MediaType IsRequired base OnModelCreating modelBuilder You can still use the enum property in the rest of your application which I encourage Author BennyM Posted on 21 05 2011 Categories Software Development 5 Comments on Entity Framework 4 1 Supporting Enums NuGet install all packages referenced by a project When you install packages in a project using NuGet you probably don t want to include those in your version control system When you want to share some code in a blogpost you don t want

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


  • BennyM – Page 12 – Benny Michielsen
    trying to get this working under Leopard Just had to complain about it to be continued for sure Author BennyM Posted on 06 05 2008 Categories Computer Tags blablabla documentation open source Leave a comment on Open source 1 Benny 0 New project MailConverter I ve started work on an Outlook plugin to convert the mailbox to various other formats In my case to mbox so I can import my mails in Apple Mail The library will be able to be used in other applications as well but that won t be the main goal The source code is hosted at Google and can be found here Project progress will be reported on this blog Author BennyM Posted on 05 05 2008 Categories Computer Tags converter mbox outlook pst Leave a comment on New project MailConverter Using the MacBook While delving through the Monodevelop bug tracking pages one submitter stated that while the control click combination didn t work to get the appropriate context menu you could work around it by using a two button mouse Why didn t I think of that I plugged the mouse of my other laptop in and boom I had context menus in Monodevelop Technology of two competitors working together I took the picture with my iPhone and was able to convert it with iPhoto One shortcoming however was that when you export a photo it allows you to change the size to small medium large and full size I was missing the size in pixels here the only way to find out what the program does is to do the export and look at the new file The new thumbnail now had to move to the blog so where s the ftp program Well there isn t you can connect Finder to an ftp server but that only allows one way traffic I could have used the terminal and start ftp from the command prompt but who wants to use that On the Apple site I found a link to Transmit which has an idiot proof interface perfect for me Author BennyM Posted on 29 04 2008 Categories Computer Tags ftp leopard macbook mouse Leave a comment on Using the MacBook Monodevelop on Leopard Since last week I m the proud owner of a MacBook and I m exploring this new world I want to try out Mono with Monodevelop since I m a net developer but their Mac support seems to be lacking I m using the latest version of Mono 1 9 1 3 and Monodevelop 1 0 and am unable to add any projects to a solution The documentation states I need to right click control click on a Mac right the solution and then select Add new Project but I don t get any context menu I m guessing it s my own fault and not theirs Where s my menu Edit after going through the MD bug tracking pages I found several issues related to this behaviour bug

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

  • Software Development – Page 3 – Benny Michielsen
    void OnModelCreating DbModelBuilder modelBuilder not possible only executed once var tableName schemaService LookupTheTableName loggedInCustomer modelBuilder Entity Customer ToTable tableName base OnModelCreating modelBuilder Useless approach since the model isn t being build again MvcApplication1Context myContext new MvcApplication1Context customer1 schemaService var csts context Customers ToList will go to the same tables as before because OnModelCreating is only executed once myContext new MvcApplication1Context customer2 schemaService var otherCsts context Customers ToList There is a constructor though on the DbContext class that takes a compiled model and using that one does allow you to tweak the mappings you are using in your application This also allows you to work with models that have been generated with a designer from 4 0 to use with the DbContext API build config from scratch DbModelBuilder builder new DbModelBuilder DbModelBuilderVersion V4 1 builder Configurations Add new EntityTypeConfiguration Customer lets change something for each customer var schemaName schemaService LookupTheTableName loggedInCustomer builder Entity Customer ToTable schemaName use the constructor that takes a compiled model context new MvcApplication1Context builder Build context Database Connection Compile You could then cache the compiled model for each customer so you don t need to take that hit every time Works like a charm I ll try to make it a bit easier to use Author BennyM Posted on 21 05 2011 21 05 2011 Categories Software Development 18 Comments on Entity Framework 4 1 Change mappings at runtime Entity Framework 4 1 Supporting Enums One of those features you think are so trivial are hard to miss if you use that latest new tool One of those is enum support in Entity Framework 4 1 just like in all other versions of the framework it just isn t there There is though a way to get around it unfortunately it does mean changing your model just a tiny bit In the sample class model I used for my previous posts on mapping inheritance each movie had an enum value to hold its media type DVD Bluray You won t see it mapped by default in your database if you use Entity Framework 4 1 out of the box So having the enum property there isn t enough you have to explicitly add an int property like below Required public virtual EMediaType MediaType get set public virtual int MediaTypeId get return int MediaType set MediaType EMediaType value And change your model mapping a bit inside your DbContext class if needed protected override void OnModelCreating DbModelBuilder modelBuilder modelBuilder Entity Movie Property x x MediaTypeId HasColumnName MediaType IsRequired base OnModelCreating modelBuilder You can still use the enum property in the rest of your application which I encourage Author BennyM Posted on 21 05 2011 Categories Software Development 5 Comments on Entity Framework 4 1 Supporting Enums NuGet install all packages referenced by a project When you install packages in a project using NuGet you probably don t want to include those in your version control system When you want to share some code in a blogpost you don t

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

  • Software Development – Page 7 – Benny Michielsen
    on 10 11 2008 Categories Software Development Tags apple iPhone techtalk Leave a comment on iPhone Tech Talk Amsterdam Dutch alt net If you re into alt net and speak dutch though it s not really required you might be interested in the dutch alt net group The plan is to have regular meetings with like minded people to discuss and demonstrate the merits and drawbacks of different approaches in net development For the next meeting we re trying not to have an agenda let s see where that goes Author BennyM Posted on 16 09 2008 Categories Software Development Tags alt net Leave a comment on Dutch alt net Adding transactions and exploring the BindingList I stopped working on my todo sample after all the frameworks were playing nicely together and my todo list was displayed Next up was adding edit capabilities At work I normally use Spring Aop to inject an INotifyPropertyChanged implementation into the objects I pass to the view but since I m trying out new stuff here I turned to the default Net BindingList to support change notification I m actually quite happy with the capabilities that are provided for now at least The BindingList has a ListChanged event which gets fired if either a property of an object in the list gets changed or the list itself is modified For my basic sample here this is more then enough Something I struggled with however was how to turn off notifications while the list is being populated with data which improves responsiveness of the UI After some googling I found that you had to call ResetBindings strange that I didn t find anything on MSDN that told me how to work in this scenario I might need to pick up a book on Windows Forms development though professionally I work with WinForms 99 of the time when I need to create a UI who knows what other goodies I m missing out on public void SetDatasource List TodoDto todos todoDtoBindingSource RaiseListChangedEvents false todoDtoBindingSource DataSource todos todoDtoBindingSource RaiseListChangedEvents true todoDtoBindingSource ResetBindings false With the UI now raising events when the user makes changes the presenter that is listening had to keep track of the changes and forward them to the webservice when the user wants to save his work The code I ve written for that isn t rocket science or hard to grasp It boils down to what is transferred between the client and the server public enum ChangeType Added 0 Changed Deleted public class TodoEditDto public virtual Guid EditId get set public virtual TodoDto EditedTodo get set public virtual ChangeType ChangeType get set The ChangeType indicates what has happened the item was added changed or deleted The TodoEditDto wraps the edited dto adds a ChangeType and EditId property The EditId is generated on the client and used to identify newly saved objects when the server sends back the Id s that were generated when the todo was persisted That way a new created todo can be edited right away after saving it saved data to server foreach var persistedEdit in response PersistedEdits var foundEdit from edt in editedTodos where edt Value EditId Equals persistedEdit EditId select edt Value First foundEdit EditedTodo Id persistedEdit EditedTodo Id With some basic editing now in place some work is still needed in the UI let s now add transactional support to our save method Spring Net allows you to add this capability declarative or programmatic and even within these two approaches there are several ways to achieve your result At work I ve always used the declarative way using AutoProxy and the Transaction attribute To make that work you need to add a reference to Spring Data add the attribute to the methods that need to be transactional and add the following object definitions to your configuration object id AutoProxyCreator type Spring Aop Framework AutoProxy DefaultAdvisorAutoProxyCreator Spring Aop object id TransactionAdvisor type Spring Transaction Interceptor TransactionAttributeSourceAdvisor Spring Data property name TransactionInterceptor ref TransactionInterceptor object Transaction Interceptor object id TransactionInterceptor type Spring Transaction Interceptor TransactionInterceptor Spring Data property name TransactionManager ref TransactionManager property name TransactionAttributeSource ref AttributeTransactionAttributeSource object object id AttributeTransactionAttributeSource type Spring Transaction Interceptor AttributesTransactionAttributeSource Spring Data object Transaction TransactionPropagation Required public SaveEditedTodosResponse SaveTodos SaveEditedTodosRequest request do stuff At runtime Spring Net will create a proxy for each service that has the tranascation attribute declared on its methods and manage the transaction from in that generated class Everything you ve written will be transactional from that point until the method that is being called is completed For now however let s use the TransactionProxyFactoryObject To use this approach I only need to change my service definition Through the transaction attributes property I can define which methods need to be transactional in this case any method that starts with Save The target property can be any object in your context object id TodoService type Spring Transaction Interceptor TransactionProxyFactoryObject Spring Data property name PlatformTransactionManager ref TransactionManager property name TransactionAttributes name values add key Save value PROPAGATION REQUIRED name values property property name Target object type TodoCore AppService TodoService TodoCore property name TodoRepository ref NhnTodoRepository object property object With this in place we now have a basic application which is workable in a test environment Speaking about tests I really need to add them to the project I m not a very good TDD er myself though I m convinced it is the way to go I should start applying it SampleApplication04092008 rar 2 95 mb Author BennyM Posted on 05 09 2008 Categories Software Development Spring NET Tags transactions Leave a comment on Adding transactions and exploring the BindingList Using Spring Net SQLite and NHibernate I was planning to put a quick spike together on putting single sign on using CardSpace OpenID and Windows Live into an application to test it out for a project at work Maybe it was because of the weekend but I was quite enthusiastic and added several technologies to the sample which I had never

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

  • Reduce PDF file size – Benny Michielsen
    Choose your PDF then select File Export In the dialog you now get choose as Quartz Filter Reduce File Size hit save You now have a PDF the fraction of the size of the original without any noticeable quality loss depending on the original file I ve been able to create a 1 MB PDF from an original of 60 while the pages document was 100 MB Author BennyM Posted on 01 03 2009 Categories Computer Tags apple mac Leave a Reply Cancel reply Your email address will not be published Required fields are marked Comment Name Email Website Post navigation Previous Previous post This week on my screen 2 Next Next post Migrating from asmx webservices to WCF with Spring Net Search Search for Search Follow me Recent Comments Rick on Partitioning and wildcards in an Azure Data Factory pipeline BennyM on WCF HTTPS And Request Entity Too Large Justin on WCF HTTPS And Request Entity Too Large The Morning Brew Chris Alcock The Morning Brew 2052 on Getting up and running with Mono and Raspberry Pi 3 bhldev on Exposing iCal data in WebAPI Archives March 2016 February 2016 August 2015 July 2015 June 2015 May 2015 April

    Original URL path: http://blog.bennymichielsen.be/2009/03/01/reduce-pdf-file-size/ (2016-04-29)
    Open archived version from archive

  • Computer – Page 2 – Benny Michielsen
    easier than expected First turn over your MacBook so the top is facing the table Make sure you have a clean and soft surface to avoid any scratches Use a 10 cent piece to turn the lock next to the battery to the unlocked position The battery will pop out Remove the battery Use a cross screwdriver to remove the three screws of the plate protecting the memory and the hard disk They are very small so use your smallest screwdriver you can find Next pull the plate away you now have access to the memory By using the lever per memory slot the ram sticks will pop out making place for the new ones Gently push them in until you hear a click Done Author BennyM Posted on 16 12 2008 Categories Computer Tags macbook memory Leave a comment on Replace MacBook memory Installing a Scythe Mini Ninja After using my htpc for 4 months I sometimes became annoyed of the noise being produced by the system It varied from day to day so I decided to do something about it There were only 4 fans in the system one on the cpu two on the side of the case to get airflow going and one to cool down the psu The loudest one was the stock cpu cooler closely followed by the psu fan The two 120mm fans are already quite good After searching on the internet for a passive cpu cooler it seemed that the Scythe Mini Ninja was quite popular and ideal for the system that I have assembled No computer parts shop in Belgium had it or they were quite expensive so I purchased one on eBay In the package you find thermal paste 3 mounting systems meaning universal socket support screws one fan clips to attach the fan and one big heatsink When removing the stock cpu cooler I noticed that there was not much of thermal paste on the standard heatsink so removing any residue was quite easy I also ignored all the advice of installing the Ninja outside the case which would mean dismantling the htpc In the end it didn t save me that much time since I had to remove the ram and some of the power cables to install the heatsink also if you ve got thicker fingers than me you probably won t be able to reach all of the pins used to attach the Ninja to the motherboard Make sure to apply an even layer of thermal paste on the cpu you won t need to use all of it since too much is as bad as too little I powered the system back on again changed the bios to allow the absence of a cpu fan and off it went With the top of the case screwed back into place I first thought the upgrade didn t change a lot but I was sitting at 20cm from it When I had placed the htpc back into

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

  • Computer – Page 4 – Benny Michielsen
    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 make sure you have the correct cables etc for your tv Mine has a dvi port and a 3 5mm audio port so I could use the cables I already had Author BennyM Posted on 14 04 2008 Categories Computer Tags apple hd home theater htpc mac mac mini movie 1 Comment on HTPC high definition for the masses diNovo Mini Today arrived the final pièce de résistance of my HTPC a diNovo Mini keyboard When I assembled my mediacenter a couple of months ago I was looking for something to control it but I did not really want a full fledged keyboard and also didn t want an average remote The diNovo Mini is the perfect balance between the two It s small enough to be stored in a drawer or to lie on a table like your normal remote would but still has the power of a full keyboard Granted typing with ten fingers is faster but this keyboard did not require any getting used to in fact I m typing this blog entry with it If you ve had a pda or smartphone with a keyboard you ll feel right at home The best feature I ve discovered until now is the ok button which you can press with your left thumb while your scrolling with your other hand Very ergonomic The keyboard is also backlit orange meaning normal and green media center style It would appear that there is a light sensor on it so if there s enough light in the room the battery will be saved The lights of the keyboard and the clickpad also work seperately meaning that the keyboard lights only go on when you use it again to prevent waisting power The battery is a cell phone like model a charger is included as well as a cleaning aid to remove any fingerprints on the cover There s also a cd included haven t used it though I read that it comes with a program to bind key combinations to actions The clickpad however will need some time to grow on you since sometimes it s very sensitive and the other minute it s not very responsive this is the only negative remark I have for the moment I ll conclude with some picture my apologies for the bad quality you can click on them to see a bigger picture Author BennyM Posted on 08 04 2008 Categories Computer Tags dinovo htpc Leave a comment on diNovo Mini

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

  • Global Azure Bootcamp 2015 – Belgium – Benny Michielsen
    introduced the basic concepts of machine learning and how they relate to concepts in AzureML I created one experiment to predict the income level of somebody based on sample labs you can find in AzureML For the second half of my talk I had created an online movie database how original I used the API of The Movie Database to get some realistic data I then created an experiment in AzureML to get suggestions for these movies I closed with some info on what I ve been working on in my spare time Learning about machine learning really interesting service to use in your handlers messagehandler globalazure pic twitter com rUjpn7SzpK Yves Goeleven YvesGoeleven April 25 2015 The fourth session was presented by Hans Peeters and Glenn Dierckx They had created an enormous demo around everything App service related They started off with an API service and eventually created a Web App a mobile app and closed by creating a logic app which combined everything they had done so far The final session was presented by Reinhart De Lille Not a deep dive in technology this time his talk showed the other side of the coin How to get your company from on premise to a cloud first world Quite a way to end the day as many of the attendees probably don t dwell on this much I ve gathered the slides here People could also deploy compute instances to aid in breast cancer research At the end of the day 117 billion data points were analysed and little Belgium was on the in the top 10 of contributing countries Looking forward to next year Author BennyM Posted on 29 04 2015 05 05 2015 Categories Software Development Tags azure 1 thought on Global Azure Bootcamp 2015 Belgium tummac

    Original URL path: http://blog.bennymichielsen.be/2015/04/29/global-azure-bootcamp-2015-belgium/?replytocom=33760 (2016-04-29)
    Open archived version from archive