Search Results

Search found 301 results on 13 pages for 'underscore'.

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

  • How can accomplish an if else statement from the underscore template to mustache

    - by user2942566
    I have an underscore template and I have to use Mustache to render it. Below is my underscore template: <div id="sub-account"> <p>something</p> <table> <tr><td>Name</td> </tr> <tbody> <% _.each(accountList, function(account) { %> <tr> <td><%= account.get('name') %></td> </tr> <% }) %> </tbody> </table> </div> Im using a mustache as my main view to render a list. I also added _.templateSettings = { evaluate : /\{\[([\s\S]+?)\]\}/g, interpolate : /\{\{([\s\S]+?)\}\}/g, escape : /<%-([\s\S]+?)%>/g, }; to my undersocre.js settings. How can i loop through the code to render as a mustache template. Any ideas???

    Read the article

  • Python double underscore mangling

    - by gnr
    I am a bit confused by this behavior (using python 3.2): class Bar: pass class Foo: def __init__(self): self.__cache = None bar = Bar() bar.__cache = None foo = Foo() print(vars(bar)) #returns {'__cache': None} print(vars(foo)) #returns {'_Foo__cache': None} I've read up a bit on how double-underscores cause attribute names to be "mangled", but I would have expected the same name-mangling in both cases above. The meaning of a single- and a double-underscore before an object name in Python Any ideas what's going on here?

    Read the article

  • Shared Data Source name error underscore characters added

    - by mick
    The name of our shared data source in RS (report server) is "AF1 Live Database" (no underscore characters - just spaces between words) and is the same in report builder in VS. However, the following error pops up when the RDL of this report is uploaded onto our company site and run. (error we are receiving...) The report server cannot process the report or shared dataset. The shared data source 'AF1_Live_Database' for the report server or SharePoint site is not valid. Browse to the server or site and select a shared data source. (rsInvalidDataSourceReference) We have no idea why the error reports the shared data source as 'AF1_Live_Database' with underscore characters? As this appears to be the problem that keeps the report from running we are seeking your help, thanks.

    Read the article

  • Is there a way of providing a final transform method when chaining operations (like map reduce) in underscore.js?

    - by latentflip
    (Really strugging to title this question, so if anyone has suggestions feel free.) Say I wanted to do an operation like: take an array [1,2,3] multiply each element by 2 (map): [2,4,6] add the elements together (reduce): 12 multiply the result by 10: 120 I can do this pretty cleanly in underscore using chaining, like so: arr = [1,2,3] map = (el) -> 2*el reduce = (s,n) -> s+n out = (r) -> 10*r reduced = _.chain(arr).map(map).reduce(reduce).value() result = out(reduced) However, it would be even nicer if I could chain the 'out' method too, like this: result = _.chain(arr).map(map).reduce(reduce).out(out).value() Now this would be a fairly simple addition to a library like underscore. But my questions are: Does this 'out' method have a name in functional programming? Does this already exist in underscore (tap comes close, but not quite).

    Read the article

  • Getting a lot of backslash underscore errors from webmaster tools

    - by Vermino
    I'm using a wordpress site and I thought I got all the kinks out of it. For some reason Webmaster tools is crawling my website and showing a lot of 404 errors which are from "/_" like additional pages that's i've never created. I just can't figure out what is creating these to google crawlers and then displaying a 404. my robots txt http://www.redcherryshrimp.net/robots.txt my sitemap created from Yoast plugin http://www.redcherryshrimp.net/sitemap_index.xml I have Yoast(creates the sitemap) and Jetpack plugins installed

    Read the article

  • In Ruby on Rails Routing I Would Like to Use Dash `-` Instead of Underscore `_`

    - by pablitostar
    I would like all the URLs for my web applications to use dash - instead of underscore _ for word separators. I'm surprised about a couple of things really: Google et al. continue to distinguish them. That RoR doesn't have a simple global configuration parameter to map - to _ in the routing. Or does it? I found a few questions here and elsewhere, but the best solution I've seen is to use :as or a named route. That's quite annoying. So I'm thinking of modifying the Rails routing to check for that global config and change - to _ before dispatching to a controller action. But before I do that, I'm hoping someone can save me the trouble! Thanks in advance for any help, or even confirmation that my approach makes sense. I'd submit it back. BTW, I'm currently on 2.3.8, but hope to migrate to 3 soon.

    Read the article

  • What's the deal with a leading underscore in PHP class methods?

    - by nocash
    While looking over various PHP libraries I've noticed that a lot of people choose to prefix some class methods with a single underscore, such as public function _foo() ...instead of... public function foo() I realize that ultimately this comes down to personal preference, but I was wondering if anyone had some insight into where this habit comes from. My thought is that it's probably being carried over from PHP 4, before class methods could be marked as protected or private, as a way of implying "do not call this method from outside the class". However, it also occurred to me that maybe it originates somewhere (a language) I'm not familiar with or that there may be good reasoning behind it that I would benefit from knowing. Any thoughts, insights and/or opinions would be appreciated.

    Read the article

  • WPF, PreviewKeyDown event and underscore char

    - by commanderz
    Hi, I'm catching key hits with PreviewKeyDown event in my WPF component. I need to distinguish characters being typed: letters vs. numbers vs. underscore vs. anything else. Letters and numbers work fine (just convert the Key property of the KeyEventArgs object to string and work with character 0 of that string), but this won't work for underscore. It's ToString value depends on localized keyboard settings (it shows up as "OemMinus" on EN/US keyboard and "OemQuestion" on CZ/QWERTY keyboard). So how can I RELIABLY find out, if the typed char is underscore in the PreviewKeyDown event? Thanks for any help

    Read the article

  • How to remove my backslash while input have underscore

    - by bob
    Problem when I enter any input which has underscore (_) data will store to my db looks like this image\_background.png Example $image = stripslashes($_POST['image']); // example image name image_background.png $query = 'UPDATE product SET image="' . $db->string_escape($image, true) . '" WHERE id="' . intval($id) . '"'; The problem coming when input has underscore only. If without underscore all backslashes will remove by the stripslashes Let me know.

    Read the article

  • allow only alphabets and underscore using javascript

    - by Priyanka
    Hello.I am allowing a string to contain only alphabets and underscore,but is i enter fist character as alphabet or underscore and later if i put any invalid character then this validation is being done.I have done validation as follows: function permission_validate() {var permission=document.permissionForm.permission.value;var allowedStr=/[A-Za-z_]/; if(!allowedStr.test(permission)){document.getElementById("permission_Er").innerHTML="* Required field can contain Only A-Z/az/_"; document.permissionForm.permission.focus();return false;}else{return true;}

    Read the article

  • Rsync fails for files that start with underscore when destination is zfs

    - by Eric
    everyone. I'm using rsync3.1.0pre1 on Mac OS X 10.8.5, and am trying to rsync one folder to another. The destination is a ZFS volume mounted via SMB. The problem I'm having is that files that start with underscore (e.g., '_filename.jpg') are not being successfully synced to the destination. I get the following error message: rsync: mkstemp "/path/to/destination/._filename.jpg.NUgYJw" failed: Permission denied (13) In this case, '_filename.jpg' does not make it to the destination. I understand that rsync creates hidden, temporary files at the destination which are preceded with '.' and have a random file extension appended on the end. But the original filename starts with '', not '.', and I haven't asked rsync to copy extended attributes / resource forks over (unless it always does it). The rsync command I'm using is: rsync -avE --exclude='.DS_Store' --exclude '.Trash' --exclude 'Thumbs.db' --exclude '._*' --delete /source/ /destination/ Has anyone found a way around this problem? Thank you!

    Read the article

  • replace a 'space' char in filename with an underscore

    - by user38730
    I have a bunch of files in a directory with 'spaces' in the filename. How do I perform a bulk rename of all filenames with 'spaces' and replace them with an '_' char. Looking at the other solutions, I've tried the following command w/o success: find . -name '* *' -exec rename ' ' '_' {} + find: rename: No such file or directory

    Read the article

  • Underscore characters disappears

    - by pocoa
    I'm using jEdit 4.3 pre 16. As I've mentioned on the title, when I'm typing, sometimes underscore characters disappears. I tried to change fonts, line highlighting etc. but it didn't work. Is there any solution of this problem?

    Read the article

  • Underscore characters disappears on jEdit

    - by pocoa
    I'm using jEdit 4.3 pre 16. As I've mentioned on the title, when I'm typing, sometimes underscore characters disappears. I tried to change fonts, line highlighting etc. but it didn't work. For example when you type: if __name__ == 'main': it displays: if name == 'main': When you click on name, it displays the underscores again. Is there any solution of this problem?

    Read the article

  • NoMethodError for underscore

    - by siulamvictor
    I want to convert the string "Full Time" to "full_time" When I using "Full Time".underscore in irb, it prompt a error NoMethodError: undefined method `underscore' for "Full Time":String How can I fix it? Or is there any other way for me to get the above underscored result?

    Read the article

  • Underscore before theme name

    - by Nick Lowman
    Hi There, I was browsing the template.php file for the rootcandy theme and noticed some of the function names start with an underscore i.e. function _rootcandy_admin_links() function rootcandy_body_class() Anyone know why this is? I thought the functions had to start with the name of the theme. Many thanks

    Read the article

  • Leading underscore in directory name in IIS 5.

    - by Chuck Conway
    In IIS 5 one of the directories off the root has a leading underscore. All files under the directory are unreachable (404) from the browser. I have verified that the paths are correct. Other javascript files outside the directory comedown fine. Any thoughts? Example: http://fm74g4rndmu02.corp.com/_cache/softwarecommunity/api.js

    Read the article

  • Underscore as a segment_separators in routing.yml

    - by Mickael
    In symfony project, I would like to use an underscore as a separator for the parameter in routing.yml. Url example: /article/lorem-1111_45.html In routing.yml rule_sample: url: /article/:info-:datePublished_:id.html param: { module: cms, action: test } options: segment_separators: ['-', '/', '.', '_'] requirements: info: ^([A-Za-z0-9\-]+)$ datePublished: \d+ id: \d+ This code doesnt work. I have the following error: Unable to parse "/article/:info-:datePublished_:id.html" route near ":id.html". Anybody knows how to implement this rule ?

    Read the article

  • gedit underscore as a word_character

    - by dreftymac
    Is it possible to configure gedit to treat the underscore character as a word character? Currently, it appears that the editor treats "two_words" as two separate words when selecting, instead of a single word as in many other mainstream text editors.

    Read the article

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