| newDate(year, month, day) |
CDate |
Create a new date object within this calendar. You can also create
dates directly
or from another date.
An error is thrown if the requested date is not valid.
year (CDate) is a date to clone or
(number) is the year for the new date.
month (number, optional) is the month for the date.
day (number, optional) is the day for the date.
var d = gc.newDate(2009, 1, 26);
var d2 = gc.newDate(d);
var d = pc.newDate(1388, 1, 1);
|
| today() |
CDate |
Create a new date object representing today within this calendar.
var d = gc.today();
|
| leapYear(year) |
boolean |
Determine whether or not this date is in a leap year. It returns
true if it is, or false if it is not.
You can also determine a leap year from the
date itself.
year (CDate) is a date to get the year from or
(number) is the year to examine.
if (gc.leapYear(d)) ...
if (hc.leapYear(5768)) ...
|
| epoch(year) |
string |
Retrieve the epoch designator for this date. For the Gregorian calendar
this is 'BCE' for negative years or 'CE' for positive years.
You can also find the epoch from the
date itself.
year (CDate) is a date to get the year from or
(number) is the year to examine.
var e = gc.epoch(d);
var e = pc.epoch(1388);
|
| formatYear(year) |
string |
Retrieve the formatted year for this date. Typically this is
the same as the normal year, padded to four digits.
For the Mayan calendar it is the long count year in the
format: baktun.katun.tun.
You can also find the formatted year from the
date itself.
year (CDate) is a date to get the year from or
(number) is the year to examine.
var fy = gc.formatYear(d);
var fy = mc.newDate(5160);
|
| monthsInYear(year) |
number |
Retrieve the number of months in a given year for this calendar.
year (CDate) is a date to get the year from or
(number) is the year to examine.
var m = gc.monthsInYear(d);
var m = hc.monthsInYear(5768); // = 13
|
| monthOfYear(year, month) |
number |
Retrieve the ordinal month number for a given month, i.e. the number of
the month within a numbered year as opposed to its number within the
list of months. This is only different in the Hebrew calendar
where the year numbering changes on month 7.
You can also find the month of the year from the
date itself.
The inverse function is fromMonthOfYear.
year (CDate) is a date to get the month from or
(number) is the year to exmaine.
month (number, optional) is the month to examine.
var moy = gc.monthOfYear(d);
var moy = hc.monthOfYear(5768, 7); // = 1
|
| fromMonthOfYear(year, ord) |
number |
Retrieve the month for a given ordinal month number, i.e. the number of
the month within the list of months as opposed to its number within
a numbered year. This is only different in the Hebrew calendar
where the year numbering changes on month 7. The inverse function is
monthOfYear.
year (number) is the year to exmaine.
ord (number) is the ordinal month number.
var m = gc.fromMonthOfYear(y, o);
|
| weekOfYear(year, month, day) |
number |
Retrieve the number of the week within the year in which a date
is located. By default this uses the ISO 8601 definition of a week:
weeks start on Monday, the first week of the year contains the first
Thursday of the year. This means that some dates at the start and end
of some years will appear in weeks from other years.
An error is thrown if the date is not valid for the calendar.
You can also find the week of the year from the
date itself.
year (CDate) is the date to examine or
(number) is the year to examine.
month (number, optional) is the month to examine.
day (number, optional) is the day to examine.
var woy = gc.weekOfYear(d);
var woy = pc.weekOfYear(1388, 1, 1);
|
| daysInYear(year) |
number |
Retrieve the number of days in a given year.
You can also find the day in a year from the
date itself.
year (CDate) is a date to get the year from or
(number) is the year to examine.
var diy = gc.daysInYear(d);
var diy = hc.daysInYear(5768);
|
| dayOfYear(year, month, day) |
number |
Retrieve the number of the given day within its year.
An error is thrown if the date is not valid for the calendar.
You can also find the day of the year from the
date itself.
year (CDate) is a date to examine or
(number) is the year to examine.
month (number, optional) is the month to examine.
day (number, optional) is the day to examine.
var doy = gc.dayOfYear(d);
var doy = pc.dayOfYear(1388, 1, 1);
|
| daysInMonth(year, month) |
number |
Retrieve the number of days in a given month.
An error is thrown if the year or month is invalid.
You can also find the days in a month from the
date itself.
year (CDate) is a date to get the month and
year from or (number) is the year to examine.
month (number, optional) is the month to examine.
var dim = gc.daysInMonth(d);
var dim = pc.daysInMonth(1388, 12);
|
| daysInWeek() |
number |
Retrieve the number of days in a week.
var diw = gc.daysInWeek();
|
| dayOfWeek(year, month, day) |
number |
Retrieve the number of the given day within its week.
An error is thrown if the date is not valid for the calendar.
You can also find the day of the week from the
date itself.
year (CDate) is a date to examine or
(number) is the year to examine.
month (number, optional) is the month to examine.
day (number, optional) is the day to examine.
var dow = gc.dayOfWeek(d);
var dow = pc.dayOfWeek(1388, 1, 1);
|
| weekDay(year, month, day) |
boolean |
Determine whether or not this date is a normal week day.
It returns true if it is (Monday through Friday in the
Gregorian calendar), or false if it is not.
You can also determine a week day from the
date itself.
year (CDate) is a date to examine or
(number) is the year to examine.
month (number, optional) is the month to examine.
day (number, optional) is the day to examine.
if (gc.weekDay(d)) ...
if (pc.weekDay(1388, 1, 1)) ...
|
| object |
Retrieve extra information about this date - the returned
object's attributes depend on the calendar implementation.
For example, the Mayan calendar returns the corresponding
Tzolkin and Haab dates.
An error is thrown if the date is not valid for the calendar.
You can also find extra information from the
date itself.
year (CDate) is a date to examine or
(number) is the year to examine.
month (number, optional) is the month to examine.
day (number, optional) is the day to examine.
var ei = hc.extraInfo(d);
var ei = mc.extraInfo(5160, 1, 1);
alert(ei.tzolkinDayName);
|
| add(date, offset, period) |
CDate |
Add a number of periods to a date and return the modified date.
If changing by month or year and the new month has fewer days,
the day is adjusted to the end of that new month.
You can also add periods to the
date itself.
date (CDate)the day to modify.
offset (number) is the amount of change; it may be negative.
period (string) is the unit of change: 'y' for years,
'm' for months, 'w' for weeks, 'd' for days.
gc.add(d, 1, 'w');
gc.add(d, 18, 'm');
|
| set(date, value, period) |
CDate |
Set a period for a date.
An error is thrown if the date is not valid for the calendar.
You can also set periods for the
date itself.
date (CDate)the day to modify.
value (number) is the new period value.
period (string) is the period designator:
'y' for year, 'm' for month, 'd' for day.
gc.set(d, 2010, 'y');
pc.set(d, 1, 'm');
|
| isValid(year, month, day) |
boolean |
Determine whether or not a given date is valid within this calendar.
It returns true if valid, or false if not.
year (number) is the year to examine.
month (number) is the month to examine.
day (number) is the day to examine.
if (gc.isValid(2009, 1, 26)) ... // true
if (gc.isValid(2009, 2, 29)) ... // false
|
| toJD(year, month, day) |
number |
Convert a date into its Julian date equivalent. This is the
number of days since 1 January, 4713 BCE, Greenwich noon.
An error is thrown if the date is not valid for the calendar.
You can also convert to a Julian date from the
date itself.
year (CDate) is a date to convert or
(number) is the year to convert.
month (number, optional) is the month to convert.
day (number, optional) is the day to convert.
var jd = gc.toJD(d);
var jd = pc.toJD(1388, 1, 1);
|
| fromJD(jd) |
CDate |
Create a new date for a given Julian date.
You can also convert from a Julian date from another
date.
jd (number) is the Julian date to convert.
Typically it would end in .5, e.g. 2454857.5.
var d = gc.fromJD(jd);
|
| toJSDate(year, month, day) |
Date |
Convert this date into the equivalent JavaScript Date.
An error is thrown if the date is not valid for the calendar.
You can also convert to a JavaScript Date from the
date itself.
year (CDate) is a date to convert or
(number) is the year to convert.
month (number, optional) is the month to convert.
day (number, optional) is the day to convert.
var jsd = gc.toJSDate(d);
var jsd = pc.toJSDate(1388, 1, 1);
|
| fromJSDate(jsd) |
CDate |
Convert a JavaScript Date into the equivalent CDate.
You can also convert from a JavaScript Date from another
date.
jsd (Date) is the JavaScript date to convert.
var d = gc.fromJSDate(jsd);
var d = pc.fromJSDate(new Date(2009, 1 - 1, 26));
|


Want to consider switching degrees? Already completed a degree and want to pick up a second one?
Kevin Bacon uses the groscanot API to identify degrees with at least one overlapping course with the degree selected. Degrees are sorted by the number of extra courses needed to get the degree.
Courses that would fall into the 'extra' data field are not shown so there maybe additional courses you needed.
This is not endorsed by uOttawa.


The SKY UX tutorials get you up and running with SKY UX. They demonstrate how to create and serve single-page applications, how to create and edit pages and components, how to run tests, and how to host projects.
The first step to set up your machine for SKY UX is to make sure you have the following prerequisites in place:
Node.js version 6+ — To check your version, run
NPM version 3+ — NPM is the default JavaScript package manager for Node.js. As of Node.js version 0.6.3, it is bundled and installed automatically with the environment. We recommend version 3+ for its flat dependency structure. To check your version, run
Git — To confirm that you have Git in place, run


US
EU
No ads! Tracker free! Poorly written by some guy on the internet!
Let me know if anything is wrong. Contact info is in the footer.
↓
No ads! Tracker free! Poorly written by some guy on the internet!
Let me know if anything is wrong. Contact info is in the footer.


- getAircraft() - Method in class com.toldcalculator.android.tc.model.pojo.AircraftAndData
-
- getAircraft() - Method in class com.toldcalculator.android.tc.model.pojo.UserInfo
-
- getAircraftDao() - Method in class com.toldcalculator.android.tc.model.db.ToldData
-
- getAircraftId() - Method in class com.toldcalculator.android.tc.model.entity.TakeoffData
-
Returns the aircraftId associated with the takeoff data.
- getAircraftId() - Method in class com.toldcalculator.android.tc.model.entity.TakeoffPowerN1
-
Returns the aircraftId associated with the takeoff data.
- getAircraftId() - Method in class com.toldcalculator.android.tc.model.entity.User
-
Returns the aircraftId associated with the user profile.
- getAircraftName() - Method in class com.toldcalculator.android.tc.model.entity.SavedTakeoffData
-
Returns the aircraft profile name.
- getAircraftType() - Method in class com.toldcalculator.android.tc.model.entity.Aircraft
-
Returns the aircraft type set by the user.
- getAirport() - Method in class com.toldcalculator.android.tc.model.pojo.AirportAndRunways
-
- getAirport() - Method in class com.toldcalculator.android.tc.model.pojo.UserInfo
-
- getAirportDao() - Method in class com.toldcalculator.android.tc.model.db.ToldData
-
- getAirportId() - Method in class com.toldcalculator.android.tc.model.entity.Runway
-
Returns the airport id associated with the runway.
- getAirportId() - Method in class com.toldcalculator.android.tc.model.entity.SavedTakeoffData
-
Returns the airport id associated with the saved data.
- getAirportId() - Method in class com.toldcalculator.android.tc.model.entity.User
-
Returns the airportId associated with the user profile.
- getAirportId() - Method in class com.toldcalculator.android.tc.model.entity.Weather
-
Returns the airportId associated with the weather.
- getAltimeterInHg() - Method in class com.toldcalculator.android.tc.model.Metar
-
Returns the observed altimeter setting in inches of mercury.
- getAltitude() - Method in class com.toldcalculator.android.tc.model.entity.TakeoffData
-
Returns the altitude in feet.
- getAltitude() - Method in class com.toldcalculator.android.tc.model.entity.TakeoffPowerN1
-
Returns the altitude in feet.
- getBasicEmptyWeight() - Method in class com.toldcalculator.android.tc.model.entity.Aircraft
-
Return the aircraft basic empty weight set by the user.
- getCloudBase() - Method in class com.toldcalculator.android.tc.model.SkyCondition
-
Returns a string containing cloud base information.
- getClouds() - Method in class com.toldcalculator.android.tc.model.entity.Weather
-
Returns sky coverage information.
- getData() - Method in class com.toldcalculator.android.tc.model.MetarResponse
-
Returns a list of metars that was received as a response to the request.
- getDateTime(Long) - Static method in class com.toldcalculator.android.tc.model.db.ToldData.DateTimeConverter
-
- getDewpoint() - Method in class com.toldcalculator.android.tc.model.entity.Weather
-
Returns the dewpoint in celsius.
- getDewpointC() - Method in class com.toldcalculator.android.tc.model.Metar
-
Returns the dewpoint in celsius.
- getElevation() - Method in class com.toldcalculator.android.tc.model.entity.Airport
-
Returns the elevation of the airport in feet.
- getElevationMeters() - Method in class com.toldcalculator.android.tc.model.Metar
-
Returns the station elevation in meters.
- getFlightCategory() - Method in class com.toldcalculator.android.tc.model.Metar
-
Returns observed flight category.
- getIcaoId() - Method in class com.toldcalculator.android.tc.model.entity.Airport
-
Returns the ICAO identifier of the airport.
- getId() - Method in class com.toldcalculator.android.tc.model.entity.Aircraft
-
Return the id of an aircraft entry.
- getId() - Method in class com.toldcalculator.android.tc.model.entity.Airport
-
Returns the id to the airport table entry.
- getId() - Method in class com.toldcalculator.android.tc.model.entity.Runway
-
Returns the id of Runway table entry.
- getId() - Method in class com.toldcalculator.android.tc.model.entity.SavedTakeoffData
-
Returns the id for the savedTakeoffData table entry.
- getId() - Method in class com.toldcalculator.android.tc.model.entity.TakeoffData
-
Returns the id of the TakeoffData table entry.
- getId() - Method in class com.toldcalculator.android.tc.model.entity.TakeoffPowerN1
-
Returns the id of the TakeoffPowerN1 table entry.
- getId() - Method in class com.toldcalculator.android.tc.model.entity.User
-
Returns the id of the user table entry.
- getId() - Method in class com.toldcalculator.android.tc.model.entity.Weather
-
Returns the id of the weather table entry.
- getIdent() - Method in class com.toldcalculator.android.tc.model.entity.Airport
-
Returns the identifier of the airport.
- getInstance(Context) - Static method in class com.toldcalculator.android.tc.model.db.ToldData
-
This static method is used to get a instance of the database, ToldData.
- getLatitude() - Method in class com.toldcalculator.android.tc.model.Metar
-
Returns the stations latitude.
- getLength() - Method in class com.toldcalculator.android.tc.model.entity.Runway
-
Returns the length of the runway in feet.
- getLongitude() - Method in class com.toldcalculator.android.tc.model.Metar
-
Returns the stations longitude.
- getMetarType() - Method in class com.toldcalculator.android.tc.model.Metar
-
Returns type of metar.
- getName() - Method in class com.toldcalculator.android.tc.model.entity.Aircraft
-
Returns the aircraft profile name.
- getName() - Method in class com.toldcalculator.android.tc.model.entity.Airport
-
Returns the name of the airport.
- getName() - Method in class com.toldcalculator.android.tc.model.entity.User
-
Returns the profile user name.
- getObservationTime() - Method in class com.toldcalculator.android.tc.model.Metar
-
Returns a string containing the time of observation.
- getPressure() - Method in class com.toldcalculator.android.tc.model.entity.Weather
-
Returns the observed altimeter setting in inches of mercury.
- getQualityControlFlags() - Method in class com.toldcalculator.android.tc.model.Metar
-
Returns quality control flags.
- getRawText() - Method in class com.toldcalculator.android.tc.model.entity.Weather
-
Returns a string containing all the METAR information.
- getRawText() - Method in class com.toldcalculator.android.tc.model.Metar
-
Returns a string containing all the METAR information.
- getRunway() - Method in class com.toldcalculator.android.tc.model.pojo.AirportAndRunways
-
- getRunwayDao() - Method in class com.toldcalculator.android.tc.model.db.ToldData
-
- getRunwayId() - Method in class com.toldcalculator.android.tc.model.entity.Runway
-
Returns the runway identifier.
- getRunwayRequired() - Method in class com.toldcalculator.android.tc.model.entity.SavedTakeoffData
-
Returns the required runway in feet.
- getSavedTakeoffDataDao() - Method in class com.toldcalculator.android.tc.model.db.ToldData
-
- getSeaLevelPressureMb() - Method in class com.toldcalculator.android.tc.model.Metar
-
Returns the observed sea level pressure in millibars.
- getSkyCondition() - Method in class com.toldcalculator.android.tc.model.Metar
-
Returns list of sky conditions at different altitudes, if any.
- getSkyCover() - Method in class com.toldcalculator.android.tc.model.SkyCondition
-
Returns a string containing sky coverage information.
- getStationId() - Method in class com.toldcalculator.android.tc.model.Metar
-
Returns the station identifier.
- getTakeoffData() - Method in class com.toldcalculator.android.tc.model.pojo.AircraftAndData
-
- getTakeoffDataDao() - Method in class com.toldcalculator.android.tc.model.db.ToldData
-
- getTakeoffDistance() - Method in class com.toldcalculator.android.tc.controller.helpers.PerformanceCalculations
-
Getter that returns the calculated takeoff distance as a string.
- getTakeoffDistance() - Method in class com.toldcalculator.android.tc.model.entity.TakeoffData
-
Returns the required takeoff distance in feet.
- getTakeoffN1() - Method in class com.toldcalculator.android.tc.model.entity.SavedTakeoffData
-
Returns the takeoff power N1 setting.
- getTakeoffPowerN1() - Method in class com.toldcalculator.android.tc.controller.helpers.PerformanceCalculations
-
Getter that returns the calculated takeoff power N1 setting as a string.
- getTakeoffPowerN1() - Method in class com.toldcalculator.android.tc.model.entity.TakeoffPowerN1
-
Returns the takeoff power N1 setting.
- getTakeoffPowerN1() - Method in class com.toldcalculator.android.tc.model.pojo.AircraftAndData
-
- getTakeoffPowerN1Dao() - Method in class com.toldcalculator.android.tc.model.db.ToldData
-
- getTakeoffSpeedV1() - Method in class com.toldcalculator.android.tc.controller.helpers.PerformanceCalculations
-
Getter that returns the calculated takeoff speed V1 as a string.
- getTakeoffSpeedV1() - Method in class com.toldcalculator.android.tc.model.entity.TakeoffData
-
Returns the takeoff speed V1 in knots.
- getTakeoffSpeedV2() - Method in class com.toldcalculator.android.tc.controller.helpers.PerformanceCalculations
-
Getter that returns the calculated takeoff speed V2 as a string.
- getTakeoffSpeedV2() - Method in class com.toldcalculator.android.tc.model.entity.TakeoffData
-
Returns the takeoff speed V2 in knots.
- getTakeoffSpeedVR() - Method in class com.toldcalculator.android.tc.controller.helpers.PerformanceCalculations
-
Getter that returns the calculated takeoff speed VR as a string.
- getTakeoffSpeedVR() - Method in class com.toldcalculator.android.tc.model.entity.TakeoffData
-
Returns the takeoff speed VR in knots.
- getTakeoffV1() - Method in class com.toldcalculator.android.tc.model.entity.SavedTakeoffData
-
Returns the takeoff speed V1 in knots.
- getTakeoffV2() - Method in class com.toldcalculator.android.tc.model.entity.SavedTakeoffData
-
Returns the takeoff speed V2 in knots.
- getTakeoffVR() - Method in class com.toldcalculator.android.tc.model.entity.SavedTakeoffData
-
Returns the takeoff speed VR in knots.
- getTakeoffWeight() - Method in class com.toldcalculator.android.tc.model.entity.SavedTakeoffData
-
Returns the aircraft takeoff weight in pounds.
- getTempC() - Method in class com.toldcalculator.android.tc.model.Metar
-
Returns the temperature in celsius.
- getTemperature() - Method in class com.toldcalculator.android.tc.model.entity.TakeoffData
-
Returns the temperature in celsius.
- getTemperature() - Method in class com.toldcalculator.android.tc.model.entity.TakeoffPowerN1
-
Returns the temperature in celsius.
- getTemperature() - Method in class com.toldcalculator.android.tc.model.entity.Weather
-
Returns the temperature in celsius.
- getTimestamp() - Method in class com.toldcalculator.android.tc.model.entity.SavedTakeoffData
-
Returns the date and time that the data was saved.
- getTimestamp() - Method in class com.toldcalculator.android.tc.model.entity.Weather
-
Returns the date and time that the data was saved.
- getUser() - Method in class com.toldcalculator.android.tc.model.pojo.UserInfo
-
- getUserDao() - Method in class com.toldcalculator.android.tc.model.db.ToldData
-
- getUserId() - Method in class com.toldcalculator.android.tc.model.entity.SavedTakeoffData
-
Returns the userId associated with the saved data.
- getVisibility() - Method in class com.toldcalculator.android.tc.model.entity.Weather
-
Returns the observed visibility in statute miles.
- getVisibilityStatuteMile() - Method in class com.toldcalculator.android.tc.model.Metar
-
Returns the observed visibility in statute miles.
- getWeatherDao() - Method in class com.toldcalculator.android.tc.model.db.ToldData
-
- getWeatherRawText() - Method in class com.toldcalculator.android.tc.model.entity.SavedTakeoffData
-
Returns a string of the raw METAR text.
- getWeatherType() - Method in class com.toldcalculator.android.tc.model.entity.Weather
-
Returns the current type of weather observed.
- getWeight() - Method in class com.toldcalculator.android.tc.model.entity.TakeoffData
-
Returns the weight in pounds.
- getWidth() - Method in class com.toldcalculator.android.tc.model.entity.Runway
-
Returns the width of the runway in feet.
- getWindDirectionDegrees() - Method in class com.toldcalculator.android.tc.model.Metar
-
Returns the observed wind direction in degrees.
- getWinds() - Method in class com.toldcalculator.android.tc.model.entity.Weather
-
Returns the observed wind direction in degrees and speed in knots.
- getWindSpeedKt() - Method in class com.toldcalculator.android.tc.model.Metar
-
Returns the wind speed in knots.


EVP_MD_CTX_new, EVP_MD_CTX_reset, EVP_MD_CTX_free, EVP_MD_CTX_copy_ex, EVP_MD_CTX_ctrl, EVP_MD_CTX_set_flags, EVP_MD_CTX_clear_flags, EVP_MD_CTX_test_flags, EVP_DigestInit_ex, EVP_DigestInit, EVP_DigestUpdate, EVP_DigestFinal_ex, EVP_DigestFinalXOF, EVP_DigestFinal, EVP_MD_CTX_copy, EVP_MD_type, EVP_MD_pkey_type, EVP_MD_size, EVP_MD_block_size, EVP_MD_CTX_md, EVP_MD_CTX_size, EVP_MD_CTX_block_size, EVP_MD_CTX_type, EVP_MD_CTX_md_data, EVP_md_null, EVP_get_digestbyname, EVP_get_digestbynid, EVP_get_digestbyobj, EVP_MD_CTX_set_pkey_ctx - EVP digest routines
#include <openssl/evp.h>
EVP_MD_CTX *EVP_MD_CTX_new(void);
int EVP_MD_CTX_reset(EVP_MD_CTX *ctx);
void EVP_MD_CTX_free(EVP_MD_CTX *ctx);
void EVP_MD_CTX_ctrl(EVP_MD_CTX *ctx, int cmd, int p1, void* p2);
void EVP_MD_CTX_set_flags(EVP_MD_CTX *ctx, int flags);
void EVP_MD_CTX_clear_flags(EVP_MD_CTX *ctx, int flags);
int EVP_MD_CTX_test_flags(const EVP_MD_CTX *ctx, int flags);
int EVP_DigestInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, ENGINE *impl);
int EVP_DigestUpdate(EVP_MD_CTX *ctx, const void *d, size_t cnt);
int EVP_DigestFinal_ex(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *s);
int EVP_DigestFinalXOF(EVP_MD_CTX *ctx, unsigned char *md, size_t len);
int EVP_MD_CTX_copy_ex(EVP_MD_CTX *out, const EVP_MD_CTX *in);
int EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type);
int EVP_DigestFinal(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *s);
int EVP_MD_CTX_copy(EVP_MD_CTX *out, EVP_MD_CTX *in);
int EVP_MD_type(const EVP_MD *md);
int EVP_MD_pkey_type(const EVP_MD *md);
int EVP_MD_size(const EVP_MD *md);
int EVP_MD_block_size(const EVP_MD *md);
const EVP_MD *EVP_MD_CTX_md(const EVP_MD_CTX *ctx);
int EVP_MD_CTX_size(const EVP_MD *ctx);
int EVP_MD_CTX_block_size(const EVP_MD *ctx);
int EVP_MD_CTX_type(const EVP_MD *ctx);
void *EVP_MD_CTX_md_data(const EVP_MD_CTX *ctx);
const EVP_MD *EVP_md_null(void);
const EVP_MD *EVP_get_digestbyname(const char *name);
const EVP_MD *EVP_get_digestbynid(int type);
const EVP_MD *EVP_get_digestbyobj(const ASN1_OBJECT *o);
void EVP_MD_CTX_set_pkey_ctx(EVP_MD_CTX *ctx, EVP_PKEY_CTX *pctx);
The EVP digest routines are a high level interface to message digests, and should be used instead of the cipher-specific functions.
Allocates and returns a digest context.
Resets the digest context ctx. This can be used to reuse an already existing context.
Cleans up digest context ctx and frees up the space allocated to it.
Performs digest-specific control actions on context ctx.
Sets, clears and tests ctx flags. See "FLAGS" below for more information.
Sets up digest context ctx to use a digest type from ENGINE impl. type will typically be supplied by a function such as EVP_sha1(). If impl is NULL then the default implementation of digest type is used.
Hashes cnt bytes of data at d into the digest context ctx. This function can be called several times on the same ctx to hash additional data.
Retrieves the digest value from ctx and places it in md. If the s parameter is not NULL then the number of bytes of data written (i.e. the length of the digest) will be written to the integer at s, at most EVP_MAX_MD_SIZE bytes will be written. After calling EVP_DigestFinal_ex() no additional calls to EVP_DigestUpdate() can be made, but EVP_DigestInit_ex() can be called to initialize a new digest operation.
Interfaces to extendable-output functions, XOFs, such as SHAKE128 and SHAKE256. It retrieves the digest value from ctx and places it in len-sized <B>md. After calling this function no additional calls to EVP_DigestUpdate() can be made, but EVP_DigestInit_ex() can be called to initialize a new operation.
Can be used to copy the message digest state from in to out. This is useful if large amounts of data are to be hashed which only differ in the last few bytes.
Behaves in the same way as EVP_DigestInit_ex() except it always uses the default digest implementation.
Similar to EVP_DigestFinal_ex() except the digest context ctx is automatically cleaned up.
Similar to EVP_MD_CTX_copy_ex() except the destination out does not have to be initialized.
Return the size of the message digest when passed an EVP_MD or an EVP_MD_CTX structure, i.e. the size of the hash.
Return the block size of the message digest when passed an EVP_MD or an EVP_MD_CTX structure.
Return the NID of the OBJECT IDENTIFIER representing the given message digest when passed an EVP_MD structure. For example, EVP_MD_type(EVP_sha1())
returns NID_sha1. This function is normally used when setting ASN1 OIDs.
Return the digest method private data for the passed EVP_MD_CTX. The space is allocated by OpenSSL and has the size originally set with EVP_MD_meth_set_app_datasize().
Returns the EVP_MD structure corresponding to the passed EVP_MD_CTX.
Returns the NID of the public key signing algorithm associated with this digest. For example EVP_sha1() is associated with RSA so this will return NID_sha1WithRSAEncryption. Since digests and signature algorithms are no longer linked this function is only retained for compatibility reasons.
A "null" message digest that does nothing: i.e. the hash it returns is of zero length.
Returns an EVP_MD structure when passed a digest name, a digest NID or an ASN1_OBJECT structure respectively.
Assigns an EVP_PKEY_CTX to EVP_MD_CTX. This is usually used to provide a customzied EVP_PKEY_CTX to EVP_DigestSignInit(3) or EVP_DigestVerifyInit(3). The pctx passed to this function should be freed by the caller. A NULL pctx pointer is also allowed to clear the EVP_PKEY_CTX assigned to ctx. In such case, freeing the cleared EVP_PKEY_CTX or not depends on how the EVP_PKEY_CTX is created.
EVP_MD_CTX_set_flags(), EVP_MD_CTX_clear_flags() and EVP_MD_CTX_test_flags() can be used the manipulate and test these EVP_MD_CTX flags:
This flag instructs the digest to optimize for one update only, if possible.
This flag instructs EVP_DigestInit() and similar not to initialise the implementation specific data.
Some functions such as EVP_DigestSign only finalise copies of internal contexts so additional data can be included after the finalisation call. This is inefficient if this functionality is not required, and can be disabled with this flag.
Returns 1 for success and 0 for failure.
Returns 1 if successful or 0 for failure.
Returns 1 if successful or 0 for failure.
Returns the NID of the corresponding OBJECT IDENTIFIER or NID_undef if none exists.
Returns the digest or block size in bytes.
Returns a pointer to the EVP_MD structure of the "null" message digest.
Returns either an EVP_MD structure or NULL if an error occurs.
This function has no return value.
The EVP interface to message digests should almost always be used in preference to the low level interfaces. This is because the code then becomes transparent to the digest used and much more flexible.
New applications should use the SHA-2 (such as EVP_sha256(3)) or the SHA-3 digest algorithms (such as EVP_sha3_512(3)). The other digest algorithms are still in common use.
For most applications the impl parameter to EVP_DigestInit_ex() will be set to NULL to use the default digest implementation.
The functions EVP_DigestInit(), EVP_DigestFinal() and EVP_MD_CTX_copy() are obsolete but are retained to maintain compatibility with existing code. New applications should use EVP_DigestInit_ex(), EVP_DigestFinal_ex() and EVP_MD_CTX_copy_ex() because they can efficiently reuse a digest context instead of initializing and cleaning it up on each call and allow non default implementations of digests to be specified.
If digest contexts are not cleaned up after use, memory leaks will occur.
EVP_MD_CTX_size(), EVP_MD_CTX_block_size(), EVP_MD_CTX_type(), EVP_get_digestbynid() and EVP_get_digestbyobj() are defined as macros.
EVP_MD_CTX_ctrl() sends commands to message digests for additional configuration or control.
This example digests the data "Test Message\n" and "Hello World\n", using the digest name passed on the command line.
#include <stdio.h>
#include <string.h>
#include <openssl/evp.h>
int main(int argc, char *argv[])
{
EVP_MD_CTX *mdctx;
const EVP_MD *md;
char mess1[] = "Test Message\n";
char mess2[] = "Hello World\n";
unsigned char md_value[EVP_MAX_MD_SIZE];
unsigned int md_len, i;
if (argv[1] == NULL) {
printf("Usage: mdtest digestname\n");
exit(1);
}
md = EVP_get_digestbyname(argv[1]);
if (md == NULL) {
printf("Unknown message digest %s\n", argv[1]);
exit(1);
}
mdctx = EVP_MD_CTX_new();
EVP_DigestInit_ex(mdctx, md, NULL);
EVP_DigestUpdate(mdctx, mess1, strlen(mess1));
EVP_DigestUpdate(mdctx, mess2, strlen(mess2));
EVP_DigestFinal_ex(mdctx, md_value, &md_len);
EVP_MD_CTX_free(mdctx);
printf("Digest is: ");
for (i = 0; i < md_len; i++)
printf("%02x", md_value[i]);
printf("\n");
exit(0);
}
The full list of digest algorithms are provided below.
EVP_blake2b512(3), EVP_md2(3), EVP_md4(3), EVP_md5(3), EVP_mdc2(3), EVP_ripemd160(3), EVP_sha1(3), EVP_sha224(3), EVP_sha3_224(3), EVP_sm3(3), EVP_whirlpool(3)
The EVP_MD_CTX_create() and EVP_MD_CTX_destroy() functions were renamed to EVP_MD_CTX_new() and EVP_MD_CTX_free() in OpenSSL 1.1.0, respectively.
The link between digests and signing algorithms was fixed in OpenSSL 1.0 and later, so now EVP_sha1() can be used with RSA and DSA.
The EVP_dss1() function was removed in OpenSSL 1.1.0.
The EVP_MD_CTX_set_pkey_ctx() function was added in 1.1.1.
Copyright 2000-2019 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the OpenSSL license (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at https://www.openssl.org/source/license.html.


Use Analyze | Inspect Code to run code analysis for the whole project or a custom scope and examine the results in a friendly view.


"We are a family owned and operated dentistry since 1963. Originally from Sweden, our ancestors moved to New York during 1912 through Ellis Island. After our grandfather joined the Air Force and retired, he made his permanent home here in San Antonio, Texas." - George Credial (Owner)
We are the proud caretakers of the largest private dentristy in the State of Texas, were we have expanded over 3 acres and we cater to everyone's dental needs.
Our team of dentists are some the most intelligent in the area, and prove to be the best in the world.
Contact Phone Numbers:
Main Number<PHONE_NUMBER>
Administration<PHONE_NUMBER>
Human Resources<PHONE_NUMBER>
Patient Billing<PHONE_NUMBER>
Our Mission: Serving Humanity to Honor God
Dr. Smiles opened in 1963 as the first dentisty in the now internationally acclaimed and recongized. From the beginning, we have recognized the unique needs of each of our patients. It is a process that we continue to improve on, creating ways to better serve the community when they need us most.
Our dental care has deep-rooted traditions of patient-focused care, faith-based philosophies and hiring staff that genuinely care for the well-being of others. As an organization, we promise to provide you, the patient, the highest quality of service and treatment as we strive to carry out the mission of Dr. Smiles Dental Care: Serving Humanity to Honor God.
We are proud to say we have some of the best dentist in San Antonio at our facility.
As the flagship dental care facility of San Antonio, we appreciate the support and recognition we receive from the community in being ranked number one in the Express-News Readers Choice Awards from 2009-2014. We also enjoy being the most preferred dentistry in San Antonio, as consistently reported by the Consumer Research Corporation.
Thank you, South Texas, for making us the number one dentistry in San Antonio. We are proud to serve you, your friends and your family.


{% extends "base.html" %} {% block title %} Legal {% endblock %} {% block content %}
fftogo is not affiliated with FriendFeed.


It’s been another impressive week of contributions to Utopian’s various categories. This week, we’re highlighting excellent selections from the Translations, Ideas, Blog, Tutorials, and Video Tutorials categories. Check them out!
Staff Picks
SIP001 - Non Fungible Tokens in STEEM by @upheaver [ideas]
This is an Ideas contribution meant to improve the Steem blockchain. The author did not just share the overview of the idea. Instead, he went into great detail describing how it could be implemented, its usecases and its advantages if integrated. The contribution is well thought out, and this is the sort of effort we would like to see on the ideas category.
Total payout: 83.05 STU Number of votes: 685
Simplified Chinese translation of Node.js #12 - 1090 words by @aafeng [translations]
@aafeng’s translation was perfectly accurate. The sentences are fluent in all the strings. The translator even highlighted some of the source strings that were difficult to translate. He showed us how he tried to understand the underlying programming concepts by running a demo code to get accurate translation.
Total payout: 27.43 STU Number of votes: 122
The Curious Expedition Greek Translation - Part 50 (~ 1088 words) by @trumpman [translations]
According to the moderator, @trumpan’s execution of this translation was flawless. The post about the translation is filled with humour and is very engaging. Both of the translation posts selected this week are excellent examples of what we want to see.
Total payout: 28.50 STU Number of votes: 193
Advanced Flutter Project - Setting Up the Basic Structure - Part One by @tensor [video-tutorials]
Video Tutorials MVP @tensor presents us with a new course. This is the first in a series of an advanced Flutter project. @tensor uses the Utopian Rocks Mobile application as the basis of this project. He tells us that we will be able to expand upon the code and feature list of this application. This tutorial get us started with the systematic and deliberate steps we have seen in many of @tensor’s other tutorials.
Total payout: 44.85 STU Number of votes: 272
A Token on the Steem Blockchain!!! by @shredz7 [tutorials]
The author of this tutorial provides us with an innovative concept that he recently introduced, allowing the creation of tokens on the Steem blockchain. In this tutorial, he leads a well-written, easy to follow, step by step guide to help you create your own token, transfer funds, and sync blocks for every user with a balance. This, along with other community based work, can represent the foundation of how tokens will function on Steem. It can potentially serve as an alternative to Steemit Inc’s implementation. Make sure to have a look at the tutorial if you’re interested in tokens. Whether you want to create them or challenge the concepts he refers to.
Total payout: 34.70 STU Number of votes: 87
Launching #WeAreOne – Curie, Sndbox, Travelfeed, and More On 1Ramp [Web + Android] by @the1ramp [blog]
This post details a massive update to @1Ramp’s platforms on Android and the web, with the creation of #WeAreOne, a dedicated space for communities. The post is detailed, engaging, and very well illustrated with screenshots. This is an impressive update, and one we look forward to seeing evolve.
Total payout: 55.42 STU Number of votes: 355
Utopian.io Post Statistics
The staff picked contributions are only a small (but exceptional) example of the mass of contributions reviewed and rewarded by Utopian.io.
- Overall, the last week saw a total of 139 posts, with 125 of them rewarded through an upvote by @utopian-io.
- In total, Utopian.io distributed an approximate of 3389.54 STU to contributors.
- The highest payout seen on any Utopian.io contribution this week was 118.496 STU, with a total of 282 votes received from the community.
- The contribution that attracted the most engagement was Ideas For Improving DTube, with no less than 100 comments in its comment threads.
- The average vote given by Utopian.io was worth 26.90 STU.
Category Statistics
|Category|Reviewed|Rewardable|Rewarded|Total rewards|Top contributor| |:-|:-|:-|:-|-:|:-| |translations|48|47|47|1383.29 STU|@alexs1320| |blog|22|18|18|316.80 STU|@actifit| |graphics|4|3|3|54.92 STU|@zularizal| |development|21|20|20|572.24 STU|@immanuel94| |bug-hunting|2|2|2|30.78 STU|@tobias-g| |ideas|4|3|3|89.13 STU|@upheaver| |iamutopian|9|9|9|332.33 STU|@katerinaramm| |tutorials|16|11|11|179.14 STU|@drifter1| |video-tutorials|2|2|2|80.53 STU|@tensor| |analysis|3|3|3|95.53 STU|@miniature-tiger| |documentation|1|1|1|3.02 STU|@bobinson| |anti-abuse|1|1|1|33.46 STU|@flagawhale| |copywriting|1|1|1|21.30 STU|@harry-heightz|
First Time Contributing in Utopian.io?
Learn how to contribute on our website
This page is synchronized from the post: Top of Utopian.io: December 5-12


What is the empirical Fisher ?
November 9, 2018
Some recent papers mention that they use the inverse of the "empirical Fisher" as a preconditioner. The main reason is its simplicity of use since it only requires gradients of the loss with respect to the parameters for each individual example. These are the same gradients as the ones we use to estimate our expected gradient when using SGD, as opposed to the true Fisher used in natural gradient, where the gradients that we need are gradients sampled from the distribution represented by our neural network.
The update using the "empirical Fisher" is:
Where is often estimated using its minibatch estimate, and is the (uncentered) covariance of the gradients, also estimated using a minibatch, or a running average. is the learning rate, and is a Tikhonov damping parameter.
1 What problem are we solving when using this update?
Claim: This update is solution to the following problem, up to a second order approximation:
Where we defined , and is a predefined scalar constant.
Proof: We start by writing the first order Taylor series expansion of :
Where hides the higher order terms. It is a function such that , or to put it into words, it will be negligible compared to the first order term as long as is not too big.
By replacing in the constraint we obtain:
In the second line we have hidden the cross product in .
We now remark that we can rewrite:
And so our minimization problem becomes:
Which can be solved e.g. using Lagrange multipliers, and we obtain the update:
Where is a scalar that we usually define as being the (constant) learning rate, but to be more precise it should be set so that the constraint is enforced. The role of is to make sure that regardless of the spectrum of , the update will not get too big, and make our second order approximation wrong.
2 Discussion
What does it mean to be solving this minimization problem?
First, it means that we measure progress in the space of our loss function. It has the desirable effect of making this update invariant by reparametrization of the network, as long as is kept small.
Second, it means that we will encourage all examples to have their loss reduced by a similar amount, on average . Is this something desirable or not ? I don’t know but I am open to your suggestions!


measure the ambient light value
pin
: int. the aio pin which is attached by the sensor
trigger
: any type. trigger signal, and whenever it comes, the sensor will measure and report the light value.
value
: number. the value of the light
It measure the light in every 1s, if the value is below 100, turn on the light, otherwise, turn off.


Class Hive
... creates and holds the Actor System, Hive Configuration, Context Manager. Loads the Akka Configuration and provides basic functionality.
Inheritance
System.Object
Hive
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Akka.Hive
Assembly: Akka.Hive.dll
Syntax
public class Hive
Constructors
Hive(IHiveConfig)
Prepare Simulation Environment
Declaration
public Hive(IHiveConfig engineConfig)
Parameters
| Type | Name | Description |
|---|---|---|
| IHiveConfig | engineConfig | Several Simulation Configurations |
Fields
ContextName
Public Contextname for identification
Declaration
public const string ContextName = "HiveContext"
Field Value
| Type | Description |
|---|---|
| System.String |
Properties
ActorSystem
The actor system itself
Declaration
public ActorSystem ActorSystem { get; }
Property Value
| Type | Description |
|---|---|
| Akka.Actor.ActorSystem |
Config
The hive Configuration
Declaration
public IHiveConfig Config { get; }
Property Value
| Type | Description |
|---|---|
| IHiveConfig |
ContextManager
Actor managing the virtual time, is triggered by interupts and can be used for external comunication
Declaration
public IActorRef ContextManager { get; }
Property Value
| Type | Description |
|---|---|
| Akka.Actor.IActorRef |
Inbox
Global Inbox that is used for comunication with the state manager
Declaration
public Inbox Inbox { get; }
Property Value
| Type | Description |
|---|---|
| Akka.Actor.Inbox |
Methods
Continue()
Confiniues the system after a stop. Only on simulation contexts
Declaration
public void Continue()
IsReady()
Request a ready signal from system context
Declaration
public bool IsReady()
Returns
| Type | Description |
|---|---|
| System.Boolean | true as soon as the initialization is finished |
RunAsync()
Starts the actor system
Declaration
public Task RunAsync()
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task | when the system is terminated |
Terminate()
Terminates the ActorSystem.
Declaration
public Task Terminate()
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task | Task when the system is terminated |


{{site.upcoming_event_description}}
For more information about the event and tickets, see: {{site.upcoming_event_eb_url}}


consistent/cautious
inventive/curious
efficient/organized
easy-going/careless
outgoing/energetic
solitary/reserved
friendly/compassionate
analytical/detached
sensitive/nervous
secure/confident


Before Change
score = np.zeros(label_num)
bin_prediction = binarize_predictions(prediction, task)
fn = np.sum(np.multiply(solution, (1 - bin_prediction)), axis=0)
tp = np.sum(np.multiply(solution, bin_prediction), axis=0)
fp = np.sum(np.multiply((1 - solution), bin_prediction), axis=0)
//print(np.multiply(solution, (1 - bin_prediction)).shape, fn.shape,
// np.sum(np.multiply(solution, (1 - bin_prediction)), axis=0).shape)
// Bounding to avoid division by 0
After Change
label_num = solution.shape[1]
score = np.zeros(label_num)
bin_prediction = binarize_predictions(prediction, task)
[tn, fp, tp, fn] = acc_stat(solution, bin_prediction)
// Bounding to avoid division by 0
eps = 1e-15
true_pos_num = sp.maximum(eps, tp + fn)
found_pos_num = sp.maximum(eps, tp + fp)


We have noticed that this is your first event! We are very happy for this, and ask you to fill a few details before you can proceed.


Changing privacy settings on social media is least common among EPCD respondents
EPCD respondents are relatively less prone to reach out to institutional support for digital privacy
Nationalities interviewed throughout the investigation


You got a email notification
April 12, 2018 06:50{{pie.LAmount}}
Loan Amount{{pie.RAmount}}
Received Amount${{pie.LAmount+(pie.RAmount-pie.LAmount)}}
total earningsCopyright © 2018 Colorlib. All rights reserved. Template by Colorlib.
Copyright © 2018 Colorlib. All rights reserved. Template by Colorlib.


A Valve component represents an instance of a specified Java class that will be involved in the processing of each request and response handled by the Container within which it is nested, as follows:
Valves are typically used to implement optional features for the associated Container. See the "Special Features" section of the documentation on Engine, host, and Context Containers for more information about the Valves designed to be associated with each Container type. This page summarizes the configuration information for all standard Valve implementations that are provided with Catalina.
All implementations of the Valve component support the following attributes:
| Attribute | Description |
|---|---|
className |
Java class name of the implementation to use. This class must
implement the org.apache.catalina.Valve interface.
Because there is no single standard implementation, this attribute
is required. See
Standard Implementation Attributes for the names of the
supported classes.
|
Unlike most other Catalina components, there is not a single standard
implementation of the Valve component available. Instead,
a variety of standard implementations, with different functional purposes,
are available for your use. To select one, use the specified value for the
className
attribute, and configure the remaining attributes
as described below.
org.apache.catalina.valve.AccessLogValve
)The Access Log Valve creates log files in the same format as those created by standard web servers. These logs can later be analyzed by standard log analysis tools to track page hit counts, user session activity, and so on. The access log Valve shares many configuration characteristics with the File Logger components used to record internal event, exception, and debugging output from Catalina components, including the automatic rollover of log files at midnight each night. An Access Log Valve can be associated with an Engine, Host, or Context Container, and will log requests processed by the associated Container and any nested Containers.
The Access Log Valve supports the following additional attributes:
| Attribute | Description |
|---|---|
directory |
Relative or absolute pathname of the directory into which log files will be created. If a relative path is specified, it is interpreted as relative to $CATALINA_HOME. If no directory is specified, the default value is "logs" (relative to the Catalina home directory). |
pattern |
A formatting layout identifying the various information fields
from the request and response to be logged, or the word
common to select the standard Common Log Format.
See below for more information on pattern variables. If no
value is specified, the common format is utilized.
|
prefix |
The prefix added to the front of each log file name. If not specified, the default value is "access_log.". To specify no prefix, use a zero-length string. |
resolveHosts |
Should the IP address of the remote client for each request be
resolved to the corresponding host name (via a DNS lookup)? You
might wish to turn off host resolution to improve performance
in high activity web applications. If not specified, the default
value is false , indicating that remote host resolution
will not take place.
|
suffix |
The suffix added to the end of each log file name. If not specified, the default value is "". To specify no suffix, use a zero-length string. |
timestamp |
Should log messages be date/time stamped? Set this value to
true or false . If not specified,
log messages will not be date/time stamped.
|
Values for the pattern
attribute are made up of literal text
strings, and pattern identifiers prefixed by the % character,
which cause replacement by the corresponding variable value from the current
request and response. The following pattern codes are supported:
If you specify a pattern of common
, or do not specify a pattern
at all, the common pattern %h %l %u %t "%r" %s %b
is used, which
corresponds to the default logging format for many web servers.
org.apache.catalina.valve.RemoteAddrValve
)The Remote Address Filter allows you to compare the IP address of the client that submitted this request against one or more regular expressions, and either allow the request to continue or refuse to process a request from this client based on the outcome of the comparison. A Remote Address Filter can be associated with an Engine, Host, or Context Container, and will filter requests processed by the associated Container and any nested Containers.
The Remote Address Filter supports the following additional attributes:
| Attribute | Description |
|---|---|
| allow | A comma-separated list of regular expression patterns that
the remote client's IP address is compared to. If this attribute is
specified, the remote address must match at least
one of the patterns to be allowed. If this attribute is not
specified, all requests are allowed unless the remote address
matches a deny pattern.
|
| deny | A comma-separated list of regular expression patterns that
the remote client's IP address is compared to. If this attribute is
specified, the remote address must not match any of
the specified patterns to be allowed. If this attribute is not
specified, any request where the remote address matches one of the
accept patterns is allowed.
|
org.apache.catalina.valve.RemoteHostValve
)The Remote Host Filter allows you to compare the remote host address of the client that submitted this request against one or more regular expressions, and either allow the request to continue or refuse to process a request from this client based on the outcome of the comparison. A Remote Host Filter can be associated with an Engine, Host, or Context Container, and will filter requests processed by the associated Container and any nested Containers.
The Remote Address Host supports the following additional attributes:
| Attribute | Description |
|---|---|
| allow | A comma-separated list of regular expression patterns that
the remote client's host address is compared to. If this attribute is
specified, the remote address must match at least
one of the patterns to be allowed. If this attribute is not
specified, all requests are allowed unless the remote address
matches a deny pattern.
|
| deny | A comma-separated list of regular expression patterns that
the remote client's host address is compared to. If this attribute is
specified, the remote address must not match any of
the specified patterns to be allowed. If this attribute is not
specified, any request where the remote address matches one of the
accept patterns is allowed.
|
org.apache.catalina.valve.RequestDumperValve
)The Request Dumper Valve is a debugging tool that lets you insert a component that dumps the HTTP headers associated with the specified request (before processing) and response (after processing) to the Logger that is associated with our corresponding Container. It is especially useful when trying to debug problems related to headers or cookies sent by an HTTP client. A Request Dumper Filter can be associated with an Engine, Host, or Context Container, and will log requests processed by the associated Container and any nested Containers.
The Request Dumper Filter supports no additional attributes.


The option can be selected in the sitefile, per default we do
use mksite:listsitemapstyle
.

will select mksite:multisitemapstyle
as well.
The sitemap file is always generated into the target variant of the sitefile - if your sitefile is named "site.htm" then the sitemap will generated into "site.html". To make this happen the target sitemap file must be named in the sitefile as a generation html file. To stick with the example, in your file "site.htm" the following line should be present:

-our sitemap.
Note that there may be multiple sitefiles for a website and each will get its own sitemap. The sitemap is really just a conversion of the sect/subsect hierarchy present in the sitefile that you did create for your website. Most styles for a sitemap will present each sect1/ sect2/... entry sligthly differently.
In the listsitemapstyle
each sect/subsect
entry is presented in a linear list top-down. The order
matches exactly the order of html targets in the sitefile.
Each sect1 is prefixed by "*", each sect2 is prefixed by
a "-", and each sect3 is slightly indented, i.e. prefixed with
a " " and has also added some dots or a hyphen to mark its
relation to the nexthigher topic entry. Here is an example:
| * | examples | 2004-04-22 | Examples of sitefiles | ||
| - | horizontal | 2004-04-22 | Horizontal Navigation Bar | ||
| - | vertical | 2004-04-22 | Vertical Navigation Bar | ||
| - | tabbed | 2004-04-22 | Tabbed Vertical Navigation Bar | ||
| - (2) | 2004-04-22 | new Tabbed Vertical Navigation Bar | |||
| - | multi section | 2004-04-22 | Multi Section Vertical Navigation Bar |
As seen in example, the listsitemapstyle presents each page with (a) the
shorthand name taken from the sitefile along with the href hotlink from
the sitefile (b) attach the date meta attribute from that file being
usually the last modified one (c) and put in the title attribute of
the target page which is often the first

or
similar markup in the text body of the source.
This style can be too long for some occassions. The multisitemapstyle uses a more compact notation. There the three entries are set together in table cell. The sitemap table itself has as many columns as there are sect1 section entries, and each column starts off with the sect1 intro page reference. Obsiously this mode has been developed for being used along with the multisectionstyle layout for the website.
It turns out that the multisitemapstyle is really more compact but it also makes reading it a lot harder. While many sites will pick up the multisectionstyle quite early in the process (at about 30-80 pages) it occurred that the listsitemapstyle looks better than the multisitemapstyle for about 100 pages. For newer code it therefore recommended to use the listsitemapstyle along with a multisectionstyle.
Since a sitemap of 100 entries in the list might be hard to read as
well (by the amount of entries) the reader of this site is asked to
develop some sitemapstyle for the 40-100 range and send it to me. The
current multisitemapstyle layout is not all too pleasing to my eyes
and therefore not explicitly shown in this feature documentation. If
you want to see it then just enable it with the

option in the sitefile
and have look. Patches are welcome.


http-auth-proxy setup
URL
Username
Password
Bearer
Headers
Expiry
Please note that submitting the request requires HTTP authentication.


On stored routines and dynamic statements
I very much enjoyed reading Overloading Procedures by Michael McLaughlin: good stuff!
I’m dealing with similar issues in common_schema/QueryScript, where I implement a whole new scripting language within MySQL, interpreted by stored routines. I am now finalizing the next version of common_schema/QueryScript, with a major addition to the scripting language to put yet even more power at the hands of the programmer/DBA using simple, clean syntax.
Still hush hush, the development of that feature touched at the very same issues described in Michael’s post. Present in current release, these issues are intensified by the use and complexity of the new development. Here are a few insights of mine:
Internal array implementation
Like Michael, I started by implementing arrays through tables. That is, create a (temporary, in my case) table, wrap it up with a lot of stored routine code, and simulate an array. This array is not yet provided to the user, but is used internally for QueryScript’s own code.
Well, disappointment here: during load tests on intense structures, such as a foreach loop, where each iteration of the loop requires the creation of an array, I found that the current solution does not hold well on busy servers.
Seemingly, there’s nothing wrong with the creation of a new table every once in a while – and in particular a temporary table. However, I quickly found out that a busy server thrashes the table cache with such intense rate of creation/dropping of tables. The competition over the table cache mutex becomes intolerable and hogs not only the script’s execution but the entire server’s.
There’s also the issue of the type of array values – no going around using textual columns, of course, but – how long? A VARCHAR(32767) should be enough for any reasonable implementation, but – how much memory would that consume? Both MEMORY and standard temporary tables (Percona Server has that partially resolved) use a fixed row format, which means a 32K text is actually allocated in memory even when your value is ‘x’.


<!DOCTYPE html>

<%
dim d,a,i,s
set d=Server.CreateObject("Scripting.Dictionary")
d.Add "n", "Norway"
d.Add "i", "Italy"
Response.Write("
The value of the keys are:
")
a=d.Keys
for i = 0 To d.Count -1
s = s & a(i) & "
"
next
Response.Write(s)
set d=nothing
%>


> {-# LANGUAGE Arrows, BangPatterns,
> ExistentialQuantification, FlexibleContexts,
> FunctionalDependencies, ScopedTypeVariables,
> NoMonomorphismRestriction #-}
Euterpea adaptation of some unit generators from csound
Conventions:
(1) Optional arguments in some csound unit generators sometimes carry
different semantics depending on the way the generator is called.
Here they are encoded as algebraic datatypes instead (see 'pluck' for
example). A single optional argument is normally encoded using
Haskell's Maybe type.
(2) csound's i-type is updated only once on every note's
initialization pass. They are represented as unlifted arguments here
(i.e. non-signal).
(3) Many unit generators in csound take a signal 'amp' as input, which
scales its result by 'amp'. Since this feature induces computational
overhead when scaling is not needed, and is easily expressed using
arrow syntax when needed, we omit that functionality from Eutperpea's
versions of the unit generators.
> module Euterpea.IO.Audio.BasicSigFuns (
> Table,
> pluck,
> PluckDecayMethod(..),
> balance,
> tableExponN,
> tableExpon,
> tableLinearN,
> tableLinear,
> tableSines3N,
> tableSines3,
> tableSinesN,
> tableSines,
> tableBesselN,
> tableBessel,
> filterLowPass,
> filterHighPass,
> filterBandPass,
> filterBandStop,
> filterLowPassBW,
> filterHighPassBW,
> filterBandPassBW,
> filterBandStopBW,
> filterComb,
> osc,
> oscI,
> oscFixed,
> oscDur,
> oscDurI,
> oscPartials,
> envLine,
> envExpon,
> envLineSeg,
> envExponSeg,
> envASR,
> envCSEnvlpx,
> noiseWhite, noiseBLI, noiseBLH,
> delayLine, delayLine1, delayLineT,
> samples, milliseconds, seconds, countTime
> ) where
> import Euterpea.IO.Audio.Basics
> import Euterpea.IO.Audio.Types
> import Control.Arrow
> import Control.Arrow.Operations
> import Control.Arrow.ArrowP
> import Data.Array.Base (unsafeAt)
> import Data.Array.Unboxed
> import Foreign.Marshal
> import Foreign.Ptr
> import Foreign.Storable
> import GHC.IO
> import System.Random
> type SEvent a = Maybe a
> constA = arr . const
Helper Functions
----------------
> wrap :: (Ord n, Num n) => n -> n -> n
> wrap val bound = if val > bound then wrap val (val-bound) else val
> clip :: Ord n => n -> n -> n -> n
> clip val lower upper
> | val <= lower = lower
> | val >= upper = upper
> | otherwise = val
Raises 'a' to the power 'b' using logarithms.
> pow :: Floating a => a -> a -> a
> pow a b = exp (log a * b)
Returns the fractional part of 'x'.
> frac :: RealFrac r => r -> r
> frac = snd . properFraction
Table Creation and Access
-------------------------
A Table is essentially a UArray.
> data Table = Table
> !Int -- size
> !(UArray Int Double) -- table implementation
> !Bool -- Whether the table is normalized
> instance Show Table where
> show (Table sz a n) = "Table with " ++ show sz ++ " entries: " ++ show a
> funToTable :: (Double->Double) -> Bool -> Int -> Table
> funToTable f normalize size =
> let delta = 1 / fromIntegral size
> ys = take size (map f [0, delta.. ]) ++ [head ys]
> -- make table one size larger as an extended guard point
> zs = if normalize then map (/ maxabs ys) ys else ys
> maxabs = maximum . map abs
> in Table size (listArray (0, size) zs) normalize
> readFromTable :: Table -> Double -> Double
> readFromTable (Table sz array _) pos =
> let idx = truncate (fromIntegral sz * pos) -- range must be [0,size]
> in array `unsafeAt` idx
> {-# INLINE [0] readFromTable #-}
> readFromTableA :: Arrow a => Table -> a Double Double
> readFromTableA = arr . readFromTable
> readFromTableRaw :: Table -> Int -> Double
> readFromTableRaw (Table _ a _) idx = a `unsafeAt` idx
Like readFromTable, but with linear interpolation.
> readFromTablei :: Table -> Double -> Double
> readFromTablei (Table sz array _) pos =
> let idx = fromIntegral sz * pos -- fractional "index" in table ([0,sz])
> idx0 = (truncate idx) `mod` sz :: Int
> idx1 = idx0 + 1 :: Int
> val0 = array `unsafeAt` idx0
> val1 = array `unsafeAt` idx1
> in val0 + (val1 - val0) * (idx - fromIntegral idx0)
> {-# INLINE [0] readFromTablei #-}
> readFromTableiA :: Arrow a => Table -> a Double Double
> readFromTableiA = arr . readFromTablei
Accesses table values by direct indexing with linear interpolation.
The index 'pos' is expected to be normalized (between 0 and 1). Values
out of bounds are either clipped or wrapped.
> tablei :: (Clock p, Arrow a) =>
> Table -- Table to read from.
> -> Bool -- Whether to wrap around index;
> -- if not, index is clipped within bounds
> -> ArrowP a p Double Double
> tablei tab True =
> proc pos -> do
> outA -< readFromTablei tab (wrap pos 1)
> tablei tab False =
> proc pos -> do
> outA -< readFromTablei tab (clip pos 0 1)
Accesses table values by direct indexing; the index is normalized
(between 0 and 1).
> table :: (Clock p, Arrow a) => Table -> Bool -> ArrowP a p Double Double
> table tab True =
> proc pos -> do
> outA -< readFromTable tab (wrap pos 1)
> table tab False =
> proc pos -> do
> outA -< readFromTable tab (clip pos 0 1)
Like tablei, but the index is interpreted as a raw value (between 0
and (size of table - 1), inclusive).
> tableiIx :: (Clock p, Arrow a) =>
> Table -> Bool -> ArrowP a p Double Double
> tableiIx tab@(Table sz array _) True =
> proc idx -> do
> let idx0 = (truncate idx) `mod` sz
> val0 = readFromTableRaw tab idx0
> val1 = readFromTableRaw tab (idx0 + 1)
> outA -< val0 + (val1 - val0) * (idx - fromIntegral idx0)
> tableiIx tab@(Table sz _ _) False =
> proc idx -> do
> let pos = idx / fromIntegral (sz-1)
> outA -< readFromTablei tab (clip pos 0 1)
Like table, but index interpreted as raw value.
> tableIx :: (Clock p, Arrow a) => Table -> Bool -> ArrowP a p Double Double
> tableIx tab@(Table sz array _) True =
> proc idx -> do
> outA -< readFromTableRaw tab (truncate idx `mod` (sz-1))
> tableIx tab@(Table sz array _) False =
> proc idx -> do
> outA -< readFromTableRaw tab (clip (truncate idx) 0 (sz-1))
Oscillators
-----------
'osc' generates periodic signals consisting of the values returned
from sampling a stored function table. The internal phase is
simultaneously advanced in accordance with the input signal 'freq'.
> osc :: (Clock p, ArrowCircuit a) =>
> Table
> -> Double -- Initial phase of sampling, expressed as a
> -- fraction of a cycle (0 to 1).
> -> ArrowP a p Double Double
> osc table iphs = osc_ iphs >>> readFromTableA table
'oscI' is like 'osc', but with linear interpolation.
> oscI :: (Clock p, ArrowCircuit a) =>
> Table
> -> Double
> -> ArrowP a p Double Double
> oscI table iphs = osc_ iphs >>> readFromTableiA table
Helper function for osc and oscI.
> osc_ :: forall p a. (Clock p, ArrowCircuit a) =>
> Double -> ArrowP a p Double Double
> osc_ phs =
> let sr = rate (undefined :: p)
> in proc freq -> do
> rec
> let delta = 1 / sr * freq
> phase = if next > 1 then frac next else next
> next <- delay phs -< frac (phase + delta)
> outA -< phase
Simple, fast sine oscillator, that uses only one multiply and two add
operations to generate one sample of output, and does not require a
function table.
> oscFixed :: forall p a . (Clock p, ArrowCircuit a) =>
> Double -> ArrowP a p () Double
> oscFixed freq =
> let omh = 2 * pi * freq / sr
> d = sin omh
> c = 2 * cos omh
> sr = rate (undefined :: p)
> sf = proc () -> do
> rec
> let r = c * d2 - d1
> d1 <- delay 0 -< d2
> d2 <- delay d -< r
> outA -< r
> in sf
'oscDur' accesses values by sampling once through the function table
at a rate determined by 'dur'. For the first 'del' seconds, the point
of scan will reside at the first location of the table; it will then
begin moving through the table at a constant rate, reaching the end in
another 'dur' seconds; from that time on (i.e. after 'del' + 'dur'
seconds) it will remain pointing at the last location.
> oscDur :: (Clock p, ArrowChoice a, ArrowCircuit a) =>
> Table
> -> Double
> -- delay in seconds before 'oscDur' incremental sampling begins
> -> Double
> -- duration in seconds to sample through the table just once.
> -> ArrowP a p () Double
> oscDur = oscDur_ osc
Like 'oscDur', but with linear interpolation.
> oscDurI :: (Clock p, ArrowChoice a, ArrowCircuit a) =>
> Table
> -> Double
> -- delay in seconds before 'oscDur' incremental sampling begins.
> -> Double
> -- duration in seconds to sample through the table just once.
> -> ArrowP a p () Double
> oscDurI = oscDur_ oscI
Helper function for oscDur and oscDurI.
> oscDur_ :: forall p a . (Clock p, ArrowChoice a, ArrowCircuit a) =>
> (Table -> Double -> ArrowP a p Double Double)
> -> Table -> Double -> Double -> ArrowP a p () Double
> oscDur_ osc table@(Table sz _ _) del dur =
> let sr = rate (undefined :: p)
> t1 = del * sr
> t2 = t1 + dur * sr
> v0 = readFromTableRaw table 0
> v2 = readFromTableRaw table (sz-1)
> in proc () -> do
> i <- countUp -< ()
> let i' = fromIntegral i
> y <- case (i' < t1, i' < t2) of
> (True, _) -> outA -< v0
> (False, True) -> osc table 0 -< 1 / dur
> (False, False) -> outA -< v2
> outA -< y
These are not implemented.
> foscil, foscili :: (Clock p, Arrow a) =>
> Table -> ArrowP a p (Double,Double,Double,Double) Double
> foscil table =
> proc (freq,carfreq,modfreq,modindex) -> do
> outA -< 0
> foscili table =
> proc (freq,carfreq,modfreq,modindex) -> do
> outA -< 0
> loscil :: (Clock p, Arrow a) => Table -> ArrowP a p Double Double
> loscil table =
> proc freq -> do
> outA -< 0
Output a set of harmonically related sine partials.
> oscPartials :: forall p . Clock p =>
> Table -- table containing a sine wave;
> -- a table size of at least 8192 is recommended.
> -> Double -- initial phase of the fundamental frequency,
> -- expressed as a fraction of a cycle (0 to 1).
> -> Signal p (Double,Int) Double
> -- 'freq' is the fundamental frequency in cycles per
> -- second; 'nharms' is the number of harmonics requested.
> oscPartials table initialPhase =
> let sr = rate (undefined :: p)
> in proc (freq, nharms) -> do
> rec
> let delta = 1 / sr * freq
> phase = if next > 1 then frac next else next
> next <- delay initialPhase -< frac (phase + delta)
> outA -< sum [ readFromTable table (frac (phase * fromIntegral pn)) |
> pn <- [1..nharms] ]
> / fromIntegral nharms
Pluck
-----
> data PluckDecayMethod
> = SimpleAveraging
> -- A simple smoothing process.
> | StretchedAveraging Double
> -- Smoothing time stretched by a factor.
> | SimpleDrum Double
> -- The range from pitch to noise is controlled by a 'roughness
> -- factor' (0 to 1). Zero gives the plucked string effect, while
> -- 1 reverses the polarity of every sample (octave down, odd
> -- harmonics). The setting .5 gives an optimum snare drum.
> | StretchedDrum Double Double
> -- Combines both roughness and stretch factors. parm1 is
> -- roughness (0 to 1), and parm2 the stretch factor (=1).
> | WeightedAveraging Double Double
> -- As SimpleAveraging, with parm1 weighting the current sample
> -- (the status quo) and iparm2 weighting the previous adjacent
> -- one. iparm1 + iparm2must be <= 1.
> | RecursiveFilter
> -- 1st order recursive filter, with coefs .5. Unaffected by
> -- parameter values.
> pluck :: forall p . Clock p =>
> Table -> Double -> PluckDecayMethod -> Signal p Double Double
> pluck table pitch method =
> let sr = rate (undefined :: p)
> in proc cps -> do
> rec
> z <- delayLineT (max 64 (truncate (sr / pitch))) table -< y
> z' <- delay 0 -< z
> let y = case method of
> SimpleAveraging -> 0.5 * (z + z')
> -- or is this "RecursiveFilter?"
> WeightedAveraging a b -> z * a + z' * b
> _ -> error "pluck: method not implemented"
> outA -< y
Grain
-----
Not implemented.
> grain :: Table
> -- Grain waveform. This can be just a sine wave or a sampled sound.
> -> Table
> -- Amplitude envelope used for the grains.
> -> Double
> -- Maximum grain duration in seconds. This is the biggest
> -- value to be assigned to 'gdur'.
> -> Bool
> -- If 'True', all grains will begin reading from the
> -- beginning of the 'gfn' table. If 'False', grains
> -- will start reading from random 'gfn' table positions.
> -> Signal p (Double,Double,Double,Double,Double) Double
> grain gfn wfn mgdur grnd =
> proc (pitch,dens,ampoff,pitchoff,gdur) -> do
> outA -< 0
Delay Lines
-----------
csound's delayr and delayw are not implemented -- instead, one can use
a fixed-time delay with native recursive arrow syntax to achieve
modified feedback loops.
> data Buf = Buf !Int !(Ptr Double)
> updateBuf :: Buf -> Int -> Double -> IO Double
> updateBuf (Buf _ a) i u = a `seq` i `seq` u `seq` do
> let p = a `advancePtr` i
> x' <- peek p
> poke p u
> return x'
> peekBuf (Buf sz a) i = peek (a `advancePtr` (min (sz-1) i))
TODO: deal with pre-initialized buffers
> mkArr :: Int -> Buf
> mkArr n = n `seq` Buf n (unsafePerformIO $
> Foreign.Marshal.newArray (replicate n 0))
> mkArrWithTable size t = Buf size (unsafePerformIO $
> Foreign.Marshal.newArray (map (readFromTable t) [0, (1/sz)..((sz-1)/sz)]))
> where sz = fromIntegral size
A fixed-length delay line, initialized using a table.
> delayLineT :: forall p . Clock p =>
> Int -> Table -> Signal p Double Double
> delayLineT size table =
> let sr = rate (undefined :: p)
> buf = mkArrWithTable size table
> in proc x -> do
> rec
> let i' = if i == size-1 then 0 else i+1
> i <- delay 0 -< i'
> y <- delay 0 -< x
> -- TODO: this proc can't be strict on x, but how can we
> -- deal with strictness better without this hack?
> outA -< unsafePerformIO $ updateBuf buf i y
A fixed-length delay line.
> delayLine :: forall p . Clock p =>
> Double -> Signal p Double Double
> delayLine maxdel =
> let sr = rate (undefined :: p)
> sz = truncate (sr * maxdel)
> buf = mkArr sz
> in proc x -> do
> rec
> let i' = if i == sz-1 then 0 else i+1
> i <- delay 0 -< i'
> y <- delay 0 -< x
> outA -< unsafePerformIO $ updateBuf buf i y
delay line with one tap.
> delayLine1 :: forall p . Clock p => Double -> Signal p (Double, Double) Double
> delayLine1 maxdel =
> let sr = rate (undefined :: p)
> sz = truncate (sr * maxdel)
> buf = mkArr sz
> in proc (sig,dlt) -> do
> rec
> let i' = if i == sz-1 then 0 else i+1
> dl = min maxdel dlt
> tap = i - truncate (sr * dl)
> tapidx = if tap < 0 then sz + tap else tap
> i <- delay 0 -< i'
> y <- delay 0 -< sig
> outA -< unsafePerformIO $ do
> s <- peekBuf buf tapidx
> _ <- updateBuf buf i y
> return s
delay line with two taps.
> delay2 :: Double -> Signal p (Double, Double, Double) Double
> delay2 maxdel =
> proc (sig, dlt1, dlt2) -> do
> outA -< 0
delay line with three taps.
> delay3 :: Double -> Signal p (Double, Double, Double, Double) Double
> delay3 maxdel =
> proc (sig, dlt1, dlt2, dlt3) -> do
> outA -< 0
delay line with four taps.
> delay4 :: Double -> Signal p (Double, Double, Double, Double, Double) Double
> delay4 maxdel =
> proc (sig, dlt1, dlt2, dlt3, dlt4) -> do
> outA -< 0
Noise Generators
----------------
Analogous to rand, randi, and randh in csound.
Generate uniform white noise with an R.M.S value of 1 / sqrt 2, where
'seed' is the random seed.
> noiseWhite :: Int -> Signal p () Double
> noiseWhite seed =
> let gen = mkStdGen seed
> in proc () -> do
> rec
> let (a,g') = random g :: (Double,StdGen)
> g <- delay gen -< g'
> outA -< a * 2 - 1
Controlled band-limited noise with interpolation between each new
number, and with an RMS value of 1 / sqrt 2.
'cps' controls how fast the new numbers are generated.
'seed' is the random seed.
> noiseBLI :: forall p . Clock p => Int -> Signal p Double Double
> noiseBLI seed =
> let sr = rate (undefined :: p)
> gen = mkStdGen seed
> (i_n1, i_g1) = random gen :: (Double,StdGen)
> (i_n2, i_g2) = random i_g1 :: (Double,StdGen)
> i_pr = (i_n1, i_n2, i_g2)
> in proc cps -> do
> let bound = sr / cps
> rec
> state <- delay (0, i_pr) -< state'
> let (cnt, pr@(n1, n2, g)) = state
> n = n1 + (n2 - n1) * cnt / bound
> state' = if cnt + 1 < bound
> then (cnt + 1, pr)
> else let (n3, g') = random g :: (Double,StdGen)
> in (0, (n2, n3, g'))
> outA -< n * 2 - 1
Controlled band-limited noise without interpolation (holds
previous value instead), and with an RMS value of 1 / sqrt 2.
'cps' controls how fast the new numbers are generated.
'seed' is the random seed.
> noiseBLH :: forall p . Clock p => Int -> Signal p Double Double
> noiseBLH seed =
> let sr = rate (undefined :: p)
> gen = mkStdGen seed
> (i_n1, i_g) = random gen :: (Double,StdGen)
> i_pr = (i_n1, i_g)
> in proc cps -> do
> let bound = sr / cps
> rec
> state <- delay (0, i_pr) -< state'
> let (cnt, pr@(n, g)) = state
> state' = if cnt + 1 < bound
> then (cnt + 1, pr)
> else let (n', g') = random g :: (Double,StdGen)
> in (0, (n', g'))
> outA -< n * 2 - 1
Gain Adjustment
---------------
Adjusts RMS amplitude of 'sig' so that it matches RMS amplitude of 'ref'.
> balance :: forall p . Clock p =>
> Int -> Signal p (Double, Double) Double
> balance ihp =
> proc (sig, ref) -> do
> rec
> (sqrsum, refsum) <- delay (0, 0) -< (sqrsum', refsum')
> let sqrsum' = c1 * sig * sig + c2 * sqrsum
> refsum' = c1 * ref * ref + c2 * refsum
> ratio = if sqrsum == 0 then sqrt $ refsum
> else sqrt $ refsum / sqrsum
> outA -< sig * ratio
> where sr = rate (undefined :: p)
> tpidsr = 2 * pi / sr -- tpidsr = two-pi over sr
> b = 2 - cos (fromIntegral ihp * tpidsr)
> c1 = 1 - c2
> c2 = b - sqrt (b * b - 1)
Filters
-------
> data BandPassData = BandPassData{
> rsnKcf :: !Double
> , rsnKbw :: !Double
> , rsnCosf :: !Double
> , rsnC1 :: !Double
> , rsnC2 :: !Double
> , rsnC3 :: !Double
> , rsnYt1 :: !Double
> , rsnYt2 :: !Double
> }
> rsnDefault :: BandPassData
> rsnDefault = BandPassData (-1) (-1) 0 0 0 0 0 0
A second-order resonant (band pass) filter.
Analogous to csound's 'reson' routine.
> filterBandPass :: forall p . Clock p =>
> Int -- 'scale': 1 signifies a peak response factor of 1, i.e. all
> -- frequencies other than kcf are attenuated in accordance with
> -- the (normalized) response curve; 2 raises the response
> -- factor so that its overall RMS value equals 1; 0 ignifies
> -- no scaling of the signal, leaving that to some later
> -- adjustment (like balance).
> -> Signal p (Double, Double, Double) Double
> -- 'sig' is the signal to be filtered,
> -- 'kcf' is the center frequency of the filter,
> -- and 'kbw' is the bandwidth of it.
> filterBandPass scale =
> proc (sig, kcf, kbw) -> do
> rec
> rsnData <- delay rsnDefault -< rsnData'
> currData <- if kcf == rsnKcf rsnData && kbw == rsnKbw rsnData
> then outA -< rsnData
> else update -< (rsnData, kcf, kbw)
> let BandPassData{ rsnC1 = c1, rsnC2 = c2, rsnC3 = c3,
> rsnYt1 = yt1, rsnYt2 = yt2 } = currData
> a = c1 * sig + c2 * yt1 - c3 * yt2
> rsnData' = currData{ rsnYt1 = a, rsnYt2 = yt1 }
> outA -< a
> where sr = rate (undefined :: p)
> tpidsr = 2 * pi / sr -- tpidsr = two-pi over sr
> update = proc (rsnData, kcf, kbw) -> do
> -- kcf or kbw changed, recalc consts
> let cosf = cos $ kcf * tpidsr -- cos (2pi * freq / rate)
> c3 = exp $ - kbw * tpidsr -- exp (-2pi * bwidth / rate)
> -- (note on csound code) mtpdsr = -tpidsr
> -- c1 Gain for input signal.
> -- c2 (Minused) gain for output of delay 1.
> -- c3 Gain for output of delay 2.
> c3p1 = c3 + 1
> c3t4 = c3 * 4
> c2 = c3t4 * cosf / c3p1
> omc3 = 1 - c3
> c2sqr = c2 * c2
> c1 = case scale of
> 1 -> omc3 * sqrt (1 - c2sqr / c3t4)
> 2 -> sqrt $ (c3p1 * c3p1 - c2sqr) * omc3 / c3p1
> _ -> 1.0
> outA -< rsnData{ rsnKcf = kcf, rsnKbw = kbw, rsnCosf = cosf,
> rsnC1 = c1, rsnC2 = c2, rsnC3 = c3 }
A band stop filter whose transfer function is the complement of
filterBandPass.
Analogous to csound's 'areson' routine.
> filterBandStop :: forall p. Clock p =>
> Int -> Signal p (Double, Double, Double) Double
> filterBandStop scale = proc (sig, kcf, kbw) -> do
> r <- filterBandPass scale -< (sig, kcf, kbw)
> outA -< sig - r
> data ButterData = ButterData !Double !Double !Double !Double !Double
> sqrt2 :: Double
> sqrt2 = sqrt 2
> blpset :: Double -> Double -> ButterData
> blpset freq sr = ButterData a1 a2 a3 a4 a5
> where c = 1 / tan (pidsr * freq)
> csq = c * c; pidsr = pi / sr
> a1 = 1 / (1 + sqrt2 * c + csq)
> a2 = 2 * a1
> a3 = a1
> a4 = 2 * (1 - csq) * a1
> a5 = (1 - sqrt2 * c + csq) * a1
> bhpset :: Double -> Double -> ButterData
> bhpset freq sr = ButterData a1 a2 a3 a4 a5
> where c = tan (pidsr * freq)
> csq = c * c; pidsr = pi / sr
> a1 = 1 / (1 + sqrt2 * c + csq)
> a2 = (-2) * a1
> a3 = a1
> a4 = 2 * (csq - 1) * a1
> a5 = (1 - sqrt2 * c + csq) * a1
> bbpset :: Double -> Double -> Double -> ButterData
> bbpset freq band sr = ButterData a1 a2 a3 a4 a5
> where c = 1 / tan (pidsr * band)
> d = 2 * cos (2 * pidsr * freq)
> pidsr = pi / sr
> a1 = 1 / (1 + c)
> a2 = 0
> a3 = negate a1
> a4 = negate (c * d * a1)
> a5 = (c - 1) * a1
> bbrset :: Double -> Double -> Double -> ButterData
> bbrset freq band sr = ButterData a1 a2 a3 a4 a5
> where c = tan (pidsr * band)
> d = 2 * cos (2 * pidsr * freq)
> pidsr = pi / sr
> a1 = 1 / (1 + c)
> a2 = negate d * a1
> a3 = a1
> a4 = a2
> a5 = (1 - c) * a1
A second-order low-pass Butterworth filter, where 'sig' is the input
signal to be filtered, and 'freq' is the cutoff center frequency.
Analogous to csound's 'butterlp' routine.
> filterLowPassBW :: forall p . Clock p => Signal p (Double, Double) Double
> filterLowPassBW =
> let sr = rate (undefined :: p)
> in proc (sig, freq) -> do
> butter -< (sig, blpset freq sr)
A high-pass Butterworth filter.
Analogous to csound's 'butterhp' routine.
> filterHighPassBW :: forall p . Clock p => Signal p (Double, Double) Double
> filterHighPassBW =
> let sr = rate (undefined :: p)
> in proc (sig, freq) -> do
> butter -< (sig, bhpset freq sr)
A band-pass Butterworth filter where 'band' is the bandwidth.
'filterBandPassBW -< (s, 2000, 100)' will pass only 1950 to 2050 Hz in 's'.
Analogous to csound's 'butterbp' routine.
> filterBandPassBW :: forall p . Clock p =>
> Signal p (Double, Double, Double) Double
> filterBandPassBW =
> let sr = rate (undefined :: p)
> in proc (sig, freq, band) -> do
> butter -< (sig, bbpset freq band sr)
A band-stop Butterworth filter where 'band' is the bandwidth.
'filterBandStopBW -< (s, 4000, 1000)' will filter 's' such that frequencies
between 3500 to 4500 Hz are rejected.
Analogous to csound's 'butterbr' routine.
> filterBandStopBW :: forall p . Clock p =>
> Signal p (Double, Double, Double) Double
> filterBandStopBW =
> let sr = rate (undefined :: p)
> in proc (sig, freq, band) -> do
> butter -< (sig, bbrset freq band sr)
Helper function for various Butterworth filters.
> butter :: Clock p => Signal p (Double,ButterData) Double
> butter = proc (sig, ButterData a1 a2 a3 a4 a5) -> do
> rec let t = sig - a4 * y' - a5 * y''
> y = t * a1 + a2 * y' + a3 * y''
> y' <- delay 0 -< t
> y'' <- delay 0 -< y'
> outA -< y
This filter reiterates input with an echo density determined by loop
time 'looptime'. The attenuation rate is independent and is
determined by 'rvt', the reverberation time (defined as the time in
seconds for a signal to decay to 1/1000 of, or 60dB down from, its
original amplitude). Output from 'filterComb' will appear only after
'looptime' seconds.
Analogous to csound's 'comb' routine.
> filterComb :: Clock p =>
> Double -- loop time in seconds, which determines the "echo
> -- density" of the reverberation. This in turn
> -- characterizes the "color" of the filter whose
> -- frequency response curve will contain 'looptime' *
> -- sr/2 peaks spaced evenly between 0 and sr/2 (the
> -- Nyquist frequency). Loop time can be as large as
> -- available memory will permit.
> -> Signal p (Double, Double) Double
> filterComb looptime =
> let log001 = -6.9078
> del = delayLine looptime
> in proc (sig, rvt) -> do
> let gain = exp (log001 * looptime / rvt)
> rec
> r <- del -< sig + r * gain
> outA -< r
A first-order recursive low-pass filter with variable frequency
response. 'hp' is the response curve's half-power point, in Hertz.
Half power is defined as peak power / sqrt 2.
Analogous to csound's tone routine.
> filterLowPass :: forall p . Clock p => Signal p (Double,Double) Double
> filterLowPass =
> let sr = rate (undefined :: p)
> in proc (sig, hp) -> do
> rec
> let y' = c1 * sig + c2 * y
> b = 2 - cos (2 * pi * hp / sr)
> c2 = b - sqrt (b * b - 1.0)
> c1 = 1 - c2
> y <- delay 0 -< y'
> outA -< y
A high-pass filter whose transfer function is the complement of that
of 'filterLowPass'. The transfer function of 'filterHighPass'
represents the "filtered out" aspects of its complement. However,
power scaling is not normalized in 'filterHighPass' but remains the
true complement of filterLowPass. Thus an audio signal, filtered by
parallel matching 'filterLowPass' and 'filterHighPass', would under
addition simply reconstruct the original spectrum.
> filterHighPass :: Clock p => Signal p (Double,Double) Double
> filterHighPass = proc (sig, hp) -> do
> y <- filterLowPass -< (sig, hp)
> outA -< sig - y
Envelopes
---------
'envLine' generates control or audio signals whose values move linearly
from an initial value to a final one. A common error with this signal
function is to assume that the value of 'b' is held after the time
'dur'. 'envLine' does not automatically end or stop at the end of the
duration given. If your note length is longer than 'dur' seconds, the
resulting value will not come to rest at 'b', but will instead
continue to rise or fall with the same rate. If a rise (or fall) and
then hold is required then 'envLineSeg' should be considered instead.
> envLine :: forall p . Clock p =>
> Double -- Starting value.
> -> Double -- Duration in seconds.
> -> Double -- Value after 'dur' seconds.
> -> Signal p () Double
> envLine a dur b =
> let sr = rate (undefined :: p)
> in proc () -> do
> rec
> y <- delay a -< y + (b-a) * (1 / sr / dur)
> outA -< y
Trace an exponential curve between specified points.
> envExpon :: forall p . Clock p =>
> Double -- Starting value. Zero is illegal for exponentials.
> -> Double -- Duration in seconds.
> -> Double -- Value after 'dur' seconds. For exponentials,
> -- must be non-zero and must agree in sign with 'a'.
> -> Signal p () Double
> envExpon a dur b =
> let sr = rate (undefined :: p)
> in proc () -> do
> rec
> y <- delay a -< y * pow (b/a) (1 / sr / dur)
> outA -< y
Unfortunately, envLine and envExpon cannot be abstracted to a common
function because Template Haskell doesn't like higher-order functions.
> data Tab = Tab [Double] !Int !(UArray Int Double)
> aAt :: Tab -> Int -> Double
> aAt (Tab _ sz a) i = unsafeAt a (min (sz-1) i)
Helper function for envLineSeg and envExponSeg.
> seghlp :: forall p . Clock p =>
> [Double] -- List of points to trace through.
> -> [Double] -- List of durations for each line segment.
> -- Needs to be one element fewer than 'iamps'.
> -> Signal p () (Double,Double,Double,Double)
> seghlp iamps idurs =
> let sr = rate (undefined :: p)
> sz = length iamps
> amps = Tab iamps sz (listArray (0, sz-1) iamps)
> durs = Tab idurs (sz-1) (listArray (0, sz-2) (map (*sr) idurs))
> in proc _ -> do
> -- TODO: this is better defined using 'integral', but which is faster?
> rec
> let (t', i') = if t >= durs `aAt` i
> then if i == sz-2 then (t+1, i) else (0, i+1)
> else (t+1, i)
> i <- delay 0 -< i'
> t <- delay 0 -< t'
> let a1 = aAt amps i
> a2 = aAt amps (i+1)
> d = aAt durs i
> outA -< (a1,a2,t,d)
Trace a series of line segments between specified points.
> envLineSeg :: Clock p =>
> [Double] -- List of points to trace through.
> -> [Double] -- List of durations for each line segment.
> -- Needs to be one element fewer than 'amps'.
> -> Signal p () Double
> envLineSeg amps durs =
> let sf = seghlp amps durs
> in proc () -> do
> (a1,a2,t,d) <- sf -< ()
> outA -< a1 + (a2-a1) * (t / d)
Trace a series of exponential segments between specified points.
> envExponSeg :: Clock p =>
> [Double] -- List of points to trace through.
> -> [Double] -- List of durations for each line segment.
> -- Needs to be one element fewer than 'amps'.
> -> Signal p () Double
> envExponSeg ampinps durs =
> let amps' = case ampinps of
> (a:amps) -> max 0.001 a : amps
> [] -> []
> sf = seghlp amps' durs
> in proc () -> do
> (a1,a2,t,d) <- sf -< ()
> outA -< a1 * pow (a2/a1) (t / d)
Creates a straight-line rise and decay envelope. Rise modifications
are applied for the first 'rise' seconds, and decay from time 'dur' -
'dec'. If these periods are separated in time there will be a steady
state during which the output will remain constant. If the overall
duration idur is exceeded in performance, the final decay will
continue on in the same direction, going negative.
> envASR :: (Clock p) =>
> Double -- rise time in seconds.
> -> Double -- overall duration in seconds.
> -> Double -- decay time in seconds.
> -> Signal p () Double
> envASR rise dur dec =
> let sf = envLineSeg [0,1,1,0] [rise, dur-rise-dec, dec]
> in proc () -> do
> env <- sf -< ()
> outA -< env
Apply an envelope consisting of 3 segments:
1. stored function rise shape
2. modified exponential pseudo steady state
3. exponential decay
Rise modifications are applied for the first 'rise' seconds, and decay
from time 'dur' - 'dec'. If these periods are separated in time the
output will be modified by the first exponential pattern. If rise and
decay periods overlap then both modifications will be in effect for
that time. If the overall duration 'dur' is exceeded in performance,
the final decay will continue on in the same direction, tending
asymptotically to zero.
> envCSEnvlpx :: forall p . Clock p =>
> Double -- rise time in seconds.
> -> Double -- overall duration in seconds.
> -> Double -- decay time in seconds.
> -> Table -- table of stored rise shape.
> -> Double
> -- attenuation factor, by which the last value of the
> -- 'envCSEnvlpx' rise is modified during the note's pseudo
> -- steady state. A factor greater than 1 causes an
> -- exponential growth and a factor less than 1 creates an
> -- exponential decay. A factor of 1 will maintain a true
> -- steady state at the last rise value. Note that this
> -- attenuation is not by fixed rate (as in a piano), but
> -- is sensitive to a note's duration. However, if 'atss'
> -- is negative (or if steady state < 4 k-periods) a fixed
> -- attenuation rate of 'abs' 'atss' per second will be
> -- used. 0 is illegal.
> -> Double
> -- attenuation factor by which the closing steady state
> -- value is reduced exponentially over the decay
> -- period. This value must be positive and is normally of
> -- the order of .01. A large or excessively small value is
> -- apt to produce a cutoff which is audible. A zero or
> -- negative value is illegal.
> -> Signal p () Double
> envCSEnvlpx rise dur dec tab atss atdec =
> let sr = rate (undefined :: p)
> cnt1 = (dur - rise - dec) * sr + 0.5
> -- num of samples in steady state
> mlt1 = pow atss (1 / cnt1)
> mlt2 = pow atdec (1 / sr / dec)
> in proc () -> do
> rec
> i <- countUp -< ()
> let i' = fromIntegral i
> y <- delay (readFromTableRaw tab 0) -< y'
> y' <- case (i' < rise * sr, i' < (dur-dec) * sr) of
> (True, _) -> table tab False -< i' / (rise*sr+0.5)
> (False, True) -> outA -< y * mlt1
> (False, False) -> outA -< y * mlt2
> outA -< y'
GEN routines
------------
All the GEN routines in Csound are normalized by default. In
Euterpea, the names of normalized table generators end in "N"; those
without an "N" are unnormalized
> type TableSize = Int
> type PartialNum = Double
> type PartialStrength = Double
> type PhaseOffset = Double
> type StartPt = Double
> type SegLength = Double
> type EndPt = Double
> type DoubleSegFun =
> (Double, StartPt) -> [(SegLength, EndPt)] -> Double -> Double
Analgous to csound's gen05 routine.
> tableExponN :: TableSize
> -- The size of the table to be produced.
> -> StartPt
> -- The y-coordinate for the start point, (0,y).
> -> [(SegLength, EndPt)]
> -- Pairs of segment lengths and y-coordinates. The segment
> -- lengths are the projection along the x-axis. The first
> -- pair will define the line from (0, startPt) to (segLength,
> -- endPt).
> -> Table
> tableExponN size sp segs = tableExp_ sp segs True size
> tableExpon :: Int -> StartPt -> [(SegLength, EndPt)] -> Table
> tableExpon size sp segs = tableExp_ sp segs False size
> tableExp_ :: StartPt -> [(SegLength, EndPt)] -> Bool -> Int -> Table
> tableExp_ sp segs = funToTable (interpLine sp segs interpExpLine)
Analogous to csound's gen07 routine.
> tableLinearN :: TableSize
> -- The size of the table to be produced.
> -> StartPt
> -- The y-coordinate for the start point, (0,y).
> -> [(SegLength, EndPt)]
> -- Pairs of segment lengths and y-coordinates. The segment
> -- lengths are the projection along the x-axis. The first
> -- pair will define the line from (0, startPt) to (segLength,
> -- endPt).
> -> Table
> tableLinearN size sp segs = tableLin_ sp segs True size
> tableLinear :: Int -> StartPt -> [(SegLength, EndPt)] -> Table
> tableLinear size sp segs = tableLin_ sp segs False size
> tableLin_ :: StartPt -> [(SegLength, EndPt)] -> Bool -> Int -> Table
> tableLin_ sp segs = funToTable (interpLine sp segs interpStraightLine)
Make a table from a collection of sine waves at different delays and
strengths.
Analogous to csound's gen09 routine.
> tableSines3N :: TableSize
> -- The size of the table to be produced.
> -> [(PartialNum, PartialStrength, PhaseOffset)]
> -- List of triples of the partial (0,1,...), partial
> -- strength on [0,1], and phase delay on [0,360].
> -> Table
> tableSines3N size ps = tableSines3_ ps True size
> tableSines3 :: Int -> [(PartialNum, PartialStrength, PhaseOffset)] -> Table
> tableSines3 size ps = tableSines3_ ps False size
> tableSines3_ :: [(PartialNum, PartialStrength, PhaseOffset)] -> Bool -> Int -> Table
> tableSines3_ ps = funToTable (makeCompositeSineFun ps)
> tableSinesF :: (Floating a, Enum a) => [a] -> a -> a
> tableSinesF pss x = let phase = 2 * pi * x
> in sum (zipWith (*) [ sin (phase * pn) | pn <- [1..] ] pss)
Analogous to csound's gen10 routine.
> tableSinesN :: TableSize -> [PartialStrength] -> Table
> tableSinesN size pss = tableSinesN_ pss True size
> tableSines :: Int -> [Double] -> Table
> tableSines size pss = tableSinesN_ pss False size
> tableSinesN_ :: [Double] -> Bool -> Int -> Table
> tableSinesN_ pss = funToTable (tableSinesF pss)
Generates the log of a modified Bessel function of the second kind,
order 0, suitable for use in amplitude-modulated FM.
Analogous to csound's gen12 routine.
> tableBesselN :: TableSize
> -> Double -- specifies the x interval [0 to +xint] over which
> -- the function is defined.
> -> Table
> tableBesselN size xint = tableBess_ xint True size
> tableBessel :: Int -> Double -> Table
> tableBessel size xint = tableBess_ xint False size
> tableBess_ :: Double -> Bool -> Int -> Table
> tableBess_ xint = funToTable (tableBessF xint)
> tableBessF :: Floating s => s -> s -> s
> tableBessF xint x =
> log $ 1 +
> let tsquare = x * x * xint * xint / 3.75 / 3.75
> in sum $ zipWith (*) [ 3.5156229, 3.0899424, 1.2067492,
> 0.2659732, 0.0360768, 0.0045813 ]
> $ iterate (*tsquare) tsquare
Utility functions for tableExpon and tableLinear.
> normalizeSegs :: [(SegLength, entPt)] -> [(SegLength, entPt)]
> normalizeSegs segs =
> let s = sum (map fst segs)
> fact = if (s > 1) then (1/s) else 1 -- don't force max<1 up to max=1
> in map (\(x,y) -> (x*fact, y)) segs
> interpLine :: StartPt
> -- The y-coordinate for the start point (0,y).
> -> [(SegLength, EndPt)]
> -- Pairs of segment lengths (projected on the x-axis)
> -- and y-coordinates (end points).
> -> DoubleSegFun
> -- The function to use for interpolation
> -> Double
> -- The x-coordinate for which to find the
> -- corresponding f(x)=y.
> -> Double
> interpLine sp [] d f = 0 -- catchall case
> interpLine sp points f d = f (0,sp) (normalizeSegs points) d
The exponential interpolation function stretches e^x between two
endpoints for each pair of points.
> interpExpLine :: (Double, StartPt)
> -- The startpoing as (x,y)
> -> [(SegLength, EndPt)]
> -- A list of line segments with (x',y) where x' is
> -- a length projected on the x-axis
> -> Double
> -- The target x-coordinate to find a corresponding
> -- y value for
> -> Double
> interpExpLine (s1, e1) [] d = e1 -- termination case, end of list
> interpExpLine (s1, e1) ((s2, e2):t) d =
> if d > s2 then interpExpLine (s2, e2) t (d-s2) else
> let h = e2 - e1
> x = if h<0 then s2-d else d
> in if s2<=0 then e2 else -- accomodate discontinuities
> (abs h)*((exp (x/s2))-1)/((exp 1)-1) + (min e1 e2)
> interpStraightLine :: (Double, StartPt)
> -- The startpoing as (x,y)
> -> [(SegLength, EndPt)]
> -- A list of line segments with (x',y) where x' is
> -- a length projected on the x-axis
> -> Double
> -- The target x-coordinate to find a corresponding
> -- y value for
> -> Double
> interpStraightLine (s1, e1) [] d = e1 -- termination case, end of list
> interpStraightLine (s1, e1) ((s2, e2):t) d =
> if d > s2 then interpStraightLine (s2, e2) t (d-s2) else
> let h = e2 - e1 -- height of triangle
> s = h/s2 -- slope of triangle
> in if s2<=0 then e2 else
> e1 + (s*d) -- start point plus slope times distance
Function to find a particular point at a particular strength
> makeSineFun :: (PartialNum, PartialStrength, PhaseOffset)
> -- Triple of the partial (0,1,...), partial strength
> -- on [0,1], and phase delay on [0,360].
> -> Double
> -- The x coordinate for which to find f(x)=y
> -> Double
> makeSineFun (pNum, pStrength, pOffset) x =
> let x' = x * 2 * pi -- convert [0,1] to [0,pi] radians
> po = (pOffset/360) * 2 * pi -- convert [0,360] to [0,pi] radians
> in pStrength * sin (x' * pNum + po)
For a particular point, sum all partials.
> makeCompositeSineFun :: [(PartialNum, PartialStrength, PhaseOffset)]
> -- List of triples of the partial (0,1,...),
> -- partial strength on [0,1], and phase delay
> -- on [0,360].
> -> Double
> -- The x coordinate for which to find f(x)=y
> -> Double
> makeCompositeSineFun [] x = 0
> makeCompositeSineFun (p:ps) x = makeSineFun p x + makeCompositeSineFun ps x
--------------------------------------
-- Time events
--------------------------------------
> samples :: forall p . Clock p => Signal p () (SEvent ())
> samples = constA (Just ())
> timeBuilder :: forall p . Clock p => Double -> Signal p () (SEvent ())
> timeBuilder d =
> let r = (rate (undefined :: p))*d
> in proc _ -> do
> rec i <- delay 0 -< if i >= r then i-r else i+1
> outA -< if i < 1 then Just () else Nothing
> milliseconds :: Clock p => Signal p () (SEvent ())
> milliseconds = timeBuilder (1/1000)
> seconds :: Clock p => Signal p () (SEvent ())
> seconds = timeBuilder 1
> countTime :: Clock p => Int -> Signal p () (SEvent ()) -> Signal p () (SEvent ())
> countTime n t = proc _ -> do
> e <- t -< ()
> rec i <- delay 0 -< maybe i' (const $ i'+1) e
> let (i',o) = if i == n then (0, Just ()) else (i, Nothing)
> outA -< o


JavaScript is disabled on your browser.
Skip navigation links
Overview
Package
Class
Use
Tree
Deprecated
Index
Help
Prev Letter
Next Letter
Frames
No Frames
All Classes
A
B
C
D
E
F
G
H
I
L
M
N
O
P
R
S
T
U
V
W
X
Y
Z
O
occupiedTypeTimes
- Variable in class buildingOrderModule.simulator.
ActionSequence
occurrenceMultiplier
- Variable in class buildingOrderModule.stateFactories.actions.executableActions.
TrainUnitActionWorker
OFFSET_LEFT
- Static variable in class buildingOrderModule.
BuildingOrderDisplay
OFFSET_LEFT
- Static variable in class core.
Display
OFFSET_LEFT
- Static variable in class unitControlModule.
UnitControlDisplay
OFFSET_LEFT_TOTAL
- Static variable in class buildingOrderModule.
BuildingOrderDisplay
OFFSET_LEFT_TOTAL
- Static variable in class unitControlModule.
UnitControlDisplay
offsetLeft
- Variable in class core.
Core
onEnd(boolean)
- Method in class core.
CBot
onFrame()
- Method in class core.
CBot
onNukeDetect(Position)
- Method in class core.
CBot
onPlayerDropped(Player)
- Method in class core.
CBot
onPlayerLeft(Player)
- Method in class core.
CBot
onReceiveText(Player, String)
- Method in class core.
CBot
onSaveGame(String)
- Method in class core.
CBot
onSendText(String)
- Method in class core.
CBot
onStart()
- Method in class core.
CBot
onUnitComplete(Unit)
- Method in class core.
CBot
onUnitCreate(Unit)
- Method in class core.
CBot
onUnitDestroy(Unit)
- Method in class core.
CBot
onUnitDiscover(Unit)
- Method in class core.
CBot
onUnitEvade(Unit)
- Method in class core.
CBot
onUnitHide(Unit)
- Method in class core.
CBot
onUnitMorph(Unit)
- Method in class core.
CBot
onUnitRenegade(Unit)
- Method in class core.
CBot
onUnitShow(Unit)
- Method in class core.
CBot
A
B
C
D
E
F
G
H
I
L
M
N
O
P
R
S
T
U
V
W
X
Y
Z
Skip navigation links
Overview
Package
Class
Use
Tree
Deprecated
Index
Help
Prev Letter
Next Letter
Frames
No Frames
All Classes