decode

Cannot decode object of class

匿名 (未验证) 提交于 2019-12-03 01:20:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to send a "Class" to my Watchkit extension but I get this error. * Terminating app due to uncaught exception 'NSInvalidUnarchiveOperationException', reason: '* -[NSKeyedUnarchiver decodeObjectForKey:]: cannot decode object of class (MyApp.Person) Archiving and unarchiving works fine on the iOS App but not while communicating with the watchkit extension. What's wrong? InterfaceController.swift let userInfo = ["method":"getData"] WKInterfaceController.openParentApplication(userInfo, reply: { (userInfo:[NSObject : AnyObject]!, error

Concat GROUP BY in Vertica SQL

匿名 (未验证) 提交于 2019-12-03 01:12:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I need to get a comma separated list of ids as a field for a messy third party api :s This is a simplified version of what I am trying to achieve. | id | name | |====|======| | 01 | greg | | 02 | paul | | 03 | greg | | 04 | greg | | 05 | paul | SELECT name, {some concentration function} AS ids FROM table GROUP BY name Returning | name | ids | |======|============| | greg | 01, 03, 04 | | paul | 02, 05 | I know MySQL has the CONCAT_GROUP function and I was hoping to solve this problem without installing more functions because of the

How to decode “application/x-qabstractitemmodeldatalist” in Qt for drag and drop?

匿名 (未验证) 提交于 2019-12-03 01:12:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I've created a child class of QTreeWidget that I want to be able to drag items from another tree widget too (I want to handle the insertion myself though), as well as from a QListWidget. I've overridden the dropEvent method in my class, and it looks like the mimetype of the data I'm getting from my QTreeWidget is application/x-qabstractitemmodeldatalist, how can I decode this to get the items from the tree back out? 回答1: You can decode it as follows: QByteArray encoded = qMimeData->data("application/x-qabstractitemmodeldatalist");

Use (Python) Gstreamer to decode audio (to PCM data)

匿名 (未验证) 提交于 2019-12-03 01:10:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm writing an application that uses the Python Gstreamer bindings to play audio, but I'm now trying to also just decode audio -- that is, I'd like to read data using a decodebin and receive a raw PCM buffer. Specifically, I want to read chunks of the file incrementally rather than reading the whole file into memory. Some specific questions: How can I accomplish this with Gstreamer? With pygst specifically? Is there a particular "sink" element I need to use to read data from the stream? Is there a preferred way to read data from a pygst

How can I de-obfuscate or decode this Perl code?

匿名 (未验证) 提交于 2019-12-03 01:08:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I found this code and I think it's encoded. I tried to understand how it's encoded or how can read it. Does anyone have an idea to decode this code? #!/usr/bin/perl eval unpack u=>q{_<')I;G0@(EQN7&5<>#5"7'@S,UQX,S-<>#9$7'@U-UQX-C%<>#<R7'@V15QX-CE<>#9%7'@V-UQX,C!<>#4Y_7'@V1EQX-S5<>#(P7'@T1%QX-C%<>#<Y7'@R,%QX-$5<>#8U7'@V-5QX-C1<>#(P7'@U-%QX-D9<>#(P7'@T_.5QX-D5<>#<S7'@W-%QX-C%<>#9#7'@V0UQX,C!<>#<S7'@V1EQX-D1<>#8U7'@P05QX,C!<>#(P7'@R,%QX_,C!<>#(P7'@R,%QX,C!<>#(P7'@R,%QX-$1<>#9&7'@V-%QX-S5<>#9#7'@V-5QX-S-<>#!!7'@R,%QX,C!<_>#(P7'@R,%QX,C!<>#(P7'@R

Python - Attempt to decode JSON with unexpected mimetype:

匿名 (未验证) 提交于 2019-12-03 01:07:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I recently swapped over from requests to aiohttp because I couldn't use it in asyncio loops. The swap went perfectly and everything goes well except for one thing. My console is full of Attempt to decode JSON with unexpected mimetype: and Attempt to decode JSON with unexpected mimetype: txt/html; charset=utf-8 My code has a list of sites it goes too and grabs JSON from, Each site is different but my loop is basically the same for each of them, Ive simplified it here: PoolName = "http://website.com" endpoint = "/api/stats" headers = "headers

How to decode gzip encoded html?

匿名 (未验证) 提交于 2019-12-03 01:00:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I got data from web server: data := ' HTTP/1.1 200 OK Content-Encoding: gzip Vary: Accept-Encoding Content-type: text/html Transfer-Encoding: chunked Server: Apache 3d5 ???????????????????????????????????? ???????????????????????????????????? ???????????????????????????????????? '; The size of data is: 3d5 (in hex) all is stored to TIdBytes variable "data". How to decode gziped data, change something in it, and encode back and edit the length 3d5 to new. 回答1: The Transfer-Encoding response header is set to chunked . That means the server

Linking libavcodec and libavformat: Undefined references

匿名 (未验证) 提交于 2019-12-03 00:59:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to compile a project I am working on that uses ffmpeg libraries. The project is written in C. The header files are appropriately included in the source code. In particular, it seems to be using libavcodec and libavformat , and these libraries are appropriately linked in the Makefile with the LDFLAGS. Here are the flags used: -lavcodec -lavformat -lswscale -lavutil Now, because the packaged libraries that come with Ubuntu were too out-of-date, I downloaded the latest source code for ffmpeg, compiled it and installed it. I removed

BASE64 Encode and Decode is not working

匿名 (未验证) 提交于 2019-12-03 00:59:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am working on android applicatin in Delphi XE5 and I need to BASE64 encode and decode some strings. Any idea how to fix it? I found BASE64 unit http://www.delphipraxis.net/991-base64-mime-en-decoding.html But does FireMonkey support AnsiString and PAnsiChar type and what unit to include to use this type? My code uses IdCoderMIME; ... function Encode64(S: string): string; var IdEncoderMIME: TIdEncoderMIME; begin try IdEncoderMIME := TIdEncoderMIME.Create(nil); Result := IdEncoderMIME.EncodeString(S); finally IdEncoderMIME.Free; end; end;

Oracle Decode function results with different formats

匿名 (未验证) 提交于 2019-12-03 00:58:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: SELECT DECODE (SYSDATE, SYSDATE + 1, NULL, SYSDATE) FROM DUAL; SELECT DECODE (SYSDATE, SYSDATE + 1, TO_DATE (NULL), SYSDATE) FROM DUAL; why am i getting the results in different formats from the queries above? i am using Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi 回答1: the decode function result has the datatype of the third parameter. In the first case, since no datatype is specified for NULL , the default VARCHAR2 is used. In the second case, a DATE is explicitely asked for and therefore the result is a date. In other