signature

index() error message incorrect for third parameter?

若如初见. 提交于 2019-12-07 03:09:24
问题 sub count-a { my $word = "banana"; my $count = 0; my $foo; # Source of error: $foo intentionally not given a value. # The value ought to be zero. while True { $foo = index $word, "a", $foo; last unless $foo.defined; $foo++; $count++ } return $count; } say count-a; Is this error message wrong? Cannot resolve caller index(Str: Str, Any); none of these signatures match: (Str:D $: Cool:D $needle, *%_) (Str:D $: Str:D $needle, *%_) (Str:D $: Cool:D $needle, Cool:D $pos, *%_) (Str:D $: Str:D

Define recursive signatures for modules

梦想与她 提交于 2019-12-07 01:32:57
问题 I know that it is possible to define recursive modules, does anyone know how to define recursive signatures? For instance, I would like to realize: module type AAA = sig module Bbb : BBB type 'a t val f : 'a Bbb.t -> 'a t end module type BBB = sig module Aaa : AAA type 'a t val g : 'a Aaa.t -> 'a t end Could anyone help? 回答1: You can't, as far as I can tell. The closest solution is to limit the "recursive" bits to what is actually needed to express each signature separately: module type AA =

Two methods with same erasure aren't necessary override-equivalent (or they signatures aren't subsignatures between them)?

和自甴很熟 提交于 2019-12-06 22:57:07
问题 Im reading the incredible book “a programmer's guide to java scjp certification” for jdk6 and theres a section about generic overriding. On it is described subsignature and override-equivalent and describes some examples of override-equivalent that I quote: Given the following three generic method declarations in a class: static <T> void merge (MyStack<T> s1, MyStack<T> s2) { /*...*/ } static <T> void merge (MyStack<T> s1, MyStack<? extends T> s2) { /*...*/ } static <T> void merge (MyStack<T>

Verifying that two apk files are signed with the same signature

﹥>﹥吖頭↗ 提交于 2019-12-06 22:07:17
问题 I would like to verify that two APK files have been signed with the same certificate. I have the whole Java SDK available but would like to it from Java code to make for cross-platform reasons. Any ideas? 回答1: all about is to Comparing your app's signatures a) get signature of both aps b) check if sig.hashCode() == releaseSig.hashCode 1) by run-time check using android api: Signature[] sigs = context.getPackageManager() .getPackageInfo(context.getPackageName(), PackageManager.GET_SIGNATURES)

Signature.verify() is always returning false

一曲冷凌霜 提交于 2019-12-06 15:01:14
问题 When I am tring to verify the signature's using Signature class , the Signature.verify() method it is always returning false. my code is as below. package test; import com.sun.org.apache.xerces.internal.impl.dv.util.Base64; import java.io.UnsupportedEncodingException; import java.math.BigInteger; import java.security.*; import java.security.spec.InvalidKeySpecException; import java.security.spec.RSAPublicKeySpec; import java.util.logging.Level; import java.util.logging.Logger; /* this method

Need and impossibility of having a type of a signature

柔情痞子 提交于 2019-12-06 13:48:53
问题 I have defined 2 signature and 4 modules as follows, and it works fine: module type TRIANGLE = sig type 'a t val get ... val set ... ... end module type MATRIX = sig type 'a t val unionArrayArray: 'a TriangleArray.t -> 'a TriangleArray.t -> 'a t val unionListList: 'a TriangleList.t -> 'a TriangleList.t -> 'a t val unionArrayList: 'a TriangleArray.t -> 'a TriangleList.t -> 'a t val unionListArray: 'a TriangleList.t -> 'a TriangleArray.t -> 'a t ... end module rec MatrixArray: MATRIX = struct

Bitmap (of a signature) comparison in c#

一曲冷凌霜 提交于 2019-12-06 12:49:24
We have a for fun project which require us to compare two black and white bitmaps of two signature and say whether they are the same persons signature. As this is just two loaded bitmaps rather than data captured from a tablet the approach is going to be a little different to normal signature recognition. I am thinking it would require the following steps Crop the bitmaps to just the signature Try to work out some kind of rotation to align them Resize to make the cropped / rotated bitmaps the same Analyse the signature inside (maybe by breaking down into a grid) Does anyone have any thoughts

What is the default signature algorithm of bouncycastle CMSSignedDataGenerator if not explicitly specified

拥有回忆 提交于 2019-12-06 12:11:13
问题 I was wondering what signature algorithm (digestOID) BouncyCastle uses by default if you do not specify it explicitly like like in the code below: List certList = new ArrayList(); CMSTypedData msg = new CMSProcessableByteArray("Hello world!".getBytes()); certList.add(signCert); Store certs = new JcaCertStore(certList); CMSSignedDataGenerator gen = new CMSSignedDataGenerator(); ContentSigner sha1Signer = new JcaContentSignerBuilder("SHA1withRSA").setProvider("BC").build(signKP.getPrivate());

Objective C - “Duplicate declaration of method” compilation error

為{幸葍}努か 提交于 2019-12-06 11:44:27
I have this piece of code: - (id) getSearchSuggestions:(NSString*)q; - (NSOperationQueue*) getSearchSuggestions:(NSString*)q callback:(id<UserDelegate>)callback; - (id) getSearchSuggestions; - (NSOperationQueue*) getSearchSuggestions:(id<UserDelegate>)callback; And I Xcode keeps showing me an error on the last line: Duplicate declaration of method "getSearchSuggestions" Why? It seems to me that the signatures are all different. This signature: - (id) getSearchSuggestions:(NSString*)q; Is identical to this signature: - (NSOperationQueue*) getSearchSuggestions:(id<UserDelegate>)callback; All

How to generate a signed PDF w/o green checkmark

随声附和 提交于 2019-12-06 10:53:13
问题 I'm signing PDF's using iText. I'm including a graphic in the signature. This works, but the green checkmark (or yellow question mark) that shows when the document is verified interferes with the graphic I inserted, making the end result look ugly. It either shows up above or below the signature graphic, but I can't get it to disappear. Does anyone know how to fix this? 回答1: sorry but I don't understand this. You want a valid signature but no possibility to see that the signature is valid?