Posts

Showing posts from June, 2010

php - `SignatureDoesNotMatch` Response from AWS of Alexa Top Sites Service -

i referring alexa top sites developer guide , using their sample codes, both php , ruby . getting following signaturedoesnotmatch error: <?xml version="1.0"?> <response><errors><error><code>signaturedoesnotmatch</code><message>the request signature calculated not match signature provided. check aws secret access key , signing method. consult service documentation details. </message></error></errors><requestid>28c6b028-c4b6-66a2-f5d8-70d8dc21b8f8</requestid> </response> i tried 2 different access keys same user , signed alexa web information service, no luck. tried scripts on both mac os 10.9 , 10.10, time settings set automatically updated. in php code part generates signature: /** * generates signature per rfc 2104 * * @param string $queryparams query parameters use in creating signature * @return string signature */ protected function generatesignature($queryparams)

php - MySQLi UPDATE where clause not working -

i wrote code suposed update "user level" stored in column "level" in table "users", user specified variable "$x5_input_username". $x_changelvl_sql = "update users set level='$x5_input_newlevel' `username`=$x5_input_username"; when using userlevel "2" , username "testuser" (which both exist in database), gives me error: error updating record: unknown column 'testuser' in 'where clause' quote string in where clause $x_changelvl_sql = "update users set level='$x5_input_newlevel' `username`='$x5_input_username'"; better yet, start using mysqli prepared statements , bind variables

ios - Extension taking too long to initialize -

i have today widget extension, in viewdidload: method, calling method, unloadclipboard: , method contains bit gets called, converts user's image clipboard nsdata. in theory should work fine, however, widget crashes on code, because takes long initialize–even though running on background thread. if (copiedimage && self.imagefunctionalityenabled) { //item image, data dispatch_async(dispatch_get_global_queue(0, dispatch_queue_priority_default), ^{ nsdata *data = uiimagejpegrepresentation([[uipasteboard generalpasteboard] image], 0.032); //if data isn't added if (![imagearray containsobject:data]) { [imagearray addobject:data]; } //sync defaults [defaults setobject:imagearray forkey:@"imagesarray"]; [defaults synchronize]; uiimage *image = [uiimage imagewithdata:[imagearray lastobject]]; dispatch_async(dispatch_ge

unity3d - Vuforia: it is possible play a Movie texture with alpha in iOS? -

i'm trying use video alpha channel, alpha channel color black. i'm using vuforia video playback example. i hope i'm not missing relevant info. thanks in advance, appreciated :) vuforia plays video using built-in system video players (on ios , android) setting them output render texture. the system players not support alpha channel video. you need apply chroma-key shader on render texture remove green or purple. there discussion in vuforia forums: playing-video-alpha-channel-videosample-demo-project

javascript - Text input from jquery not working -

hi have script appends set of constant string textarea works fine if click button first input text on textarea, button not append constant string on textarea if clicked again here code click event: $("#apply").on("click",function() { var orange = $("#agent_option").val(), lock = $("#agent_disallowed").val(); $("#textareafixed").html(orange + " " + lock ); }); and here html form: <label for="agent_option" class="control-label">user-agent :</label></div> <div class="col-md-6"> <select id="agent_option" class="form-control input-sm"> <option value="all">all</option> <option value="banana">banana</option> <option value="apple">apple</option> <optio

java - How do I use SwingX's Highlighter to return a different renderer component? -

Image
i noticed swingx's highlighter interface allows highlighter return different component 1 being passed in. can't find examples of being used, thought try use create kind of fake second column. the intended result text in left column should truncate right column starts, can't use painter . right column should render same width whole list, issue haven't figured out yet doesn't seem hard. as right though, finding row height gets compressed small, can't see of text. here's mean: sample program: import java.awt.borderlayout; import java.awt.component; import javax.swing.defaultlistmodel; import javax.swing.grouplayout; import javax.swing.jframe; import javax.swing.jscrollpane; import javax.swing.layoutstyle; import javax.swing.swingutilities; import org.jdesktop.swingx.jxlist; import org.jdesktop.swingx.decorator.abstracthighlighter; import org.jdesktop.swingx.decorator.componentadapter; import org.jdesktop.swingx.renderer.jrendererlabel; import

How to reuse Logstash codec or pattern definition? -

background currently in logstash configuration, have like: input { file { type => "catalina-out" path => [ "/var/tomcat/logs/catalina.out"] sincedb_path => "$home/.sincedb" tags => ["tomcat", "catalina-out"] codec => multiline { pattern => "(^.+exception: .+)|(^\s+at .+)|(^\s+... \d+ more)|(^\s*caused by:.+)|(%{loglevel}: %{greedydata})" => "previous" } } ... what i'm trying accomplish i have lots of tomcat output files, , reuse codec (or, less optimally, pattern ) other file definitions. the problem my problem following gives me error: input { tomcat_multiline_codec => multiline { pattern => "(^.+exception: .+)|(^\s+at .+)|(^\s+... \d+ more)|(^\s*caused by:.+)|(%{loglevel}: %{greedydata})" => "previous" } file { type => "catalina-out" path => [ "/var/tomcat/logs

how to conditionally include associations in a Rails Active Model Serializer v0.8 -

i have used ams (0.8) rails 3.2.19 1 place struggle them how control whether serializers include associations or not. use ams build json api's. serializer leaf or furthest out element , it's top level , needs include associations. question best way or solution below work (or best solution). i have seen of discussions find them confusing (and version based). it's clear serializer attributes or associations, there an include_xxx? method each , can return either truthy or falsey statement here. here's proposed code - it's winemaker has many wine_items. how this? model classes: class wineitem < activerecord::base attr_accessible :name, :winemaker_id belongs_to :winemaker end class winemaker < activerecord::base attr_accessible :name has_many :wine_items attr_accessor :show_items end serializers: class winemakerserializer < activemodel::serializer attributes :id, :name has_many :wine_items def include_wine_items? object.s

javascript - Get footer to display AFTER elements with z-index -

i have 1 div containing elements both relative & absolute position, both , without z-index . i need div - footer, display after other visible elements. should start below end of lowest other element. in html code, footer div occur after others. reason, renders under/overlapped others. i can't figure out positioning or z-index can set make footer never overlapped other elements, , displays lowest/last on page. you can see problem in fiddle: http://jsfiddle.net/patmeeker/9drr6qhr/ (later length of other elements change dynamically. not sure if concern, fiddle doesn't reflect yet) it's because you're using position: relative top: 50px , render position 50px further top , in flow, it's position still in top without space, top: 0 , cause footer doesn't have top value overlapped content div class relnoz . to overcome this, should either give top: 50px footer , other sibling container (if any) or remove top: 50px .relnoz here&

sql - BCP Utility Not returning/Hangs -

i creating simple stored procedure export output of query text file using bcp shown below. when execute sp sql management sudio, results pane sits there "executing query..." doesn't return error nor come back. any appreciated..i have spend lot of time on already. create procedure sptestshell execute 'cmdshell' begin declare @command varchar(512) set @command = 'bcp "select * dbname.dbo.[importfiletable]" queryout "c:\bcptest.txt" -t -c -s' + @@servername print @command exec xp_cmdshell @command end exec sptestshell the fact 'hangs', suggests me process trying to, cannot connect server. i think problem there no space between -s parameter , server name. won't able connect server name invalid. try adding space see if fixes it, i.e. set @command = 'bcp "select * dbname.dbo.[importfiletable]" queryout "c:\bcptest.txt" -t -c -s ' + @@servername if doesn&

android - How can I know if my app is removed? -

i'm newbie. don't know when publish app, wonder if removed. there way check if app disabled before publish it? thanks , best regards ps: english not good. please sympathetic!!! go google play store console, , check app status

java - Taking integers as input from console and storing them in an array -

when trying write following code, computer takes several inputs. want should take 1 line input , save integers in line in array. can me please? import java.util.*; class inputinteger{ public static void main(string args[]){ scanner input=new scanner(system.in); int[] array=new int[20]; int i=0; while(input.hasnext()){ array[i]=input.nextint(); i++; } input.close(); } } but want should take 1 line input , save integers in line in array. first, urge not close() scanner have created around system.in . that's global, , close() ing can cause kinds of issues later (because can't reopen it). reading single line of input , splitting int values array, use scanner.nextline() , like public static void main(string[] args) { scanner input = new scanner(system.in); if (input.hasnextline()) { string line = input.nextline(); string[] arr = line.split(&quo

java - Utilizing 2 Layouts within a ListView -

i have been trying implement listview utilizes 2 seperate layouts depending on row. first layout has 1 imageview, , second layout has 2 imageviews. i make can each row within listview contain alternating layouts, able use in arraylist bitmaparray; so example, first row contain first 2 bitmap images, , second row contain 1 large bitmap image, 3rd row 2 more bitmap images side side... , forth. update i have got working somewhat, , issue remains images not being seperated properly. reusing total of 4 different pictures , seperating them oddly... try illustrate below each number represents picture in bitmaparray (there 20 images total 0 - 19) needs be [ 0 ] [ 1 , 2 ] [ 3 ] [ 4, 5 ] [ 6 ] [ 7, 8 ] [ 9 ] [10 , 11] [ 12 ] [13, 14] [ 15 ] [16, 17] [ 18 ] [ 19, --] updated pattern der golem [ 0 ] [ 1 , 2 ] [ 2 ] [ 3 , 4 ] repeat **there ever total of 20 images stored in bitmaparray. issue finding when press onitemclick on later row (s

debugging - Android app be blank without run it from debug in Lollipop 5.0 -

Image
i have problem developing android app in lollipop. using nexus 7 (2012). if app run eclipse (run debug) work ok. if open in app screen (on phone), show blank screen (the actionbar , drawer still working) main content (i use fragments) blank edited : these code in mainactivity loading fragment content : mstacks = new hashmap<string, stack<fragment>>(); mstacks.put(appconstant.test_fragment, new stack<fragment>()); bundle bundle = getintent().getextras(); currentmenu = appconstant.test_fragment; if (bundle != null) { currentmenu = bundle.getstring(baseappconstant.intent_al_screeen_name_extra); } if (currentmenu != null) { if (currentmenu.equals(appconstant.test_fragment)) pushfragments(new listfragment(), false, true); }

android - How to get Resource name? -

how image name , display in textbox? used arraylist generates random images. string imagename = getresources().getresourcename((integer)list.get(position)); the output code r.drawable.image1. how image name image1? try this, string name = getresources().getresourceentryname(image[position]);

api - Apidocjs document creation issue, warning : plugin param parser not found and missing comma issue -

i tried create api documentation using apidocjs , got issues while compiling project creating apidoc using apidoc.json on project folder. code here : ~$ apidoc -i ./ -o apidoc/ and result warning: parser plugin 'param' not found. error: error: can not read: apidoc.json, please check format (e.g. missing comma). please me fix issue tags related apidocjs.com removing apidoc destination folder @prasanth suggests destroy history if using @apiversion feature. way rebuild go through , checkout each version, run apidoc. so, if want use versioning. not answer. you may have syntax issues or other configuration issue. in case, since updating had functions documented in javadoc style @param... used ignored throws warning.

php - vagrant up command fails -

this question has answer here: error when trying vagrant up 19 answers i learning use vagrant , have setup vagrant homestead system on local machine. my homestead.yaml in scr/stubs/ folder. it looks this. ip: "192.168.10.10" memory: 2048 cpus: 1 authorize: /var/www/myhomestead/homestead/ssh/id_rsa.pub keys: - /var/www/myhomestead/homestead/ssh/id_rsa folders: - map: /var/www/sites/ to: /home/vagrant/sites/ sites: - map: homestead.app to: /home/vagrant/code/laravel/public databases: - homestead variables: - key: app_env value: local when run "vagrant up" gives me errors this. amit@amit:/var/www/myhomestead/homestead$ vagrant up bringing machine 'default' 'virtualbox' provider... ==> default: box 'base' not found. attempting find , install... default:

for loop - select records from a table for each different date in single iteration of SQL query -

sorry vague problem statement, maybe not frame right way hence couldn't internet. my basic intent select 2 columns table, table has been partitioned based on dates, , has huge number of records. the intent select records each date jan 1 nov 30, can't using date between statement, need input each date separately in iteration in loop. can writing dummy sql query on this? thanks, you can use scripting language iterate on each day achieve. below sample (untested code) import pyodbc conn = pyodbc.connect(dsn='dsnname',autocommit=true,ansi=true) cur = conn.cursor() sql = "insert tgt_table select col1,col2 src_table partitioned_date_column = date '2014-01-01' + interval '%d' day" in range(1,30): cur.execute(sql % i)

javascript - failed to connect to mongoose lab -

Image
ive create mongoose lab db , im getting error in command line failed connect(i've provided right user , pass),what doing wrong , how can overcome issue? mongoose.connect('mongodb://myuser:123456@ds063200.mongolab.com:61200/flights',function(err){ if(err) throw err; }) im using node.js i believe using mongolab's username & password connecting database. you should define username & password database in mongolab control panel for example have database named 'test' , after login mongolab i'll go https://mongolab.com/databases/test#users , add new username , password 'test' database username: hamid, password:zzzz . the connection test database mongolab be mongodb://hamid:zzzz@ds053438.mongolab.com:53438/test updated: test connection via robomongo connect mongolab via robomongo step 1: create new connection step 2: enter address ds063200.mongolab.com , 61200 port step 3: enter flights databa

PHP: To decode json to chinese and smily not works? -

this question has answer here: unicode character in php string 6 answers to decode json chinese: json_decode('"\ud83d\ude18\ud83d\ude18\ud83d\ude18\ud83d\ude18\u597d\u5bb6\u4f19\ud83d\ude0d\ud83d\ude0d\ud83d\ude0d"'); not works? it works chinese not smily can please give me idea it that's not valid json string -- json strings must inside double quotes edit: took failing example above, wrapped utf-8 in doublequotes, , decoded: var_dump(json_decode('"\ud83c\udf83\ud83c\udf83\ud83c\udf83"')); string(12) "🎃🎃🎃" (i don't know glyphs should like, don't eve know if have right fonts installed, string decoded)

javascript - Cancel upload angular-evaporate -

i using angular-evaporate https://github.com/uqee/angular-evaporate uploading files amazon web service(aws). need add cancel button in it.there function available in evaporate.js. _.cancel = function(id){ l.d('cancel ', id); if (files[id]){ files[id].stop(); return true; } else { return false; } }; but don't know how cal on button click.i new in angulare js,please me. it should done in latest master branch ( added 13 may ), not in 1.4.3. install master, run bower uninstall angular-evaporate bower install angular-evaporate#master you fork stable version or change angular-evaporate.js part eva._.add({ , change file.id = eva._.add({ , once adding complete, proxy evaporate.js method file.cancel = function(){ eva._.cancel(file.id); };

ilog - If-then-else not working well for comparison with 0 -

i have written rule if period of 'request' more 0 set date of 'request' due_date - 1 day; else set date of 'request' due_date ; for period values other 0 it's working fine when value of period 0 skips whole rule, i.e neither go nor else. using odm 8.6 , testing through dvs file. i have tried same thing in odm 8.5 , it's working fine there please in getting issue resolved. did try latest fixpack? in general poor design rules use else construct. try split rule 2 different rules: for period of 'request'>0, , for period of 'request'<0.

android - How are bitmaps scaled? -

i have 2 bitmaps. bitmap 257x257, , bitmap b 255x255. container both being placed in 256x256. how bitmaps scaled? in other words: 1) how can bitmap scaled small values, such 1 pixel? 2) difference between scaling bitmap (placing b in container) , scaling bitmap down (placing in container)? 3) there difference in cost between scaling in either direction 1 pixel vs 100 pixels?

javascript - Changing a Date & Time input (AnyTime picker) into a date object to get the seconds -

im using anytime picker date , time (start date& time) in format "%d/%m/%y %h:%i:%s", im trying input converted date object use getseconds() seconds , add duration(in seconds) end time , date. how can convert input? <input id="choosetime" name="choosetime" type="text" maxlength="16" size="20" value=""> var anytimeformat = "%d/%m/%y %h:%i:%s"; anytime.picker( "choosetime", { format: anytimeformat, firstdow: 1 }); var schedule_start_time = new date($("#choosetime").val()); var schedule_end_time = new date(); schedule_end_time.setseconds(schedule_start_time.getseconds() + durationinsecs); basically problem input current date , time on computer. anytime picker input selected doesnt work. did did wrongly. have feeling way im converting choosetime new date. how can it, need help! the picker initializes date/time in input field. if value in input f

GraphHopper Dynamic Routing -

i know question of gh dynamic edge weights has been raised in various forums, still find myself lost on how implement this. have seen options - changing edge weights , recalculating contracted graph, disabling contraction hierarchies altogether etc. please explain me beginners point of view, begin, available options, drawbacks of each, packages , classes in library used achieve this, etc.

linux - In Bash, how do I display script output and then resume to the previous output (like less, or top, or watch) -

i don't want write c code this, want script behave 'watch': display output on clean console, , return original output displayed. i'm not using watch because messes output , lack functions want add. regular 'clear' fill console pages , pages of same output , want avoid that. any suggestions? terminal curses software such ncurses should work making 'q' quit less simple

javascript - Values and captions in Ace Editor autocomplete -

i using ace editor v.1.1.8 ext-language_tools. want achieve following behavior auto-complete: user starts typing, presses ctrl+space , show him list of found captions, when selects 1 of them value inserted. my code: var completions = [ {id: 'id1', 'value': 'value1'}, {id: 'id2', 'value': 'value2'} ]; var autocompleter = { getcompletions: function(editor, session, pos, prefix, callback) { if (prefix.length === 0) { callback(null, []); return; } callback( null, completions.map(function(c) { return {value: c.id, caption: c.value}; }) ); } }; editor.setoptions({ enablebasicautocompletion: [autocompleter], enableliveautocompletion: false, enablesnippets: false }); so need above user enters 'val', sees list 'value1' , 'value2', selects 1 of them ,

android - Decode Apk, open Eclipse Auto-Save Data? -

just yesterday eclipse gave me following error: "an error has occurred. see log file" i searched internet do, , tried solution: http://bugsanddebugs.blogspot.de/2010/06/when-eclipse-says-error-has-occurred.html basically:" deleted: /your path workspace/.metadata/.plugins/org.eclipse.core.resources " after open eclipse again, whole workspace gone though. because didnt work, put deleted file place. workspace used now. can open eclipse, not load projects itself. plain empty the big problem however, saved latest project apk file cannot acces now. tried decoding apktool , apktool-install-windows-r05-ibot.tar. folder out of corrupted tho. xml files not in right shape , src code in smali files. but there must solution believe. before incident, open eclipse , projects there, though never saved them in latest state. eclipse save projects? can somehow backup , tell eclipse load old workspace? did not change path eclipse uses workspace, not loading in there. e

c++ - Get relative path to current dll from working directory -

i'm using software loads .dll library sofware located somewhere on my hard drive, let's say: c:\program files\unicode chars\(...)\123.exe and dll located in: c:\program files\unicode chars\(...)\addons\dlls\123.dll now need able perform operations fopen(), fclose() etc inside of dll, passing path dll fopen parameter. how relative path 123.dll allow me access file short, ansi path, possibly addons\dlls\123.dll

javascript - Can the default `window.top` ever be invalid as a reference? -

i want redirect user external page , simultaneously break out of frameset. the outermost frameset within same domain page doing redirection, there possibility span domains. in development, outermost frameset might not exist @ all. ideally, want cover situations. the innermost page (the 1 has breakout code) going served on https. target url may http or https. acceptable redirection fail (there fallback link "click here continue" cover scenario) redirection should work in majority of cases. particularly purposes of question, i'd hate more browser-dependent necessary. the web application asp.net. because of framesets, can't use http redirect. so far have javascript code, registered startup script within class subclassing page , ... represents redirection target url: ((window.top == null) ? (window) : (window.top)).location = '...'; what bothers me mdn has window.top , window.parent , respectively. particularly, documentation window.parent s

python 2.7 - My Maxent Classifier works fine with gis algorithm but does not work with iis algorithm. It is not throwing any error, just some warnings -

i trying implement maxent classifier facing problem while using iis algorithm.the following code works fine gis algorithm. import nltk nltk.classify import maxentclassifier, accuracy featx import split_label_feats, label_feats_from_corpus nltk.corpus import movie_reviews nltk.classify import megam openpyxl import load_workbook featx import bag_of_non_words nltk.tokenize import word_tokenize movie_reviews.categories() lfeats = label_feats_from_corpus(movie_reviews) lfeats.keys() train_feats, test_feats = split_label_feats(lfeats) me_classifier = nltk.maxentclassifier.train(train_feats, algorithm='iis', trace=0, max_iter=3) print accuracy(me_classifier, test_feats) i working on win32 machine , above code nltk book jacob perkins. warning thrown c:\python27\lib\site-packages\nltk\classify\maxent.py:1308: runtimewarning: invalid value encountered in multiply sum1 = numpy.sum(exp_nf_delta * a, axis=0) c:\python27\lib\site-packages\nltk\classify\maxent.py:1309: runtime

Azure Cloud Service PHP Pear Packages -

i following tutorial http://azure.microsoft.com/en-gb/documentation/articles/storage-php-how-to-use-blobs/ on ussing azure php sdk access azure storage blobs. i need read , write these blobs live cloud service running php app. says sdk dependent on pear packages , should installed using "pear package installer" the php client libraries azure have dependency on http_request2, mail_mime, , mail_mimedecode pear packages. recommended way resolve these dependencies install these packages using pear package manager. this , on dev server, install pear , install packages. once app packaged , pushed azure production cloud service, doesn't contain pear or of packages. php installed on cloud service when spun using servicedefinition.csdef startup tasks. every new instance has php installed on startup. so how pear , these packages on cloud instance? have googled , cannot find explains using pear on cloud instances, yet sdk documentation says needed?!? am misunders

java - How to enable ssl/https on linux tomcat server(works with intern IP)? -

i've got problem setting tomcat on linux secure connection. servlets work fine normal http requests, when changing server.xml file https configuration, servlet addressable through intern ip. created .keystore file in home directory. fact, https connection(after accepting certificate) works within intern network makes me believe router related problem (i opend , forwarded port 8443 on router). thanks help! server.xml: <connector port="8080" protocol="http/1.1" connectiontimeout="20000" uriencoding="utf-8" redirectport="8443"/> ... <connector port="8443" protocol="http/1.1" sslenabled="true" maxthreads="150" scheme="https" secure="true" clientauth="false" sslprotocol="tls" keystorefile="/home/user/.keystore" keystorepass="password" />

Ask to a user for a folder path PHP -

since name of folder diferent register of database totally unexpected, need ask every folder path , store in database. can me how in php? i have form register id linked folder path user indicate browsing correct folder (which not know how do). i name url , have store folder corresponding path database. // check if 'id' variable set in url, , check valid if (isset($_get['name'])) { // name value $name = $_get['name']; // assign name folder name path session_start(); // starting session $_session['name_for_path'] = $name; header("location: index_showpic.php?");} //here!!!!???? else // if id isn't set, or isn't valid, redirect view page {header("location: _table.php?sort=id");} ?> i need show tiff pictures folder. know how convert them automatically jpeg since php not support tiff images? thanks!

c++ - is it compatible library complied with g++/libstdc++ and client complied with (clang/g++/gcc)/libstdc++? -

i not expert linux family compiler. i wonder static library built g++/libstdc++ can used compiler (clang/g++/gcc) , linked libstdc++ (as long know, libstdc++ , libc++ not compatible. restrict them libstdc++ ) it important library development, allows whatever user used, can supported. and also, compiled c++98 / gnu c++98 can used library - , client structure ? how c++98 / c++11, respectively ? thank you, in advance!! yes, libraries compatible if use same binutils , not use conflicting compiler flags. compatibility doesn't depend on c standard.

php - Issue trying to print data from a web service with function file_get_contents -

when use code print data local json file works perfect. $json_string = 'data.json'; $jsondata = file_get_contents($json_string); $obj = json_decode($jsondata,true); echo "<pre>"; print_r($obj); but can´t make works web service. don't results.. $json_string = 'http://ddddd.com/ws/ws_get_news.php?limit=10'; $jsondata = file_get_contents($json_string); $obj = json_decode($jsondata,true); echo "<pre>"; print_r($obj); what i'm doing wrong? thanks. it looks first characters of generated json problem. possible generating utf8-bom? can solve strip first characters. try this: $json_string = 'http://dattabasic.com.ar/~masterli/admin/ws/ws_get_categorias.php'; $jsondata = file_get_contents($json_string); $jsondata = substr($jsondata,3); $obj = json_decode($jsondata,true); echo "<pre>"; print_r($obj); echo "</pre>";

Firing Facebook conversion pixel with Google Tag Manager and no confirmation page? -

i work on website used generate sales leads (www.first-european.co.uk). there few different forms on website , of these have confirmation pages, apart quote form (/customised-quote.html). heavily used form on site, , to track form submissions in google analytics use google tag manager's click listener when submit button clicked. to implement facebook pixel, pasted in custom html tag in gtm. firing rules tag confirmation pages , when "{{event}} equals submit_build_my_quote" (the quote form button click). looks pixel firing on confirmation pages, doesn't seem firing button clicks. can let me know correct implementation, or if it's possible work without confirmation page? any appreciated! from our discussion above, seems not detecting form submit action , passing gtm. can automatically built-in gtm form submit auto event tracking. in version 1 of gtm, add form submit listener tag fire on pages. in version 2 of gtm, add new form trigger . onc

java - How to give password to protect xlsx sheet using apache poi? -

sheet1.protectsheet("xxxx"); actually tried above code, protecting sheet editing, while enable editing not ask password, how protect password? read apache poi - encryption support paragraph xml-based formats - encryption. comes source code example. see http://poi.apache.org/encryption.html

java - Parsing JSON Object to Restful web service -

i developing android registration system communicates mysql database through json. restful web service written php , slim library. have tested web service using advanced rest client app parsing json payload data , works fine result shown below. @ moment trying parse user data android app server , shows error (error parsing data org.json.jsonexception: value <html><head><title>slim of type java.lang.string cannot converted jsonobject) . tell me doing wrong coz feel error jsonparser class , userfunction . in advance. here test result {"tag":"signup","success":1,"error":0,"uid":"547d92b0480711.90973742", "result":{"firstname":"mish","lastname":"harry","email":"mishael19@gmail.com"}} here jsonparser public class jsonparser2 { static inputstream = null; static jsonobject jobj = null; static string json = ""; // co

computer vision - How can I find camera pose from matlab calibration? -

as far know caltech matlab toolbox gives internal camera parameters (focal length, principle point,...) , camera matrix. as external camera parameters gives transformation matrices each image used in calibration (chessboard pattern). my question how can find pose of camera given internal , external parameters caltech matlab calibration toolbox? pose relative what? extrinsic parameters give pose of camera relative checkerboard in each of calibration images. pose here represented translation , rotation checkerboard's coordinate system camera's coordinate system. by way, there support camera calibration in computer vision system toolbox . there function called extrinsics , computes pose of calibrated camera (in terms of translation , rotation) relative world coordinate system (e. g. represented checkerboard points).

javascript - ThreeJS how to change color of hovered face on a PlaneGeometry -

i want change color of hovered face of planegeometry don't find how selected face. here code: //three.webglrenderer 69 // generating plane var geometryplane = new three.planegeometry( 100, 100, 20, 10 ); (var vertindex = 0; vertindex < geometryplane.vertices.length; vertindex++) { geometryplane.vertices[vertindex].z += math.random(); } geometryplane.dynamic = true; geometryplane.computefacenormals(); geometryplane.normalsneedupdate = true; var materialplane = new three.meshlambertmaterial( { color: 0xffff00, side: three.doubleside, shading: three.flatshading, overdraw: 0.5, vertexcolors: three.facecolors } ); plane = new three.mesh( geometryplane, materialplane ); plane.geometry.colorsneedupdate = true; // mouse event container[0].addeventlistener( 'mousemove', onmousemove, false ); function onmousemove( event ) { var mousex = ( event.clientx / window.innerwidth ) * 2 - 1; var mousey = -( event.clienty / window.innerheight ) * 2 +

html - How to display promotion items in item listing description on eBay -

Image
i'm trying display promotion items in items listing page in description section. i have created promotion box in store management section , tried using following ebay html special tag include in desription section did not work. {ebaypromo id="promo_box_name"} i have seen being done other stores here not sure how it. can please give pointers in direction. thanks in advance. this feature called promotions manager, although has been called sales maximizer. may not available ebay merchants. you can read more here: ebay sales maximizer in ebay, find left menu column. it's located towards bottom (i've highlighted in red you). note if don't have or see there, try speak account manager (if have one). otherwise, try speaking ebay support.

amazon ec2 - How to set up a Chef Node on an ec2 instance? -

i trying use knife bootstrap command mac terminal "knife bootstrap node_domain_or_ip -x username -p password -n name_for_node --sudo" but problem is, don't have user name , password, instead ec2-user has private key stored in local work station helps me connect server. find lot of examples debian os, hard find rhel on ec2. os: rhel 6 chef: 11.1.6 kindly let me know if details need me better. even host keys have username. typically, if using ssh -i somekey user@host_or_ip to ssh node, use knife bootstrap node_domain_or_ip -x username -i samekey -n chef_name_you_want --sudo notice, use -i rather -p . that's there it. an better option people use knife ec2 server create create node in first place. create node in aws , bootstrap it, in 1 command.

testing - Grails: How to mock a domain field validator? -

is there way mock domain field validator? currently, code in domain class looking this: isprimary(validator: { boolean value, person obj -> ....... } and need mock function. i tried use like: person.metaclass.static.isprimary.validator = { boolean value, person obj -> ....... } and didn't work, suggestions how solve issue ? here example: class person { boolean isprimary static constraints = { isprimary validator: isprimaryvalidator //or qualified validator //isprimary validator: person.isprimaryvalidator } static isprimaryvalidator = { boolean value, person obj -> //some validation } } //in test person.metaclass.'static'.isprimaryvalidator = { boolean value, person obj -> //do else }

[apigee]how to stop an request from hitting default backend target -

i want restrict request resource doesn't exist in api proxy , hitting "default" target. one way add resources in api product access permitted required api key passed in request.in case api key not passed in request. please suggest anyother way on how check of blocking requests. first, if resources in basepath /v1, should create "catch-all" api block not in /v1 api group. create new api no target , basepath of / -- put assign message or raise fault policy in there returns 404 error. like: <?xml version="1.0" encoding="utf-8" standalone="yes"?> <proxyendpoint name="default"> <description/> <flows/> <preflow name="preflow"> <request> <step> <faultrules/> <name>fault-not-found</name> </step> </request> <response/> </pref

ibm mobilefirst - Unable to deploy wlapp file, null source exception -

i trying deploy wlapp file using worklight console. after uploading file giving error. "failed deploye 'xxx.wlapp' null source". adapters getting deployed, wlapp file not. worklight version : 6.1 i don't know error lies. when have changed jar file of mysql connector version 5.1.6 5.1.28 , redeployed project, thing working fine. i able deploy application adapters. thing working fine.

windows - Qt Creator has no kits that are suitable for CMake projects -

Image
when try create new cmake project, message error. have cmake installed, , when click configure, gets me kits tab, have qt4 , qt5, qt5 default. no matter select, "next" button still disabled in wizard. what need select kit? it turned out the message misleading , talking kits, , configure button further misleading because opened kit tab, when needed set path cmake executable in cmake tab (tools->options->build & run->cmake).

web services - Generic based WebService -

i esb solution, want use generic based webservice. can definition, generate needed classes, service exists, wsdl deficient. missing "generic part", part defined generic type. the ancestor: @xmlaccessortype(xmlaccesstype.field) @xmltype(proporder = { "header", "body" }) public abstract class wsrequest<t> { protected requestheader header; protected t body; public requestheader getheader() { return header; } public void setheader(requestheader header) { this.header = header; } public t getbody() { return body; } public void setbody(t body) { this.body = body; } } and descendant: public class partnerrequest extends wsrequest<partnerdata> { } the service work correctly, generated wsdl doesn't contain partnerdata structure. i'm new in ws part, real possibility impossible. please me solve problem (or reject idea) thx! feri so, problem that, base xsd complex. (i generated xml, , th generator pr

ruby - Rails Paperclip - Duplicating the attachment file name in another field -

i've got following table: create_table "documents", force: true |t| t.string "title" t.integer "subject_id" t.datetime "created_at" t.datetime "updated_at" t.string "attachment_file_name" t.string "attachment_content_type" t.integer "attachment_file_size" t.datetime "attachment_updated_at" end whenever upload file (using paperclip), want duplicate param of 'attachment_file_name' 'title'. this app api, i'm using debugs_controller test it. debugscontroller class debugscontroller < applicationcontroller def index @document = document.new @documents = document.all @subject = subject.new end end debugs/index.html.erb <form action="http://0.0.0.0:3000/documents" method="post" enctype="multipart/form-data"> <input name="document[title]" type="text" placeholder