Posts

Showing posts from May, 2010

api - PUT/POST request in SOAPUI giving 403 forbidden, while same request working fine in rest client Postman -

there no authentication on server side authentication should not issue. url format: put https://localhost/api/v1/protections?integrationkey=111&userkey=1111&group=111&category=foo payload: {"action":"block"} this working fine in postman. in soap ui , giving input under: endpoint: https://localhost resource: /api/v1/protections parameters:?integrationkey=111&userkey=1111&group=111&category=foo in media type, selecting "application/json" , entering {"action": "block"} getting "wed jan 20 16:25:27 pst 2016:debug:receiving response: http/1.1 403 forbidden " there suggestion output in soap ui. depending on server rest exposed service generates http 403, should verify server , find fastest response. try making request browser see if can answer correctly because problem lock machine server.

typescript - Asp.Net 5 how make .ts files compile on build instead of just save -

i'd .ts files generate on build , not on save. i'd happen without having create gulp task specify every file examples keep seeing. i'm using tsconfig.json files specify output should possible have build go through ts files, use tsconfig, , output them location. any appreciated. a moment it's impossible turn off auto-generation on save in vs. i'm working fallow typescript files: - editing files in atom editor (much better visual studio) - has watch() task configured generates files in background refresh browser , that's it.

Javascript/JQuery populate array many elements -

okay, i'm using tampermonkey/greasemonkey load , save data userscripts using gm_getvalue/setvalue at 1 point, had stored 7000 objects 1 of these arrays, , proceeded output via window.open , $(disp.document.body).text , subsequent .join call on array. allowed me copy 7000 objects strings normal .txt file in notepad. however, issue comes this: cleared original array of 7000 objects, want restore of these array; without having either manually array[0] = "foo" , array [1] = "bar" etc. i thinking maybe open new window, dump 7000 strings it, , somehow have button parse window? not sure how i'm wondering what's efficient/easiest way manually populate array outside source (notepad) javascript arrays. hopefully makes sense have tried using string.protype.split()? arr = textfromfile.split(/\n|\r/);

gae python27 - Unit Testing Inbound Mail Service on Google App Engine -

i have handler in application processing inbound emails. there way unit test functionality? don't see in documentation. if question testing handlers in general on gae can use webtest framework accomplish this. if question testing mail service can use mail service stub provided testbed .

Angular2 - how should I parse xml into json? -

i want import rss don't know how should parse xml json using angular2/typescript. have seen lot of ways using jquery need approve that's best way it. can give me propositions should use? thank you. i saw lot of people using google feed api retrieve json formatted rss feed. there's fiddle found google: http://jsfiddle.net/mahbub/b8wcz/ here's way call google api: $http.jsonp('//ajax.googleapis.com/ajax/services/feed/load?v=1.0&num=50&callback=json_callback&q=' + encodeuricomponent(url));

ios - The action of UIBarbuttonItem on UIToolBar not called -

i having trouble action of uibarbuttonitem on uitoolbar not called. in following code, although donebtn on toolbar tapped, action donebtnaction: not called. have idea fix it? - (void)viewdidload { uipickerview *pickerview = [[uipickerview alloc] init]; uitoolbar *toolbar = [[uitoolbar alloc] initwithframe:cgrectmake(0, -44, 320, 44)]; uibarbuttonitem *donebtn = [[uibarbuttonitem alloc] initwithtitle:@"done" style:uibarbuttonitemstyledone target:self action:@selector(donebtnaction:)]; uibarbuttonitem *flex = [[uibarbuttonitem alloc] initwithbarbuttonsystemitem:uibarbuttonsystemitemflexiblespace target:nil action:nil]; toolbar.items = @[flex, donebtn]; [pickerview addsubview:toolbar]; uitextfield *textfield = [[uitextfield alloc] init]; textfield.inputview = pickerview; } - (void)donebtnaction:(uibarbuttonitem *)sender { nslog(@"%@", sender); } don't add toolbar subview of picker view, negative y origin (n...

android - Alternative way for Fragment to Activity communication -

note, official way fragment activity communication, according http://developer.android.com/training/basics/fragments/communicating.html public class headlinesfragment extends listfragment { onheadlineselectedlistener mcallback; // container activity must implement interface public interface onheadlineselectedlistener { public void onarticleselected(int position); } @override public void onattach(activity activity) { super.onattach(activity); // makes sure container activity has implemented // callback interface. if not, throws exception try { mcallback = (onheadlineselectedlistener) activity; } catch (classcastexception e) { throw new classcastexception(activity.tostring() + " must implement onheadlineselectedlistener"); } } @override public void onlistitemclick(listview l, view v, int position, long id) { // send event ho...

php - cURL Unsupported SSL Protocol -

i have curl request fails when running through php 5.4.48 app. funny thing is, executes correctly when running directly through console, or through postman. the api i'm connecting expects tlsv1.2 connection, specifying in app. here's simple request in php app: $ch = curl_init(); curl_setopt($ch, curlopt_url, 'https://dev-dataconnect.givex.com:50104'); curl_setopt($ch, curlopt_returntransfer, true); curl_setopt($ch, curlopt_postfields,$payload); curl_setopt($ch, curlopt_post, 1 ); curl_setopt($ch, curlopt_httpheader, array('content-type: text/plain;charset=utf-8')); curl_setopt($ch, curlopt_sslversion, 6); // curl_setopt($ch, curlopt_sslversion, 'curl_sslversion_tlsv1_2'); // specifying value name of no curl_setopt($ch, curlopt_ssl_cipher_list, 'tls_rsa_with_aes_256_cbc_sha256'); curl_exec($ch); a raw curl request (note fires within console) curl 'https://dev-dataconnect.givex.com:50104/' -h 'accept-encoding: gzip, def...

javascript - Jquery - Selecting a item by ID not working -

i'm doing ionic (angular) app , have following simple code @ head of 1 of templates: <script> $(document).ready(function(){ alert($('#amountid').attr('id')); }); </script> </head> ... <label class="aquitext item item-input" id="amountid"> i used have tradicional javascript onclick("blablabla") , worked point decided shift jquery , i'm stuck had remove , simplify point. i've tried multiple permutations of this, including using angular's .element keep getting "undefined" on alert. doing wrong? (no don't errors on console) edit: seems might related fact have afterwards ionic slide-box, thought have little clue how circumvent it. now, removed slider boxes. seems have "fixed" it. the full structure is, after script (i trimmed of stuff out): </script> </head> <body> <ion-view> <ion-content> ...

Entity Framework map one to many with an intermediate table without a class for that table -

i have issue { //id, etc public list<cloudfile> files { get; set; } } and since cloudfile can used other classes, cleanest solution seems create intermediate table called issuefile . thing have no use such class in code... how map between issue , cloudfile without creating such intermediate class. or possible? know there similar questions ( one many mapping intermediate table ) create intermediate but, hopefully, unnecessary class. what want table-per-type (tpt) inheritance. cloudfile base class , derived types represent relationship owning entities ( issue , order , etc.): [table( "cloudfile" )] public class cloudfile { public int id { get; set; } } [table( "issuecloudfile" )] public class issuecloudfile : cloudfile { } public class issue { public int id { get; set; } public list<issuecloudfile> files { get; set; } } or via fluent api: modelbulider.entity<cloudfile>().totable( "cloudfile"...

ios - Center and bold part of a text in Swift -

i want center , bold title of paragraph. far can make title bold cant center it. here's code: let title = "title of paragraph" let attrs = [nsfontattributename : uifont.boldsystemfontofsize(15)] let boldstring = nsmutableattributedstring(string:title, attributes:attrs) let normaltext = "something here.............." let attributedstring = nsmutableattributedstring(string:normaltext) boldstring.appendattributedstring(attributedstring) label.attributedtext = boldstring i tried add attribue in attrs: let attrs = [nsfontattributename : uifont.boldsystemfontofsize(15), nstextalignment: nstextalignment.center] i'm not sure if that's correct way center it, still gives error "type of expression ambiguous without more context" i've searched error seems still can't fix problem i think problem nstextalignment key trying add on dictionary. it's type int becomes ambiguous previou...

android - Cannot change UI in runOnUiThread -

Image
i want change textview content result of calculation in thread, crashing when execution. here's code. new thread(new runnable() { public void run() { while (i < 5) { i++; } getactivity().runonuithread(new runnable() { public void run() { textview txv = (textview) getview().findviewbyid(r.id.txvone); log.d("123","i = "+ i); txv.settext(i);//crash!!! } }); } }).start(); you need pass string type settext() method. when pass integer type, performs lookup r ( see : r ) file string resource specified id. since id not match item in strings.xml file, exception thrown resourcenotfoundexception . like sree said, try code below, guaranteed work. txv.settext(string.valueof(i)));

python - make selenium driver wait until elements style attribute has changed -

as title suggests need wait dynamically loaded material. material shows when scrolling end of page each time. currently trying following: driver.execute_script("window.scrollto(0, document.body.scrollheight);") webdriverwait(driver, 5).until(expected_conditions.presence_of_element_located( (by.xpath, "//*[@id='inf-loader']/span[1][contains(@style, 'display: inline-block')]"))) is xpath problem here (not familiar)? keeps timing out though display style change when scrolling selenium. i wait display style change inline-block custom expected condition , use value_of_css_property() : from selenium.webdriver.support import expected_conditions ec class wait_for_display(object): def __init__(self, locator): self.locator = locator def __call__(self, driver): try: element = ec._find_element(driver, self.locator) return element.value_of_css_property("display") == "inlin...

c++ - Party Invitation -

the problem working on right here , of course not looking complete answer homework problem. asking steps in final parts of question. have far: int main() { cout << "please enter number of guests attending party: "; int k; cin >> k; cout << "please enter number of rounds of removal you'd perform: "; int m; cin >> m; (int = 1; <= m; i++) { cout << "please enter multiple @ you'd removal @ round " << << ": "; int r; cin >> r; if (k % r == 0) { k - r; } cout << k << endl; } system("pause"); } this confusing me, , have no idea turn answers. seems i'd need array solve this, arrays in c++ cannot variable, , array length k , variable input. appreciated. i've read question. need dynamic list linked list because need p...

php - json_encode / decode char troubles -

i'm having troubles json_encode/decode functions when store string mysql db table. problem in swedish chars, ÅÄÖ. if have like $my_arr = array('räksmörgås'); $json = json_encode($my_arr): print_r(json_decode($json)); it works fine, trouble is, said, when store jsonstring db , collects them. table (entire db) has encoding 'utf8_general_ci'. i've tried uft8_unicode_ci' well, same result, output ' ru00e4ksmu00f6rgu00e5s '. column store valus 'text'. what doing wrong? edit, forgot mention plugin wordpress , i'm using $wpdb->prepare() , $wpdb->query(). somewhere in code stripping slashes. // text: räksmörgås // json_encode(): r\u00e4ksm\u00f6rg\u00e5s // output: ru00e4ksmu00f6rgu00e5s

jquery - Radio Button toggle based on other radio button -

i needing setup 4 forms radio buttons competition, wanting set selections disable other options, if selected question 1 option disabled in 2,3 , 4. i have managed put together, knowledge limited longest possible way of doing , hoping know of simpler method before start building 2 forms it. i setup fiddle, http://jsfiddle.net/2kc6m/2/ html: <form id="answer1" class="radiooptions"> <div class="forminput"><input type="radio" value="a1" name="question1" /> a</div> <div class="forminput"><input type="radio" value="b1" name="question1" /> b</div> <div class="forminput"><input type="radio" value="c1" name="question1" /> c</div> <div class="forminput"><input type="radio" value="d1" name="question1" /> d</div>...

Is it possible to use Custom Issue Type as Epic in JIRA Agile -

we have set of issuetypes , following agile scrum. now, we're planning use jira agile. mentioned in jira documentation epic issue of type "epic". but, since we're considerably sized bu few projects - use "new feature" issue type epic - spec, dev , test can added "feature" epic. question is: possible use custom issue type epic in jira agile? if so, how? short answer no. the epic issue type (and few others) added base jira installation when install "jira agile" extension/plugin. none of features (epic links, epics filtering on backlogs, epic burndown charts, etc) work other issue type. i'd suggest begin adapting process use new issue type. now, there's nothing stopping associating custom fields (if that's use spec, dev, , test information) epic issue type same functionality have new feature.

java - How can I publish my restful webservice to internet? -

i don't have knowledge webservices. now developing server side code restful webservices. deployed server side application in glassfish 4 . my webservice doing work. checked giving below url in local machine. eg: http://localhost:8080/server/rest/v1/getdata it give expected result. but how can access webservice internet (i want access mobile or computer placed somewhere)? what steps have achieve this? you need internet connection static ip (if using dynamic ip change every reconnection) can access application outside using your-static-ip:8080 or buy droplet digital ocean or amazon or other hosting providers can host application configuring glassfish in it.

typo3 - Referential Integrity in List View -

i have made extension in typo3 v4.5 extension builder. have tables, don't have create/update function, because don't change (only once in month). change them, want use list view in typo3. that works, can create , update records. if have record, that's in relation other record, can delete it. other record has invalid value. for example: books _________________________ | name | authorid | ------------------------- |harry potter | 1 | ------------------------- author _________________________ | id | name | ------------------------- | 1 | rowling | ------------------------- now if delete rowling, have "invalid value" in authorid field. can prevent this? edit: okay, i've found way how prevent this: have use predb hook in tce extension. code (only experimenting) not work if delete record. thought i'll array element named 'deleted' value 1. not appear. other data (if alter information or make new record...

C# ListView Last Column Too Wide -

when list view's 'autoresizecolumns(...)' method called either 'none' or 'columncontent' parameters last column not expand fill entire panel, if 'autoresizecolumns(...)' called 'headersize' parameter last column expanded, looks odd if text centre or right aligned. i've been able fix issue adding blank column end expand , contract necessary, leaving intended last column cover width of heading seems bit hackie. neater way it? thanks. last column expanded preferred width the columnheader can set adjust @ run time column contents or heading. can setting width property -2 (to autosize width of column) or listview1.autoresizecolumns(columnheaderautoresizestyle.headersize)

php - password_verify() returning false -

i'm having seeming spontaneous problem. password_verify() function returning false. <?php $email = $_post['email']; $password = $_post['password']; $sql1 = "select `merchants_id`, `password`, `name` table_name `email` = :email;"; $binds = array( 'email' => $email ); $findvalue = mage::getsingleton('core/resource')->getconnection('core_read')->fetchall($sql1, $binds); $findvalue = $findvalue[0]; $verified = password_verify($password, $findvalue['password']); ?> as may able see, i'm using magento (fully patched 1.7) , methods execute query. if parse through password_get_info($findvalue['password']) picks password valid , outputs expected data (encryption type etc) $verified returns false the database field set, , has been set, varchar(255) . edit--- this code used create passwords: $hash = password_hash($value['password'], password_bcrypt); $updatesql = ...

ios - Detecting shake gesture by multiple view controllers -

i need detect shake gesture in ios. have done usual stuff , works fine. thing have multiple view controllers in uitabbarcontroller , wish each of them detect shake gesture. when shaking in of view controller , switched particular tab. problem if shake in 1 view controller , try shake in other controller gesture not detected unless action performed in controller. i know need set becomefirstresponder need know how can property set current tab of uitabbarcontroller shake gesture recognised tabs. write code detection (usually via notification observer shake) in base view controller , and controller subclass this. can write code move particular tab in base controller. problem solved.

javascript - Angular 2: how to pass attributes to child component? -

in application have home root component , generic component named list i'm rendering inside home. i want pass data property list component coming xmlhttprequest. home.ts import {component} 'angular2/core'; import {dashboardservice} '../../services/dashboard'; import {list} '../contact/list'; @component({ selector: 'home', template: ` <h3>home</h3> <list type="{{type}}"></list> ` providers: [dashboardservice], directives: [list], }) export class home { private _type: any; constructor(private _dashboardservice: dashboardservice) { this._dashboardservice.typetodisplay() .subscribe((type) => { this._type = type; }); } } list.ts @component({ selector: 'list', properties: ['type'], template: ` <h2>list</h3> `, providers: [dashboardservice] }) export class list { private type: any; constructor...

javascript - How to get value of selected item from dropdown in jquery UI tabs content -

i using jquery ui tabs , have text filed , dropdown select in tab's content, getting value text field not dropdown select item, can 1 please me, project in yii <html lang="en"> <head> <meta charset="utf-8"> <title>jquery ui tabs - vertical tabs functionality</title> <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css"> <script src="//code.jquery.com/jquery-1.10.2.js"></script> <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script> <link rel="stylesheet" href="/resources/demos/style.css"> <script> $(function() { $( "#tabs" ).tabs().addclass( "ui-tabs-vertical ui-helper-clearfix" ); $( "#tabs li" ).removeclass( "ui-corner-top" ).addclass( "ui-corner-left" ); }); </script> <style> .ui-tabs-v...

asp.net - Is it possible to have Kendo Context Menu (right click menu) on Kendo Treelist? -

i have kendo treelist , want add custom context menu on (right click menu) on it. things have tried: $(document).ready(function() { $("#menu").kendocontextmenu({ // listen right-clicks on treelist container target: "#treelist", // show when node text clicked filter: "tr", // handle item clicks }); }); yes, works. code right. see here

javascript - how to refresh page to fetch new values from service using angular? -

i having page having 1 table , 2 charts , how refresh charts , tables while pressing refresh button , table , 2 different charts coming 3 different controllers on single page . want refresh of them able new values webservice again , recreate page accordingly click or single refresh button . i have tried few ideas . $scope.refreshchart = function(){ alert("refresh"); // $scope.dashloader = true; $state.go('plm.creator'); // $scope.dashloader = false; console.log("on page refresh called; not dashboard page"); } but these not working per expectations , kindly help one thing can try use $scope.$broadcast(name, args) broadcast event (event name string make up) controller can listen , run code refresh. the controller listen $scop.$on(event, listener) so 1 controller this: $scope.$broadcast('myrefreshevent', args); and controller this: $scope.$on('myrefreshevent', function (args) { //handle refresh...

Exception Handling in ASP.NET MVC 4, 5 -

i using asp.net mvc 4 i want trace or handle exception globally. 1.which handled user code? 2.which not handled user code? both type how possible ? http://www.codeguru.com/csharp/.net/net_asp/mvc/handling-errors-in-asp.net-mvc-applications.htm shows different ways of handling errors globally. setting global exception handling filter usual. globalfilters.filters.add(new specialhandleerrorattributecreatedbyyou()); you derive new attribute handleerrorattribute , put logic in there, overriding onexception method. public override void onexception(exceptioncontext filtercontext) however not show exceptions handled other code. point, handled not continue bubble stack. have put code in each of catch blocks either want.

Simple regex not working in Javascript -

my regex next /^(\.\w*)|(\d*\.?\d*)$/ it should works float numbers ( 123.23 , 12. , .56 ) , words starts dot. confused when /^(\.\w*)|(\d*\.?\d*)$/.test("qweasdzxc"); // return true without or: /^(\.\w*)$/.test("qweasdzxc"); // return false /^(\d*\.?\d*)$/.test("qweasdzxc"); // return false on regexpal works well try this /^((\.\w*)|(\d*\.?\d*))$/.test("qweasdzxc"); // false /^((\.\w*)|(\d*\.?\d*))$/.test(".5"); // true you must encapsulate regex condition (a|b).

c# - Entity Framework - How to map a required property on one side with no navigation property on other side -

i have following 2 pocos ( product , user ) , complex type ( tracking ). class product() { guid id { get; protected set; } tracking trackinginfo { get; protected set; } // other properties } class user() { guid id { get; protected set; } // other properties } class tracking() { user createdby { get; protected set; } guid createdbyid { get; protected set; } // other properties } the tracking class wrapper tracking info , contains other tracking properties (date created, updated etc) , fulfils interface other purposes, concerned mapping relationships between product trackinginfo , user . every product must have associated user maps trackinginfo.createdby property. the catch don't want create navigation properties on user product - i.e. don't want have icollection<product> productscreated property. i'm not sure how relationship or complex type mapping should done in entityframework code first. have mapp...

excel - Error message if no data entered in text box -

please suggest vb code, if text box left blank,and during tab/enter, error message box appears each text box. private sub commandbutton1_click() sheets("attendance").select range("a1").select if isempty(activecell) = false activecell.offset(1, 0).select end if loop until isempty(activecell) = true activecell.value = me.d.value activecell.offset(0, 1).select activecell.value = me.n.value activecell.offset(0, 1).select activecell.value = me.salary.value activecell.offset(0, 1).select activecell.value = me.remarks.value activecell.offset(0, 1).select activecell.value = me.it.value activecell.offset(0, 1).select activecell.value = me.outtime.value activecell.offset(0, 1).select activecell.value = me.lunch.value activecell.offset(0, 3).select activecell.value = me.advance.value activecell.offset(0, 2).select activecell.value = me.paid.value end sub please see below sub , t...

php - file not found when using header() in php7 -

when update php5.6 php7.0.2 i`m getting error 'file not found'. in php5.6 works fine, php.ini , other server settings same. code: header('content-type: application/vnd.ms-excel'); header('content-disposition: attachment;filename="'.$this->name.'.xls"');// header('cache-control: max-age=0'); $objwriter->save('php://output'); while debug error appear after first , second line. server apache/2.4.18 (ubuntu).

Facebook login "given URL not allowed by application configuration" -

i've added facebook login site. however, when click button, red box says: invalid argument given url not allowed application configuration. if continue login get: api error code: 100 api error description: invalid parameter error message: next not owned application. not sure problem is. thoughts appreciated. your settings must incorrect. go http://www.facebook.com/developers/ , edit application you're working on. on "website" tab, "site url". should set website's url " http://yoursite.com/ " note if you're using subdomains, you'll need update "site domain" "yoursite.com"

php - I m trying to use repeater inside repeater field any body can help me -

i trying use repeater inside repeater field. please point me mistake? <?php if(get_field('help_blocks')): ?> <?php while(has_sub_field('help_blocks')): ?> <div class="col-sm-4"> <div class="block"> <h5><?php the_sub_field('block_title'); ?></h5> <?php the_sub_field('block_paragraph'); ?> <?php if(get_field('block_list')): ?> <ul class="list-style"> <?php while(has_sub_field('block_list')): ?> <li><?php the_sub_field('list_item'); ?></li> <?php endwhile; ?> </ul> <?php endif; ?> <img src="<?php the_sub_field('block_image'); ?>" alt=...

erlang - Mnesia, select and secondary indexes -

i created indexes table , have question. mnesia:select use secondary indexes? from http://www.erlang.org/doc/efficiency_guide/tablesdatabases.html there exceptions when complete table not scanned, instance if part of key bound when searching ordered_set table, or if mnesia table , there secondary index on field selected/matched.

mysql - Connecting SQL running on Vagrant machine through remote host? -

i trying connect emma mysql running on vagrant machine nginx remote location. server (host) has static ip can accessed through internet. has own running mysql instance can connect to. want connect vagrant's mysql remote location. you need expose port of mysql server's running on vagrant public internet. there number of ways, simplest should configuring vagrant port forwarding . since have mysql server running on host, need forward on (free) port default, example 6306 : vagrant.configure("2") |config| config.vm.network "forwarded_port", guest: 3306, host: 6306 end you need explicitly specify port in connection url in emma.

javascript - d3 force directed graph moving away on the svg, separating into group of nodes -

Image
my force directed graph drawn correctly. doesn't stay still. moves here , there on svg nodes disappear visibility leaving clusters of nodes here , there. how graph looks: some time later looks this: nodes have gone every away div var graph = new object(); var map = new object(); var index = 0; var linkindex = 0; var width = $("#d3graph").width(); var height = $("#d3graph").height() ; var svg = d3.select("#d3graph").append("svg:svg") .attr("width", width) .attr("height", height); // tool tip label var tip = d3.tip() .attr('class', 'd3-tip') .offset([-10, 0]) .html(function (d) { return d.name + ""; }) svg.call(tip); /* take nodes , edges outside. part works fine*/ graph.links = dataset2; graph.nodes = dataset1; function drapgraph(graph) { svg.selectall("g.link").remove(); svg.selectall("g.gnode").remove(...

php post to another page or the same? -

i create page php posts this: page1.php: <form action="page2.php" method="post"> ... </form> page2.php: <?php $var = $_post['...']; ?> one friend of mine told me should in same page: page1.php <?php if (isset($_post['...'])){ ... } else{ ?> <form action="page1.php" method="post"> ... </form> <?php } ?> my question is, 1 better or faster method , best practise? thank friends! you can in both ways have mentioned . its not " should in same page " in first par t passing control page1 page2 ...which done submit button can directly values using $_post['...']; now in seccond part passing control same page , since calling same page on submit . but here need check if post data has been set use isset method. most importantly can use second solution if want stay on same page after submission therefore, use of isset() met...

c++ - OpenCV error in codes -

i'm doing project on opencv on image matching. lines std::vector<cv::keypoint> keypoints1; std::vector<cv::keypoint> keypoints2; have error: namespace "cv" has no member "keypoint" how solve this? another error in code //define feature detector cv::fastfeaturedetector fastdet(80); //keypoint detection fastdet.detect(image1, keypoints1); fastdet.detect(image2, keypoints2); where error says: object of abstract class type "cv::fastfeaturedetector" not allowed: function :cv::fastfeaturedetector::setthreshold" pure virtual function function :cv::fastfeaturedetector::getthreshold" pure virtual function function :cv::fastfeaturedetector::setnonmaxsuppression" pure virtual function function :cv::fastfeaturedetector::getnonmaxsuppression" pure virtual function function :cv::fastfeaturedetector::settype" pure virtual function function :cv::fastfeaturedetector::gettype...

android - Why parsing StackOverflowException throws OOM? -

i noticed, app users got error: fatal exception: java.lang.outofmemoryerror: outofmemoryerror thrown while trying throw outofmemoryerror; no stack available so, had written pretty simple app: public class mainactivity extends appcompatactivity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); log.d("tag", "" + getfoo()); } private int getfoo() { return getbar(); } private int getbar() { return getfoo(); } } who throws oom while parsing stackoverflowexception not able stacktrace in log: 01-20 13:51:06.250 8134-8134/lt.neworld.java e/art: throwing outofmemoryerror "failed allocate 16482048 byte allocation 12515386 free bytes , 11mb until oom" 01-20 13:51:06.250 8134-8134/lt.neworld.java e/androidruntime: error reporting crash java.lang.outofmemoryerror: failed allocate 16482048 b...

c# - To pass value in DropDrownList to the Controller using ajax -

i have 2 textboxes , 1 dropdownlist. have passed value of textboxes controller action method using id through ajax.beginform() method. how pass value of dropdownlist has not defined id. here code: deliveryindex.cshtml: @using (ajax.beginform("customerfilter", "delivery", new system.web.mvc.ajax.ajaxoptions { insertionmode = system.web.mvc.ajax.insertionmode.replace, httpmethod = "post", updatetargetid = "deliverylist" })) { <input id="from" name="from" type="text" /> <input id="to" name="to" type="text" /> @html.dropdownlist("cus_name",null,"--select customer--",new { @style = "width:169px" }) <input type="submit" value="view" id="btnsubmit" /> } controller: public class deliverycontroller : mastercontroller { public actionresult deliveryindex() { ...

msysgit - git.Run() had no output -

i created git repository , started working on project on server. did push , pull fine. later on due conflicts, deleted local repository. but whenever try create local repository, following error: git.run() had no output . i didn't found solution on net after searching lot. don't know happened tortoisegit , msysgit. try this: 1. uninstall tortoisegit 2. delete tortoisegit registry using regedit.exe on windows. 3. reinstall tortoisegit hope helps.

asp.net mvc - SAML Token generation for third party -

i need create user management service central point authorize ad users multiple applications. applications can both intranet or internet, internal or external. what figured out identity server . due requirements doesn't want identity server custom sts (security token service). - need take input 3rd parties credentials - validate in our active directory - generate & send saml token authenticated users. i have looked : https://katanaproject.codeplex.com http://www.c-sharpcorner.com/uploadfile/scottlysle/windows-identity-foundation-and-single-sign-on-sso/ http://garymcallisteronline.blogspot.in/2013/01/aspnet-mvc-4-adfs-20-and-3rd-party-sts.html https://msdn.microsoft.com/en-us/library/ms972971.aspx#singlesignon_topic9 https://coding.abel.nu/2014/08/kentor-authservices-saml2-owin-middleware-released/ but still confused how 3rd party understand saml or need interpret shared identity info. 3rd party app can on language other .net too they don't need m...

json - Send a List object from a Java Servlet to JSP using the PrintWriter object? -

before proceeding realise there's similar question ( passing list servlet jsp ) couple of years ago. realise possible set list i'm trying pass session attribute out of curiosity wondered if it's possible use printwriter object send data jsp page. jsp <script type="text/javascript"> function getengineschemes(engineid) { $.get('schemetypeservlet', { action: "getschemes", engineid: engineid }, function(data, status){ }).fail(function() { alert("error obtaining schemes engine engine id: " + engineid); }); } </script> </body> servlet @override protected void doget(httpservletrequest request, httpservletresponse response) throws servletexception, ioexception { //set type of response response.setcontenttype("text/html"); response.setcharacterencoding("utf-8...

tsql - Data parameter ranges for Start and End dates -

i have req include start , end date such user should pick date range. start date includes null. i created parameters date/time , allowed null in start date parameter. also, placed filters in tablix these filters. my issue when select start , end date range don't see data in report. main dataset: select col1, col2, start_date, end_date, col3 table dataset 1: select distinct col1 table dataset 2: select distinct col2 table (col1in (@param1)) order col2 dataset 3: select distinct col1, col2, col3 table (col1 in (@param1)) , (col2 in (@param2)) group col1, col2, col3 any inputs/ideas/suggestions appreciated. you'll need outer join against calendar table contains dates in query range. way, you'll see dates in results if there's no corresponding measure it.

msbuild: build as to a appxbundle (AppxBundle=Always not working) -

i have shared windows8.1 project phone , desktop project in it. defined different configurations build x86/x64 desktop , arm phone. msbuild works fine without error, there no final *.appxbundle file on output folder (or anywhere else) although set parameter appxbundle=always . my command looks this: msbuild myapp.sln /p:outputpath=%outpath%;configuration=phone;platform=arm;appxbundle=always;appxbundleplatforms=arm /t:rebuild,publish the output is: outpath ├── forbundle │ └── appxmanifest.xml ├── appxmanifest.xml ├── app.windowsphone.build.appxrecipe ├── app.windowsphone_3.2.1_arm.appx ├── app.windowsphone_3.2.1_scale-100.appx ├── app.windowsphone_3.2.1_scale-140.appx ├── app.windowsphone_3.2.1_scale-180.appx ├── resources.pri └── somedependency.winmd i tried pack folder makeappx.exe bundle didn't work , realized folder looks bit different appxbundle. creating appxbundle via vs gui no problem, automate step! thanks in advance! there's hint co...

java - Passing method generic type to internal call -

i trying create method generics unmarshal json lists lists containing pojos. snippet below compiles , runs, @ runtime getting list<custompojo> filled hashmap instances, type t not passed along typereference constructor falls hashmap guess. public static <t> list<t> getlist(string endpoint) throws ioexception { httpget request = new httpget(server_address + endpoint); closeablehttpresponse response = httpclient.execute(request); try { statusline statusline = response.getstatusline(); if (statusline.getstatuscode() == 200) { return mapper.readvalue(response.getentity().getcontent(), new typereference<list<t>>() { }); } } { response.close(); } return null; } am on right track or not achievable using generics? try use like: mapper.readvalue(response.getentity().getcontent(), mapper.gettypefactory().contructcollectiontype(list.class, cls); where cls class<t...

c# - SQL Server query plan cache randomly getting corrupted -

i have asp.net site running off sql server database following nightly maintenance plan: check database integrity rebuild index update stats clean history every , wake stream of following errors (and unhappy users!) the conversion of varchar data type datetime data type resulted in out-of-range value. i've figured out that's it's because 1 of sp cache plans has gone skewiff, i.e. 1 of signatures no longer correct (it's trying force varchar parameter datetime). i'm using linq 2 sql (can't change that!) results in manner of weird , wonderful sp_executesql calls. way know fix step in , execute following sql after fact: dbcc dropcleanbuffers dbcc freeproccache any ideas can stop issue happening in first place?

ruby on rails - matching string then returning results using regexp -

is there way match following string user name , 50? hey "user name":/users/50 i may have more 1 instance of in string. can try following string = 'hey "user name":/users/50' matches = string.scan /"(?<name>[a-za-z ]+)":\/users\/(?<user_id>\d+)/ matches array containing arrays 2 elements first element name , 2nd element user_id >> matches # [['user name', 50]]

linux - How do I use sed for selective replacement of certain lines -

i have text follows in file: line 1 line 2 word1 line3 line 4 word2 line5 i replace lines between word1 , word2 produce final output: line 1 line 2 new lines xxxxx line5 with sed '/word1/,/word2/d' input.txt can remove lines, how can replace them instead of deleting them? one way: replacement text file: $ cat rep new lines xxxxx input file: $ cat file line 1 line 2 word1 line3 line 4 word2 line5 sed command: $ sed '/word1/,/word2/{ > /word2/r rep > d > }' file the sed command seraches line range word1 till word2 , deletes lines(d) , , when word2 encounterd, dumps replacement file contents(r rep).

Jenkins Amazon Linux Setup -

i have setup jenkins on ec2 instance using below steps tutorial online. novice in linux environment , deployments. problem jenkins dashboard not showing in browser @ <myip>:8080/jenkins. can me out this. sudo yum install -y docker nginx git sudo wget -o /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo sudo rpm --import https://jenkins-ci.org/redhat/jenkins-ci.org.key sudo yum install jenkins sudo vim /etc/nginx/nginx.conf change below server { listen 80; server_name _; location /jenkins { proxy_pass http://127.0.0.1:8080; } } sudo usermod -a -g docker jenkins sudo service docker start sudo service jenkins start sudo service nginx start sudo chkconfig docker on sudo chkconfig jenkins on sudo chkconfig nginx on i had faced similar problem before, can check following: check security groups of instance specific ports check ip tables on instance hope helps

python - Gtk-WARNING **: cannot open display: -

i using data science toolbox running ubuntu 14.04 through vagrant in windows. installed opencv , tried simple python code. import cv2 import numpy np import matplotlib.pyplot plt img = cv2.imread('image1.jpg' , cv2.imread_grayscale) cv2.imshow('image' , img) cv2.waitkey(0) cv2.destroyallwindows() when run code error - (image:1267): gtk-warning **: cannot open display: i have searched on internet not able find solution working me. i have tried - export display=:0.0 export display=:0 and many more. have tried xhost +localhost gives error xhost: unable open display "" anyone know way solve problem. you can forward display host, in vagrantfile, add following lines config.ssh.forward_agent = true config.ssh.forward_x11 = true you need x-server running on windows machine (i use quartz on mac, need equivalent windows, xming ) , when vagrant up boot vm, when run x-program pop-up on host.

Find key that contains certain characters in a hashtable with Ruby -

i have hash that's this: hash = { "key1-one" => 3, "key1-two" => 6, "key2-one" => 5, "key2-two" => 9 } now want find values keys starting key1 , regardless of follows. i've tried has_key? doesn't seem work. know can use regex there built-in method ruby? hash.select{ |key, _| key.start_with?("key1") }.values

c++ - why constant variables are not treated as compile time constant sometime -

this question has answer here: array initialization use const variable in c++ 4 answers i tried execute 2 different scenarios : scenario 1: const auto arraysize = 10; // fine, arraysize constant std::array<int, arraysize> data; here , arraysize treated compile time constant , hence allowed in std::array . scenario 2: int sz=10; const auto arraysize = sz; // fine . std::array<int, arraysize> data; //error , arraysize not compile time constant . in scenario 2 , arraysize not treated compile time constant despite of fact arrysize constant copy of sz . why these 2 scenarios treated differently ? because can like int sz = 0; std::cin >> sz; const auto arraysize = sz; and here value of sz defined in runtime. can use constexpr , instead of const , compile error on such initialization.

svn - What is the best way to resolve a tree conflict with TortoiseSVN if I want to keep my local changes? -

i've been unfortunate enough run lot of tree conflicts myself lately on project i'm working on. want know best , simplest way resolve tree conflict if want keep local changes only. thank you. right-click on file > edit conflicts > mark resolved.

angularjs - ng-model is not passing through correct value -

i have select element in users can select orderby filter, %select{ "ng-change" => "select()", "ng-model" => "selecteditem", "ng-options" => "option.sortby option in listofoptions"} this listofoptions $scope.listofoptions = [ {sortby: 'release date', value:'release_date'}, {sortby: 'newly added', value:'created_at'} ]; and select function, $scope.select = function(){ console.log($scope.selecteditem.value) } in view select box shows both release date , newly added options, when select 1 of them error, typeerror: cannot read property 'value' of undefined so looks $scope.selecteditem undefined, can't figure out why. well did plunker , select works expected plunker app.js: $scope.listofoptions = [{ sortby: 'release date', value: 'release_date' }, { sortby: 'newly added', value:...

javascript - How to open a URL in Windows 8 in a specified browser -

i've created javascript windows store blank app, , added following code launch google in default browser. var url = new windows.foundation.uri("http://www.google.com") windows.system.launcher.launchuriasync(url); what can specify specific browser launch google in? possible? think read somewhere can't this, can't seem find forum longer. you can't it. app doesn't know browsers installed, won't able target specific one, if framework allowed (which doesn't). other thing bear in mind user should in control (in case specifying default browser). should not try override choice.

geolocation - How to detect that Android Camera Geo tagging setting is on/off (GPS Info in the EXIF data) -

i'm trying find out if there's way detect "geotag" or "store-location" setting of camera on android device. don't mean general location access setting i'm familiar with, more "hidden" setting when use camera. most users not aware exists, , it's turned off default, able tell users setting off can turn on if want to, way pictures have exif data concerning location. i hope has not been answered before on so, if case, i'm sorry , please link me right thread. each android device ships own custom camera app, made manufacturer of device. each has own ui , own way/place store setting, if exists device. answer question heavily device-dependent. but if restrict aosp camera app, app used on nexus devices, there's no api this. app asks if want enable gps tagging first time app run, , after option enable/disable geotagging can found in settings. there's no way confirm if setting on, since it's not part of public ...

amazon ec2 - How to Backup running EC2 instances with EBS root volumes? -

i new aws , had take on existing vpc multiple ec2 instances. i looking way backup instances (whole disks). i read ebs snapshots on forums , seems solution. the instances' root disks ebs volumes. i read aws documentation on ebs snapshot states shown below: to create snapshot amazon ebs volumes serve root devices, should stop instance before taking snapshot. i cannot shutdown ec2 instances backup. how senior aws sysadmins instances ebs root volumes ? with kvm possible pause host. there similar functionality available in aws?

visual studio 2015 - Typescript: --outDir does not seem to work -

i using typescript in vs2015 , have following structure in project: in wwwroot app - containts ts files lib spa - want compiled js there tsconfig.json in app directory following values: { "compileroptions": { "noimplicitany": true, "module": "system", "moduleresolution": "node", "experimentaldecorators": true, "emitdecoratormetadata": true, "noemitonerror": true, "removecomments": false, "sourcemap": true, "target": "es5", "outdir": "../lib/spa" } } i have set vs2015 compile ts files on save. compiled js files generated in same app dir, , not in desired /lib/spa folder. suggestions ? in typescript versions lower 1.8 out option not work module option. you check issue here . in version 1.8 able use out when module option amd or syst...

facebook graph api - Adding custom links like 'Like' / 'Share' / 'Comment' in newsfeed -

i want know if possible add custom button 'like'/'share'/'comment' in facebook's newsfeed. i wanna add action 'mark unread' posts appearing on user's newsfeed, user can check them out later. i found browser add-on : http://socialfixer.com enables functions on user's newsfeed. wondering if achieved through facebook app, without of browser add-on. thanks :)

ios - Splash Screen Issue iPhone -

i using launch screen in xcode splash screen app. there image on splash screen, no api hit in background. taking long on splash screen time exceed of 20 sec , app crashed there, have checked on device log well. sometime crashes , runs takes long. not able move next screen there. , shows white screen before splash screen iphone 6 plus (no white screen on other devices). how come out white screen issue iphone 6 plus , resolve splash screen time long issue ? func application(application: uiapplication, didfinishlaunchingwithoptions launchoptions: [nsobject: anyobject]?) -> bool { // override point customization after application launch. // self.prepareforcontact() if let a: anyobject = (nsuserdefaults.standarduserdefaults().objectforkey("isfirsttime")) { if let a: anyobject = (nsuserdefaults.standarduserdefaults().objectforkey("userid")) { self.createappfromhomepage() ...

sql - MYSQL query with complex aggregated results -

here scenario. i've got 2 tables schema this experience: (id, title) user_experience: (id, experience_id, created_date) when user adds experience list, record added in user_experience. want dates when experience achieved milestone of 2, 5 or 10 listers. required result: id (experience.id), title, created_date, count (no of users listed experience) if experience achieved 10 listers, result should include records corresponding times when got 2 , 5 listers. i'm using query getting required result, , looking better "query". select e.id, e.title, ue_res.created_date, ue_res.count experience e inner join ( select ue.experience_id, ( select count(uee.id) user_experience uee uee.experience_id = ue.experience_id , uee.created_date <= ue.created_date ) `count`, ue.created_date user_experience ue ) ue_res on e.id = ue_res.experience_id ue_res.uecount in (2,5,10) order e.id,ue_res.created_date asc i can't create table achievements becau...