Search Results

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

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

  • Not able to get the data from the JSON in OpenSocial App!

    - by Abhishek
    I have follwing JSON: {"mykey":[{name:"Jak",interests:"movies"}]} and following opensocial app code: <script type="text/os-template" require="mykey"> <ul> <li repeat="${mykey}"> <span>Offer id: ${Cur.name}</span> <span>Offer: ${Cur.interests}</span> </li> </ul> </script> but the App is not able to get the data from the JSON? Not able to find out the issue!

    Read the article

  • Alt attribute encoding with JavaScript

    - by MainMa
    Hi, Html entities must be encoded in alt attribute of an image in HTML page. So <img id="formula" alt="A &rarr; B" src="formula.png" /> will work well. On the other hand, the same JavaScript code will not work document.getElementById('formula').alt = 'A &rarr; B'; and will produce A &rarr; B instead of A → B. How to do it through JavaScript, when it is not possible to put the special (unencoded) characters in the source code?

    Read the article

  • Using json_encode on objects in PHP

    - by Alan
    Hi, I'm trying to output lists of objects as json and would like to know if there's a way to make objects usable to json_encode? The code I've got looks something like $related = $user->getRelatedUsers(); echo json_encode($related); Right now, I'm just iterating through the array of users and individually exporting them into arrays for json_encode to turn into usable json for me. I've already tried making the objects iterable, but json_encode just seems to skip them anyway.

    Read the article

  • What is the best php encoder software ?

    - by question_about_the_problem
    What is the best php encoder software? http://www.freedownloadmanager.org/downloads/php_encoder_software/ http://forums.digitalpoint.com/showthread.php?t=596680 or another. Everybody say Zend Guard. But you can decode/decript zend's files at the page http://www.showmycode.com/ I think, SourceGuardian is good. But I'm not so sure.

    Read the article

  • <%: %> brackets for HTML Encoding in ASP.NET 4.0

    - by Slauma
    Accidentally I found this post about a new feature in ASP.NET 4.0: Expressions enclosed in these new brackets <%: Content %> should be rendered as HTML encoded. I've tried this within a databound label in a FormView like so: <asp:Label ID="MyLabel" runat="server" Text='<%: Eval("MyTextProperty") %>' /> But it doesn't work: The text property contains script tags (for testing), but the output is blank. Using the traditional way works: <asp:Label ID="MyLabel" runat="server" Text='<%# HttpUtility.HtmlEncode(Eval("MyTextProperty")) %>' /> What am I doing wrong? (On a sidenote: I am too stupid to find any information: Google refuses to search for that thing. The VS2010 Online help on MSDN offers a lot of hits, but nothing related to my search. Stackoverflow search too. And I don't know how these "things" (the brackets I mean) are officially called to have a better search term.) Any info and additional links and resources are welcome! Thanks in advance!

    Read the article

  • [Ruby] Why do I have to URI.encode even safe characters for Net::HTTP requests?

    - by Matthias
    I was trying to send a GET request to Twitter (user ID replaced for privacy reasons) using Net::HTTP: url = URI.parse("http://api.twitter.com/1/friends/ids.json?user_id=12345") resp = Net::HTTP.get_response(url) this throws an exception in Net::HTTP: NoMethodError: undefined method empty?' for #<URI::HTTP:0x59f5c04> from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/http.rb:1470:ininitialize' just by coincidence, I stumbled upon a similar code snippet, which used URI.encode prior to URI.parse, so I copied that and tried again: url = URI.parse(URI.encode("http://api.twitter.com/1/friends/ids.json?user_id=12345")) resp = Net::HTTP.get_response(url) now it works fine, but why? There are no reserved characters that need escaping in the URL I mentioned, so why do I have to call URI.encode for get_response to succeed?

    Read the article

  • How do I use the html 'title' attribute with Html.Encode()?

    - by Kai
    Hello, I've been tryin to find an example of the syntax for getting an html 'title' for a string when using Html.Encode(). I want to display the full name in the mouseover title, if it's too long. Is there a way to do this without wrapping the string in a < span , i.e. <span title = "<%=Html.Encode(model.Name) %>"> //displays the full name on mouseover <%=Html.Encode(model.Name.Substring(0, 10))%>... //displays the name up to a max length </span> Or should I just do it this way? Thanks!

    Read the article

  • Renderpartial or renderaction

    - by femi
    have an action that generates active vacancies. The code is below; public ViewResult OpenVacancies() { var openvacancies = db.GetActiveVacancies(); return View(openvacancies); } I want to use this list on several pages so i guess the best thing to use is html.renderaction (please correct me if i am wrong here). Please note that the view and .ascx control are in an Area. I then created a view by right clicking inside the action and create a .ascx and a strongly typed view of Vacancy. I chose a view content of "List". I then added this line to the required page; <% Html.RenderAction("OpenVacancies"); % Please note that the view and .ascx control are in an Area. The error i got is; The type or namespace name 'Vacancy' could not be found (are you missing a using directive or an assembly reference?) the .ascx code is below; <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" % <table> <tr> <th></th> <th> VacancyID </th> <th> JobTitle </th> <th> PositionID </th> <th> LocationID </th> <th> JobDescription </th> <th> JobConditions </th> <th> Qualifications </th> <th> RequiredSkills </th> <th> Certifications </th> <th> AdvertDate </th> <th> AdvertExpiryDate </th> <th> Status </th> <th> StaffLevel </th> <th> LineManagerEmail </th> <th> ApprovalFlag </th> <th> RequisitionDate </th> </tr> <% foreach (var item in Model) { %> <tr> <td> <%= Html.ActionLink("Edit", "Edit", new { id=item.VacancyID }) %> | <%= Html.ActionLink("Details", "Details", new { id=item.VacancyID })%> | <%= Html.ActionLink("Delete", "Delete", new { id=item.VacancyID })%> </td> <td> <%= Html.Encode(item.VacancyID) %> </td> <td> <%= Html.Encode(item.JobTitle) %> </td> <td> <%= Html.Encode(item.PositionID) %> </td> <td> <%= Html.Encode(item.LocationID) %> </td> <td> <%= Html.Encode(item.JobDescription) %> </td> <td> <%= Html.Encode(item.JobConditions) %> </td> <td> <%= Html.Encode(item.Qualifications) %> </td> <td> <%= Html.Encode(item.RequiredSkills) %> </td> <td> <%= Html.Encode(item.Certifications) %> </td> <td> <%= Html.Encode(String.Format("{0:g}", item.AdvertDate)) %> </td> <td> <%= Html.Encode(String.Format("{0:g}", item.AdvertExpiryDate)) %> </td> <td> <%= Html.Encode(item.Status) %> </td> <td> <%= Html.Encode(item.StaffLevel) %> </td> <td> <%= Html.Encode(item.LineManagerEmail) %> </td> <td> <%= Html.Encode(item.ApprovalFlag) %> </td> <td> <%= Html.Encode(String.Format("{0:g}", item.RequisitionDate)) %> </td> </tr> <% } %> </table> <p> <%= Html.ActionLink("Create New", "Create") %> </p>

    Read the article

  • JQuery and radio buttons

    - by ognjenb
    <form id="Numbers1" <table id="numbers"> <tr> <th> prvi_br </th> <th> drugi_br </th> <th> treci_br </th> </tr> <% int rb = 1; %> <% foreach (var item in Model) { %> <tr> <td> <%= Html.Encode(item.prvi_br) %> <input type="radio" name="<%= Html.Encode(rb) %>" value="<%= Html.Encode(rb) %>" id='<%= Html.Encode(item.prvi_br) %>'/> </td> <td> <%= Html.Encode(item.drugi_br) %> <input type="radio" name="<%= Html.Encode(rb) %>" value="<%= Html.Encode(rb) %>" id='<%= Html.Encode(item.drugi_br) %>'/> </td> <td> <%= Html.Encode(item.treci_br) %> <input type="radio" name="<%= Html.Encode(rb) %>" value="<%= Html.Encode(rb) %>" id='<%= Html.Encode(item.treci_br) %>'/> </td> <% rb=rb+1; %> </tr> <% } %> </table> <p> <input type="submit" value="Save" /> </p> </form> With this script I get some info of selected radio: <script type="text/javascript"> $(document).ready(function() { var thevalue1; var thevalue2; $("#Numbers1").submit(function() { $("input:radio:checked").each(function() { thevalue1 = $("input:radio:checked").attr('id'); thevalue2 = $("input:radio:checked").val(); alert(thevalue1 + thevalue2); }); }); }); </script> If I have more rows this alert every time prints the information of first selected radio, why???

    Read the article

  • post row where radio button is checked

    - by ognjenb
    View: <form id="numbers-form" method="post" action="/Numbers/Numbers"> <table id="numbers"> <tr> <th> prvi_br </th> <th> drugi_br </th> <th> treci_br </th> </tr> <% int rb = 1; %> <% foreach (var item in Model) { %> <tr> <td> <%= Html.Encode(item.prvi_br) %> <input type="radio" name="<%= Html.Encode(rb) %>" value="<%= Html.Encode(rb) %>" id='<%= Html.Encode(item.prvi_br) %>'/> </td> <td> <%= Html.Encode(item.drugi_br) %> <input type="radio" name="<%= Html.Encode(rb)%>" value="<%= Html.Encode(rb) %>" id='<%= Html.Encode(item.drugi_br) %>'/> </td> <td> <%= Html.Encode(item.treci_br) %> <input type="radio" name="<%= Html.Encode(rb)%>" value="<%= Html.Encode(rb) %>" id='<%= Html.Encode(item.treci_br) %>'/> </td> </tr> <% rb++; %> <% } %> </table> <p> <input type="submit" value="Save" /> </p> </form> Controller action: [HttpPost] public ActionResult Numbers(int[] rb) { brojevi br = new brojevi(); for (int i = 1; i <= rb.Length; i++) //in this line I have error:Object reference not set to an instance of an object. { br.prvi_br = i; br.drugi_br = i+1; br.treci_br = i+3; } numbers.AddTobrojevi(br); numbers.SaveChanges(); return View(); } I try to post data row in wich radio button is checked but failed, what is wrong??

    Read the article

  • What is the proper way to URL encode Unicode characters?

    - by Josh Gibson
    I know of the non-standard %uxxxx scheme but that doesn't seem like a wise choice since the scheme has been rejected by the W3C. Some interesting examples: The heart character. If I type this into my browser: http://www.google.com/search?q=? Then copy and paste it, I see this URL http://www.google.com/search?q=%E2%99%A5 which makes it seem like Firefox (or Safari) is doing this. urllib.quote_plus(x.encode("latin-1")) '%E2%99%A5' which makes sense, except for things that can't be encoded in Latin-1, like the triple dot character. … If I type the URL http://www.google.com/search?q=… into my browser then copy and paste, I get http://www.google.com/search?q=%E2%80%A6 back. Which seems to be the result of doing urllib.quote_plus(x.encode("utf-8")) which makes sense since … can't be encoded with Latin-1. But then its not clear to me how the browser knows whether to decode with UTF-8 or Latin-1. Since this seems to be ambiguous: In [67]: u"…".encode('utf-8').decode('latin-1') Out[67]: u'\xc3\xa2\xc2\x80\xc2\xa6' works, so I don't know how the browser figures out whether to decode that with UTF-8 or Latin-1. What's the right thing to be doing with the special characters I need to deal with?

    Read the article

  • How do you encode Algebraic Data Types in a C#- or Java-like language?

    - by Jörg W Mittag
    There are some problems which are easily solved by Algebraic Data Types, for example a List type can be very succinctly expressed as: data ConsList a = Empty | ConsCell a (ConsList a) consmap f Empty = Empty consmap f (ConsCell a b) = ConsCell (f a) (consmap f b) l = ConsCell 1 (ConsCell 2 (ConsCell 3 Empty)) consmap (+1) l This particular example is in Haskell, but it would be similar in other languages with native support for Algebraic Data Types. It turns out that there is an obvious mapping to OO-style subtyping: the datatype becomes an abstract base class and every data constructor becomes a concrete subclass. Here's an example in Scala: sealed abstract class ConsList[+T] { def map[U](f: T => U): ConsList[U] } object Empty extends ConsList[Nothing] { override def map[U](f: Nothing => U) = this } final class ConsCell[T](first: T, rest: ConsList[T]) extends ConsList[T] { override def map[U](f: T => U) = new ConsCell(f(first), rest.map(f)) } val l = (new ConsCell(1, new ConsCell(2, new ConsCell(3, Empty))) l.map(1+) The only thing needed beyond naive subclassing is a way to seal classes, i.e. a way to make it impossible to add subclasses to a hierarchy. How would you approach this problem in a language like C# or Java? The two stumbling blocks I found when trying to use Algebraic Data Types in C# were: I couldn't figure out what the bottom type is called in C# (i.e. I couldn't figure out what to put into class Empty : ConsList< ??? >) I couldn't figure out a way to seal ConsList so that no subclasses can be added to the hierarchy What would be the most idiomatic way to implement Algebraic Data Types in C# and/or Java? Or, if it isn't possible, what would be the idiomatic replacement?

    Read the article

  • Make Apache encode or replace quotes instead of escaping them?

    - by mplungjan
    In the dcoumentation I read Format Notes For security reasons, starting with version 2.0.46, non-printable and other special characters in %r, %i and %o are escaped using \xhh sequences, where hh stands for the hexadecimal representation of the raw byte. Exceptions from this rule are " and \, which are escaped by prepending a backslash, and all whitespace characters, which are written in their C-style notation (\n, \t, etc). In versions prior to 2.0.46, no escaping was performed on these strings so you had to be quite careful when dealing with raw log files. This is a problem for Analog which is still the handiest analyser I use. I get .... "GET /somerequest?q=\"quoted string\"&someparm=bla" in the logfile and it is of course flagged as corrupt since Analog expects .... "GET /somerequest?q=%22quoted string%22&someparm=bla" or similar. I realise I can pre-process using something like perl -p -i.bak -e 's/\\"/%22/g' logfile But I'd rather not have to add this step to these files which are 50-90MB zipped per day Thanks for any pointers

    Read the article

  • FFMPEG, FLAC. How do i encode with highest compression?

    - by acidzombie24
    With FFMPEG how do i encode a lossless codec (ATM i am testing with another flac) to a flac file with the highest compression level. With MediaMonkey i was able to compress to level 8 and i recompressed with ffmpeg and it matched the output of a level 6 compress. Even with -aq 8. How do i set it to the highest compression?

    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

  • [ASP.NET] How can I HTML-encode a string and use human-readable encoded tags (ex: &ecirc; instead of

    - by Beerdude26
    Greetings, I'm looking for a way to encode a string into HTML that uses human-readable tags such as &ecirc; (=ê). At the moment, I am using the HttpUtility.HtmlEncode() function, but it appears to return numbered tags instead of human-readable ones. For example: Dim str as string = HttpUtility;HtmlEncode("vente - en-tête") 'Expected: vente - en-t&ecirc;te 'Actually received: vente - en-t&#234;te Is there a setting or function in ASP.Net to encode a string into HTML resembling the first comment? EDIT: I am looking for this kind of functionality because the text is saved HTML-encoded in the database. The text comes from a bunch of MS Word documents that have been converted to HTML.

    Read the article

  • How to encode video to use HTML 5 video tag? [closed]

    - by exquisitor
    I'm trying to use <video> tag feature. I've encoded my file with ffmpeg: ffmpeg -i 1.vob -f ogg -vcodec libtheora -b 800k -g 300 -acodec libvorbis -ab 128k out.ogv I've placed this text in index.html: <video src="out.ogv" controls></video> I've loaded this files to nginx document root and opened index.html in Firefox 3.5. I see the first frame, see controls, but can't play video. This video plays good even from my server. How should I encode video to view it in browser? UPD: If I start playing video from the middle, everything works fine.

    Read the article

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