Search Results

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

Page 10/15 | < Previous Page | 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • Displaying thumbnails of images (present at different locations in the sdcard) in a listview

    - by frieza
    Hi all, I have several images present in different folders in my sdcard. I would like to display a list of thumbnails. So what I have done is while rendering any row in the list I read the file in an input stream, get the byte array, decode it to obtain a bitmap and set it in an imageview. So far so good. But when I scroll the list, the list scrolls in jerks. I believe this is because decoding a bitmap from byte array takes some time. What I would like to know is that, is there any optimization which I can do to improve the performance, or better still is there any better method to achieve what I want ?

    Read the article

  • [Iphone] - Problem in saving file using NSCoding

    - by Matte Gary
    Hi everybody, I've a problem with Iphone programming... I've a NSMutableArray containing object of type "MyClass". MyClass has some parameters, like NSNumber and NSString. I've followed the Apple Tutorial about coding and decoding object using NSCoding, but when I try to decode the file I've stored, the NSMutableArray contain object of type "MyClass", but with wrong parameters. I think i've done all I've to do (including protocol, including methods like initwithencode etc), but it's still not working... Any suggestions? Thanks a lot! And sorry for my English XD

    Read the article

  • How to get the quickfix timestamp?

    - by yves Baumes
    I've seen in quickfix doxygen documentation that it generates an utc timestamp as soon as it has received a FIX message from a socket file. Have a look in ThreadedSocketConnection::processStream(), it calls then m_pSession->next( msg, UtcTimeStamp() ); I would like to get that timestamp, because I need it to screen network and QuickFix lib latencies. I didn't find a way to get it from FixApplication::fromApp() callback or 'Log::onIncoming()' callback. As I am newbie with quickfix I would like to know if I missed something in the Quickfix documentation. Did anybody ever done that before? Of course there is other solutions, but for homogeneity with others market acces applications I maintain, I would prefer to avoid them. For instance, I would prefer not to modify QuickFix code source. And I would like to avoid re-write the application logic that quickfix provide me, quickfix helpping me only for message decoding.

    Read the article

  • How to decode a JSON String with several objects in PHP?

    - by ilnur777
    Hi, guys! I know how to decode a JSON string with one object with your help from this example http://stackoverflow.com/questions/2543389/how-to-decode-a-json-string But now I would like to improve decoding JSON string with several objects and I can't understand how to do it. Here is an example: { "programmers": [ { "firstName": "Brett", "lastName":"McLaughlin" }, { "firstName": "Jason", "lastName":"Hunter" }, { "firstName": "Elliotte", "lastName":"Harold" } ], "authors": [ { "firstName": "Isaac", "lastName": "Asimov" }, { "firstName": "Tad", "lastName": "Williams" }, { "firstName": "Frank", "lastName": "Peretti" } ], "musicians": [ { "firstName": "Eric", "lastName": "Clapton" }, { "firstName": "Sergei", "lastName": "Rachmaninoff" } ] } How to decode this JSON, call data and display on the page from what object the informartion list is being read? Thank you!

    Read the article

  • IMB_ibImageFromMemory: unknown fileformat?

    - by Antoni4040
    Here's my add-on: import bpy import os import sys import subprocess import threading class ExportToGIMP(bpy.types.Operator): bl_idname = "uv.exporttogimp" bl_label = "Export to GIMP" def execute(self, context): self.filepath = os.path.join(os.path.dirname(bpy.data.filepath), "Layout") bpy.ops.uv.export_layout(filepath=self.filepath, check_existing=True, export_all=False, modified=False, mode='PNG', size=(1024, 1024), opacity=0.25, tessellated=False) self.files = os.path.dirname(bpy.data.filepath) cmd = " (python-fu-bgsync RUN-NONINTERACTIVE)" subprocess.Popen(['gimp', '-b', cmd]) self.update() return {'FINISHED'}; def update(self): self.thread = threading.Timer(3.0, self.update).start() self.filepath2 = "/home/antoni4040/????afa/Layout1.png" bpy.ops.image.open(filepath=self.filepath2, filter_blender=False, filter_image=True, filter_movie=False, filter_python=False, filter_font=False, filter_sound=False, filter_text=False, filter_btx=False, filter_collada=False, filter_folder=True, filemode=9, relative_path=False) tex = bpy.data.textures.new(name = self.filepath2, type = "IMAGE") def exporttogimp_menu(self, context): self.layout.operator(ExportToGIMP.bl_idname, text="Export To GIMP") bpy.utils.register_class(ExportToGIMP) bpy.types.IMAGE_MT_uvs.append(exporttogimp_menu) But I can't load an image, because I get this: Reached EOF while decoding PNG IMB_ibImageFromMemory: unknown fileformat (/home/antoni4040/????afa/Layout1.png) What is that?

    Read the article

  • Double encoded url being fully decoded in ASP.NET

    - by Brad R
    I have just come across something that is quite strange and yet I haven't found any mention on the interwebs of others having the same problem. If I hit my ASP.NET application with a double encoded url then the Request["myQueryParam"] will do a double decode of the query for me. This is not desirable as I have double encoded my query string for a good reason. Can others confirm I'm not doing something obviously wrong, and why this would happen. A solution to prevent it, without doing some nasty query string parsing, would be great too! As an example if you hit the url: http://localhost/MyApp?originalUrl=http%3a%2f%2flocalhost%2fAction%2fRedirect%3fUrl%3d%252fsomeUrl%253futm_medium%253dabc%2526utm_source%253dabc%2526utm_campaign%253dabc (For reference %25 is the % symbol) Then look at the Request["originalUrl"] (page or controller) the string returned is: http://localhost/Action/Redirect?Url=/someUrl?utm_medium=abc&utm_source=abc&utm_campaign=abc I would expect: http://localhost/Action/Redirect?Url=%2fsomeUrl%3futm_medium%3dabc%26utm_source%3dabc%26utm_campaign%3dabc I have also checked in Fiddler and the URL is being passed to the server correctly (one possible culprit could have been the browser decoding the URL before sending).

    Read the article

  • Matlab: Adding symbols to figure

    - by niko
    Hi, Below is the user interface I have created to simulate LDPC coding and decoding The code sequence is decoded iteratively by passing values between the left and right nodes through the connections. The first thing it would be good to add in order to improve visualization is to add arrows to the connections in the direction of passing values. The alternative is to draw a bigger arrow at the top of the connection showing the direction. Another thing I would like to do is displaying the current mathematical operation below the connection (in this example c * H'). What I don't know how to do is displaying special characters and mathematical symbols and other kinds of text such as subscript and superscript in the figure (for example sum sign and subscript "T" instead of sign ="'" to indicate transposed matrix). I would be very thankful if anyone could point to any useful resources for the questions above or show the solution. Thank you.

    Read the article

  • Encode/compress sequence of repeating integers

    - by Alex
    Hey there! I have very long integer sequences that look like this (arbitrary length!): 0000000001110002220033333 Now I need some algorithm to convert this string into something compressed like a9b3a3c3a2d5 Which means "a 9 times, then b 3 times, then a 3 times" and so on, where "a" stands for 0, "b" for 1, "c" for 2 and "d" for 3. How would you do that? So far nothing suitable came to my mind, and I had no luck with google because I didn't really know what to search for. What is this kind of encoding / compression called? PS: I am going to do the encoding with PHP, and the decoding in JavaScript.

    Read the article

  • Can't DER encode and BER decode RSA public key

    - by Mildred
    I have problems using Crypto++ to save a RSA public key (that I obtained loading a private key file in PKCS#8 format). When decoding the key, I always get a BERDecodeErr exception. Here is the code I am using: CryptoPP::RSASSA_PKCS1v15_SHA_Signer _signer; CryptoPP::RSASSA_PKCS1v15_SHA_Verifier _verifier; CryptoPP::ByteQueue bytes; //_signer.AccessPublicKey().Save(bytes); // seem to save private key instead _signer.AccessKey().DEREncodePublicKey(bytes); //_verifier.AccessKey().Load(bytes); //_verifier.AccessKey().BERDecodePublicKey(bytes, 0, 0); _verifier.AccessPublicKey().Load(bytes); I also tried with the instructions commented above, without success. How do you do to save or open the public key? The public key looks like this in hex format, is there a tool to check its format / validity (regarding what crypto++ supports) ? 3081890281810097e24f2e95504a397e90fbc56d1b330ab2ab97a0d326007b890e40013f9e1d9bd9 f54b0c0840782ddae19b5b4595d8f8b9ffe0d2120174fcbc39585c5867cd2dfba69f8e540caa2c52 de8f08278a34e9249120500117f0ba756c5bb2be660013160db9f82f75deb7ccf63742a9e945da6c cf30c2b109b73342daaabd02b872e50203010001

    Read the article

  • Truncate a UTF-8 string to fit a given byte count in PHP

    - by fsb
    Say we have a UTF-8 string $s and we need to shorten it so it can be stored in N bytes. Blindly truncating it to N bytes could mess it up. But decoding it to find the character boundaries is a drag. Is there a tidy way? [Edit 20100414] In addition to S.Mark’s answer: mb_strcut(), I recently found another function to do the job: grapheme_extract($s, $n, GRAPHEME_EXTR_MAXBYTES); from the intl extension. Since intl is an ICU wrapper, I have a lot of confidence in it.

    Read the article

  • open encrypted file with php

    - by stormdrain
    Hi, I'm looking for a way to open encrypted files that are stored on a server. I'm using mcrypt to encrypt the files. I was initially going to create a class that would open the file, decrypt it, write it to a new location, then open that. But I have convinced myself there is a better way (I just don't know what it is). It seems like there should be a way to stream it (?) to the browser once it's decrypted. The initial setup would just link to the file location and the browser would take over (e.g. .pdf files would bring up a dialogue offering to open or save the file). If possible, I'd like it to do the same after decoding. Pointers? Advice? Bueller? Thanks!

    Read the article

  • Blackberry RepeatRule

    - by Vinay
    Hi All, I am very new to Blackberry development. I am trying to access the Blackberry Events (Calender) list. Currently, I am able to read the basic information from the event list. I am stuck in getting the info regarding the RepeatRule. My code is as below: EventList eventList = (EventList)PIM.getInstance().openPIMList(PIM.EVENT_LIST, PIM.READ_ONLY); Enumeration e = eventList.items(); while (e.hasMoreElements()) { Event event = (Event)e.nextElement(); RepeatRule rRule = event.getRepeat() ; if (rRule != null) { fieldIds = rRule.getFields() ; // Here I get the values as { 0,128,64,2}. How do I decode this information? } } Can any one help in decoding this information. Any kind of links, examples or pointers would be of great help. Thanks and regards, Vinay

    Read the article

  • Encoding gives "'ascii' codec can't encode character … ordinal not in range(128)"

    - by user140314
    I am working through the Django RSS reader project here. The RSS feed will read something like "OKLAHOMA CITY (AP) — James Harden let". The RSS feed's encoding reads encoding="UTF-8" so I believe I am passing utf-8 to markdown in the code snippet below. The em dash is where it chokes. I get the Django error of "'ascii' codec can't encode character u'\u2014' in position 109: ordinal not in range(128)" which is an UnicodeEncodeError. In the variables being passed I see "OKLAHOMA CITY (AP) \u2014 James Harden". The code line that is not working is: content = content.encode(parsed_feed.encoding, "xmlcharrefreplace") I am using markdown 2.0, django 1.1, and python 2.4. What is the magic sequence of encoding and decoding that I need to do to make this work? Thanks.

    Read the article

  • C++ threaded class design from non-threaded class

    - by macs
    I'm working on a library doing audio encoding/decoding. The encoder shall be able to use multiple cores (i.e. multiple threads, using boost library), if available. What i have right now is a class that performs all encoding-relevant operations. The next step i want to take is to make that class threaded. So i'm wondering how to do this. I thought about writing a thread-class, creating n threads for n cores and then calling the encoder with the appropriate arguments. But maybe this is an overkill and there is no need for another class, so i'm going to make use of the "user interface" for thread-creation. I hope there are any suggestions.

    Read the article

  • does a switch idiom make sense in this case?

    - by the ungoverned
    I'm writing a parser/handler for a network protocol; the protocol is predefined and I am writing an adapter, in python. In the process of decoding the incoming messages, I've been considering using the idiom I've seen suggested elsewhere for "switch" in python: use a hash table whose keys are the field you want to match on (a string in this case) and whose values are callable expressions: self.switchTab = { 'N': self.handleN, 'M': self.handleM, ... } Where self.handleN, etc., are methods on the current class. The actual switch looks like this: self.switchTab[selector]() According to some profiling I've done with cProfile (and Python 2.5.2) this is actually a little bit faster than a chain of if..elif... statements. My question is, do folks think this is a reasonable choice? I can't imagine that re-framing this in terms of objects and polymorphism would be as fast, and I think the code looks reasonably clear to a reader.

    Read the article

  • Color space - RGB and YCbCr question

    - by HardCoder1986
    Hello! I am now trying to understand how JPEG encoding works and everything seems fine except the color transformation part. Before attempting to do a DCT in JPEG algorithm, the image is transformed into YCbCr color space. To me this essentially means that we just (comparing to initial RGB image) take a chunk of color information and dispose it while applying the RGB -> YCbCr transformation. So, our encoding steps look generally like RGB -> YCbCr -> DCT -> Huffman. The decoding means inversing this process. And my question is - why does the image (for example, created and exported to JPEG) remain the same in terms of color, although we have to make inverse YCbCr -> RGB transform. Where does the disposed part of color information comes from or how is it handled?

    Read the article

  • php $_REQUEST data is only half-decoded

    - by hackmaster.a
    I am retrieving a url via querystring. I need to pass it again to the next page. When I retrieve it the first time, using $_REQUEST['url'], only the slashes are decoded, e.g: http://example.com/search~S10?/Xllamas&searchscope=10&SORT=D/Xllamas&searchscope=10&SORT=D&SUBKEY=llamas/51%2C64%2C64%2CB/browse The php docs page for urldecode advises against decoding request data, and says that it will already be decoded. I need it either completely decoded, so I can encode it again without double-encoding some parts, or not decoded at all. I'm not sure why my experience of this data is incongruous with the php docs. Appreciate any help or pointers to same!!

    Read the article

  • How to detect identical part(s) inside string?

    - by Horace Ho
    I try to break down the http://stackoverflow.com/questions/2711961/decoding-algorithm-wanted question into smaller questions. This is Part I. Question: two strings: s1 and s2 part of s1 is identical to part of s2 space is separator how to extract the identical part(s)? example 1: s1 = "12 November 2010 - 1 visitor" s2 = "6 July 2010 - 100 visitors" the identical parts are "2010", "-", "1" and "visitor" example 2: s1 = "Welcome, John!" s2 = "Welcome, Peter!" the identical parts are "Welcome," and "!" Python and Ruby preferred. Thanks

    Read the article

  • Best way to validate a WinCE OS image (.bin) file?

    - by Ryan Clark
    We have a Windows CE 6.0 based product that allows for firmware upgrades through a web interface. I want to perform a sanity check on the new firmware image to be sure that it is valid. How should I perform the validation? I see in the BIOSLOADER code, there is support code for decoding a BIN file. I suppose I could massage that to perform the validation. Is there a better way? Thanks!

    Read the article

  • Bookmarkabale ajax calls with MVC routing

    - by devzero
    I have a page with a menu that uses JQuery AJAX calls to populate the page with. To reflect any changes I update the URL with a #... instead of ?... or /... So an URL that originally reads : htpp://localhost/pages/index/id=1 would look like : http://localhost/#pages/index/id=1. If a user bookmarks this, and later comes back to the page, I wonder if it's possible to use the second URL in my route decoding, or if I have to load it blank, then use the same JS/Ajax to populate the page? In my mind it is problematic to use Ajax in these cases if a user copies the link and mails it to a friend with JavaScript disabled. edit#1: Fixed some spelling.

    Read the article

  • aacplus frame alignment problems

    - by Daniel Mošmondor
    I have an application that rips aac+ audio streams, cutting them at every regular interval (i.e. 10 minutes). Sometimes files are playable OK, but sometimes, Windows Media Player just closes when trying to build DirectShow graph. I am using Orban aacplus plugin, and it works under directshow. When I play this file with winamp or vlc, that have it's own aacplus decoding engine, it works fine. However, I need it to work under directshow. Anyway, problematic file is here: http://www.videophill.com/files/00272-20100418100002.aac I know that there is frame alignment error and I confirmed my theory by filling first 256 bytes with 0x00, tried to play it again, and it worked. Is there any info on aacplus frames available on the web, so I can try to find the beginning of the frame manually and cut the rest off?

    Read the article

  • decode mysql query before returning it to view

    - by stormdrain
    I'm running a query to mysql that returns encrypted data. I'd like, if possible, to decode the results before sending it to the view. It seems like better form to handle the decoding in the controller (or even the model) rather than inside the view. I can't seem to wrap my head around how to do it, though. I was thinking I could iterate through the object, decodode it, and push it to another array that would be sent to the view. Problem with this is I won't know (and need to keep) the indexes of the query. So the query might return something like: [id] => 742 [client_id] => 000105 [last] => dNXcw6mQPaGQ4rXfgIGJMq1pZ1dYAim0 [first] => dDF7VoO37qdtYoYKfp1ena5mjBXXU0K3dDlcq1ssSvCgpOx75y0A== [middle] =>iXy6OWa48kCamViDZFv++K6okIkalC0am3OMPcBwK8sA== [phone] => eRY3zBhAw2H8tKE Any ideas?

    Read the article

  • Local Live Quicktime Video Broadcast, latency?

    - by Snowwire
    I'm looking into the feasibility of using a local server to distribute live video of a conference to delegates in the same room. They would still hear the live audio coming from the speaker, so only the video would be streamed. I was considering a Darwin Steaming Server (a lot of iPhone users to support) and encoding with H.264. My main concern is latency across the network. Even with everything running locally, would there be lip sync issues between the live audio and the 'live' video stream? It feels like there will be problems given the encoding, broadcasting, decoding to be completed, but I've never done any like this before so thought I would check. Thanks

    Read the article

  • relace double quotes to parse JSON in PHP

    - by hunt
    hi, i have following json format { "status": "ACTIVE", "result": false, "isworking": false, "margin": 1, "employee": { "111": { "val1": 5.7000000000000002, "val2": "9/2", "val3": 5.7000000000000002 }, "222": { "val1": 31.550000000000001, "val2": "29/1", "val3": 31.550000000000001 } } } how the problem is when i am trying to decode above json response in php using json_decode($res,true) { true param for associative array } i am getting following result as few fields like "result":false is not "result":"false" i.e. at many of the places doubles quotes are missing in values of json. see in val1 and val3 fields resultant data after decoding in php (associative array) Array ( [status] = ACTIVE [result] = [isworking] = [margin] = 1 [employee] = Array ( [111] = Array ( [val1] = 5.7 [val2] = 9/2 [val3] = 5.7 ) [222] = Array ( [val1] = 31.55 [val2] = 29/1 [val3] = 31.55 ) ) ) please help me on how would i insert double quotes in values ? Thanks

    Read the article

  • Getting animated gif data in c or c++

    - by Pickles
    I'm trying to get the frames (properly decoded) and the frames delay times from an animated gif. I've opened up the code to gifsicle and have also tried lungif but I'm not accustomed to c code and I'm having a difficult time following the logic. I've also tried other examples and I've gotten one to work but it didn't do the proper LZW decoding. Can anyone give me a quick example of how to do this? I'm building this app in xcode and trying to get an NSArray of the image frames. Thanks.

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14 15  | Next Page >