Posts

php - Contact page MVC workflow -

all previous projects have had workflow on contact pages user submits form controller gets $_post details controller validates details (and sets error messages if necessary) controller sends email controller redirects thanks page is standard workflow? i used validate in controllers, , did more reading , recommended against it. therefore, should send $_post details helper type object , let work (validation/sending)? in controller should check validation. main validation should on model before operations db.

c# - fetch selected row from DataGrid -

i'm using wpf grid. first column checkbox column, , there 1 save button on page. when button clicked, i'd checkboxes row set checked, insert in datatable. how can done? would help? it uses decorator pattern wrap class (that's come out of orm linq2sql) enable databind "selected" value. can upon saving selected items in list of decorated items , save those. (simple example, not mvvm compliant) xaml: <window x:class="checktest.mainwindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" title="mainwindow" height="350" width="525"> <grid> <datagrid autogeneratecolumns="false" itemssource="{binding path=foos}" name="gridfoos" margin="0,0,0,34"> <datagrid.columns> <datagridcheckboxcolumn ...

qt - QtScript: how to reload current script? -

qscriptengine has evaluate() method can used load script, execute , run specified function loaded script. how clear current script , load new one? example, use evaluate() load script file , evaluate() script functions , call them. can clear current script , load new 1 different file? deleting , creating qscriptengine seems solution, likes created in gui thread (due qscriptenginedebugger) while script operations performed in separate thread. way clear current script without re-creating qscriptengine object? i ran problem, , improve eye of hell's answer (thanks, way!), leaves out important detail. i'll use cut down version of problem, reusing qscriptengine object , wanted ensure nothing left behind between evaluations. in particular, wanted ensure onequipped function not called "rc helicopter controller" entity, doesn't change sprite when equipped , hence doesn't define onequipped function in script file. using pushcontext() , popcontext() r...

web analytics - Track visits/origin asp.net mvc website -

i not sure possible, i've never tried doing before have customer wants able know came when visited site. google, bing, link website, etc. more importantly want know if visit product of normal sso or if paid add adwords? i appreciate anyone's thoughts on , if it's possible? many thanks why not use google analytics. should tell pretty information.

rubygems - Is it possible to show ruby gem updates without actually updating? -

i have checked docs, didn't find way check gems updates available. i wondering if knew how this? turns out find answer minutes later: gem outdated

apache - How to serve a gziped font using .htaccess? (no mod gzip or deflate) -

here's list of stuff tried in random order: addhandler application/x-httpd-php .otf addtype default_mimetype auto_prepend_file = "otf.php" zlib.output_compression = on output_handler = ob_gzhandler header("content-type: application/octet-stream"); even though php files of server gzipped using zlib, replacing .otf extension .php didn't work either. with .htaccess, this, assuming font file fontfile.otf.gz , browser request fontfile.otf rewriteengine on #check browser's accept-encoding, remove force return gzipped 1 rewritecond "%{http:accept-encoding}" "gzip.*deflate|deflate.*gzip" #check file name endswith otf rewritecond %{request_filename} "\.(otf)$" #check existance of .gz file name rewritecond %{request_filename}.gz -s #rewrite .otf.gz rewriterule ^.*$ %{request_uri}.gz [l] #update response header <filesmatch "\.otf\.gz$"> addencoding gzip .gz forcetype "text/plain...

c# - How does SqlGeography.Reduce method works? -

how api works? i using complex geography ~2000 points (geometry of river). while reducing tolerance 2048, works fine. while reducing tolerance factor 4096, throws exception "24205: specified input not represent valid geography instance because exceeds single hemisphere. each geography instance must fit inside single hemisphere. common reason error polygon has wrong ring orientation." does mean have 2 geometry of different orientation (these points located in single hemisphere only) in geography object , tolerance 4096 tries merge these 2 geometries of different orientation , fails? there anyway avoid such scenarios? when sql server sees geography instance computes bounding cap it. if cap angle exceeds 90 degrees throws exception 24205 "geography instance must fit inside single hemisphere". can true if none of points cross equator. for in depth answer see the geography hemisphere limitation .