Posts

Showing posts from June, 2015

ios - editActionsForRowAtIndexPath was called but not showing EDIT and DELETE -

i have tableview in uiviewcontroller class. have implement swipeable when swipe should show edit delete, 2 action. problem is, it's going inside method when swipe, did not show 2 actions. func tableview(tableview: uitableview, commiteditingstyle editingstyle: uitableviewcelleditingstyle, forrowatindexpath indexpath: nsindexpath) { } func tableview(tableview: uitableview, editactionsforrowatindexpath indexpath: nsindexpath) -> [uitableviewrowaction]? { let editaction = uitableviewrowaction(style: .default, title: "edit") { action, index in print("edit"); } editaction.backgroundcolor = uicolor.bluecolor() let deleteaction = uitableviewrowaction(style: .default, title: "delete") { (rowaction:uitableviewrowaction, indexpath:nsindexpath) -> void in print("delete"); // self.confirmdelete(); } deleteaction.backgroundcolor = uicolor.redcolor() return [editaction,deleteaction] } ...

r - Markdown for Reproducible Research in Python -

i know whether there equivalent r-markdown in python can me reproducible research. please note: i'm not interested in ipython notebooks answer . i want have syntactic joy of r-markdown code in python. know 1 can supply engine="python" in r-markdown , going problem comes when want include plots produced using matplotlib in reproducible doc writing plt.show() plt alias matplotlib.pyplot . do know such modules / tools in python can me achieve this? want use such tools spyder / intellij. i option similar echo=false present in such tool. if no such project exists, guys know / organization working on such thing.

android - Overwrite HOST header in okhttp request -

i using okhttp send http request android apk. due server-side proxy requirement, url endpoint like: " https://api.example.com ", in http request, overwrite host header "host: proxy.example.com". tried use like: httpurl url = new httpurl.builder() .scheme("https") .host("api.example.com") .build(); okhttprequest = new com.squareup.okhttp.request.builder() .url(url) .method("get", requestbody) .header("host", "proxy.example.com") .build(); response = mokhttpclient.newcall(okhttprequest).execute(); however, when looked http request in network packages, host header still "api.example.com". wonder, advice can overwrite host header? lot! by default okhttp won’t let set host header that’s different url’s host. can hack using network interceptor sets host header.

excel - saving a file to dynamic path which is a value in excell cell -

i have vba code in powerpoint saves file automatically name of excel file active . powerpointapp.activepresentation.saveas "z:\05_project\tanverdi\" & replace(thisworkbook.name, "xlsm", "ppt"), 1 different people going use macro , have different folders save it, want path of folder dynamic too. best getting path name active excell cell, can write path name in excel cell , can use cell value path. but how do ? let's path in sheet1/cell a1, replace hard coded path with: powerpointapp.activepresentation.saveas thisworkbook.sheets(1).range("a1").value & replace(thisworkbook.name, "xlsm", "ppt"), 1

ios - Can we allow different "indexes" of a NSMutableArray to be manipulated simultaneously from two threads -

nsmutablearray not thread-safe, don't see why can't designed thread-safe long different indices being manipulated simultaneously. e.g. index 1 points instance of class x , index 2 instance. isn't efficient allow these 2 objects manipulated @ same time? allowed when use gcd or need use dispatch barrier when changing objects pointed different indices? think of this. your array contains pointers objects. pointers signposts, pointing objects located in memory. now when mutate object, don't touch pointers object. object's location in memory unaffected. therefore, array's point of view, nothing happens when mutate objects in it, pointers remain unaffected. this means mutating different objects in array different threads safe. therefore, correct when it's more efficient download data in parallel different objects in array. so long you're not mutating array itself (adding or removing objects) or mutating same object concurrently, you...

ios - Why can't I make an array of type NSLayoutConstraint? -

this question has answer here: instance member cannot used on type 4 answers basically, trying reset nsconstraints when user taps button. my constraint outlets: @iboutlet weak var firstbuttonheight: nslayoutconstraint! @iboutlet weak var secondbuttonheight: nslayoutconstraint! @iboutlet weak var thirdbuttonheight: nslayoutconstraint! example action: @ibaction func firstbuttonheight(sender: uibutton) { firstbuttonheight.constant = 100 } thought put them array (below) , iterate through them before running firstbuttonheight.constant = 100 : var constraints: [nslayoutconstraint] = [firstbuttonheight, secondbuttonheight, thirdbuttonheight] constraint in constraints { constraint.constant = 50 //original constraint value } however, error instance member 'firstbuttonheight' cannot used on type 'viewcontroller' . when did firstbuttonhei...

sql server - Returning different tables based on parameter? -

for example, have function returns table columns follows: returns table (a character varying, b boolean, c numeric) then based on parameter result_mode default 'summary' , want return different table follows: returns table (a timestamptz, b boolean, c character varying, d numeric) originally have stored procedure in ms sql return results 'summary', 'customer item summary', 'item summary' etc. in postgresql, different think. i might need create multiple functions if can't fit them 1 single function. so, possible sort of have if-statement or case statement returns table based on parameter input?

Python selenium executing add-on -

chop = webdriver.chromeoptions() prefs = {"download.default_directory" : desire_save_path} chop.add_experimental_option("prefs",prefs) chop.add_extension(file_location) driver = webdriver.chrome(chromedriverpath, chrome_options = chop) i've created .crx file make chrome load add-on when launches. next, want make click add-on button @ top right corner make execute. able using pyautogui make manually click it. however, i'd rather not have program clicking on place. there better way? if point me right direction, that'd great. thank much if want run chrome-extension in browser, don't need click it's icon extensions panel, can run manually @ first , when extension page loaded save it's url variable. should looks like extension_url = 'chrome-extension://just_sequence_of_symbols/addon_name.html' and can run automatically: chop = webdriver.chromeoptions() prefs = {"download.default_directory" : desire_save_p...

What does ${} (dollar sign and curly braces) mean in a string in Javascript? -

i haven't seen here or on mdn. i'm sure i'm missing something. there's got documentation on somewhere? functionally, looks allows nest variable inside string without doing concatenation using + operator. i'm looking documentation on feature. example: var string = 'this string'; console.log('insert string here: ${string}'); you're talking template literals . they allow both multiline strings , string interpolation. multiline strings: console.log(`foo bar`); // foo // bar string interpolation: var foo = 'bar'; console.log(`let's meet @ ${foo}`); // let's meet @ bar

angularjs - Angular submit a preset input value -

i'm having trouble submitting preset value. if type in input gets submitted fine. if not value showing undefined. if set array values @ beginning before controller shown in page , gets submitted. if initialize array populate dynamically submits empty arry not shown on page. i know it's weird angular $scope issue i've been trying days debug unsuccessfully. can find problem? <button type="button" class="btn btn-primary" form="commandform" ng-click="submitcmd(mycommand)"> <tr ng-repeat="param in paramlist"> <td></td> <td><input type="text" id="paramname" class="hidden_text" ng-model="mycommand.paramnames[$index]" ng-readonly="false...

javascript code in onkeypress value -

for below text box: <input type="text" style="" onkeypress="javascript:doit_onkeypress(event);" /> this script working fine. <script type="text/javascript"> function doit_onkeypress(event){ if (event.keycode == 13 || event.which == 13){ here action works } } </script> but problem images (instead of text area) creating dynamically. i trying execute same <input type="text" style="" onkeypress=" <script type="text/javascript"> function doit_onkeypress(event){ if (event.keycode == 13 || event.which == 13){ here action works } } </script>" /> is possible above modifications? why because dynamically generating images can't write java script on key press actio...

web applications - Can't update manifest.json for my android homescreen webapp -

i can't seem manifest.json (associated webapp on android phone) updated. i created web page created needed manifest.json file as: { "lang": "en", "display": "fullscreen", } included link in html of web page <link rel="manifest" href="http://yoursite.com/manifest.json"> brought web page on samsung android phone in browser (samsung internet 2.1) , clicked "add shortcut home screen" looked good. shortcut on homescreen icon , took me webpage in fullscreen mode. now trying change things in manifest.json. wanted add start_url , add url parameters. deleted icon on home screen, changed code in manifest.json on webserver. loaded webapge in browser , added shortcut homescreen. url parameters not passed webpage. i did same steps again, manifest.json different url. no dice. tried changing "fullscreen" "browser". delete icon, add homescreen, try again. nope - stil...

r - 2d density plot for categories -

Image
i'm trying make 2d density plot density displayed each category. example, in image below, have density plot each day, , daily densities combined coloured plots. these types of plots common in scientific literature on atmospheric sciences , aerosol pollution studies. so far i've got this ggplot(dat, aes(y = `dn/dlogdp`, x = date)) + stat_density2d(geom="tile", aes(fill = ..density..), contour = false) + scale_fill_gradient(low="blue", high="red") + geom_point(alpha = 0.1) + theme_bw() but want facet day, , i'm not sure start. here example data: structure(list(date = structure(c(1359244800, 1359245400, 1359246000, 1359246600, 1359247200, 1359247800, 1359248400, 1359249000, 1359249600, 1359250200, 1359250800, 1359251400, 1359252000, 1359252600, 1359253200, 1359253800, 1359254400, 1359255000, 1359255600, 1359256200, 1359256800, 1359257400, 1359258000, 1359258600, 1359259200, 1359259800, 1359260400, 1359261000, 13592...

Operator overloading definition outside of the class - C++ -

sorry such simple question. i've been using tutorialspoint.com learn c++. i'm trying learn classes , operator overloading. other member function, website uses convention class box { private: int volume; public: box(int num); ... } box::box(int num) { volume = num; } however, when overloading operators, use this class box { private: int volume; public: box(int num); box operator+(const box &b) { box box; box.volume = this->volume + b.volume; return box; } } they define overloading function inside class. possible define outside class? if so, how? i've tried box box::operator+(const box &b) {...} box::box operator+(const box &b) {...} but these don't work how do outside of class? again, sorry such simple question. thanks edit code looks this #include <iostream> #include <string> using n...

mongodb - Error while setting up compound index -

i want setup compound index on fb_id , ts in mongodb. so, did: primary> db.sessions.ensureindex( { fb_id: 1, ts: 1 }, { unique:true } ); but got following error: e11000 duplicate key error index: tracking.sessions.$fb_id_1_ts_1 dup key: { : null, : null } so checked indexes in collection using db.sessions.getindexes() , got: [ { "v" : 1, "key" : { "_id" : 1 }, "ns" : "tracking.sessions", "name" : "_id_" } ] it doesn't duplicate key me. doing wrong here? mongodb tells you have several documents (more one) same fb_id , ts values, null values. in other words, there documents without fb_id , ts fields. so, violates unique constraint across collection. as workaround, should take @ sparse indexes. quote docs: sparse indexes contain entries documents have indexed field. document missing field not indexed. index “spa...

How to install lxml on Amazon EC2 for Python 3.4 -

after got lxml installed on computer downloading .whl file http://www.lfd.uci.edu/~gohlke/pythonlibs/ , thought lxml installation problems behind me. but, wrong. not seem easier on ec2 platform. have tried every command can think of—sudo pip3/pip3.4/pip-3.4/easy_install-3.4 lxml/lxml-3.5.0-cp34-none-win32.whl/lxml-3.5.0-cp34-none-win32.whl, static_deps=true sudo pip3/pip3.4/pip-3.4/easyinstall-3.4 install lxml. keep getting could not find function xmlcheckversion in library libxml2. libxml2 installed? error message. have tried install these libraries too, far not successfully. installing either lxml or dependent libraries appreciated. i able install libxml2 executing following procedure: download tar.gz. file http://www.linuxfromscratch.org/blfs/view/7.7/general/libxml2.html , transfer ec2 instance, , run tar -zxvf libxml2-2.9.2.tar.gz directory in file located. run sudo yum install libxml2-devel libxslt-devel python34-devel . (the reason why unable install these packa...

google maps - directionDisplay.setDirections() a.lat is not a function -

Image
i setting directions in map using direction.setdirection method , getting directions form stored json file. when load directions without waypoints , works fine. when load directions waypoints gives me error a.lat not function . display starting location (a) , 1 waypoint on map. code load directions on map function route() { $.ajax({ type: 'post', url: '/home/getroute', success: function (response) { //alert(response); var route = json.parse(response); alert(route.data); //alert(data); directiondisplay.setdirections(json.parse(route.data)); }, error: function (error) { alert('error: ' + error); } }); update: double parsing because object attribute data. response object property data contains json string. { "data": "{"geocoded_waypoints":[{"geocoder_status":"ok","p... on ...

python - PyQt: tab order not working for a simple custom widget -

i have made custom widget consisting of spinbox , checkbox. widget delegates focus spinbox using setfocusproxy. checkbox should not focus. my problem when use widget in layout, qt tab order not work expected. below minimal working example. in example, focus should move var 1->var 3->var 2->var 4 when pressing tab key, doesn't. if replace checkspinboxes regular qt widgets (e.g. qcheckboxes), works expected. using checkbox focus proxy seems make tab order work properly. problem seems using spinbox focus proxy. from pyqt4 import qtgui, uic, qtcore import sys class checkspinbox(qtgui.qwidget): def __init__(self, parent=none, label=none): super(self.__class__, self).__init__(parent) self.degspinbox = qtgui.qspinbox() self.normalcheckbox = qtgui.qcheckbox(label) layout = qtgui.qhboxlayout(self) layout.addwidget(self.degspinbox) layout.addwidget(self.normalcheckbox) self.degspinbox.setfocuspolicy(qtcore.qt.st...

forms - My php code is not working, and as a new php coder I am not sure where my mistake is? -

this php code, using post contact form site gmail account. seems when gathers information, not sent , keeps typed information visible on contact.php page, instead of providing error <?php session_start(); require_once 'phpmailer/phpmailerautoload.php'; $errors = array(); if(isset($_post['name'], $_post['email'], $_post['phonenumber'], $_post['services'], $_post['message_area'])) { $fields = array( 'name' => $_post['name'], 'email' => $_post['email'], 'phonenumber' => $_post['phonenumber'], 'services' => $_post['services'], 'message_area' => $_post['message_area'] ); foreach($fields $field => $data) { if(empty($data)) { $errors[] = 'the ' . $fields . ' field required.'; }...

How to resolve an issue with overloading operators in haskell? -

i can file compile fine. however, when try test if operator overloaded correctly error message: *main> myfloat (2,3) + myfloat(3,3) <interactive>:19:15: ambiguous occurrence `+' refer either `main.+', defined @ problem1.hs:3:16 or `prelude.+', imported `prelude' @ problem1.hs:1:1 (and defined in `ghc.num') the code using is: data myfloat = myfloat (int, int) myfloat (a, b) + myfloat (c, d) = ((fromintegral a)/ (fromintegral(order a)) * 10^b) prelude.+ ((fromintegral c)/ (fromintegral(order c)) * 10^d) order :: int -> int order b | b == 0 = 0 | otherwise = ((ceiling ((logbase 10 (abs (fromintegral b))))) prelude.+ 1) am misunderstanding how overload operators correctly, or there different problem entirely? what want make class instance of num instance num myfloat x + y = <put in definition here> note num require definition of (*), abs...

c# - how to get multiple a tags within multiple divs in Html having same names with help of Html agility pack, -

<div class="itemmenu level1"> <a class="itemmenuname level1" href="http://www.shophive.com/apple/mac"> <span>macbook</span> </a> // here more divs in div submenu items , level1 div ends under them </div> i want href link in tag within div, code below foreach (htmlagilitypack.htmlnode node in doc.documentnode.selectnodes("//div[@class='megnor-advanced-menu-popup_inner']")) { foreach (htmlagilitypack.htmlnode node2 in node.selectnodes("./a[@class='itemmenuname level1']")) { console.writeline(node2.innertext + " "); console.writeline(node2.getattributevalue("href", "")); } i getting whole block of code first loop second loop giving me error of nullreference

css - Bootstrap transparent navbar -

i'm trying make navbar transparent kinda this . can't seem work. i've added rga(0,0,0,0.5) on navbar class. i figured out. needs in future. added css override was: .navbar.transparent.navbar-inverse .navbar-inner { background: rgba(0,0,0,0.4); } and html syntax looks like: <div class="navbar transparent navbar-inverse navbar-fixed-top"> <nav class="navbar-inner"> ... </div> </div>

javascript - Autocomplete first line shouldn't be active -

Image
i'm still working on autocomplete integration , found out strange behaviour. when start type , autocomplete popup shown, can't move next line 'enter' because first line in autocomplete active. how can disable this? here's how looks: i want leave 'ace' word on fifth line , go 6th line 'enter' can't. here's i've changed in ext-language_tools.js: changed false this.autoselect = false; // changed true popup.setdata = function(list) { popup.setvalue(lang.stringrepeat("\n", list.length), -1); popup.data = list || []; popup.setrow(-1); // changed 0 }; and added additional condition: popup.setrow = function (line) { if (line == -1) // added { popup.selection.clearselection(); selectionmarker.start.row = selectionmarker.end.row = line; popup.session._emit("changebackmarker"); popup.movecursorto(line, 0); if (popup.isopen) popup._si...

twitter bootstrap - PIMCore carousel issue -

Image
i'm building new website using pimcore first time , getting grips quite well. however, i've come across issue has me stumped , looking answer on google has proved fruitless. i've added block , placed gallery carousel feature in it, works great. can add image, title , description first slide, however, subsequent slides not show images nor inputs title , description. merely 2 horizontal lines presume input boxes (see below). even if code carousel feature in myself, leaving image, title , description input fields, still comes out same way. looking @ demo suite on pimcore 4, front page carousel works intended, however, in basic-examples , galleries, comes out above, me signifies major problem in carousel code. any gratefully received. in such cases makes sense disable carousel plugin when in editmode , display images 1 after another. for example: <script> $('.carousel').carouselplugin({ //////////// }); </script> <div class=...

Simple syntax PHP error -

this question has answer here: what difference between single-quoted , double-quoted strings in php? 10 answers i'm getting syntax error parse error: syntax error, unexpected 'text' (t_string) in c:... line 18. i don't know why getting error. sooner response better. thank much. <?php session_start(); ?> <!doctype html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <title>login</title> </head> <body> <div align="center"> <img src="logo.png" alt="school logo"> <h2>login</h2> <?php $form="<form action='./login.php' method='post'> <table> <tr> ...

declaring variable inside mysql stored procedure -

we trying declare variable inside mysql stored procedure has transaction implemented in it. seems giving syntax error : following syntax of stored procedure: create procedure `sp_markappointmentrefferal`( p_appid bigint, p_newlocation bigint, p_userid bigint, p_referralreason varchar(500), p_newlocationname varchar(100) ) begin declare v_oldlocation int default 0; set v_oldlocation = (select locationid appointments iappid = p_appid limit 1 ); declare exit handler sqlexception begin rollback; select -1; end; start transaction; update table set is_referred = 1, referred_timestamp = now(), referral_reason = p_referralreason iappid = p_appid limit 1; -- create new appointment new referred location.. insert appointments (vappname, vapptype, dappdate, vcell, ipatid, iappstatus, iuserid, iactive, dinsertdate, ihsid, daily_ticket_no, locationid, visit_id, encounter_id, referredfrom,referredopdname, opd_name ) selec...

android - google play games service same e-mail account returns difference id -

i'm using google-play-games-service plug-in unity 0.9.26. namespace googleplaygames { public class pluginversion { // older versions, used when upgrading other versions public const string versionkeycpp = "00911"; public const string versionkeyu5 = "00915"; public const int versionint = 0x0926; public const string versionstring = "0.9.27"; public const string versionkey = "00927"; // used check correct min version or play services. public const int mingmscoreversioncode = 8115000; // used right version of dependencies. public const string playservicesversionconstraint = "8.1+"; } my server identify user id social.localuser.id //(like 123456789012345678901) 21character i saw id unique, after release app user send difference id(not null or empty, g1234568901234567890 start 'g' same 21character) server can't find user data. is fault or kind of bug? this change in behavior of play game services. de...

Google+ Share link / Send message to pre-filled users -

i building web application using google+ login. users can select people in circles invite them on app events. i users able share event link or send via message users have selected (i have ids...) without having type again every name in share dialog. it's possible facebook api tough possible g+ didn't find that. i found answer question ; with interactive post, it's possible specify data-recipients data-prefilltext. more informations on google specific documentation

visual studio 2010 - Debugging Classic ASP Windows 8/IIS 8 VS2010/VS2012 -

moved on win8 metro development, need support classic asp code. on windows 7/iis6 debug classic asp code vs2008/2010, no problems. first time trying on win8/iis8 , having no luck started. in win7/iis6, start vs2010, attached debugging w3wp.exe (running vs2010 in administrator mode), debugger attached , can see classic asp code. in win8/iis8, start vs2010, attached debugging w3wp.exe (running vs2010 in administrator mode), debugger attached , cannot see classic asp code. other observation under win7, w3wp.exe type script/managed(v2...), x64 under win8 w3wp.exe type x86. can help? as stated here problem registry key. me problems solved changing registry key 8. hkey_classes_root\appid\\{e62a7a31-6025-408e-87f6-81aeb0dc9347} set appidflags 28 8 (not 20 stated in original workaround microsoft). after changed registry key able debug classic asp on iis8 under win8 vs2010 , vs2012. furthermore use of vbscipt keyword "stop" possible after change. jit...

javascript - Append Symbols like ♀ to an input text field -

i'm creating simple search utility , needs able use characters ♀ , ♂. make easier, i'm creating buttons append characters field. however, can't figure out how append field. i'm using following right now: function addfemale() { document.getelementbyid('searchfield').value += "♀"; } however, adds ♀ text field. how can make work? try add meta tag <meta charset="utf-8"> on page in <head> tag. meta tag specifies character encoding html document.

Right way of doing Realm Migration Android -

we use realm our app. our app has been beta released. want add field 1 of our realm objects. got write realmmigration , wrote 1 too. question here how apply realm migration app. use realm.getinstance() realm instance whenever want something. remember, realm.getinstance() being used in entire app everytime, want access realm database. so, bit queried on how apply migration? leads can helpful. thanks. my realmmigration follows. public class realmmigrationclass implements realmmigration { @override public void migrate(dynamicrealm realm, long oldversion, long newversion) { if(oldversion == 0) { realmschema sessionschema = realm.getschema(); if(oldversion == 0) { realmobjectschema sessionobjschema = sessionschema.get("session"); sessionobjschema.addfield("issessionrecordinguploading", boolean.class, fieldattribute.required) .transform(new realmobjectschema.function...

java - how to avoid Files.lines() throwing MalformedInputException on japanese text? -

Image
my code throws exception exception in thread "main" java.io.uncheckedioexception: java.nio.charset.malformedinputexception: input length = 1 @ java.io.bufferedreader$1.hasnext(bufferedreader.java:574) @ java.util.iterator.foreachremaining(iterator.java:115) @ java.util.spliterators$iteratorspliterator.foreachremaining(spliterators.java:1801) @ java.util.stream.referencepipeline$head.foreachordered(referencepipeline.java:590) when executing line files.lines(in.topath()).foreachordered(new consumer<string>() { @override public void accept(string s) { //stuff }); the file causes behaviour when opened in notepad++ shows of course text garbled because of encoding, if select "convert utf-8" "encoding" menu shows correctly which makes me assume utf-8 correct encoding, according java documentation files.lines() uses utf-8 encoding default (it's equivalent of files.lines(path, standardcharsets.utf_8)) yet still break...

Does Netty 4.0.43 support Websockets RFC 6455? -

does netty 4.0.43 support websockets rfc 6455 ? official docs hybi-10 , mentioning hybi-17 . yes netty supports websockets rfc6455 since long time.

javascript - Pinterest API UncaughtReference Exception -

can explain how correctly access , parse users pinterest boards? attempting use pinterest api list of pins on users board keep getting uncaughtreference error on commented line below. <script> window.pasyncinit = function() { pdk.init({ appid: "xxxxxxx", cookie: true }); }; (function(d, s, id){ var js, pjs = d.getelementsbytagname(s)[0]; if (d.getelementbyid(id)) {return;} js = d.createelement(s); js.id = id; js.src = "//assets.pinterest.com/sdk/sdk.js"; pjs.parentnode.insertbefore(js, pjs); }(document, 'script', 'pinterest-jssdk')); var pins = []; var board_id='yyyyy'; pdk.request('/boards/'+board_id+'/pins/', function (response) {// error here if (!response || response.error) { alert('error occurred'); } else { pins = pins.concat(response.data); if (response.hasnext) { response.next(); ...

.net - C# Check gridview row select or not -

i want check whether row in gridview selected or not. how can write if condition?? if (gridview-row[1].select) { //do } else { //do } youcan use gridviewrow.rowstate property asp.net gridview.rowstate gridviewrow row = yourgridview.selectedrow; give selected row and check   if(row.rowstate == datacontrolrowstate.selected)     {       //selectd     } 

ios - How to achieve this animation in UICollectionView while clicking a cell of it? -

i got requirement achieving animation shown in video in following link. cell expansion the animation require when click done on uicollection cell , goes detail view. how achieve this? you can retrieve location of cell in - (void)collectionview:(uicollectionview *)collectionview didselectitematindexpath:(nsindexpath *)indexpath after have x,y,w,h can create "popviewcontroller" just change animation animation need , add shade or border give more effect) check here border , shadow for animation can use: [uiview animatewithduration:0.5f animations:^{ code }];

linux - Nmon analyzer automation issue -

i have nmon installed on linux servers , collect nmon files , save folder, later use nmon analyzer generate reports. when doing manually facing no issue, when providing nmon analyzer file of list of nmon files(fileslist) nmon setting processed giving me pop pop message . after click yes pops generates reports. have scripted of these program waiting response. there stop popup. first of little clarifications: nmon , nmon analyser not mixed up nmon: nmon c program , sourceforce project - current version 16d. nmon analyser: the nmon analyser microsoft excel spreadsheet , current version 4.7 new release curently in testing , maintained ibm this clarifications required issue can of above 2 projects , hence should differently addressed. issue related later 1 i.e nmon analyser reason: data had multiple aaa,x86, records causing error within pp_aaa create.labels function if merge = no. fix: pp_aaa create.labels function should have merge = yes. ...

r - How to get dpois results for multiple x and multiple lambda? -

i'm trying probability matrix poisson distribution using vector of lambda. want get: x<-seq(1,3,1) lambda<-seq(1,2,0.5) dpois(x,lambda[1]) [1] 0.36787944 0.18393972 0.06131324 dpois(x,lambda[2]) [1] 0.3346952 0.2510214 0.1255107 dpois(x,lambda[3]) [1] 0.2706706 0.2706706 0.1804470 when this: dpois(x,lambda) [1] 0.3678794 0.2510214 0.1804470 i probs of x[i] lambda[i] , not each lambda probs of x i want know how without using loop... in other words insert dpois() 2 vectors x , lambda, , possible probability combination. for creating pairs of combinations of vectors need use expand.grid function. x <- seq(1, 3, 1) lambda <- seq(1, 2, 0.5) grid <- expand.grid(x=x, lambda=lambda) dpois(grid$x, grid$lambda) when r in vectorized way, aligns , repeats shorter vectors longest vector in example below: > cbind(1:5, 1:8, 1:2, 1:3) [,1] [,2] [,3] [,4] [1,] 1 1 1 1 [2,] 2 2 2 ...

javascript - CKEditor plugin not in plugins folder -

when used ckbuilder build editor have added uploadimage plugin , shows in 'selected plugins' list. when build ckeditor , download zip file, uploadimage folder (and depencies) not in plugins folder. doing wrong? if used ckbuilder add plugin, should ok - ckbuilder creates optimized, production-ready ckeditor distribution, dependencies resolved, , with plugin.js files merged ckeditor.js file better performance. if download plugin zip file manually, need (1) manually resolve plugin dependencies , (2) manually add additional plugins editor configuration. plus performance gets hit because need loading additional plugin js files no reason @ all.

qt - What is the difference between QtWebEngine and WebView? -

this question has answer here: qwebview or qwebengineview 3 answers i think title explains pretty everything. but once again, how explain roles & purposes of these 2 terms displaying webcontent in qt applications? if use webview , automatically involve qtwebengine or else? i have read in wikipedia qt uses blink web engine, on qt 's official pages don't mention term blink anywhere. since can't comment directly on post low reputation reason, answering here. question related : qwebview or qwebengineview . basically, qwebview uses webkit backend, whereas qwebengineview uses chromium backend. these 2 links may interest you, both referring latest version of qt (5.6) : qwebview : http://doc.qt.io/qt-5/qml-qtwebview-webview.html#details qwebengineview : http://doc.qt.io/qt-5/qml-qtwebengine-webengineview.html#details i working qweben...

bluej - How do you make an Arraylist of RandomNumber integers? java -

so relatively new programming scene , confused why code doesn't work. trying make arraylist of flowers , use random number generator create random number of flowers, , store them in array. in logic, thought created variable store numbers (ex randomroses ) , stored number in array print out how many of each flower there calling arraylist , position. (ex flowerarray[0] print out 8 roses) sadly not. public class flower { private int randomroses; private int randomtulips; private int randomorchids; public arraylist <integer> flowerarray; public flower() { r = new random(); t = new random(); o = new random(); int randomroses = (r.nextint(10) + 0); int randomtulips = (t.nextint(10) + 0); int randomorchids = (o.nextint(10) + 0); flowerarray = new arraylist<integer> } public void add2array () { flowerarray.add(randomroses); //flowerarray[0] # of roses flowerar...

java - How can I compare 2 xml files for changed nodes? -

i have 2 xml files a.xml , b.xml , b.xml modified version of a.xml node values have been changed. want make check in code particular node values can changed not nodes. how can make check in java? getting xml user , allowed change particular nodes if changes other nodes should not allow .below xml can see <xt:path>helloworld/businessservices/mytest</xt:path> has changed in both valid case has changed <xt:value xsi:type="xs:string" xmlns:xs="http://www.w3.org/2001/xmlschema">40</xt:value> 30 40 not valid. a.xml <?xml version="1.0" encoding="utf-8"?> <cus:customizations xmlns:cus="http://www.bea.com/wli/config/customizations" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:xt="http://www.bea.com/wli/config/xmltypes"> <cus:customization xsi:type="cus:envvaluecustomizationtype"> <cus:description/> <cus:envvalueassignments...

java - Threads synchronising not working -

i trying implement synchronization using following code, not working expected. class callme extends thread{ synchronized void call( ) { system.out.print("[" + "hello"); try { thread.sleep(1000); } catch(interruptedexception e) { system.out.println("interrupted"); } system.out.println("]"); } public void run() { call(); } } public class threads { static void main(string args[]) { callme target = new callme(); callme target2 = new callme(); target.start(); target2.start(); }} the output should [hello][hello] [hello[hello]] not synchronized. you code working fine imo , in fact there not synchronizing issue there, why not?: every object of class thread calling own call method, , printing when should, in fact trying same resource, (the system.out.print) not synchronized.... totally correct behavior like [hello[hello]] in output. ...

php - Display menu if site is homepage (wordpress) -

on site have left menu, appears on every subpage <div class="category_menu"> <nav class="cat_menu"> <div class="menu_title parent_cat_name"> <h6><?php echo $category->name; ?></h6> </div> <?php rs_left_menu_subcats($subcategories); ?> </nav> </div> i display menu if site homepage. in other cases should menu code pasted. what code may use? you can combine is_front_page() , is_home() wordpress function. <?php if( is_front_page() && is_home() ) { ?> // on homepage, show menu <?php } else { ?> <div class="category_menu"> <nav class="cat_menu"> <div class="menu_title parent_cat_name"> <h6><?php echo $category->name; ?></h6> </div> <?php rs_left_menu_subcats($subcategories); ?> </nav...

list - How do I create an applicative instance for ziplist? -

i want implement instance of applicative custom list. import test.quickcheck import test.quickcheck.checkers import test.quickcheck.classes data list = nil | cons (list a) deriving (eq, show) instance eq => eqprop (list a) (=-=) = eq instance functor list fmap _ nil = nil fmap f (cons nil) = (cons (f a) nil) fmap f (cons as) = (cons (f a) (fmap f as)) main = let trigger = undefined :: list (int, string, int) quickbatch $ applicative trigger instance arbitrary => arbitrary (list a) arbitrary = sized go go 0 = pure nil go n = xs <- go (n - 1) x <- arbitrary return (cons x xs) instance applicative list pure x = (cons x nil) nil <*> _ = nil _ <*> nil = nil (cons f fs) <*> (cons as) = (cons (f a) (fs <*> as)) this gives following bugs: λ> main applicative: identity: *** failed! falsifiable (after 3 tests): cons 0 (cons (-1) nil) composition: *** fai...

java - How to check weather string contains single backslash? -

i want check if string contains "\" or not. used string method contains(), not working string path = "d:\steve\"; if(path.contains("\"){ path = path.replaceall("\\\\",""); } use escape character \ public class test{ public static void main(string[] args) { string str = "a\\b"; system.out.println(str.contains("\\")); } } a character preceded backslash ( \ ) escape sequence , has special meaning compiler. https://docs.oracle.com/javase/tutorial/java/data/characters.html

css - font size depending on container width? only in mobile -

Image
i encountered strange problem don't know how solve. seems font size displayed depending on width of container: for example width:100% and same width:50% font-size 24pt. but strangely, happens when activate mobile icon in chrome / see on phone. on desktop version, not matter: and so bothering me lot because other parts of page have same font-size it's showing differently. i'm not author of full css may missing something. ideas?