Posts

chromium embedded - CefSharp OffScreen Browser fails when setting a proxy -

i'm trying offscreen browser change proxy while running, error when trying so. i'm running following code when changing proxy: var success = false; cef.uithreadtaskfactory.startnew(delegate { var rc = _webbrowser.getbrowser().gethost().requestcontext; var dict = new dictionary<string, object> { {"mode", "fixed_servers"}, {"server", proxyaddress} }; string error; success = rc.setpreference("proxy", dict, out error); }).wait(); if (success == false) throw new exception("proxy not configured"); when run code _webbrowser set instance of cefsharp.offscreen.chromiumwebbrowser success variable set false. if _webbrowser set instance of cefsharp.wpf.chromiumwebbrowser instance, works charm. what wrong?

javascript - .offsetWidth, .width, .width() etc. not always returning properly on auto-sized element -

i'm trying resize div based on width of image contained within it, no js method grabbing image's width seems working consistently. <div class="main_image"> <img class="wp-post-image" src=""> <label>label here</label> </div> img { width: auto; height: auto; max-width: 500px; max-height: 450px; } var newwidth = document.getelementsbyclassname("wp-post-image"[0].offsetwidth; $(".wp-post-image").parent(".main_image").css({"width": newwidth}); i've tried .style.width , .width , .offsetwidth , .width() , .outerwidth() , .getboundingclientrect.width() each of these, correctly grabs image width of time, other times has image's width 0. (or 2 because has 1px border , that's part getting picked up, same deal.) issue grabbing of width, not setting, tested alerts. the reason need resize div image caption wrap if it's wider image itself. ...

javascript - PHP: making a countdown auto-updating -

i new php , new stackoverflow , , far it's been few months started learning php , so point making countdown auto-refresh, have refresh page new result, there way make auto-updateable i used following code achieve need: <?php $date = strtotime("september 12, 2017 2:00 pm"); $remaining = $date - time(); $days_remaining = floor($remaining / 86400); $hours_remaining = floor(($remaining % 86400) / 3600); $min_remaining = floor(($remaining % 3600) / 60); $seconds_remaining = floor($remaining % 60); echo "there $days_remaining days , $hours_remaining hours left , $min_remaining minutes left , $seconds_remaining left"; ?> but.. have update page every time new result. update: what heck.. had use javascript. if want, use code works perfectly <script> var end = new date('09/12/2017 10:1 am'); var _second = 1000; var _minute = _second * 60; var _hour = _minute * 60; var _day = _hour * 24; var timer; ...

node.js - Changing data before Create in Sails API call -

in taskcontroller i'm trying insert current user (i.e. user created task) newly created task. mostly i've been trying different ways override create() in override call original blueprint , let continue usual. i found bunch of answers seem outdated or otherwise not working. wonder if there's more updated. i'm using sails v1.0.0-37 solution: in \tasks\api\controllers\taskcontroller.js create: function (req, res) { req.query.createdby = req.user.id; task.create(req.query) .exec(function (err) { if (err) { return res.servererror(err); } return res.ok(); }); } my issue: during testing , experimenting created empty lifecycle callback of beforecreate. since empty, never called cb() request got stuck.

javascript - How can I pass properties to a component which is called by router in Vue Js -

i new vuejs , have problem 2 components. trying display component vuejs router , must pass properties component , since it's not child of component (it's in different directory), how can pass data component? example: this parent component: <template> <div class="container"> <router-link to="/form"></router-link> </div> </template> <script> export default{ data(){ return{ values: {val1: 123, val2: 321} } } } </script> this components needs properties, form component: <template> <div class="container"> <form> <input type="text" v-model="values.val1"/> <input type="number" v-model="values.val2"/> </form> </div> </template> <script> export default{ props: { values: { type: object } } } </script> ...

edit - How to add exception urls for action.VIEW in Android -

in manifest file i've made sure whenever link website clicked , intent created action_view , app among suggestions user link should opened with. can choose between chrome , app. now, how add url not want app open, want chrome open right away (without asking user choose between chrome , app) for instance, want preserve code below, modify exclude "mywebsite.com/promotion" being openable app <activity android:name=".mainactivity"> <intent-filter> <action android:name="android.intent.action.main" /> <category android:name="android.intent.category.launcher" /> </intent-filter> <intent-filter> <action android:name="android.intent.action.view" /> <category android:name="android.intent.category.default" /> <category android:name="android.intent.category.browsable" /...

php - how to get fullpath of scandir() -

when scandir() it's return in array this array( [0]=> string(8) "devtools" [1]=> string(17) "lb-particles.phar" [2]=> string(11) "nogrifersdp" [3]=> string(12) "packetlogger" [4]=> string(24) "pocketmine-devtools.phar" ) so want fullpath of files this array( [0]=> string(8) "c:\users\username\pocketmine-mp\plugins\devtools" [1]=> string(17) "c:\users\username\pocketmine-mp\plugins\lb-particles.phar" [2]=> string(11) "c:\users\username\pocketmine-mp\plugins\nogrifersdp" [3]=> string(12) "c:\users\username\pocketmine-mp\plugins\packetlogger" [4]=> string(24) "c:\users\username\pocketmine-mp\plugins\pocketmine-devtools.phar" ) the code tried use didnt work $pluginsfolder = $this->getserver()->getdatapath()."plugins/"; $plugins = array_slice(scandir($pluginsfolder), 2); foreach ($plugins $...