Search Results

Search found 3471 results on 139 pages for 'docs'.

Page 20/139 | < Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >

  • Ruby on Rails: What are Erubis' disadvantages and why isn't it packaged with Rails by default? How t

    - by williamjones
    I just discovered Erubis, a replacement for the default view renderer for Ruby on Rails. However, from what I can tell from reading about it, it's superior across the board. It is much faster. It has many more options. It can prevent cross site scripting without having to use h. Does this have any disadvantages versus the standard erb renderer? Why isn't this the standard renderer packaged with Rails? Also, the docs for Erubis say to install it just by installing the gem, and then add the following to environment.rb: require 'erubis/helpers/rails_helper' #Erubis::Helpers::RailsHelper.engine_class = Erubis::Eruby # or Erubis::FastEruby Reading the docs, FastEruby seems to be just a faster renderer than Eruby. Why wouldn't it be default and used by everyone? I'm highly interested in using the engine erubis::EscapedEruby which automatically calls h to escape html on fields from the database. Are there any gotchas I should be aware of or does this pretty much solve all cross site scripting?

    Read the article

  • What is ExtJS philosophy? Single page application?

    - by stach
    I need to write my next project using ExtJs. It's a nice Javascript lib but I don't fully understand the idea behind it. Take the docs page for example: http://www.extjs.com/deploy/dev/docs/ Am I supposed to write my web applications with extjs like that? One page that should never be refreshed, and everything getting done by AJAX? How do you debug such applications if getting to the right place may take a lot of 'clicking' and working with it. You cannot fix the bug and hit refresh in the browser to see the results. Any suggestions?

    Read the article

  • highlight query string in more than one field using solr search feature

    - by Romi
    i am using solr indexes for showing my search results. to show serch results i am parsing json data received from solr. i am able to highlight a query string in search result but only in a single field. for this i set hl=true and hl.fl="field1". i did it as $.getJSON("http://192.168.1.9:8983/solr/db/select/?wt=json&&start=0&rows=100&q="+lowerCaseQuery+"&hl=true&hl.fl=description,name&hl.usePhraseHighlighter=true&sort=price asc&json.wrf=?", function(result){ var n=result.response.numFound var highlight = new Array(n); $.each(result.highlighting, function(i, hitem){ var match = hitem.text[0].match(/<em>(.*?)<\/em>/); highlight[i]=match[1]; }); $.each(newresult.response.docs, function(i,item){ var word=highlight[item["UID_PK"]]; var result = item.text[0].replace(new RegExp(word,'g'), '<em>' + word + '</em>'); }); for this json object is as : { "responseHeader": { "status": 0, "QTime": 32 }, "response": { "numFound": 21, "start": 0, "docs": [ { "description": "The matte finish waves on this wedding band contrast with the high polish borders. This sharp and elegant design was finely crafted in Japan.", "UID_PK": "8252", }, { "description": "This elegant ring has an Akoya cultured pearl with a band of bezel-set round diamonds making it perfect for her to wear to work or the night out.", "UID_PK": "8142", }, ] }, "highlighting": { "8252": { "description": [ " and <em>elegant</em> design was finely crafted in Japan." ] }, "8142": { "description": [ "This <em>elegant</em> ring has an Akoya cultured pearl with a band of bezel-set round diamonds making" ] }, } } Now if i want to highlight query string in two fields i did as hl=true hl.fl=descrption, name my json is as: { "responseHeader":{ "status":0, "QTime":16 }, "response":{ "numFound":1904, "start":0, "docs":[ { "description":"", "UID_PK":"7780", "name":[ "Diamond bracelet with Milgrain Bezel1" ] }, { "description":"This pendant is sure to win hearts. Round diamonds form a simple and graceful line.", "UID_PK":"8121", "name":[ "Heartline Diamond Pendant" ] }, "highlighting":{ "7780":{ "name":[ "<em>Diamond</em> bracelet with Milgrain Bezel1" ] }, "8121":{ "description":[ "This pendant is sure to win hearts. Round <em>diamonds</em> form a simple and graceful line." ], "name":[ "Heartline <em>Diamond</em> Pendant" ] } } } Now how should i parse it to get the result. suggest me some general technique, so if i want to highlight query in more fields then i could do so. Thanks

    Read the article

  • How Do I Remove The First 4 Characters From A String If It Matches A Pattern In Ruby

    - by James
    I have the following string: "h3. My Title Goes Here" I basically want to remove the first 4 characters from the string so that I just get back: "My Title Goes Here". The thing is I am iterating over an array of strings and not all have the h3. part in front so I can't just ditch the first 4 characters blindly. I have checked the docs and the closest think I could find was chomp, but that only works for the end of a string. Right now I am doing this: "h3. My Title Goes Here".reverse.chomp(" .3h").reverse This gives me my desired output, but there has to be a better way right? I mean I don't want to reverse a string twice for no reason. I am new to programming so I might have missed something obvious, but I didn't see the opposite of chomp anywhere in the docs. Is there another method that will work? Thanks!

    Read the article

  • Insert fixed elements in editable iframe

    - by swarnendude
    Hi, I have an editable iframe and I want to insert two DIVs at the [b]top [/b]and [b]bottom [/b]part(as header/footer) of iframe body respectively. Now, the question is : how to insert a div [b]at the top of iframe body[/b] and fix it there? (Will insertFirst() work?) Also, how to fix the footer div always [b]at the bottom of the iframe body[/b]? I tried make its position absolute and gave a margin top/bottom, but the problem comes when the body height of the iframe increases and footer DIV position does not change. I want the same thing google docs does, i.e. fixing separate part for header/footer (though google docs page is not an iframe). Any work around? Regards, Swarnendu

    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

  • What is the difference between the add and offer methods in a queue?

    - by Finbarr
    Take the PriorityQueue for example http://java.sun.com/j2se/1.5.0/docs/api/java/util/PriorityQueue.html#offer(E) According to the Collection API entry http://java.sun.com/j2se/1.5.0/docs/api/java/util/Collection.html the add method will often seek to ensure that an element exists within the Collection rather than adding duplicates. So my question is, what is the difference between the add and offer methods? Is it that the Offer method will add duplicates regardless? (I doubt that it is because if a Collection should only have distinct elements this would circumvent that).

    Read the article

  • Definitive list of protocols supported by the WebClient and WebRequest classes.

    - by the-locster
    The docs state: From WebRequest.Create Method The .NET Framework includes support for the http://, https://, and file:// URI schemes. Custom WebRequest descendants to handle other requests are registered with the RegisterPrefix method. However I've also been using this class to get files via ftp (not listed in the docs). Is there a definitive list of supported protocols documented anywhere? UPDATE: To clarify. Yes additional protocols can be plugged-in, but what is the standard/baseline set of protocols supported in the class framework assuming I haven't registered any others. e.g. sftp, tftp?

    Read the article

  • Custom configuration file custom_config.js not working?

    - by nanoquetz9l
    Hello gals/guys, I am trying to use a custom configuration file instead of the default config.js file in the ckeditor root. I have placed a renamed copy of the config.js file in my webroot and call it with customConfig. It is not working for me though. Is my syntax creating any issues? I used the dev docs site as a ref: http://docs.cksource.com/CKEditor_3.x/D ... igurations Any ides or comments will really help me out. Im stuck. Thanks!! nano <p></p> CKEDITOR.replace( 'ticket_text' ); CKEDITOR.replace( 'ticket_text1', { customConfig : '/ckeditor/custom_config.js' });

    Read the article

  • Retrieving values from Env in mod_esi or webtools

    - by williamstw
    A complete noob question, but how exactly do I get values (e.g. path_info) from inside the callback? From the docs, I thought it was a list of tuples, which I thought would make it accessible via lists:keyfind, but I've had no luck. So far, all the examples I've found only show how to print everything with io_lib but not how to access the values by key... Thanks, --tim The docs: Module:Function(SessionID, Env, Input)- _ Types SessionID = term() Env = [EnvironmentDirectives] ++ ParsedHeader EnvironmentDirectives = {Key, Value} Key = query_string | content_length | server_software | gateway_interface | server_protocol | server_port | request_method | remote_addr | script_name. <v>Input = string()

    Read the article

  • wxPython ,Change the background colour of a StyledTextCtrl

    - by user1357159
    I tried (but nothing happens) self.txt.SetBackgroundColour ((255,0,0)) As said in the title I'm trying to change the background colour StyledTextCtrl. Does anyone know a method that could be used? I've checked the API docs but I couldn't seem to find one, http://wxpython.org/docs/api/wx.stc.StyledTextCtrl-class.html (by background colour, I mean the whole writing area, of course) Does anyone know a way I could do this? EDIT: The background doesn't change in the following code import wx import wx.stc app = wx.App(redirect=True) top = wx.Frame(None, title="StyledTXTCtrl", size=(300,200)) txt=wx.stc.StyledTextCtrl(top) txt.SetBackgroundColour((255,255,0)) txt.Refresh() top.Show() app.MainLoop()

    Read the article

  • How to print object data in javascript

    - by rxzhang
    I have the following object data: var response = { "response": { "numFound": 7945, "docs": [{ "description": "target", "url": "target", "id": "269653", "score": 6.9186745 }, { "description": "Target Kent", "url": "Target_Kent", "id": "37275", "score": 4.3241715 }] }, "highlighting": { "269653": { "description": ["<em>target</em>"] }, "37275": { "description": ["<em>Target</em> Kent"] } } }; I can use response.response.docs[0].description to print out "target". But I don't know how to print out "<em>target</em>". Thanks.

    Read the article

  • Assorted list of what's new in Delphi [Language, RTL, VCL]?

    - by utku_karatas
    Hi gents, As someone who's been stuck at the older versions of Delphi and upgraded to D2010 lately, I figure I still use the language, RTL and VCL features from the D5 era and refrain from using these new features as the documents on those are somewhat decentralized around the blogosphere. So I'd like to ask if there was an assorted list like what's new docs of Python's - clear and concise to the point. Btw, please no screencasts. They seem to be quite abundant lately (probably because of CodeRages) but I find them very unintuitive to learn from. Let's leave that docs in video format thing to RoR community, shall we :).

    Read the article

  • Why does SQLAlchemy with psycopg2 use_native_unicode have poor performance?

    - by Bob Dover
    I'm having a difficult time figuring out why a simple SELECT query is taking such a long time with sqlalchemy using raw SQL (I'm getting 14600 rows/sec, but when running the same query through psycopg2 without sqlalchemy, I'm getting 38421 rows/sec). After some poking around, I realized that toggling sqlalchemy's use_native_unicode parameter in the create_engine call actually makes a huge difference. This query takes 0.5secs to retrieve 7300 rows: from sqlalchemy import create_engine engine = create_engine("postgresql+psycopg2://localhost...", use_native_unicode=True) r = engine.execute("SELECT * FROM logtable") fetched_results = r.fetchall() This query takes 0.19secs to retrieve the same 7300 rows: engine = create_engine("postgresql+psycopg2://localhost...", use_native_unicode=False) r = engine.execute("SELECT * FROM logtable") fetched_results = r.fetchall() The only difference between the 2 queries is use_native_unicode. But sqlalchemy's own docs state that it is better to keep use_native_unicode=True (http://docs.sqlalchemy.org/en/latest/dialects/postgresql.html). Does anyone know why use_native_unicode is making such a big performance difference? And what are the ramifications of turning off use_native_unicode?

    Read the article

  • Need simple Twitter API v1.1 example to show timeline using jQuery or C# ASP.NET

    - by Ken Palmer
    With Twitter turning off the API 1.0 faucet on 6/11/2013, we have several sites that now fail to display timelines. I've been looking for an "If you did that, now do this" example. Here was Twitter's announcement. https://dev.twitter.com/blog/api-v1-is-retired Here is what we were originally doing to show the Twitter timeline via API 1.0. <div id="twitter"> <ul id="twitter_update_list"></ul> <script type="text/javascript" src="http://twitter.com/javascripts/blogger.js"></script> <script type="text/javascript" src="http://api.twitter.com/1/statuses/user_timeline/companytwitterhandle.json?callback=twitterCallback2&amp;count=1"></script> <div style="float:left;"><a href="https://twitter.com/companytwitterhandle" target="_blank">@companytwitterhandle</a> | </div> <div class="twitterimg">&nbsp;</div> </div> Initially I tried changing the version in the JavaScript reference URL like so, which did not work. <script type="text/javascript" src="http://api.twitter.com/1.1/statuses/user_timeline/companytwitterhandle.json?callback=twitterCallback2&amp;count=1"></script> Then I looked at the Twitter API documentation (https://dev.twitter.com/docs/api/1.1/overview) which lacks a clear transition example. I don't have 4 or 5 hours to delve into that, or into this disheveled FAQ (https://dev.twitter.com/docs/faq#17750). Then I found this API documentation regarding the user timeline. So I changed the URL again as shown below. https://dev.twitter.com/docs/api/1.1/get/statuses/user_timeline <script type="text/javascript" src="https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=companytwitterhandle&amp;count=1"></script> That did not work. Using jQuery or C# ASP.NET MVC, how can I transition that interface from Twitter API 1.0 to Twitter API 1.1? My first preference would be for a browser client side implementation if that is possible. Please include a code example. Thanks.

    Read the article

  • jquery-ui - position of a list item when starting drag and drop?

    - by user246114
    Hi, I am using the jquery-ui library. I have two sortables. I want to know the index of the dragged source item. I have something like this: $(function() { $("#sortable1, #sortable2").sortable({ connectWith: '.connectedSortable' }).disableSelection(); $("#sortable1").sortable({ start: function(event, ui) { alert(ui.position); } }); }); if I'm reading the docs correctly, then ui.position should be what I want?: ui.position - current position of the helper but when I jsut try printing it: alert(ui.position) it seems to be empty. I am doing all of this in an attempt to emulate cloning. docs: http://jqueryui.com/demos/sortable/#event-activate Thanks

    Read the article

  • Drupal: Views: grouping relationship in block list

    - by Ronn
    I have a question about views, specifically about grouping a relationship. I have a "partner" node that has many "docs", I want to list the name of the "partner" along with its corresponding "docs" below. I have the relationship set up correctly(I think) but can't figure out how or where to group it correctly. I get this: partner name 1 - doc name 1 partner name 1 - doc name 2 partner name 1 - doc name 3 partner name 2 - doc name 4 partner name 2 - doc name 5 partner name 3 - doc name 6 but would like this: partner name 1 - doc name 1 - doc name 2 - doc name 3 partner name 2 - doc name 4 - doc name 5 - doc name 6

    Read the article

  • How do I control output files name and content of an Hadoop streaming job?

    - by Eran Kampf
    Is there a way to control the output filenames of an Hadoop Streaming job? Specifically I would like my job's output files content and name to be organized by the ket the reducer outputs - each file would only contain values for one key and its name would be the key. Update: Just found the answer - Using a Java class that derives from MultipleOutputFormat as the jobs output format allows control of the output file names. http://hadoop.apache.org/core/docs/current/api/org/apache/hadoop/mapred/lib/MultipleOutputFormat.htmlhttp://hadoop.apache.org/core/docs/current/api/org/apache/hadoop/mapred/lib/MultipleOutputFormat.html I havent seen any samples for this out there... Can anyone point out to an Hadoop Streaming sample that makes use of a custom output format Java class?

    Read the article

  • how can JIRA soap API not have this method?

    - by oo
    I want to be able to get a list of issues given a: Project Name and Release Version this seems like a basic JIRA soap API 101 request It seems, looking at the documentation: http://docs.atlassian.com/software/jira/docs/api/rpc-jira-plugin/latest/index.html?com/atlassian/jira/rpc/soap/JiraSoapService.html you can get issues by: Filter SearchTerms SearchTerms and Project but not the above. Is this a complete oversight or i am missing something i would expect to see something like this: RemoteIssue[] issues = _soapService.getIssues(string project_, string version_) any help? UPDATE: I see that JIRA 4.0 is out but i can't find any documentation if the API has changed to support this request above. Can anyone find this link to answer that questions.

    Read the article

  • Document conversion and viewing, what are the cutting edge solutions?

    - by DigitalLawyer
    Goal: building a web application where a user can: Upload a document (doc, docx, pdf, additional office formats a +) View that document in a browser, preferably in html Download the document (in doc, pdf, additional open formats a +) Current solution: Ruby on Rails Application on Rackspace Users can upload doc and pdf files (AWS) Files can be downloaded in the format in which they were uploaded Thumbnail generation ([doc, pdf] - pdf - png) is done through AbiWord. Certain doc files do not convert well. Documents can be viewed in embedded Google docs viewer (https://docs.google.com/viewer). Certain doc files cannot be displayed. Little flexibility. Potential improvements: Document viewing in pdf through pdf.js Viewing in html (+ annotation) through Crocodoc I'd be glad to hear other users' experiences, and will add good recommendations to this list.

    Read the article

  • What is the best instance type to use for hosting a website on ec2?

    - by Josh
    Amazon offers two instance types on EC2: 1) On-Demand and 2) Reserved. After reading the docs on these, I don't really understand the difference from an end-user perspective. More specifically, I'd like to know the answer to this question: is one or the other better for web applications? Based on their names and descriptions, it seems as though on-demand instances may get wiped away from the server altogether if they're not in use which means that they need to be restarted when a request finally does come in. That seems like a pretty bad thing for a website. Am I just misinterpreting the docs? Thanks!

    Read the article

< Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >