Daily Archives

Articles indexed Wednesday May 12 2010

Page 30/121 | < Previous Page | 26 27 28 29 30 31 32 33 34 35 36 37  | Next Page >

  • What is the efficient way to find some pattern in a big text?

    - by salman
    I want to extract email addresses from a large text file. what is the best way to do it? My idea is to find '@' in the text and use "Regex" to find email address into substring at (for example) 256 chars before this position and length of 512. P.S.: Straightforwardly I want to know the best and most efficient way to find some pattern (like email addresses) in a huge text.

    Read the article

  • nginx automatic failover load balancing

    - by robinmag
    Hi, I'm using nginx and NginxHttpUpstreamModule for loadbalancing. My config is very simple: upstream lb { server 127.0.0.1:8081; server 127.0.0.1:8082; } server { listen 89; server_name localhost; location / { proxy_pass http://lb; proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } } But with this config, when one of 2 backend server is down, nginx still routes request to it and it results in timeout half of the time :( Is there any solution to make nginx to automatically route the request to another server when it detects a downed server. Thank you.

    Read the article

  • Issue with css float -- Hindering IE6 from putting div in next line

    - by Bernhard V
    Hi, I've got an issue with floating divs in IE6. There's one navigation div on the left and one content div for the rest of the page. They've got the following css values: #navigation { float: left; width: 185px; padding-left: 5px; overflow: auto; height: 100%; } #content { overflow: auto; height: 100%; } In Firefox, IE8, Chrome and Opera, I get scrollbars for the content div when I resize the page to a size where both divs can't fit in as a whole. The navigation div stays in its place. And that is the desired behaviour. But in IE6, there are no scrollbars for the content div. Instead, when the page is getting too small, IE6 simply puts the content div under the navigation div. Do you know any way to hinder IE6 from this behaviour?

    Read the article

  • [WordPress] Hide Custom Fields in New Post?

    - by Norbert
    I just started out with WordPress and I'm having some problems with the custom fields. Here's the code from functions.php add_post_meta($post_id, 'Post Thumbnail', $post_thumb, true) or update_post_meta($post_id, 'Post Thumbnail', $post_thumb); add_post_meta($post_id, 'Project URL', $url, true) or update_post_meta($post_id, 'Project URL', $url); add_post_meta($post_id, 'Project Thumbnail', $thumb, true) or update_post_meta($post_id, 'Project Thumbnail', $thumb); The problem is that they show up when I try to create a new post like so: The other problem is that they don't even work, only if I publish the post, go back and readd each field. Is there any way to hide the fields to only show the "Add new custom field:" part? Thank you!

    Read the article

  • Separating positive values from 'zero' values in an XSLT for-each statement

    - by danielle
    I am traversing an XML file (that contains multiple tables) using XSLT. Part of the job of the page is to get the title of each table, and present that title with along with the number of items that table contains (i.e. "Problems (5)"). I am able to get the number of items, but I now need to separate the sections with 0 (zero) items in them, and put them at the bottom of the list of table titles. I'm having trouble with this because the other items with positive numbers need to be left in their original order/not sorted. Here is the code for the list of titles: <ul> <xsl:for-each select="n1:component/n1:structuredBody/n1:component/n1:section/n1:title"> <li style="list-style-type:none;"> <div style = "padding:3px"><a href="#{generate-id(.)}"> <xsl:variable name ="count" select ="count(../n1:entry)"/> <xsl:choose> <xsl:when test = "$count != 0"> <xsl:value-of select="."/> (<xsl:value-of select="$count"/>) </xsl:when> <xsl:otherwise> <div id = "zero"><xsl:value-of select="."/> (<xsl:value-of select="$count"/>)</div> </xsl:otherwise> </xsl:choose> </a> </div> </li> </xsl:for-each> </ul> Right now, the "zero" div just marks each link as gray. Any help regarding how to place the "zero" divs at the bottom of the list would be greatly appreciated. Thank you!

    Read the article

  • div popup inside td

    - by sims
    I have a table with a bunch of cells. (No way! Amazing! :P) Some of the cells have a small div that when you put your mouse over, it gets bigger so you can read all the text. This works well and all. However, since html elements that come later in the document have a higher z-index, when the div gets bigger it is underneath the other divs in the other cells. Some html code: <table> <tr> <td> limited info <div style="position: relative;"> <div style="position: absolute; top: 0; left: 0; width: 1em; height: 1em;" onmouseover="tooltipshow(this)" onmouseout="tooltiphide(this)"> informative long text is here </div> </div> </td> <td> some short info <div style="position: relative;"> <div style="position: absolute; top: 0; left: 0; width: 1em; height: 1em;" onmouseover="tooltipshow(this)" onmouseout="tooltiphide(this)"> longer explanation about what is really going on that covers the div up there ^^^. darn! </div> </div> </td> </tr> </table> Some js code: function tooltipshow(obj) { obj.style.width = '30em'; obj.style.zIndex = '100'; } function tooltiphide(obj) { obj.style.width = '1em'; obj.style.zIndex = '20'; } It doesn't matter if I set z-index dynamically to something higher onmouseover. It's like z-index has no affect. I think it has something to do with the table. I've tested this in FF3. When I'm feeling particularly macho, I'll test it in IE.

    Read the article

  • Am I writing this right? [noob]

    - by Aaron
    private final int NUM_SOUND_FILES = 4; private Random rnd = new Random(4); private int mfile[] = new mfile[NUM_SOUND_FILES]; //the second mfile //reports error everytime mfile[0] = R.raw.sound1; mfile[1] = R.raw.sound2; mfile[2] = R.raw.sound3; mfile[3] = R.raw.sound4; int sndToPlay = rnd.nextInt(NUM_SOUND_FILES); I keep getting syntax errors no matter how I write it. And when I get the syntax right, it forcecloses. Here's with the alleged "correct" syntax but forcecloses: private final int NUM_SOUND_FILES = 4; private Random rnd = new Random(4); private int mfile[] = new int[NUM_SOUND_FILES];{ mfile[0] = R.raw.sound1; mfile[1] = R.raw.sound2; mfile[2] = R.raw.sound3; mfile[3] = R.raw.sound4;}

    Read the article

  • Diagonal of polygon is inside or outside?

    - by Himadri
    I have three consecutive points of polygon, say p1,p2,p3. Now I wanted to know whether the orthogonal between p1 and p3 is inside the polygon or outside the polygon. I am doing it by taking three vectors v1,v2 and v3. And the point before the point p1 in polygon say p0. v1 = (p0 - p1) v2 = (p2 - p1) v3 = (p3 - p1) With reference to this question, I am using the method shown in the accepted answer of that question. It is only for counterclockwise. What if my points are clockwise. I am also knowing my whole polygon is clockwise or counterclockwise. And accordingly I select the vectors v1 and v2. But still I am getting some problem. I am showing one case where I am getting problem. This polygon is counterclockwise. and It is starting from the origin of v1 and v2.

    Read the article

  • how to add styles to actionview helper tags?

    - by ZX12R
    how do i add styles to actionviews helper tags. like the following <%= link_to "Home", :controller=> "home", :action=> "index", :style=>{:position=>"absolute", :top=>"0px"} %> is something like the above achievable. I dont want to add css classes. Thanks.

    Read the article

  • Implementing a kext that intercepts file system usage.

    - by UraN
    Hi, how do most of antivirus software block file system io in case of an infected file? I suppose all the magic resides in some custom kext to do that. Can anyone point me to some topics on this? Some working example would also be great. I've read apple docs about kext development, but mostly it's all about hardware drivers and i could not find what i need. Thanx.

    Read the article

  • Application frame leaves blank line at the top

    - by iFloh
    Any clues why my programmatically defined UIScrollView (using the application frame) always leaves an empty space at the top (below the navigationBar) of 20 pixels. How can I close that? UIScrollView *vScrollView = [[UIScrollView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]]; vScrollView.backgroundColor = [UIColor redColor]; How do I need to call the application frame size to avoid that gap?

    Read the article

  • From where these links are coming

    - by Ramesh
    i am having an web site and it displays in google for some keywords and i need to know these sites are getting displayed in google like this Welcome! - The Apache Software Foundation Supports the development of a number of open-source software projects, including the Apache web server. Includes license information, latest news, ... www.apache.org/ - Cached - Similar Apache web server Tomcat Mirrors Projects from where these '"apache" "web server" tomcat links are coming from ...how to do this for my site///

    Read the article

  • C# expression tree for ordinary code

    - by rwallace
    It's possible to create an expression tree, if you declare it as such. But is it possible to get an expression tree for an ordinary chunk of code such as a method or property getter? What I'm trying to do is, let's say for an order processing system, I have a class for order items: class Item : Entity { [Cascade] public Document document { get; set; } public int line { get; set; } public Product product { get; set; } public string description { get; set; } public decimal qty { get; set; } public decimal price { get; set; } public decimal net { get { return qty * price; } } public VatCode vat_code { get; set; } } where the net value equals qty * price, so I'd like to declare it as such, either with a property or method, and then also have the framework introspect that expression so it can generate appropriate SQL for defining a corresponding calculated column in a corresponding database view. The most obvious way to do this would be to get the expression tree for a property getter or a method, but I can't find any indication how to do this, or that it is possible. (I have found a way to get a method body as a byte stream, but that's not what's desired here.) If that isn't possible, I suppose the recommended solution would be to declare something like a static field that is an expression tree, and compile/run it at run time for internal use, and also introspect as normal for SQL generation?

    Read the article

  • Scroll Bar - Help

    - by 3gwebtrain
    Hi, any one can help in this?, i want to make a scroll bar to scroll the li underneath a div. in which i made a ui, scroller, but client want the front and back arrow to adjust the slides. like regular scroll bar like browser. please visit ; http://ikeafamilylive.com/stories/60 and you will witness what i request. And please don't recommend me a plug-in, because i need to use this scroll bar across the site with several customization process. please give me the sample code / suggestion to make a scroll bar using jquery+css. with full functionality.

    Read the article

  • design question for transportation agency/workflow system

    - by George2
    Hello everyone, I am designing a transportation agency/workflow system, and it including 3 types of people, customer who requests to transport some stuff, drivers who deliver the stuff, and truck manager who manages transport source/destination truck coordination and communicates/organizes drivers. The system is expected to be a web site, and 3 kinds of people could use the web site to submit request, accept request, monitor status of specific stuff transportation, etc. The web site is more like an open agency or a workflow system. I am wondering whether there are any existing technologies, tools or projects (better to be open source, but not a must) which I could build my application faster based on? I prefer to use .Net technologies, but not a must. thanks in advance, George

    Read the article

  • How can I automatically update the title in an xterm running screen?

    - by Nathan Fellman
    This is a bit of a followup to this question. I'm working in tcsh within GNU screen in an xterm. I have the following in my .cshrc: alias res_t 'xtset -t %h:%d "(%u:%g)" %e' # reset titlebar res_t # reset title right now alias precmd res_t And this works fine! However, when I run screen I see that the title doesn't get updated with the current directory. How can I make screen update the xterm title?

    Read the article

  • How to set value from other class

    - by Ram
    Its said that property should not be "Set" only and it should be "Get" as well. What should i do if I need to set value to a variable from some other class? The will keep changing so I cannot pass it through constructor. Shall I create a function for this as shown below? class A { public void SetValue() { b = new B(); b.SetTest(10); } } class B { int test; public void SetTest(int value) { test = value; } } What are the other alternatives?

    Read the article

  • About Backward Compatibility of .NET Framework 4

    - by wuminqi
    We have an WPF Application build on .net framework 3.5. Some testers find if they uninstall .net framework 3.5, but install .net framework 4.0, our APP fails to launch itself. Dose this mean that .net framework 4.0 does not include all 3.5 libs, and users have to install .net 3.5 even though they have 4.0? I see here are some migration issues listed by Microsoft http://msdn.microsoft.com/en-us/library/ee941656.aspx#windows_presentation_foundation_wpf Are they all breaking changes so that the backward compatibility is ruined? Thanks

    Read the article

< Previous Page | 26 27 28 29 30 31 32 33 34 35 36 37  | Next Page >