New budget + summer = return of the buzz cut. Chin and scalp now the same length... it's a race to see which is faster. Go!
6/28/2009, 4:35:41 PM
Favs: 0
Retweets: 0
link--- layout: tweet ---
New budget + summer = return of the buzz cut. Chin and scalp now the same length... it's a race to see which is faster. Go!
6/28/2009, 4:35:41 PM
Favs: 0
Retweets: 0
link


We have a vision to make the latest technologies more intersting to our viewers and help them in all possible ways.This website is the result of combined efforts and thoughts of our team.
We are looking forward to make this platform a place where future Developers etc. come and make their ideas as fine as possible.
Check out our Blogging feature.


The invention of the internet happened in a unique way as no one would have imagined. As the United States was in state of war and information was going to play vital role in it so the research and development wanted to build communications tools for them in that they found a way using computer networks in which they made a network from computer to computer i.e “network of networks".
Though telephone systems were the best way of communication(In the 1960's) as when the phone numbers were called they were dedicated to a transmission line. But when the United States feared the soviet attack they fought they wouldn't be able to communicate through telephone systems once lines were destroyed. Then "Packet Switching" was applied for sending information from one computer network to another. Packet switching was used because data was divided into smaller blocks called packets, so that each packet can travel through different routes and reach its destination. Packets contain "Header" in which the destination was mentioned as no dedicated path was there.
Now it was time for an upgrade so they tried time sharing. file sharing through networks. Created a mini copy of the original computer and interconnected the copies. These were later called Interface Message Processor(IMP). Every software and hardware were built for this project as there were no hardware paths for sharing data.Later they were able to send data through it and this is how ARPANet was formed. From this the most used application Email was built. Email was used to send messages from one computer to another in the network.
The Internet was open to all so many academic people were contributing in building or researching and giving feedback upon the Internet. People were coming together so that they could upgrade the Internet to a new level. They were able to find much more things they could do using the internet.
There were also different types of networks built like LAN's, WAN's but everyone had different formats so to keep the networks connected the TCP/IP was introduced. Protocols are a set of rules which networks have to follow so that every network is connected to each other. If networks were different we wouldn't have been able to share information.
In 9th June 1992 Congress made a decision that the internet was available to the general public to use which helped the internet grow more. As many people used the internet for commercial, business,etc. due to which there was always a competition for better use of the internet.
Many people were finding it difficult to use or search on the internet so Tim Berners-Lee invented software called the World Wide Web(WWW). WWW used hyperlinks to connect pages. Later user friendly software was introduced for surfing WWW called MOSAIC. MOSAIC had graphical advantage i.e texts, images, videos. After this the web grew significantly.


Curriculum Vitae
Personal and contact information
Name:
Tomáš František Kašpar
Born:
October XXth 19XX in Prague
Address: XXXXXXXXXXXX XXX, XXX XX Prague X
Phone number: +420 XXX XXX XXX
Email address<EMAIL_ADDRESS>Education
2015 – Present
University of Economics in Prague
Faculty of Informatics and Statistics
Bachelor's study programme: Applied Informatics
2010 – 2014
Soukromá střední škola výpočetní techniky
Private Secondary School of Information Technology
Specialization: Programming and Database systems
Work experience
Feb 2015 - Present
PricewaterhouseCoopers s.r.o.
Administrating and developing corporate websites, intranet, internal social network, corporate blog and mobile application. Buying and maintenance of domain names and domain hosting. Reporting from google and adobe analytics.
2013 - December 2015
Pizza Paolo Prosek
Accepting and processing orders and their delivery to customers and responsibility for the cash box.
2011 – Present Ipsos, s.r.o.
Pizza Paolo Prosek
Occasional cooperation on various projects.
Help with launch of the company's website www.ipsos.cz. Adding and modifying a content using HTML and CSS through content management system. Optimization of website for mobile devices.
Data processing operator in the first phase of launching of Tesco club card project.
Optimization of computer network in the offices.
Testing of surveys applications for tablets and PDAs.
2010 – Present
Trip computers, s.r.o.
Occasional cooperation on various projects.
Hardware constructions of computer networks.
Security cameras installations and management.
May 2012
Ministry of health of the Czech Republic
Short term internship
Documentation sorting and data processing and updating database of medical equipment.
Skills
Software
Ms Office (Word, Excel, Access, PowerPoint, Outlook), Microsoft Visual Studio, Microsoft SQL server, Adobe Photoshop
Expertise
HTML, CSS, javascript, jquery, experience with programming in visual basic, C#, java


- Key Findings
- 4-1. Civic tech: A New Possibility for Public-Private Collaboration
- 4-2. Donation Maps and Victim Identification: Civic Tech in Emergencies
- An Explosion Results in Taipei’s First Civic Tech Collaboration
- Open Source Programs in Disaster Prevention and Relief
- Bridge Builders Are the Key to Civic Tech Collaboration
- 4-3. Document Delivery Management System: Using Digital Tools to Improve Administrative Processes
- Reforming Administrative Processes with the Power of Digital Technology
- Long-term Partnership: Start by Identifying the Right Problems
- Difficulties Faced by Civic Tech in Government
- 4-4. AirBox: Building a Civic Tech Ecosystem
- A Civic Tech Ecosystem of Governments, Companies, and Communities
- Small Government Is the Starting Point for Public-Private Collaboration
- 4-5. vTaiwan: Civic Tech Collaboration to Create an Open Space for Deliberation
- Building an Online Deliberation Platform in a Hackathon
- Power and Relationships Should Be Opened Up
- How Can vTaiwan Deepen Its Impact?
- 4-6. How to Facilitate Civic Tech Collaboration
- Civic Tech vs IT Procurement
- Four Models for Civic Tech
- Turning Difficulties Into Challenges
- Note


Our long term target is BattleBots USA - the most prestigious competition and we aim to become the first Indian team ever to win the competition thereby taking the achievements of IIT Kanpur to new heights in the field of robotics.
As it happens, our existing Science and Technology clubs are unable to support us financially due to budget constraints.
Finance constitutes the backbone of any project.We welcome any amount which will help this coveted project in it's completion.
The task of putting together a robot is of paramount altitude and cannot be scaled without your support. Financial assistance is a crucial aspect of any team’s success. It lets us live up to our potential without any compromises and aim to achieve better than the best. It includes monetary as well as in-kind donation to the team. Funding for fabrication, materials, supplies and team logistics will also be highly appreciated. At the same time, endowment of service and parts will also be an influential role in the growth.
We strive for a stable and mutually beneficial relationship with our benefactors because we firmly believe that the knowledge and expertise gained from the sponsors are of paramount importance.
We are looking forward to your generous contribution and also invite you to join hands with Robowars IIT Kanpur for a captivating and fulfilling experience.
We would also like to mention that if our venture is successful and we win a few of the upcoming competitions the prize money from the various competitions would be ample to make us financially stable . Also, your generous contribution will highly appreciated and will always remain as one of the pillars of our success.


Pick user
(A)
(B)
Deploy State Channel Contract (Ethmo App)
Deploy State Channel Contract (Free Balance)
Submit latest state
Wait for timeout
Set Resolution
Everything Upto Withdraw
Withdraw
network_id: 7777777


Anomalies in Arctic Sea ice extent (million km 2) from Walsh et al. ( 2017) in the months of April through to August relative to the climatology from 1931 to 1960, smoothed with a 10‐year moving average


YourRestaurant is the ultimate restaurant experince. Take the next step to growing your buisness, By advertsing your restaurant through our App, Website and Social Media to reach new customers and drive sales, while increasing online and mobile presence to boost your brand awareness.Championing both local and national businesses, Our mission is to is to deliver profitable marketing using our expertise. When partnering with us you can expect trackable, measurable results with valuable customer insights to help shape your future marketing efforts.
You can log into your account and track how your buisness over the month, before you recieve a monthly update
You get to keep 100% of your profits, Unlike other discount sites we dont take a percentage of your profits, Your restaurant work off a monthly subscription fee
We'll send you a monthly report of how your business is growing with your restaurant. How many times your discount has been downloaded, and your monthly customer feedback report


Let's read
The smart way
Devote time and Energy to Positive People ~ Don’t let anyone undermine your dreams ~ Think Positive ~
MORAL STORIES
“Tell me and I forget. Teach me and I remember. Involve me and I learn.” - Benjamin Franklin
PANCHATANTRA STORIES
“Flying is learning how to throw yourself at the ground and miss.” - Douglas Adams
BEDTIME STORIES


Home
Gallery
All Result
Chuadanga
contacts
Farewell Gallery
!!!!!!!!!!!!!!
!!!!!!!!!!!!!!
!!!!!!!!!!!!!!
!!!!!!!!!!!!!!
!!!!!!!!!!!!!!
!!!!!!!!!!!!!!
!!!!!!!!!!!!!!
!!!!!!!!!!!!!!
!!!!!!!!!!!!!!
Powered by Maya©


Action title is required.
Enter a valid email.
Describe the report in the body.
Enter a valid resolution pattern.
Delay must be a positive integer.
Enter a valid URL.


Elevated blood
pressure, or hypertension, is associated with serious health problems,
such as strokes, heart attacks, and kidney failure. Most people
believe the problem with hypertension is that the elevated pressure
damages the arteries and the body’s organs. Actually, it is
more often the other way around. The rise in blood pressure is a
response to a sick body – the blood pressure goes up as a natural
and proper adaptation – as an attempt to compensate for a plugged
up cardiovascular system. After years of consuming the rich Western
diet, the blood vessels develop blockages referred to as atherosclerosis,
the artery walls stiffen, and the blood itself becomes viscous.
All this change creates a resistance to flow, resulting in a decrease
in the ability to deliver nutrients to the tissues. The body responds,
as it should, with a rise in blood pressure.
The correct
action for the patient to take is to decrease the resistance to
flow by eating a healthy diet and exercising. Most people who follow
the McDougall diet find their blood pressure decreases within a
few days. Based on several collections of results from my clinic,
the average reduction of blood pressure is about 14/11 mmHg in seven
days, and at the same time medications used for treating hypertension
are usually stopped. My customary protocol is to stop all blood
pressure-lowering medications the first day of the Program, except
for beta-blockers, which I slowly discontinue by cutting the dosage
in half every two to three days. Unfortunately, not every patient
experiences the reduction in numbers they desire. Despite their
best efforts some people may need medications.
These blood-pressure-lowering
drugs function by poisoning the body in various ways. “Poison”
is the correct word. In chemistry poison means to inhibit a substance
or a reaction. Beta-blockers inhibit the action of adrenalin on
the heart muscle, calcium channel blockers inhibit the contraction
of the blood vessels, ACE inhibitors and angiotensin receptor blockers
do just that (inhibit and block) the blood pressure regulating hormones
produced by the adrenal glands, and diuretics poison the water and
electrolyte conserving functions of the kidneys.
These five
major classes of medications are discussed in more detail below.
Take Measurements
at Home for Months before Starting Drugs
Before starting
medications in non-emergency situations, people with concerns about
their blood pressure should first, buy a good quality blood pressure
cuff (an oscillometric monitor for $50 to $100) and use it to monitor
their blood pressure at home. I suggest they then record the values
several times a week and take these numbers to their private doctor
for further discussion.
A sustained
elevation of blood pressure to 160/100 mmHg or greater over months
suggests the need for treatment with medication. A word of caution:
If you do start blood pressure-lowering medications, avoid overly
aggressive treatment. In general, reducing blood pressure below
140/90 mmHg with medication is not beneficial and actually will
increase the risk of heart attacks, strokes, and death. A recent
review by the well-respected Cochrane Collaboration concluded with:
“Treating patients to lower than standard BP targets, ±140–160/90–100
mmHg, does not reduce mortality or morbidity.”
Chlorthalidone
Is the Drug of Choice
Chlorthalidone
is an oral diuretic (a water pill taken by mouth) with a prolonged
action of 48 to 72 hours and low toxicity. Diuretics lower blood
pressure by reducing fluid volume, which decreases the output of
the heart causing the blood pressure to fall. Doctors and patients
often believe that all diuretics have similar benefits. This is
not the case, and chlorthalidone is the preferred kind of diuretic
for most patients. In 1990, the Multiple Risk Factor Intervention
Trial (MRFIT) reported a reduction in nonfatal cardiovascular events
when the diuretic treatment was changed to replace hydrochlorothiazide
(HCTZ) with chlorthalidone in men at high risk for coronary heart
disease. Chlorthalidone is also more effective at lowering systolic
blood pressure (the top number) than HCTZ. The starting dosage used
was 12.5 to 25 mg daily; but the dosage can be increased to 50 to
100 mg daily. All patients receiving chlorthalidone should be checked
after one month for evidence of fluid or electrolyte imbalance:
namely, low sodium, low chloride, and low potassium (by blood tests).
Other periodic laboratory tests should be performed to look for
adverse effects from this potent diuretic. For example, blood levels
of cholesterol, triglycerides and uric acid can be increased by
this medication. Chlorthalidone is inexpensive; a 30-day supply
is $4 and a 90-day supply is $10 for 25 or 50 mg tablets at Walmart.
Why I No
Longer Routinely Prescribe Beta-blockers
For many years
beta-blockers were considered one of the first line therapies for
the treatment of hypertension. Current evidence suggests that beta-blockers
(like Atenolol) should not be prescribed unless there is some other
reason for their use (like atrial fibrillation, heart failure, or
myocardial infarction). A recent Cochrane Collaboration concluded:
“The available evidence does not support the use of beta-blockers
as first-line drugs in the treatment of hypertension. This conclusion
is based on the relatively weak effect of beta-blockers to reduce
stroke and the absence of an effect on coronary heart disease when
compared to placebo or no treatment.”
John McDougall,
MD [send him mail],
a board-certified Internist, is the founder and medical director
of the nationally renowned McDougall
Program, a ten-day, residential program located at a luxury
resort in Santa Rosa, CA – a place where medical miracles occur
through proper diet and lifestyle changes. He has been studying,
writing and "speaking out" about the effects of nutrition on disease
for over 30 years. Dr. McDougall is the author of 11 national bestselling
books, writes a monthly newsletter, and co-founded Dr. McDougall's
Right Food's Inc., a producer of high-quality vegetarian cuisine.
You may subscribe to the free
McDougall Newsletter.


Default node image.
String, default = ''
For any node if its img property is not defined, then default img will be used.
The img property is a css class for the image div. See .nodes to see how to
use img for nodes.
There are several default icons in w2ui.css file you can use or you can create your own css file with icons. Majority of default
icons are used in w2grid. Default icons are:
- icon-folder
- icon-page
- icon-reload
- icon-columns
- icon-search
- icon-add
- icon-delete
- icon-save
- icon-edit
- icon-bullet-black
The difference between img and icon is that img
uses a div and a background image. The icon property uses a span and icon fonts, such as font-awesome.
You can define it during object creation:
Or any time after the object has been created:


A simple tool to format paragraphs with multi vertical/horizontal margins, different text alignment, text formatting, in-text whitespace manipulation, frames, and target converters for characters.
Resources
Home page |
|
Source repository |
|
Maven Central current release |
|
Maven Central all releases |
|
Java 7 legacy version source repository |
|
Java 7 legacy version Maven releases |
|
UTF-8 Howto, older blog |
|
UTF-8 Howto, updated Wiki |
Installation
Maven
For Maven declare a dependency in the <dependencies>
section of your POM file.
<dependency>
<groupId>de.vandermeer</groupId>
<artifactId>asciiparagraph</artifactId>
<version>0.1.1</version>
</dependency>
Gradle / Grails
compile 'de.vandermeer:asciiparagraph:0.1.1'
For other build systems see Maven Central
Features
Text paragraph with some flexibility for alignment, format, padding, margins, frames, and additional strings per line:
-
add text, as often as required in many different formats (string, text provider, render provider, ST, clusters),
-
removes all excessive white spaces (tabulators, extra blanks, combinations of carriage return and line feed),
-
6 different alignments: left, right, centered, justified, justified last line left, justified last line right,
-
3 different formats: first line, hanging, dropped capital letter
-
flexible width, set for text and calculated in many different ways for rendering
-
padding characters for left and right padding (configurable separately)
-
character for in-text white spaces
-
additional string at the start of each line
-
additional string at the end of each line
-
a frame around the text
-
flexible left/right margins configurable individually by length and character between frame, strings and text
-
flexible top/bottom margins configurable individually by length between frame and text
-
top/bottom/left/right margins outside a frame
-
character conversion to generated text suitable for further process, e.g. for LaTeX and HTML
Concepts
The main concepts are: paragraph, paragraph context, and paragraph renderer.
Anatomy of a paragraph
The figure below shows all spacing characteristics of a paragraph.
The outer rectangle (using +
, -
, and |
characters) marks the most outer part of a paragraph.
This is followed by top, bottom, left, and right frame margins.
The next rectangle (using the UTF-8 double line characters ╔
, ═
, ╗
, ╚
, ║
, and ╝
) shows an example frame.
This is followed by top / bottom text margins and left / right string margins.
Left and right we find the start and end strings that can be set. This is followed by the left / right text margins.
The last rectangle (using the single line UTF-8 characters ┌
, ─
, ┐
, └
, ─
, and ┘
) marks the actual paragraph.
Here we have the text, plus optional padding and indentations.
+----------------------------------------------------------------------------------------------+
| |
| Top Frame Margin |
| |
|--------╔════════════════════════════════════════════════════════════════════════════╗--------|
| ║ ║ |
| ║ Top Text Margin ║ |
| ║ ║ |
| ║--------+--------+--------┌─────────────────────┐--------+--------+---------║ |
| ║ | | │ │ | | ║ |
| F M ║ S M | S S | T M │ Paragraph │ T M | E S | S M ║ F M |
| r a ║ t a | t t | e a │ text with │ e a | n t | t a ║ r a |
| a r ║ r r | a r | x r │ padding & │ x r | d r | r r ║ a r |
| m g ║ i g | r i | t g │ indentation │ t g | i | i g ║ m g |
| e i ║ n i | t g | i │ │ i | g | n i ║ e i |
| n ║ g n | | n │ │ n | | g n ║ n |
| ║ | | │ │ | | ║ |
| ║--------+--------+--------└─────────────────────┘--------+--------+---------║ |
| ║ ║ |
| ║ Bottom Text Margin ║ |
| ║ ║ |
|--------╚════════════════════════════════════════════════════════════════════════════╝--------|
| |
| Bottom Frame Margin |
| |
+----------------------------------------------------------------------------------------------+
Paragraph
A paragraph is a collection of text strings. The strings are processed as follows:
-
add text to the paragraph, multiple times if required
-
the paragraph will separate each added text using a space
-
for rendering a paragraph, all excessive white spaces will be removed
-
tabulators (converted to spaces),
-
more than one consecutive space,
-
line feed,
-
carriage return, and
-
line feed and carriage return.
-
Format of a paragraph
Paragraphs can be formatted using a number of special formats. Currently implemented are
-
First line - an indentation for the first line of the paragraph
-
Hanging paragraph - an indentation for everything but the first line
-
Dropped capital letter - a large capital letter for the first character of the first sentence spanning multiple lines
Text alignment
Text in the paragraph can be aligned in multiple different ways:
-
align left (open ended right site)
-
align right (open ended left site)
-
centered (all lines centered)
-
justified (all line justified)
-
justified with last line left aligned
-
justified with last line right aligned
Text padding
All lines will use padding to create a paragraph with equal length of each line. The padding on the left and the right depends on the text alignment:
-
align left: no padding left (all lines bound), padding on the right
-
align right: no padding on the right (all lines bound), padding on the right
-
centered: padding on both sides of each line
-
justified: no padding at all, each line starts and finishes with a word (or single character)
-
justified last line left align: padding only for the last line, on the right site
-
justified last line right align: padding only for the last line, on the left site
The characters being used for padding can be set separately, so that each site of a line gets a different padding character.
 The exception to this rule are all justified paragraphs (here extra white spaces are added to give the impression of a justified paragraph).
The implementation allows to change the character used for in-text white spaces from the default (a blank) to any other character.
Start and end strings
Each line of a paragraph can be started and terminated by a specific (different or identical) string. These strings are outside the text area, i.e. no special formatting is done on those strings.
Margins
A paragraph has several margins for the left and right sides as well as for top and bottom. Each margin can be set - the width for let/right side margins and the height for top and bottom margins. Additionally, a character can be set for left/right margins (the same or different characters for each side).
Frame
A paragraph can also be framed. A frame is
-
a line above the paragraph,
-
borders for each line of the paragraph (on the left and right side),
-
and a line at the bottom of of the paragraph.
The frame is set as a frame theme.
A number of those themes are provided in the skb-interfaces
package.
New themes can be created very easily, using ASCII and/or UTF-8 characters.
Summary of configurable characteristics
-
text width (length of each text line)
-
text alignment (for the whole paragraph): left, right, centered, justified (with additional options for last line)
-
text format: first line, hanging, dropped capital letter
-
frame: set a frame around the paragraph
-
start / end string: define a start and/or end string for each line
-
top and bottom margins above a frame (empty lines)
-
margins on the left and right of a frame (number with character)
-
margins between the frame and the start string (left) and end string and frame (right), using different length and character
-
margins between start string and text (left), and text and end string (right), using different length and characters
-
top and bottom margins for the text (including and string margin and string)
-
character converters to convert characters before line generation, i.e. to generate text suitable for LaTeX or HTML
Context
While the paragraph only maintains the text, the paragraph context maintains all configurable characteristics of the paragraph (see above). The current implementation directly has
-
paragraph alignment (default being justified, last line left)
-
paragraph format (default being none)
-
paragraph width (default being 80)
-
an optional library for dropped capital letters (default being not set)
-
an optional theme for a frame (default being not set)
The following characteristics are handled by special objects (one for each), which the context provides access to:
-
indentations (for first line and hanging paragraph)
-
all margins
-
all characters
-
all strings
-
all character (and target) translators
Additionally, the context provides a number of helper methods for rendering
-
different calculations for width, starting with simple text width and finishing with an all inclusive width
-
convenience methods to jointly set margins and characters, for the same left/right or top/bottom pairs
The paragraph can be initialized with a given context or plain, in which case it will create its own context object. Any future characteristics will be added to the paragraph context
Renderer
The actual rendering of a paragraph is realized by special render objects (i.e. it’s not done in the paragraph or its context). A paragraph can be rendered in two different ways:
-
call the provided render methods on the paragraph object itself
-
use a specialized render object
No changes are made to the paragraph text or any context settings by any render operation. All required text being processed and calculations being made will happen inside the renderer.
The render methods on the paragraph allow to render it (a) to the width set in the context or (b) to an overall required width. The first option is the most simple one: fill paragraph with text, set width on context, render. The second option can be used by other applications, for instance a table, to get a paragraph of required width.
For any other render operations use the provided standard renderer or create your own render object. The default renderer does currently provide render methods to different width with calculations provided by the context.
Note: coming soon: It also provides render methods that use their own context (i.e. ignore the context set in the paragraph). This allows for extremely flexibility in using the paragraph in many different scenarios.
Getting Started
The standard usage is:
-
create a paragraph
-
add text to the paragraph
-
change the paragraph context (to change its properties)
-
render the paragraph
-
use the created string, e.g. print it to a console or write it to a file
First, create a paragraph.
AsciiParagraph ap = new AsciiParagraph();
Next, add text. Any text can be added, the renderer will process the text (for instance remove excessive white spaces).
ap.addText("line 1");
ap.addText("2 2");
ap.addText("more text with tab and \n newline");
ap.addText("some more text to get it over the 80 character default width");
Next, render the paragraph. This will provide the text output using the default settings from the paragraph’s context.
String rend = ap.render();
Finally, print the paragraph to standard out.
System.out.println(rend);
The output will be:
line 1 2 2 more text with tab and newline some more text to get it over the 80 character default width
Examples
The following examples are using the classic "Lorem Ipsum" text as content.
Width
Width of 50, 40, and 30 on the same text.
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam
Whitespace handling
The paragraph will remove all additional white spaces so that the resulting text has words separated by 1 space. All tabulators, line feeds, and carriage returns will be removed.
"c2 c2" // string with 1 extra blank "c3 c3" // string with 2 extra blanks "c4 c4" // string with 3 extra blanks "t1 t1" // string with a tabulator "t2 t2" // string with 2 tabulators "t3 t3" // string with 3 tabulators "t4\t\t\t\tt4" // string with 4 escaped tabulators // a more complex construct using StringUtils to add CR and LF "word followed by " + StringUtils.CR + " followed by" + StringUtils.LF + " followed by \n"
Using left alignment and a width of 60 the rendered output will be:
c2 c2 c3 c3 c4 c4 t1 t1 t2 t2 t3 t3 t4 t4 word followed by followed by followed by
Conditional line breaks
Use HTML entities

and

to render text
"line 1
" "line 2
" "line three \n still line three"
to
line 1 line 2 line three still line three
In-text white space replacement
Remaining blanks in text can be automatically replaced by other characters
Lorem˽ipsum˽dolor˽sit˽amet, Lorem—ipsum—dolor—sit—amet, consetetur˽sadipscing˽elitr,˽sed consetetur—sadipscing—elitr,—sed diam˽nonumy˽eirmod˽tempor˽invidunt diam—nonumy—eirmod—tempor—invidunt ut˽labore˽et˽dolore˽magna˽aliquyam ut—labore—et—dolore—magna—aliquyam
Text alignment
Left and right.
 At vero eos et accusam voluptua. At vero eos et accusam
Centered and justified.
 At vero eos et accusam voluptua. At vero eos et accusam
Justified last line left and right.
 At vero eos et accusam voluptua. At vero eos et accusam
Text format
First line indentation and hanging paragraph.
 At vero erat, sed diam voluptua. At vero eos et accusam eos et accusam
Dropped capital letters.
ooooo orem ipsum dolor sit # orem ipsum dolor sit amet, `888' amet, consetetur # consetetur sadipscing 888 sadipscing elitr, # elitr, sed diam nonumy 888 sed diam nonumy # eirmod tempor invidunt ut 888 eirmod tempor # labore et dolore magna 888 o invidunt ut labore ###### aliquyam erat, sed diam o888ooooood8 et dolore magna voluptua. At vero eos et aliquyam erat, sed accusam diam voluptua. At vero eos et accusam
Left/Right text margin (width and character)
Lorem ipsum dolor sit amet, Lorem ipsum dolor sit amet, consetetur sadipscing elitr, consetetur sadipscing elitr, sed diam nonumy eirmod tempor sed diam nonumy eirmod tempor invidunt ut labore et dolore invidunt ut labore et dolore magna aliquyam erat, sed diam magna aliquyam erat, sed diam voluptua. At vero eos et voluptua.  At vero eos et voluptua.  At vero eos et voluptua. At vero eos et<<<<<<<<<< >>>>>>>>>>accusam accusam<<<<<<<<<<
Extra text at each line start and line end
Normal paragraph, added start string "// "
, added end string " -→"
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam // Lorem ipsum dolor sit amet, consetetur sadipscing // elitr, sed diam nonumy eirmod tempor invidunt ut // labore et dolore magna aliquyam erat, sed diam // voluptua. At vero eos et accusam // Lorem ipsum dolor sit amet, consetetur sadipscing --> // elitr, sed diam nonumy eirmod tempor invidunt ut --> // labore et dolore magna aliquyam erat, sed diam --> // voluptua. At vero eos et accusam -->
Render to maximum width, calculating additional padding and strings
Render to text width, text - strings, text - strings - margin
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam // Lorem ipsum dolor sit amet, consetetur // sadipscing elitr, sed diam nonumy eirmod tempor // invidunt ut labore et dolore magna aliquyam // erat, sed diam voluptua. At vero eos et accusam // Lorem ipsum dolor sit amet, consetetur --> // sadipscing elitr, sed diam nonumy eirmod --> // tempor invidunt ut labore et dolore magna --> // aliquyam erat, sed diam voluptua.   Lorem ipsum dolor --> % sit amet, consetetur  % sadipscing elitr,  % sed  %
Target translator for LaTeX character conversion
Left side w/o and right side with LaTeX target converter:
A sentence with some normal text, A sentence with some normal text, not specific to LaTeX. Now for some not specific to LaTeX. Now for some characters that require conversion: characters that require conversion: # % &. And some more: © § ¤. And \# \% \&. And some more: even more: È É Ê Ë. And some arrows {\copyright} {\S} \currency. And as well: ← ↑ → ↓ ↔ even more: \`{E} \'{E} \^{E} \"{E}. And some arrows as well: \(\leftarrow{}\) \(\uparrow\) \(\rightarrow{}\) \(\downarrow{}\) \(\leftrightarrow{}\)
Target translator for HTML character conversion
Left side w/o and right side with HTML target converter
A sentence with some normal text, A sentence with some normal text, not specific to HTML. Now for some not specific to HTML. Now for some characters that require conversion: characters that require conversion: # % & < >. And some more: © § ¤. And ̣ % & < >. And even more: Ē ē Ĕ ĕ Ė ė Ę ę Ě ě. And some more: © § ¤. some arrows as well: ← ↑ → ↓ ↔ ↕ And even more: Ē ē Ĕ ĕ Ė ė Ę ę Ě ě. And some arrows as well: ← ↑ → ↓ ↔ ↕


4-DOFs beam model
equilibrium approach
Previous Works
"Kirchhoff's theory of rods" > Dill 1992
Kirchhoff, Clebsch, Love XIXth
"Geometrically Exact Beam" > [Reissner 1992] [Simo & Vu-Quoc 1991]
"Special Theory of Cosserat Rods" > [Antman 2005]
Cosserat Rod
Kinematic Description
- arc length of the reference configuration > $s$
- Centerline > $\mathbf{x}(s)$
- Material frame > $\{\mathbf{d}_3,\mathbf{d}_1,\mathbf{d}_2\}(s)$
- Cross-section > $\mathcal{S}(s)$
- Material point > $\mathbf{p}(s,X_1,X_2)$
Rod Motion
- Translational velocity > $\mathbf{\dot{x}}(s,t)$
- Angular velocity > $\mathbf{\omega}(s,t)$
- Force strains > $\mathbf{\eta}(s,t)$
- Moment strains > $\mathbf{\varkappa}(s,t)$
Kirchhoff Rod Assumptions
- Slender
- Shear center = Centroid
- Small strains but finite displacements/rotations allowed
- Negligible shear
- Cross-sections are free to warp
- Complete first order theory in $\alpha$ [Dill 1992]
Kirchhoff Deformations
Strains
- Extension > $\mathbf{\epsilon}(s,t)$
- Force strains > $\mathbf{\eta}(s,t)$
- Moment strains > $\mathbf{\varkappa}(s,t)$
Balance on a Slice
Constitutive Equations
- They are deduced from 3D elasticity
- For an isotropic and linear elastic material
Dynamical Equations
- Already focused on 4-DOFs
- Shear force is a reacting parameter
Benefits
- Straightforward approach
- Complete theory
- Dynamical equations
- External distributed loads
- Physical meaning & Geometric interpretation
Limitations
- Discontinuities & Jumps
- External concentrated loads


--- layout: post title: Your 5-minute Google Analytics spot check date: 2015-01-01 13:18:00.000000000 -05:00 type: post published: true status: publish categories: - Analytics tags: - analytics - backend analytics - google analytics - how_to - tips & tricks meta: _wpcom_is_markdown: '1' _edit_last: '1' image: '' _use_slide_background: 'false' _publicize_twitter_user: "@chris_vannoy" _thumbnail_id: '133' _wpas_done_all: '1' _wpas_mess: Your 5-minute Google Analytics spot check _wpas_skip_9013372: '1' _wpas_skip_9017901: '1' _wpas_skip_9013380: '1' _wpas_skip_9013384: '1' thumb: http://jekyll-blog-cv.s3.amazonaws.com/file7801310373961.jpg ---
Note: This post originally appeared on the blog of my since-shuttered analytics firm: Axiomatic. That said, if you need some analytics work, get in touch
You're busy, so we'll keep this brief. I have a New Year's Resolution to propose to you ...
I've talked to enough business owners at this point to recognize a disturbing trend - analytics going unglanced at for weeks or months at a time. On one such occasion, their entire funnel had stopped tracking six months earlier and no one had noticed ...
Because no one was looking.
In five minutes (or less), once a week, you can make sure your business and your website analytics are running smoothly.
And yes, I timed this.
On your dashboard, first expand the view out to the last six months.
Look at the sessions trendline. Everything look good and make sense?
Groovy.
Next up (with the time frame still extended), check on your goals or events if you have them set up.
Next: Acquisition > Channels > Organic Search.
Trend line look nice and stable or has a Google algorithm update screwed things up for you?
Now switch the time frame back to the last seven days and go back to Acquisition > All Referrals.
Look for sources you don't expect. Make a note or to-do to explore them later if that strikes your fancy. Keep in mind: there's been a large uptick in referral spam lately.
Run through any conversion goals you have against the list. Look for anomalies. Make a note or to-do.
Do the same for Acquisition > Campaigns.
That's it, you're done.
Do this once a week and rest easy that all's quiet on the Analytics front.


When enabled, regular users will be able to change the configuration of jobs that use this strategy.
This may open up a security risk as the users could potentially configure the job to run scripts
which would enable an escalation of privileges attack.
When disabled, only users with the RUN_SCRIPTS
permission will be able to either select
this strategy or reconfigure a job that uses this strategy.
NOTE: The RUN_SCRIPTS permission is the highest permission available in Jenkins.
By default, all administrator users will have the RUN_SCRIPTS permission.


Hal Jordan
Hal Jordan, played by Ryan Reynolds, was the son of an air force pilot, until his father died in an airplane accident. Hal inherits the green power ring from a previous Green Lantern who crashed on Earth, and inherited the Green Lantern power. The key to becoming a powerful Green Latntern is to "show no fear", a trait that even as a kid Hal insisted on portraying.


--- layout: post title: "Microsoft is 'not litigating'" date: 2007-05-15 03:29:18 +0000 permalink: /2007/05/15/microsoft-is-not-litigating/ category: Linux redirect_from: - /blog/microsoft-is-not-litigating/ ---
Microsoft's VP for Intellectual Property has announced that Microsoft has no intent of litigating against Linux users. So why the recent announcement of the number of patents they feel Linux and Linux distributions infringe on? They want to spread the usual round of FUD -- fear, uncertainty, and doubt -- to encourage business who might be afraid of litigation to choose Windows over Linux. Nice marketing strategy, don't you think?
I just noticed that declanmcgrath has a similar theory over on his blog. Guess it's seeming pretty obvious to the Free world.


Pirates Threaten Fisheries in Lake Victoria
KAMPALA, August 21 (Xinhua) -- Rampant marauding threatens the
fisheries in Lake Victoria, the New Vision newspaper reported
today.
The exact number and composition of the gang is to be
established, but the newpaper said the ring consisted of heavily
armed ugandan, tanzanian and some Kenyan criminals.
The gang act in collaboration with the islanders of the three
countrias, it said.
In the latest swoop, the pirates hit Lolwe Island in
southeastern Uganda, looting properties worth millions of
shillings, and then headed for islands in Kenyan waters.

"Police do not respond or come too late" on the criminal
report, Mboli complained.
Meanwhile, the gang has its own warning network, an
unidentified source told the newspaper.
But Ugandan Police Chief Spokesman said that they have
deployed police marine boats to patrol the waters and asked
Kenyan counterparts to intensify patrols.
The local residents in southeastern Uganda asked for combating
the crime wave. enditem
=08210851
=08210847
NNNN
16:52 16:52 g # PAB


Boris Johnson’s election pledge: Let’s end Brexit groundhog day
by Joe CurtisPrime Minister Boris Johnson is set to call on voters to end the “groundhoggery” of Brexit in his first major General Election speech.
The Prime Minister will say the UK cannot “squander” more time on deciding on the manner of its departure from the EU, and ask the public to let him “get Brexity done”.
Read more: Ex-minister David Gauke says Tory majority would be ‘very bad’ for UK
Johnson’s speech, seen in advance by City A.M., will seek to put the Conservatives’ campaign back on track after the PM spent three days in South Yorkshire and the east Midlands following flooding.
He will travel to the West Midlands today to say: “The UK is admired and respected around the world but people are baffled by our debate on Brexit and they cannot understand how this great country can squander so much time and energy on this question and how we can be so hesitant about our future.
“If we can get a working majority we can get parliament working for you, we can get out of the rut. We can end the groundhoggery of Brexit.”
Read more: In his pursuit of power, Farage is gambling with Brexit itself
Labour has criticised Johnson’s Brexit stance, with party leader Jeremy Corbyn arguing the PM’s Brexit deal is flawed.
Instead Corbyn would call a second referendum, saying Labour would negotiate a better deal and give the public a choice on what happens next.
Johnson will say: “The country can either move forwards with policies that will deliver years of growth and prosperity, or it can disappear into an intellectual cul-de-sac of far left Corbynism.”
He will argue that his Brexit deal will boost the UK economy and allow the UK to shift focus onto other issues.
The Tories were dealt a blow today from former justice secretary David Gauke, who has warned a Johnson government will lead to a “very hard Brexit”.
Read more: Lib Dems defiant after Canterbury candidate Tim Walker steps down
He criticised Johnson for refusing to extend the UK’s Brexit transition period further than December 2020. That, Gauke argued, gives the UK too narrow a window to negotiate a free trade agreement with the EU.
The Tories have pledged to leave the EU without a free trade agreement if they fail to secure one by that deadline.
Main image credit: Getty Images


"use strict";
/**
* @fileOverview Main module for game
* @module game
* @author Dariusz 'Palid' Niemczyk
* @requires lodash
* @requires short-id
*/
var _ = require('lodash');
var shortID = require('short-id');
shortID.configure({
length: 4, // The length of the id strings to generate
algorithm: 'sha1', // The hashing algoritm to use in generating keys
salt: Math.random // A salt value or function
});
var requestUtil = require('./util/request.js');
var config = require('./config/game.js');
var currentGames = {};
/**
* The complete gameObject shared between players stored in currentGames object.
* @typedef {object} gameObject
* @property {string} gameId Current game's ID.
* @property {string} host Holds host's userId.
* @property {string} state Current game's state.
*
* @property {object} settings Current game's settings.
* @property {number} settings.captureTime At least this amount of seconds have to pass to capture a beacon by standing near it.
* @property {number} settings.afterCaptureDelay To gain points at least this amount of seconds have to pass counting from beacon's last movement.
* @property {number} settings.gameTime Game's maximum length in minutes.
* @property {number} settings.victoryPoints Points required to get by player to win.
* @property {number} settings.pointsPerTick Points received per tick for each controlled beacon.
* @property {number} settings.tickPeriod Time in seconds after which points will be granted to player.
* @property {number} settings.maxPlayers Maximum players amount that can join this game.
*
* @property {array} beacons Beacons array.
*
* @property {array} players Players array.
*
* @property {object} sys Holds every sys-only data like intervals. Updated after GAME command from host.
* @property {interval} sys.scoreInterval Interval in which player scoring will update.
* @property {interval} sys.syncInterval Interval in which command SYNC will be send to players with all data updates.
*
* @property {gameObjectProgress} progress Game's progress object in which all game-in-progress data is stored after GAME command from host.
*/
/**
* gameObject's progress object in which whole actual game goes on.
* @typedef {object} gameObjectProgress
*
* @property {date} gameStartTime Time of game's beginning
* @property {Number} gameLength Game length calculated on gameObject.settings.gameTime
*
* @property {array.<object>} beacons Array of all beacons taking part in this game.
* @property {string} beacons.beaconId Current beacon's ID
* @property {string} beacons.state Current beacon's state (captured/in-capture)
* @property {string} beacons.owner Current beacon's owner (playerID/neutral)
* @property {number} beacons.currentCapturingTime Time passed on standing near the beacon to capture it
* @property {number} beacons.movementLockTime Time that has to pass before beacon starts giving points after it last moved.
* @property {object} beacons.stats Stats object, used only for after-game statistics screen
* @property {array.<object>} beacons.stats.allCaptures Array with each captured made on the beacon
* @property {object} beacons.stats.allCaptures.capture Object with user's ID and capture date
* @property {string} beacons.stats.allCaptures.capture.userId Capturing player's ID
* @property {date} beacons.stats.allCaptures.capture.date Capture's time
* @property {number} beacons.lastCaptureTry Time of last capture try
* @property {number} beacons.capturingTimeTotal Total time spent on capture tries by players
* @property {object} beacons.longestInHold Object with informations about player having the beacon for the longest amount of time
* @property {string} beacons.longestInHold.by Player's ID who had the beacon captured for the longest time
* @property {string} beacons.firstCapturedBy Player's ID who captured the beacon first
* @property {object} beacons.sys System object, not send to player
* @property {interval} beacons.sys.captureInterval Beacon's private capture interval that starts on CAPTURE command sent from player
* @property {array.<string>} beacons.sys.lastCaptures Beacon's last captures array used for determining if beacon should be neutral now
* @property {string} beacons.sys.lastCaptures.array Players userIDs that last tried to capture the beacon
*
* @property {array.<object>} players Array of all players taking part in this game.
* @property {date} players.lastSyncDate Time of last synchronization between client and server (SYNC command)
* @property {string} players.userId Current player's userID
* @property {number} players.score Current player's accmulated score
* @property {object} players.stats Stats object, used only for after-game statistics screen
* @property {number} players.stats.timeSpentOnCaptures Total time spent on capture tries
* @property {number} players.stats.totalCaptureTries Total amount of capture tries
* @property {number} players.stats.succeededCaptures Total amount of succeeded(not blocked) captures
* @property {number} players.stats.failedCaptures Total amount of blocked captures
*
*/
/**
* Creates new game object and adds it into currentGames
* @property {string} userId Current player's ID
* @returns {gameObject} New gameObject
*/
function gameFactory(userId) {
var gameId = shortID.generate(),
game = {
gameId: gameId,
host: userId,
state: "lobby",
settings: config.gameDefaults,
beacons: [],
players: [],
sys: {}
};
currentGames[gameId] = game;
return game;
}
/**
* Returns reference to game object or error if not found
* @param {string} gameId Player's current gameId
* @return {gameObject|null} gameObject reference or null
*/
function getGame(gameId) {
var checkedGame = currentGames[gameId];
if (checkedGame) {
return checkedGame;
} else {
return null;
}
}
/**
* Removes all intervals created in setupGameLoops from the {gameObject}
* @param {gameObject} gameObject
* @returns {gameObject} Returns referenced gameObject
*/
function cleanAfterGame(gameObject) {
if (gameObject) {
_.forEach(gameObject.sys, function(gameInterval, key, collection) {
clearInterval(gameInterval);
delete collection[key];
});
if (gameObject.progress) {
_.forEach(gameObject.beacons, function(beacon, key, collection) {
if (beacon.interval) {
clearInterval(beacon.interval);
delete collection[key];
}
});
}
}
return gameObject;
}
/**
* Synchronize clients and server by sending server's game state to each client
* @param {gameObject} gameObject Current game object
* @returns {gameObject} Returns referenced gameObject
*/
function syncGame(gameObject) {
var progress = _.transform(gameObject.progress, function(result, item, key) {
if (key === "beacons") {
result[key] = _.map(item, function(beacon) {
return _.transform(beacon, function(result, item, key) {
if (key !== "sys" && key !== "stats") {
result[key] = item;
}
});
});
} else {
result[key] = item;
}
});
_.forEach(gameObject.players, function(player) {
var request = requestUtil.build({
command: "SYNC",
response: progress,
status: "OK",
date: Date.now()
});
player.socket.write(request);
});
return gameObject;
}
function updateGameObjectProgress(gameObject) {
_.forEach(gameObject.progress.beacons, function(beacon) {
if (beacon.owner !== 'neutral') {
_.forEach(_.where(gameObject.progress.players, {
userId: beacon.owner
}), function(user) {
user.score = gameObject.settings.pointsPerTick + user.score;
});
}
});
}
function synchronizeGameObject(gameObject) {
syncGame(gameObject);
var victoriousPlayer = _.find(gameObject.progress.players, function(player) {
return player.score >= gameObject.settings.victoryPoints;
});
if (((Date.now() - gameObject.progress.gameStartTime) > gameObject.progress.gameLength) || victoriousPlayer) {
cleanAfterGame(gameObject);
}
}
/**
* Setups all game loops as intervals
* @param {gameObject} gameObject Current game object
* @returns {gameObject} Returns referenced gameObject
*/
function setupGameLoops(gameObject) {
gameObject.sys.scoreInterval = setInterval(updateGameObjectProgress , 1000 / 3);
gameObject.sys.syncInterval = setInterval(synchronizeGameObject, 1000);
return gameObject;
}
/**
* Creates progress object in current gameObject and start game loops
* @param {gameObject} gameObject Current game's gameObject
* @returns {gameObject} Returns referenced gameObject
*/
function startGame(gameObject) {
var gameProgress = {
beacons: _.map(gameObject.beacons, function(beacon) {
return {
// name: '',
beaconId: beacon.beaconId,
state: 'captured',
owner: 'neutral',
currentCapturingTime: 0,
movementLockTime: 0,
stats: {
allCaptures: [],
lastCaptureTry: null,
capturingTimeTotal: 0,
longestInHold: {
by: 'neutral',
time: 0
},
firstCapturedBy: null
},
sys: {
captureInterval: null,
lastCaptures: []
}
};
}),
players: _.map(gameObject.players, function(player) {
return {
lastSyncDate: Date.now(),
userId: player.userId,
score: 0,
stats: {
timeSpentOnCaptures: 0,
totalCaptureTries: 0,
succeededCaptures: 0,
failedCaptures: 0
}
};
}),
gameStartTime: Date.now(),
// 1000 * 60 * 20 or 1000 * 60
gameLength: gameObject.settings.gameTime > 20 ? 1200000 : gameObject.settings.gameTime * 60000
};
gameObject.progress = gameProgress;
gameObject.state = 'started';
setupGameLoops(gameObject);
syncGame(gameObject);
return gameObject;
}
module.exports = {
factory: gameFactory,
get: getGame,
start: startGame,
sync: syncGame,
cleanup: cleanAfterGame
};


EDIT: Since everyone is asking. (English is not my first language so sorry for the grammar errors) We met in high school and started dating, my dad and her mom were single. They started talking and then they did something more than talking. We broke up, they got married. Family holidays are not awkward, actually my wife and her get along quite well. Yes I think about a threesome sometimes.
TIL The Titanic had a much more successful sister ship called the "Olympic". It was the only merchant ship to sink an enemy warship during World War I, after it turned around and rammed a submarine that had tried to torpedo it. The sub sank after it was gashed open by one of the Olympic's propellers
When Olympic was laid up in the drydock after the war, they found a dent in her side that appeared to have been caused by a torpedo that failed to detonate. She was built of horseshoes..


RAIDERS OF THE LOST ARK (1981) October 2nd, 2001 Reviewed by Jerry Saravia
The late Pauline Kael once said that a film is only worth seeing once and that the initial viewing is usually the best - one's impressions are often correct upon seeing a film the first time. When I first saw "Raiders of the Lost Ark" in 1981, I could not wait to see it again. And again. And again. The film is a thunderous assault on the senses and a wonder to behold but more than that - it is a roller coaster ride that you want to keep visiting again and again. It is thrilling, scary, adventurous, spooky, amusing, nerve-wracking and the kind of movie that will literally keep you on the edge of your seat.
By now, everyone knows who Indiana Jones is. He is the resourceful, stubborn, educated archaeologist and adventurer seeking unusual artifacts around the globe in the era of the 1930's. The first sequence, notably the most gripping opening sequence in the entire action-adventure genre, has Indiana in Peru entering a dangerous cave where a golden idol is kept. He must endure several booby-traps before acquiring it.  It is a continuous action serial where we wonder if the hero will make it out of one mishap after another. He always does, of course.
Harrison Ford is pitch perfect as Indiana Jones, showing sly changes from a bespectacled professor who is admired by his students to an action hero with a felt hat and trusty bullwhip who never thinks twice about shooting a swordsman (easily the best joke in the film). In fact, it is a shock after the opening sequence to see Indiana teaching an archaeology class - who is this guy, we wonder. When he is asked to find the Lost Ark of the Covenant, a relic being sought by Adolf Hitler, the gleam shows in his eyes as he is ready for adventure all over again. Indiana's first stop in this adventure is Nepal where an old flame, Marion Ravenwood (Karen Allen), has a medallion that is a key to finding the Ark.  The villains enter as he leaves, threaten Marion since they also seek the medallion, and a shootout in a bar turns into yet another thrilling action setpiece. Other stops around the globe include Cairo and some fortress where the Ark is to be unveiled on some unnamed island. Indiana rescues Marion and the medallion from Nepal, and they confront a variety of dangers and pratfalls along the way. There are mean Nazis, bare-chested, bald fighters, slithering snakes, rotting temples, poisonous dates (the fruit that is), clever monkeys, naval ships, trucks, rotating planes, and so much more that you feel you have entered a museum of 1930's memorabilia come to life. It is a pulp fiction world that director Steven Spielberg loves as does most people and it shows. And the action never stops, though it is not as headache-inducing as say "Indiana Jones and the Temple of Doom." Spielberg knows when to quit, when to let us breathe. It is only fitting that there is even a scene where Indiana sleeps instead of making love to Marion. He needs his rest.
What makes all this silliness work is Ford's charismatic performance - he makes us believe in him and makes the hero vulnerable enough to make us hope he will make it out of every single jam he is in. Also noteworthy is a hissable villain, one who is as credible as Ford is as a hero. Belloq (Paul Freeman), a French archaeologist, also has a gleam in his eyes and wants the Ark for his own needs - "a radio for speaking to God." Both of these men are in pursuit of a magical relic and will do anything to get it. Steven Spielberg is at his very best here, making every event as cinematic as possible and accentuating all the visual gags with flair. The action scenes are tightly edited and frightening in how explosive they are, especially the climactic truck chase where Indiana rides horseback to get inside the truck holding the Ark while dozens of jeeps and trucks go after him (as if this was the beginning of World War II). The gags come from everywhere but are never obtrusive, even if at one point a monkey does the Nazi salute! But what makes "Raiders of the Lost Ark" wonderful is Spielberg's sense of fun and his surefire direction, which somehow makes all the old cliches seem new again. The old marksman versus the swordsman joke is old-hat but Ford's sense of desperation makes the scene seem wondrous all over again, and one understands his reflexive action of shooting the swordsman. Every scene tingles with excitement and tension. The first time I saw the famous opening sequence, I was literally grabbing the arms of my seat. I am not sure how Spielberg does it exactly but it works in ways most action movies have not since - it is witty and there is an element of surprise that engages us. The rousing, memorable musical score by the incredible John Williams lends support and enhances our enjoyment.
The cast is superb and, surprisingly, there is little in the way of overacting or exaggeration as say in "Romancing the Stone" or "Jake Speed." Harrison Ford's secret is that he plays it straight, as if he believed what was happening all around him. It is not easy for an actor not to wink at all the chaos and mayhem but he succeeds admirably. Karen Allen is a great choice as the also stubborn, tough, romantic interest in Indiana's life - a shame she did not appear in any of the other entries of this series. She is clearly the woman for Indiana and knows how to match his wits, and delivers a knockout punch. For some good belly laughs, there is John Rhys-Davies as Indy's Cairo sidekick, Sallah. And for a charming yet insane villain in the grandest of traditions, there is Paul Freeman as the sympathetic Belloq who even has a thing for Marion.
"Raiders" does not end on an uplifting note. Instead it sort of ends abruptly as Indiana reclaims the Ark (what did you expect?) and brings it back to the United States yet it falls in the hands of the government rather than a museum for research and study. There is no sense of victory. And yet this remains one of the best action-adventure films ever made, as rousing and engaging as any film ever made. The sequels and numerous rip-offs can't do it justice. "Raiders of the Lost Ark" showcases Spielberg at his kinetic best, bringing us into a world we can only dream of. After all, isn't that what great movies are all about?
For more reviews, check out JERRY AT THE MOVIES at http://moviething.com/members/movies/faust/JATMindex.shtml
E-mail me with any questions, comments or complaints at<EMAIL_ADDRESS>or at<EMAIL_ADDRESS>========== X-RAMR-ID: 29670 X-Language: en X-RT-ReviewID: 252465 X-RT-TitleID: 1017096 X-RT-SourceID: 875 X-RT-AuthorID: 1314
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


Qt Quick 2 Surface Multiseries Example
The Qt Quick 2 surface example shows how to make a 3D surface plot displaying 3 layers using Surface3D with Qt Quick 2.
The focus in this example is on generating a multiseries surface plot from 3 different height map images, so in this section we skip explaining the application creation. For a more detailed QML example documentation, see Qt Quick 2 Scatter Example.
Running the Example
To run the example from Qt Creator, open the Welcome mode and select the example from Examples. For more information, visit Building and Running an Example.
Adding Data to the Graph
This example shows how to add several surface series to one graph using using HeightMapSurfaceDataProxies and how to control their visibilities individually.
Let's start by creating a specific gradient for each layer:
ColorGradient { id: layerOneGradient ColorGradientStop { position: 0.0; color: "black" } ColorGradientStop { position: 0.31; color: "tan" } ColorGradientStop { position: 0.32; color: "green" } ColorGradientStop { position: 0.40; color: "darkslategray" } ColorGradientStop { position: 1.0; color: "white" } } ColorGradient { id: layerTwoGradient ColorGradientStop { position: 0.315; color: "blue" } ColorGradientStop { position: 0.33; color: "white" } } ColorGradient { id: layerThreeGradient ColorGradientStop { position: 0.0; color: "red" } ColorGradientStop { position: 0.15; color: "black" } }
Then we'll create the series themselves. It happens simply by adding 3 separate Surface3DSeries to the Surface3D graph as children:
... Surface3DSeries { id: layerOneSeries baseGradient: layerOneGradient HeightMapSurfaceDataProxy { heightMapFile: ":/heightmaps/layer_1.png" } flatShadingEnabled: false drawMode: Surface3DSeries.DrawSurface visible: layerOneToggle.checked // bind to checkbox state } Surface3DSeries { id: layerTwoSeries baseGradient: layerTwoGradient HeightMapSurfaceDataProxy { heightMapFile: ":/heightmaps/layer_2.png" } flatShadingEnabled: false drawMode: Surface3DSeries.DrawSurface visible: layerTwoToggle.checked // bind to checkbox state } Surface3DSeries { id: layerThreeSeries baseGradient: layerThreeGradient HeightMapSurfaceDataProxy { heightMapFile: ":/heightmaps/layer_3.png" } flatShadingEnabled: false drawMode: Surface3DSeries.DrawSurface visible: layerThreeToggle.checked // bind to checkbox state } ...
You'll notice we added the created gradients to the baseGradient
properties of the series. We could have added them to the baseGradients
property of the Theme3D in Surface3D instead, but doing it this way ensures each gradient is applied to a correct series:
Surface3DSeries { id: layerOneSeries baseGradient: layerOneGradient ...
Controlling the Graph
Let's add some checkboxes to control the visibility of layers:
GroupBox { flat: true Layout.fillWidth: true Column { spacing: 10 Label { font.pointSize: fontSize font.bold: true text: "Layer Selection" } CheckBox { id: layerOneToggle checked: true style: CheckBoxStyle { label: Label { font.pointSize: fontSize text: "Show Ground Layer" } } } CheckBox { id: layerTwoToggle checked: true style: CheckBoxStyle { label: Label { font.pointSize: fontSize text: "Show Sea Layer" } } } CheckBox { id: layerThreeToggle checked: true style: CheckBoxStyle { label: Label { font.pointSize: fontSize text: "Show Tectonic Layer" } } } } }
We don't need to do anything on the onCheckedChanged
as we bound the checked
state to the visible
property of the series directly:
... visible: layerOneToggle.checked // bind to checkbox state ...
Let's add some more checkboxes to control how the layers are displayed, when visible:
GroupBox { flat: true Layout.fillWidth: true Column { spacing: 10 Label { font.pointSize: fontSize font.bold: true text: "Layer Style" } CheckBox { id: layerOneGrid style: CheckBoxStyle { label: Label { font.pointSize: fontSize text: "Show Ground as Grid" } } onCheckedChanged: { if (checked) layerOneSeries.drawMode = Surface3DSeries.DrawWireframe else layerOneSeries.drawMode = Surface3DSeries.DrawSurface } } CheckBox { id: layerTwoGrid style: CheckBoxStyle { label: Label { font.pointSize: fontSize text: "Show Sea as Grid" } } onCheckedChanged: { if (checked) layerTwoSeries.drawMode = Surface3DSeries.DrawWireframe else layerTwoSeries.drawMode = Surface3DSeries.DrawSurface } } CheckBox { id: layerThreeGrid style: CheckBoxStyle { label: Label { font.pointSize: fontSize text: "Show Tectonic as Grid" } } onCheckedChanged: { if (checked) layerThreeSeries.drawMode = Surface3DSeries.DrawWireframe else layerThreeSeries.drawMode = Surface3DSeries.DrawSurface } } } }
In addition to these we have three buttons, one of which is of special interest to us. It is used to control whether we want to slice into only one layer, or all of them:
NewButton { id: sliceButton text: "Slice All Layers" fontSize: fontSize Layout.fillWidth: true Layout.minimumHeight: 40 onClicked: { if (surfaceLayers.selectionMode & AbstractGraph3D.SelectionMultiSeries) { surfaceLayers.selectionMode = AbstractGraph3D.SelectionRow | AbstractGraph3D.SelectionSlice text = "Slice All Layers" } else { surfaceLayers.selectionMode = AbstractGraph3D.SelectionRow | AbstractGraph3D.SelectionSlice | AbstractGraph3D.SelectionMultiSeries text = "Slice One Layer" } } }
Example Contents
Files:


__init__(self,
source,
filepath=None,
filename=None,
loader=None,
encoding=None,
lookup=' strict ' ,
allow_exec=True)
(Constructor)
|
|
Initialize a template from either a string, a file-like object, or
an already parsed markup stream.
- Parameters:
source - a string, file-like object, or markup stream to read the
template from
filepath - the absolute path to the template file
filename - the path to the template file relative to the search
path
loader - the TemplateLoader to use for loading included
templates
encoding - the encoding of the source
lookup - the variable lookup mechanism; either "strict" (the
default), "lenient", or a custom lookup class
allow_exec - whether Python code blocks in templates should be
allowed
- Overrides:
object.__init__
Note:
Changed in 0.5: Added the allow_exec argument
|


[ all classes ]
[ org.imgscalr ]
Coverage Summary for Class: AsyncScalr (org.imgscalr)
| Class | Method, % | Line, % |
|---|---|---|
| AsyncScalr | 30% (6/ 20) | 25.6% (10/ 39) |
| AsyncScalr$1 | 0% (0/ 2) | 0% (0/ 2) |
| AsyncScalr$10 | 0% (0/ 2) | 0% (0/ 2) |
| AsyncScalr$11 | 0% (0/ 2) | 0% (0/ 2) |
| AsyncScalr$12 | 0% (0/ 2) | 0% (0/ 2) |
| AsyncScalr$13 | 0% (0/ 2) | 0% (0/ 2) |
| AsyncScalr$14 | 0% (0/ 2) | 0% (0/ 2) |
| AsyncScalr$2 | 0% (0/ 2) | 0% (0/ 2) |
| AsyncScalr$3 | 0% (0/ 2) | 0% (0/ 2) |
| AsyncScalr$4 | 0% (0/ 2) | 0% (0/ 2) |
| AsyncScalr$5 | 0% (0/ 2) | 0% (0/ 2) |
| AsyncScalr$6 | 100% (2/ 2) | 100% (2/ 2) |
| AsyncScalr$7 | 0% (0/ 2) | 0% (0/ 2) |
| AsyncScalr$8 | 0% (0/ 2) | 0% (0/ 2) |
| AsyncScalr$9 | 0% (0/ 2) | 0% (0/ 2) |
| AsyncScalr$DefaultThreadFactory | 100% (3/ 3) | 91.7% (11/ 12) |
| AsyncScalr$ServerThreadFactory | 0% (0/ 2) | 0% (0/ 5) |
| total | 20.8% (11/ 53) | 27.4% (23/ 84) |
1 /**
2 * Copyright 2011 The Buzz Media, LLC
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 package org.imgscalr;
17
18 import java.awt.Color;
19 import java.awt.image.BufferedImage;
20 import java.awt.image.BufferedImageOp;
21 import java.awt.image.ImagingOpException;
22 import java.util.concurrent.Callable;
23 import java.util.concurrent.ExecutorService;
24 import java.util.concurrent.Executors;
25 import java.util.concurrent.Future;
26 import java.util.concurrent.ThreadFactory;
27 import java.util.concurrent.ThreadPoolExecutor;
28 import java.util.concurrent.TimeUnit;
29 import java.util.concurrent.atomic.AtomicInteger;
30
31 import org.imgscalr.Scalr.Method;
32 import org.imgscalr.Scalr.Mode;
33 import org.imgscalr.Scalr.Rotation;
34
35 /**
36 * Class used to provide the asynchronous versions of all the methods defined in
37 * {@link Scalr} for the purpose of efficiently handling large amounts of image
38 * operations via a select number of processing threads asynchronously.
39 *

40 * Given that image-scaling operations, especially when working with large
41 * images, can be very hardware-intensive (both CPU and memory), in large-scale
42 * deployments (e.g. a busy web application) it becomes increasingly important
43 * that the scale operations performed by imgscalr be manageable so as not to
44 * fire off too many simultaneous operations that the JVM's heap explodes and
45 * runs out of memory or pegs the CPU on the host machine, staving all other
46 * running processes.
47 *

48 * Up until now it was left to the caller to implement their own serialization
49 * or limiting logic to handle these use-cases. Given imgscalr's popularity in
50 * web applications it was determined that this requirement be common enough
51 * that it should be integrated directly into the imgscalr library for everyone
52 * to benefit from.
53 *

54 * Every method in this class wraps the matching methods in the {@link Scalr}
55 * class in new {@link Callable} instances that are submitted to an internal
56 * {@link ExecutorService} for execution at a later date. A {@link Future} is
57 * returned to the caller representing the task that is either currently
58 * performing the scale operation or will at a future date depending on where it
59 * is in the {@link ExecutorService}'s queue. {@link Future#get()} or
60 * {@link Future#get(long, TimeUnit)} can be used to block on the
61 * Future, waiting for the scale operation to complete and return
62 * the resultant {@link BufferedImage} to the caller.
63 *

64 * This design provides the following features:
65 *

66 *
Non-blocking, asynchronous scale operations that can continue execution
67 * while waiting on the scaled result.

68 *
Serialize all scale requests down into a maximum number of
69 * simultaneous scale operations with no additional/complex logic. The
70 * number of simultaneous scale operations is caller-configurable (see
71 * {@link #THREAD_COUNT}) so as best to optimize the host system (e.g. 1 scale
72 * thread per core).

73 *
No need to worry about overloading the host system with too many scale
74 * operations, they will simply queue up in this class and execute in-order.

75 *
Synchronous/blocking behavior can still be achieved (if desired) by
76 * calling get() or get(long, TimeUnit) immediately on
77 * the returned {@link Future} from any of the methods below.

78 *

79 *
Performance

80 * When tuning this class for optimal performance, benchmarking your particular
81 * hardware is the best approach. For some rough guidelines though, there are
82 * two resources you want to watch closely:
83 *

84 *
JVM Heap Memory (Assume physical machine memory is always sufficiently
85 * large)

86 *
# of CPU Cores

87 *

88 * You never want to allocate more scaling threads than you have CPU cores and
89 * on a sufficiently busy host where some of the cores may be busy running a
90 * database or a web server, you will want to allocate even less scaling
91 * threads.
92 *

93 * So as a maximum you would never want more scaling threads than CPU cores in
94 * any situation and less so on a busy server.
95 *

96 * If you allocate more threads than you have available CPU cores, your scaling
97 * operations will slow down as the CPU will spend a considerable amount of time
98 * context-switching between threads on the same core trying to finish all the
99 * tasks in parallel. You might still be tempted to do this because of the I/O
100 * delay some threads will encounter reading images off disk, but when you do
101 * your own benchmarking you'll likely find (as I did) that the actual disk I/O
102 * necessary to pull the image data off disk is a much smaller portion of the
103 * execution time than the actual scaling operations.
104 *

105 * If you are executing on a storage medium that is unexpectedly slow and I/O is
106 * a considerable portion of the scaling operation (e.g. S3 or EBS volumes),
107 * feel free to try using more threads than CPU cores to see if that helps; but
108 * in most normal cases, it will only slow down all other parallel scaling
109 * operations.
110 *

111 * As for memory, every time an image is scaled it is decoded into a
112 * {@link BufferedImage} and stored in the JVM Heap space (decoded image
113 * instances are always larger than the source images on-disk). For larger
114 * images, that can use up quite a bit of memory. You will need to benchmark
115 * your particular use-cases on your hardware to get an idea of where the sweet
116 * spot is for this; if you are operating within tight memory bounds, you may
117 * want to limit simultaneous scaling operations to 1 or 2 regardless of the
118 * number of cores just to avoid having too many {@link BufferedImage} instances
119 * in JVM Heap space at the same time.
120 *

121 * These are rough metrics and behaviors to give you an idea of how best to tune
122 * this class for your deployment, but nothing can replacement writing a small
123 * Java class that scales a handful of images in a number of different ways and
124 * testing that directly on your deployment hardware.
125 *
Resource Overhead

126 * The {@link ExecutorService} utilized by this class won't be initialized until
127 * one of the operation methods are called, at which point the
128 * service will be instantiated for the first time and operation
129 * queued up.
130 *

131 * More specifically, if you have no need for asynchronous image processing
132 * offered by this class, you don't need to worry about wasted resources or
133 * hanging/idle threads as they will never be created if you never use this
134 * class.
135 *
Cleaning up Service Threads

136 * By default the {@link Thread}s created by the internal
137 * {@link ThreadPoolExecutor} do not run in daemon mode; which
138 * means they will block the host VM from exiting until they are explicitly shut
139 * down in a client application; in a server application the container will shut
140 * down the pool forcibly.
141 *

142 * If you have used the {@link AsyncScalr} class and are trying to shut down a
143 * client application, you will need to call {@link #getService()} then
144 * {@link ExecutorService#shutdown()} or {@link ExecutorService#shutdownNow()}
145 * to have the threads terminated; you may also want to look at the
146 * {@link ExecutorService#awaitTermination(long, TimeUnit)} method if you'd like
147 * to more closely monitor the shutting down process (and finalization of
148 * pending scale operations).
149 *
Reusing Shutdown AsyncScalr

150 * If you have previously called shutdown on the underlying service
151 * utilized by this class, subsequent calls to any of the operations this class
152 * provides will invoke the internal {@link #checkService()} method which will
153 * replace the terminated underlying {@link ExecutorService} with a new one via
154 * the {@link #createService()} method.
155 *
Custom Implementations

156 * If a subclass wants to customize the {@link ExecutorService} or
157 * {@link ThreadFactory} used under the covers, this can be done by overriding
158 * the {@link #createService()} method which is invoked by this class anytime a
159 * new {@link ExecutorService} is needed.
160 *

161 * By default the {@link #createService()} method delegates to the
162 * {@link #createService(ThreadFactory)} method with a new instance of
163 * {@link DefaultThreadFactory}. Either of these methods can be overridden and
164 * customized easily if desired.
165 *

166 * TIP: A common customization to this class is to make the
167 * {@link Thread}s generated by the underlying factory more server-friendly, in
168 * which case the caller would want to use an instance of the
169 * {@link ServerThreadFactory} when creating the new {@link ExecutorService}.
170 *

171 * This can be done in one line by overriding {@link #createService()} and
172 * returning the result of:
173 * return createService(new ServerThreadFactory());
174 *

175 * By default this class uses an {@link ThreadPoolExecutor} internally to handle
176 * execution of queued image operations. If a different type of
177 * {@link ExecutorService} is desired, again, simply overriding the
178 * {@link #createService()} method of choice is the right way to do that.
179 *
180 * @author Riyad Kalla<EMAIL_ADDRESS>181 * @since 3.2
182 */
183 @SuppressWarnings("javadoc")
184 public class AsyncScalr {
185 /**
186 * System property name used to set the number of threads the default
187 * underlying {@link ExecutorService} will use to process async image
188 * operations.
189 *

190 * Value is "imgscalr.async.threadCount".
191 */
192 public static final String THREAD_COUNT_PROPERTY_NAME = "imgscalr.async.threadCount";
193
194 /**
195 * Number of threads the internal {@link ExecutorService} will use to
196 * simultaneously execute scale requests.
197 *

198 * This value can be changed by setting the
199 * imgscalr.async.threadCount system property (see
200 * {@link #THREAD_COUNT_PROPERTY_NAME}) to a valid integer value > 0.
201 *

202 * Default value is 2.
203 */
204 public static final int THREAD_COUNT = Integer.getInteger(
205 THREAD_COUNT_PROPERTY_NAME, 2);
206
207 /**
208 * Initializer used to verify the THREAD_COUNT system property.
209 */
210 static {
211 if (THREAD_COUNT < 1)
212 throw new RuntimeException("System property '"
213 + THREAD_COUNT_PROPERTY_NAME + "' set THREAD_COUNT to "
214 + THREAD_COUNT + ", but THREAD_COUNT must be > 0.");
215 }
216
217 protected static ExecutorService service;
218
219 /**
220 * Used to get access to the internal {@link ExecutorService} used by this
221 * class to process scale operations.
222 *

223 * NOTE: You will need to explicitly shutdown any service
224 * currently set on this class before the host JVM exits.
225 *

226 * You can call {@link ExecutorService#shutdown()} to wait for all scaling
227 * operations to complete first or call
228 * {@link ExecutorService#shutdownNow()} to kill any in-process operations
229 * and purge all pending operations before exiting.
230 *

231 * Additionally you can use
232 * {@link ExecutorService#awaitTermination(long, TimeUnit)} after issuing a
233 * shutdown command to try and wait until the service has finished all
234 * tasks.
235 *
236 * @return the current {@link ExecutorService} used by this class to process
237 * scale operations.
238 */
239 public static ExecutorService getService() {
240 return service;
241 }
242
243 /**
244 * @see Scalr#apply(BufferedImage, BufferedImageOp...)
245 */
246 public static Future<BufferedImage> apply(final BufferedImage src,
247 final BufferedImageOp... ops) throws IllegalArgumentException,
248 ImagingOpException {
249 checkService();
250
251 return service.submit(new Callable<BufferedImage>() {
252 public BufferedImage call() throws Exception {
253 return Scalr.apply(src, ops);
254 }
255 });
256 }
257
258 /**
259 * @see Scalr#crop(BufferedImage, int, int, BufferedImageOp...)
260 */
261 public static Future<BufferedImage> crop(final BufferedImage src,
262 final int width, final int height, final BufferedImageOp... ops)
263 throws IllegalArgumentException, ImagingOpException {
264 checkService();
265
266 return service.submit(new Callable<BufferedImage>() {
267 public BufferedImage call() throws Exception {
268 return Scalr.crop(src, width, height, ops);
269 }
270 });
271 }
272
273 /**
274 * @see Scalr#crop(BufferedImage, int, int, int, int, BufferedImageOp...)
275 */
276 public static Future<BufferedImage> crop(final BufferedImage src,
277 final int x, final int y, final int width, final int height,
278 final BufferedImageOp... ops) throws IllegalArgumentException,
279 ImagingOpException {
280 checkService();
281
282 return service.submit(new Callable<BufferedImage>() {
283 public BufferedImage call() throws Exception {
284 return Scalr.crop(src, x, y, width, height, ops);
285 }
286 });
287 }
288
289 /**
290 * @see Scalr#pad(BufferedImage, int, BufferedImageOp...)
291 */
292 public static Future<BufferedImage> pad(final BufferedImage src,
293 final int padding, final BufferedImageOp... ops)
294 throws IllegalArgumentException, ImagingOpException {
295 checkService();
296
297 return service.submit(new Callable<BufferedImage>() {
298 public BufferedImage call() throws Exception {
299 return Scalr.pad(src, padding, ops);
300 }
301 });
302 }
303
304 /**
305 * @see Scalr#pad(BufferedImage, int, Color, BufferedImageOp...)
306 */
307 public static Future<BufferedImage> pad(final BufferedImage src,
308 final int padding, final Color color, final BufferedImageOp... ops)
309 throws IllegalArgumentException, ImagingOpException {
310 checkService();
311
312 return service.submit(new Callable<BufferedImage>() {
313 public BufferedImage call() throws Exception {
314 return Scalr.pad(src, padding, color, ops);
315 }
316 });
317 }
318
319 /**
320 * @see Scalr#resize(BufferedImage, int, BufferedImageOp...)
321 */
322 public static Future<BufferedImage> resize(final BufferedImage src,
323 final int targetSize, final BufferedImageOp... ops)
324 throws IllegalArgumentException, ImagingOpException {
325 checkService();
326
327 return service.submit(new Callable<BufferedImage>() {
328 public BufferedImage call() throws Exception {
329 return Scalr.resize(src, targetSize, ops);
330 }
331 });
332 }
333
334 /**
335 * @see Scalr#resize(BufferedImage, Method, int, BufferedImageOp...)
336 */
337 public static Future<BufferedImage> resize(final BufferedImage src,
338 final Method scalingMethod, final int targetSize,
339 final BufferedImageOp... ops) throws IllegalArgumentException,
340 ImagingOpException {
341 checkService();
342
343 return service.submit(new Callable<BufferedImage>() {
344 public BufferedImage call() throws Exception {
345 return Scalr.resize(src, scalingMethod, targetSize, ops);
346 }
347 });
348 }
349
350 /**
351 * @see Scalr#resize(BufferedImage, Mode, int, BufferedImageOp...)
352 */
353 public static Future<BufferedImage> resize(final BufferedImage src,
354 final Mode resizeMode, final int targetSize,
355 final BufferedImageOp... ops) throws IllegalArgumentException,
356 ImagingOpException {
357 checkService();
358
359 return service.submit(new Callable<BufferedImage>() {
360 public BufferedImage call() throws Exception {
361 return Scalr.resize(src, resizeMode, targetSize, ops);
362 }
363 });
364 }
365
366 /**
367 * @see Scalr#resize(BufferedImage, Method, Mode, int, BufferedImageOp...)
368 */
369 public static Future<BufferedImage> resize(final BufferedImage src,
370 final Method scalingMethod, final Mode resizeMode,
371 final int targetSize, final BufferedImageOp... ops)
372 throws IllegalArgumentException, ImagingOpException {
373 checkService();
374
375 return service.submit(new Callable<BufferedImage>() {
376 public BufferedImage call() throws Exception {
377 return Scalr.resize(src, scalingMethod, resizeMode, targetSize,
378 ops);
379 }
380 });
381 }
382
383 /**
384 * @see Scalr#resize(BufferedImage, int, int, BufferedImageOp...)
385 */
386 public static Future<BufferedImage> resize(final BufferedImage src,
387 final int targetWidth, final int targetHeight,
388 final BufferedImageOp... ops) throws IllegalArgumentException,
389 ImagingOpException {
390 checkService();
391
392 return service.submit(new Callable<BufferedImage>() {
393 public BufferedImage call() throws Exception {
394 return Scalr.resize(src, targetWidth, targetHeight, ops);
395 }
396 });
397 }
398
399 /**
400 * @see Scalr#resize(BufferedImage, Method, int, int, BufferedImageOp...)
401 */
402 public static Future<BufferedImage> resize(final BufferedImage src,
403 final Method scalingMethod, final int targetWidth,
404 final int targetHeight, final BufferedImageOp... ops) {
405 checkService();
406
407 return service.submit(new Callable<BufferedImage>() {
408 public BufferedImage call() throws Exception {
409 return Scalr.resize(src, scalingMethod, targetWidth,
410 targetHeight, ops);
411 }
412 });
413 }
414
415 /**
416 * @see Scalr#resize(BufferedImage, Mode, int, int, BufferedImageOp...)
417 */
418 public static Future<BufferedImage> resize(final BufferedImage src,
419 final Mode resizeMode, final int targetWidth,
420 final int targetHeight, final BufferedImageOp... ops)
421 throws IllegalArgumentException, ImagingOpException {
422 checkService();
423
424 return service.submit(new Callable<BufferedImage>() {
425 public BufferedImage call() throws Exception {
426 return Scalr.resize(src, resizeMode, targetWidth, targetHeight,
427 ops);
428 }
429 });
430 }
431
432 /**
433 * @see Scalr#resize(BufferedImage, Method, Mode, int, int,
434 * BufferedImageOp...)
435 */
436 public static Future<BufferedImage> resize(final BufferedImage src,
437 final Method scalingMethod, final Mode resizeMode,
438 final int targetWidth, final int targetHeight,
439 final BufferedImageOp... ops) throws IllegalArgumentException,
440 ImagingOpException {
441 checkService();
442
443 return service.submit(new Callable<BufferedImage>() {
444 public BufferedImage call() throws Exception {
445 return Scalr.resize(src, scalingMethod, resizeMode,
446 targetWidth, targetHeight, ops);
447 }
448 });
449 }
450
451 /**
452 * @see Scalr#rotate(BufferedImage, Rotation, BufferedImageOp...)
453 */
454 public static Future<BufferedImage> rotate(final BufferedImage src,
455 final Rotation rotation, final BufferedImageOp... ops)
456 throws IllegalArgumentException, ImagingOpException {
457 checkService();
458
459 return service.submit(new Callable<BufferedImage>() {
460 public BufferedImage call() throws Exception {
461 return Scalr.rotate(src, rotation, ops);
462 }
463 });
464 }
465
466 protected static ExecutorService createService() {
467 return createService(new DefaultThreadFactory());
468 }
469
470 protected static ExecutorService createService(ThreadFactory factory)
471 throws IllegalArgumentException {
472 if (factory == null)
473 throw new IllegalArgumentException("factory cannot be null");
474
475 return Executors.newFixedThreadPool(THREAD_COUNT, factory);
476 }
477
478 /**
479 * Used to verify that the underlying service points at an
480 * active {@link ExecutorService} instance that can be used by this class.
481 *

482 * If service is null, has been shutdown or
483 * terminated then this method will replace it with a new
484 * {@link ExecutorService} by calling the {@link #createService()} method
485 * and assigning the returned value to service.
486 *

487 * Any subclass that wants to customize the {@link ExecutorService} or
488 * {@link ThreadFactory} used internally by this class should override the
489 * {@link #createService()}.
490 */
491 protected static void checkService() {
492 if (service == null || service.isShutdown() || service.isTerminated()) {
493 /*
494 * If service was shutdown or terminated, assigning a new value will
495 * free the reference to the instance, allowing it to be GC'ed when
496 * it is done shutting down (assuming it hadn't already).
497 */
498 service = createService();
499 }
500 }
501
502 /**
503 * Default {@link ThreadFactory} used by the internal
504 * {@link ExecutorService} to creates execution {@link Thread}s for image
505 * scaling.
506 *

507 * More or less a copy of the hidden class backing the
508 * {@link Executors#defaultThreadFactory()} method, but exposed here to make
509 * it easier for implementors to extend and customize.
510 *
511 * @author Doug Lea
512 * @author Riyad Kalla<EMAIL_ADDRESS>513 * @since 4.0
514 */
515 protected static class DefaultThreadFactory implements ThreadFactory {
516 protected static final AtomicInteger poolNumber = new AtomicInteger(1);
517
518 protected final ThreadGroup group;
519 protected final AtomicInteger threadNumber = new AtomicInteger(1);
520 protected final String namePrefix;
521
522 DefaultThreadFactory() {
523 SecurityManager manager = System.getSecurityManager();
524
525 /*
526 * Determine the group that threads created by this factory will be
527 * in.
528 */
529 group = (manager == null ? Thread.currentThread().getThreadGroup()
530 : manager.getThreadGroup());
531
532 /*
533 * Define a common name prefix for the threads created by this
534 * factory.
535 */
536 namePrefix = "pool-" + poolNumber.getAndIncrement() + "-thread-";
537 }
538
539 /**
540 * Used to create a {@link Thread} capable of executing the given
541 * {@link Runnable}.
542 *

543 * Thread created by this factory are utilized by the parent
544 * {@link ExecutorService} when processing queued up scale operations.
545 */
546 public Thread newThread(Runnable r) {
547 /*
548 * Create a new thread in our specified group with a meaningful
549 * thread name so it is easy to identify.
550 */
551 Thread thread = new Thread(group, r, namePrefix
552 + threadNumber.getAndIncrement(), 0);
553
554 // Configure thread according to class or subclass
555 thread.setDaemon(false);
556 thread.setPriority(Thread.NORM_PRIORITY);
557
558 return thread;
559 }
560 }
561
562 /**
563 * An extension of the {@link DefaultThreadFactory} class that makes two
564 * changes to the execution {@link Thread}s it generations:
565 *

566 *
Threads are set to be daemon threads instead of user threads.

567 *
Threads execute with a priority of {@link Thread#MIN_PRIORITY} to
568 * make them more compatible with server environment deployments.

569 *

570 * This class is provided as a convenience for subclasses to use if they
571 * want this (common) customization to the {@link Thread}s used internally
572 * by {@link AsyncScalr} to process images, but don't want to have to write
573 * the implementation.
574 *
575 * @author Riyad Kalla<EMAIL_ADDRESS>576 * @since 4.0
577 */
578 protected static class ServerThreadFactory extends DefaultThreadFactory {
579 /**
580 * Overridden to set daemon property to true
581 * and decrease the priority of the new thread to
582 * {@link Thread#MIN_PRIORITY} before returning it.
583 */
584 @Override
585 public Thread newThread(Runnable r) {
586 Thread thread = super.newThread(r);
587
588 thread.setDaemon(true);
589 thread.setPriority(Thread.MIN_PRIORITY);
590
591 return thread;
592 }
593 }
594 }