{% load static %}
Welcome to our Zoo Application!
Main Project Home
Zoo Home
Become a Member
The Ninja Shop
Meet the Animals
Welcome to {{zooName}}, we are located in {{zooLocation}}
We have the following animals here:
{% for animals in zooAnimals %}
{{animals}}
{% endfor %}


How it Works
We're turning privileged knowledge about China into common knowledge. Knowledge that enables you to make faster and better decisions and to grow your business.
Find an Expert
Browse our community of China experts to find the right one for you.
Connect Directly
Pick the China expert you'd like to consult with based on their profile, availability and feedback.
Request a Call
Consult 1-1 with your China expert over the phone for any specific question you have in mind.
Find Your China Expert
Find, schedule and pay for expert advice on China over the phone instantly.
Wentao Zhang
Consultant
Trained Chinese recruiter and management consultant. Wentao has worked and selected candidates for Top 3 firms (MBB) worldwide. He has experience with different geographies and expert career tracks.
ConsultRory Bate-Williams
Entrepreneur
MBA Graduate from the Cheung Kong Graduate School of Business in Beijing with 5+ years experience in food manufacturing and technology startups. Working between the UK and China.
ConsultJeremy Solomons
Exporter
Founder of a male grooming business with significant exports to China. Knowledge of manufacturing, supply chain management and distribution throughout Western Europe and China.
ConsultYour Shortcut to China
Advice, insight, and recommendations from China experts who have been there before.
Browse Specialities
Chinese Business Structures
Opening Subsidiaries
M&A
Investing
Financing
Restructuring
Supply Chain
Localisation
Market Research
Marketing & Social
Strategic Advice
Manufacturing
Search by Skill
Finance Marketing Fundraising M&A Recruiting Sales
account_balance
Knowledge
You want to work with proven strategists, business development professionals and fundraisers. But beyond that you want China-market knowledge and expertise.
language
Networks
You want access to strong and wide networks, on the ground experinence, and specific expertise. You want people you can trust and who can connect you to the right leaders.
wb_incandescent
Advice
Our advisors have built up years of experience and understanding on China. They want to share what they know to save you time and money.


| DOSE: |
15 mg |
oral |
2C-T-4 |
(powder / crystals) |
There seems to be very little information around regarding 2C-T-4, but I recently has a chance to try it and so I did.
In the morning I ate a light breakfast and dealt with a few things for a couple of hours. I then brewed and drank some ginger tea, presuming that there may be some nausea ahead, and wanting my 1st experience with this to go well.
0.00 - put 15mg of 2C-T-4 into some juice and drank it down, barely tasted it.
+0.40 - 1st alerts
+1.30 - a slight vivid difference noticed in my visual field.
+2.20 - noticed that there are busy CEVs but they are also very feint.
+4.00 - over the last 2 hours or so the intensity of the OEVs continued to build, reaching the point that for a the 1st time in a long time I engaged in some wall staring, they were nothing amazing but more than I expected.
After adjusting to the visuals I settled in to wacth a few epsiodes of 'Serial Experiments Lain' (in the course of these 2 hours), which had me transfixed, I felt really involved with the story, and my eyes enjoyed the artwork even more than usual.
Then in the last part of this period I suddenly became distracted, I felt a sense of deeping of the effects as if my room had suddenly become larger and I could here a deep drum beat somewhere in the distance. For a short while I just sat there and abosorbed this feeling, which I can't easily describe, but at a push I'd say it was like a slow motion genetle version of when 5-meo-dmt 1st hits you in the seconds after you smoke it.
After I came out of this I decided to write a few notes of what had been going on throughout.
And then it got a bit odd. I looked down at what I had written and the final sentence read 'This is not my writting'. Inital puzzled at this I entered into a verbabl and written dialouge with myself, paid close attention to my environment and mind, and debated the possibility that some other entity had borrowed my hand for a few seconds. I decided I didn't want to dwell on this since the moment seemed to have passed.
+4.30 - still enjoying some effects, but now seems to have stablised into a non-specific trip, with nothing being particularly enchanced, I went about normal tasks, checking mail, reading news, etc quite happily.
+6.20 - things are definately fading away now, a slight headache has developed but it's of no concern. Called some friends and carried out normal conversations with the slightest spaciness.
Throughout the experience, there was some minor disturbance to my stomach, but never approaching what I would call nausea.
I listened to music on and off throughout, but at no point did it really draw my attention, though this could be because I was listening to a random selection of Mp3s, rather than a co-ordinated audio strike.
I was impressed with the visuals, they were more prominent than on the same (15mg) dose of 2C-T-7, which surprised me. I think that a higher dose (being more easily possible due to the lack of nausea), could yeild some strong visuals (as it stands I would compare them to mild acid visuals).
I was pleased with this overal, and look forward to re-visiting it at some point.
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


This sample shows how to implement a clip-indicating volume meter in Web Audio, using a ScriptProcessor. It's necessary to use a ScriptProcessor in order to not miss any clipping samples - otherwise you could implement this using a RealtimeAnalyser to only grab samples when necessary.
Usage:
var meter = createAudioMeter(audioContext,clipLevel,averaging,clipLag); audioContext: the AudioContext you're using. clipLevel: the level (0 to 1) that you would consider "clipping". Defaults to 0.98. averaging: how "smoothed" you would like the meter to be over time. Should be between 0 and less than 1. Defaults to 0.95. clipLag: how long you would like the "clipping" indicator to show after clipping has occured, in milliseconds. Defaults to 750ms. meter.checkClipping(); returns true if the node has clipped in the last clipLag milliseconds. meter.shutdown(); used to destroy the node (it's important to disconnect and remove the event handler for any ScriptProcessor).


I have spent most of my adult life working in the service industry, but now work as a carpenter. I grew up in the country, and have finally made my return to living in the country. As such, I would love the opportunity to work remotely and make a living wage, so I am trying to learn how to code so that I can achieve the lifestyle I most desire.
I have a bachelor's degree in Health Science, and outside of a brief stint working as a food safety inspector for the Oregon Department of Agriculture, I never succeeded at pursuing a career in the way my college education suggested I might.
my favorite past-times, in order of importance


Available fields
{% for variable in query.variables.values %}
- {{ variable.name }}
{% endfor %}
Queries
- Search for an exact value: field_name=value
- Search for an exact value containing space: field_name="value with space"
- Containing a text: field_name:val
- Exclude a value: field_name!=value
- You can also use <, >, <= and >= to find ranges of values: field_name<10
|


DrugWise infographic on drug dangers (PDF)
Some people think everyone who takes drugs will end up dead. Others seem to think that drug use is not dangerous at all. The truth is somewhere in between… Drug use can never be 100 per cent safe but it is not always as dangerous as people think. The dangers of drug use depend on drug, set and setting factors. The drug bit is everything connected with the drug and how it is used. The set bit is everything connected with the person who is using the drugs. The setting bit is about what the person is doing at the time, where they are, the environment they live in etc. The basic principle is that drug dangers are the result of interactions between drug, set and setting.
The drug
Drugs are not all the same. Different drugs have different dangers associated with them. Some drugs (such as alcohol, heroin and tranquillisers) have a sedative effect which slow down the way the body and brain function. They can have a numbing effect that produces drowsiness if a lot is taken. Other drugs (such as amphetamine, cocaine, crack and ecstasy) have a stimulant effect giving a rush of energy and making people more alert. A third group of drugs (such as LSD and magic mushrooms and to a lesser extent cannabis and ecstasy) have a hallucinogenic effect. This means they tend to alter the way the user feels, sees, hears, tastes or smells. Sedative drugs like alcohol and heroin can lead to fatal overdose if a lot is taken. They can also affect co-ordination making accidents more likely. Use of sedatives can also lead to physical dependence and withdrawal symptoms while others drugs like cannabis cannot. Stimulant drugs can produce anxiety or panic attacks particularly if taken in large quantities. They can be particularly dangerous for people who have heart or blood pressure problems. Hallucinogenic drugs sometimes produce very disturbing experiences and may lead to erratic or dangerous behaviour by the user. And of course some drugs are legal to use and others are not. Being arrested and getting a conviction can lead to all sorts of problems.
The dangers of drug use will also depend on: How much is taken. The more that is taken the greater the danger. Taking too much of a sedative drug can lead to a fatal overdose. Taking a large dose of a stimulant drug can lead to panic attacks,heart problems or in extreme cases, psychotic behaviour (where all sense of reality is lost). Taking a large dose of a hallucinogenic drug may lead to disturbing experiences. Taking a high dose of many drugs can lead to a lack of co-ordination and increase the likelihood of accidents. How often the drug is taken. The more often a drug is taken, the greater the risks to your health, particularly if the body hasn’t had time to recover. With some drugs a tolerance can develop and more needs to be taken in order to keep getting an effect. If heavy, frequent use is followed by a period of non-use tolerance levels drop. Taking the same amount of drug needed with high tolerance levels can bring on an overdose, especially with drugs like heroin. Not all drugs produce tolerance. LSD has its own safeguard against tolerance. If taken too frequently it just stops working. No matter how much is taken there will be no effect at all. Other things in drugs. Many illegal drugs, especially in powder or pill form, have other drugs or substances mixed in with them. These can change the effect of the drugs and contribute to dangers. Drug mixtures. Combining drugs can produce unpredictable and sometimes dangerous effects. In particular, mixtures of sedative drugs can be very dangerous. Many reported drug overdoses involve mixtures of alcohol and tranquillisers or opiates. How a drug is taken. The method of use will influence the effect the drug has and its possible dangers. Injecting drugs has a very quick and intense effect. Snorting or inhaling drugs can also have a quick but slightly less intensive effect. Smoking drugs produces a slower, more subtle effect sometimes. The slowest effect of all is eating or drinking a drug. Drug dangers also vary with the method used to take them: Injecting is particularly risky because it is difficult to know how much is being taken. Injection also carries the risk of infection by blood borne diseases if any injecting equipment is shared. Highest profile recently has been given to HIV, the virus that leads to AIDS, but there are also risks from Hepatitis B and C, another very serious blood borne disease. Eating or drinking a drug can be risky if people take a lot in one go. The effects tend to be slow but once they come on it is too late to do anything about it. Examples are drinking too much alcohol in a short space of time or eating a lump of cannabis. In such cases people can suddenly feel very drunk or stoned and become very disorientated. Snorting drugs like amphetamine or cocaine powder up the nose on a regular basis can lead to damage to the nasal membranes although this risk has sometimes been exaggerated. There are more or less dangerous ways of inhaling solvents such as glues, gases and aerosols.  Squirting aerosols or butane straight down the throat has lead to deaths through freezing of the airways. Squirting onto a rag or small bag then inhaling is not as dangerous. Smoking a drug is a relatively less dangerous method of use although regular smoking can damage the respiratory system especially if the drug is smoked with tobacco, as is often the case with cannabis.
The set
The effects and dangers of drugs are influenced by many things. Personal factors involving the person who is using the drugs can be just as important as the drugs being used. The drug experience and the expectations of the user are important. Many young people experimenting with drugs for the first time will be unsure about what to do or what to expect. This ignorance and lack of experience can itself be dangerous. The mental or psychological state of the drug user is very important. The mood people are in when they take drugs influences the effects and dangers of drug use. If they are anxious, depressed or unstable they are more likely to have disturbing experiences when using drugs. They can become more anxious and disorientated, possibly aggressive, ‘freak out’ and do crazy things or take too much etc. As a general rule someone who is happy and stable is more likely to use more carefully and not be so badly affected. Other things about the person which may effect drug dangers include: If they have physical health problems like heart disease, high blood pressure, epilepsy, diabetes, asthma or liver problems, drug use could be more dangerous and possibly make their health problem worse. The drug users energy levels at the time of consuming drugs can also be important. If they are tired at the time of use then it may have a different or more extreme effect than if they are fresh and full of energy. If the user has a low body weight the same amount of drugs may effect them more than heavier people. Also people who have eating disorders like anorexia or bulimia can find that drug use makes their eating difficulties even worse. Males and females can experience drugs in different ways. This is both because of their different physical make up and the different way people view male and female drug use. On average women are of smaller body weight than men, have smaller livers as a proportion of body weight and a greater proportion of body fat. This means that, generally speaking, the same amount of drugs will have a greater effect on a woman than on a man. Obviously this will not apply with a much larger than average woman or a much smaller than average man. The effects and risks of drug use are also influenced by attitudes towards men and women taking drugs. Women are often seen as doubly bad if they take drugs. Male drug use is often seen as more acceptable than that of women and mothers, in particular, come in for a lot of criticism if they use drugs. Male drug users who are parents are not usually seen in the same sort of way. Sexism can also affect the experience of drug use and drug risks.
The setting
The place where drugs are used and what people are doing at the time can influence how dangerous it is. For example, some young people take drugs in out-of-the-way places that are particularly dangerous like canal banks, near motorways, in derelict buildings etc. Accidents are much more likely in these places, especially if the user is intoxicated. Also if anything does go wrong, it is unlikely help will be at hand or that an ambulance could easily be called. Even if the setting is not in itself inherently dangerous there may be other types of risks associated with the place of use. Using or taking drugs into school has led to substantial numbers of young people being expelled from school with drastic effects on their future careers. Driving a car or riding a bicycle or operating machinery while on drugs, will greatly increase the risks of accidents. Drug use can lower inhibitions, increasing the likelihood of sexual encounters. Safer sex – eg by using condoms – will be much more difficult if the person concerned is intoxicated. The risks of unwanted pregnancy, HIV (the virus that leads to AIDS) and other sexually transmitted infections could be increased if people have sex while high on alcohol or drugs. Surveys have found that many young people have sexual encounters while under the influence of drugs, particularly alcohol and/or cannabis. Another setting danger is that of people over-exerting themselves when using ecstasy. Ecstasy gives a buzz of energy and is often used in clubs while dancing non-stop for long periods. In some situations people have danced for hours without a break in hot, crowded environments. They run the risk of becoming dehydrated and getting heat exhaustion. In some cases this can be very dangerous and it has led to a number of deaths. ‘Chilling out’ – having a break from dancing, cooling off and sipping or drinking water or fruit juice (not alcohol) at regular intervals (around 1 pint per hour).
In conclusion
There are many possible risks and dangers involved when using drugs. To fully understand potential risks and dangers you will need to think about drug, set and setting. In addition people may experience problems with drug use because of other people’s perceptions and responses to them. Examples include conflict in family and other personal relationships, getting thrown out of school/ college or work, getting a criminal record, getting into debt to pay for drugs, violence associated with drug dealing etc.


Eclipse (@ www.eclipse.org) is an open-source Integrated Development Environment (IDE) supported by IBM. Eclipse is popular for Java application development (Java SE and Java EE) and Android apps. It also supports C/C++, PHP, Python, Perl, and other web project developments via extensible plug-ins. Eclipse is cross-platform and runs under Windows, Linux and Mac OS.
Eclipse Versions
The various versions are:
- Eclipse 1.0 (November 7, 2001): based on an earlier Java IDE called VisualAge from IBM.
- Eclipse 2.0 (June 28, 2002)
- Eclipse 2.1 (March 28, 2003)
- Eclipse 3.0 (June 25, 2004)
- Eclipse 3.1 (June 28, 2005)
- Eclipse 3.2 (June 30, 2006) (Callisto - named after one of the Jupiter's Galilean moons): started annual simultaneous release of all the related Eclipse projects.
- Eclipse 3.3 (June 25, 2007) (Europa - named after another Jupiter's Galilean moons)
- Eclipse 3.4 (June 19, 2008) (Ganymede - named after yet another Jupiter's Galilean moons)
- Eclipse 3.5 (June 12, 2009) (Galileo - named after the great 17th century scientist and astronomer Galileo Galilei)
- Eclipse 3.6 (June 23, 2010) (Helios - named after god of the sun in Greek Mythology)
- Eclipse 3.7 (June 23, 2011) (Indigo)
- Eclipse 4.2 (June 27, 2012) (Juno)
- Eclipse 4.3 (June, 2013) (Kepler)
- Eclipse 4.4 (June, 2014) (Luna)
- Eclipse 4.5 (June, 2015) (Mars)
How to Install Eclipse 4.5 (Mars) for Java
For Windows
Step 0: Install JDK
To use Eclipse for Java programming, you need to first install Java Development Kit (JDK). Read "How to Install JDK (on Windows)".
Step 1: Download
Download Eclipse from http://www.eclipse.org/downloads. For beginners, choose "Eclipse IDE for Java Developers" (32-bit or 64-bit) (e.g., "eclipse-java-luna-SR1a-win32-x86_64.zip
").
Step 2: Unzip
To install Eclipse, simply unzip the downloaded file into a directory of your choice (e.g., "d:\myproject
").
There is no need to run any installer. Moreover, you can simply delete the entire Eclipse directory when it is no longer needed (without running any un-installer). You are free to move or rename the directory. You can install (unzip) multiple copies of Eclipse in the same machine.
For Macs
Read "How to Install Eclipse on Mac".
For Ubuntu Linux
Read "How to Install Eclipse on Ubuntu".
Writing your First Java Program in Eclipse
Step 0: Launch Eclipse
- Start Eclipse by running "
eclipse.exe
" in the Eclipse installed directory. - Choose an appropriate directory for your workspace (i.e., where you would like to save your files).
- If the "Welcome" screen shows up, close it by clicking the "close" button.
Step 1: Create a new Java Project
For each Java application, you need to create a project to keep all the source files, classes and relevant resources.
To create a new Java project:
- Choose "File" menu ⇒ "New" ⇒ "Java project".
- The "New Java Project" dialog pops up.
- In the "Project name" field, enter "
FirstProject
". - Check "Use default location".
- In the "JRE" box, select "Use default JRE (currently 'JDK1.x')". But check the JDK version, you should be using JDK 1.5 and above.
- Click "Finish".
- In the "Project name" field, enter "
Step 2: Write a Hello-world Java Program
- In the "Package Explorer" (left panel) ⇒ Right-click on "
FirstProject
" (or use the "File" menu) ⇒ New ⇒ Class. - The "New Java Class" dialog pops up.
- In "Name" field, enter "
Hello
". - In "package" field, delete the content if it is not empty.
- Check "
public static void main(String[] args)
" box. - Click "Finish".
- In "Name" field, enter "
- The source file "
Hello.java
" opens on the editor panel. Enter the following codes:public class Hello { // "Hello.java" public static void main(String[] args) { System.out.println("Hello, world!"); } }
Step 3: Compile & Execute the Java Program
- There is no need to compile the Java source file explicitly. It is because Eclipse performs the so-called incremental compilation, i.e., the Java statement is compiled as and when it is entered.
- To run the program, right-click anywhere on the source file "
Hello.java
" (or from the "Run" menu) ⇒ Choose "Run As" ⇒ "Java Application". - The output "Hello, world!" appears on the "Console" panel.
NOTES:
- You should create a new Java project for each of your Java application.
- Nonetheless, Eclipse allows you to keep more than one programs in a project, which is handy for writing toy programs (such as your tutorial exercises). If you have more than one files with
main()
method in one project, you need to right-click the source and choose "Run As" ⇒ "Java Application" to run that particular source. Clicking the "Run" button runs the recently-run program (based on the previous configuration). Try clicking on the "down-arrow" besides the "Run" button.
Read the Documentation
At a minimum, you SHOULD browse through Eclipse's "Workbench User Guide" and "Java Development User Guide" - accessible via the Eclipse's "Welcome" page or "Help" menu. This will save you many agonizing hours trying to figure out how to do somethings later.
Debugging Programs in Eclipse
Able to use a graphics debugger to debug program is crucial in programming. It could save you countless hours guessing on what went wrong.
Step 0: Write a Java Program
The following program computes and prints the factorial of n
(=1*2*3*...*n
). The program, however, has a logical error and produce a wrong answer for n
=20
("The Factorial of 20 is -2102132736
" - a negative number?!).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
/** Compute the Factorial of n, where n=20. * n! = 1*2*3*...*n */ public class Factorial { public static void main(String[] args) { int n = 20; // To compute factorial of n int factorial = 1; // Init the product to 1 int i = 1; while (i <= n) { factorial = factorial * i; i++; } System.out.println("The Factorial of " + n + " is " + factorial); } } |
Let's use the graphic debugger to debug the program.
Step 1: Set an Initial Breakpoint
A breakpoint suspends program execution for you to examine the internal states (e.g., value of variables) of the program. Before starting the debugger, you need to set at least one breakpoint to suspend the execution inside the program. Set a breakpoint at main()
method by double-clicking on the left-margin of the line containing main()
. A blue circle appears in the left-margin indicating a breakpoint is set at that line.
Step 2: Start Debugger
Right click anywhere on the source code (or from the "Run" menu) ⇒ "Debug As" ⇒ "Java Application" ⇒ choose "Yes" to switch into "Debug" perspective (A perspective is a particular arrangement of panels to suits a certain development task such as editing or debugging). The program begins execution but suspends its operation at the breakpoint, i.e., the main()
method.
As illustrated in the following diagram, the highlighted line (also pointed to by a blue arrow) indicates the statement to be executed in the next step.
Step 3: Step-Over and Watch the Variables and Outputs
Click the "Step Over" button (or select "Step Over" from "Run" menu) to single-step thru your program. At each of the step, examine the value of the variables (in the "Variable" panel) and the outputs produced by your program (in the "Console" Panel), if any. You can also place your cursor at any variable to inspect the content of the variable.
Single-stepping thru the program and watching the values of internal variables and the outputs produced is the ultimate mean in debugging programs - because it is exactly how the computer runs your program!
Step 4: Breakpoint, Run-To-Line, Resume and Terminate
As mentioned, a breakpoint suspends program execution and let you examine the internal states of the program. To set a breakpoint on a particular statement, double-click the left-margin of that line (or select "Toggle Breakpoint" from "Run" menu).
"Resume" continues the program execution, up to the next breakpoint, or till the end of the program.
"Single-step" thru a loop with a large count is time-consuming. You could set a breakpoint at the statement immediately outside the loop (e.g., Line 11 of the above program), and issue "Resume" to complete the loop.
Alternatively, you can place the cursor on a particular statement, and issue "Run-To-Line" from the "Run" menu to continue execution up to the line.
"Terminate" ends the debugging session. Always terminate your current debugging session using "Terminate" or "Resume" till the end of the program.
Step 5: Switching Back to Java perspective
Click the "Java" perspective icon on the upper-right corner to switch back to the "Java" perspective for further programming (or "Window" menu ⇒ Open Perspective ⇒ Java).
Important: I can's stress more that mastering the use of debugger is crucial in programming. Explore the features provided by the debuggers.
Other Debugger's Features
Modify the Value of a Variable: You can modify the value of a variable by entering a new value in the "Variable" panel. This is handy for temporarily modifying the behavior of a program, without changing the source code.
Step-Into and Step-Return: To debug a method, you need to use "Step-Into" to step into the first statement of the method. ("Step-Over" runs the function in a single step without stepping through the statements within the function.) You could use "Step-Return" to return back to the caller, anywhere within the method. Alternatively, you could set a breakpoint inside a method.
Tips & Tricks
General Usages (for all Programming Tasks)
These are the features that I find to be most useful in Eclipse:
- Maximizing Window (Double-Clicking): You can double-click on the "header" of any panel to maximize that particular panel, and double-click again to restore it back. This feature is particularly useful for writing source code in full panel.
- Shorthand Templates (sysout, for,...): You can type "
sysout
" followed by a ctrl+space (or alt-/) as a shorthand for typing "System.out.println()
".
The default shortcut key (ctrl-space or alt-/) depends on the system. Check your system's shortcut key setting in "Edit" ⇒ "Content Assist" ⇒ "Default". Take note that many of you use ctrl+space to switch between input languages. You need to reconfigure either your language switching hot-key or Eclipse.
Similarly, you can type "for" followed by ctrl-space (or alt-/) to get a for-loop.
You can create your own shorthand in "Window" menu ⇒ "Preferences" ⇒ "Java" ⇒ "Editor" ⇒ "Templates". (Alternatively, in "Window" ⇒ "Preferences" ⇒ type "template" as filter text and choose "Java" ⇒ "Editor" ⇒ "Templates".)
You can change your key settings in "Window" menu ⇒ "Preferences" ⇒ "General" ⇒ "Key" ⇒ choose "Command", "Content Assist". (Alternatively, in "Window" ⇒ "Preferences" ⇒ type "key" as filter text and choose "General" ⇒ "Key".) - Intelli-Sense (ctrl-space): You can use ctrl-space to activate the "intelli-sense" (or content assist). That is, Eclipse will offer you the choices, while you are typing.
- Source Formatting (ctrl-shift-f): Right-click on the source. Choose "Source" ⇒ "Format" to let Eclipse to layout your source codes with the proper indentation.
- Source Toggle Comment (ctrl-/): To comment/uncomment a block of codes, choose "Source" ⇒ "Toggle Comment".
- Hints for Correcting Syntax Error: If there is a syntax error on a statement, a red mark will show up on the left-margin on that statement. You could click on the "light bulb" to display the error message, and also select from the available hints for correcting that syntax error.
- Refactor (or Rename) (alt-shift-r): You can rename a variable, method, class, package or even the project easily in Eclipse. Select and right-click on the entity to be renamed ⇒ "Refactor" ⇒ "Rename". Eclipse can rename all the occurrences of the entity.
- Line Numbers: To show the line numbers, choose "Window" menu ⇒ "Preferences" ⇒ "General" ⇒ "Editors" ⇒ "Text Editors" ⇒ Check the "Show Line Numbers" Box. You can also configure many editor options, such as the number of spaces for tab. Alternatively, you can right-click on the left-margin, and check "Show Line Numbers".
- Error Message Hyperlink: Click on an error message will hyperlink to the corresponding source statement.
- Changing Font Type and Size: From "Window" menu ⇒ "Preferences" ⇒ "General" ⇒ "Appearance" ⇒ "Colors and Fonts" ⇒ expand "Java" ⇒ "Java Editor Text Font" ⇒ "Edit". (Alternatively, in "Window" ⇒ "Preferences" ⇒ type "font" as filter text and choose the appropriate entry.)
- Unicode Support: To enable Unicode support, select "Window" menu ⇒ Preferences ⇒ General ⇒ Workspace ⇒ Text file encoding ⇒ UTF-8. This sets the default character set used for file encoding, similar to VM's command-line option
-Dfile.encoding=UTF-8
. Commonly used charsets for Unicode are UTF-8, UTF-16 (with BOM), UTF-16BE, UTF-16LE. Other charsets are US-ASCII, ISO-8859-1. - Mouse Hover-over: In debug mode, you could configure to show the variable's value when the mouse hovers over the variable. Select "Window" menu ⇒ "Preferences" ⇒ "Java" ⇒ "Editor" ⇒ "Hover".
- Comparing Two Files: In "Package Explorer", select two files (hold the control key) ⇒ Right-click ⇒ Compare with.
- Useful Eclipse Shortcut Keys:
- F3: Goto the declaration of the highlighted variable/method.
- Ctrl-Shift-G: Search for ALL references of the highlighted variable/method in workspace.
- Ctrl-G: Search for the Declaration of a variable/method in workspace.
Don't use Find (Ctrl-F), but use the above context-sensitive search. - Ctrl-Shift-F: Format the source code.
- Ctrl-Shift-O: Organize imports.
- Alt-Shift-R: Rename. (Don't use Find/Replace.)
- Ctrl-Space: auto-complete.
- Package Explorer vs. Navigator: We usually use "Package Explorer" in programming, but it will not show you all the folders and files under the project. On the other hand, "Navigator" is a file manager that shows the exact file structure of the project (similar to Windows Explorer). You can enable the Navigator by "Window" ⇒ Show view ⇒ Navigator.
- Spell Check: To enable spell check, select Window ⇒ Preferences ⇒ type "spell" in the filter ⇒ General ⇒ Editors ⇒ Text Editors ⇒ Spelling ⇒ Check "Enable spell checking". Also provide a "User defined dictionary" (with an initially empty text file).
To correct mis-spell words, right-click and press ctrl-1 (or Edit menu ⇒ Quick Fix). - Eclipse's Log File: Goto Help ⇒ about Eclipse ⇒ Installation details ⇒ Configuration ⇒ View Error Log.
- Viewing two files in split screen: Simply click and hold on the title of one file and drag it to the lower side of the screen. [To view the same file on split screen, create a new editor window by selecting Window ⇒ New Editor; and drag one window to the lower side of the screen.]
- Block Select: Push Alt-Shift-A to toggle between block-select mode and normal mode.
- Snippets:
- To view the snippet window: choose "Window" ⇒ Show View ⇒ Snippets.
- To create a new snippet category: Right-click ⇒ Customize ⇒ New.
- To create a new snippet item: Copy the desired text ⇒ Select the snippet category ⇒ paste as snippet.
- To insert a snippet: place the cursor on the desired location at the editor panel ⇒ click the snippet item.
- Word Wrap (Line Wrap): Word-wrap (or line-wrap) is essential for editing long HTML documents without the horizontal scroll bar. However, the Eclipse's HTML Editor and Text Editor do not support word-wrap.
You could install a plug-in called "Word Wrap" from http://ahtik.com/eclipse-update/.
Choose "Help" ⇒ Install New Software ⇒ in "Work with" Enter "http://ahtik.com/eclipse-update/".
To activate word wrap, right-click on the editor panel ⇒ select "Word Wrap". - Creating "link folder" in project: You do not have to place all the folders under the project base directory, instead, you can use so-called "link folders" to link to folder outside the project base directory.
To create a link folder in a project, right-click on the project ⇒ File ⇒ New ⇒ Folder ⇒ Advanced ⇒ Check Link to alternate Location (Linked Folder). - Running Eclipse in "clean" mode: You can run eclipse in so-called "
clean
" mode, which wipes all the cached data and re-initialize the cache, by running eclipse from command-line with "-clean" argument (i.e., "eclipse -clean
"). It is useful if something is not working proper, especially if you install a new copy of Eclipse. - Show the Right Margin: Window ⇒ Preferences ⇒ General ⇒ Editors ⇒ Text Editors ⇒ Show Print Margin and set the column number.
- Let me know if you have more tips to be included here.
Update Eclipse and Install new Software
- Install New Software: Select "Help" menu ⇒ Install New Software ⇒ In "Work With", pull down the select menu and choose a software site.
- Update: Select "Help" menu ⇒ Check for Updates ⇒.
For Java Application Development Only
- Eclipse 3.7 does not support JDK 7. Eclipse 4.2 does.
- Small Toy Java Programs: You can keep many small programs (with
main()
) in one Java project instead of create a new project for each toy program. To run the desired program, right-click on the source file ⇒ "Run as" ⇒ "Java Application". - Scanner/printf() and JDK 1.5: If you encounter syntax error in using
printf()
orScanner
(which are available from JDK 1.5), you need to check your compiler settings. Select "Window" menu ⇒ Preferences ⇒ open the "Java" node ⇒ select "Compiler" ⇒ in "Compiler compliance level" ⇒ select the latest release, which should be "1.5" or above. - Command-Line Arguments: To provide command-line arguments to your Java program in Eclipse, right-click on the source file ⇒ "Run Configurations" ⇒ Under the "Main" panel, check that "Project" name and "Main Class" are appropriate ⇒ Select the "Argument" tab ⇒ type your command-line arguments inside the "Program Arguments" box ⇒ "Run".
- Resolving Import (Ctrl-Shift-o): To ask Eclipse to insert the
import
statements for classes. Useful when you copy a large chunk of codes without the corresponding import statements. - Including Another Project: To include another project in the same work space, right-click on the project ⇒ Build Path ⇒ Configure Build Path... ⇒ Select "Projects" tab ⇒ "Add..." to select project in the existing work space ⇒ OK.
- Exporting a Project to a JAR file: Right-click on the project ⇒ Export... ⇒ Java, JAR File ⇒ Next ⇒ Select the files to be exported ⇒ Next ⇒ Next ⇒ In "JAR Manifest Specification" dialog, enter the main class (if you wish to run the JAR file directly) ⇒ Finish.
- Unit Testing: If you keep your test in another project, you need to include the project under test in your Build Path (see above).
To create a test case: Right-click on the project ⇒ New ⇒ JUnit Test Case ⇒ the "New JUnit Test Case" dialog appears. Select "New JUnit 4 Test". In "Name", enter your class name. In "Class under test", browse and select the class to be tested.
To run the test: Right-click ⇒ "Run As" ⇒ "JUnit Test". The results are displayed in a special "JUnit console". - Adding External JAR files & Native Libraries (".dll", ".lib", ".a", ".so"): Many external Java packages (such as JOGL, Java3D, JAMA, etc) are available to extend the functions of JDK. These packages typically provide a "
lib
" directory containing JAR files (".jar
") (Java Archive - a single-file package of Java classes) and native libraries (".dll
", ".lib
" for windows, ".a
", ".so
" for Linux and Mac).
To include these external packages into an Eclipse's project, right-click on the project ⇒ Build Path ⇒ Add External Archives ⇒ Navigate to select the JAR files (".jar
") to be included.
In "Package Explorer", right-click on the JAR file added ⇒ Properties:- To include native libraries ("
.dll
", ".lib
", ".a
", ".so
"), select "Native Library" ⇒ "Location Path" ⇒ "External Folder". - To include the javadoc, select "JavaDoc Location" ⇒ "JavaDoc URL" ⇒ You can specify a local file or a remote link.
- To include source file (for debugging), select "Java Source Attachment".
Notes: The JAR files must be included in theCLASSPATH
. The native library directories must be included in JRE's property "java.library.path
", which normally but not necessarily includes all the paths from thePATH
environment variable. Read "External JAR files and Native Libraries". - To include native libraries ("
- Creating a User Library: You can also create a Eclipse's user library to include a set of JAR files and native libraries, that can then be added into subsequent Eclipse projects.
For example, I created a user library for "JOGL" as follows:
- From "Window" menu ⇒ Preferences ⇒ Java ⇒ Build Path ⇒ User Libraries ⇒ New ⇒ In "User library name", enter "
jogl
". The "User Library" dialog appears. - In "User Library" dialog ⇒ Select "
jogl
" ⇒ Add JAR... ⇒ Navigate to<JOGL_HOME>/lib
, and select "gluegen-rt.jar
" and "jogl.jar
". - Expand the "
jogl.jar
" node ⇒ Select "Native library location: (none)" ⇒ Edit... ⇒ External Folder... ⇒ select<JOGL_HOME>/lib
. - Expand the "
jogl.jar
" node ⇒ Select "Javadoc location: (none)"
⇒ Edit... ⇒ Javadoc in archive ⇒ In "Archive Path", "Browse" and select the downloaded JOGL API documentation zip-file ⇒ In "Path within archive", "Browse" and expand the zip-file to select the top-level path (if any) ⇒ Validate. Alternatively, you can provide the path to the un-zipped javadocs. This is needed for Eclipse to display javadoc information about classes, fields, and methods. - You may provide the source files by editing "Source attachment: (none)". Source is needed only if you are interested to debug into the JOGL source codes.
jogl
". - From "Window" menu ⇒ Preferences ⇒ Java ⇒ Build Path ⇒ User Libraries ⇒ New ⇒ In "User library name", enter "
- Running an External Program: Suppose that you want to run a Perl script on the selected file, you can configure an external tool as follows:
- From "Run" menu ⇒ External Tools ⇒ External Tools Configuration... ⇒ The "External Tools Configuration" dialog appears.
- In "Name", enter your tool name.
- Choose the "Main" tab ⇒ In "Location", "Browse File System..." to choose the perl interpreter "perl" ⇒ In "Arguments", enter "
path/scriptname.pl ${resource_loc}
", where${resource_loc}
is an Eclipse variable that denotes the currently selected resource with absolute path. - Choose the "Common" tab ⇒ In "Standard Input and Output", uncheck "Allocate Console", check "File" and provide an output file (e.g.,
d:\temp\${resource_name}.txt
). - (If you use the CYGWIN perl interpreter, need to set environment variable CYGWIN=nodosfilewarning to disable warning message.)
- Viewing Hex Code of Primitive Variables in Debug mode: In debug perspective, "Variable" panel ⇒ Select the "menu" (inverted triangle) ⇒ Java ⇒ Java Preferences... ⇒ Primitive Display Options ⇒ Check "Display hexadecimal values (byte, short, char, int, long)".
- Adding a New Version of JDK/JRE: First, you can check the installed JDK/JRE via "Window" menu ⇒ "Preferences" ⇒ Expand "Java" node ⇒ "Installed JREs". Check the "Location" current JRE installed to make sure that it is the intended one. You can use the "Add" button to add a new version of JRE. For program development, I recommend that you add the JDK (instead of JRE). [The "Location" decides the extension directory used for including additional JAR files, e.g.,
$JAVA_HOME\jre\lib\ext
.]
For Web Developers
- HTML Editor: Use the "Web Page Editor" (available in Eclipse Java EE), which provides the design view (WYSISYG).
To use the "Web Page Editor", right-click on the HTML file, open as "Web Page Editor".
To make the "Web Page Editor" as default for HTML file, goto Window ⇒ Preferenes ⇒ General ⇒ Editor ⇒ File Associations ⇒ .htm and .html ⇒ Select "Web page editor" ⇒ default.
File I/O in Eclipse
Suppose that your want to write a Java program, which inputs from a text file called "xxxx.in
" and outputs to a text file called "xxxx.out
". This is a little tricky under Eclipse due to:
- When you create a text file in Windows' Notepad and saved it as "
xxxx.in
", Notepad will append the ".txt
" to your file and it becomes "xxxx.in.txt
". Worse still, the Windows' Explorer, by default, will not show the ".txt
" extension. (The first thing I always do to an alien computer is to change this setting. From "Tools" menu ⇒ Folder Options... ⇒ View ⇒ Uncheck "Hide extensions for known file types".) You need to put a pair of double quotes aroundxxxx.in
to override the default ".txt
" extension. This is one good reason not to use Notepad for programming at all. You should use Eclipse to create the text file instead. - Which directory to keep the input file "
xxxx.in
" in Eclipse?- If you did not separate the sources and class files into two separate directories, then the answer is straight forward, because there is only one directory to place your input file.
- If you choose to keep your sources and class files in two separate directories, eclipse will create two sub-directories "src" and "bin" under the base directory. BUT you need to put your input file "
xxxx.in
" in the base directory of your project, instead of the "src" or "bin"..
- Put the sources, class files, and the input/output files in the same directory. (When you create a new project, select "Use project folder as root for sources and class files" in "Project Layout".) (But put your sources and class files in separate directories for big project.)
- You can create you input file from eclipse directly via "File" menu ⇒ "New" ⇒ "File".
- Remember to add a newline to the end of your input file.
- You may need to right-click the project and select "Refresh" to see the output file "
xxxx.out
" created in the package explorer. - To open the "
xxxx.in
" and "xxxx.out
": right-click ⇒ Open With ⇒ Text Editor.
This is a sample JDK 1.5 program for file input/output:
import java.util.Scanner; import java.util.Formatter; import java.io.File; import java.io.IOException; public class FileIOTest { // saved as "FileIOTest.java" public static void main (String [] args) throws IOException { Scanner in = new Scanner(new File("FileIOTest.in")); // file input Formatter out = new Formatter(new File("FileIOTest.out")); // file output int a = in.nextInt(); int b = in.nextInt(); out.format("%d\n",a+b); // format() has the same syntax as printf() out.close(); // flush the output and close the output file } }
Create the input text file called "FileIOTest.in
" with the following contents and terminated with a newline:
55 66
Writing Swing Applications using Eclipse GUI Builder
Eclipse provides a visual GUI builder called "WindowBuilder" (@ https://www.eclipse.org/windowbuilder), which supports AWT/Swing, SWT (Eclipse's Standard Widget Toolkit - an alternative to JDK's AWT/Swing), XWT, GWT, eRCT.
Step 1: Create a New "Java Application" Project
- Choose "File" menu ⇒ "New" ⇒ "Java project".
- The "New Java Project" dialog pops up.
- In the "Project name" field, enter "
FirstSwingProject
". - Check "Use default location".
- In the "JRE" box, select "Use default JRE (currently 'JDK1.x')". But check the JDK version, you should be using JDK 1.5 and above.
- Click "Finish".
- In the "Project name" field, enter "
Step 2: Create a Swing JFrame Subclass
- Choose "File" menu ⇒ "New" ⇒ "Other..." ⇒ "WindowBuilder" ⇒ "Swing Designer" ⇒ "JFrame" ⇒ "Next". [If you cannot find "WindowBuilder" option, you need to install the "WindowBuilder" plug-in for Eclipse. Check https://www.eclipse.org/windowbuilder.]
- In the "Create JFrame" dialog ⇒ Enter "SwingMain" in the "Name" field ⇒ "Finish".
- Select the "Design" pane.
- In "Layouts", select "FlowLayout" and click on the "design form".
- From "Components", select "
JLabel
" and click on the design form. Change the label text to "Counter: ". Select a "JTextField" and place it on the design form. Change the text to "0". Select a "JButton" and place it on the design form. Change the text label to "Count". - To attach a event-handler to the button, double-click the
JButton
to switch into the "Source" pane, with the event-handler skeleton created. Complete theactionPerformed()
as follows:public void actionPerformed(ActionEvent e) { count++; textField.setText(count + ""); }
Add an instance variable calledcount
as follow:public class SwingMain extends JFrame { private int count = 0; ......
- You can now ready run the program. Right-click on the project ⇒ Run As ⇒ Java Application.
Eclipse Generated Codes
Study the codes generated by Eclipse GUI Builder, as follows, which is just a typical Swing application.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.border.EmptyBorder; public class SwingMain extends JFrame { // A JFrame application // Define private variables of all the GUI components private JPanel contentPane; private JTextField textField; private int count = 0; /** * Launch the application. */ public static void main(String[] args) { EventQueue.invokeLater(new Runnable() { // same as SwingUtilities.invokeLater() @Override public void run() { try { SwingMain frame = new SwingMain(); frame.setVisible(true); } catch (Exception e) { e.printStackTrace(); } } }); } /** * Create the frame. */ public SwingMain() { setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setBounds(100, 100, 450, 300); contentPane = new JPanel(); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); setContentPane(contentPane); contentPane.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5)); JLabel lblNewLabel = new JLabel("Counter: "); contentPane.add(lblNewLabel); textField = new JTextField(); textField.setText("0"); contentPane.add(textField); textField.setColumns(10); JButton btnCount = new JButton("Count"); btnCount.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { count++; textField.setText(count + ""); } }); contentPane.add(btnCount); } } |
Eclipse for C/C++ Programming
Here.
Eclipse PDT (PHP Development Tool)
Here.
Eclipse and Database Development (MySQL)
Reference: "Data Tools Platform User Documentation" @ Eclipse Welcome page.
You need to install Eclipse for Java EE, MySQL and MySQL Connector/J Driver. Read "How to install and get started with MySQL".
To use Eclipse for MySQL development:
- Switch to "Database Development" perspective: From "Window" menu ⇒ Open Perspective ⇒ Other ⇒ Database Development.
- Connect to MySQL database server: Start your MySQL database server. Right-click "Database Connection" ⇒ New.
- In "Connection Profile", choose "MySQL" ⇒ Next.
- In "Driver", choose "New Driver Definition" ⇒ Choose the MySQL Connector/J Driver ⇒ In JAR List, select the MySQL Connector/J Driver JAR file (that you have installed). In "Properties", "General", specify URL (take note of the database name), User name and password ⇒ Test Connection ⇒ Finish.
- In "Datasource Explorer", you can "connect" and "disconnect" the connection.
- To create a new SQL script, choose File ⇒ New ⇒ SQL File ⇒ You may use an existing project or create a new project (General - Project or Web - Dynamic Web Project) ⇒ Enter filename, and set the connection profile name ⇒ Finish. Enter a SQL statement (e.g., SELECT * FROM tablename) ⇒ Right-click on the text ⇒ "Execute Current Text" or "Execute All".
- To use an existing SQL file, drop the file into a project and open the SQL file. In Connection profile, set the type and connection name. Right-click on a statement ⇒ "Execute ...".
- To CURD (create-update-read-delete) tables, in "Datasource Explorer" (of the "Database Development" perspective), expand "database" to view the tables. Right-right on the table ⇒ Datat ⇒ Edit.
Developing and Deploying Web Applications in Eclipse for Java EE
Setting Up Eclipse for Web Development
- Install "Eclipse for Java EE (Enterprise Edition)".
- Install Tomcat (or Glassfish) server.
- Configuring Web Server: Launch Eclipse ⇒ Window ⇒ Preferences ⇒ Expand the "Server" node ⇒ "Runtime Environments" ⇒ "Add..." ⇒ Expand "Apache" and select "Apache Tomcat v7.0" ⇒ Enter the "Tomcat Installation Directory" ⇒ "Finish".
Writing a Hello-world JSP Page
- Create a new Web Application: File ⇒ New ⇒ Dynamic Web Project (under "Web" category) ⇒ In "Project Name", enter "
HelloJSP
" ⇒ Finish. - Create a new JSP File: Right-click on the project "
HelloJSP
" ⇒ New ⇒ JSP File ⇒ The parent folder shall be "HelloJSP/WebContent" ⇒ In "File Name", enter "Hello
" ⇒ "Finsih". - Enter the following HTML/JSP codes within the
<body>...</body>
tags:
<h1>Hello World!</h1> <% out.println("Your IP address is " + request.getRemoteAddr() + "<br/>"); out.println("Your user agent is " + request.getHeader("user-agent") + "<br/>"); %>
- To execute the JSP, right-click on "
Hello.jsp
" ⇒ Run As ⇒ Run on Server.
Writing a Hello-world Servlet
- Create a new Web Application: File ⇒ New ⇒ Dynamic Web Project (under "Web" category) ⇒ In "Project Name", enter "
HelloServlet
" ⇒ "Finish". - Create a new Servlet: Right-click on the project "
HelloServlet
" ⇒ New ⇒ Servlet ⇒ In "Java Package", enter "hello
"; in "Class Name", enter "HelloServlet
" ⇒ Next ⇒ In "URL Mappings", select "\HelloServlet
", "Edit" to "\Hello
" ⇒ Next ⇒ In "Which method stubs would you like to create", check "Inherited abstract method" and "doGet" ⇒ Finish.
In "HelloServlet.java", enter the following codes:package hello; import java.io.*; import javax.servlet.*; import javax.servlet.http.*; import javax.servlet.annotation.WebServlet; @WebServlet("/sayhello") // URL for this Servlet (for Servlet 3.0 with Tomcat 7) public class HelloServlet extends HttpServlet { private static final long serialVersionUID = 1L; @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // Set the response message MIME type (in Content-Type response header) response.setContentType("text/html"); // Get an output Writer to write the response message over the network PrintWriter out = response.getWriter(); // Write the response message (in an HTML page) to display "Hello, world!" out.println("<!DOCTYPE html>"); out.println("<html><head>"); out.println("<meta http-equiv='Content-Type' content='text/html; charset=UTF-8'>"); out.println("<title>Hello Servlet</title></head>"); out.println("<body><h1>Hello, World!</h1>"); out.println("<p>Your IP address is " + request.getRemoteAddr() + "</p>"); out.println("<p>Your user agent is " + request.getHeader("user-agent") + "</p>"); out.println("</body></html>"); } }
(For Servlet 2.4/2.5 with Tomcat 6) The annotation
@WebServlet
is new in Servlet 3.0 and is not supported in Servlet 2.4/2.5. Hence, you need to manually configure the URL for the servlet in the Web Application Deployment Descriptor "web.xml
" under directory "WEB-INF
", as follows:<?xml version="1.0" encoding="ISO-8859-1"?> <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0" metadata-complete="true"> <servlet> <servlet-name>HelloServletExample</servlet-name> <servlet-class>hello.HelloServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>HelloServletExample</servlet-name> <url-pattern>/sayhello</url-pattern> </servlet-mapping> </web-app>
- To execute the Servlet, right-click on the "
HelloServlet
" project ⇒ "Run As" ⇒ "Run on Server" ⇒ Change the URL to "http://localhost:8080/HelloServlet/sayhello
".
Exporting a Web Application as a WAR file
Right-click on the project to be exported ⇒ Export ⇒ WAR File ⇒ In "Destination", specify the destination directory and filename (the filename shall be the web application name) ⇒ Finish.
- To deploy the war file in Tomcat, simply drop the war file into Tomcat's "
webapps
" folder. The war file will be automatically extracted and deployed. The web application name is the war-filename. - You could use WinZip (or WinRAR) to view the content of the war file, as war-file is in ZIP format.
Writing a Hello-world JSF Page
[TODO]
Debugging Web Applications
You can debug a webapp just like standalone application. For example, you can set breakpoints, single-step through the programs, etc.
REFERENCES & RESOURCES
- Eclipse mother site @ www.eclipse.org.
- Eclipse documentation and user guides, accessible via Eclipse's Help and menu.


| No. | Question | Points | id | answerId | answerId | answerId | answerId | Actions |
|---|---|---|---|---|---|---|---|---|
<
| First name | Last name | Username | Actions | |
|---|---|---|---|---|


--- layout: default title: Installing new languages permalink: /installing-new-languages/ redirect_from: - /installing_new_languages.html sitemap: priority: 0.7 lastmod: 2014-12-10T00:00:00-00:00 ---
During the generation of a new project you will be asked whether or not you want to enable internationalization support.
If enabling it you will need to select the native language of your application. After that you can choose the additional languages you would like to install. If you don't want to support any additional languages from start you can always add languages later when needed by running the language sub-generator.
If you are sure you will never translate this application into another language you should not enable the internationalization.
These are the currently supported languages
Does JHipster not support your language? Please help us with a PR!
To do this you can run the languages sub-generator with:
yo jhipster:languages
Note that you will need to regenerate your entities if you would like to have them translated in the language you just added.
All languages are saved in the folder src/main/webapp/i18n
(client side) and src/main/resources/i18n
(server side)
Here are the steps to install a new language called new_lang
:
src/main/webapp/i18/en
folder to src/main/webapp/i18/new_lang
(this is where all the front-end translations are stored)src/main/webapp/i18/new_lang
Add the languege code new_lang
to the LANGUAGES
constant defined in src/main/webapp/app/components/language/language.constants.js
.constant('LANGUAGES', [
'en',
'fr',
'new_lang'
// jhipster-needle-i18n-language-constant - JHipster will add/remove languages in this array
]
src/main/resources/i18n
folder, copy the messages_en.properties
file to messages_new_lang.properties
(this is where the server-side translations are stored)messages_new_lang.properties
fileAdd the new language's name in the function of filter('findLanguageFromKey')
in the src/main/webapp/app/components/language/language.filter.js
file
function findLanguageFromKeyFilter(lang) {
return {
'ca': 'Català',
'da': 'Dansk',
'de': 'Deutsch',
'el': 'Ελληνικά',
'en': 'English',
'es': 'Español',
'fr': 'Français',
'gl': 'Galego',
'hu': 'Magyar',
'hi': 'हिंदी',
'it': 'Italiano',
'ja': '日本語',
'ko': '한국어',
'mr': 'मराठी',
'nl': 'Nederlands',
'pl': 'Polski',
'pt-br': 'Português (Brasil)',
'pt-pt': 'Português',
'ro': 'Română',
'ru': 'Русский',
'sv': 'Svenska',
'ta': 'தமிழ்',
'tr': 'Türkçe',
'zh-cn': '中文（简体）',
'zh-tw': '繁體中文'
}[lang];
}
src/main/webapp/bower_components/messageformat/locale
you need to create it.
More info in Angular translate
and MessageFormatIf the messageformat locale file exits in previous step add the file in bower.json
"messageformat": {
"main": [
"messageformat.js",
"locale/en.js",
"locale/fr.js",
"locale/new_lang.js"
]
}
If the messageformat locale file does not exits in the previous step include the file manually in src/main/webapp/index.html
The new language new_lang
is now available in the language menu, and it is available both in the front-end AngularJS application and in the back-end Spring application.
Here are the steps to remove a language called old_lang
:
src/main/webapp/i18/old_lang
src/main/webapp/app/components/language/language.constants.js
src/main/resources/i18n/messages_old_lang.properties
file


String
extension String: SpotifyURIConvertible
-
Returns
self
, with the assumption that it represents a Spotify URI.Declaration
Swift
@inlinable @inline(__always) public var uri: `Self` { get }
-
Returns a new string made by removing characters contained in a given character set from both ends of the String.
Alias for
String.trimmingCharacters(in:)
.Declaration
Swift
@inlinable func strip( _ characterSet: CharacterSet = .whitespacesAndNewlines ) -> String
Parameters
characterSet
The character set to use when trimming the string. Default:
whitespacesAndNewlines
. -
Base-64 encodes
self
.Equivalent to
self.data(using: .utf8)?.base64EncodedString(options: options)
Declaration
Swift
func base64Encoded( _ options: Data.Base64EncodingOptions = [] ) -> String?
Parameters
options
Options to use when encoding the data.
-
Base64-decodes
self
.Declaration
Swift
func base64Decoded( encoding: Encoding = .utf8, options: Data.Base64DecodingOptions = [] ) -> String?
-
Characters that are safe for use in a URL: Letters, digits, the underscore character, and the hyphen character.

All of these characters are valid for creating the code verifier for the Authorization Code Flow with Proof Key for Code Exchange.
See also
String.randomURLSafe(length:)
andString.randomURLSafe(length:using:)
which generate a random string containing only these characters."abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-"
Declaration
Swift
static let urlSafeCharacters: String
-
Returns a random string with the specified length that only contains letters, digits, the underscore character, and the hyphen character.
This method can be used for creating the code verifier for the Authorization Code Flow with Proof Key for Code Exchange, and for creating the state parameter.
See also:
String.urlSafeCharacters
String.randomURLSafe(length:)
makeCodeChallenge()
- makes the code challenge from the code verifier
Declaration
Swift
static func randomURLSafe<Generator: RandomNumberGenerator>( length: Int, using randomNumberGenerator: inout Generator ) -> String
Parameters
length
The length of the string. The code verifier must between 43 and 128 characters in length, inclusive.
randomNumberGenerator
The random number generator to use.
-
Returns a random string with the specified length that only contains letters, digits, the underscore character, and the hyphen character.
This method can be used for creating the code verifier for the Authorization Code Flow with Proof Key for Code Exchange, and for creating the state parameter.
See also:
String.urlSafeCharacters
String.randomURLSafe(length:using:)
- allows you to specify the random number generator to use.makeCodeChallenge()
- makes the code challenge from the code verifier
Declaration
Swift
static func randomURLSafe(length: Int) -> String
Parameters
length
The length of the string. The code verifier must be between 43 and 128 characters in length, inclusive.
-
Hashes the
codeVerifier
using the SHA256 algorithm and returns the Base-64 URL-encoded hash.This method can be used to generate the code challenge for the Authorization Code Flow with Proof Key for Code Exchange.
Equivalent to
let data = self.data(using: .utf8)! // The hash is an array of bytes (UInt8). let hash = SHA256.hash(data: data) // Convert the array of bytes into data. let bytes = Data(hash) // Base-64 URL-encode the bytes. return bytes.base64URLEncodedString()
Declaration
Swift
static func makeCodeChallenge(codeVerifier: String) -> String
Parameters
codeVerifier
The code verifier.
Return Value
The code challenge.


A newer version is available. For the latest information, see the
current release documentation
.
Curator Reference [3.4]
»
Commands
« --skip-repo-validation
alias »
Commands
edit
alias
allocation
bloom
close
delete
open
optimize
replicas
seal
show
snapshot


--- layout: page title: "Who are we?" permalink: /about/ description: "About TopLap Israel" ---
TOPLAP Israel
TOPLAP is an organisation founded in 2004, to explore and promote live coding.
Live coding is a new direction in electronic music and video, and is getting somewhere interesting. Live coders expose and rewire the innards of software while it generates improvised music and/or visuals. All code manipulation is projected for your pleasure. Live coding works across musical genres, and has been seen in concert halls, late night jazz bars, as well as algoraves. There is also a strong movement of video-based live coders, writing code to make visuals, and many environments can do both sound and video, creating synaesthetic experiences.
Live coding is inclusive and accessible to all. Many live coding environments can be downloaded and used for free, with documentation and examples to get you started and friendly on-line communities to help when you get problems. Popular live coding software includes ChucK, Cyril, extempore, fluxus, impromptu, overtone and supercollider. Environments designed for fast exploration of musical pattern include ixi lang and TidalCycles. Sonic Pi is designed for teaching both music and computer science in classrooms, as well as performing in algoraves. There are also impressively capable web-based live coding environments like gibber and livecodelab. Live patching is live coding with graph-based languages such as the venerable pure-data. It’s also possible to livecode with a gamepad, e.g. with the robot oriented Al-Jazari.
There is a more complete and up-to-date directory of live coding environments and other things over here: All Things Livecoding.
Source: TopLap Official Website


Voting is EASY. Here's a step by step guide!
Register to vote using this online web form.
If you live in two places (school vs parents' house) you can choose either.
Enter your postal code here then click 'Where do I vote?', or call 1-800-463-6868 and they will sort you out.
Notice that there's no complicated documents involved or mailing of anything anywhere. You can do this in 5 minutes using your phone.
Here's the ID you need to vote. You do have it, even if you're a student living in rez.
The number one problem at this step is that your "official" ID has your parents' address, but you live away at school. Don't worry, you're still good to go. Just bring a second piece of ID that has your name and current address on it. It can be as simple as any document or letter issued by your university or rez. Worst case, ask your don for a letter confirming your address, which they can provide you in no time.
It's quick, easy, and not scary. Someone will meet you at the door and show you just where to go and what to do. It's usually a sweet old lady.
Last time I voted, one of the poll workers gave me a home baked chocolate chip cookie, straight up. It's that chill.
No complicated documents needed. No mailing forms anywhere. No excuses.


The encodeURI()
method encodes a Uniform Resource Identifier (URI) by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character (will only be four escape sequences for characters composed of two "surrogate" characters).
encodeURI(URI)
URI
Assumes that the URI is a complete URI, so does not encode reserved characters that have special meaning in the URI.
encodeURI
replaces all characters except the following with the appropriate UTF-8 escape sequences:
Note that encodeURI
by itself cannot form proper HTTP GET and POST requests, such as for XMLHTTPRequests, because "&", "+", and "=" are not encoded, which are treated as special characters in GET and POST requests. encodeURIComponent, however, does encode these characters.
Note that an URIError will be thrown if one attempts to encode a surrogate which is not part of a high-low pair, e.g.,
// high-low pair ok console.log(encodeURI('\uD800\uDFFF')); // lone high surrogate throws "URIError: malformed URI sequence" console.log(encodeURI('\uD800')); // lone low surrogate throws "URIError: malformed URI sequence" console.log(encodeURI('\uDFFF'));
Also note that if one wishes to follow the more recent RFC3986 for URLs, which makes square brackets reserved (for IPv6) and thus not encoded when forming something which could be part of a URL (such as a host), the following code snippet may help:
function fixedEncodeURI (str) { return encodeURI(str).replace(/%5B/g, '[').replace(/%5D/g, ']'); }
Created by Mozilla Contributors, license: CC-BY-SA 2.5


Before Change
raise NotImplementedError(
"Tuple action spaces not supported for Pytorch.")
child_dist = []
input_lens = []
for action in action_space.spaces:
dist, action_size = ModelCatalog.get_action_dist(
action, config)
child_dist.append(dist)
input_lens.append(action_size)
return partial(
MultiActionDistribution,
action_space=action_space,
child_distributions=child_dist,
After Change
// Dist_type is given directly as a class.
elif type(dist_type) is type and \
issubclass(dist_type, ActionDistribution) and \
dist_type not in (
MultiActionDistribution, TorchMultiActionDistribution):
dist = dist_type
// Box space -> DiagGaussian OR Deterministic.
elif isinstance(action_space, gym.spaces.Box):


Enter or click on a value below:
Check the box below to use the potentiometer to set the servo angle.


{% extends "base.html" %} {% load static %} {% block head_tags %} {% endblock %} {% block page_title %}Custom Link Button Maker{% endblock %} {% block content %}
I have had many people ask me to include one link or another in Toolbar Buttons, so here finally is my answer. A tool for creating a your own toolbar button that links to what ever page you want. Feel free to distribute these extensions from your own site, but you must provide a like back to this page and you may not edit the extensions to change their homepage, creator, update link etc.
I also have a number of pre built link button extensions for some popular sites.
{% endblock %}


Toggle navigation
Yash Thaker
About
Portfolio
Contact
Hangman
RPG Game
Trivia Game
Rutgers Info Widget
Rock Paper Scissors
Slack
Github
Linkedin
Connect with me
Slack
Github
Linkedin


Has he ever spared your life from accident or danger?
Has He ever provided money or things in answer to prayer?
Has God ever not answered an important prayer?
Secrets to praying back to God all the truth He has revealed to you
If you fail to pray things back to God you will face the
responsibility of truth on your own and experience one of the
following consequences:
Feel condemned by it and your heart will be hardened.
Try to do it in the power of the ﬂesh and give up
quickly.
Mentally assent to it and become a hearer's of the Word but
not a doer of the Word thereby deceiving
yourself.
When you pray things back to God you are:
Praying back to Him what He has shown you and acknowledging
your need for Him to live through you.

Recognizing our responsibility is to believe and speak with
faith.
You are accepting the reality that apart from God you can do
nothing.
You are accepting the fact that your power comes from
containing Someone as a
vessel versus trusting in ourselves and performing to become
somebody in the power of the ﬂesh.
You are changing your mind to agree with God. Repenting and
turning away from your own way to follow God.


B
A
SELECT
SELECT
START
START
Choose Game...
Upload Savegame...
PAUSE
RESET
Download Savegame
Screenshot
Pixelated
Sound


Heading tags allow us to create a nice visual hierarchy!
Heading tags add structure to make websites more easily scannable.
It also makes websites easier to read!


Business Analytics
Add a new location
Location
Minimum Customers
Maximum Customers
Cups per customer
Pounds per customer


Cheslin Kolbe clinches Top 14 player of the year award
Paris - Rugby World Cup winner Cheslin Kolbe was named the Top 14's player of the season on Monday, the French league announced at a ceremony in Paris.
Kolbe, 26, lifted the Webb Ellis Cup with the Springboks earlier this month as well as the Rugby Championship in August after having helped his club Toulouse to the French domestic title in June.
"It's been a phenomenal season, not just for me but for my club and for my country, winning the Top 14, The Rugby Championship and then World Cup in one year I'm really blessed," Kolbe said.
"I couldn't have done this without all my team-mates. I give credit to all of them because if they didn't create opportunities for me as a wing to finish off I wouldn't be standing here now," he added.
The Rio Olympic Games bronze medallist, who made his international debut after joining Toulouse in 2017, scored six tries in 16 league appearances before Ugo Mola's side lifted the Bouclier de Brennus for a record-extending 20th time at the Stade de France.
Kolbe also won the award for the best Top 14 player at the World Cup, beating Fiji's Semi Radradra and France's Damian Penaud as well as winning the award for the try of the campaign.
Clermont's Penaud took the prize for the France international after 'Les Bleus' were knocked out of the World Cup in the quarter-finals.
Lyon's 21-year-old centre Pierre-Louis Barassi, who made his Test debut during the tournament in Japan, won the young player of the season award.
Bayonne scrumhalf Pauline Bourdon won the women's player of the season award as France beat New Zealand's Black Ferns for the first time.


#{extends 'main.html' /} Media Archiving Description Type of Media Select Audio Video Word file Text PowerPoint XML file Images Others Search Keyward Uploaded File Provide Link to Access File #{cascade/}


Escola de TI 2014
Toggle navigation
Jane Doe
Jane Doe - Web Developer
Member since Nov. 2012
Sign out


Copyright © 2013-2017, Phalcon Framework Team
and contributors.
All Rights Reserved. Powered by Phosphorum v3.2.0.


I'm Aleix Castillo and I have been one of the designers of this team. As a designer, my tasks were devising and transmitting the bases of the basic elements such as relics, damage of the characters and general design elements of the game, together with the different reworks and iterations that these involve.
For this project and with the situation in which we have found ourselves without being able to open the engine, my main work has been research and iterating the different design bases, mainly what has reference in combat.
In the beginning of this project I took care of the bases of the relics, the starting idea of Necklaces and the damage of the characters along with their damage by combos.
Also implemented the bases of the stats of the characters and all the enemies.
With another designer we made the list of relics, their functions and their drop and spawn rate.
Example of the first iteration of the combos dmg
Damage of the basics attacks
Also implemented the bases of the stats of the characters and the enemies.
Example of how stats were at the start
Draft of level 1 with its study.
Draft
The first iteration of half of level 1 of the ghouls area with their respective research on how to make a balanced area of enemies
Ghouls area
For the general combat I did a research of the combat style of similar games and how it works, the conlusion was the battle circle.
Battle Circle example
Also I took part of the design of how enemies will interact with the player as a linear combat or ambush, after that I design the first iteration of how the enemies will appear at level 1.
Enemy positioning level 1
Ult charging and managment
In this area I did the rework of the Yennefer Ultimate as a cooperative and single player ability.
New Ultimate idea
After researching how the scores boards of similiar games works, we design a scoring system with the next components:
At the last stage of the project my work was balancing the previous stats of the characters and relics.
Also I managed two playtest sessions with an exhaustive report of bugs together with some particles that had to be done and some bug fixes of the results of the playtest.


Currently, a Senior Digital Marketing Specialist at 180 Marketing for US clients. Equipped with various digital marketing techniques to provide excellent results. Well-equipped with various digital marketing tools that helps simplify SEO processes in timely and effective way. A great team player and is confident to lead a team.
We understand what it takes to increase traffic and attain page-one Google rankings. We develop inexpensive, custom strategies to meet the goals of our clients. We provide all the necessary services for a successful SEO campaign.
I make sure clients are satisfied with their digital marketing campaigns. As digital marketing manager, I manage the following:
The main objective is to share the latest events and news happening all around Cebu. This started as a hobby and eventually become a serious responsibility. With the help of Cebuanos and businesses, this blog has been made possible. Part of it is also my life's journal.
I was tasked to write some articles pertaining to specific keywords. Each article would need to have 500 words, free from plagiarism and can pass from the SEO standards. The articles are also free from edits and are ready to be used by clients. Each day, I finish about 15 articles.


| Package | Description |
|---|---|
| energy.usef.agr.service.business |
Business classes of the Aggregator.
|
| energy.usef.brp.service.business |
The package which contains all the business services for the BRP.
|
| energy.usef.core.rest | |
| energy.usef.core.util |
Package for the core utility classes.
|
| energy.usef.cro.service.business |
Business classes of the Common Reference Operator.
|
| energy.usef.dso.service.business |
Business classes of the Distribution System Operator.
|
| energy.usef.mdc.service.business |
Contains BusinessService classes.
|
| Modifier and Type | Method and Description |
|---|---|
RestResult |
AggregatorTopologyBusinessService.findAllCommonReferenceOperators()
Try and retrieve all
CommonReferenceOperator instances. |
RestResult |
AggregatorTopologyBusinessService.findAllSynchronisationConnections()
Try and retrieve all
SynchronisationConnection instances. |
RestResult |
AggregatorTopologyBusinessService.findCommonReferenceOperator(String domain)
Try and retrieve a
CommonReferenceOperator with the given domain name, returning it in a . |
RestResult |
AggregatorTopologyBusinessService.findSynchronisationConnection(String entityAddress)
Try and retrieve a
SynchronisationConnection with the given entityAddress, returning it in a . |
| Modifier and Type | Method and Description |
|---|---|
List<RestResult> |
AggregatorTopologyBusinessService.processCommonReferenceOperatorBatch(String jsonText)
Process a batch of updates.
|
List<RestResult> |
AggregatorTopologyBusinessService.processSynchronisationConnectionBatch(String jsonText)
Process a batch of updates.
|
| Modifier and Type | Method and Description |
|---|---|
RestResult |
BalanceResponsiblePartyTopologyBusinessService.findAllCommonReferenceOperators()
Try and retrieve all
CommonReferenceOperator instances. |
RestResult |
BalanceResponsiblePartyTopologyBusinessService.findAllSynchronisationConnections()
Try and retrieve all
SynchronisationConnection instances. |
RestResult |
BalanceResponsiblePartyTopologyBusinessService.findCommonReferenceOperator(String domain)
Try and retrieve a
CommonReferenceOperator with the given domain name, returning it in a . |
RestResult |
BalanceResponsiblePartyTopologyBusinessService.findSynchronisationConnection(String entityAddress)
Try and retrieve a
SynchronisationConnection with the given entityAddress, returning it in a . |
| Modifier and Type | Method and Description |
|---|---|
List<RestResult> |
BalanceResponsiblePartyTopologyBusinessService.processCommonReferenceOperatorBatch(String jsonText)
Process a batch of updates.
|
List<RestResult> |
BalanceResponsiblePartyTopologyBusinessService.processSynchronisationConnectionBatch(String jsonText)
Process a batch of updates.
|
| Modifier and Type | Method and Description |
|---|---|
static RestResult |
RestResultFactory.getJsonRestResult()
Create a for JSON texts
|
RestResult |
RestResult.withBody(String body) |
RestResult |
RestResult.withCode(long code) |
RestResult |
RestResult.withErrors(List<String> errors) |
RestResult |
RestResult.withHeaders(List<Header> headers) |
| Modifier and Type | Method and Description |
|---|---|
static RestResult |
JsonUtil.notSupported(String method,
String entity)
Construct a RestResult stating that the method is not supported for a given entity
|
static RestResult |
JsonUtil.unknownRole(String role)
Construct a RestResult stating that the role is not supported in a certain context
|
| Modifier and Type | Method and Description |
|---|---|
static void |
JsonUtil.validateNodeSyntax(String schemaResource,
com.fasterxml.jackson.databind.JsonNode node,
Map<Integer,RestResult> report)
Validate a against a json schema.
|
| Modifier and Type | Method and Description |
|---|---|
RestResult |
CommonReferenceOperatorTopologyBusinessService.findAggregator(String domain)
Try and retrieve an
Aggregator with the given domain name, returning it in a . |
RestResult |
CommonReferenceOperatorTopologyBusinessService.findAllAggregators()
Try and retrieve all
Aggregator instances. |
RestResult |
CommonReferenceOperatorTopologyBusinessService.findAllBalanceResponsibleParties()
Try and retrieve all
BalanceResponsibleParty instances. |
RestResult |
CommonReferenceOperatorTopologyBusinessService.findAllDistributionSystemOperators()
Try and retrieve all
DistributionSystemOperator instances. |
RestResult |
CommonReferenceOperatorTopologyBusinessService.findAllMeterDataCompanies()
Try and retrieve all
MeterDataCompany instances. |
RestResult |
CommonReferenceOperatorTopologyBusinessService.findBalanceResponsibleParty(String domain)
Try and retrieve an
BalanceResponsibleParty with the given domain name, returning it as a . |
RestResult |
CommonReferenceOperatorTopologyBusinessService.findDistributionSystemOperator(String domain)
Try and retrieve an
DistributionSystemOperator with the given domain name, returning it as a . |
RestResult |
CommonReferenceOperatorTopologyBusinessService.findMeterDataCompany(String domain)
Try and retrieve an
MeterDataCompany with the given domain name, returning it as a . |
| Modifier and Type | Method and Description |
|---|---|
List<RestResult> |
CommonReferenceOperatorTopologyBusinessService.processAggregatorBatch(String jsonText)
Process a batch of updates.
|
List<RestResult> |
CommonReferenceOperatorTopologyBusinessService.processBalanceResponsiblePartyBatch(String jsonText)
Process a batch of updates.
|
List<RestResult> |
CommonReferenceOperatorTopologyBusinessService.processDistributionSystemOperatorBatch(String jsonText)
Process a batch of updates.
|
List<RestResult> |
CommonReferenceOperatorTopologyBusinessService.processMeterDataCompanyBatch(String jsonText)
Process a batch of updates.
|
| Modifier and Type | Method and Description |
|---|---|
RestResult |
DistributionSystemOperatorTopologyBusinessService.findAllCommonReferenceOperators()
Try and retrieve all
CommonReferenceOperator instances. |
RestResult |
DistributionSystemOperatorTopologyBusinessService.findAllSynchronisationCongestionPoints()
Try and retrieve all
SynchronisationCongestionPoint instances. |
RestResult |
DistributionSystemOperatorTopologyBusinessService.findCommonReferenceOperator(String domain)
Try and retrieve an
CommonReferenceOperator with the given domain name, returning it in a . |
RestResult |
DistributionSystemOperatorTopologyBusinessService.findSynchronisationCongestionPoint(String entityAddress)
Try and retrieve an
SynchronisationCongestionPoint with the given domain name, returning it in a . |
| Modifier and Type | Method and Description |
|---|---|
List<RestResult> |
DistributionSystemOperatorTopologyBusinessService.processCommonReferenceOperatorBatch(String jsonText)
Process a batch of updates.
|
List<RestResult> |
DistributionSystemOperatorTopologyBusinessService.processSynchronisationCongestionPointBatch(String jsonText)
Process a batch of updates.
|
| Modifier and Type | Method and Description |
|---|---|
RestResult |
MeterDataCompanyTopologyBusinessService.findAllBalanceResponsibleParties()
Try and retrieve all
BalanceResponsibleParty instances. |
RestResult |
MeterDataCompanyTopologyBusinessService.findAllCommonReferenceOperators()
Try and retrieve all
CommonReferenceOperator instances. |
RestResult |
MeterDataCompanyTopologyBusinessService.findAllConnections()
Try and retrieve all
Connection instances. |
RestResult |
MeterDataCompanyTopologyBusinessService.findAllDistributionSystemOperators()
Try and retrieve all
DistributionSystemOperator instances. |
RestResult |
MeterDataCompanyTopologyBusinessService.findBalanceResponsibleParty(String domain)
Try and retrieve an
BalanceResponsibleParty with the given domain name, returning it as a . |
RestResult |
MeterDataCompanyTopologyBusinessService.findCommonReferenceOperator(String domain)
Try and retrieve an
CommonReferenceOperator with the given domain name, returning it as a . |
RestResult |
MeterDataCompanyTopologyBusinessService.findConnection(String entityAddress)
Try and retrieve an
Connection with the given entityAddress, returning it as a . |
RestResult |
MeterDataCompanyTopologyBusinessService.findDistributionSystemOperator(String domain)
Try and retrieve an
DistributionSystemOperator with the given domain name, returning it as a . |
| Modifier and Type | Method and Description |
|---|---|
List<RestResult> |
MeterDataCompanyTopologyBusinessService.processBalanceResponsiblePartyBatch(String jsonText)
Process a batch of updates.
|
List<RestResult> |
MeterDataCompanyTopologyBusinessService.processCommonReferenceOperatorBatch(String jsonText)
Process a batch of updates.
|
List<RestResult> |
MeterDataCompanyTopologyBusinessService.processConnectionBatch(String jsonText)
Process a batch of updates.
|
List<RestResult> |
MeterDataCompanyTopologyBusinessService.processDistributionSystemOperatorBatch(String jsonText)
Process a batch of updates.
|
Copyright © 2016. All rights reserved.


Frond-End Developer .
Adyax’s core values take top priority: we care for our client, and we care for our people. Staff and clients work in partnership with consistent, transparent communication
Adyax specializes in working with multi-national, multi-brand companies on a wide range of customer, client and employee-facing solutions.


Some controls can require index
and tabIndex
attributes to be set. To avoid having
to calculate these manually you can use the auto-index
directive. This directive is an attribute directive
that can be placed on any item which will be iterated using an
ng-repeat
statement. Although it can be used in other cases it is intended for use with Table controls.
For example, refer to the following sample code showing how the attribute might be placed on a table row:
This example would give each row the indices 0, 4, 8, 12… respectively. This allows for each row to contain indices for additional items, as shown:
These additional indices would either be configured manually, or will be provided if using this in conjunction with a
Preview Pane or Item Display Panel. The tabindex
value will be set either to 1 or -1; as it is anticipated
that a control providing direct keyboard control will be used in conjunction, requiring the default tabbing behaviour
to be overriden with programatic keyboard control.
The full set of configuration options for this directive are as follows:
If no values are provided then each item subject to the ng-repeat
would receive an index value 0, 1, 2, 3 ….


health patients mental COVID- []. {border-style px;} #ffffff;} care psychiatrists infectious staff psychiatric including service clinicians exposure work disease emerging individual social public px; {font-family Ebola available challenges epidemic font-size high medical particularly services treatment video [,]. consultation double; epidemics frontline healthcare key new novel pandemic patients, psychiatry risk roles Elsevier Wuhan, border-color border-width changes effects epidemic/pandemic fear global illness infection potential psychological resource role setting significant solid; team {font-style {font-weight China England access anxiety associated bold care, centre comorbid context coronavirus courier; data em; entire identify information institutional like mitigate mitigation needs opportunities pandemic/epidemic prevent providers providing pt;} rapid research response roles. suggest support vulnerable workforce working


Scroll the above box - scrolling will occur on the compositor thread. When you click the mouse anywhere on the page, the scroller's style will be changed so that it no longer requires a compositing layer for scrolling. We force style computation to ensure the composited layer is removed. Immediately after this, we reset style back to needing a compositing layer.
The bug occurs because we create a new compositing layer which replaces the compositor's ElementId-->LayerId mapping but only delete the old one after this. When the old layer is deleted it removes the mapping for the ElementId, thinking it still belongs to itself. Composited scrolling now fails to commit scroll deltas to the new layer because it can't find the layer from the ElementId.


Sniffly2
This is a demo of sniffing browser history on desktop Chrome/Chromium using HSTS. Please disable HTTPS Everywhere for best results.
This is a demo of sniffing browser history on desktop Chrome/Chromium using HSTS. Please disable HTTPS Everywhere for best results.


|
C++ Templates
|
Base class for array-like structures. More...
#include <ArrayBase.h>
Public Types | |
| typedef T | type |
Public Member Functions | |
| ArrayBase (void) | |
| ArrayBase (size_t maxSize) | |
| ArrayBase (size_t maxSize, T fill) | |
| ~ArrayBase (void) | |
| size_t | size (void) |
| T | get (size_t index) const |
| void | set (size_t index, T contents) |
| int | find (T element) |
| int | find (T element, size_t startIndex) |
| void | fill (T contents) |
| void | clear () |
| virtual bool | isEmpty () |
| bool | operator== (const ArrayBase< T > &rhs) const |
| bool | operator!= (const ArrayBase< T > &rhs) const |
| T | operator[] (size_t index) const |
| T & | operator[] (size_t index) |
Base class for array-like structures.
Contains the actual raw array of type T along with common properties and methods for array like structures.
| T | (typename) Element type of array. |
Default initializing constructor.
Creates the raw array of type T
and sets the maximum size to 10 by default.
Initializing constructor. Sets max size to maxSize
, effectively overriding the default.
| maxSize | (size_t) Maximum size of the array. |
Initializing constructor. Sets max size to maxSize
and filling each element of the array with fill
.
| maxSize | (size_t) Maximum size of the array. |
| fill | (T) Contents of each element. |
| void ArrayBase< T >::clear | ( | ) |
Clears all elements from the array.
| void ArrayBase< T >::fill | ( | T | contents | ) |
Set each element in raw array to given element
up to the maximum size.
| contents | (T) Element to fill ArrayBase with. |
| int ArrayBase< T >::find | ( | T | element | ) |
Return first index
that matches element.
| element | (T) Element to match with. |
index
or -1 if no match. | int ArrayBase< T >::find | ( | T | element, |
| size_t | startIndex | ||
| ) |
Return first index
that matches element
starting at the given index.
| element | (T) Element to match with. |
| startIndex | (size_t) The index to start with. |
index
or -1 if no match. | T ArrayBase< T >::get | ( | size_t | index | ) | const |
Query the element at specified index.
| index | (size_t) Index of query element. |
| std::out_of_range | Index is out of the range. |
|
virtual |
Test to see if array is empty.
| T ArrayBase< T >::operator[] | ( | size_t | index | ) | const |
Query the element given the index.
| index | (size_t) Index of the element. |
index
. | T & ArrayBase< T >::operator[] | ( | size_t | index | ) |
Query the element given the index.
| index | (size_t) Index of the element. |
index
. | void ArrayBase< T >::set | ( | size_t | index, |
| T | contents | ||
| ) |
Sets the element at the specified index.
| index | (size_t) Index of element. |
| contents | (T) Contents of element. |
| std::out_of_range | Index is out of the range. |
| size_t ArrayBase< T >::size | ( | void | ) |
Query the current size.


\[` \newcommand{\Prob}{\operatorname{P}} \newcommand{\E}{\operatorname{E}} \newcommand{\Var}{\operatorname{Var}} \newcommand{\Cov}{\operatorname{Cov}} \newcommand{\se}{\operatorname{se}} \newcommand{\re}{\operatorname{re}} \newcommand{\ybar}{{\overline{Y}}} \newcommand{\phat}{{\hat{p}}} \newcommand{\that}{{\hat{T}}} \newcommand{\med}{{\tilde{Y}}} \]
The explanatory variables are Gender (male, female), and Mother’s education (high school, college). The response variable is Attitude towards gun control (favour, oppose).
The explanatory variables are Blood pressure, and Cholesterol level. The response variable is Heart Disease (yes, no).
The explanatory variables are Race (white, nonwhite), Religion (Catholic, Jewish, Protestant), and Annual income. The response variable is Vote for president (Democrat, Republican, Other).
The explanatory variable is Marital status (married, single, divorced, widowed). The response variable is Quality of life (excellent, good, fair, poor).
Let \(X=\) the number of correct answers by the student on the exam. Let \(p=\frac{1}{4}\) be the probability of guessing the correct answer for a given question. Let \(n=100\) be the number of questions on the exam. Then: \[ X \sim Binom\left( n = 100, p = \frac{1}{4} \right) \]
Assuming a Type I error rate of \(5\%\): \[ H_{0}: p = 0.25 \] \[ H_{1}: p > 0.25 \] \[ \Prob \left( X \geq 50 \right) = \sum_{x=50}^{100} {{100}\choose{x}} 0.25^{x} (1-0.25)^{100-x} \] or equivalently in R:
pbinom(50 - 1, 100, 0.25, lower.tail = FALSE)
## [1] 6.638502e-08
which is \(<5\%\). As such we reject the null hypothesis that the student was merely guessing for each question, and assume that their probability of getting the correct answer is \(>0.25\) based on the sample.
We need to find \(\phat\) s.t. we maximize \(\Prob\left(Y = 0 \middle| n = 2 \right)\) subject to \(p\in[0,1]\) \[ \Prob\left(Y = 0 \middle| n = 2 \right) = {{2}\choose{0}} p^{0} (1-p)^{2-0} = (1-p)^{2} \implies \] \[ \frac{d}{dp} (1-p)^{2} = -2(1-p) \implies 0 = -2(1-p) \implies p = 1 \] \(p=0\) is also an endpoint, so we can check that as well. For \(p=1\), we have a likelihood of 0, and for \(p=0\), we have a likelihood of 1.
# p = 0
dbinom(x = 0, size = 2, prob = 0)
## [1] 1
# p = 1
dbinom(x = 0, size = 2, prob = 1)
## [1] 0
Since our function is monotonic over this domain, \(p = 0\) is our MLE.
This may not be reasonable however, as this would require the coin to have both sides as tails. As well, we have a small sample size of \(n=2\), which makes it hard to draw a reasonable conclusion. If we use the bayesian estimator as given in the text, \(p=\frac{1}{4}\), which may be a more reasonable estimator for \(p\) based on our limited data.
Let \(X\) be the bullet firing (a somewhat morbid success…), \(n=6\), \(p=\frac{1}{6}\): \[ \Prob \left( X = 0 \middle| n = 6, p = \frac{1}{6} \right) = {{6}\choose{0}} \left( \frac{1}{6} \right)^{0} \left( 1 - \frac{1}{6} \right)^{6-0} = \left( \frac{5}{6} \right)^{6} = 0.3349 \]
We have the case where we have \(y-1\) number of non-fires, and then 1 fire. Since the order of the non-fires doesn’t matter, we don’t need a binomial term in our equation, as it would = 1. As well, each spin is independent, which allows us to multiply our probabilities together. \[ \Prob \left( X = 0 \middle| n = y - 1 \right) \times \Prob \left( X = 1 \middle| n = 1 \right) = (1-p)^{y-1}p \stackrel{{p=\frac{1}{6}}}{=} \left( \frac{5}{6} \right)^{y-1} \left( \frac{1}{6} \right) \]
\[ \phat = 0.86, n=1158 \] \[ \se \left( \phat \right) = \sqrt{\frac{0.86(1-0.86)}{1158}} = 0.0102 \] 95% CI for \(p\): \[ 0.86 \mp 1.96(0.0102) = [0.84, 0.88] \]
That is, we can say with 95% confidence the true proportion of american adults that believe in heaven is somewhere between 84% and 88% based on our sample.
\[ \ell = \prod_{i=1}^{25} \Prob \left( Y_{i} = 0 \right) = \prod_{i=1}^{25} {{25}\choose{0}} p^{y_{i}} (1-p)^{25-y_{i}} = \] Note: We can ignore the binomial term at the start, as it doesn’t contain \(p\). \[ \ell = p^{\sum_{i=1}^{25} y_{i}} (1-p)^{25-\sum_{i=1}^{25} y_{i}} \] Since \(y_{i}=0,\forall 1=1,2,\dots,25\): \[ \ell = (1-p)^{25} \]
Under \(H_{0}\), we assume \(p=0.5\), our likelihood function (\(\ell_{0}\)) is maximized at \(p=0.5\). \[ \implies \ell_{0} = (0.5)^{25} \]
\[ \ell_{1} = (1-p)^{25} \implies \frac{d}{dp}(1-p)^{25} = -25(1-p)^{24} \implies 0 = -25(1-p)^{24} \implies p = 1 \] We also get \(p=0\) due to it being our other endpoint in the domain \(p\in[0,1]\). \[ \ell_{1}(0) = (1-0)^{25} = 1 \] \[ \ell_{1}(1) = (1-1)^{25} = 0 \]
So our MLE is 0, with a likelihood of 1.
\[ {\chi^{2}}_{calc} = -2\ln \left( \frac{(1-0.5)^{25}}{(1-0)^{25}} \right) = -2 \ln \left( 0.5^{25} \right) = 34.65736 \approx 34.7 \]
pchisq(q = -2*log(0.5^25), df = 1, lower.tail = FALSE)
## [1] 3.931495e-09
So we have a p-value of \(3.93 \times 10^{-9}\), and can then reject our null hypothesis at that level.
\[ {\chi^{2}}_{calc} = -2\ln \left( \frac{(1-0.074)^{25}}{(1-0)^{25}} \right) = 3.844052 \approx 3.84 \]
pchisq(q = -2*log((1-0.074)^25), df = 1, lower.tail = FALSE)
## [1] 0.04992273
So our p-value is \(\approx 0.05\) meaning it is the upper bound for the 95% likelihood-ratio confidence interval.