decode

Failing to decode as same length as input

丶灬走出姿态 提交于 2019-11-29 13:09:22
This is a Link Embedding Messages in Digital Images using JAVA, they provide the sample code also, but when i tried to embed over 38 characters, it will give different output when i run the decode part. I am using 111x115 (6.38k) image. my question is in this article, it said n=(p-32)/8 , n is the maximum length of message and P is the number of pixels. so if i calculate the image i used, it will be n=(6380-32)/8=793.5. Since like i could store 793.5 characters in this image, but when i tried to put more than 38 characters, it will give me different output when i did decode part. (under 38

How to decode a python string

淺唱寂寞╮ 提交于 2019-11-29 13:06:39
I have some code which I would like to be decoded but not having much luck in guessing what the codepage is, if any is being used. Any help would be much appreciated. Here is the code: exec("import re;import base64");exec((lambda p,y:(lambda o,b,f:re.sub(o,b,f))(r"([0-9a-f]+)",lambda m:p(m,y),base64.b64decode(

Decode an ENCODED unicode string in Python

不羁岁月 提交于 2019-11-29 11:55:20
I need to decode a "UNICODE" encoded string: >>> id = u'abcdß' >>> encoded_id = id.encode('utf-8') >>> encoded_id 'abcd\xc3\x9f' The problem I have is: Using Pylons routing, I get the encoded_id variable as a unicode string u'abcd\xc3\x9f' instead of a just a regular string 'abcd\xc3\x9f' : Using python, how can I decode my encoded_id variable which is a unicode string? >>> encoded_id = u'abcd\xc3\x9f' >>> encoded_id.decode('utf-8') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/test/vng/lib64/python2.6/encodings/utf_8.py", line 16, in decode return codecs

Why is Oracle's DECODE giving me a different value than NVL?

无人久伴 提交于 2019-11-29 11:18:37
This query: select nvl(0.75,0) from dual gives me 0.75 (numeric) but this query: select decode(1,0,null,0.75) from dual gives me '.75' (string). Why? I tried to fix this by changing the second query to: select decode(1,0,null,to_char(0.75,'0.99')) from dual but in my actual code the 0.75 will be a field (NUMBER) that may have a different number of decimal places and I'm not suppose to add/remove anything from that value. Any ideas on how to fix the missing zero issue but still support all possible decimal lengths? It's because the 3 rd parameter of your decode statement is NULL; as per the

Python - Converting Hex to INT/CHAR

拥有回忆 提交于 2019-11-29 10:57:24
I am having some difficulty changing a hex to an int/char (char preferably). Via the website; http://home2.paulschou.net/tools/xlate/ I enter the hex of C0A80026 into the hex box, in the DEC / CHAR box it correctly outputs the IP I expected it to contain. This data is being pulled from an external database and I am not aware how it is being saved so all I have to work with is the hex string itself. I have tried using the binascii.unhexlify function to see if I could decode it but I fear that I may not have a great enough understanding of hex to appreciate what I am doing. Attemping to print

How to decode audio via FFmpeg in Android

末鹿安然 提交于 2019-11-29 10:28:08
问题 I am writing a player for Android with FFmpeg compiled for Android NDK. I could open the file through FFmpeg and wrote this: av_register_all(); char* str = (*env) -> GetStringUTFChars(env, argv, 0); __android_log_print(ANDROID_LOG_INFO, "HelloNDK!", str, str); if (av_open_input_file (&pFormatCtx, str, NULL, 0, NULL) != 0) return -2; // Couldn't open file // Retrieve stream information if (av_find_stream_info(pFormatCtx) < 0) return -3; // Couldn't find stream information // Dump information

decodeURI decodes space as + symbol

故事扮演 提交于 2019-11-29 10:27:23
I have created a Google Custom Search. The logic is when a user search, the page will display result and the title of the page will be changed to the search term using javascript. I use decodeURI to decode the unicode characters. But the space is decode as +. For example if I search money making it will be decoded as money+making and it is displayed as title. Someone please help to solve this. I want to display space instead of the symbol +. The code is if (query != null){document.title = decodeURI(query)+" | Tamil Search";}</script> The Google Closure Library provides its own urlDecode

How can I decode UTF-16 data in Perl when I don't know the byte order?

 ̄綄美尐妖づ 提交于 2019-11-29 09:38:11
问题 If I open a file ( and specify an encoding directly ) : open(my $file,"<:encoding(UTF-16)","some.file") || die "error $!\n"; while(<$file>) { print "$_\n"; } close($file); I can read the file contents nicely. However, if I do: use Encode; open(my $file,"some.file") || die "error $!\n"; while(<$file>) { print decode("UTF-16",$_); } close($file); I get the following error: UTF-16:Unrecognised BOM d at F:/Perl/lib/Encode.pm line 174 How can I make it work with decode ? EDIT: here are the first

Inconsistent sample time / presentation time during video decoding

扶醉桌前 提交于 2019-11-29 07:23:53
I'm writing an APP that can encode video by camera input and process video by decode-edit-encode steps. For the camera, I use the Camera class rather than Intent to configure the details settings of the camera. Then I feed the camera frames to the encoder (MediaCodec in API 16) and the muxer (I use ffmpeg muxer since I want to work on 4.1 Devices). I measure the time code of camera frames by system nano time, and select a subset of frames to fit a desired FPS (currently 15). There are some small "noises" in the time values, for example (in ms): 0, 60718, 135246, 201049, ... rather than 0,

Error code -8969, -12909 while decoding h264 in iOS 8 with video tool box

爷,独闯天下 提交于 2019-11-29 07:19:46
问题 I have the h264 stream inAnnex B format and follow this link here to implements h264 decoding with iOS8 videoToolBox. I check the OSStatus in every step. use CMVideoFormatDescriptionCreateFromH264ParameterSets with the SPS and PPS data to create a CMFormatDescription.(status == noErr) create a VTDecompressionSession using VTDecompressionSessionCreate. (status == noErr) capture the NALUnit payload into a CMBlockBuffer making sure to replace the start code with a byte length code. (status ==