Posts

Showing posts from September, 2014

performance - Prepending to mutable.LinkedList without copying in Scala -

i need build list quickly. idea use mutable.linkedlist , grow prepending. found operator +: prepending , produces copy of list, surprising, given list mutable. is there way prepend , modify list in place? i think how supposed use it, quick glance: val newlist = new linkedlist(newelem, existinglist) note though deprecated in scala 2.11 , might removed in future.

static - C++ shared library export function -

i want write plugin application. application brings plugin header- , c-file written exported functions fill. make development easier want create c++ "api". created base classes virtual functions (required functions abstract) , call functions plugin c-file. "api" should in static library file. the real plugin (a shared library) should include static library, derive , implement needed classes. now problem: how export function included static lib in shared lib (so application calls functions static lib)? possible? usually if want have plugin mechanism c++ common way of doing it: // plugin file extern "c" baseclass* create() { return new derivedclass; } extern "c" void destroy(baseclass* base) { delete base; } then in code uses plugin you're dealing baseclass without caring derivedclass pointing to. methods need export plugin should put in baseclass , make them virtual. note1: make sure call destroy function i

c# - Register an interface with Autofac? -

i have class based on dbcontext , it's generated automatically ef designer (currently using database first). dbcontext in own assembly called 'model'. public partial class mycontext : dbcontext {} i have code in partial class , implementing interface: public interface imycontext { int commit(); task<int> commitasync(cancellationtoken ct); } public partial class mycontext : imycontext {} i have unit of work , generic repository. these classes in separater assembly called 'dal' public interface iunitofwork<tcontext> : idisposable tcontext : imycontext { int commit(); task<int> commitasync(cancellationtoken ct); } public interface irepository<t> t : class {} public abstract class repository<tcontext, t> : irepository<t> tcontext : imycontext t : class, ientity and have services, in yet assembly called 'services'. public class loginservice : baseservice, iloginservice { public loginserv

javascript - Avoid triggering multiple click events -

i'm trying make input field disabled/enabled when click on sibling link. here code. $('a').on('click',function(){ var inp=$(this).siblings('input'); inp.prop('disabled', false); $(this).click(function(){ inp.prop('disabled', true); }); }); when click first time works fine, next time won't work. because both click functions, triggers. i'm unable overcome issue. please me. see fiddle. just negate disabled prop on every click. elem.disabled = ! elem.disabled . demo fiddle: http://jsfiddle.net/abhitalks/2a2ajbnb/1/ snippet: $('a').on('click',function(){ var $inp = $(this).siblings('input'); $inp.prop('disabled', !$inp.prop('disabled')); }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <input type="text" name="x" value="22" disabled/&

oracle11g - Java block when execute Oracle Procedure -

i have problem can not solve ,i use ojdbc7 libraries connect java database oracle11g @ launch of procedure when ends java application not go forward without responce. tried change driver ojdbc nothing know give me ideas ? attaching code : private static hashmap<string, connection> connessioni = new hashmap<>(); .... public static connection getconnectionistance(string connessione){ connection connection=null; try{ if((connection=connessioni.get(connessione))==null){ class.forname("driver"); connection=drivermanager.getconnection("urldb","userdb","pwddb"); connection.setautocommit(false); connessioni.put(connessione, connection); } }catch(sqlexception e){ e.printstacktrace(); }catch(classnotfoundexception e){ e.printstacktrace(); }ca

java - How do I get files of particular extension? -

i'm creating program upload backup files cloud server, want use wildcard characters upload files "*.txt" or ".jpg". my code is: string filewacrypt = environment.getexternalstoragedirectory().getpath() + "/backup/dmg122.jpg"; but want string filewacrypt = environment.getexternalstoragedirectory().getpath() + "/backup/*.jpg";

backbone.js - requireJS in multiple context -

i'm having bit of trouble contexts in requirejs. have 2 js project based on requirejs , backbone. work perfect if work on own page. context conflict each others if put them same page. both projects follow similar module name convention. project a: main.js: require.config({ baseurl : "javascript/app1/", waitseconds : 20, paths : { jquerypb : "jquery-1.10.1.min", underscore : "underscore", backbone : "backbone-min", }, shim : { underscore : { exports : "_" }, backbone : { deps : [ "underscore", "jquerypb" ], exports : "backbone" } } }); require([ "app" ], function(app) { app.startup(); }); app.js define([ "jquerypb", "backbone", "underscore", "models/app", "views/app" ], function($jpb, backbone, _,

Java arraylist and polymorphism -

recently find questions java. 1 【a】 arraylist dates = new arraylist(); dates.add(new date()); dates.add(new string()); 【b】 arraylist<date> dates = new arraylist<date>(); dates.add(new date()); dates.add(new string()); do these 2 pieces have compilation errors? guess there should wrong add(new string()) can't make sense clearly. i cannot find mistake in arraylist , return type of dates.get() wrong? arraylist dates = new arraylist(); dates.add(new date()); date date = dates.get(0); what if use (below)? arraylist<date> dates = new arraylist<date>(); dates.add(new date()); date date = dates.get(0); if student subtype of person , legal? person p = new student(); student s = new person(); list<person> lp = new arraylist<student>(); list<student> ls = new arraylist<person>(); i struggled these questions 2 days need give me explanation. in advance for questions 1 , 2, key thing need learn

jquery - How did youtube create a fluid video player? -

if see on on of youtube's videos, https://www.youtube.com/watch?v=s8yzne7rkim , re-size dimensions of page, video player change according aspect ratio rather re-sizing it. useful because doesn't show black bars. attempt @ not successful. <style type="text/css"> #actualvid { width: 100% !important; height: auto !important; } </style> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script> <div id="actualvid"> <div id="ytapiplayer" style="width: 620px; height: 480px;" > need flash player 8+ , javascript enabled view video. </div> <script type="text/javascript"> var params = { allowscriptaccess: "always", allowfullscreen: "true" }; var at

mysql - Is it better to JOIN on id or to save string value -

i have table mvuser wih attributes user_id (int) (primary_key), username (varchar) (key), email (varchar) ,..., table job attributes job_id (int) (primary_key), job_name (varchar) (key) , table user_job. is better table user_job have attributes user_id (int), job_id (int) , or have attributes username (varchar), job_name (varchar) , why? 1 faster? table user_job queried username or job_name, example: select job_name user_job user_job.username='username' or select job_name user_job join mvuser on mvuser.user_id = user_job.user_id join job on job.job_name = user_job.job_name username='username' and similar when query users job_name. i know solution user_id (int), job_id (int) better if username , job_name can changed, in case can't, permanent. you should prefere joining on user_id , job_id primary key , indexed default (always try join on indexed columns) integer comparison faster string

javascript - How to only display certain options in select tag? -

how display options depending on value in select tag? function key(id){ var selectvalue = document.getelementbyid('names').value = document.carmakes.cars.selectedindex var selectoption = $("#names option:selected").val(); } <select size='5' name='carmakes' onchange='key(id)'> <option selected='selected' value="-1">car makes</option> <option>bmw</option> <option>audi</option> </select> <select required='required' size='5' type='text' id='names'> <option selected="selected" value="0" >car names</option> <option value="1">x5</option> <option value="2">q5</option> check this: http://www.sanwebe.com/2013/05/select-box-change-dependent-options-dynamically <!doctype html> <html> <head> <meta charset=

python - Creating an outgoing call using Asterisk Manager and "pyst" -

i trying write automation tests make phone call local asterisk instance , check receiving sip client has received call. it understanding can create outgoing call event using asterisk manager. have been trying use python 'pyst' library. i have not been able find working examples of how implement scenario. information have managed gather, have come script: from asterisk import manager host = 'localhost' port = 5068 m = manager.manager() m.connect( host ) m.login( 'admin', 'temp123' ) targeturl = '441610000001' response = m.originate( targeturl , 's', context='outgoing', priority='1' ) print m.status() m.logoff() m.close() this script reports 'success' response asterisk manager not create outgoing call. has written script in python? i familiar python language solutions in other languages wouldn't helpful me! please read again documentation "targeturl"

How to resolve conflict in git terminal? -

there conflict while merging 2 branches in git, how resolve conflict in terminal. in case can resolve problem in netbeans ide easily. cannot resolve problem in termial. edit files conflicts git add files fixed conflicts git commit finish merge

benchmarking - Is Apache SOLR fully certified on vmware? -

is apache solr certified on vmware ? if yes there benchmarking figures available ? i have gone through below link, other insights appreciated. http://mail-archives.apache.org/mod_mbox/lucene-solr-user/201303.mbox/%3c008a01ce297c$d0934900$71b9db00$@arcadelia.com%3e i dont have benchmarking figures share - have deployed solr in numerous environments on virtual infrastructure - , never seen issues related virtualization in solr

java - Linked list creates infinte loop when outputted (No Iterators allowed) -

when user stores 2 or more values list, output displays this: item 3: null item 4: null item 5: null ... item 14623: null this case when user wants output list case output: { system.out.println ("the list:"); displaylist(); break; } which leads displaylist() method public static void displaylist() { (int = 0; <= list.size (); i++) { system.out.println ("item " + + ": " + list.get(i)); } } which uses list.size() public int size() { for(node n = header; n.getnext() != null; n = n.getnext()) { size++; } return size; } and list.get() public object get(int index) { node n = traverse(index); if (n == null) { return null; } return n.getdata(); } getnext() public node getnext() { return next; } traverse(). think method what's causing problems public node traverse(int index) { node n = header; if (index < 0) { return

sqlite3 - Spatialite for iOS -

in past few days, i've been trying use spatialite ios. have tried many things, none of them worked. have made best progress spatialdbkit, fails when run application (with example spatildbkit webpage) on statement: sqlite3_auto_extension ((void (*)(void)) init_spatialite_extension); which located in function spatialite_init in file spatialite_init.c. there exc_bad_access error, don't understand much. have tried solution libspatialite-ios, rather outdated , doesn't work anymore. know how fix issue?

symfony - Symfony2 ConsoleExceptionListener ConsoleExceptionEvent get Arguments and Options -

i have implemented console exception listener explained in http://symfony.com/doc/current/cookbook/console/logging.html#enabling-automatic-exceptions-logging works expected. but have cronjobs execute commands require arguments , options , add arguments , options log, have more specific detail of caused error. how can that? inside command class haven't see public function arguments or options i found answer looking in wrong place $command = $event->getcommand(); as described in question command has no methods it but consoleexceptionevent $event has method input (arguments , options) $event->getinput();

javascript - How can I change global variable when it's showed in an HTML page? -

the global variable called "gv" own original value. , when call function clicking buttons in html page, gv changed. then, want show gv in html page calling alert() or else. gv has no change. how can this? the "best" way create global add "window." in front of variable. window.gv = 0; function testone() { window.gv = 'hi !'; } testone(); settimeout(function () { alert(window.gv); }, 500);

mysql - SQL Switch even/odd values of the selection -

currently have selection 2 tables: (select e.id, e.num, '1' tbl events e ) union (select p.id, p.num, '2' tbl places p ) order 2 desc it returns values ordered num this: id | num | tbl 3 | 9 | 2 1 | 8 | 2 4 | 7 | 1 1 | 4 | 1 7 | 1 | 2 but goal mix tables in selection not losing order within specific table. this: id | num | tbl 3 | 9 | 2 4 | 7 | 1 1 | 8 | 2 1 | 4 | 1 7 | 1 | 2 thanks in advance! appreciate help! if want interleave tables, need additional information. if enumerate each row, can use sorting. this: (select e.id, e.num, '1' tbl, (@rn1 := @rn1 + 1) rn events e cross join (select @rn1 := 0) vars order e.num desc ) union (select p.id, p.num, '2' tbl, (@rn2 := @rn2 + 1) rn places p cross join (select @rn2 := 0) vars order p.num desc ) order rn, tbl desc;

java - Getting exception: Unable to locate element -

i trying write script automate login , logout site www.flipkart.com . script failing , giving exception: unable locate element: {"method":"link text","selector":"logout"} not able figure out issue. can tell issue locator. below code: actions builder = new actions(driver); system.out.print("log1"); webelement element = driver.findelement(by.xpath(".//*[@id='fk-mainhead-id']/div[1]/div/div[2]/div[1]/ul/li[6]/a")); system.out.print("log2"); action action = builder.movetoelement(element).build(); action.perform(); system.out.print("log3"); driver.manage().timeouts().implicitlywait(5,timeunit.seconds); driver.findelement(by.linktext("logout")).click(); } you're in luck.. recently, had helped individual logging in , out of flipkart. here script: @config(url="http://flipkart.com", browser=browser.firefox) public class testflipkart extends conductor { @test

android - Send Keyboard presses via IP HTTP GET -

i have iptv android box (atn 200ii) , unfortunately have no ir control on control system. have no api control app remotely, remote sends keyboard presses device. wonder there way can build driver send http request (or maybe post) emulate keyboard button on android box. many thanks

Unable to get xaxis values of Bar Chart using jqplot -

function setupbarchartfilter(id, listdata) { if (listdata.length > 0) { // prepare data jqplot refinementcount = []; refinementname = []; refinementdata = []; (var = 0; < listdata.length; i++) { var filter = listdata[i]; var name = filter.refinementname.slice(0, 20); var count = filter.refinementcount; var item = [name, count]; refinementcount.push(count); refinementname.push(name); refinementdata.push(item); } ticks = []; ticks.push = refinementname; // call jqplot $.jqplot.config.enableplugins = true; var plot = $.jqplot(id, [refinementcount], { // animate if we're not using excanvas (not in ie 7 or ie 8).. seriescolors: ['#0072c6', '#73c774', '#c7754c', '#17bdb8', '#00749f'], animate: !$.jqplot.use_excanvas, seriesdefaults: { renderer: $.jqplot.barrenderer, rendereropt

jquery - set position relative to another element -

suppose of following html: <div class="header"> <div class="foo"></div> </div> <div class="main"></div> <div class="footer"></div> now, .foo relative .header , wish set .foo position in accordance .footer . if use absolute position .foo should relative .footer . please note: cannot append .foo .footer reason. is possible?

java - Why are variable not recognised from inside for-statements? -

what trying create array pulls numbers array. i'm not sure if have gone right way. i've ways of returning statements functions/methods , can't find anything, not sure if possible. anyway, issue having here 'return evenarray' below 'cannot find symbol.' not sure means? public static int[] getevenarray(int[] array) { int dividedby = 2; int evenelement; int evencount = 0; for(int = 0; < array.length; i++) { int[] evenarray; evenelement = array[i] % dividedby; if(evenelement == 0) { evencount++; } else { array[i] = 0; } evenarray = new int[evencount]; for(int x = 0; x < evenarray.length; x++) { if(array[i] != 0) { evenarray[x] = array[i]; } } } return evenarray; } this tutorial 1 of lectures, it's little bit challenging least :-)0

sql - Join query issue in MySQL -

i'm storing records in hierarchy. ex. account -> hospital -> department account -> hospital -> department -> section i'm storing association of records in following manner. +------+---------------+----------+---------------+-----------+ | id | parenttype | parentid | child type | childid | +------+---------------+----------+---------------+-----------+ | 1| account| 1| hospital| 10| | 2| account| 1| hospital| 20| | 3| hospital| 10| department| 100| | 4| hospital| 10| department| 101| | 5| department| 100| device| 1000| | 6| department| 101| device| 1001| | 6| department| 101| device| 1002| | 1| account| 2| hospital| 30| | 2| account| 2| hospital| 40| | 3| hospital|

java - create ProducerTemplate for dynamic uri -

common producertemplate usage declare member , annotate @produce @produce(uri = "direct:start") protected producertemplate template; and use simple string response = (string) template.requestbody(message_body); what if uri not known @ compile time, how create producertemplate? i think mean like: producertemplate template = context.createproducertemplate(); template.requestbody("direct:start",message_body);

c# - Consuming a webservice returning array in C # -

i have 2 webservices developed in advpl consumed in application in c # vs2013 (windows form). the first 1 returns string , working perfectly, second , returns array can not consume @ all. it's not connection problem, because if change second webservice return string works normally, can not array in visual studio 2013. he returning me "can not implicitly convert type" error. follows method of webservice published , error generated: webservice request: <?xml version="1.0" encoding="utf-8"?" <soap:envelope xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:xsd="http://www.w3.org/2001/xmlschema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:body> <_cfilial>string</_cfilial> </soap:body> </soap:envelope> webservice response <?xml version="1.0" encoding="utf-8"?" <soap:envelope xmlns:xsi="http://www.w

smarty - Template inheritance: remove block that was added in grandparent and appended to in parent -

in smarty template, have 3 templates: base.tpl {block name="myblock"} base {/block} child.tpl {extends file="base.tpl"} {block name="myblock" append} child {/block} grandchild.tpl {extends file="child.tpl"} {block name="myblock"}{/block} when rendering grandchild.tpl , output is base so grandchild-template wants replace content of whole block, replaces appended part. how delete whole block? related: how remove content appended block in parent template? the solution here in child.tpl change block definition from: {block name="myblock" append} child {/block} into: {block name="myblock"} {$smarty.block.parent} child {/block}

r - Weighting k Means Clustering by number of observations -

i cluster data using k means in r looks follows. adp ns cntr pp2v eml pp1v addps fb pp1d adr isv pp2d adsem sumall conv 2 0 0 1 0 0 0 0 0 12 0 12 0 53 0 2 0 0 1 0 0 0 0 0 14 0 25 0 53 0 2 0 0 1 0 0 0 0 0 15 0 0 0 53 0 2 0 0 1 0 0 0 0 0 15 0 4 0 53 0 2 0 0 1 0 0 0 0 0 17 0 0 0 53 0 2 0 0 1 0 0 0 0 0 18 0 0 0 106 0 2 0 0 1 0 0 0 0 0 23 0 10 0 53 0 2 0 0 1 0 0 1 0 0 0 0 1 0 106 0 2 0 0 1 0 0 3 0 0 0 0 0 0 53 0 2 0 0 2 0 0 0 0 0 0 0 0 0 3922 0 2 0 0 2 0 0 0 0 0 0 0 1 0 530 0 2 0 0 2 0 0 0 0 0 0 0 2 0 954 0 2 0 0 2 0 0 0 0 0 0 0 3 0 477 0 2 0 0 2 0 0 0 0 0 0 0 4 0 265 0 2 0 0 2 0 0 0 0 0

java - Validating an xml against xsd that was used to generate Beans -

i generate beans couple of xsd via ant-build. when unmarshalling xml, validate one. far know, there way beans themself, 1 has this: jaxbcontext context = jaxbcontext.newinstance(bean.class); schemafactory sf = schemafactory.newinstance(xmlconstants.w3c_xml_schema_ns_uri); schema schema = sf.newschema(new file("whatever.xsd")); unmarshaller unmarshaller = context.createunmarshaller(); unmarshaller.setschema(schema); unmarshaller.seteventhandler(validationhandler); return (bean) unmarshaller.unmarshal(givenxmlstring); my problem new file("whatever.xsd") . don't want hardcode url xsd, might change later (i.e. refactoring project) , break @ runtime, because 1 forgot (or didn't know) change url. idea: idea have copy xsd same folder generated beans , use packagename of 1 bean generate url @ runtime. any better ideas? instead of sf.newschema(file) can use sf.newschema(source[]) 1 of javax.xml.transform.source implementations, e.g. javax

java - How to change point size or shape in FastScatterPlot (JFreeChart)? -

i have large collection of 2d coordinates (i.e., in order of 100k 200k x,y pairs) visualize scatter plot. application intended for, having many points makes sense , can't/won't reduce number different reasons. plot in java, use jfreechart. have played around chartfactory.createscatterplot() , 50k randomly generated points, , while gives greatest amount of flexibility set appearance (point size/color/shape), slow displaying many points. means, takes time appear , zooming delayed/not smooth. however, once few points visible, i.e., zoomed in, visualization nicely responsive. on contrary, fastscatterplot() allows draw 500k randomly generated 2d points appearance not nice managed set color far (using, e.g., setpaint(color.blue) ) not shape or size. size problem in particular individual points small. how can change point size or shape in fastscatterplot ? and related this, there way make chart returned chartfactory.createscatterplot() more responsive? my data fixed , r

Convert nested array into single array using php -

i having nested output this $arr = array(); $arr = array (size=2) 0 => array (size=2) 0 => string '28' (length=2) 1 => string '7973' (length=4) 1 => array (size=1) 0 => string '4595' (length=4) my expected output this $new_array = array 0 => 28 1 => 7973 2 => 4595 pls me solve this... advance thanks.... this simple doing array_merge: array_merge($arr[0], $arr[1]); php - array_merge demo

C++ override operator= to call ToInt() method -

hi i'm trying overload assignment operator of class return class member (data). class a{ public: int32_t toint32() { return this->data; } void setdata(int32_t data) { this->data=data; } private: int32_t data; } i want overload = operator, can following: a *a = new a(); a->setdata(10); int32_t testint; testint = a; and a should 10 . how can that? you can’t since a pointer. can overload operators custom types (and pointers not custom types). but using pointer here nonsense anyway. can make following work: a = a{}; a.setdata(10); int32_t testint; testint = a; in order this, overload implicit-conversion-to- int32_t operator, not operator= : public: operator int32_t() const { return data; } a word on code style: having setters bad idea – initialise class in constructor. , don’t declare variables without initialising them. code should this: a = a{10}; int32_t testint = a; … two lines instead of four. definition of a becomes s

java - ResultSet.next() is too slow for an oracle ref cursor -

i call oracle procedure java , returns ref cursor result. cast ref cursor resultset , iteration starts on it. string query = "{call ...(...)}"; callablestatement stmt = conn.preparecall(query,resultset.type_forward_only, resultset.concur_read_only); stmt.setfetchsize(10000); . . . stmt.registeroutparameter(x, oracletypes.cursor); stmt.execute(); resultset rs = (resultset) stmt.getobject(x); while (rs.next()) { /** problem occurs here **/ ... } the problem (not always) specific records resultset.next() method takes long (like 100 secs). necessary mention number of returned records @ 25 , same query in database behaves executed (executes in 6 seconds). as investigated more, found out there column in returned cursor if removed problem doesn't occur. column rownum() included in result cursor. --oracle query snippet: open result_cursor select "firstname","lastname", r (select rownum r, * ... -- query details

localization - Can I change the language of mod_autoindex / Apache Directory Listing -

is possible change default language (german) of apache directorylisting? i tried this: defaultlanguage de addlanguage de .de languagepriority de en forcelanguagepriority fallback the table headers still "name", "last modified" "size". as of httpd 2.4.10, not possible using httpd.conf because column headings hard-coded in modules/generators/mod_autoindex.c. i changed headings using httpd.conf , javascript. not full solution because works 1 language only. have not been able figure out how same several languages. is, unfortunately, not possible use 'document.documentelement.lang' detect appropriate language because mod_autoindex.c not provide 'lang' attribute. here relevant lines httpd.conf (you can omit indexoptions except htmltable): loadmodule autoindex_module /usr/lib/httpd/modules/mod_autoindex.so indexoptions htmltable charset=utf-8 suppressdescription indexstylesheet "/directoryindex.css" readmename

java - Sorting strings in Japanese -

i in process of localizing android application japanese. have localized strings. example, when displaying list, need strings displayed in alphabetical order. is there way can sort japanese strings alphabetically (because see symbols :p). have tried using collator: collator collator = collator.getinstance(locale.japanese); collections.sort(list, collator); ?

java - Why Servlet filter causing error in working application -

in working application, servlet filter has been placed. filter causing errors in existing application. currently proof of concept purposes filter logs, no code has been implemented. no exceptions found. on tomcat access log clue resources returning 304 [18/nov/2014:17:18:34 -0500] 10.93.161.0 (0ms) 52d40ef309a3eb46f1c5de3fb1d063bd.application.1 /secure/application/application/sc/skins/enterprise/images/window/window_tl.png http/1.1 : 304 as mentioned without filter in place application works fine. when filter in place, logs show filter logging application not work properly, seems filter interfering somehow, don't want interference, except of implemented code in dofilter method. below filter declaration in web.xml <filter> <filter-name>sessionfilter</filter-name> <filter-class>com.company.filter.sessionfilter</filter-class> </filter> <filter-mapping> <filter-name>sessionfilter</filter-name> &

angularjs - g-tag does not work when used in replace directive -

this code: app.js var app = angular.module('plunker', []); app.controller('mainctrl', function($scope) { $scope.name = 'world'; }); // directive replaces <g> tag app.directive('hexagonreplace', function(){ return { templateurl: 'hexagonreplace.html', restrict: 'e', replace: true, scope:{ dx: '=', dy: '=' } }; }); // directive appends <g> tag polygon forming hexagon app.directive('hexagonappend', function(){ return { templateurl: 'hexagonappend.html', restrict: 'a' }; }); hexagonreplace.html <g class='hexagon' ng-attr-transform='translate({{dx}},{{dy}})'> <polygon points="21.65063509461097,-12.499999999999998 21.65063509461097,12.499999999999998 1.5308084989341915e-15,25 -21.65063509461097,12.499999999999998 -21.65063509461097,-12.499999999999993 -4.59242549680257

SSL not working in CherryPy -

i've seemingly done according docs ssl not work. here's cherrypy settings.conf : [global] request.show_tracebacks = false server.socket_port = 443 server.thread_pool = 10 log.screen = true log.error_file = '/root/website/web.log' log.access_file = '/root/website/access.log' cherrypy.server.ssl_module = 'pyopenssl' cherrypy.server.ssl_certificate = "/etc/ssl/website/addtrustexternalcaroot.crt" cherrypy.server.ssl_private_key = "/etc/ssl/website/btcontract_com.key" cherrypy.server.ssl_certificate_chain = "/etc/ssl/website/chain.crt" if try load site.com:443 in browser works without using certificate. if try https://site.com browser says there's ssl connect error. cherrypy error , connection logs contain nothing @ if not getting these https requests. i'm not sure if python has built in ssl support did installed pyopenssl . what's going on , how can fix this? there change in version 3.2.5 b

sonarqube - See which issues had their severity changed -

in sonarqube (i use version 4.5.1), user can change severity of issue (i don't mean changing severity of rule). in theory, developer take "critical" issue , change "minor". a project lead or reviewer might want know issues had severity changed not clear me how see that. (for false positives on other hand, there widget called "false positives issues" shows issues marked false positive). for sonarqube v4.5.1 there viewing issue change log can used see if issue has changed severity. additional there widget plan plugin can show manual severity reviews, it's not working sonarqube 3.6+. have tried plugin, both in sonarqube v4.5.1 , in v3.5.1, , working in v.3.5.1. hope helps you.

ios - Animating UIView and Mask -

Image
i have uiimageview mole. want mole pop out of hole. have in mind create mole points below hole , have mask on , animate image view looks popping out of hole. following thought , had made written down code : cashapelayer *masklayer = [[cashapelayer alloc] init]; cgrect maskrect = _moleicon.frame; cgpathref path = cgpathcreatewithrect(maskrect, null); masklayer.path = path; cgpathrelease(path); _moleicon.layer.mask = masklayer; [uiview animatewithduration:2.0 animations:^(void){ _moleicon.transform=cgaffinetransformmaketranslation(0, 50); }]; but problem, seems mask moving actual uiimageview. highly appreciated. try use 2 uiviews, maskview should bring front: [superview bringsubviewtofront:maskview]; and set background color , alpha property mask view, maskview.backgroundcolor = [uicolor blackcolor]; maskview.alpha = 0.8; and can move 2 view directly. but better add 2 view other view - container, , rotate 1 view.

c# - The remote name could not be resolved when creating blob Container -

im trying store screenshots cloud azure keep geting exception: remote name not resolved:'azuretest.blob.core.windows.net.blob.core.windows.net' cloudstorageaccount storageaccount = cloudstorageaccount.parse(cloudconfigurationmanager.getsetting("storageconnectionstring")); cloudblobclient blobclient = storageaccount.createcloudblobclient(); cloudblobcontainer container = blobclient.getcontainerreference("screenshots"); container.createifnotexists(); does know might causing exception? it looks have wrong account name in connection string, should have: accountname=azuretest instead of: accountname=azuretest.blob.core.windows.net

datepicker - how to display date difference using javascript and disable old dates -

i have problem js i have find difference between 2 days , have disable past dates too.. i tried many scripts have these functions separately.. past disabling alone.. or date calculation.. need both functions combined in work. i tried out js you can check out js below link [http://jsfiddle.net/w5eta8rm/2/][1] kindly check link above.. combined them both.. unable make work.. i dont need alert function.. need show text below datepicker. thanks in advance. you can check here in jsfiddle giving days difference , printing in div down datepicker combined past disabling alone , date calculation dateto gets enabled when select datefrom html file <form method="post"> <div height="100px"> <br/> from: <input type="text" name="date_from" id="txtfromdate" autocomplete="off" /> to: <input type="text" name="date_to" id="txttodate&quo

Why Java inner classes require "final" outer instance variables? -

this question has answer here: why final variables accessible in anonymous class? 11 answers cannot refer non-final variable inside inner class defined in different method 20 answers final jtextfield jtfcontent = new jtextfield(); btnok.addactionlistener(new java.awt.event.actionlistener(){ public void actionperformed(java.awt.event.actionevent event){ jtfcontent.settext("i ok"); } } ); if omit final , see error " cannot refer non-final variable jtfcontent inside inner class defined in different method ". why must anonymous inner class require outer classes instance variable final in order access it? well first, let's relax, , please put gun down. ok. reason language insists on cheats in order provide inner class functions

android - UiLifecycleHelper not opening Facebook Session -

i have facebook login integrated in native android app im creating.the uilifecyclehelper class opens facebook session working fine before ,but session not getting opened , session.statuscallback not getting triggered , onsessionstatechange() method not getting called. public class sessionactivity extends fragmentactivity { private static final int signup = 0; private static final int citylist = 1; private static final int fragment_count = citylist+1; private boolean isresumed = false; private fragment[] fragments = new fragment[fragment_count]; private uilifecyclehelper uihelper; private session.statuscallback callback = new session.statuscallback() { @override public void call(session session, sessionstate state, exception exception) { toast.maketext(getapplicationcontext(), "uilifecycle called", toast.length_short).show(); onsessionstatechange(session, state, exception); } }; @override public void oncreate(bundle

Xtext enum value setting -

i have ecore metamodel this pattern direction:direction patterndetail:details direction both=0 left=1 right=2 this simplification representation of graph query language use patterns. pattern direction , details (name, whatever) in grammar want parse input direction information on 2 places, example <-[patterndetails]-> (direction = both) -[patterndetails]-> (direction = right) <-[patterndetails]- (direction = left) so have created rule pattern returns pattern: '<-'patterndetails=patterndetails'->' |'<-'patterndetails=patterndetails'-' |'-'patterndetails=patterndetails'->' ; but can't figure out how can set direction associated. try add direction=direction.both @ end of first line not possible. seems strange because possible affect value estring attribute example, not enums. am missing on enum access or doing wrong ? you can have multiple rules same enum

Mongos + Pymongo 2.5 ==>No suitable hosts found -

our application using pymongo. i'm trying connect mongos. code fails on following line pymongo.mongoreplicasetclient(ec2-aa-bbb-124-22.compute-1.amazonaws.com:27017, replicaset=self.class_settings['mongo_rs']) exception /system/library/frameworks/python.framework/versions/2.7/bin/python2.7 /users/.../server_tornado.py --config=conf/development.conf --port=9001 traceback (most recent call last): file "/users/..../server_tornado.py", line 319, in basecatalog.db_instance = dbinit(config=settings) file "/users/..../lib/sc/singleton.py", line 20, in call cls._instances[cls] = super(singleton, cls). call (*args, **kwargs) file "/users/..../app/models/db_init.py", line 50, in init raise exception(" init () => " + str(err)) exception: init () => no suitable hosts found process finished exit code 1` found solution, if @ faces issue: usin

performance - Oracle perfromance joining 3 tables with sum aggregate function -

i have 3 tables terms ( id, isn,sentenceid,term_root,sentence_length) contains full corpus ( more 20 million records ) user_terms ( id,isn,sentenceid,term_roott,sentence_length) contains user document info ( 100000 records) correlations ( id, term1, term2, correlation_factor ) contains static data, describes correlation , similarity between 2 terms (contains 500000 records) i want find similarity between user document sentence , documents in corpus. joining user term , corpus term , find correlation factor, , summing result each sentence used query select tt.sentenceid ,tu.sentenceid, sum (c.correlation_factor)/greatest( tu.sentence_length,tt.sentence_length), tt.isn , tu.isn correlations c, terms tt, user_terms tu (tt.term_root = c.term1 , tu.term_root = c.term2 , tu.isn='22242') group tt.sentence_id, tu.sentence_id, tt.isn, tu.isn,tu.sentence_length,tt.sentence_length having sum (c.correlation_factor)/greatest( tu.sentence_

jquery - Get range input value to css using Javascript -

i did code simple css process bar. need range or textbox value div width <div style="width:50%;"> , when user change value of range or textbox textbox takes range value in code. can using javascript? *i'm not js no idea how start! possible do? here's simple code: .graph { width:200px; margin-left:25px; height:20px; background: rgb(168,168,168); background: -moz-linear-gradient(top, rgba(168,168,168,1) 0%, rgba(204,204,204,1) 23%); background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(168,168,168,1)), color-stop(23%,rgba(204,204,204,1))); background: -webkit-linear-gradient(top, rgba(168,168,168,1) 0%,rgba(204,204,204,1) 23%); background: -o-linear-gradient(top, rgba(168,168,168,1) 0%,rgba(204,204,204,1) 23%); background: -ms-linear-gradient(top, rgba(168,168,168,1) 0%,rgba(204,204,204,1) 23%); filter: progid:dximagetransform.microsoft.gradient( startcolorstr='#a8a8a8', endcolorstr='#cccccc',gradienttyp

r - efficient way to change the colnames of data frame with a lot of columns -

there exists data frame 80 columns, change column names sth like t1 t2 t3 t4 t5 t6 ... t80 is there efficient way fulfill kind of task? thank you! you make use of more efficient paste0 colnames(data) <- paste0("t", 1:80) # paste0("t", 1:80) give you: [1] "t1" "t2" "t3" "t4" "t5" "t6" "t7" "t8" "t9" "t10" "t11" "t12" "t13" "t14" "t15" [16] "t16" "t17" "t18" "t19" "t20" "t21" "t22" "t23" "t24" "t25" "t26" "t27" "t28" "t29" "t30" [31] "t31" "t32" "t33" "t34" "t35" "t36" "t37" "t38" "t39" "t40" "t41" "t42" "t43&qu

sql server - MS SQL text type field in a trigger -

in project forced use columns text type in ms sql (version 2008), due datalink obscure gis-system. forced use triggers convert value in text column geometry type value in column.(for geographical indexing , search) i know text type not allowed in trigger, trying find workaround. mentioned above it's not option change column type nvarchar(max). i have tried convert(), not allowed use select stement inside function. , can't use select directly because of text type. any suggestions?

mysql - Joining Two Tables In One Join -

i need filter query result 1 of selected aggregated fields meets conditions. in case, have nvk.quality_id being equal 81 or 82. 81 or 81 condition applies 1 field counting not other field. query work expected: select cams.name campaign_name, clk.type, count(distinct clk.eid) dist_eids_sent, count(distinct nvk.eid) dist_leads bm_arc.clicks156 clk inner join bm_queue.campaigns cams on clk.camp = cams.id left join bm_emails.nvk156 nvk on nvk.eid = clk.eid , quality_id in (81,82) # hot, warm group campaign_name, type the results here this: campaign name | type | dist_eids_sent | dist_leads dogs | 1 | 1000 | 100 cats | 1 | 900 | 80 these results correct , in line our expectations. 81 , 82 descriptions of type of dist_leads. want hot or warm ones in result. but, rather and quality_id in (81,82) # hot, warm use english meaning of these 2 ids in selector. to must join query bm_config.classes cls on nvk.quality_id =

excel - Why is this nested IF statement not returning my intended values? -

i trying formula in excel. nested if statement not returning values i've intended. cell in statement can between 1.000 , 0.000. if value in cell equal 1 returns value of "1", if less 1 returning value of "3", when value 0. missing if statement? =if(f5=1,"4", if(1>f5>=0.9,"3", if(0.9>f5>=0.75,"2", if(0.75>f5>=0.55,"1", if(f5<0.5,"0"))))) to between range in excel done using and(logical1, [logical2], ...) if(and(xxx>=yyy,xxx<=zzz)... so check if(and(f5>=0.9,f5<1)...

spring jms - Grails JMS Plugin -

i using grails 2.4.3 version , latest grails jms plugin. i have durable subscription , message listener configured. when deploy code 2 node cluster, throws javax.jms.jmsexception: duplicate durable subscription detected. is there way handle error? shared durable subscription part of jms 2.0 spec.

meteor - Iron-Router Does NOT Render Template A Second Time For Data Change Context in same Route -

i have route using iron-router described below: //// preview route router.route('/preview/:_id', { template:'preview', subscriptions: function() { return meteor.subscribe('files', 'preview', currentincident()); }, data: function () { return files.findone(this.params._id); }, action: function () { if (this.ready()) { this.render(); } else { this.render("loading"); } }, onafteraction: function() { // start resetting scroll top of page $(window).scrolltop(0); } }); the template.preview.rendered gets called when come different route, i.e /home . if use router.go("/preview/someid") /preview/differentid template.preview.rendered not called. there way around problem?

git - How can I display commit's position in the history relative to tags (and branches)? -

i'm looking way information commit occurred relative tags (and branches if possible). there kind of command or group of commands (if necessary, can use bash commands well) give commit hash , receive list of tags (and branches) in order commit in correct position relative other tags? example, if <commit-hash> occurred between tag2 , tag3 , following command: [command(s)] <commit-hash> would result in following output: branch1 tag1 tag2 <commit-hash> tag3 branch2 master i tried using git log this, i'm not sure start. possible? git describe --tags $rev give short description (see man page details) of tag before revision. git describe --contains $rev give first tag contains revision. git rev-list --branches --tags $rev might useful place start also. might able want using of "history simplification" arguments function. i'd try --simplify-by-decoration first , possibly --dense . to control output of git rev-list can