Search Results

Search found 368 results on 15 pages for 'decoding'.

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

  • Decoding bitmaps in Android with the right size

    - by hgpc
    I decode bitmaps from the SD card using BitmapFactory.decodeFile. Sometimes the bitmaps are bigger than what the application needs or that the heap allows, so I use BitmapFactory.Options.inSampleSize to request a subsampled (smaller) bitmap. The problem is that the platform does not enforce the exact value of inSampleSize, and I sometimes end up with a bitmap either too small, or still too big for the available memory. From http://developer.android.com/reference/android/graphics/BitmapFactory.Options.html#inSampleSize: Note: the decoder will try to fulfill this request, but the resulting bitmap may have different dimensions that precisely what has been requested. Also, powers of 2 are often faster/easier for the decoder to honor. How should I decode bitmaps from the SD card to get a bitmap of the exact size I need while consuming as little memory as possible to decode it?

    Read the article

  • Decoding not reversing unicode encoding in Django/Python

    - by PhilGo20
    Ok, I have a hardcoded string I declare like this name = u"Par Catégorie" I have a # -- coding: utf-8 -- magic header, so I am guessing it's converted to utf-8 Down the road it's outputted to xml through xml_output.toprettyxml(indent='....', encoding='utf-8') And I get a UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 3: ordinal not in range(128) Most of my data is in French and is ouputted correctly in CDATA nodes, but that one harcoded string keep ... I don't see why an ascii codec is called. what's wrong ?

    Read the article

  • decoding 802.11 b

    - by stan
    I have a raw grabbed data from spectrometer that was working on wifi (802.11b) channel 6. (two laptops in ad-hoc ping each other). I would like to decode this data in matlab. I see them as complex vector with 4.6 mln of complex samples. I see their spectrum quite nice. I am looking document a bit less complicated as IEEE 802.11 standard (which I have). I can share measurement data to other people.

    Read the article

  • HTML encoding and decoding

    - by Zerotoinfinite
    Hi All, I am looking for a HTML editor, and I found many links through google like this http://online-html-editor.org/ Now I have written something on it: Let say the below content <div> <span style="font-weight: bold; font-size: 12pt; "> Heading</span></div> <div><br /> </div> The'la;skdlajlsdjansdkahskdkhaksdhkhaskdhkhaskhdkashdkhaksda <div>asdljalsjdljalsdjljalsdjljalsdjljalsdlajs;fl'ajduyasdahsldjkagsdhasvdjyhlasjdgklastgians,dkasjdlhakhsdl</div> <div>amsdka;sdlyasdalshdlj,asdh,asdjg,absdlasd/.malskdla'slduljds,vaskkd;jas;dl'asldu'alsdaskd;lk'as;d</div> <div>'a</div> <div>sd;jasldj;asdaklsdka'sld'sai'dkabskdm;;lsidaasfhdlasjd;ljaspodi;ajsd;lka'sld</div> <div>'</div> <div>ad'</div> <div>a;fj;ljas;dfjalshdoiauslkfdnkasfnlka's;dkap[sd'alsd;jlaksfdkajsdfh;alsd;</div> <div>asdkasjd;kaskd;as;dk;aksd;ajsdlkjalksjdlasjdkgasfkjashdjashdkasfdkjashkdasdjo[uipuhlkasdjlkajsdljalsjdlkajsdljaljsdljalsjdlkaslkjdlkasdjlasjdlkjaslkdjlasjdlasudqpeohw09iqwpekjqwehlj</div> <div><br /> </div> <div> <div> bool tt = new bool();</div> <div> if (txtStatus.Text == "true")</div> <div> tt = true;</div> <div> else</div> <div> tt = false;</div> <div><br /> </div> <div> </div></div> Now I want to save this content into the database and display as a normal text on a page. While extracting I can use Server.HTMLDecode, but I am facing problem while inserting this html data which I have copied from the sites. Please help. Thanks in advance.

    Read the article

  • Decoding subsampled bitmaps in Android

    - by hgpc
    I decode bitmaps from the SD card using BitmapFactory.decodeFile. Sometimes the bitmaps are bigger than what the application needs or that the heap allows, so I use BitmapFactory.Options.inSampleSize to request a subsampled (smaller) bitmap. The problem is that the platform does not enforce the exact value of inSampleSize, and I sometimes end up with a bitmap either too small, or still too big for the available memory. From http://developer.android.com/reference/android/graphics/BitmapFactory.Options.html#inSampleSize: Note: the decoder will try to fulfill this request, but the resulting bitmap may have different dimensions that precisely what has been requested. Also, powers of 2 are often faster/easier for the decoder to honor. How should I decode bitmaps from the SD card to get a bitmap of the exact size I need while consuming as little memory as possible to decode it?

    Read the article

  • Need help Decoding JSON with XML

    - by brant
    I have a set of data that looks like this when using print_r($var): cbfunc({"query":{"count":"12","created":"2010-06-11T01:20:19Z","lang":"en-US"},"results":["\n 238.l.739089.t.4<\/team_key>\n 4<\/team_id>\n CHEE-HOO!!!<\/name> It looks like JSON to me, so I've tried to use json_decode but can't get it right. My goal is to print the xml data found in "results". Any helpful pointers would be greatly appreciated.

    Read the article

  • image decoding problem in android

    - by achie
    Some of the images are not being displayed in the web browser in android while they work fine on all other machines and mobile devices. this is an example of one of those images http://s3.amazonaws.com/itriage/logos/19/iphone_list.jpg?1261515055 So I tried to pull the image to see it if it works from code. This is what I did URL url = new URL(address); InputStream is = (InputStream) url.getContent(); Drawable d = Drawable.createFromStream(is, "src"); It works for most images but for some images including this images it gives this error D/skia (28314): --- decoder-decode returned false Why is this happening and how can I prevent this. I saw an example on the developers forum but thats when we are accessing the image directly. But what I want is the browser to handle it. So how do I encode my images on my server for the android devices to recognise them correctly?

    Read the article

  • PHP: simple form encoding/decoding

    - by Lennart
    Hi guys, Probably, this question has been asked before, though, I'll ask it again. Currently, I'm facing a problem with form encoding. When posting my form, all spaces are replaced by the "+" character. I would like to replace this "+" character by a real space. Does someone has a PHP solution for this? Thanks in advance. Cheers, Lennart

    Read the article

  • Decoding equivalent assembly code of C code...

    - by puffadder
    Hi All, Wanting to see the output of the compiler (in assembly) for some C code, I wrote a simple program in C and generated its assembly file using gcc. The code is this: #include <stdio.h> int main() { int i = 0; if ( i == 0 ) { printf("testing\n"); } return 0; } The generated assembly for it is here (only the main function): _main: pushl %ebpz movl %esp, %ebp subl $24, %esp andl $-16, %esp movl $0, %eax addl $15, %eax addl $15, %eax shrl $4, %eax sall $4, %eax movl %eax, -8(%ebp) movl -8(%ebp), %eax call __alloca call ___main movl $0, -4(%ebp) cmpl $0, -4(%ebp) jne L2 movl $LC0, (%esp) call _printf L2: movl $0, %eax leave ret I am at an absolute loss to correlate the C code and assembly code. All that the code has to do is store 0 in a register and compare it with a constant 0 and take suitable action. But what is going on in the assembly ? Thanks in advance.

    Read the article

  • Strange javascript decoding behavior in IE

    - by Yoni
    I run the following html snippet in IE8 and IE7 with non-English characters (we tried both Hebrew and Chinese), and the second link never works properly. The displayed text in the alert box is mangled. This occurs in IE8 and IE7, but not in firefox. It is not dependent on Windows's regional settings. Here is the html snippet (html header and footer omitted for brevity, the content-type is "text/html; charset=utf-8", and so is the response header): <p> <a href="javascript:alert('ab????ab')">link with English and Hebrew text</a> <a href="javascript:alert('ab%D7%A9%D7%9C%D7%95%D7%9Dab')">same text, url encoded</a> </p> Here is the alert box that pops up when clicking the second link: I know that the string for "????" is encoded as 8 bytes in utf-8, thus there are 8 %NN items, and there are also 8 weird characters in the alert box. The problem is, how can I make IE recognize that this is utf-8 encoding text, like firefox does?

    Read the article

  • Error when decoding image C# asp

    - by Wayneio
    I am trying to use MessagingToolkit to decode an image in C#/ASP. I have managed to encode a qr using this package, but when i try to decode, using the code below it comes up with 2 errors (at the bottom of the page) I believe this is because I am not getting the image correctly after uploading, but can someone point out exactly where I have gone wrong. Thanks. protected void CreateCode_OnClick(object sender, EventArgs e) { string path = "C:\\Users\\Wayneio\\Documents\\Visual Studio 2012\\Projects\\BAMSystem\\BAMSystem\\"; if (QRUpload.HasFiles == true) { FileInfo fi = new FileInfo(QRUpload.FileName); string extA = fi.Extension; if (extA == ".jpg" || extA == ".png") { QRCodeDecoder decoder = new QRCodeDecoder(); QRUpload.SaveAs(path + QRUpload.FileName); System.Drawing.Image myImg = System.Drawing.Image.FromFile(path + QRUpload.FileName); decoder.Decode(myImg); } else { error.Text = "You have uploaded a " + extA + " file. Please upload either a PNG or a JPG"; } } else { error.Text = "You have not uploaded an image."; } } Error1: Error 2 Argument 1: cannot convert from 'System.Drawing.Image' to 'MessagingToolkit.QRCode.Codec.Data.QRCodeImage' c:\users\wayneio\documents\visual studio 2012\Projects\BAMSystem\BAMSystem\default.aspx.cs 38 35 BAMSystem Error2: Error 1 The best overloaded method match for 'MessagingToolkit.QRCode.Codec.QRCodeDecoder.Decode(MessagingToolkit.QRCode.Codec.Data.QRCodeImage)' has some invalid arguments c:\users\wayneio\documents\visual studio 2012\Projects\BAMSystem\BAMSystem\default.aspx.cs 38 20 BAMSystem P.S if anyone has documentation on this MessagingToolkit QR package, it would be useful

    Read the article

  • Decoding mysql_real_escape_string() for outputting HTML

    - by Peter
    I'm trying to protect myself from sql injection and am using: mysql_real_escape_string($string); When posting HTML it looks something like this: <span class="\&quot;className\&quot;"> <p class="\&quot;pClass\&quot;" id="\&quot;pId\&quot;"></p> </span> I'm not sure how many other variations real_escape_string adds so don't want to just replace a few and miss others... How do I "decode" this back into correctly formatted HTML, with something like: html_entity_decode(stripslashes($string));

    Read the article

  • Decoding the IE9 user agent

    - by Portman
    I installed IE9 in a Windows 7 virtual machine, and was surprised to see this user agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0; BOIE9;ENUSMSNIP) In particular, the last two keys BOIE9 and ENUSMSNIP look very spammy. I'm used to seeing toolbars and add-ins register themselves at the end of the user agent like that, but this is on a virgin install of Windows 7 with no other software. They're defined in the registry here: HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\5.0\User Agent\PostPlatform That key has a value of IEAK, which is apparently the Internet Explorer Administrators Kit which according to Microsoft sends a custom user agent string. But why? I'm guessing that BOIE9 is stands for "Bing on IE9". It's the only active Add-On: As for ENUSMSNIP, I'm at a loss. My guesses are: ENUS = Locale, which for me is EN-US ("US English") MS = Microsoft NIP = ??? I tried changing my locale to EN-GB, but the user agent didn't update nor did the registry. So it appears it's only at the time of install that it matters (if I'm even right about ENUS). Does anyone know what these two user agent keys represent? Or, care to share what your IE9 user agent is, and maybe we can piece it together ourselves?

    Read the article

  • Base32 Decoding

    - by trampster
    I have a base32 string which I need to convert to a byte array. And I'm having trouble finding a conversion method in the .net framework. I can find methods for base64 but not for base32. Convert.FromBase64String – something like this for base32 would be perfect. Is there such a method in the framework or do I have to roll my own?

    Read the article

  • Text code decoding

    - by Diana Villafane
    Hello. I am an English/Spanish Spanish/English translator. I have been given a job where I have to translate Spanish text messages sent from cell phones. Some of them are in code. I assume each set of figures represents a letter. Is there any website where I can find information on how to decipher the code? For instance, the first message says: ‘0x69 ox61 0x6e 0x70 0x72 0x2e 0x6e 0x65 0x74 0x2f 0x3f 0x64 0x34 0x39 0x31 0x66 0x30 0x37 0x38 0x35 0x35 0x32 0x39 0x62 0x36 0x31 0x31 0x00 Thank you for any help you provide. Diana

    Read the article

  • Python and hebrew encoding/decoding error

    - by user340495
    Hey, I have sqlite database which I would like to insert values in Hebrew to I am keep getting the following error : UnicodeDecodeError: 'ascii' codec can't decode byte 0xd7 in position 0: ordinal not in range(128) my code is as following : runsql(u'INSERT into personal values(%(ID)d,%(name)s)' % {'ID':1,'name':fabricate_hebrew_name()}) def fabricate_hebrew_name(): hebrew_names = [u'????',u'???',u'???',u'???',u'????',u'???',u'????',u'???',u'????',u'?????',u'????',u'???',u'????'] return random.sample(names,1)[0].encode('utf-8') note: runsql executing the query on the sqlite database fabricate_hebrew_name() should return a string which could be used in my SQL query. any help is much appreciated.

    Read the article

  • decoding algorithm wanted

    - by Horace Ho
    I receive encoded PDF files regularly. The encoding works like this: the PDFs can be displayed correctly in Acrobat Reader select all and copy the test via Acrobat Reader and paste in a text editor will show that the content are encoded so, examples are: 13579 -> 3579; hello -> jgnnq it's basically an offset (maybe swap) of ASCII characters. The question is how can I find the offset automatically when I have access to only a few samples. I cannot be sure whether the encoding offset is changed. All I know is some text will usually (if not always) show up, e.g. "Name:", "Summary:", "Total:", inside the PDF. Thank you!

    Read the article

  • Decoding relationship between two numbers?

    - by Nimbuz
    Is there any way (or calculator) to determine the relationship between two numbers. For example on one the temporary event ID cards, the Unique ID is 20309825 but the barcode when decoded reads 8336902052. What could be the relationship between these numbers, if any? Thanks in advance for your help!

    Read the article

  • Sending JSON(jQuery) to PHP and decoding it

    - by dscher
    I can't for the life of me figure out what I'm doing wrong. It seems like it should be simple because I can't find anyone else with this issue but I can't figure out to send basic data via javascript(jQuery) to PHP and decode it. For the sake of simplicity, this is what I have: JAVASCRIPT var json_data = { "name" : "john doe" }; $.ajax({ type: "POST", url: "../bin/process.php", dataType: "json", data: json_data }); and my PHP FILE $arr = json_decode("json_data", true); $fp = fopen('data.txt', "w"); fwrite($fp, $arr['name']); fclose($fp); The file I'm writing ends up with nothing in it. If I do an: fwrite($fp, 'test'); I get a file with the word test in it but no matter what I do I don't get the json data I sent. Can someone please share a thorough example of A to Z. Thanks for any help.

    Read the article

  • Sending JSON(jQuery) to PHP and decoding it

    - by dscher
    I can't for the life of me figure out what I'm doing wrong. It seems like it should be simple because I can't find anyone else with this issue but I can't figure out to send basic data via javascript(jQuery) to PHP and decode it. For the sake of simplicity, this is what I have: JAVASCRIPT var json_data = { "name" : "john doe" }; $.ajax({ type: "POST", url: "../bin/process.php", dataType: "json", data: json_data }); and my PHP FILE $arr = json_decode("json_data", true); $fp = fopen('data.txt', "w"); fwrite($fp, $arr['name']); fclose($fp); The file I'm writing ends up with nothing in it. If I do an: fwrite($fp, 'test'); I get a file with the word test in it but no matter what I do I don't get the json data I sent. Can someone please share a thorough example of A to Z. Thanks for any help.

    Read the article

  • Unicode and URI encoding, decoding and escaping in JavaScript

    - by apphacker
    If you look at this table here, it has a list of escape sequences for Unicode characters that don't actually work for me. For example for "%96", which should be a –, I get an error when trying decode: decodeURIComponent("%96"); URIError: URI malformed If I attempt to encode "–" I actually get: encodeURIComponent("–"); "%E2%80%93" I searched through the internet and I saw this page, which mentions using escape and unescape with decodeURIComponent and encodeURIComponent respectively. This doesn't seem to help because %96 doesn't show up as "–" no matter what I try and this of course wouldn't work: decodeURIComponent(escape("%96)); "%96" Not very helpful. How can I get "%96" to be a "–" with JavaScript (without hardcoding a map for every single possible unicode character I may run into)?

    Read the article

  • Trouble decoding JSON string with PHP

    - by Anthony
    I'm trying to send an array of objects from JS to PHP using JSON. I have an array of players as follows: var player; var players = new Array(); //loop for number of players player = new Object(); player.id = theID; players[i] = player; Then my AJAX call looks like this: JSONplayers = JSON.stringify(players); $.ajax({ type: "POST", url: "php/ajax_send_players.php", data: { "players" : JSONplayers } On the PHP side the decode function looks like this $players = $_REQUEST['players']; echo var_dump($players); $players = json_decode($players); echo 'players: ' .$players. '--'. $players[0] . '--'. $players[0]->id; Debugging in chrome, the JSON players var looks like this before it is sent: JSONplayers: "[{"id":"Percipient"},{"id":"4"}]" And when I vardump in PHP it looks OK, giving this: string(40) "[{\"id\":\"Percipient\"},{\"id\":\"4\"}]" But I can't access the PHP array, and the echo statement about starting with players: outputs this: players: ---- Nothing across the board...maybe it has something to do with the \'s in the array, I am new to this and might be missing something very simple. Any help would be greatly appreciated. note I've also tried json_decode($players, true) to get it as an assoc array but get similar results.

    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

  • Encoding/Decoding hex packet

    - by Roberto Pulvirenti
    I want to send this hex packet: 00 38 60 dc 00 00 04 33 30 3c 00 00 00 20 63 62 39 62 33 61 36 37 34 64 31 36 66 32 31 39 30 64 30 34 30 63 30 39 32 66 34 66 38 38 32 62 00 06 35 2e 31 33 2e 31 00 00 02 3c so i build the string: string packet = "003860dc0000" + textbox1.text+ "00000020" + textbox2.text+ "0006" + textbox3.text; then "convert" it to ascii: conn_str = HexString2Ascii(packet); then i send the packet... but i have this: 00 38 60 **c3 9c** 00 00 04 33 30 3c 00 00 00 20 63 62 39 62 33 61 36 37 34 64 31 36 66 32 31 39 30 64 30 34 30 63 30 39 32 66 34 66 38 38 32 62 00 06 35 2e 31 33 2e 31 00 00 02 3c **0a** why?? Thank you! P.S. the function is: private string HexString2Ascii(string hexString) { byte[] tmp; int j = 0; int lenght; lenght=hexString.Length-2; tmp = new byte[(hexString.Length)/2]; for (int i = 0; i <= lenght; i += 2) { tmp[j] =(byte)Convert.ToChar(Int32.Parse(hexString.Substring(i, 2), System.Globalization.NumberStyles.HexNumber)); j++; } return Encoding.GetEncoding(1252).GetString(tmp); }

    Read the article

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