Posts

What is a good way to build sub views with logic in ASP.NET MVC 3 -

we're building business application using microsoft asp.net mvc 3. views becoming complex seems reasonable divide them 2 or more separate views, separate controllers , models. (reuse reason wanting build separate views.) which method recommend achieving such separation in asp.net mvc? partial views seems obvious answer, see it, partial views "out of box" has little support separate controllers. the best solution we've found far this, using html.renderaction("<view initialization action method>") method explained here: http://www.primaryobjects.com/cms/article129.aspx this post mentions renderaction method: asp .net mvc correct usercontrol architecture do see weaknesses approach? recommend better, easier ways of achieving this? take "post detail" view. composite view displays both "post summary" , "post comments". taking partial approach, you'd end with: public class postdetailmodel { p...

optimization - Profiling and Optimizing a game android -

i'm making first android game going 3d arcade-ish game using opengl es. i've been working on quite long time, optimizing engine flexibility future. anyways i'm done games features , pretty stuff, laggs on phones aren't debug phone. game has pretty high-quality graphics mobile game little lagg expected, difference in performance between running game on nexus s , running on mytouch 4g huge. game isn't playable on lower-end phones lg optimus(the game runs, choppy play comfortably). on nexus s if ever choppy movement(i've implemented frame-rate independent movement in game) on mytouch 4g lot more common, although game still playable....but annoying i come desktop game-development background, , optimization has never been subject of interest me before. can recommend me speed game? i've tried optimizing code as possibly could, , performance has improved significantly, there seem things i've missed or overlooking. huge game full engine , lots , lots o...

Fluent Nhibernate foreign key constraint -

i have problem fluent nhibernate mapping. say have 2 entities b this: public class { public virtual guid id { get; private set; } public virtual b reftob { get; set; } } public class b { public virtual guid id { get; private set; } } how should map them, forbid me delete b when it's referenced a. so, when i'm going say: b b = new b(); a = new a(); a.reftob = b; session.save(b); session.save(a); (...) session.delete(b); //should throw kind of exception states //"cannot remove b used a" first need figure out kind of relationship have. go link useful information on one-to-one relationship mapping - if want: http://brunoreis.com/tech/fluent-nhibernate-hasone-how-implement-one-to-one-relationship/

visual c++ - How do I swap an MFC CString? -

ok, i'm sold on copy-and-swap idiom , think know how implement it. however, or codebase uses mfc's cstring class string , ain't gonna change. since swap must (should???) nothrow, cannot do std::swap(this->my_cstring, rhs.my_cstring); since create temporary cstring object may throw. (plus inefficient.) so i'm left? should add try-catch? should allow (well, extremely rare) out of memory condition raise exception , make swap fail? looking @ cstrings implementation, doesn't seem there's member or function allows swapping ... self-answer: after looking cstring more closely, appears due fact cstring reference counted string implementation, swapping via std::swap "99%" exception safe because happens reference count increments , decrements. it's "99%" safe, when cstring object islocked , copy.

javascript - How would I get a certain part of a string? -

here's example string: survey_questions_attributes_1317784471568_answers_attributes i want 1317784471568 out of string. but part text. example, may need string called new_questions same spot in string. the constant here survey_questions_attributes_ precede chunk want , _answers_attributes follow it. id = str.match(/_questions_attributes_(.+)_answers_attributes/)[1];

java - Oracle Hyperion MDM Web Service API and .NET interop -

we have oracle hyperion master data management (aka data relationship management) installed along it's web service api, ear file deployed on weblogic. built-in server side security policy has been attached web service. have .net client needs speak web service endpoint, not sure how set client side security policy defined oracle. versions used - drm: 11.1.2.1; weblogic: 10.3.4 i'm looking pointers (& sample code if possible) on how can achieve this. thanks. i got solution http://download.oracle.com/docs/cd/e17904_01/web.1111/e16098.pdf . section 5 in document speaks of how export certificate wls , import same .net client app along w/ other config specified in document. hope helps.

java - What is the purpose of 'Class.forName("MY_JDBC_DRIVER")'? -

i understand class loading useful load class @ runtime class name. however while using jdbc in our project know driver going use , driver manager string hard coded. my question is: why loading driver using class.forname("jdbc_driver") here? why can't go ahead adding driver in class path? since know driver jar going use. i believe class.forname(jdbc_driver) load driver drivermanager . reason? edit 1: the drivermanager api doc states that as part of its(drivermanager) initialization, drivermanager class attempt load driver classes referenced in "jdbc.drivers" system property. applications no longer need explictly load jdbc drivers using class.forname() . existing programs load jdbc drivers using class.forname() continue work without modification. then when use other oracle driver; need change driver name string in system property? first of: modern jdbc drivers , current jdk (at least java 6) call class.forname() no longe...