Search Results

Search found 1130 results on 46 pages for 'encode'.

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

  • Webcam capture with c# and convert to avi

    - by Spidfire
    Im trying to make a program that captures a video from the webcam and sound from the microphone but im getting stuck at the part where ive try to make a movie out of still images ive heard you need to use directshow but it doesnt jet work for me Does someone know a good piece of example code that captures video and sound and can encode it to a file (divx or something like that) ? or some suggestions where to look so i can build it myself (if a other programming language is better for this im happy to know it early. )

    Read the article

  • HTML encode on a XSLT

    - by Hugo Palma
    I would like to convert some value from a XML attribute into valid HTML with entities. So that for example the string "olá" from the XML would be transformed from the XSLT into "ol&#225;" I can't find any xsl function to do this. Any ideas ?

    Read the article

  • (Android) Seems like my JSON query is getting double encode

    - by A Gardner
    Hi, I am getting some weird errors with my Android App. It appears that this code is double encoding the JSON string. What should be sent is ?{"email":"[email protected]","password":"asdf"} or ?%7B%22email%22:%22..... what the server is seeing is %257B%2522email%2522:%2522 .... which means the server sees %7B%22email%22:%22 ..... This confuses the server. Any ideas why this is happening? Thanks for your help Code: DefaultHttpClient c = new DefaultHttpClient(); if(cookies!=null) c.setCookieStore(cookies); if(loginNotLogout){ jso.put("email", userData.email); jso.put("password", userData.password); } URI u = null; if(loginNotLogout) u= new URI("HTTP","www.website.com","/UserService",jso.toString(),""); else u= new URI("HTTP","www.website.com","/UserService",jso.toString(),""); HttpGet httpget = new HttpGet(u); HttpResponse response = c.execute(httpget); ret.jsonString = EntityUtils.toString(response.getEntity());

    Read the article

  • CouchDB Lucene How to URL Encode Query containing Minus (-)

    - by Peter
    I'd like to query text containing a minus (-) Sign, e.g. foo-bar with a couchdb lucene fulltext query. Following lucene rules I'd have to escape the minus, resulting in foo\-bar Last I'd have to urlencode the backslash resulting in foo%5C-bar So the complete url would be: http://127.0.0.1:5984/_fti/local/db/_design/foo/by_subject?q=foo%5C-bar Neither works. The result is always split in two phrases "q":"default:foo default:bar" Leading to documents containing only foo or bar being found also. Thanks for your help!

    Read the article

  • why my code show messy code ..

    - by zjm1126
    class sss(webapp.RequestHandler): def get(self): url = "http://www.google.com/" result = urlfetch.fetch(url) if result.status_code == 200: self.response.out.write(result.content) and this view show : when i change code to this: if result.status_code == 200: self.response.out.write(result.content.decode('utf-8').encode('gb2312')) it show : so ,what i should do ? thanks

    Read the article

  • ASP.Net - How do I allow users to enter html tags in textbox without runtime errors?

    - by Coder
    I have an input textbox on an asp.net page and when a user inputs any tags like break tags or bold an error occurs. I currently am using the following to encode the input: Server.HtmlEncode(mytextbox.Text) However this only encodes characters when they aren't phrased as an html tag, like if the input is "<<<" is there a way for me to allow the user to put the tags in without it leading to a runtime error? Thanks.

    Read the article

  • '£' character does not seem to encode properly - expect '%a3' but get '%u00a3'

    - by user243143
    Hello, I want to send The pound sign character i.e. '£' encoded as ISO-8859-1 across the wire. I perform this by doing the following: var _encoding = Encoding.GetEncoding("iso-8859-1"); var _requestContent = _encoding.GetBytes(requestContent); var _request = (HttpWebRequest)WebRequest.Create(target); _request.Headers[HttpRequestHeader.ContentEncoding] = _encoding.WebName; _request.Method = "POST"; _request.ContentType = "application/x-www-form-urlencoded; charset=iso-8859-1"; _request.ContentLength = _requestContent.Length; _requestStream = _request.GetRequestStream(); _requestStream.Write(_requestContent, 0, _requestContent.Length); _requestStream.Flush(); _requestStream.Close(); When I put a breakpoint at the target, I expect to receive the following: '%a3', however I receive '%u00a3' instead. We have tested many odd characters, but '£' seems to be the only character where theres a problem. Does anyone know what the problem is here? - Help would be greatly appreciated... Billy

    Read the article

  • How can I make Banshee re-encode FLAC to Ogg Vorbis when copying to my player?

    - by Michael E
    I have most of my music in FLAC on my large storage device, and would like to automatically re-encode it in Ogg Vorbis when copying it to my portable audio player (Sansa Fuze v2). I have set my Fuze to MTP mode and told Banshee to encode to Ogg Vorbis with quality 4 in the Device Properties dialog for the Fuze (I would use MSC mode, but don't have an encoding option in the device properties when I do that). However, when I copy music to the device, either by dragging it from the music library or by syncing a playlist, the full FLAC files are copied rather than transcoded and written as Oggs. How can I get my Banshee setup re-encoding the audio? If StackExchange supported bonus points, I'd give bonus points for a solution that only re-encoded music that was already losslessly encoded, but I don't think that's possible.

    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

  • FFmpeg + iPhone - Interesting (incorrect?) video encoding results

    - by jtrim
    I'm encoding some video on the iPhone by running the png image data through swscale to get YUV420P data then encoding that frame using the MSMPEG4V1 codec. In the api docs, avcodec_encode_video should return the number of bytes used from the output buffer by that encode operation. There are 234,000 bytes going into the encoder, but the result returned by avcodec_encode_video is simply "4". The result is exactly the same over 24 frames. Something seems fishy here...any insight? Here's a pastebin link to the code: http://pastebin.com/ht94FWva (sorry for the link away from SO, I just didn't want to have the code duplicated in several places) EDIT: Also, I've set up a custom log callback for ffmpeg to use and I have the log level set to "Verbose" (libavutil/log.h), so libavcodec should be logging any goofs to the console, but avcodec is quiet throught he whole operation. (note: I did test to make sure my log callback was working)

    Read the article

  • PHP unserialize fails with non-encoded characters?

    - by FFish
    $ser = 'a:2:{i:0;s:5:"héllö";i:1;s:5:"wörld";}'; // fails $ser2 = 'a:2:{i:0;s:5:"hello";i:1;s:5:"world";}'; // works $out = unserialize($ser); $out2 = unserialize($ser2); print_r($out); print_r($out2); echo "<hr>"; But why? Should I encode before serialzing than? How? I am using Javascript to write the serialized string to a hidden field, than PHP's $_POST In JS I have something like: function writeImgData() { var caption_arr = new Array(); $('.album img').each(function(index) { caption_arr.push($(this).attr('alt')); }); $("#hidden-field").attr("value", serializeArray(caption_arr)); };

    Read the article

  • PHP Variable Encryption

    - by NCoder
    I have the following code that creates an encryption in PHP: $password = "helloworld"; $passwordupper = strtoupper($password); $passwordencode = mb_convert_encoding($passwordupper, 'UTF-16LE'); $passwordsha1 = hash("SHA1", $passwordencode); $passwordbase64 = base64_encode($passwordsha1); The instructions I have from the system I'm trying to connect to states: The encoding process for passwords is: first convert to uppercase, then Unicode it in little-endian UTF 16, then SHA1 it then base64 encode it. I think I'm doing something wrong in my code. Any ideas?! Thanks! NCoder

    Read the article

  • How to encrypt an NSString in Objective C with DES in ECB-Mode?

    - by blauesocke
    Hi, I am trying to encrypt an NSString in Objective C on the iPhone. At least I wan't to get a string like "TmsbDaNG64lI8wC6NLhXOGvfu2IjLGuEwc0CzoSHnrs=" when I encode "us=foo;pw=bar;pwAlg=false;" by using this key: "testtest". My problem for now is, that CCCrypt always returns "4300 - Parameter error" and I have no more idea why. This is my code (the result of 5 hours google and try'n'error): NSString *token = @"us=foo;pw=bar;pwAlg=false;"; NSString *key = @"testtest"; const void *vplainText; size_t plainTextBufferSize; plainTextBufferSize = [token length]; vplainText = (const void *) [token UTF8String]; CCCryptorStatus ccStatus; uint8_t *bufferPtr = NULL; size_t bufferPtrSize = 0; size_t *movedBytes; bufferPtrSize = (plainTextBufferSize + kCCBlockSize3DES) & ~(kCCBlockSize3DES - 1); bufferPtr = malloc( bufferPtrSize * sizeof(uint8_t)); memset((void *)bufferPtr, 0x0, bufferPtrSize); // memset((void *) iv, 0x0, (size_t) sizeof(iv)); NSString *initVec = @"init Vec"; const void *vkey = (const void *) [key UTF8String]; const void *vinitVec = (const void *) [initVec UTF8String]; ccStatus = CCCrypt(kCCEncrypt, kCCAlgorithmDES, kCCOptionECBMode, vkey, //"123456789012345678901234", //key kCCKeySizeDES, NULL,// vinitVec, //"init Vec", //iv, vplainText, //"Your Name", //plainText, plainTextBufferSize, (void *)bufferPtr, bufferPtrSize, movedBytes); NSString *result; NSData *myData = [NSData dataWithBytes:(const void *)bufferPtr length:(NSUInteger)movedBytes]; result = [myData base64Encoding];

    Read the article

  • UTF-8 character encoding battles json_encode()

    - by Dave Jarvis
    Quest I am looking to fetch rows that have accented characters. The encoding for the column (NAME) is latin1_swedish_ci. The Code The following query returns Abord â Plouffe using phpMyAdmin: SELECT C.NAME FROM CITY C WHERE C.REGION_ID=10 AND C.NAME_LOWERCASE LIKE '%abor%' ORDER BY C.NAME LIMIT 30 The following displays expected values (function is called db_fetch_all( $result )): while( $row = mysql_fetch_assoc( $result ) ) { foreach( $row as $value ) { echo $value . " "; $value = utf8_encode( $value ); echo $value . " "; } $r[] = $row; } The displayed values: 5482 5482 Abord â Plouffe Abord â Plouffe The array is then encoded using json_encode: $rows = db_fetch_all( $result ); echo json_encode( $rows ); Problem The web browser receives the following value: {"ID":"5482","NAME":null} Instead of: {"ID":"5482","NAME":"Abord â Plouffe"} (Or the encoded equivalent.) Question The documentation states that json_encode() works on UTF-8. I can see the values being encoded from LATIN1 to UTF-8. After the call to json_encode(), however, the value becomes null. How do I make json_encode() encode the UTF-8 values properly? One possible solution is to use the Zend Framework, but I'd rather not if it can be avoided.

    Read the article

  • Code for decoding/encoding a modified base64 URL

    - by Kirk Liemohn
    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 padding '=' will be used, and the '+' and '/' characters of standard Base64 are respectively replaced by '-' and '_', so that using URL encoders/decoders is no longer necessary and has no impact on the length of the encoded value, leaving the same encoded form intact for use in relational databases, web forms, and object identifiers in general. Using .NET I want to modify my current code from doing basic base64 encoding and decoding to using the "modified base64 for URL" method. Has anyone done this? To decode, I know it starts out with something like: string base64EncodedText = base64UrlEncodedText.Replace('-', '+').Replace('_', '/'); // Append '=' char(s) if necessary - how best to do this? // My normal base64 decoding now uses encodedText But, I need to potentially add one or two '=' chars to the end which looks a little more complex. My encoding logic should be a little simpler: // Perform normal base64 encoding byte[] encodedBytes = Encoding.UTF8.GetBytes(unencodedText); string base64EncodedText = Convert.ToBase64String(encodedBytes); // Apply URL variant string base64UrlEncodedText = base64EncodedText.Replace("=", String.Empty).Replace('+', '-').Replace('/', '_'); I have seen the Guid to Base64 for URL StackOverflow entry, but that has a known length and therefore they can hardcode the number of equal signs needed at the end.

    Read the article

  • Garbled text when constructing emails with vmime

    - by Klaus Fiedler
    Hey, my Qt C++ program has a part where it needs to send the first 128 characters or so of the output of a bash command to an email address. The output from the tty is captured in a text box in my gui called textEdit_displayOutput and put into my message I built using the Message Builder ( the object m_vmMessage ) Here is the relevant code snippet: m_vmMessage.getTextPart()->setCharset( vmime::charsets::US_ASCII ); m_vmMessage.getTextPart()->setText( vmime::create < vmime::stringContentHandler > ( ui->textEdit_displayOutput->toPlainText().toStdString() ) ); vmime::ref < vmime::message > msg = m_vmMessage.construct(); vmime::utility::outputStreamAdapter out( std::cout ); msg->generate( out ); Giving bash 'ls /' and a newline makes vmime give terminal output like this: ls /=0Abin etc=09 initrd.img.old mnt=09 sbin=09 tmp=09 vmlinuz.o= ld=0Aboot farts=09 lib=09=09 opt=09 selinux usr=0Acdrom home=09 = lost+found=09 proc srv=09 var=0Adev initrd.img media=09 root = Whereas it should look more like this: ls / bin etc initrd.img.old mnt sbin tmp vmlinuz.old boot farts lib opt selinux usr cdrom home lost+found proc srv var dev initrd.img media root sys vmlinuz 18:22> How do I encode the email properly? Does vmime just display it like that on purpose and the actual content of the email is ok?

    Read the article

  • Need help with PHP URL encoding/decoding

    - by Kenan
    On one page I'm "masking"/encoding URL which is passed to another page, there I decode URL and start file delivering to user. I found some function for encoding/decoding URL's, but sometime encoded URL contains "+" or "/" and decoded link is broken. I must use "folder structure" for link, can not use QueryString! Here is encoding function: $urll = 'SomeUrl.zip'; $key = '123'; $result = ''; for($i=0; $i<strlen($urll); $i++) { $char = substr($urll, $i, 1); $keychar = substr($key, ($i % strlen($key))-1, 1); $char = chr(ord($char)+ord($keychar)); $result.=$char; } $result = urlencode(base64_encode($result)); echo '<a href="/user/download/'.$result.'/">PC</a>'; Here is decoding: $urll = 'segment_3'; //Don't worry for this one its CMS retrieving 3rd "folder" $key = '123'; $resultt = ''; $string = ''; $string = base64_decode(urldecode($urll)); for($i=0; $i<strlen($string); $i++) { $char = substr($string, $i, 1); $keychar = substr($key, ($i % strlen($key))-1, 1); $char = chr(ord($char)-ord($keychar)); $resultt.=$char; } echo '<br />DEC: '. $resultt; So how to encode and decode url. Thanks

    Read the article

  • Decode html tag so that it can be read when it goes back to the server more specifically the controller

    - by Yusuf
    My engine is Aspx. How can I decode/encode the html tags that is in my text box. I have the html tag to make it more readable. I tried the ValidationRequest and the htmlDecode(freqQuestion.Answer) but no luck. I just keep getting the same message. Server Error in '/Administrator' Application. A potentially dangerous Request.Form value was detected from the client (QuestionAnswer="...ics Phone:123-456-7890 Description: Request Validation has detected a potentially dangerous client input value, and processing of the request has been aborted. This value may indicate an attempt to compromise the security of your application, such as a cross-site scripting attack. To allow pages to override application request validation settings, set the requestValidationMode attribute in the httpRuntime configuration section to requestValidationMode="2.0". Example: . After setting this value, you can then disable request validation by setting validateRequest="false" in the Page directive or in the configuration section. However, it is strongly recommended that your application explicitly check all inputs in this case. For more information, see http://go.microsoft.com/fwlink/?LinkId=153133. View Page <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" validateRequest="false" Inherits="System.Web.Mvc.ViewPage<dynamic>" %> <asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server"> EditFreqQuestionsUser </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> <script type="text/javascript"> $(document).ready(function () { $("#freqQuestionsUserUpdateButton").click(function () { $("#updateFreqQuestionsUser").submit(); }); }); </script> <h2>Edit Freq Questions User </h2> <%Administrator.DarkstarAdminProductionServices.FreqQuestionsUser freqQuestionsUser = ViewBag.freqQuestionsUser != null ? ViewBag.freqQuestionsUser : new Administrator.DarkstarAdminProductionServices.FreqQuestionsUser(); %> <%List<string> UserRoleList = Session["UserRoles"] != null ? (List<string>)Session["UserRoles"] : new List<string>(); %> <form id="updateFreqQuestionsUser" action="<%=Url.Action("SaveFreqQuestionsUser","Prod")%>" method="post"> <table> <tr> <td colspan="3" class="tableHeader">Freq Questions User Details <input type ="hidden" value="<%=freqQuestionsUser.freqQuestionsUserId%>" name="freqQuestionsUserId"/> </td> </tr> <tr> <td colspan="2" class="label">Question Description:</td> <td class="content"> <input type="text" maxlength="2000" name="QuestionDescription" value="<%=freqQuestionsUser.questionDescription%>" /> </td> </tr> <tr> <td colspan="2" class="label">QuestionAnswer:</td> <td class="content"> <input type="text" maxlength="2000" name="QuestionAnswer" value="<%=Server.HtmlDecode(freqQuestionsUser.questionAnswer)%>" /> </td> </tr> <tr> <td colspan="3" class="tableFooter"> <br /> <a id="freqQuestionsUserUpdateButton" href="#" class="regularButton">Save</a> <a href="javascript:history.back()" class="regularButton">Cancel</a> </td> </tr> </table> </form> </asp:Content> Controller [AuthorizeAttribute(AdminRoles = "EditFreqQuestionsUser")] public ActionResult SaveFreqQuestionsUser(string QuestionDescription, string QuestionAnswer) { Guid freqQuestionsUserId = Request.Form["freqQuestionsUserId"] != null ? new Guid(Request.Form["freqQuestionsUserId"]) : Guid.Empty; //load agreement eula ref AdminProductionServices.FreqQuestionsUser freqqQuestionsUser = Administrator.Models.AdminProduction.FreqQuestionsUser.LoadFreqQuestionsUser(freqQuestionsUserId, string.Empty, string.Empty)[0]; freqqQuestionsUser.questionDescription = QuestionDescription; freqqQuestionsUser.questionAnswer = QuestionAnswer; //save it Administrator.Models.AdminProduction.FreqQuestionsUser.addFreqQuestionsUser(freqqQuestionsUser); return RedirectToAction("SearchFreqQuestionsUser", "Prod", new { FreqQuestionsUserId = freqQuestionsUserId }); }

    Read the article

  • How can I re-encode H.264 video with minimal quality loss?

    - by SofaKng
    I have a lot of MPEG-TS files (.TS container but H.264 video) and playback is fine except that when you skip forward/backward or fast forward it's very sluggish and gets pixelated, etc. I've been trying to do research and I'm guessing that they were encoding with very few reference blocks (ie. it's a capture from a DVB-S satellite stream). When I re-encode them with Handbrake (.MP4 container) they play very, very good and seeking in the video is instant, etc, etc. Is it possible to transcode/re-encode my MPEG-TS files with minimal quality loss? If so, what is my best bet? They are each about 2 Mbps (ie. 2 GB per hour) but I don't want to re-encode them if "minimal quality loss" requires 10+ GB per file. I'm hoping to keep the video are the same size. Can anybody give me any advice?

    Read the article

  • How to use HtmlEncode with TemplateFields, Data Binding, and a GridView

    - by Yadyn
    I have a GridView bound to an ObjectDataSource. I've got it supporting editing as well, which works just fine. However, I'd like to safely HtmlEncode text that is displayed as we do allow special characters in certain fields. This is a cinch to do with standard BoundFields, as I just set HtmlEncode to true. But in order to setup validation controls, one needs to use TemplateFields instead. How do I easily add HtmlEncoding to output this way? This is an ASP.NET 2.0 project, so I'm using the newer data binding shortcuts (e.g. Eval and Bind). What I'd like to do is something like the following: <asp:TemplateField HeaderText="Description"> <EditItemTemplate> <asp:TextBox ID="TextBoxDescription" runat="server" Text='<%# System.Web.HttpUtility.HtmlEncode(Bind("Description")) %>' ValidationGroup="EditItemGrid" MaxLength="30" /> <asp:Validator ... /> </EditItemTemplate> <ItemTemplate> <asp:Label ID="LabelDescription" runat="server" Text='<%# System.Web.HttpUtility.HtmlEncode(Eval("Description")) %>' /> </ItemTemplate> </asp:TemplateField> However, when I try it this way, I get the following error: CS0103: The name 'Bind' does not exist in the current context

    Read the article

  • Rle Encoding...What's the wrong?

    - by FILIaS
    I'm trying to make a Rle Encoder Programme.I read the way it works on notes on net. And i tried to fix my code! Regardless I think that the structure and logic of code are right,the code doesnt work! It appears some strange 'Z' as it runs. I really cant find what;s wrong! Could u please give me a piece of advice? Thanx in advance... #include <stdio.h> int main() { int count; unsigned char currChar,prevChar=EOF; while(currChar=getchar() != EOF) { if ( ( (currChar='A')&&(currChar='Z') ) || ( (currChar='a')&&(currChar='z') ) ) { printf("%c",currChar); if(prevChar==currChar) { count=0; currChar=getchar(); while(currChar!='EOF') { if (currChar==prevChar) count++; else { if(count<=9) printf("%d%c",count,prevChar); else { printf("%d%c",reverse(count),prevChar); } prevChar=currChar; break; } } } else prevChar=currChar; if(currChar=='EOF') { printf("%d",count); break; } } else { printf("Error Message:Only characters are accepted! Please try again! False input!"); break; } } return 0; } int reverse(int x) { int piliko,ypoloipo,r=0; x=(x<0)?-x:x; while (x>0) { ypoloipo=x%10; piliko=x/10; r=10*r+ypoloipo; x=piliko; } printf("%d",r); return 0; }

    Read the article

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