Search Results

Search found 834 results on 34 pages for 'fragment'.

Page 26/34 | < Previous Page | 22 23 24 25 26 27 28 29 30 31 32 33  | Next Page >

  • Qt 5.3 OpenGL - vertex buffer object drawing using the core profile

    - by user3700881
    Im using Qt 5.3 to create a QWindow to do some basic rendering stuff. The QWindow is declared like this: class OpenGLWindow : public QWindow, protected QOpenGLFunctions_3_3_Core { Q_OBJECT ... } It is initialized in the constructor: OpenGLWindow::OpenGLWindow(QWindow *parent) : QWindow(parent) { QSurfaceFormat format; format.setVersion(3,3); format.setProfile(QSurfaceFormat::CoreProfile); this->setSurfaceType(OpenGLSurface); this->setFormat(format); this->create(); _context = new QOpenGLContext; _context->setFormat(format); _context->create(); _context->makeCurrent(this); this->initializeOpenGLFunctions(); ... } And that's the rendering code: void OpenGLWindow::render() { if(!isExposed()) return; _context->makeCurrent(this); glClear(GL_COLOR_BUFFER_BIT); glUseProgram(_shaderProgram); glBindBuffer(GL_ARRAY_BUFFER, _positionBufferObject); glEnableVertexAttribArray(0); glVertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, 0, 0); glDrawArrays(GL_TRIANGLES, 0, 3); glDisableVertexAttribArray(0); glUseProgram(0); _context->swapBuffers(this); } I am trying to draw a simple triangle using a vertex and fragment shader. The problem is that the triangle is not showing up when the core profile is set. Only when I set the OpenGL version to 2.0 or when I use the compatibility profile, it shows up. From my point of view that doesn't make any sense because I am not using fixed functionality at all. What am I missing?

    Read the article

  • remove text in parentheses and the parentheses using .filter() or .slice()

    - by liz
    i have a table with code like this: <tr> <th scope="row">5-17</th> <td>23.6 (22.0-24.0)</td> <td>18.0 (17-20.0)</td> </tr> <tr> <th scope="row">Total 0-17</th> <td>20.6 (8-15.6)</td> <td>16.1 (22.2-24.0)</td> </tr> i am using the following function to find the contents of the table cells and bring it into an array: var l1 = $('#datatable td:nth-child(2)').map(function() { return $(this).text(); }).get(); the table fragment's id is "datatable". this returns properly, however i am putting this array into jqPlot and it cant read the stuff between the parentheses or the parentheses themselves. i need the data to remain in the table however because we are displaying both the table and the chart. i cant reformat (add spans around the content i want to remove etc) because these tables are being generated by another piece of software. i think what i need to do is either slice off after the space or use a regex to find and remove. not sure how to proceed with either of these. thanks!

    Read the article

  • Javascript: prototypeal inheritance and the prototype proprity

    - by JanD
    Hi, I have a simple code fragment in JS working with prototype inheritance. function object(o) { function F() {} F.prototype = o; return new F(); } //the following code block has a alternate version var mammal={ color: "brown", getColor: function(){ return this.color; } } var myCat = object(mammal); myCat.meow = function(){return "meow";} that worked fine but adding this: mammal.prototype.kindOf = "predator"; does not. ("mammal.prototype is undefined") Since I guessed that object maybe have no prototype I rewrote it, replacing the var mammal={... block with: function mammal(){ this.color="brown"; this.getColor = function(){return this.color;} } which gave me a bunch of other errors: "Function.prototype.toString called on incompatible object" and if I try to call _myCat.getColor() "myCat.getColor is not a function" Now I am totally confused. After reading Crockford, and Flanagan I did not get the solution for the errors. So it would be great if somebody knows... - why is the prototype undefined in the first example (which is foremost concern; I thought the prototype of explicitly set in the object() function) - why get I these strange errors trying to use the mammal function as prototype object in the object() function?

    Read the article

  • Javascript: prototypal inheritance and the prototype property

    - by JanD
    Hi, I have a simple code fragment in JS working with prototype inheritance. function object(o) { function F() {} F.prototype = o; return new F(); } //the following code block has a alternate version var mammal = { color: "brown", getColor: function() { return this.color; } } var myCat = object(mammal); myCat.meow = function(){return "meow";} that worked fine but adding this: mammal.prototype.kindOf = "predator"; does not. ("mammal.prototype is undefined") Since I guessed that object maybe have no prototype I rewrote it, replacing the var mammal={... block with: function mammal() { this.color = "brown"; this.getColor = function() { return this.color; } } which gave me a bunch of other errors: "Function.prototype.toString called on incompatible object" and if I try to call _myCat.getColor() "myCat.getColor is not a function" Now I am totally confused. After reading Crockford, and Flanagan I did not get the solution for the errors. So it would be great if somebody knows... - why is the prototype undefined in the first example (which is foremost concern; I thought the prototype of explicitly set in the object() function) - why get I these strange errors trying to use the mammal function as prototype object in the object() function? Edit by the Creator of the Question: These two links helped a lot too: Prototypes_in_JavaScript on the spheredev wiki explains the way the prototype property works relativily simple. What it lacks is some try-out code examples. Some good examples are provided by Morris John's Article. I personally find the explanations are not that easy as in the first link, but still very good. The most difficult part even after I actually got it is really not to confuse the .prototype propery with the internal [[Prototype]] of an object.

    Read the article

  • Suppress indentation after environment in LaTeX

    - by David
    I'm trying to create a new environment in my LaTeX document where indentation in the next paragraph following the environment is suppressed. I have been told (TeXbook and LaTeX source) that by setting \everypar to {\setbox0\lastbox}, the TeX typesetter will execute this at the beginning of the next paragraph and thus remove the indentation: \everypar{\setbox0\lastbox} So this is what I do, but to no effect (following paragraph is still indented): \newenvironment{example} {\begin{list} {} {\setlength\leftmargin{2em}}} {\end{list}\everypar{\setbox0\lastbox}} I have studied LaTeX's internals as well as I could manage. It seems that the \end routine says \endgroup and \par at some point, which may be the reason LaTeX ignores my \everypar setting. \global doesn't help either. I know about \noindent but want to do this automatically. Example document fragment: This is paragraph text. This is paragraph text, too. \begin{example} \item This is the first item in the list. \item This is the second item in the list. \end{example} This is more paragraph text. I don't want this indented, please. Internal routines and switches of interest seem to be \@endpetrue, \@endparenv and others. Thanks for your help.

    Read the article

  • How to detect back button or forward button navigation in a silverlight navigation application

    - by parapura rajkumar
    When a Page is navigated to in silverlight you can override this method. protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); } The NavigationEventArgs has a NavigationMode enumeration which is defined as public enum NavigationMode { New = 0, Back = 1, Forward = 2, Refresh = 3, } But calling e.NavigationMode always throws a NotImplementedException Is there a way in silverlight to detect a page is being navigated to because the user hit the forward/back browser button. What I am trying to achieve is some kind of state that can be preserved when the user hits the back button. For example assume you have a customer page which is showing a list of customers in a datagrid. The user can select a customer and there is a detail view which shows all the orders for that customer. Now within an order item you can click a hyperlink link that takes you to the shipping history of the order which is a separate page. When the user hits the back button I want to go back to the customers page and automatically select the customer he was viewing. Is this possible at all ? I also tried out the fragment navigation feature NavigationService.Navigate(new Uri("#currentcustomerid=" + customer.Id.ToString(), UriKind.Relative)); when the customer selection changes but this adds too many items to the history when the user clicks various customers on the customer page. EDIT There is also an method you can override protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) { } which is the same as handling the NavigationService.Navigating event as indicated by BugFinder's answer. In this method e.NavigationMode always returns New when when you hit the Back or Forward Button. The only time this method returns Back is when you explicitly call NavigationService.GoBack()

    Read the article

  • Python pixel manipulation library

    - by silinter
    So I'm going through the beginning stages of producing a game in Python, and I'm looking for a library that is able to manipulate pixels and blit them relatively fast. My first thought was pygame, as it deals in pure 2D surfaces, but it only allows pixel access through pygame.get_at(), pygame.set_at() and pygame.get_buffer(), all of which lock the surface each time they're called, making them slow to use. I can also use the PixelArray and surfarray classes, but they are locked for the duration of their lifetimes, and the only way to blit them to a surface is to either copy the pixels to a new surface, or use surfarray.blit_array, which requires creating a subsurface of the screen and blitting it to that, if the array is smaller than the screen (if it's bigger I can just use a slice of the array, which is no problem). I don't have much experience with PyOpenGL or Pyglet, but I'm wondering if there is a faster library for doing pixel manipulation in, or if there is a faster method, in Pygame, for doing pixel manupilation. I did some work with SDL and OpenGL in C, and I do like the idea of adding vertex/fragment shaders to my program. My program will chiefly be dealing in loading images and writing/reading to/from surfaces.

    Read the article

  • take values from table cells and turn into array

    - by liz
    using jquery I need to retrieve an array from table cells, format the data and pass it into a js function. the code i am using is this: var l1 = new Array(); $('table#datatable tbody td:first-child').each(function() { l1.push($(this).text()); }); this is the table fragment <tr> <th scope="row">Age: 0-4</th> <td>0</td> <td>9.7</td> </tr> <tr> <th scope="row">5-17</th> <td>23.6</td> <td>18.0</td> </tr> <tr> <th scope="row">Total 0-17</th> <td>20.6</td> <td>16.1</td> </tr> the table's id is "datatable". i want to return an array of the contents of each first td and then format it like this: 0,23.6,20.6 i am very new to using arrays...

    Read the article

  • Updated - Having trouble making a circled button in android

    - by user3641545
    I'm trying to use an image as a button. The image is an oval/circle, so when I set it as the background there's basically a black box with the image on top of it. How can I fix this? This is the fragment main xml: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" tools:context="com.example.example1.MainActivity$PlaceholderFragment" > <ImageButton android:id="@+id/hardButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerHorizontal="true" android:layout_centerVertical="true" android:background="@drawable/hard_button_clickable" android:onClick="hardButton" android:text="@string/button_hard" android:textColor="#ffff00" android:textSize="50sp" /> </RelativeLayout> This is the hard button xml: <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@drawable/hard_button_img" android:state_focused="true" android:state_pressed="false"/> <item android:drawable="@drawable/hard_button_img" android:state_focused="true" android:state_pressed="true"/> <item android:drawable="@drawable/hard_button_img"/> </selector> Here's the problem in the app: http://i.gyazo.com/a7f3b25341ebf4146d294df1f5660e99.png I've tried setting background to null and setting src to my image file. Nothing changed. Thanks. e; Here's the actual PNG: http://tinypic.com/r/av3cli/8 e; Still looking for help with this!

    Read the article

  • Webpage data scraping using Java

    - by Gemma
    I am now trying to implement a simple HTML webpage scraper using Java.Now I have a small problem. Suppose I have the following HTML fragment. <div id="sr-h-left" class="sr-comp"> <a class="link-gray-underline" id="compare_header" rel="nofollow" href="javascript:i18nCompareProd('/serv/main/buyer/ProductCompare.jsp?nxtg=41980a1c051f-0942A6ADCF43B802');"> <span style="cursor: pointer;" class="sr-h-o">Compare</span> </a> </div> <div id="sr-h-right" class="sr-summary"> <div id="sr-num-results"> <div class="sr-h-o-r">Showing 1 - 30 of 1,439 matches, The data I am interested is the integer 1.439 shown at the bottom.I am just wondering how can I get that integer out of the HTML. I am now considering using a regular expression,and then use the java.util.Pattern to help get the data out,but still not very clear about the process. I would be grateful if you guys could give me some hint or idea on this data scraping. Thanks a lot.

    Read the article

  • webkit - css transition effect on a div

    - by Mak Killbers
    I am trying to do fadein/out effect when I change innerHTML of a div. Even tried example given at safari doc I want the div to fade-out, change the contents and then fade-in again with new content. <style> .cv { background-color: #eee; -webkit-transition: all 1s ease-in-out;} .cf {opacity: 0;} </style> <body> <div id="main"> <div id="c"> OLD </div> </div> </body> <script> var c = document.getElementById("c"); c.setAttribute("class", "cf"); c.innerHTML = ''; c.appendChild(fragment); c.setAttribute("class", "cv"); </script> Please help me here

    Read the article

  • How can I validate/secure/authenticate a JavaScript-based POST request?

    - by Bungle
    A product I'm helping to develop will basically work like this: A Web publisher creates a new page on their site that includes a <script> from our server. When a visitor reaches that new page, that <script> gathers the text content of the page and sends it to our server via a POST request (cross-domain, using a <form> inside of an <iframe>). Our server processes the text content and returns a response (via JSONP) that includes an HTML fragment listing links to related content around the Web. This response is cached and served to subsequent visitors until we receive another POST request with text content from the same URL, at which point we regenerate a "fresh" response. These POSTs only happen when our cached TTL expires, at which point the server signifies that and prompts the <script> on the page to gather and POST the text content again. The problem is that this system seems inherently insecure. In theory, anyone could spoof the HTTP POST request (including the referer header, so we couldn't just check for that) that sends a page's content to our server. This could include any text content, which we would then use to generate the related content links for that page. The primary difficulty in making this secure is that our JavaScript is publicly visible. We can't use any kind of private key or other cryptic identifier or pattern because that won't be secret. Ideally, we need a method that somehow verifies that a POST request corresponding to a particular Web page is authentic. We can't just scrape the Web page and compare the content with what's been POSTed, since the purpose of having JavaScript submit the content is that it may be behind a login system. Any ideas? I hope I've explained the problem well enough. Thanks in advance for any suggestions.

    Read the article

  • Visual Studio 2010 Professional - Problem Unit-Testing Web Services

    - by Ben
    Have created a very simple Web Service (asmx) in Visual Studio 2010 Professional, and am trying to use the auto-generated unit test cases. I get something that seems quite familiar on this site: The web site could not be configured correctly; getting ASP.NET process information failed. Requesting http://localhost:81/zfp/VSEnterpriseHelper.axd return an error: The remote server returned an error: (500) Internal Server Error. http://stackoverflow.com/questions/260432/500-error-running-visual-studio-asp-net-unit-test I have tried: 1. Running the tests on IIS rather than ASP.NET Development Server 2. Adding and then removing the XML fragment to my Web Service's .config file 3. Giving the MACHINE\ASPNET account Full control to the local folder My current questions: 1. Why am I being bothered with this instrumentation / code coverage DLL, when this doesn't seem to be something that ships with Visual Studio 2010 Professional? Is there any way I can turn it off? 2. I'm placing the node under in Web.config - is that the correct node? 3. Is it possible to bind to a web service without using the webby test attributes? I've seen other people advising making the Web Service as light-weight as possible. I'm trying to call it with jQuery / AJAX / JSON, so being able to debug the actual web service would be really helpful. Best wishes, Ben

    Read the article

  • Dynamically change ViewPagerIndicator titles

    - by msal
    My current project uses some ListFragments to show rows of data. The rows get updated dynamically every some seconds. The amount of rows varies with every update and in every ListFragment. I would like to show the amount of rows to the user, and think that the perfect place for that would be next to the Fragment's title in the ViewPagerIndicator. I provided a sample image for better comprehension: Sadly I am pretty clueless how to achieve this. I tried the following: public class PagerAdapter extends FragmentPagerAdapter { private int numOne = 0; private int numTwo = 0; // ... @Override public CharSequence getPageTitle(int position) { switch (position) { case 0: return "List 1 (" + numOne + ")"; case 1: return "List 2 (" + numTwo + ")"; default: return ""; } public void setNumOne(int num) { this.numOne = num; } public void setNumTwo(int num) { this.numTwo = num; } } When I now call the setNumXXX() method, nothing happens, until I move between fragments, what seems to trigger the getPageTitle() to fire. My question is: How can I force an update of the title(s), everytime when the num value changes?

    Read the article

  • Rails' page caching vs. HTTP reverse proxy caches

    - by John Topley
    I've been catching up with the Scaling Rails screencasts. In episode 11 which covers advanced HTTP caching (using reverse proxy caches such as Varnish and Squid etc.), they recommend only considering using a reverse proxy cache once you've already exhausted the possibilities of page, action and fragment caching within your Rails application (as well as memcached etc. but that's not relevant to this question). What I can't quite understand is how using an HTTP reverse proxy cache can provide a performance boost for an application that already uses page caching. To simplify matters, let's assume that I'm talking about a single host here. This is my understanding of how both techniques work (maybe I'm wrong): With page caching the Rails process is hit initially and then generates a static HTML file that is served directly by the Web server for subsequent requests, for as long as the cache for that request is valid. If the cache has expired then Rails is hit again and the static file is regenerated with the updated content ready for the next request With an HTTP reverse proxy cache the Rails process is hit when the proxy needs to determine whether the content is stale or not. This is done using various HTTP headers such as ETag, Last-Modified etc. If the content is fresh then Rails responds to the proxy with an HTTP 304 Not Modified and the proxy serves its cached content to the browser, or even better, responds with its own HTTP 304. If the content is stale then Rails serves the updated content to the proxy which caches it and then serves it to the browser If my understanding is correct, then doesn't page caching result in less hits to the Rails process? There isn't all that back and forth to determine if the content is stale, meaning better performance than reverse proxy caching. Why might you use both techniques in conjunction?

    Read the article

  • Javascript: prototypeal inheritance and the prototype property

    - by JanD
    Hi, I have a simple code fragment in JS working with prototype inheritance. function object(o) { function F() {} F.prototype = o; return new F(); } //the following code block has a alternate version var mammal = { color: "brown", getColor: function() { return this.color; } } var myCat = object(mammal); myCat.meow = function(){return "meow";} that worked fine but adding this: mammal.prototype.kindOf = "predator"; does not. ("mammal.prototype is undefined") Since I guessed that object maybe have no prototype I rewrote it, replacing the var mammal={... block with: function mammal() { this.color = "brown"; this.getColor = function() { return this.color; } } which gave me a bunch of other errors: "Function.prototype.toString called on incompatible object" and if I try to call _myCat.getColor() "myCat.getColor is not a function" Now I am totally confused. After reading Crockford, and Flanagan I did not get the solution for the errors. So it would be great if somebody knows... - why is the prototype undefined in the first example (which is foremost concern; I thought the prototype of explicitly set in the object() function) - why get I these strange errors trying to use the mammal function as prototype object in the object() function?

    Read the article

  • XSL transformation generating output from other nodes

    - by Abel Morelos
    I have the following XSL template: <xsl:template match="SOAP-ENV:Body/*[local-name()='Publisher']"> <html> <xsl:call-template name="body" /> </html> </xsl:template> The previous template generates the output I want, it's generating the tags containing the output generated by the "body" template. The issue I'm having is that before the opening tag I'm getting text output from a previous node. Not sure why this is happening since I'm not selecting these other nodes. For example: <SOAP-ENV:Header> <!-- Many child nodes here--> </SOAP-ENV:Header> <SOAP-ENV:Body> <publishParty:Publisher> <!-- Many child nodes here--> </publishParty:Publisher> </SOAP-ENV:Body> Given the previous sample XML fragment, my output would contain what I would expect of formatting the Publisher element, but I'm also getting the text nodes of the children of the SOAP-ENV:Header node. Any ideas? Thanks!

    Read the article

  • Create bookmark into 1st column of MSWord table

    - by MikeD
    Hello All, does anyone have a VBA code to create a bookmark into the first column of an MSWord table? Let's say I have a table looking like this .-----.----------------. . ref . Title . .-----.----------------. . 1 . Title 1 . .-----.----------------. . 2 . Title 2 . .-----.----------------. . foo . Title 3 . .-----.----------------. . bar . Title 4 . .-----.----------------. and I want a VBA code fragment that creates a bookmark named "T1_1" on the string "1" in row 2 / column 1, and bookmarks named "T1_2", "T1_foo" and "T1_bar" on the strings in the other cells of column 1. I don't mind to hardcode the prefix "T1" (and substitute for other tables each time). I don't mind to select tables before running the macro, I don't mind giving those cells a special format, and I don't mind to get a superfluous bookmark "T1_ref" from the first row - so the code doesn't need to distinguish between table title and table row. Thanks a lot in advance

    Read the article

  • Database Functional Programming in Clojure

    - by Ralph
    "It is tempting, if the only tool you have is a hammer, to treat everything as if it were a nail." - Abraham Maslow I need to write a tool to dump a large hierarchical (SQL) database to XML. The hierarchy consists of a Person table with subsidiary Address, Phone, etc. tables. I have to dump thousands of rows, so I would like to do so incrementally and not keep the whole XML file in memory. I would like to isolate non-pure function code to a small portion of the application. I am thinking that this might be a good opportunity to explore FP and concurrency in Clojure. I can also show the benefits of immutable data and multi-core utilization to my skeptical co-workers. I'm not sure how the overall architecture of the application should be. I am thinking that I can use an impure function to retrieve the database rows and return a lazy sequence that can then be processed by a pure function that returns an XML fragment. For each Person row, I can create a Future and have several processed in parallel (the output order does not matter). As each Person is processed, the task will retrieve the appropriate rows from the Address, Phone, etc. tables and generate the nested XML. I can use a a generic function to process most of the tables, relying on database meta-data to get the column information, with special functions for the few tables that need custom processing. These functions could be listed in a map(table name -> function). Am I going about this in the right way? I can easily fall back to doing it in OO using Java, but that would be no fun. BTW, are there any good books on FP patterns or architecture? I have several good books on Clojure, Scala, and F#, but although each covers the language well, none look at the "big picture" of function programming design.

    Read the article

  • Symfony 1.2 to 2.3 migration

    - by Bonswouar
    I've got a pretty big Symfony 1.2 project to migrate. First, I modified my .htaccess so I can have some pages handled by Symfony 2. What I'd like to do, to make the migration smoother, is to be able to render some SF2 action/templates/methods/... inside SF1. I added the autoloader to the SF1 app, so I can access to twig rendering methods and other stuff. But how can I call a SF2 action ? For example, if I want to migrate only the footer first, I would also need some php methods, not only rendering. That was previously in SF1 component, where should it be now ? If you've got any suggestion about the way of migrating, don't hesitate ! EDIT 1 : Apparently, the only way to do something like that is to render a full twig template, and/or in this template call some other partial twig templates with render(url, params). Here is my SF1 code to be able to render twig templates : public static function getTwig() { require_once __DIR__.'SF2_PATH/vendor/twig/extensions/lib/Twig/Extensions/Autoloader.php'; Twig_Autoloader::register(); $loader = new Twig_Loader_Filesystem( __DIR__.'SF2_PATH/sf2/src/VENDOR/BUNDLE/'); $twig = new Twig_Environment($loader, array( 'cache' => __DIR__.'SF2_PATH/sf2/app/cache/dev/twig', )); return $twig; } And so : $twig->loadTemplate('header.html.twig'); EDIT 2 : That doesn't seem to work, if in a twig template I try to render an other one with {{render(controller('BUNDLE:CONTROLER:ACTION', {})) }} for example Twig_Error : The function "controller" does not exist. And if I try to render the url Unknown tag name "render". I guess Symfony 2 twig functionalities are not loaded, how can I do that ? EDIT 3 : Ok, now I can do it, but I've got the following message... Twig_Error_Runtime An exception has been thrown during the rendering of a template ("Rendering a fragment can only be done when handling a master Request.") in ...

    Read the article

  • XPath: Nodes that have a child node that have an attribute

    - by Jonathan Allen
    XML Fragment <component name='Stipulations'> <group name='NoStipulations' required='N'> <field name='StipulationType' required='N' /> <field name='StipulationValue' required='N' /> </group> </component> <component name='NestedParties3'> <group name='NoNested3PartyIDs' required='N'> <field name='Nested3PartyID' required='N' /> <field name='Nested3PartyIDSource' required='N' /> <field name='Nested3PartyRole' required='N' /> <group name='NoNested3PartySubIDs' required='N'> <field name='Nested3PartySubID' required='N' /> <field name='Nested3PartySubIDType' required='N' /> </group> </group> </component> <component name='UnderlyingStipulations'> <group name='NoUnderlyingStips' required='N'> <field name='UnderlyingStipType' required='N' /> <field name='UnderlyingStipValue' required='N' /> </group> </component> What I want is all "group" nodes which have a child node of type "field" and a name "StipulationType". This is what I've tried so far: dictionary.XPathSelectElements("group[field[@name='StipulationType']]") dictionary.XPathSelectElements("group[./field[@name='StipulationType']]")

    Read the article

  • Is there a standard syntax for encoding structure objects as HTTP GET request parameters?

    - by lexicore
    Imagine we need to pass a a number structured objects to the web application - for instance, locale, layout settings and a definition of some query. This can be easily done with JSON or XML similar to the following fragment: <Locale>en</Locale> <Layout> <Block id="header">hide</Block> <Block id="footer">hide</Block> <Block id="navigation">minimize</Block> </Layout> <Query> <What>water</What> <When> <Start>2010-01-01</Start> </When> </Query> However, passing such structures with HTTP implies (roughly speaking) HTTP POST. Now assume we're limited to HTTP GET. Is there some kind of a standard solution for encoding structured data in HTTP GET request parameters? I can easily imagine something like: Locale=en& Layout.Block.header=hide& Layout.Block.footer=hide& Layout.Block.navigation=minimize& Query.What=water& Query.When.Start=2010-01-01 But what I'm looking for is a "standard" syntax, if there's any. ps. I'm surely aware of the problem with URL length. Please assume that it's not a problem in this case.

    Read the article

  • How to make parts of a div element resize automatically?

    - by vladimir
    I'm trying to create a small html fragment (a div element) consisted of three parts: a label, textbox, and a button. Within that div element the label would be on the left (autosized), the button would be on the right (again, autosized) and the textbox should take up all remaining space within the parent div element. This is what I've tried (assuming I want my div to be 400 pixels wide): <div style="width:400px"> <div style="float: left">Label</div> <input style="width:100%"> <!-- doesn't work --> <button type='button' style='float: right'>Click</button> </div> The trouble is, my textbox does not get resized automatically. Add 'width=100%' to the textbox doesn't work. What would be the way to make it take up all remaining space between the label and the button? Ideally it should be done just by applying some styles, not by introducing new elements. (I guess the issue isn't related only to div element, but that just happens to be my work scenario.)

    Read the article

  • How to force positioned elements to stay withing viewable browser area?

    - by jessegavin
    I have a script which inserts "popup" elements into the DOM. It sets their top and left css properties relative to mouse coordinates on a click event. It works great except that the height of these "popup" elements are variable and some of them extend beyond the viewable area of the browser window. I would like to avoid this. Here's what I have so far <script type="text/javascript"> $(function () { $("area").click(function (e) { e.preventDefault(); var offset = $(this).offset(); var relativeX = e.pageX - offset.left; var relativeY = e.pageY - offset.top; // 'responseText' is the "popup" HTML fragment $.get($(this).attr("href"), function (responseText) { $(responseText).css({ top: relativeY, left: relativeX }).appendTo("#territories"); // Need to be able to determine // viewable area width and height // so that I can check if the "popup" // extends beyond. $(".popup .close").click(function () { $(this).closest(".popup").remove(); }); }); }); }); </script>

    Read the article

  • Concatenate 2 text elements on a line with full-width border using CSS only

    - by Michael Horne
    Okay, I'm a newbie to CSS3, so please be gentle. ;-) I'm working with some Wordpress code (Woocommerce plugin, to be exact), and I'm trying to format a line of code in a sidebar so that 2 separate text items (one in an <a, the other in a <span are all on the same line, the full width of the column, and with a bottom border. It looks something like this (except the bottom border on each text do not go all the way across the enclosing sidebar box): http://www.dalluva.com/temp/browse-catalog.JPG (sorry, I'm new and can't post inline images yet) Here's the code fragment I'm trying to live with (i.e. I don't want to change it): <div class="widget"> ... <ul class="product-categories"> <li class="cat-item"> <a href="http://localhost/dalluva/shop/product-category/books/">Books</a> <span class="count">(5)</span> </li> ... And here's the CSS I have now: .widget ul li a { border-bottom: 1px solid #e9e9e9; line-height:1.0; padding: 5px 0 5px 22px; display: inline-block; } .widget ul li span { border-bottom: 1px solid #e9e9e9; line-height: 1.0; padding: 5px 0 5px 0; display: inline-block; } The output in the image above looks right for this CSS code, but when I change the 'span' CSS to include a width:100%, it causes the span element to wrap to the next line, looking like this: http://www.dalluva.com/temp/browse-catalog-2.JPG I've played with white-space:nowrap, overflow:hidden, etc, but I can't seem to find a way to have both the <a and the <span text on the same line with the border extending the full width of the column. Any suggestions on getting the desired effect through CSS only? Thanks. Michael

    Read the article

< Previous Page | 22 23 24 25 26 27 28 29 30 31 32 33  | Next Page >