encode

Escaping XML tag contents

I have a simple CAML query like <Where><Eq><Field="FieldName"><Value Type="Text">Value text</Value></Field></Eq></Where> And I have a variable to substitute for "Value text". What's the best way to validate/escape the text that is substituted here in the .NET framework? I've done a quick web search on this problem but all what I found...

QR code (2D barcode) coding and decoding algorithms?

Looking for free/opensource code or description of algorithms to code (simple) and decode (hard) the 2D barcode QR code. It doesn't seem like a trivial problem, but it's so popular in Japan that there must be something already available... ...

How do I convert an audio stream to MP3 using Java?

Is it possible using Java to convert a real time audio stream from the mixer to MP3? It has to be converted chunk by chunk otherwise the memory will be exhausted. I already know how to record but only to lossless formats such as wav and aiff. I need conversion as the audio comes in. ...

Base64 encoded string search

I have string which is base64 encoded. How can I search this string to check if this string contains specific sub string which is not encoded? I don't want to decode that string and then search it. Can I just encode that specific sub string, and search the encoded string by using the encoded sub string? Thanks, ...

Python UnicodeDecodeError - Am I misunderstanding encode?

Any thoughts on why this isn't working? I really thought 'ignore' would do the right thing. >>> 'add \x93Monitoring\x93 to list '.encode('latin-1','ignore') Traceback (most recent call last): File "<interactive input>", line 1, in ? UnicodeDecodeError: 'ascii' codec can't decode byte 0x93 in position 4: ordinal not in range(128) ...

SharePoint publishing site email encoding/decoding

Hello, I'm building a SharePoint (MOSS) publishing site for employee information on my company website. I have an employee content type and am using the Contact E-Mail Address site column to store an employee's email address. Want I'd like is the ability to encode email addresses at runtime to prevent the real email address from bei...

Cause of video artifact/artefact

Hi folks, ![alt text][1] The above screenshot shows some artifacting which is occuring during a software decode of a .DV video file, compliant to SMPTE 314m... The artefacting is believed to be cause by a AC/DC coefficient problem, is this likely? Any information is appreciated. ...

rails: how to html encode/escape a string? is there a built-in?

Yay, silly question time. So I have an untrusted string that I simply want to show as text in an html page. All I need to do is escape the chars '<' and '&' as html entities. The less fuss the better. I'm using utf8 and don't need no other stinking entities for accented letters and so on. Is there anything built-in in ruby or rails, ...

file upload issue

Hello everyone, I am implementing a similar scenario like Youtube for my web site -- uploading video and so that all people could watch. My question is, I think we need to encode the video after upload before other people could play remotely, but encode process is very slow (I tried with Microsoft Expression Encoder and also mplayer, en...

Is it necessary to "escape" character "<" and ">" for javascript string?

Sometimes, server side will generate strings to be embedded in inline JavaScript code. For example, if "UserName" should be generated by ASP.NET. Then it looks like. <script> var username = "<%UserName%>"; </script> This is not safe, because a user can have his/her name to be </script><script>alert('bug')</script></script> It is...

Ideas to create a small (<10 digits), not (very) secure "hash"

I'm working on an online event ticketing system, where users will be able to self print his tickets and show up at the event where it will be scanned (barcode) and ideally the person will get in. My problem is how to create a "ticket code" that fulfills the following requirements: each "ticket code" need to be sufficiently different fr...

url encoding using Flex navigatetoUrl function

Hi, I want to post data to a URL on my server from a Flex app. im using the following UrlParam = UrlParam + '&name='+ name.text + '&business=' + buisness.text; navigateToURL(new URLRequest(UrlParams),'_self'); the problem im having however is that if i enter a business with an ampersand ("A&b.com") then the name does not send. D...

How to encode string in Oracle?

Hello, I have problem with encoding data in Oracle database. I want to xor string with another string (mask) and then encode it with base64. In Python this looks like: def encode_str(s, mask): xor_mask = mask while len(xor_mask) < len(s): xor_mask += mask chrs2 = [] for i in range(len(s)): chrs2.append(chr(or...

Java Reading Undecoded URL from Servlet

Let's presume that I have string like '=&?/;#+%' to be a part of my URL, let's say like this: example.com/servletPath/someOtherPath/myString/something.html?a=b&c=d#asdf where myString is the above string. I've encoded critical part so URL looks like example.com/servletPath/someOtherPath/%3D%26%3F%2F%3B%23%2B%25/something.html?a=b&c=d...

Java Encode SHA-1 Byte Array

I have an SHA-1 byte array that I would like to use in a GET request. I need to encode this. URLEncoder expects a string, and if I create a string of it and then encode it, it gets corrupt? To clarify, this is kinda a follow up to another question of mine. (Bitorrent Tracker Request) I can get the value as a hex string, but that is not...

How can I reverse engineer the encode/decode method used here?

I have the page to encode and I have the page to decode. I don't, however, have the knowledge on how to do it myself without the web pages. What I'm trying to do is figure out how to encode a hoplink like: http://geoffreyf6.earth4.hop.clickbank.net into http://8e5250ieuas1d9b9bo6c6p8xat.hop.clickbank.net/ The encode/decode pages ...

Why doesn't my decrypt function work?

This was not written by me; it was written by someone who passed it down to me. I lost contact with the author of the code. I have been using this code for a few years and just now realized this error. It seems that the letter sequence rkey1 messes up the output. For example turkey1 outputs as decryption as tur79y1. This Perl code shou...

QR codes image generator in java (open source but no GPL)

Hi, I'm seeking an open source QR codes image generator component in java (J2SE), but the open source licence mustn't be a GPL licence (needs to be included in a close source project). BTW, i can't access the web from the project so no Google API. ...

How do I encode UTF-8 using the XStream framework?

Per XStream's FAQ its default parser does not preserve UTF-8 document encoding, and one must provide their own encoder. How does one do this? Thanks! ...

Code for decoding/encoding a modified base64 URL

I want to base64 encode data to put it in a URL and then decode it within my HttpHandler. I have found that Base64 Encoding allows for a '/' character which will mess up my UriTemplate matching. Then I found that there is a concept of a "modified Base64 for URL" from wikipedia: A modified Base64 for URL variant exists, where no paddin...