ART study HIV intervention EAAA treatment health patients trial national care data months viral time {border-style patient HIV-positive initiation px;} #ffffff;} [], []. control guidelines individuals impact public transition Swaziland conducted early follow-up incidence load sector standard Health Swaziland’s antiretroviral baseline implementation including sites social clinical community enrolled initiated population primary stage suppression MaxART access design enrollment initiation, number program randomized research retention six-month testing used South current following include outcomes point px; rate science stepped-wedge understand {font-family Community National Trial analysis differences economic eligibility facilities font-size interviews people phase resistance sample services AIDS Accessed Africa. age approach assess cluster comprehensive consent country designed double; drug eligible end endpoints file follow grouped new package patients’ protocol providing site size stage, Additional Board Data Fig. HIV/AIDS Research addition, aims analysis, available border-color border-width causal collected communities considered criteria determine estimate facility group immediate increase model offered offering one-year participants period place prior recommended response results retention, solid; start sub-Saharan support survey therapy using years {font-style {font-weight (EAAA) .collab: Access Africa Average Health, July Ministry Prevention Primary Proportion Public Study Swaziland. World adherence administrative adults article bold changes collection contains cost-effectiveness counseling countries courier; critical day delayed em; enroll evidence final global guidelines. healthcare implementing inform initiation. irrespective key methods month need outcomes, pairs percentage period. power pre-ART prevalence prevention procedures projected provide provided provider pt;} quantify questions random range satisfaction second secondary sexual significant strategy study. supplementary suppressed test treat universal virally women


Copyright © 2005-2006 Jas Latrix<EMAIL_ADDRESS>Copyright © 2013-2021 Thijs Schreijer
Table of Contents
To Load the module call local date = require"date"
in
your script. Make sure Lua can find the source file date.lua
. No global table date
will be created. Use the metamethod __call to construct
a dateObject see example below:
local date = require "date" -- prints all FRIDAY the 13TH dates between year 2000 and 2010 for i = 2000, 2010 do -- year jan 1 x = date(i, 1, 1) -- from january to december for j = 1, 12 do -- set date to 13, check if friday if x:setmonth(j, 13):getweekday() == 6 then print(x:fmt("%A, %B %d %Y")) end end end --- OUTPUT --- --> Friday, October 13 2000 --> Friday, April 13 2001 --> Friday, July 13 2001 --> Friday, September 13 2002 --> Friday, December 13 2002 --> Friday, June 13 2003 --> Friday, February 13 2004 --> Friday, August 13 2004 --> Friday, May 13 2005 --> Friday, January 13 2006 --> Friday, October 13 2006 --> Friday, April 13 2007 --> Friday, July 13 2007 --> Friday, June 13 2008 --> Friday, February 13 2009 --> Friday, March 13 2009 --> Friday, November 13 2009 --> Friday, August 13 2010
24*60*60
seconds.Mon
Jan 01 1000000 BCE 00:00:00
and less than Mon Jan
01 1000001 00:00:00
.Local = UTC + bias
os.date
and os.time
. It assumes that the Lua function os.time
returns the number of seconds
since the start time (called "epoch"). If the time value is outside
the allowable range of times, usually Jan 01 1970
00:00:00
to Jan 19 2038 03:14:07
the bias will
be retrieve using the equivalent year inside the allowable range. Two years are
considered to equivalent if they have the same leap year ness and starting weekday.
The function that needs local time support are date(true) (get the current UTC time), date(false) (get the current local time), date(num_time), dateObj:getbias(), dateObject:fmt(str) (when str has a '%Z' or '%z'),
num_time
or tbl_date
or str_date
or
bool_now
argument describe in the date library __call method.
string
, it must be the name of the month
full or abbreviated. If the value is a number
, that
number must be 1-12 (January-December). see table below
Table 1.
| Index | Abbreviation | Full Name |
|---|---|---|
| 1 | Jan | January |
| 2 | Feb | February |
| 3 | Mar | March |
| 4 | Apr | April |
| 5 | May | May |
| 6 | Jun | June |
| 7 | Jul | July |
| 8 | Aug | August |
| 9 | Sep | September |
| 10 | Oct | October |
| 11 | Nov | November |
| 12 | Dec | December |
If the value does not represent month, that is equivalent to passing a nil value.
date.diff(var_date1
,var_date2
)
| Success | The resulting dateObject |
| Failure | nil. |
-- get the days between two dates d = date.diff("Jan 7 1563", date(1563, 1, 2)) assert(d:spandays()==5)
date.epoch()
| Success | The resulting dateObject |
| Failure | nil. |
assert(date.epoch()==date("jan 1 1970"))
local centuryflip = date.getcenturyflip()
local centuryflip = date.getcenturyflip()
date.isleapyear(var_year
)
true
if var_year
leap year. false
if var_year
not leap year.d = date(1776, 1, 1) assert(date.isleapyear(d)) assert(date.isleapyear(d:getyear())) assert(date.isleapyear(1776))
date.setcenturyflip(century_flip
)
date.setcenturyflip(0) assert(date("01-01-00")==date(1900,01,01)) assert(date("01-01-50")==date(1950,01,01)) assert(date("01-01-99")==date(1999,01,01)) date.setcenturyflip(100) assert(date("01-01-00")==date(2000,01,01)) assert(date("01-01-50")==date(2050,01,01)) assert(date("01-01-99")==date(2099,01,01)) date.setcenturyflip(50) assert(date("01-01-00")==date(2000,01,01)) assert(date("01-01-49")==date(2049,01,01)) assert(date("01-01-50")==date(1950,01,01)) assert(date("01-01-99")==date(1999,01,01))
int_year, var_month,
int_day, num_hour, num_min, num_sec, int_ticks
num_time
or
tbl_date
or str_date
or bool_now
date(false
)
date:__call(...)
is the same as date(...)
.
date(num_time
)
date(tbl_date
)
date(str_date
)
date(bool_now
)
date(int_year
,var_month
,int_day
, [num_hour
], [num_min
], [num_sec
], [int_ticks
])
number
value. Represents
the number of seconds in Universal Coordinated Time between the
specified value and the System epoch.table
value. The
constructor will look for the value of this key:
year
- an integer,
the full year, for example, 1969. Required if month and day is
givenmonth
- a parsable month value. Required if
year and day is givenday
- an integer,
the day of month from 1 to 31. Required if year and month is
givenhour
- a number,
hours value, from 0 to 23, indicating the number of hours since
midnight. (default = 0)min
- a number,
minutes value, from 0 to 59. (default = 0)sec
- a number,
seconds value, from 0 to 59. (default = 0)(hour or min or sec or
msec)
must be supplied if date (year and month and day)
is not
given, vice versa.
string
value. It must have
number/words representing date and/or time. Use commas and spaces
as delimiters. Strings enclosed by parenthesis is treated as a
comment and is ignored, these parentheses may be nested. The stated
day of the week is ignored whether its correct or not. A string
containing an invalid date is an error. For example, a string
containing two years or two months is an error. Time must be
supplied if date is not given, vice versa.
Time Format. Hours, minutes, and seconds are separated by colons, although all need not be specified. "10:", "10:11", and "10:11:12" are all valid. If the 24-hour clock is used, it is an error to specify "PM" for times later than 12 noon. For example, "23:15 PM" is an error.
Time Zone Format. First character is a sign "+" (east of UTC) or "-" (west of UTC). Hours and minutes offset are separated by colons:
assert( date("Jul 27 2006 03:56:28 +2:00") == date(2006,07,27,1,56,28))
Another format is [sign][number]
If [number]
is less than 24, it is
the offset in hours e.g. "-10" = -10 hours.  Short dates can use either a "/" or "-" date separator, but must follow the month/day/year format. 2 digit years are interpreted according to the global centuryflip setting.
assert(date("02-03-04")==date(1904,02,03)) assert(date("12/25/98")==date(1998,12,25))
Long dates of the form "July 10 1995" can be given with the year, month, and day in any order, and the year in 2-digit or 4-digit form. If you use the 2-digit form, the year must be greater than or equal to 70.
assert(date("Feb-03-04")==date(1904,02,03)) assert(date("December 25 1998")==date(1998,12,25))
Follow the year with BC or BCE to indicate that the year is before common era.
assert(date("Feb 3 0003 BC")==date(-2,02,03)) assert(date("December 25 0001 BC")==date(0,12,25))
Supported ISO 8601 Formats.
YYYY-MM-DD
assert(date("2000-12-31")==date(2000,12,31)) assert(date(" 20001231 ")==date(2000,12,31)) -- Compact version
YYYY-DDD
assert(date("1995-035")==date(1995,02,04)) assert(date("1995035 ")==date(1995,02,04)) -- Compact version
YYYY-WDD-D
assert(date("1997-W01-1")==date(1996,12,30)) assert(date(" 1997W017")==date(1997,01,05)) -- Compact version
DATE HH:MM:SS.SSS
assert(date("1995-02-04 24:00:51.536")==date(1995,2,5,0,0,51.536)) assert(date("1976-W01-1 12:12:12.123")==date(1975,12,29,12,12,12.123)) assert(date("1995-035 23:59:59.99999")==date(1995,02,04,23,59,59.99999)) -- Compact version separated by latin capital letter T assert(date(" 19950205T000051.536 ")==date(1995,2,5,0,0,51.536)) assert(date(" 1976W011T121212.123 ")==date(1975,12,29,12,12,12.123)) assert(date(" 1995035T235959.99999 ")==date(1995,02,04,23,59,59.99999))
DATE TIME +HH:MM
, DATE
TIME -HHMM
,
DATE TIME Z
,assert(date("1976-W01-1 12:00Z ")==date(1975,12,29,12)) assert(date("1976-W01-1 13:00+01:00")==date(1975,12,29,12)) assert(date("1976-W01-1 0700-0500 ")==date(1975,12,29,12))
boolean
value. if
bool_now
is false
it returns the current local date and time.
if bool_now
is true
it returns the current UTC date and
time.interger
value. The year
value.interger
value. The day
of month.number
value. Equal to
the hours value. The default value is 0
number
value. Equal to
the minutes value. The default value is 0
number
value. Equal to
the seconds value. The default value is 0
interger
value. Equal to
the ticks value. The default value is 0
| Success | the new dateObject |
| Failure | nil. |
a = date(2006, 8, 13) assert(a == date("Sun Aug 13 2006")) b = date("Jun 13 1999") assert(b == date(1999, 6, 13)) c = date(1234483200) assert(c == date("Feb 13 2009")) d = date({year=2009, month=11, day=13, min=6}) assert(d == date("Nov 13 2009 00:06:00")) e = date() assert(e)
dateObject
as Ticks or Day
Fraction. Date is stored in dateObject
as Day
Number. Ticks is time unit per seconds. For example, if the tick unit is 1000000.
0.25 seconds is equivalent to 250000 ticks (0.25*1000000). Day number, is the
number days since the epoch, which is January 1, 0001 AD. Example.
dobj = date("15:49:59.3669")If the tick unit is 1000000,
dobj
store this time as
56999366900 ticks and 0 days.
((((15*60)+49)*60)+59.3669)*1000000 ==<PHONE_NUMBER>0Example Date and Time:
dobj = date("Jan-5-0001 10:30:15")If the tick unit is 1000000,
dobj
store this date and
time as<PHONE_NUMBER>0 ticks and 4 days. 4 days becuase:
| Day# | Date |
|---|---|
| 0 | Jan 1 0001 |
| 1 | Jan 2 0001 |
| 2 | Jan 3 0001 |
| 3 | Jan 4 0001 |
| 4 | Jan 5 0001 |
| 5 | Jan 6 0001 |
| ... | ... |
The default tick unit is 1000000 (micro-second-ticks)
a < b
operation.true
if date value of a is smaller/older
than date value of b. a > b
is equivalent to
b < a
.a <= b
operation.true
if date value of a is smaller/older
than or equal to the date value of b. a >= b
is equivalent to b <= a
.a == b
operation.true
if date value of a is equal
equal to the date value of b. a ~= b
is
equivalent to not (a == b)
.a .. b
operation.tostring(a) ..
tostring(b)
.a - b
operation.b
from
date and time value of a
.a + b
operation.b
to date and
time value of a
.a
and b
must be a
parsable date value or an error rises
a = date(1521,5,2) b = a:copy():addseconds(0.001) assert((a - b):spanseconds() == -0.001) assert((a + b) == (b + a)) assert(a == (b - date("00:00:00.001")) ) assert(b == (a + date("00:00:00.001")) ) b:addseconds(-0.01) assert(a > b and b < a) assert(a >= b and b <= a) assert(a ~= b and (not(a == b))) a = b:copy() assert(not (a > b and b < a)) assert(a >= b and b <= a) assert(a == b and (not(a ~= b))) assert((a .. 565369) == (b .. 565369)) assert((a .. "????") == (b .. "????"))
dateObject:adddays(int_days
)
integer
value. Days to
add.| Success | reference to the adjusted dateObject |
| Failure | nil. |
a = date(2000,12,30) b = date(a):adddays(3) c = date.diff(b,a) assert(c:spandays() == 3)
dateObject:addhours(num_hours
)
number
value. Hours to
add.| Success | reference to the adjusted dateObject |
| Failure | nil. |
a = date(2000,12,30) b = date(a):addhours(3) c = date.diff(b,a) assert(c:spanhours() == 3)
dateObject:addminutes(num_minutes
)
number
value. Minutes to
add.| Success | reference to the adjusted dateObject |
| Failure | nil. |
a = date(2000,12,30) b = date(a):addminutes(3) c = date.diff(b,a) assert(c:spanminutes() == 3)
dateObject:addmonths(int_months
)
integer
value. Months to
add.| Success | reference to the adjusted dateObject |
| Failure | nil. |
a = date(2000,12,28):addmonths(3) assert(a:getmonth() == 3)
dateObject:addseconds(num_sec
)
number
value. Seconds to
add.| Success | reference to the adjusted dateObject |
| Failure | nil. |
a = date(2000,12,30) b = date(a):addseconds(3) c = date.diff(b,a) assert(c:spanseconds() == 3)
dateObject:addticks(num_ticks
)
number
value. Ticks to
add.| Success | reference to the adjusted dateObject |
| Failure | nil. |
dateObject
”.a = date(2000,12,30) b = date(a):addticks(3) c = date.diff(b,a) assert(c:spanticks() == 3)
dateObject:addyears(int_years
)
integer
value. Years to
add.| Success | reference to the adjusted dateObject |
| Failure | nil. |
a = date(2000,12,30):addyears(3) assert(a:getyear() == (2000+3))
dateObject:copy()
a = date(2000,12,30) b = a:copy() assert(a==b)
dateObject:fmt(str_code
)
string
value. The format string
follows the same rules as the strftime standard C function.
Table 3. Format Spec
| Spec | Description |
|---|---|
| '%a' | Abbreviated weekday name (Sun) |
| '%A' | Full weekday name (Sunday) |
| '%b' | Abbreviated month name (Dec) |
| '%B' | Full month name (December) |
| '%C' | Year/100 (19, 20, 30) |
| '%d' | The day of the month as a number (range 1 - 31) |
| '%g' | year for ISO 8601 week, from 00 (79) |
| '%G' | year for ISO 8601 week, from 0000 (1979) |
| '%h' | same as %b |
| '%H' | hour of the 24-hour day, from 00 (06) |
| '%I' | The hour as a number using a 12-hour clock (01 - 12) |
| '%j' | The day of the year as a number (001 - 366) |
| '%m' | Month of the year, from 01 to 12 |
| '%M' | Minutes after the hour 55 |
| '%p' | AM/PM indicator (AM) |
| '%S' | The second as a number (59, 20 , 01) |
| '%u' | ISO 8601 day of the week, to 7 for Sunday (7, 1) |
| '%U' | Sunday week of the year, from 00 (48) |
| '%V' | ISO 8601 week of the year, from 01 (48) |
| '%w' | The day of the week as a decimal, Sunday being 0 |
| '%W' | Monday week of the year, from 00 (48) |
| '%y' | The year as a number without a century (range 00 to 99) |
| '%Y' | Year with century (2000, 1914, 0325, 0001) |
| '%z' | Time zone offset, the date object is assumed local time (+1000, -0230) |
| '%Z' | Time zone name, the date object is assumed local time |
| '%\b' | Year, if year is in BCE, prints the BCE Year representation, otherwise result is similar to "%Y" (1 BCE, 40 BCE) # |
| '%\f' | Seconds including fraction (59.998, 01.123) # |
| '%%' | percent character % |
| '%r' | 12-hour time, from 01:00:00 AM (06:55:15 AM); same as "%I:%M:%S %p" |
| '%R' | hour:minute, from 01:00 (06:55); same as "%I:%M" |
| '%T' | 24-hour time, from 00:00:00 (06:55:15); same as "%H:%M:%S" |
| '%D' | month/day/year from 01/01/00 (12/02/79); same as "%m/%d/%y" |
| '%F' | year-month-day (1979-12-02); same as "%Y-%m-%d" |
| '%c' | The preferred date and time representation; same as "%x %X" |
| '%x' | The preferred date representation, same as "%a %b %d %\b" |
| '%X' | The preferred time representation, same as "%H:%M:%\f" |
| '${iso}' | Iso format, same as "%Y-%m-%dT%T" |
| '${http}' | http format, same as "%a, %d %b %Y %T GMT" |
| '${ctime}' | ctime format, same as "%a %b %d %T GMT %Y" |
| '${rfc850}' | RFC850 format, same as "%A, %d-%b-%y %T GMT" |
| '${rfc1123}' | RFC1123 format, same as "%a, %d %b %Y %T GMT" |
| '${asctime}' | asctime format, same as "%a %b %d %T %Y" |
d = date(1582,10,5) assert(d:fmt('%D') == d:fmt("%m/%d/%y")) -- month/day/year from 01/01/00 (12/02/79) assert(d:fmt('%F') == d:fmt("%Y-%m-%d")) -- year-month-day (1979-12-02) assert(d:fmt('%h') == d:fmt("%b")) -- same as %b (Dec) assert(d:fmt('%r') == d:fmt("%I:%M:%S %p")) -- 12-hour time, from 01:00:00 AM (06:55:15 AM) assert(d:fmt('%T') == d:fmt("%H:%M:%S")) -- 24-hour time, from 00:00:00 (06:55:15) assert(d:fmt('%a %A %b %B') == "Tue Tuesday Oct October") assert(d:fmt('%C %d') == "15 05", d:fmt('%C %d')) print(d:fmt[[ ${iso} -- iso ${http} -- http ${ctime} -- ctime ${rfc850} -- rfc850 ${rfc1123} -- rfc1123 ${asctime} -- asctime ]])
-- Prints the current date and time, including time zone d = date(false); print(d:fmt("Today is %c GMT%z")) --> "Today is Tue Oct 31 2000 01:58:14 GMT-0330" -- Prints the current date and time in ISO format including time zone d = date(false); print(d:fmt("Today is ${iso}%z")) --> "Today is 2000-10-31T01:58:14-0330" -- Prints the current date and time in ISO format, indicates UTC d = date(true); print(d:fmt("Today is ${iso}Z")) --> "Today is 2000-10-31T05:28:14Z"
dateObject:getbias()
a = date(2^16) print(a:getbias())
dateObject:getclockhour()
a = date("10:59:59 pm") assert(a:getclockhour()==10)
year
, month
, and day
value in a dateObject.
dateObject:getdate()
a = date(1970, 1, 1) y, m, d = a:getdate() assert(y == 1970 and m == 1 and d == 1)
dateObject:getday()
d = date(1966, 'sep', 6) assert(d:getday() == 6)
dateObject:getfracsec()
d = date("Wed Apr 04 2181 11:51:06.996 UTC") assert(d:getfracsec() == 6.996)
dateObject:gethours()
d = date("Wed Apr 04 2181 11:51:06 UTC") assert(d:gethours() == 11)
dateObject:getisoweekday()
d = date(1970, 1, 1) assert(d:getisoweekday() == 4)
dateObject:getisoweeknumber()
d = date(1975, 12, 29) assert(d:getisoweeknumber() == 1) assert(d:getisoyear() == 1976) assert(d:getisoweekday() == 1) d = date(1977, 1, 2) assert(d:getisoweeknumber() == 53) assert(d:getisoyear() == 1976) assert(d:getisoweekday() == 7)
dateObject:getisoyear()
d = date(1996, 12, 30) assert(d:getisoyear() == 1997) d = date(1997, 01, 05) assert(d:getisoyear() == 1997)
dateObject:getminutes()
d = date("Wed Apr 04 2181 11:51:06 UTC") assert(d:getminutes() == 51)
dateObject:getmonth()
d = date(1966, 'sep', 6) assert(d:getmonth() == 9)
dateObject:getseconds()
d = date("Wed Apr 04 2181 11:51:06.123 UTC") assert(d:getseconds() == 6)
dateObject:getticks()
dateObject
”.d = date("Wed Apr 04 2181 11:51:06.123 UTC") assert(d:getticks() == 123000)
hours
, minutes
, seconds
and ticks
value in a dateObject.
dateObject:gettime()
a = date({hour=5,sec=.5,min=59}) h, m, s, t = a:gettime() assert(t == 500000 and s == 0 and m == 59 and h == 5, tostring(a))
dateObject:getweekday()
d = date(1970, 1, 1) assert(d:getweekday() == 5)
dateObject:getweeknumber([int_wdaybase
])
integer
value. The
starting day of week (1 for sunday, 2 for monday, ... 7 for
saturday). If omitted the starting day of week is sunday.a = date("12/31/1972") b,c = a:getweeknumber(), a:getweeknumber(2) assert(b==53 and c==52)
dateObject:getyear()
d = date(1965, 'jan', 0) assert(d:getyear() == 1964)
dateObject:getyearday()
d = date(2181, 1, 12) assert(d:getyearday() == 12)
dateObject:setday(int_mday
)
integer
value. A numeric value
equal to the day of month. The default value is the current day of month
| Success | reference to the dateObject |
| Failure | nil. |
d = date(1966, 'july', 6) d:setday(1) assert(d == date("1966 july 1"))
dateObject:sethours(num_hour
,num_min
,num_sec
,num_ticks
)
number
value. The hours value. The
default value is the current hours
value
number
value. The minutes after
the hours value. The default value is the
current minutes value
number
value. The seconds after
the minute value. The default value is the
current seconds value
number
value. The ticks after the
second value. The default value is the current
ticks value
| Success | reference to the dateObject |
| Failure | nil. |
d = date(1984, 12, 3, 4, 39, 54) d:sethours(1, 1, 1) assert(d == date("1984 DEc 3 1:1:1"))
dateObject:setisoweekday(int_wday
)
integer
value. The day the week.
The default value is the current week
day
| Success | reference to the dateObject |
| Failure | nil. |
d = date.isodate(1999, 52, 1) d:setisoweekday(7) assert(d == date(2000, 1, 02))
dateObject:setisoweeknumber(int_week
,int_wday
)
integer
value. The week value.
The default value is the current
week
integer
value. The day of the week.
The default value is the current week
day
| Success | reference to the dateObject |
| Failure | nil. |
d = date(1999, 12, 27) d:setisoweeknumber(51, 7) assert(d == date(1999, 12, 26))
dateObject:setisoyear(int_year
,int_week
,int_wday
)
integer
value. The year value. The
default value is the current year
integer
value. The week value.
The default value is the current
week
integer
value. The day of the week.
The default value is the current week
day
| Success | reference to the dateObject |
| Failure | nil. |
d = date(1999, 12, 27) d:setisoyear(2000, 1) assert(d == date.isodate(2000,1,1)) assert(d:getyear() == 2000) assert(d:getday() == 3)
dateObject:setminutes(num_min
,num_sec
,num_ticks
)
number
value. The minutes after
the value. The default value is the current
minutes value
number
value. The seconds after
the minute value. The default value is the
current seconds value
number
value. The ticks after the
second value. The default value is the current
ticks value
| Success | reference to the dateObject |
| Failure | nil. |
d = date(1984, 12, 3, 4, 39, 54) d:setminutes(59, 59, 500) assert(d == date(1984, 12, 3, 4, 59, 59, 500))
dateObject:setmonth(var_month
,int_mday
)
the current month
integer
value. The day of month.
The default value is the current day of
month
| Success | reference to the dateObject |
| Failure | nil. |
d = date(1966, 'july', 6) d:setmonth(1) assert(d == date("6 jan 1966"))
dateObject:setseconds(num_sec
,num_ticks
)
number
value. The seconds after
the minute value. The default value is the
current seconds value
number
value. The ticks after the
second value. The default value is the current
ticks value
| Success | reference to the dateObject |
| Failure | nil. |
d = date(1984, 12, 3, 4, 39, 54) d:setseconds(59, date.ticks()) assert(d == date(1984, 12, 3, 4, 40))
dateObject:setticks(num_ticks
)
number
value. The ticks after the
second value. The default value is the current
ticks value
| Success | reference to the dateObject |
| Failure | nil. |
d = date(1984, 12, 3, 4, 39, 54) d:setticks(444) assert(d == date(1984, 12, 3, 4, 39, 54, 444))
dateObject:setyear(int_year
,var_month
,int_mday
)
integer
value. The year value. The
default value is the current year
the
current month
integer
value. The day of month.
The default value is the current day of
month
| Success | reference to the dateObject |
| Failure | nil. |
d = date(1966, 'july', 6) d:setyear(2000) assert(d == date("jul 6 2000"))
dateObject:spandays()
a = date(2181, "aPr", 4, 6, 30, 30, 15000) b = date(a):adddays(2) c = date.diff(b, a) assert(c:spandays() == (2))
dateObject:spanhours()
a = date(2181, "aPr", 4, 6, 30, 30, 15000) b = date(a):adddays(2) c = date.diff(b, a) assert(c:spanhours() == (2*24))
dateObject:spanminutes()
a = date(2181, "aPr", 4, 6, 30, 30, 15000) b = date(a):adddays(2) c = date.diff(b, a) assert(c:spanminutes() == (2*24*60))
dateObject:spanseconds()
a = date(2181, "aPr", 4, 6, 30, 30, 15000) b = date(a):adddays(2) c = date.diff(b, a) assert(c:spanseconds() == (2*24*60*60))
dateObject:spanticks()
dateObject
”.a = date(2181, "aPr", 4, 6, 30, 30, 15000) b = date(a):adddays(2) c = date.diff(b, a) assert(c:spanticks() == (2*24*60*60*1000000))
dateObject:tolocal()
a = date(2^16) b = a:copy():tolocal(); print(a,b)
dateObject:toutc()
a = date(2^16) b = a:copy():toutc(); print(a,b)
http://alcor.concordia.ca/~gpkatch/gdate-method.html - Date calculation algorithms is based on this site.


Register for FlixOneStore
First Name:
Last Name:
Email:
Gender:
Male
Female
Date of Birth:
Mobile Number:
Fax:
Password:
Confirm Password:
Register


By default, all searches will be done under the Global search base. However, because most servers put users and groups under different sub-trees, you will probably need to set the Base for Unix users and Base for Unix groups to the distinguished names for those sub-trees. The Base for Unix passwords should be set to the same DN as Base for Unix users, as password information is almost always stored with other user attributes.


That page isn't here anymore.
You're probably looking for a page that has moved to a different URL. Browse through the post archives to find a link to the page.
You're probably looking for a page that has moved to a different URL. Browse through the post archives to find a link to the page.


Enables the use of time calculations within Time itself
- advance
- ago
- at_beginning_of_day
- at_beginning_of_month
- at_beginning_of_quarter
- at_beginning_of_week
- at_beginning_of_year
- at_end_of_month
- at_midnight
- beginning_of_day
- beginning_of_month
- beginning_of_quarter
- beginning_of_week
- beginning_of_year
- change
- end_of_month
- in
- last_month
- last_year
- midnight
- monday
- months_ago
- months_since
- next_month
- next_week
- next_year
- seconds_since_midnight
- since
- tomorrow
- years_ago
- years_since
- yesterday
Uses Date to provide precise Time calculations for years, months, and days. The options parameter takes a hash with any of these keys: :months, :days, :years.
[ show source ]
# File vendor/rails/activesupport/lib/active_support/core_ext/time/calculations.rb, line 50 50: def advance(options) 51: d = ::Date.new(year + (options.delete(:years) || 0), month, day) 52: d = d >> options.delete(:months) if options[:months] 53: d = d + options.delete(:days) if options[:days] 54: change(options.merge(:year => d.year, :month => d.month, :mday => d.day)) 55: end
Returns a new Time representing the time a number of seconds ago, this is basically a wrapper around the Numeric extension Do not use this method in combination with x.months, use months_ago instead!
[ show source ]
# File vendor/rails/activesupport/lib/active_support/core_ext/time/calculations.rb, line 59 59: def ago(seconds) 60: seconds.until(self) 61: end
Alias for beginning_of_day
Alias for beginning_of_month
Alias for beginning_of_quarter
Alias for beginning_of_week
Alias for beginning_of_year
Alias for end_of_month
Alias for beginning_of_day
Returns a new Time representing the start of the day (0:00)
[ show source ]
# File vendor/rails/activesupport/lib/active_support/core_ext/time/calculations.rb, line 143 143: def beginning_of_day 144: (self - self.seconds_since_midnight).change(:usec => 0) 145: end
Returns a new Time representing the start of the month (1st of the month, 0:00)
[ show source ]
# File vendor/rails/activesupport/lib/active_support/core_ext/time/calculations.rb, line 151 151: def beginning_of_month 152: #self - ((self.mday-1).days + self.seconds_since_midnight) 153: change(:mday => 1,:hour => 0, :min => 0, :sec => 0, :usec => 0) 154: end
Returns a new Time representing the start of the quarter (1st of january, april, july, october, 0:00)
[ show source ]
# File vendor/rails/activesupport/lib/active_support/core_ext/time/calculations.rb, line 166 166: def beginning_of_quarter 167: beginning_of_month.change(:month => [10, 7, 4, 1].detect { |m| m <= self.month }) 168: end
Returns a new Time representing the "start" of this week (Monday, 0:00)
[ show source ]
# File vendor/rails/activesupport/lib/active_support/core_ext/time/calculations.rb, line 129 129: def beginning_of_week 130: days_to_monday = self.wday!=0 ? self.wday-1 : 6 131: (self - days_to_monday.days).midnight 132: end
Returns a new Time representing the start of the year (1st of january, 0:00)
[ show source ]
# File vendor/rails/activesupport/lib/active_support/core_ext/time/calculations.rb, line 172 172: def beginning_of_year 173: change(:month => 1,:mday => 1,:hour => 0, :min => 0, :sec => 0, :usec => 0) 174: end
Returns a new Time where one or more of the elements have been changed according to the options parameter. The time options (hour, minute, sec, usec) reset cascadingly, so if only the hour is passed, then minute, sec, and usec is set to 0. If the hour and minute is passed, then sec and usec is set to 0.
[ show source ]
# File vendor/rails/activesupport/lib/active_support/core_ext/time/calculations.rb, line 35 35: def change(options) 36: ::Time.send( 37: self.utc? ? :utc : :local, 38: options[:year] || self.year, 39: options[:month] || self.month, 40: options[:mday] || self.mday, 41: options[:hour] || self.hour, 42: options[:min] || (options[:hour] ? 0 : self.min), 43: options[:sec] || ((options[:hour] || options[:min]) ? 0 : self.sec), 44: options[:usec] || ((options[:hour] || options[:min] || options[:sec]) ? 0 : self.usec) 45: ) 46: end
Returns a new Time representing the end of the month (last day of the month, 0:00)
[ show source ]
# File vendor/rails/activesupport/lib/active_support/core_ext/time/calculations.rb, line 158 158: def end_of_month 159: #self - ((self.mday-1).days + self.seconds_since_midnight) 160: last_day = ::Time.days_in_month( self.month, self.year ) 161: change(:mday => last_day,:hour => 0, :min => 0, :sec => 0, :usec => 0) 162: end
Alias for since
Short-hand for months_ago(1)
[ show source ]
# File vendor/rails/activesupport/lib/active_support/core_ext/time/calculations.rb, line 119 119: def last_month 120: months_ago(1) 121: end
Short-hand for years_ago(1)
[ show source ]
# File vendor/rails/activesupport/lib/active_support/core_ext/time/calculations.rb, line 108 108: def last_year 109: years_ago(1) 110: end
Alias for beginning_of_day
Alias for beginning_of_week
Returns a new Time representing the time a number of specified months ago
[ show source ]
# File vendor/rails/activesupport/lib/active_support/core_ext/time/calculations.rb, line 71 71: def months_ago(months) 72: months_since(-months) 73: end
[ show source ]
# File vendor/rails/activesupport/lib/active_support/core_ext/time/calculations.rb, line 75 75: def months_since(months) 76: year, month, mday = self.year, self.month, self.mday 77: 78: month += months 79: 80: # in case months is negative 81: while month < 1 82: month += 12 83: year -= 1 84: end 85: 86: # in case months is positive 87: while month > 12 88: month -= 12 89: year += 1 90: end 91: 92: max = ::Time.days_in_month(month, year) 93: mday = max if mday > max 94: 95: change(:year => year, :month => month, :mday => mday) 96: end
Short-hand for months_since(1)
[ show source ]
# File vendor/rails/activesupport/lib/active_support/core_ext/time/calculations.rb, line 124 124: def next_month 125: months_since(1) 126: end
Returns a new Time representing the start of the given day in next week (default is Monday).
[ show source ]
# File vendor/rails/activesupport/lib/active_support/core_ext/time/calculations.rb, line 137 137: def next_week(day = :monday) 138: days_into_week = { :monday => 0, :tuesday => 1, :wednesday => 2, :thursday => 3, :friday => 4, :saturday => 5, :sunday => 6} 139: since(1.week).beginning_of_week.since(days_into_week[day].day).change(:hour => 0) 140: end
Short-hand for years_since(1)
[ show source ]
# File vendor/rails/activesupport/lib/active_support/core_ext/time/calculations.rb, line 113 113: def next_year 114: years_since(1) 115: end
Seconds since midnight: Time.now.seconds_since_midnight
[ show source ]
# File vendor/rails/activesupport/lib/active_support/core_ext/time/calculations.rb, line 28 28: def seconds_since_midnight 29: self.hour.hours + self.min.minutes + self.sec + (self.usec/1.0e+6) 30: end
Returns a new Time representing the time a number of seconds since the instance time, this is basically a wrapper around
the Numeric extension. Do not use this method in combination with x.months, use months_since instead!
[ show source ]
# File vendor/rails/activesupport/lib/active_support/core_ext/time/calculations.rb, line 65 65: def since(seconds) 66: seconds.since(self) 67: end
Convenience method which returns a new Time representing the time 1 day since the instance time
[ show source ]
# File vendor/rails/activesupport/lib/active_support/core_ext/time/calculations.rb, line 183 183: def tomorrow 184: self.since(1.day) 185: end
Returns a new Time representing the time a number of specified years ago
[ show source ]
# File vendor/rails/activesupport/lib/active_support/core_ext/time/calculations.rb, line 99 99: def years_ago(years) 100: change(:year => self.year - years) 101: end
[ show source ]
# File vendor/rails/activesupport/lib/active_support/core_ext/time/calculations.rb, line 103 103: def years_since(years) 104: change(:year => self.year + years) 105: end
Convenience method which returns a new Time representing the time 1 day ago
[ show source ]
# File vendor/rails/activesupport/lib/active_support/core_ext/time/calculations.rb, line 178 178: def yesterday 179: self.ago(1.day) 180: end


StreamManager
public class StreamManager
| Field Summary | |
|---|---|
| private mixed | Path of the file containing the configuration. |
| private mixed | The simple xml of the 'streams.xml'. |
| Constructor Summary | |
|---|---|
Constructor. |
| Method Summary | |
|---|---|
| private void | Loads the 'config.xml'. |
| The | getStreamActions(mixed id) Returns the path of an stream for a given ID |
| The | getStreamInfo(mixed id) Returns the path of an stream for a given ID |
| void | setStreamConfiguration(mixed streamConfiguration, string configFilePath) Sets the path of the file containing the configuration |
private mixed $streamConfiguration = null
Path of the file containing the configuration. */
private mixed $xml = null
The simple xml of the 'streams.xml'. */
public StreamManager()
Constructor. */
private void _loadConfig()
Loads the 'config.xml'. /
public The getStreamActions(mixed id)
Returns the path of an stream for a given ID
public The getStreamInfo(mixed id)
Returns the path of an stream for a given ID
public void setStreamConfiguration(mixed streamConfiguration, string configFilePath)
Sets the path of the file containing the configuration
Manages the settings configured in 'streams.xml'. /


"Life is and will ever remain an equation incapable of solution, but it contains certain known factors." - Nicola Tesla


Prime Time
SLpM - Significant Strikes Landed per Minute
Str. Acc. - Significant Striking Accuracy
SApM - Significant Strikes Absorbed per Minute
Str. Def. - Significant Strike Defence (the % of opponents strikes that did not land)
TD Avg. - Average Takedowns Landed per 15 minutes
TD Acc. - Takedown Accuracy
TD Def. - Takedown Defense (the % of opponents TD attempts that did not land)
Sub. Avg. - Average Submissions Attempted per 15 minutes
| W/L | Fighter | Kd | Str | Td | Sub | Event | Method | Round | Time |
|---|---|---|---|---|---|---|---|---|---|
|
UFC Fight Night: Hall vs. Strickland Jul. 31, 2021 |
|||||||||
|
0 0 |
0 1 |
0 0 |
0 0 |
Apr. 24, 2021 |
KO/TKO
|
1 |
0:17 |
||
|
2 0 |
60 53 |
0 0 |
0 0 |
UFC Fight Night: Hall vs. Silva Oct. 31, 2020 |
KO/TKO Punches |
4 |
1:24 |
||
|
1 0 |
34 22 |
0 3 |
0 0 |
UFC Fight Night: Cowboy vs. Gaethje Sep. 14, 2019 |
S-DEC
|
3 |
5:00 |
||
|
1 0 |
39 68 |
0 0 |
0 0 |
UFC 232: Jones vs. Gustafsson 2 Dec. 29, 2018 |
KO/TKO Punch |
3 |
1:32 |
||
|
0 1 |
58 75 |
0 0 |
0 0 |
Jul. 07, 2018 |
KO/TKO Punches |
2 |
2:38 |
||
|
1 1 |
26 44 |
0 1 |
0 1 |
UFC Fight Night: Rockhold vs. Branch Sep. 16, 2017 |
KO/TKO Punches |
2 |
2:25 |
||
|
0 0 |
12 20 |
0 1 |
0 0 |
UFC Fight Night: Mousasi vs. Hall 2 Nov. 19, 2016 |
KO/TKO Punches |
1 |
4:37 |
||
|
0 1 |
1 4 |
0 0 |
0 0 |
UFC Fight Night: Poirier vs. Johnson Sep. 17, 2016 |
KO/TKO Punches |
1 |
1:41 |
||
|
0 0 |
45 67 |
0 1 |
0 0 |
Nov. 14, 2015 |
U-DEC
|
3 |
5:00 |
||
|
1 0 |
18 17 |
0 1 |
1 1 |
UFC Fight Night: Barnett vs Nelson Sep. 26, 2015 |
KO/TKO Spinning Back Kick |
2 |
0:25 |
||
|
0 0 |
11 7 |
1 0 |
0 0 |
UFC Fight Night: Teixeira vs Saint Preux Aug. 08, 2015 |
KO/TKO Punches |
1 |
2:32 |
||
|
0 0 |
43 45 |
1 1 |
0 0 |
May. 23, 2015 |
S-DEC
|
3 |
5:00 |
||
|
1 0 |
27 10 |
0 0 |
0 0 |
UFC Fight Night: McGregor vs Siver Jan. 18, 2015 |
KO/TKO
|
1 |
3:37 |
||
|
0 0 |
42 44 |
1 0 |
1 0 |
Jul. 05, 2014 |
U-DEC
|
3 |
5:00 |
||
|
1 0 |
20 11 |
0 0 |
0 0 |
Dec. 28, 2013 |
KO/TKO
|
1 |
5:00 |
||
|
0 0 |
41 33 |
2 2 |
0 1 |
UFC Fight Night: Shogun vs Sonnen Aug. 17, 2013 |
S-DEC
|
3 |
5:00 |
||
|
0 0 |
44 31 |
2 3 |
0 0 |
The Ultimate Fighter: Team Jones vs. Team Sonnen Finale Apr. 13, 2013 |
S-DEC
|
3 |
5:00 |


Qpid Proton 0.23.0 Release Notes
Proton is a high-performance, lightweight messaging library. More
about Qpid Proton.
For more information about this release, including download links and
documentation, see the release overview.
New features and improvements
- PROTON-636 - remove confusing default for session capacity and allow disabling it
- PROTON-1823 - [c] make it easier to send a message
- PROTON-1826 - [go] Add Messge.String() method for human-readable message printing
Bugs fixed
- PROTON-1514 - [proton-c] When last frame of multi-frame transfer has settled=true, Proton still considers delivery as unsettled
- PROTON-1809 - [python, ruby] Unable to receive messages when max-frame-size is set to more than 2^20
- PROTON-1815 - [C++ binding] Complex types: List containing array of std::nullptr_t fails compilation
- PROTON-1818 - [C++ binding] Complex types: list of nulls causes SIGABRT
- PROTON-1820 - [ruby] Container#schedule does not work if called from handler
- PROTON-1821 - link name is not correctly set from sender or receiver options
- PROTON-1822 - Running C/C++ Example tests under python 3 produces warnings
- PROTON-1825 - PyPI package python-qpid-proton doesn't pip install on MacOS X or FreeBSD
- PROTON-1830 - [ruby] sporadic failure of ruby tests
- PROTON-1832 - [c] duplicate link names cause invalid read in pn_transport_unbind_handles
- PROTON-1841 - [cpp] add missing ostream<< and to_string for proton::message
- PROTON-1844 - Windows proactor memory corruption on cleanup
- PROTON-1845 - [c] Treat attach received after detach as implying new link
- PROTON-1847 - container:schedule used from an external thread can stop container::run loop processing other events
Apache Qpid, Messaging built on AMQP; Copyright © 2015
The Apache Software Foundation; Licensed under
the Apache
License, Version 2.0; Apache Qpid, Qpid, Qpid Proton,
Proton, Apache, the Apache feather logo, and the Apache Qpid
project logo are trademarks of The Apache Software
Foundation; All other marks mentioned may be trademarks or
registered trademarks of their respective owners


04. Debug Console
Debug Console
In this section, we'll go over the bitcoin core debug console. This is a powerful tool that helps you explore data within the bitcoin blockchain. We'll be using this debug console throughout the rest of the lesson to learn many of the commands you can use to access data for yourself.
Debug Console Overview
The video below gives an introduction to the main features we'll be using in the debug console.
Debug-Console-Overview
INSTRUCTOR NOTE:
Note: The current version for Bitcoin Core is <IP_ADDRESS>, some functions and commands has been changed since the video was recorded, we are adding text notes if changes has been made.
Bitcoin Core version v<IP_ADDRESS> changes
In the video we introduce the following command categories:
- == Blockchain ==
- == Control ==
- == Generating ==
- == Mining ==
- == Network ==
- == Rawtransactions ==
- == Util ==
- == Wallet ==
In this new version we also have this new category:
- == Zmq ==
Commands
Help: Provides an overview and details of commands available in the console.
For a list of available commands and their definitions, you can also go to the bitcoin wiki
Wrap Up
Coming up, we'll explore many of the commands available to you in the Bitcoin Core Debug console. The goal of these sections is to help you feel confident working with this data and exploring commands for yourself.
They're covered in a specific order to make sure you've seen certain commands that you may need before moving on to others. That said, they're not too dependent on each other. If you are interested in a certain section, feel free to jump straight to that, and if you're confident going off to explore on your own, that's great too!


Contact us for Admissions:
Assistant Director (Admissions)
Room No. SRB-G30
VIT-AP University
(Beside AP Secratariat)
Near Vijayawada, 522 237
Andhra Pradesh
Contact us for Admissions:
Assistant Director (Admissions)
Room No. SRB-G30
VIT-AP University
(Beside AP Secratariat)
Near Vijayawada, 522 237
Andhra Pradesh
Web Hunt 3.0
Photographic Event
National Workshop on Data Science and Computing


 Buffalo tenderloin tongue chuck shoulder. Cow rump porchetta sirloin beef. Pig brisket tongue ham, doner t-bone buffalo swine bacon landjaeger sausage ground round jerky.  Filet mignon bacon cow alcatra chicken landjaeger ham. Biltong beef meatball jowl andouille ribeye ball tip.
Cupim pancetta boudin short ribs andouille drumstick chuck sausage meatball hamburger ribeye shoulder. Fatback cow pork belly, leberkas pork chop picanha short ribs shankle sirloin. Ribeye pork chop flank, short ribs boudin pork loin leberkas shoulder alcatra spare ribs salami. Jowl kielbasa andouille, pork loin leberkas ham hock pastrami biltong shank strip steak sirloin short loin tail. Short loin jowl brisket biltong, spare ribs frankfurter strip steak.
Shankle porchetta ground round, t-bone ham bresaola turkey flank tenderloin venison landjaeger. Cow tail turkey landjaeger sirloin. Drumstick swine short loin ham turkey.
December 11 2015
This Is Another Article
Bacon ipsum dolor amet ribeye drumstick ball tip tail. Meatball swine leberkas kielbasa pork cupim sirloin. Jowl turkey prosciutto shank frankfurter sausage pork loin short ribs kielbasa sirloin tail t-bone porchetta kevin drumstick.  Salami turducken ham meatloaf turkey short loin sirloin tri-tip bacon.
Short loin short ribs alcatra biltong rump shankle. Rump chuck boudin burgdoggen shankle shoulder pastrami beef bresaola kielbasa pork loin. Corned beef shoulder porchetta pancetta shankle venison swine sirloin pork belly. Pig chuck jerky, turkey salami spare ribs drumstick picanha pancetta.
Tongue jowl swine, buffalo beef beef ribs tail doner shank. Kielbasa prosciutto flank, meatball tri-tip corned beef venison pork kevin leberkas pork loin.  Tail short ribs buffalo cupim, burgdoggen sausage corned beef boudin chicken tri-tip pork ham hock jerky. Pork pork belly pork loin turducken prosciutto burgdoggen jerky corned beef. Ham hock pork pastrami bresaola rump short loin, t-bone brisket shank. Shank bresaola ham hock pork loin, leberkas shankle tail pork.


When I was a small boy, my father told me never to recommend a church or a woman to anyone. And I have found it wise never to recommend a restaurant either. Something always goes wrong with the cheese soufflé.
There is something profoundly satisfying about sharing a meal. Eating together, breaking bread together, is one of the oldest and most fundamentally unifying of human experiences.
There is something profoundly satisfying about sharing a meal. Eating together, breaking bread together, is one of the oldest and most fundamentally unifying of human experiences.
There is something profoundly satisfying about sharing a meal.Eating together, breaking bread together,is one of the oldest and most fundamentally unifying of human experiences.


tennis
{%if likes_same_singer== True %}
we like the same singers :D
{%else%}
we dont like the same singers maybe you can listen to them :3
{% for songs in songs %}
{{songs}}
{% endfor %} {%endif%}


Manual Cluster
Design
The following diagram outlines the design of the cluster.
Requirements
For complete deployment requirements and instructions, please see the Deployment Page. The requirements for Clusters vary only in the RAM requirement. Clusters require at least 8GB RAM for smooth performance. The requirements below are specific for Cluster Installation VMs.
| Number of VMs | CPU Units | RAM | Root Partion | Port Requirements |
|---|---|---|---|---|
| 2 | 2 CPU ea. | 8 GB | 40 GB | 4444 and 8989 (LDAP replication), 30865 (file system syncing) |
NOTE: Above three ports should be opened in such a way that Node-1/host-1 can talk to Node-2/host-2 through these ports and vice versa
Note: For convenience, the VMs are identified as host-1
and host-2
Timezone Requirements
It is mandatory to keep the date and time synced between all the nodes of a cluster. It is recommended to change the timzone from UTC to local timezone where the cluster is situated or use a single timezone if the cluster spans multiple timezones. The timezone requirement is applicable to both the VM and the chroot
container.
Note
It is recommended to use a single timezone for all the nodes of the cluster in both VM and chroot.
Gluu strongly recommends using ntpd
in the VMs and run the ntp
daemon from cronjob
to sync time. It is preferable if the cronjob is run every second to ensure smooth performance of the cluster.
Preparing VMs
Preparing Node-1 of cluster:
- Install Gluu CE following the Deployment Page in
host-1
.- NOTE: you must provide hostname of the cluster itself to
setup.py
script (idp.gluu.org
in this example), not hostnames of individual nodes!
- NOTE: you must provide hostname of the cluster itself to
Preparing Node-2 of cluster:
- Grab
setup.properties.last
from Node-1/host-1 ( location: /install/community-edition-setup/ ) - Change attribute 'ip': Provide node-2/host-2 IP address here.
- Rename
setup.properties.last
tosetup.properties
- Put this new file inside 2nd node's Gluu Server container ( location: /install/community-edition/setup/ )
- Enter into Gluu Server Container
- Run
setup.py
- NOTE: As it won't be running in interactive mode this way, make sure you'll provide all optional components (like Shibboleth, Asimba etc) you need to be installed explicitly with keys (run
# ./setup.py -h
for full list of them) Please be sure to read this part in case you failed to setup the 2nd node usingsetup.properties.last
file from the 1st one for some reason, and resorted to installing it from scratch, that will call for additional steps.
- NOTE: As it won't be running in interactive mode this way, make sure you'll provide all optional components (like Shibboleth, Asimba etc) you need to be installed explicitly with keys (run
LDAP Replication
NOTE: Deployer need to perform LDAP Replication in Node-1/host-1 as user 'ldap'
- Things to know
| host-1 | host-2 |
|---|---|
| IP Address eg. <IP_ADDRESS> | Ip Address eg. <IP_ADDRESS> |
| LDAP admin pass | LDAP admin pass |
| ldapGeneralConfigInstall.py | |
| replicationSetup.py |
-
Log into
host-1
Gluu Server container -
Run ldapGeneralConfigInstall.py in
host-1
. This script will prepare thehost-1
LDAP server to accept various configurations such asallow-pre-encoded-passwords
or applyting the host and port for LDAP Server. -
Run replicationSetup.py in
host-1
and it will give a similar output as below:
[ldap@]$ python replicationSetup.py
Create a password for the replication admin:
Enter number of OpenDJ servers: 2
Enter the hostname of server 1: <IP_ADDRESS>
Enter the Directory Manager password for <IP_ADDRESS>: xxxxx
Enter the hostname of server 2: <IP_ADDRESS>
Enter the Directory Manager password for <IP_ADDRESS>: yyyyy
Establishing connections ..... Done.
Checking registration information ..... Done.
Configuring Replication port on server <IP_ADDRESS>:4444 ..... Done.
Configuring Replication port on server <IP_ADDRESS>:4444 ..... Done.
Updating replication configuration for baseDN o=gluu on server <IP_ADDRESS>:4444 ..... Done.
Updating replication configuration for baseDN o=gluu on server <IP_ADDRESS>:4444 ..... Done.
Updating registration configuration on server <IP_ADDRESS>:4444 ..... Done.
Updating registration configuration on server <IP_ADDRESS>:4444 ..... Done.
Updating replication configuration for baseDN cn=schema on server <IP_ADDRESS>:4444 ..... Done.
Updating replication configuration for baseDN cn=schema on server <IP_ADDRESS>:4444 ..... Done.
Initializing registration information on server <IP_ADDRESS>:4444 with the contents of server <IP_ADDRESS>:4444 ..... Done.
Initializing schema on server <IP_ADDRESS>:4444 with the contents of server <IP_ADDRESS>:4444 ..... Done.
Replication has been successfully enabled. Note that for replication to work you must initialize the contents of the base DNs that are being replicated (use dsreplication initialize to do so).
See /tmp/opendj-replication-8140652343601372868.log for a detailed log of this
operation.
Enabling Replication Complete.
<EMAIL_ADDRESS>- Initialize directory server replication with this command
/opt/opendj/bin/dsreplication initialize
and it will give the following output (some issues were reported for this step, resulting in "Invalid credentials" errors; in that case try to run the tool in console mode rather than interactive:/opt/opendj/bin/dsreplication initialize-all --hostname <IP_ADDRESS> --port 4444 -I 'admin' \ -w 'REPLICATION_ADMIN_PASSWORD' -b 'o=gluu' --trustAll --no-prompt
):
<EMAIL_ADDRESS>/opt/opendj/bin/dsreplication initialize
>>>> Specify server administration connection parameters for the source server
Directory server hostname or IP address [idp.gluu.org]: <IP_ADDRESS>
Directory server administration port number [4444]:
How do you want to trust the server certificate?
1) Automatically trust
2) Use a truststore
3) Manually validate
Enter choice [3]: 1
Global Administrator User ID [admin]:
Password for user 'admin': #!0^GluU(sWoWSm)
>>>> Specify server administration connection parameters for the destination
server
Directory server hostname or IP address [idp.gluu.org]: <IP_ADDRESS>
Directory server administration port number [4444]:
How do you want to trust the server certificate?
1) Automatically trust
2) Use a truststore
3) Manually validate
Enter choice [3]: 1
You must choose at least one base DN to be initialized.
Initialize base DN o=gluu? (yes / no) [yes]:
Initializing the contents of a base DN removes all the existing contents of
that base DN. Do you want to remove the contents of the selected base DNs on
server <IP_ADDRESS>:4444 and replace them with the contents of server
<IP_ADDRESS>:4444? (yes / no) [yes]:
Initializing base DN o=gluu with the contents from <IP_ADDRESS>:4444:
0 entries processed (0 % complete).
36336 entries processed (99 % complete).
Base DN initialized successfully.
See /tmp/opendj-replication-808135637744675184.log for a detailed log of this
operation.
(!)
OpenDJ may become picky about certificates used for SSL connections during replication in certain linux distros. Make sure you've added certificates of each OpenDJ instance to default java key storage of each node; another option is to use the same OpenDJ certificate/key pair for both nodes
File System Replication
(!)
Be advised that backup feature is broken in some of earlier versions of csync2 you may get installed from your distribution's repo. In that case you will need either to disable it by commenting out backup-*
clauses in tool's configuration file, or to build csync2 of version 2.0+ from sources and use key -l
in your xinetd.d's config (like server_args = -i -l -N idp1.gluu.org
) on both nodes.
(!)
Be sure to verify all pathes (for executables, keys etc) in configuration files' examples before using them in your production instance, as they may differ for different linux distros.
csync2
is used for file system syncing between host-1
and host-2
. The following locations are synced in between the two VMs.
- /opt/idp/conf
- /opt/idp/metadata
- /opt/idp/ssl
- /opt/tomcat/conf
- /etc/csync2/csync2.cfg
Csync2 installation
Please follow steps provided in next articles to install csync2 on both nodes: CentOS 6.x, CentOS 7.x, Ubuntu 14.x (from repo), Ubuntu 14.x (compiling from sources).
Csync2 configuration for host-1
-
Log into Gluu-Server container
-
Generate
csync2
private key by runningcsync2 -k csync2.key
and put it into/etc/csync2/csync2.key
file -
Copy the private key to
host-2
and put it into the same file there -
Generate certificate/key pair that will be used to establish SSL protection layer for incoming connections by running next commands on
host-1
(location of the files and their names are hardcoded into executable). Don't fill any fields, just hitEnter
accepting default values:
openssl genrsa -out /etc/csync2_ssl_key.pem 1024
openssl req -new -key /etc/csync2_ssl_key.pem -out /etc/csync2_ssl_cert.csr
openssl x509 -req -days 600 -in /etc/csync2_ssl_cert.csr -signkey /etc/csync 2_ssl_key.pem \
-out /etc/csync2_ssl_cert.pem
In case you've compiled csync from sources you may opt to just run # make cert
while in the sources' directory, it will do everything for you.
- Add IP and hostnames in the
hosts
file. In the hosts file example belowhost-1
is calledidp1.gluu.org
andhost-2
is calledidp2.gluu.org
<IP_ADDRESS> localhost
::1 ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
<IP_ADDRESS> idp.gluu.org idp1.gluu.org
<IP_ADDRESS> idp2.gluu.org
- Modify
csync2
in the/etc/xinetd.d/
folder (some packages may reqire you to install it first; run# yum install xinetd
, then# chkconfig xinetd on
):
# default: off
# description: csync2
service csync2
{
flags = REUSE
socket_type = stream
wait = no
user = root
group = root
server = /usr/sbin/csync2
server_args = -i -N idp1.gluu.org
port = 30865
type = UNLISTED
#log_on_failure += USERID
disable = no
# only_from = <IP_ADDRESS> <IP_ADDRESS>
}
- Run the following commands
service xinetd restart
chkconfig xinetd on
Note: The status can be checked by running chkconfig xinetd –list
and iptables -L -nv | grep 30865
. For confirmation, telnet 30865 port from the VMs.
- Configure
csync2.cfg
to reflect the configuration below (Please note that csync2 doesn't allow to use symlinks in this file; you'll may need to correct full paths to certain directories as they may change in future Gluu's CE packages)
#nossl * *;
group cluster_group
{
host idp1.gluu.org;
host idp2.gluu.org;
key /etc/csync2/csync2.key;
include /etc/csync2/csync2.cfg;
include /opt/idp/conf;
include /opt/idp/metadata;
include /opt/idp/ssl;
include /opt/apache-tomcat-7.0.65/conf;
exclude *~ .*;
action
{
logfile "/var/log/csync2_action.log";
do-local;
}
action
{
pattern /opt/apache-tomcat-7.0.65/conf/*;
exec "/sbin/service tomcat restart";
logfile "/var/log/csync2_action.log";
do-local;
}
backup-directory /var/backups/csync2;
backup-generations 3;
auto younger;
}
- Start
csync2
by runningcsync2 -cvvv -N idp2.gluu.org
- Run
mkdir -p /var/backups/csync2
- Add cronjob to automate csync2 run. The cronjob example is given below:
1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59 * * * * /usr/sbin/csync2 -N idp1.gluu.org -xv 2>/var/log/csync2.log
Csync2 configuration for host-2
-
Log into Gluu-Server container
-
(If you haven't done it yet) Copy the private key you generated on
host-1
previously tohost-2
and put it into/etc/csync2/csync2.key
file -
Generate certificate/key pair that will be used to establish SSL protection layer for incoming connections by running next commands on
host-2
(location of the files and their names are hardcoded into executable). Don't fill any fields, just hit "Enter" accepting default values:
openssl genrsa -out /etc/csync2_ssl_key.pem 1024
openssl req -new -key /etc/csync2_ssl_key.pem -out /etc/csync2_ssl_cert.csr
openssl x509 -req -days 600 -in /etc/csync2_ssl_cert.csr -signkey /etc/csync2_ssl_key.pem \
-out /etc/csync2_ssl_cert.pem
In case you've compiled csync from sources you may opt to just run # make cert
while in the sources' directory, it will do everything for you.
- Add IP and hostnames in the
hosts
file. In the hosts file example belowhost-1
is calledidp1.gluu.org
andhost-2
is calledidp2.gluu.org
<IP_ADDRESS> localhost
::1 ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
<IP_ADDRESS> idp1.gluu.org
<IP_ADDRESS> idp.gluu.org idp2.gluu.org
- Modify
csync2
in the/etc/xinetd.d/
folder (some packages may reqire you to install it first; run# yum install xinetd
, then# chkconfig xinetd on
):
# default: off
# description: csync2
service csync2
{
flags = REUSE
socket_type = stream
wait = no
user = root
group = root
server = /usr/sbin/csync2
server_args = -i -N idp2.gluu.org
port = 30865
type = UNLISTED
#log_on_failure += USERID
disable = no
# only_from = <IP_ADDRESS> <IP_ADDRESS>
}
- Run the following commands
service xinetd restart
chkconfig xinetd on
Note: The status can be checked by running chkconfig xinetd –list
and iptables -L -nv | grep 30865
. For confirmation, telnet 30865 port from the VMs.
- Configure
csync2.cfg
to reflect the configuration below (Please note that csync2 doesn't allow to use symlinks in this file; you'll may need to correct full paths to certain directories as they may change in future Gluu's CE packages):
#nossl * *;
group cluster_group
{
host idp1.gluu.org;
host idp2.gluu.org;
key /etc/csync2/csync2.key;
include /etc/csync2/csync2.cfg;
include /opt/idp/conf;
include /opt/idp/metadata;
include /opt/idp/ssl;
include /opt/apache-tomcat-7.0.65/conf;
exclude *~ .*;
action
{
logfile "/var/log/csync2_action.log";
do-local;
}
action
{
pattern /opt/apache-tomcat-7.0.65/conf/*;
exec "/sbin/service tomcat restart";
logfile "/var/log/csync2_action.log";
do-local;
}
backup-directory /var/backups/csync2;
backup-generations 3;
auto younger;
}
- Start
csync2
by runningcsync2 -cvvv -N idp2.gluu.org
- Run
mkdir -p /var/backups/csync2
- Add cronjob to automate csync2 run. The cronjob example is given below:
1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59 * * * * /usr/sbin/csync2 -N idp2.gluu.org -xv 2>/var/log/csync2.log
Certificate Management
Certificates are not being synced automatically in the proposed setup. They must be initially copied by hand from one node to the other, and must be synced in this manner each time they are being updated.
in each host, when required. Move to /etc/certs/
on the 1st node (inside the container). Copy all keys, certs and key storages conforming to these masks: httpd.*
, asimba.*
, asimbaIDP.*
, idp-encryption.*
, idp-signing.*
, shibIDP.*
, oxauth-keys.*
and scim-rs.*
- to the same directory on the 2nd node (overwriting files that exist there; you may opt to backup them first, just in case).
After that's done you still will need to update default system storage (cacerts
file) at the 2nd node with these newly copied certificates. The Certificate Page contains the details about available certificates and how to update certificates are detailed in the update-certificate page.
[Optional] Actions in case setup.properties.last method of installation didn't work for you
In this case jks keystores you'll be moving to the 2nd node will be protected by passwords hardcoded into different configuration files on the 1st node, which are different from the similar passwords hardcoded into the same files on the 2nd node.
Thus you MUST ensure that the 1st node will be the one that will initialize the 2nd node during first csync's run (i.e., that it will win any conflicts due to changes in files that csync may detect during its very first run), as otherwise different components won't be able to decrypt these keystores and will fail.
To achieve this you should run initial sync manualy after completing configuring it, but before you install cron jobs:
-
Comment out
auto younger;
string incsync2.cfg
on both nodes to disable autoresolution of conflicts -
Run
# csync2 -crvvv -N idp1.gluu.org /
on the 1st node -
Run
# csync2 -crvvv -N idp2.gluu.org /
on the 2nd node -
Previous commands did initial scan and filled metadata database. Now run
# csync2 -xrvvv -N idp1.gluu.org /
on the 1st node. That will try to sync files with the 2nd node, and most likely will fail to replicate all files due to some conflicts. -
You should be now in a state of conflict, as certain files in directories to be synced differ between nodes and tool can't decide which to prefer. Run this
# csync2 -frvvv -N idp1.gluu.org /
on the 1st node to mark its files that are still in dirty state as the ones that will win any conflict next time. -
Run
# csync2 -xrvvv -N idp1.gluu.org /
on the 1st node to complete your initial sync. Now all your 2nd node's directories covered by csync should be identical to the 1st node's. -
Uncomment
auto younger;
string and proceed to installing cron jobs


Namespace PlayGen.SUGAR.Contracts
Classes
AccountRequest
Encapsulates log-in details.
AccountResponse
Encapsulates user and token details at log-in.
AccountSourceRequest
Encapsulates log-in source details.
AccountSourceResponse
Encapsulates log-in source details.
ActorClaimRequest
Encapsulates actorclaim details.
ActorClaimResponse
Encapsulates actorclaim details from the server.
ActorRequest
Encapsulates user and group details.
ActorResponse
Encapsulates user and group details from the server.
ActorRoleRequest
Encapsulates actorrole details.
ActorRoleResponse
Encapsulates actorrole details from the server.
ClaimResponse
Encapsulates claim details.
EvaluationCreateRequest
Encapsulates achievement/skill details.
EvaluationCriteriaCreateRequest
Encapsulates requirements for completing an achievement or skill.
EvaluationCriteriaResponse
Encapsulates requirements for completing an achievement or skill.
EvaluationCriteriaUpdateRequest
Encapsulates requirements for completing an achievement or skill.
EvaluationDataRequest
Encapsulates ActorData/EvaluationData details.
EvaluationDataResponse
Encapsulates ActorData/EvaluationData details from the server.
EvaluationProgressResponse
Encapsulates current progress to completing an achievement.
EvaluationResponse
Encapsulates achievement/skill details returned from the server.
EvaluationUpdateRequest
Encapsulates achievement/skill details.
GameRequest
Encapsulates game details.
GameResponse
Encapsulates game details from the server.
GroupRequest
Encapsulates group details.
GroupResponse
Encapsulates group details from the server.
LeaderboardRequest
Encapsulates leaderboard details.
LeaderboardResponse
Encapsulates leaderboard details returned from the server.
LeaderboardStandingsRequest
Encapsulates leaderboard current standings request.
LeaderboardStandingsResponse
Encapsulates leaderboard standings details from the database.
MatchResponse
Encapsulates a match entity's details from the database.
RelationshipRequest
Encapsulates relationship details.
RelationshipResponse
Encapsulates relationship details from the server.
RelationshipStatusUpdate
Encapsulates relationship details, including updated status of the relationship.
ResourceAddRequest
Encapsulates Resource Data details.
ResourceResponse
Encapsulates resource details from the server.
ResourceTransferRequest
Encapsulates Resource Transfer details.
ResourceTransferResponse
Encapsulates Resource Transfer details from the server.
ResponseWrapper<TResponse>
RewardCreateRequest
Encapsulates the reward given for completing an achievement or skill.
RewardResponse
Encapsulates the reward given for completing an achievement or skill.
RewardUpdateRequest
Encapsulates the reward given for completing an achievement or skill.
RoleClaimRequest
Encapsulates roleclaim details.
RoleClaimResponse
Encapsulates roleclaim details from the server.
RoleRequest
Encapsulates role details.
RoleResponse
Encapsulates role details from the server.
TokenLoginRequest
UserRequest
Encapsulates user details.
UserResponse
Encapsulates user details from the server.


Politics
Let us find a way to compromise on this.
Picture
Name
Dina Badie
Rob Bosco
Lori Hartmann
Jaclyn Johnson
Ben Knoll
Chris Paskewich
Daniel Stroup
Return Home


- Unlimited draggable board is added. Click and hold right click and then drag through the board
- You can Download Whatever you Draw
- Lets Now begun!!
Sorry, this service is currently not optimized for mobile devices!
Kindly use Desktop or laptop.
Inconvenience is deeply regretted!


GoodNews
Welcome
What's Hot
Feature Story
Spotlight
Archives
Get Started
GENERAL
Great Works start with Rough Ideas and Crude Concepts
Fanny pack health goth marfa deep v. Cornhole poutine banh mi.
INTERIOR DESIGN
Make your Office a Place you Want to Work at
Fanny pack health goth marfa deep v. Cornhole poutine banh mi.
DESIGN
Long Exposure Photography at Night
Fanny pack health goth marfa deep v. Cornhole poutine banh mi.
TRAVEL
Top 25 Metropoles
to Visit
CITY GUIDE
Exploring Black Sea
Diving Spots
PHOTOGRAPHY
Botanical Gardens
Up Close
LIFETYLE
Building your Dream Home
GADGETS
The Latest Android Smart Watches compared
PHOTOGRAPHY
Welcome to the World of Macro
WHAT'S HOT
TRAVEL
Changing your Day Schedule in a Way that Frees up Time for Things you Want to do
Build Next-Gen Websites with Slider Revolution
Start Now
FEATURED STORY
WEB DESIGN
Striking Effects for your Website with this Popular Tool
Yes, we mean Slider Revolution. It‘s the begining of a new era of usable, interactive websites.
PHOTOGRAPHY
Eye Candy Paired with Great Usability
Letterpress bushwick 90's, sustainable kale chips portland lo-fi tattooed yuccie.
PHOTOGRAPHY
Disrupt Tryhard Tacos Kombucha Authentic Heirloom
Before they sold out selvage neutra synth plaid. Vexillologist pitchfork forage, schlitz iceland franzen jean shorts.
SPOTLIGHT
DATING
Dating in Big Cities
TRAVEL
The Marvellous Grand Canyon
TRAVEL
Art Exhibition in San Francisco
MUSIC
Rock 'n Roll in Main Arena
MISC
Interesting Skyscrapers
TRAVEL
Travel to Our Suggested Nature Retreats
TRAVEL
All-Inclusive Roundtrip in NYC
PHOTOGRAPHY
Macro Photography Highlights
ARCHIVES
Goodnews is a
Full Website Template for
Slider Revolution
All modules on this Website are 100% build with Slider Revolution.
Freely arrange & customize modules with our visual editor.
1-click easy template installation!
Get a License
About
Goodnews is essentially a set of modules that are build with Slider Revolution. The customizability and flexibility make it an absolute joy to use!
Things to do
Get Slider Revolution
Our Customer Benefits
Essential Grid
Useful Links
Documentation
FAQ Database
Video Tutorials
SHARE
TWEET
SHARE
SHARE


Daren Scot Wilson, http://www.darenscotwilson.com/
This purpose of this project is to display a 3D grid of points as a stereoscopic pair on an oscilloscope screen. With a pair of cheap lenses one will be able to view the points in 3D in a manner like an old fashioned sterescope but with modern electronics in place of photo prints. The device provides basic but believable perspective effects and allows a limited amount of rotation of the grid.
These 3D effects are produced entirely by analog electronics, using cheap and common parts likely to be in the possession of any moderately experienced electronics hobbyist.
A memory chip holds one bit for each grid point, so that it may be on or off, allowing for a crude form of drawing in three dimensions.
As shown, this device isn't of much practical use, but an enterprising student, 3D vision researcher, or mad scientist could find it an interesting start for an interesting project. Crazed art teachers handy with soldering irons might also find this fun. The right half of the schematic diagram that will be of interest; the left half as shown is just for initial experimenting. You will probably want to replace that left half with your own design.
Binary counters, 3 bits each, generate x,y,z values which are converted to analog by resistor networks. The outputs at the X and Y DACs show an eight-step staircase waveshape approximating a sawtooth wave. The Y staircase runs through one full cycle for each step of the X staircase. There is also a Z counter producing an even slower staircase wave, but we'll put that aside for now.
The x and y signals are sent to voltage-controlled amplifiers Q1 and Q2. The outputs of these are the main contribution to the main outputs to the scope. Transistor Q4 shorts out the Y output according to the contents of the RAM, which is driven by the X, Y and Z counters. Thus the bits in the memory control the presence or absence of each point of the 8x8x8 grid. If the rest of the ciruitry were removed, we'd be seeing an simple square 8x8 grid of green dots on the scope, with the ability to turn each one on or off with enough fumbling with the programming switches and buttons. Adding the Z circuitry will cause this 2D grid to be redrawn eight times, each time farther away. (or closer? I forget...)
The Z signal is used as the control voltage for the VCAs Q1 and Q2, applied by R1 and R7 from inverter Q3. The change in gains of Q1 and Q2 creates the appearance of shrinkage of the XY grid of points as Z increases. This is one important 3D effect - things getting smaller with distance. We are not trying for extreme closeup views or wild points of view; only a mild variation in gain is needed in this application. The potentiometers R13 and R14 mix a little bit of the Z signal, or its inverse provided by Q3, into the X and Y outputs. This causes the XY grids to slide in some direction as they shrink with increasing Z, producing a shearing effect. For small amounts, it fools the eye and looks like rotation.
The fourth bit of the Z counter is used as a left/right flip/flop. It flips state at the completion of each Z staircase cycle. The output is a square wave, added by resistor R17 to the horizontal output. This causes the separate left and right views of the grid to appear. So far, these two views would be identical. To create the stereoscopic 3D effect, these views must differ as if rotated (or sheared) a little. In the circuit, we need an effect like adding the Z or its inverse to the horizontal ouput, but we must have it differ between the left and right cases. The Z staircase signal will be repeating exactly the same in both cases.
We produce the desired perspective difference effect with a low-pass filter formed by R18, R19 and C5. When the L/R flip/flop goes high, the signal at other side of this LPF rises suddenly (due to R17) then slowly oozes up further as C5 charges. This oozing causes receeding XY planes in the right-hand view to shift rightward, which is the effect you'd expect when viewing the grid from a point of view displaced a bit to the right - as if from your right eye. The opposite occurs for the left-hand view. Together, this produces on the display a pair of grids as seen from either eye.
The original prototype was build on plug-in breadboard sockets using cheap commonly found parts any moderately experienced electronics experimenter is likely to have on hand. The 2102 RAM chip may be hard to find, since static RAM fell out of fashion long ago and now much larger amounts of memory are cheap and readily available. Feel free to substitute newer logic and RAM chips as you like.
 There are two places to be careful. The dot on/off switching transistor Q4 needs to switch cleanly; stray capacitance will lead to downward smearing of the displayed grid points. The other is where the L/R flip flop output feeds the horizontal output. Stray capacitance here will lead to a couple smeary streaks between the left and right versions of the grid. Even if stray capacitance can't be eliminated, the 3D effects should still be viewable.
While it may seem tempting to go for, say, a 1024x1024x1024 grid, this isn't a good idea due to the very wide range of frequencies involved from the very fast Y counter's least significant bits, to the L/R flip flop. It would be better to supply a series of X,Y,Z coordinates
Certain details of the digital portion are omitted, such as power, enable pins, etc. You are expected to know how to build circuitry with whatever logic family you choose - 74LS00, 4000-series CMOS or whatever. The 2102 RAM takes ten address lines, but only nine are used, so be sure to tie the tenth one to ground (or use it for crude two-frame animation).
Since the circuitry, as provided here, was only to demonstrate the concept and have a bit of fun, the design is not necessarily optimum. It merely works under good conditions. Various subcircuits are not well-isolated. For example the capacitor C4 at the collector of Q2 influences the workings of the waveshaping network of C5 and R17-19. Basic textbook circuit analysis probably won't work quite right.
The outputs X and Y expect a high impedance load, typical of all oscilloscopes since the 1970s. If you want to drive a display device with lower impedance, you'll want to add some sort of buffers.
The schematic was drawn using Postscript and Ruby. The file written to make this particular schematic, stereo888xy.rb, creates a Schematic class providing methods to draw diodes, resistors, lines etc between stated coordinates. Coordinates are kept in variables to allow arithmetic, making it easy to create equally space lines and adjust the positioning of parts in the schematic. Most of these coordinates are defined by the main vertical and horizontal lines determined from a hand-drawn schematic (from 1979, in this case) with further coordinates defined relative to these.
Schematic and its methods are defined in a separate Ruby file which may be used for drawing other schematics. It takes canned Postscript code from dswschem.ps to define the details of drawing part symbols. This Postscript code was lifted straight out of my "Pure Sine Wave Generator" project, with a few minor tweaks.
The PDF file was made with the ps2pdf command line utility.
Recommended electron geek toy store: SparkFun
I thank my high school electronics instructor, Mr. Scharmen, for arranging a three hour block of time and the gift of independent study. Electronics class for everyone was at most two hours, but I showed such aptitude for designing and fixing electronic gadgets that the school granted me extra time. Without that I wouldn't have developed the hands-on practice, theory and intuition that let me do so many other things in the future.


Help desk for Sabarimala pilgrims
The Hindu Religious & Charitable Endowments (HR &CE) Department has set up information centres, which will function round-the-clock, and a toll-free number for devotees of Lord Ayyappa undertaking pilgrimage to Sabarimala from Tamil Nadu,
The round-the-clock help desk has been set up at the HR & CE Commissioner’s office in Chennai. The toll free number 1800-425-1757 would function from November 16, 2019 to January 31, 2020, an official release stated. Information centres have also been set up at Arulmigu Gowmariamman temple at Veerapandi on Theni-Kumuli Road, the Arulmigu Kutralanathar temple at Kutralam and at the Arulmigu Thirumalaikumarasamy temple at Nerkalanjiyam, it stated.
Useful pointers for the benefit of devotees have been made public with important phone numbers in case of emergency. The official release also advised pilgrims against using plastic and discarding clothes at the Pamba river.


You are cordially invited to decorate your computer with images from our film. We think you'll like them.
Click on "Mac" or "Windows" to download a new pattern automatically.
|
Mac or Windows |
|
Mac or Windows |
|
|
Mac or Windows |
|
Mac or Windows |


Welcome to Lawrence Tech. I am a developer, who mainly concentrates on web applications such as video shareing sites. This website is some times used for my projects but this shouldnt interfear too much.


Iran says any figures on protest casualties 'speculative': official's tweet
DUBAI (Reuters) - Iran said on Wednesday that any figures on casualties during the country’s bloody protests over petrol price hikes were “speculative, not reliable” unless confirmed by Tehran, the country’s U.N. mission spokesman Alireza Miryousefi tweeted.
“The baseless allegations and fabricated figures by biased Western entities do not shake government’s determination in making prudent economic decisions while respecting human rights of its people including to freely exercise their right to protest in a peaceful environment,” he tweeted.
Amnesty International said on Tuesday at least 106 protesters in 21 cities had been killed in protests that have been sparked over increase of gasoline prices in Iran on Friday.


 If you've ever tried watching a movie with the sound off, you've probably noticed this.
Games are no exception! My fondest video game memories are of the music and sound effects.  The same catchiness applies to sound effects, such as the instantly recognizable unit click responses from Warcraft, and samples from Nintendo's classics.
Game audio presents some interesting challenges. To create convincing game music, designers need to adjust to potentially unpredictable game state a player finds themselves in. In practice, parts of the game can go on for an unknown duration, sounds can interact with the environment and mix in complex ways, such as room effects and relative sound positioning. Finally, there can be a large number of sounds playing at once, all of which need to sound good together and render without introducing performance penalties.
For simple games, using the <audio>
tag may be sufficient. However, many
browsers provide poor implementations, which result in audio glitches
and high latency. This is hopefully a temporary problem, since vendors
are working hard to improve their respective implementations. For a
glimpse into the state of the <audio>
tag, there is a nice test suite
at areweplayingyet.org.
Looking deeper into the <audio>
tag specification, however, it becomes
clear that there are many things that simply can't be done with it,
which isn't surprising, since it was designed for media playback. Some
limitations include:
In the rest of the article, I'll dive into some of these topics in the context of game audio written with the Web Audio API. For a brief introduction to this API, take a look at the getting started tutorial.
Games often have background music playing on a loop. For example, a background track like:
can get very annoying if your loop is short and predictable. If a player is stuck in an area or level, and the same sample continuously plays in the background, it may be worthwhile to gradually fade out the track to prevent further frustration. Another strategy is to have mixes of various intensity that gradually crossfade into one another, depending on the context of the game.
For example, if your player is in a zone with an epic boss battle, you might have several mixes varying in emotional range from atmospheric to foreshadowing to intense. Music synthesis software often allows you to export several mixes (of the same length) based on a piece by picking the set of tracks to use in the export. That way you have some internal consistency and avoid having jarring transitions as you cross-fade from one track to another.
Then, using the Web Audio API, you can import all of these samples using something like the BufferLoader class via XHR (this is covered in depth in the introductory Web Audio API article. Loading sounds takes time, so assets that are used in the game should be loaded on page load, at the start of the level, or perhaps incrementally while the player is playing.
Next, you create a source for each node, and a gain node for each source, and connect the graph as follows:
After doing this, you can play back all of these sources simultaneously on a loop, and since they are all the same length, the Web Audio API will guarantee that they will remain aligned. As the character gets nearer or further from the final boss battle, the game can vary the gain values for each of the respective nodes in the chain, using a gain amount algorithm like the following:
// Assume gains is an array of AudioGainNode, normVal is the intensity
// between 0 and 1.
var value = normVal * (gains.length - 1);
// First reset gains on all nodes.
for (var i = 0; i < gains.length; i++) {
gains[i].gain.value = 0;
}
// Decide which two nodes we are currently between, and do an equal
// power crossfade between them.
var leftNode = Math.floor(value);
// Normalize the value between 0 and 1.
var x = value - leftNode;
var gain1 = Math.cos(x * 0.5*Math.PI);
var gain2 = Math.cos((1.0 - x) * 0.5*Math.PI);
// Set the two gains accordingly.
gains[leftNode].gain.value = gain1;
// Check to make sure that there's a right node.
if (leftNode < gains.length - 1) {
// If there is, adjust its gain.
gains[leftNode + 1].gain.value = gain2;
}
In the above approach, two sources play at once, and we crossfade between them using equal power curves (as described in the intro). This strategy is used in the following sample, a demonstration of background music gradually ramping up in intensity based on a theme from Warcraft 2:
Many game developers today use the <audio>
tag for their background
music, because it is well suited to streaming content. Now you can bring
content from the <audio>
tag into a Web Audio context.
This technique can be useful since the <audio>
tag can work with
streaming content, which lets you immediately play the background music
instead of having to wait for it all to download. By bringing the stream
into the Web Audio API, you can manipulate or analyze the stream. The
following example applies a low pass filter to the music played through
the <audio>
tag:
var audioElement = document.querySelector('audio');
var mediaSourceNode = context.createMediaElementSource(audioElement);
// Create the filter
var filter = context.createBiquadFilter();
// Create the audio graph.
mediaSourceNode.connect(filter);
filter.connect(context.destination);
For a more complete discussion about integrating the <audio>
tag with the
Web Audio API, see this short article.
Games often play back sound effects in response to user input or changes in game state. Like background music, however, sound effects can get annoying very quickly. To avoid this, it's often useful to have a pool of similar but different sounds to play. This can vary from mild variations of footstep samples, to drastic variations, as seen in the Warcraft series in response to clicking on units.
Another key feature of sound effects in games is that there can be many of them simultaneously. Imagine you're in the middle of a gunfight with multiple actors shooting machine guns. Each machine gun fires many times per second, causing tens of sound effects to be played at the same time. Playing back sound from multiple, precisely timed sources simultaneously is one place the Web Audio API really shines.
The following example creates a machine gun round from multiple individual bullet samples by creating multiple sound sources whose playback is staggered in time.
var time = context.currentTime;
for (var i = 0; i < rounds; i++) {
var source = this.makeSource(this.buffers[M4A1]);
source.noteOn(time + i * interval);
}
Here's this code in action:
Sorry if that was a little loud! We'll talk about metering and dynamics compression in a later section.
Now, if all of the machine guns in your game sounded exactly like this, that would be pretty boring. Of course they would vary by sound based on distance from the target and relative position (more on this later), but even that might not be enough. Luckily the Web Audio API provides a way to easily tweak the example above in two ways:
These two effects are shown below:
For a more real-life example of these techniques in action, take a look at the Pool Table demo, which uses random sampling and varies playbackRate for a more interesting ball collision sound.
Games are often set in a world with some geometric properties, either in 2D or in 3D. If this is the case, stereo positioned audio can greatly increase the immersiveness of the experience. Luckily, Web Audio API comes with built-in hardware accelerated positional audio features that are quite straight forward to use. By the way, you should make sure that you've got stereo speakers (preferably headphones) for the following example to make sense. In the following sample, you can change the angle of the source by scrolling while the mouse is over the canvas.
In the above example, there is a listener (person icon) in the middle of the canvas, and the mouse affects the position of the source (speaker icon). The above is a simple example of using AudioPannerNode to achieve this sort of effect. The basic idea of the sample above is to respond to mouse movement by setting the position of the audio source, as follows:
PositionSample.prototype.changePosition = function(position) {
// Position coordinates are in normalized canvas coordinates
// with -0.5 < x, y < 0.5
if (position) {
if (!this.isPlaying) {
this.play();
}
var mul = 2;
var x = position.x / this.size.width;
var y = -position.y / this.size.height;
this.panner.setPosition(x * mul, y * mul, -0.5);
} else {
this.stop();
}
};
Things to know about Web Audio's treatment of spatialization:
The positional model is very powerful and quite advanced, largely based on OpenAL. For more details, see sections 3 and 4 of the above-linked spec.
There is a single AudioListener attached to the Web Audio API context which can be configured in space through position and orientation. Each source can be passed through an AudioPannerNode, which spatializes the input audio. The panner node has position and orientation, as well as a distance and directional model.
The distance model specifies the amount of gain depending on proximity to the source, while the directional model can be configured by specifying an inner and outer cone, which determine amount of (usually negative) gain if the listener is within the inner cone, between the inner and outer cone, or outside the outer cone.
var panner = context.createPanner();
panner.coneOuterGain = 0.5;
panner.coneOuterAngle = 180;
panner.coneInnerAngle = 0;
Though my example is in 2D, this model generalizes easily to the third dimension. For an example of sound spatialized in 3D, see this positional sample. In addition to position, the Web Audio sound model also optionally includes velocity for doppler shifts. This example shows the doppler effect in more detail.
For more information on this topic, read this detailed tutorial on mixing positional audio and WebGL.
In reality, the way sound is perceived greatly depends on the room in which that sound is heard. The same creaky door will sound very different in a basement, compared to an large open hall. Games with high production value will want to imitate these effects, since creating a separate set of samples for each environment is prohibitively expensive, and would lead to even more assets, and a larger amount of game data.
Loosely speaking, the audio term for the difference between the raw sound and the way it sounds in reality is the impulse response. These impulse responses can be painstakingly recorded, and in fact there are sites that host many of these pre-recorded impulse response files (stored as audio) for your convenience.
For a lot more information about how impulse responses can be created from a given environment, read through the "Recording Setup" section in the Convolution part of the Web Audio API spec.
More importantly for our purposes, the Web Audio API provides an easy way to apply these impulse responses to our sounds using the ConvolverNode.
// Make a source node for the sample.
var source = context.createBufferSource();
source.buffer = this.buffer;
// Make a convolver node for the impulse response.
var convolver = context.createConvolver();
convolver.buffer = this.impulseResponseBuffer;
// Connect the graph.
source.connect(convolver);
convolver.connect(context.destination);
The following example plays a military speech with a number of different impulse responses:
Telephone Muffler Spring feedback Crazy echo
Also see this demo of room effects on the Web Audio API spec page, as well as this example which gives you control over dry (raw) and wet (processed via convolver) mixing of a great Jazz standard.
 Great, but there's still one more thing to consider:
Since multiple sounds just stack on top of one another with no normalization, you may find yourself in a situation where you are exceeding the threshold of your speaker's capability. Like images exceeding past their canvas boundaries, sounds can also clip if the waveform exceeds its maximum threshold, producing a distinct distortion. The waveform looks something like this:
Here's a real example of clipping in action. The waveform looks bad:
And sounds bad:
It's important to listen to harsh distortions like the one above, or conversely, overly subdued mixes that force your listeners to crank up the volume. If you're in this situation, you really need to fix it!
From a technical perspective, clipping happens when the value of the signal in any channel exceeds the valid range, namely between -1 and 1. Once this is detected, it's useful to give visual feedback that this is happening. To do this reliably, put a JavaScriptAudioNode into your graph. The audio graph would be setup as follows:
// Assume entire sound output is being piped through the mix node.
var meter = context.createScriptProcessor(2048, 1, 1);
meter.onaudioprocess = processAudio;
mix.connect(meter);
meter.connect(context.destination);
And clipping could be detected in the following processAudio
handler:
function processAudio(e) {
var buffer = e.inputBuffer.getChannelData(0);
var isClipping = false;
// Iterate through buffer to check if any of the |values| exceeds 1.
for (var i = 0; i < buffer.length; i++) {
var absValue = Math.abs(buffer[i]);
if (absValue >= 1) {
isClipping = true;
break;
}
}
}
In general, be careful not to overuse the JavaScriptAudioNode
for
performance reasons. In this case, an alternative implementation of
metering could poll a RealtimeAnalyserNode
in the audio graph for
getByteFrequencyData
, at render time, as determined by
requestAnimationFrame
. This approach is more efficient, but misses
most of the signal (including places where it potentially clips), since
rendering happens at most at 60 times a second, whereas the audio signal
changes far more quickly.
Because clip detection is so important, it's likely that we will see a
built-in MeterNode
Web Audio API node in the future.
By adjusting the gain on the master AudioGainNode, you can subdue your mix to a level that prevents clipping. However, in practice, since the sounds playing in your game may depend on a huge variety of factors, it can be difficult to decide on the master gain value that prevents clipping for all states. In general, you should tweak gains to anticipate the worst case, but this is more of an art than a science.
To get a sense of how this works in practice, below is a sample where you can adjust master gain. If you set the gain too high, the sound will clip. The monitor will turn red to give a visual indicator of clipping. The soundscape below is a remix of a great Chrono Trigger track written by Yasunori Mitsuda and remixed by Disco Dan.
Master gain: Meter level:
Compressors are commonly used in music and game production to smooth
over the signal and control spikes in the overall signal. This
functionality is available in the Web Audio world via the
DynamicsCompressorNode
, which can be inserted in your audio graph to
give a louder, richer and fuller sound, and also help with clipping.
Directly quoting the spec, this node
...lowers the volume of the loudest parts of the signal and raises the volume of the softest parts... It is especially important in games and musical applications where large numbers of individual sounds are played simultaneous to control the overall signal level and help avoid clipping.
Using dynamics compression is generally a good idea, especially in a game setting, where, as previously discussed, you don't know exactly what sounds will play and when. Plink from DinahMoe labs is a great example of this, since the sounds that are played back completely depends on you and other participants. A compressor is useful in most cases, except some rare ones, where you're dealing with painstakingly mastered tracks that have been tuned to sound "just right" already.
Implementing this is simply a matter of including a DynamicsCompressorNode in your audio graph, generally as the last node before the destination.:
// Assume the output is all going through the mix node.
var compressor = context.createDynamicsCompressor();
mix.connect(compressor);
compressor.connect(context.destination);
For more detail about dynamics compression, this Wikipedia article is very informative.
To summarize, listen carefully for clipping and prevent it by inserting a master gain node. Then tightening the whole mix by using a dynamics compressor node. Your audio graph might look something like this:
That covers what I think are the most important aspects of game audio development using the Web Audio API. With these techniques, you can build truly compelling audio experiences right in your browser. Before I sign off, let me leave you with a browser-specific tip: be sure to pause sound if your tab goes to the background using the page visibility API, otherwise you will create a potentially frustrating experience for your user.
For additional information about Web Audio, take a look at the more introductory getting started article, and if you have a question, see if it's already answered in the web audio FAQ. Finally, if you have additional questions, ask them on Stack Overflow using the web-audio tag.