Search Results

Search found 15520 results on 621 pages for 'block element'.

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

  • Call a block method on an iterator: each.magic.collect { ... }

    - by blinry
    I have a class with a custom each-method: class CurseArray < Array def each_safe each.do |element| unless element =~ "fuck" yield element end end end end And want to call block methods on those "selected" elements. For example: curse_array.each_safe.magic.collect {|element| "#{element} is a nice sentence."} I know there is a way to do this, but I've forgotten. Please help! :-)

    Read the article

  • Extract single element from XMLHttpRequest

    - by m6a-uds
    Hi! I am actually making a Sidebar Gadget, (which is AJAX-based) and I am looking for a way to extract a single element from an AJAX Request. The only way I found yet was to do something like that: var temp = document.createElement("div"); temp.innerHTML = HttpRequest.innerText; document.body.appendChild(temp); temp.innerHTML = document.getElementByID("WantedElement").innerText; But it is pretty ugly, I would like to extract WantedElement directly from the request without adding it to the actual document... Thank you!

    Read the article

  • WPF How to bind to a specific element in the Collection

    - by PaN1C_Showt1Me
    Hi, I want to make a binding to a specific element in the Collection. But I cannot figure out how to write the Binding. This is the code: public class MySource { .. public string SomeProp; public ICollection<T> MyCollection; .. } this.DataContext = new MySource(); <TextBox Text={Binding SomeProp} /> <TextBox Text={Binding FIRST_ELEMENT_OF_THE_MyCollection} /> <TextBox Text={Binding SECOND_ELEMENT_OF_THE_MyCollection} /> <!--Ignore other elements--> Try to replace those binding strings, please Thank you

    Read the article

  • Finding whether a value is equal to the value of any array element in MATLAB

    - by James
    Hi, Can anyone tell me if there is a way (in MATLAB) to check whether a certain value is equal to any of the values stored within another array? The way I intend to use it is to check whether an element index in one matrix is equal to the values stored in another array (where the stored values are the indexes of the elements which meet a certain criteria). So, if the indices of the elements which meet the criteria are stored in the matrix below: criteriacheck = [3 5 6 8 20]; Going through the main array (called array) & checking if the index matches: for i = 1:numel(array) if i == 'Any value stored in criteriacheck' ... "Do this" end Does anyone have an idea of how I might go about this? Thanks in advance

    Read the article

  • required element content

    - by Guarava Makanili
    I'm trying to create xsd for an element like this: <ElementType attr1="a" attr2 ="b">mandatory_string</ElementType> and I want to make the mandatory_string required. What should I add to this xsd: <xs:complexType name="ElementType"> <xs:simpleContent> <xs:extension base="xs:string"> <xs:attribute name="attr1" type="StringLength1to2" use="required"/> <xs:attribute name="attr2" type="StringLength1to2" use="required"/> </xs:extension> </xs:simpleContent> </xs:complexType> Currently is optional. What's missing?

    Read the article

  • Running in to some issues with Tumblr's Theme Parser

    - by Kylee
    Below part of a tumblr theme I'm working on and you will notice that I use the {block:PostType} syntax to declare the opening tag of each post, which is a <li> element in an Ordered List. This allows me to not only dynamicly set the li's class based on the type of post but cuts down on the number of times I'm calling the ShareThis JS which was really bogging down the page. This creates a new issue though which I believe is a flaw in Tumblr's parser. Each post is an ordered list with one <li> element in it. I know I could solve this by having each post as a <div> but I really like the control and semantics of using a list. Tumblr gurus? Suggestions? Sample of code: {block:Posts} <ol class="posts"> {block:Text} <li class="post type_text" id="{PostID}"> {block:Title} <h2><a href="{Permalink}" title="Go to post '{Title}'.">{Title}</a></h2> {/block:Title} {Body} {/block:Text} {block:Photo} <li class="post type_photo" id="{PostID}"> <div class="image"> <a href="{LinkURL}"><img src="{PhotoURL-500}" alt="{PhotoAlt}"></a> </div> {block:Caption} {Caption} {/block:Caption} {/block:Photo} {block:Photoset} <li class="post type_photoset" id="{PostID}"> {Photoset-500} {block:Caption} {Caption} {/block:Caption} {/block:Photoset} {block:Quote} <li class="post type_quote" id="{PostID}"> <blockquote> <div class="quote_symbol">&ldquo;</div> {Quote} </blockquote> {block:Source} <div class="quote_source">{Source}</div> {/block:Source} {/block:Quote} {block:Link} <li class="post type_link" id="{PostID}"> <h2><a href="{URL}" {Target} title="Go to {Name}.">{Name}</a></h2> {block:Description} {Description} {/block:Description} {/block:Link} {block:Chat} <li class="post type_chat" id="{PostID}"> {block:Title} <h2><a href="{Permalink}" title="Go to post {PostID} '{Title}'.">{Title}</a></h2> {/block:Title} <table class="chat_log"> {block:Lines} <tr class="{Alt} user_{UserNumber}"> <td class="person">{block:Label}{Label}{/block:Label}</td> <td class="message">{Line}</td> </tr> {/block:Lines} </table> {/block:Chat} {block:Video} <li class="post type_video" id="{PostID}"> {Video-500} {block:Caption} {Caption} {/block:Caption} {/block:Video} {block:Audio} <li class="post type_audio" id="{PostID}"> {AudioPlayerWhite} {block:Caption} {Caption} {/block:Caption} {block:ExternalAudio} <p><a href="{ExternalAudioURL}" title="Download '{ExternalAudioURL}'">Download</a></p> {/block:ExternalAudio} {/block:Audio} <div class="post_footer"> <p class="post_date">Posted on {ShortMonth} {DayOfMonth}, {Year} at {12hour}:{Minutes} {AmPm}</p> <ul> <li><a class="comment_link" href="{Permalink}#disqus_thread">Comments</a></li> <li><script type="text/javascript" src="http://w.sharethis.com/button/sharethis.js#publisher=722e181d-1d8a-4363-9ebe-82d5263aea94&amp;type=website"></script></li> </ul> {block:PermalinkPage} <div id="disqus_thread"></div> <script type="text/javascript" src="http://disqus.com/forums/kyleetilley/embed.js"></script> <noscript><a href="http://disqus.com/forums/kyleetilley/?url=ref">View the discussion thread.</a></noscript> {/block:PermalinkPage} </div> </li> </ol> {/block:Posts}

    Read the article

  • 'Element is already the child of another element' error in Silverlight App.xaml

    - by rwwilden
    Hi, I keep getting a strange error inside my App.xaml file: Element is already the child of another element. My App.xaml file looks like this: <Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Class="Celerior.Annapurna.SL.App"> <Application.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="ProvisiorResourceDictionary.xaml"/> </ResourceDictionary.MergedDictionaries> </ResourceDictionary> </Application.Resources> </Application> The error is reported for the entire ResourceDictionary element (from lines 5 to 9). ProvisiorResourceDictionary.xaml contains a number of styles and templates. Nothing exciting in my opinion. Does anyone know what is wrong? Kind regards, Ronald Wildenberg

    Read the article

  • the element 'transport' cannot contain child element 'extendedProtectionPolicy' because the parent e

    - by neildeadman
    I inherited a web application that makes calls to a web service. It is being developed in VS2008 SP1 and deployed to IIS6 (2k3 Server R2). Since I upgraded to Windows 7 Enterprise RTM, the following line gets added to my Web.config: <extendedProtectionPolicy policyEnforcement="Never" /> The problem is that when I deploy this application to my web server I get the following error: The element 'transport' cannot contain child element 'extendedProtectionPolicy' because the parent element's content model is empty I can remove the line and it will work, but its a pain and I forget sometimes to remove it again (VS2008 adds seems to add it back whenever I load the solution!!). Is there anything that can be done? Here is my 'transport' section: <transport clientCredentialType="None" proxyCredentialType="None" realm=""> <extendedProtectionPolicy policyEnforcement="Never" /> </transport> Thanks Neil

    Read the article

  • jquery ui get id of child element of dragged element, when dropped

    - by Catfish
    I've read through many of the drag and drop threads on SO and i haven't found one that tells me how to get the child element id of the dragged element, when the dragged element is dropped. For example if you have <div id='drag'> <img id="something"/>//how do i get this id when #drag is dropped? </div> <div id='drop'> </div> and the js $('#drag').draggable({ containment: '#content', scrollSensitivity: 60, revert: 'invalid', cursor: 'move' }); $('#drop').droppable({ accept: '#albumImgs li', activeClass: 'dropContainerOpen', drop: function(event, ui) { var fileName = $(ui.draggable.attr('alt')); console.log(fileName); } });

    Read the article

  • Nginx Browser Caching using HTTP Headers outside server/location block

    - by Danny O'Sullivan
    I am having difficulty setting the HTTP expires headers for Nginx outside of specific server (and then location) blocks. What I want is to something like the following: location ~* \.(png|jpg|jpeg|gif|ico)$ { expires 1y; } But not have to repeat it in every single server block, because I am hosting a large number of sites. I can put it in every server block, but it's not very DRY. If I try to put that into an HTTP block or outside of all other blocks, I get "location directive is not allowed here." It seems I have to put it into a server block, and I have a different server block for every virtual host. Any help/clarification would be appreciated.

    Read the article

  • jquery remove selected element and append to another

    - by KnockKnockWhosThere
    I'm trying to re-append a "removed option" to the appropriate select option menu. I have three select boxes: "Categories", "Variables", and "Target". "Categories" is a chained select, so when the user selects an option from it, the "Variables" select box is populated with options specific to the selected categories option. When the user chooses an option from the "Variables" select box, it's appended to the "Target" select box. I have a "remove selected" feature so that if a user "removes" a selected element from the "Target" select box, it's removed from "Target" and put back into the pool of "Variables" options. The problem I'm having is that it appends the option to the "Variables" items indiscriminately. That is, if the selected category is "Age" the "Variables" options all have a class of "age". But, if the removed option is an "income" item, it will display in the "Age Variables" option list. Here's the HTML markup: <select multiple="" id="categories" name="categories[]"> <option class="category" value="income">income</option> <option class="category" value="gender">gender</option> <option class="category" value="age">age</option> </select> <select multiple="multiple" id="variables" name="variables[]"> <option class="income" value="10">$90,000 - $99,999</option> <option class="income" value="11">$100,000 - $124,999</option> <option class="income" value="12">$125,000 - $149,999</option> <option class="income" value="13">Greater than $149,999</option> <option class="gender" value="14">Male</option> <option class="gender" value="15">Female</option> <option class="gender" value="16">Ungendered</option> <option class="age" value="17">Ages 18-24</option> <option class="age" value="18">Ages 25-34</option> <option class="age" value="19">Ages 35-44</option> </select> <select height="60" multiple="multiple" id="target" name="target[]"> </select> And, here's the js: /* This determines what options are display in the "Variables" select box */ var cat = $('#categories'); var el = $('#variables'); $('#categories option').click(function() { var class = $(this).val(); $('#variables option').each(function() { if($(this).hasClass(class)) { $(this).show(); } else { $(this).hide(); } }); }); /* This adds the option to the target select box if the user clicks "add" */ $('#add').click(function() { return !$('#variables option:selected').appendTo('#target'); }); /* This is the remove function in its current form, but doesn't append correctly */ $('#remove').click(function() { $('#target option:selected').each(function() { var class = $(this).attr('class'); if($('#variables option').hasClass(class)) { $(this).appendTo('#variables'); sortList('variables'); } }); });

    Read the article

  • python subprocess block

    - by MW
    Hello. I'm having a problem with the module subprocess. I'm running a script from python through: subprocess.Popen('./run_pythia.sh',shell=True).communicate() and sometimes it just blocks and it doesn't finish to execute the script. Before I was using .wait() instead of .communicate() but then because of this: http://dcreager.net/2009/08/06/subprocess-communicate-drawbacks/ I changed to .communicate(). Nevertheless the problem continues. Can anyone help me?

    Read the article

  • Twig templates, inheritances and block usage

    - by user846226
    I've created three templates using Twig. The first one has block A defined in it, the second one extends from the first one, but includes a third template which sets the content of block A. When loading, through the browser, the url which renders b.html.twig, the content in block A (defined by the 3th template) is not positioned block _A is defined. Example: <!-- base.html.twig --> {% block _css '' %} {% block _header '' %} {% block _content '' %} {% block _footer '' %} {% block _js '' %} <!-- layout.html.twig --> <!-- header and footer are placed in the raight zone --> {% extends ::base.html.twig %} {% block _header %} {% render "MyBundleBundle:Header:header" %} {% endblock %} {% block _footer %} {% render "MyBundleBundle:Footer:footer" %} {% endblock %} <!-- my_template.html.twig --> <!-- content is also placed in the right zone but css and js blocks in the included template are not placed where declared in base.html.twig --> {% extends MyBundleBundle::layout.html.twig %} {% block _content %} SOME_CONTENT {% include MyBundleBundle::my_included_template.html.twig %} {% endblock %} <!-- my_included_template.html.twig --> {% block _css %} <link.......................> {% endblock %} {% block _js %} <script..................> {% endblock %} MORE CONTENT BELONGING TO THE INCLUDED TEMPLATE What i expect here is, _css blocks content to appear on top of the page and _js block content at the bottom, but that's not happening. I hope you can see where i'm going wrong, thanks!

    Read the article

  • Block All Keyboard Input in a Linux Application (Using Qt or Mono)

    - by Evans
    Hi, I'm working on a online quiz client where we use a dedicated custom-made linux distro which contains only the quiz client software along with text editors and other utility software. When the user has started the quiz, I want to prevent him/her from minimizing the window/closing it/switching to the desktop or other windows. The quizzes can be attempted using only the mouse, so I need the keyboard to be completed disabled for the period of the quiz. How could I do this, using Qt or Mono? I'm ready to use any low-level libraries/drivers, if required. Thanks Evans

    Read the article

  • I'm confused with block in ruby, compared to smalltalk.

    - by weakish
    What does block in ruby mean? It looks similar with smalltalk, but you can't send messages to it. For example, in smalltalk: [:x | x + 3] value: 3 returns 6. But in ruby: {|x| x + 3}.call 3 will cause SyntaxError. Well, you can pass messages to lambda in ruby, though: irb(main):025:0> ->(x){x+3}.call 3 => 6 So in ruby, block is not a block, but lambda is a block? Is this true? I mean, are there any differences between ruby lambda and smalltalk block? If this is true, then what is ruby block?

    Read the article

  • Find an element by class name, from a known parent element

    - by user246114
    Hi, I want to find an element by class name. I know it will appear in a particular parent div, so rather than search the entire dom, I'd like to search only the particular div. I am trying this, but does not seem to be the correct syntax: var element = $("#parentDiv").(".myClassNameOfInterest"); what's the right way to do that? Thanks

    Read the article

  • How do you find out what element type the root element is with jquery

    - by user363873
    I'm sending an ajax request that will either give me an error or a userID <?xml version="1.0" encoding="UTF-8"?> <error>1000</error> <?xml version="1.0" encoding="UTF-8"?> <userID>8</userID> how can I find out if the root element is error or userID using jquery or just javascript in general. Using the find method doesn't appear to work if what you're trying to access is the root element

    Read the article

  • Block Fortress is an Awesome Tower Defense Game

    - by Akemi Iwaya
    What do you get when you mix Minecraft, tower defense, and a first-person shooter together? Block Fortress! This awesome game combines the best aspects of three game types into one unique, action-packed romp for survival and victory. Keep in mind that the game has quite a bit going on, so we will only be able to offer a quick glimpse with our post. Also, it may take a few minutes to become familiar with how to maneuver around in the game area using various gestures on your device’s screen. From the Block Fortress homepage: It offers more than 30 different building blocks, 16 different turret blocks, and tons of additional items to build (including mining blocks, lumber blocks, storage crates, power generators, and much more). It also includes many different weapon and item upgrades for your character – all brought to bear against the relentless attacks of the Goblocks! Block Fortress currently comes with three modes of game play: Survival, Quickstart, and Sandbox. As you can see, there should be more modes available at a later date. There are many types of terrain to choose from, or if you wish you can select Random for a nice surprise. For our example we chose Snowy Hills. Time to have a look around and find a nice spot to set up our barracks… This spot looks like it will do rather nicely… Just for fun we set up a castle-style set of walls and entry point for our barracks. Now on to fun and adventure! You can see what the game looks like in action with the official launch trailer… Price: 0.99 (U.S.) Block Fortress [iTunes App Store] Block Fortress Homepage Official Block Fortress Launch Trailer [YouTube]    

    Read the article

  • js - using replace method to replace html element

    - by Rueta
    hi everyone! i have a question. I have a work this morning but i don't know how to do it. My work here (html): <div class="demo"> <p>this is demo text</p> </div> here is my JS : var tempdata = $(".demo").text(); var replacedata = tempdata.replace("text","<span>1234</span>"); Look everything ok. but result is : this is demo <span>1234</span>. this isn't my result i want. How to make in this string become a HTMLelement by using replace method?

    Read the article

  • How do I use ViewScripts on Zend_Form File Elements?

    - by Sonny
    I am using this ViewScript for my standard form elements: <div class="field" id="field_<?php echo $this->element->getId(); ?>"> <?php if (0 < strlen($this->element->getLabel())) : ?> <?php echo $this->formLabel($this->element->getName(), $this->element->getLabel());?> <?php endif; ?> <span class="value"><?php echo $this->{$this->element->helper}( $this->element->getName(), $this->element->getValue(), $this->element->getAttribs() ) ?></span> <?php if (0 < $this->element->getMessages()->length) : ?> <?php echo $this->formErrors($this->element->getMessages()); ?> <?php endif; ?> <?php if (0 < strlen($this->element->getDescription())) : ?> <span class="hint"><?php echo $this->element->getDescription(); ?></span> <?php endif; ?> </div> Trying to use that ViewScript alone results in an error: Exception caught by form: No file decorator found... unable to render file element Looking at this FAQ revealed part of my problem, and I updated my form element decorators like this: 'decorators' => array( array('File'), array('ViewScript', array('viewScript' => 'form/field.phtml')) ) Now it's rendering the file element twice, once within my view script, and extra elements with the file element outside my view script: <input type="hidden" name="MAX_FILE_SIZE" value="8388608" id="MAX_FILE_SIZE" /> <input type="hidden" name="UPLOAD_IDENTIFIER" value="4b5f7335a55ee" id="progress_key" /> <input type="file" name="upload_file" id="upload_file" /> <div class="field" id="field_upload_file"> <label for="upload_file">Upload File</label> <span class="value"><input type="file" name="upload_file" id="upload_file" /></span> </div> Any ideas on how to handle this properly with a ViewScript?

    Read the article

  • Bind to a property of a parent element in wpf

    - by msfanboy
    Hello all, I want to bind the Height property of the RichTextBox to the Height Property of the GridViews Row. How can I do that? I do not know how to get the Rows Height as I can not access the Row in xaml what I would like to do. <my:RadGridView Height="524" ItemsSource="{Binding Lessons}" AutoGenerateColumns="False" Name="dataGrid1" VerticalAlignment="Top" SelectionMode="Single" CanUserSortColumns="False" IsFilteringAllowed="False"> <my:RadGridView.Columns> <my:GridViewDataColumn Name="ContentColumn" Width="0.3*" Header="Content"> <my:GridViewDataColumn.CellTemplate> <DataTemplate> <RichTextBox Height="{Binding ElementName=MyRowNameToBindTo,Path=Height}"> <FlowDocument> <Paragraph> <Run Text="{Binding Content}"/> </Paragraph> </FlowDocument> </RichTextBox> </DataTemplate> </my:GridViewDataColumn.CellTemplate> ...

    Read the article

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