Posts

Showing posts from May, 2011

java - How to install JRE using AutoIt -

i'm trying configure jre installation using autoit: if $ijava64 = 1 $hdownloadjava64 = inetget("https://www.dropbox.com/s/s68heiccdoxhtii/java%20jre%20x64.exe?dl=1", @tempdir & "\java jre x64.exe", $inet_forcereload) runwait(@tempdir & "\java jre x64.exe -install") $smessage_stt = $smessage_stt & "java jre x64 -> done" & @crlf controlsettext("processing status", "", "static1", $smessage_stt) endif but doesn't work. tried /s , /q , it's not working! does work if on command line? if yes use following code: runwait(@comspec & ' /c "' & @tempdir & '\java jre x64.exe" -install') remeber use ' if need use " path, because yours has spaces. edit: correct parameter: runwait(@comspec & ' /c "' & @tempdir & '\java jre x64.exe" /s')

javascript - Add a public function to a jquery plugin, to be called from another script -

i'm using adobe accessible mega menu plugin , looking extend this, (basically add function can called script). i've looked extending jquery plugins, javascript closures , various other threads on subject and can see how works i can see bunch of public attributes , methods (ln 695 on) attempting call these merely returns jquery object? equally adding function , attempting call doesn't seem work? i've added function called testfunction fires alert , should (i think) called : $("nav:first").accessiblemegamenu("testfunction"); but no luck far.. does know how can add function above script, can called script? https://codepen.io/anon/pen/vjzkqe edit: solved - functions need accessed through prototype obj in : nav.accessiblemegamenu.accessiblemegamenu.prototype.customfunction(param); i have implemented approach on project using extend function jquery , prototype extend infinitescroll plugin can take approach , implement plu

bitbucket - Git Clone : Permission denied (publickey). fatal: Could not read from remote repository -

i'm using bitbucket , i'm trying clone repo : sudo git clone git@bitbucket.org:kassak/mbf.git i error : permission denied (publickey). fatal: not read remote repository. please make sure have correct access rights , repository exists. i search everywhere solution nothing good. i folowed instructions https://confluence.atlassian.com/bitbucket/set-up-ssh-for-git-728138079.html (to step), have error. i tried remove , reinstall git it's same. any ideas me ? ! for public key authentication system, concern host name, user name, key filename, etc., if run sudo, user name root , different run ssh-keygen create key pair. authentication failed.

c++ - QT SQL notification with payload -

i'm working on applciation add table view new row, inserted db's table. started basic class handle notifies , setted triggers: create or replace function notify_tableiwanttoobserve_update() returns trigger $$ declare begin perform pg_notify( cast('tableiwanttoobserve_update' text), (new.tableiwanttoobserve_id)::text); return new; end; $$ language plpgsql; create trigger trigger_notify_tableiwanttoobserve_update after update on tableiwanttoobserve each row execute procedure notify_tableiwanttoobserve_update(); so jsut send notfy id of updated row in payload. want - becous reloading whole table won't trick later. i checked documentaton of qsqldriver http://doc.qt.io/qt-5/qsqldriver.html#notification-1 with it, created "handler": // that's constructor mydb = new qsqldatabase(qsqldatabase::adddatabase("qpsql", "main")); //removed data here (just fro sake of post)

python - How can I find where files are used as links in html pages? -

i have static website versions of old pages still stored in root. want find these pages , if used in link somewhere in root's files. made list of files inside root using powershell's command ls -r -name , store on file 'filelist.txt' , have like: directory1 directory2 5s.htm 5s.html 5s_introduction.htm ... images\icons images\icons\linkedin.png images\icons\project-slider-arrow-left.png images\icons\project-slider-arrow-right.png i want these files used, thought use simple script in python (as don't know windows' powershell) takes line list , occurences in each html page inside root. extract file name tried regex on notepad++: [^\\^\n]+\.[a-z]{0,4} and seemed work...(^\n exclude lines represent directories) second step, tried adapt python lines found on stackoverflow: import re open('filelist.txt') f: l in f: m = re.match('([^\\^\n]+\.[a-z]{0,4})', l) if m: print(m.group(1)) but returns me strin

PHP CURL - how to get only first 100 characters response -

i created script content of web page script full content (~25.000 characters). script 4 sites 100.000 characters need first 100 characters every web page. how can tell curl fisrt 100 characters , no more ? think faster solution because have wait ~11 seconds. it's me. here script: $c = curl_init(); curl_setopt($c, curlopt_url, 'https://example.com/index.php?id='.$part.'&asmp3=1&part='.$i.'&t='.get_miliseconds()); curl_setopt($c, curlopt_useragent, "mozilla/5.0 (windows; u; windows nt 5.0; en-us; rv:1.7.12) gecko/20050915 firefox/1.0.7"); curl_setopt($c, curlopt_followlocation, true); curl_setopt($c, curlopt_ssl_verifypeer, false); curl_setopt($c, curlopt_cookiefile, 'cookies.txt'); curl_setopt($c, curlopt_cookiejar, 'cookies.txt'); curl_setopt($c, curlopt_returntransfer, true); $code = curl_exec($c); curl_close($c); what have add script first 100 characters response? thanks. edit: no, it's not duplicat

AngularJS - Add Select model option in Json string -

html <form ng-submit="exportvideoform()"> <input type="text" class="form-control" ng-model="exportvideo.exportname" required> <input type="text" class="form-control" ng-model="exportvideo.description" required> <select class="form-control" name="selectposition" id="selectposition" ng-options="position.name position in data.watermarkimgposition track position.id" ng-model="data.selectedposition" ng-change="changeposition(data.selectedposition)" required> <option ng-show="false" value="">please select</option> </select> </form> ctrl $scope.exportvideoform = function() { $scope.data.selectedposition.id = 'lowerleft'; $scope.exportvideo = $scope.exportvideo.push($scope.data.selectedposition.id); //p

matlab - Adjacency matrix from three-dimensional real world coordinates possible or nearest neighbour necessary? -

problem statement i have 3 dimensional coordinates point cloud , create adjacency matrix in order use: http://www.mathworks.com/matlabcentral/fileexchange/12850-dijkstra-s-shortest-path-algorithm problem definition my coordinates stored in bm(40000x3) (columns:1=x, 2=y, 3=z) . have seen questions in forum creating adjacency matrices two-dimensional coordinates, possible three-dimensions ? , yes me set-up algorithm? or necessary use nearest neighbours knnsearch find adjacency? points equally spaced (x=5,y=1,z=5).

php - Extend a propel model class -

as described thoroughly in the propel documentation , propel generates base class, e.g., base\foo extended individual class foo . same applies another table, e.g., base\bar , bar respectively. add necessary attributes/methods base classes can regenerated. using middle-class class foo extends myclass {} class myclass extends base\foo { //must created each foo, bar, buzz, //they must extend base/foo, base/bar, base/buzz respectively } what best way (in terms of propel) have single extendible class? should behaviours used?

botframework - Prompts from LUIS model in multi turn bot -

i have luis model required action parameters. when trying form query , required parameter not detected luis sets triggered false , asks relevant question prompt. i use prompt when developing multi turn dialog using bot framework. in basic multi turn example in botframework(v3) sdk when entity not detected prompts question using local prompts module. i have prompts in luis , wondering if there anyway use ? my intent correctly recognized query deliberately misses specifying entity. query when trying in luis correctly shows prompt in response not see args being passed callback upon intent detection have prompts.

c++ - cannot construct std::string from placeholder in Boost.Spirit -

i have started working on boost.spirit based simple parser parse c++-like file (the c++-ish part built-in template types; e.g. map<string, smart_ptr<int>> name_object_map; - built-in compiler, , user cannot declare template classes). nevertheless, grammar intended contain data structure declarations, , not expressions, except constant expressions used initialization of enumerator declarations; enum e { = 4 * 5 + 3 }; valid. not problem me, because couldn't parse e way want yet :) i have made following yesterday, after reading docs , examples, doesn't compile: #include <boost/spirit/include/phoenix.hpp> #include <boost/spirit/include/qi.hpp> #include <boost/spirit/include/qi_char_class.hpp> #include <cassert> #include <memory> #include <string> #include <utility> struct context {}; class foo { std::string name; const context *ctx; public: foo(const std::string &name, const context *ctx) : name(name), c

c - Minix keyboard Driver -

i'm trying change keyboard driver in minix, idea store in file characters used introduced in keyboard.i declare global file * fp , insert piece of code in /usr/src/drivers/tty/keyboard.c while (icount > 0) { scode = *itail++; /* take 1 key scan code */ if (itail == ibuf + kb_in_bytes) itail = ibuf; icount--; /* function keys being used debug dumps. */ if (func_key(scode)) continue; /* perform make/break processing. */ ch = make_break(scode); if (ch <= 0xff) { /* normal character. */ fp = fopen("log.txt","a+"); fprint(fp,"%c",ch); fclose(fp); buf[0] = ch; (void) in_process(tp, buf, 1); } else ... then run "make" in directory , reboot not work. mean, file not created. idea? this won't work. keyboard driver ins

php - Few issues in voting -

<?php include_once 'dbconnect.php'; include_once 'index_header.php'; $article_id = $_get['id']; $counter = 0; // select article db $sql = $con->query("select * posts post_id = '$article_id'"); if ($sql){ while($row = mysqli_fetch_assoc($sql)) { $select_title = $row['title']; $select_article = $row['article']; }} if(isset($_post['downvote'])){ $counter = $counter - 1; } if(isset($_post['upvote'])){ $counter = $counter + 1; if($counter<=1){ $insert_query = $con->query("insert votes(vote_count,post_id) values(1,'$article_id')"); } } $selet_votes = $con->query("select sum(vote_count) vote_count_sum votes post_id= '$article_id'"); if ($selet_votes){ $row_votes = mysqli_fetch_assoc($selet_votes); $votes = $r

Initialize data from json variable d3js (javascript) -

to create dynamic graphic, json variable rest server. found way initialize graphic variable, have apply function on each data inside before. here part of current code : d3.json("test.json", function(data) { var parse = d3.time.format("%y-%m-%d %h").parse; types = d3.nest() .key(function(d) { return d.type; }) .entries(stocks = data); types.foreach(function(s) { s.values.foreach(function(d) { d.jour = parse(d.jour); d.count = +d.count; }); s.maxcount = d3.max(s.values, function(d) { return d.count; }); s.sumcount = d3.sum(s.values, function(d) { return d.count; }); }); var g = svg.selectall("g") .data(types) .enter().append("g") .attr("class", "type"); settimeout(lines, duration); }); as can see , code use json file, it's tests. can't use method because data come rest server. have idea replace utilisation of json file variable containing json. here, exam

android - Change the color of a checked menu item in a navigation drawer in different menus -

this activity_main_drawer.xml <menu xmlns:android="http://schemas.android.com/apk/res/android"> <group android:checkablebehavior="single"> <item android:id="@+id/nav_hasiera" android:title="@string/nav_hasiera" /> <item android:id="@+id/nav_oharrak" android:title="@string/nav_oharrak" /> <item android:id="@+id/nav_instalazioak" android:title="@string/nav_instalazioak" /> <item android:id="@+id/nav_gustokoak" android:title="@string/nav_gustokoak" /> </group> <item android:title="@string/filtrar_por"> <menu> <item android:id="@+id/nav_lokalizazioa" android:title="@string/nav_lokalizazio" />

angularjs - Redirecting to previous page without reloading -

i have question suppose, have admin dashboard page, on have given list of users. clicking upon particular user details of corresponding user shown on different page (say on userdetails.jsp). have button on userdetails page, clicking of need redirect admin last visited page admin dashboard page, have 1 solution can "reload" previos page on clicking button, feel there overhead of calling server side api, retrieving data, again redraw whole admin dashboard page when there no change made in userdetails[because read page, modification not allowed there]. there anyway can make user of cache or else not need go server fetch data again. using spring mvc, angularjs, thank you. on button's click event add following code: $window.history.back(); make sure use $window rather window since you're using angularjs

orm - Doctrine: Related entities are not updated after changing id in EventSubscriber (onFlush) -

i use composite primary keys doctrine entities (multi-tenancy). example (yaml file): id: website: associationkey: true id: type: integer so have auto increment id manually. entities have id 1 default. example (eventsubscriber): class multitenanteventsubscriber implements eventsubscriber { public function getsubscribedevents() { return [ 'onflush' ]; } public function onflush(onflusheventargs $event) { $em = $event->getentitymanager(); $uow = $em->getunitofwork(); foreach ($uow->getscheduledentityinsertions() $entity) { if ($entity instanceof autoincrementinterface) { $maxid = $em ->createquerybuilder('e') ->select('max(e.id)') ->from(get_class($entity), 'e') ->getquery() ->getsinglescalarresult();

python - tensorflow efficient way for tensor multiplication -

i have 2 tensors in tensorflow, first tensor 3-d, , second 2d. , want multiply them this: x = tf.placeholder(tf.float32, shape=[sequence_length, batch_size, hidden_num]) w = tf.get_variable("w", [hidden_num, 50]) b = tf.get_variable("b", [50]) output_list = [] step_index in range(sequence_length): output = tf.matmul(x[step_index, :, :], w) + b output_list.append(output) output = tf.pack(outputs_list) i use loop multiply operation, think slow. best way make process simple/clean possible? you use batch_matmul . unfortunately doesn't seem batch_matmul supports broadcasting along batch dimension, have tile w matrix. use more memory, operations stay in tensorflow a = tf.ones((5, 2, 3)) b = tf.ones((3, 1)) b = tf.reshape(b, (1, 3, 1)) b = tf.tile(b, [5, 1, 1]) c = tf.batch_matmul(a, b) # use tf.matmul in tf 1.0 sess = tf.interactivesession() sess.run(tf.shape(c)) this gives array([5, 2, 1], dtype=int32)

java - Fallback methods at Zuul server in Spring cloud -

i new in spring cloud netflix , have questions concerning it. using api gateway hystrix running @ zuul edge server , make sure if understand following behavior correctly: i kill microservice running "behind" api gateway force hystrix open circuit. after (ca 10 seconds) send request non-running microservice , receive timeout error. when send many (tens) of requests in short time (up 1 sec), receive shortcircuit open error. surprised why receive timeout error although circuit open , therefore hystrix should come play avoid such kind of failures. guess reason if time since last request > circuitbreaker.sleepwindowinmilliseconds, api gateway tries connect microservice again check if it's alive, wasn't, -> timeout. explain, why got shortcircuit open error on many requests in short time. the next thing receive "timeout" or "shortcircuit" error got: hystrixruntimeexception: microservice (timed-out | short-circuited) , no fallback avail

c# - Check if list of objects single property value exists in Hashset -

i have list of objects in objects have guid id property. i have hashset containing bunch of guids. what fastest way check if each objects guid in list exists in hashset, , update property on object in list if exist? have ability change hashset different data type if needed, list must remain same. here's classes/enumerable public class test { public guid id {get; set;} public bool isresponded {get; set;} } var clientresponses = new hashset<guid>(); var testrecords = new list<test>(); this doing foreach (var test in testrecords) { if (clientresponses.contains(test.id)) test.isresponded = true; } you can so foreach (var test in testrecords) { if (clientresponses.remove(test.id)) test.isresponded = true; } or, more briefly foreach (var test in testrecords) { test.isresponded = clientresponses.remove(test.id); } every found value removed hashset, each next iteration faster. of course, it's w

html - How to format section of website when screen is SM with Bootstrap -

good morning, i have question how format part of website when @ different browser size. for example: top nav looks @ lg size. nav lg but when sm size, shows unformatted looks bad so: nav sm my question is, how target @ sm size , format when @ size? would use media query or class in boostrap? im not sure go here, appreciated! thanks! you can use media queries specify specific px/% sizes believe. bootstrap has built in rows columns have built in break points , sizes. col-lg-12 col-md-12 col-sm-12 etc. heres bootstrap link it: http://getbootstrap.com/css/

python - In Tensorflow, is there an op / are there ops to accept a tensor (of filenames) and output images? -

i'd able read in batches of images. however, these batches must constructed python script (they cannot placed file ahead of time various reasons). what's efficient way, in tensorflow following: (1) provided: python list of b variable-length strings point images, have same size. b batch size. (2) each string, load image corresponds to, , apply random crop of 5% (the crop random size of crop fixed) (3) concatenate images tensor of size b x h x w x 3 if not possible, have benchmarks / data on efficiency loss of loading , preprocessing images in python placing them queue? assume net run considerably faster if image loading / preprocessing done internally on tensorflow. this how understand problem: you have images you have function sample_batch() returns batch of filenames of size b you want read images corresponding these filenames , preprocess them finally output batch of these examples input = tf.placeholder(tf.string, name='input') queue = t

json - Java Application not working after Packaging into jar file -

i had java app working intellij idea not working after packaging jar file what possible causes ? , how can find mistake ? the app gradle project ( libgdx ) , packaged command line gradlew desktop:dist it give me this exception in thread "lwjgl application" com.badlogic.gdx.utils.gdxrun timeexception: error reading file: json\levels.json <absolute> @ com.badlogic.gdx.files.filehandle.read<filehandle.java:144> after packaging application jar file, json file part of jar? have change way of accessing file. can't access file through absolute file path, instead should use inputstream in = classloader.getsystemresourceasstream("path/to/file/in/jar")

php - How to cut off characters in JSON element -

i have following php code: $curl = curl_init(); curl_setopt_array($curl, array( curlopt_url => "some_url", curlopt_returntransfer => true, curlopt_verbose => true, curlopt_encoding => "", curlopt_maxredirs => 10, curlopt_timeout => 30, curlopt_http_version => curl_http_version_1_1, curlopt_customrequest => "get", curlopt_httpheader => array( "cache-control: no-cache", "postman-token: 32bee9e5-7618-3b97-0239-f9f0185c7396" ), )); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); $response = json_decode($response, true); $reversed = array_reverse($response); foreach($reversed $json){ echo '<p>' . '<strong>' . $json['date'] . ' ' . $json["display_name"] . '</strong>' . '</p>' . '</ br>' . '<p>' . $json["description"] . '</p>'; } if ($err) { e

regex - Remove first and last character from csv file using python -

i need transpose following file output1.csv, is result quantum chemistry calculation single colum efficiently: frequencies -- 18.8210 44.7624 46.9673 frequencies -- 66.6706 102.0432 112.4930 frequencies -- 124.4601 138.4393 180.1404 frequencies -- 230.0306 240.4389 258.2459 frequencies -- 282.7781 340.8302 357.7789 frequencies -- 378.9043 384.1284 401.4285 frequencies -- 418.0523 444.2264 447.6885 frequencies -- 473.2391 501.0937 518.9083 frequencies -- 559.5925 609.9256 623.7729 frequencies -- 657.4144 672.5480 728.2009 frequencies -- 740.5035 750.3238 757.2199 frequencies -- 774.6343 806.7750 815.9990 freque

how to look throuth android Attribute document -

<shape android:shape="rectangle"> <stroke android:width="1dp" android:color="@color/designer_cell_background" /> <solid android:color="@color/designer_cell_background" /> <corners android:radius="7dp" android:toprightradius="0dp" android:topleftradius="0dp"/> <padding android:bottom="1dp"/> </shape> just code,if want know attributes shape has , what's meaning separetly. how should do,is there document refer .thank in advance. the attributes can can define shape are: visible : determines if drawable visible. shape : rectangle, oval, line, ring innerradiusratio : valid if shape == 'ring'. inner radius of ring expressed ratio of ring's width. value ignored if innerradius defined. innerradius : valid if shape == 'ring'. inner radius of ring. when defined, innerradiusratio ignored. when

asp.net web api - Format of params structure expected by Rails 5 -

i'm working on api-only rails 5 app -- yes, know. haven't been around rails while, doing long overdue catching when bumped ol' nested hash of parameters, had forgotten about. want create user , thought i'd issue post request following parameters (let's make json simplicity): { "username": "myusername", "password": "mypassword" } however, after grieving , googling, discovered/remembered i'm supposed pass following: { "user": { "username": "myusername", "password": "mypassword" } } which in turn makes following def user_params params.request(:user).permit(:username, :password) end happy. all in all, i'm ok that. going private api mobile app, , don't expect open anyone. however, i've been perusing other (typically restful-ish-like) apis around web, , none of them have nested model business going on. i'll working on public api different proj

php - Add item in array with key? -

i have php code , tried many times no luck. case have 1 array declare in difference place , want merge in looping $data[] = ['sales' => 'mark']; for($i=0;$i<3;$i++){ data[$i]="some value".$i; } the result array ( [0] => array ( [sales] => mark ) [0] => value0 [1] => value1 [2] => value2 ) my expected array ( [0] => array ( [sales] => mark [0] => value0 [1] => value1 [2] => value2 ) ) i think looking for: $data['sales'] = 'mark'; for($i=0;$i<3;$i++){ $data[$i]="some value".$i; } $x[0] = $data; print_r($x); print_r($data); that outputs this: array ( [0] => array ( [sales] => mark [0] => value0 [1] => value1 [2] => value2 ) )

typescript - Cannot find name 'module'. when using commonjs -

i have following code... @component({ module: module.id, selector: 'hero', templateurl:'hero.component.html', styleurls: ['hero.component.css'], directives: [herodetailcomponent, md_card_directives, md_button_directives, md_list_directives, md_icon_directives, mdtoolbar, md_input_directives], providers: [heroservice], viewproviders: [mdiconregistry] }) export class herocomponent implements oninit{ ... } //tsconfig.js { "compileroptions": { "target": "es5", "module": "commonjs", "rootdir": "src/ng2", "moduleresolution": "node", "sourcemap": false, "inlinesources": true, "inlinesourcemap": true, "emitdecoratormetadata": true, "experimentaldecorators": true, "removecomments": false, "outdir": "public/ng2", "n

django - Find visible plugins with multiple templates and static placeholders -

is there way check if plugin visible (published) anywhere in page? have multiple pages different templates each. these templates have different static placeholders have different plugins. the problem plugins present on templates not activated , therefore don't want in query. is there method show plugins visible on published pages? same question: there method show plugins appear on activated templates? thank in advance. edit: want because trying fill search database i.e. index. there method on page model called is_published ; def is_published(self, language, force_reload=false): return self.get_title_obj(language, false, force_reload=force_reload).published and can find page given cmsplugin object attached through it's placeholder. so on filter of plugin do; draft_objects = myplugin.objects.filter(placeholder__page__publisher_is_draft=true) live_objects = myplugin.objects.filter(placeholder__page__publisher_is_draft=false) as further example

javascript - Auto unmount when removed from DOM -

consider following example: riot.mount('clock') settimeout(()=>{ console.log("removing dom") var el = document.getelementsbytagname("clock")[0]; el.parentnode.removechild(el); riot.update(); }, 5000) <script src="https://cdnjs.cloudflare.com/ajax/libs/riot/2.5.0/riot+compiler.min.js"> </script> <script type="riot/tag"> <clock> <p>{ time }</p> this.time = new date(); tick() { this.update({ time: new date() }) } var timer = setinterval(this.tick, 1000) this.on("unmount",() => { console.log("unmounted") clearinterval(timer) }); this.on("update",() => { console.log("on update"); }); this.tick(); </clock> </script> <clock></clock> where mount tag, remove using normal dom methods.

edit - Open .bat as txt from another .bat file -

how open .bat file text file in notepad batch script. what want open file b.bat in notepad using batch script a.bat i tried: start notepad tools_originalbuild\repository_test.bat doesn't work at moment, path relative, run batch file directory containing batch file (provided relative path given correct). running other directory result in error file not being found. you can eradicate problem, running relative batch file's location using following code inside batch file: notepad %~dp0\tools_originalbuild\repository_test.bat information on format can found here: what %~dp0 mean, , how work? this makes assumption that sub directory exists , file exists, of course. check existence first, if wish, that's question investigate on own :)

javascript - Telling Chrome to debug js rather than ts -

by default (and it's not option) when have ts file, chrome lets me debug ts code. i.e show me content of both ts , js files, when try put break-point in js file, transfers me ts file , locates break-point in right place. how can tell chrome debug js file rather ts one? since don't have control on ts compilation settings, can disable javascript source maps in chrome. load developer tools (chrome menu > more tools > developer tools), load developer tool settings (developer tools menu > settings), find setting "enable javascript source maps" , disable it.

c++ - QTime add seconds to new object -

i using qt5.51. why t1 invalid?: qtime t1 = qtime().addsecs(122); qdebug() << t1.isvalid() << t1.tostring("hh:mm:ss"); i expected "00:02:02" , false "". a newly default-constructed qtime object starts in invalid state. adding seconds invalid time leaves invalid - after all, it's invalid time point, not midnight seem expect. it's pretty nan-type behavior. http://doc.qt.io/qt-5/qtime.html#qtime constructs null time object. null time can qtime(0, 0, 0, 0) (i.e., midnight) object, except isnull() returns true , isvalid() returns false . http://doc.qt.io/qt-5/qtime.html#addsecs returns null time if time invalid.

ios - Center UIView in center of MainScreen Despite Location of Superview -

i have uiview can dragged around. in uiview have subview want centered on device screen both height , width. ever try centers superview. how can make subview @ center of uidevice mainscreen despite uiview is. i have (stripped down because 50000 lines long): popartwork = [uiimageview new]; popartwork.frame = cgrectmake(367, 367, widgetwidth, widgetwidth/5.3); popartwork.layer.cornerradius = 10; popartwork.layer.maskstobounds = yes; popartwork.alpha = 0; [popartwork setuserinteractionenabled:yes]; [add addsubview:popartwork]; add superview. program little unusual in way music widget user's home screen (jailbreak tweak) can move ever. want view popartwork in center of screen despite wherever add might be. i don't know if it's looking for, how center subview when superview re-positioned: - (void)viewdidload { [super viewdidload]; uipangesturerecognizer *pan = [[uipangesturerecognizer alloc] initwithtarget:self action:@s

ios - Share extension only with specific URL -

is there way filter share extension show when, example, url domain specific one? for example, want show app extension when user sharing google link: http://www.google.com/?somequery if i'm filtering urls, code below sufficient: subquery ( extensionitems, $extensionitem, subquery ( $extensionitem.attachments, $attachment, $attachment.registeredtypeidentifiers uti-conforms-to "public.url" ).@count == $extensionitem.attachments.@count ).@count == 1 in case predicate access $attachment 's registeredtypeidentifiers property , evaluate it. want able match regex against value inside $attachment , this: subquery ( extensionitems, $extensionitem, subquery ( $extensionitem.attachments, $attachment, $attachment.registeredtypeidentifiers uti-conforms-to "public.url" , $attachment.value matches "^http\:\/\/www\.google\.com\/" ).@count == $extensionitem.attac

r - Missing scale on ggplot 2 -

Image
i creating graph using ggplot2. here first output of graph before tidying done. and here code: graph <- ggplot(data = village.times, aes(x=village.times$a6ncopo, y=(village.times$a5species=="funestus"))) + geom_bar(stat="identity", position = "stack", fill="#ff4444") what don't know why there isn't scale on y axis , how remove true-false labels. there way can force ggplot include scale on y axis or have change way use data? maybe subsetting data frame before using ggplot , creating histogram? otherwise don't expected result should be... ggplot(subset(village.times, a5species=="funestus"), aes(x=a6ncopo)) + geom_bar()

c# - Using DataTable.Load() method is not working in case two resultsets returned by DataReader -

with motive of enhancing performance trying eliminate dataset use & implement datareader. here oracle procedure returning 2 refcursors & when loading first recordset in first datatable, next 1 never gets loaded. sample code looks : dataset ds = new dataset(); using (oracleconnection db = new oracleconnection(constring)) { try { using (oraclecommand mycom = new oraclecommand()) { mycom.commandtext = "mypkg.pr_mysp"; mycom.connection = db; mycom.commandtype = commandtype.storedprocedure; mycom.parameters.add("ref_list1", oracledbtype.refcursor).direction = parameterdirection.output; mycom.parameters.add("ref_list2", oracledbtype.refcursor).direction = parameterdirection.output; //mycom.fetchsize = mycom.fetchsize * 64; db.open();

python - Reading regular expressions from a XML file, store them into a list of list and afterwards use them -

i want read many regular expressions xml file, store them list of list , use them. solution not work , not know why. suppose have xml contains regex want store in list of list. xml this: <?xml version="1.0" encoding="iso-8859-1"?> <my_xml> <field> <regex>\d+\.\d+</regex> </field> <field> <regex>\d+</regex> </field> </my_xml> so, read line line xml file , build list of list containing regex: tree = et.parse("./my_file.xml") root = tree.getroot() listoflist = [] field in root.findall('field'): tmp = [] regex = str(field.find('regex').text) tmp.append(regex) listoflist.append(tmp) now, list of list contains regex ready. in fact, if print listoflist get: [['\\d+\\.\\d+'], ['\\d+']] now, it's time use list of list contains 2 regex. suppose have string contains ver=4.0 , want 4.0 . that, use

c - Why might a (makefile) build work serially but not in parallel, and would pattern matching cause such an issue? -

essentially, have large project ordinarily takes incredible amount of time build. reason, better use -j option , divide bunch of jobs, speeding process. seems when do this, build crash @ seemingly random times. if keep trying, build work. not experienced makefiles (i have worked them before, none large this), @ loss why fails. the thing can think of why happen makefile made out of pattern based rules. (if not using terminology correctly, mean rule looks this...) $(outdir)/%.o: $(exampledir)/%.c ... ... so result in problems -j option? on right track or wrong (if cause these types of problems)? thank in advanced reading this to clear, make not multithreaded. it's single-threaded, invokes multiple programs simultaneously parallel job support. the short answer is, no, there's nothing pattern rules problematic parallel builds. if build works serially fails when run in parallel, , particularly if works if keep running on , over, reason makefiles wr

plsql - output of dbms_xplan.display_awr() is coming blank -

i want see plan output of below query. explain plan select /*ajay*/ main_query.circle_name, main_query.operator_id, main_query.operator_name, (decode(main_query.billing_type,'1','energy','2','ipf','3','ipf-opex',main_query.billing_type)) billing_type, (decode( main_query.billing_cycle,1,'monthly',2,'monthly advance', 4,'quarterly advance',main_query.billing_cycle)) billing_cycle, (decode(main_query.billing_cycle,4,to_char(to_date(main_query.bill_month,'yyyymm'),'mon-yyyy')||'-'||to_char(add_months(to_date(main_query.bill_month,'yyyymm'),2),'mon-yyyy'),to_char(to_date(main_query.bill_month,'yyyymm'),'mon-yyyy')))bill_month, main_query.bill_cycle_no, main_query.external_invoice_id invoice_no, (case when 1= 0 '0' else decode(main_query.current_lev