Part I: Experimental projects
Item One: Random photo display. Objective: To understand the generation of random numbers and the display of pictures. Goal:
(1) On the basis of existing code, complete the random (or sequential) display of three
, one, mask-shaped such as: "255.255.255.0" into the number of digits 24, the idea is as follows:
To determine if the passed-in mask string is IP, the simplest method is to match directly, with the following code:
Import
First you need to understand that Java Hastset is actually implemented in a hash table, the size of the hash table is by default size 16 (also known as the number of hashes), and the load factor is 0,75 (the following explains what the load factor
When doing community app, you need to implement this function:
String filetext = "//@ Zhang Nickname: 25 points//@ Li Xiaohua: 43 points//@ Wang Li: 100 points";
Pattern p = pattern.compile ("\\@" (. *?) \ n: ");//Regular expression,
Because it involves reading data from large files, but the program memory is too small to read the reason, so the file is split to read
Package cn.jado.ctt_check.test;
Import Java.io.BufferedReader;Import Java.io.FileInputStream;Import
Synchronized Way
Package test;
Import java.util.LinkedList;
Import Java.util.Queue;
Import Java.util.Random; public class Producerconsumer {public static void main (String args[]) {queue buffer = new L
Inkedlist<> ();
int
Here's a Akka Java demo to illustrate how Akka works. 1, first download Akka's official bag
The download address is: http://akka.io/downloads/. I downloaded the Akka 2.3.15.
Unzip this compression pack, prepare to copy the associated jar package to
Recently in the brush "sword refers to offer" in the programming problem, but the internet about "sword refers to offer" solution is mostly C or C + +, and the official (author) is also in C + + to explain, here himself with Java wrote some of the
Package common.util;
Import Java.util.concurrent.ExecutorService;
Import java.util.concurrent.Executors;
Import Java.util.concurrent.Future;
/** Threading Tool class/public class Threadutil {/** maximum number of threads for long time thread
First, the use of tools:
Nginx-1.8.1.tar.gz
Nginx_upload_module-2.2.0.tar.gz
Openssl-1.0.2h.tar.gz
Pcre-8.37.tar.gz
Zlib-1.2.8.tar.gz
Graphicsmagick-1.3.22.tar.gz
Apache-tomcat-7.0.47.tar.gz
Because of the use of Java Voice, the basic configuration
Java callback function understanding and application
Callback: is called a method C in class B in Class A, and then in Class B, in turn, calls the method in Class A d,d this method is called the callback method, so that you are not a little
We first propose such a simple requirement:Now to analyze the access log information of a Web site, the number of users from different IP visits, so that the GEO information to obtain access to the country region distribution. Here I take an example
Background:
The last article based on the object of Wait, notify realized the producer, consumer model. This article continues to comb the condition. Condition Introduction and demo
Condition is present in Java 1.5, which replaces the traditional
thread sharing restricted resources
1, basically all concurrency patterns in the resolution of threading conflict, are used
serializing access to shared resourcesProgram that allows only one task to access a shared resource at a given time; this is
Write today a question that we all generally overlook
Set method and return mutable object
We usually use the get, set method to access or set the property field when we are programming.
But there are some very special examples in the Set method,
Java io is really confusing, since there are FileWriter can write the character stream, why create DataOutputStream can also input character flow to the file. The following demo shows that files created by DataOutputStream can be read by FileReader.
This article is to see "effective Java" 17th feeling, on the basis of its expansion. This article explores mainly the following: After class inheritance, create subclass objects, call to parent constructors, and order of class initialization (that
1.parseInt (): Converts a string type to an int type.
Example:
String a = "123456";
int B = Integer.parseint (a);
2. (1) integer.valueof (): Converts a String type to an integer type (knocking the blackboard with emphasis: the integer type!= int
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service