jsoup HTML parser hello world examples



Posted on Jsoup , a HTML parser, its “jquery-like” and “regex” selector syntax is very easy to use and flexible enough to get whatever you want. Below are three examples to show you how to use Jsoup to get links, images, page title and “div” element content from a HTML page. Download jsoup The jsoup is available in Maven central repository. For non-Maven user, just download it from jsoup website . org.jsoup jsoup 1.7.1 1.

Read full article from jsoup HTML parser hello world examples


java - How to find a specific meta tag - Stack Overflow



Elements metalinks = doc.select("meta[name=generator]");

Read full article from java - How to find a specific meta tag - Stack Overflow


meta » Learn CSS3 | Cheat Sheet | CSS Tutorial | Selectors | Properties



Description The meta element provides information about the following document content; that information may be used by the user agent (that is, the browser) to decide how to render content, or it may be meta information that’s provided for indexing purposes—for example, to provide keywords that relate to the document for use by search engines or some other form of web service. The meta element can also be used to simulate HTTP response headers (the character encoding snippet provided here is an example of this),

Read full article from meta » Learn CSS3 | Cheat Sheet | CSS Tutorial | Selectors | Properties


hadoop - Hbase: How to specify hostname for Hbase master - Stack Overflow



There are two things that fix this class of problem for me:

1) Remove all "localhost" names, only have 127.0.0.1 pointing to the name of the hmaster node.

2) run "hostname X" on your hbase master node, to make sure the hostname matches what is in /etc/hosts.


Read full article from hadoop - Hbase: How to specify hostname for Hbase master - Stack Overflow


Ubuntu Networking Configuration Using Command Line | Ubuntu Geek



Sponsored Link The basics for any network based on *nix hosts is the Transport Control Protocol/ Internet Protocol (TCP/IP) combination of three protocols. This combination consists of the Internet Protocol (IP),Transport Control Protocol (TCP), and Universal Datagram Protocol (UDP). By Default most of the users configure their network card during the installation of Ubuntu. You can however, use the ifconfig command at the shell prompt or Ubuntu's graphical network configuration tools, such as network-admin,

Read full article from Ubuntu Networking Configuration Using Command Line | Ubuntu Geek


在伪分布集群上运行hbase,出现zookerper没有工作的错误,是不是一定要先装zookeeper? - Hadoop综合 - Hadoop技术论坛-大数据解决方案 hadoop,spark,storm,分布式,大数据,big data - Powered by Discuz!



问题解决,在/etc/hosts设置本机ip地址 xxx.xxx.xxx.xxx hbase .在hbase的regionserver将localhost去掉,改成hbase 。不修改配置文件

Read full article from 在伪分布集群上运行hbase,出现zookerper没有工作的错误,是不是一定要先装zookeeper? - Hadoop综合 - Hadoop技术论坛-大数据解决方案 hadoop,spark,storm,分布式,大数据,big data - Powered by Discuz!


Hbase/Shell - Hadoop Wiki



More Actions: This page describes the JRuby IRB-based HBase Shell. It replaces the SQL-like HQL , the Shell found in HBase versions 0.1.x and previous. Some discussion of new shell requirements can be found in the Shell Replacement document. To run the shell, do $ ${HBASE_HOME}/bin/hbase shell You'll be presented with a prompt like the following: HBase Shell; enter 'help' for list of supported commands. Version: 0.2.0-dev, r670701, Mon Jun 23 17:26:36 PDT 2008 hbase(main):001:0> Type 'help' followed by a return to get a listing of commands. Commands hbase(main):001:

Read full article from Hbase/Shell - Hadoop Wiki


Java Blog» Creating a simple cache in Java using a LinkedHashMap and an Anonymous Inner Class



14
            this.cache = new LinkedHashMap<String, Integer>(CACHE_MAX_SIZE, 0.75f, true) { 
15
                  protected boolean removeEldestEntry(
16
                             Map.Entry<String, Integer> eldest) {
17
                        // Remove the eldest entry if the size of the cache exceeds the
18
                        // maximum size
19
                        return size() > CACHE_MAX_SIZE;
20
                  }
21
            };
22
      } 

Read full article from Java Blog» Creating a simple cache in Java using a LinkedHashMap and an Anonymous Inner Class


kotek.net



3 billion items in Java Map with 16 GB RAM One rainy evening I meditated about memory managment in Java and how effectively Java collections utilise memory. I made simple experiment, how much entries can I insert into Java Map with 16 GB of RAM? Goal of this experiment is to investigate internal overhead of collections. So I decided to use small keys and small values. All tests were made on Linux 64bit Kubuntu 12.04. JVM was 64bit Oracle Java 1.7.0_09-b05 23.5-b02 . There is option to use compressed pointers (-XX:+UseCompressedOops), which is on by default on this JVM.

Read full article from kotek.net


java - Using Google Guava's Objects.ToStringHelper - Stack Overflow



I have a little trick for Objects.toStringHelper(). I configured IntelliJ IDEA to use it when auto-generating toString() methods. I assume you can do the same in Eclipse. Here's how to do it in Intellij: go inside a class hit Alt + Insert to popup the "Generate" menu choose toString() click the "Settings" button go to the "Templates" tab create a new template named "Guava's Objects.toStringHelper()" (I did it by copying the "ToStringBuilder" template) change the template to: public String toString() { #set ($autoImportPackages = "com.google.common.base.Objects") return Objects.

Read full article from java - Using Google Guava's Objects.ToStringHelper - Stack Overflow


html - CSS selector for select option value - Stack Overflow



Its called an attribute selector

option[value="1"]  {  background-color:yellow;  } 

Example http://jsfiddle.net/JchE5/


Read full article from html - CSS selector for select option value - Stack Overflow


css selectors - Select CSS based on multiple classes - Stack Overflow



You mean two classes? "Chain" the selectors (no spaces between them):

.class1.class2 {      /* style here */  }

This selects all elements with class1 that also have class2.

In your case:

li.left.ui-class-selector {    }

Official documentation : CSS2 class selectors.


Read full article from css selectors - Select CSS based on multiple classes - Stack Overflow


Multiple Class / ID and Class Selectors | CSS-Tricks



Published #header.callout { } #header .callout { } They look nearly identical, but the top one has no space between "#header" and ".callout" while the bottom one does. This small difference makes a huge difference in what it does. To some of you, that top selector may seem like a mistake, but it's actually a quite useful selector. Let's see the difference, what that top selector means, and exploring more of that style selector. Here is the "plain English" of "#header .callout": Select all elements with the class name callout that are decendents of the element with an ID of header.

Read full article from Multiple Class / ID and Class Selectors | CSS-Tricks


Use selector-syntax to find elements: jsoup Java HTML parser



Problem

You want to find or manipulate elements using a CSS or jquery-like selector syntax.

Solution

Use the Element.select(String selector) and Elements.select(String selector) methods:

File input = new File("/tmp/input.html");
Document doc = Jsoup.parse(input, "UTF-8", "http://example.com/");

Elements links = doc.select("a[href]"); // a with href
Elements pngs = doc.select("img[src$=.png]");
 
// img with src ending .png

Element masthead = doc.select("div.masthead").first();
 
// div with class=masthead

Elements resultLinks = doc.select("h3.r > a"); // direct a after h3

Read full article from Use selector-syntax to find elements: jsoup Java HTML parser


An Introduction to Programming in Go




Read full article from An Introduction to Programming in Go


Learn Go in Y Minutes



Get the code: learngo.go Go was created out of the need to get work done. It’s not the latest trend in computer science, but it is the newest fastest way to solve real-world problems. It has familiar concepts of imperative languages with static typing. It’s fast to compile and fast to execute, it adds easy-to-understand concurrency to leverage today’s multi-core CPUs, and has features to help with large-scale programming. Go comes with a great standard library and an enthusiastic community. // Single line comment /* Multi- line comment */ // A package clause starts every source file.

Read full article from Learn Go in Y Minutes


Why You Should Learn to Program in Go » Blake Smith



19 Aug 2012 Python and Ruby programmers come to Go because they don’t have to surrender much expressiveness, but gain performance and get to play with concurrency. Why should I learn Go? The first time I heard about Go, I was quite skeptical. In the past, other Google tools like GWT have left me nothing but confused about their grand complexity. I didn’t want or need another overbearing tool that made its own idiosyncrasies the priority over my own goals. Out of pure curiosity, I watched a Google IO video about using Go in production which spoke to me an important message.

Read full article from Why You Should Learn to Program in Go » Blake Smith


PDFObject: Embedding a PDF using HTML markup



Embedding a PDF using the standards-compliant <object> element is actually rather simple, and looks like this:

<object data="myfile.pdf" type="application/pdf" width="100%" height="100%">       <p>It appears you don't have a PDF plugin for this browser.    No biggie... you can <a href="myfile.pdf">click here to    download the PDF file.</a></p>      </object>

Read full article from PDFObject: Embedding a PDF using HTML markup


Java 8 http HelloWorld with docker on Google Compute Engine | Java Bien!



I tried to put more buzzwords in the title of this blog post but didn’t succeed… So anyway, let’s see what’s really behind these buzzwords. With this article my goal is to host on Google Compute Engine (GCE) a basic java http server that will answer “Hello World”. “Use the Api Luke!” I want to do as much as possible using GCE’s Api because this Api is a big deal. Not all cloud providers give us such a nice tool to automate thing. “Docker fear you should not” And to make things more interesting, I’ll use docker to describe the process that will run on my GCE instance.

Read full article from Java 8 http HelloWorld with docker on Google Compute Engine | Java Bien!


How To Install and Use Docker: Getting Started | DigitalOcean



Before you continue... You are about to enter a community-supported IRC chat. DigitalOcean is not responsible for its content. If you require immediate assistance, please open a support ticket . Introduction The provided use cases are limitless and the need has always been there. Docker is here to offer you an efficient, speedy way to port applications across systems and machines. It is light and lean, allowing you to quickly contain applications and run them within their own secure environments (via Linux Containers: LXC). In this DigitalOcean article,

Read full article from How To Install and Use Docker: Getting Started | DigitalOcean


Java 8 http HelloWorld with docker on Google Compute Engine | Java Bien!



I tried to put more buzzwords in the title of this blog post but didn’t succeed… So anyway, let’s see what’s really behind these buzzwords. With this article my goal is to host on Google Compute Engine (GCE) a basic java http server that will answer “Hello World”. “Use the Api Luke!” I want to do as much as possible using GCE’s Api because this Api is a big deal. Not all cloud providers give us such a nice tool to automate thing. “Docker fear you should not” And to make things more interesting, I’ll use docker to describe the process that will run on my GCE instance.

Read full article from Java 8 http HelloWorld with docker on Google Compute Engine | Java Bien!


Java 8 http HelloWorld with docker on Google Compute Engine | Java Bien!



I tried to put more buzzwords in the title of this blog post but didn’t succeed… So anyway, let’s see what’s really behind these buzzwords. With this article my goal is to host on Google Compute Engine (GCE) a basic java http server that will answer “Hello World”. “Use the Api Luke!” I want to do as much as possible using GCE’s Api because this Api is a big deal. Not all cloud providers give us such a nice tool to automate thing. “Docker fear you should not” And to make things more interesting, I’ll use docker to describe the process that will run on my GCE instance.

Read full article from Java 8 http HelloWorld with docker on Google Compute Engine | Java Bien!


crawler4j - Open Source Web Crawler for Java - Google Project Hosting



Crawler4j is an open source Java crawler which provides a simple interface for crawling the Web. You can setup a multi-threaded web crawler in 5 minutes! Sample Usage You need to create a crawler class that extends WebCrawler . This class decides which URLs should be crawled and handles the downloaded page. The following is a sample implementation: public class MyCrawler extends WebCrawler { private final static Pattern FILTERS = Pattern.compile(".*(\\.(css|js|bmp|gif|jpe?g" + "|png|tiff?|mid|mp2|mp3|mp4" + "|wav|avi|mov|mpeg|ram|m4v|pdf" + "|rm|smil|wmv|swf|wma|zip|rar|gz))$");

Read full article from crawler4j - Open Source Web Crawler for Java - Google Project Hosting


The Docker Book Sample.pdf



It appears you don't have a PDF plugin for this browser. No biggie... you can click here to download the PDF file.

Read full article from

Heroku on Docker | CenturyLink Labs



I am sure you have heard of Docker , but have you ever actually deployed a real app on it? How would you even start to move Heroku’s 4+ million apps into Docker Containers? Not many people have even tried. Building an app on Docker can be incredibly hard and frustrating. Not at all like using Heroku where everything is taken care of for you. With Docker, you have to learn about Dockerfiles and then try to get one that works just right with your code. If you are lazy (like me) and want to just try out Docker with no fuss, I will guide you through the whole process from start to finish.

Read full article from Heroku on Docker | CenturyLink Labs


Top 10 Startups Built on Docker | CenturyLink Labs




Read full article from Top 10 Startups Built on Docker | CenturyLink Labs


KenCochrane.net



Step 1: Register First things first, if you don't already have a Digital Ocean account, you will need to create one. If you follow this link , click sign up and enter this promo code VPSERS10, you will be given a $10 credit to try out the service. Step 2: Billing To prevent abuse, Digital Ocean requires that you enter a credit card before you can spin up a server. Go ahead and do that now. Once you put in your information you should see a screen like this. Step 3 SSH keys To make your life easier, I would add a public SSH key to your account.

Read full article from KenCochrane.net


Where are Docker images stored? - Lounge Scene



If you're just starting out with Docker , it's super easy to follow the examples, get started and run a few things. However, moving to the next step, making your own Dockerfiles, can be a bit confusing. One of the more common points of confusion seems to be: Where are my Docker images stored? - Everyone I know this certainly left me scratching my head a bit. Even worse, as a n00b, the last thing you want to do is publish your tinkering on the public Docker Index . Checkout my awesome new Docker image thoward/i_have_no_idea_what_im_doing Yeah. Not really what I want to do. Even worse,

Read full article from Where are Docker images stored? - Lounge Scene


Where are docker images stored on the host machine? - Stack Overflow



The images are stored in /var/lib/docker/graph/<id>/layer.

Note that images are just diffs from the parent image. The parent ID is stored with the image's metadata /var/lib/docker/graph/<id>/json.

When you docker run an image. AUFS will 'merge' all layers into one usable file system.


Read full article from Where are docker images stored on the host machine? - Stack Overflow


Deploy Java Apps With Docker = Awesome - Atlassian Blogs



I'm speaking at RoadTrip 2014 Learn More » You may remember a blog post I wrote some time ago about Java provisioning with Vagrant . Today I’ll be exploring something that rivals and complements that in coolness. Today I would like to tell you about Docker and show you how awesome it is. New to Docker? Here is an intro in their own word: “Docker is an open-source engine which automates the deployment of applications as highly portable, self-sufficient containers which are independent of hardware, language, framework, packaging system and hosting provider.

Read full article from Deploy Java Apps With Docker = Awesome - Atlassian Blogs


14 great tutorials on Docker | Docker Blog




Read full article from 14 great tutorials on Docker | Docker Blog


Day 21: Docker--The Missing Tutorial | Openshift Blog



OpenShift Evangelist A couple of months ago, Red Hat announced a partnership with dotCloud on their Docker technology. I did't have the time then to learn about Docker so today for my 30 days challenge I'm learning what Docker is all about. This blog post does not cover OpenShift's plans for using Docker in the future. Please read the blog post by Mike McGrath called Technical Thoughts on OpenShift and Docker . Also read this stackoverflow question to understand how Docker compares to OpenShift. What is Docker? Docker provides an envelope (or container) for running your applications.

Read full article from Day 21: Docker--The Missing Tutorial | Openshift Blog


Salmon Run: Extracting Useful Text from HTML



Saturday, November 14, 2009 Some time back, a colleague pointed me to The Easy Way to Extract Useful Text from Arbitary HTML . If you haven't read/know about this already, I suggest that you do, the simplicity of the approach will probably blow you away. The approach has two steps: For each line of input HTML, compute the text density and discard the ones whose densities are below some predefined threshold value. This has the effect of removing heavily marked up text. To the text that remains, train and apply a neural network to remove boiler-plate text such as disclaimers, etc.

Read full article from Salmon Run: Extracting Useful Text from HTML


Salmon Run: Extracting Useful Text from HTML



Saturday, November 14, 2009 Some time back, a colleague pointed me to The Easy Way to Extract Useful Text from Arbitary HTML . If you haven't read/know about this already, I suggest that you do, the simplicity of the approach will probably blow you away. The approach has two steps: For each line of input HTML, compute the text density and discard the ones whose densities are below some predefined threshold value. This has the effect of removing heavily marked up text. To the text that remains, train and apply a neural network to remove boiler-plate text such as disclaimers, etc.

Read full article from Salmon Run: Extracting Useful Text from HTML


How to install VNC server on Ubuntu Server 12.04 | Lazy Geek -:)



How to install VNC server on Ubuntu Server 12.04 34 Comments Posted by rbgeek on June 25, 2012    VNC is a protocol that is used to share the desktop with other users/computers over the network/Internet.In order to share a desktop, VNC server must be install and configure on the computer and VNC client must be run on the computer that will access the shared desktop. When we install the fresh copy of Ubuntu Server, it only gives us the “Command Line” interface. But some people prefer GUI instead and for this they install Full version of Gnome on Ubuntu Server.

Read full article from How to install VNC server on Ubuntu Server 12.04 | Lazy Geek -:)


Red Hat / CentOS: Check / List Running Services



Red Hat / CentOS: Check / List Running Services by Nix Craft on January 14, 2009 · 15 comments · LAST UPDATED January 14, 2009 Q. How do I list all currently running services in Fedora / RHEL / CentOS Linux server? A. There are various ways and tools to find and list all running services under Fedora / RHEL / CentOS Linux systems. service command - list running services service --status-all To print the status of apache (httpd) service:

Read full article from Red Hat / CentOS: Check / List Running Services


Get a list of the installed services | HowtoForge - Linux Howtos and Tutorials



To get a list of the installed services on the shell, you may use this command (on Fedora, RedHat, CentOS, SuSE, and Mandriva):
chkconfig --list

 service --status-all
 covers what (obsolescent) chkconfig doesn't
Read full article from Get a list of the installed services | HowtoForge - Linux Howtos and Tutorials

HowTos/VNC-Server - CentOS Wiki



VNC is used to display an X windows session running on another computer. Unlike a remote X connection, the xserver is running on the remote computer, not on your local workstation. Your workstation ( Linux or Windows ) is only displaying a copy of the display ( real or virtual ) that is running on the remote machine. There are several ways to configure the vnc server. This HOWTO shows you how to configure VNC using the 'vncserver' service as supplied by CentOS. 1. Installing the required packages The server package is called 'vnc-server'. Run the command:

Read full article from HowTos/VNC-Server - CentOS Wiki


Salmon Run: Annotating text in HTML with UIMA and Jericho



Sunday, April 24, 2011 Some time back, I wrote about an UIMA Sentence Annotator component that identified and annotated sentences in a chunk of text. This works well for plain text input, but in the application I am planning to build, I need to be able to annotate HTML and plain text. The annotator that I ended up building is a two pass annotator. In the first pass, it iterates through the document text by node, applies the include and skip tag and attribute rules. In the second pass, it iterates through the (pre-processed) document text line by line, filtering by density as described here .

Read full article from Salmon Run: Annotating text in HTML with UIMA and Jericho


CheckingYourUbuntuVersion - Community Help Wiki



  • Open the Terminal (keyboard shortcut: Ctrl+Alt+T)

  • Enter the command lsb_release -a


  • Read full article from CheckingYourUbuntuVersion - Community Help Wiki


    Open-ocr by tleyden



    The heavy lifting OCR work is handled by Tesseract OCR . Docker is used to containerize the various components of the service. Launching OpenOCR on Orchard There are several docker PAAS platforms available, and OpenOCR should work on all of them. The following instructions are geared towards Orchard , but should be easily adaptable to other platforms. Install Orchard CLI tool See the Orchard Getting Started Guide for instructions on signing up and installing their CLI management tool.

    Read full article from Open-ocr by tleyden


    The 3 Best Free OCR Tools To Convert Your Files Back Into Editable Documents



    Believe it or not, some people still print documents to physical pieces of paper. Optical Character Recognition (OCR) software takes those printed documents and converts them right back into machine-readable text. We’ve found some of the best free OCR tools and compared them for you here. No OCR program is perfect, so you’ll have to double check the results and fix a few problems. Still, it’s a lot faster than typing the entire document back into the computer. Each of these free OCR software tools has its own strengths, and all of them will get the job done.

    Read full article from The 3 Best Free OCR Tools To Convert Your Files Back Into Editable Documents


    Day 26: OCR in Google Docs | PCWorld



    Day 26: OCR in Google Docs 30 Days With...Google Docs: Day 26 There are enough different features and scenarios to explore with Google Docs that 30 Days With...Google Docs only scratches the surface in some ways. For example, here we are with 25 days down and a only a handful to go and we haven't yet examined the OCR (optical character recognition) feature. I haven't done much with OCR in recent years. I recall being highly disappointed in the concept during the early days of mainstream consumer scanners. Back then OCR was about as accurate as Google Voice speech to text transcription.

    Read full article from Day 26: OCR in Google Docs | PCWorld


    why is javascript node.js not on google app engine - Stack Overflow



    Node.js is maintained by Joyent, who is in a way a competitor of Google. Node.js has no link what so ever with Google but is in fact built on top of an open source project started by Google. Google might jumped into this business just like Azure did, but there are already so many PaaS doing it, it might not be worth it. I have never used GAE, but my understanding is that it is quite different that other PaaS and you have to use GAE libraries to make your code run. Which, this is my personal feeling, is not really what the Node.js community is looking for. Node.

    Read full article from why is javascript node.js not on google app engine - Stack Overflow


    javascript - How to close current tab in a browser window? - Stack Overflow



    <a href="javascript:window.open('','_self').close();">close</a>

    Read full article from javascript - How to close current tab in a browser window? - Stack Overflow


    How to Close the Current Window Using Javascript: 5 Steps



    Edited by Overthetop, Teresa, Maluniu This is a simple tutorial to show you how to close the current browser window with JavaScript. Ad Steps http://pad1.whstatic.com/images/thumb/3/3e/Close-the-Current-Window-Using-Javascript-Step-1-preview.jpg/550px-Close-the-Current-Window-Using-Javascript-Step-1-preview.jpg http://pad2.whstatic.com/images/thumb/3/3e/Close-the-Current-Window-Using-Javascript-Step-1-preview.jpg/240px-Close-the-Current-Window-Using-Javascript-Step-1-preview.jpg Close the Current Window Using Javascript Step 1 Version 2.jpg 1 To close the browser window,

    Read full article from How to Close the Current Window Using Javascript: 5 Steps


    John Resig - How JavaScript Timers Work



    How JavaScript Timers Work At a fundamental level it’s important to understand how JavaScript timers work. Often times they behave unintuitively because of the single thread which they are in. Let’s start by examining the three functions to which we have access that can construct and manipulate timers. var id = setTimeout(fn, delay); – Initiates a single timer which will call the specified function after the delay. The function returns a unique ID with which the timer can be canceled at a later time. var id = setInterval(fn, delay);

    Read full article from John Resig - How JavaScript Timers Work


    Mutually exclusive checkboxes with jQuery | Germán Schuager's blog



    I was needing a way for the user to select none or just one item in a set... here is how I've managed to achieve this functionality using jQuery:
    <html>
      <head>
          <script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
          <script type="text/javascript" language="javascript">
              $(document).ready(function() {
                  $('.mutuallyexclusive').click(function () {
                      checkedState = $(this).attr('checked');
                      $('.mutuallyexclusive:checked').each(function () {
                          $(this).attr('checked', false);
                      });
                      $(this).attr('checked', checkedState);
                  });
              });              
          </script>
      </head>
      <body>
          <div>
              Red: <input id="chkRed" name="chkRed" type="checkbox" value="red" class="mutuallyexclusive">
              Blue: <input id="chkBlue" name="chkBlue" type="checkbox" value="blue" class="mutuallyexclusive">
              Green: <input id="chkGreen" name="chkGreen" type="checkbox" value="green" class="mutuallyexclusive">
          </div>
      </body>
    </html>
    Read full article from Mutually exclusive checkboxes with jQuery | Germán Schuager's blog

    Force HTML5 youtube video - Stack Overflow



    <object width="640" height="360"> <param name="movie" value="http://www.youtube.com/embed/VIDEO_ID?html5=1&amp;rel=0&amp;hl=en_US&amp;version=3"/> <param name="allowFullScreen" value="true"/> <param name="allowscriptaccess" value="always"/> <embed width="640" height="360" src="http://www.youtube.com/embed/VIDEO_ID?html5=1&amp;rel=0&amp;hl=en_US&amp;version=3" class="youtube-player" type="text/html" allowscriptaccess="always" allowfullscreen="true"/> </object>

    Read full article from Force HTML5 youtube video - Stack Overflow


    Apache OpenNLP Developer Documentation



    The OpenNLP UIMA pear file must be build manually. First download the source distribution, unzip it and go to the apache-opennlp/opennlp folder. Type "mvn install" to build everything. Now build the pear file, go to apache-opennlp/opennlp-uima and build it as shown below. Note the models will be downloaded from the old SourceForge repository and are not licensed under the AL 2.0.

    			  $ ant -f createPear.xml   Buildfile: createPear.xm

    Read full article from Apache OpenNLP Developer Documentation


    uimafit in a servlet - Google Groups




    Read full article from uimafit in a servlet - Google Groups


    java - How to call for a Maven goal within an Ant script? - Stack Overflow



    <target name="mvn">
        <exec dir="." executable="cmd">
            <arg line="/c mvn clean install" />
        </exec>
    </target>
    or you want it to work on both UNIX and Windows:
    <condition property="isWindows">
        <os family="windows" />
    </condition>
    
    <condition property="isUnix">
        <os family="unix" />
    </condition>
    
    <target name="all" depends="mvn_windows, mvn_unix"/>
    
    <target name="mvn_windows" if="isWindows">
        <exec dir="." executable="cmd">
            <arg line="/c mvn clean install" />
        </exec>
    </target>
    
    <target name="mvn_unix" if="isUnix">
        <exec dir="." executable="sh">
            <arg line="-c 'mvn clean install'" />
        </exec>
    </target>
    Read full article from java - How to call for a Maven goal within an Ant script? - Stack Overflow

    Running an External Ant Script in a Maven Build - O'Reilly Answers



    Redeem the reputation points you've earned from participating in O'Reilly Answers for O'Reilly ebooks, videos, courses, and conferences. Related Posts + 1   Posted Oct 01 2009 07:39 AM You need to execute an external Ant script in a Maven build. Configure the run goal form the Maven AntRun plugin. Define any properties you wish to pass to the external Ant build, and then call the external Ant build with the ant task, specifying the antfile and target you wish to execute.
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-antrun-plugin</artifactId>
            <executions>
              <execution>
                <id>ant-magic</id>
                <phase>prepare-package</phase>
                <goals>
                  <goal>run</goal>
                </goals>
                <configuration>
                  <tasks>
                    <property name="compile_classpath" 
                              refid="maven.compile.classpath"/>
                    <property name="outputDir"
                              value="${project.build.outputDirectory}"/>
                    <property name="sourceDir"
                              value="${project.build.sourceDirectory}"/>
                    <ant antfile="${basedir}/src/main/ant/create-deps.xml"
                         target="create"/>
                  </tasks>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    Read full article from Running an External Ant Script in a Maven Build - O'Reilly Answers

    Using tasks attributes



    Using <target/> Attributes

    Since plugin version 1.2 you can specify attributes in the <target/> configuration to execute or not Ant tasks depending some conditions. For example, to skip Ant call, you could add the following:

    <project>    ...    <build>      <plugins>        ...        <plugin>          <groupId>org.apache.maven.plugins</groupId>          <artifactId>maven-antrun-plugin</artifactId>          <version>1.7</version>          <executions>            <execution>              <phase> <!-- a lifecycle phase --> </phase>              <configuration>                  <target unless="maven.test.skip">                  <echo message="To skip me, just call mvn -Dmaven.test.skip=true"/>                </target>                </configuration>              <goals>                <goal>run</goal>              </goals>            </execution>          </executions>        </plugin>        ...      </plugins>    </build>    ...  </project>

    Read full article from Using tasks attributes


    How can I get which radio is selected via jQuery? - Stack Overflow



    Use this..

    $("#myform input[type='radio']:checked").val();

    Read full article from How can I get which radio is selected via jQuery? - Stack Overflow


    javascript - Check checkbox checked property using jQuery - Stack Overflow



    Using jQuery > 1.6

    <input type="checkbox" value="1" name="checkMeOut" id="checkMeOut" checked="checked" />    // traditional attr  $('#checkMeOut').attr('checked'); // "checked"  // new property method  $('#checkMeOut').prop('checked'); // true

    Read full article from javascript - Check checkbox checked property using jQuery - Stack Overflow


    Chromium Blog: Run Chrome Apps on mobile using Apache Cordova



    Tuesday, January 28, 2014 In September we introduced a new breed of Chrome Apps that work offline by default and act like native applications on the host operating system. These Chrome Apps are currently available on all desktop platforms. Today we're expanding their reach to mobile platforms with an early developer preview of a toolchain based on Apache Cordova , an open-source mobile development framework for building native mobile apps using HTML, CSS and JavaScript.

    Read full article from Chromium Blog: Run Chrome Apps on mobile using Apache Cordova


    HTML5 Input Types



    HTML Tutorial HTML5 APIs HTML5 New Input Types HTML5 has several new input types for forms. These new features allow better input control and validation. This chapter covers the new input types: color date datetime datetime-local email month number range search tel time url week Not all browsers support all the new input types. However, you can already start using them; If they are not supported, they will behave as regular text fields. Input Type: color The color type is used for input fields that should contain a color. Example Select your favorite color:

    Read full article from HTML5 Input Types


    jquery - Monitoring when a radio button is unchecked - Stack Overflow



    Handle the change event on the radio group, not each button. Then look to see which one is checked.

    Here's is some untested code that hopefully shows what I'm talking about :)...

    $("input[name='type']").change(function(e){      if($(this).val() == 'history') {          $year.css({display:'none'});          $datespan.fadeIn('fast');      } else {          $datespan.css({display:'none'});          $year.fadeIn('fast');      }    });

    Read full article from jquery - Monitoring when a radio button is unchecked - Stack Overflow


    html - Checking Value of Radio Button Group via JavaScript? - Stack Overflow



    If you are using a javascript library like jQuery, it's very easy:

    alert($('input[name=gender]:checked').val());

    Read full article from html - Checking Value of Radio Button Group via JavaScript? - Stack Overflow


    HTML fieldset disabled Attribute



    HTML Reference HTML Tags
      Personalia:   Date of birth:
    The disabled attribute is supported in all major browsers, except Internet Explorer and Safari. Definition and Usage The disabled attribute is a boolean attribute. When present, it specifies that a group of related form elements (a fieldset) should be disabled. A disabled fieldset is unusable and un-clickable. The disabled attribute can be set to keep a user from using the fields until some other condition has been met (like selecting a checkbox, etc.). Then,

    Read full article from HTML fieldset disabled Attribute


    Java - Convert string to enum | CoralCode



    public enum Fruit {
        APPLE, BANANA, ORANGE;
         
        public static Fruit getValue(String str) {
            if (APPLE.name().equalsIgnoreCase(str)) {
                return APPLE;
            } else if (BANANA.name().equalsIgnoreCase(str)) {
                return BANANA;
            } else if (ORANGE.name().equalsIgnoreCase(str)){
                return ORANGE;
            }
            return null;
        }
    }

    Read full article from Java – Convert string to enum | CoralCode


    Java Enum ValueOf Example - How to use | Java67



    Wednesday, October 31, 2012 valueOf Example in Java Enum valueOf method of Java Enum is used to retrieve Enum constant declared in Enum Type by passing String in other words valueOf method is used to convert String to Enum constants . In this Java Enum valueOf example we will see how to use valueOf method in Java. valueOf method is implicitly available to all Java Enum because every enum in Java implicitly extends java.lang.Enum class. valueOf method of enum accepts exactly same String which is used to declare Enum constant to return that Enum constant.

    Read full article from Java Enum ValueOf Example - How to use | Java67


    5 jQuery.each() Function Examples



    Related posts: Firstly, what is jQuery .each() Basically, the jQuery .each() function is used to loop through each element of the target jQuery object. Very useful for multi element DOM manipulation, looping arrays and object properties. jQuery .each() Syntax //DOM ELEMENTS $("div").each(function(index, value) { console.log('div' + index + ':' + $(this).attr('id')); }); //outputs the ids of every div on the web page //ie - div1:header, div2:body, div3:footer //ARRAYS var arr = [ "one", "two", "three", "four", "five" ]; jQuery.each(arr, function(index, value) { console.log(this); return (this !

    Read full article from 5 jQuery.each() Function Examples


    Listutorial: Tutorial 4 - Horizontal lists - Variation - Center the list



    Tutorial 4 - Horizontal lists - all steps combined There are many methods that can be used to making a horizontal list. The main ingredient is "display: inline", applied to the "LI" element. #navcontainer ul li a
    Step 1 - Make a basic list Start with a basic unordered list. The list items are all active (wrapped in ) which is essential for this list to work. Some CSS rules are written exclusively for the "a" element within the list items. For this example a "#" is used as a dummy link. Step 2 - Remove the bullets To remove the HTML list bullets,

    Read full article from Listutorial: Tutorial 4 - Horizontal lists - Variation - Center the list


    jquery - each / click function not working - Stack Overflow



    You can bind all buttons with a click event like this, there is no need to loop through them

    $(function(){      $("button").click(function() {          alert($(this).attr("value"));      });  });

    But a more precise selector might be:

    $(function(){      $("button[id^='button-'").click(function() {          alert($(this).attr("value"));      });  });

    Read full article from jquery - each / click function not working - Stack Overflow


    jquery - JavaScript: Changing src-attribute of a embed-tag - Stack Overflow



    You should remove the embed element and reinject it with the new src parameter set.
    embed like object and similar are two elements which, due do their special uses (video, audio, flash, activex, ...), in some browsers are handled differently from a normal DOM element. Thus changing the src attribute might not trigger the action you expect.
    The best thing is to remove the existing embed object an reinsert it. If you write some kind of wrapper function with the src attribute as parameter this should be easy

    I was also facing same issue when I want to change "src"-attribute of "embed" element, so what I did, is given below:
    var parent = $('embed#audio_file').parent();
    var newElement = "<embed scr='new src' id='audio_file'>";
    
    $('embed#audio_file').remove();
    parent.append(newElement);
    And this will work fine in my application.
    Conclusion: - You need to first remove the embed element and then you have to reinsert it with change in src.
    Read full article from jquery - JavaScript: Changing src-attribute of a embed-tag - Stack Overflow

    Labels

    Algorithm (219) Lucene (130) LeetCode (97) Database (36) Data Structure (33) text mining (28) Solr (27) java (27) Mathematical Algorithm (26) Difficult Algorithm (25) Logic Thinking (23) Puzzles (23) Bit Algorithms (22) Math (21) List (20) Dynamic Programming (19) Linux (19) Tree (18) Machine Learning (15) EPI (11) Queue (11) Smart Algorithm (11) Operating System (9) Java Basic (8) Recursive Algorithm (8) Stack (8) Eclipse (7) Scala (7) Tika (7) J2EE (6) Monitoring (6) Trie (6) Concurrency (5) Geometry Algorithm (5) Greedy Algorithm (5) Mahout (5) MySQL (5) xpost (5) C (4) Interview (4) Vi (4) regular expression (4) to-do (4) C++ (3) Chrome (3) Divide and Conquer (3) Graph Algorithm (3) Permutation (3) Powershell (3) Random (3) Segment Tree (3) UIMA (3) Union-Find (3) Video (3) Virtualization (3) Windows (3) XML (3) Advanced Data Structure (2) Android (2) Bash (2) Classic Algorithm (2) Debugging (2) Design Pattern (2) Google (2) Hadoop (2) Java Collections (2) Markov Chains (2) Probabilities (2) Shell (2) Site (2) Web Development (2) Workplace (2) angularjs (2) .Net (1) Amazon Interview (1) Android Studio (1) Array (1) Boilerpipe (1) Book Notes (1) ChromeOS (1) Chromebook (1) Codility (1) Desgin (1) Design (1) Divide and Conqure (1) GAE (1) Google Interview (1) Great Stuff (1) Hash (1) High Tech Companies (1) Improving (1) LifeTips (1) Maven (1) Network (1) Performance (1) Programming (1) Resources (1) Sampling (1) Sed (1) Smart Thinking (1) Sort (1) Spark (1) Stanford NLP (1) System Design (1) Trove (1) VIP (1) tools (1)

    Popular Posts