Posts

Why Fluent NHibernate vs. hbm XML files? -

However this is a subjective question, as a new NHibernate user, I'm curious why a uninterrupted versus traditional XML mapping . When I used to work with NHibernate for the first time, then I used the Fluent interface, but ran into some obstacles and hard times harder to find enough documentation for Fluent Interface for something beyond a toy. App, so I learned to handle them through XML. Over time, I realized that I did most of my work on the XML side, and felt that it was not so terrible I was as much as I thought it would be. Personally for me, this was a case of poor documentation and was not seeing significant savings in coding time. It is being said that there can be some great benefit / loss which I am missing, D really should hear some opinions from those people who have more experience working with these devices Are there. Time protection and reconstruction (re-naming classes, attributes) of the benefits you get from profitable mapping There are one. Using...

Organising JavaScript / jQuery - alternative to using jQuery's live hookup -

Simple question (I hope). I have a page that contains links, when new content is loaded in a specific device. The content that loads (a partial view) has further links that fire the JavaScript code (jQuery). I'm hooking up these links using the jQuery live system. I have been recommended that I wire-up the buttons in partial sequences by inserting javascript directly into these sequences or by linking the onclick handler directly to links (instead they have wires with jQuery above). Is there a 'best practice' to hook the dynamic content? I will argue against in-line javascript, it should be in a script tag or onclick handler. It is always recommended to separate your presentation from logic. What to do in that example, I would say that your best bet would be to use a live event or to use the callback to provide additional functionality. REF:

SAPI event SPEI_WORD_BOUNDARY notification doesn't work -

I have used this function ascynchronously for speaking sentences M_cpVoice-> Speak (m_sInputText, SPF_ASYNC, NULL)) I want to receive notification of the event SPEI_WORD_BOUNDARY, so I did this. M_cpVoice-> SetInterest (SPFEI (SPEI_WORD_BOUNDARY), SPFEI (SPEI_WORD_BOUNDARY)); M_cpVoice-> SetNotifyWindowMessage (GetSafeHwnd (), CTTSDlgDlg :: MSG_SAPI_EVENT, 0,0); CTTSDlgDlg :: MSG_SAPI_EVENT Map for my event handler, am I missing something and I am getting the problem, which I am not getting notification? MFC needs ON_REGISTERED_MESSAGE instead of ON_MESSAGE to distribute your events on your object. it occurs.

html - jqGrid and JQuery UI tabs showing grids expanded only on primary tab (div) -

I have a jQuery Add a grid (Jekgreed) in UI tab objects are extended to all grid I tabs Children default , Are fully displayed. But the tabs on the grid on children who are not extended by default, permanently shows jqGrid small (jqgrid with autocity = true) any ideas? Thank you! See on other words ... I have two tabs on one page, on which jqgrids each one. Is Set both jqgrids Otovothth property, the problem occurs when the page load is adjusted before the grid size of the container, but when I click on another tab, I adjust the second grid size Container is not doing. How are you starting jqGrids on other tabs? For example: you should start them when using the show event, for example: jQuery (document) .ready (function () {var initialized = [False, false]; jquery ('# tab'). Tab ({show: function (event, UI) {if (ui.index == 0 & amp;; initialized [0]) {// on another tab grid start page here ... jQuery (NOMBRE_GRID) .jqGrid ({url: '/ Idiomas / Dato...

sinatra - Access Ruby accessors using block variables -

I have an application that I am using an active record to access a database. I am trying to get information and put it in a hash for later use. Here's what I am doing basically. is required 'active_support' @emailhash = hash.new email = email.find (all) email. Email | Email | Email.attributes.keys.each do | @column | | @EMailhash [email.ticketno] || Hash.new @ melehash [email.ticketno] = email @ End of the column end The row that does not work: @emailhash [Email.ticketno] = Email @ Column Is there a way that I can do it properly? Basically my goal is to make a hash off values ​​stored in the table column, any input is appreciated. Ruby programmer usually indents 2 Your code will display all e- Squash all the emails in any entry instead of mail If you want to call a method dynamically, use Object.send . @emailhash [email.ticketno] || Hash New does nothing. Something like this can happen: is required 'active_support' @emailhash =...

c# - Accessing a resource via codebehind in WPF -

My custom resources are defined in my window resources (in a sketchflow app so that the window is actually a user tran Ho): & Lt; /UserControl.Resources> I want to be able to refer to this collection in the codebehind, which I hope that X: name will be, but I can not access it. I can get a reference using this myRef = (MyCollection). FindName ("myKey"); But it seems hacks. Is this bad practice, and what would be better? Thank you :) You use the System.Windows.Controls.UserControl Should s FindResource () or TryFindResource () methods. In addition to this, a good practice is to make a string constant which is the name of your key resource dictionary (so that you can change it only in one place).

com interop - COM Callable Wrapper and .NET object lifetime -

I have a C # .NET assembly that calls from the C ++ COM client when the client process explicitly calls COM If the object releases, this is the reference to CCW release, thus the .net object for garbage collection is eligible. What if the .NET object is a stable creator that opens a log file? Is there a great solution for closing the log file without explicit requests from the client? TIA To close the log file after some tests that use AppDomain.ProcessExit EventHandler Seems a good option for