Posts

Rotate WPF control or change screen orientation -

i have wpf project 1 window (mainwindow). depending upon config file shows 1 of 2 usercontrol's content. may horizontal (1920x1080) control or vertical (1080x1920) control. it's fine horizontal screen, when vertical loaded do: 1) rotate window/control 270 degrees 2) change primary screen orientation i prefer rotate application , don't interact windows api. can't change orientation manually, because have remote access computer. you can not rotate window object itself, positioned window management system built in windows. can, however, transform (and rotate) frameworkelement inside window. includes, not limited to, grid , button , textbox elements. all need edit layouttransform property on element want rotate, root element in window. set rotation 270/-90 degrees , wpf automatically rotate ui. because using layouttransform property, layout system scale ui correctly. rendertransform property causes control first rendered, rotated.

c++ - Using gcc attributes with C++11 attributes syntax -

i trying use gcc attributes c++11 syntax . example this: static void [[used]] foo(void) { // ... } but following: warning: ‘used’ attribute ignored [-wattributes] static void [[used]] foo(void) ^ why attribute ignored? possible use gcc attributes c++ attributes? [[gnu::used]] static void foo(void) {} first, attribute can appear in specific places, otherwise get: x.cc:1:13: warning: attribute ignored [-wattributes] static void [[gnu::used]] foo(void) {} ^ x.cc:1:13: note: attribute appertains type-specifier ignored second, used not standard warning, gets hidden in proprietary namespace gnu:: .

F# concatenate int array option to string -

i have data contract (wcf) field defined as: [<datacontract(namespace = _namespace.ws)>] type commitrequest = { // excluded brevity ... [<field: datamember(name="excludelist", isrequired=false) >] excludelist : int array option } i want entries in excludelist, create comma separated string (to reduce number of network hops database update status). have tried following 2 approaches, neither of create desired string, both empty: // logic determine if need execute block works correctly try // use f# concat let strlist = request.excludelist.value |> array.map string let idstring = string.concat ",", strlist // next try using .net join let idlist = string.join ((",", (request.excludelist.value.select (fun f -> f)).distinct).tostring ()) | ex -> ... both compile , execute neither give me in string. appreciate pointing out doing wrong here. let intoarray : int array option = [| 1; 23; 16 |] let s...

c# - Awesomium freezes / not responding -

i have traffic exchange website , want convert windows application using c# winform awesomium 1.7.5. basic setup ready there problem awesomium. after visiting few websites slows down , freezes entirely ( not responding ). public form1() { initializecomponent(); text = "traffic exchange"; windowstate = formwindowstate.maximized; timer1 = new system.windows.forms.timer(); timer1.tick += new eventhandler(timer1_tick); int user_id = properties.settings.default.user_id; string user_id_s = user_id.tostring(); toolstriplabel2.text = user_id_s; if (properties.settings.default.user_id == 0) { toolstriplabel3.visible = true; toolstripbutton3.visible = false; } else { toolstripbutton3.visible = true; toolstriplabel3.visible = false; ...

excel - Creating a chart and adding new series to it -

i trying add new chart workbook using code below. however, every time try run it, error object doesn't support property or method on name property. tried use qualified workbook name still no luck. code: charts.add activechart.seriescollection.newseries .name = activesheet.range("a2") .values = activesheet.range("b2:ak2") .xvalues = activehsheet.range("a2:a7") end i tried using code in following way: charts.add activechart.seriescollection.newseries .name = finalviewswbk.sheets(1).range(finalviewswbk.sheets(1).cells(2, 1)) .values = finalviewswbk.sheets(1).range("b2:ak2") .xvalues = finalviewswbk.sheets(1).range("a2:a7") end

php - ZF2 share models between modules -

hi i'm trying share models between modules, when call getservicelocator()->get('mail\model\mail') in controller module class cannot found. i'm searching solution few days now, can't find 1 thats working me. public function getserviceconfig() { return array( 'factories' => array( 'mail\model\mail' => function($sm) { $mail = new mail(); return $mail; }, 'mail\model\mailtable' => function($sm) { $tablegateway = $sm->get('mailtablegateway'); $table = new mailtable($tablegateway); return $table; }, 'mailtablegateway' => function($sm) { $dbadapter = $sm->get('zend\db\adapter\adapter'); $resultsetprototype = new resultset(); $resultsetprototype->setarrayobjectprototype(new mail()); ...

android - Calling finish() after launching another activity only works sometimes -

i have splash screen handles automatic login. if user logged in, sends s/he directly main activity, through following code: intent intent = new intent(activity, mainactivity.class); activity.startactivity(intent); activity.finish(); where activity activity finished (i'm not using this because method common automatic logins, manual logins, social logins etc.) however 70% of time, splash screen still there after finishing main activity. not occur during debugging. looks happens when login happens quickly, why never happens during debugging (because becomes slow). logging has helped see that, when problem happens finish() indeed being called, ondestroy() not. i have tried flag_activity_clear_top , doesn't help. nohistory work, brings unwanted finishing animation and, really, want know problem code is. i've used , don't see why fails. thanks in advance.