Posts

Hadoop - Getting input paths, java api -

i passing file pattern: fileinputformat.addinputpath(job, new path("/path/to/file*")); and wish know files matches after job finished running, provided successful. i have tried: job.getconfiguration().get("mapreduce.input.fileinputformat.inputdir") but returning same thing: "/path/to/file*" i wondering if there's method matching paths without resorting creating routine scanning of directories. your enlightenment appreciated. try link, has few ways path in mapper. but, sure talking few more ways. :) how input file name in mapper in hadoop program?

java - Verify ECDSA signature using SpongyCastle -

i'm trying verify ecdsa digital signature on android using spongycastle. have x509certificate contains public key need use verify can't quite figure out how publickey (down cast ecpublickey ) use ecdsasigner class. i've done using c# version of bouncycastle looks this: ecdsasigner signer = new ecdsasigner(); signer.init(false, cert.getpublikey()); in java version of apis, x509certificate.getpublickey() method returns publickey class instead of asymmetrickeyparameter . however, ecdsasigner.init() method needs cipherparameters object. can't figure out how ecdsa. for rsa signatures manually reconstructed new rsakeyparameters object: rsaengine engine = new rsaengine(); engine.init( false, new rsakeyparameters( false, ((rsapublickey) pubkey).getmodulus(), ((rsapublickey) pubkey).getpublicexponent() ) ); this doesn't seem ideal think should work. can't figure out how equivalent ecdsa. think there's b...

How to debug the issue Unable to install the app from APK in Android -

i have android application. my qa reported when try deploy build apks in various emulators, apk not getting installed in os versions less 4.3.3. however, it's installing in emulator or device versions greater 4.3.3 but try , debug issue, ran application "android studio" on emulators of version less 4.3.3, application gets deployed properly. does mean it's not programming issue, build file or packaging issue? here's gradle snippet android { compilesdkversion 21 buildtoolsversion '21.1.2' defaultconfig { applicationid 'com.intuit.qm2014' minsdkversion 14 targetsdkversion 21 } how debug/fix these type of issues? try install on problem devices command adb install path_to_apk and see output. also see logcat output on problem devices (possibly filter tag "package manager") , you'll see info installation failed.

Connection refused error in SOAP while sending request to WSDL -

org.apache.axis.client.call _call = createcall(); _call.setusername("nehalp"); _call.setpassword("sap@123"); _call.setoperation(_operations[0]); _call.setusesoapaction(true); _call.setsoapactionuri("http://sap.com/xi/webservice/soap1.1"); _call.setencodingstyle(null); _call.setproperty(org.apache.axis.client.call.send_type_attr, boolean.false); _call.setproperty(org.apache.axis.axisengine.prop_domultirefs, boolean.false); _call.setsoapversion(org.apache.axis.soap.soapconstants.soap11_constants); _call.setoperationname(new javax.xml.namespace.qname("", "unlock")); setrequestheaders(_call); setusername("nehalp"); setpassword("sap@123"); setattachments(_call); try { java.lang.object _resp = _call.invoke(new java.lang.object[] {unlock_...

jquery - wrap image with next link -

i'm working on slideshow upcoming events. slides suppose link corresponding event page. but, not slides suppose have link if don't have event page. here html i'm able output: <ul> <li><img><a href="/link1">link1</a></li> <li><img><a href="/link2">link2</a></li> <li><img></li> // 1 doesn't have link </ul> then jquery i'm trying change html this: <ul> <li><a href="/link1"><img></a></li> <li><a href="/link2"><img></a></li> <li><img></li> // 1 doesn't have link </ul> here jquery i've been working on: $(function() { $(' ul li img').each(function() { // each image if($(' ul li img').next('a').attr("href").length) // check if banner has link var = $(this).next(...

python - How to add a repeated column using pandas -

i doing homework , encounter problem, have large matrix, first column y002 nominal variable, has 3 levels , encoded 1,2,3 respectively. other 2 columns v96 , v97 numeric. now, wanna group mean corresponds variable y002. wrote code group = data2.groupby(by=["y002"]).mean() then index each group mean using group1 = group["v96"] group2 = group["v97"] now wanna append group mean new column original dataframe, in each mean matches corresponding y002 code(1 or 2 or 3). tried code, shows nan. data2["group1"] = pd.series(group1, index=data2.index) hope me this, many :) ps: hope makes sense. r language, can same thing using data2$group1 = with(data2, tapply(v97,y002,mean))[data2$y002] but how can implement in python , pandas??? you can use .transform() import pandas pd import numpy np # data # ============================ np.random.seed(0) df = pd.dataframe({'y002': np.random.randint(1,4,100), 'v96': ...

ios - GCDAsyncSocket: [socket acceptOnPort: error:] not accepting -

so have been trying create 2 gcdasyncsocket 's in project, 1 ( socket ) uploads file server , other ( listensocket ) waits process server communicate it. in viewcontroller have initialized them in viewdidload method , setup delegate self both sockets. socket = [[gcdasyncsocket alloc] initwithdelegate:self delegatequeue:dispatch_get_main_queue()]; listensocket = [[gcdasyncsocket alloc] initwithdelegate:self delegatequeue:dispatch_get_main_queue()]; i made listensocket start listening by nserror *err = nil; if (![listensocket acceptonport:19920 error:&err]) { nslog(@"listensocket failed accept: %@", err); } i made socket connect remote server , start uploading files. the problem socket works fine , can upload , read response server, seems can't access accepting listensocket way. not other process on server, nor using telnet or typing ip address , port number browser. why , how fix it? edit: here's doing app: i working on app pr...