Posts

Force Sync for Roaming Settings for Windows -

is there way force roaming settings , files sync? i using applicationdata.current.roamingsettings.values and/or applicationdata.current.roamingfolder store settings , saved games. what way force pull roaming profile app when app starts, , push when app loses focus. casual sync @ point not quick enough. should giveup , write own sync onedrive? there no apis available 3rd party developers allowing them change roaming settings. should obvious, it's user control data consumption, not 3rd party applications.

ruby - Rails database date issues -

my web app has 2 date_select parameters in. these should passed db searching later on. cannot function. see can see inspection parameters being passed date(3i) (2i) (1i). when create migrate file tables in fails if try add (3i) etc.. i've read in rails need manipulate in controller. i'm trying failing miserably. have thought basic attribute of db table. dates etc.. any pointers? code need see. here parameters i'm passing... "date(3i)"=>"19", "date(2i)"=>"4", "date(1i)"=>"2014", "date_of_change(3i)"=>"19", "date_of_change(2i)"=>"4", "date_of_change(1i)"=>"2014", class createposts < activerecord::migration def change create_table :posts |t| t.text :title t.text :requester t.text :requester_email t.text :customer t.text :contact t.text :customer_email t.text :customer_phone t.string :type_of_change ...

c# - Geopoint, Geocoordinate, Geoposition or GeoCoordinate on Windows Store & Windows Phone apps? -

i'm confused i'm supposed use? using geocoordinate in windows phone 8, doesn't exist in windows store 8.1. going use geoposition, saw visual studio underlined , said not supported later. which 1 should use maintain best compatibility between windows store , windows phone apps? all need work on latitude , longitudes. http://code.msdn.microsoft.com/windowsapps/geolocation-2483de66/sourcecode?fileid=43753&pathid=180041592 using windows.devices.geolocation; //is key using necessary newer "merged runtime" link shows source related windows phone based on example ms using newer api, believe there slight differences in code win8.1 usage well. this assumes windows phone 8.1 or windows 8.1, believe windows phone silverlight 8.1 uses older method still ( wrong haven't updated of projects yet).

c# - object cannot be cast from DB Null or other types -

i have datagridview in windows application.in want calculate total amount using datagridview cell(from qty,price,tax,discount) values , display in total gridview cell. getting error.i had taken nullable type also.how overcome problem. ? here cellendedit event code private void datagrid_cellendedit(object sender, datagridviewcelleventargs e) { int val1 = convert.toint32(datagrid.rows[e.rowindex].cells[2].value); int val2 = convert.toint32(datagrid.rows[e.rowindex].cells[3].value); int val3 = convert.toint32(datagrid.rows[e.rowindex].cells[4].value); int val4 = convert.toint32(datagrid.rows[e.rowindex].cells[5].value); datagrid.rows[e.rowindex].cells[6].value = ((val2 + val3) * val1) - val4; } the issue have if 1 of cells dbnull.value. check see if cell not equal dbnull.value, , convert in. if value infact true null, assume setting value 0 fine. int value1 = datagrid.rows[e.rowind...

c# - Entity Framework 6.0 Decoupling Implementing From POCOs -

Image
lets have couple basic objects , interfaces them: interface icar { int id { get; set; } int driverid { get; set; } idriver driver { get; set; } } class car: icar { int id { get; set; } [foreignkey("driver")] int driverid { get; set; } idriver driver { get; set; } } if use implementing class of "driver" instead of "idriver" happy (so lets ignore i'm missing additional configuration other values), using idriver ends error: the property 'driver' cannot configured navigation property. property must valid entity type , property should have non-abstract getter , setter. collection properties type must implement icollection t valid entity type. so far understand entity doesn't support in way, options are: hard couple poco interfaces entity, throwing wrench testability , portability, welp. add transition layer between pocos , entity objects (bleh). throw entity out, sort of work around nasty linq2sql im...

sql - mysql crashes when alter table -

i using mysql version 6.1.4 , windows 7 i have empty table want drop column , foreign key. when try apply changes workbench crashes , when try stop mysql returns error error 2013: lost connection mysql server during query sql statement: alter table `teste_db`.`search_products` drop foreign key `product_id_id_refs_id_aa2f4dab` error: error when running failback script. details follow. error 2006: mysql server has gone away i have looked around lot , not find clue... thanks in advance help! please follow steps , if dont if myisam table repair first , check table . where empty table , check if index present delete that, try , if still not work please paste table structure , table engine name.

javascript - Is readFileSync() during initialization of a Node.js web app a bad approach? -

there few static html-snippet files conditionally include in web pages node app serves. thinking of having cache map these snippets, include @ top of express's app.js file: var cache = object.create(null); cache['404'] = fs.readfilesync('path/to/404.html'); cache['weekend'] = fs.readfilesync('path/to/weekend.html'); this code runs during initialization (i.e. whenever node app (re)started). wonder if using readfilesync() in context bad approach. for comparison, analogous async approach: var cache = object.create(null); fs.readfile('path/to/404.html', function (err, data) { cache['404'] = data; }); fs.readfile('path/to/weekend.html', function (err, data) { cache['weekend'] = data; }); in long-running program, performing synchronous request on startup fine. problem synchronous request block entire application. while individual requests suffer if have wait 0.1 seconds response, whole applic...