canonicalization

How to implement a canonicalizing mapping in Java?

心不动则不痛 提交于 2019-12-20 09:40:37
问题 I am currently rolling my own little ORM, and find myself faced with the task of creating a canonicalizing mapping in order to prevent loading the same entity from the database more than once. My current approach is to use a HashMap<Object, WeakReference<Object>> . The key is the primary key of the mapped database-entity (an ArrayList<Object> if it is a composite key), and the values are WeakReference<Object> . My main problem is how to clean the map up? When an object is not used any more,

How to canonicalize WSDL files in Java?

北战南征 提交于 2019-12-20 03:33:14
问题 I need to find differences in two WSDL files. I started by pretty-printing them like here, but I see there are same things (e.g. complexType s) in the two files defined (for whatever stupid reason) in a different order. I want to canonicalize the files further, so I can later use things like standard diff to find the differences. No idea if there's a defined canonical form for WSDL, I know there's Canonical XML, but I need to go a bit further and sort all the things whose order doesn't matter

Site Performance: rel=canonical vs redirect 301

杀马特。学长 韩版系。学妹 提交于 2019-12-12 06:32:05
问题 From this page on the blog of Matt Cutts, he says that rel=canonical should be a secondary choice if you can't use a 301 redirect. Is there any performance issue with using a 301 redirect instead of a rel=canonical ? 回答1: In my experience, the performance difference is negligible. There are more steps involved in the implementation of 301 redirects, so rel=canonical might perform slightly better. The extra steps are typically executed very quickly and should not add any noticeable delay or

handling carriage return in canonicalization with java

老子叫甜甜 提交于 2019-12-11 13:06:34
问题 I am trying to canonicalize an html text node by com/sun/org/apache/xml/internal/security/c14n/Canonicalizer.java class. My input file has carriage return and a line feed at the end. Upon canonicalization I expect to see the carriage return transformed into . However, the the output I get does not contain the carriage return. It only contains the line feed. How should I modify my code to include the carriage return? example: my input with cr and lf at the end <MyNode xmlns="http://www

Google Analytics: How to merge canonical URLs for historical data

女生的网名这么多〃 提交于 2019-12-11 09:27:23
问题 I have a single-page online app which relies on query strings. Google Analytics tracking was added, however canonical meta wasn't added until a few days later, so now Analytics is showing several entries for the same page because of a difference in the query string, e.g. "/app/?s=4324,543,12421" and "/app/?s=5234,86754" whereas the canonical is just "/app/". Is there a way to merge data for the extra pages (in Reporting > Behavior > Overview) in GA which have since been canonicalised? 回答1: To

ESAPI canonicalize malforming url

五迷三道 提交于 2019-12-06 05:00:47
We have an application that accepts URLs from users. This data needs validation, and we're using ESAPI for this purpose. However, we're struggling with URLs containing ampersands. The problem appears when ESAPI canonicalizes the data before validation. &pid=123 in the URL turns into πd=123 for example. Since π is not whitelisted, the validation fails. I've tried encoding it, but ESAPI is smarter than that and does canonicalization to avoid double encoding and mixed encoding. I'm a bit stumped here and I'm not sure how to proceed. avgvstvs This problem is a known bug in ESAPI. I started working

How To Use XmlDsigC14NTransform Class in C#

亡梦爱人 提交于 2019-12-06 03:26:33
问题 I am trying to canonicalize an xml node by using System.Security.Cryptography.Xml.XMLDsigC14nTransform class of c# .net Framework 2.0. The instance expects three different input types, NodeList, Stream and XMLDocument. I try the transform with all of these input types but I get different results. What I really want to do is to canonicalize a single node, but as you can see in the output file, the output does not contain any of the inner xml. Any suggestions about the proper way to

Windows: How to canonicalize a file to the special folder?

五迷三道 提交于 2019-12-04 22:52:30
问题 i want to to persist some filenames for the user (e.g. recent files). Let's use six example files: c:\Documents & Settings\Ian\My Documents\Budget.xls c:\Documents & Settings\Ian\My Documents\My Pictures\Daughter's Winning Goal.jpg c:\Documents & Settings\Ian\Application Data\uTorrent c:\Documents & Settings\All Users\Application Data\Consonto\SpellcheckDictionary.dat c:\Develop\readme.txt c:\Program Files\Adobe\Reader\WhatsNew.txt i'm now hard-coding path to special folders. If the user

C# Calculate and verify SHA256 value for SEPA (XML) paymentfile

徘徊边缘 提交于 2019-12-04 12:51:39
i am struggling with the same issue like Markus Dreyer: C# Calculate SHA256 value for SEPA (XML) paymentfile According to the DFÜ Agreement i have to calculate a sha256 hash value: The hash value is created using the entire contained document, including the opening and closing tag. The document is canonicalized according to Canonical XML, version 1.0. ( http://www.w3.org/TR/2001/REC-xml-c14n-20010315 ). In the case of included documents, the canonisation has also to be executed accord-ing to the main document. SHA-256 is used as hash algorithm. This is a sample valid xml File ( exported from

Windows: How to canonicalize a file to the special folder?

别来无恙 提交于 2019-12-03 14:25:34
i want to to persist some filenames for the user (e.g. recent files). Let's use six example files: c:\Documents & Settings\Ian\My Documents\Budget.xls c:\Documents & Settings\Ian\My Documents\My Pictures\Daughter's Winning Goal.jpg c:\Documents & Settings\Ian\Application Data\uTorrent c:\Documents & Settings\All Users\Application Data\Consonto\SpellcheckDictionary.dat c:\Develop\readme.txt c:\Program Files\Adobe\Reader\WhatsNew.txt i'm now hard-coding path to special folders. If the user redirects their folders, roams to another computer, or upgrades their operating system, the paths will be