Daily Archives

Articles indexed Friday June 11 2010

Page 24/114 | < Previous Page | 20 21 22 23 24 25 26 27 28 29 30 31  | Next Page >

  • A graph problem

    - by copperhead
    I am struggling to solve the following problem http://uva.onlinejudge.org/external/1/193.html However Im not able to get a fast solution. And as seen by the times of others, there should be a solution of maximum n^2 complexity http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=3&page=show_problem&problemid=129&page=problem_stats Can I get some help?

    Read the article

  • Getting the name of a Clojure struct type?

    - by j-g-faustus
    When defining a struct type and instance, I can print the value and get the "struct" implementation type: (defstruct person :name :age) (def p (struct person "peter" 30)) user=> p {:name "peter", :age 30} user=> (type p) clojure.lang.PersistentStructMap But is it possible to tell whether p is an instance of the struct type "person"?

    Read the article

  • Xpath expression to retrieve oldest/earliest node

    - by gkrogers
    I have an XML snippet, so: <STATES> <STATE> <NAME>Alabama</NAME> <ABBREVIATION>AL</ABBREVIATION> <CAPITAL>Montgomery</CAPITAL> <POPULATION>4661900</POPULATION> <AREA>52419</AREA> <DATEOFSTATEHOOD>14 December 1819</DATEOFSTATEHOOD> </STATE> <STATE> <NAME>Alaska</NAME> <ABBREVIATION>AK</ABBREVIATION> <CAPITAL>Juneau</CAPITAL> <POPULATION>698473</POPULATION> <AREA>663268</AREA> <DATEOFSTATEHOOD>1 January 1959</DATEOFSTATEHOOD> </STATE> <STATE> <NAME>Delaware</NAME> <ABBREVIATION>DE</ABBREVIATION> <CAPITAL>Dover</CAPITAL> <POPULATION>885122</POPULATION> <AREA>2490</AREA> <DATEOFSTATEHOOD>7 December 1787</DATEOFSTATEHOOD> </STATE> </STATES> <etc, etc.> I want to retrieve (for example) the capital of the oldest state (i.e. "Dover"). I have managed to get this far: //STATES/STATE[DATEOFSTATEHOOD='7 December 1787']/CAPITAL/text() but can't figure out how to say 'DATEOFSTATEHOOD={the earliest DATEOFSTATEHOOD}'. Can anybody point me in the right direction, please? SOLUTION: Matt's solution is more or less spot on. I had to reformat the dates (I used YYYYMMDDD) because, as was pointed out, Xpath 1.0 doesn't support the date format I was using. Also, Microsoft's XML library (4.0 and 6.0) returned the whole node list with Matt's expression. Reversing the test fixed that problem, making it return just the earliest node. So: //STATES/STATE[(DATEOFSTATEHOOD < //STATES/STATE/DATEOFSTATEHOOD)]/CAPITAL/text()

    Read the article

  • Why the input and the select do not get the same width?

    - by Bytecode Ninja
    I have a table with two rows. The first row contains an input and the second row contains a select. Even though I have set their widths to be 100%, the select box is a few pixels smaller than the input. Any ideas why is this so and how can I set their widths to be equal to each other and as big as possible (e.g. %100) in a way that works across all (A-grade) browsers? <table width="100%" style="margin-top: 5px;"> <tr> <td width="35"><label for="desc">Description</label></td> <td> <input type="text" style="width: 100%;" name="desc" id="desc" /> </td> </tr> <tr> <td width="35"><label for="group">Group</label></td> <td> <select id="group" name="group" style="width: 100%; line-height: 17px;"> <option value="val">name</option> </select> </td> </tr> </table>

    Read the article

  • Free LINQPad is a great way to learn LINQ!

    - by CatherineRussell
    LINQPad is a great way to learn LINQ: it comes loaded with 500 examples from the book, C# 4.0 in a Nutshell.  There's no better way to experience the coolness of LINQ and functional programming. LINQPad is more than just a LINQ tool: it's an ergonomic C#/VB scratchpad that instantly executes any C#/VB expression, statement block or program with rich output formatting – the ultimate in dynamic development. Put an end to those hundreds of Visual Studio Console projects cluttering your source folder! Best of all, LINQPad standard edition is free and can run without installation (or with a low-impact setup). The executable is 3MB and is self-updating. To get it, go to: http://www.linqpad.net/

    Read the article

  • Access control to non root users

    - by Sirish Kumar
    Hi I am setting up development environment based on SLED, we have installed required software as root user. We have configuered users Login through NIS. Developers needs access to almost all partitions for complete access including write and execute when they login using their ID's, Log in through their own id's is mandatory . What is the best way to give this access?

    Read the article

  • Windows Vista - behavior with RAM minimum

    - by benc
    I am considering creating a Vista install, in VirtualBox, in a minimum configuration. The Microsoft pages seem consistent on the most important points: 1 GB of system memory 40 GB hard drive with at least 15 GB of available space 128 MB of graphics memory (minimum) In my experience sometimes these recommendations are accurate. (For example, I have a Windows XP in VirtualBox that generally behaves well running in the stated minimum). If anyone has some practical experience (especially the type that could save me hours of pain), please let me know.

    Read the article

  • MacOSX Dock - number of open windows?

    - by Pydev UA
    There is one big issue for me with Doc in OSX - it does not shows you if more than one window opened in application For example - I were browsing with firefox and some site opens a background window with some sounds - and I have no idea where it comes from - Dock does not tell you if some application opens more than one window.. Is there a way (or some application) that can add some mark to application icon in Dock if it has more than one window open?

    Read the article

  • Weird text addition in PHP

    - by Patrick Gates
    I have a form posting data to a php page. Then I have the PHP page echoing the data aswell as posting it to twitter. Whenever In a word with an apostrophe it adds a back-slash right before it. So I type in "I'm going to the park" it echos "I\'m going to the park" what's going on and how do I fix it? Thanx :)

    Read the article

  • How to Ignore certain tags and replace texts in PHP

    - by Aakash Chakravarthy
    Hello, I have a variable like $content = "Lorem Ipsum is simply <b>dummy text of the printing</b> and typesetting industry. Lorem Ipsum has been the industry's <i>standard dummy text</i> ever since the 1500s <string>javascriptFunc();</script>" ; when i use str_replace('a', '', $content); all the 'a's get removed. But the 'a's within the <script> tag should not be removed. or is there any way to replace text other than this method Please help .

    Read the article

  • Does FastCGI support PHP 5.3.2 centOS?

    - by bn
    I just upgrade the PHP version in my VPS to 5.3.2 I used FastCGI and worker MPM in php 5.1.2 or 5.2.1 I forgot, it worked fine, and it was so fast, I like it. After I upgrade the PHP version, it gives me Internal Server Error 500 on all .php pages. What is wrong? does FCGI support php 5.3.2? If yes, there should be some differences in setting it up? what should I change to get it back working? Thank You

    Read the article

  • how to update rubygems in ubuntu 10.4?

    - by fayer
    when i run "gem -v" i get 1.3.5 i want to upgrade that version cause the bundler gem has to run on a higher version. i have run "apt-get install rubygems" but the version when typing "gem -v" is still 1.3.5. i cant use "gem update --system" on ubuntu, it tells me to update gem using apt-get. please help

    Read the article

  • Is it possible to make customizable WPF styles?

    - by Dheeraj Kumar
    I really like WPF because of its awesome skinning support by changing resourcedictionaries on the fly, but the catch is, the styles must be made by designers in XAML. My client needs a skinnable UI where the end users can make skins themselves. My question is - In Photoshop, you can take any image, and add a color overlay to change all the colors to that hue. Can you do something similar in WPF? I'm just a beginner, and looking at several WPF styles, it seems like all the color values are hard-coded. Here's a sample scenario - user selects two colors from color pickers, and all the controls have a gradient background from Color1 to Color2.

    Read the article

  • how to insert new line in bash shell for variable??

    - by puspa
    I have two variables var1 and var2. The contents of each variables come from bash shell grep command. echo $var1 prints 123 465 326 8080 echo $var2 prints sila kiran hinal juku Now I want to print the above into following formats in Linux bash shell 123 sila 465 kiran 326 hinal 8080 juku So how can I print this way in bash shell??

    Read the article

  • Best XML Library in C++, Fast Set-Up

    - by Cenoc
    Hello Everyone, I was wondering what is the best XML Library in C++ (I'm using Visual Studio), considering fast set-up is critical. Basically, I want to create a file to save annotations on various .avi files. Thank you in advance.

    Read the article

  • Adding integer value to a list from XML file

    - by Pramodh
    I've an Xml file like <SampleFile> <Data> <Element Val="8" /> <Element Val="10" /> <Element Val="12" /> <Element Val="14" /> <Element Val="16" /> <Element Val="9" /> <Element Val="11" /> <Element Val="13" /> <Element Val="15" /> <Element Val="17" /> </Data> </SampleFile> i need to read the attribute value of" Val" and convert it to Int32 , then sort and then add to the list now i'm using like: List<Int32> lst = (XDocument.Load("\\Sample.xml").Descendants("Element").Select(l_Temp => l_Temp.Attribute("Val").Value.ToString()).Cast<Int32>().OrderBy(nTemp => nTemp)).ToList(); but its not working properly please give me a better solution

    Read the article

  • Python - Create a list with initial capacity

    - by Claudiu
    Code like this often happens: l = [] while foo: #baz l.append(bar) #qux This is really slow if you're about to append thousands of elements to your list, as the list will have to constantly be re-initialized to grow. (I understand that lists aren't just wrappers around some array-type-thing, but something more complicated. I think this still applies, though; let me know if not). In Java, you can create an ArrayList with an initial capacity. If you have some idea how big your list will be, this will be a lot more efficient. I understand that code like this can often be re-factored into a list comprehension. If the for/while loop is very complicated, though, this is unfeasible. Is there any equivalent for us python programmers?

    Read the article

  • Device Clipping in Qwt

    - by Cenoc
    Hey everyone, I was working in qwt, and noticed I was setting device clipping to false. Does anyone know what device clipping is? I couldnt find anything about it really in their documentation. Thanks.

    Read the article

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