Posts

Showing posts from August, 2013

elasticsearch - Logstash: create new event in filter -

when filtering events in logstash (20+ attributes) create new event have 1 parameter original event , store other elastisearch index. i know possible using clone filter plugin. don't want manually remove attributes original events except 1 need. also clone event (i'm store new event in separate elasticsearch index) duplicate unneeded attributes. is there filter plugin purpose? or hidden feature? or maybe clone filter plugin handles removal of attributes cloned messages? elastalert simple framework alerting on anomalies, spikes, or other patterns of interest data in elasticsearch. http://elastalert.readthedocs.io/en/latest/elastalert.html

python - Tkinter: Display image after opening from dialog -

this first program i'm writing utilizing tkinter, apologize in advance if questions bit naive. i have following: class example(frame): def __init__(self, master=none): frame.__init__(self,master) menubar = menu(self) master.config(menu=menubar) self.centerwindow(master) self.top_bar(menubar,master) self.pack(fill = both, expand = 1) def top_bar(self,menubar,master): filemenu = menu(menubar,tearoff=false) menubar.add_cascade(label="file",menu=filemenu) filemenu.add_command(label="open",command = self.open_file) filemenu.add_command(label="exit",command = self.quit) filemenu = menu(menubar,tearoff=false) menubar.add_cascade(label="edit",menu=filemenu) filemenu = menu(menubar,tearoff=false) menubar.add_cascade(label="shortcuts",menu=filemenu) filemenu = menu(menubar,tearoff=false) menubar.add_command(label="about",command = message_about) notice ha

Compass Sprite returning "File to import not found or unreadable" -

so, i've started using compass framework, , wish start using native spriting feature. in doing so, i've added following top of scss file: @import 'compass/utilities'; @import "*.png"; @include all-img-sprites; after compiling, following error: error path/to/my/project/css/scss/front.scss (line 4: file import not found or unreadable: *.png. load paths: compass::spriteimporter path/to/my/project/css/scss c:/ruby22/lib/ruby/gems/2.2.0/gems/compass-core-1.0.3/stylesheets) compilation failed in 1 files. [finished in 1.7s] i've looked around solution this, surprise, though there's multiple threads on - can't seem find relevant. i've tried renaming folders thinking "img" folders might keyworded or something, no avail. below you'll find config.rb . # set root of project when deployed: http_path = "" # configure sass path sass_path= "path\\to\\my\\project\\css\\scss" # folder locations sass_dir

Oracle sql: Using two listagg -

Image
i'm using following code bring through 'del' text , 'pal' text. 'del' , 'pal' text across several lines (and not same amount of lines of each). select trim(listagg(tx1.text, ', ') within group (order tx1.text)) del_text, trim(listagg(tx2.text, ', ') within group (order tx2.text)) pal_text oes_ordtxt tx1 inner join oes_ordtxt tx2 on tx1.key1 = tx2.key1 , tx1.key2 = tx2.key2 , tx1.key3 = tx2.key3 , tx2.doctyp = 'pal' tx1.key1 = '0018104834' , tx1.key2 = '00001' , tx1.key3 = '001' , tx1.doctyp = 'del' the problem have have multiple rows on 'del text , 1 row on 'pal' text 'pal' text repeats, e.g. the 'pal_text' duplicating 1 pal_text exists but, 3 del_text exists. is there way remove duplicates? thanks, smorf it doesn't matter how many tables in aggregation (unfortunately can't check syntax without data structure): select

angularjs - use a bootstrap modal without making a seperate controller -

i using bootstrap modal controller.js - $scope.open = function() { var modalinstance = $modal.open({ animation: true, templateurl: 'views/template.html', controller: 'controller2', resolve: { items: function() { return $scope.values; } } }); modalinstance.result.then(function(values) { $scope.new_value = values; }, function() { }); }; i don't want create new controller since modal should show values changing in current controller. should pass in place of controller2 if modal in same controller? you use scope option instead of controller: $scope.open = function() { var modalinstance = $modal.open({ animation: true, templateurl: 'views/template.html', scope: $scope, resolve: { items: function() { return $scope.values; } } }); modalinstance.result

plsql - PL/SQL Trigger throws a MUTATING TABLE error -

i have trigger: create or replace trigger tr14_2 before insert or update of cantidad on distribucion each row declare total_cars number; total_cars_potential number; begin select sum(cantidad) total_cars distribucion cifc = :new.cifc; total_cars_potential := total_cars + :new.cantidad; if inserting if(total_cars_potential > 40) raise_application_error(-20005, 'dealer [' || :new.cifc || '] has 40 cars stocked'); end if; end if; if updating if(total_cars_potential - :old.cantidad > 40) raise_application_error(-20006, 'that update of cantidad makes dealer exceeds limit of 40 cars stocked'); end if; end if; end; it gets mutating table error, , have checked because of updating block of code, inserting goes ok; why? , how can fix it? just clarify, want each dealer can have @ maximum 40 cars stocked. so, if add row distribucion ("distribution") cantidad ("quantity") make dealer

devise - Rails http post method returning a 401 unauthorized error -

so i'm developing simple web app, have devise set user authentication. child of user class property. both registration , login work user. however, when try create new property or edit property 401 error: started post "/api/v1/properties" ::1 @ 2015-06-25 11:00:09 -0400 .... completed 401 unauthorized in 0ms (activerecord: 0.0ms) it seems if current_user devise not being passed properties controller suspect association problem or token issue. appreciated. propertiescontroller: class api::v1::propertiescontroller < applicationcontroller skip_before_filter :verify_authenticity_token, :only => :create respond_to :json def index properties = property.all render json: properties end def show respond_with property.find(params[:id]) end def create property = current_user.property.build(product_params) if property.save render json: property, status: 201, location: [:api,

Fill HTML Form Fields With JSON Object -

i have basic html form i've created locally , form, same one, on separate local site. i wondering if there way fill out first html form , automatically fill out second form same data. i have looked possibly packaging form data json object can't seem find guidance how it. <!doctype html> <html lang="en"> <head> <link rel="stylesheet" type="text/css" href="main.css"> <title>form test</title> </head> <body> <center> <h1>form test</h1></center> <div class="navigation"> <nav> <a href="secondform.html">second form submission</a> </nav> </div> <p>upon clicking submit button, populated fields should send field data second form emailed someone.</p> </body> <div id="message"> </div> <form name="form_sim

java - Using maven in scripts or adding a script-runner task at the end -

i'm using maven on both mac , linux build .war file website. i'd know best way automatically run script deploy website server after build. what doing have deploy.sh script run mvn -p<profile> clean package and bunch of ssh / scp stuff copy target/file.war web server , run bunch of commands start/stop tomcat - clean out logs etc. problems although various stack posts using $? supposed catch error code maven have yet working , if reason have bad maven build have no way detect it. not deploy tasks if build fails. options? 1) there correct way detect bad "build" maven , have script abort (i guess check if war doesn't exist ...??) 2) there maven "plugin" handle me, , if provide small code example. i 2 things in shell script calls maven , deployment commands: test whether war file exists before attempting deploy it, suggest yourself; save maven output timestamped log file reference.

javascript - How can we add the static label for select2 -

in application using select2 plugin drop-down multiple select values. , want add static option select2 drop-down. <select multiple="" class="test"> <option value="a">illustrations</option> <option value="b">maps</option> <option value="add">add status</option> </select> and applying multi select, when click on add status option want functionality , option not selected option. and js code : $('.test').select2(); $('.test').on("select2-selecting", function(e) { alert($(".test").val()); }); but alert giving selected values a,b,add . want 'add' option only. please suggest me how can this. thanks in advance. try this: alert($(".test option:selected").val());

python - Ajax: Unable to send Json object to bottle webservice -

i trying understand how ajax call works. i sending json object bottle python webservice url. $.ajax({ type: "post", data: {"jstring": json.stringify(output)}, url: "http://localhost:8080/salesvolume" , contenttype: "application/json; charset=utf-8", datatype: "json", success: function(data){ $('#container').highcharts(data); }, error: function() { alert("something not ok") }, }); the above snippet ajax call. output json object intend send server. @app.post('/salesvolume') def salesvolume(db): jsonstring = request.forms.get('jstring') _jsonparams = json.loads(jsonstring) _studios = _jsonparams.studios ret = `some json` return json.loads(ret) app.run(server='paste', host='

ruby - How to work with not (yet) registered devise Users -

i have user model, login , registration, email field used (everything vanilla devise gem). i want (other) users able e.g. add users team, email-address identifier. that fine when user existing (pseudo @team.users.add(user.find_by(email: other_users_email)) ) unsure how handle situations user not yet exist (did not [yet] register). when (new) user sets new account, example above after successfull registration current_user.teams should show correctly. i not want force these potentially new users use system (e.g. using devise_invitable) , bother them email. i followed path of creating user when user given email not yet exist, when user tries setup account, fails (email not unique). alternatively, remodel teammember-part , let optionally either store email-adress or reference existing user. need check "open" teammembers directly after user-account-creation (so, teammembers given email). on each requst, looks expensive me. there might race conditions, live (and che

How to extract the Android NDK package? -

my os centos 32-bit. i want extract package 7-zip, install 7-zip rpm without error. when extract ndk package,it doesn't work. this: [root@localhost ~]# ls anaconda-ks.cfg jni-test android-ndk-r10e-linux-x86.bin p7zip-9.20.1-1.el5.rf.i386.rpm install.log p7zip-plugins-9.20.1-1.el5.rf.i386.rpm install.log.syslog [root@localhost ~]# 7z x android-ndk-r10e-linux-x86.bin 7-zip 9.20 copyright (c) 1999-2010 igor pavlov 2010-11-18 p7zip version 9.20 (locale=zh_cn.utf-8,utf16=on,hugefiles=on,1 cpu) processing archive: android-ndk-r10e-linux-x86.bin error: can not open file archive according google's official document operation: [root@localhost ~]# ll 总用量 307344 -rw-------. 1 root root 1096 6月 25 17:41 anaconda-ks.cfg -rwxr-xr-x. 1 root root 309844799 6月 25 21:24 android-ndk-r10e-linux-x86.bin -rw-r--r--. 1 root root 9119 6月 25 17:41 install.log -rw-r--r--. 1 root root 3091 6月 25 17:41 install.log.syslog drwxr-xr-x.

search - Solr: Apply faceting when query contains particular terms -

i have database of product information indexed name, type, manufacturer, etc. users submit search queries results contained neatly in 1 or more facets. when situation arises, solr parse query , apply relevant facets. for example, searching shoes should return results in shoe category. more ambitiously, searching plaid shirt should query plaid on items in shirt category. is possible configure solr this? thanks in advance. asking solr want tall order. best bet store categories in field weighted highly. example, if have category field value of "shoes", having hit on field increase relevance of documents on category, having them show first. same goes second example. as faceting, question not clear on how want apply faceting.

postgresql - PgAgent jobs not executing on remote server -

Image
i don't understand why isn't working, set pgagent job send notify database every hour the steps the schedule turns out problem heroku doesn't support agagent , database running on heroku, ended making work around scheduling tasks using windows task scheduler - it's not best solution job needed do...

javascript - External URL in Nav menu not working -

i'm trying menu link redirect target=_blank won't seem work. works if put code in own html file, not when on site it "example" menu link having trouble with. <!-- nav --> <nav id="navigation" class="animated fadeinupbig shadow"> <ul id="nav"> <li class="current shadow"><a href="#section-1">home</a></li> <li class="shadow"><a href="#section-2">about</a></li> <li class="shadow"><a href="#section-3">services</a></li> <li class="shadow"><a href="#section-4">events</a></li> <li><a href="http://www.google.com" target="_blank">example</a></li> <li class="shadow"><a href="#section-6">contact</a></li> </ul> he

cakephp - CakePHP3.x fetching associated data from controller -

i have relations postcategory hasmany posts , post hasone user. here code fetches posts not able users data each post. $parents = $postcategories->find('all',[ 'fields'=>['postcategories.id','postcategories.name'], ])->contain(['posts'=>function ($q) { return $q->select(['id', 'title','postcategory_id']) ->where(['posts.active' => 1]) ->order('posts.created desc') ->limit(5) ;}]) ->where(['postcategories.parent_id null','postcategories.active'=>1]) ->hydrate(false)->toarray(); also want 5 latest posts each category. code fetches 5 posts first category , blank array remaining categories.

java - Javassist: creating an interface that extends another interface with generics -

i using javassist in project , need create following interface @ runtime: package com.example; import org.springframework.data.repository.crudrepository; import com.example.cat; public interface catrepository extends crudrepository<cat, long> {} while had no problem creating interface catrepository extending crudrepository , not understand (from docs , looking @ source code), how specify com.example.cat , java.lang.long generics types super-interface. please note that: com.example.cat : created @ runtime using javassist (no problems that, have tested , works org.springframework.data.repository.crudrepository : existent class library. if 1 great! thanks! luca short answer the generic information can manipulated in javassist using signatureattribute . long answer (with code) the code have this: classpool defaultclasspool = classpool.getdefault(); ctclass superinterface = defaultclasspool.getctclass(crudrepository.class .getnam

Specfically, how does an EMV device talk with the card issuer? -

when doing emv online transaction (arqc), emv device needs communicate issuer (or gateway) approval/denial. writing pos software , need support emv, need support interaction. can't seem answer is, part of emv specification emv device communicate directly issuer, on internet? or need looking sort of send function in device's api? i know question directed @ hardware manufacturer's design, have read few api's different emv devices , non of them seem detail communication. of them have function initialize emv capabilities (with transaction amount) , callback/event when transaction completed. leads me believe need provide internet connection device , magic happen. as followup that, see devices have usb communications (instead of ethernet). these devices (obviously) couldn't talk directly outside network. safe assume these devices going every emv transaction offline? or missing something? as far have come understand, emv covers finer details of communicati

c++ - ifstream - Read last character two times -

when reading chars textfile dont know why last character read 2 times? if insert new line row no longer read 2 times. heres class class readfromfile { private: std::ifstream fin; std::string allmoves; public: readfromfile(std::string filename) { fin.open(filename, std::ios::in); char my_character; if (fin) { while (!fin.eof()) { fin.get(my_character); allmoves += my_character; } } else { std::cout << "file not exist!\n"; } std::cout << allmoves << std::endl; } }; and heres content of textfile (without newline) 1,2 3,1 1,3 1,2 1,4 and output: 1,2 3,1 1,3 1,2 1,44 you need check fin after fin.get . if call fails (as happens on last char) keep going, despite stream being on (and my_character invalid) something like: fin.get(my_character); if (!fin) break ;

Android same attribute name in two libs, name collision -

i'm using 2 3rd party libs, both use same attribute name in attrs.xml. build fails with: attribute "tabbackground" has been defined is there way work around collision without modifying argument name in 1 of libs? actually no. i suppose have dependency project b. when build main project in eclipse, resources fail build , error printed out in android console: "... error: attribute "icon" has been defined" . actually have 2 ways : remove dependency project b or change attribute name of project also if build project gradle can use this article explains how merge resources.

Openam and OpenDJ Integration issue: authorization failure -

i using openam12 , opendj2.6 version configure single sign on. while trying make openam12 , opendj2.6 communicate getting following exception: [error] handleexception: java.lang.runtimeexception: error occurred invoking public method: public boolean com.sun.identity.config.wizard.wizard.createconfig() @ org.apache.click.util.clickutils.invokemethod(clickutils.java:3335) @ org.apache.click.util.clickutils.invokelistener(clickutils.java:2088) @ org.apache.click.control.abstractcontrol$1.onaction(abstractcontrol.java:228) @ org.apache.click.actioneventdispatcher.fireactionevent(actioneventdispatcher.java:259) @ org.apache.click.actioneventdispatcher.fireactionevents(actioneventdispatcher.java:236) @ org.apache.click.actioneventdispatcher.fireactionevents(actioneventdispatcher.java:180) @ org.apache.click.clickservlet.performonprocess(clickservlet.java:746) @ org.apache.click.clickservlet.processajaxpageevents(clickservlet.java:1860) @ org.apache

android studio - Block gradle release-build if git is not committed -

i need gradle.build throw gradleexception if have files isn't commited git, when make release build. i have been trying way: android { buildtypes { release { prebuild.dependson('verifyversioncontrol') } } } task verifyversioncontrol { def cmd = "git diff-files" def proc = cmd.execute() ext.status = proc.text.trim() dolast { if (!(ext.status == "")) throw new gradleexception("git not clean, commit changes before running release build") } } but code trigger when run application through androidstudio.

jquery - CSS background-image reference in javascript using codigniter -

i working in codeigniter folder structure that. application assets css js img system index.php i've make bootstrap carousel full window height. approach make div.item layer full height of window using jquery. remove image div.item layer , set image div.item background image using jquery. here jquery code. $('.carousel').find('.item img').each(function () { var $this = $(this), src = $(this).attr('src'); imagename = 'url(assets/img/' + $(this).attr('src').split('/')[6]+')'; $this.parent().css('background-image',imagename); $this.remove(); }); my reference in not working please let me what's wrong code. your should use full reference. try this. $('.carousel').find('.item img').each(function () { var $this = $(this), src = $this.attr('src'); $this.parent().css('background-image',src); $this.remove(); });

css - JavaScript NOT operator on Boolean -

so got piece of code work, i'm having trouble understanding why works. css has sprite sheet animates box morphing circle. the animation-play-state : paused; rule in css keeps sprite starting animation till key pressed see in javascript code. my question why if execute code block when keycheck false . knowledge of how ! operator works, isn't code suppose execute when keycheck "not" false ? initial value false why run ? the code suppose stop event executing repeatedly when key held down. keycheck = false; window.addeventlistener("keydown", checkkey_dn, false); window.addeventlistener("keyup", checkkey_up, false); function checkkey_dn(e) { if(e.keycode == "83" && !keycheck){ keycheck = true; $("boxmorph").style.animationplaystate = "running"; $("boxmorph").style.webkitanimationplaystate = "running"; $("boxmorph").style.visibility

javascript - Loading arrays through select2 with text containing HTML-entities are not showing as the special characters -

<!doctype html> <html> <head> <meta charset="utf-8" /> <title>test</title> <link rel="stylesheet" type="text/css" href="stylesheet.css" /> <link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.0/css/select2.min.css" rel="stylesheet" /> </head> <body> <div> <select style="width: 50%" id="div"> </select> </div> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.0/js/select2.min.js"></script> <script type="text/javascript" src="javascript.js"></script> </body> and in javascript: $('select').select2(); array = [ { id: 0, text: "&mu;" }, { id: 1,

ios - How to rotate the navigation image according to the user direction in MKMapView? -

Image
i show user's current location while toggling location mode on free ride in simulator. it's working fine, take @ image below: i want image rotate direction of route changes. how can that? here can download project. have not implemented route on below project, changed arrow's direction towards route. if understand question correctly, want arrow aligned path drawn in map, @ every position on path. what i'd create cakeyframeanimation path property set path on map, , rotationmode set kcaanimationrotateauto . add animation image view containing arrow. once you've added animation, set imageview.layer.speed = 0 , control imageview.layer.timeoffset move arrow. value goes 0 1, , interpolates position on path. coreanimation automatically rotate view in tangential direction path @ every point.

ruby - How to export models to a CSV file using Rails 3? -

i'd export database entries csv using rails 3.2. i've been following these instructions: my controller: edit: i've changed class method instance method ... elsif params[:reference] == 'exportnews' @data = news.find(:all, :order => "date_posted desc", :conditions => "#{settings.show} = 1", :limit => "5") respond_to |format| format.html { redirect_to root_url } format.csv { send_data @data.to_csv } end else ... my model: class news < activerecord::base attr_accessible :content, :date_posted, :heading, :hidden, :reference, :title, :user def to_csv(options = {}) csv.generate(options) |csv| csv << column_names all.each |product| csv << product.attributes.values_at(*column_names).map(&:to_csv) end end end end yet when visit specified url (i've created route in config/routes.rb csv file f

c++ - What is the difference between passing a pointer to function and passing reference of pointer to function? -

so, have structure struct node { node * l; node * r; }; then, there is typedef node* tnode; what don't understand function: void tsplit(tnode t, tnode &l, tnode &r, int x) as it, pass t tsplit() pointer structure, pass 2 references of pointers structures of same type. why can't pass pointers instead of references? makes sense? yes makes sense. can treat references pointers (with restrictions). change references pointers in example. of course syntax change in the, don't need bother it. example like: void tsplit(tnode t, tnode *l, tnode *r, int x) so difference is, can modify under l , r not t , typedef abstracts it, can expand it: void tsplit(node* t, node** l, node** r, int x) now, meaning can change under t , cannot change t itself, can l , r . in other words, cannot change reference target of t , can r , l , because have reference reference (or pointer pointer). why use references on pointers? because pointers can

xampp - RecursiveDirectoryIterator error joomla -

im getting error have idea hove solve. im getting error after saving slider images joomla page: recursivedirectoryiterator::__construct(c:\xampp\htdocs\bondenssliderdsimagesds,c:\xampp\htdocs\bondenssliderdsimagesds): how solve this? it's have problem "ds constant". per joomla documentation ds(directory separator) constant has been removed version 3.x. if using custom component uses "ds" generate error it's not defined in library. resolve issue either can tried define : if(!defined('ds')) define('ds', directory_separator); added main .php file of components/plugin or module. or can directly install following plugin: http://extensions.joomla.org/extensions/extension/core-enhancements/performance/ds-constant

php - Can't get access to database in user access class -

i'm new in oop , access class db in user_access class. can't, error , can't figure out why errors that: warning: mysqli_query() expects parameter 1 mysqli, object given in c:\xampp\htdocs\brothers.traning\profiadmin\models\login_class.php on line 20 notice: trying property of non-object in c:\xampp\htdocs\brothers.traning\profiadmin\models\login_class.php on line 21 not this database class: class db { public function db() { $db = new mysqli(db_server, db_username, db_password, db_database); if (mysqli_connect_errno()) { echo "error: not connect database."; exit; } } } and im user_access class: class user_access{ public function __construct($db){ $this->db = $db; } public function check_login($login,$password){ $password = sha1($password); $sql = "select * admins username = '$login' , password = '$password'";

node.js - Getting the difference of two differently structured collections -

supposed have 2 collections, a , b . a contains simple documents of following form: { _id: '...', value: 'a', data: '...' } { _id: '...', value: 'b', data: '...' } { _id: '...', value: 'c', data: '...' } … b contains nested objects this: { _id: '...', values: [ 'a', 'b' ]} { _id: '...', values: [ 'c' ]} … now can happen there documents in a not referenced document in b , or there referenced documents in b not existent in a . let's call them "orphaned". my question is: how find orphaned documents, in efficient way? in end, need _id field. so far have used unwind "flatten" a , , calculated difference using differencewith function of ramda , takes quite long time , sure not efficient, work on client instead of in database. i have seen there $setdifference operator in mongodb, did not work. can point me right direction, ho

javascript - Bookmark to check published date -

do of know how make bookmark check website published date. want go website , press bookmark , in bookmark this. google.com/search?q=inurl:{{ website url of active page }}&as_qdr=y15 this way can check via google whats publish date of website. is there somekind of javascript code copy's website's url make happen? i managed figure out on own. use code see publish date in google. you can save bookmark check. it comes handy fill apa details. javascript:void(location.href=' http://google.com/search?q=inurl :'+escape(location.href))+'&as_qdr=y15'

Adding a link in an array in PHP using href -

this question has answer here: php parse/syntax errors; , how solve them? 11 answers i developing plugin moodle , have add data table created. this code: <?php $table = new html_table(); $table->head = array('id', 'name', 'programme', 'edit', 'delete'); $table->data[] = array('cse1010', 'intro it', 'bsc acc, mgt', ?> <a href="edit.php"><u>edit</u></a> <?php); $table->data[] = array(); echo html_writer::table($table); echo "... php data handling code"; echo $output->footer(); ?> i having problems add link inside table. this part of code giving me error: $table->data[] = array('cse1010', 'intro it', 'bsc acc, mgt', ?> <a href="edit.php"><u>edit</u></a> <?php)

java - Spring unit test objects autowired with null fields -

i'm attempting create unit tests rest service in spring servlet. when controller object created @autowire, of @autowired fields null. my test class follows, using springjunit runner , context configuration set @contextconfiguration(locations = "examplerestcontrollertest-context.xml") @runwith(springjunit4classrunner.class) public class examplerestcontrollertest { @autowired private baseservice mockexampleservice; @autowired private examplerestcontroller testexamplerestcontroller; the examplerestcontrollertest-context.xml sets service mocked , injects mocked object controller <context:annotation-config/> <import resource="classpath*:example-servlet.xml"/> <bean id="mockexampleservice" class="org.easymock.easymock" factory-method="createmock"> <constructor-arg index="0" value="za.co.myexample.example.services.baseservice"/> </bean> <bean id="

javascript - mobile site Scroll issues -

im building website www.nutcraft.co.uk/shop.html , behaving ok in normal browsers, when viewed in mobile browsers not scroll , content locked @ top of screen. ive read around trying figure fix out @ loss. ( know have clean div tags etc, im more of designer coder , head spinning)!!! any appreciated. you have inline style body overflow:hidden in mobile view. added grid system's javascript (you using called 5grid). either there problem grid system javascript, or missing component. not familiar 5grid, not able whether grid system robust or not. i tried find out more , didnt find online it. without documentation, there nothing can except guess grid system wasn't tested cross mobile maybe? seems use lot of touch based javascript. if me have preferred media queries on javascript solution when comes making site responsive. if still want use grid system, can add css style with: overflow:visible !important; to body tag. should solve problem hopefully. please ch

Symfony 2 cache stuck after config change (FileLoaderException) -

Image
very strange behavior in sf2 here. i've try change config namespaces while refactoring code: adadgio_rocket: foo: 'bar' to simple adadgio: rocket: 'bar' i have change bundle di configuration nodes reflect change : $rootnode = $treebuilder->root('adadgio'); $rootnode->children() ->scalarnode('rocket')->end() ->end(); now have fileloaderloadexception still saying able load configuration adadgio still finds adadgio_rocket namespace (error results). i tried clear cache thinking issue, of course, symphony cache command issues same error. , still finds other config namespaces removes (and declaration in appkernel well). basically, stuck now. yes, sort of stuff can happen. delete app/cache/dev directory , run app/console cache:clear again. if still doesn’t work, make 100% sure there no remainders in config or referenced in other bundles. if unsure, check: grep -ir adadgio app/config/ src/ v

web - The ability to create Doc element of hypertext in Websharper.UI.Next -

i have string html markup, want cretae doc elment this: doc.fromhtm "<div><p>.....</p>.....</div>" as understand not possible right now. ok, not possible accurately sew, tried nail using jquery: jquery.jquery.of( "." + class'name ).first().html(html'content) but call code, need specify event handler doc element. not implemented in ui.next. tried track changes of model given css class asynchronously: let inbox'post'after'render = mailboxprocessor.start(fun agent -> let rec loop (ids'contents : map<int,string>) : async<unit> = async { // try recive event new portion of data let! new'ids'contents = agent.tryreceive 100 // calculate state of agent let ids'contents = // merge map's ( match new'ids'contents | none -> ids'contents | (ne

qt - QSystemTrayIcon notification message with custom icon -

qsystemtrayicon has function : void showmessage(const qstring &title, const qstring &msg, messageicon icon = information, int msecs = 10000); is there way change custom icon , example - void showiconmessage(const qstring &title, const qstring &msg, qicon icon = qicon(), int msecs = 10000); without modifying qt sources i know showmessage (d instance of qsystemtrayiconprivate , called q_d(qsystemtrayicon) macro) void qsystemtrayicon::showmessage(const qstring& title, const qstring& msg, qsystemtrayicon::messageicon icon, int msecs) { q_d(qsystemtrayicon); if (d->visible) d->showmessage_sys(title, msg, icon, msecs); } calls showmessage_sys qsystemtrayiconprivate in turn magic icon happens: void qsystemtrayiconprivate::showmessage_sys(const qstring &message, const qstring &title,

python - Sort three dimensional numpy array with two axes sorting constraints -

i have 3 dimensional numpy array sort. an example of array given by: arr = numpy.array([[4., 5., .1], [-2., 5., .3], [-1., -3., .2], [5, -4, .1], [2., 2., .25], [-2., 0., .1], [-1.5, 0., .1], [1., -3., .1], [-2., 8, .1]]) lets convenience call 3 dimensions x , y , , z , respectively. sort array based on value of y in decreasing order. know can by arr[arr[:, 1].argsort()[::-1]] however, second constraint multiple occurrences of same y -value sort along x in increasing value. values of x , y can both negative. i have tried sorting first along x , along y hope x order remain in tact. unfortunately not case. the sorted array of arr should given by sorted_arr = numpy.array([[-2., 8, .1], [-2., 5., .3], [4., 5., .1], [2., 2., .25], [-2., 0., .1], [-1.5, 0., .1], [-1., -3., .2], [1., -3., .1], [5, -4, .1]]) since actual array big not want use for loops. how can sort array? one way use np.lexsort sort second column followed first column. since sorts valu

swift - Error: "HttpGetData.Type doesn't have a member named 'url'" -

i want test http post, shows error: httpgetdata.type 'doesn't have member named 'url' when type on viewcontroller works? is initialize problem? import foundation public class httpgetdata{ let url = nsurl( string: "https://210.61.209.194:8443/smarttvwebservicetopmsoapi/") let request = nsmutableurlrequest((url : url)!) request.httpmethod = "post" let poststring : string = "id=13&name=jack" request.httpbody = poststring.datausingencoding(nsutf8stringencoding) let task = nsurlsession.sharedsession().datataskwithrequest(request) { data, response, error in if error != nil { println("error=\(error)") return } println("response = \(response)") let responsestring = nsstring(data: data, encoding: nsutf8stringencoding) println("responsestring = \(responsestring)") } task.resume() }

java - Selenium Web Driver and OpenLayers 2.x: how to do a identify on a map? -

Image
i've test web mapping application use openlayers 2.x, using selenium web driver in java , using firefox (i'm on windows 7). i've found issue how use openlayers drawfeature selenium webdriver in java (double click issue)? doesn't solve problem. i've have test identify function on features on map, so: 1) select identify button on toolbar (i'm able ... no problem ...) 2) click on point feature on map (i'm not able ....) 3) close dialog shows feature descriptive data (i'm not able ....) i can't give url of application it's not public can use simple test case http://dev.openlayers.org/releases/openlayers-2.13.1/examples/markers.html that shows use case. clicking on map, you'll see feature details , close dialog. here you're code doesn't work package mytestprojects; import java.util.concurrent.timeunit; import org.openqa.selenium.by; import org.openqa.selenium.webdriver; import org.openqa.selenium.webelement; im

c# - dotnet compiled matlab code in matlab -

for 1 of our projects migrated matlab codebase .net. of code reprogrammed, once function decided complicated instead used matlab dot net compiler generate dll can invoke c# code. so far good, c# code runs fine. however, legacy matlab code requires run, need access newly migrated functionality matlab. i add dll's matlab using net.addassembly(..) command, works of pure c# code base, fails when compiled matlab function invoked:- the type initializer 'mathworks.matlab.net.arrays.mwnumericarray' threw exception. innerexception: type initializer 'mathworks.matlab.net.arrays.mwarray' threw exception. innerexception type initializer 'mathworks.matlab.net.utility.mwmcr' threw exception. innerexception trouble initializing libraries required builder ne.\n any ideas whats going wrong here?

In R, how can I determine the operator precedence of user defined infix operators? -

suppose have 2 custom infix operators in r: %foo% , %bar% . i have expressions use both operators, such as: x %foo% y %bar% z how can determine operator precedence of %foo% , %bar% ? how can change precedence that, example, %bar% executes before %foo% ? in example above same as: x %foo% (y %bar% z) i don't think explicitly documented, implicit in r language documentation infix operators of equal precedence , executed left right. can demonstrated follows: `%foo%` <- `+` `%bar%` <- `*` 1 %bar% 2 %foo% 3 #5 1 %foo% 2 %bar% 3 #9 the option can think of redefine 1 of existing operators wanted. however, have repercussions might want limit within function. it's worth noting using substitute not change operator precedence set when expression first written: eval(substitute(2 + 2 * 3, list(`+` = `*`, `*` = `+`))) #10 2 * 2 + 3 #7

javafx - How to access @FXML components of one controller from another controller? -

i using afterburner build simple application. have 3 packages package main , package inwards , package outwards . main.fxml has anchor pane in loading inwards.fxml @ application start. now inwards.fxml has button action load outwards.fxml in anchor pane of main.fxml . but doing giving me null pointer exception . thank you.

android - Push notification from server to client using UDP -

we want build simple data sharing application 2 android mobiles (or computers) connected on internet (wifi/network) upload , download data server through https. e.g. wants send data b. trigger "put" https api , upload data bucket of b. b call "get" https api , download content. now issue communication between , b demand based. can happen after minutes, hours or days. if go https way, have keep b in long polling server eat out resources days when there no message. if poll every minute or 2 communication not happen in near real time. to counter problem, have come following idea: whenever mobile registers internet, creates udp port , binds it it makes 1 time https connection server , sends ip address , port there can optional dummy data exchange between server , client using udp (to , from) after client doesn't have active connection , remains on same internet; continuously waits on udp port data received; if internet changes again repeat step-1 w

swing - how to close a JFrame class with a button in another JFrame class in java? -

i have 2 jframes ( framea , frameb ). frameb can opened framea , when open frameb , framea must left open. frameb has got button ( close_framea ). when button clicked close framea . how can it? you can use below 2 class: tjframe , openframe close jframe class button in jframe public class tjframe { public static openframe openwindow; public static void main(string[] args) { jframe frame = new jframe("swing frame"); jbutton button = new jbutton("open"); frame.add(button); button.addactionlistener(new actionlistener() { @override public void actionperformed(actionevent e) { openwindow = new openframe(); openwindow.setvisible(true); } }); frame.setdefaultcloseoperation(windowconstants.dispose_on_close); frame.setsize(350, 200); frame.setvisible(true); }} public class openframe extends jframe{ jpanel back_panel; public jbutton button = new jbutton("cross&

javascript - How to stop the child from inheriting the parent opacity -

i having trouble figure out how stop child elements inheriting parent opacity. i know has been answered before, setting background instead of opacity values. scenario different in sense have use fade in effect in sticky headers contain child elements. when add fade in, children gets same effect. here test code: $('.nav-items').css('opacity', '0.3'); var top_nav = $("body, html").scrolltop(); (function () { var $win = $(window); $win.on('scroll', function () { var header = $(".nav-items"); if ($(this).scrolltop() > 40) { if (!header.data('faded')) header.data('faded', 1).not('nav-item li').stop(true).fadeto(400, 1); } else if (header.data('faded')) { header.data('faded', 0).stop(true).fadeto(400, 0.3); } }); }).call(this); body { margin:0; padding:0; } .nav-items { font-we