Posts

Showing posts from July, 2014

How to implement a refresh token process with JWT for Android apps -

i'm working on oauth2 token system access rest api android app. i'm having problems token refreshment part on client side. here flow : app makes request (with access token in parameter) server asynctask ( postcommentasynctask() , addfriendasynctask() etc...), if accesstoken valid it's ok, if has expired call asynctask ( getrefreshtokenasynctask() ) onpostexecute() method of precedent asynctask new accesstoken. here tricky part me. when new access token want re-execute initial asynctask request server. can't figure out how properly. example1 : request postcommentasynctask() --> (acesstoken expired) --> getrefreshtokenasynctask() -->request postcommentasynctask() --> (good token)--> ok edit: i chose use volley library ( no need use asynctask anymore ). use json web token can check expire date wich encoded in payload of token. here isaccesstokenexpired() method check if access token not expired before making request server : publi

How to display console tab of intellij -

if use "find usage" usage of methods or fields, intellij hide console tab , take me tab. how can switch console tab. one possibility use ctrl-tab (switcher) shows list of toolwindows along list of open files. press button in bottom left corner of intellij idea toolwindow show toolwindow tabs. can switch toolwindow directly pressing alt-4 (for run) or alt-5 (for debug).

html - Remove javascript link in mobile screen -

i have clickable javascript link (trustwave) on desktop website theme i'm trying disable on mobile screens: in footer.tpl: <div style="position:absolute; margin-left:100px; margin-top:50px"> <script type="text/javascript" src="https://sealserver.trustwave.com/seal.js?style=invert"></script> i know how remove clickable image link on mobile screens ( remove image link in mobile screen ) example: in footer.tpl: <div class="column"> <a href="http://mywebsite.com/delivery" id="test" class="hide"></a> in stylesheet.tpl: @media , (max-width: 480px) { .hide { display: none; } } #test { display: block; background-image: url('../image/myimage.png'); background-repeat: no-repeat; position: absolute; margin-top: 10px; margin-left: 20px; width: 75px; height: 75px; } but i've no idea how re-create javascript link not display

mongodb - WiredTiger - “too many open files error” during resync of a secondary replica set member -

i'm upgrading secondary replica set member wiredtiger. have upgraded mongodb 2.6.3 3.0.4 , changed storage engine wiredtiger. resyncing data primary. @ point following error received, , process starts on again: 2015-07-22t13:18:55.658+0000 index [rssync] building index using bulk method 2015-07-22t13:18:55.664+0000 index [rssync] build index done. scanned 1591 total records. 0 secs 2015-07-22t13:18:56.397+0000 e storage [rssync] wiredtiger (24) [1437571136:397083][20413:0x7f3d9ed29700], file:wiredtiger.wt, session.create: wiredtiger.turtle: fopen: many open files 2015-07-22t13:18:56.463+0000 e repl [rssync] 8 24: many open files 2015-07-22t13:18:56.463+0000 e repl [rssync] initial sync attempt failed, 9 attempts remaining the same machine running 2.6.3 version without open file limits issues. i'm aware wiredtiger might creating more files, must it, keep them open simultaneously ? for reference: cat /proc/sys/

Magento in Thumbnail Category custom theme -

i working 1.9.2.0 version of magento in custom theme, running smoothly, want , name of main category rather category name.already tested several tips right here, , several tutorials on net. can not it, guide me going wrong? 1.1. have code displays categories , sub-categories on home page: file top.phtml <?php mage::helper('custommenu')->savecurrentcategoryidtosession(); $menudata = mage::helper('custommenu')->getmenudata(); extract($menudata); // --- $txtloading = ''; $txtmenu = $this->__('menu'); $xrtl = $_rtl ? ' rtl' : ''; $wpinitcontent = <<<html <div id="custommenu-loading" class="$xrtl"> <div class="menu"> <div class="parentmenu menu0"> <a href="javascript:;"> <span>$txtloading</span> </a> </div> </div> <div class=&q

auto resize webpage html/css -

im trying window in sharepoint auto-resize when user changes size of window. im using web version of sharepoint @ work. not allowed use designer. <style type="text/css"> #dgwrap { height: 1000px; background-image: url(publishingimages/graybk.png); background-repeat: repeat-y; margin-top: 75px; width: 1325px } .dgtopbox { font-size: 9pt; height: 200px; float: left; text-align: center; margin-left: 350px; margin-top: 110px; width: 700px } #dgtopboxleft { height: 50px; float: left; margin-left: 350px; margin-top: 25px; width: 200px } #dgtopboxright { height: 50px; float: right; margin-top: 25px; width: 200px; margin-right: 300px } #dgtopboxother { float: left; margin-right: 25px } #otherbutton { height: 35px; background-image: url(publishingimages/otherbutton.png); background-repeat: no-repeat; margin-top: 70px; display: block; width: 160px } #clmbutton { border-top: #838b8b 1pt solid; height: 40px; border-right: #838b8b 1pt solid; backgr

automation - How to detect the creation date of a webpage from its server -

i'm trying find way detect creation date of webpage server. example when page wwww.amazon.com/fghhggg created? there way find , automate it? thank clues in general, answer no. you'll see web page returns information in headers, site pages generated information in database (like amazon, or other sites on internet), asking "creation date" doesn't make sense. for example, imagine you're looking product x on amazon. amazon's servers retrieve information database, put html document, , return you. "creation date" be? page didn't exist 5 seconds ago - assembled - , doesn't exist it's been sent you. if you're looking when product added amazon's database, information might available via amazon's api.

android - Send multiple URIs with adb am -

i'm trying simulate activity being started intent android.intent.action.send_multiple . need pass in "android.intent.extra.stream" array of uris (strings). i'm trying start shell using am command. however, appears can't specify uri/string list using am . array type extras see ints, longs, , floats. is there different way simulate sending multiple uris shell? this known limitation of android command line tools - basic data types supported parameters. unfortunate because easy add command line support existing xml serialization used internally.

io - How to delete file and that file is used by another process using C# -

in c# application want delete file in below scenario. openfiledialog , select .jpg file. display file in picturebox. delete file if needed. i try while doing step 3 set default image picturebox before delete not work. how can delete file? please suggest me. // code select file. private void btnselet_click(object sender, eventargs e) { if (dialogresult.ok == openfiledialog1.showdialog()) { txtfilename.text = openfiledialog1.filename; mypicturebox.image = image.fromfile(openfiledialog1.filename); } } // code delete file private void btndelete_click(object sender, eventargs e) { try { //mypicturebox.image = image.fromfile(system.io.directory.getcurrentdirectory() + @"\images\defaultimage.jpg"); system.io.file.delete(txtfilename.text); messagebox.show("file delete sucessfully"); } catch(exception ex) { messagebox

html - DIV show and hide with jumping to next when click on link -

i'm using css & html show/hide few div's. ( http://jsfiddle.net/davidthomas/x8hmq/2/ ) i extend code prev , next "buttons" is... if div2 visible , hit next button jump div3... is possible css+html only? #content > div { display: none; width: 50%; margin: 0 auto; } #content > div:target { display: block; } #content > div a.hide { display: block; text-align: right; } <ul> <li><a href="#div1">div one</a> </li> <li><a href="#div2">div two</a> </li> <li><a href="#div3">div three</a> </li> <li><a href="#div4">div four</a> </li> <li><a href="#">hide</a> </li> </ul> <div id="content"> <div id="div1">this div one</div> <div id="div2">this div two</d

Enable Silverlight Plugin (NPAPI) in Chrome using registry key fix -

i have created powershell script add npapi , silverlight* registry keys enable silverlight in google chrome. powershell script works fine , adds 2 registry keys, silverlight plugin still disabled in chrome , when load silverlight based sites “install silverlight” popup. have restarted machine , still silverlight plugin disabled. however, if go registry , delete npapi , silverlight* registry keys , re-create them (string value - reg_sz), when reload page in chrome, silverlight enabled , site loads perfectly. don’t understand what’s going on. the powershell script creates these keys when delete them , re-create them manually take effect , silverlight plugin enabled. if go chrome://plugins, chrome reports silverlight plugin “enabled enterprise policy”. have run script on machine , exact same thing happens. has else experienced , know fix or doing wrong? powershell script used create npapi , silverlight* registry keys: function create-path { [cmdletbinding()] param (

How to build, deploy and test a SAPUI5/Fiori application on HANA XS in less than 10 minutes -

there lot of information sap ui5 , sap fiori. what's difference, what's needed build them? sap fiori design guide building web-based app easy use, responsive, delightful, etc. technology sap fiori based on sap ui5 . start information sap fiori guidelines open-sap courses. to build sap ui5 application , deploy on hana xs application server: prerequisites eclipse sap plugins (for eclipse luna): https://tools.hana.ondemand.com/luna (installed via -> install new software... sap hana (including configured xs server) build simple sap ui5 application , deploy on sap hana xs server: in eclipse project explorer -> context menu -> new -> project... -> sapui5 application development -> application project -> next -> <enter project name> -> next -> <enter name> -> finish share projrect: right click on project -> team -> share project -> sap hana repository -> next -> choose desired repository, ch

ruby on rails - Paperclip Gem - "Image has contents that are not what they are reported to be" Error -

the website's function post blog post. it's running locally on windows 7. i've tried on paperclip gem (both versions 4.2.4 , 4.3) , server goes infinite loop in cmd (doesn't happen on 4.2.4 still error). did bundle install , it's installed. gemfile: gem "paperclip", "~> 4.3" here's model: class post < activerecord::base has_attached_file :image, :default_url => ":style/rails1.jpg" validates_attachment_content_type :image, :content_type => /\aimage\/.*\z/ end this error when trying submit image (png or jpg): image has contents not reported be i'm new detailed explanations appreciated. read other fixes on here nothing worked. figured out temporary solution: add file config/initializers/paperclip_media_type_spoof_detector_override.rb require 'paperclip/media_type_spoof_detector' module paperclip class mediatypespoofdetector def spoofed? false end

javascript - How to prevent an iframe to display external websites? -

let's display iframe on iframe.domain.com. want iframe able display content iframe.domain.com or sub.domain.com. websites contain link external websites, example google.com. if users clicks on link redirecting him google.com, want iframe redirected sub.domain.com how can that? you can use e.preventdefault() achieve achieve this now onclick handler set on links in frame can use function function onloadif(frame) { var elements = frame.getelementsbytagname('a'), len = elements.length; while( len-- ) { $(elements[len]).on('click', function(e){ e.preventdefault(); } } }

mysql - How To Create Query With Conditional Group By -

i have table : +---------+---------------+ | item_id | status | +---------+---------------+ | 1 | active | | 1 | sold | | 1 | deleted | | 2 | active | | 2 | sold | | 3 | active | +---------+---------------+ what want simple output this. but, 1 condition. if item_id have 'deleted' status, wont show again in query. , item_id grouped single line. +---------+---------------+ | item_id | status | +---------+---------------+ | 2 | active | | 3 | active | +---------+---------------+ i tried using : select * table group item_id , result not expected. it doesn't make sense have column called status , when have more 1 value. can want having : select item_id table group item_id having sum(status = 'deleted') = 0; if want statuses product has, add group_concat(distinct status) statuses select

javascript - Recent Camera gets overrided with the default image -

i have image grid, designed have add more button, when clicked on it. new image placeholder should appear default image, when clicked on camera gets invoked , should update default image picture taken. in case, camera picture not getting updated default picture stays. when clicked on add more, instead of default picture recent camera picture getting appeared. think there problem rendering part of code. here code var summary = react.createclass({ getinitialstate: function(){ return { pictriggers: [], number:0, image:"https://www.bignerdranch.com/img/blog/2014/07/button-2.png" } }, camera: function(){ var = this; var image = this.state.image; navigator.camera.getpicture(onsuccess, onfail, { quality: 50, destinationtype: camera.destinationtype.data_url }); function onsuccess(imagedata) { console.log(imagedata); var finalim

jailbreak - Does any know how to bypass entitlements in iOS 8? -

as aware famous _xpconnectionhasentitlement has no longer works in ios 8, there anyother way bypass entitlements tweaks requires entitlements? come know _bsaudittokentaskhasentitlement might solve issue, can't through it. i'm using following snippet of code hook backboardd & assertionsd. static int (*orig_bsaudittokentaskhasentitlement)(id connection, nsstring *entitlement); static int hooked_bsaudittokentaskhasentitlement(id connection, nsstring *entitlement) { nslog(@"got it."); if (xpc_connection_get_pid(connection) == [[uidevice currentdevice] __qrwagetpidforprocess:@"springboard"] && [entitlement isequaltostring:@"com.apple.multitasking.unlimitedassertions"]) { return 1; } else { return orig_bsaudittokentaskhasentitlement(connection, entitlement); } } %ctor { %init; mshookfunction(((int *)msfindsymbol(null, "_bsaudittokentaskhasentitlement")), (int*) hooked_bs

c++11 - Why can't I specialize std::tuple_element? -

the following program attempts provide specialization std::tuple_element user-defined type foo . unfortunately, clang-3.5 rejects libc++, using other compilers or using other standard libraries clang-3.5 accept program. correct? if no, why not? #include <utility> struct foo {}; namespace std { template<size_t, class> struct tuple_element; template<size_t i> struct tuple_element<i, foo> {}; } int main() { return 0; } compiler output: $ clang-3.5 -std=c++11 -stdlib=libc++ -lc++ test.cpp test.cpp:11:8: error: explicit specialization of non-template struct 'tuple_element' struct tuple_element<i, foo> {}; ^ ~~~~~~~~ 1 error generated. $ clang-3.5 -std=c++11 -lstdc++ test.cpp (no error) $ g++-4.9 -std=c++11 test.cpp (no error) libc++ 's entities in std::__1:: , inline namespace inside std . own forward declaration template<size_t, class> struct tuple_element; declares different class

Spring Cloud Config Client connecting to RabbitMQ -

i have been trying set spring cloud config server/client. have been following few different examples ( 1 , 2 ). have client , server set correctly , can query localhost:8888/localhost:8080 see values in json format. my question whether spring boot automatically detect these properties provided spring cloud config server. attempting connect rabbitmq instance on startup have had no success despite not having errors. not connect rabbit or create queues/exchanges. it works when have application.properties file locally following properties wish these setting through spring cloud config github repository. spring.rabbitmq.host=178.61.47.--- spring.rabbitmq.port=5672 spring.rabbitmq.username=mqtt spring.rabbitmq.password=mqtt i have looked through questions here/issues on github can't see relating this. code client class below: @enableautoconfiguration @componentscan @springbootapplication public class configrabbitapplication { final static string queuename = "ard

ffmpeg php get frame / image after half time of the video or after 40 seconds -

hello having code in php , want image after 50% of duration of video , duration of video in variable have installed ffmpeg in php , computer the page has following code require 'vendor/autoload.php'; //ececute ffmpeg generate mp4 exec('ffmpeg -i '.$uploadfile.' -f mp4 -s 896x504 '.$new_flv.''); //execute ffmpeg , create thumb exec('ffmpeg -i '.$uploadfile.' -f mjpeg -vframes 71 -s 768x432 -an '.$new_image_path.''); i want image after 50% of duration of video , store video duration in variable please give me suggestions stuck on here first need video duration in second , need multiply total second 0.5 half. try one: $total_sec = exec("ffprobe -loglevel error -show_streams inputfile.mp4 | grep duration | cut -f2 -d="); $total_half_sec = $total_sec * 0.5; exec("ffmpeg -i source.mp4 -f mjpeg -vframes $total_half_sec -s 768x432 -an destination.jpg")

database - Normalization, Primary Key Dependency Candidate Key -

in process of decomposition normalize relation. if reach point attributes in relation depend on primary key, can assume depend entirely on different candidate keys? if not case can please give me example of case attributes depend on primary key, of them depend on part of other candidate keys. i'm starting learning databases surrogate primary ids make example easy: (row_id pk, student_id, course_id, student_name) where row_id , (student_id, course_id) candidate keys , student_id -> student_name . of course row_id trivially determines other attributes if it's auto-incremented number.

jquery - Trigger event on new line in content editable div -

i trying listen event indicates new line has been created in content editable div. purpose show user options each time new empty line created , caret on line, or if user clicks caret position empty line. in book there seem 4 events lead user being on new line within contentediable div: pressing enter pasting content has empty new line @ end clicking causing caret (blinking line) move position empty line using arrow keys move new line of course in contentediable div new line means different things different browsers, in chrome seems create <div><br/></div> tags, having browsed around enough seems other browsers might create <div><p></p></div> or perhaps <span> tags. i've tried figure out couple of times , have done. best way listen new elements being added under div, and/or check if caret position within empty 'new line' tags. checking each time caret moves seems highly inefficient - there better way this?

php - Show user meta from antoher wordpress instalation -

hello want show users wordpress installation. need show names , others metadata. i've trying following code, not able show metas separated. // create connection $conn = new mysqli($servername, $username, $password, $dbname); // check connection if ($conn->connect_error) { die("connection failed: " . $conn->connect_error); } $sql = 'select * sbdspass_usermeta'; $result = $conn->query($sql); if ($result->num_rows > 0) { while($row = $result->fetch_assoc()) { echo $row["meta_value"]; // show first name echo $row["meta_value"]; // show last name } } else { echo "0 results"; } $conn->close(); i want show list of user, implement search query anyone can me?

three.js rendering issue with chrome - uncaught typeerror -

i have working three.js program on firefox, loads normally. when try run program on chrome, partially renders background , flickering objects. have checked terminal , seems spew out thousands of errors relating issue -- uncaught typeerror: cannot read property 'update' of undefined three.vertex has been deprecated. use three.vector3 instead. three.vertex has been deprecated. use three.vector3 instead. three.vertex has been deprecated. use three.vector3 instead. three.uv has been deprecated. use three.vector2 instead. three.uv has been deprecated. use three.vector2 instead. three.uv has been deprecated. use three.vector2 instead. three.webglrenderer 66 webgl: invalid_value: uniform3fv: no array webgl: invalid_value: uniform3fv: no array uncaught securityerror: failed execute 'teximage2d' on 'webglrenderingcontext': cross-origin image @ file:///c:/foodshop/images/wall-2.jpg may not loaded. webgl: invalid_value: uniform3fv: no array uncaught security

ios - Google Maps Custom Infowindow - Popover Shape? -

Image
i style google maps infowindows - if create custom uiview here: func mapview(mapview: gmsmapview!, markerinfowindow marker: gmsmarker!) -> uiview! { var infowindow = uiview(frame: cgrectmake(0,0,280,40)) infowindow.backgroundcolor = uicolor.lightgraycolor() ... thats easy - have triangle shape on bottom, first though if creating view in view, here: view1 transparent - view2 contentwindow, view3 triangle shape. 3 should "own" popover. as rounded triangle shape have same standard uipopover has. that: . should use image view3 - or possible subclass uipopoverview (for 3 views) - got triangle shape? or can draw such trangle shape core graphics? that should solution (with rounded triangle shape @ bottom): you can mask custom view used infowindow. refer how mask uiview on how mask uiview image.

android - You need the NDKr9 or later -

i tried build android-vlc , ijkplayer using git, , after following steps , making required sdk , ndk exports each one, both lead me same error message through git-bash is: you need ndkr9 or later i have ndkr9b , ndkr10d , got error message both of them, , after having @ android-vlc sdk source code found checking /release.txt file in ndk provided path: # try detect ndk version rel=$(grep -o '^r[0-9]*.*' $android_ndk/release.txt 2>/dev/null|cut -b2-) case "$rel" in 9*|10*) gccver=4.8 cxxstl="/"${gccver} ;; 7|8|*) echo "you need ndkv9 or later" exit 1 ;; esac and when checking self ndk10, found contains 1 line is: r10d (64-bit) and in ndk9 is: r9b which supposed make code run without problems in both cases, missing here? p.s. came across this question provides same problem it's answer doesn't work me.

postgresql - Make Migration Conditional in Django -

the concrete use case is: a django module wants create extension during migration. if db user used run migration not superuser, fails. there several ways solve this, 1 way being (hypothetically) check in migration file whether extension installed , run sql code if not installed. after research, however, not seem django's runsql can return results , subsequently excluding operations depending on result of previous operation not possible. there other ways achieve this? (e.g. subclassing runsql ?) any solution based on django migrations, django settings or postgres internal (one sql statement achieves run create extension if condition true) fine. (note mentioned django-pgcrypto-fields illustration. i'm interested know whether such solution exists in general.) edit in answer anentropic's comment: solution has work when running test or jenkins commands. means, manually calling --fake-initial or similar avoid running migration not option. if can expl

Can I use Powershell on Windows to extract information from multiple Google searches? -

i have list of several hundred quoted phrases , 1 number google search each of these phrases. number need estimate of number of search results each phrase. (for example, "n" line "about n results (y seconds)" ps: ask powershell because of comment on question use cmd prompt search word on google or other search engine user https://stackoverflow.com/users/1240980/timwagaman implied easy powershell. if there way without complications of powershell, please let me know. have never use powershell before. something start with: $useragent = 'mozilla/5.0 (windows nt 6.3; wow64) applewebkit/537.36 (khtml, gecko) chrome/33.0.1750.146 safari/537.36' $searchphrases = @("supercalifragilisticexpialidocious", "david") $searchphrases | %{ $searchlink = "http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=$_" $results = invoke-webrequest -uri $searchlink -useragent $useragent $json = $results.content

On an accessibility compilation error when a public type implements an internal interface in F# -

i wrote code like type internal imyinterface = abstract member method1 : unit -> unit type class1() = member this.y() = (this :> imyinterface).method1() interface imyinterface member this.method1() = () note public type class1 implements internal interface imyinterface, compiles fine. in generated msil, "method1" shown private. similar explicit interfaces in c#. however, when change code bit to type internal foo() = member x.value = "foo" type internal imyinterface = abstract member method1 : foo -> unit type class1() = member this.y() = let v = foo() (this :> imyinterface).method1(v) interface imyinterface member this.method1(v : foo) = () this type interface method "method1" takes internal type "foo" parameter. time, not compile error the type 'foo' less accessible value, member or type 'override class1.method1 : v:foo -> unit

java - Replace english digit with persian digit in String except URL's -

i wrote custom textview persian string, textview should replace english digit's persian digit's public class persiantextview extends textview { public persiantextview(context context) { super(context); } public persiantextview(context context, attributeset attrs) { super(context, attrs); } public persiantextview(context context, attributeset attrs, int defstyleattr) { super(context, attrs, defstyleattr); } @override public void settext(charsequence text, buffertype type) { string t = text.tostring(); t = t.replaceall("0", "۰"); t = t.replaceall("1", "۱"); t = t.replaceall("2", "۲"); t = t.replaceall("3", "۳"); t = t.replaceall("4", "۴"); t = t.replaceall("5", "۵"); t = t.replaceall("6", "۶"); t = t.replac

java - Loading image from google places url to imageview (Android) -

i'm trying load image url provided google place's json response , putting in imageview layout that's going show when marker clicked. no error in run-time or in debug image not display on imageview. there may cause this? my layout: <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/places" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerhorizontal="true" android:orientation="horizontal" android:background="@drawable/mapinfoborder"> <imageview android:id="@+id/place_badge" android:layout_width="100dp" android:layout_height="100dp" android:layout_centerhorizontal="true" android:layout_margintop="20dp" android:adjustviewbounds="true" /> <textview an

perl - Benchmarking utf8 file read - explanation of the differences -

have code: #!/usr/bin/env perl use 5.016; use warnings; use autodie; use path::tiny; use encode; use benchmark qw(:all); $cnt = 10_000; $utf = 'utf8.txt'; $res = timethese($cnt, { 'open-utf-8' => sub { open $fhu, '<:encoding(utf-8)', $utf; $stru = { local $/; <$fhu>}; close $fhu; }, 'open-utf8' => sub { open $fhu, '<:utf8', $utf; $stru = { local $/; <$fhu>}; close $fhu; }, 'decode-utf8' => sub { open $fhu, '<', $utf; $stru = decode('utf8', { local $/; <$fhu>}); close $fhu; }, 'decode-utf-8' => sub { open $fhu, '<', $utf; $stru = decode('utf-8', { local $/; <$fhu>}); close $fhu; }, 'ptiny' => sub { $stru = path($utf)->slurp_utf8; }, }); cmpthese $res; the utf8.txt (approx 175kb) contain

Assigning a 2D image for every face of a 3D cube: MATLAB -

i want build cube in matlab , assign different 2d images faces. think called texture mapping. i've searched such code, found code able assign single image of cube faces, code available here ( http://www.mathworks.com/matlabcentral/answers/32070-rgb-images-on-a-3d-cube ). here code, cdata = flipdim( imread('peppers.png'), 1 ); cdatar = flipdim( cdata, 2 ); % bottom surface([-1 1; -1 1], [-1 -1; 1 1], [-1 -1; -1 -1], ... 'facecolor', 'texturemap', 'cdata', cdatar ); % top surface([-1 1; -1 1], [-1 -1; 1 1], [1 1; 1 1], ... 'facecolor', 'texturemap', 'cdata', cdata ); % font surface([-1 1; -1 1], [-1 -1; -1 -1], [-1 -1; 1 1], ... 'facecolor', 'texturemap', 'cdata', cdata ); % surface([-1 1; -1 1], [1 1; 1 1], [-1 -1; 1 1], ... 'facecolor', 'texturemap', 'cdata', cdatar ); % left surface([-1 -1; -1 -1], [-1 1; -1 1], [-1 -1; 1 1], ... 'facecolor',

How to install Windows 10 Core on Raspberry Pi 2 without a real (physical) machine -

i have windows 8.1 x64 pc , raspberry pi 2. have problems prevent me installing windows 10 on pc. in situation, there way install "windows 10 iot core" sd card on raspberry pi2? i tried following: using virtual machine - windows 10 x64 preview on vm player, failed. used: dism.exe /apply-image /imagefile:flash.ffu /applydrive:\\.\physicaldrive1 /skipplatformcheck -> error 87? forgot number i copied "dism.exe" file "window10x64 .iso" file in sources folder. , tried following, failed: dism.exe /apply-image /imagefile:flash.ffu /applydrive:\\.\physicaldrive1 /skipplatformcheck -> error 87? same i copied "dism.exe" file "window10x86 .iso" file in sources folder. , tried following, failed: dism.exe /apply-image /imagefile:flash.ffu /applydrive:\\.\physicaldrive1 /skipplatformcheck -> error 87? same so know "dism.exe" called windows 8, not windows 10. if ".ffu" installer exists, not probl

c++ - problems with printing 2d array from print function -

i'm trying fill , print 2d array, yet every time try compile says undeclared identifier c. , points arrow @ c in print function. tried declaring many ways yet reason not work. #include <iostream> using namespace std; void print(char x[][c], int r) { for(int r = 0; r < 25; r++) { for(int c = 0; c < 25; c++) { cout << x[r][c]; } cout << endl; } } int main() { void print(char x[][c], int r); char p[25][25]; for(int r = 0; r < 25; r++) { for(int c = 0; c < 25; c++) { if(r==0)p[r][c]='x'; else p[r][c]='o'; } } print(p[25][25]); return(0); } write following way #include <iostream> using namespace std; const size_t rows = 25; const size_t cols = 25; void print(char x[][cols], size_t r ) { ( size_t = 0; < r; i++ ) { ( size_t j = 0; j < cols;

android - how to show string in mhtml format in a webview? -

i have string contains contents of web page in mhtml format. now want display web page in webview android devices: string str = "..."; // mhtml document webview.loaddata(str,"text/html",null); but displays mhtml markup instead of parsing it. appreciated.

sql server - Need to insert breaks in strings of very column with ' ' or ',' -

i have table has 1 column on 100,000 rows col_name qwchijhuirhxnihdiuyfnx dhjhfiurhncnmxmzjcoinrds xnbxknsiiuncirnxknrxnxz i need insert '.' or '$' or marker after every 3rd character example of result needed: col_name qwc.hij.hui.rhx.nih.diu.yfn.x dhj.hfi.urh.ncn.mxm.zjc.oin.rds. xnb.xkn.sii.unc.irn.xkn.rxn.xz i solved with: insert new_table ( c1 ,c2 ,c3 ) select substring(cast(col_name varchar(max)),1,3) c1 ,substring(cast(col_name varchar(max)),4,3) c2 ,substring(cast(col_name varchar(max)),7,3) c3 table_name this causes problems later in script data must remain in 1 column inserted new table long new table 1 column here's sqlfiddle starting point can refactor http://sqlfiddle.com/#!6/ab6dd/1/0 using function , while loop. you may able more efficient regular expressions or sqlclr if need speed. create function dotify (@input var

jquery - Powerange - Change value via javascript -

i using powerange library in form . javascript library create ios style range bars. there plenty of options author has provided. is there way move slider particular value via javascript programmatically? documentation doesn't has related this. i have same problem , write code move slider particular value via javascript programmatically. see below. /** * set slider new value * * @param {object} sliderinstance * @param {number} newvalue */ function setslidervalue (sliderinstance, newvalue) { console.assert( (newvalue > sliderinstance.options.min && newvalue < sliderinstance.options.max), 'new value less slider min value or greater slider max value!'); var changed = false; var offset; var maxvalue = sliderinstance.options.max; var minvalue = sliderinstance.options.min; var stepindex; var stepsarr = (sliderinstance.options.step) ? sliderinstance.steps : null; var value = (sliderinstance.options.decimal) ? (math

objective c - NSButtonCell NSSwitchButton doesn't display checked box -

the nsbuttoncell code bellow works fine, doesn't visualy display check icon when clicked. ideas why? - (nscell *)outlineview:(nsoutlineview *)outlineview datacellfortablecolumn:(nstablecolumn *)tablecolumn item:(id)item { if ([[tablecolumn identifier] isequaltostring:@"select"]) { nsbuttoncell *cell = [[nsbuttoncell alloc]init]; [cell setbuttontype:nsswitchbutton]; [cell settarget:self]; [cell setaction:@selector(checkboxchanged:)]; [cell settitle:@""]; return cell; } else { nscell *cell = [tablecolumn datacell]; return cell; } } here action code: - (ibaction)checkboxchanged:(id)sender { nsbuttoncell *acell = [[sender tablecolumnwithidentifier:@"select"] datacellforrow:[sender selectedrow]]; if ([acell state] == nsonstate) { nslog(@"on"); [acell setst

How to import CSV into mysql if values contains comma -

i've csv file values may have comma part of value "09200, france, paris", "tower ""olivia""" "09200, spain, barselona", shop - perfect however once import data breaks value on 4 columns (based on number of comma in row). do wrong? please see import command below. load data local infile '~/downloads/file.csv' table my_table character set utf8 fields terminated ',' lines terminated '\n' (@col1,@col2) set address=@col1,name=@col2; add enclosed by clause query: load data local infile '~/downloads/file.csv' table my_table character set utf8 fields terminated ',' optionally enclosed '"' lines terminated '\n' (@col1,@col2) set address=@col1,name=@col2;

swift - iBeacon: Particle filter extension for Fingerprinting position estimation -

i have implemented full fingerprint solution in application. offline phase: can create multiple observation points , calibrate them mean rssi values of beacons in room. live phase: here compare actual values database values closest position. now i've read inclusion of particle filter can improve accuracy of fingerprint solution. know how , why can implement this? i assume can use them complementary solutions each other, since i'm not aware of approach combines both of them practically. here nice paper using particle filters ble, discuss other approaches including fingerprinting. to comment on question, know particle filters work better when there line of sight between observer , beacons. on other hand, current solution should work better accuracy when there no line of sight , when using database map beacon distances observations. what "extension" use both methods side side, , take advantage of database when inside known locations depending on l

cakephp - Global variable change to null after calling an action in controller -

i want call delete action, global variable sets null. controller: app::uses('appcontroller', 'controller'); class whitelistcontroller extends appcontroller { public $helpers = array('html', 'form'); private $deletes; public function index() { if ($this->request->is('post')) { $whitelist = $_post['data']['whitelist']['stylecodes']; if($whitelist == "") return $this->session->setflash('you did not enter stylecodes. if send this, delete shoes website.'); $whitelist = preg_replace('/\s+/', '', $whitelist); $whitelist = explode(",", $whitelist); $url = 'http://fonda.vps.***********/product_import_json_all_published_products'; $ch = curl_init($url); curl_setopt( $ch, curlopt_post, 1); curl_setopt( $ch, curlopt_followlocation, 1); curl_setopt( $ch, curlopt_heade