Daily Archives

Articles indexed Saturday March 27 2010

Page 1/84 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Problem with Richfaces running with NGinx proxy

    - by Michael
    Hi, I got a problem with my Richfaces application. I am using it with JSF and GlassFish v.2 on my localhost and combination od dataTable and dataScroller works fine. While moving the app to the VPS running Tomcat but proxied by Nginx server, everything crashes. Exactly the scroller is working, but the dataTable view is not refreshed! I looked at responses with Firebug and figured out, that even on VPS the response contains 2nd page of the dataTable, but it is not shown on the screen. I tried everything - changing page attribute of dataScroller (it was taken from session bean, I changed that to request bean). I also removed page attribute from dataScroller - did not help either. Finally I added my table to reRender attribute of dataScroller - still whichever page I choose I am seeing only the first one. Does anyone even heard about such problem? I am going crazy with this. Best regards, Michael

    Read the article

  • Suggestions for displaying code on webpages, MUST use <br> for newline

    - by bguiz
    Hi, I want to post code snippets online (wordpress.com blog) - and have its whitespace formatted nicely. See the answers suggested by this other SO question: Those would be OK, except that I like to copy code to clip board or clip entire pages using Evernote - and they use either the <pre> tag or <table> (or both) to format the code. So I end up with text whose newlines and white spaces ignored, e.g. string url = "<a href=\"" + someObj.getUrl() + "\" target=\"_blank\">"; // single line comments // second single line override protected void OnLoad(EventArgs e) { if(Attributes["class"]&nbsp;!= null) { //_year.CssClass = _month.CssClass = _day.CssClass = Attributes["class"]; } base.OnLoad(e); } Which I find rather annoying myself. I find that if the code was formatted using <br> tags, they copy/ clip porperly, e.g. string url = "<a href=\"" + someObj.getUrl() + "\" target=\"_blank\">"; // single line comments // second single line override protected void OnLoad(EventArgs e) { if(Attributes["class"]&nbsp;!= null) { //_year.CssClass = _month.CssClass = _day.CssClass = Attributes["class"]; } base.OnLoad(e); } I find this annoying myself, so I don't want to inflict it upon others when I post my own code. Please suggest methods of posting code snippets online that are able to do this. I would like to emphasise that syntax highlighting capability is secondary to correct white space markup. Thank you

    Read the article

  • JS onclick triggers wrong object

    - by Clemens Prerovsky
    Hi guys, what I'm trying to do here is to associate a DOM object with an instance of a JS object, which will provide some meaningfol methods later on ;) At this point I just want to handle my JS object the click event, whilst keeping it's references intact. <?xml version="1.0" encoding="ISO-8859-1" ?> <!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=ISO-8859-1" /> <title>Insert title here</title> <script type="text/javascript"> // my object, which will hold a reference to a single DOM object obj = function(domobj) { this.o = domobj; my = this; var ref = my.click; this.o.onclick = ref; } // my objects click function obj.prototype.click = function() { alert(my.o.innerHTML); } // create objects with references $(document).ready(function() { o1 = new obj(document.getElementById('b1')); o2 = new obj(document.getElementById('b2')); }); </script> </head> <body> <button id="b1">button 1</button> <button id="b2">button 2</button> </body> </html> Expected result: when clicking on button 1, the text "button 1" should be alerted. Current result: when clicking button 1, the text "button 2" is alerted. What I found out so far is that the wrong instance of obj is triggered from the click event, even though o1 and o2 maintain correct references to their corresponding DOM object. Any ideas how to solve this? Thanks for your help! Best regards, Clemens

    Read the article

  • Which virtualization solutions are available for non-x86 platforms?

    - by asmaier
    Are their any virtualization solutions like Xen, KVM and VMWare ESX available for non-x86 platform? Especially I'm interested if there are solutions available or if Xen, KVM can be made to run on the platforms POWER5/6/7 PowerPC Itanium 64 NEC SX-8/9 Cray X2 BlueGene What are your experiences? Is it possible to virtualize GPUs like Nvidias Tesla/Fermi?

    Read the article

  • What is wrong with my PHP/MySQL code?

    - by James
    I am building a navigation menu which lists all my categories and subcategories. The problem is it returns only one of these and not all. I have the categories echoed inside the while loop so I'm not sure why it's only showing one result and not all: <?php $query = mysql_query("SELECT * FROM categories_parent"); while ($row = mysql_fetch_assoc($query)) { $id = $row['id']; $name = $row['name']; $slug = $row['slug']; $childStatus = $row['child_status']; // if has child categories if ($childStatus == "1") { echo "<li class='dir'><a href='category.php?slug=$slug'>$name</a>"; echo "<ul id='dropdown'>"; $query = mysql_query("SELECT * FROM categories_child WHERE parent=$id"); while ($row = mysql_fetch_assoc($query)) { $id = $row['id']; $name = $row['name']; $slug = $row['slug']; echo "<li><a href='category.php?slug=$slug'>$name</a></li>"; } echo "</ul>"; echo "</li>"; } // if singular parent else { echo "<li><a href='category.php?slug=$slug'>$name</a></li>"; } } ?> My database tables: -- -- Table structure for table `categories_child` -- CREATE TABLE IF NOT EXISTS `categories_child` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(1000) NOT NULL, `slug` varchar(1000) NOT NULL, `parent` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=139 ; -- -- Dumping data for table `categories_child` -- INSERT INTO `categories_child` (`id`, `name`, `slug`, `parent`) VALUES (138, 'Britney Spears', 'category/celiberties/britney-spears/', 137), (136, 'Tigers', 'category/animals/tigers/', 136), (137, 'Horses', 'category/animals/horses/', 136), (135, 'Lions', 'category/animals/lions/', 136); -- -- Table structure for table `categories_parent` -- CREATE TABLE IF NOT EXISTS `categories_parent` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(1000) NOT NULL, `slug` varchar(1000) NOT NULL, `child_status` int(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=139 ; -- -- Dumping data for table `categories_parent` -- INSERT INTO `categories_parent` (`id`, `name`, `slug`, `child_status`) VALUES (137, 'Celiberties', 'category/celiberties/', 1), (138, 'TV Shows', 'category/tv-shows/', 0), (136, 'Animals', 'category/animals/', 1);

    Read the article

  • (interactive) graph as in graph theory on a web page ?

    - by LB
    Hi, I have to integrate a graph with nodes and edges on a web page. Ideally, i would like to be able to interact with it (like moving the nodes around). Actually, i'm beginning by representing trees, so i would appreciate to be able to collapse subtrees. How can I do that ? I was considering google-visualization api but i wasn't able to find the kind of visualization i'm looking for (org chart doesn't allow to have multiple fathers, if i understood well) I've got no idea of the kind of technology so my tagging may not be really accurate :-). thanks

    Read the article

  • Silverlight Cream for March 26, 2010 -- #821

    - by Dave Campbell
    In this Issue: Max Paulousky, Christian Schormann, John Papa, Phani Raj, David Anson(-2-, -3-), Brad Abrams(-2-), and Jeff Wilcox(-2-, -3-). Shoutouts: Jeff Wilcox posted his material from mix and some preview TestFramework bits: Unit Testing Silverlight & Windows Phone Applications – talk now online At MIX10, Jeff Wilcox demo'd an app called "Peppermint"... here's the bleeding edge demo: “Peppermint” MIX demo sources Erik Mork and Co. have put out their weekly This Week In Silverlight 3.25.2010 Brad Abrams has all his materials posted for his MIX10 session Mix2010: Search Engine Optimization (SEO) for Microsoft Silverlight... including play-by-play of the demo and all source. Do you use Rooler? Well you should! Watch a video Pete Brown did with Pete Blois on Expression Blend, Windows Phone, Rooler Interested in Silverlight and XNA for WP7? Me too! Michael Klucher has a post outlining the two: Silverlight and XNA Framework Game Development and Compatibility From SilverlightCream.com: Modularity in Silverlight Applications - An Issue With ModuleInitializeException Max Paulousky has a truly ugly error trace listed by way of not having a reference listed, and the obvious simple solution. Next time he'll talk about the difficult situations. Using SketchFlow to Prototype for Windows Phone Christian Schormann has a tutorial up on using Expression Blend to develop for WP7 ... who better than Christian for that task?? Silverlight TV 18: WCF RIA Services Validation John Papa held forth with Nikhil Kothari on WCF RIA Services and validation just prior to MIX10, and was posted yesterday. Building SL3 applications using OData client Library with Vs 2010 RC Phani Raj walks through building an OData consumer in SL3, the first problem you're going to hit, and the easy solution to it. Tip: When creating a DependencyProperty, follow the handy convention of "wrapper+register+static+virtual" David Anson has a couple more of his 'Tips' up... this first is about Dependency Properties again... having a good foundation for all your Dependency Properties is a great way to avoid problems. Tip: Do not assign DependencyProperty values in a constructor; it prevents users from overriding them In the next post, David Anson talks about not assigning Dependency Property values in a constructor and gives one of the two ways to get around doing so. Tip: Set DependencyProperty default values in a class's default style if it's more convenient In his latest post, David Anson gives the second way to avoid setting a Dependency Property value in the constructor. Silverlight 4 + RIA Services - Ready for Business: Search Engine Optimization (SEO) Brad Abrams Abrams adds SEO to the tutorial series he's doing. He begins with his PDC09 session material on the subject and then takes off on a great detailed tutorial all with source. Silverlight 4 + RIA Services - Ready for Business: Localizing Business Application Brad Abrams then discusses localization and Silverlight in another detailed tutorial with all code included. Silverlight Toolkit and the Windows Phone: WrapPanel, and a few others Jeff Wilcox has a few WP7 posts I'm going to push today. This first is from earlier this week and is about using the Toolkit in WP7 and better than that, he includes the bits you need if all you want is the WrapPanel Data binding user settings in Windows Phone applications In the next one from yesterday, Jeff Wilcox demonstrates saving some user info in Isolated Storage to improve the user experience, and shares all the necessary plumbing files, and other external links as well. Displaying 2D QR barcodes in Windows Phone applications In a post from today, Jeff Wilcox ported his Silverlight 2D QR Barcode app from last year into WP7 ... just very cool... get the source and display your Microsoft Tag. Stay in the 'Light! Twitter SilverlightNews | Twitter WynApse | WynApse.com | Tagged Posts | SilverlightCream Join me @ SilverlightCream | Phoenix Silverlight User Group Technorati Tags: Silverlight    Silverlight 3    Silverlight 4    Windows Phone    MIX10

    Read the article

  • Exchange 2010 DAG Automatic Failover Testing/Issue. Not always automatically failing over to health

    - by Richard
    Ok I've got 2 exchange 2010 servers that run client access/hub transport/mailbox roles and one exchange 2010 server running just client access/hub transport roles and acts as my bridgehead. The two mailbox servers are running one database setup in a DAG. Server A shows the DB Mounted and Server B shows Healthy. If I reboot Server A via windows GUI Server B switches from healthy to mounted and I see hardly any interruption in service using Outlook 2007. Server A shows "Service down", then "Failed" then "Healthy" and leaves the DB mounted on Server B. This is how it should work, so far so good. Now if I test Server A being shut down cold, or unplugging both nics from network to simulate failure, Server B switches from Healthy to Mounted and server A switches to "Service Down" but my outlook client never connects to the DB mounted on server B! I can connect to server C (client access/hub transport) and get to my email and even send new email out, but incoming email doesn't deliver until Server A is brought back online and it's DB goes back to Healthy status. So I don't understand why it auto fail-overs when I reboot the server with the mounted DB copy, causing very little outlook 2007 hiccup if any. But when I shutdown or DC the mounted DB server it DOES mount the healthy copy but outlook 2007 clients can't connect.. I hope the picture I'm trying to paint makes some sense, it's driving me a little batty. Any help would be appreciated!

    Read the article

  • How does one close a Popup in Silverlight 3 by pressing the Escape key?

    - by Jacob
    I've just implemented a context menu control in Silverlight 3. One feature lacking in this control is for the Esc key to dismiss the menu. I've tried adding a KeyUp event handler in a few places, but the handler is never called. It looks like KeyUp is only available for items that can have focus. The popup menu cannot have focus, however, as it is only an ItemsControl. Have any of you successfully implemented having the Esc key close a Popup, or do you have any other suggestions on how I can implement this behavior?

    Read the article

  • Linux - serial port read returning EAGAIN...

    - by Andre
    Hello all! I am having some trouble reading some data from a serial port I opened the following way. I've used this instance of code plenty of times and all worked fine, but now, for some reason that I cant figure out, I am completely unable to read anything from the serial port. I am able to write and all is correctly received on the other end, but the replies (which are correctly sent) are never received (No, the cables are all ok ;) ) The code I used to open the serial port is the following: fd = open("/dev/ttyUSB0", O_RDWR | O_NONBLOCK | O_NOCTTY); if (fd == -1) { Aviso("Unable to open port"); return (fd); } else { //Get the current options for the port... bzero(&options, sizeof(options)); /* clear struct for new port settings */ tcgetattr(fd, &options); /*-- Set baud rate -------------------------------------------------------*/ if (cfsetispeed(&options, SerialBaudInterp(BaudRate))==-1) perror("On cfsetispeed:"); if (cfsetospeed(&options, SerialBaudInterp(BaudRate))==-1) perror("On cfsetospeed:"); //Enable the receiver and set local mode... options.c_cflag |= (CLOCAL | CREAD); options.c_cflag &= ~PARENB; /* Parity disabled */ options.c_cflag &= ~CSTOPB; options.c_cflag &= ~CSIZE; /* Mask the character size bits */ options.c_cflag |= SerialDataBitsInterp(8); /* CS8 - Selects 8 data bits */ options.c_cflag &= ~CRTSCTS; // disable hardware flow control options.c_iflag &= ~(IXON | IXOFF | IXANY); // disable XON XOFF (for transmit and receive) options.c_cflag |= CRTSCTS; /* enable hardware flow control */ options.c_cc[VMIN] = 0; //min carachters to be read options.c_cc[VTIME] = 0; //Time to wait for data (tenths of seconds) //Set the new options for the port... tcflush(fd, TCIFLUSH); if (tcsetattr(fd, TCSANOW, &options)==-1) { perror("On tcsetattr:"); } PortOpen[ComPort] = fd; } return PortOpen[ComPort]; After the port is initializeed I write some stuff to it through simple write command... int nc = write(hCom, txchar, n); where hCom is the file descriptor (and it's ok), and (as I said) this works. But... when I do a read afterwards, I get a "Resource Temporarily Unavailable" error from errno. I tested select to see when the file descriptor had something t read... but it always times out! I read data like this: ret = read(hCom, rxchar, n); and I always get an EAGAIN and I have no idea why. All help would be appreciated. Cheers

    Read the article

  • Swing Grid Layout or JTable

    - by ikurtz
    greetngs, i am trying to learn Java and Swing by writing a simple game of connect4. i am hoping you could guide me regarding the following issue: to emulate the connect4 grid should i use a JTable or rely on Grid layout? thank you.

    Read the article

  • How can I write a makefile to auto-detect and parallelize the build with GNU Make?

    - by xyld
    Not sure if this is possible in one Makefile alone, but I was hoping to write a Makefile in a way such that trying to build any target in the file auto-magically detects the number of processors on the current system and builds the target in parallel for the number of processors. Something like the below "pseudo-code" examples, but much cleaner? all: @make -j$(NUM_PROCESSORS) all Or: all: .inparallel ... build all here ... .inparallel: @make -j$(NUM_PROCESSORS) $(ORIGINAL_TARGET) In both cases, all you would have to type is: % make all Hopefully that makes sense.

    Read the article

  • Speex in Python

    - by iKarampa
    How can I use Speex to encode/decode from within python? Are there any wrappers? I found an old project pySpeex but it is obsolete now (requires Python 2.2).

    Read the article

  • Is it possible to programmatically set the state of the shift and control keys?

    - by Stephen Harrison
    The reason I am asking is that I am thinking of building a foot switch to act as shift and control keys - well two switches, one for each foot. I'm planning on using the Arduino for this and writing a small C# application to detect when the switch has been pressed that would then set the state of shift or control. I would rather not have to write a keyboard driver for the Arduino as I would like it to do other things as well.

    Read the article

  • How to convert XML to JSON in Python?

    - by Geuis
    I'm doing some work on App Engine and I need to convert an XML document being retrieved from a remote server into an equivalent JSON object. I'm using xml.dom.minidom to parse the XML data being returned by urlfetch. I'm also trying to use django.utils.simplejson to convert the parsed XML document into JSON. I'm completely at a loss as to how to hook the two together. Below is the code I more or less have been tinkering with. If anyone can put A & B together, I would be SO greatful. I'm freaking lost. from xml.dom import minidom from django.utils import simplejson as json #pseudo code that returns actual xml data as a string from remote server. result = urlfetch.fetch(url,'','get'); dom = minidom.parseString(result.content) json = simplejson.load(dom) self.response.out.write(json)

    Read the article

  • Map problem when passing it as model to view in grails

    - by xain
    Hi, In a controller, I have populated a map that has a string as key and a list as value; in the gsp, I try to show them like this: <g:each in="${sector}" var="entry" > <br/>${entry.key}<br/> <g:each in="${entry.value}" var="item" > ${item.name}<br/> </g:each> </g:each> The problem is that item is considered as string, so I get the exception Error 500: Error evaluating expression [item.name] on line [11]: groovy.lang.MissingPropertyException: No such property: nombre for class: java.lang.String Any hints on how to fix it other than doing the find for the item explicitly in the gsp ?

    Read the article

  • Which virtualization solutions are available for non-x86 platforms?

    - by asmaier
    Are their any virtualization solutions like Xen, KVM and VMWare ESX available for non-x86 platform? Especially I'm interested if there are solutions available or if Xen, KVM can be made to run on the platforms POWER5/6/7 PowerPC Itanium 64 NEC SX-8/9 Cray X2 BlueGene What are your experiences? Is it possible to virtualize GPUs like Nvidias Tesla/Fermi?

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >