Posts

Showing posts from March, 2015

php - getimagesize on application/octet-stream upload? -

i using mithril.js drag n drop, using formdata, sends end unable use getimagesize() on it. why need getimagesize because of library i'm using. //var_dump on $_files array (size=1) 'upload' => array (size=5) 'name' => string '95ab94cadab44e81cfe6d3c83642680d.jpg' (length=36) 'type' => string 'image/jpeg' (length=10) 'tmp_name' => string '/tmp/phptj3ix3' (length=14) 'error' => int 0 'size' => int 743265 and heres var_dump on getimagesize($_files['upload']['tmp_name']); boolean false i've tried thinking uploading string: $data = file_get_contents($_files['upload']['tmp_name']); $image = imagecreatefromstring($data); //the error imagecreatefromstring(): data not in recognized format also tried var_dumping tmp file out $data = file_get_contents($_files['upload'][&#

java - Oozie Hive Logs Missing -

i have oozie hive action. after failure, see exit code of hive script in oozie logs(oozie web console/job log screen) not cause of error in words. how can fix this? i hope below link can solve problem ... http://www.hadoopinrealworld.com/troubleshooting-hive-action-in-oozie/

osx - How to ask for a permission for user's files using NSOpenPanel in objective c? -

Image
i having cocoa mac app in want ask user's permission using nsopenpanel. in app, deleting data downloads folder, application caches , mail downloads. when submitted app, app got rejected below reason. the app finds files in ~/downloads folder. appropriate have user grant access home folder. so, used nsopenpanel asking access user. i able open dialogue box nsopenpanel. now, not aware of should on allow button. what meaning of that? i have enabled app sand boxing mode on app store distribution. please guide me on this... edit i have come know i'll have use security scope bookmark this. so in projname.entitlements file, added key com.apple.security.files.bookmarks.app-scope , set boolean value yes . now did below code save... nsurl* url = [panel url]; nsdata* data = [url bookmarkdatawithoptions:nsurlbookmarkcreationwithsecurityscope includingresourcevaluesforkeys:nil relativetourl:nil error:nil]; nslog(@"%@&quo

def function returning wrong value (python 2.7) -

so im working def functions first time , documentation looked simple enough. , got few examples. cant relate code. have 2 files langpy , test1: test1.py import time import thread import os import sys import ctypes import wmi langpy import lang langpy import port string = "" class service_test: def __init__(self): thread.start_new(self.do_something, tuple()) while true: if getattr(sys,'stopservice', false): sys.exit() time.sleep(0.3) def do_something(self): print(str(lang)) print(str(port)) while true: fname = 'c:\\\\test.txt' f = open(fname, 'a') f.write(str(time.time())) #f.write("%s /n/r") % string f.close() time.sle

javascript - Siesta selector by custom tags -

i want ask if in siesta possible write selector custom tag: for example have component: <a class="x-btn x-unselectable x-box-item x-toolbar-item x-btn-default-small" style="min-width: 75px; right: auto; left: 232px; top: 0px; margin: 0px;" hidefocus="on" unselectable="on" id="button-1017" data-id="loginbtn" tabindex="0" componentid="button-1017" target="_blank"> which console can select using css selector: document.queryselector('a[data-id="loginbtn"]') but if write in siesta test: t.chain({click: '>> a[data-id="loginbtn"]'}, no component find. how selector should find component? the selector component should this: t.chain( {click: 'a[data-id=loginbtn]'} ) the click method accepting actiontarget , , using >> used extjs component query. can find more info how specify target type on docs page. if testing

php - How do i remove a value in array ? -

$abc = array( 1 ,2, 3, 4, 5 934, ......); now want remove particular value array without loop since array can contain n number of values. note : value not repeated. you can use <?php $key = array_search(5, $abc); if($key!==false) unset($abc[$key]); ?>

Azure Active Directory Access Token from Id Token -

i'm using webview build mobile app. means we're writing in html/js hosted locally (file system), receiving data apis. using adal.js received id_token , trying use authentication token, described here results in 401 unauthorized . is configuration missing? request: post https://myams.azure-mobile.net/login/aad http/1.1 host: myams.azure-mobile.net connection: keep-alive content-length: 1264 pragma: no-cache cache-control: no-cache accept: application/json, */*; q=0.01 origin: file:// authorization: bearer ey...ww user-agent: mozilla/5.0 (linux; android 4.4.4; en-us; nexus 4 build/jop40d) applewebkit/537.36 (khtml, gecko) chrome/42.0.2307.2 mobile safari/537.36 content-type: application/json accept-encoding: gzip, deflate accept-language: en-us,en;q=0.8 access_token=ey...ww response http/1.1 401 unauthorized content-length: 0 server: microsoft-iis/8.0 www-authenticate: basic realm="service" access-control-allow-origin: * x-powered-by: asp.net date: mon,

c++ - Opening another form in mfc -

i need close current form dialog , open form after user clicks button in mfc application. school project application. have decided use mfc in visual c++ project , have obsolutely no guidance regarding language. had chosen single document , cformview class in mfc application wizard , used resource editor design 2 forms 1 of them displayed @ start of program , need other open , replace existing form. had tried googling answer couldn't understand anything. have basic c++ oop knowledge new mfc. use visual studio 2013 ultimate. you don't close current dialog truely, can hide it. this: ccurrentdialig::onbtncliekted() { showwindow(this->m_hwnd, sw_hide); cotherdialog dlg; dlg.domodal(); }

How to make a python to run in linux -

please trying use linux , have used on livecd , want use main problem having linux on windows use application server (ip: 127.0.0.1 port: 8080) connect internet on , want use same proxy on linux don't know how that. i have tried extract windows executable file , python program (.pyc). i want ask if there's way pack files used in linux still connecting through same proxy again.

Where does zookeeper and Kafka fit in hadoop 2.6 cluster -

hadoop 2.6 uses yarn next generation map reduce , cluster manager. still need use zookeeper hadoop 2.6 cluster managing services? how setup zookeeper. how kafka connectivity installed hadoop cluster. consumer , producer kafka send data hadoop file system. where fit in. i have setup hadoop 2.6 single node cluster. next, way understand have zookeeper , kafka data streaming hadoop file system. , don't have idea how use kafka hadoop or api. zookeeper coordination framework distributed systems. zookeeper used coordinating state in hdfs & yarn high availability, coordination between hbase master , region servers etc. kafka works in combination apache storm, apache hbase , apache spark real-time analysis , rendering of streaming data. common use cases include: stream processing. website activity tracking metrics collection , monitoring log aggregation usually use kafka along storm. storm needs zookeeper cluster coordination between nimbus , supervisor. ka

Notched boxplot using gnuplot 4.6 -

Image
i'm trying create boxplot in gnuplot 4.6 using following code fragment: plot "bfile" using 1:3:2:6:5:xticlabels(7) candlesticks whiskerbars, \ '' using 1:4:4:4:4 candlesticks lt -1 notitle the file "bfile" contains information creating boxplots: 1 0.846441701336 1.85125834872 2.04139268516 2.52113611364 3.52595276102 a11 2 1.0 1.86332286012 2.01911131918 2.44521435143 3.31805158841 a10 3 0.937457841853 1.89899281522 2.1055068453 2.54001613079 3.50155110415 a9 4 0.76451090769 1.88649072517 2.12057393121 2.63447727016 3.6870828446 a8 5 0.881026437774 1.89209460269 2.10380372096 2.56614004597 3.57720821088 a7 6 1.05152952772 1.89209460269 2.04921802267 2.45247131934 3.29303639431 a6 7 0.750478015178 1.83250891271 2.07916616585 2.55386284439 3.63589374192 a5 8 0.602059991328 1.98677173427 2.50987376627 3.06929611397 3.69897000434 a4 9 0.47712125472 1.64095662126 2.04921802267 2.54499470961 3.67228262479 a3 10 1.0 1.7671400026 2.120573

symbols - Does dlopen require a lib to be self-contained? -

i call function f1 obtained dlopen("libxyz.so", rtld_now). know if f1 internally relies on symbols outside of libxyz.so, , libs containing these symbols "searchable" runtime linker, application work? or, requirement dlopen'ed lib (libxyz.so in case) has self-contained? is requirement dlopen'ed lib (libxyz.so in case) has self-contained? there no such requirement. however, if libxyz.so not self-contained, may work in 1 application (that happens link in other libraries required libxyz.so work), fail in another. therefore practice make sure libxyz.so linked against other libraries needs.

asp.net mvc - ASP MVC with jQuery, how to approach inline editor design? -

i'm new both asp.net mvc , jquery , in process of designing first inline (in-place) editor html table. in short - when user clicks on e.g "unit price" td , jquery clones hidden ajax.beginform replace td , makes visible. form includes pre-set mvc helpers @html.editorfor(m => m.unitprice) , @html.validationmessagefor etc. user can post form , receive tr controller. works nicely. now, want extend same functionality td , example "quantity". have few options: add second hidden form page proper helpers, e.g @html.editorfor(m => m.quantity) , show user instead. means end hidden form per editable field (could around 10 in total). continue single form, process cloned dom object jquery before presenting , replace unitprice quantity everywhere required, manually adjust validation properties ( -data-val ) etc etc. when user clicks on td , use jquery make request controller, return appropriate partialview. question - of these options feasible? ther

Android ActionBar icons are missing -

i add icon actionbar can't actionbar show icons defined inside menu file. i've tried changing activity actionbaractivity but, if that, app crashes. tried changing theme theme.appcompat, didn't work. here code: public class mainactivity extends activity { private drawerlayout drawerlayout; private listview drawerlist; private actionbardrawertoggle drawertoggle; private charsequence activitytitle; private charsequence itemtitle; private string[] tagtitles; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); itemtitle = activitytitle = gettitle(); tagtitles = getresources().getstringarray(r.array.nav_options); drawerlayout = (drawerlayout) findviewbyid(r.id.drawer_layout); drawerlist = (listview) findviewbyid(r.id.left_drawer); view header = getlayoutinflater().inflate(r.layout.drawer_cabecera, null); drawerlist.addheaderview(header); dra

dataset - Using unstack in R -

i have data frame wish transpose long wide form. advisor suggested using unstack , wrote bit of sample code me out. i'm able run sample code fine (with placeholder variables) having trouble applying data. here "sample code: " data1 <- data.frame( dwnstid = c(1, 1, 2, 2, 2), load = c(3, na, 10, na, na), x1 = c(10,14, 20, 40, 10), x2=c(3,5,1,2,3), z1 = c(0.2, 0.7, 0.4, 0.3,0.2) ) oo <- order(data1$dwnstid) data1 <- data1[oo,] y <- data1$load[!is.na(data1$load)] id <- as.numeric(ordered(data1$dwnstid)) idtbl <- table(id) ns <- max(idtbl) nr <- max(id) my.unstack <- function(x, id, nc=ns, x.names){ temp <- tapply(data1$x1, data1$dwnstid, fun=function(x, ns=nc){ tt <- as.vector(x) if (length(tt) < ns) tt <- c(tt, rep(0, ns-length(tt))) return(tt)}) temp <- as.data.frame(matrix(unlist(temp), nrow=nr, ncol=ns, byrow=t)) names(temp) <- x.names return(temp) } x1.names <- paste("x1", 1:ns, sep="_") x2.names &

php - Trying to add random strings in columns whenever new row added -

i trying populate 2 columns random strings whenever new user created in laravel maybe in user model public function putstringindatabase () { $this->public_key = str_random(40); } and whenever new row added in users table public_key , private_key columns updated automatically random string take @ model events . creating . for example: user::creating(function($user) { $this->public_key = str_random(40); $this->private_key = str_random(40); });

jquery - Want to write Junit for the beow function -

validating input fields html form .trying write unit test case.need implement jasmine unit test case in jasmine var object = {}; var myclass=function requiredfieldvalidator(jquery) { object.utility = { requiredfieldvalidation : function validation() { jquery("#insertquestionandanswer").validate({ rules : { question : "required", answer : "required", }, messages : { question : "question cannot blank", answer : "answer cannot blank", }, submithandler : function(form) { form.submit(); } }); } } jquery(document).ready(function() { object.utility.requiredfieldvalidation(); }); }(jquery);

scope - Seemingly defined javascript variable throws undefined error -

given following code, i'm not sure why can retrieve longandobscurevariablename not anotherlongobscurevariablename. can explain, , show how make anotherlongobscurevariablename accessible jsfilenumbertwo.js? head of html document contains: <script type="text/javascript" id="my_globals"> var longandobscurevariablename = "foo"; </script> <script type="text/javascript" src="jsfilenumberone.js" /></script> <script type="text/javascript" src="jsfilenumbertwo.js" /></script> javascript file jsfilenumberone.js contains code, adds global variable #my_globals element: jquery(document).ready(function() { // store initial variables, add more var initialvars = jquery('#my_globals').html(); // define content script tag: var scriptcontent = initialvars; // add script content scriptcontent += 'var anotherlongobscurevariablename = "bar"

linux - Merge two files with no pseudo-repetitions -

i have 2 text files file1.txt , file2.txt both contain lines of words this: fare word word-ed wo-ded wor , fa-re text uncial woded wor worded or this. word, mean succession of letters a-z possibly accents, symbol - . question is, how can create third file output.txt linux command line (using awk , sed etc.) out of these 2 files satisfies following 3 conditions: if same word occurs in 2 files, third file output.txt contains once. if hyphenated version (for example fa-re in file2.txt) of word in on file occurs in another, hyphenated version retained in output.txt (for example, fa-re retained in our example). thus, output.txt should contain following words: fa-re word word-ed wo-ded wor text uncial ================edit======================== i have modified files , given output file well. try make sure manually there no differently hyphenated words (such wod-ed , wo-ded). another awk: !($1 in a) || $1 ~ "-" { key = value = $1; gsu

java - Unable to call policy/behaviour in alfresco 5 -

previously using alfresco 4.1.3 in have done many customization like. policy,custom action etc. now have migrated code alfresco 5.01 , deployed successfully. functionality working fine not able call custom policy/behaviour. below sample code. public class oncreateobjectpolicy extends abstractconfigurablepolicy implements nodeservicepolicies.oncreatenodepolicy{ @override public void oncreatenode(childassociationref childassocref) { system.out.println("************create node called successfully"); } @override public void bindbehavior() { system.out.println("************bindbehavior called successfully"); } } any 1 can help? you need register policy/class in (any of) context xml files well. having them in module/jar/class not register them yet automatically. i'm sure did in 4.1.3 installation, copy over. sample: <bean id="oncreatenodepolicy" class="com.mycompany.alfresco.repo.po

angularjs - Carousel image transition does not work (ui.bootstrap.carousel) -

i trying use angular-ui bootstrap carousel (reference @ http://angular-ui.github.io/bootstrap/ ). problem transition not work, image appear/disappear instead of moving right left demo. i using chrome version 43.0 html: <!doctype html> <html ng-app="ui.bootstrap.demo"> <head> <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.16/angular.js"></script> <script src="//angular-ui.github.io/bootstrap/ui-bootstrap-tpls-0.13.1.js"></script> <script src="example.js"></script> <link href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet"> </head> <body> testing <div ng-controller="carouseldemoctrl"> <div style="height: 305px"> <carousel interval="myinterval" no-wrap="nowrapslides"> <slide ng-repeat="slide in slides&quo

eclipse - how to solve error Conversion to Dalvik format failed: Unable to execute dex: Java heap space when aspose-pdf-10.4.1.jar is in lib folder -

i added aspose-pdf-10.4.1.jar libs folder of project in eclipse. , codes in 1 of buttons click event. , when want run project error conversion dalvik format failed: unable execute dex: java heap space occur. after using android:largeheap="true" , increased value of xmx , xms in eclipse.ini file. still have problem. answer appreciated.

ios - Flow Control in Xcode -

for reason, if input valid input, namely, integer, seem go if statement in function, @ibaction func guess(sender: uibutton){} . in other words, if input 5, console output "please input valid number." not "you guessed high" or "you guessed low" or "you win!". suggestion on how fix this? the following code: class viewcontroller: uiviewcontroller { //just member variables. don't think problem here. @iboutlet weak var inputfield: uitextfield! @iboutlet weak var output: uitextview! var guesses : uint = 0; var number : uint32 = 0; var gameover = false; let max_guesses = 8; var possibleguess : int? override func viewdidload() { super.viewdidload() number = generatenewnumber() consoleout("i'm thinking of number...\n") var possibleguess : int? = inputfield.text.toint() } override func didreceivememorywarning() { super.didreceivememorywarning()

python - Wagtail 1.0: RoutablePageMixin throws TypeError: serve() takes exactly 5 arguments (2 given) -

after implementing routablepage documented, created page , tried render it. that's when error. after digging, looks starts @ wagtailcore/urls.py , problem call serve() located in wagtailcore/views.py doesn't match routablepage serve function defined here. code: class officeroutes(routablepagemixin): @route(r'^offices/(?p<office_id>[\w-]+)/$', name="offices") def office_landing_view(self, request, office_id, *args, **kwargs): return httpresponse("this isn't working") class officepage(routablepagemixin, page): body = richtextfield(blank=true) content_panels = page.content_panels + [ fieldpanel('body', classname="full") ] what issue? have strong feeling i'm missing concept how routablepages used. return @route function guess. any appreciated! thanks!

android - Crash when clicking button with custom theme -

i creating custom theme button , using android:onclick event of button xml handle click of button. due reason crashing below exception java.lang.illegalstateexception: not find method myonclick(view) in activity class android.view.contextthemewrapper onclick handler on view class android.widget.button id 'button1' and working fine if remove theme attribute button, below theme button <style name="buttontheme" parent="@android:style/widget.button"> <item name="android:textcolor">#ff0000</item> <item name="android:shadowcolor">#ff000000</item> </style> and button defined in xml below, <button android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/textview1" android:layout_margin="20dp" android

java - onActivityResult() is not being called -

i've been trying while work no avail. attempting retrieve data detailactivity , return mainactivity. can 1 assist. @override protected void onactivityresult(int requestcode, int resultcode, intent data) { super.onactivityresult(requestcode, resultcode, data); log.v(log_tag, "kjhvlerhvrhogvinorwui " + my_child_activity + " " + resultcode +" "+activity.result_ok); switch(requestcode) { case (my_child_activity) : { if (resultcode == activity.result_ok) { system.out.println("log_tag"+ "mainactivity.extra_search" + data.getstringextra(mainactivity.extra_search)); } break; } } } @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); artistsalbums = new arraylist<>(); temp

java - Best practice and implementation of a builder pattern when using JPA -

i have class suitable builder pattern, there many params , i'd rather not use ton of telescopic constructors. my problem class jpa entity , new me. having private final data members throwing error not initialised in constructor , far i'm aware, jpa requires empty protected constructor. can please? example fantastic, i've included basic example of code below it's generic. i've emoted many of accessors , data members save space/time. @entity//(name= "table_name") //name of entity / table name public class bean implements serializable { private static final long serialversionuid = 1l; @id //primary key @generatedvalue long id; private final datetime date; private final string title; private final string intro; //used jpa protected bean(){} private bean(bean builder beanbuilder){ this.date = beanbuilder; this.title = beanbuilder; this.intro = beanbuilder; } public da

c# - Group IEnumerable into a string -

i wonder if spare me few minutes give me advice please? i've created ienumerable list: public class emailblock { public int alertcategory { get; set; } public string alertname { get; set; } public string alerturl { get; set; } public string alertsnippet { get; set; } //need work out snippet } list<emailblock> myemaildata = new list<emailblock>(); which loop through data (umbraco content - not that's relevant!) , add items list. myemaildata.add(new emailblock { alertcategory = category.id, alertname = alert.getpropertyvalue("pagetitle"), alerturl = alert.niceurl }); what i'd group list alertcategory , load each 'group' (another loop occurs later check members have subscribed alert category) variable can use email's content. linq has nice group statement: var emailgroup = emaillist.groupby(e => e.alertcategory); then can loop through each grouping , whatever want: foreach(var grouping in ema

How to list all mp3 files in a Folder in JavaScript -

i want add mp3 files list in javascript. and set 1 song after var foo=new sound("/users/alexw/music/test.mp3",100,true); you can't access data files file system via javascript, it's security issue https://en.wikipedia.org/wiki/javascript#security edit: access files there's 2 solution: using custom dll (for ex. made c# in internet explorer) can load via javascript list computer files using local web service (for ex. made node.js) list files , stream them if want online

javascript - How do I modify the page I'm serving in node.js -

ok, have server.js var express = require("express"), app = express(), bodyparser = require('body-parser'); app.use(bodyparser.urlencoded({ extended: true })); app.use(bodyparser.json()); app.use(express.static(__dirname + '/')); app.post('/message', function(req, res) { var jsondata = req.body; if (jsondata.hasownproperty('phone1')) { console.log("phone 1 connected to", jsondata.phone1.connection, "and has downlink speed of", jsondata.phone1.dl, "mbps"); } else if (jsondata.hasownproperty('phone2')) { console.log("phone 2 connected to", jsondata.phone2.connection, "and has downlink speed of", jsondata.phone2.dl, "mbps"); } }); var port = 1337; app.listen(port); console.log("running @ port " + port); and see want stuff when server gets posted on /message. can console.log stuff y

python - Error saving and loading a list of matrices -

i have list "data_list", , save in order load in script. first of converted in array, in way: data_array = np.array(data_list) then saved it: np.savez("file", data_array) then, in script want access "file"; so: a = np.load("file.npz") b = a['arr_0'] i used code until 2 weeks ago , worked fine. in these days trying work program, ends error identified in line b = a['arr_0'] "file" 300 mb file. strangest thing has stopped work. idea can happened? ps: give information. list contains 180 matrices 511x511. each matrix contains decimal numbers (i tried create 180 matrices of zeros, , error occurs in same way). if reduce number of matrices, script works fine: in particular down 130 matrices ok, while program doesn't work. here report error message b = a['arr_0'] file "c:\python27\lib\site-packages\numpy\lib\npyio.py", line 241, in __getitem__ return form

android - How to animate an icon for expand/collapse view? -

Image
i have icon: and when press item in listview want rotate 180°. when click again want rotate 180° get's it's original position. first tried: view.animate().rotation(180).setduration(500).start(); but fires once. after tried: <?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android" android:fillafter="true" android:fillenabled="true"> <rotate android:duration="500" android:fromdegrees="0" android:pivotx="50%" android:pivoty="50%" android:todegrees="180" /> </set> but animation starts arrow showing buttom , rotating top if arrow shows top. so how can make working? user following code click event of image: objectanimator anim = objectanimator.offloat(v, "rotation",rotationangle, rotationangle + 180); anim.setdur

R:Count daily number of a variable distinguish per ID -

i've asked similar question before ( here link ), time, want calculate number of v distinguish per day , per id , "distinguish" not means different v 1 day, means different v day , forwards days. for example, if there v1 in second day, in day before, don't count v1 second day. id1: day1: v1/v2 -----> 2 day1 day2: v1/v3 -----> 1 day2 day3: v3 -----> 0 day3 id2 day1: v4 -----> 1 day1 day2: v5/v4/v1 -----> 2 day2 day3: v3/v4 -----> 1 day3 here data: id day v id1 1 v1 id1 1 v1 id1 1 v2 id1 2 v1 id1 2 v3 id1 3 v3 id1 3 v3 id1 3 v3 id2 1 v4 id2 2 v5 id2 2 v5 id2 2 v4 id2 2 v1 id2 3 v3 id2 3

javascript - How to use Jquery onload function inside angularjs? -

i using jquery slider inside angularjs function. script file not working inside angular controller. using following code, $(window).load(function() { alert("flexslider function"); $('.flexslider').flexslider({ animation: "slide", usecss: modernizr.touch }); }); <link rel="stylesheet" href="../bower_components/hosting.css"></link> <link rel="stylesheet" href="../bower_components/flexslider.css"></link> <link rel="stylesheet" href="../bower_components/bootstrap/dist/css/bootstrap.min.css"/> <script src="../bower_components/jquery.flexslider.js" type="text/javascript"></script> <script src="../bower_components/modernizr.js" type="text/javascript"></script> <script src="../bower_components/bootstrap/dist/js/bootstrap.min.js"></scr

java - How to read the dependencies from an eclipse .classpath in gradle? -

here example of eclipse .classpath file <?xml version="1.0" encoding="utf-8"?> <classpath> <classpathentry kind="src" path="src/main/java"/> <classpathentry kind="src" path="src/main/resources"/> <classpathentry kind="src" output="bin/test" path="src/test/java"/> <classpathentry kind="src" output="bin/test" path="src/test/resources"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.jre_container"/> <classpathentry kind="lib" path="/kc-tools-thirdparty/lib/slf4j-api-1.7.7.jar"/> <classpathentry kind="lib" path="/kc-tools-thirdparty/lib/slf4j-log4j12-1.7.7.jar"/> <classpathentry kind="lib" path="/kc-tools-thirdparty/lib/commons-collections4-4.0.jar"/> <classpathentry kind=&quo

ios - Add HMRoom to HMHome is not working properly -

i have question regarding hmroom adding. when adding hmroom hmhome added after successful adding trying load hmhome rooms in tableview. not returning rooms immediately. - (void)home:(hmhome *)home didaddroom:(hmroom *)room method not getting called though set delegate hmhome calling homemanagerdidupdatehomes method after 30 seconds. 1 suggest me solve issue. you calling wrong method add room home. add room home need call, - (void)addroomwithname:(nsstring *)roomname completionhandler:(void (^)(hmroom *room, nserror *error))completion; you can reload table information of room have added in completionhandler of addroomwithname method. called object of hmhome in want add room. the method calling, - (void)home:(hmhome *)home didaddroom:(hmroom *)room tozone:(hmzone *)zone is delegate method called when add room zone. and make sure have set delegate of home properly.

java - opening pdf files from android app -

i'm using code open file. have no problem when filetype photo or mp4,but when filetype pdf adobe reader dc says: this file not accessed .check location or network , try again. uri fileuri = uri.parse(environment.getexternalstoragedirectory() + "/sweetsoft/.files/"+filepath); file file = new file(fileuri.tostring()); log.d("file", fileuri.tostring()); if(file.exists()) { mimetypemap mymime = mimetypemap.getsingleton(); string mimetype = mymime.getmimetypefromextension(fileextension.substring(1)); intent intent = new intent(intent.action_view, fileuri); intent.setdataandtype(fileuri, mimetype); intent.setflags(intent.flag_activity_clear_top); try { startactivi

Windows 10/Edge pinned site tiles - caching/refreshing and inaccurate tile color rendering -

Image
not sure if edge or more general windows 10 question, trying pinned site tile work i'm encountering rather strange behavior. first of all, application tile images cached aggressively? seems once site pinned, changes relevant meta elements seem ignored. un-pinning, clearing browser cache , doing windows clean-up of temp files/temp internet files has no effect. removing meta elements, trying pin site, still reuses old ones. makes debugging/testing rather difficult. there i'm missing? how can tile information flushed? secondly, seems specified msapplication-tilecolor not handled correctly - in example below i'm using transparent png files icons themselves, set tile color <meta name="application-name" content="the paciello group (tpg)"> <meta name="msapplication-tilecolor" content="#1b75bc"> <meta name="msapplication-tileimage" content="/images/tpg-white-trans-144.png"> <meta name="

mongodb - How can I merge two field arrays in many documents into a single set? -

i have mongodb collection data looks this: { "_id" : "1", "array1" : [ "1", "2" ] }, { "_id" : "2", "array2" : [ "1", "3" ] }, { "_id" : "3", "array1" : [ ] }, { "_id" : "4", "array2" : [ ] }, { "_id" : "5" }, { "_id" : "6", "array1" : [ "3", "4" ], "array2" : [ "5" ] } i find query returns unique array values in single array so: {"_id":"theid", "result":["1", "2", "3", "4", "5"]} the id isn't important. note either array1 , array2 , both or neither can present in document , can empty. have tried many aggregations , cascading query commands , can't come desired response. to need use .aggregate() method provides access aggregation

c++ - The macro `assert`, why doesn't it compile in the global scope? -

this snippet in cppreference doesn't compile. understand problem has fact assert macro expanded in global scope. is, if include part of code below, starting assert(sieof(s)==8); inside function, main() example, code work. #include <cassert> struct s { char c; // 1 byte value // 3 bytes padding float f; // 4 bytes value bool operator==(const s& arg) const { // value-based equality return c == arg.c && f == arg.f; } }; assert(sizeof(s) == 8); s s1 = {'a', 3.14}; s s2 = s1; reinterpret_cast<char*>(&s1)[2] = 'b'; // change 2nd byte assert(s1 == s2); // value did not change but want understand why code doesn't compile, stated in original code. example in vs2013, macro defined follows: #define assert(_expression) (void)( (!!(_expression)) || (_wassert(_crt_wide(#_expression), _crt_wide(__file__), __line__), 0) ) and compiler complains following error message: error c2

PHP, after setting an array in a method, how can I get it from a different method in same class -

i have class , in class have method sets array. how can values of array , use them method in same class ? this class: class homecontroller extends controller { private $tmp = array(); public function setvalues(){ array_push($this->tmp,"blue","yellow"); print_r(array_values($this->tmp)); // works well, can see values. } public function getvalues(){ print_r(array_values($this->tmp)); // doesn't work - shows empty array. // return $this->tmp doesn't work - shows empty array. } } how can values of array? i not sure how controllers work in laravel. however, if similar other frameworks controller not singleton. new controller potentially created each request. means calling setvalues(); on 1 instance of class , getvalues(); on another. i pretty sure can configure laravel treat controller singleton. http://laravel.com/docs/5.0/container shows how can register controlle