3d_rotation
access_alarm
access_alarms
access_time
accessibility
account_balance
account_balance_wallet
account_box
account_circle
adb
add
add_alarm
add_alert
add_box
add_circle
add_circle_outline
add_shopping_cart
add_to_photos
adjust
airline_seat_flat
airline_seat_flat_angled
airline_seat_individual_suite
airline_seat_legroom_extra
airline_seat_legroom_normal
airline_seat_legroom_reduced
airline_seat_recline_extra
airline_seat_recline_normal
airplanemode_active
airplanemode_inactive
airplay
alarm
alarm_add
alarm_off
alarm_on
album
android
announcement
apps
archive
arrow_back
arrow_drop_down
arrow_drop_down_circle
arrow_drop_up
arrow_forward
aspect_ratio
assessment
assignment
assignment_ind
assignment_late
assignment_return
assignment_returned
assignment_turned_in
assistant
assistant_photo
attach_file
attach_money
attachment
audiotrack
autorenew
av_timer
backspace
backup
battery_alert
battery_charging_full
battery_full
battery_std
battery_unknown
beenhere
block
bluetooth
bluetooth_audio
bluetooth_connected
bluetooth_disabled
bluetooth_searching
blur_circular
blur_linear
blur_off
blur_on
book
bookmark
bookmark_border
border_all
border_bottom
border_clear
border_color
border_horizontal
border_inner
border_left
border_outer
border_right
border_style
border_top
border_vertical
brightness_1
brightness_2
brightness_3
brightness_4
brightness_5
brightness_6
brightness_7
brightness_auto
brightness_high
brightness_low
brightness_medium
broken_image
brush
bug_report
build
business
cached
cake
call
call_end
call_made
call_merge
call_missed
call_received
call_split
camera
camera_alt
camera_enhance
camera_front
camera_rear
camera_roll
cancel
card_giftcard
card_membership
card_travel
cast
cast_connected
center_focus_strong
center_focus_weak
change_history
chat
chat_bubble
chat_bubble_outline
check
check_box
check_box_outline_blank
check_circle
chevron_left
chevron_right
chrome_reader_mode
class
clear
clear_all
close
closed_caption
cloud
cloud_circle
cloud_done
cloud_download
cloud_off
cloud_queue
cloud_upload
code
collections
collections_bookmark
color_lens
colorize
comment
compare
computer
confirmation_number
contact_phone
contacts
content_copy
content_cut
content_paste
control_point
control_point_duplicate
create
credit_card
crop
crop_16_9
crop_3_2
crop_5_4
crop_7_5
crop_din
crop_free
crop_landscape
crop_original
crop_portrait
crop_square
dashboard
data_usage
dehaze
delete
description
desktop_mac
desktop_windows
details
developer_board
developer_mode
device_hub
devices
dialer_sip
dialpad
directions
directions_bike
directions_boat
directions_bus
directions_car
directions_railway
directions_run
directions_subway
directions_transit
directions_walk
disc_full
dns
do_not_disturb
do_not_disturb_alt
dock
domain
done
done_all
drafts
drive_eta
dvr
edit
eject
equalizer
error
error_outline
event
event_available
event_busy
event_note
event_seat
exit_to_app
expand_less
expand_more
explicit
explore
exposure
exposure_neg_1
exposure_neg_2
exposure_plus_1
exposure_plus_2
exposure_zero
extension
face
fast_forward
fast_rewind
favorite
favorite_border
feedback
file_download
file_upload
filter
filter_1
filter_2
filter_3
filter_4
filter_5
filter_6
filter_7
filter_8
filter_9
filter_9_plus
filter_b_and_w
filter_center_focus
filter_drama
filter_frames
filter_hdr
filter_list
filter_none
filter_tilt_shift
filter_vintage
find_in_page
find_replace
flag
flare
flash_auto
flash_off
flash_on
flight
flight_land
flight_takeoff
flip
flip_to_back
flip_to_front
folder
folder_open
folder_shared
folder_special
font_download
format_align_center
format_align_justify
format_align_left
format_align_right
format_bold
format_clear
format_color_fill
format_color_reset
format_color_text
format_indent_decrease
format_indent_increase
format_italic
format_line_spacing
format_list_bulleted
format_list_numbered
format_paint
format_quote
format_size
format_strikethrough
format_textdirection_l_to_r
format_textdirection_r_to_l
format_underlined
forum
forward
forward_10
forward_30
forward_5
fullscreen
fullscreen_exit
functions
gamepad
games
gesture
get_app
gif
gps_fixed
gps_not_fixed
gps_off
grade
gradient
grain
graphic_eq
grid_off
grid_on
group
group_add
group_work
hd
hdr_off
hdr_on
hdr_strong
hdr_weak
headset
headset_mic
healing
hearing
help
help_outline
high_quality
highlight_off
history
home
hotel
hourglass_empty
hourglass_full
http
https
image
image_aspect_ratio
import_export
inbox
indeterminate_check_box
info
info_outline
input
insert_chart
insert_comment
insert_drive_file
insert_emoticon
insert_invitation
insert_link
insert_photo
invert_colors
invert_colors_off
iso
keyboard
keyboard_arrow_down
keyboard_arrow_left
keyboard_arrow_right
keyboard_arrow_up
keyboard_backspace
keyboard_capslock
keyboard_hide
keyboard_return
keyboard_tab
keyboard_voice
label
label_outline
landscape
language
laptop
laptop_chromebook
laptop_mac
laptop_windows
launch
layers
layers_clear
leak_add
leak_remove
lens
library_add
library_books
library_music
link
list
live_help
live_tv
local_activity
local_airport
local_atm
local_bar
local_cafe
local_car_wash
local_convenience_store
local_dining
local_drink
local_florist
local_gas_station
local_grocery_store
local_hospital
local_hotel
local_laundry_service
local_library
local_mall
local_movies
local_offer
local_parking
local_pharmacy
local_phone
local_pizza
local_play
local_post_office
local_printshop
local_see
local_shipping
local_taxi
location_city
location_disabled
location_off
location_on
location_searching
lock
lock_open
lock_outline
looks
looks_3
looks_4
looks_5
looks_6
looks_one
looks_two
loop
loupe
loyalty
map
markunread
markunread_mailbox
memory
menu
merge_type
message
mic
mic_none
mic_off
mms
mode_comment
mode_edit
money_off
monochrome_photos
mood
mood_bad
more
more_horiz
more_vert
mouse
movie
movie_creation
music_note
my_location
nature
nature_people
navigate_before
navigate_next
navigation
network_cell
network_locked
network_wifi
new_releases
nfc
no_sim
not_interested
note_add
notifications
notifications_active
notifications_none
notifications_off
notifications_paused
offline_pin
ondemand_video
open_in_browser
open_in_new
open_with
pages
pageview
palette
panorama
panorama_fish_eye
panorama_horizontal
panorama_vertical
panorama_wide_angle
party_mode
pause
pause_circle_filled
pause_circle_outline
payment
people
people_outline
perm_camera_mic
perm_contact_calendar
perm_data_setting
perm_device_information
perm_identity
perm_media
perm_phone_msg
perm_scan_wifi
person
person_add
person_outline
person_pin
personal_video
phone
phone_android
phone_bluetooth_speaker
phone_forwarded
phone_in_talk
phone_iphone
phone_locked
phone_missed
phone_paused
phonelink
phonelink_erase
phonelink_lock
phonelink_off
phonelink_ring
phonelink_setup
photo
photo_album
photo_camera
photo_library
photo_size_select_actual
photo_size_select_large
photo_size_select_small
picture_as_pdf
picture_in_picture
pin_drop
place
play_arrow
play_circle_filled
play_circle_outline
play_for_work
playlist_add
plus_one
poll
polymer
portable_wifi_off
portrait
power
power_input
power_settings_new
present_to_all
public
publish
query_builder
question_answer
queue
queue_music
radio
radio_button_checked
radio_button_unchecked
rate_review
receipt
recent_actors
redeem
redo
refresh
remove
remove_circle
remove_circle_outline
remove_red_eye
reorder
repeat
repeat_one
replay
replay_10
replay_30
replay_5
reply
reply_all
report
report_problem
restaurant_menu
restore
ring_volume
room
rotate_90_degrees_ccw
rotate_left
rotate_right
router
satellite
save
scanner
schedule
school
screen_lock_landscape
screen_lock_portrait
screen_lock_rotation
screen_rotation
sd_card
sd_storage
search
security
select_all
send
settings
settings_applications
settings_backup_restore
settings_bluetooth
settings_brightness
settings_cell
settings_ethernet
settings_input_antenna
settings_input_component
settings_input_composite
settings_input_hdmi
settings_input_svideo
settings_overscan
settings_phone
settings_power
settings_remote
settings_system_daydream
settings_voice
share
shop
shop_two
shopping_basket
shopping_cart
shuffle
signal_cellular_4_bar
signal_cellular_connected_no_internet_4_bar
signal_cellular_no_sim
signal_cellular_null
signal_cellular_off
signal_wifi_4_bar
signal_wifi_4_bar_lock
signal_wifi_off
sim_card
sim_card_alert
skip_next
skip_previous
slideshow
smartphone
sms
sms_failed
snooze
sort
sort_by_alpha
space_bar
speaker
speaker_group
speaker_notes
speaker_phone
spellcheck
star
star_border
star_half
stars
stay_current_landscape
stay_current_portrait
stay_primary_landscape
stay_primary_portrait
stop
storage
store
store_mall_directory
straighten
strikethrough_s
style
subject
subtitles
supervisor_account
surround_sound
swap_calls
swap_horiz
swap_vert
swap_vertical_circle
switch_camera
switch_video
sync
sync_disabled
sync_problem
system_update
system_update_alt
tab
tab_unselected
tablet
tablet_android
tablet_mac
tag_faces
tap_and_play
terrain
text_format
textsms
texture
theaters
thumb_down
thumb_up
thumbs_up_down
time_to_leave
timelapse
timer
timer_10
timer_3
timer_off
toc
today
toll
tonality
toys
track_changes
traffic
transform
translate
trending_down
trending_flat
trending_up
tune
turned_in
turned_in_not
tv
undo
unfold_less
unfold_more
usb
verified_user
vertical_align_bottom
vertical_align_center
vertical_align_top
vibration
video_library
videocam
videocam_off
view_agenda
view_array
view_carousel
view_column
view_comfy
view_compact
view_day
view_headline
view_list
view_module
view_quilt
view_stream
view_week
vignette
visibility
visibility_off
voice_chat
voicemail
volume_down
volume_mute
volume_off
volume_up
vpn_key
vpn_lock
wallpaper
warning
watch
wb_auto
wb_cloudy
wb_incandescent
wb_iridescent
wb_sunny
wc
web
whatshot
widgets
wifi
wifi_lock
wifi_tethering
work
wrap_text
youtube_searched_for
zoom_in
zoom_out
<i class="material-icons">view_list</i>
Replace view_list
with one of the names above.


Approximately half of all criminal cases in Canada end in a not guilty verdit. If your are charged with a criminal case, there is hope.
A criminal trial has 3 basic parts, opening statements, questioning witnesses, and closing statements. When there is no jury, we usually skip the opening statements and move right to questioning witnesses.
Opening and closing statements are just a summary of the things the witnesses said and the evidence seen at trial from your perspective. A trial is about asking witnesses questions. A skilled lawyer uses these questions to make his arguments and tell a story of what happened.
A good criminal lawyer will focus on only one or two points he is trying to make. Nearly all the questions he asks witnesses will be related to these points. These points should also be woven into a story outlining your version of what happened.
For example, imagine a lawyer is trying to show that the police got the wrong person. In this case, many of the questions to witnesses will center on the witnesses ability to see. This like what the lighting was like, how long they saw the perpetrator for (a split second many minutes) etc. These points are connected to a story - that someone else committed the crime, and that the witnesses mistakenly identified the wrong person. Trials are won by showing, not telling. Instead of telling the court that they got the wrong guy, show it by asking witnesses and police questions that raise doubts about their identification.


WWE News: Alexa Bliss slaps Superstar after he shows up at her house shirtless (VIDEO)
by Danny HartElliot Sexton is one of many WWE Superstars who uses social media to his advantage by posting in-character videos on his own YouTube channel.
The Aussie, who debuted in NXT in March 2019 and also performs under the name Brendan Vink, regularly posts videos as part of his ‘SMUG’ YouTube series, and the latest episode surprisingly featured an appearance from SmackDown Superstar Alexa Bliss.
The video began with a shirtless Sexton delivering a coffee to the five-time Women’s Champion as an apology for feeding her vegan pig, Larry-Steve, some bacon, which prompted Bliss to call him “pathetic” for showing up at her house without a shirt on again.

Then, in a spoof from American television show The Office, Bliss slapped Sexton in the face and assumed he was okay despite him saying the opposite.
The video, which you can check out below, ended with Sexton saying he thinks he is in love.


Dialog Substitution Password
This dialog appears when you are using the
ADFGVX encryption algorithm
or
ADFGVX analysis
.


@(crew: String, crewMembers: String)
Took refuge on Oak Island.
Current Crew Size: @crew Current Crew Members: @crewMembers


Provisions tagged in constitutions are arranged in topics and sub topics. For example, 'Rights and Duties' breaks down into 'Economic Rights', 'Social Rights' and others. In turn, 'Social Rights' contains individual provisions such as 'Right to Work' and 'Right to Rest and Leisure'.
These are sorted by the number of countries' constitutions in which they have been adopted.


Tippy
Enter
10% = {{pct10}}
15% = {{pct15}}
20% = {{pct20}}
Total =
{{totalAmount}}
Divide
Amount per person =
{{amountPerPerson}}


Note!
M/NTSC system implemented in Japan differs slightly from the description below.
I have dropped out most of the small exceptions to clarify the basic characteristics. I have not described the colour encoding principles. System B is used in VHF band and system G in UHF band.
| Characteristics | ||
| Number of lines per picture (frame) | ||
| Field frequency, nominal value (fields/s) | ||
| Line frequency fH | ||
| Assumed gamma of display device | ||
| Nominal video bandwidth (MHz) |
| Symbol | Characteristics | ||
| Blanking level | |||
| Peak white-level | |||
| Synchronizing level | |||
| Difference between black and blanking levels | |||
| Peak-to-peak value of burst | |||
| Peak level including chrominance signal |
| Symbol | Characteristics | ||
| Nominal line period (Ás) | |||
| Line-blanking interval (Ás) | |||
| Interval between time datum (0H) and back edge of line-blanking pulse (Ás) | |||
| Front porch (Ás) | |||
| Synchronizing pulse (Ás) | |||
| Build-up time of the line blanking pulse (Ás) | |||
| Build-up time of the line synchronizing pulse (Ás) | |||
| Start of sub-carrier burst (Ás) | |||
| Duration of sub-carrier burst (Ás) |
| Symbol | Characteristics | |
| Field Period (ms) | ||
| Field-blanking interval | ||
| Build-up time of the edges of field-blanking pulse (Ás) | ||
| Interval between front edge of field-blanking interval and front edge of first equalizing pulse (Ás) | ||
| Duration of first sequence of equalizing pulses | ||
| Duration of sequence of synchronizing pulses | ||
| Duration of second sequence of equalizing pulses | ||
| Duration of equalizing pulses (Ás) | ||
| Duration of field-synchronizing pulses (Ás) | ||
| Interval between field-synchronizing pulses (Ás) | ||
| Build-up time of synchronizing and equalizing pulses (Ás) |
| Symbol | Characteristics | |
| Field Period (ms) | ||
| Field-blanking interval | ||
| Build-up time of the edges of field-blanking pulse (Ás) | ||
| Interval between front edge of field-blanking interval and front edge of first equalizing pulse (Ás) | ||
| Duration of first sequence of equalizing pulses | ||
| Duration of sequence of synchronizing pulses | ||
| Duration of second sequence of equalizing pulses | ||
| Duration of equalizing pulses (Ás) | ||
| Duration of field-synchronizing pulses (Ás) | ||
| Interval between field-synchronizing pulses (Ás) | ||
| Build-up time of synchronizing and equalizing pulses (Ás) |
| Characteristics | ||
| Nominal RF channel bandwidth (MHz) | G:8 |
|
| Sound carrier relative to vision carrier (MHz) | ||
| Nearest edge of channel relative to vision carrier (MHz) | ||
| Nominal width of main sideband (MHz) | ||
| Nominal width of vestigial sideband (MHz) | ||
| Type and polarity of vision modulations | ||
| Synchronizing level (%) | ||
| Blanking level (%) | ||
| Difference between black level and blanking level (%) | ||
| Peak white level (%) | ||
| Type of sound modulation | ||
| Frequency deviation (kHz) | ||
| Pre-emphasis for modulation (Ás) |


This week we are going to learn about microcontrollers and embedded programming, our assignment was to understand the microcontroller by reading its Datasheet, to know different terms in micro controller and use them effectively in future to make own board in future as well. I want to start with very bottom , since I had some imformation about Electrical components in week 5. I started with terms like integrated circuits and microcontrollers.
An integrated circuit (IC), sometimes called a chip or microchip, is a semiconductor wafer on which thousands or millions of tiny resistors, capacitors, and transistors are fabricated. An IC can function as an amplifier, oscillator, timer,
counter, computer memory, or microprocessor. A particular IC is categorized as either linear (analog) or digital, depending on its intended application.
There are two types of IC. Linear IC and Digital IC.
Linear IC
Linear ICs have continuously variable output (theoretically capable of attaining an infinite number of states) that depends on the input signal level. As the term implies, the output signal level is a linear function of the input signal
level. Ideally, when the instantaneous output is graphed against the instantaneous input, the plot appears as a straight line. Linear ICs are used as audio-frequency (AF) and radio-frequency (RF) amplifiers. The operational amplifier(op
amp)
is a common device in these applications.
Digital ICs operate at only a few defined levels or states, rather than over a continuous range of signal amplitudes. These devices are used in computers, computer networks, modems, and frequency counters. The fundamental building blocks of digital ICs are logic gates, which work with binary data, that is, signals that have only two different states, called low (logic 0) and high (logic 1).
 It contains a processor core, ROM, RAM, and I/O pins dedicated to performing various tasks. Microcontrollers are generally used in projects and applications that require direct control of users. As it has all the components needed in its single chip, it does not need any external circuits to do its task so microcontrollers are heavily used in embedded systems and major microcontroller manufacturing companies are making them be used in the embedded market. A microcontroller can be called the heart of the embedded system. Some examples of popular microcontrollers are 8051, AVR, PIC series of microcontrollers.
architecture of 8051 microcontroller
Below is the architecture of the 8051 microcontrollers. And you can see all the required components for a small project is present in a single chip.
Wiki definition
A Microcontroller (MCU for microcontroller unit, or UC for μ-controller) is a small computer on a single integrated circuit. In modern terminology, it is similar to but less sophisticated than, a system on a chip (SoC); an SoC may include a microcontroller as one of its components. A microcontroller contains one or more CPUs (processor cores) along with memory and programmable input/output peripherals. Program memory in the form of ferroelectric RAM, NOR flash, or OTP ROM is also often included on-chip, as well as a small amount of RAM. Microcontrollers are designed for embedded applications, in contrast to the microprocessors used in personal computers or other general-purpose applications consisting of various discrete chips.
Memory types
RAMRandom Access Memory (RAM) is a term commonly used to describe the memory within a computer. Unlike ROM, RAM is a volatile memory and requires power; if power is lost, all data is also lost.
Flash memory is an electronic (solid-state) non-volatile computer storage medium that can be electrically erased and reprogrammed.
A programmable read-only memory (PROM) is a form of digital memory where the setting of each bit is locked by a fuse or anti-fuse. It is one type of ROM (read-only memory). The data in them is permanent and cannot be changed. PROMs are used
in digital electronic devices to store permanent data, usually low-level programs such as firmware or microcode.
The key difference from a standard ROM is that the data is written into a ROM during manufacture, while with a PROM the data is programmed into them after manufacture.
Difference between Integrated Circuit and microcontroller
The microcontroller is a register-based clock-driven integrated circuit that reads data from input, performs actions based on the instruction written in the memory, and displays the results at o/p. the biggest difference between a microcontroller and a normal IC is that it can be programmed through software instructions to perform different tasks. while an IC for e.g, IC for not gate performs just one function (of inverting the signal) and needs to be assembled on a breadboard or PCB board every time it is being used. It doesn't have any memory elements.
The Microprocessor is one type of simple electronic or computer device which stores and processes the data, not a desktop or computer hardware include one or a few Integrated Circuits. It is similar to a microcontroller but does not have any peripheral devices like RAM, ROM, etc. The task of microprocessors is dependent on the exterior circuits of peripherals. But there are not work for the specific task, but they are needed where the task is tough and complicated like games, software development, other applications that require high memory, and also where I/O are not mentioned. The Microprocessor is called the heart of a computer system. For example, of the best Microprocessor are I3, Pentium, and I5, etc..
Bus (Computing)
In computer architecture, a bus (a contraction of the Latin omnibus) is a communication system that transfers data between components inside a computer, or between computers. This expression covers all related hardware components (wire,
optical fiber, etc.) and software, including communication protocols. Wiki.
A microprocessor is a processing device of every computing device. It is like an artificial brain. It needs to communicate with the outer world. for example, It needs to communicate with Input devices to get data, it needs to communicate
with memory to process data according to instructions written in memory and finally it needs to communicate with output devices to display the output on O/P devices. To communicate with the external world, the Microprocessor makes use of
buses. There are different types of buses used in Microprocessor.
Data bus
As name tells that it is used to transfer data within Microprocessor and Memory/Input or Output devices. It is bidirectional as Microprocessor requires to send or receive data. The data bus also works as address bus when multiplexed with
lower order address bus. Data bus is 8 Bits long. The word length of a processor depends on data bus, thats why Intel 8085 is called 8 bit Microprocessor because it have an 8 bit data bus.
Address bus
An address bus is a computer bus architecture. It is used to transfer data between devices. The devices are identified by the hardware address of the physical memory (the physical address). The address is stored in the form of binary
numbers to enable the data bus to access memory storage.
Control Bus
The microprocessor uses a control bus to process data, that is what to do with the selected memory location. Some control signals are Read, Write and Opcode fetch, etc. Various operations are performed by microprocessors with the help of a
control bus. This is a dedicated bus because all timing signals are generated according to the control signal.
ALU (Arithmetic logic unit)
An arithmetic logic unit (ALU) is a combinational digital electronic circuit that performs arithmetic and bitwise operations on integer binary numbers. This is in contrast to a floating-point unit (FPU), which operates on floating-point numbers. An ALU is a fundamental building block of many types of computing circuits, including the central processing unit (CPU) of computers, FPUs,
and graphics processing units (GPUs). A single CPU, FPU, or GPU may contain multiple ALUs. Wiki
Sorce
Important topics in the Datasheet
Features
The page is explaining about Key things about microcontroller, it is 8-bit microcontroller that means it can process 8 - a bit of word size per second. An 8-bit controller works on 8-bits at a time hence
suitable for low power, less compute-intensive application.
Data types matter in 8-bit. For example, int var_1 allocates 2 bytes in AVR ( 8-bit micro) and char var_2 allocates 1 byte.
Since I tell you it shows the processing ability of the microcontroller it
also
effects the ALU (Arithmetic Control Unit). An 8-bit microcontroller refers to the processing capability of ALU of a microcontroller.
Architectural overview
ATtiny44 has advance RISC architecture.
Reduced instruction set computer, or RISC (/rɪsk/), is one whose instruction set architecture (ISA) allows it to have fewer cycles per instruction (CPI) than a complex instruction set computer (CISC). Various suggestions have been made regarding a precise definition of RISC, but the general concept is that such a
computer has a small set of simple and general instructions, rather than a large set of complex and specialized instructions. Wiki.
Memory
Types of Memory in micro controller
In system re-programmable memory (Flash and EEROM)
The ATtiny24A/44A/84A contains 2K/4K/8K byte On-chip In-System Reprogrammable Flash memory for program storage. The Flash memory has an endurance of at least 10,000 writes/erase cycles.
It means one can program the isp for 10,000 times approximately. after that microcontroller will not be sure to program. As I explained in the beginning flash memory no - volatile memory and it is the type of EEROM (electrically
erasable read-only memory) that has large storage space in comparison to EEROM. Though EERom has an advantage in programmable cycles, one can program 1,000,000 (cycles) times in EEROM type memory.
.
flash memory differs in a way that EEROM has only one transistor per bit. but flash has 8 transistors per
bit so it is much faster in writing large data over A EEROM and used for store the firmware code and EEROM are used to track history and parameters.
Static rendom Access memory
Static random-access memory (static RAM or SRAM) is a type of semiconductor memory that uses bistable latching circuitry (flip-flop) to store each bit. SRAM exhibits data remanence, but it is still volatile in the conventional sense
that
data is eventually lost when the memory is not powered.
The term static differentiates SRAM from DRAM (dynamic random-access memory) which must be periodically refreshed. SRAM is faster and more expensive than DRAM; it is typically used for CPU cache while DRAM is used for a computer's main
memory. Wiki
Dynamic rendom access memory
Dynamic random-access memory (DRAM) is a type of random-access semiconductor memory that stores each bit of data in a separate tiny capacitor within an integrated circuit. The capacitor can either be charged or discharged; these two
states are taken to represent the two values of a bit, conventionally called 0 and 1.
The electric charge on the capacitors slowly leaks off, so without intervention, the data on the chip would soon be lost. To prevent this, DRAM requires an external memory refresh circuit which periodically rewrites the data in the
capacitors, restoring them to their original charge.
This refresh process is the defining characteristic of dynamic random-access memory, in contrast to static random-access memory (SRAM) which does not require data to be
refreshed.
Unlike flash memory, DRAM is volatile memory (vs. non-volatile memory), since it loses its data quickly when power is removed. However, DRAM does exhibit limited data remanence.
Block diagram
In learning the first thing I noticed it everything is connected to one single line or path called 8-bit Bus. I am still not fully aware of the design here but I can say all the microcontroller controlling units(which help
microcontroller to synchronize on every clock signal) are on the right side of the 8-bit bus. On the left side of the bus Processing unit including the Memmory portion, Register, Logic unit(ALU)
is
placed.
I will write about this in the clock signal part. But I can tell this clock works come to the Timer Counter.Here WATCHDOG TIMER creates automatically system reset when it hangs if the main program neglects to
periodically service it.
INTERNAL Calibrated CLOCK is an internal clock of micro-controller in microcontroller ATtiny44 its maximum frequency is 8Mhz.
Clock
This section is trying to explain the clock system of the ATTiny44.
A clock signal or pulse is used in digital circuits of sequential circuits for differentiating output with time. As in sequential circuits output, is fed back to the input, and new output will be given after every clock pulse.
Applications flip flops, 555 timer, etc.
Clock is used in digital circuit for the following reasons:
timing is everything in Digital Circuits. Without clocks, digital circuits cannot run. Clocks control the input and output of the circuit and provide synchronization for peripherals. Most integrated circuits (ICs) of sufficient complexity
use a clock signal in order to synchronize different parts of the circuit, cycling at a rate slower than the worst-case internal propagation delays.
Propagation delay
In electronics, digital circuits, and digital electronics, the propagation delay, or gate delay, is the length of time which starts when the input to a logic gate becomes stable and valid to change, to the time that the output of that
logic gate is stable and valid to change.
Often on manufacturers' datasheets, this refers to the time required for the output to reach 50% of its final output level when the input changes to 50% of its final input level. Reducing gate delays in digital circuits allows
them to process data at a faster rate and improve overall performance. The determination of the propagation delay of a combined circuit requires identifying the longest path of propagation delays from input to output and by adding each
tpd time along this path. The Clock signal interval should always be more than the propagation delay.
Pin configuration
Graphical pinout
Graphical pinout helps to use the microcontroller more effectively, when you are using it with different development software you will need to give then specific pin number where you want to have some output or some input also, here for Arduino Development environment (IDE) blue pins shown in picture is are Arduino pins you can give specific inputs and output at pins in Arduino IDE which we will see soon in board programming. In week 7 I already talk about Attiny 44 pinout and Some terms in Details.
Programming Board
I am going to program the echo hello board. there was a missing resister in echo hello in my design, I noticed it later, it was connected between Vcc and reset pin, will not affect working anyway.
For programming Attiny 44 in Arduino ide, one has to include board settings to the ide, one can do that by adding some particular link in the Preference of file menu, see below!
Arduino tiny core
You have to paste
"http://drazzy.com/package_drazzy.com_index.json"on the additional board manager section.
settings in tools
Give this setting, you can visit week 5 for settings. Burn the bootloader.
Blinking the Led
To see the Microcontroller's action on the LED I Decided to make one relation between the Switch and the LED.
Code
Final code with the Switch. Since I put the Switch to the PA3(Arduino pin 3) and LED to the PA2(Arduino pin 2)
power from FTDI
in general, I have written a code that tells the microcontroller to control the led blinking when I am pushing the button. Code link. here I am giving power through the FTDI.
One can fing other embedded programming work on week 11, week 12.
In Embedded programming, our group work was to compare the performance and development workflows for other architectures. we had stm32f103c8 Blue pill Development Board.
I generally know any other microcontrollers other that ATtiny and Atmega I was interested in the Datasheet part!
Specifications
visit group website for more imformation.
In three electronics weeks, this week was the first when I was getting something in mind about terminologies, I got time to explore about microcontroller though. I programmed simple code which Arduino IDE but I am also interested in learning other languages too, in meantime, I am going to try c programming to program my board.


Your profile Reset you account security
Your security questions no longer meet the new security policy. In order to keep your account safe, you need to update your security questions.
You will now be asked to choose new security questions.
You won't be prompted to change these again, but you can change your account security at any time from your profile.
Cancel and return to sign in to your secuirty card PIN


I'm a passionate Full Stack Software Developer 🚀 having an experience of building Web and Mobile applications with JavaScript / Reactjs / Nodejs / React Native and some other cool libraries and frameworks.
A brief description of the repository
Front End Design
Backend
UX/UI Design
Discuss a project or just want to say hi? My Inbox is open for all.
Location: Miami, Florida
Open for opportunities: Yes


Before Change
power=2.0)
for fw in ["tf", "torch", None]:
config["framework"] = fw
polynomial = from_config(config)
for t in ts:
out = polynomial(t)
check(out, 0.5 + (2.0 - 0.5) * (1.0 - t / 100)**2, decimals=4)
// Test eager as well.
with eager_mode():
config["framework"] = "tf"
polynomial = from_config(config)
for t in ts:
After Change
final_p=0.5,
power=2.0)
for fw in framework_iterator(
frameworks=["tf", "eager", "torch", None]):
fw_ = fw if fw != "eager" else "tf"
polynomial = from_config(config, framework=fw_)
for t in ts:
out = polynomial(t)
check(out, 0.5 + (2.0 - 0.5) * (1.0 - t / 100)**2, decimals=4)


interface AccountListener
Account subscription results listener
Author
Dmitriy Bushuev
onChange |
Calls when observing account changed abstract fun onChange(updatedAccount: FullAccount): Unit |
MainThreadAccountListener |
Executes account listener events on main (UI) thread class MainThreadAccountListener : AccountListener |


Pepper Form
Test Survey
This is a test survey
Answer this rather very long question
Pepper Survey
Thank You!


| Constructor and Description |
|---|
Move(float x,
float y,
float[] ctrlPoints)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
java.awt.geom.Path2D |
addTo(java.awt.geom.Path2D path2D)
Adds the Segment to the end of a Path2D
|
java.awt.geom.Path2D |
addTo(java.awt.geom.Path2D path2D,
float t)
Adds a sub-segment of this segment to the end of a Path2D
|
double |
getAngle(float t)
Gets the angle of the segment in radians at the position specified by
time |
double |
getEndAngle() |
Robot.Pos |
getPos(float t)
Return the position on the segment at time
t . |
float |
getSize()
The time a robot uses to trace a segment at a given speed is
proportional to the segment's size.
|
double |
getStartAngle() |
Segment |
subSegment(float t)
Return the sub-segment of this segment that starts at
0 and ends at t . |
public Move(float x, float y, float[] ctrlPoints)
x
- x-coordinate of the segment's starting pointy
- y-coordinate of the segment's starting pointctrlPoints
- an array of length at least 2 that
contains the x- and y-coordinates of the segment's control points.public Segment subSegment(float t)
Segment
0
and ends at t
.
For t ≤ 0
, returns a segment of size 0, and for t ≥ 1F
,
returns this.subSegment
in interface Segment
t
- a float value, normally between 0 and 1public Robot.Pos getPos(float t)
Segment
t
. If t ≤ 0
,
the start position of this segment is returned, and if t ≥ 1
, the end
position of this segment is returned.public double getStartAngle()
getStartAngle
in interface Segment
public double getEndAngle()
getEndAngle
in interface Segment
public double getAngle(float t)
Segment
time
public float getSize()
Segment
public java.awt.geom.Path2D addTo(java.awt.geom.Path2D path2D)
Segment
public java.awt.geom.Path2D addTo(java.awt.geom.Path2D path2D, float t)
Segment
addTo
in interface Segment
path2D
- a Path2D to which the sub-segment is addedt
- a float value, normally between 0 and 1, that
specifies the sub-segment of this segment that is addedSegment.subSegment(float)


Note: To complete these procedures, you must be assigned a role having the necessary permissions. To determine your role, follow the directions in Participant roles. For a basic understanding of roles and permissions, see Permissions and roles: Overview.
In order to give an assessment, you must first publish it. For instructions, see Publishing an assessment. Once it's published, your assessment's availability depends on how you've configured certain settings:
Anonymous Users
, the assessment will only be available via
the URL (not from within the site), and anyone to whom you've given the
URL can take it. If you selected your site or Selected
Groups
, then only site members or members of the groups you
checked will be able to take the assessment (either via the URL or
from within the site). See Taking an assessment.
For more information on assessment settings, see Assessment settings.


You are viewing an historical archive of past issues. Please
report new issues to the appropriate project issue tracker on
GitHub.
Comments
-
Greg Hurrell
This is a duplicate of ticket #1634, I think. I couldn't reproduce that one, and I can't reproduce following the instructions that you list here. It must depend in some way on either a plug-in you're using, or some specific setting(s) in your
.vimrc
.I'll close this one for now so as to keep all discussion about this issue in the one place. Please add any further comments you have to ticket #1634.
-
Greg Hurrell
Status changed:
- From: new
- To: closed
Add a comment
Comments are now closed for this issue.


Images to help with Search Basics
You can Search for Movie Domain
Type you question or use microphone to query Minerva
See the results and related questions.
Get fast and one click result.Happy Browsing!
Click on the below Contact us.
Get the phone number from there.
Feel free to give us feedback on mention mail id.


RAMADDA provides a web-based interface for managing the repository.
These are available via the
Admin
link.
Some of the more important items are:
- Configure your Tomca to support SSL. More information here
- Site and Contact Information
- Hostname and HTTP port: These are what your external users see. They are used when RAMADDA needs to make an absolute URL back to itself.
- Administrator Email and Mail Server: To enable RAMADDA to send email (e.g., password reset messages) enter your mail server.
- Server Registry: This is used to support distributed search. Note: More work needs to be done.
- Access
- Site Access: Controls who can access your server.
- Sizes... Control disk usage for anonymous uploads and the cache
- File Access: Specify where else (other than the RAMADDA home directory) RAMADDA can access files.
- Enable Lucene Indexing and Search: RAMADDA has some initial support for using Lucene (a indexing and search engine) to support full text search. This is experimental.
- Display
- Controls the display and what is shown. Note: some of these items (e.g, logo image) only show up in certain display templates and others (e.g., enable ratings, google maps key, Facebook comments) are experimental and might not work.
- System: Displays system status
- Logs: Shows recent access and error log
- Maintenance: Clean up the database and dump the databse.
Note - this functionality needs work.


JxBrowser Programmer’s Guide
Version: 6.0
- Introduction
- Requirements
- Browser Context
- Hello world!
- Loading URL
- Loading URL with POST Data
- Loading HTML
- Browser Events
- Pop-up Windows
- JavaScript
- JavaScript Dialogs
- JavaScript-Java Bridge
- Zooming
- Context Menu
- Cookies
- Navigation History
- User-Agent
- Proxy Settings
- 18.1 AutoDetect
- 18.2 Direct
- 18.3 AutoConfig URL
- 18.4 Manual
- Disabling images, videos, JavaScript, etc.
- Proxy Authentication
- Basic, Digest and NTLM Authentication
- Network Delegate
- File Downloads
- Web page as PNG image
- Executing commands
- Saving web pages
- DOM API
- DOM Events
- Find Text
- JxBrowser & Java Web Start
- JxBrowser & Java Applet
- Remote Debugging
- Drag and Drop
- Plugins
- 34.1 Flash and Silverlight
- 34.2 Plugins Manager
- Printing
- Geolocation
- Logging
- Known Restrictions
- Technical Support
1. Introduction
1.1. About This Document
This document represents a developer’s guide to JxBrowser library. Here you can find all the required information regarding the use of JxBrowser library in your Java Swing/AWT/JavaFX application.
1.2. About JxBrowser
JxBrowser is a cross-platform Java library that allows integrating Google Chromium-based web browser component into your Java Swing/AWT/JavaFX application. With JxBrowser you can embed a lightweight Swing/JavaFX component into your Java application to display modern web pages, supporting the latest web standards such as HTML5, CSS3, JavaScript etc.
etc.JxBrowser is based on Chromium 43.0.2357.52 engine and supports Windows, Linux and Mac OS X platforms. All the required Chromium binaries are deployed with JxBrowser libraries, so you don’t need to install Google Chromium on the target environment.
1.3. Examples and Demo Application
Almost all the examples from this guide can be found in the samples directory of JxBrowser Distribution Package and on the Samples web page.
You can find the JxBrowser Web Start Online Demo at http://www.teamdev.com/jxbrowser/onlinedemo.
1.4. Distribution Package
The structure of JxBrowser Distribution Package (jxbrowser-6.0-cross-desktop-win_mac_linux.zip
) is the following:
lib/ jxbrowser-6.0.jar // JxBrowser library jxbrowser-win-6.0.jar // Chromium binaries for Windows jxbrowser-mac-6.0.jar // Chromium binaries for Mac OS X jxbrowser-linux32-6.0.jar // Chromium binaries for Linux 32-bit jxbrowser-linux64-6.0.jar // Chromium binaries for Linux 64-bit samples/ // API samples doc/javadoc/ // Public API JavaDocs doc/guide/ // Programmer's and Quick Start Guide demo/ jxbrowserdemo.jar // Demo application library jxbrowserdemo.bat // Executable *.bat to run Demo application on Windows jxbrowserdemo.sh // Executable *.sh to run Demo application on Mac OS X and Linux Readme.txt // Readme file License agreement.txt // License agreement
1.5. Installation Instruction
In order to use JxBrowser library in your Java application you need to include all the JAR files from the lib directory of the JxBrowser Distribution Package. Your application class path should look like:
java -classpath jxbrowser-6.0.jar;jxbrowser-win-6.0.jar;jxbrowser-mac-6.0.jar; jxbrowser-linux32-6.0.jar;jxbrowser-linux64-6.0.jar <your-application-class>
If your application supports only Windows platform, there is no need to include the jxbrowser-mac
,
jxbrowser-linux32
and jxbrowser-linux64
JAR files into your application class
path.
The jxbrowser-win-6.0.jar
, jxbrowser-mac-6.0.jar
,
jxbrowser-linux32-6.0.jar
, jxbrowser-linux64-6.0.jar
libraries
contain Chromium binaries for corresponding platform. At the first run JxBrowser extracts the binaries from the
JAR file into user’s temp folder.
Chromium binaries
You can extract Chromium binaries from these JAR files manually and configure JxBrowser to use them via the
"jxbrowser.chromium.dir
" System Property. This property must contain a valid absolute/related path to the
directory with extracted Chromium binaries.
JxBrowser checks the directory and if the directory doesn't
contain all the required Chromium files, JxBrowser will search for the binaries inside JAR files included in the application class path
and extract them programmatically. If JxBrowser couldn't find Chromium binaries in the provided directory and none of
JAR files included into Java application class path contains Chromium binaries, an exception will be thrown during
Browser
instance initialization.
2. Requirements
JxBrowser supports Windows, Linux and Mac OS X platforms (Intel and AMD), both 32- and 64-bit:
2.1. Windows
- Microsoft Windows XP (SP2), 7, 8, Vista, Server 2003 (SP1), Server 2008/2012, 32-bit and 64-bit.
- Swing: Oracle (Sun) JRE 1.6.x and higher, IBM JRE 1.7.x and higher, 32-bit and 64-bit.
- JavaFX: Oracle (Sun) JRE 1.8.x and higher, 32-bit and 64-bit.
2.2. Linux
- Ubuntu 12.04+, Debian 7.7, RedHat Enterprise Linux 7, openSUSE 13.1, Fedora 20, 32-bit and 64-bit.
- Swing: Oracle (Sun) JRE 1.6.x and higher, IBM JRE 1.7.x and higher, 32-bit and 64-bit.
- JavaFX: Oracle (Sun) JRE 1.8.x and higher, 32-bit and 64-bit.
Linux environment must be in non-headless mode, because Chromium doesn't support headless mode.
2.3. Mac OS X
- Mac OS X 10.7.x - 10.10.x (Intel)
- Swing: Apple or Oracle (Sun) JRE 1.6.x and higher, 32-bit and 64-bit.
- JavaFX: Oracle (Sun) JRE 1.8.x and higher, 32-bit and 64-bit.
3. Browser Context
Each Browser
instance must be initialized with BrowserContext
.
BrowserContext
holds the context needed for a browsing session and provides path to the directory
where Chromium stores cookies, cache data files, etc.
The following code creates a new Browser
instance initialized with default context:
Browser browser = new Browser();The code above equals to:
Browser browser = new Browser(BrowserContext.defaultContext());
The BrowserContext.defaultContext()
method returns default BrowserContext
that
is configured to store Chromium data files such as cookies, cache, etc. in user's temp directory. You can
get path to the directory where data files are stored using the BrowserPreferences.getDefaultDataDir()
method.
Two Browser
instances with same BrowserContext
will use same user data directory. As
result they shares cookies and cache files. For example:
BrowserContext context = new BrowserContext("C:\\my-data1"); Browser browser1 = new Browser(context); Browser browser2 = new Browser(context);
To create independent Browser
instances that don't share cookies and cache data, you must initialize
each Browser
instance with a different BrowserContext
configured to use different
data directory. For example:
BrowserContext context1 = new BrowserContext("C:\\my-data1"); Browser browser1 = new Browser(context1); BrowserContext context2 = new BrowserContext("C:\\my-data2"); Browser browser2 = new Browser(context2);
To get BrowserContext
of the Browser
instance you can use the browser.getContext()
method.
Make sure that you don't use several BrowserContext
instances configured to use same data directory.
In this case Chromium engine will read/write same data directory from different Browser
instances which might cause
unexpected behavior or errors.
4. Hello world!
After including all the required JxBrowser JAR files into your application class path together with the license JAR, you should be able to run your first program with JxBrowser in it:
Swing
import com.teamdev.jxbrowser.chromium.Browser; import com.teamdev.jxbrowser.chromium.swing.BrowserView; import javax.swing.*; import java.awt.*; public class HelloWorldSample { public static void main(String[] args) { Browser browser = new Browser(); BrowserView browserView = new BrowserView(browser); JFrame frame = new JFrame("Hello World!"); frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); frame.add(browserView, BorderLayout.CENTER); frame.setSize(400, 300); frame.setVisible(true); browser.loadHTML("
Hello world!
"); } }
To embed Browser
into a Swing container use the com.teamdev.jxbrowser.chromium.swing.BrowserView
component.
JavaFX
import com.teamdev.jxbrowser.chromium.Browser; import com.teamdev.jxbrowser.chromium.javafx.BrowserView; import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.layout.StackPane; import javafx.stage.Stage; public class HelloWorldSample extends Application { @Override public void start(Stage primaryStage) { Browser browser = new Browser(); BrowserView browserView = new BrowserView(browser); StackPane pane = new StackPane(); pane.getChildren().add(browserView); Scene scene = new Scene(pane, 400, 300); primaryStage.setScene(scene); primaryStage.show(); browser.loadHTML("
Hello world!
"); } public static void main(String[] args) { launch(args); } }
To embed Browser
into a JavaFX container use the com.teamdev.jxbrowser.chromium.javafx.BrowserView
component.
This simple example above shows how to create a Browser
component, embed it into Swing/JavaFX container, display it and load the "
Hello
world!

" HTML string directly into the Browser
.
When you run this sample you should see the following output:
5. Loading URL
In order to load a web page by its URL you can use the Browser.loadURL(String url)
, Browser.loadURL(int
frameId, String url)
and Browser.loadURL(LoadURLParams params)
methods. The following code
demonstrates how to load the http://www.google.com web page:
browser.loadURL("http://www.google.com");
All web pages are loaded asynchronously. It means that the Browser.loadURL()
method doesn’t
guarantee that the web page will be loaded completely after this method has finished its execution. For testing
purposes you may need to wait until the web page is loaded completely. In this case you can use the following
approach:
browser.loadURL("http://www.google.com"); while (browser.isLoading()) { TimeUnit.MILLISECONDS.wait(50); } // web page is loaded completely
The code below shows how to periodically check if the Browser
component is still loading web page. This approach
blocks the current thread execution until the web page is loaded completely. If you don’t need to block the
current thread and receive notification when the web page is loaded completely, you can use the
LoadListener.onFinishLoadingFrame(FinishLoadingEvent event)
event. For example:
browser.addLoadListener(new LoadAdapter() { @Override public void onFinishLoadingFrame(FinishLoadingEvent event) { if (event.isMainFrame()) { // web page is loaded completely including all frames } } }); browser.loadURL("http://www.google.com");
You can find more information about LoadListener
in the Load chapter of
this guide.
6. Loading URL with POST Data
To send POST data to a specific URL you can use the Browser.loadURL(LoadURLParams params)
method:
browser.loadURL(new LoadURLParams("http://www.google.com", "firstKey=KeyValue1&secondKey=KeyValue2"));
POST data in this method represents a string in the key=value&key=value...
format. The content type
in HTTP header for all the POST data will be application/x-www-form-urlencoded
.
7. Loading HTML
To load HTML document from a string you can use the Browser.loadHTML(String html)
or Browser.loadHTML(LoadHTMLParams
params)
method. The second method allows you to provide additional parameters to the Browser
component,
such as text encoding and base URL for resolving relative links.
browser.loadHTML("
HTML Content
");
To find out whether HTML document is loaded completely, you can use one of the described approaches in the Loading URL section.
8. Browser Events
JxBrowser API provides different listeners for listening various browser events such as loading events, title change, zoom level change, render process events etc.
8.1. Load
The LoadListener
provides methods for receiving browser load events. You can use this listener to
get notifications about web page loading events, document availability events, loading failure events etc. The
following code demonstrates how to register LoadListener
:
browser.addLoadListener(new LoadAdapter() { @Override public void onStartLoadingFrame(StartLoadingEvent event) { if (event.isMainFrame()) { System.out.println("Main frame has started loading"); } } @Override public void onProvisionalLoadingFrame(ProvisionalLoadingEvent event) { if (event.isMainFrame()) { System.out.println("Provisional load was committed for a frame"); } } @Override public void onFinishLoadingFrame(FinishLoadingEvent event) { if (event.isMainFrame()) { System.out.println("Main frame has finished loading"); } } @Override public void onFailLoadingFrame(FailLoadingEvent event) { int errorCode = event.getErrorCode(); if (event.isMainFrame()) { System.out.println("Main frame has failed loading: " + errorCode); } } @Override public void onDocumentLoadedInFrame(FrameLoadEvent event) { System.out.println("Frame document is loaded."); } @Override public void onDocumentLoadedInMainFrame(LoadEvent event) { System.out.println("Main frame document is loaded."); } });
8.2. Title
The TitleListener
allows you to receive the document title change events. For example:
browser.addTitleListener(new TitleListener() { public void onTitleChange(TitleEvent event) { System.out.println("Title = " + event.getTitle()); } });
8.3. Zoom
The ZoomListener
can be used to listen to the zoom level change events for different web pages. For
example:
browser.getContext().getZoomService().addZoomListener(new ZoomListener() { public void onZoomChanged(ZoomEvent event) { System.out.println("event.getURL() = " + event.getURL()); System.out.println("event.getZoomLevel() = " + event.getZoomLevel()); System.out.println("event.isRemember() = " + event.isRemember()); } });
You can configure default zoom level for all web pages using the
browser.getContext().getZoomService().setDefaultZoomLevel(double level)
method.
8.4. Dispose
The DisposeListener
allows you to receive notifications about Browser
instance disposal. This
listener informs you that its Browser
instance is disposed because of the Browser.dispose()
method
or because the JavaScript window.close()
function has been invoked. For example:
Browser browser = new Browser(); browser.addDisposeListener(new DisposeListener<Browser>() { public void onDisposed(DisposeEvent<Browser> event) { System.out.println("Browser is disposed."); } }); browser.dispose();
8.5. Render
EachBrowser
instance is running in a separate native process where the web page is rendered. Sometimes this
process can exit unexpectedly because of the crash in plugin. To receive notifications about unexpected render
process termination you can use RenderListener
. When you receive notification about render process
termination you can display a "sad" icon like Google Chrome does, for example, to inform the user that this
particular Browser
component has crashed. Example:
browser.addRenderListener(new RenderAdapter() { @Override public void onRenderCreated(RenderEvent event) { System.out.println("Render process is created."); } @Override public void onRenderGone(RenderEvent event) { System.out.println("Render process is gone:"); TerminationStatus terminationStatus = event.getTerminationStatus(); System.out.println("Termination Status: " + terminationStatus); } });
If you refresh or load the same or another URL, the render process and Browser
instance will be
restored. Example:
browser.addRenderListener(new RenderAdapter() { @Override public void onRenderGone(RenderEvent event) { Browser browser = event.getBrowser(); // Restore Browser instance by loading the same URL browser.loadURL(browser.getURL()); } });
9. Pop-up Windows
Any web page can display pop-up windows. JxBrowser API provides PopupHandler
to handle pop-up window
creation.
By default JxBrowser doesn't display pop-up windows, because it cannot know what UI Toolkit must be used — Swing or JavaFX.
To enable support of popup-windows you must register default Swing or JavaFX implementation depending on what UI Toolkit you use in your Java application:
Swing
Register default Swing popup handler implementation:
browser.setPopupHandler(new com.teamdev.jxbrowser.chromium.swing.DefaultPopupHandler());
Register custom Swing popup handler implementation:
browser.setPopupHandler(new PopupHandler() { public PopupContainer handlePopup(PopupParams params) { return new PopupContainer() { public void insertBrowser(final Browser browser, Rectangle initialBounds) { BrowserView browserView = new BrowserView(browser); browserView.setPreferredSize(initialBounds.getSize()); final JFrame frame = new JFrame("Popup"); frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); frame.add(browserView, BorderLayout.CENTER); frame.pack(); frame.setLocation(initialBounds.getLocation()); frame.setVisible(true); frame.addWindowListener(new WindowAdapter() { @Override public void windowClosing(WindowEvent e) { browser.dispose(); } }); browser.addDisposeListener(new DisposeListener() { public void onDisposed(DisposeEvent event) { frame.setVisible(false); } }); } }; } });
JavaFX
Register default JavaFX popup handler implementation:
browser.setPopupHandler(new com.teamdev.jxbrowser.chromium.javafx.DefaultPopupHandler());
Register custom JavaFX popup handler implementation:
browser.setPopupHandler(new PopupHandler() { public PopupContainer handlePopup(PopupParams params) { return new PopupContainer() { public void insertBrowser(final Browser browser, final Rectangle initialBounds) { Platform.runLater(new Runnable() { @Override public void run() { final Stage stage = new Stage(); StackPane root = new StackPane(); Scene scene = new Scene(root, 800, 600); BrowserView browserView = new BrowserView(browser); root.getChildren().add(browserView); stage.setScene(scene); stage.setTitle("Popup"); if (!initialBounds.isEmpty()) { stage.setX(initialBounds.getLocation().getX()); stage.setY(initialBounds.getLocation().getY()); stage.setWidth(initialBounds.width); stage.setHeight(initialBounds.height); } stage.setOnCloseRequest(new EventHandler<javafx.stage.WindowEvent>() { public void handle(javafx.stage.WindowEvent event) { browser.dispose(); } }); browser.addDisposeListener(new DisposeListener<Browser>() { public void onDisposed(DisposeEvent<Browser> event) { Platform.runLater(new Runnable() { public void run() { stage.close(); } }); } }); stage.show(); } }); } }; } });
10. JavaScript
Ability to execute JavaScript code on the loaded web page is one of the main features of JxBrowser. To execute JavaScript code, first of all you need to make sure that web page is loaded completely (see Loading URL chapter).
If the web page is loaded completely you can execute JavaScript code on it in one of the following ways:
1. Using the Browser.executeJavaScript(String javaScript)
method. This method executes the
JavaScript code asynchronously without blocking the current thread execution. If you are not interested in
receiving the result of JavaScript code, you can use this method because its return parameter is void.
2. Using the Browser.executeJavaScriptAndReturnValue(String javaScript)
method. This method executes
the code described by javaScript
parameter and returns the result of JavaScript code execution as
JSValue
. This method blocks the current thread execution until the passed JavaScript code stop its
execution and return the result of execution.
The JSValue
provides access to the result of JavaScript code execution. Using the methods of JSValue
you can determine whether the result value is an object, number, string or boolean value. For example, the
following code demonstrates how to get a document title string value using the Browser.executeJavaScriptAndReturnValue(String
javaScript)
method:
JSValue documentTitle = browser.executeJavaScriptAndReturnValue("document.title"); // Make sure that result value is a string and read its value if (documentTitle.isString()) { System.out.println("Document Title = " + documentTitle.getString()); }
In this sample we check that the return JSValue
is a string value, using the JSValue.isString()
method; and access the string value, using the JSValue.getString()
method.
Please avoid using the Browser.executeJavaScriptAndReturnValue(String javaScript)
method in
Swing UI thread, because the passed JavaScript code can cause JavaScript Alert dialog to be shown. All the
dialogs are displayed in Swing UI thread by default. As result, it can cause a deadlock.
11. JavaScript Dialogs
JxBrowser API provides DialogHandler
interface that allows handling JavaScript dialogs.
By default JxBrowser doesn't display JavaScript dialogs such as Alert, Confirmation or Prompt, because it doesn't know what UI Toolkit must be used — Swing or JavaFX.
To enable JavaScript dialogs you must register Swing or JavaFX DialogHandler
implementation depending
on what UI Toolkit you use in your Java application:
Swing
import com.teamdev.jxbrowser.chromium.swing.BrowserView; import com.teamdev.jxbrowser.chromium.swing.DefaultDialogHandler; Browser browser = new Browser(); final BrowserView browserView = new BrowserView(browser); browser.setDialogHandler(new DefaultDialogHandler(browserView) { @Override public void onAlert(DialogParams params) { String title = "My Alert Dialog"; String message = params.getMessage(); JOptionPane.showMessageDialog(browserView, message, title, JOptionPane.PLAIN_MESSAGE); } });
JavaFX
import com.teamdev.jxbrowser.chromium.javafx.BrowserView; import com.teamdev.jxbrowser.chromium.javafx.DefaultDialogHandler; import com.teamdev.jxbrowser.chromium.javafx.internal.dialogs.MessageDialog; Browser browser = new Browser(); final BrowserView browserView = new BrowserView(browser); browser.setDialogHandler(new DefaultDialogHandler(browserView) { @Override public void onAlert(DialogParams params) { String title = "My Alert Dialog"; String message = params.getMessage(); MessageDialog.show(browserView, title, message); } });
12. JavaScript-Java Bridge
JxBrowser API provides functionality that allows you to register a BrowserFunction
callback and
associate it with JavaScript function. Every time when this JavaScript function is invoked, an appropriate
BrowserFunction
callback will be used as a body for this JavaScript function. You can receive input
parameters from JavaScript as array of JSValue
instances and even return the function result from
Java to JavaScript via JSValue
.
browser.registerFunction("MyFunction", new BrowserFunction() { public JSValue invoke(JSValue... args) { for (JSValue arg : args) { System.out.println("arg = " + arg); } return JSValue.create("Hello!"); } });
In the example above we register a BrowserFunction
callback and associate it with the "MyFunction"
JS function. After that, every time when JavaScript on any web page invokes the "MyFunction" JS function, the
invoke()
method of our BrowserFunction
instance will be executed:
var result = MyFunction("Hello JxBrowser!", 1, 2, 3, true);
The result of the JavaScript code above will be the "Hello!" string.
When you don’t need to use the BrowserFunction
instance you can un-register it using the Browser.unregisterFunction(String
functionName)
method:
browser.unregisterFunction("MyFunction");
This functionality doesn't allow overriding existing JavaScript functions. So, if JavaScript on the
web page already defines the MyFunction
function, then the registered "MyFunction" Java callback
will not be invoked.
13. Zooming
With JxBrowser you can zoom the web page content using Browser.setZoomLevel(double
zoomLevel)
, Browser.zoomIn()
, Browser.zoomOut()
,
Browser.zoomReset()
methods. Please note that zoom level can be applied only for the completely loaded
web page. You need to wait until the web page is loaded completely and only then you can zoom it:
browser.addLoadListener(new LoadAdapter() { @Override public void onFinishLoadingFrame(FinishLoadingEvent event) { if (event.isMainFrame()) { event.getBrowser().setZoomLevel(2.0); } } });
The zoom level is configured for each domain separately, so if you have set zoom level for the a.com
web page, it will not be applied for the b.com
web page.
14. Context Menu
By registering your ContextMenuHandler
implementation you can handle mouse right click events on a
web page and display your custom Swing context menu. To register your implementation of the ContextMenuHandler
you should use the Browser.setContextMenuHandler(ContextMenuHandler contextMenuHandler)
method.
JxBrowser doesn't display context menu by default.
15. Cookies
Using CookieStorage
you can manage all the Browser
cookies including session, secure, HTTP-only and
persistent cookies. To access the Browser’s cookie storage you can use the
Browser.getCookieStorage()
method. For example:
CookieStorage cookieStorage = browser.getCookieStorage(); List<Cookie> cookies = cookieStorage.getAllCookies();
The CookieStorage
allows receiving all the cookies, deleting and registering new cookies. Every time
when you modify the cookie storage you must save the changes using the CookieStorage.save()
method.
For example:
CookieStorage cookieStorage = browser.getCookieStorage(); cookieStorage.setSessionCookie("http://www.a.com", "name1", "value1", ".a.com", "/", false, false); cookieStorage.save();
All Browser
instances share the persistent cookies by default, because they use the same user data directory
where
the persistent cookies are stored. If you need to avoid such sharing, you can provide unique user data directory
for
each Browser
instance. In the BrowserContext
parameter you can provide the data directory path that
must be used in the new Browser(BrowserContext browserContext)
method. For example:
Browser browser = new Browser(new BrowserContext("C:\\MyUserData"));
16. Navigation History
JxBrowser provides API that allows you to work with Browser's navigation history. Using this API, you can remove navigation history entries (clear navigation history), obtain information about every entry (e.g. URL, title, HTTP status code, etc.), get total number of history entries and navigate to a specified entry from the history.
The following sample demonstrates how to use Navigation History API:
Browser browser = new Browser(); // Returns the number of entries in the back/forward list. int entryCount = browser.getNavigationEntryCount(); // Returns index of the current navigation entry in the back/forward list. int index = browser.getCurrentNavigationEntryIndex(); // Navigates to the entry at a specific index in the back/forward list. browser.goToIndex(index); // Removes navigation entry from the back/forward list at a specific index. boolean success = browser.removeNavigationEntryAtIndex(index); // Prints information about the navigation entry at specific index. NavigationEntry navigationEntry = browser.getNavigationEntryAtIndex(index); System.out.println("URL = " + navigationEntry.getURL()); System.out.println("Original URL = " + navigationEntry.getOriginalURL()); System.out.println("Title = " + navigationEntry.getTitle());
17. User-Agent
Due to Chromium API restrictions the default user-agent string can be modified only once, before you create any
Browser
instances. You can provide your own user-agent string using the BrowserPreferences.setUserAgent(String
userAgent)
method or via the "jxbrowser.chromium.user-agent
" Java System Property.
BrowserPreferences.setUserAgent("My User Agent String"); Browser browser = new Browser(); BrowserView browserView = new BrowserView(browser); JFrame frame = new JFrame(); frame.add(browserView, BorderLayout.CENTER); frame.setSize(700, 500); frame.setVisible(true); browser.loadURL("http://whatsmyuseragent.com/");
18. Proxy Settings
Proxy settings can be configured for each Browser
instance during its creation. You can set the required Proxy
configuration using the new Browser(ProxyConfig proxyConfig)
method. The workflow
is the following:
Browser browser = new Browser(new [AutoDetectProxyConfig, DirectProxyConfig, URLProxyConfig or CustomProxyConfig]);
By default JxBrowser uses system proxy settings. On Windows, JxBrowser uses the same settings that MS Internet Explorer uses. On Mac — it uses the proxy settings listed under the Network Control Panel. These are the same settings that Safari uses. On Linux — JxBrowser uses either GNOME/KDE proxy settings, or will use certain environment variables. When you modify JxBrowser proxy settings you don't modify the system global proxy settings.
The ProxyConfig
class is an abstract class that is implemented by different proxy configurations:
18.1. AutoDetect
With the AutoDetectProxyConfig
proxy configuration the connection automatically detects proxy
settings:
new Browser(new AutoDetectProxyConfig());
18.2. Direct
With the DirectProxyConfig
configuration the connection will not use proxy server at all:
new Browser(new DirectProxyConfig());
18.3. AutoConfig URL
With the URLProxyConfig
proxy configuration the connection uses proxy settings received from proxy
auto-config (PAC) file. You will need to provide URL of the required PAC file:
new Browser(new URLProxyConfig("<pac-file-url>"));
URL to the PAC file must be a valid http://
address. You cannot provide a path to the
local *.pac
file. The name of the PAC file must have the "pac" extension. For example,
http://my-site.com/proxy.pac
and on a web server the pac
file must be served with the
application/x-ns-proxy-autoconfig
mime type.
18.4. Manual
With the CustomProxyConfig
proxy configuration you can provide custom proxy settings for HTTP, HTTPS
and FTP protocols:
HostPortPair httpServer = new HostPortPair("http-proxy-server", 80); HostPortPair httpsServer = new HostPortPair("https-proxy-server", 80); HostPortPair ftpServer = new HostPortPair("ftp-proxy-server", 80); String exceptions = "<local>"; // bypass proxy server for local web pages new Browser(new CustomProxyConfig(httpServer, httpsServer, ftpServer, exceptions));
The format of the exceptions
string can be any of the following:
– [ URL_SCHEME "://" ] HOSTNAME_PATTERN [ ":" <port> ]
e.g. "foobar.com", "*foobar.com", "*.foobar.com", "*foobar.com:99", "https://x.*.y.com:99"
– "." HOSTNAME_SUFFIX_PATTERN [ ":" PORT ]
e.g. ".google.com", ".com", "http://.google.com"
– [ SCHEME "://" ] IP_LITERAL [ ":" PORT ]
e.g. "127.0.1", "[0:0::1]", "[::1]", "http://[::1]:99"
– IP_LITERAL "/" PREFIX_LENGHT_IN_BITS
e.g. "<IP_ADDRESS>/16", "fefe:13::abc/33"
– "<local>
" Match local addresses. The meaning of "<local>
" is
whether the host
matches one of:
"<IP_ADDRESS>", "::1", "localhost".
19. Disabling images, JavaScript, videos, etc.
JxBrowser provides functionality that allows you to enable or disable various features, such as images,
JavaScript, videos, etc., for each Browser
instance.
The following sample demonstrates how to disable images and JavaScript on www.google.com
web page:
Browser browser = new Browser(); // Gets the current Browser's preferences BrowserPreferences preferences = browser.getPreferences(); preferences.setImagesEnabled(false); preferences.setJavaScriptEnabled(false); // Updates Browser's preferences browser.setPreferences(preferences); // Images and JavaScript will be disabled browser.loadURL("http://www.google.com/");
20. Proxy Authentication
Some proxy servers require authorization. You can use the NetworkDelegate.onAuthRequired(AuthRequiredParams
params)
handler in order to handle proxy authentication. The following sample demonstrates how to use it:
browser.getContext().getNetworkService().setNetworkDelegate(new DefaultNetworkDelegate() { @Override public boolean onAuthRequired(AuthRequiredParams params) { if (params.isProxy()) { params.setUsername("proxy-username"); params.setPassword("proxy-password"); // Don't cancel authentication return false; } // Cancel authentication return true; } });
By default JxBrowser doesn't display authorization dialog because it doesn't know what UI Toolkit must be used — Swing or JavaFX.
21. Basic, Digest and NTLM Authentication
To handle basic, digest or NTLM authentication you can use the NetworkDelegate.onAuthRequired(AuthRequiredParams
params)
handler.
To display authentication dialog where user can enter valid user name and password you must
register default Swing/JavaFX implementation of the NetworkDelegate
or your own implementation
of the NetworkDelegate
interface.
The following example demonstrates how to register and override default Swing implementation of
the NetworkDelegate
interface in order to provide user name and password without displaying
authorization dialog:
import com.teamdev.jxbrowser.chromium.swing.DefaultNetworkDelegate; browser.getContext().getNetworkService().setNetworkDelegate(new DefaultNetworkDelegate() { @Override public boolean onAuthRequired(AuthRequiredParams params) { if (!params.isProxy()) { params.setUsername("proxy-username"); params.setPassword("proxy-password"); // Don't cancel authentication return false; } // Cancel authentication return true; } });
22. Network Delegate
JxBrowser provides functionality that allows handling network activity including HTTP requests/responses.
You can use the NetworkDelegate
to handle all network activity of the Browser
instances associated with specified BrowserContext
.
With NetworkDelegate
you can intercept all HTTP requests/responses headers and obtain information
about each request/response stage. Below is the list of all request/response stages:
-
onBeforeRequest
Fires when a request is about to occur. This event is sent before any TCP connection is made and can be used to redirect requests to another location. It can be used to access and modify POST data of the request when method type is "POST". See example.
-
onBeforeSendHeaders
Fires when a request is about to occur and the initial headers have been prepared. It allows adding, modifying, and deleting HTTP request headers
-
onBeforeSendProxyHeaders
Fires after onBeforeSendHeaders when proxy connection is used. Provides information about proxy connection, and allows adding, modifying, and deleting HTTP request headers.
-
onSendHeaders
Fires right before the HTTP headers are sent to the network. This event is informational and it does not allow modifying HTTP headers.
-
onHeadersReceived
Fires each time that an HTTP(S) response header is received. Due to redirects and authentication requests this can happen multiple times per request. This event is intended to allow adding, modifying, and deleting HTTP response headers, such as incoming "Set-Cookie" headers.
-
onAuthRequired
Fires when a request receives an authentication challenge and is unable to respond using cached credentials. You can use this method to handle "basic" or "digest" authentication.
-
onBeforeRedirect
Fires when a request is about to occur and the initial headers have been prepared. It allows adding, modifying, and deleting HTTP request headers.
-
onResponseStarted
Fires when the first byte of the response body is received. For HTTP requests, this means that the status line and response headers are available. This event is informational.
-
onCompleted
Fires when a request has been processed successfully or failed.
-
onDestroyed
Fires when a request is being destroyed.
-
onCanSetCookies
Fires when engine is about to decide whether specified cookies can be set or not.
-
onCanGetCookies
Fires when engine is about to decide whether specified cookies can be received and send to a web server.
The following sample demonstrates how to change target URL using onBeforeURLRequest
event and
print "User-Agent" HTTP header value when user loads www.google.com
:
BrowserContext browserContext = BrowserContext.defaultContext(); browserContext.getNetworkService().setNetworkDelegate(new DefaultNetworkDelegate() { @Override public void onBeforeURLRequest(BeforeURLRequestParams params) { // If navigate to teamdev.com, then change URL to google.com. if (params.getURL().equals("http://www.teamdev.com/")) { params.setURL("www.google.com"); } } @Override public void onBeforeSendHeaders(BeforeSendHeadersParams params) { // If navigate to google.com, then print User-Agent header value. if (params.getURL().equals("http://www.google.com/")) { HttpHeaders headers = params.getHeaders(); System.out.println("User-Agent: " + headers.getHeader("User-Agent")); } } }); Browser browser = new Browser(browserContext); browser.loadURL("http://www.teamdev.com/");
23. File Downloads
JxBrowser provides API that allows handling all the file downloads. Using this API you can control what files should be downloaded, provide path to the destination directory where file must be saved and track download progress.
You can register your own implementation of the DownloadHandler
interface to
handle file downloads in your own way. The following sample demonstrates how to do this:
browser.setDownloadHandler(new DownloadHandler() { public boolean allowDownload(DownloadItem download) { download.addDownloadListener(new DownloadListener() { public void onDownloadUpdated(DownloadEvent event) { DownloadItem download = event.getDownloadItem(); if (download.isCompleted()) { System.out.println("Download is completed!"); } } }); System.out.println("Dest file: " + download.getDestinationFile().getAbsolutePath()); return true; } });
The DownloadItem
class provides methods for pausing and canceling download process. See its corresponding methods.
24. Web page as PNG image
The web page content is rendered off-screen (in memory) by Chromium engine in a separate native process. To
render web content Chromium engine requires the view size to be provided by the application. To provide the view
size you need to use the BrowserView.updateSize(int width, int height)
method. To get the image
from the web page you can use the BrowserView.getImage()
method.
The complete sample that demonstrates how to get an image of the web page with the 1280x1024 view size is the following:
final Browser browser = new Browser(); BrowserView view = new BrowserView(browser); int viewWidth = 1280; int viewHeight = 1024; // Resize view to the required size view.setBounds(new Rectangle(viewWidth, viewHeight)); // Wait until web page is loaded completely invokeAndWaitReady(browser, new Runnable() { public void run() { browser.loadURL("http://www.teamdev.com"); } }); // Get image of the loaded web page Image image = view.getImage();
Where invokeAndWaitReady()
method has the following implementation:
public static void invokeAndWaitReady(Browser browser, Runnable runnable) { final CountDownLatch latch = new CountDownLatch(1); LoadAdapter listener = new LoadAdapter() { @Override public void onFinishLoadingFrame(FinishLoadingEvent event) { if (event.isMainFrame()) { latch.countDown(); } } }; browser.addLoadListener(listener); try { runnable.run(); try { if (!latch.await(45, TimeUnit.SECONDS)) { throw new RuntimeException(new TimeoutException()); } } catch (InterruptedException ignore) { Thread.currentThread().interrupt(); } } finally { browser.removeLoadListener(listener); } }
You can use standard Java API to save this image as PNG file:
// Save image as PNG file BufferedImage bufferedImage = new BufferedImage(viewWidth, viewHeight, BufferedImage.TYPE_4BYTE_ABGR); Graphics2D graphics = (Graphics2D) bufferedImage.getGraphics(); // Scale image according to the current device scale factor. // This code must be used to support Retina displays. Double scale = 1.0 / view.getDeviceScaleFactor(); graphics.scale(scale, scale); graphics.drawImage(image, 0, 0, null); ImageIO.write(bufferedImage, "PNG", new File("teamdev.com.png"));
25. Executing commands
JxBrowser provides functionality that allows you to execute commands such as "Cut", "Copy", "Paste", "Undo", "Redo", "Insert Text", etc. on the loaded web page. JxBrowser supports two types of commands: simple commands (e.g. "Copy", "Cut", "Paste") and parameterized commands ("InsertText", "FindString", etc.).
Most of commands can be executed only in a WYSIWYG editor (e.g. "FontSize", "ForegroundColor", "Bold", etc.), HTML text filed or text area ("InsertText", "Cut", "Delete", etc.).
To execute command you need to use the Browser.executeCommand(EditorCommand command)
method to
execute simple commands or the Browser.executeCommand(EditorCommand command, String value)
method
to execute parameterized command.
browser.executeCommand(EditorCommand.SELECT_ALL); browser.executeCommand(EditorCommand.COPY); browser.executeCommand(EditorCommand.CUT); browser.executeCommand(EditorCommand.PASTE); browser.executeCommand(EditorCommand.INSERT_TEXT, "Text");
The list of all supported commands you can find in the EditorCommand
enum.
26. Saving web pages
JxBrowser allows you to save web pages as a file or set of files. You can use Browser.saveWebPage(String
filePath, String dirPath, SavePageType saveType)
method to save the current web page. Before saving make
sure the page is loaded completely. To find out whether HTML document is loaded completely, you can use one
of the described approaches in the Loading URL section.
String filePath = "C:\\SavedPages\\index.html"; String dirPath = "C:\\SavedPages\\resources"; browser.saveWebPage(filePath, dirPath, SavePageType.COMPLETE_HTML);
27. DOM API
JxBrowser DOM API provides functionality that allows you to work with DOM of the loaded web page. Before you access the DOM of the web page make sure the page is loaded completely. To find out that web page is loaded completely you can use one of the approaches described in the Loading URL section.
To access the web page DOM you need to get its document. You can do it using the
Browser.getDocument()
method. This method returns DOMDocument
instance that represents
a web page’s DOM document. Using DOMDocument
you can go through DOM structure, access HTML elements
by tag name or ID.
DOMDocument document = browser.getDocument(); List<DOMElement> elements = document.findElements(By.tagName("body"));
The DOMDocument.findElements(By by)
method returns a list of DOMNode
objects.
The DOMNode
object represents a standard W3C DOM node. If DOMNode
object represents a
HTML element (see the DOMNode.getNodeType()
method), you can cast it to the DOMElement
interface.
DOMElement
inherits DOMNode
and represents a HTML element. DOMElement
provides methods for working with the HTML element attributes:
DOMElement element = document.getDocumentElement(); element.setAttribute("id", "my-id");
28. DOM Events
Each DOMNode
implements DOMEventTarget
interface that provides methods for registering
DOM events. You can register DOM listener to receive DOM events such as click, mousedown, mouseup, keydown,
load, error etc. The following sample demonstrates how to register click event listener for a document HTML
element:
DOMElement element = document.getDocumentElement(); element.addEventListener(DOMEventType.OnClick, new DOMEventListener() { public void handleEvent(DOMEvent event) { // user clicked document element } }, false);
You can register DOM event listener only for the document of the loaded web page. After reloading the web page, all the registered DOM event listeners will not work anymore, so you need to register the required DOM event listeners again.
29. Find Text
JxBrowser API provides functionality that finds specified text, highlights all matches and selects the first match on the currently loaded web page. See example below:
final Browser browser = new Browser(); browser.addLoadListener(new LoadAdapter() { @Override public void onFinishLoadingFrame(FinishLoadingEvent event) { if (event.isMainFrame()) { SearchParams request = new SearchParams("find me"); // Find text from the beginning of the loaded web page. SearchResult result = browser.findText(request); System.out.println(result.indexOfSelectedMatch() + "/" + result.getNumberOfMatches()); // Find the same text again from the currently selected match. result = browser.findText(request); System.out.println(result.indexOfSelectedMatch() + "/" + result.getNumberOfMatches()); } } }); browser.loadHTML("
Find me

Find me
");
Browser performs search only through visible content on the loaded document. If some text is presented on the
web page, but due to CSS rules it's not visible, Browser
will not check this content during search. Also
Browser
will not find text on the document with size 0x0, so make sure that Browser
component is visible and its
size isn't empty.
To clear highlights on a web page (search results) and cancel search use Browser.stopFindingText(StopFindAction action)
method.
30. JxBrowser & Java Web Start
This section describes how you can deploy your application that uses JxBrowser via Java Web Start (JWS) technology. To deploy your application via JWS, please follow the steps below:
1. Pack your application classes into application JAR file(s) (e.g. myapp.jar
).
2. Sign all your application JAR files with a valid signature. To sign JAR files you can use the following Ant script:
<project name="MyApp"> <target name="myapp-jar"> <signjar jar="myapp.jar" alias="my_alias" keystore="my_keystore" keypass="my_keypass" storepass="my_storepass"/> </target> </project>
where: my_alias
, my_keystore
, my_keypass
,
my_storepass
— signjar
parameters. You can see their description in Apache Ant User Manual.
You can also use the jarsigner
tool to sign all your application JAR files:
jarsigner -keystore keystore_file -storepass storepass -keypass keypass myapp.jar alias
3. Create and configure your application JNLP file.
 Upload your application JAR files, JxBrowser JAR files and JNLP (my.jnlp
and
jxbrowser.jnlp
) files to a web-server.
31. JxBrowser & Java Applet
You can use JxBrowser in a Java Applet the same way as a standard Java library.
JxBrowser requires access to the file system, so all the JAR libraries of your Java Applet must be signed. JxBrowser JAR files are signed with TeamDev signature by default, so you don’t need to to sign them.
Your APPLET tag on a web page should look like:
<APPLET code="com.mycompany.myapp.Application.class" codebase="." archive="myapp.jar, jxbrowser-6.0.jar,jxbrowser-win-6.0.jar,jxbrowser-mac-6.0.jar,jxbrowser-linux32-6.0.jar, jxbrowser-linux64-6.0.jar" WIDTH=800 HEIGHT=400>Browser doesn't support Java Applets. </APPLET>
Where the myapp.jar
file is your application JAR file.
If your Java Applet supports only Windows
platform, there is no need to include the the jxbrowser-mac
, jxbrowser-linux32
and jxbrowser-linux64
JAR files into the archive
attribute.
32. Remote Debugging
JxBrowser provides functionality that allows you to use the
Chrome Developer Tools remote debugging
feature. To enable this feature you must define the remote-debugging-port
Chromium switch by
calling
BrowserPreferences.setChromiumSwitches(String...)
method before creating any Browser
instance.
Once you configured JxBrowser to use a specified remote debugging port, you can get a remote DevTools URL by
calling the Browser.getRemoteDebuggingURL()
method:
BrowserPreferences.setChromiumSwitches("--remote-debugging-port=9222"); Browser browser = new Browser(); browser.loadURL("http://www.google.com"); String remoteDebuggingURL = browser.getRemoteDebuggingURL();
The remoteDebuggingURL
you can load in Google Chrome 31 and higher, or in any other JxBrowser
Browser
instance to open Chrome Developer Tools page that allows inspecting HTML, debugging
JavaScript etc.
For example, in the source code above if you navigate to the remoteDebuggingURL
in Google Chrome,
you
will see Chrome Developer Tools Inspector that you could use to debug the loaded
http://www.google.com
web page.
Do not open the remote debugging URL
in other web browser applications such as
Mozilla FireFox, MS IE, etc. This will lead to a native crash in Chromium DevTools web server. The remote
debugging feature is compatible with Chromium 31 and higher.
33. Drag and Drop
Browser
component supports the following Drag and Drop features:
- Drag selected text and links on loaded web page and drop them into other applications.
- Drag selected text and links on loaded web page and drop them into text fields or text areas on the same web page.
- Drag text from other applications and drop it into text fields or text areas on loaded web page.
HTML5 drag and drop feature is also supported.
To disable Drag and Drop use the BrowserView.setDragAndDropEnabled(boolean enabled)
method or the
jxbrowser.chromium.dnd.enabled=false
System Property.
34. Plugins
JxBrowser inherits Google Chromium Plugin Architecture, but it can display only windowless plugins, because it uses Swing lightweight component to display HTML web pages. Windowless plugins are designed to run directly within the rendering pipeline. Right now only Flash and Silverlight supports windowless mode, so they can be displayed by JxBrowser.
Adobe PDF plugin can be used, but JxBrowser cannot display its content, because Adobe PDF Viewer doesn't support windowless mode.
Java Applets can be used partially — JxBrowser cannot display Java Applets embedded directly into a web page document, but if Java Applet represents a separate window, then it can be used with JxBrowser without any issues.
34.1. Flash and Silverlight
JxBrowser can display Flash and Silverlight content on Windows platform only. It forces these plugins to use windowless mode.
— In order to display Flash contents you need to download
and install Flash Player.
— In order to display Silverlight contents you need to download and
install Silverlight on the target Windows platform.
34.2. Plugins Manager
To get information about all installed and available plugins you can use the PluginManager.getPluginsInfo()
method:
PluginManager pluginManager = browser.getPluginManager(); List<PluginInfo> pluginsList = pluginManager.getPluginsInfo(); for (PluginInfo plugin : pluginsList) { System.out.println("Plugin Name: " + plugin.getName()); }
To enable/disable specified plugin register your own PluginFilter
implementation:
pluginManager.setPluginFilter(new PluginFilter() { @Override public boolean isPluginAllowed(PluginInfo pluginInfo) { // Allow only PDF plugin return pluginInfo.getMimeTypes().contains("application/pdf"); } });
35. Printing
JxBrowser allows printing currently loaded web page using one of the installed printer devices. To print web
page use the Browser.print()
method. The web page can be printed also from JavaScript via
the window.print()
function.
To handle printing and provide custom print settings, register your own implementation of the
PrintHandler
interface using the Browser.setPrintHandler()
method. For example:
browser.setPrintHandler(new PrintHandler() { @Override public PrintStatus onPrint(PrintJob printJob) { PrintSettings printSettings = printJob.getPrintSettings(); printSettings.setLandscape(true); printSettings.setPrintBackgrounds(true); printJob.addPrintJobListener(new PrintJobListener() { @Override public void onPrintingDone(PrintJobEvent event) { System.out.println("PrintingDone success: " + event.isSuccess()); } }); return PrintStatus.CONTINUE; } });
36. Geolocation
JxBrowser is based on Google Chromium engine. Some Chromium features uses Google APIs. To access those APIs, an API Key is required. To acquire API Key follow the instruction.
Geolocation is one of those Chromium features that uses Google API. You must enable Google Maps Geolocation API and billing, otherwise Geolocation API will not work.
Once you enable Google Maps Geolocation API and billing, you can provide the keys to JxBrowser Chromium engine:
1. Via environment variables. Set the environment variables GOOGLE_API_KEY, GOOGLE_DEFAULT_CLIENT_ID and GOOGLE_DEFAULT_CLIENT_SECRET to your "API key", "Client ID" and "Client secret" values respectively. To find out where to get "API key", "Client ID" and "Client secret" see the video instruction.
2. Using the BrowserPreferences.setChromiumVariable(String name, String value)
method. For example:
BrowserPreferences.setChromiumVariable("GOOGLE_API_KEY", "Your API Key"); BrowserPreferences.setChromiumVariable("GOOGLE_DEFAULT_CLIENT_ID", "Your Client ID"); BrowserPreferences.setChromiumVariable("GOOGLE_DEFAULT_CLIENT_SECRET", "Your Client Secret");
You must configure Chromium variables before you create any Browser
instance.
37. Logging
JxBrowser logging system is based on Java Logging, so you can configure JxBrowser logging using standard Java Logging API. For example, in order to access different JxBrowser Loggers and specify the SEVERE log level you can use the following code:
import com.teamdev.jxbrowser.chromium.LoggerProvider; import java.util.logging.*; ... LoggerProvider.getBrowserLogger().setLevel(Level.SEVERE); LoggerProvider.getIPCLogger().setLevel(Level.SEVERE); LoggerProvider.getChromiumProcessLogger().setLevel(Level.SEVERE);
The BrowserLogger
is used to log browser messages.
The IPCLogger
is used to log IPC (Inter-Process Communication) messages.
The ChromiumProcessLogger
is used to log messages that are come from Chromium process.
By default the log level for all JxBrowser loggers is set to Level.ALL
.
Redirect logging to a file
To redirect all log messages of BrowserLogger
to the "D:/jxbrowser.log" file, you can use the
following way:
Logger logger = LoggerProvider.getBrowserLogger(); FileHandler fileHandler = new FileHandler("D:/jxbrowser.log"); logger.addHandler(fileHandler); fileHandler.setFormatter(new SimpleFormatter());
You can redirect log messages of any JxBrowser logger: BrowserLogger
, IPCLogger
or
ChromiumProcessLogger
.
38. Known Restrictions
JxBrowser uses a lightweight Swing/JavaFX component to display HTML web pages, all heavyweight plugins such as Java Applet, Adobe PDF Viewer etc. cannot be embedded into a lightweight component, so they are not supported.
The following features and functionality are not supported in JxBrowser yet:
— Flash on Linux isn't supported;
— Java Applets on all platforms will be downloaded but not displayed
39. Technical Support
Support Site
You can find more information about how to use JxBrowser library at JxBrowser Support Site.
Support Forum
If you would like to discuss any topics related to JxBrowser, please visit our Support Forum.
Samples
You can find JxBrowser samples on the following resource: http://links.teamdev.com/jxbrowser-samples
Reporting Issues
If you have any questions regarding JxBrowser, please e-mail us at: jxbrowser-evaluation@teamdev.com


--- title: Damn Cool Algorithms -- BK-Trees layout: post ---
BK-Trees, or Burkhard-Keller Trees are a tree-based data structure engineered for quickly finding near-matches to a string, for example, as used by a spelling checker, or when doing a 'fuzzy' search for a term. The aim is to return, for example, "seek" and "peek" if I search for "aeek". What makes BK-Trees so cool is that they take a problem which has no obvious solution besides brute-force search, and present a simple and elegant method for speeding up searches substantially.


Week 3 Technical Blog
Arrays and Hashes
1/11/15
Arrays and Hashes are similar, yet they are different. It is important to know the difference in order to utilize them effectively.
I like to think an array is like an ordered list. In a sense, an array is like a hash, where the key is the number on the list. You can look up what is on the list by the number. An important note though is that programmers count from 0 so the first object of an array is actually the 0th object. An array can contain any object, including another array. Thus, it is possible to have an array of an array, or multi-dimensional arrays.
Here is an example of an array of strings:
letter_array["A", "B", "C"]
letter_array[1] will retrieve the second string, "B".
If an array is an ordered list, then I like to think a hash is like a phonebook. The key would be the name of a person and the value would be their phone number. You get the value (the phone number) by looking up the key (their name).


There are several ALM-specific rake tasks that help with administration of the ALM application. They can be listed with the following command:
bundle exec rake -T
Please append RAILS_ENV=production
to all rake commands when running Rails in production
mode.
db.rake
Bulk-load articles via the CrossRef API:
bundle exec rake db:articles:import
The command takes the following optional parameters via ENV variables
FROM_UPDATE_DATE=2014-02-05
UNTIL_UPDATE_DATE=2014-03
FROM_PUB_DATE=2014-01-01
UNTIL_UPDATE_DATE=2014-07-01
MEMBER=340
TYPE=journal-article
ISSN=1545-7885
SAMPLE=50
FROM_UPDATE_DATE
means metadata updated since (inclusive){date}
,UNTIL_UPDATE_DATE
means metadata updated until (inclusive){date}
.FROM_PUB_DATE
means article published since (inclusive){date}
,UNTIL_PUB_DATE
published until (inclusive){date}
.MEMBER
is the CrossRef member_id, which you find by searching the member database, e.g.http://api.crossref.org/members?query=elife
.TYPE
is the type of the resource, e.g.journal-article
, a listing of available types can be found athttp://api.crossref.org/types
.SAMPLE
returns a random sample of x DOIs and can be combined with the other parameters.
For more information please see the CrossRef API documentation.
To load for example all eLife content created or updated in 2014, use the following command:
bundle exec rake db:articles:import MEMBER=4374 FROM-UPDATE-DATE=2014-01 UNTIL-UPDATE-DATE=2014-12
Bulk-load a file consisting of DOIs, one per line. It'll ignore (but count) invalid ones and those that already exist in the database:
bundle exec rake db:articles:load <DOI_DUMP
Format for import file
DOI Date(YYYY-MM-DD) Title
The rake task splits on white space for the first two elements, and then takes the rest of the line (title) as one element including any whitespace in the title.
Loads 25 sample articles
bundle exec rake db:articles:seed
Deletes all articles and associated rows in the retrieval_statuses table. For safety reasons doesn't work in the production environment (use the following rake task).
bundle exec rake db:articles:delete_all
Bulk-load a file consisting of DOIs, one per line. It'll ignore (but count) invalid DOIs, and will delete all articles with matching DOIs:
bundle exec rake db:articles:delete <DOI_DUMP
Format for import file:
DOI Date(YYYY-MM-DD) Title
The rake task splits on white space for the first two elements, and then takes the rest of the line (title) as one element including any whitespace in the title.
Removes all HTML and XML tags from title field (for legacy data).
bundle exec rake db:articles:sanitize_title
Isnstall sources. Provide one or more source names as arguments, e.g. rake db:sources:install[pmc]
or install all available sources without arguments:
bundle exec rake db:sources:install
Uninstall sources. Provide one or more source names as arguments, e.g. rake db:sources:uninstall[pmc]
:
bundle exec rake db:sources:uninstall
Deletes all resolved alerts:
bundle exec rake db:alerts:delete
Delete old API requests (only keep the last 10,000):
bundle exec rake db:api_requests:delete
Delete all resolved API responses older than 24 hours:
bundle exec rake db:api_responses:delete
The last three rake tasks should run regularly, and can be set up to run as a daily cron task with bundle exec whenever -w
.
queue.rake
Queue all articles
bundle exec rake queue:all
Queue article with given DOI:
bundle exec rake queue:one[DOI]
Start job queue
bundle exec rake queue:start
Stop job queue
bundle exec rake queue:stop
By default the rake tasks above run for all sources. Do have them run for one or more specific sources, add the source names as parameters:
bundle exec rake queue:all[mendeley,citeulike]
pmc.rake
Import latest (i.e. last month's) PubMed Central usage stats.
bundle exec rake pmc:update
Import all PubMed Central usage stats since month/year.
bundle exec rake pmc:update MONTH=1 YEAR=2013
workers.rake
Start all the workers.
bundle exec rake workers:start_all
Stop all the workers.
bundle exec rake workers:stop_all
filter.rake
Create alerts by filtering API responses
bundle exec rake filter:all
Unresolve all alerts that have been filtered (e.g. to re-run filters with new settings)
bundle exec rake filter:unresolve
mailer.rake
Send all reports
bundle exec rake mailer:all
Send error report
bundle exec rake mailer:error_report
Send status report
bundle exec rake mailer:status_report