The official Fatica Labs Blog! RSS 2.0
# Saturday, April 11, 2009

I decided to stops developing a completely new GUI for NHModeller, but I would like to use Intellipad instead. Intellipad is a higly configurable editor that ships with Microsoft "Oslo" SDK ctp. So far I wrote an initial NHModeller command line version, and decided to start writing a plugin for Intellipad, or, better a "Mode". The task is not so difficult, thanks to these blogs:

Until now i found a little annoying thing: It is not possible to add a command to the MiniBuffer without directly modifying a script that in shipped with Intellipad. It would be really nice if some extension point were exposed, so that a new mode can add new commands to the minibuffer.

 

Saturday, April 11, 2009 10:41:00 PM (GMT Daylight Time, UTC+01:00)  #    Comments [0] - Trackback
NHModeller

# Tuesday, February 17, 2009

I'm working on a little project to satisfy my idea on creating a mapping for NHibernate describing the model entities in a notepad like fashion. The application I created leverage a new SDK from microsof, at present in CTP: Microsoft Oslo SDK.

The application starts from a very simple language, and starting from this creates the clsses, the hbm's and the database script ( Database script at the moment does not work... ;)

). The application deal with collections,references, subclassing, and many-to-many relationship.

Lets have a couple of screenshot, the first one about a relation Books-Authors...

  This is the hbm (whit all the mapping in a single view ):


and this the mapping ( all the classes in a view):

 



A sample with subclassing ( a just for fun financial model )

 




Well, there is still some bugs, but the application really do what expected: a lot of boring code line autogenerated from an intuitive textual DSL.
Tuesday, February 17, 2009 2:40:00 AM (GMT Standard Time, UTC+00:00)  #    Comments [0] - Trackback
NHModeller

# Friday, January 30, 2009

Piccolo problema affrontato al volo oggi: Un client WCF non raggiunge un server quando tra i due c'è un proxy che richiede autenticazione. Le credenziali dell'utente però sono sufficienti ad autenticarsi al proxy, e l'utente ha effettuato già il login. La soluzione è ( xEsempio ) dire a .NET di usare le credenziali attive, questo si fa modificanto/aggiungendo la seguenter sezione nel machine.config:

 <system.net>

<defaultProxy enabled="true" useDefaultCredentials="true">

</defaultProxy>

</system.net>

 

Friday, January 30, 2009 2:40:00 AM (GMT Standard Time, UTC+00:00)  #    Comments [0] - Trackback


# Thursday, January 22, 2009

L'applicazione non è un granchè, almeno non è come dovrebbe essere. Il motivo è che è stata scritta imparando la tecnologia "al momento", e quindi la qualità lascia un po' a desiderare.

Servono gli ultimi chart di microsoft per poter compilare l'esempio.

 

QuasiChart.zip (2.26 mb)

Thursday, January 22, 2009 3:18:00 AM (GMT Standard Time, UTC+00:00)  #    Comments [0] - Trackback


# Wednesday, December 31, 2008

Ho da poco pubblicato questo video sul forum di Channel9. Vale davvero scaricare il Microsoft OSLO SDK vedere quanto è facile scrivere una semplice grammatica ed usarla immediatamente.

Il tool intellipad ( compreso nell SDK di cui sopra ) permette di avere un feedback immediato di come il linguaggio che si sta implementando sia interpretato, permettendo uno sviluppo interattivo della grammatrica stessa. 

Wednesday, December 31, 2008 4:16:00 PM (GMT Standard Time, UTC+00:00)  #    Comments [0] - Trackback


# Friday, May 16, 2008

The ListView VirtualMode allow very efficient data display of very large resultset. We can mix this ability with Linq Skip(n) and Take(m) to bind a IQueryable<T> to a virtual list view.  To efficently avoid to query the underlaying database, we have to cache in some way the results with some paging strategy.

Below the solution I used:

public class LinqPager<T>

{

Dictionary<int, List<T>> pages = new Dictionary<int,List<T>>();

IQueryable<T> queryable;

int pageSize;public LinqPager(IQueryable<T> queryable,int pageSize)

{

this.pageSize = pageSize;

this.queryable = queryable;

}

public void InvalidatePages()

{

pages.Clear();

}

public T this[int index]

{

get {int page, offset;

page = index / pageSize;

offset = index % pageSize;

if (!pages.ContainsKey(page))

{

pages[page] =
new List<T>(pageSize);int start = pageSize * page;

pages[page].AddRange(queryable.Skip<T>(start).Take<T>(pageSize));

}

return pages[page][offset];

}

}

}

The class above has a constructor taking an IQueryable<T> and a page size. It will query the DB with chunks pageSize long, and provide an indexer to randomly access the result. This accessor can be used to fill the item on the RetrieveVirtualItem event.
Friday, May 16, 2008 1:43:00 PM (GMT Daylight Time, UTC+01:00)  #    Comments [0] - Trackback


My Stack Overflow
Contacts

Send mail to the author(s) E-mail

Tags
profile for Felice Pollano at Stack Overflow, Q&A for professional and enthusiast programmers
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2012
Felice Pollano
Sign In
Statistics
Total Posts: 143
This Year: 3
This Month: 0
This Week: 0
Comments: 105
This blog visits
All Content © 2012, Felice Pollano
DasBlog theme 'Business' created by Christoph De Baene (delarou) and modified by Felice Pollano