Search Results

Search found 145 results on 6 pages for 'eswaramoorthy nec'.

Page 2/6 | < Previous Page | 1 2 3 4 5 6  | Next Page >

  • Resolution changes when using switch

    - by Edward D
    So, the "real" resolution of my monitor is 1024x768. That's what I'd use on my docked Windows laptop, and what I'd use on my Xubuntu desktop connected directly. When I connect a switch, to switch between the two, however, the ubuntu machine's resolution changes. Everything's still proportional, and it still thinks it's doing 1024x768, but the icons and fonts appear larger. Not 800x600 larger, but still big. When I used Xubuntu Precise, I created an xorg.conf file to set a resolution of 1280x1024 which made it look the way it does without the switch ... as a workaround. When I upgraded to Trusty, I lost this. I tried to re-create it, but doesn't seem to load my file. Ideally, I'd like to correct the original problem, but I'd settle for being able to up the resolution. I searched for a while, and tried to do it, but I'm giving up ... please help me out. Controller: Intel Corporation 82915G/P/GV/GL/PL/910GL Memory Controller Hub (rev 04) Monitor: NEC MultiSync LCD 1850e http://www.necdisplay.com/documents/UserManuals/LCD1850E_manual.pdf OS: Xubuntu 14.04 Trusty /etc/X11/xorg.conf: # YOU CREATED THIS FILE # sudo leafpad /etc/X11/xorg.conf Section "Device" Identifier "Configured Video Device" EndSection Section "Monitor" Identifier "NEC LCD1850E" # I found Synchronization Range at: # http://www.necdisplay.com/documents/UserManuals/LCD1850E_manual.pdf HorizSync 31.0-82.0 VertRefresh 55.0-85.0 EndSection Section "Screen" Identifier "Default Screen" Monitor "NEC LCD1850E" Device "Configured Video Device" SubSection "Display" Depth 24 Modes "1280x1024" "1280x960" "1024x768" "800x600" "848x480" "640x480" EndSubSection EndSection

    Read the article

  • Ruby on Rails Truncate text - can I use it for a combination of title and content?

    - by Quhby
    I have <%=link_to topic.title, topic_path(topic) % - <%= truncate(topic.description_without_embed, :length=50, :omission ="...") % But what I really want to do is to truncate both the title and the post to 50 characters. How can this be done? The output should look something like Lorem ipsum dolor sit amet, consectetur adipiscing elit. - Curabitur eu dolor est, id pharetra lectus. Phasellus nec feugiat dolor. Curabitur feugiat ultrices leo ut egestas. Nullam nec nisi in ligula feugiat placerat. Ut adipiscing urna consequat tortor euismod pretium. Maecenas eget quam aliquet orci blandit eleifend eu et quam. Donec. instead of Lorem ipsum dolor sit amet, consectetur adipiscing elit. - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur eu dolor est, id pharetra lectus. Phasellus nec feugiat dolor. Curabitur feugiat ultrices leo ut egestas. Nullam nec nisi in ligula feugiat placerat. Ut adipiscing urna consequat tortor euismod pretium. Maecenas eget quam aliquet orci blandit eleifend eu et quam. Donec. I don't need to use the truncate method, any method would be helpful. Thanks.

    Read the article

  • target="_blank" link using jQuery UI Tabs

    - by Tim
    Hello, I would like to use my existing Jquery UI tabs to shoot my users off to a new browser window Unfortunately adding a target="_blank" to the jquery tab code doesn't work. Does anyone have any ideas? Here is the default Tab Code found here <div id="tabs"> <ul> <li><a href="#tabs-1">Nunc tincidunt</a></li> <li><a href="#tabs-2">Proin dolor</a></li> <li><a href="#tabs-3">Aenean lacinia</a></li> </ul> <div id="tabs-1"> <p>Proin elit arcu, rutrum commodo, vehicula tempus, commodo a, risus. Curabitur nec arcu. Donec sollicitudin mi sit amet mauris. Nam elementum quam ullamcorper ante. Etiam aliquet massa et lorem. Mauris dapibus lacus auctor risus. Aenean tempor ullamcorper leo. Vivamus sed magna quis ligula eleifend adipiscing. Duis orci. Aliquam sodales tortor vitae ipsum. Aliquam nulla. Duis aliquam molestie erat. Ut et mauris vel pede varius sollicitudin. Sed ut dolor nec orci tincidunt interdum. Phasellus ipsum. Nunc tristique tempus lectus.</p> </div> <div id="tabs-2"> <p>Morbi tincidunt, dui sit amet facilisis feugiat, odio metus gravida ante, ut pharetra massa metus id nunc. Duis scelerisque molestie turpis. Sed fringilla, massa eget luctus malesuada, metus eros molestie lectus, ut tempus eros massa ut dolor. Aenean aliquet fringilla sem. Suspendisse sed ligula in ligula suscipit aliquam. Praesent in eros vestibulum mi adipiscing adipiscing. Morbi facilisis. Curabitur ornare consequat nunc. Aenean vel metus. Ut posuere viverra nulla. Aliquam erat volutpat. Pellentesque convallis. Maecenas feugiat, tellus pellentesque pretium posuere, felis lorem euismod felis, eu ornare leo nisi vel felis. Mauris consectetur tortor et purus.</p> </div> <div id="tabs-3"> <p>Mauris eleifend est et turpis. Duis id erat. Suspendisse potenti. Aliquam vulputate, pede vel vehicula accumsan, mi neque rutrum erat, eu congue orci lorem eget lorem. Vestibulum non ante. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Fusce sodales. Quisque eu urna vel enim commodo pellentesque. Praesent eu risus hendrerit ligula tempus pretium. Curabitur lorem enim, pretium nec, feugiat nec, luctus a, lacus.</p> <p>Duis cursus. Maecenas ligula eros, blandit nec, pharetra at, semper at, magna. Nullam ac lacus. Nulla facilisi. Praesent viverra justo vitae neque. Praesent blandit adipiscing velit. Suspendisse potenti. Donec mattis, pede vel pharetra blandit, magna ligula faucibus eros, id euismod lacus dolor eget odio. Nam scelerisque. Donec non libero sed nulla mattis commodo. Ut sagittis. Donec nisi lectus, feugiat porttitor, tempor ac, tempor vitae, pede. Aenean vehicula velit eu tellus interdum rutrum. Maecenas commodo. Pellentesque nec elit. Fusce in lacus. Vivamus a libero vitae lectus hendrerit hendrerit.</p> </div> Thanks, Tim

    Read the article

  • jQuery - Opening links within tabs

    - by rwbutler
    Hi all, At present I have some jQuery tabs and these tabs contain links. Unfortunately on following one of the links, the new page opens as if you were following any normal link i.e. not within the tab which is want I would want to happen. Have tried following this section but to no avail: http://jqueryui.com/demos/tabs/#...open_links_in_the_current_tab_instead_of_leaving_the_page Any ideas what might be going wrong here? Many thanks in advance! <html> <head> <script src="jquery-1.4.2.min.js"></script> <script src="jquery-ui-1.8rc3.custom.min.js"></script> <link href="redmond/jquery-ui-1.8rc3.custom.css" rel="stylesheet" type="text/css"></link> <script type="text/javascript"> $(function() { $("#tabs").tabs({ load: function(event, ui) { $("a", ui.panel).click(function() { $(ui.panel).load(this.href); return false; }); } }); }); </script> </head> <body> <div id="tabs"> <ul> <li><a href="#tabs-1">Nunc tincidunt</a></li> <li><a href="#tabs-2">Proin dolor</a></li> <li><a href="#tabs-3">Aenean lacinia</a></li> </ul> <div id="tabs-1"> <a href="page.html">link</a> <p>Proin elit arcu, rutrum commodo, vehicula tempus, commodo a, risus. Curabitur nec arcu. Donec sollicitudin mi sit amet mauris. Nam elementum quam ullamcorper ante. Etiam aliquet massa et lorem. Mauris dapibus lacus auctor risus. Aenean tempor ullamcorper leo. Vivamus sed magna quis ligula eleifend adipiscing. Duis orci. Aliquam sodales tortor vitae ipsum. Aliquam nulla. Duis aliquam molestie erat. Ut et mauris vel pede varius sollicitudin. Sed ut dolor nec orci tincidunt interdum. Phasellus ipsum. Nunc tristique tempus lectus.</p> </div> <div id="tabs-2"> <a href="page.html">link</a> <p>Morbi tincidunt, dui sit amet facilisis feugiat, odio metus gravida ante, ut pharetra massa metus id nunc. Duis scelerisque molestie turpis. Sed fringilla, massa eget luctus malesuada, metus eros molestie lectus, ut tempus eros massa ut dolor. Aenean aliquet fringilla sem. Suspendisse sed ligula in ligula suscipit aliquam. Praesent in eros vestibulum mi adipiscing adipiscing. Morbi facilisis. Curabitur ornare consequat nunc. Aenean vel metus. Ut posuere viverra nulla. Aliquam erat volutpat. Pellentesque convallis. Maecenas feugiat, tellus pellentesque pretium posuere, felis lorem euismod felis, eu ornare leo nisi vel felis. Mauris consectetur tortor et purus.</p> </div> <div id="tabs-3"> <p>Mauris eleifend est et turpis. Duis id erat. Suspendisse potenti. Aliquam vulputate, pede vel vehicula accumsan, mi neque rutrum erat, eu congue orci lorem eget lorem. Vestibulum non ante. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Fusce sodales. Quisque eu urna vel enim commodo pellentesque. Praesent eu risus hendrerit ligula tempus pretium. Curabitur lorem enim, pretium nec, feugiat nec, luctus a, lacus.</p> <p>Duis cursus. Maecenas ligula eros, blandit nec, pharetra at, semper at, magna. Nullam ac lacus. Nulla facilisi. Praesent viverra justo vitae neque. Praesent blandit adipiscing velit. Suspendisse potenti. Donec mattis, pede vel pharetra blandit, magna ligula faucibus eros, id euismod lacus dolor eget odio. Nam scelerisque. Donec non libero sed nulla mattis commodo. Ut sagittis. Donec nisi lectus, feugiat porttitor, tempor ac, tempor vitae, pede. Aenean vehicula velit eu tellus interdum rutrum. Maecenas commodo. Pellentesque nec elit. Fusce in lacus. Vivamus a libero vitae lectus hendrerit hendrerit.</p> </div> </div> </body> </html>

    Read the article

  • JQuery UI Tabs not working

    - by DFG
    Hi, I am using the exact example below from the JQuery website using its built in tabs functions: <script type="text/javascript"> $(function() { $("#tabs").tabs(); }); </script> <div class="demo"> <div id="tabs"> <ul> <li><a href="#tabs-1">Nunc tincidunt</a></li> <li><a href="#tabs-2">Proin dolor</a></li> <li><a href="#tabs-3">Aenean lacinia</a></li> </ul> <div id="tabs-1"> <p>Proin elit arcu, rutrum commodo, vehicula tempus, commodo a, risus. Curabitur nec arcu. Donec sollicitudin mi sit amet mauris. Nam elementum quam ullamcorper ante. Etiam aliquet massa et lorem. Mauris dapibus lacus auctor risus. Aenean tempor ullamcorper leo. Vivamus sed magna quis ligula eleifend adipiscing. Duis orci. Aliquam sodales tortor vitae ipsum. Aliquam nulla. Duis aliquam molestie erat. Ut et mauris vel pede varius sollicitudin. Sed ut dolor nec orci tincidunt interdum. Phasellus ipsum. Nunc tristique tempus lectus.</p> </div> <div id="tabs-2"> <p>Morbi tincidunt, dui sit amet facilisis feugiat, odio metus gravida ante, ut pharetra massa metus id nunc. Duis scelerisque molestie turpis. Sed fringilla, massa eget luctus malesuada, metus eros molestie lectus, ut tempus eros massa ut dolor. Aenean aliquet fringilla sem. Suspendisse sed ligula in ligula suscipit aliquam. Praesent in eros vestibulum mi adipiscing adipiscing. Morbi facilisis. Curabitur ornare consequat nunc. Aenean vel metus. Ut posuere viverra nulla. Aliquam erat volutpat. Pellentesque convallis. Maecenas feugiat, tellus pellentesque pretium posuere, felis lorem euismod felis, eu ornare leo nisi vel felis. Mauris consectetur tortor et purus.</p> </div> <div id="tabs-3"> <p>Mauris eleifend est et turpis. Duis id erat. Suspendisse potenti. Aliquam vulputate, pede vel vehicula accumsan, mi neque rutrum erat, eu congue orci lorem eget lorem. Vestibulum non ante. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Fusce sodales. Quisque eu urna vel enim commodo pellentesque. Praesent eu risus hendrerit ligula tempus pretium. Curabitur lorem enim, pretium nec, feugiat nec, luctus a, lacus.</p> <p>Duis cursus. Maecenas ligula eros, blandit nec, pharetra at, semper at, magna. Nullam ac lacus. Nulla facilisi. Praesent viverra justo vitae neque. Praesent blandit adipiscing velit. Suspendisse potenti. Donec mattis, pede vel pharetra blandit, magna ligula faucibus eros, id euismod lacus dolor eget odio. Nam scelerisque. Donec non libero sed nulla mattis commodo. Ut sagittis. Donec nisi lectus, feugiat porttitor, tempor ac, tempor vitae, pede. Aenean vehicula velit eu tellus interdum rutrum. Maecenas commodo. Pellentesque nec elit. Fusce in lacus. Vivamus a libero vitae lectus hendrerit hendrerit.</p> </div> </div> </div><!-- End demo --> <div style="display: none;" class="demo-description"> <p>Click tabs to swap between content that is broken into logical sections.</p> </div><!-- End demo-description --> However, when I place the JQuery Accordian plugin anywhere in the tabs-1, tabs-2, or tabs-3 element, it stops working correctly, but it works fine in a normal page that doesn't use Jquery. Or any other Jquery doesn't seem to work as its in any of the tabs DIVs. Any ideas?

    Read the article

  • jQuery UI Tabs - bind tabs to links on the same page

    - by Troy
    Hello, I'm trying to bind tabs to a link on the same page, but I'm a relative newby to jQuery and need some help. I have the tabs working with the code from jQuery UI site. However, how do I bind the links in the sidebar on the same page? <script> $(function() { $( "#tabs" ).tabs(); }); /script> <div class="demo"> <div id="tabs"> <ul> <li><a href="#tabs-1">Nunc tincidunt</a></li> <li><a href="#tabs-2">Proin dolor</a></li> <li><a href="#tabs-3">Aenean lacinia</a></li> </ul> <div id="tabs-1"> <p>Proin elit arcu, rutrum commodo, vehicula tempus, commodo a, risus. Curabitur nec arcu. Donec sollicitudin mi sit amet mauris. Nam elementum quam ullamcorper ante. Etiam aliquet massa et lorem. Mauris dapibus lacus auctor risus. Aenean tempor ullamcorper leo. Vivamus sed magna quis ligula eleifend adipiscing. Duis orci. Aliquam sodales tortor vitae ipsum. Aliquam nulla. Duis aliquam molestie erat. Ut et mauris vel pede varius sollicitudin. Sed ut dolor nec orci tincidunt interdum. Phasellus ipsum. Nunc tristique tempus lectus.</p> </div> <div id="tabs-2"> <p>Morbi tincidunt, dui sit amet facilisis feugiat, odio metus gravida ante, ut pharetra massa metus id nunc. Duis scelerisque molestie turpis. Sed fringilla, massa eget luctus malesuada, metus eros molestie lectus, ut tempus eros massa ut dolor. Aenean aliquet fringilla sem. Suspendisse sed ligula in ligula suscipit aliquam. Praesent in eros vestibulum mi adipiscing adipiscing. Morbi facilisis. Curabitur ornare consequat nunc. Aenean vel metus. Ut posuere viverra nulla. Aliquam erat volutpat. Pellentesque convallis. Maecenas feugiat, tellus pellentesque pretium posuere, felis lorem euismod felis, eu ornare leo nisi vel felis. Mauris consectetur tortor et purus.</p> </div> <div id="tabs-3"> <p>Mauris eleifend est et turpis. Duis id erat. Suspendisse potenti. Aliquam vulputate, pede vel vehicula accumsan, mi neque rutrum erat, eu congue orci lorem eget lorem. Vestibulum non ante. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Fusce sodales. Quisque eu urna vel enim commodo pellentesque. Praesent eu risus hendrerit ligula tempus pretium. Curabitur lorem enim, pretium nec, feugiat nec, luctus a, lacus.</p> <p>Duis cursus. Maecenas ligula eros, blandit nec, pharetra at, semper at, magna. Nullam ac lacus. Nulla facilisi. Praesent viverra justo vitae neque. Praesent blandit adipiscing velit. Suspendisse potenti. Donec mattis, pede vel pharetra blandit, magna ligula faucibus eros, id euismod lacus dolor eget odio. Nam scelerisque. Donec non libero sed nulla mattis commodo. Ut sagittis. Donec nisi lectus, feugiat porttitor, tempor ac, tempor vitae, pede. Aenean vehicula velit eu tellus interdum rutrum. Maecenas commodo. Pellentesque nec elit. Fusce in lacus. Vivamus a libero vitae lectus hendrerit hendrerit.</p> </div> </div> </div> <div id="sidebar"> <a href="#tab-1" id="tab-1"><img src="image1.jpg" /></a> <a href="#tab-2" id="tab-2"><img src="image2.jpg" /></a> </div>

    Read the article

  • Checkbox to Show and Hide only for the near DIV

    - by Holp
    Select all options... Then, when the user uncheck "B" and check it again, the "D" parents must be hidden. I have to do it without give then IDs. <html> <head> <title>Form</title> <style> * { font-family: Segoe UI, Verdana; font-size: 10pt; } #total { padding: 10px; position: fixed; top: 10px; left: 500px; width: 150px; height: 100px; } p { margin: 5px; } .grupo { padding: 5px 0 5px 0; } </style> <script src="jquery-1.4.2.min.js" type="text/javascript"></script> </head> <body> <div class="grupo"> <p class="pergunta">A) Lorem ipsum dolor sit amet, nulla nec tortor?</p> <p><label><input type="radio" name="P-1" value="R-1-1" />Sim</label></p> <p><label><input type="radio" name="P-1" value="R-1-2" />Não</label></p> </div> <div class="grupo"> <p class="pergunta"><label><input type="checkbox" name="P-2" value="R-2-3" />B) Donec libero risus, commodo vitae</label></p> <div class="dependente"> <div class="grupo"> <p class="pergunta">C) Lorem ipsum dolor sit amet, nulla nec tortor?</p> <p><label><input type="radio" name="P-3" value="R-3-1" />Morbi in orci</label></p> <p><label><input type="radio" name="P-3" value="R-3-2" />Nulla purus lacus, pulvinar vel</label></p> <p><label><input type="radio" name="P-3" value="R-3-3" />Aliquam ante</label></p> <p><label><input type="radio" name="P-3" value="R-3-4" />Suspendisse scelerisque dui nec velit</label></p> </div> <div class="grupo"> <p class="pergunta"><label><input type="checkbox" name="P-4" value="R-4-5" />D) Donec libero risus, commodo vitae</label></p> <div class="dependente"> <div class="grupo"> <p class="pergunta">E) Lorem ipsum dolor sit amet, nulla nec tortor?</p> <p><label><input type="radio" name="P-5" value="R-5-1" />Morbi in orci</label></p> <p><label><input type="radio" name="P-5" value="R-5-2" />Nulla purus lacus</label></p> </div> </div> </div> </div> </div> <div class="grupo"> <p class="pergunta">F) Lorem ipsum dolor sit amet, nulla nec tortor?</p> <p><label><input type="radio" name="P-6" value="R-6-1" />Morbi in orci</label></p> <p><label><input type="radio" name="P-6" value="R-6-2" />Nulla purus lacus, pulvinar vel</label></p> <p><label><input type="radio" name="P-6" value="R-6-3" />Aliquam ante</label></p> <p><label><input type="radio" name="P-6" value="R-6-4" />Suspendisse scelerisque dui nec velit</label></p> </div> <script type="text/javascript"> $('.dependente').hide(); $(':checkbox').click(function () { var checked = this.checked; $('.dependente:first',$(this).parents('div:first')).css('display',checked ? 'block':'none'); $('.dependente input',$(this).parents('div:first')).attr('checked', false).change(); }); </script> </body> </html>

    Read the article

  • Int property in class definition

    - by Daniel I-S
    I have the following class structure for custom UITableViewCells: NumericEntryCell - Contains method for controlling max value that can be entered into a textbox. SliderCell - inherits from NEC and contains methods for handling slider-control of textbox value TextOnlyCell - just contains a textbox CellA - inherits from SliderCell and has a max value of 28 CellB - inherits from TextOnlyCell and has a max value of 150. I want NumericEntryCell to contain a definition for a property that contains the maxValue. I want to be able to set a value for this in the initialize method of a child class (CellA or CellB). Currently I have an int maxValue declared in the interface of NEC. I declare a property for this with @property int maxValue and @synthesize it within the .m file. However, attempting to modify this property's value from CellA or CellB's initialize method has no effect - when I hit a breakpoint in the NEC method that uses this value, its value is always zero. How can I get this to work?

    Read the article

  • css: zoooming-out inside the browser moves rightmost floated div below other divs

    - by John Sonderson
    I am seeing something strange in both firefox and chrome when I increase the zoom level inside these browsers, although I see nothing wrong with my CSS... I am hoping someone on this group will be able to help. Here is the whole story: I have a right-floated top-level div containing three right-floated right. The three inner divs have all box-model measurements in pixels which add up to the width of the enclosing container. Everything looks fine when the browser size is 100%, but when I start making the browser smaller with CTRL+scrollwheel or CTRL+minus the rightmost margin shrinks down too fast and eventually becomes zero, forcing my rightmost floated inner div to fall down below the other two! I can't make sense out of this, almost seems like some integer division is being performed incorrectly in the browser code, but alas firefox and chrome both display the same result. Here is the example (just zoom out with CTRL-minus to see what I mean): Click Here to View What I Mean on Example Site Just to narrow things down a bit, the tags of interest are the following: div#mainContent div#contentLeft div#contentCenter div#contentRight I've searched stackoverflow for an answer and found the following posts which seem related to my question but was not able to apply them to the problem I am experiencing: http:// stackoverflow.com/questions/6955313/div-moves-incorrectly-on-browser-resize http:// stackoverflow.com/questions/18246882/divs-move-when-resizing-page http:// stackoverflow.com/questions/17637231/moving-an-image-when-browser-resizes http:// stackoverflow.com/questions/5316380/how-to-stop-divs-moving-when-the-browser-is-resized I've duplicated the html and css code below for your convenience: Here is the HTML: <!doctype html> <html> <head> <meta charset="utf-8"> <title>Pinco</title> <link href="css/style.css" rel="stylesheet" type="text/css"> </head> <body> <div id="wrapper"> <header> <div class="logo"> <a href="http://pinco.com"> <img class="logo" src="images/PincoLogo5.png" alt="Pinco" /> </a> </div> <div class="titolo"> <h1>Benvenuti!</h1> <h2>Siete arrivati al sito pinco.</h2> </div> <nav> <ul class="menu"> <li><a href="#">Menù Qui</a></li> <li><a href="#">Menù Quo</a></li> <li><a href="#">Menù Qua</a></li> </ul> </nav> </header> <div id="mainContent"> <div id="contentLeft"> <section> <article> <p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque tempor turpis est, nec varius est pharetra scelerisque. Sed eu pellentesque purus, at cursus nisi. In bibendum tristique nunc eu mattis. Nulla pretium tincidunt ipsum, non imperdiet metus tincidunt ac. In et lobortis elit, nec lobortis purus. Cras ac viverra risus. Proin dapibus tortor justo, a vulputate ipsum lacinia sed. In hac habitasse platea dictumst. Phasellus sit amet malesuada velit. Fusce diam neque, cursus id dui ac, blandit vehicula tortor. Phasellus interdum ipsum eu leo condimentum, in dignissim erat tincidunt. Ut fermentum consectetur tellus, dignissim volutpat orci suscipit ac. Praesent scelerisque urna metus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Duis pulvinar, sem a sodales eleifend, odio elit blandit risus, a dapibus ligula orci non augue. Nullam vitae cursus tortor, eget malesuada lectus. Nulla facilisi. Cras pharetra nisi sit amet orci dignissim, a eleifend odio hendrerit. </p> </article> </section> </div> <div id="contentCenter"> <section> <article> <p> Maecenas vitae purus at orci euismod pretium. Nam gravida gravida bibendum. Donec nec dolor vel magna consequat laoreet in a urna. Phasellus cursus ultrices lorem ut sagittis. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Vivamus purus felis, ornare quis ante vel, commodo scelerisque tortor. Integer vel facilisis mauris. </p> <img src="images/auto1.jpg" width="272" height="272" /> <p> In urna purus, fringilla a urna a, ultrices convallis orci. Duis mattis sit amet leo sed luctus. Donec nec sem non nunc mattis semper quis vitae enim. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Suspendisse dictum porta quam, vel lobortis enim bibendum et. Donec iaculis tortor id metus interdum, hendrerit tincidunt orci tempor. Sed dignissim cursus mattis. </p> </article> </section> </div> <div id="contentRight"> <section> <article> <img src="images/auto2.jpg" width="272" height="272" /> <img src="images/auto3.jpg" width="272" height="272" /> <p> Cras eu quam lobortis, sodales felis ultricies, rhoncus neque. Aenean nisi eros, blandit ac lacus sit amet, vulputate sodales mi. Nunc eget purus ultricies, aliquam quam sit amet, porttitor velit. In imperdiet justo in quam tristique, eget semper nisi pellentesque. Cras fringilla eros enim, in euismod nisl imperdiet ac. Fusce tempor justo vitae faucibus luctus. </p> </article> </section> </div> </div> <footer> <div class="footerText"> <p> Copyright &copy; Pinco <br />Lorem ipsum dolor sit amet, consectetur adipiscing elit. <br />Fusce ornare turpis orci, nec egestas leo feugiat ac. <br />Morbi eget sem facilisis, laoreet erat ut, tristique odio. Proin sollicitudin quis nisi id consequat. </p> </div> <div class="footerLogo"> <img class="footerLogo" src="images/auto4.jpg" width="80" height="80" /> </div> </footer> </div> </body> </html> and here is the CSS: /* CSS Document */ * { margin: 0; border: 0; padding: 0; } body { background: #8B0000; /* darkred */; } body { margin: 0; border: 0; padding: 0; } div#wrapper { margin: 0 auto; width: 960px; height: 100%; background: #FFC0CB /* pink */; } header { position: relative; background: #005b97; height: 140px; } header div.logo { float: left; width: 360px; height: 140px; } header div.logo img.logo { width: 360px; height: 140px; } header div.titolo { float: left; padding: 12px 0 0 35px; color: black; } header div.titolo h1 { font-size: 36px; font-weight: bold; } header div.titolo h2 { font-size: 24px; font-style: italic; font-weight: bold; color: white;} header nav { position: absolute; right: 0; bottom: 0; } header ul.menu { background: black; } header ul.menu li { display: inline-block; padding: 3px 15px; font-weight: bold; } div#mainContent { float: left; width: 100%; /* width: 960px; *//* height: 860px; */ padding: 30px 0; text-align: justify; } div#mainContent img { margin: 12px 0; } div#contentLeft { height: 900px; float: left; margin-left: 12px; border: 1px solid black; padding: 15px; width: 272px; background: #ccc; } div#contentCenter { height: 900px; float: left; margin-left: 12px; border: 1px solid transparent; padding: 15px; width: 272px; background: #E00; } div#contentRight { height: 900px; float: left; margin-left: 12px; border: 1px solid black; padding: 15px; width: 272px; background: #ccc; } footer { clear: both; padding: 12px; background: #306; color: white; height: 80px; font-style: italic; font-weight: bold; } footer div.footerText { float: left; } footer div.footerLogo { float: right; } a { color: white; text-decoration: none; } Thanks.

    Read the article

  • Java Oracle Installation /usr/bin/java: cannot execute binary file

    - by Dave
    Hi I've been trying for 1 day to get Oracle Java running on Ubuntu. I have a powermac g5 with Ubuntu 12.04 ppc64. uname -a : Linux LK37 3.2.0-53-powerpc64-smp #81-Ubuntu SMP Thu Aug 22 21:17:14 UTC 2013 ppc64 ppc64 ppc64 GNU/Linux lspci: david@LK37:~$ sudo lspc [sudo] password for david: sudo: lspc: command not found david@LK37:~$ sudo lspci 0000:00:0b.0 PCI bridge: Apple Inc. CPC945 PCIe Bridge 0000:0a:00.0 VGA compatible controller: NVIDIA Corporation NV43 [GeForce 6600 LE] (rev a2) 0001:00:00.0 Host bridge: Apple Inc. U4 HT Bridge 0001:00:01.0 PCI bridge: Broadcom BCM5780 [HT2000] PCI-X bridge (rev a3) 0001:00:02.0 PCI bridge: Broadcom BCM5780 [HT2000] PCI-X bridge (rev a3) 0001:00:03.0 PCI bridge: Broadcom BCM5780 [HT2000] PCI-Express Bridge (rev a3) 0001:00:04.0 PCI bridge: Broadcom BCM5780 [HT2000] PCI-Express Bridge (rev a3) 0001:00:05.0 PCI bridge: Broadcom BCM5780 [HT2000] PCI-Express Bridge (rev a3) 0001:00:06.0 PCI bridge: Broadcom BCM5780 [HT2000] PCI-Express Bridge (rev a3) 0001:00:07.0 PCI bridge: Apple Inc. Shasta PCI Bridge 0001:00:08.0 PCI bridge: Apple Inc. Shasta PCI Bridge 0001:00:09.0 PCI bridge: Apple Inc. Shasta PCI Bridge 0001:01:07.0 Unassigned class [ff00]: Apple Inc. Shasta Mac I/O 0001:01:0b.0 USB controller: NEC Corporation OHCI USB Controller (rev 43) 0001:01:0b.1 USB controller: NEC Corporation OHCI USB Controller (rev 43) 0001:01:0b.2 USB controller: NEC Corporation uPD72010x USB 2.0 Controller (rev 04) 0001:03:0c.0 IDE interface: Broadcom K2 SATA 0001:03:0d.0 Unassigned class [ff00]: Apple Inc. Shasta IDE 0001:03:0e.0 FireWire (IEEE 1394): Apple Inc. Shasta Firewire 0001:05:04.0 Ethernet controller: Broadcom Corporation NetXtreme BCM5780 Gigabit Ethernet (rev 03) 0001:05:04.1 Ethernet controller: Broadcom Corporation NetXtreme BCM5780 Gigabit Ethernet (rev 03) david@LK37:~$ I tried various ways to install Oracle Java but I always end up with: bash: /usr/bin/java: cannot execute binary file At the moment I have Installed jdk-7u25-linux-x64.tar.gz in /usr/lib/jvm/jdk1.7.0/bin/ as said in this post I already tried the web install but I get a 404 error. I hope you can help me. I started using Ubuntu yesterday so please give me the complete terminal code, it will be a lot easier for me. For those who care I want to play Minecraft and with the OpenJDK I got a java.lang error. That's why I want to install Oracle Java.

    Read the article

  • Laptop freezes and seems to crash, but continues working after waiting for a few minutes [closed]

    - by Corwin
    I've had this old notebook laying around and because i was missing a second machine (My wife usually steals the first ;) ) I considered installing Linux. As a php developer I work with Linux servers (usually fedora) on a daily basis and because its an older machine that I want to use for development, linux seemed the best option. Speedwise I expected a good experience, better than Windows 7 on the same machine. The results where terrible. I tried ubuntu 12.04. The shell never got past showing the background. The system doesn't freeze since the mouse still works and I can use ctrl+alt+f2 etc to enter terminal mode. I expected hardware problems en even exchanged the harddisk en Ram memory. No luck though, so I started over and tried 11.10 Same results so I tried 10.04.4 which did install properly. Not sure if unity was the problem, but it seems likely. But then I tried simply things like surfing on the net, the system frooze and I thought it crashed so after a few minutes I pulled the plug and rebooted. But it happened again and I waited. After a few minutes the system came back to life like nothing happened. Long story short. Besides the fact that the entire interface is very sluggish, any and all graphical functions freezes the system. The more elaborate the animation would be, the longer it freezes. I switch chromium from window to fullscreenmode and had to wait 15 minutes to continue. I don't see the animation that's probably supposed to be in between. It just freezes and then after unfreezing its fullscreen. I don't think its a bug. I suspect the problem is with my graphics card. Like I said, its and old system. So old that I can't even find the original Ati drivers anywere. (I'll post the details of my system at the end of my post) I'm at a loss as to what to do next. I tried other Distro's. So far only dreamlinux works normally. Linux Mint won't start as a live CD. I think I simply need a driver update but I can't find them anywhere. Does anyone have the same experience ? Maybe even someone who has or had the same notebook running Ubuntu at some point ? Anyway, here are the specs: http://www.nec-driver.com/nec-driver/NEC-Versa-P550---FP550-Driver_421.html

    Read the article

  • Express5800 to Mesh with SQL Server 2012

    NEC's GX servers have been engineered to supply high performance and availability. At their core is an Intel Xeon E7 processor with the power to handle up to 2TB of memory and 160 threads. In addition, thanks to QuickPath Interconnect technology, GX servers boast as much as a 200 percent in database improvement over their predecessors. The combination of NEC servers with Microsoft SQL Server 2012 give users the necessary capabilities to truly realize the cloud's potential for their needs in a number of ways. Organizations get stable platforms built for enterprise environments that offer hig...

    Read the article

  • how to integrate jquery with jsf richfaces tags for print the image and textarea content?

    - by eswaramoorthy-nec
    hi, Here i write code to take printout the textarea content using jquery. I load the two java script (jquery-1.3.2.js and jquery.print.js) But these two source file not support rich:datascroller tag.. That means there is no reaction in datascroller. I need to take print the textarea content and also perfectly work to datascroller also. Here i give jsp and related java files. This code have datatable, rich:datascroller and textarea. Datatable for only used for test the datascroller component. My focus : print the textarea content as well as perfectly work to datascroller component. printer.jsp <%@page contentType="text/html" pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> <%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%> <%@ taglib uri="http://richfaces.org/rich" prefix="rich"%> <html> <head> <title>Print Viewer </title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <a4j:loadScript src="resource/jquery-1.3.2.js"/> <a4j:loadScript src="resource/jquery.print.js"/> // The problem is : above two loadscript does not support datascroller //componenet. // But that two jquery file for using to take the print. <script type="text/javascript"> function printData() { //Print the Div content for textarea jQuery( ".printable" ).print(); return( false ); } </script> </head> <body> <h:form id="printViewerForm" binding="#{PrintViewer.initForm}"> <rich:panel id="printViewerRichPanel"> <h:panelGrid cellpadding="3" columns="2" id="printPanelGridId" cellspacing="3" border ="1"> <h:panelGrid> //DataScroller for dataTable <rich:datascroller id = "dataScrollerTop" align="center" for= "printDataTable" page="1" maxPages="20"/> <rich:dataTable id="printDataTable" value="#{PrintViewer.printViewerList}" cellpadding="3" rows = "5" rowKeyVar="rowIndex" cellspacing="3" var="printViewerResultListTo"> <f:facet name="header"> <rich:columnGroup> <rich:column> <h:outputText value="PrintTable"/> </rich:column> </rich:columnGroup> </f:facet> <rich:column> <h:outputText value="#{printViewerResultListTo.printName}"/> </rich:column> </rich:dataTable> </h:panelGrid> //Print Content Region <a4j:region id="printContentViewRegion"> <a4j:commandButton id="printButton" value="PrintContent" onclick="printData()"/> <div id="printContentDiv" class="printable"> <h:inputTextarea id="printContentTextArea" style="width:300px;height:300px; value =" This is Sample Jquery For Test working Text Area"/> </div> </a4j:region> </h:panelGrid> </rich:panel> </h:form> </body> PrintViewer.java import java.util.ArrayList; import java.util.List; import javax.faces.component.html.HtmlForm; public class PrintViewer { private HtmlForm initForm; private List printViewerList = new ArrayList(); public HtmlForm getInitForm() { printViewerList = getPrintList(); return initForm; } private List getUploadList() { if (!printViewerList.isEmpty()) { printViewerList.clear(); } printViewerList.add(new PrintViewerResultListTo("print 1")); printViewerList.add(new PrintViewerResultListTo("print 2")); printViewerList.add(new PrintViewerResultListTo("print 3")); printViewerList.add(new PrintViewerResultListTo("print 4")); printViewerList.add(new PrintViewerResultListTo("print 5")); printViewerList.add(new PrintViewerResultListTo("print 6")); printViewerList.add(new PrintViewerResultListTo("print 7")); printViewerList.add(new PrintViewerResultListTo("print 8")); printViewerList.add(new PrintViewerResultListTo("print 9")); printViewerList.add(new PrintViewerResultListTo("print 10")); printViewerList.add(new PrintViewerResultListTo("print 11")); printViewerList.add(new PrintViewerResultListTo("print 12")); printViewerList.add(new PrintViewerResultListTo("print 13")); printViewerList.add(new PrintViewerResultListTo("print 14")); printViewerList.add(new PrintViewerResultListTo("print 15")); return printViewerList; } public void setInitForm(HtmlForm initForm) { this.initForm = initForm; } public List getPrintViewerList() { return printViewerList; } public void setPrintViewerList(List printViewerList) { this.printViewerList = printViewerList; } } PrintViewerResultListTo.java public class PrintViewerResultListTo { private String printName; PrintViewerResultListTo(String printName) { this.printName = printName; } public String getPrintName() { return printName; } public void setPrintName(String printName) { this.printName = printName; } } I hope help me about this. Thanks in advance.

    Read the article

  • How to set cursor focus onload?

    - by eswaramoorthy-nec
    Hi, I use h:selectOneRadio tag. I need to set the cursor focus to first radio field. <f:view> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> </head> <body> <h:form id="focusForm" > <h:selectOneRadio id="testRadioId" value=""> <f:selectItem id="si1" itemLabel="JSF" /> <f:selectItem id="si2" itemLabel="JSP" /> </h:selectOneRadio> </h:form> </body></html></f:view> here The Firefox (browser) assign id :focusForm:testRadioId:0 that field. So i use the following script: document.getElementById("focusForm:testRadioId:0").focus(); But, Some times, i may change dynamically disable the radio field from backing bean. <h:selectOneRadio id="testRadioId" value=""> <f:selectItem id="si1" itemLabel="JSF" itemDisabled="true"/> <f:selectItem id="si2" itemLabel="JSP" /> </h:selectOneRadio> So here i disable the first radio button. Now, If i use the same script, then not set cursor focus to first radio field. how to handle this? that means how to alter my script dynamically during onload? Please help me. Thanks in advance.

    Read the article

  • jQuery not support rich:hotKey in jsf tag

    - by eswaramoorthy-nec
    Hi, i have used rich:hotKey for h:inputText in my jsp page. And also i wrote jQuery for get the textBox value. When i use jquery, that time rich:kotKey not worked sample.jsp <%@page contentType="text/html" pageEncoding="UTF-8"%> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> <%@ taglib uri="http://richfaces.org/a4j" prefix="a4j" %> <%@ taglib uri="http://richfaces.org/rich" prefix="rich"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <f:view> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>JSP Page</title> <script type="text/javascript" src="../../resource/js/jquery.min.js"/> <script type="text/javascript"> function typedName() { //Get The value using styleClass id var userName = jQuery.trim($('.textBox').val()); alert("Name is : " + userName); } // If i am not use above typedName() script and load src, then // the following testButton() clicked script perfectly worked. function testButton() { alert("Test Button Clicked"); } </script> </head> <body> <h:form> <rich:panel> <h:outputText value="Enter your Name : "/> <h:inputText id="textBox" styleClass="textBox" value ="" />&nbsp; <a4j:commandButton id="nameButton" value="NameButton" onclick="typedName();"/><br> <a4j:commandButton id="testButton" value="TestButton" onclick="testButton();" /> <%--HotKey for text Box and focus to testButton --%> <rich:hotKey key="return" selector="#textBox" handler="#{rich:element('testButton')}.click(); event.stopPropagation();event.preventDefault(); return false;"/> </rich:panel> </h:form> </body> </f:view> If i am not include the jquery, then that time i hit the enter button from text box, then automatically called testButton() script. If i include the Jquery, then rich:hotkey not work. I am also Used , var $J = jQuery.noConflict(); . But this time also not work jQuery. I hope help me about this. Thanks for your effort.

    Read the article

  • How to stop page refresh when hit enter button from rich:inputNumberSpinner field?

    - by eswaramoorthy-nec
    Hi, I use rich:inputNumberSpinner tag. The problem is : I set cursor focus to inside of rich:inputNumberSpinner field, then i hit the enter button from my keyboard, that time page will be automatically refresh. But i don't need page refresh when i hit the enter button from my keyboard. The code : spinnerTagTest.jsp <%@page contentType="text/html" pageEncoding="UTF-8"%> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> <%@ taglib uri="http://richfaces.org/a4j" prefix="a4j" %> <%@ taglib uri="http://richfaces.org/rich" prefix="rich"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <f:view> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Spinner Tag Test</title> </head> <body> <h:form id="SpinnerForm"> <rich:panel id="SpinnerPanel"> <h:outputText value="Input Spinner Tag : "/> <rich:inputNumberSpinner id="spinnerField" value="" maxValue="23" inputSize="2"/> </rich:panel> </h:form> </body> I also use rich:hotKey for that inputNumberSpinner field. But Page refreshed. <rich:hotKey key="return" selector="#spinnerField" handler="event.stopPropagation();event.preventDefault(); return false;"/> And i check anotherway using javasccript, but page refreshed. The specific tag and javascript is : <rich:inputNumberSpinner id="spinnerField" value="" maxValue="23" inputSize="2" oninputkeypress="return stopPageRefresh();"/> <script type="text/javascript"> function stopPageRefresh() { return false; } </script> Here i use one alert message inside of stopPageRefresh(). But i hit enter button, first page refreshing and then alert message displayed. Help me about this. Thanks in advance.

    Read the article

  • Hard wrapping in vim without joining

    - by Miles
    Vim newbie here. How can I hard wrap plain text in vim (inserting actual linebreaks), respecting word boundaries, without joining existing lines? For example, given this: Lorem ipsum dolor sit amet, consectetur adipiscing elit. - Nulla cursus accumsan faucibus. - Donec dapibus dignissim ullamcorper. Integer nec malesuada diam. I'd like to get (with textwidth=30): Lorem ipsum dolor sit amet, consectetur adipiscing elit. - Nulla cursus accumsan faucibus. - Donec dapibus dignissim ullamcorper. Integer nec malesuada diam. instead of this (which I can get with gggqG) Lorem ipsum dolor sit amet, consectetur adipiscing elit. - Nulla cursus accumsan faucibus. - Donec dapibus dignissim ullamcorper. Integer nec malesuada diam. Also, for bonus points: when I create a brand new buffer, I get different wrapping behavior (lines beginning with - aren't wrapped specially) than when I open a file ending in .txt. What controls this? I don't notice any difference in the output of :set filetype? or :filetype.

    Read the article

  • Vim, LaTeX, and version controlI

    - by Bkkbrad
    I'm writing a LaTeX document in vim, and I have it hard wrapping at 80 characters to make reading easier. However, this causes problems with tracking changes with in version control. For example, inserting "Lorem ipsum" at the beginning of this text: 1 Dolor sit amet, consectetur adipiscing elit. Phasellus bibendum lobortis lectus 2 quis porta. Aenean vestibulum magna vel purus laoreet at molestie massa 3 suscipit. Vestibulum vestibulum, mauris nec convallis ultrices, tellus sapien 4 ullamcorper elit, dignissim consectetur justo tellus et nunc. results in: 1 Lorum ipsum dolor sit amet, consectetur adipiscing elit. Phasellus bibendum 2 lobortis lectus quis porta. Aenean vestibulum magna vel purus laoreet at 3 molestie massa suscipit. Vestibulum vestibulum, mauris nec convallis ultrices, 4 tellus sapien ullamcorper elit, dignissim consectetur justo tellus et nunc. When I review this change in git, it tells me that all the lines of the paragraph have changed because of the wrapping, even though only one semantic change has occurred. One way around this problem is to have every sentence on its own line. This looks the same in the rendered document, but the source now is harder to read, because each line has quite a different line length: 1 Lorum ipsum dolor sit amet, consectetur adipiscing elit. 2 Phasellus bibendum lobortis lectus quis porta. 3 Aenean vestibulum magna vel purus laoreet at molestie massa suscipit. 4 Vestibulum vestibulum, mauris nec convallis ultrices, tellus sapien ullamcorper elit, dignissim consectetur justo tellus et nunc. (If I soft wrap at 80, things still look bad, just in a different way.) Is it possible to have my text on disk with one newline per sentence, but display and edit it in vim as if the text of each paragraph was one long line, soft wrapped at 80 characters? I assume it requires some vim-foo rather than tweaking git or LaTeX.

    Read the article

  • Vim, LaTeX, word-wrapping, and version control

    - by Bkkbrad
    I'm writing a LaTeX document in vim, and I have it hard wrapping at 80 characters to make reading easier. However, this causes problems with tracking changes with in version control. For example, inserting "Lorem ipsum" at the beginning of this text: 1 Dolor sit amet, consectetur adipiscing elit. Phasellus bibendum lobortis lectus 2 quis porta. Aenean vestibulum magna vel purus laoreet at molestie massa 3 suscipit. Vestibulum vestibulum, mauris nec convallis ultrices, tellus sapien 4 ullamcorper elit, dignissim consectetur justo tellus et nunc. results in: 1 Lorum ipsum dolor sit amet, consectetur adipiscing elit. Phasellus bibendum 2 lobortis lectus quis porta. Aenean vestibulum magna vel purus laoreet at 3 molestie massa suscipit. Vestibulum vestibulum, mauris nec convallis ultrices, 4 tellus sapien ullamcorper elit, dignissim consectetur justo tellus et nunc. When I review this change in git, it tells me that all the lines of the paragraph have changed because of the wrapping, even though only one semantic change has occurred. One way around this problem is to have every sentence on its own line. This looks the same in the rendered document, but the source now is harder to read, because each line has quite a different line length: 1 Lorum ipsum dolor sit amet, consectetur adipiscing elit. 2 Phasellus bibendum lobortis lectus quis porta. 3 Aenean vestibulum magna vel purus laoreet at molestie massa suscipit. 4 Vestibulum vestibulum, mauris nec convallis ultrices, tellus sapien ullamcorper elit, dignissim consectetur justo tellus et nunc. (If I soft wrap at 80, things still look bad, just in a different way.) Is it possible to have my text on disk with one newline per sentence, but display and edit it in vim as if the text of each paragraph was one long line, soft wrapped at 80 characters? I assume it requires some vim-foo rather than tweaking git or LaTeX.

    Read the article

  • How do I make Linux recognize a new SATA /dev/sda drive I hot swapped in without rebooting?

    - by Philip Durbin
    Hot swapping out a failed SATA /dev/sda drive worked fine, but when I went to swap in a new drive, it wasn't recognized: [root@fs-2 ~]# tail -18 /var/log/messages May 5 16:54:35 fs-2 kernel: ata1: exception Emask 0x10 SAct 0x0 SErr 0x50000 action 0xe frozen May 5 16:54:35 fs-2 kernel: ata1: SError: { PHYRdyChg CommWake } May 5 16:54:40 fs-2 kernel: ata1: link is slow to respond, please be patient (ready=0) May 5 16:54:45 fs-2 kernel: ata1: device not ready (errno=-16), forcing hardreset May 5 16:54:45 fs-2 kernel: ata1: soft resetting link May 5 16:54:50 fs-2 kernel: ata1: link is slow to respond, please be patient (ready=0) May 5 16:54:55 fs-2 kernel: ata1: SRST failed (errno=-16) May 5 16:54:55 fs-2 kernel: ata1: soft resetting link May 5 16:55:00 fs-2 kernel: ata1: link is slow to respond, please be patient (ready=0) May 5 16:55:05 fs-2 kernel: ata1: SRST failed (errno=-16) May 5 16:55:05 fs-2 kernel: ata1: soft resetting link May 5 16:55:10 fs-2 kernel: ata1: link is slow to respond, please be patient (ready=0) May 5 16:55:40 fs-2 kernel: ata1: SRST failed (errno=-16) May 5 16:55:40 fs-2 kernel: ata1: limiting SATA link speed to 1.5 Gbps May 5 16:55:40 fs-2 kernel: ata1: soft resetting link May 5 16:55:45 fs-2 kernel: ata1: SRST failed (errno=-16) May 5 16:55:45 fs-2 kernel: ata1: reset failed, giving up May 5 16:55:45 fs-2 kernel: ata1: EH complete I tried a couple things to make the server find the new /dev/sda, such as rescan-scsi-bus.sh but they didn't work: [root@fs-2 ~]# echo "---" > /sys/class/scsi_host/host0/scan -bash: echo: write error: Invalid argument [root@fs-2 ~]# [root@fs-2 ~]# /root/rescan-scsi-bus.sh -l [snip] 0 new device(s) found. 0 device(s) removed. [root@fs-2 ~]# [root@fs-2 ~]# ls /dev/sda ls: /dev/sda: No such file or directory I ended up rebooting the server. /dev/sda was recognized, I fixed the software RAID, and everything is fine now. But for next time, how can I make Linux recognize a new SATA drive I have hot swapped in without rebooting? The operating system in question is RHEL5.3: [root@fs-2 ~]# cat /etc/redhat-release Red Hat Enterprise Linux Server release 5.3 (Tikanga) The hard drive is a Seagate Barracuda ES.2 SATA 3.0-Gb/s 500-GB, model ST3500320NS. Here is the lscpi output: [root@fs-2 ~]# lspci 00:00.0 RAM memory: nVidia Corporation MCP55 Memory Controller (rev a2) 00:01.0 ISA bridge: nVidia Corporation MCP55 LPC Bridge (rev a3) 00:01.1 SMBus: nVidia Corporation MCP55 SMBus (rev a3) 00:02.0 USB Controller: nVidia Corporation MCP55 USB Controller (rev a1) 00:02.1 USB Controller: nVidia Corporation MCP55 USB Controller (rev a2) 00:04.0 IDE interface: nVidia Corporation MCP55 IDE (rev a1) 00:05.0 IDE interface: nVidia Corporation MCP55 SATA Controller (rev a3) 00:05.1 IDE interface: nVidia Corporation MCP55 SATA Controller (rev a3) 00:05.2 IDE interface: nVidia Corporation MCP55 SATA Controller (rev a3) 00:06.0 PCI bridge: nVidia Corporation MCP55 PCI bridge (rev a2) 00:08.0 Bridge: nVidia Corporation MCP55 Ethernet (rev a3) 00:09.0 Bridge: nVidia Corporation MCP55 Ethernet (rev a3) 00:0a.0 PCI bridge: nVidia Corporation MCP55 PCI Express bridge (rev a3) 00:0b.0 PCI bridge: nVidia Corporation MCP55 PCI Express bridge (rev a3) 00:0c.0 PCI bridge: nVidia Corporation MCP55 PCI Express bridge (rev a3) 00:0d.0 PCI bridge: nVidia Corporation MCP55 PCI Express bridge (rev a3) 00:0e.0 PCI bridge: nVidia Corporation MCP55 PCI Express bridge (rev a3) 00:0f.0 PCI bridge: nVidia Corporation MCP55 PCI Express bridge (rev a3) 00:18.0 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] HyperTransport Technology Configuration 00:18.1 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Address Map 00:18.2 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] DRAM Controller 00:18.3 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Miscellaneous Control 00:19.0 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] HyperTransport Technology Configuration 00:19.1 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Address Map 00:19.2 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] DRAM Controller 00:19.3 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Miscellaneous Control 03:00.0 VGA compatible controller: Matrox Graphics, Inc. MGA G200e [Pilot] ServerEngines (SEP1) (rev 02) 04:00.0 PCI bridge: NEC Corporation uPD720400 PCI Express - PCI/PCI-X Bridge (rev 06) 04:00.1 PCI bridge: NEC Corporation uPD720400 PCI Express - PCI/PCI-X Bridge (rev 06) Update: In perhaps a dozen cases, we've been forced to reboot servers because hot swap hasn't "just worked." Thanks for the answers to look more into the SATA controller. I've included the lspci output for the problematic system above (hostname: fs-2). I could still use some help understanding what exactly isn't supported hardware-wise in terms of hot swap for that system. Please let me know what other output besides lspci might be useful. The good news is that hot swap "just worked" today on one of our servers (hostname: www-1), which is very rare for us. Here is the lspci output: [root@www-1 ~]# lspci 00:00.0 RAM memory: nVidia Corporation MCP55 Memory Controller (rev a2) 00:01.0 ISA bridge: nVidia Corporation MCP55 LPC Bridge (rev a3) 00:01.1 SMBus: nVidia Corporation MCP55 SMBus (rev a3) 00:02.0 USB Controller: nVidia Corporation MCP55 USB Controller (rev a1) 00:02.1 USB Controller: nVidia Corporation MCP55 USB Controller (rev a2) 00:04.0 IDE interface: nVidia Corporation MCP55 IDE (rev a1) 00:05.0 IDE interface: nVidia Corporation MCP55 SATA Controller (rev a3) 00:05.1 IDE interface: nVidia Corporation MCP55 SATA Controller (rev a3) 00:05.2 IDE interface: nVidia Corporation MCP55 SATA Controller (rev a3) 00:06.0 PCI bridge: nVidia Corporation MCP55 PCI bridge (rev a2) 00:08.0 Bridge: nVidia Corporation MCP55 Ethernet (rev a3) 00:09.0 Bridge: nVidia Corporation MCP55 Ethernet (rev a3) 00:0b.0 PCI bridge: nVidia Corporation MCP55 PCI Express bridge (rev a3) 00:0c.0 PCI bridge: nVidia Corporation MCP55 PCI Express bridge (rev a3) 00:0f.0 PCI bridge: nVidia Corporation MCP55 PCI Express bridge (rev a3) 00:18.0 Host bridge: Advanced Micro Devices [AMD] K10 [Opteron, Athlon64, Sempron] HyperTransport Configuration 00:18.1 Host bridge: Advanced Micro Devices [AMD] K10 [Opteron, Athlon64, Sempron] Address Map 00:18.2 Host bridge: Advanced Micro Devices [AMD] K10 [Opteron, Athlon64, Sempron] DRAM Controller 00:18.3 Host bridge: Advanced Micro Devices [AMD] K10 [Opteron, Athlon64, Sempron] Miscellaneous Control 00:18.4 Host bridge: Advanced Micro Devices [AMD] K10 [Opteron, Athlon64, Sempron] Link Control 00:19.0 Host bridge: Advanced Micro Devices [AMD] K10 [Opteron, Athlon64, Sempron] HyperTransport Configuration 00:19.1 Host bridge: Advanced Micro Devices [AMD] K10 [Opteron, Athlon64, Sempron] Address Map 00:19.2 Host bridge: Advanced Micro Devices [AMD] K10 [Opteron, Athlon64, Sempron] DRAM Controller 00:19.3 Host bridge: Advanced Micro Devices [AMD] K10 [Opteron, Athlon64, Sempron] Miscellaneous Control 00:19.4 Host bridge: Advanced Micro Devices [AMD] K10 [Opteron, Athlon64, Sempron] Link Control 03:00.0 VGA compatible controller: Matrox Graphics, Inc. MGA G200e [Pilot] ServerEngines (SEP1) (rev 02) 04:00.0 PCI bridge: NEC Corporation uPD720400 PCI Express - PCI/PCI-X Bridge (rev 06) 04:00.1 PCI bridge: NEC Corporation uPD720400 PCI Express - PCI/PCI-X Bridge (rev 06) 09:00.0 SCSI storage controller: LSI Logic / Symbios Logic SAS1064ET PCI-Express Fusion-MPT SAS (rev 04)

    Read the article

  • How do I make Linux recognize a new SATA /dev/sda drive I hot swapped in without rebooting?

    - by Philip Durbin
    Hot swapping out a failed SATA /dev/sda drive worked fine, but when I went to swap in a new drive, it wasn't recognized: [root@fs-2 ~]# tail -18 /var/log/messages May 5 16:54:35 fs-2 kernel: ata1: exception Emask 0x10 SAct 0x0 SErr 0x50000 action 0xe frozen May 5 16:54:35 fs-2 kernel: ata1: SError: { PHYRdyChg CommWake } May 5 16:54:40 fs-2 kernel: ata1: link is slow to respond, please be patient (ready=0) May 5 16:54:45 fs-2 kernel: ata1: device not ready (errno=-16), forcing hardreset May 5 16:54:45 fs-2 kernel: ata1: soft resetting link May 5 16:54:50 fs-2 kernel: ata1: link is slow to respond, please be patient (ready=0) May 5 16:54:55 fs-2 kernel: ata1: SRST failed (errno=-16) May 5 16:54:55 fs-2 kernel: ata1: soft resetting link May 5 16:55:00 fs-2 kernel: ata1: link is slow to respond, please be patient (ready=0) May 5 16:55:05 fs-2 kernel: ata1: SRST failed (errno=-16) May 5 16:55:05 fs-2 kernel: ata1: soft resetting link May 5 16:55:10 fs-2 kernel: ata1: link is slow to respond, please be patient (ready=0) May 5 16:55:40 fs-2 kernel: ata1: SRST failed (errno=-16) May 5 16:55:40 fs-2 kernel: ata1: limiting SATA link speed to 1.5 Gbps May 5 16:55:40 fs-2 kernel: ata1: soft resetting link May 5 16:55:45 fs-2 kernel: ata1: SRST failed (errno=-16) May 5 16:55:45 fs-2 kernel: ata1: reset failed, giving up May 5 16:55:45 fs-2 kernel: ata1: EH complete I tried a couple things to make the server find the new /dev/sda, such as rescan-scsi-bus.sh but they didn't work: [root@fs-2 ~]# echo "---" > /sys/class/scsi_host/host0/scan -bash: echo: write error: Invalid argument [root@fs-2 ~]# [root@fs-2 ~]# /root/rescan-scsi-bus.sh -l [snip] 0 new device(s) found. 0 device(s) removed. [root@fs-2 ~]# [root@fs-2 ~]# ls /dev/sda ls: /dev/sda: No such file or directory I ended up rebooting the server. /dev/sda was recognized, I fixed the software RAID, and everything is fine now. But for next time, how can I make Linux recognize a new SATA drive I have hot swapped in without rebooting? The operating system in question is RHEL5.3: [root@fs-2 ~]# cat /etc/redhat-release Red Hat Enterprise Linux Server release 5.3 (Tikanga) The hard drive is a Seagate Barracuda ES.2 SATA 3.0-Gb/s 500-GB, model ST3500320NS. Here is the lscpi output: [root@fs-2 ~]# lspci 00:00.0 RAM memory: nVidia Corporation MCP55 Memory Controller (rev a2) 00:01.0 ISA bridge: nVidia Corporation MCP55 LPC Bridge (rev a3) 00:01.1 SMBus: nVidia Corporation MCP55 SMBus (rev a3) 00:02.0 USB Controller: nVidia Corporation MCP55 USB Controller (rev a1) 00:02.1 USB Controller: nVidia Corporation MCP55 USB Controller (rev a2) 00:04.0 IDE interface: nVidia Corporation MCP55 IDE (rev a1) 00:05.0 IDE interface: nVidia Corporation MCP55 SATA Controller (rev a3) 00:05.1 IDE interface: nVidia Corporation MCP55 SATA Controller (rev a3) 00:05.2 IDE interface: nVidia Corporation MCP55 SATA Controller (rev a3) 00:06.0 PCI bridge: nVidia Corporation MCP55 PCI bridge (rev a2) 00:08.0 Bridge: nVidia Corporation MCP55 Ethernet (rev a3) 00:09.0 Bridge: nVidia Corporation MCP55 Ethernet (rev a3) 00:0a.0 PCI bridge: nVidia Corporation MCP55 PCI Express bridge (rev a3) 00:0b.0 PCI bridge: nVidia Corporation MCP55 PCI Express bridge (rev a3) 00:0c.0 PCI bridge: nVidia Corporation MCP55 PCI Express bridge (rev a3) 00:0d.0 PCI bridge: nVidia Corporation MCP55 PCI Express bridge (rev a3) 00:0e.0 PCI bridge: nVidia Corporation MCP55 PCI Express bridge (rev a3) 00:0f.0 PCI bridge: nVidia Corporation MCP55 PCI Express bridge (rev a3) 00:18.0 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] HyperTransport Technology Configuration 00:18.1 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Address Map 00:18.2 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] DRAM Controller 00:18.3 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Miscellaneous Control 00:19.0 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] HyperTransport Technology Configuration 00:19.1 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Address Map 00:19.2 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] DRAM Controller 00:19.3 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Miscellaneous Control 03:00.0 VGA compatible controller: Matrox Graphics, Inc. MGA G200e [Pilot] ServerEngines (SEP1) (rev 02) 04:00.0 PCI bridge: NEC Corporation uPD720400 PCI Express - PCI/PCI-X Bridge (rev 06) 04:00.1 PCI bridge: NEC Corporation uPD720400 PCI Express - PCI/PCI-X Bridge (rev 06) Update: In perhaps a dozen cases, we've been forced to reboot servers because hot swap hasn't "just worked." Thanks for the answers to look more into the SATA controller. I've included the lspci output for the problematic system above (hostname: fs-2). I could still use some help understanding what exactly isn't supported hardware-wise in terms of hot swap for that system. Please let me know what other output besides lspci might be useful. The good news is that hot swap "just worked" today on one of our servers (hostname: www-1), which is very rare for us. Here is the lspci output: [root@www-1 ~]# lspci 00:00.0 RAM memory: nVidia Corporation MCP55 Memory Controller (rev a2) 00:01.0 ISA bridge: nVidia Corporation MCP55 LPC Bridge (rev a3) 00:01.1 SMBus: nVidia Corporation MCP55 SMBus (rev a3) 00:02.0 USB Controller: nVidia Corporation MCP55 USB Controller (rev a1) 00:02.1 USB Controller: nVidia Corporation MCP55 USB Controller (rev a2) 00:04.0 IDE interface: nVidia Corporation MCP55 IDE (rev a1) 00:05.0 IDE interface: nVidia Corporation MCP55 SATA Controller (rev a3) 00:05.1 IDE interface: nVidia Corporation MCP55 SATA Controller (rev a3) 00:05.2 IDE interface: nVidia Corporation MCP55 SATA Controller (rev a3) 00:06.0 PCI bridge: nVidia Corporation MCP55 PCI bridge (rev a2) 00:08.0 Bridge: nVidia Corporation MCP55 Ethernet (rev a3) 00:09.0 Bridge: nVidia Corporation MCP55 Ethernet (rev a3) 00:0b.0 PCI bridge: nVidia Corporation MCP55 PCI Express bridge (rev a3) 00:0c.0 PCI bridge: nVidia Corporation MCP55 PCI Express bridge (rev a3) 00:0f.0 PCI bridge: nVidia Corporation MCP55 PCI Express bridge (rev a3) 00:18.0 Host bridge: Advanced Micro Devices [AMD] K10 [Opteron, Athlon64, Sempron] HyperTransport Configuration 00:18.1 Host bridge: Advanced Micro Devices [AMD] K10 [Opteron, Athlon64, Sempron] Address Map 00:18.2 Host bridge: Advanced Micro Devices [AMD] K10 [Opteron, Athlon64, Sempron] DRAM Controller 00:18.3 Host bridge: Advanced Micro Devices [AMD] K10 [Opteron, Athlon64, Sempron] Miscellaneous Control 00:18.4 Host bridge: Advanced Micro Devices [AMD] K10 [Opteron, Athlon64, Sempron] Link Control 00:19.0 Host bridge: Advanced Micro Devices [AMD] K10 [Opteron, Athlon64, Sempron] HyperTransport Configuration 00:19.1 Host bridge: Advanced Micro Devices [AMD] K10 [Opteron, Athlon64, Sempron] Address Map 00:19.2 Host bridge: Advanced Micro Devices [AMD] K10 [Opteron, Athlon64, Sempron] DRAM Controller 00:19.3 Host bridge: Advanced Micro Devices [AMD] K10 [Opteron, Athlon64, Sempron] Miscellaneous Control 00:19.4 Host bridge: Advanced Micro Devices [AMD] K10 [Opteron, Athlon64, Sempron] Link Control 03:00.0 VGA compatible controller: Matrox Graphics, Inc. MGA G200e [Pilot] ServerEngines (SEP1) (rev 02) 04:00.0 PCI bridge: NEC Corporation uPD720400 PCI Express - PCI/PCI-X Bridge (rev 06) 04:00.1 PCI bridge: NEC Corporation uPD720400 PCI Express - PCI/PCI-X Bridge (rev 06) 09:00.0 SCSI storage controller: LSI Logic / Symbios Logic SAS1064ET PCI-Express Fusion-MPT SAS (rev 04)

    Read the article

  • Lenovo t400 laptop docking station with DVI out shows green artifacts when connected to monitor

    - by Roy Rico
    I have a Lenovo T400 laptop, with Windows XP. I have a docking station connected via DVI to my Samnsung monitor. I'm connected at 1920x1200 resolution and I keep seeing all these green dots (when colors are supposed to be near black). It's really bad. I have tried running on my Samsung monitor, at all sizes, even down town 1280x1024 like my monitors at work. When I use the docking station at work, I am able to connect 2 1280x1024 NEC monitors (one via DVI, one through VGA, both through my docking station). I have absolutely no issue there, both displays work great. I have tried to update the drivers, I've even installed the latest video drivers from lenovo's site (DEC-02-2010). Is anyone familiar with this issue? Details: Docking Station: Lenovo Advanced Mini Dock- 250410U - NIB Montior at home: Samsung T240 24-inch monitor Monitors at work: NEC monitors

    Read the article

  • graphic error on console

    - by Christian Elsner
    I have Linux on an embedded system. There is no graphic system, but I still have graphic errors. For example, if I type: ifconfig eth2 hw ether 00:0e:8c:d0:59:d2 I see: ifconfig eth hw ether 00:0e:8:2:2 If I type Enter, it accepts the command I typed, so it's just a matter of displaying. Everything is fine, when I log in via SSH. Anyone any ideas, what could be the cause or where to look at? Output of lspci: 00:00.0 Host bridge: Intel Corporation 3100 Chipset Memory I/O Controller Hub 00:00.1 Unassigned class [ff00]: Intel Corporation 3100 DRAM Controller Error Reporting Registers 00:01.0 System peripheral: Intel Corporation 3100 Chipset Enhanced DMA Controller 00:02.0 PCI bridge: Intel Corporation 3100 Chipset PCI Express Port A 00:03.0 PCI bridge: Intel Corporation 3100 Chipset PCI Express Port A1 00:1c.0 PCI bridge: Intel Corporation 631xESB/632xESB/3100 Chipset PCI Express Root Port 1 (rev 01) 00:1c.1 PCI bridge: Intel Corporation 631xESB/632xESB/3100 Chipset PCI Express Root Port 2 (rev 01) 00:1d.0 USB Controller: Intel Corporation 631xESB/632xESB/3100 Chipset UHCI USB Controller #1 (rev 01) 00:1d.1 USB Controller: Intel Corporation 631xESB/632xESB/3100 Chipset UHCI USB Controller #2 (rev 01) 00:1d.7 USB Controller: Intel Corporation 631xESB/632xESB/3100 Chipset EHCI USB2 Controller (rev 01) 00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev c9) 00:1f.0 ISA bridge: Intel Corporation 631xESB/632xESB/3100 Chipset LPC Interface Controller (rev 01) 00:1f.2 IDE interface: Intel Corporation 631xESB/632xESB/3100 Chipset SATA IDE Controller (rev 01) 00:1f.3 SMBus: Intel Corporation 631xESB/632xESB/3100 Chipset SMBus Controller (rev 01) 02:00.0 Ethernet controller: Intel Corporation 82574L Gigabit Network Connection 03:01.0 Network controller: Siemens Nixdorf AG Device 4003 (rev 02) 03:01.1 Unassigned class [ff00]: Siemens Nixdorf AG Device 4003 (rev 02) 03:02.0 Ethernet controller: Siemens Nixdorf AG Device 4047 (rev 01) 03:03.0 Ethernet controller: National Semiconductor Corporation DP83815 (MacPhyter) Ethernet Controller 03:04.0 Unassigned class [ff00]: Siemens Nixdorf AG Device 4057 (rev 01) 04:00.0 PCI bridge: Texas Instruments XIO2000(A)/XIO2200(A) PCI Express-to-PCI Bridge (rev 03) 05:00.0 Ethernet controller: Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE] (rev 44) 06:00.0 PCI bridge: Texas Instruments XIO2000(A)/XIO2200(A) PCI Express-to-PCI Bridge (rev 03) 07:00.0 VGA compatible controller: Silicon Motion, Inc. SM720 Lynx3DM (rev c1) 07:01.0 USB Controller: NEC Corporation USB (rev 43) 07:01.1 USB Controller: NEC Corporation USB (rev 43) 07:01.2 USB Controller: NEC Corporation USB 2.0 (rev 04) The whole thing is running on an Intel Core 2 Duo U2500

    Read the article

  • IE 6 and 7 background inheritance problem, how do I solve this?

    - by Evilalan
    When I'm trying to create a rounded shaded box it works fine on FF and IE8 but on IE6 and IE7, any div inside the box gets the last background but if you set that all divs on the level where there should not be a background have background:none it doesn't show any background on the level that comes before *The code is pointing to live images on Image Shack so you can save and run that it will work normally on Firefox but you can see what happen on IE6/7. Also I can't give a specific class for the intens inside the containet "background" because it's a CMS that I'm trying to style! the code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Problem With IE6 and 7</title> <style type="text/css"> * {padding:0px; margin:0px auto;} body {font-family:Verdana, Geneva, sans-serif; color:#666; font-size:14px; text-align:justify;} .background {width:300px;} .background div {background:url(http://img6.imageshack.us/img6/5763/76022084.png) repeat-y;} .background div div {background:url(http://img253.imageshack.us/img253/444/97936614.png) top left no-repeat;} .background div div div {background:url(http://img13.imageshack.us/img13/3667/45918712.png) bottom left no-repeat;} .background div div div div {padding:15px; background:none;} </style> </head> <body> <div class="background"> <div><div><div><div> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis ut sagittis nisl. Nullam facilisis volutpat metus eu semper. Sed eleifend, mi sed rhoncus interdum, neque quam pellentesque diam, in tincidunt metus nulla in ligula. Donec dui tellus, ultricies vel venenatis vitae, aliquam et purus. Cras eu nunc urna, in placerat quam. Pellentesque lobortis pellentesque orci, a tempus diam consequat nec. Aliquam erat volutpat. Aliquam laoreet blandit tellus in mollis. Duis tincidunt, justo sit amet lacinia ultrices, nibh justo venenatis erat, non commodo libero ligula quis ante. Cras eget nulla nec est accumsan porttitor at euismod nulla. Integer pharetra lacinia malesuada. Donec commodo vestibulum est, eget pellentesque velit volutpat nec. In id erat nec ipsum consequat convallis id non libero. Sed dui nisl, molestie vel dignissim sed, mattis in est. Vestibulum porttitor posuere ipsum, id facilisis libero dapibus et. Fusce consequat malesuada nulla, vitae faucibus neque consectetur eget. Curabitur porta dapibus justo dictum porttitor. Curabitur facilisis faucibus diam, vel dapibus ipsum ornare sed. Vestibulum turpis nulla, facilisis condimentum sodales sed, imperdiet placerat mi. Cras ac risus ipsum. </p> </div></div></div> </div><!-- class background end here --> </body> </html>

    Read the article

  • Auto-Suggest via &lsquo;Trie&rsquo; (Pre-fix Tree)

    - by Strenium
    Auto-Suggest (Auto-Complete) “thing” has been around for a few years. Here’s my little snippet on the subject. For one of my projects, I had to deal with a non-trivial set of items to be pulled via auto-suggest used by multiple concurrent users. Simple, dumb iteration through a list in local cache or back-end access didn’t quite cut it. Enter a nifty little structure, perfectly suited for storing and matching verbal data: “Trie” (http://tinyurl.com/db56g) also known as a Pre-fix Tree: “Unlike a binary search tree, no node in the tree stores the key associated with that node; instead, its position in the tree defines the key with which it is associated. All the descendants of a node have a common prefix of the string associated with that node, and the root is associated with the empty string. Values are normally not associated with every node, only with leaves and some inner nodes that correspond to keys of interest.” This is a very scalable, performing structure. Though, as usual, something ‘fast’ comes at a cost of ‘size’; fortunately RAM is more plentiful today so I can live with that. I won’t bore you with the detailed algorithmic performance here - Google can do a better job of such. So, here’s C# implementation of all this. Let’s start with individual node: Trie Node /// <summary> /// Contains datum of a single trie node. /// </summary> public class AutoSuggestTrieNode {     public char Value { get; set; }       /// <summary>     /// Gets a value indicating whether this instance is leaf node.     /// </summary>     /// <value>     ///     <c>true</c> if this instance is leaf node; otherwise, a prefix node <c>false</c>.     /// </value>     public bool IsLeafNode { get; private set; }       public List<AutoSuggestTrieNode> DescendantNodes { get; private set; }         /// <summary>     /// Initializes a new instance of the <see cref="AutoSuggestTrieNode"/> class.     /// </summary>     /// <param name="value">The phonetic value.</param>     /// <param name="isLeafNode">if set to <c>true</c> [is leaf node].</param>     public AutoSuggestTrieNode(char value = ' ', bool isLeafNode = false)     {         Value = value;         IsLeafNode = isLeafNode;           DescendantNodes = new List<AutoSuggestTrieNode>();     }       /// <summary>     /// Gets the descendants of the pre-fix node, if any.     /// </summary>     /// <param name="descendantValue">The descendant value.</param>     /// <returns></returns>     public AutoSuggestTrieNode GetDescendant(char descendantValue)     {         return DescendantNodes.FirstOrDefault(descendant => descendant.Value == descendantValue);     } }   Quite self-explanatory, imho. A node is either a “Pre-fix” or a “Leaf” node. “Leaf” contains the full “word”, while the “Pre-fix” nodes act as indices used for matching the results.   Ok, now the Trie: Trie Structure /// <summary> /// Contains structure and functionality of an AutoSuggest Trie (Pre-fix Tree) /// </summary> public class AutoSuggestTrie {     private readonly AutoSuggestTrieNode _root = new AutoSuggestTrieNode();       /// <summary>     /// Adds the word to the trie by breaking it up to pre-fix nodes + leaf node.     /// </summary>     /// <param name="word">Phonetic value.</param>     public void AddWord(string word)     {         var currentNode = _root;         word = word.Trim().ToLower();           for (int i = 0; i < word.Length; i++)         {             var child = currentNode.GetDescendant(word[i]);               if (child == null) /* this character hasn't yet been indexed in the trie */             {                 var newNode = new AutoSuggestTrieNode(word[i], word.Count() - 1 == i);                   currentNode.DescendantNodes.Add(newNode);                 currentNode = newNode;             }             else                 currentNode = child; /* this character is already indexed, move down the trie */         }     }         /// <summary>     /// Gets the suggested matches.     /// </summary>     /// <param name="word">The phonetic search value.</param>     /// <returns></returns>     public List<string> GetSuggestedMatches(string word)     {         var currentNode = _root;         word = word.Trim().ToLower();           var indexedNodesValues = new StringBuilder();         var resultBag = new ConcurrentBag<string>();           for (int i = 0; i < word.Trim().Length; i++)  /* traverse the trie collecting closest indexed parent (parent can't be leaf, obviously) */         {             var child = currentNode.GetDescendant(word[i]);               if (child == null || word.Count() - 1 == i)                 break; /* done looking, the rest of the characters aren't indexed in the trie */               indexedNodesValues.Append(word[i]);             currentNode = child;         }           Action<AutoSuggestTrieNode, string> collectAllMatches = null;         collectAllMatches = (node, aggregatedValue) => /* traverse the trie collecting matching leafNodes (i.e. "full words") */             {                 if (node.IsLeafNode) /* full word */                     resultBag.Add(aggregatedValue); /* thread-safe write */                   Parallel.ForEach(node.DescendantNodes, descendandNode => /* asynchronous recursive traversal */                 {                     collectAllMatches(descendandNode, String.Format("{0}{1}", aggregatedValue, descendandNode.Value));                 });             };           collectAllMatches(currentNode, indexedNodesValues.ToString());           return resultBag.OrderBy(o => o).ToList();     }         /// <summary>     /// Gets the total words (leafs) in the trie. Recursive traversal.     /// </summary>     public int TotalWords     {         get         {             int runningCount = 0;               Action<AutoSuggestTrieNode> traverseAllDecendants = null;             traverseAllDecendants = n => { runningCount += n.DescendantNodes.Count(o => o.IsLeafNode); n.DescendantNodes.ForEach(traverseAllDecendants); };             traverseAllDecendants(this._root);               return runningCount;         }     } }   Matching operations and Inserts involve traversing the nodes before the right “spot” is found. Inserts need be synchronous since ordering of data matters here. However, matching can be done in parallel traversal using recursion (line 64). Here’s sample usage:   [TestMethod] public void AutoSuggestTest() {     var autoSuggestCache = new AutoSuggestTrie();       var testInput = @"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Praesent libero.                 Sed cursus ante dapibus diam. Sed nisi. Nulla quis sem at nibh elementum imperdiet. Duis sagittis ipsum. Praesent mauris.                 Fusce nec tellus sed augue semper porta. Mauris massa. Vestibulum lacinia arcu eget nulla. Class aptent taciti sociosqu ad                 litora torquent per conubia nostra, per inceptos himenaeos. Curabitur sodales ligula in libero. Sed dignissim lacinia nunc.                 Curabitur tortor. Pellentesque nibh. Aenean quam. In scelerisque sem at dolor. Maecenas mattis. Sed convallis tristique sem.                 Proin ut ligula vel nunc egestas porttitor. Morbi lectus risus, iaculis vel, suscipit quis, luctus non, massa. Fusce ac                 turpis quis ligula lacinia aliquet. Mauris ipsum. Nulla metus metus, ullamcorper vel, tincidunt sed, euismod in, nibh. Quisque                 volutpat condimentum velit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nam                 nec ante. Sed lacinia, urna non tincidunt mattis, tortor neque adipiscing diam, a cursus ipsum ante quis turpis. Nulla                 facilisi. Ut fringilla. Suspendisse potenti. Nunc feugiat mi a tellus consequat imperdiet. Vestibulum sapien. Proin quam. Etiam                 ultrices. Suspendisse in justo eu magna luctus suscipit. Sed lectus. Integer euismod lacus luctus magna. Quisque cursus, metus                 vitae pharetra auctor, sem massa mattis sem, at interdum magna augue eget diam. Vestibulum ante ipsum primis in faucibus orci                 luctus et ultrices posuere cubilia Curae; Morbi lacinia molestie dui. Praesent blandit dolor. Sed non quam. In vel mi sit amet                 augue congue elementum. Morbi in ipsum sit amet pede facilisis laoreet. Donec lacus nunc, viverra nec.";       testInput.Split(' ').ToList().ForEach(word => autoSuggestCache.AddWord(word));       var testMatches = autoSuggestCache.GetSuggestedMatches("le"); }   ..and the result: That’s it!

    Read the article

< Previous Page | 1 2 3 4 5 6  | Next Page >