Posts

Showing posts from January, 2014

ios - iOS9 Safari content blocker extension not invoked -

i'm playing xcode7 beta, trying test shiny new " content blocker extension ". example class adopting same nsextensionrequesthandling protocol (already known) sharing extension. essential difference sharing extension class plain nsobject , not *viewcontroller subclass because, know, blocker extension isn't supposed showing ui feedback. that's understanding @ least. anyway crucial method beginrequestwithextensioncontext supposed feed blocker declaration json extension point, not invoked. extension have truepredicate nsextensionactivationrule , safari acknowledge existence of host app in new safari config "content blockers". still no cigar. does know if it's supposed working in beta or press release? and, oh, while we're @ it, there any documentation of declarative json format or it's google-fu failing me? :) how know extension isn't getting invoked? i built quick test app , did simple nslog() beginrequestwithexten

angularjs - Once I turn off debuggingData in angular, is there another way to get the rootscope? -

i think having debugging info on default in angular sink large apps. can disable in production: https://docs.angularjs.org/guide/production#disabling-debug-data but there cases do: angular.element(document).scope() in order access rootscope. there way in angular $rootscope without debugging feature on? to access $rootscope angular.element(document).injector().get('$rootscope')

javascript - While call function I got this error HttpUserAgent.Errors.SendRequestFailure -

Image
i got httpuseragent.errors.sendrequestfailure error while try call function. works fine when use http when try call https url side httpuseragent.errors.sendrequestfailure error. function process() { var ua = new httpuseragent(); script.log("test"); var resp = ua.request("http://www.google.com"); //var resp = ua.request("https://www.irctc.co.in"); script.log("test1"); return resp; } i following error:

Elasticsearch. Nested field type and raw string subfield -

i has mapping: { "properties":{ /*some fields ommited*/, "properties":{ "type":"nested", "properties":{ "fielda":{ "type":"string", "fields":{ "raw":{ "index":"not_analyzed", "type":"string" } } } } } } } and documents: { /*some fields ommited*/, "properties":{ "fielda":"one" } } { /*some fields ommited*/, "properties":{ "fielda":"two" } } and on. i try make query: { "query": { "nested&

javascript - Safari turns Simple Cors Request into Preflight after 302 redirect -

i found out following issue occurs on safari via javascript, jquery ajax: i make cors simple request using get server responses 302 safari follows redirect uses options instead of method, preflight request i expect step 3 invoke simple request using get, how done in chrome , firefox. the problem server responses request after step 3 can not handle requests method options , therefor fails status "method not allowed". since have no influence on server side, need force either not follow redirect automatically , manually instead or somehow tell safari not switch options. is there way 1 of options?

c++ - MacPorts clang not using its own headers -

i'm trying emscripten work on os x 10.8, see this post related issues there. apparently clang++ version shipped xcode old, got recent clang 3.7.0 using macports. told cmake use compiler (passing -dcmake_cxx_compiler=clang++-mp-3.7 on command line), still fails: [ 33%] building cxx object cmakefiles/optimizer.dir/parser.cpp.o /opt/local/bin/clang++-mp-3.7 -std=c++11 -fno-exceptions -fno-rtti -o3 -dndebug -o cmakefiles/optimizer.dir/parser.cpp.o -c …/emsdk/emscripten/master/tools/optimizer/parser.cpp in file included …/emsdk/emscripten/master/tools/optimizer/parser.cpp:2: in file included …/emsdk/emscripten/master/tools/optimizer/parser.h:12: …/emsdk/emscripten/master/tools/optimizer/istring.h:3:10: fatal error: 'unordered_set' file not found #include <unordered_set> ^ 1 error generated. i can reproduce issue launching compiler command line. in parallel build mode, it's instead complaining <cstdint> optimizer.cpp instead. bo

excel vba - VBA CSV Import Code in Shared Network not working on co-workers connections -

i have coded csv import file imports , sorts information, import section of code being skipped no errors on co-workers computer , not mine. both access same file in same folder on same shared network, reason not running code same. there no error codes, , set connection shared network using same network folder: n:\12abc\program\main (put csvs here) sub importallcsv() dim fname variant, r long r = 1 fname = dir("*.csv") while fname <> "" importcsvfile fname, activesheet.cells(r, 1) r = activesheet.usedrange.rows.count + 1 fname = dir loop end sub sub importcsvfile(filename variant, position range) activesheet.querytables.add(connection:= _ "text;" & filename _ , destination:=position) .name = replace(filename, ".csv", "") .fieldnames = true .rownumbers = false .filladjacentformulas = false .refreshonfileopen = false .backgroundquery = true .r

continuous integration - [Jenkins]Why User-Defined axis doesn't work with slaves -

Image
i created multi-configuration project running couple of automation tests. have user-defined axis running on single node , want parallelize process. i have following configuration: my problem both jobs running 1 same node. @ first wil start "eu_washroom" , "eu_linen". "eu_linen" not running on 5th(jenkinsqft5) node, instead running on 4, disregarding combination filter( qf_script_name == "eu_linen" && slave=="jenkins-qft5" ). @ end of name of job, name of node added. is bug or doing wrong? i'm using jenkins version 1.598 edit: deleted combination filter , 4 combinations running on single node. both nodes set usage: "utilize node as possible" edit #2: deleted user-defined axis, , let slave-axis , acts same. console of job should ran on jenkins- qft5 : building remotely on jenkins-qft4 in workspace c:\jenkinsslave\lib\workspace\8.03.08-qf-tests\testparalelfor8\jenkins-qft5 in jenkins

javascript - SAPUI5 event handler function for view leave -

i declared controller view in sapui5 application. want perform tasks when view leaved user. there possibility add callback function attachroutepatternmatched to perform tasks when view navigated user need equivalent function handle leave of view. use splitcontainer parent container oninit: function () { this._orouter = sap.ui.core.uicomponent.getrouterfor(this); this._orouter.attachroutepatternmatched(this._routepatternmatched, this); }, _routepatternmatched: function (oevent) { var = this; var sroutetargetname = oevent.getparameter("name"); if (sroutetargetname === "myview") { // perform tasks if view opened user } }, you can try if works: navaway: function(viewname, callback) { this._orouter.navto(viewname); if(callback && typeof(callback) === "function") { callback(); } } e.g. this.navaway("myview", function() { //dostuff });

Cant get information of my friends - Facebook Graph API -

im trying information of friends, return of friends, not all. what problem? in v2.0 of graph api not possible that. check answer .

java - How to reset back to default css after adding style? -

basically have changed css text field in javafx adding style class this: textfield.getstyleclass().add("textfieldstyle"); but want able revert original appearance. since original appearance in case default skin javafx, can't find original layout textfields. found textfieldskin properties here , jungle, , can't find color of -fx-control-inner-background, -fx-text-box-border , -fx-focus-color, want know. i've tried textfield.getstyleclass().remove("textfieldstyle"); , think remove new css, doesn't apply old 1 again. to reset element's default styling after setting using .setstyle("css settings....."); can use - textfield.setstyle(null); i'm not sure if work on it's own element that's had class applied using .getstyleclass().add("textfieldstyle"); if not - textfield.getstyleclass().clear(); textfield.setstyle(null);

javascript - Not all rows are rendered in ng-grid -

in project i'm fetching data server, , receive 20 data-items. however, 6 rows rendered, , inside ng-repeat there 6 of them. height of canvas calculated correctly other items appears after resize of window. issue similar to: https://github.com/angular-ui/ng-grid/issues/860 using virtualizationthreshold doesn't work me , there no other way around here part of controllers code: app.controller('nagruzkacontroller', ['$scope', 'nagruzkaservice', 'cacher', 'rawinforetriever', '$timeout', function ($scope, nagruzkaservice, cacher, rawinforetriever, $timeout) { $scope.configrequest = {}; $scope.showloader = false; $scope.showtable = false; $scope.fetch = function () { $scope.showloader = true; nagruzkaservice.getall().then(function (data) { var tmp = rawinforetriever(data); $scope.nagruzkadata = tmp; cacher.nagruzka = $scope.nagruzkadata;

android - Design Library TabLayout, tab indicator bouncing after scroll -

edit latest design libraries fixed issue compile 'com.android.support:design:+' i working tablayout in 2 instances, pageradapter , fragmentstatepageradapter. in both cases tab indicator bounces, when swiped between pages. tab indicator doesn't bounce when clicking tab's change pages. i not sure if error on part, known issue, or part of guidelines. if need more code, or other example post it. fragmentstatepageradapter mviewpager.setadapter(new fragmentstatepageradapter(getsupportfragmentmanager()) { @override public fragment getitem(int position) { logmeal log = mlogmealadapter.getitem(position); return mealviewfragment.newinstance(log.getid()); } @override public charsequence getpagetitle(int position) { // tab text logmeal logmeal1 = mlogmealadapter.getitem(position); string s; if (logmeal1.getmealname().tostring().trim().length() > 12) {

javascript - Nested Loop in Ruby, Hash and Array -

how can in ruby var pcodeprice = { 'gr1': 3.11, 'sr1': 5, 'cf1': 11.23 }; var basket = ['gr1', 'sr1', 'gr1', 'gr1', 'cf1']; var total = []; (i = 0, x = basket.length; < x; i++) { (var prop in pcodeprice) { if (basket[i] == prop) { total.push(pcodeprice[prop]) } } } this loops through array , checks see if item matches key of hash in inner loop, if pushes value new array. i cant in ruby, thanks it's pretty simple in ruby using map. pcodeprice = { 'gr1' => 3.11, 'sr1' => 5, 'cf1' => 11.23 } => {"gr1"=>3.11, "sr1"=>5, "cf1"=>11.23} basket = ['gr1','sr1','gr1','gr1','cf1'] => ["gr1", "sr1", "gr1", "gr1", "cf1"] total = basket.map { |code| pcodeprice[code] } => [3.11, 5,

logging - Delete logs after consumption: logstash -

i have logstash watching directory on host. every time sees log matches path specified in logstash config starts import data elasticsearch cluster. logstash have way delete log after done consuming it? i want write script delete logs logstash done how should know logs done ? maybe u guys done before or have idea how implement this? logstash not able delete files. focus of file input plugin continuously monitor files there's no way of knowing when file done, i.e. when no more writes take place. if know when files "done" invoke logstash , feed files via stdin input plugin . logstash terminate upon receiving end-of-file , script delete file. you read sincedb files , compare logstash's current file offset size of corresponding file. see understanding sincedb files logstash file input details on format of sincedb files. or make sure have enough disk space , use regular log rotation delete files based on e.g. age. disk space cheaper time.

Minus query in HIVE -

minus query seems not work in hive. tried ex: select x abc minus select x bcd ; am doing wrong or minus query isn't defined hive? if so, there other way result this? it not appear hql supports minus operator. see relevant, albeit bit old, resource: http://www.quora.com/apache-hive/what-are-the-biggest-feature-gaps-between-hiveql-and-sql what want can done left join or not exists : select x abc left join bcd on abc.x = bcd.x bcd.x null edit: per comments below, not exists not supported. select x abc not exists (select x bcd)

javascript - Clone a SVG path and put it in an other SVG -

i'm real noob in svg manipulation. need copy svg path , paste in other svg. other svg have different position , different size. problem when copy svg path keeps position , don't stay in new svg viewport. in order copy svg use : $('.svg_thumb svg').append($('#head').clone() ); you can play example : http://jsfiddle.net/uk4c2jqr/ following example : head in center of read square example 1. you may use transform=translate(x,y) method : var tb_head = $('#head').clone(); tb_head.attr('transform', 'translate(-325, -85)'); $('.svg_thumb svg').append(tb_head); fiddle edit op's request : in order calculate x , y values, best way refactor path starts position 0,0. but can find approximation using getboundingclientrect() method : var originalpath = $('#head'), thumb_head = originalpath.clone(), thumb_svg = $('.svg_thumb svg'), bbox = originalpath[0].getboundingclientrect(), xpos = thum

apache - Redirecting a domain with htaccess with a few specific 301s -

is possible redirect old traffic new site 301. rewriteengine on rewritebase / rewritecond %{http_host} !new-example.com$ [nc] rewriterule ^(.*)$ http://new-example.com/$1 [l,r=301] however, need manually map pages new equivalent pages redirect 301 /about http://new-example.com/about-us is possible both? if going use rewrite , use only. don't recommend use both mod-alias , mod-rewrite . can use rewrite map individual pages too. order matters. catchall rule should last one. provide cleaner code imo. rewriteengine on rewritebase / rewritecond %{http_host} !^new-example.com$ [nc] rewriterule ^about/?$ http://new-example.com/about-us [r=301,l] rewritecond %{http_host} !new-example.com$ [nc] rewriterule ^(.*)$ http://new-example.com/$1 [l,r=301]

c# - Dealing with large chunks of data via REST (JSON) API -

i writing wrapper around api takes in couple of inputs , supplies nested json data. before showing on ui, have order data property "price" decimal (from high low). i trying understand what performant way of dealing ordering. ui consumes same json object comes api. so if order data high "price" low a. convert api output strongly-typed list of "item" objects, b. perform ordering on "price" property c. convert list of "items" json ui can use it. this seems overkill retain in-memory representation of json perform ordering. if have large set of data, how stop running out of memory. again ties answer/solution used in question 1. how approach thanks

Use Java Regex to parse xml file -

for reason cannot use sax , dom parsers , need parse regex. i want extract values in key-value pairs(key being content in tag1, value being content in tag 3) . of keys don't have key values in between, have ignore keys. xml file <main tag><element><tag1>key1</tag1><tag2>not intrested</tag2><tag3>value1</tag3></element><element><tag1>key2</tag1><tag2>not intrested</tag2></element><element><tag1>key3</tag1><tag2>not intrested</tag2><tag3>value3</tag3></element></main tag> the above xml file indentation: <main tag> <element> <tag1>key1</tag1> <tag2>not intrested</tag2> <tag3>value1</tag3> </element> <element> <tag1>key2</tag1> <tag2>not intrested</tag2> </element> <element>

javascript - How to use Regular Expressions with a Form using Angular (no jQuery) -

i have simple input field. want make sure rules met before submission the password must: 0. have @ least 8 characters 1. have no more 8 characters 2. have both upper , lower case characters 3. have @ least 1 letters 4. have @ least 1 digits 5. have 1 of @ # $ 6. contain characters available on standard english (us) keyboard. list of valid characters 7. not old password my html form <form name="login" action="index_submit" method="get" accept-charset="utf-8"> <ul> <li><label for="username">email</label> <input type="email" name="username" placeholder="username@example.com" required></li> <li><label for="password">current password</label> <input type="password" name="current_password" placeholder="current password" required></li> <li><l

php - Use of undefined constant CURLOPT_PROTOCOLS error when using Laravel and S3 -

i'm having snag storage facade in laravel 5.1 when using s3. i have following code in controller: $file = $request->file('file'); $extension = $file->getclientoriginalextension(); $filename = date('d-m-y').'_'.$request->get('author').'.'.$extension; storage::put($filename, $file); however following error: s3exception in wrappedhttphandler.php line 162: error executing "headobject" on "https://s3-eu-west-1.amazonaws.com/[redacted]/10-06-2015_my%20file.jpg"; aws http error: use of undefined constant curlopt_protocols - assumed 'curlopt_protocols' i have curl installed along php5-curl on ubuntu 14.04. i'm using hhvm 3.7. didn't notice using hhvm. it's not supported. see https://github.com/facebook/hhvm/issues/3737 https://github.com/fruux/sabre-http/pull/14

jquery - Error when trying to edit to check for class name duplicates -

i have following script working , needed add check no duplicate span classes appended. original script below $.ajax({ type: "get", url: location.protocol + '//' + window.location.hostname + '/%year%/export?type=league&l=%leagueid%&w=&json=1' }).done(function (data) { requiredstarters = data.league.starters.count; $.get('http://%host%/%year%/options?l=%leagueid%&o=06', function (data) { $(data).find('td.two_column_layout .report').each(function (index, element) { if ($(this).find("td.player").length !== +requiredstarters && $(this).attr("id") !== "invalidlineup") { var target = $("#invalidlineup").find("tbody"); $(this).find("span a").each(function () { target.append("<tr class='oddtablerow'><td>" + $(this)[0].outerhtml +

java - Despite a condition for no equality the string is being added to the ArrayList -

Image
i splitting direclist 2 sublists firstdirec , secondtdirec when speciefic string new direction found. then filtering particular strings out of lists not adding them new arraylist s timelistfirst , timelistsecond . works fine firstdirec , , elements not being added timelistfirst , facing problem secondtdirec list @ postion: if (!(mergeline.equals(otherdirection)) since here @ position mergeline equal to "ravensbusch" , otherdirection . despite fact string being added timelistsecond . can explain me mistake? mergeline value: otherdirection value: (string keyline : direclist) { if (keyline.startswith("new direction")) { int index = direclist.indexof(keyline); // direcarray.remove(index); list<string> firstdirec = direclist.sublist(0, index); list<string> secondtdirec = direclist.sublist(index, direclist.size() - 1); // pa

php - error for displayed even it has not been submitted yet -

i load page yet error has been displayed <?php $nameerr = $emailerr = $iderr = $passworderr = ""; $name = $email = $id = $password = ""; if ($_server["request_method"] == "post") { if (empty($_post["name"])) { $nameerr = "name required"; } else { $name = test_input($_post["name"]); // check if name contains letters , whitespace if (!preg_match("/^[a-za-z ]*$/",$name)) { $nameerr = "only letters , white space allowed"; } } if (empty($_post["email"])) { $emailerr = "email required"; } else { $email = test_input($_post["email"]); // check if e-mail address well-formed if (!filter_var($email, filter_validate_email)) { $emailerr = "invalid email format"; } } if (empty($_post["id"])) { $gendererr = "matric

css - Display Mobile Compatible when it's on mobile -

please allow me ask silly question google's site(google.com). have tested site computer browsers , smartphone browsers. okay! here question have, when time make computer browser small screen, layout of google's site not fit in mobile friendly layout. but, become mobile friendly layout when it's on mobile screen. but, url still same http://www.google.com . i have tried other site, other site using 301 redirect when mobile screen detected , url transferring mobile url. curios how can google this(change mobile friendly web layout on mobile screen keep same url). keep thinking question until can't sleep well. there here know trick google use? this using media queries: @media screen , (min-device-width: 320px) , (max-device-width: 480px) , (-webkit-min-device-pixel-ratio: 2) { } check link more details is css style when website on mobile, example want div not shown on mobile device can this: @media screen , (max-width: 480px) { .yo

php - how to use MySQL like for searching exact a value -

i have string stored table 'tbl_route' column named 'route_nos'. the string looks 3,4,7,8,9,10,11,14,16,20 i searching 2 number whole string using mysql operator. $nospos="1"; $qr=mysql_query("select * tbl_route routes_nos '% $nospos %'"); but when query executes returns rows. there no 1 present in string. found takes partial match of no present in 11 or 14 or 16. need exact search.. how possible? use $qr=mysql_query("select * tbl_route find_in_set($nospos, routes_nos) "); refer doc here

css - Create columned text reStructuredText -

Image
i'm trying format restructuredtext section so: type1 : type4 : type7 : type2 : type5 : type8 : type3 : type6 : type9 : such can fill page horizontally text, know how can accomplish this? guess have css , container? this best alternative have, in place of playing css , container... i don't think there way natively you're trying in restructured text. but, if use sphinx , there directive called hlist (horizontal list): http://sphinx-doc.org/markup/para.html you write this: .. hlist:: :columns: 3 * list of * short items * should * displayed * horizontally and gets converted to: hope helps!

scala - type parameter mismatch with WeakTypeTag reflection + quasiquoting (I think!) -

inspired travisbrown , i'm trying use macro create "smart constructors". given package mypkg sealed trait hello[a] case class ohayo[a,b](a: (a,b)) extends hello[a] and val smartconstructors = freemacros.liftconstructors[hello] the macro should find subclasses of hello , @ constructors, , extract few elements populate tree "smart constructor": q""" def $methodname[..$typeparams](...$paramlists): $basetype = $companionsymbol[..$typeargs](...$arglists) """ i hoped get: val smartconstructors = new { def ohayo[a, b](a: (a, b)): hello[a] = ohayo[a, b](a) } but instead get: error: type mismatch; found : (a(in class ohayo), b(in class ohayo)) required: ((some other)a(in class ohayo), (some other)b(in class ohayo)) val liftedconstructors = freemacros.liftconstructors[hello] at glance, tree looks ok me: scala> q" new { ..$welltyped }" res1: u.tree = { final class $anon extends sca

osx - elinks reports `Bad HTTP response` in Mac OS -

i installed elinks via brew install elinks in macbook. when open http://www.gnu.org/software/make/manual/make.html in elinks , reports bad http response . tried same web address elinks in debian 8, works fine. what's wrong elinks in osx? this apparently bug in stable elinks version 0.11. install development version of elinks (0.12pre6 @ moment), works fine: brew install --devel elinks

windows - How to migrate registry entries with PowerShell with Get-Item : Set-Item and ExportTo-CliXml -

i trying export selective registry entries, preferences , configurations various software applications, , them import them on new machine. get-childitem registry::hkey_current_user\software\microsoft\office\14.0\onenote -recurse | export-clixml -depth 3 -path onenote.xml and reverse process on machine @ different time using import-clixml -path onenote.xml | set-item this doesn't seem work it's not obvious why. conceptually feels though should work. ideally next step able keys, filter them , store them in 1 file , restore them cleanly on machine. this can done regedit, i'm curious how done powershell. rather creating keys if don't exist , setting values import-clixml command creates values under default property names in keys correspond paths of key. example: on destination machine, target key such as: hkey_current_user\software\microsoft\office\14.0\onenote\opennotebooks will contain default item has value: "hkey_current_user\software\mi

html - Div ul list css menu -

how can have child div appear when hover on parent div? please view . fiddle apologies if code incorrect. thank you #submenu11 { width:550px; height:400px; float:none; padding-left:1px; padding-top:1px; margin-right; 10px; font: 15px/30px sans-serif; clear: left; margin-left: 181px; border: 1px solid blue; border-bottom: 5px solid blue; } #left1, #right1 { width: 35%; float:left; margin-top: -85px; } #left1 { margin-right: 1px; border: 1px solid green; box-sizing: inline-block; height: 100%; } #right1 { display: inline-block; box-sizing: border-box; width: 60%; height: 100%; border: 1px solid red; } #abc_11 { font: 15px/30px sans-serif; height: 300px; width:170px; display: inline-block; line-height:30px; background-color:white; float:left; padding-right:10px; border-right: 1px solid #0057a4; clear:left; } submenulist ul li { list-style-type: none; clear: left; margin-left: -40px ; } a.menu1 { font: 15px/30px sans-serif; height: 30px; width: 170px; display:

html - How to identify an element via XPath when IDs keep changing -

i using website, values of elements changing dynamically every time elements load. id's dynamic , xpath. don't seem have unique identifier locate elements. please advise on best way uniquely identify element every time page loads. here example of xpath when page loads first time: .//*[@id='isc_hy']/table/tbody/tr/td the same element when run follows: .//*[@id='isc_ip']/table/tbody/tr/td there several other elements on page looks above elements. for example, there element following xpath don't need: .//*[@id='isc_i2']/table/tbody/tr/td here html information same: <div id="isc_hy" style="position: relative; display: inline-block; box-sizing: border-box; width: 100%; vertical-align: top; visibility: inherit; z-index: 204195; cursor: pointer;" eventproxy="isc_obtabbarbuttonchild_9"> <table width="68px" height="38px" cellspacing="0" cellpadding="0">

pandas - Removing space in dataframe python -

i getting error in code because tried make dataframe calling element csv. have 2 columns call file: companyname , qualityissue. there 3 types of quality issues: equipment quality, user, , neither. run problems trying make dataframe df.equipment quality, doesn't work because there space there. want take equipment quality original file , replace space underscore. input: top calling customers, equipment quality, user, neither, customer 3, 2, 2, 0, customer 1, 0, 2, 1, customer 2, 0, 1, 0, customer 4, 0, 1, 0, here code: import numpy np import pandas pd import pandas.util.testing tm; tm.n = 3 # data. data = pd.dataframe.from_csv('mydata.csv') # group data calling companyname , qualityissue columns. byqualityissue = data.groupby(["companyname", "qualityissue"]).size() # make pand

swift - iOS Segue - Left to Right - -

Image
i've read other posts on segues none solve question. simply put, viewcontroller s ordered, book. want backward transitions (example: page 9 8) present (slide over) left right. want forward transitions (from page 9 10) present right left. yes, nav-controller button (top left) presents if paging through page page. however, if jump in index function on nav controller takes index. my objective if user jumps page 9 (for example) index, swipes right, it'll flick page off right , show page 8. once on page 8, if flick left page flicked off left , they'll on page 9 again. all viewcontroller s by, default, presenting sliding in right left. example: think of book, if use index hop chapter 4, swipe right , pop view stack, i'll @ index. if you're on chapter 4, page 394 , swipe right, don't want go index! want go last page of chapter 3, page 393! nav stack no me. end example details: 1. i'm using new xcode "show" on button-tap switch between vi

Not able to retrieve a single value from php array -

we have stored procedure in mssql returns 2 values: agent | tickets int | int we connecting database server , calling sp pdo this: <?php //declare hostname variable $hostname = 'servername'; try { $conn = new pdo("sqlsrv:server=$hostname;database=dbnamee"); $conn->setattribute(pdo::attr_errmode, pdo::errmode_exception); $agent = 249; $stmt = $conn->prepare("{call proc_getactiveticketsforagent (:agent)}"); $stmt->bindparam(":agent",$agent, pdo::param_str); $stmt->execute(); $results = array(); { $results []= $stmt->fetchall(); } while ($stmt->nextrowset()); echo '<pre>'; print_r($results);echo "\n"; // record sets echo '</pre>'; ?> this outputs full array (as test). what trying returning value of tickets (for example; 6, current number of tickets on agent 249), , can using: $results = $stmt->fetch(pdo::fetch_obj); print($results->tickets); when go our index

php - TwiML - Can I record an user AND gather keypad inputs in the same call? -

its pretty straight forward either record , transcribe user's call, or gather input user's keypad after prompting them recording. not clear me however, steps should take record users 'description' of problem (in case) , gather user input me route 'request' in same call, twiml can post data in 1 request. has encountered scenario, , can point me in right direction if have? thanks. i'm answering own question in case needs in future. in particular scenario, needed prompt user press key in order route "request" being placed. needed request include description, hence need record users voice. this not complicated sounded (i know now), need respond twiml action when gathering key presses, xml document handles voice recording. xml, in theory, use "digits" received twiml construct new action src in second xml (routing). the first xml gather user input: <?xml version="1.0" encoding="utf-8"?> <respo

mysql - Two separate joins on the same query -

i have query find duplicates in table: select sofferenze.id_soff, sofferenze.descrizione sofferenze inner join ( select descrizione sofferenze group descrizione having count( id ) >1 )dup on sofferenze.descrizione = dup.descrizione order descrizione asc it works charm , gives me duplicated rows. have query starting sofferenze.id_soff give me value in table: select cod_fisc anagrafiche join `rischiatura` on anagrafiche.id_ndg = rischiatura.id_ndg id_ogg = 'sf000000012' , id_ruolo = 'ru010000002' actually second query run each row returned first query replacing in line where id_ogg='sf000000012' value 'sf000000012' value sofferenze.id_soff returned first query. this code not efficient because runs several times second query. there option can merge 2 queries? why not combine sub-query? select cod_fisc anagrafiche join `rischiatura` on anagrafiche.id_ndg = rischiatura.id_ndg id_ogg in (select x.id_soff sofferenze x x.de

Sublists of a list in java -

there n buildings in one-dimensional landscape. each building has height given hi,i∈[1,n]. if join k adjacent buildings, form solid rectangle of area k×min(hi,hi+1,…,hi+k−1). given n buildings, find greatest such solid area formed consecutive buildings. input format first line contains n, number of buildings altogether. second line contains n space-separated integers, each representing height of building. output format 1 integer representing maximum area of rectangle formed. sample input 5 1 2 3 4 5 sample output 9 this code , tried cross check there problem , whenever access sublist , getting sorted automatically , positions aso getting changed in original list import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class solution { public static void main(string[] args) { scanner sc = new scanner(system.in); int n=sc.nextint(); list<integer> al= new arraylist<integer>(); f

javascript - How to `replaceWith` directive element with template in directive -

in directive, using 2 template. according index template switched. the problems after find index calling method element.html() replace updated template. but that's makes directive element wrapped that. don't want wrapped template. how this? here result getting: <program-name name="titre1" data-page="home" index="0" ng-repeat="appname in appnames" class="ng-scope ng-isolate-scope"><h2 class="que t0" ng-click="callme()">titre1arif</h2></program-name> this looking : <h2 class="que t0" ng-click="callme()">titre1arif</h2> any 1 me this? live demo here js : // code goes here "use strict"; angular.module('tcpapp', []) .controller('mainctrl', function($scope) { $scope.appnames=[{title:'titre1'}, {title:'titre2'}, {title:'titre3'}]; }) .directive(&

amazon web services - Error with Data Pipeline backup when I transfer my data from DynamoDb to S3 -

i have backup dynamodb table s3 when launch service receive error after 3 attempts: private.com.amazonaws.amazonserviceexception: user: arn:aws:sts::769870455028:assumed-role/datapipelinedefaultresourcerole/i-3678d99c not authorized perform: elasticmapreduce:modifyinstancegroups (service: amazonelasticmapreduce; status code: 400; error code: accessdeniedexception; request id: 9065ea77-0f95-11e5-8f35-39a70915a1ef) @ private.com.amazonaws.http.amazonhttpclient.handleerrorresponse(amazonhttpclient.java:1077) @ private.com.amazonaws.http.amazonhttpclient.executeonerequest(amazonhttpclient.java:725) @ private.com.amazonaws.http.amazonhttpclient.executehelper(amazonhttpclient.java:460) @ private.com.amazonaws.http.amazonhttpclient.execute(amazonhttpclient.java:295) @ private.com.amazonaws.services.elasticmapreduce.amazonelasticmapreduceclient.invoke(amazonelasticmapreduceclient.java:1391) @ private.com.amazonaws.services.elasticmapreduce.amazonelastic

dictionary - Scala map split input to int and string? -

normally if reading line of input stdin looks "100 200" can store them both ints line: val array(a, b) = readline.split(" ").map(_.toint); but if a integer , b string? you cannot store values of different types homogeneous container such array . if know cardinality, store them in separate variables. val input = "100 foo" val array(a, b) = input.split(" ") val p1 = scala.util.try(a.toint) val p2 = b i used scala.util.try because toint may fail , throw exception

python-pptx throwing error on loading (2003 converted) 2010 powerpoint document in windows 7 64x ? -

i'm using python-pptx version 0.5.7 - windows 7 64x. i'm not sure how procedure able find online didn't work. i'm not sure why zip file error since powerpoint document. as help. >>> pptx import presentation >>> f = open("randy-diehl-analysis.pptx") >>> prs = presentation(f) traceback (most recent call last): file "<stdin>", line 1, in <module> file "c:\python27\lib\site-packages\pptx\api.py", line 26, in __init__ self._package = package.open(pkg_file) file "c:\python27\lib\site-packages\pptx\package.py", line 44, in open return super(package, cls).open(pkg_file) file "c:\python27\lib\site-packages\pptx\opc\package.py", line 122, in open pkg_reader = packagereader.from_file(pkg_file) file "c:\python27\lib\site-packages\pptx\opc\pkgreader.py", line 32, in from_file phys_reader = physpkgreader(pkg_file) file "c:\python27\lib\site-p

r - mirt simdata Error in sample.int(length(x), size, replace, prob) : too few positive probabilities -

i'm trying use mirt package in r simulate responses multidimensional item response model, via simdata() function. in jstat article introducing package simulated data used illustrate confmirt() function, , code used produce simulated data presented in appendix b, as library(mirt) <- matrix(c(1.5, na, 0.5, na, 1, na, 1, 0.5, na, 1.5, na, 0.5, na, 1, na, 1), ncol = 2, byrow = true) d <- matrix(c(-1, na, na, -1.5, na, na, 1.5, na, na, 0, na, na, 3, 2, -0.5, 2.5, 1, -1, 2, 0, na, 1, na, na), ncol = 3, byrow = true) sigma <- diag(2) sigma[1, 2] <- sigma[2, 1] <- 0.4 simdata2 <- simdata(a, d, 2000, sigma) this doesn't work, because simdata() function has since been updated, , requires item type specified. however, when try amend code specifying item type dichotomous, simdata2 <- simdata(a, d, 2000, "dich", sigma) , function still not run me, , error noted in title error in sample.int(length(

regex - Convert spaces of all sizes to a standard space in PHP? -

was wondering if there clean way replace space character variants (half space, full-width space, chinese space, etc.) standard space? bonus points replacing multiple spaces in row (like 3 half-width or zero-width spaces or of each) single normal space. i'll go obvious regular expression. preg_replace('~\s+~u', ' ', 'your input here'); see http://php.net/manual/en/function.preg-replace.php

sql - MySQL some rows to columns -

Image
i have table in mysql this: trans time_in placard container sztp line time_out ===== ======= ======= ========= ==== ==== ======== in 10:15 254114 clhu12345 40dh mae 10:54 <in transaction out 10:15 254114 maeu45678 20dr sea 10:54 <out transaction (same placard) out 10:15 254114 ttnu98765 20dr chi 10:54 <out transaction (same placard) in 11:23 664524 fscu13479 40rh seb 11:55 <in transaction out 11:23 664524 ponu55588 40dr mab 11:55 <out transaction (same placard) in 13:01 542234 tlhu77665 40rh mol 13:23 <in transaction (no out) out 13:36 232212 mlhu22341 20dr cmd 13:49 <out transaction (no in) out 14:03 187852 amfu56041 20dr cmd 14:48 <out transaction (no in) out 14:03 187852 cclu44112 20dr chn 14:48 <out transaction, same placard (no in) this table of trucks enter our terminal drop container, , pick 1 40" or 2 20" gate out (3 transactions, 3 rows). trucker drops