Posts

c# - Difference between inproc and outproc -

i trying find difference between inproc , outproc in c#. if have dll running on server , question run in both inproc , outproc? performance-wise process better? an inproc server runs in same process calling application. it's close normal function call on dll. calling outproc server, data needs marshalled across process boundry expensive operation. inproc server fast can bring down application.

asp.net mvc 2 - C# MVC 2 HtmlHelper to generate Table Columns with Model Binding -

i'm after mvc2 custom htmlhelper allow me dynamically create x amount of columns given data. say instance have zoo class contains list of animals (which contains sub class). ex: public class zoo { public list<animals> myanimals; } public class animals { public string year; public warmclimate warm; public class warmclimate { public string hippo; public string zebra; public string elephant; etc... } } and want create table similar following. creating column every list of animals have. 4 columns worth of data or 30. | | 2011 | 2012 | 2013 | 2014 | | hypo | 6 | 1 | 7 | 0 | | zebra | 1 | 1 | 2 | 1 | | elephant | 1 | 1 | 3 | 0 | i have this; quite basic. loop iterates on list grabbing defined property value. if there 100 animals in class, page 100 loops nightmare. <tr> <td>zebras: </td> <% (int = 0; < model.myanimals.c...

node.js - Proper way to integrate compile-to-javascript languages under node? -

i'm trying set application using coffeescript, jade , mocha. however, when run mocha, --compilers flag, jade templates don't load. i have done similar setup using brunch, , jade templates automatically converted commonjs modules there. under node, not appear loaded modules. is there proper way this? right now, running mocha so: mocha --compilers coffee:coffee-script,jade:jade i'm sure there's way jury-rig along lines, thing understand .coffee files compile .js files, , when written commonjs modules, node can run them. however, .jade templates compile single javascript function opposed full commonjs module, node never going able make use of .jade templates without other module integrate standalone compiled template functions commonjs module system. guess automated build tools brunch adding little wrapper code boilerplate make templates commonjs modules.

c# - Binding a dynamically created CombinedGeometry Path? -

Image
i have application draws slots on screen rectangles rounded corners. slot can part of section, nothing more collection of slots. i want visually mark slots have been assigned. draw solid shape covering selected slots. before selection: after selection: the shape has without inner borders , hence combined geometry. i want bind combinedgeometry datatemplate of selected slots. viewmodel public observablecollection<slot> slots { { return _slots; } set { if (equals(value, _slots)) return; _slots = value; drawshape(); onpropertychanged(); } } private void drawshape() { path = new path(); path.stroke = brushes.white; path.strokethickness = 3; var count = slots.count(); var combined = new combinedgeometry(); combined.geometrycombinemode = geometrycombinemode.union; (var = 0; < count; i++) { ...

Wordpress: Simple solution to have mobile devices load a different homepage -

i have done quite bit of googling , have not found simple solution method or plugin load different static homepage mobile devices. there way or plugin (without revamping whole site mobile devices, mobile site style good, specific static homepage thing need changed). wordpress cms platform. thanks in advance! update: so installed plugin suggested below, copied on exact copy of theme using named 'mobile' in front reference, other same. read via google add following code functions.php theme file shows blank when add specific code. code: //set homepage $mobilehome = get_page_by_title( 'mobilehome' ); update_option( 'page_on_front', $mobilehome->id ); update_option( 'show_on_front', 'page' ); // set blog page $blog = get_page_by_title( 'blog' ); update_option( 'page_for_posts', $blog->id ); update 2, solved. i found simple solution. created new theme file 'page-home.php' , changed css class '#primar...

c# - Add images dynamicaly asp net mvc 4 -

i building simple image gallery using asp.net mvc 4. best way in create method images users pc? mean there way open file explorer in browser , copy selected file /content/images folder? what best way in create method images users pc? using file input control , having action take file: @using (html.beginform("youraction", "controller", formmethod.post, new { enctype = "multipart/form-data" })) { <input type="file" name="image" /> <input type="submit" value="upload" /> } then post action be: public actionresult youraction(httppostedfilebase image) { //do whatever image } i mean there way open file explorer in browser , copy selected file /content/images folder? no, not content/images folder. should consider hosting solution/database store these images.

java - Hadoop get relative path from absolute path and base path -

i want relative path absolute path, given absolute base path. there hadoop java api this? for example, if absolute hdfs path abs_path = hdfs://name-node/level1/level2/level3 , absolute base path abs_base_path = hdfs://name-node/level1 , extract relative path abs_path , rel_path = level2/level3 . familiar using path constructor combine 2 paths. for example, if have rel_path , abs_base_path , can use 1 of overloaded constructors in path class http://hadoop.apache.org/docs/current/api/org/apache/hadoop/fs/path build abs_path cannot find api reverse. this done in fileoutputcommitter 's source code. relevant function is /** * find final name of given output file, given job output directory * , work directory. * @param joboutputdir job's output directory * @param taskoutput specific task output file * @param taskoutputpath job's work directory * @return final path specific output file * @throws ioexception */ private path getfin...