links for 2011-02-17

18 02 2011
  • Overview: What is pages.xml?

    The pages.xml file and any .page.xml file is Seam's way of describing:

    1. RESTful (non-Faces) pages – That is, what to do with the URL parameters for a GET request.
    2. View restrictions – Restrict users from viewing pages based on an EL expression.
    3. Page actions – Invoke EL expressions whenever a page is accessed (RESTful or not).
    4. Page flow – The Seam <navigation> elements can replace the ordinary JSF navigation rules.

  • 1. Open the JBoss Folder
    2. Goto its Deploy folder.
    3. Goto the jbossweb-tomcat55.sar
    4. Find out the server.xml inside that folder. Actually this is the server configure file of the BuildIn Tomcat.
    5. Find the folowing Tag
    <Connector port=”8080″ address=”${jboss.bind.address}”…….
    6. Change the port number here.
    7. Restart the server.
  • # Integer.valueOf(String) converts a String to a number by assuming the String is a numeric representation. In other words. Integer.valueOf("12345") yields the number 12345.
    # Integer.getInteger(String) converts a String to a number by assuming the String is the name of a system property numeric representation. In other words. Integer.getInteger("12345") is likely to yield null.
  • Compared to Ruby on Rails,the ability to type check Java code is a nice feature and lets you find a certain kind of mistake very quickly,in an IDE such as Eclipse even as you type.This support rapidly degrades when moving outside the statically typed world of Java.As soon as the programmer has to jump to using strings,as is the case when using e.g. regular expression,SQL and HQL,the safe,checked world of Java comes to an end.The only kind of checks that are performed in languages like Java are type checks.This also means that the only mistakes are found that are related to types and can be expressed in types.This gets you only up to a certain point in finding programming errors. In order to use regular expressions in Java, programmers have to encode them in strings;SQL queries are encoded in strings compilers do not check strings. Strings are parsed and interpreted only at runtime,meaning problems only appear at runtime typically buried in an enormous stacktrace.And that’s a big shame.




links for 2011-02-15

16 02 2011
  • Boolean expressions Combine search terms using the familiar Boolean operators AND, OR, NOT.

    Office formats Support for popular Office formats including Office 2007 and OpenOffice.

    Updated UI Brings Agent Ransack's user interface into the modern day.

    Perl regex Support for Perl compatible regular expressions.

    64-bit Version Natively compiled 64-bit version for improved compatibility.

    FileLocator Lite A more 'gentle' branding of Agent Ransack for corporate environments. See the FileLocator Lite page for more information.

  • Search for a text string in a file & display all the lines where it is found.
    Syntax FIND [/V] [/C] [/N] [/I] "string" [pathname(s)]
    /V : Display all lines NOT containing the specified string.
    /C : Count the number of lines containing the string.
    /N : Display Line numbers.
    /I : Ignore the case of characters when searching for the string.
    "string" : The text string to find (must be in quotes).
    [pathname] : A drive, file or files to search.
    Examples:
    If names.txt contains the following:
    Joe Bloggs, 123 Main St, Dunoon
    Arnold Jones, 127 Scotland Street, Edinburgh
    To search for "Jones" in names.txt
    FIND "Jones" names.txt
    ———- NAMES.TXT
    Arnold Jones, 127 Scotland Street, Edinburgh
    If you want to pipe a command into FIND use this syntax
    TYPE names.txt | FIND "Jones"
    You can also redirect like this
    FIND /i "Jones" < names.txt >logfile.txt
    To search a folder for files that contain a given search string
    FOR %G IN (*.txt) do (find /n /i "SearchWord" "%G")




links for 2011-02-14

15 02 2011
  • //declare and initialize variables BigDecimal customer_tx_amount; BigDecimal customer_tx_vatamount; BigDecimal vatrate = new BigDecimal("14"); //calculate vatrate divider. //if vatrate = 14%, then to work out the exclusive amount, we divide the inclusive amount by //((100+14)/100), or 1.14 vatrate = vatrate.add(new BigDecimal("100")); //we want 6 decimal places vatrate = vatrate.divide(new BigDecimal("100"), 6, BigDecimal.ROUND_HALF_UP); customer_tx_amount = new BigDecimal("235345.37"); customer_tx_vatamount = customer_tx_amount.divide(vatrate, 6, BigDecimal.ROUND_HALF_UP); customer_tx_vatamount = customer_tx_amount.subtract(customer_tx_vatamount);




links for 2011-02-07

8 02 2011
  • 1) Implement interface in a new class
    public class hr_mi_se_Converter implements Converter { …
    2) Register in faces-config.xml
    <?xml version="1.0"?>
    <faces-config>
    …………
    …………
    <converter>
    <converter-id>hr_mi_se_Converter</converter-id>
    <converter-class>hr_mi_se_Converter</converter-class>
    </converter>
    ………..
    ………..
    </faces-config>
    3) Fire it up!
    <%@ taglib uri="http://java.sun.com/jsf/core&quot; prefix="f" %>
    <%@ taglib uri="http://java.sun.com/jsf/html&quot; prefix="h" %>

    <f:view>
    <html>
    <body>
    <h:form>
    <b>Please enter the time below :</b><br></br>
    <h:inputText id="input_text">
    <f:converter converterId="hr_mi_se_Converter" />
    </h:inputText>

    &nbsp;&nbsp;&nbsp;"Hours<b>:</b>Minutes<b>:</b>Seconds"
    format. <b>(Ex. 01:05:50)</b></br>

    <h:message for="input_text" style="color:RED"/></br></br>
    <h:commandButton value="Submit"/>
    </h:form>
    </body>
    </html>
    </f:view>