Daily Archives

Articles indexed Friday April 30 2010

Page 14/114 | < Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >

  • How to print a image file in printer

    - by jackrobert
    Hi, I write a simple program to print a image in JSF.... I have one image (sampleImage.png).. Already i connected my pc to printer.... Manually i open the image and select print option , then i got image from printer.... Now i want print image using javascript.... <%@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"% <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Printer</title> <script type="text/javascript"> function printImage() { // Here i want write a script for print image } </script> <body> <h:form id="fileViewerForm"> <rich:panel> <f:facet name="header"> <h:outputText value="Printer"/> </f:facet> <h:commandButton value="PrintImage" onclick="printImage();"/> <rich:panel id="imageViewerPanel"> <h:graphicImage id="imageViewer" url="sampleImage.png" </rich:panel> </rich:panel> </h:form> </body> </html> help me about this..

    Read the article

  • Why is Lua considered a game language?

    - by Hoffmann
    I have been learning about Lua in the past month and I'm absolutely in love with the language, but all I see around that is built with lua are games. I mean, the syntax is very simple, there is no fuss, no special meaning characters that makes code look like regex, has all the good things about a script language and integrates so painlessly with other languages like C, Java, etc. The only down-side I saw so far is the prototype based object orientation that some people do not like (or lack of OO built-in). I do not see how ruby or python are better, surely not in performance ( http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=lua&lang2=python ). I was planning on writting a web app using lua with the Kepler framework and Javascript, but the lack of other projects that use lua as a web language makes me feel a bit uneasy since this is my first try with web development. Lua is considered a kids language, most of you on stackoverflow probably only know the language because of the WoW addons. I can't really see why that is... http://lua-users.org/wiki/LuaVersusPython this link provides some insights on Lua against Python, but this is clearly biased.

    Read the article

  • touchesEnded Sound?

    - by NextRev
    I'm trying to play a sound on touchesEnded but I'm having a problem. There are multiple objects that get moved around, so if the below code holds true when any object is moved, it constantly plays the sound. How do I only play it once? -(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event{ if(CGRectContainsRect([image1 frame], [image2 frame])){ [self playsound]; } }

    Read the article

  • How do I animate a single ChartSeriesItem in a Flex 3 Chart?

    - by Edward Stembler
    Here's my setup... I have a ColumnChart above a DataGrid. When the user clicks on an individual column in the chart, I programmatically select the corresponding cell in the DataGrid. Conversely, if a user clicks a cell on the DataGrid, I select the corresponding column in the Chart and change it's color to haloBlue. This work well, however if possible I’d like to make the column stand out more. Is there a way to animate an individual column and not the entire series? For example, I might like to make the column zoom or expand out and back to it’s original size once selected. Or, if this is not possible, can a stroke be added to only the selected column and not the entire series? Anyone have any ideas? Thanks!

    Read the article

  • How to preserve &amp; in <pre><code>

    - by Marcy Sutton
    I am having trouble preserving an ampersand in a code example on my blog, because all HTML entities start with &. Any tips? For example: <pre> <code> $pageTitle = str_replace('&', ' &amp;', $page->attributes()->title); </code> </pre> Renders as: $pageTitle = str_replace('&', '&', $page->attributes()->title);

    Read the article

  • Software RAID for several HDs which retains files on each HD

    - by Fuxi
    Is there some kind of software/driver that would enable me to create one big volume out of several hard disks but retain the file structure on each HD? This would be in case where one hard disk crashes and only data on that HD will be lost. Windows 7 enables me to do that but in case one HD breaks all data will be lost.

    Read the article

  • Using Apple’s Bonjour service from .NET?

    - by Martín Marconcini
    I have an iPhone app that publishes through Bonjour. The Mac counterpart works, they sync and exchange data. Now I have to port that little Mac app to Windows. I’ve decided to go with .NET (because that’s what I know). The app is not complex, but I’m in the early stages. I need to browse/discover Bonjour services. For this task, I’ve downloaded Mono.Zeroconf and Apple’s latest SDK (which includes a couple of C# Samples). I’m not really pasting code because I’m really copy/pasting the samples. In fact, Mono.Zeroconf has a MZClient.exe that can be used to test “all the API”. My 1st test was -on the same box- open two cmd.exe and launch a MZclient registering a service and on the other, launch it and “discover it”. It doesn’t work. Here’s the server: C:\MZ>MZClient -v -p "_http._tcp 80 mysimpleweb” *** Registering name = 'mysimpleweb', type = '_http._tcp', domain = 'local.' *** Registered name = ‘mysimpleweb’ On the other terminal: c:\MZ>MZClient -v -t "_http._tcp" Creating a ServiceBrowser with the following settings: Interface = 0 (All) Address Protocol = Any Domain = local Registration Type = _http._tcp Resolve Shares = False Hit ^C when you're bored waiting for responses. And that’s it. Nothing happens. I’ve of course tried with different services to no avail. Even played a little bit with that domain thing. Remember this is the same box. I tried on another computer, because this was a VM inside OSX, so I went ahead and tried on a “pure” win XP. Nothing. note: I have Apple Bonjour Service (up and running) and also the Apple SDK (installed later). Given that this didn’t work, I went ahead and decided to try the Apple SDK which has an Interop and a few pre-compiled samples (and its source code). Short story, neither the mDSNBrowser.exe nor the SimpleChat.exe work/see/discover anything. My box is a Win7 under Parallels, but that doesn’t seem to be affecting anything, given that the native XP exhibits the same problems. What am I doing so awfully wrong?

    Read the article

  • javascript AOP advice to statements

    - by Paul
    Some javascript libraries, such as JQuery and Dojo, provide AOP APIs that can introduce before, after, or around advice to a function. Just wondering whether there is any javascript AOP libraries can introduce such advices to an individual statement?

    Read the article

  • Using jQuery delay() with separate elements

    - by boomturn
    I want to fake a simple animation on page load by sequentially revealing several pngs, each appearing instantly but with unique, precisely timed delay before the next one. Using the latest version of jQuery (1.4.2 at writing), which provides a delay method. My first (braindead) impulse was: $('#image1').show('fast').delay(800); $('#image2').show('fast').delay(1200); $('#image3').show('fast'); Of course all come up simultaneously. jQuery doc examples refer to a single item being chained, not handling multiple items. OK... try again using nested callbacks from show(): $('#image1').show('fast', function() { $('#image2').show('fast', function() { $('#image3').show('fast', function() { }); }); }); Looks ugly (imagine doing 10, also wonder what processor hit would be) but hey, it works sequentially! Without delay though. So... chain delay() after show() using a callback function from it (not even sure if it supports one): $('#image1').show('fast').delay(800, function() { $('#image2').show('fast').delay(1200, function() { $('#image3').show('fast'); }); }); Hm. Opposite result of what I thought might happen: the callback works, but still no delay. So... should I be using some combination of queue and delay instead of nested callbacks? jQuery doc examples for queue again only use one element for example. Guessing this would involve using a custom queue, but am uncertain how to implement this. Or maybe I'm missing a simple way? (For a simple problem!)

    Read the article

  • How to generate a unified diff in Ruby?

    - by jstayton
    After reading through this question about Ruby diff packages, I'm still not sure how to generate a unified diff from two text files. I'm not having trouble reading each file into a string (IO.read()), but I'm not finding any package that can generate a unified diff. Does one exist? Is doing a system call to diff even an option I should consider? (I'm thinking no.) Any help is appreciated! Thanks.

    Read the article

  • XMLHttpRequest() and outputting csv file

    - by sjw
    Initially, I developed a javascript function to use window.open to post contents of a form to a new window which simply opened the new window and initiated a csv file download. Now on reflection, I find the opening of the window superfluous and am trying to just execute a XMLHttpRequest() to download the csv. I am not getting what I want and I'm not 100% sure that I can so I thought I'd ask here for some assistance. When a form is submitted, I want to take all the form values and post them to another page which builds an SQL string and builds a csv based on the contents. (This I can do and works fine with XMLHttpRequest() as seen below) var xhReq = new XMLHttpRequest(); var parameters = ""; for ( i=0; i<formObj.elements.length; i++ ) { parameters += formObj.elements[i].name + "=" + encodeURI( formObj.elements[i].value ) + "&"; } xhReq.open("POST", outputLocation, false); xhReq.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xhReq.setRequestHeader("Content-length", parameters.length); xhReq.setRequestHeader("Connection", "close"); xhReq.send(parameters); document.write(xhReq.responseText); The code above calls the page ok, builds the csv ok, but it outputs the contents into the current browser window instead of initiating a csv file download. Can I achieve what I need using XMLHttpRequest() or am I going it about it the wrong way? Thanks

    Read the article

  • Checking for Magento login on external page

    - by LinuxGnut
    I'm hitting a wall here while trying to access items from Magento on an external page (same server, same domain, etc, etc). I want to see if the user is logged into Magento before showing them certain parts on the site. Keep in mind that this code exists outside of Magento. Mage::app("default"); Mage::getSingleton("core/session", array("name" = "frontend")); if (empty($session)) { $session = Mage::getSingleton("customer/session"); } if($session-isLoggedIn()) echo "hi"; $cart = Mage::helper('checkout/cart')-getCart()-getItemsCount(); echo $cart; $cart returns 0, where I definitely have products in my cart. isLoggedIn() also returns false. What am I doing wrong here? Is there an option in Magento that I need to turn on or off to be able to access this information outside of Magento?

    Read the article

  • How to test if a string is inside a list of predinfined list of string in oracle pl/sql

    - by drupalspring
    I define a list a string which contains different country codes ( for example , USA ,CHINA ,HK ,JPN) How can I check that if a input variable equal to one of the country of the country list in pl/sql . I use the following code to test it but fail, how can I revise it? declare country_list CONSTANT VARCHAR2(200) := USA,CHINA,HK,JPN; input VARCHAR2(200); begin input := 'JPN'; IF input IN (country_list) DBMS_OUTPUT.PUT_LINE('It is Inside'); else DBMS_OUTPUT.PUT_LINE('It is not Inside'); END IF; end;

    Read the article

  • How to record user interaction in Flash app?

    - by Trung Vu
    I am looking for a way to capture the user interactions with a text input control in Flash over a period of time (not a screen cast)? For example: If the user enter some text, then delete, then enter something, I would be able to store that interaction as it happens and replay that later. Any help would be extremely useful Thanks

    Read the article

  • How do I create email addresses for all my users using my domain ([email protected])?

    - by user33012
    My client wants to create email addresses for all their dotnetnuke users using their domain. The point is to keep the user's email addresses 'private' while still allowing communication through a public email address that they can control. It's not necessary to have a full webmail interface (although that would be nice). I'm thinking it would be enough just to forward any mail on and just act as a gateway. So if an email was sent to [email protected], it would be forwarded on to the email address associated with the dotnetnuke account with username 'rwain'. Is this possible to do in a shared hosting environment? Or do I need to create some custom mail server that does a conversion of the email address and forwards it?

    Read the article

< Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >