Posts

Showing posts from August, 2013

ios - SecItemAdd not prompting for Touch ID -

i have odd problem secitemadd() seems vary between ios 8 , 9. ios 8, saving secure enclave prompt touch id authentication (unless have specified ksecusenoauthenticationui @yes). expect. however, on ios 9, never seem touch id authentication on secitemadd. i realize between 8 , 9 there change attributes, , ksecusenoauthenticationui deprecated in favour of ksecuseauthenticationui, regardless of whether omit ksecuseauthenticationui, or specify @yes, never prompted. what should secitemadd() do? here code snippet of attempting: cferrorref error = null; secaccesscontrolref sacobject; sacobject = secaccesscontrolcreatewithflags(kcfallocatordefault, ksecattraccessiblewhenpasscodesetthisdeviceonly, ksecaccesscontroluserpresence, &error); nsdictionary *attributes = @{ (__bridge id)ksecclass: (__bridge id)ksecclassgenericpassword, (__bridge id)ksecattrservice: @"zenbanx", (__bridge id)ksecattraccount: tokenkey,

Simple addition and displaying answer on another form - VB.NET -

i wish add figures entered textbox on 1 form , display answer on form. i.e. customersubmit form. here code have far. dim x, y integer x = cint(textbox14.text) y = cint(textbox10.text) customersubmit.textbox1 = x + y thanks in advance customersubmit.textbox1.text = x + y

jquery - Google Chart API callback function not getting called -

i trying render data using google chart api, strangely when load visualization api, callback function not called. have created fiddle @ http://jsfiddle.net/jagzviruz/zbmnh/ var donutchart = { data : [ ['sales', 20], ['returns', 12], ['pending', 80], ['processed',990] ], init : function(){ $.getscript('https://www.google.com/jsapi', this.loadpackages); }, loadpackages : function(){ console.log('loaded api.. loading packages'); var o = this; google.load("visualization", "1", {packages:["corechart"]}); google.setonloadcallback(o.renderdata); }, renderdata: function(){ //console.log('loaded packages.. showing charts'); alert('render data'); }}; donutchart.init(); i never alert. other console messages appear fine. use donutchar rather this reference function pointer: $.getscript('https://www.google.com/jsapi', donutchart.loa

ios - Xcode storyboard equivalent of Android LinearLayout with View.GONE -

basically, in android have linearlayout of 3 views on top of each other. if set view 1 'view.gone', view 2 becomes top view , view 3 still underneath it. or if set view 2 'view.gone', view 1 above view 3. cannot find answers on how in xcode ios app. know there uistackview ios 9+ only, don't want. how do this? in swift preferably. i solved problem pinning views other views , instead of trying change height of view using outlet of view created outlet of height constraint , set 0, shown in answer: https://stackoverflow.com/a/23655322/4838107

r - Single bar stacked chart in DC -

i trying populate single column stacked bar chart. sum of 1 value stacked on other i.e. sum of 'lb' experiments stacked on 'random' experiments. since need give dimension value chart have assumed dim variable 1 value both lb , random. i getting above described data using following code: d3.csv("file:///d:/optus/lars t&l/dashboard/html/dummy2.csv",function(error, experiments) { var ndx = crossfilter(experiments), rdim = ndx.dimension(function(d) {return d.dim;}); var lb = rdim.group().reducesum(function(d){return d.lbrandom=="lb"?d.contacted:0;}); var ran = rdim.group().reducesum(function(d){return d.lbrandom=="random"?d.contacted:0;}); although when trying plot data, browser displays the axis , no data plotted: code plotting: chart .width(768) .height(480) .x(d3.scale.ordinal()) .y(d3.scale.linear().domain([0,200000])) .brushon(false) .dimension(rdim) .group(lb) .stack(ran) .render(); });

voip - Path Translation issue in Asterisk PBX DialPlan -

asterisk pbx cannot translate path calling cell did. when call cell did number warning in pbx occuring no path translate sip/1005-000002cc sip/fornishantpbx-000002cb spawn extension (from_nishantpstn, 14692498805, 1) exited non-zero on 'sip/fornishantpbx-000002cb' following extensions.conf configuration dialplan: [from_nishantpstn] exten => _14692498805,1,dial(sip/1005,20) here calling cell number did number: 14692498805, @ time of translation in pbx, getting above mentioned warning & call cannot connected. i need suggestions dial plan make happen that message mean have codecs a,b,c in inbound , d,e,f on outbound , there no matching codec , no translator can transcode choosed codec(for example if choosed a+e no translator e ) usually such situation when allowed g729 or g732 codec , have no codec_g729.so (which require license,so payed module) you can solve set same allow= on both peers.

javascript - Load a particular JS file base on what URL its hosted -

i've mvc asp page following code: <script type="text/javascript" src="https://test_domain.com/test.js"> </script> @*<script type="text/javascript" src="https://live_domain.com/live.js"> </script>*@ essentially comment or uncomment script want use if site live or if on test. i'd love able dynamically how. 1 solution, perhaps, if read current url , figure out if live/test. updated answer (thanks whipdancer) in web.config have added url: <add key="bundlejs" value="https://test_domain.com/test.js" /> <!--<add key="bundlejs" value="https://live_domain.com/live.js" /> i web.config transformations next. better had before. the next step during session_start in global.asax.cs file set url application variable: application["bundlejs"] = system.configuration.configurationmanager.appsettings["bundlejs"]; after set able go contr

ios - How to make popoverview the image on click imagebutton -

i have created image view , assign imagebutton shown in below code.once click on image should popover not working .if try use uipopoverview not working.how create button popovercontroller. - (ibaction)showpopover:(uibutton *)sender { if(![popovercontroller ispopovervisible]){ mypopover = [[popviewcontroller alloc] initwithnibname:@"popviewcontroller" bundle:nil]; popovercontroller = [[[uipopovercontroller alloc] initwithcontentviewcontroller:mypopover] retain]; [popovercontroller setpopovercontentsize:cgsizemake(299.0f,111.0f)]; [popovercontroller presentpopoverfromrect:cgrectmake(10, 10, 200, 200) inview:self.view permittedarrowdirections:uipopoverarrowdirectionany animated:yes]; } else{ [popovercontroller dismisspopoveranimated:yes]; } } - (void)viewdidload { [super viewdidload]; imageview=[[uiimageview alloc] initwithframe:cgrectmake(10, 10,100, 100)]; imageview.image=[uiimage imagenamed:@"dosa.jpg"]; cgrect textviewframe

excel - Right to left offset formula with match -

Image
i'm looking return start , end dates of person availability based upon gantt chart of hours on project. i can @ minute return start of availability, formula looking left right , returning date of first "0" cell meets. i need formula right left , return date of cell of last "0" meets. formula is: =iferror(offset(b3,(row(b3)-2)*-1,match(0,c3:o3,0)),"") this formula return results you're after: {=index($c$2:$s4,1,max(if($c4:$s4>0,column($c4:$s4),0)))} enter array/cse formula (use ctrl+shift+enter complete formula - put curly brackets in). nb: return 00/01/1900 if last date greater 0. adding custom format result cells hide 00/01/1900: dd/mm/yyyy;;; i used reference answer: http://www.mrexcel.com/forum/excel-questions/234469-find-last-value-row-greater-than-zero.html

javascript - get file name from file upload using jquery and set filename to a text field -

i have filename of uploaded file , set textfield i have done follows <input type="file" name = "filename" id="upload"> <input type="text" name = "file" id="file"> //jquery $('#upload').change(function() { var filename = $('input[type=file]').val().split('\\').pop(); var lastindex = filename.lastindexof("\\"); $('#file').val(filename); }); and tried this $('#upload').change(function() { var filename = $(this).val(); var lastindex = filename.lastindexof("\\"); if (lastindex >= 0) { filename = filename.substring(lastindex + 1); } $('#file').val(filename); }); but filename not displayed in textfield. you supposed using jquery inside document ready. might have forgotten add that. here working code. $(document).ready(function() { $('#upload').change(function(

parse.com - Parse iOS p12 certificate with a password -

i understand documentation/tutorial parse ios push notification says create p12 certificate without password, i'm dealing big enterprise client providing own p12 certificate , insisting can provide me 1 that's password protected. so there possible way use 1 password? i'm still trying push on client i'm checking every possible angle. don't want roll own server , parse , want use them thanks

Bash script reading input in loop -

i want read bash script e.g test.sh input1 id1 name1 input2 id2 name2 input3 id3 name3 i want read input loop , assign group of 3 parameters local variable , run different command e.g for var in "$@" input=$var id=$var+1 name=$var+2 rawfastq=${input} echo "input is" $input echo "id" $id echo "name is" $name rscript "$input"/script1.r id name done how go next command line parameter. $var+1 or adding counter , doing ${i+1} doesn't work? you've got iterate on elements of user's parameters, in other programming language. example: args=("$@") i=0 while [ $i -lt ${#args[@]} ]; input=${args[$i]} i=$[$i+1] id=${args[$i]} i=$[$i+1] name=${args[$i]} i=$[$i+1] rscript $input/script1.r $id $name done

ios - 2D array declaration in Objective-C++ error -

i'm developing ios application latest sdk. i want create int [][] in objective-c++ don't know how it: this piece of myclass.mm : static const int max_num_detections = 10; static const int patch_size = 100; @interface myclass () { int[max_num_detections][patch_size*patch_size] _results; } @end that line of code generate 2 errors: expected member name or ';' after declaration specifiers. expected ';' @ end of declaration list i error under _ character. how can declare , initialize 2d array? you need put [][] brackets after variable name: eg: int multiarr[3][4];

android - How to get the file has special symbols? -

when try file named 1233%1111.png,i file not found error.i know it's because special symbol %.how can solve problem? want upload image. now,i try use uri approach , create new file file.then upload new file. if creating 'file' variable, can try file.exists(), , handle accordingly. if want check file name, can filename (as string) , use contains("%"), example

python - Adding Column headers to pandas dataframe.. but NAN's all the data even though headers are same dimension -

i trying add column headers csv file have parsed dataframe withing pandas. dftrades = pd.read_csv('pnl1.txt',delim_whitespace=true,header=none,); dftrades = dftrades.drop(dftrades.columns[[3,4,6,8,10,11,13,15,17,18,25,27,29,32]], axis=1) # note: 0 indexed dftrades = dftrades.set_index([dftrades.index]); df = pd.dataframe(dftrades,columns=['tradedate', 'tradetime', 'cumpnl', 'dailycumpnl', 'realisedpnl', 'unrealisedpnl', 'ccyccy', 'ccyccypnldaily', 'position', 'candleopen', 'candlehigh',

sql server - Corrupt Azure SQL stored procedure could only be fixed by drop recreate -

Image
pardon me if duplicate. closest find random timeout running stored proc - drop recreate fixes i'm not answers there recompiling stored procedure apply. i have azure sql database, latest version, has lot of traffic azure web app front end. have nightly remote job runs batch rebuild indexes on azure sql database seems controlling database size , performance. normally, rebuilding of indexes takes 20 minutes. last night timed out after 2 hours. error handler in batch did not log errors. soon after rebuilding indexes started, 1 particular stored procedure starting timing out every client calling it. other stored procedures using same tables not having issues. when discovered problem, alleviate timeouts , suspended processes altering stored procedure return. when altered stored procedure again behave normally, issues reappeared immediately. understanding altering stored procedure forced recompile didn't fix it. ultimately, dropped , recreated procedure original

sql server - How to overcome ( SQL Like operator ) performance issues? -

i have users table contains 500,000 rows of users data the full name of user stored in 4 columns each have type nvarchar(50) i have computed column called userfullname that's equal combination of 4 columns i have stored procedure searching in users table name using like operatior below select * users userfullname n'%'+@fullname+'%' i have performance issue while executing sp .. take long time :( is there way overcome lack of performance of using operator ? not while still using operator in fashion. % @ start means search needs read every row , match. if need kind of search should using full text index.

python 2.7 - Helper scan fails over 90000 documents? -

because of limit of search in elasticsearch python module starter using scroll access more 10000 documents. didn't test if there limit scroll because working ok. couple of days ago got on 100000 documents result of query , implementation of scroll started failing with: searchcontextmissingexception [no search context found id [568] i thought code failing somehow although couldn't see problem. while googleing found helper scan , decided use since work of implementing scroll without worries code having bug. when using scan large amount of data ( around 90000) keep getting previous error. has seen same behaviour before? expected? there workaround can use avoid problem without splitting query? best regards, ruben is not clear if set size of scroll 900000 or bigger or if looping on more documents keep calling scroll. happen handling data takes time before return scroll. context kept default amount of time can configure using scroll parameter described in fol

payflowpro - PayPal Manager Account Suspended. How to unlock -

i have paypal manager account using payflow payment in web application. last day while trying access account different system, not usual ip address, paypal prompt me security question, have tried wrong credentials, account has been suspended. got mail paypal same. "unsuccessful attempt login paypal manager unknown ip address". got security questions answer, can't able reset password. can 1 me out unlock paypal manager account ? or reset password? if account locked, password reset not work can try going manager.paypal.com; select: forgot password? link , try there. if not work contact payflow support , they'll unlock account, reset , give information. payflow-support@paypal.com <-- they're pretty quick.

apache - Wamp is not working after Windows 10 upgrade -

wampserver worked fine on computer running windows 8.1. i've upgraded windows 10, , wamp not working. wamp icon red. i've looked internet information services , found world wide web services folder unchecked. went services.msc , world wide web publishing service missing list. took off skype port80. i've tried changing port address in httpd.conf 8090 , 9080. tested port80 through wamp - apache interface , found out "your port 80 not used". i'm not @ using command prompt. don't know how ensure apache uses port 80. i'm asking if problem , how fix it. or @ least how wamp working again. thanks! if had wampserver installed before upgraded windows 10 solution simple. problem w10 upgrade not know apache , mysql (wampmysqld , wampapache) services, , therefore not re-register them. all have using wampmanager menus wampmanager -> mysql -> service -> install service wampmanager -> apache -> service -> install ser

java - Map an array to a complex type using Dozer -

i able map array complex type specified in 1 of answers in link . application contains more 500 classes , time consuming identify , map these 1 one. trying build generic method conversion. example , complex type array can achieved using following methods. looking ways reverse operation - public <t> t map(object srcobj, class<?> destclass, string mapid) { if (srcobj == null) { return null; } if (srcobj.getclass().isarray()) { return (t) maparraytoarray((object[]) srcobj, destclass); } return (t) dozerbeanmapper.map(srcobj, destclass, mapid); } private object maparraytoarray(object[] srcarray, class<?> destclass) { class<?> componenttype = destclass.getcomponenttype(); object resultarray = array.newinstance(componenttype, srcarray.length); (int = 0; < srcarray.length; i++) { object resultitem = this.map(srcarray[i], componenttype); array.set(resultarray, i, resultitem); } return

git - How to copy one branch with commit history to another new repo? -

i clone 1 branch git repo new git repo b. prefer include commits history. everything ok following http://gbayer.com/development/moving-files-from-one-git-repository-to-another-preserving-history/ . when try push remote, errors happened. remote: error: invalid comitter email: someone@hehe.com ... remote: valid email addresses: ... remote: error: hook declined update refs/heads/mybranch ssh://git@git.internal/myrepo.git ! [remote rejected] mybranch -> mybranch (hook declined) error: failed push refs 'ssh://git@git.internal/myrepo.git' i know past commits done person, not in list of valid email addresses more. how ignore kind of verification? there other way this? update asked our admin change remote settings. works. you should ignore hooks: git push --no-verify from git-push documentation : --[no-]verify toggle pre-push hook (see githooks[5]). default --verify, giving hook chance prevent push. --no-verify, hook bypassed completely. edit n

c# - Recover id in display list using combobox -

i need recover id of element selected in combobox in dev express , code of combobox: @html.devexpress().combobox( settings => { settings.name = "combobox4"; settings.width = 180; settings.selectedindex = 0; settings.properties.dropdownwidth = 550; settings.properties.dropdownstyle = dropdownstyle.dropdownlist; settings.callbackroutevalues = new { controller = "editors", action = "multicolumncomboboxpartial" }; settings.properties.callbackpagesize = 30; settings.properties.incrementalfilteringmode = incrementalfilteringmode.startswith; settings.properties.textformatstring = "{1}"; settings.properties.valuefield = "id"; settings.properties.valuetype = typeof(string); settings.properties.columns.add("id", "id", 130).setcolvisible(false); // settings.properties.columns.add("id", "id", 130).setcolvisibleindex(1); settings.properties.column

c# - Cannot find the DialogWorkItemDetails method when reflecting the Microsoft.TeamFoundation.VersionControl.Controls assembly -

i attempting utilize existing dialog within microsoft.teamfoundation.versioncontrol.controls assembly show details of tfs work item sent. utilizing reflection this, in similar manner found accessing dialogchangesetdetails method used here . however, after creating assembly, array object store method arguments, dialogchangesetdetails method cannot found using .createinstance method: var assembly = assembly.getassembly(typeof (workitempolicy)); var args = new object[] {this, workitem, false}; using ( var dialog = (form) assembly.createinstance( "microsoft.teamfoundation.versioncontrol.controls.dialogworkitemdetails", false, bindingflags.createinstance | bindingflags.nonpublic | bindingflags.instance, null, args, cultureinfo.currentculture, null)) { if (dialog == null) return;

c# - AX 2012 table Rename Conflicts -

i have question, have table certaing name, used web services, have rename table, personal purposes, , update info in web service, point new table name, , compiles fine. before making change, web service works charm, after change receive 200 response, without data (is list, , list empty). i give incremental cil, , works, not give problema implementing services, , update references in client side. how can solve this? renaming table partly broken in ax 2012 not relations table renamed. in former version (internal) references table , fields in aot stored using table id. sometimes stored string. big mistake! the best way find these errors best practices check on customization.

ssas - MDX Repeat Measure betwewn Start Date and End Date -

think following facttable: customer | startdate | enddate | feeperday | feedayduration | 01.01.2015 | 03.01.5015 | 10 | 3 is possible create calculated measure repeat "feeperday" until enddate reached. if create mdx expression (this pseudo mdx): select { feeperday } on 0, {[customer].[a]} *{ [date].[31.12.2014] : [date].[06.01.2015] } on 1, cube the result should following table: customer | date | valueperday | 31.12.2014 | null | 01.01.2015 | 10 | 02.01.2015 | 10 | 03.01.2015 | 10 | 04.01.2015 | null | 05.01.2015 | null | 06.01.2015 | null untested, can give shot. with member measures.valueperday iif( datediff( "d", exists([customer].[startdate].members, ([customer].currentmember, feeperday)).item(0), [date].currentmember ) <=0 , datediff( "d&qu

Install Wordpress as a subfolder inside Laravel -

i run laravel based website , need host wordpress blog on same domain http://example.com/blog by placing "blog" directory inside public directory of laravel project, infinite redirect loop error. how fix this? add line .htaccess file inside laravel "public" folder , should exclude /blog/ can have own settings inside blog folder. rewritecond $1 !^(blog)

c# - Excel VSTO workbook object returning empty -

excel vsto add-in puts button in ribbon. i have pinpointed issue lies, don't know why giving me error or how fix it. more interesting, works fine if stay in same instance of excel. can run add-in multiple times no issues. open new instance of excel , comexception. excel.workbook thisworkbook = globals.thisaddin.application.activeworkbook; //... //run code //run below function (my function) setthesecolumnheaders(thisworkbook.worksheets[1], somelist) //run more code globals.thisaddin.dispose(); //added line see if help, didn't change anything. this doesn't give me issues first time run add-in, second time, thisworkbook appears null object, calling worksheets[1] on causes error. not sure why happening - if open new instance of excel, , try running add-in, after running once, should create new objects, don't know why globals.thisaddin.application.activeworkbook returning empty com object. here steps involved issue: open new instance of excel click b

monads - Haskell: 'do [1,2,3]; ["hello"]' behavior clarification -

so i'm trying understand how haskell do notation works. understand used monads , expands (since it's syntactic sugar) anonymous functions connected either bind ( >>= ) or ( >> ) shown here https://en.wikibooks.org/wiki/haskell/syntactic_sugar#do_notation . however my question is why following command prelude> [1, 2, 3]; "hello" returns "hellohellohello" i know arrays monads (and strings arrays of chars) fail see how results in behavior above. do [1, 2, 3]; "hello" desugars to [1, 2, 3] >> "hello" which same [1, 2, 3] >>= (\_ -> "hello") which same as concatmap (\_ -> "hello") [1, 2, 3] which same as concat (map (\_ -> "hello") [1, 2, 3]) which same as concat [(\_ -> "hello") 1, (\_ -> "hello") 2, (\_ -> "hello") 3]) which same as concat ["hello","hello","hello&q

python - NetworkX: How to find the source and target nodes of a directed edge -

dito above.. couldn't find in networkx docs... in python igraph, can use: import igraph ig g = ig.graph(directed=true) g.add_vertices(2) g.add_edge(0,1) eid = g.get_eid(0,1) edge = g.es[eid] nodes = (edge.source, edge.target) print nodes the ordering of tuples significant. first element source , second target. in [1]: import networkx nx in [2]: g = nx.digraph() in [3]: g.add_edge(1,2) # 1->2 in [4]: g.add_edge(2,3) # 2->3 in [5]: list(g.edges()) out[5]: [(1, 2), (2, 3)] # 1->2 , 2->3 in [6]: g.add_edge(42,17) # 42->17 in [7]: list(g.edges()) out[7]: [(1, 2), (2, 3), (42, 17)] in [8]: e in g.edges(): ...: source,target = e ...: print source ...: 1 2 42

c# - MVC 5 Global Resource -

okay, new microsofts mvc architechture, , curious if there way can store data global application , doesn't reside in database. have partial view goal render out html feed. need resource global, can called controller or view. please help i think calling assembly resource file. here link msdn explains how create global or local resources files in project: https://msdn.microsoft.com/en-us/library/ms247246.aspx

c++ - What version of ffmpeg does libvlc use? -

i writing application on linux (debian) uses both libvlc , ffmpeg. both run fine separately, moment try compile both functionalities app, libvlc stops working (complains not finding codecs). i have been able isolate problem, libvlc runs fine until compile first line of ffmpeg code (av_register_all), @ point linker brings in own ffmpeg compiled lib, , moment that, stops playing file. have 2 conflicting ffmpeg libs on system, 1 libvlc using, , newer 1 built myself write ffmpeg code. my question is, how make libvlc work newer library? considering there functions deprecated in newer ffmpeg code, involve recompiling libvlc? libvlc code date newest ffmpeg library(new function signatures)? any appreciated!

get - web2py function not triggered on user request -

using web2py (version 2.8.2-stable+timestamp.2013.11.28.13.54.07), on 64-bit windows, have following problem there exe program started on user request (first txt file created p triggered). p = subprocess.popen(['woshi_engine.exe', scriptid], shell=true, stdout = subprocess.pipe, cwd=path_1) while exe file running creating txt file. the program stopped on user request deleting file program needs input. when exe started have other requests user can trigger. common request comes server (i used microsoft network monitor check that), function not triggered. tried using scheduler no success. same problem i stuck here problem thank help with of web2py google group solution is. i used scheduler. created scheduler.py file following code def runwoshiengine(scriptid, path): import os, sys import time import subprocess p = subprocess.popen(['woshi_engine.exe', scriptid], shell=true, stdout = subprocess.pipe, cwd=path) return dict(sta

python - Is there a built-in equivalent to C#'s Enumerable.Single()? -

in c#, if have enumerable , try call .single() on it, throw error if not have 1 element in it. is there similar built-in python this? if len(iterable) == 0 or len(iterable) > 1: raise error("...") return iterable[0] not built in method, there idiomatic way achieve same goal: (value,) = iterable raises valueerror if iterable doesn't contain 1 element. the single element stored in value example simplified to: (value,) = iterable return value the unpacking feature of assignment operator . if target list comma-separated list of targets: object must iterable same number of items there targets in target list, , items assigned, left right, corresponding targets.

java - find the max temperature of each month in a year using map reduce program -

my code seems correct me on cmd not giving correct output, please me find problem in code. runs output wrong: package test; import java.io.ioexception; import org.apache.hadoop.conf.configuration; import org.apache.hadoop.fs.path; import org.apache.hadoop.io.intwritable; import org.apache.hadoop.io.text; //import org.apache.hadoop.mapred.jobconf; import org.apache.hadoop.mapreduce.job; import org.apache.hadoop.mapreduce.mapper; import org.apache.hadoop.mapreduce.reducer; import org.apache.hadoop.mapreduce.lib.input.fileinputformat; import org.apache.hadoop.mapreduce.lib.output.fileoutputformat; public class temp { public static class mymapper extends mapper<object, text, intwritable,text> { public void map(object key, text value,context context) throws ioexception, interruptedexception{ int month=integer.parseint(value.tostring().substring(16, 18)); intwritable mon=new intwritable(month); string temp=value.tostring().subs

ios - how to unwind segue to the view controller that called it -

below great answer of how use apple's unwind segue. what unwind segues , how use them? my problem answer have explicitly tell storyboard view controller want exit (unwind) to. i'm trying exit (unwind) whichever view controller called it, using 1 button. let's have 3 view controllers: red, blue, , yellow. both red , blue have button on them go yellow view controller, yellow has 1 button, return. possible have yellow return button unwind whichever view controller called it? thanks @luk2302 able figure out. no need use unwind segue. luk2302! @ibaction func returnviewcontroller(sender: anyobject) { if((self.presentingviewcontroller) != nil){ self.dismissviewcontrolleranimated(true, completion: nil) } }

How to a serve static site on Azure with Git (Bitbucket)? -

i have mvc 6 app on azure , host static files had ftp server , manually put them on /site/wwwroot . bit cumbersome when doing daily changes. fix setup continuos deployment bitbucket on azure. created separate repo static site. notice repo added /site/repository . how serve static files there? tried changing virtual directory / --> site\wwwroot / --> site\repository got the specified cgi application encountered error , server terminated process it bit scary. reverting change , restarting server didn't work. had publish again visual studio somehow overwrite configuration. an mvc 6 application have wwwroot folder in root directory (as sibling controllers, views etc) if put static content in there, , ensure have app.usestaticfiles(); defined in startup.cs static content should deploy , run rest of content.

javascript - create a table with a global secondary index error -

i trying create table global secondary index using javascript sdk inside of nodejs: var messagestableparams = { tablename : "messages", keyschema: [ { attributename: "to", keytype: "hash"}, //partition key { attributename: "tm", keytype: "range" } //sort key ], attributedefinitions: [ { attributename: "to", attributetype: "n" }, { attributename: "tm", attributetype: "n" } ], provisionedthroughput: { readcapacityunits: 10, writecapacityunits: 10 }, globalsecondaryindexes: [ { indexname: 'fr_indx', keyschema: [ { attributename: "fr", keytype: "hash"}, //partition key { attributename: "tm", keytype: "range" } //sort key ], attributedefinitions: [ { attributename:

ios - How can i add a completion handler to this function? -

i have function calls it's self if conditions not met (which works fine) want add completionhandler it, i've tried different ways completion never returned of ways i've attempted. runsearch() func runsearch(){ search{ _ in if (parresults.count < 20 && self.searchcounter < 20){ self.runsearch()//run search again** } if (parresults.count >= 20 && self.searchcounter < 20){ self.searchcomplete = true } } } what i've tried runsearch() completionhandler call self.runsearch{ msg in print("all done") //not executed } runsearch() completionhandler func 1 func runsearch(completionhandler: (bool) -> ()) -> () { search{ _ in if (parresults.count < 20 && self.searchcounter < 20){ self.runsearch{ _ in } } if (parresults.count >= 20 && self.searchcounte

mysql - Binding table names to SQL query using JDBI -

i issuing simple mysql select query using jdbi. in if try bind table name, getting wrong sql syntax error. code snippet: @sqlquery("select * <table> rowid=:rowid") @singlevalueresult @mapper(contentrecordmapper.class) public abstract optional<document> getrecord(@define("table") string table, @bind("rowid") string rowid); if execute this, getting com.mysql.jdbc.exceptions.jdbc4.mysqlsyntaxerrorexception: have error in sql syntax; check manual corresponds mysql server version right syntax use near '<table> rowid='row1'' @ line 1 [statement:"select * <table> rowid=:rowid", located:"select * <table> rowid=:rowid", rewritten:"/* contentdao.getrecord */ select * <table> rowid=?", arguments:{ positional:{}, named:{rowid:'row1'}, finder:[]}] if hard code table name, getting proper results. kindly help. thanks you should annotate @usestringtemplate3stat

php - How may Sphider be modified to display an image in search results, without knowing the name of the image -

using code below sphider search engine, sphider display image in search results - if html page , jpg share same name (i.e) page14.html, , page14.jpg. 1) without knowing name of image, how code modified first of 2-3 jpg's displayed html page returned in search results ? <?php $url_path = "http://www.webpage.com/"; // url indexed pages. $url_ext = ".html"; // file ext. of indexed pages. $image_path = "../"; // path image folder. $image_ext = ".jpg"; // file extension of images. $image = str_replace("$url_path", "$image_path", $url); $image = str_replace("$url_ext", "$image_ext", $image); if (file_exists($image)) { // nothing } else { $image = $image_path . "ics" . $image_ext; } ?> <img src="<?php print $image ?>" align="left" style="margin-right:10px;" /> or, 2) how modify above

debugging - PHP debuging printing into command line -

i have php server, , want create function receive variable , print terminal/command line open @ same time. any idea how can done? linux based server or wamp, doesn't matter you can write variable file , "tail" file on terminal. function writelog($msg) { file_put_contents(file_path,$msg); } you can use error_log function instead of file_put_content. not sure whether error message or not. on terminal run tail -f file_path p.s. file_path absoulte path of file want write data.

haskell - Best Practices for Where clauses -

i wrote simple tic-tac-toe program in haskell. runs on command line, has 1 , 2 player mode, , implements minimax algorithm when play against it. i'm used writing proper code in oo languages, haskell new me. code works reasonably well, seems hard read (even me!). suggestions on how make code more...haskellian? import data.list import data.char import data.maybe import control.monad data square = | b | c | d | e | f | g | h | | x | o deriving (read, eq, ord) instance show square show = "a" show b = "b" show c = "c" show d = "d" show e = "e" show f = "f" show g = "g" show h = "h" show = "i" show x = "x" show o = "o" type row = [square] type board = [row] data player = px | po deriving (read, eq) instance show player show px = "player x" show po = "player o" data result = xwin | tie | owin deriving

BLAST: can't find reference file in db -

i trying run standalone ncbi-blast-2.2.29+ on machine (mac) error message when running blastx (or blastn) database: no alias or index file found nucleotide database [db/viral.1.1.genomic] in search path [~/users/kk/ncbi-blast-2.3.0+/virus::] the way run it: blastn -query input.fasta -out out.blast.txt -db db/viral.1.1.genomic my working directory ~/users/kk/ncbi-blast-2.3.0+/virus , there sub-directory db (~/users/kk/ncbi-blast-2.3.0+/virus/db) , db has viral.1.1.genomic.phr, viral.1.1.genomic.pin, viral.1.1.genomic.pnd, viral.1.1.genomic.pni, viral.1.1.genomic.pog, viral.1.1.genomic.psd, viral.1.1.genomic.psi, viral.1.1.genomic.psq, viral.1.1.genomic.fasta. , made these files using command line makeblastdb -in viral.1.1.genomic.fasta -out viral1.1.genomic -dbtype prot -parse_seqids i don't know why keep getting error message saying no alias or index file found. have read other similar questions posted others don't seem finding answer problem. , try other tblas

How do I pass back multiple select box selections to HTML form? -

i using perl (and dancer) html create form. on form have fields so: <input type="text" name="keywords" id="keywords" value="<% keywords | html %>"/> <select multiple="multiple" id="sentences" name="sentences" size="3"/> <% if list_of_sentences %> <% foreach sentence in list_of_sentences %> <option value=<% sentence %>/> <% end %> <% end %> </select> these are, of course, inside own divisions , there more code around, these essentials of i've got. these in main.tt interacted using myapp.pm , there parameters passed , forth (e.g. keywords , list_of_sentences here). code set 2 divs, 1 form , other purely show output. when form submitted output shows correctly, select field selections not retained. so therefore, want make chosen selection(s) 'multiple select' kept selected. as examp

perl - Get the value of a process executed in a child back to parent -

i'm looking solution allows me return values of process executed in child parent process. try have no idea hook return value: use proc::processtable; use posix qw(:signal_h :errno_h :sys_wait_h); $sig{chld} = \&reaper; $count (1..10) { # start few demo childs if (fork () == 0) { &startchild; exit 0; } } { print "working\n"; sleep 1; } while (chkchildprocess()); sub startchild { print "starting child $$\n"; system("date"); #==>need output of "date" parent sleep 2 + rand 7; print "end child $$\n"; } sub chkchildprocess { $p (@{new proc::processtable->table}){ if ($p->ppid == $$){ $curpid{$$}=$p->pid; return 1; } } return undef; } sub reaper { $pid; $pid = waitpid(-1, &wnohang); if ($pid == -1) { # no child waiting. ignore it. } elsif (wifexited($?)) { print "process $pid exited.\n"; } else { print "false alarm on $pid.\n"; } $sig{chld} =

clojure - Filter a collection by multiple attributes provided with a map -

i have collection want filter. filter done using map key attribute in collection item, , value collection items should match. example: (let [filters {:name "test" :type "new"} collection [{:name "testable" :type "old"} {:name "shoudwork" :type "new"} {:name "testable" :type "new"}]]) right now, have built filter function take single attribute , value. want expand able take filter hashmap . this current filter looks like: (filter #(re-find (re-pattern "test") (string/lower-case (% :name))) collection) in other words, want filter not take "test " hardcoded, should value filters let binding, , (% :name) not hardcoded :name , key filters let binding. create function returns filtering function single [key expected-value]: (defn regex-value [[k expected-rex]] (fn [c] (re-find (re-pattern expected-rex)

Using Meteor, how to handle computationally intensive tasks? -

this question has answer here: long computations on meteor 2 answers since meteor single threaded avoid pretty intensive function bogging down application. but, how go this? need function able access database , take parameter or 2 (an array). how this? you can use this.unblock() detailed here , or can create meteor app observes mongodb relevant changes , computations there.

Php operator that evaluates TRUE on a answer typo -

i busy building elo students in primary education. some questions in elo 'open', students should type answer in textbox. suppose there question correct answer "scanner". student makes typo , types "scaner". don't want mark answer incorrect. so wonder if there operator 'resembles' in php, same like in mariadb sql or double 'tilde' in math. i quite sure there workarounds 'problem', i'm eager learn. check out: http://php.net/manual/en/function.levenshtein.php the levenshtein algorithm great exact scenario. works typos or brain-fart moments typing "blew" instead of "blue", names, etc. levenshtein return number. number indicates "distance" between 2 words. i'd in scenario, make maximum distance small number, 2 or 3. way, if there 1 character correction necessary, it'll fine. however, if word "scanner", , input "skammer", not pass valid response.

Add minutes to a time (hh:mm) in excel vba -

i making production schedule, , add ex. 78 minutes time ex. 7:05 (am) in vba. how go doing this? have tried far, i'm getting error 13 type:mismatch dim tuntilpump integer dim tfpump long, tstartpump long tup = 78 tfp = time(0, tup, 0) tsp = time(7,05,0) + tfp i'm thinking has variable dimensions or format of times, have no idea i'm doing wrong. appreciated, , in advance! use dateadd function: trp = dateadd("n",78,"7:05:00") the "n" means minutes.

Facing Error with command multiplot from coefplot package in R -

is there facing same when running command multiplot r package coefplot ? even example: data(diamonds) model1 <- lm(price ~ carat + cut, data=diamonds) model2 <- lm(price ~ carat + cut + color, data=diamonds) model3 <- lm(price ~ carat + color, data=diamonds) multiplot(model1, model2, model3) i´m getting below error: error in get(x, envir = this, inherits = inh)(this, ...) : attempt apply non-function any hint? this answer bit tangential, have found more recent combination of broom , dotwhisker packages useful - broom end (converting models "tidy" data frames of coefficients) , dotwhisker front end (creating plots via thin ggplot2 layer) library(ggplot2) library(dotwhisker) library(broom) update : re-installed dotwhisker v 0.2.0.3, appears work: dwplot(list(model1,model2,model3)) you can dwplot(list(m1=model1,m2=model2,m3=model3)) if want pick different model names on fly. alternatively, finer control can construct full data f

objective c - How to access objects from different classes in Cocoa Programming -

i have nstextfield subclass (called "txtfield1" , used custom class text field in interface builder) , able access nscombobox object present in interface builder class. this code: txtfield1.h: #import <cocoa/cocoa.h> @interface txtfield1 : nstextfield @end txtfield.m: #import "txtfield1.h" @implementation txtfield1 -(void)mousedown:(nsevent *)theevent { here able write like: [combobox sethidden:yes]; } @end i able set access combobox sethidden property, in mousedown event. can please tell me how that? have tried different solutions found on internet didn't obtain @ all! appreciated. here lot of ways, , answers here, : update label through button different view xcode - update viewcontroller label text different view setting label text in class set label on view stored nsdate edit: -(void)mousedown:(nsevent *)theevent { here able write like: [combobox sethidden:yes]; /* use shared instance o

json - Typescript definitions from postgresql query result -

suppose have complex query returning hierarchical json. how generate typescript definitions of query result? like martin vseticka wrote, actual json you're getting help. here's semi-complex example had work with: http://i.stack.imgur.com/wypjt.png the strategy follow identify lowest level bits of tier , assemble them 1 one under parent until root. the ts interface describe (with few comments) this: module rl.ss.portal.rltoday.interfaces { // don't blame craziness. zoo mms asmx service unleashes when succeeds. /* data termstore t: [] of ds: string or object, --> description go if there one. blank string if no desciption, otherwise object -> td: object -> a11: string (the description; can see , edit description in ui) ls: object -> tl: object -> **note: array if ther