Posts

Showing posts from September, 2011

javascript - How to convert website into multi language using AngularJs -

my approach translating 1 time when applied on element on angular template when applied multiple directive template making multiple time api call how avoid it. solution please comment var directive = { restrict: 'ae', scope: false, multielement: true, link: link }; $rootscope.cityname = cookieservice.getcookie('lang'); $rootscope.translatethese = []; $rootscope.translationdata = ''; $rootscope.translationcounter = 0; function link(scope, element, attr) { scope.$evalasync(function() { $rootscope.translatethese.push(element[0]); scope.$on('translateapisuccess', function(e, data) { angular.foreach($rootscope.translatethese, function(elem) { var translatedstring = $rootscope.translationdata[elem.innerhtml.trim().tolowercase()]; elem.innerhtml = translatedstring; // $compile(element....

jdbc - How to import data into Apache Solr index from LDAP -

i have ldap-server contains large set of user data , import apache solr index. question not whether idea or not (as discussed here ). need kind of architecture 1 of our production systems depends on solr index of our ldap data. i'm considering different options so, i'm not sure 1 should preferred: option 1: use apache solr dataimporthandler : this seems straight forward solr way of doing so. unfortunately there not seem datasource available work ldap. i tried combine jdbcdatasource jdbc-ldap-bridge . in theory might work driver looks quite dated (latest version 2007). another option might write custom ldapdatasource using of ldap-libraries java (probably spring ldap , directly via jndi or similar?). option 2: build custom feeder: another option might write standalone service/script bridges between 2 services. feels bit reinventing wheel. option 3: haven't thought of yet: maybe there additional options here haven't discovered yet. solved wr...

php - Insert newly created id value into the column of another table as Foreign key -

hello php , mysql noob here i'm creating form create new user , @ same time add contact user , contact in 2 different table and need newly user_id reference user_id (fk) in tbl_contact how it? first of insert user mysql_query("insert tbl_user (...) values (...)"); then retrieve last inserted id $liid=mysql_insert_id(); then insert contact id mysql_query("insert tbl_contact (user_id,...) values ($liid,...)"); refrence if want use mysqli $mysqli->query("insert tbl_user (...) values (...)"); $liid=$mysqli->insert_id; $mysqli->query("insert tbl_contact (user_id,...) values ($liid,...)");

arrays - Global Variable Not Working in Swift -

i have created small tabbed view program uses tabs switch between 2 views. there 1 global variable called list array containing information both views need access , change. however, when try use nsuserdefaults save array future use in app after closed, got error saying: "cannot convert value of type 'array<_>' expected argument type 'anyobject?'". here code second view: @iboutlet weak var reminder: uitextfield! @iboutlet weak var label: uilabel! override func viewdidload() { } @ibaction func submit(sender: anyobject) { if reminder.text == "" { label.text = "please type reminder!" } else { list.append(reminder.text!) reminder.text = "" label.text = "add reminder" } // below line giving error!!!!! // fact using variable "list" nsuserdefaults.standarduserdefaults().setobject(list, forkey: "reminders") } override func didreceivememor...

network programming - How do I make my automated Client-Server Java networking code output in the correct sequence? -

Image
let me start saying know lot of code, , please bear me. working on project, i'm porting oracle's knock-knock client/server example state-capital example. instead of knockknock jokes, runs series of state-capital queries. runs : server: may have permission send state-capital query? client: ok server: send me state , can send capital? client: alabama server: capital of alabama hunstville . want 1 (y/n) ? client: n the motivation doing project later demonstrate type of fail-safe ability (after work want use powershell , use run client-server single unit). back code. when run it's giving me following output, not i'm looking for. supposed synchronized client , server working on 1 state @ time. instead, client-side jumping ahead of server side, , isn't reaching last state of wyoming. tried add in synchronization as per question . i've linked full code on pastebin fixedmessagesequenceclient fixedmessagesequenceserv...

c++ - combining cv::remap and cv::warpAffine to simultaneously correct fisheye and roll effects -

looking @ cv::remap , can use de-fisheye image have translation table have prepared earlier particular model of lens, , use cv::warpaffine correct camera roll , suspect there significant cumulative loss of quality doing 2 operations sequentially versus combining both operations. unfortunately, maths aren't working out how preprocess maps, can help? (note, require opencv 2.x solution, not 3.x)

Can't import project with "android-support-v7-appcompat which resolves" error -

i can't import project https://www.dropbox.com/s/182zpz7acu5opyo/com.resulam.android.nufitchamna_nufi_francais_nufi_prototype.zipp.rar?dl=0 this full error project com.resulam.android.nufitchamna_nufi_francais_nufi:c:\users\gaewgan\desktop\dic\dics\project.properties: library reference ..\android-support-v7-appcompat not found path c:\users\gaewgan\desktop\dic\dics..\android-support-v7-appcompat resolves c:\users\gaewgan\desktop\dic\android-support-v7-appcompat how solve it? you missing appcompat-v7 library project have import workspace on top of existing project. more information refer these existing guides: for android studio: https://developer.android.com/tools/support-library/setup.html#add-library for eclipse: cannot add library android project in eclipse

datastax - Modelling Cassandra from XML & C# -

i beginner cassandra. finding difficult model xml file attached. my requirement is: i many xml files given below on daily basis. need write c# program read xml , store in cassandra. once stored, data read 1000's of customers 1000's of times. once data stored, not updated again. note: possible each parent node (ex: customer/site...) may appear more no. of times. i.e may have customer2, site2, equipmentdetails node etc. my xml: <?xml version="1.0" standalone="yes"?> <myanalystxmlreport> <mc-domainid id="xyz123"> <customer name="customer1" id="53043"> <site name="site1" id="488688"> <equipmentdetails> <equipmentdescription>test desc</equipmentdescription> <equipmentrefid>t3567111</equipmentrefid> <componentdescription>com oil</componentdescription> <componentrefi...

javascript - Update JS references in HTML page for different environments -

i have 2 types of generated js files: xyz.js xyz.min.js i want refer both @ different times, different environments. currently need update references manually, there large number of js files: there technique avoid manual updating. possible? using gruntjs, have multiple choices solve problem: 1. point 1 single file in html , switch version/type get's compiled different folders depending on environment (by having @ least 2 grunt-tasks): grunt build:dev , grunt build:live 2. use grunt-processhtml package. again depending on environment require different targets . (untested): ``` <!-- build:dev --> <script src="js/lib/path/lib.js"></script> <script src="js/deep/development/path/script.js"></script> <!-- /build --> <!-- build:dist --> <script src="js/app.min.js"></script> <!-- /build --> ``` there grunt-targethtml or grunt-preprocess or grunt-htmlrefs ...

android - Extending a view which overrides onMeasure() -

i have view view1 extends framelayout , overrides onmeasure() this, rendered square: @override protected void onmeasure(int widthmeasurespec, int heightmeasurespec) { super.onmeasure(widthmeasurespec, widthmeasurespec); } now want create view view2 extends view1 , want view2 have height equal parent, , hence cover full screen. of now, square too. how achieve this? in view 1: private boolean measureassquare = true; @override protected void onmeasure(int widthmeasurespec, int heightmeasurespec) { if (measureassquare) { super.onmeasure(widthmeasurespec, widthmeasurespec); } else { super.onmeasure(widthmeasurespec, heightmeasurespec); } } public void setmeasureassquare(boolean b) { measureassquare = b; } in view2 constructor subclasses view 1: public view2(context c) { setmeasureassquare(false); } then can use normal layout weight , height view 2 assign preferred size.

swift - Automatically restore last saved document on application launch -

i have core data document based application written in swift , using storyboards. whenever build , launch app, instead of automatically opening last opened document(s), create new document. want able have application automatically restore whatever documents last opened on application launch, if available. how can this? os x has feature called resume. want. way allow user decide wether open new documents or open existing ones on launch. you can find starting point here . use find command locate resume part. found example here.

sublimetext2 - Sublime Text 3 Highlighting Jquery Angular Syntax Issue -

Image
after updating sublime text 2 sublime text 3, have experienced issues highlighting of variables in case of angular or jquery elements no longer having highlight of pink (using monokai theme; default) has experienced issue or know way resolve this? these variables have, normal javascript syntax, scope variable.other.dollar.js . scope variable , variable.other have no highlighting in monokai colorscheme. if want add highlighting on own, can modify colorscheme. recommend package resource viewer . press ctrl+shift+p , select packageresourceviewer: open resource , navigate monokai colorscheme. open colorscheme xml file. if save it, not change existing 1 (which read in zip folder), create in packages folder. colorscheme shadow existing one. add following entry @ reasonable position , variables should highlighted pink: <dict> <key>name</key> <string>jquery variable</string> <key>scope</key> <string>variable...

django - Submit to form without relying on URL -

okay appears i'm in way on head on small task. i'd ask how 1 submit form, without relying on url values? in example, user has log in before can see gallery pictures. determining via "context", has active user (as logged in) assigned it. props @chem1st & @daniel-roseman assistance earlier in helping me figure out yesterday. can display own user gallery in homepage after log in. i prefer not uploading "blahblah.com/bobby/upload", because doesn't seem secure. i'd let logged in users upload via "blahblah.com/upload/". means form in view.py have context of user who's logged in, somehow, , save data database under account. i've been toying around, , searching answers, can't find anything. can point me in right direction? here's models.py class userprofile(models.model): user = models.onetoonefield(user) activation_key = models.charfield(max_length=40, blank=true) key_expires = models.datetimefield(def...

regex - Replace < and > symbols with &lt; and &gt; symbols in HTML String -

i want regular expression replace < , > symbols &lt; , &gt; in html text , make valid xml. example string: <html><body><p style="margin:0px">his <span style="color: rgb(237, 23, 23);">career </span>spanned development of cinema, <span style="font-weight: 700;">silent film</span>, through experiments in <span style="text-transform: uppercase;">technicolor </span>to filmmaking in 21st century.​</p><p>his career spanned development of cinema, silent film, through experiments in technicolor filmmaking in 21st century.<this sample></p>​</body></html> result: <html><body><p style="margin:0px">his <span style="color: rgb(237, 23, 23);">career </span>spanned development of cinema, <span style="font-weight: 700;">silent film</span>, through experiments in <span style=...

jquery - CSS3 Animate It changes position and width properties for some elements on mobile devices -

i have weird problem of blog post pages, eg. http://www.stgobsas.dk/blog/buenosaires/index.html the problem seems css3 animate plugin. seems work great when viewing in desktop browser of width (i have tested down 400 px). when view on mobile device (and through chrome's developer tools using device mode) changes position property of <header> , .header-image fixed "not fixed" , makes header/menu bar take more horizontal space, eg. 760 px .main-wrapper takes 375 px should (this iphone 6). don't understand why problem occurs on mobile browsers, , not on desktop browser though window width same. have @ bottom of script.js file. second last code block blog pages , causes problem. last code block front page , causes similar problem, width of header/menu bar shrinks while animation goes on , ends being fine again. update: if on through device mode in chrome size of ipad (or bigger 700 px) can see same problem, when scroll way down bottom, last animations wai...

Magento with RedisLab Redis Cluster Backend -

magento redislab cluster integration problem after deploy cluster redis database , fpc , session working when add cluster redis ( redislab ) instance magento cache section facing 1 problem. when click add cart >> show cannot add product backend error next exception 'zend_cache_exception' message 'error cleaning cache mode matchinganytag: err crossslot keys in request don't hash same slot (command='sunion', key='zc:ti:da3_quote_2156255')' in /var/www/magento/lib/zend/cache.php:209 stack trace: 3 #6 /var/www/magento/app/code/core/mage/core/model/abstract.php(464): mage_core_model_abstract->cleanmodelcache() #7 /var/www/magento/app/code/core/mage/sales/model/quote.php(333): mage_core_model_abstract->_aftersave() #8 /var/www/magento/app/code/core/mage/core/model/abstract.php(319): mage_sales_model_quote->_aftersave() #9 /var/www/magento/app/code/core/mage/sales/model/quote.php(1966): mage_core_model_ab...

algorithm - Proof of correct of the dynamic programming approach to min edit distance -

to calculate min edit distance (the minimum amount of insertions, deletions , substitutions required transform 1 word another), dynamic programming solution based on recurrence relation, last character of both string examined. details in https://en.wikipedia.org/wiki/wagner%e2%80%93fischer_algorithm . the description of algorithm everywhere on internet when comes edit distance, of them asserts correctness without proof. definition of edit distance, can insert, delete or substitute characters in middle, not @ end. how prove recurrence relation holds? use induction prove recursive algorithms correct first, said in comment, can view dynamic programming way speed recursion, , easiest way prove recursive algorithm correct induction : show it's correct on small base case(s), , show that, assuming correct problem of size n, correct problem of size n+1. way proof closely mirrors recursive structure. the usual recursion problem breaks problem "find minimum cost edi...

python/django - View in Footer ( view in all urlpatterns ) -

finally it's easy me query set in view , print in template. but, have huge problem... normal case know 2 steps, adding view in views.py , in view setting gueryset want use in 1 off templates. setting url view, exmaple. exmaple.com/projects/ , showing last projects in particular page. want show last projects on footer 1 allways visible on urls... cannot sort out...

yii2 - crypt() fallback for old hash salts in PHP7 -

i working on upgrading code base php-7 , i'm having trouble old users have salt format not compatible des. idea authenticate user , transform hash salt new format blowfish compatible new crypt. the problem comes when try use 'crypt()' old salt in order authenticate user before changing salt, following error: crypt(): supplied salt not valid des. possible bug in provided salt format. is there way use crypt (or alternative function) other algorithms can use old format salt? for people have same problem, solved using password_verify underneath uses password_hash which supports existing password hashes joachim suggested.

encryption - Python cryptography package RSA -- save private key to DB -

i want encrypt rsa python cryptography library. ( https://cryptography.io/en/latest/hazmat/primitives/asymmetric/rsa/ ) first think first, have secret msg , 2 types of keys(public , private): from cryptography.hazmat.primitives.asymmetric import rsa secret = 'ligula venenatis etiam fermentum' private_key = rsa.generate_private_key( public_exponent=65537, key_size=2048, backend=default_backend() ) public_key = private_key.public_key() now can encrypt msg public_key: from cryptography.hazmat.primitives import hashes cryptography.hazmat.primitives.asymmetric import padding ciphertext = public_key.encrypt( secert, padding.oaep( mgf=padding.mgf1(algorithm=hashes.sha1()), algorithm=hashes.sha1(), label=none ) ) great! due decrypt message need use private_key : plaintext = private_key.decrypt( ciphertext, padding.oaep( mgf=padding.mgf1(algorithm=hashes.sha1()), algorithm=hashes.sha1(), ...

erlang - An error with ets and reading files -

disclaimer: didn't write code, i'm trying make work. i'm trying code here working. setup ubuntu 14.04 64bit machine erlang installed. the sequence of actions follows: i'm doing follows: clone code cd folder code , erl in terminal make:all([load]). polis:create(). polis:start(). benchmarker:start(slidingwindow50). the errors are: 4> benchmarker:start(slidingwindow50). true dimensions:4, plasticity:none dimensions:4, plasticity:none dimensions:4, plasticity:none dimensions:4, plasticity:none dimensions:4, plasticity:none dimensions:4, plasticity:none dimensions:4, plasticity:none dimensions:4, plasticity:none dimensions:4, plasticity:none dimensions:4, plasticity:none specie_id:6.858114617542796e-10 morphology:forex_trader ******** population monitor started parameters:{state,benchmark,test,[], [],undefined,undefined, undefined,[],0,0,0,0,0, undefined,undefined, undefined,undefined, undefined,undefined,0.5, 10,10,mathema,inf,10000, inf,<0...

ios - How to change return button to Done in UIAlertViewStylePlainTextInput Xcode -

uialertview *alert = [[uialertview alloc] initwithtitle:app_name message:@"please enter amount" delegate:self cancelbuttontitle:@"done" otherbuttontitles:nil]; alert.alertviewstyle = uialertviewstyleplaintextinput; alert.tag = 2; [alert show]; above coding , type amount in uialertview. when keyboard showing up, client want "done" button instead of "return". please me how it? try this uialertview objective-c uialertview *alert = [[uialertview alloc] initwithtitle: app_name message:@"please enter amount" delegate:self cancelbuttontitle:@"done" otherbuttontitles: nil]; alert.alertviewstyle = uialertviewstyleplaintextinput; uitextfield *textfield = [alert textfieldatindex:0]; textfield.keyboardtype = uikeyboardtypenumberpad; // set return key...

jquery mobile - What causes this delay during page rendering after html loaded? -

Image
i want decrease time jquery mobile site shows blank page during pageload. due adsense had include data-ajax="false", there no smooth transitions anymore , worse, header disapears keeps page rendering during page load. the timeline shows significant delay after load of html document , after loading css/js resources: what cause of , possible eliminate gap?

java - Send Parameter To Runtime.getRuntime().exec() After Execution -

i need execute command in java program after executing command , required parameter ( password in case ). how can manage output process of runtime.getruntime().exec() accept parameter further execution ? i tried new bufferedwriter(new outputstreamwriter(signingprocess.getoutputstream())).write("123456"); did not work. does program not feature --password option ? command line based programs do, scripts. runtime.getruntime().exec(new string[]{"your-program", "--password="+pwd, "some-more-options"}); or more complicated way , more error-prone: try { final process process = runtime.getruntime().exec( new string[] { "your-program", "some-more-parameters" }); if (process != null) { new thread(new runnable() { @override public void run() { try { datainputstream in = new datainputstream( process.ge...

javascript - Is it possible to simulate key press events programmatically? -

is possible simulate key press events programmatically in javascript? a non-jquery version works in both webkit , gecko: var keyboardevent = document.createevent("keyboardevent"); var initmethod = typeof keyboardevent.initkeyboardevent !== 'undefined' ? "initkeyboardevent" : "initkeyevent"; keyboardevent[initmethod]( "keydown", // event type : keydown, keyup, keypress true, // bubbles true, // cancelable window, // viewarg: should window false, // ctrlkeyarg false, // altkeyarg false, // shiftkeyarg false, // metakeyarg 40, // keycodearg : unsigned long virtual key code, else 0 0 // charcodeargs : unsigned long unicode character associated depressed key, else 0 ); document.dispatchevent(keyboardevent);

java - OpenGlES2.0 Texture issue -

i new opengl, trying apply texture 3d figure ,but getting glgetuniformlocation: glerror 1282 error,please me this, searched online couldn't rectify it.would happy if explains issue also. my shaders: private final string vertexshadercode = "uniform mat4 umvpmatrix;" + "attribute vec4 vposition;" + "attribute vec2 texcoord;" + "varying vec2 texcoordout;" + "void main() {" + " gl_position = umvpmatrix * vposition;" + " texcoordout = texcoord;" + "}"; private final string fragmentshadercode = "precision mediump float;" + "uniform vec4 texcolor"+ "varying vec2 texcoordout;" + "uniform sampler2d texture;" + "void main() {" + " texcolor = te...

signals - How to handle SIGUSR1 in python -

import os import signal time import sleep child=[] in range(2): pid = os.fork() if pid == 0: child=[] print 'child start,pid',os.getpid() break else: child.append(pid) if(child): def onsig1(a,b): print 'onsig1->',a signal.signal(signal.sigchld,onsig1) signal.signal(signal.sigusr1,onsig1) try: print os.getpid(),' start wait...',str(child) while true: pid, stat = os.wait() print '--->',pid,stat except exception e: print 'error -->',str(e) else: def onsig2(a,b): print 'onsig2->',a signal.signal(signal.sigusr2,onsig2) while true: sleep(10) print os.getpid(),'say ...' 12500 start wait... [12501, 12502] when used 'kill -usr2 12501' , got 'onsig2->12' , 2 child process alive. understand this. when used 'kill -usr1 12500',i go...

openvpn easy-rsa command not found -

im trying install openvpn on centos 6 box im using epel repository install vpn went fine on installation somehow when coming generate certificate part lots of command not found raised when im typing "source ./vars" command here returned terminal [root@... easy-rsa]# source ./vars : command not found : command not found : command not found : command not found : command not found : command not found : command not found note: if run ./clean-all, doing rm -rf on /etc/openvpn/easy-rsa/keys : command not found : command not found : command not found : command not found : command not found here vars file setting # easy-rsa parameter settings # note: if installed rpm, # don't edit file in place in # /usr/share/openvpn/easy-rsa -- # instead, should copy whole # easy-rsa directory location # (such /etc/openvpn) # edits not wiped out future # openvpn package upgrade. # variable should point # top level of easy-rsa # tree. export easy_rsa="`pwd`" # # variable...

excel - UDF Circular reference -

i have task creating couple udf's compare sales figures against benchmark , return integer based on same value returned on previous sheet. i've run infamous circular error makes no sense me because while referring address of cell no-no in vba, it's in context of sheet. if enable iterative calculations, works on occasion continues iterate , jacks return value up. affects entire workbook. feel i'm missing simple here lack experience vba know explicitly. if has quick easy fix might overlooking i'd appreciate it. i'm @ wits , and going in python using xlwings or java using apache poi. consider hail mary pass @ giving on vba. ideas? function tier1(sales double) integer 'constant declaration 'change these alter benchmark values const bench double = 133000# const variance double = 0.9 'variable declaration dim callcell string dim sheet integer dim oldvalue integer dim returnvalue integer 'assigns value...

PHP multidimensional array keys combinations/combinatorics -

ok, have assignment php , appreciate assistance. so, let's have multidimensional array one: $testarray = array(0 => array(10, 20, 30), 1 => array(50, 60, 70), 2 => array(80, 90, 100), . . . n => array("", "", "",) ); values in array irrelevant, matters array keys. in case, have 3 keys in each array element, when permutation finished, final result should this: [0] => array ( [0] => 1 1 1 [1] => 2 1 1 [2] => 3 1 1 [3] => 1 2 1 [4] => 2 2 1 [5] => 3 2 1 [6] => 1 3 1 [7] => 2 3 1 . . . [n] => 3 3 3 ) in case of 4 array keys, final result should this: [0] = array ( [0] => 1 1 1 1 ...

java - Cloud vision api text detection showing syntax errors -

i have downloaded java vision api project github . i enabled billing project through developers console , got client_secret project. later adding environment variable google_application_credentials pointing client_secret file. i'm able other operations labeling, face detection , landmark detection. when try execute text_detection code i'm getting these errors. see image here public void indexdirectory(path inputpath) throws ioexception { list<path> unprocessedimages = files.walk(inputpath) .filter(files::isregularfile) .filter(index::isdocumentunprocessed) .collect(collectors.tolist()); lists.<path>partition(unprocessedimages, batch_size) .stream() .map(this::detecttext) .flatmap(l -> l.stream()) .filter(this::successfullydetectedtext) .map(this::extractdescriptions) .foreach(index::adddocument);} this code i've written , i'm getting below errors. exception in thread "main" java.l...

javascript - Onclick event for hightcharts range selector -

here have requirement in highcharts have range selector 1d,1w,1m,3m,6m,all when click of range selector have response data server means ajax call onclick range selector. have below fiddle file has code . has problem adding data using $.getjson('http://www.highcharts.com/samples/data/jsonp.php?filename=aapl-c.json&callback=?', function(data) { if(data != null) { chart.addseries({ name : 'energy consumption', id : 'energyconsumption', data : data },{ name : 'outdoor temperature', id : 'outdoordata', data : data } ); } }); the above code working if changed data static or jquery callback response not working. fiddle file below http://jsfiddle.net/uegzk/4/ please me on in advance, instead of reset_all_buttons function, calling chart.rangeselector.clickbutton(index) apply highstock's default behavio...

javascript - Creating basic company hierarchy line tree graph using Angular and D3 with STRAIGHT line links -

i'm building angular directive service , controller shows common, everyday company hierarchy chain. code have same accepted answer stack overflow question: organization chart - tree, online, dynamic, collapsible, pictures - in d3 i'm creating service , controller in angular example i'm not sure if there better way this, given d3 rendering happening in 'svg' in angular service. controller , service code have example: http://codepen.io/glovelidge/pen/qbbypv/ i want use service handle of d3 logic , controller bind template. my ultimate goal take links above , make selected picture on google images page, company chart using straight lines connecting nodes: https://www.google.com/search?q=org+structure+tree&espv=2&biw=1920&bih=1019&source=lnms&tbm=isch&sa=x&ved=0ahukewj9we3x4kxlahwrlimkhabzaieq_auibigb#imgrc=5qum4cjpcv2y8m%3a i new d3, questions are: can take curving links above examples , make them straight image in link ...

javascript - Apigee policy mediation - assign message / extract variables -

i exposing json on rest interface via apigee edge. externally, api consumers see following api spec: i.e. creating customer. post /customers?api_key=abc123 { "name": "john", "surname": "smith" } i have applied following policies: 1. verify api key 2. remove api key i wondering how may able use extract / assign message policy achieve following "reconstructed" request payload when calling downstream system. post /downstream-customer-service { "correlationid": "<generated guid>", "data": { "name": "john", "surname": "smith" } } so, need to: 1. move original request body, , add "data" element 2. generate guid , assign "correlationid" i assume need javascript policy? or achieved within javascript policy? thank in advance. i used javascript policy, , applied target endpoint preflow: ...

jbossfuse - Apache Camel, calling one route from another -

i have 2 routes in 1 camel context. <camelcontext xmlns="http://camel.apache.org/schema/blueprint"> <propertyplaceholder location="classpath:facebook.properties" id="properties" /> <route> <from uri="jetty:http://0.0.0.0:8765/getlikes" /> <to uri="facebook" /> </route> <route> <from uri="facebook://userlikes?oauthappid={{oauthappid}}&amp;oauthappsecret={{oauthappsecret}}&amp;oauthaccesstoken={{oauthaccesstoken}}" /> <log message="the message contains ${body}" /> </route> </camelcontext> in second route use facebook component. want call http://localhost:8765/getlikes , likes facebook second route get. first route cannot find second one you have use components direct ( http://camel.apache.org/direct ) or seda ( http://camel...

java - GLColorPointer isn't working with glDrawArrays -

i quite new opengl , having bit of trouble colorpointer function in conjunction drawarrays ... can't seem object render color .. when used glcolor4f function works .. thinking how construct color floatbuffer .. can't seem figure out. please have @ of code , let me know doing wrong here ... first stack on flow post (: // function draws vertices in 3d space public void draw(gl10 gl){ // enable client side access since arrays store on client side heap // , opengl considered server side gl.glenableclientstate(gl10.gl_vertex_array); gl.glenableclientstate(gl10.gl_normal_array); gl.glenable(gl10.gl_color_array); gl.glenable(gl10.gl_cull_face); // enable cull face gl.glcullface(gl10.gl_back); // cull face (don't display) gl.glenable(gl10.gl_color_material); gl.glvertexpointer(3, gl10.gl_float, 0, binarystlparser.getvertices()); gl.glnormalpointer(gl10.gl_float, 0, binarystlparser.getnormalvectors()); gl.glcolorpointer(4, gl10...

hadoop - Unable to connect to Hbase remotly -

i have set hadoop , hbase in pseudo distributed mode on machine a. running client ( java program ) machine b.(machine , b can communicate each other). facing problem in doing so. my client code looks : configuration config = hbaseconfiguration.create(); config.set("hbase.zookeeper.quorum" ,zookeeperlocation); config.set("hbase.zookeeper.property.clientport","2181"); htablepool tablepool = new htablepool(config,integer.max_value); htableinterface table = tablepool.gettable(tablename); my code gets hang on last line( tablepool.gettable() ) , not proceed. in zookeeper logs , see request received connect how did not proceed ahead. confused. please here. i got solution problem , tried different things 1) replacing hostname ip addresses in configuration files 2) playing /etc/hosts file 3) stopping , starting both hadoop , hbase.

java - Error when Facebook sdk Added into android project -

i getting following error while adding facebook sdk added android project unexpected top-level exception:error:execution failed task ':app:transformclasseswithdexfordebug'. com.android.build.api.transform.transformexception: com.android.ide.common.process.processexception: org.gradle.process.internal.execexception: process 'command 'c:\program files\java\jdk1.8.0_31\bin\java.exe'' finished non-zero exit value 2 add bellow line in build.gradle in android function in defaultconfig multidexenabled true then add dependencies compile 'com.android.support:multidex:1.0.1 update application bellow public class myapplication extends multidexapplication { @override protected void attachbasecontext(context base) { super.attachbasecontext(base); multidex.install(base); } then mention manifest <application android:name=".myapplication" android:allowbackup="true" ...

Using Javascript to play HTML5 video -

how play html5 video in webpage press of single key (eg. pressing 'r' key) instead of using mouse? can somehow use javascript this? yes, can done. following code should work. <script type="text/javascript"> function mykeypress(e){ var keynum; if(window.event) { // ie keynum = e.keycode; } else if(e.which){ // netscape/firefox/opera keynum = e.which; } if(keynum == 82){ // 82 key code r. var samplevideo = document.getelementbyid('samplevideo'); samplevideo.play(); } } </script>

javascript - why document.write not showing the result -

i'm learning js, script i'm trying 2 + 10 = 12 using plus operator. result not showing on editor preview. i'm going wrong? js: ver 2 = 2; ver ten = 10; ver result = 2 + ten; document.write("two plus ten = ") document.write(result) i'm expecting suggestion, mistake on js. i'm trying learn please don't suggest js. here example: https://jsfiddle.net/lnaj4zdb/ because of this ver 2 = 2; ver ten = 10; ver result = 2 + ten; it should var not ver var 2 = 2; var ten = 10; var result = 2 + ten; demo

javascript - jQuery not selecting id containing "<" angular bracket? -

i not able select checkbox has id="check stage<lead>" in jquery selector. html: <input id="check stage<lead>" type="checkbox" title="select/unselect column" name="chk-stage-column-select" value="" onchange=""> javascript: // escape jquery selectors function jqueryescape(str) { if (str) return str.replace(/([ #;?%&,.+*<>~\':"!^$[\]()=>|\/@])/g, '\\$1'); return str; } var stagename = "<lead>"; $("[id='check stage" + jqueryescape(stagename) + "']").prop("checked", true); equivalent jsfiddle : https://jsfiddle.net/vuw43uav/5/ note: i'm using jquery 1.7 , can select id spaces in jquery. refer jsfiddle: https://jsfiddle.net/vuw43uav/7/ i know asked make work using jquery selector, can using javascript. just select element using javascript ...

android - Why are there spaces on the left and right hand side of my seekbar? -

Image
i working on seekbar , have found 1 issue. default space present on left , right hand side. need seekbar full width. did match_parent , fill_parent didn't work. <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> <seekbar android:id="@+id/seek_bar_controller" android:layout_width="match_parent" android:layout_height="wrap_content" android:padding="0dp" /> </relativelayout> you can follow snapshot reference, on both left , right hand sides space present. please kindly go through post , suggest solution. to remove need use android:thumboffset="20dp" , try below code : <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:a...

Can anyone suggest a good framework for automation using Selenium, C# and NUnit 3.0 framework -

i'm beginner in selenium automation , need implement in new project c# , nunit3.0. have designed framework seems bit buggy need forum. use page object model. highly flexible , maintainable. of industries using page object model automation stuff few reference know page object model:- http://toolsqa.com/selenium-webdriver/page-object-model/ http://www.guru99.com/page-object-model-pom-page-factory-in-selenium-ultimate-guide.html few reference page object model in c#:- http://www.codeproject.com/articles/1013318/page-object-design-pattern http://automatetheplanet.com/page-object-pattern/ hope :)

java - Maven dependancy Autoit -

is there dependancy autoit maven related pom.xml. have autoit related .exe close print window. want call webdriver (java) code. i tried this, did not work: <dependency> <groupid>com.holmos</groupid> <artifactid>holmos-webtest</artifactid> <version>1.0.2u10</version> </dependency>

javascript - Passing data in between controller without help of url? -

i creating 2 page webapp using angularjs. json file is: { "data": [ { "name": "bhav", "id": 123 }, {"name": "bhavi", "id": 1234 }, {"name": "bhavk", "id": 1235 } ] } my app.js(routing file is): myapp = angular.module('myapp', ['slickcarousel', 'ngroute', 'myappcontrollers', 'myappservices','swipeli' ]); myapp.config(['$routeprovider', function($routeprovider) { $routeprovider. when('/', { templateurl: 'partials/home-page.html', controller: 'profilelistctrl', }). when('/profile/:typeofprofile', { templateurl: 'partials/profile-detail.html', controller: 'profiledetailctrl' }) }]); and 1st page(home-page.html) in given formate: <div ng-repeat="data in data"> <a hr...