decoding

PHP array Encoding and Decoding:Need a function for encoding and decoding string or array with delimiters or array itself

自作多情 提交于 2019-12-18 09:38:34
问题 I am in a need of function that will encode and decode all the id's of a tree nodes. I function that will check if its a single string or array string or string with delimiters. I am having one plugin for encoding and decoding. here goes my plugin: FIle:encode.class.php <?php /*------------------------- Author: Jonathan Pulice Date: July 26th, 2005 Name: JPEncodeClass v1 Desc: Encoder and decoder using patterns. -------------------------*/ class Protector { var $Pattern = ""; var $PatternFlip

Parsing XML string using XSLT

我是研究僧i 提交于 2019-12-18 09:17:49
问题 I have an XML document that has a TextBlock that contains HTML code. <TextBlock> <h1>This is a header.</h1> <p>This is a paragraph.</p> </TextBlock> In the actual XML, however, it is coded like this: <TextBlock> <h1>This is a header.</h1> <p>This is a paragraph.</p> </TextBlock> So when I use <xsl:value-of select="TextBlock"/> it displays all of the coding on the page. Is there a way using XSLT to convert < to < within the TextBlock element? 回答1: <xsl:value-of select="TextBlock" disable

How to receive variables in a post in google app engine that contains string with chars like: õ á?

 ̄綄美尐妖づ 提交于 2019-12-18 07:09:12
问题 email = self.request.get('email') name = self.request.get('name') mail.send_mail(sender="myemail", email=email, body=name, subject="sss " + name + "sdafsaã") // added ã: the problem was that "sdafsaã" should be u"sdafsaã". with a "u" before the string. and now it works then i get this main.py", line 85, in post subject="sss " + name + "sdafsa", UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 36: ordinal not in range(128) the might have chars like õ ó and something like

Android how to scale an image with BitmapFactory Options

旧时模样 提交于 2019-12-18 05:37:31
问题 I want to decode an image from the SD card with BitmapFactory.decodeFile(path, options). I also want images that are larger than 2048x2048 pixels to be scaled down to at most 2048x2048 (maintaining the proportions). I could do this manually after getting the bitmap, but that would require allocating a large amount of bytes in addition to the ones already allocated. How should i set up my BitmapFactory.Options object to get that effect? Thanks 回答1: Use BitmapFactory.Options.inSampleSize when

Unicode Encoding and decoding issues in QRCode

…衆ロ難τιáo~ 提交于 2019-12-18 01:18:11
问题 I am trying to generate UTF-8 QRCode so that I can encore accents and Unicode characters. To test it, I am using many decoding solution : http://zxing.org/w/decode.jspx - The zxing project also used in Android http://www.drhu.org/QRCode/QRDecoder.php - a PHP Decoder http://zbar.sf.net - The ZBar bar code reader - OpenSource and C project for embedded All of them give me always the same result. You can try this image works well with Unicode Characters. But if I am trying to use zxing or Google

Android byte[] to image in Camera.onPreviewFrame

故事扮演 提交于 2019-12-17 10:34:33
问题 When trying to convert the byte[] of Camera.onPreviewFrame to Bitamp using BitmapFactory.decodeByteArray gives me an error SkImageDecoder::Factory returned null Following is my code: public void onPreviewFrame(byte[] data, Camera camera) { Bitmap bmp=BitmapFactory.decodeByteArray(data, 0, data.length); } 回答1: This has been hard to find! But since API 8, there is a YuvImage class in android.graphics. It's not an Image descendent, so all you can do with it is save it to Jpeg, but you could save

md5 decoding. How they do it?

时光毁灭记忆、已成空白 提交于 2019-12-17 06:51:32
问题 i thought, that it is impossible to decode md5 hashes, but i found tools, which decode them here. but i have no idea, how they do it in such a short period of time(it takes about a second). Help me please to understand it. Thanks 回答1: It doesn't decode an MD5 hash. It uses what's called a rainbow table... That's why it's so important to use salted hashes instead of storing the hash directly... 回答2: It is impossible to decode an MD5 hash as it is a one way algorithm, they will have a database

md5 decoding. How they do it?

ⅰ亾dé卋堺 提交于 2019-12-17 06:51:32
问题 i thought, that it is impossible to decode md5 hashes, but i found tools, which decode them here. but i have no idea, how they do it in such a short period of time(it takes about a second). Help me please to understand it. Thanks 回答1: It doesn't decode an MD5 hash. It uses what's called a rainbow table... That's why it's so important to use salted hashes instead of storing the hash directly... 回答2: It is impossible to decode an MD5 hash as it is a one way algorithm, they will have a database

UnicodeDecodeError: 'ascii' codec can't decode

拜拜、爱过 提交于 2019-12-14 00:31:59
问题 I'm reading a file that contains Romanian words in Python with file.readline(). I've got problem with many characters because of encoding. Example : >>> a = "aberație" #type 'str' >>> a -> 'abera\xc8\x9bie' >>> print sys.stdin.encoding UTF-8 I've tried encode() with utf-8, cp500 etc, but it doesn't work. I can't find which is the right Character encoding I have to use ? thanks in advance. Edit: The aim is to store the word from file in a dictionnary, and when printing it, to obtain aberație

Get unreadable string from GPS tracker

我只是一个虾纸丫 提交于 2019-12-13 22:36:22
问题 I'm getting this unreadable string from a GPS tracking device and I need to decode these information so I can use it in my application (c#). $A grQ05Ah@‘)���ÿÿûÿÿ����°#~À‚¡U But in fact what i expect is something like below : *HQ,XXXXXX,41,4#V1,time,A,**Lat**,N/S,**Lng**,W/E,000.00,000,date,FFFFFBFF,432,35,32448,334 How can i convert the string to standard format in c# ? I convert data to byte as you can see : 24-41-20-20-67-72-51-30-35-41-68-40-91-29-3F-3F-3F-FF-FF-FB-FF-FF-3F-3F-3F-3F-B0-23