England in New Zealand: Dom Sibley set to make Test debut
| New Zealand v England, first Test |
|---|
| Venue: Bay Oval, Mount Maunganui Date: 21-25 November Time: 22:00 GMT (20-24 Nov) |
| Coverage: Ball-by-ball Test Match Special commentary on BBC Radio 5 Live Sports Extra, Radio 4 LW, online and the BBC Sport App; live text commentary on BBC Sport website |
Dom Sibley says he has been planning for his England Test debut for "quite a long time" as he prepares to open the batting against New Zealand.
The opener, 24, is set to play in the first Test at Mount Maunganui on Wednesday at 22:00 GMT after topping the county batting charts this season.
"Opening the batting, you have to accept that you are going to have some low scores," he told BBC Sport.
"But it's a case of, if I do get in, I go big and make the most of it."
Sibley scored 1,324 runs for Warwickshire in County Championship Division One this summer - no other player managed 1,000 - and made a century in England's opening tour match against a New Zealand XI.
"The team hasn't been confirmed but the thought of potentially making my Test debut is pretty exciting," he said.
"I've been thinking about it for quite a long time, been planning for this and working hard towards it. I'm just glad that it is close now."
Sibley looks set to open alongside former Surrey team-mate Rory Burns, with Joe Denly - who opened in the final Ashes Test of the summer against Australia - or Zak Crawley likely to bat at three and captain Joe Root four.
Sibley says he and Burns go "way back", adding: "He drove me to my first second team game, which I opened in with him.
"To potentially open the batting with him in the Test match would be amazing."
Meanwhile, New Zealand coach Gary Stead is considering whether to name uncapped fast bowler Lockie Ferguson in his side to "fight fire with fire" with England's Jofra Archer.
"(Archer's pace) is obviously a point of difference but we've got someone in our squad who bowls at a similar type of speed as well who's pretty quick in Lockie Ferguson," said Stead.
"It's really exciting for Lockie and a potential debut for him at some stage."


--- layout: compress --- {% include head.html %}
Hmm... Seems like you are lost
Don't worry you can go back right now.


| |
GLSL raycasting |
Introduction
This page describes a simple volume raycaster based on GLSL (a shading language for OpenGL). Volume raycasting is a form of volume rendering, a technique that generates 3D images based on a stack of 2D bitmap images. In raycasting, for each pixel on the screen we shoot a beam from the viewer's eye through any objects in in its path, determining the brightness encountered by that ray.
- Click here to get the Windows executable, sample images and source code. Note this requires a video card that supports large 3D textures, so it probably will not work with many Intel-based GPUs.
- Click here to get the OSX executable, sample images. Requires GPU that supports large 3D textures.
How it works
We start by loading the raw data, which you can think of as a stack of pictures where each pixel simply reports the intensity (black through white) at that location (top image). This original 3D image only has a single channel: brightness. We then convert this 3D image with one channel into a 3D image with four channels: X-gradient, Y-gradient, Z-gradient and brightness. This is illustrated in the second image, where the X/Y/Z gradients are shown as red/green/blue. These gradients are storing the surface angle for each voxel. This information is useful for shading the image (e.g. we can compute the viewing and light incidence, and use this image to shade specific regions). Finally, we generate a 1D color lookup table. This helps us convert brightness at each location with a corresponding level of red, green blue, and opacity (RGBA, with alpha refering to transparency).
- Load volume with single channel (e.g. brightness).
- Create color table to convert brightness to four channels: red, green, blue, alpha.
- Create 3D gradient map that shows surface orientation of each voxel (with red, blue, and green corresponding with anterior-posterior, left-right, superior-inferior).
- Shoot beams through the volume, and accumulate colors based on the color table.
- [Optional] Adjust color based on gradient direction and magnitude. For example here we show Edge coloring, where edges that are aligned with the viewing direction appear darker.
- [Optional] Adjust transparency based on gradient magnitude. For example here we show Boundary Enhancement, where regions of consistent intensity appear transparent.
Compiling the source code (Lazarus)
- You will need a relatively recent version of Lazarus installed.
- You will need the "lazopenglcontext" package installed:
- Launch Lazarus.
- From the package menu, select "Configure installed packages".
- Select "lazopenglcontext" from the list of available packages and press the "Install selection" button.
- Press the "Save and rebuild IDE" button.
- Click here to get the raycast source code and sample images.
- Launch Lazarus, open the project and choose 'Run' from the 'Run' menu.
Compiling the source code (Delphi)
- This has been tested with Delphi 7 and Delphi XE (thanks to George Boudouris).
- Click here to get the raycast source code and sample images.
- Launch Delphi, open the project simple.dpr and compile. No additional components should be required.
Notes
- Requires a GPU able to load large 3D textures. This should work on modern Radeon and GeForce video cards. Works with Intel HD2000/3000 but not earlier Intel cards.
- Currently loads 8-bit, 16-bit and RGB NIfTI format data.
- Delphi version only opens uncompressed images (.nii or .hdr/.img pairs). The Lazarus version can also open compressed .nii.gz files.
- This is a pretty complex project. I have also created a minimal Delphi/Lazarus project as a template for dglOpenGL applications.
Bounties
This is a work in progress. I have been unable to resolve the following problem. I am happy to offer individuals $200 USD for being the first one to find a solution:
- The raycaster from the GLScene team (below) generates poorer quality renderings than the dglopengl version. While setting high values "PROJECTION_LENGTH" should create higher quality renderings (as each ray is sampled more frequently), this does not seem to work well with GLScene. I think the problem might be with the opacity correction for oversampled ray casting. The traditional shader code for this would be "s.a = 1.0-pow((1.0 - s.a), oversamplingratio);" such that if the ray samples at twice the slice thickness (ratio 1/2=0.5) then a sample where the opacity was a=0.6 should be scaled to contribute 0.367 to the ray (see pages 219-220 of Engle's book for details).
GLScene versions
- Here are two volume raycasters that use GLScene, one from the GLScene team and my adaptation of my dglOpenGL project.
- The current GLScene team renderer shows a number of artifacts. Their project also requires the latest versions of GLScene, so you may need to upgrade. This code was tested with March 2011.
- My project does not yet support all the features of my dglOpenGL project.
Links
- Engle et al's book "Real time volume graphics" (ISBN<PHONE_NUMBER>) is an excellent resource, and their web page includes sample code, tutorials, and links.
- This project is mostly a direct port of the Single-Pass Raycasting technique described by Peter Trier, Philip Rideout and Doyub Kim.
- Marcus Bannerman has a great description of GLSL tricks such as stochastic jittering and surface lighting.
- This example uses the dglopengl headers, and their web page has some useful tutorials.
- My code uses a 3D Sobel filter to estimate gradients (the direction of the surfaces), a technique that provides better results than the faster Central Difference estimate.
- Volumetric Methods in Visual Effects (SIGGRAPH 2010 course).
- Brandon Ellenberger and K. Evan Nowak provide some nice looking GLSL shading fragments.
- Voreen has very sophisticated shaders that can generate dramatic images.
- Jurgen Abel has created the Medical Volume Explorer which uses Cg shaders to good effect. He also created the Texture3D demo, which is a nice introduction to texture mapping rendering if you use Lazarus or Delphi with GLScene.
- MRIcroGL is a texture mapping volume renderer I created that attempts to be intuitive but relatively powerful.


BREAKING easyJet buys all Thomas Cook's flight slots at Gatwick and Bristol
The collapse of Thomas Cook meant more than just high street shops and planes were made available to buy - with easyJet taking advantage to bag extra airport take off and landing slots too
by James Andrews, http://www.facebook.com/jameswritesmoney/Budget airline easyJet has bought Thomas Cook's slots at Gatwick and Bristol airports for £36million.
The deal means 12 more summer slot pairs and 8 more winter slot pairs at Gatwick and 6 more summer slots and one extra winter slot pair at Bristol.
More information will be made available about how they'll be used on 19 November as part of easyJet's full year results announcement.
The news comes a month after independent travel agent Hays Travel said it would buy all 555 remaining high street stores from Thomas Cook and re-employ hold of as many of its staff as possible.
We'll be bringing you the very latest updates, pictures and video on this breaking news story.
For the latest news and breaking money news visit Mirror.co.uk/money .
Get all the big headlines, pictures, analysis, opinion and video on the stories that matter to you.
Follow us on Twitter @MirrorMoney for real news in real time.
We're also on Facebook - your must-see financial news, features, videos and pictures throughout the day from the Daily Mirror.


A Fortran compiler may implement permanent data movement during the execution of a Fortran program. This would require that pointers to such data are appropriately updated. An implementation with automatic garbage collection is one use case. Such permanent data movement is in conflict with MPI in several areas:
Example
Using separated variables for overlapping communication and computation to allow
the protection of nonblocking communication with the ASYNCHRONOUS attribute.
 CALL MPI_Irecv(b_lefthalo ( 0), ..., left, ..., req(1), ...) CALL MPI_Irecv(b_righthalo(101), ..., right, ..., req(2), ...) ! b_lefthalo and b_righthalo is written asynchronously. ! There is no other concurrent access to b_lefthalo and b_righthalo. CALL MPI_Isend(b_inner( 1), ..., left, ..., req(3), ...) CALL MPI_Isend(b_inner(100), ..., right, ..., req(4), ...) DO i=2,99 ! compute only elements for which halo data is not needed bnew(i) = function(b_inner(i-1), b_inner(i), b_inner(i+1)) ! b_inner is read and sent at the same time. ! This is allowed based on the rules for ASYNCHRONOUS. END DO CALL MPI_Waitall(4,req,...) END SUBROUTINE


About
FreeStock is a collection of bots that manage your Robinhood portfolio. The bots are mathematical tools and not financial
advisers. Do not consider anything here financial advise.
Robinhood
Connect your Robinhood account for detailed analytics, stoploss automation, and options help.
Robinhood integration coming soon.
Robinhood
Equity: {{user.robinhoodAccount.portfolioBody.equity}}


Bye, friends—it was fun.
Download Everything
All the music we put out. 235MB ZIP.
View the Polymath source code.


Download Code
1. Numerical experiments
Consider the one dimensional linear Vlasov-Fokker-Planck (VPFP) as following.
In the numerical experiments, we compare the results from the greedy algorithm with the results from the polynomial interpolation of the quadrature points. we set $\epsilon = 1, T = 0.5$ for all examples. More specifically, we set
is the approximation solution obtained from either method, $f(T, x,v,z_i)$ is the exact solution. $z_i$ is uniformly chosen from $[a,b]$. ${\textbf{Dimension}}$ refers to the number of snap shots.
Observe Figure 1-6, we found that the Greedy algorithm converges to the solution faster than the other method. Especially, when there is discontinuity, the polynomial interpolation doesn’t converge as dimension increases, however, the Greedy algorithm still converges and almost keeps the same convergent rate.
Algorithm 1.1. The algorithm for the polynomial interpolation:
For Dimension $= n$, ${\alpha_i}_{i=1}^n$ is the n roots of $n$-th order Legendre polynomial, and let
Then by Lagrange interpolation,
1.1 Linear VFP with parametric initial data
In the first experiment, we consider the case where the parameter $z\in[1,5]$ only involved in the initial data,
Figure 1:
Figure 2:
Algorithm 1.2. The algorithm for PDE with only parameter in initial data:
Offline:
Step 1: Set $N = {z_i: z_i = i\delta_z, \delta_z = \frac{b-a}{N_z}, i = 0,1, \dots, N_z}$, we set $N_z = 100$ in this case.
where $ \vert f \vert^2 = \int f^2 dxdv$.
Step 2: After obtaining $z_i^\ast, f_i = f_0(x,v,z_i^\ast)$, $i =1, \dots, n-1$,
where $P^{n-1} f_0$ is the projection onto the subspace spanned by $f_1, \dots, f_{n-1}$
Step 3: Stops when
Online: After we obtained the snap shots ${z_i^\ast}_{i=1}^n$,
Step 1: Orthogonalize ${f_i}_{i=1}^n$,
and calculate the corresponding
Step 2: for any given $z$, one can approximate $f(T, x,v,z)$ by
Figure 1: Continuous initial data
Figure 2: Discontinuous initial data
1.2 Linear parametric VFP with deterministic initial data
In the second experiment, we consider the case where the parameter $z\in[1,5]$ only involved in the PDE,
Figure 3:
Figure 4:
Algorithm 1.3. The algorithm for PDE with only parameters in PDE:
Offline: Set $N = {z_i: z_i = i\delta_z, \delta_z = \frac{b-a}{N_z}, i = 0,1, \dots, N_z}$, we set $N_z = 100$ in this case.
Step 1: choose
Step 2: After obtaining $z_i^\ast, f_i = f(T,x,v,z_i^\ast)$, $i =1, \dots, n-1$,
Step 3: Stops when the above maximum residual smaller than $\epsilon$.
Online: After we obtained the snap shots ${z_i}_{i=1}^n$,
and the corresponding $f_i = f(T, x,v,z_i)$,
Figure 3: Continuous parameter in PDE
Figure 4: Discontinuous parameter in PDE
1.3 Linear parametric VFP with parametric initial data
In the third experiment, we consider the case where the parameter $z\in[1,5]$ involved in both the initial data and the PDE
Figure 5:
Figure 6:
Algorithm 1.4. The algorithm for PDE with parameters in PDE and initial data:
Offline: Set $N = {z_i: z_i = i\delta_z, \delta_z = \frac{b-a}{N_z}, i = 0,1, \dots, N_z}$, we set $N_z = 10000$ in this case.
Step 1: Using Algorithm 1.4 to obtain 50 snap shots out of $N$
to form a new set $N^\ast$.
Step 2: Using Algorithm 1.3 to get snap shot ${ z_i^\ast }_{i=1}^n$
Online: Same as Algorithm 1.3.
Remark 1.5. In the experiments, the exact solution $f(T,x,v,z)$
refers to the numerical solution to VFP, that is, $f(T,x,v,z)$ is a
$N_x\times N_v$ dimensional vector obtained by the following scheme
where $P(f)$ is the discretization of
$\delta_v (M\delta_v (\frac{f}{M}))$,
Remark 1.6. For the matlab coding, the algorithm for the examples is in the “graph.m” file of the folder “eq1”, “eq2”, “eq3” respectively. You can change the coefficients in “sig_1”, “sig_2”, “sig_3”, and the electric field in “fcn_phi_x”, and initial data in “fcn_phi_x_0”, “fcn_rho_0”.
P.S. Remember to change the path of other functions at the beginning of “graph.m”.
Figure 5: Continuous parameter in PDE and initial data
Figure 6: Discontinuous parameter in PDE and initial data


{{> components/blog/post post=blog.post show_tags=true}}
--- products: new: limit: {{theme_settings.homepage_new_products_count}} featured: limit: {{theme_settings.homepage_featured_products_count}} top_sellers: limit: {{theme_settings.homepage_top_products_count}} carousel: {{theme_settings.homepage_show_carousel}} --- {{#partial "page"}}


Hero name
Hero nickname
Hero power
Spiderman
Friendly neighborhood spider
Shoots laser from his eyes


Landing Page
Special Projects
This story is part of a series of specially designed stories that represents some of the best journalism The Post has to offer. Check out the rest of the special projects here.
8/23/2018
If you longed to be back in Athens during the summer, you weren’t alone — many homesick Bobcats took to Twitter over the summer to keep in touch with all things OU. From comedy to recognition in The New York Times, here are some of the best OU tweets you might have missed this summer:
Don’t even try to tell me you don’t want to play Athens Clue™ pic.twitter.com/oTgFsqdZfM
— Feathers (@Coltron_99) July 26, 2018
OU Yankee Candle scents:
— The Black Sheep Ohio U (@BlackSheepOhioU) July 3, 2018
- the Crystal Bathroom
- Chicken and Waffles
- Wet Bricks
- Bong Hill Breeze
- 1 AM Wendy's
- Insomnia Cookies
- Freshly-washed Pumpkin
- Freshly-mowed College Green
- Pothole Rainwater
- Post-workout Ping
- Goodfella's Late Night Slice
athens is fr out here throwing shade pic.twitter.com/dn9Bi1aQL5
— Andrea; (@andreahornn) July 17, 2018
OU bars as Jersey shore gifs
— Lex (@lex_sicilian) July 15, 2018
Upperclassman during brick break pic.twitter.com/IQJ8Rk9dEn
— Lex (@lex_sicilian) July 15, 2018
SOUVLAKIS CLOSES EVERY SUMMER. THEY ARE NOT CLOSED FOREVER. EVERYBODY CALM DOWN. pic.twitter.com/wkZY5q8fFo
— Toby (@TobyRumple51) July 13, 2018
Tribute to @ohiou in today's NYT crossword.
Landing Page
This story is part of a series of specially designed stories that represents some of the best journalism The Post has to offer. Check out the rest of the special projects here.


So you think she might be pregnant
Here's some quick advice that may be of benefit to you right now:
The Do's
1) Listen. The situation involves more than just you. There are now three lives to think about.
2) Stay Calm. She needs your support now more than ever. She may be carrying the baby, but you are BOTH parents, and regardless of your relationship in the future, that baby needs you too.
3) Talk about it - not only with each other, but prepare to talk with parents and others close to the situation. Hiding the news from people who can genuinely help you only increases the stress.
4) Gather all the facts. Get all the information and seek wise counsel so you can make the best decision for both of you.
5) Express yourself honestly - it's normal to have feelings of anger, frustration and fear. But make sure she knows she is not alone.
The Don'ts
1) Don't bail. The more you run from this, the harder it becomes to think and act clearly.
2) Don't pressure her. Applying pressure will only push her away, possibly into a regretful situation. You will do well to work together as a team.
3) Don't forget. You have a very active role in this situation. Listen to input as well as give your thoughts.


JOE VERSUS THE VOLCANO A film review by Randy Parker Copyright 1996 Randy Parker
RATING: **1/2 (out of ****)
(Review written in 1990)
JOE VERSUS THE VOLCANO is the most frustrating kind of movie.  The reason? The first two thirds of the film are virtually perfect. But just when you think the movie can do no wrong, it pulls the rug out from under you, self-destructs, and dissolves into a sloppy mess. Writer-director John Patrick Shanley has created two thirds of a four star classic.
The movie stars Tom Hanks as Joe Banks, a hypochondriac who always feels miserable. Joe works as an advertising librarian in a hideous office, which is located deep in the bowels of a surgical parts factory. His boss is a dunce, the work is boring, the coffee is putrid, and the fluorescent lights create a blinding glare. In short, Joe's life is incredibly grim, and it goes from bad to worse when a doctor tells him he has a "brain cloud"--a rare condition which will kill him within six months. Joe quits his crummy job, and the very next day a rich tycoon, played by Lloyd Bridges, comes a knockin' on his door with an unusual offer. He wants to hire Joe to jump into a volcano on a small island in the Caribbean. Joe has nothing to lose so he accepts the offer.
After Hanks' dismal outings in THE BURBS and TURNER & HOOCH, JOE VERSUS THE VOLCANO comes as a breath of fresh air. Like PUNCHLINE, VOLCANO taps into Hanks' somber side and offers him a substantial character: someone who has lost his spirit and who comes to life only after he learns that he's dying. Joe is one of Hanks' more intriguing roles, and consequently VOLCANO is easily one of the actor's better films.
VOLCANO, however, really belongs to Meg Ryan, who seems more and more polished with each movie. Ryan plays three vastly different characters, and she is enchanting in each one. First, wearing a brown wig and brown lenses, she plays DeDe, a dizzy secretary who works with Joe. Second, sporting a red wig and red lipstick, she plays Angelica, Lloyd Bridges' snobby, neurotic daughter. Third, she plays Angelica's half-sister, Patricia, a blond blue-eyed beauty. First, Ryan looks like Ally Sheedy, then like Molly Ringwald, and finally like herself. But it's not just Ryan's make-up that changes: it's her mannerisms, her body language, and the way she talks. Ryan plays each part with flair and conviction.
Until the disappointing finale, VOLCANO brings to mind films like AFTER HOURS and SOMETHING WILD. It shares with those movies a timeless, otherworldly quality and a pungent satirical tone. As in any great black comedy, every character is colorful; every actor seems perfectly cast. For example, Ossie Davis turns up as a sophisticated limo driver who takes Joe on a massive shopping spree in Manhattan. The grave luggage salesman they encounter is a riot.
VOLCANO is most memorable, however, not for its performances but for its production design. The opening sequence, which takes us into Joe's work-place, is a masterpiece of surrealism. The surgical parts factory is a nightmarish dungeon, complete with endless stairs, clunky machines, and glaring fluorescent lights. VOLCANO is Shanley's directorial debut (he previously wrote MOONSTRUCK, FIVE CORNERS, and THE JANUARY MAN), and his direction is surprisingly confident and stylish.
The problem is that an hour into the film, the bottom falls out of Shanley's script, and the movie takes a nose dive. VOLCANO begins as an intelligent satire and ends as a silly comic book. The movie really falls apart once Joe reaches the volcanic island, which is inhabited by natives who worship Orange Soda; their chief is played by Abe Vigoda of all people. It's as if Shanley didn't know how to end the story; the tacky finale seems as if it were written by someone else, by a hack. It just doesn't feel right. How can a movie so extraordinarily good become so exceedingly awkward? Blame Shanley: he rows the movie up a creek and then throws away the paddle.
----------- Randy Parker<EMAIL_ADDRESS>http://www.shoestring.org
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


Expert: The NRA Data Leak Have Attracted the Attention of Hackers from around the World
Hacking attacks attempts against the National Revenue Agency (NRA) continue. However, new systems prevent them. This is assured by the agency. The NRA executive noted that there have been 1,000 hacking attempts in a single day, and explained that they have been working with the General Directorate Combating Organized Crime. This was stated by Pavel Georgiev of the Ethical Hackers Association. The director of the Revenue Agency Galya Dimitrova confirmed this on Thursday.
"Until recently, we weren't so attractive, but this data leak which became known worldwide, attracted the attention of hackers from all over the world. Perhaps this is the main reason for the increased attacks against all institutions - not only to the NRA, but also state websites, even local and municipal websites and institutions, "Georgiev said.


Writing your first JavaScript Program
Done with Chapter 1?
Go to Chapter 2!This chapter intruduced us to programming at a pretty basic level. I showed us where JavaScript is in the programming world in relation to other languages.
The chapter also showed us the three different ways we can add JavaScript to a webpage. We were introduced to our first mini program with an alert box.
The author also took a good amounnt of time to explain differnt debugging methods and tools. He went through some of the debugging features that the main web browsers today have.


Click a location on the map to display site-specific experience or the icons at the bottom for aggregate listings. Thanks for stopping by!
Brian Loomis


Looking for friends or people who share your hobbies? Then sign up for Let's Play and start meeting interesting and fantastic people!


|
Layout Control System (LCS)
|
API handler class for a LCS controller. More...
#include <APIController.h>
Signals | |
| void | sendNotificationMessage (const QString &url, const QJsonObject &obj) |
| Notifies interested parties that a controller's status has changed. | |
Public Member Functions | |
| APIController (QObject *parent=nullptr) | |
API handler class for a LCS controller.
APIController This class handles all API requests for a controller. Two types of requests are made as it relates to a LCS controller; "/API/..." requests sent from an external source like a web page or an application and a "/controller/..." requests sent by a LCS controller to download information from the application server.
|
explicit |
Contstructor Creates a controller API handler. The constructor registers a Url Handler objects. See the API documentation for information on the URL's handled by this class.
|
slot |
API "/controller/config" Downloads a controller's configuration
| request | APIRequest containing the url of the request including the serial number of the controller. |
| response | APIResponse with the payload set to the controller's configuration information in JSON format. |
|
slot |
API "/api/send_controller_reset" Sends a SYS_REBOOT_CONTROLLER broadcast UDP message instructing the controller(s) to restart.
| request | APIRequest containing the url of the request including the controller's serial number. If the serial number is less than 1, all controllers are restarted. |
| response | APIResponse unused. |
|
slot |
API "/api/send_controller_reset_config" Sends a SYS_RESET_CONFIG broadcast UDP message instructing the controller(s) to delete all configuration data.
| request | APIRequest containing the url of the request including the controller's serial number. If the serial number is less than 1, all controllers delete their configuration data. |
| response | APIResponse unused. |
|
slot |
API "/controller/device/config" Downloads a device's configuration
| request | APIRequest containing the url of the request including the deviceID. |
| response | APIResponse with the payload set to the device's configuration information in JSON format. |
|
slot |
API "/controller/firmware" Downloads a controller's firmware.
| request | APIRequest containing the url of the request including the controller's serial number. |
| response | APIResponse not used. |
|
slot |
API "/api/controller_list" Downloads a list of all controllers.
| request | APIRequest containing the url of the request including the controller's serial number. |
| response | APIResponse with the payload set to the list of controllers in JSON format. |
|
slot |
API "/api/controller_module_list" Downloads a list of modules for a controller or a specific module.
| request | APIRequest containing the url of the request including the controller's ID or a specific module ID. |
| response | APIResponse with the payload set to the list of controller modules in JSON format. |
|
slot |
API "/controller/notification_list" Downloads a controller's controllers-to-notify list.
| request | APIRequest containing the url of the request including the controller's serial number. |
| response | APIResponse with the payload set to the controller's list of controllers-to-notify in JSON format. |
|
slot |
API "/controller/route_list" Downloads a controller's firmware.
| request | APIRequest containing the url of the request including the route's id. |
| response | APIResponse with the payload set to the route's turnout list in JSON format. |
|
slot |
API "/controller/module/config" Downloads a controller module's configuration
| request | APIRequest containing the url of the request including the serial number of the controller and the address of the module. |
| response | APIResponse with the payload set to the controller module's configuration information in JSON format. |
|
slot |
API "/api/send_controller_reset_notification_list" Sends a SYS_RESET_NOTIFICATION_LIST broadcast UDP message instructing the controller(s) to delete controllers-to-notify list. The controller responds by sending a /controller/notification_list request to the application server.
| request | APIRequest containing the url of the request including the controller's serial number. If the serial number is less than 1, all controllers delete their controllers-to-notify list. |
| response | APIResponse unused. |
|
slot |
API "/api/send_controller_firmware" Sends a SYS_DOWNLOAD_FIRMWARE broadcast UDP message instructing the controller(s) to download the firmware. The controller responds by sending a /controller/firmware request to the application server.
| request | APIRequest containing the url of the request including the controller's serial number. If the serial number is less than 1, all controllers download the new firmware. |
| response | APIResponse unused. |
|
slot |
Monitors the ControllerManager for controller status changes
| serialNumber | long Serial number of the controller. |
| newStatus | ControllerStatusEnum The controller's new status. |


This script defines core utilities for the J standard library. Definitions are loaded into the z locale.
| A | abspath, adverb, apply, assert |
| B | bind, boxopen, boxxopen, bx |
| C | clear, conjunction, CR, CRLF, cutLF, cutopen |
| D | datatype, Debug, def, define, DEL, dfh, do, drop, dyad |
| E | each, EAV, echo, EMPTY, empty, erase, every, evtloop, exit, expand |
| F | fetch, FF, file2url, fixdotdot, fliprgb |
| G | getalpha, getargs, getenv |
| H | hfd |
| I | inv, inverse, iospath, isatty, isutf16, isutf8, items |
| L | leaf, LF, LF2, list |
| M | monad |
| N | nameclass, namelist, names, nc, nl, Note, noun |
| O | on |
| P | pick |
| R | rows |
| S | script, scriptd, setalpha, sign, sminfo, smoutput, sort, split, stderr, stdin, stdout |
| T | TAB, table, take, timespacex, timex, tmoutput, toCRLF, toHOST, toJ, tolist, tolower, toupper, type |
| U | ucp, ucpcount, usleep, utf8, uucp |
| V | verb |
| abspath | v | absolute file system path name |
| adverb | n | integer 1 |
| apply | v | apply verb x to y |
| bx | v | indices of 1's in boolean (same as I.) |
| conjunction | n | integer 2 |
| CR | n | carriage return character |
| CRLF | n | CR,LF pair |
| cutLF | v | cut text on LF, removing empties |
| Debug | n | debug flag, initialized to 0 |
| def | c | : (explicit definition) |
| define | a | : 0 (explicit definition script form) |
| DEL | n | ascii 127 character |
| dfh | v | decimal from hex |
| do | v | name for ". |
| drop | v | name for }. |
| dyad | n | integer 4 |
| each | a | each (&.>) |
| EAV | n | ascii 255 character |
| echo | v | write argument to session |
| EMPTY | n | empty matrix (i.0 0) |
| empty | v | return empty result (i.0 0) |
| erase | v | erase namelist |
| every | a | every (&>) |
| evtloop | v | initialize event loop |
| exit | v | name for 2!:55 (exit) |
| fetch | v | name for {:: |
| FF | n | formfeed character |
| file2url | v | convert to file:// format |
| fixdotdot | v | fix up a/b/c/d/../../e/../f to a/b/f |
| fliprgb | v | flip between argb and abgr byte order |
| getalpha | v | get alpha channel |
| getargs | v | get args |
| getenv | v | cover for get environment variable, 2!:5 |
| hfd | v | hex from decimal |
| inv | a | inverse (^:_1) |
| inverse | a | inverse (^:_1) |
| iospath | v | iOS file system path |
| isutf16 | v | if character string is valid UTF-16 |
| isutf8 | v | if character string is valid UTF-8 |
| items | a | name for ("_1) |
| leaf | a | leaf (L:0) |
| LF | n | linefeed character |
| LF2 | n | LF,LF pair |
| monad | n | integer 3 |
| nameclass | v | name for 4!:0 |
| namelist | v | name for 4!:1 |
| names | v | formatted namelist |
| nc | v | name for 4!:0 |
| noun | n | integer 0 |
| on | c | name for @: |
| pick | v | pick (>@{) |
| rows | a | rows ("1) |
| script | v | load script, cover for 0!:0 |
| scriptd | v | load script with display, cover for 0!:1 |
| setalpha | v | set alpha channel |
| sign | v | sign (*) |
| sminfo | v | info box or output to session |
| smoutput | v | output to session |
| sort | v | sort up |
| stderr | v | name for 1!:2&5 |
| stdin | v | name for 1!:1&3 with obverse stdout |
| stdout | v | name for 1!:2&4 |
| TAB | n | tab character |
| take | v | name for {. |
| tmoutput | v | output to stdout |
| toCRLF | v | converts character strings to CRLF delimiter |
| toHOST | v | converts character strings to Host delimiter |
| toJ | v | converts character strings to J delimiter (linefeed) |
| tolist | v | convert boxed to list |
| tolower | v | convert text to lower case |
| toupper | v | convert text to upper case |
| type | v | object type |
| verb | n | integer 3 |
assertion failure if 0 e. y e.g. 'invalid age' assert 0 <: age
binds monadic verb to an argument creating a new verb that ignores its argument. e.g. fini=: sminfo bind 'finished...'
Box argument if open.
e.g. if script=: 0!:0 @ boxopen, then either
script 'work.ijs' or script <'work.ijs'
See also boxxopen.
Use cutopen to allow multiple arguments.
Box argument if open and not empty.
See also boxopen.
Clear all names in locale, returns any names not erased.
clear 'myloc'
Cut argument if open. This allows an open argument to be given where a boxed list is required.
Most common situations are handled. it is similar to boxopen, except allowing multiple arguments in the character string.
x is optional delimiters, default LF if in y, else blank
y is boxed or an open character array.
if y is boxed it is returned unchanged, otherwise:
if y has rank 2 or more, the boxed major cells are returned
if y has rank 0 or 1, it is cut on delimiters in given in x, or
if x not given, LF if in y else blank. Empty items are deleted.
e.g. if script=: 0!:0 @ cutopen, then
script 'work.ijs util.ijs'
unicode/unicode4 are literal2/literal4 in J dictionary
form: boolean expand data
Test whether a file descriptor refers to a terminal
FILE_TYPE_CHAR=: 2
STD_INPUT_HANDLE=: _10
STD_OUTPUT_HANDLE=: _11
STD_ERROR_HANDLE=: _12
syntax: {width} list data accepts data as one of:
boxed list
character vector, delimited by CR, LF or CRLF; or by ' '
character matrix
formats in given width, default screenwidth
Selective namelist.
[mp] nl sel
sel: one or more integer name classes, or a name list.
if empty use: 0 1 2 3.
mp: optional matching pattern. If mp contains '*', list names
containing mp, otherwise list names starting mp. If mp
contains '~', list names that do not match.
e.g. 'f' nl 3 - list verbs that begin with 'f'
'*com nl '' - list names containing 'com'
Monadic form:
This enables multi line comments without repeated NB.-and requires a right parenthesis in the first column of a line to close. The right argument may be empty, numeric, text, or any noun. Reads and displays the comment text but always returns an empty character string so the comment is not duplicated on screen.
The right argument can number or describe the notes, e.g.
Note 1 Note 2.2 or Note 'The special case' etc.
Dyadic form:
This permits a single consist form of comment for any lines which are not tacit definitions. The left argument must be a noun. The function code displays the right argument and returns the left argument.
Note 1
... note text
)
Split head from tail.
split 'abcde'
┌─┬────┐
│a│bcde│
└─┴────┘
2 split 'abcde'
┌──┬───┐
│ab│cde│
└──┴───┘
table - function table (adverb)
1 2 3 * table 10 11 12 13
┌─┬───────────┐
│*│10 11 12 13│
├─┼───────────┤
│1│10 11 12 13│
│2│20 22 24 26│
│3│30 33 36 39│
└─┴───────────┘
Time and space for expressions.
[repetitions] timespacex 'expression'
10 timespacex &> 'q:123456787';'3^10000x'
0.005 58432
0.061 52352
See also timex.
Time expressions.
[repetitions] timex 'expression'
See also timespacex.
This is 7-bit ascii (if possible) or literal2 with UTF-16 encoding (compare uucp).
inverse is utf8.
Counts number of literal2 in a string when converted to UTF-16
A unicode codepoint has one or two literal2, this gives the number of literal2, not unicode codepoint
linux max value around 33 minutes
windows minimum resolution in milliseconds.
Convert string to literal with UTF-8 encoding
Inverse of ucp.
Convert text to literal2 with UTF-16 encoding
This is always literal2 (compare ucp)


| Category Indian Round | Distance | Target Face Size | No. of Arrows In Each End |
No. of Ends. | Total No. of Arrows | Total Points |
| U/14 | 20 m | 80 cm | 3 | 12 | 36 | 360 |
| 30 m | 122 cm | 3 | 12 | 36 | 360 | |
| U/17 | 40 m | 122 cm | 3 | 12 | 36 | 360 |
| 30 m | 80 cm | 3 | 12 | 36 | 360 | |
| U/19 & Open | 50 m | 122 cm | 3 | 12 | 36 | 360 |
| 30 m | 80 cm | 3 | 12 | 36 | 360 |
| Category Compound & Recurve | Distance | Target Face Size | No. of Arrows In Each End |
No. of Ends. | Total No. of Arrows | Total Points |
| Sub-Junior Cadet U/14 | 60 m | 122 cm | 6 | 6 | 36 | 360 |
| 50 m | 122 cm | 6 | 6 | 36 | 360 | |
| 40 m | 80 cm | 3 | 12 | 36 | 360 | |
| 30 m | 80 cm | 3 | 12 | 36 | 360 | |
| 1440 | ||||||
| Junior U/17 | 70/90 m | 122 cm | 6 | 6 | 36 | 360 |
| 60/70 m | 122 cm | 6 | 6 | 36 | 360 | |
| 50 m | 80 cm | 3 | 12 | 36 | 360 | |
| 30 m | 80 cm | 3 | 12 | 36 | 360 | |
| 1440 | ||||||
| Senior U/19 & open | 60 m | 122 cm | 6 | 6 | 36 | 360 |
| 60/70 m | 122 cm | 6 | 6 | 36 | 360 | |
| 50 m | 80 cm | 3 | 12 | 36 | 360 | |
| 30 m | 80 cm | 3 | 12 | 36 | 360 | |
| 1440 |


Appalachian Weather
Temperature Plots
*Stations with obs > 1 hour old are excluded*
The number of stations in each plot may dwindle through the morning as ice accumulates


Use this page to create or modify the list of webpages you want to open.
Delete selected
Description
URL
Save


|
Index
ANS
API
Debugger
Download
Licensing
Links
Locals
OOP In Ficl
Parse Steps
Release History
Upgrading To 4.0
| |
Ficl includes a simple step debugger for colon definitions
and DOES> words.
To debug a word, set up the stack with any parameters the word requires,
then execute:
DEBUG your-word-name-here
If the word is unnamed, or all you have is an execution token,
you can instead use DEBUG-XT
The debugger invokes SEE on the word which prints a crude source
listing. It then stops at the first instruction of the definition. There are
six (case insensitive) commands you can use from here onwards:
-
I (step In)
- If the next instruction is a colon defintion or does> word, steps into
that word's code. If the word is a primitive, simply executes the word.
-
O (step Over)
-
Executes the next instruction in its entirety.
-
G (Go)
-
Run the word to completion and exit the debugger.
-
L (List)
-
Lists the source code of the word presently being stepped.
-
Q (Quit)
-
Abort the word and exit the debugger, clearing the stacks.
-
X (eXecute)
-
Interpret the remainder of the line as Ficl words. Any change
they make to the stacks will be preserved when the debugged word
continues execution.
Any errors will abort the debug session and reset the VM. Usage example:
X DROP 3 \ change top argument on stack to 3
Any other character will prints a list of available debugger commands.
If there is a defined word named ON-STEP when the debugger starts, that
word will be executed before every step. Its intended use is to display the stacks
and any other VM state you find interesting. The default ON-STEP is:
: ON-STEP ." S: " .S-SIMPLE CR ;
If you redefine ON-STEP , we recommend you ensure the word has no
side-effects (for instance, adding or removing values from any stack).
-
.ENV ( -- )
-
Prints all environment settings non-destructively.
-
.S ( -- )
-
Prints the parameter stack non-destructively in a verbose format.
-
.S-SIMPLE ( -- )
-
Prints the parameter stack non-destructively in a simple single-line format.
-
F.S ( -- )
-
Prints the float stack non-destructively (only available if
FICL_WANT_FLOAT is enabled).
-
R.S ( -- )
-
Prints a represention of the state of the return stack non-destructively.
The debugger words are mostly located in source file tools.c . There are
supporting words (DEBUG and ON-STEP ) in softcore.fr as well.
There are two main words that make the debugger go: debug-xt and step-break .
debug-xt takes the execution token of a word to debug (as returned by ' for example) ,
checks to see if it is debuggable (not a primitive), sets a breakpoint at its
first instruction, and runs see on it. To set a breakpoint,
debug-xt
replaces the instruction at the breakpoint with the execution token of step-break , and
stores the original instruction and its address in a static breakpoint
record. To clear the breakpoint, step-break simply replaces the original
instruction and adjusts the target virtual machine's instruction pointer
to run it.
step-break is responsible for processing debugger commands and setting
breakpoints at subsequent instructions.
The debugger needs to exit automatically when it encounters the end of the word
it was asked to debug. (Perhaps this could be a special kind of breakpoint?)
Add user-set breakpoints.
Add "step out" command.
|


---
layout: projectpages
title: "Tools Data Visualisation"
author: "partha"
categories: visualisationtype
caption: Explore data related to tools section of platform
tags: [tools, visualisation]
image:
feature : visuals_ss.png
---
These visualisations are based on data generated due to interaction with tools section of the platform. They are mainly based on three metrics for each tool- total number of days accessed, average number of students in a day and average time spent by a student in a day.
Total Number of Days Tool was Used in a School
{% for post in site.categories.vis_tools_total_num_days %}
-
{{post.caption}}
{% endfor %}
Total Number of Students Enganged in a School
{% for post in site.categories.vis_tools_total_students %}
-
{{post.caption}}
{% endfor %}
Average Number of Students Engaged in a Day
{% for post in site.categories.vis_tools_avg_num_students%}
-
{{post.caption}}
{% endfor %}
Total Time Spent by All Students in a Day
{% for post in site.categories.vis_tools_time_spent_day%}
-
{{post.caption}}
{% endfor %}


Ask any Belmont and he will tell you that count Dracula is a man of taste. Stroll through his ambient castle corridors, walk by his imposing library or listen to his melancholy harmony and you will feel the same way too. Were it not for the fact that the count keeps terrible company (death among others) the Belmonts would certainly consider living in his castle. It is a shame then that everytime a Belmont defeats the count his castle is destroyed with him. What a waste!
Perhaps no Belmont appreciates Dracula's taste more than Juste. 50 years have passed since his grandfather Simon vanquished the count. And now he is whiling away his youth on a beautiful maiden Lydie. His best friend Maxim takes upon himself to find the remains of the count and destroy him once and for all. He seeks glory while his friend is indulging in pleasures.
Things take a turn for the worse when Lydie is kidnapped. Maxim apprises Juste of the incident and the two set out together to find their friend. They are taken into Dracula's castle. It is not clear how it came into being but they don't care about the count at present. They just want to find Lydie unaware of the evil that is on the cusp of a resurrection.
Harmony of dissonance does not feature count as the villain. He is latent. His power can be felt but he can not be seen. When Juste for the first time enters in the castle he is so taken in by it's ancient beauty that he decides to set up a room for himself in it. Maybe thinking that once the evil is destroyed it would be a waste to let this beautiful dwelling go. For this purpose he starts to collect the basic objects that a man needs to live. Scattered within the castle are things such as mirrors, dining tables, candle sticks etc.
But all this exertion would be for nothing if he does not find Lydie. Therefore he explores each and every corner of the castle. Fights fearsome enemies and acquires amazing abilities. With each step getting closer to finding Lydie.
Gameplay wise Harmony of dissonance builds upon the formula of the circle of the moon. Rather than cards that can be used to give different abilities, this time around it is the whip that is customizable which can be equipped with different end points. Most of them represent an element. So if a monster who is weak against ice is fought with the ice tipped whip it will deplete his health much faster. The crushing stone tip can used to open new pathways and it also allows the whip to be charged, mega man style, to deal hefty raw damage. Where as there is another tip that allows the whip to be rotated which is excellent for enemies with low hp that come in pairs.
The secondary weapons are the same as in any castlevania game. But this time around spells can be attached to weapons which makes them super powerful. The spells use MP gauge which replenishes itself in time.
Collectibles include every thing form the aforementioned tips to spells and equipment that enhance the base stats. Defeating enemies earns experience which is used to level up the character. Also scattered throughout are hint cards that offer valuable advice on the tricky areas in the castle.
The star of the game however is the castle itself. It is a great experience traversing it little by little uncovering it's secrets and seeing what's next. During the middle portion of the game both the castles are available and the puzzles get more complex with acts in one part of the castle affecting the areas of another. It can get a bit tricky sometimes to guess where to go next.
The backgrounds are rich and haunting. In addition to building an atmosphere they help in subtle ways to convey the story. As expected the written parts of the game are a bit weak in conveying the story but it is more than compensated for in the visual department .The score is well composed too, though it can be a little disappointing to hear the 16 bit blips and bloops instead of the rich orchestra that castlevania games are famous for.
The game is probably the smoothest castlevania that I have experienced. Left and right triggers allow you to dash which makes traversing the castle a joy. Other controls like jumping and using magic are smooth as well and I always felt in total control of Juste. He is without a doubt the most agile Belmont.
There is very little that can be said against Harmony of dissonance. It is a classic metroidvania game. It has a great atmosphere and is a perfect game to play on a slightly chilly Halloween night. Don't miss the opportunity to play it again even if you have beaten it years ago on your gameboy.


This is my mock Exam No 1 based on the Objectives for the Sun Java Programmers Exam. It was created by Marcus Green<EMAIL_ADDRESS>and may be freely distributed so long as it is unmodified. Please email me if you have any corrections or comments, but please read this document first
http://www.jchq.net/homepage/getanswers.htm.
If you obtained this exam from some other source please email me to let me know and check out the latest version at http://www.jchq.net
Yes, this is a long document (around 35 pages if you were to print it out), if you cannot see the answers then you have not got the entire document, try reloading it untill you can see the answer to Question 60 and the words "End of document";. The answers contain references to approximately which objective the question relates to. If you have a query about any of these questions, please, please include the full answer with the question.
You can post a message on the discussion forum at http://www.jchq.net/discus You could also send me your question but I get heaps of email and my answer is likely to be slow and terse.
As of 5 Oct 2000 the question format has changed very slightly. You will now get more questions that include snippets (though the ratio may be similar to this mock exam). Each question will also tell you how many of the options you need to pick. You can read more about these revisions at http://www.jchq.net/faq/ExamUpdate.htm. You should assume that the real thing will be harder though many people have told me that they get similar marks in the real thing to my exams. Take a look at the "how jchq helped me" forum at http://www.jchq.net/discus to find how other people find the real exam and this material.
Check out my FAQ at http://www.jchq.net/faq/jcertfaq.htm for links to other mock exams You will find links to many good mock exams that add up to hundreds of questions. You can check out my second mock exam that contains 60 question at http://www.jchq.net/mockexams/exam2.htm
Please include which exam you are referring to, ie 1 or 2 (and maybe soon 3)
I have tried to make the questions unambiguous (the meaning should be obvious), but make sure you have read what I have written not what you think I might have written. Thus if it says "Classes can be declared with the private modifier ", it means It is possible to declare a class with the private modifier and not that all classes in all situations can be declared as private. Each question may have one or more correct Answers.
Which of the following lines will compile without warning or error.
1) float f=1.3;
2) char c="a";
3) byte b=257;
4) boolean b=null;
5) int i=10;
What will happen if you try to compile and run the following code
public class MyClass {
public static void main(String arguments[]) {
amethod(arguments);
}
public void amethod(String[] arguments) {
System.out.println(arguments);
System.out.println(arguments[1]);
}
}
1) error Can't make static reference to void amethod.
2) error method main not correct
3) error array must include parameter
4) amethod must be declared with String
Which of the following will compile without error
1)
import java.awt.*;
package Mypackage;
class Myclass {}
2)
package MyPackage;
import java.awt.*;
class MyClass{}
3)
/*This is a comment */
package MyPackage;
import java.awt.*;
class MyClass{}
A byte can be of what size
1) -128 to 127
2) (-2 power 8 )-1 to 2 power 8
3) -255 to 256
4)depends on the particular implementation of the Java Virtual machine
What will be printed out if this code is run with the following command line?
java myprog good morning
public class myprog{ public static void main(String argv[]) { System.out.println(argv[2]); } }1) myprog
Which of the following are keywords or reserved words in Java?
1) if
2) then
3) goto
4) while
5) case
Which of the following are legal identifiers
1) 2variable
2) variable2
3) _whatavariable
4) _3_
5) $anothervar
6) #myvar
What will happen when you compile and run the following code?
public class MyClass{
static int i;
public static void main(String argv[]){
System.out.println(i);
}
}
1) Error Variable i may not have been initialized
2) null
3) 1
4) 0
What will happen if you try to compile and run the following code?
public class Q {
public static void main(String argv[]){
int anar[]=new int[]{1,2,3};
System.out.println(anar[1]);
}
}
1) 1
2) Error anar is referenced before it is initialized
3) 2
4) Error: size of array must be defined
What will happen if you try to compile and run the following code?
public class Q {
public static void main(String argv[]){
int anar[]=new int[5];
System.out.println(anar[0]);
}
}
1) Error: anar is referenced before it is initialized
2) null
3) 0
4) 5
What will be the result of attempting to compile and run the following
code?
abstract class MineBase {
abstract void amethod();
static int i;
}
public class Mine extends MineBase {
public static void main(String argv[]){
int[] ar=new int[5];
for(i=0;i < ar.length;i++)
System.out.println(ar[i]);
}
}
1) a sequence of 5 0's will be printed
2) Error: ar is used before it is initialized
3) Error Mine must be declared abstract
4) IndexOutOfBoundes Error
What will be printed out if you attempt to compile and run the following code ?
int i=1;
switch (i) {
case 0:
System.out.println("zero");
break;
case 1:
System.out.println("one");
case 2:
System.out.println("two");
default:
System.out.println("default");
}
1) one
2) one, default
3) one, two, default
4) default
What will be printed out if you attempt to compile and run the following code?
int i=9;
switch (i) {
default:
System.out.println("default");
case 0:
System.out.println("zero");
break;
case 1:
System.out.println("one");
case 2:
System.out.println("two");
}
1) default
2) default, zero
3) error default clause not defined
4) no output displayed
Which of the following lines of code will compile without error
1)
int i=0;
if(i) {
System.out.println("Hello");
}
2)
boolean b=true;
boolean b2=true;
if(b==b2) {
System.out.println("So true");
}
3)
int i=1;
int j=2;
if(i==1|| j==2)
System.out.println("OK");
4)
int i=1;
int j=2;
if(i==1 &| j==2)
System.out.println("OK");
What will be output if you try to compile and run the following
code, but there is
no file called Hello.txt in the current directory?.
import java.io.*;
public class Mine {
public static void main(String argv[]){
Mine m=new Mine();
System.out.println(m.amethod());
}
public int amethod() {
try {
FileInputStream dis=new FileInputStream("Hello.txt");
}catch (FileNotFoundException fne) {
System.out.println("No such file found");
return -1;
}catch(IOException ioe) {
} finally{
System.out.println("Doing finally");
}
return 0;
}
}
1) No such file found
2 No such file found ,-1
3) No such file found, Doing finally, -1
4) 0
Which of the following statements are true?
1) Methods cannot be overriden to be more private
2) static methods cannot be overloaded
3) private methods cannot be overloaded
4) An overloaded method cannot throw exceptions not checked in the base
class
What will happen if you attempt to compile and run the following code?
class Base {}
class Sub extends Base {}
class Sub2 extends Base {}
public class CEx{
public static void main(String argv[]){
Base b=new Base();
Sub s=(Sub) b;
}
}
1) Compile and run without error
2) Compile time Exception
3) Runtime Exception
Which of the following statements are true?
1) System.out.println( -1 >>> 2);will output a result
larger than 10
2) System.out.println( -1 >>> 2); will output a positive
number
3) System.out.println( 2 >> 1); will output the number 1
4) System.out.println( 1 <<< 2); will output the number 4
What will happen when you attempt to compile and run the following code?
public class Tux extends Thread{1) Compile time error
static String sName = "vandeleur";
public static void main(String argv[]){
Tux t = new Tux();
t.piggy(sName);
System.out.println(sName);
}
public void piggy(String sName){
sName = sName + " wiggy";
start();
}
public void run(){
for(int i=0;i < 4; i++){
sName = sName + " " + i;
}
}
}
What will be displayed when you attempt to compile and run the
following code
//Code start
import java.awt.*;
public class Butt extends Frame{
public static void main(String argv[]){
Butt MyBut=new Butt();
}
Butt(){
Button HelloBut=new Button("Hello");
Button ByeBut=new Button("Bye");
add(HelloBut);
add(ByeBut);
setSize(300,300);
setVisible(true);
}
}
//Code end
1) Two buttons side by side occupying all of the frame, Hello on the
left and Bye on
the right
2) One button occupying the entire frame saying Hello
3) One button occupying the entire frame saying Bye
4) Two buttons at the top of the frame one saying Hello the other
saying Bye
What will be output by the following code?
public class MyFor{
public static void main(String argv[]){
int i;
int j;
outer:
for (i=1;i <3;i++)
inner:
for(j=1; j<3; j++) {
if (j==2)
continue outer;
System.out.println("Value for i=" + i + " Value for j=" +j);
}
}
}
1) Value for i=1 Value for j=1
2) Value for i=2 Value for j=1
3) Value for i=2 Value for j=2
4) Value for i=3 Value for j=1
Which statement is true of the following code?
public class Agg{
public static void main(String argv[]){
Agg a = new Agg();
a.go();
}
public void go(){
DSRoss ds1 = new DSRoss("one");
ds1.start();
}
}
class DSRoss extends Thread{
private String sTname="";
DSRoss(String s){
sTname = s;
}
public void run(){
notwait();
System.out.println("finished");
}
public void notwait(){
while(true){
try{
System.out.println("waiting");
wait();
}catch(InterruptedException ie){}
System.out.println(sTname);
notifyAll();
}
}
}
1) It will cause a compile time error
2) Compilation and output of "waiting"
3) Compilation and output of "waiting" followed by "finished"
4) Runtime error, an exception will be thrown
Which of the following methods can be legally inserted in place of the
comment //Method Here ?
class Base{
public void amethod(int i) { }
}
public class Scope extends Base{
public static void main(String argv[]){
}
//Method Here
}
1) void amethod(int i) throws Exception {}
2) void amethod(long i)throws Exception {}
3) void amethod(long i){}
4) public void amethod(int i) throws Exception {}
Which of the following will output -4.0
1) System.out.println(Math.floor(-4.7));
2) System.out.println(Math.round(-4.7));
3) System.out.println(Math.ceil(-4.7));
4) System.out.println(Math.min(-4.7));
What will happen if you attempt to compile and run the following code?
Integer ten=new Integer(10);
Long nine=new Long (9);
System.out.println(ten + nine);
int i=1;
System.out.println(i + ten);
1) 19 followed by 20
2) 19 followed by 11
3) Compile time error
4) 10 followed by 1
If you run the code below, what gets printed out?
String s=new String("Bicycle");
int iBegin=1;
char iEnd=3;
System.out.println(s.substring(iBegin,iEnd));
1) Bic
2) ic
3) icy
4) error: no method matching substring(int,char)
If you wanted to find out where the position of the letter v (ie
return 2) in the string s
containing "Java", which of the following could you use?
1) mid(2,s);
2) charAt(2);
3) s.indexOf('v');
4) indexOf(s,'v');
Given the following declarations
String s1=new String("Hello")
String s2=new String("there");
String s3=new String();
Which of the following are legal operations?
1) s3=s1 + s2;
2) s3=s1-s2;
3) s3=s1 & s2;
4) s3=s1 && s2
What is the result of the following operation?
System.out.println(4 | 3);
1) 6
2) 0
3) 1
4) 7
public class MyClass1 {
public static void main(String argv[]){ }
/*Modifier at XX */ class MyInner {}
}
What modifiers would be legal at XX in the above code?
1) public
2) private
3) static
4) friend
What will happen when you attempt to compile and run the following code?
public class Holt extends Thread{
private String sThreadName;
public static void main(String argv[]){
Holt h = new Holt();
h.go();
}
Holt(){}
Holt(String s){
sThreadName = s;
}
public String getThreadName(){
return sThreadName;
}
public void go(){
Holt first = new Holt("first");
first.start();
Holt second = new Holt("second");
second.start();
}
public void start(){
for(int i = 0; i < 2; i ++){
System.out.println(getThreadName() +i);
try{
Thread.sleep(100);
} catch(InterruptedException e){System.out.println(e.getMessage());}
}
}
}
1) Compile time error
2) Output of first0, second0, first0, second1
3) Output of first0, first1, second0, second1
4) Runtime error
An Applet has its Layout Manager set to the default of FlowLayout. What code would be correct to change to another Layout Manager.
1) setLayoutManager(new GridLayout());
2) setLayout(new GridLayout(2,2));
3) setGridLayout(2,2);
4) setBorderLayout();
What will happen when you attempt to compile and run the following
code?.
class Background implements Runnable{
int i=0;
public int run(){
while(true){
i++;
System.out.println("i="+i);
} //End while
return 1;
}//End run
}//End class
1) It will compile and the run method will print out the increasing
value of i.
2) It will compile and calling start will print out the increasing
value of i.
3) The code will cause an error at compile time.
4) Compilation will cause an error because while cannot take a
parameter of true.
Which of the following statements about this code are true?
public class Morecombe{
public static void main(String argv[]){
Morecombe m = new Morecombe();
m.go(new Turing(){});
}
public void go(Turing t){
t.start();
}
}
class Turing extends Thread{
public void run(){
for(int i =0; i < 2; i++){
System.out.println(i);
}
}
}
1) Compilation error due to malformed parameter to go method
2) Compilation error, class Turing has no start method
3) Compilation and output of 0 followed by 1
4) Compilation but runtime error
What will be the result when you attempt to compile and run the
following code?.
public class Conv{
public static void main(String argv[]){
Conv c=new Conv();
String s=new String("ello");
c.amethod(s);
}
public void amethod(String s){
char c='H';
c+=s;
System.out.println(c);
}
}
1) Compilation and output the string "Hello"
2) Compilation and output the string "ello"
3) Compilation and output the string elloH
4) Compile time error
Given the following code, what test would you need to put in place of the comment line?
//place test here
to result in an output of the string
Equal
public class EqTest{
public static void main(String argv[]){
EqTest e=new EqTest();
}
EqTest(){
String s="Java";
String s2="java";
//place test here {
System.out.println("Equal");
}else
{
System.out.println("Not equal");
}
}
}
1) if(s==s2)
2) if(s.equals(s2)
3) if(s.equalsIgnoreCase(s2))
4)if(s.noCaseMatch(s2))
Given the following code
import java.awt.*;
public class SetF extends Frame{
public static void main(String argv[]){
SetF s=new SetF();
s.setSize(300,200);
s.setVisible(true);
}
}
How could you set the frame surface color to pink
1)s.setBackground(Color.pink);
2)s.setColor(PINK);
3)s.Background(pink);
4)s.color=Color.pink
How can you change the current working directory using an instance of
the File class called FileName?
1) FileName.chdir("DirName")
2) FileName.cd("DirName")
3) FileName.cwd("DirName")
4) The File class does not support directly changing the current
directory.
If you create a TextField with a constructor to set it to occupy 5 columns, what difference will it make if you use it with a proportional font (ie Times Roman) or a fixed pitch typewriter style font (Courier).
1)With a fixed font you will see 5 characters, with a
proportional it will depend on the width of the characters
2)With a fixed font you will see 5 characters,with a proportional
it will cause the field to expand to fit the text
3)The columns setting does not affect the number of characters
displayed
4)Both will show exactly 5 characters
Given the following code how could you invoke the Base constructor that
will print out the string "base constructor";
class Base{
Base(int i){
System.out.println("base constructor");
}
Base(){
}
}
public class Sup extends Base{
public static void main(String argv[]){
Sup s= new Sup();
//One
}
Sup()
{
//Two
}
public void derived()
{
//Three
}
}
1) On the line After //One put Base(10);
2) On the line After //One put super(10);
3) On the line After //Two put super(10);
4) On the line After //Three put super(10);
Given the following code what will be output?
public class Pass{
static int j=20;
public static void main(String argv[]){
int i=10;
Pass p = new Pass();
p.amethod(i);
System.out.println(i);
System.out.println(j);
}
public void amethod(int x){
x=x*2;
j=j*2;
}
}
1) Error: amethod parameter does not match variable
2) 20 and 40
3) 10 and 40
4) 10, and 20
What code placed after the comment //For loop would result in the
population of every element of the array ia[] with a value from
variable i.?
public class Lin{
public static void main(String argv[]){
Lin l = new Lin();
l.amethod();
}
public void amethod(){
int ia[] = new int[4];
//Start For loop
{
ia[i]=i;
System.out.println(ia[i]);
}
}
}
1) for(int i=0; i < ia.length() -1; i++)
2) for (int i=0; i< ia.length(); i++)
3) for(int i=1; i < 4; i++)
4) for(int i=0; i< ia.length;i++)
What will be the result when you try to compile and run the following
code?
private class Base{
Base(){
int i = 100;
System.out.println(i);
}
}
public class Pri extends Base{
static int i = 200;
public static void main(String argv[]){
Pri p = new Pri();
System.out.println(i);
}
}
1) Error at compile time
2) 200
3) 100 followed by 200
4) 100
What will the following code print out?
public class Oct{
public static void main(String argv[]){
Oct o = new Oct();
o.amethod();
}
public void amethod(){
int oi= 012;
System.out.println(oi);
}
}
1)12
2)012
3)10
4)10.0
What will happen when you try compiling and running this code?
public class Ref{
public static void main(String argv[]){
Ref r = new Ref();
r.amethod(r);
}
public void amethod(Ref r){
int i=99;
multi(r);
System.out.println(i);
}
public void multi(Ref r){
r.i = r.i*2;
}
}
1) Error at compile time
2) An output of 99
3) An output of 198
4) An error at runtime
You need to create a class that will store unique object elements. You do not need to sort these elements but they must be unique.
What interface might be most suitable to meet this need?
1)Set
2)List
3)Map
4)Vector
Which of the following will successfully create an instance of the Vector class and add an element?
1) Vector v=new Vector(99);
v[1]=99;
2) Vector v=new Vector();
v.addElement(99);
3) Vector v=new Vector();
v.add(99);
4 Vector v=new Vector(100);
v.addElement("99");
You have created a simple Frame and overridden the paint method as follows
public void paint(Graphics g){
g.drawString("Dolly",50,10);
}
What will be the result when you attempt to compile and run the
program?
1) The string "Dolly" will be displayed at the centre of the frame
2) An error at compilation complaining at the signature of the paint
method
3) The lower part of the word Dolly will be seen at the top of the
frame, with the top hidden.
4) The string "Dolly" will be shown at the bottom of the frame.
What will be the result when you attempt to compile this program?
public class Rand{
public static void main(String argv[]){
int iRand;
iRand = Math.random();
System.out.println(iRand);
}
}
1) Compile time error referring to a cast problem
2) A random number between 1 and 10
3) A random number between 0 and 1
4) A compile time error about random being an unrecognised method
Given the following code
import java.io.*;
public class Th{
public static void main(String argv[]){
Th t = new Th();
t.amethod();
}
public void amethod(){
try{
ioCall();
}catch(IOException ioe){}
}
}
What code would be most likely for the body of the ioCall method
1) public void ioCall ()throws IOException{
DataInputStream din = new DataInputStream(System.in);
din.readChar();
}
2) public void ioCall ()throw IOException{
DataInputStream din = new DataInputStream(System.in);
din.readChar();
}
3) public void ioCall (){
DataInputStream din = new DataInputStream(System.in);
din.readChar();
}
4) public void ioCall throws IOException(){
DataInputStream din = new DataInputStream(System.in);
din.readChar();
}
What will happen when you compile and run the following code?
public class Scope{
private int i;
public static void main(String argv[]){
Scope s = new Scope();
s.amethod();
}//End of main
public static void amethod(){
System.out.println(i);
}//end of amethod
}//End of class
1) A value of 0 will be printed out
2) Nothing will be printed out
3) A compile time error
4) A compile time error complaining of the scope of the variable i
You want to lay out a set of buttons horizontally but with more space
between the first button and the rest. You are going to use the GridBagLayout manager to control the way the buttons
are set out. How will you modify the way the GridBagLayout acts in
order to change the spacing around the first button?
1) Create an instance of the GridBagConstraints class, call the
weightx() method and then pass the GridBagConstraints instance with the
component to the setConstraints method of the GridBagLayout class.
2) Create an instance of the GridBagConstraints class, set the weightx
field and then pass the GridBagConstraints instance with the component
to the setConstraints method of the GridBagLayout class.
3) Create an instance of the GridBagLayout class, set the weightx field
and then call the setConstraints method of the GridBagLayoutClass with
the component as a parameter.
4) Create an instance of the GridBagLayout class, call the setWeightx()
method and then pass the GridBagConstraints instance with the component
to the setConstraints method of the GridBagLayout class.
Which of the following can you perform using the File class?
1) Change the current directory
2) Return the name of the parent directory
3) Delete a file
4) Find if a file contains text or binary information
Which statement is true of the following code?
public class Rpcraven{
public static void main(String argv[]){
Pmcraven pm1 = new Pmcraven("One");
pm1.run();
Pmcraven pm2 = new Pmcraven("Two");
pm2.run();
}
}
class Pmcraven extends Thread{
private String sTname="";
Pmcraven(String s){
sTname = s;
}
public void run(){
for(int i =0; i < 2 ; i++){
try{
sleep(1000);
}catch(InterruptedException e){}
yield();
System.out.println(sTname);
}
}
}
1) Compile time error, class Rpcraven does not import
java.lang.Thread
2) Output of One One Two Two
3) Output of One Two One Two
4) Compilation but no output at runtime
You are concerned that your program may attempt to use more memory than is available. To avoid this situation you want to ensure that the Java Virtual Machine will run its garbage collection just before you start a complex routine.
 You want to make the size of one of the buttons bigger than the text it contains. Which of the following will allow you to do that?
1) The GridBagLayout manager does not allow you to do this
2) The setFill method of the GridBagLayout class
3) The setFill method of the GridBagConstraints class
4) The fill field of the GridBagConstraints class
Which of the following most closely describes a bitset collection?
1) A class that contains groups of unique sequences of bits
2) A method for flipping individual bits in instance of a primitive
type
3) An array of boolean primitives that indicate zeros or ones
4) A collection for storing bits as on-off information, like a vector
of bits
You have these files in the same directory. What will happen when you
attempt to compile and run Class1.java if you have not already compiled
Base.java
//Base.java
package Base;
class Base{
protected void amethod(){
System.out.println("amethod");
}//End of amethod
}//End of class base
package Class1;
//Class1.java
public class Class1 extends Base{
public static void main(String argv[]){
Base b = new Base();
b.amethod();
}//End of main
}//End of Class1
1) Compile Error: Methods in Base not found
2) Compile Error: Unable to access protected method in base class
3) Compilation followed by the output "amethod"
4)Compile error: Superclass Class1.Base of class Class1.Class1 not
found
What will happen when you attempt to compile and run the following code
class Base{
private void amethod(int iBase){
System.out.println("Base.amethod");
}
}
class Over extends Base{
public static void main(String argv[]){
Over o = new Over();
int iBase=0;
o.amethod(iBase);
}
public void amethod(int iOver){
System.out.println("Over.amethod");
}
}
1) Compile time error complaining that Base.amethod is private
2) Runtime error complaining that Base.amethod is private
3) Output of "Base.amethod"
4) Output of "Over.amethod"
You are creating an applet with a Frame that contains buttons. You
are using the GridBagLayout manager and you have added Four buttons. At
the moment the buttons appear in the centre of the frame from left to
right. You want them to appear one on top of the other going down the
screen. What is the most appropriate way to do this.
1) Set the gridy value of the GridBagConstraints class to a value
increasing from 1 to 4
2) set the fill value of the GridBagConstraints class to VERTICAL
3) Set the ipady value of the GridBagConstraints class to a value
increasing from 0 to 4
4) Set the fill value of the GridBagLayouts class to GridBag.VERTICAL
If you have a copy of the Roberts and Heller Java2 Guide that says the exam does not cover the GridBagLayout, this is an error. You can confirm this by looking at the online errata at
http://www.sybex.com/cgi-bin/rd_err_temp.pl?2463err.html.
Back to question 1)
Objective 4.5)
5) int i=10;
explanation:
1) float f=1.3;
Will not compile because the default type of a number with a floating
point component is a double. This would compile with a cast as in
float f=(float) 1.3
2) char c="a";
Will not compile because a char (16 bit unsigned integer) must be defined with single quotes. This would compile if it were in the form
char c='a';
3) byte b=257;
Will not compile because a byte is eight bits. Take of one bit for the sign component you can define numbers between
-128 to +127
4) a boolean value can either be true or false, null is not allowed
http://www.jchq.net/tutorial/04_05Tut.htm.
Objective 4.1
1) Can't make static reference to void amethod.
Because main is defined as static you need to create an instance of
the class in order to call any non-static methods. Thus a typical way
to do this would be.
MyClass m=new MyClass();
m.amethod();
Answer 2 is an attempt to confuse because the convention is for a main method to be in the form
String argv[]
That argv is just a convention and any acceptable identifier for a string array can be used. Answers 3 and 4 are just nonsense.
http://www.jchq.net/tutorial/04_01Tut.htm
back to Question 3)
Objective 4.1)
2 and 3 will compile without error.
1 will not compile because any package declaration must come before any other code. Comments may appear anywhere
http://www.jchq.net/tutorial/04_01Tut.htm .
Back to question 4)
Objective 4.5)
1) A byte is a signed 8 bit integer.
http://www.jchq.net/tutorial/04_05Tut.htm
Back to question 5)
Objective 4.2)
4) Exception raised: "java.lang.ArrayIndexOutOfBoundsException: 2"
Unlike C/C++ java does not start the parameter count with the program name. It does however start from zero. So in this case zero starts with good, morning would be 1 and there is no parameter 2 so an exception is raised.
http://www.jchq.net/tutorial/04_02Tut.htm
Back to question 6)
Objective 4.3)
1) if
3) goto
4) while
5) case
then is not a Java keyword, though if you are from a VB background you might think it was. Goto is a reserved word in Java.
http://www.jchq.net/tutorial/04_03Tut.htm
Back to Question 7)
Objective 4.1)
2) variable2
3) _whatavariable
4) _3_
5) $anothervar
An identifier can begin with a letter (most common) or a dollar sign($) or an underscore(_). An identifier cannot start with anything else such as a number, a hash, # or a dash -. An identifier cannot have a dash in its body, but it may have an underscore _. Choice 4) _3_ looks strange but it is an acceptable, if unwise form for an identifier.
http://www.jchq.net/tutorial/04_01Tut.htm
Back to Question 8)
Objective 4.4)
4) 0
Class level variables are always initialised to default values. In the case of an int this will be 0. Method level variables are not given default values and if you attempt to use one before it has been initialised it will cause the
Error Variable i may not have been initialized
type of error.
http://www.jchq.net/tutorial/04_04Tut.htm
Back to Question 9)
Objective 4.4)
3 ) 2
No error will be triggered.
Like in C/C++, arrays are always referenced from 0. Java allows an array to be populated at creation time. The size of array is taken from the number of initializers. If you put a size within any of the square brackets you will get an error.
http://www.jchq.net/tutorial/04_04Tut.htm
Back to question 10)
Objective 4.4)
3) 0
Arrays are always initialised when they are created. As this is an array of ints it will be initalised with zeros.
http://www.jchq.net/tutorial/04_04Tut.htm
Back to Question 11)
Objective 1.2
3) Error Mine must be declared abstract
A class that contains an abstract method must itself be declared as abstract. It may however contain non abstract methods. Any class derived from an abstract class must either define all of the abstract methods or be declared abstract itself.
http://www.jchq.net/tutorial/01_021Tut.htm
Back to Question 12)
Objective 2.1)
3) one, two, default
Code will continue to fall through a case statement until it encounters a break.
http://www.jchq.net/tutorial/02_01Tut.htm
Back to Question 13)
Objective 4.1)
2) default, zero
Although it is normally placed last the default statement does not have to be the last item as you fall through the case block. Because there is no case label found matching the expression the default label is executed and the code continues to fall through until it encounters a break.
http://www.jchq.net/tutorial/04_01Tut.htm
Back to Question 14)
Objective 5.1
2,3
Example 1 will not compile because if must always test a boolean. This can catch out C/C++ programmers who expect the test to be for either 0 or not 0.
http://www.jchq.net/tutorial/05_01Tut.htm
Back to Question 15)
Objective 11.5)
3) No such file found, doing finally, -1
The no such file found message is to be expected, however you can get caught out if you are not aware that the finally clause is almost always executed, even if there is a return statement.
http://www.jchq.net/tutorial/11_05Tut.htm
Back to Question 16)
Objective 6.2)
1) Methods cannot be overriden to be more private
Static methods cannot be overriden but they can be overloaded. If you have doubts about that statement, please follow and read carefully the link given to the Sun tutorial below. There is no logic or reason why private methods should not be overloaded. Option 4 is a jumbled up version of the limitations of exceptions for overriden methods
http://www.jchq.net/tutorial/06_02Tut.htm
Back to Question 17)
Objective 6.2)
3) Runtime Exception
Without the cast to sub you would get a compile time error. The cast tells the compiler that you really mean to do this and the actual type of b does not get resolved until runtime. Casting down the object hierarchy is a problem, as the compiler cannot be sure what has been implemented in descendent classes. Casting up is not a problem because sub classes will have the features of the base classes. This can feel counter intuitive if you are aware that with primitives casting is allowed for widening operations (ie byte to int).
http://www.jchq.net/tutorial/06_02Tut.htm
Back to question 18)
Objective 5.1)
1) System.out.println( -1 >>> 2);will output a result
larger than 10
2) System.out.println( -1 >>> 2); will output a positive
number
3) System.out.println( 2 >> 1); will output the number 1
You can test this with the following class
public class shift{
static int i=2;
public static void main(String argv[]){
System.out.println( -1 >>> 2);
System.out.println( -1 >>> 2);
System.out.println( 2 >> 1);
}
}
Java does not have a <<< operator. The operation 1 << 2 would output 4
Because of the way twos complement number representation works the unsigned right shift operation means a small shift in a negative number can return a very large value so the output of option 1 will be much larger than 10.
The unsigned right shift places no significance on the leading bit that indicates the sign. For this shift the value 1 of the bit sign is replaced with a zero turning the result into a positive number for option 2.
http://www.jchq.net/tutorial/05_01Tut.htm
Back to Question 19)
Objective 7.1)
4) Compilation and output of either "vandaleur", "vandaleur 0", "vandaleur 0
1" "vandaleur 0 1 2" or "vandaleur 0 1 2 3"
If that seems a vauge answer it is because you cannot be certain of the system that the underlying OS uses for allocating cycles for a Thread. The chances are that once the thread has been spun off in the call to start in the method piggy the main method will run to completion and the value of sName will still be vandeluer before the Thread modifies it. You cannot be certain of this though.
http://www.jchq.net/tutorial/07_01Tut.htm
Back to Question 20)
Objective 8.1)
3) One button occupying the entire frame saying Bye
The default layout manager for a Frame is a border layout. If directions are not given (ie North, South, East or West), any button will simply go in the centre and occupy all the space. An additional button will simply be placed over the previous button. What you would probably want in a real example is to set up a flow layout as in
setLayout(new FlowLayout());
Which would allow the buttons to both appear side by side, given the
appropriate font and size.
Applets and panels have a default FlowLayout manager
http://www.jchq.net/tutorial/08_01Tut.htm
Back to Question 21)
Objective 2.2)
1,2
Value for i=1 Value for j=1
Value for i=2 Value for j=1
The statement continue outer causes the code to jump to the label outer and the for loop increments to the next number.
http://www.jchq.net/tutorial/02_02Tut.htm
Answer 22)
Back to Question 22)
Objective 7.3)
4) Runtime error, an exception will be thrown
A call to wait/notify must be within synchronized code. With JDK1.2 this code throws the error message
java.lang.IllegalMonitorStateException: current thread not ownerhttp://www.jchq.net/tutorial/07_03Tut.htm
at java.lang.Object.wait(Native Method)
at java.lang.Object.wait(Object.java:424)
at DSRoss.notwait(Compiled Code)
at DSRoss.run(Agg.java:21)
Back to Question 23)
Objective 2.3)
2,3
Options 1, & 4 will not compile as they attempt to throw Exceptions not declared in the base class. Because options 2 and 3 take a parameter of type long they represent overloading not overriding and there is no such limitations on overloaded methods.
http://www.jchq.net/tutorial/02_03Tut.htm
Back to Question 24)
Objective 9.1)
3) System.out.println(Math.ceil(-4.7));
Options 1 and 2 will produce -5 and option 4 will not compile because the min method requires 2 parameters.
http://www.jchq.net/tutorial/08_01Tut.htm
Back to Question 25
Objective 4.5)
3) Compile time error
The wrapper classes cannot be used like primitives.
Depending on your compiler you will get an error that says someting like "Error: Can't convert java lang Integer". Wrapper classes have similar names to primitives but all start with upper case letters.
Thus in this case we have int as a primitive and Integer as a wrapper. The objectives do not specifically mention the wrapper classes but don't be surprised if they come up.
http://www.jchq.net/tutorial/04_05Tut.htm
Back to Question 26)
Objective 4.5)
2) ic
This is a bit of a catch question. Anyone with a C/C++ background would figure out that addressing in strings starts with 0 so that 1 corresponds to i in the string Bicycle. The catch is that the second parameter returns the endcharacter minus 1. In this case it means instead of the "icy" being returned as intuition would expect it is only "ic".
http://www.jchq.net/tutorial/04_05Tut.htm
Back to Question 27)
Objective 9.2)
3) s.indexOf('v');
charAt returns the letter at the position rather than searching for a letter and returning the position, MID is just to confuse the Basic Programmers, indexOf(s,'v'); is how some future VB/J++ nightmare hybrid, might perform such a calculation.
http://www.jchq.net/tutorial/09_02Tut.htm
Objective 5.1)
Back to Question 28
1) s3=s1 + s2;
Java does not allow operator overloading as in C++, but for the sake of convenience the + operator is overridden for strings.
http://www.jchq.net/tutorial/05_01Tut.htm
Back to Question 29)
Objective 5.3)
4) 7
The | is known as the Or operator, you could think of it as the either/or operator. Turning the numbers into binary gives
4=100
3=011
For each position, if either number contains a 1 the result will contain a result in that position. As every position contains a 1 the result will be
111
Which is decimal 7.
http://www.jchq.net/tutorial/05_03Tut.htm
Back to Question 30
Objective 4.1)
1,2,3
public, private, static are all legal access modifiers for this inner class.
http://www.jchq.net/tutorial/04_01Tut.htm
Back to Question 31
Objective 7.1
3) Output of first0, first1, second0, second1
Note that this code overrides and calls the start method. If you wished to get the output mixed you would need to override the run method but call the start method.
http://www.jchq.net/tutorial/07_01Tut.htm
Back to Question 32)
Objective 8.1)
2) setLayout(new GridLayout(2,2));
Changing the layout manager is the same for an Applet or an application. Answer 1 is wrong though it might have been a reasonable name for the designers to choose. Answers 3 and 4 are incorrect because changing the layout manager always requires an instance of one of the Layout Managers and these are bogus methods.
Instead of creating the anonymous instance of the Layout manager as in option 2 you can also create a named instance and pass that as a parameter. This is often what automatic code generators such as Borland/Inprise JBuilder do.
http://www.jchq.net/tutorial/08_01Tut.htm
Back to Question 33)
Objective 7.1)
3) The code will cause an error at compile time
The error is caused because run should have a void not an int return type.
Any class that is implements an interface must create a method to match all of the methods in the interface. The Runnable interface has one method called run that has a void return type.The sun compiler gives the error
Method redefined with different return type: int run() was defined as void run();
http://www.jchq.net/tutorial/07_01Tut.htm
Back to Question 34)
Objective 7.1)
3) Compilation and output of 0 followed by 1
The creation of an anonymous class as a parameter to go is fairly strange as you would expect it to override a method in its parent class (Turing). You don't have to though. The fact that class Turing extends Thread means the anonymous instance that is passed to go has a start method which then calls the run method.
http://www.jchq.net/tutorial/07_01Tut.htm
Back to Question 35
Objective 5.1)
4) Compile time error
The only operator overloading offered by java is the + sign for the String class. A char is a 16 bit integer and cannot be concatenated to a string with the + operator.
http://www.jchq.net/tutorial/05_01Tut.htm
Back to Question 36
Objective 5.2)
3) if(s.equalsIgnoreCase(s2))
String comparison is case sensitive so using the equals string method will not return a match. Using the==operator just compares where memory address of the references and noCaseMatch was just something I made up to give me a fourth slightly plausible option.
http://www.jchq.net/tutorial/05_02Tut.htm
Back to Question 37
Objective 8.1)
1) s.setBackground(Color.pink);
For speakers of the more British spelt English note that there is no letter u in Color. Also the constants for colors are in lower case.
http://www.jchq.net/tutorial/08_01Tut.htm
Back to Question 38)
Objective 11.1)
4) The File class does not support directly changing the current directory.
This seems rather surprising to me, as changing the current directory is a very common requirement. You may be able to get around this limitation by creating a new instance of the File class passing the new directory to the constructor as the path name.
http://www.jchq.net/tutorial/011_01Tut.htm
Back to Question 39)
Objective 8.1)
1)With a fixed font you will see 5 characters, with a proportional it will depend on the width of the characters
With a proportional font the letter w will occupy more space than the letter i. So if you have all wide characters you may have to scroll to the right to see the entire text of a TextField.
http://www.jchq.net/tutorial/08_01Tut.htm
Back to Question 40)
Objective 6.2
3) On the line After //Two put super(10);
Constructors can only be invoked from within constructors.
http://www.jchq.net/tutorial/06_02Tut.htm
Back to Question 41)
Objective 5.4)
3) 10 and 40
when a parameter is passed to a method the method receives a copy of the value. The method can modify its value without affecting the original copy. Thus in this example when the value is printed out the method has not changed the value.
http://www.jchq.net/tutorial/05_04Tut.htm
Back to Question 42
Objective 1.1
4) for(int i=0; i< ia.length;i++)
Although you could control the looping with a literal number as with the number 4 used in option 3, it is better practice to use the length property of an array. This provides against bugs that might result if the size of the array changes. This question also checks that you know that arrays starts from zero and not One as option 3 starts from one. Remember that array length is a field and not a function like the String length() method.
http://www.jchq.net/tutorial/01_01Tut.htm
Back to Question 43)
Objective 1.2
1) Error at compile time
This is a slightly sneaky one as it looks like a question about constructors, but it is attempting to test knowledge of the use of the private modifier. A top level class cannot be defined as private. If you didn't notice the modifier private, remember in the exam to be real careful to read every part of the question.
http://www.jchq.net/tutorial/01_02Tut.htm
Back to Question 44
Objective 4.5)
3)10
The name of the class might give you a clue with this question, Oct for Octal. Prefixing a number with a zero indicates that it is in Octal format. Thus when printed out it gets converted to base ten. 012 in octal means the first column from the right has a value of 2 and the next along has a value of one times eight. In decimal that adds up to 10.
http://www.jchq.net/tutorial/04_05Tut.htm
Back to Question 45
Objective 1.2)
1) Error at compile time
The variable i is created at the level of amethod and will not be available inside the method multi.
http://www.jchq.net/tutorial/01_02Tut.htm
Back to Question 46
Objective 10.1)
1) Set
The Set interface ensures that its elements are unique, but does not order the elements. In reality you probably wouldn't create your own class using the Set interface. You would be more likely to use one of the JDK classes that use the Set interface such as HashSet or TreeSet.
http://www.jchq.net/tutorial/10_01Tut.htm
Back to Question 47
Objective 10.1)
4) Vector v=new Vector(100);
v.addElement("99")
A vector can only store objects not primitives. The parameter "99" for the addElement method pases a string object to the Vector. Option 1) creates a vector OK but then uses array syntax to attempt to assign a primitive. Option 2 also creates a vector then uses correct Vector syntax but falls over when the parameter is a primitive instead of an object.
http://www.jchq.net/tutorial/10_01Tut.htm
Objective 8.1)
Back to Question 48
3) The lower part of the word Dolly will be seen at the top of the form
The Second parameter to the drawstring method indicates where the baseline of the string will be placed. Thus the 3rd parameter of 10 indicates the Y coordinate to be 10 pixels from the top of the Frame. This will result in just the bottom of the string Dolly showing up or possibly only the descending part of the letter y.
http://www.jchq.net/tutorial/08_01Tut.htm
Back to Question 49)
Objective 9.1)
1) Compile time error referring to a cast problem
This is a bit of a sneaky one as the Math.random method returns a pseudo random number between 0 and 1, and thus option 3 is a plausible Answer. However the number returned is a double and so the compiler will complain that a cast is needed to convert a double to an int.
http://www.jchq.net/tutorial/09_01Tut.htm
Objective 2.3)
Back to question 50
1) public void ioCall ()throws IOException{
DataInputStream din = new DataInputStream(System.in);
din.readChar();
}
If a method might throw an exception it must either be caught within the method with a try/catch block, or the method must indicate the exception to any calling method by use of the throws statement in its declaration. Without this, an error will occur at compile time.
http://www.jchq.net/tutorial/02_03Tut.htm
Objective 1.2)
Back to Question 51)
3) A compile time error
Because only one instance of a static method exists not matter how many instance of the class exists it cannot access any non static variables. The JVM cannot know which instance of the variable to access. Thus you will get an error saying something like
Can't make a static reference to a non static variable
http://www.jchq.net/tutorial/01_02Tut.htm
Objective 8.1)
Back to Question 52)
2) Create an instance of the GridBagConstraints class, set the
weightx field and then pass the GridBagConstraints instance with the
component to the setConstraints method of the GridBagLayout class.
The Key to using the GridBagLayout manager is the GridBagConstraint class. This class is not consistent with the general naming conventions in the java API as you would expect that weightx would be set with a method, whereas it is a simple field (variable).
If you have a copy of the Roberts and Heller Java2 Guide that says the exam does not cover the GridBagLayout, this is an error which is corrected in later versions of the book
http://www.jchq.net/tutorial/08_01Tut.htm
Objective 11.1)
Back to Question 53)
2) Return the name of the parent directory
3) Delete a file
It is surprising that you can't change the current directory. It is not so surprising that you can't tell if a file contains text or binary information.
http://www.jchq.net/tutorial/11_01Tut.htm
Back to Question 54)
Objective 7.1
2) Output of One One Two Two
Answer 3 would would be true if the code called the start method
instead of the run method (well it is on my Windows machine anyway,
I'm not sure it would be for ever implementation of Java Threads).
If you call the run method directly it just acts as any other method
and does not return to the calling code until it has finished
executing.
http://www.jchq.net/tutorial/07_01Tut.htm
Objective 3.1)
Back to Question 55)
1) You cannot be certain when garbage collection will run
Although there is a Runtime.gc(), this only suggests that the Java Virtual Machine does its garbage collection. You can never be certain when the garbage collector will run. Roberts and Heller is more specific abou this than Boone. This uncertainty can cause consternation for C++ programmers who wish to run finalize methods with the same intent as they use destructor methods.
http://www.jchq.net/tutorial/03_01Tut.htm
Objective 8.1)
Back to Question 56)
4) The fill field of the GridBagConstraints class
Unlike the GridLayout manager you can set the individual size of a control such as a button using the GridBagLayout manager. A little background knowledge would indicate that it should be controlled by a setSomethingOrOther method, but it isn't.
If you have a copy of the Roberts and Heller Java2 Guide that says the exam does not cover the GridBagLayout, this is an error. You can confirm this by looking at the online errata at
http://www.sybex.com/cgi-bin/rd_err_temp.pl?2463err.html.
http://www.jchq.net/tutorial/08_01Tut.htm
Objective 10.1)
Back to Question 57)
4) A collection for storing bits as on-off information, like a vector of bits
This is the description given to a bitset in Bruce Eckels "Thinking in Java" book. The reference to unique sequence of bits was an attempt to mislead because of the use of the word Set in the name bitset. Normally something called a set implies uniqueness of the members, but not in this context.
http://www.jchq.net/tutorial/10_01Tut.htm
Back to Question 58)
Objective 4.1)
4)Compile error: Superclass Class1.Base of class Class1.Class1 not found
Using the package statement has an effect similar to placing a source file into a different directory. Because the files are in different packages they cannot see each other. The stuff about File1 not having been compiled was just to mislead, java has the equivalent of an "automake", whereby if it was not for the package statements the other file would have been automatically compiled.
http://www.jchq.net/tutorial/04_01Tut.htm
Back to Question 59)
Objective 6.2)
4) Output of Over.amethod()
The names of parameters to an overridden method is not important, but as the version of amethod in class Base is set to be private it is not visible within Over (despite Over extending Base) and thus does not take part in overriding.
http://www.jchq.net/tutorial/06_02Tut.htm
Objective 8.1)
Back to Question 60)
1) Set the gridy value of the GridBagConstraints class to a value increasing from 1 to 4
Answer 4 is fairly obviously bogus as it is the GridBagConstraints class that does most of the magic in laying out components under the GridBagLayout manager. The fill value of the GridBagConstraints class controls the behavior inside its virtual cell and the ipady field controls the internal padding around a component.
If you have a copy of the Roberts and Heller Java2 Guide that says the exam does not cover the GridBagLayout, this is an error. You can confirm this by looking at the online errata at
http://www.sybex.com/cgi-bin/rd_err_temp.pl?2463err.html.
http://www.jchq.net/tutorial/08_01Tut.htm
1) Objective 4.5
2) Objective 4.1
3) Objective 4.1
4) Objective 4.5
5) Objective 4.2
6) Objective 4.3
7) Objective 4.1
8) Objective 4.4
9) Objective 4.4
10)Objective 4.4
11)Objective 1.2
12)Objective 2.1
13) Objective 2.1
14) Objective 5.1
15) Objective 5.11
16) Objective 6.2
17) Objective 6.2
18) Objective 5.1
19) Objective 5.4
20 ) Objective 8.1
21) Objective 2.2
22) Objective 7.3
23) Objective 2.3
24) Objective 9.1
25) Objective 4.5
26) Objective 4.5
27) Objective 9.2
28) Objective 5.3
29) Objective 5.3
30) Objective 4.1
31) Objective 7.1
32) Objective 8.1
33) Objective 7.1
34) Objective 7.1
35) Objective 5.1
36) Objective 5.2
37) Objective 8.1
38) Objective 11.1
39) Objective 8.1
40) Objective 6.2
41) Objective 5.4
42) Objective 1.1
43) Objective 1.2
44) Objective 4.5
45) Objective 1.2
46) Objective 10.1
47) Objective 10.1
48) Objective 8.1
49) Objective 2.3
50) Objective 2.3
51) Objective 1.2
52) Objective 8.2
53) Objective 11.1
54) Objective 7.1
55) Objective 3.1
56) Objective 8.1
57) Objective 10.1
58) Objective 4.1
59) Objective 6.2
60) Objective 8.1
End of Document