Posts

Showing posts from September, 2010

url rewriting - How to rewritten rule for c# for GET request example.com/123 redirect to example.com/default.aspx?pid=123 and 123 is dynamic change -

this uri http://example.com/xyz xyz number. have redirect http://example.com/default.aspx?pid=xyz this link should more: https://www.iis.net/learn/extensions/url-rewrite-module/creating-rewrite-rules-for-the-url-rewrite-module . in iis manager create new rule with: action: redirect pattern: ^([0-9]{3}) redirect url: default.aspx?pid={r:1} if xyz change in length, consider changing pattern to: ^([0-9]+)

c++ - cc1plus: error while loading shared libraries -

i running simulator mounted on disk. when trying cross compile application, gives me error: /mnt/mipsroot/cross-tools/bin/../libexec/gcc/mips-unknown-linux-gnu/4.6.3/cc1plus: error while loading shared libraries: libcloog.so.0: cannot open shared object file: no such file or directory i have tried lot rectify it, in vain. there way how can application cross compile? [root@canada ~]# yum search cloog redirecting '/usr/bin/dnf search cloog' (see 'man yum2dnf') last metadata expiration check: 0:56:47 ago on thu nov 10 14:11:03 2016. ================================= n/s matched: cloog ================================= cloog.i686 : chunky loop generator cloog.x86_64 : chunky loop generator cloog-devel.i686 : development tools chunky loop generator cloog-devel.x86_64 : development tools chunky loop generator [root@canada ~]# yum install cloog-devel did ?

node.js - Unable to run seneca for rest microservices -

i having following code in executable js after necessary imports. seneca.ready(function(err){ seneca.act('role:web', {use:{ prefix: '/products', pin: {area:'product', action:'*'}, map: { list:{get:true} } }}) var express = require('express'); var app = express(); app.use(require('body-parser').json()); app.use( seneca.export('web') ); app.listen(8082); }); i getting following error while trying run example: seneca fatal error message: seneca: export web has not been defined plugin. code: export_not_found details: { key: 'web' } thanks, sumit i beginner, hope snippet useful: var seneca = require('seneca')() var web = require("seneca-web"); var express = require('express'); var app = express(); var config = { routes : [ { prefix : '/products', pin : { area : 'product&

sql - Pass column name to a function -

create or replace function test123(column_name varchar(40)) returns record $$ declare rec record ; begin select * rec my_table column_name=1 limit 1; return rec; end; $$ language plpgsql; how can pass column name function , use name in query? the above code not work: error: operator not exist: character varying = integer when want use function parameters identifiers in queries inside function need dynamically execute query: create or replace function test123(column_name varchar(40)) returns record $$ declare rec record; begin execute format('select * my_table %i = 1 limit 1', column_name) rec; return rec; end; $$ language plpgsql; or shorter: create or replace function test123(column_name varchar(40)) returns record $$ begin return query execute format('select * my_table %i = 1 limit 1', column_name); end; $$ language plpgsql;

Loop MySQL run with java -

i have 3 tables having following content : author idauthor int name varchar publication idpublication int title varchar date year type varchar conference author_has_publication author_idauthor int publication_idpublication int i trying relational schema on authors. objectif show number of publication have in common. authors name parameters, can have 8 names. code giving number of common publication between 2 authors, have loop it. using java loop , sql statement that. here sql part private int runquery(string a1, string a2){ // a1 author 1 , a2 author 2 try { auth1 = new arraylist<string>(); class.forname("com.mysql.jdbc.driver"); connection connection = drivermanager.getconnection( "jdbc:mysql://localhost:3306/mydb", "root", "root"); statement stmt = connection.createstatement(); long start = system.currenttimemillis(); string

Paypal - Sandbox - Open Test Account -

after x hours of searching , lost-ing inside documentation , community, understand that, if : i'm non developer my client not company i want integrate paypal in market-place sending several emails paypal support i need to: register business account in paypal.com ( , not in sandbox ) find user because i'm not, otherwise need fake address, zip code , state enter in developer.paypal.com someone can answer me yes ? or right procedure ? thanks from https://developer.paypal.com/docs/faq/#international-developer-questions "i'm non-u.s. developer. products available me? the rest api supports number of countries , currencies. rest api provides simple payment processing common business needs, including paypal payments, direct credit card payments, authorization , capture, , refunds. more advanced payment solutions such parallel , recurring payments, can use nvp/soap apis. if you've used our nvp/soap apis, can continue use them. using old

java - Getting ConcurrentModificationException from onLocationMethod -

this question has answer here: concurrent modification exception : adding arraylist 7 answers i trying update arraylist of locations per below logic in service, running in background thread through runnable.i have edited code show relevant code. getting concurrentmodificationexception . public static arraylist<location> locationpoints; @override public void onlocationchanged(final location location) { //log.i(tag, "onlocationchanged: " + location); log.i(tag, "onlocationchanged: " + locationpoints.size()); arraylist<location> alnew= locationpoints; if(!locationpoints.isempty()){ for(location l:alnew){ if(location.distanceto(l)<=200.0f){ locationpoints.add(l); }else{ locationpoints.add(location); } } }else{ locationp

html - Unable to set width inside ASP repeater -

i having below repeater table tr , td have assigned width these doesn't work. have tried px , % both doesn't work in case. <div style="padding: 3px;"> <asp:repeater id="rptincrementalint" runat="server" visible="true" onitemdatabound="rptincrementalint_itemdatabound"> <headertemplate> <table cellpadding="0" cellspacing="1" class="ey-datatable"> <tbody style="background-color: white"> <tr class="heading"> <td class="ey-formlabel1 alignedrow" style="width: 5% !important;" rowspan="2">company group</td> <td class="ey-formlabel1 alignedrow" style="width: 50px;"

Vagrant provison giving error : UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh.", "unreachable": true} -

i following error : unreachable! => {"changed": false, "msg": "failed connect host via ssh.", "unreachable": true} ansible -i tests -m ping command gives [warning]: host file not found: tests [warning]: provided hosts list empty, localhost available while doing vagrant provision. please can me out?

c# - Calculate IEnumerable<decimal> with decimal without using for-loop -

i given discount percentage decimal , have ienumerable<decimal> list of prices. want calculate discount price each 1 in linq. ienumerable<decimal> prices = new ienumerable<decimal>() { 100, 200, 300}; decimal discountpercentage = 20; shoot me idea, love try anything. hope helps ienumerable<decimal> prices = new list<decimal>() { 100, 200, 300}; decimal discountpercentage = 20; var discounted = prices.select(x=>x-x/100*discountpercentage).tolist();

javascript - jQuery dynamic id value returning UNDEFINED in WordPress -

i trying wordpress post id dynamically variable in jquery . however, returning value undefined when try debug in console . can me on ? here's code: data-id attribute displaying id of current post <?php $id = get_the_id(); ?> <button data-id="<?php echo $id; ?>" type="button" class="book btn btn-danger"> submit </button> my jquery jquery(document).ready(function(jquery){ jquery('.packageform').submit(packagesubmit); function packagesubmit(){ var id = jquery(this).attr('data-id'); var ceccform = jquery(this).serialize(); jquery.ajax({ type:"post", url: "wp-admin/admin-ajax.php", data: ceccform, success:function(data){ console.log(id); console.log(data); jquery(".response").html(data); jquery(".packageform")[0].re

java - OSGI knopflerfish missing packages or can not resolve oll oof them -

i have bundle jars dependencies not know why, when run bundle, can not resolve packages slf4j.jar . this error showed knopflerfish : warning: prefs file removed in background /root/.java/.userprefs/prefs.xml [stderr] ## debug: errors - frameworkerrorevent bundle #43 [stderr] ## debug: errors - frameworkerrorevent throwable: [stderr] org.osgi.framework.bundleexception: bundle#43, unable resolve: missing package(s) or can not resolve of them: org.slf4j -- not resolve exporting bundle - org.slf4j;version=1.6.1 bundle[id=29,gen=0]. and bundle manifest : manifest-version: 1.0 bundle-symbolicname: mapmatching export-package: its.fac.mapmatching.bundle, its.fac.mapmatching.impl, its.fac.mapmatching.thread, its.fac.mapmatching.utils bundle-version: 1.0.4 bundle-name: mapmatching bundle-classpath: . bundle-activator: its.fac.mapmatching.bundle.activator bundle-manifestversion: 3 import-package: its.fac.mapmatching.services, its.fac.mapmatching.type s, its.fac.poti.api.services,

bit shift - 74hc595 Cascading -

i have problem spi protocol. have 2 74hc595 cascade register , connected 7 segment. i have following pattern displaying numbers: static const uint8_t pattern[] = { 0b01000000, // 0 0b11101001, // 1 0b00100010, // 2 0b10100000, // 3 0b10001001, // 4 0b10000100, // 5 0b00000100, // 6 0b11100001, // 7 0b00000000, // 8 0b10000000, // 9 0b11101111}; // blank but can't execute program; there shift in bits when want display number 1 or 4 or 7. i noticed these 3 figure ends bit 1 (the problem is): 0b1110100**1**, // 1 0b1000100**1**, // 4 0b1110000**1**, // 7 with other numbers (0,2,3,5,6,8,9) program works well. here program: #define f_cpu 1000000ul #include <avr/io.h> #include <util/delay.h> //#define chek_bit(var,pos) ((var) & (1 << (pos))) #define hc595_port portc #define hc595_ddr ddrc #define hc595_ds_pos pc7 //data pin (ds) pin location 42 #define hc595_sh_cp_pos pc5 //shift clock (

angular - angular2 sub navigation bar, routing, and path parameters -

i have following urls: business/details/contacts/:id business/details/account/:id business/details/address/:id and in routing have following: const routes: routes = [ { path: 'details', component: businessdetailscomponent, children: [ { path: 'contacts/:id', component: businesscontactdetailscomponent }, { path: 'account/:id', component: businessaccountdetailscomponent }, { path: 'address/:id', component: businessaddressdetailscomponent } ] } ]; the idea businessdetailscomponent has navigation bar navigate between 3 pages. my problem navigation bar in parent needs id child routes. have tried businessdetailscomponent using code below, doesn't work. works in children, not in parent. have ideas?

c++ - Applying a variadic function with std::apply -

is possible apply variadic function tuple std::apply? for example, following code works fine gcc 6.2.1: void print_t(std::string i, std::string j) { std::cout << << " " << j << std::endl; } int main() { std::tuple<std::string, std::string> t{"ab", "cd"}; std::experimental::apply(print_t, t); return 0; } but if try apply variadic function: template<typename t> void vprint(t && t) { std::cout << std::forward<t>(t) << std::endl; } template<typename t, typename ... ts> void vprint(t && t, ts ... ts) { std::cout << std::forward<t>(t) << " "; vprint<ts...>(std::forward<ts>(ts)...); } int main() { std::tuple<std::string, std::string> t{"fd", "ab"}; std::experimental::apply(vprint, t); return 0; } the compiler complains cannot deduce template ar

assembly - How to Slide numbers in an array? -

i trying slide numbers array example, array 8,7,6,5,4,3,2,1 , when code finishes loop, should 1,8,7,6,5,4,3,2 , not sure how that .model small .data arr db 8,7,6,5,4,3,2,1 .code .startup mov cx,8 mov si ,7 lop: mov al ,arr[si] mov bl ,arr[si-1] mov arr[si], bl mov arr[si-1], al dec si loop lop .exit that drag last element thorough whole array: .model small .data arr db 8,7,6,5,4,3,2,1 .code .startup mov cx , 7 ; here: 1 less ( shift size-1 elements) mov si , 7 lop: mov al,arr[si-1] xchg al, arr[si] mov arr[si-1], al dec si loop lop .exit can't possibly imagine why need kind of algorithm, still.

opengl - Conversion from Eigen::Isometry3f to gluLookAt() -

i'm using opengl draw environment represented point cloud , i'd simulate robot navigating such environment pressing arrow keys , changing accordingly camera pose glulookat() function. since robot pose stored in eigen::isometry3f, i'd glad if point me out way switch between these 2 representations. thanks!

html - Angular2 Typescript Confirmation popover -

i'm start learning angular2 + typescript , trying find ng-really-message, ng-really-click (in angularjs) when i'm click delete button. can propose me best way? , link documentation. p.s. i'm using asp.net core, .net core you implement without need external module/directive: import { component } '@angular/core'; @component({ selector: 'app-root', template: ` <a (click)="confirm('are ready?', takeaction)">delete me</a> ` }) export class appcomponent { confirm(msg, fn){ let result = confirm(msg) if (result) { fn() } } takeaction(){ console.log('taking action!!') } }

what is complexity of following code and why? -

number of divisor using prime factorization. code: include using namespace std; vector<int> primes; // we'll preload primes once @ beginning int countdivisor(int n) { int divisor = 1; (int = 0; < primes.size(); i++) { if (n % primes[i] == 0) { int cnt = 1; while (n % primes[i] == 0) { n /= primes[i]; cnt++; } divisor *= cnt; } } return divisor; }

ubuntu - In Java, Heap Memory vs System Memory -

i have java process running on ubuntu os, per jconsole shows heap memory 150 mb same process "system monitor" in ubuntu shows approx. 470 mb. when check size of jars in classpath comes around 200 mb. i considering jars present in classpath loaded in jvm particular process. please can 1 me understand? ... missing on something? ubuntu system manager shows totally memory occupied jre(java runtime environment). jre contains other memory such stack memory(native & java stacks), code memory(where java classes , code present), along heap memory. thus, heap memory jconsole less it's shown memory manager. moreover, jre manages memory on own, independent of os. thus, may possible has acquired more memory os, program @ present requiring less memory. so, it's holding whenever next time program requires more memory, doesn't have go os request more memory. because system calls requesting more memory os expensive. coming jar loading question. jars, present

How do I edit a PPTX file via Java while it is open in Microsoft PowerPoint? -

with reference poi - cannot write file while opened in excel? the required functionality java application under development powerpoint version of above: using java, create slide , add content generated captured application data, add slide existing powerpoint file opened in microsoft powerpoint. if no powerpoint file opened, java application first open microsoft powerpoint if necessary, create new, empty powerpoint file , open in microsoft powerpoint. for example, application create test.pptx . application open in microsoft powerpoint application. next, add slide. operation succeeds , no exceptions thrown. however, changes not reflected in microsoft powerpoint view. if close file in microsoft powerpoint , open again, updated changes can seen. however, not want. the user must able continuously add new slides , see these slides update microsoft powerpoint view on-the-fly without needing restart microsoft powerpoint application after each slide addition. i have noticed when

c++ - Why does boost::when_all spawn a new thread -

i have following code, compiled boost 1.62. #define boost_thread_version 4 #define boost_thread_provides_executors #include <chrono> #include <thread> #include <boost/thread/future.hpp> #include <boost/thread/executors/loop_executor.hpp> using namespace std::literals::chrono_literals; int main() { auto start = boost::make_ready_future<int>(); boost::loop_executor ex; auto = start.then(ex, [](auto &&) { std::cout << "a"; }).share(); auto b = boost::when_all(a).then(ex, [](auto &&) { std::cout << "b";} ); auto c = boost::when_all(a).then(ex, [](auto &&) { std::cout << "c";} ); auto d = boost::when_all(std::move(b),std::move(c)).then(ex, [](auto &&) { std::cout << "d";} ); while ( ex.try_executing_one() ) std::this_thread::sleep_for(100ms); d.get(); return 0; } this spawns 4 tasks (a,b,c,d) diamond depe

sed - Append Line Bash File -

one liner in bash (for example using sed ) append line before last line in file. example old file foo bar foo bar foo bar foo bar new file foo bar foo bar foo bar --new foo bar foo bar i tried sed on osx that sed '$ --new foo bar' file.sh i error command expects \ followed text . ideas? while versions of sed (e.g. gnu sed) support i command on same line text inserted, posix standard specifies usage this: sed '$i\ --new foo bar' file.sh that is, i followed backslash , newline, text inserted.

ios - I am getting hex value in string <0000000a>? How can i convert it into integer in objective-c? -

first have convert hex <> generates exception when trying convert integer nsstring *steps =characteristic.value; int value2= [steps intvalue]; first have removce <>, convert hexadecimal string integer value. nsstring *strval = [[nsstring alloc] initwithdata:characteristic.value encoding:nsutf8stringencoding]; int intvalue = strval.intvalue;

cakephp 2 rss feed not correct working -

Image
i did cakephp according official documents . but output follows:

caching - How to properly use Removal Listeners of google cache? -

the api described here: https://github.com/google/guava/wiki/cachesexplained#removal-listeners considering example in link, , suppose google cache found connection evicted, thread obtained connection, google cache thread removed cached entry , called listener closed connection. if other thread wrote connection there error. is above scenario possible happen? know if google cache obtain lock in method should ok, doubt if there lock when doing operation. such lock doesn't exist in java's concurrenthashmap example.

sql - How to get the length of chineses string in Teradata? -

i count total number of string in chinese, , values may include numbers or english alphbet . i've used length() function in sql , 1 chinese word take 2 bytes. ex. length('測試test')=8, expected answer:6 (x) length('test')=4, expected answer:4 (o) so, how can right length of string if english, numbers, , chinese included?

ios - How to merge .gcda files generated by gcovr? -

let me explain problem first before asking solution. have appium automation tests our ios app. believe every test should start clean slate (i.e. app installation) instead of relying previous test bring app screen current test in question interested in. hoping approach correct. try generate .gcda file using approach mentioned here . clean state approach seems create multiple .gcda file every test. how merge in simpler way approach mentioned here (looks multiple steps - if there many .gcda files, need multiple steps). want coverage through appium till add unit tests legacy code, don't feel needed integrate complicated approach code coverage via appium ci, doing manually every time need coverage, mean converting .gcda lcov files, may time consuming. hence question. thanks, paddy you need add capabilities full reset of application before test. works on real devices on simulators. capabilities.setcapability("fullreset", true) capabilities.setcapability(&

powershell - Get a printers total page count from printserver -

i use printserver managing printers. looking method total page count of every printer connected printserver learn each printers usage. first thought internal powershell commands realized there no suitable cmdlets. though using wmi query printers. here stuck querying recent print jobs happening on server. there can see how many pages 1 of recent print jobs have. have no idea how know total page count each printer has printed in lifetime. how can information? total prints (aka impressions or count) stored on printer itself, if printer has web interface available via or using snmp. how query these might vary depending on printers manufacturer, here's example of using snmp: https://serverfault.com/questions/329789/query-page-count-from-hp-web-jetadmin-10-2

java - How spring manages threads for multiple api requests -

this question has answer here: how increase number of threads in tomcat thread pool? 3 answers i working on spring project. put thread.sleep(60000) on 1 api check thread safety. if call api other apis wait time. thought every api request processed separate threads. reason behind behaviour? issue resolved when set maxthreads in tomcat server.xml file. thank helping me resolve issue.

django - single database connection throughout the python application (following singleton pattern) -

my question best way maintain single database connection in entire application? using singleton pattern? how? conditions needed taken care of: in case of multiple requests, should using same connection in case connection closed, create new connection if connection has timed-out, on new request code should create new connection. the driver database not supported django orm. , due same driver related issues, using pyodbc connect database. right having below class creating , managing db connections: class dbconnection(object): def __init__(self, driver, serve, database, user, password): self.driver = driver self.server = server self.database = database self.user = user self.password = password def __enter__(self): self.dbconn = pyodbc.connect("driver={};".format(self.driver) +\ "server={};".format(self.server) +\

Python Module for MySQL Workbench not working -

i writing plugin mysql workbench, when execute nothing happens. (no errors) code: from wb import * import grt import mforms moduleinfo = definemodule(name= "workbench module", author= "openbyte", version="1.0") @moduleinfo.plugin("openbyte.workbench_module", caption= "workbench module", input=[wbinputs.currentsqleditor()], pluginmenu="sql/utilities") @moduleinfo.export(grt.int, grt.classes.db_query_editor) def executescript(editor): editor.replacecontents("test") return 0 if don't see errors means plugin wasn't executed, because should attributeerror. db_query_editor doesn't have function replacecontents . try this: from wb import definemodule, wbinputs import grt moduleinfo = definemodule(name= "testmodule", author= "oracle corp.", version="1.0") @moduleinfo.plugin("wb.sqlide.test_module", caption= "test module"

swift - IOS KeyChainWrapper value is nil after stored -

im beginner in swift 3.0. convert existing swift project 3.0 swift. after converrted, have issues storing user& password using key chain wrapper. i have checked result of bool, show false , value nil. can know possible causes? guiding. //this how store var savesuccessful:bool = keychainwrapper.defaultkeychainwrapper().setstring(txt_userid.text!, forkey: "userid") let savepass:bool = keychainwrapper.setstring(txt_password.text!, forkey: "password") //this how get/retrieve var password:string? = keychainwrapper.stringforkey("password") take @ answer here . problem "keychain sharing" capability has enabled.

javascript - Is there any way to identify updated/upserted in mongoose/mongoDB? -

actually want know there way identify updated old record or added new record after using findoneandupdate() upsert: true option in mongoose/mongodb?. i using // partial code var update = {$set:fieldstoset}; var options = {new: true, upsert:true}; var created = yield user.findoneandupdate(fieldsquery, update, options).exec(); // here want check updated old record or create new record use built-in timestamps option in schema, can check createat field. var user = new schema({ ..., { timestamps: true, }); this automatically add createdat , updatedat fields schema. applied code const calltime = new date(); user.findoneandupdate(...) .then((ret) => { // created if (ret.createat.gettime() >= calltime.gettime()) {} // modified });

java - Spring @PropertySource value not overridding -

in sprint boot application, have configuration class read property files: common.properties , dev.properties . have same key server.url in both property files. value not overridden. per spring documentation, last property file value should taken. it's not working. using spring annoatation @propertysource read values. serverconfiguration class @component @propertysources( { @propertysource(value = "file:common/config/common.properties", ignoreresourcenotfound = true), @propertysource(value = "file:dev/config/dev.properties", ignoreresourcenotfound = true) }) public final class serverconfiguration { private final applicationcontext applicationcontext; /** * server url */ @value("${server.url}") private string serverurl; } common.properties server.url=ws://some ip dev.properties server.url=ws://localhost:8080 the value common.properties taken always. tried changing order, still it's not working.

Python subprocess.Popen does not work with stdout -

i need implement external application calculate crc values modbus communication. executable requires input string , gives output this: crc16 = 0x67ed / 26605 crc16 (modbus) = 0x7ced / 31981 i call programm , afterwards type in input manually. p = popen(["some_file.exe", "-x"], stdin=pipe) p.communicate("some_string") this working fine far. however, want save output variable or (no file) further uses. i know there stdout , stderr arguments, when typing p = popen([file, "-x"], stdin=pipe, stdout=pipe, stderr=pipe) nothing happens @ all. does has idea do? thanks in advance. ps: using python 2.7 on windows 7. to output of ls, use stdout=subprocess.pipe. proc = subprocess.popen('ls', stdout=subprocess.pipe) output = proc.stdout.read() print output obtained from: pipe subprocess standard output variable note: if use stdin pipe must assign value, in example: grep = popen('grep ntp'.split(), st

android - How to invoke setCountry() to AutocompleteFilter Google place API? -

i implementing placeautocompletefragment auto complete of location. want restrict search specific country ( earlier use component=uk in url). how can achieve in below code. @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); placeautocompletefragment autocompletefragment = (placeautocompletefragment) getfragmentmanager().findfragmentbyid(r.id.place_autocomplete_fragment); autocompletefilter typefilter = new autocompletefilter.builder() .settypefilter(autocompletefilter.type_filter_regions) .build(); autocompletefragment.setfilter(typefilter); autocompletefragment.setonplaceselectedlistener(new placeselectionlistener() { @override public void onplaceselected(place place) { log.i(tag, "place: " + place.getname()); log.i(tag, "place: " + place.getid()); }

php array comperation, complete missing array locations -

i have 2 arrays: $array1 = array('name', 'email', 'phone'); $array2 = array('name' => 'john', 'phone' => '55-555-555'); i have created html table 2 arrays, array1 table heads, , array2 td contents. what happens becouse array2 missing value (email in case) phone data under mail column. result: $array2 = array('name' => 'john', 'email' => ' ', 'phone' => '55-555-555'); i tried follow this answer, has 2 main problems: the array keys desapear. the 0 values added @ end of array , not in original location. your source array wrong. need have this: $array1 = array('name' => '', 'email' => '', 'phone' => ''); and if want extend empty values, can use: $array2 = array('name' => 'john', 'phone' => '55-555-555'); the final array can made using arr

lua - spring redis running script : how to pass expiry time value -

i use lua script: local lock = redis.call('get', keys[1]) if not lock return redis.call('setex', keys[1], argv[1] ,argv[2] ); end return false from spring boot application use call redis script defaultredisscript<boolean> redisscript = new defaultredisscript<boolean>(); redisscript.setscriptsource(new resourcescriptsource(new classpathresource("checkandset2.lua"))); redisscript.setresulttype(boolean.class); system.out.println(redistemplate.execute(redisscript , collections.singletonlist("value123"),"10" ,"key123")); i exception : java.lang.classcastexception: java.lang.long cannot cast java.lang.string @ org.springframework.data.redis.serializer.stringredisserializer.serialize(stringredisserializer.java:32) @ org.springframework.data.redis.core.script.defaultscriptexecutor.keysandargs(defaultscriptexecutor.java:116) @ org.springframework.data.redis.core.script.defaultscriptexecutor$1.doinredis(def

osx - Mac Appstore rejection due to OpenSSL private APIs -

i attempting submit app mac appstore. contains receipt validation @ entry of app. code use dependent on openssl , downloaded version 1.0.2j , built it. after successful submission, during review process, informed issue : your app uses or references following non-public api(s): in framework: '/usr/lib/libssl.0.9.8.dylib' +++ : ssl3_send_alert i don't use function in of code comes built in openssl. since don't use network related function, believe there should command can use exclude during build of openssl. so, question be, if knows switch/options list openssl build passes mac appstore review process? glad in matter since searches resulted no information on matter. thanks in advance,

Twilio POST request returns 401 -

i'm getting 401 when trying post request twilio rest api. i've included following header: authorization: basic <base64 encoded '<accountsid>:<authtoken>' string> and i've tried basic authorization without encoding string result same. edit: response body: not authorized - signed requests twilio allowed. more info error at: https://www.twilio.com/help/faq/twilio-basics/why-does-my-twiml-bin-url-give-me-a-not-authorized-error-when-i-try-to-view-it how sign request? docs aren't clear it.

php - Wordpress plugin development --- upgrade routine: Interaction with user confirmation -

i try develop wordpress plugin, can upgraded smoothly , more importantly, want user choose whether upgrade or not. i got there, have refresh plugin setting page manually see upgrade complished. to make question more clear, let see following code: <?php class myplugin_admin_setting_class { private $options; public function __construct() { add_action('admin_menu', array( $this, 'myplugin_admin_menu' )); add_action('admin_init', array( $this, 'myplugin_admin_init' )); } public function myplugin_admin_menu() { add_options_page('my plugin setting page', 'myplugin', 'manage_options', 'myplugin', array( $this, 'myplugin_admin_page' )); } public function myplugin_admin_page() { $this->options = get_option('myplugin_options'); ?>

dataset - Cartesian product of only one column in Pyspark? -

as specified in question want cartesian of 1 column of rdd. example: rdd1: id1 id2 b id3 c my output should be: id1 a id1 b id1 c id2 b id2 b b id2 b c id3 c id3 c b id3 c c you can creating new rdd second column, rdd2=rdd.map(lambda l: l[1]) . cartesian of these 2 rdds: rdd.cartesian(rdd2).map(lambda v: (v[0][0],v[0][1],v[1])) the map there because cartesian return rows ((id1,a),a) , , map converts (id1,a,a)

amazon web services - AWS Java SDK Error Message: The authorization header is malformed; the authorization header requires three components -

i getting following error while trying put file in aws bucket error message: authorization header malformed; authorization header requires 3 components: credential, signedheaders, , signature. (service: amazon s3; status code: 400; error code: authorizationheadermalformed; request id: abc) http status code: 400 aws error code: authorizationheadermalformed error type: client request id: abc using following code task. idea doing wrong. awscredentials awscredentials = new basicawscredentials("key",", "secret"); amazons3 s3client = new amazons3client(awscredentials); s3client.setregion(com.amazonaws.regions.region.getregion(regions.us_west_2)); string key = "test"; try { s3client.putobject(new putobjectrequest(bucketname, key, file); } catch (amazonserviceexception ase) { system.out.println("error message: " + ase.getmessage()); system.out.println("http status code: "

c# 4.0 - Google Insights Page Speed API unable to connect server error -

i dealing google insight page speed api , have come across weird errors state "pagespeed unable connect server. ensure using correct protocol (http vs https), page loads in browser, , accessible on public internet." , "unable process request. please wait while , try again." i tried finding forum hard luck didn't found any google insight page speed forum also, have searched related question are pagespeed unable connect server , timeout error you can check api call. https://www.googleapis.com/pagespeedonline/v2/runpagespeed?url=http://stackoverflow.com&strategy=mobile&key=api_key i want overcome on these errors. looking forward response. the pagespeed api throw error when being overloaded. if you're making multiple calls api might want slow down call rate implement type of retry functionality.

How to Play MJP Files in C# WinForm by using Vlc.DotNet? -

how play mjp files in c# using vlc.dotnet ? here code- vlccontrol player = new vlccontrol(); panel1.controls.add(player); player.backcolor = system.drawing.color.aqua; player.imemode = system.windows.forms.imemode.nocontrol; player.location = new system.drawing.point(0, 0); player.name = "test"; player.rate = 0.0f; player.size = new system.drawing.size(1024, 768); player.play(new fileinfo(@"e:\sample\2.mjp")); try this. works me: private void play() { if (vlcvideo.isplaying) { vlcvideo.stop(); } string path = @"e:\sample\2.mjp"; locationmedia media = new locationmedia(path); vlcvideo.media = media; vlcvideo.play(); }

Entering the login credentials twice when creating multiple nodes with Selenium Grid -

i able create hub , 2 different nodes on 2 different machines run tests in parallel selenium grid. problem facing not being able register nodes hub , when run tests in firefox , chrome browsers, enters username , password twice on login page. here code snippets , testng xml file. this driver initializer file: package common; import java.net.malformedurlexception; import java.net.url; import java.util.concurrent.timeunit; import org.openqa.selenium.webdriver; import org.openqa.selenium.chrome.chromedriver; import org.openqa.selenium.firefox.firefoxdriver; import org.openqa.selenium.ie.internetexplorerdriver; import org.openqa.selenium.remote.desiredcapabilities; import org.openqa.selenium.remote.remotewebdriver; import org.testng.annotations.aftersuite; import org.testng.annotations.beforesuite; import org.testng.annotations.beforetest; import org.testng.annotations.parameters; import com.relevantcodes.extentreports.extentreports; import com.relevantcodes.extentreports