- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我会为穆斯林创建免费的应用程序,该应用程序会通知祈祷时间(纳马斯时间)。
我不知道很多如何测量祈祷时间(纳玛斯时间)。
我看到了一些示例代码,但是这些代码对于我的国家(UZBEKISTAN)来说是错误的。
请显示或解释如何测量乌兹别克斯坦或任何国家(取决于地理位置)的Namaz时间。
最佳答案
import 'dart:collection';
import 'dart:math' as math;
import 'dart:core';
void main() {
double latitude = 41.311081;
double longitude = 69.240562;
double timezone = 5;
// Test Prayer times here
// PrayTime prayers = new PrayTime();
PrayerTime prayers = new PrayerTime();
prayers.setTimeFormat(prayers.getTime24());
prayers.setCalcMethod(prayers.getISNA());
prayers.setAsrJuristic(prayers.getHanafi());
prayers.setAdjustHighLats(prayers.getAdjustHighLats());
List<int>offsets = [0, 0, 0, 0, 0, 0, 0]; // {Fajr,Sunrise,Dhuhr,Asr,Sunset,Maghrib,Isha}
prayers.tune(offsets);
List<String> prayerTimes = prayers.getPrayerTimes(DateTime.now(),
latitude, longitude, timezone);
List<String> prayerNames = prayers.getTimeNames();
for (int i = 0; i < prayerTimes.length; i++) {
print(prayerNames[i] + " - " + prayerTimes[i]);
}
}
class PrayerTime {
// ---------------------- Global Variables --------------------
int _calcMethod; // caculation method
int _asrJuristic; // Juristic method for Asr
int _dhuhrMinutes; // minutes after mid-day for Dhuhr
int _adjustHighLats; // adjusting method for higher latitudes
int _timeFormat; // time format
double _lat; // latitude
double _lng; // longitude
double _timeZone; // time-zone
double _jDate; // Julian date
// ------------------------------------------------------------
// Calculation Methods
int _jafri; // Ithna Ashari
int _karachi; // University of Islamic Sciences, Karachi
int _iSNA; // Islamic Society of North America (ISNA)
int _mWL; // Muslim World League (MWL)
int _makkah; // Umm al-Qura, Makkah
int _egypt; // Egyptian General Authority of Survey
int _custom; // Custom Setting
int _tehran; // Institute of Geophysics, University of Tehran
// Juristic Methods
int _shaffi; // Shafii (standard)
int _hanafi; // Hanafi
// Adjusting Methods for Higher Latitudes
int _none; // No adjustment
int _midNight; // middle of night
int _oneSeventh; // 1/7th of night
int _angleBased; // angle/60th of night
// Time Formats
int _time24; // 24-hour format
int _time12; // 12-hour format
int _time12Ns; // 12-hour format with no suffix
int _floating; // floating point number
// Time Names
List<String> _timeNames;
String _invalidTime; // The string used for invalid times
// --------------------- Technical Settings --------------------
int _numIterations;
// ------------------- Calc Method Parameters --------------------
Map<int, List<double>> _methodParams;
/*
* this.methodParams[methodNum] = new Array(fa, ms, mv, is, iv);
*
* fa : fajr angle ms : maghrib selector (0 = angle; 1 = minutes after
* sunset) mv : maghrib parameter value (in angle or minutes) is : isha
* selector (0 = angle; 1 = minutes after maghrib) iv : isha parameter value
* (in angle or minutes)
*/
List<double> _prayerTimesCurrent;
List<int> _offsets;
PrayerTime() {
this.setCalcMethod(0);
this.setAsrJuristic(0);
this.setDhuhrMinutes(0);
this.setAdjustHighLats(1);
this.setTimeFormat(0);
// Calculation Methods
this.setJafari(0); // Ithna Ashari
this.setKarachi(1); // University of Islamic Sciences, Karachi
this.setISNA(2); // Islamic Society of North America (ISNA)
this.setMWL(3); // Muslim World League (MWL)
this.setMakkah(4); // Umm al-Qura, Makkah
this.setEgypt(5); // Egyptian General Authority of Survey
this.setTehran(6); // Institute of Geophysics, University of Tehran
this.setCustom(7); // Custom Setting
// Juristic Methods
this.setShafii(0); // Shafii (standard)
this.setHanafi(1); // Hanafi
// Adjusting Methods for Higher Latitudes
this.setNone(0); // No adjustment
this.setMidNight(1); // middle of night
this.setOneSeventh(2); // 1/7th of night
this.setAngleBased(3); // angle/60th of night
// Time Formats
this.setTime24(0); // 24-hour format
this.setTime12(1); // 12-hour format
this.setTime12NS(2); // 12-hour format with no suffix
this.setFloating(3); // floating point number
// Time Names
_timeNames = new List<String>();
_timeNames.add("Fajr");
_timeNames.add("Sunrise");
_timeNames.add("Dhuhr");
_timeNames.add("Asr");
_timeNames.add("Sunset");
_timeNames.add("Maghrib");
_timeNames.add("Isha");
_invalidTime = "-----"; // The string used for invalid times
// --------------------- Technical Settings --------------------
this.setNumIterations(1); // number of iterations needed to compute
// times
// ------------------- Calc Method Parameters --------------------
// Tuning offsets {fajr, sunrise, dhuhr, asr, sunset, maghrib, isha}
_offsets = new List<int>(7);
_offsets[0] = 0;
_offsets[1] = 0;
_offsets[2] = 0;
_offsets[3] = 0;
_offsets[4] = 0;
_offsets[5] = 0;
_offsets[6] = 0;
/*
*
* fa : fajr angle ms : maghrib selector (0 = angle; 1 = minutes after
* sunset) mv : maghrib parameter value (in angle or minutes) is : isha
* selector (0 = angle; 1 = minutes after maghrib) iv : isha parameter
* value (in angle or minutes)
*/
_methodParams = new HashMap<int, List<double>>();
// Jafari
List<double> _jValues = [16, 0, 4, 0, 14];
_methodParams[this.getJafari()] = _jValues;
// Karachi
List<double> _kValues = [18, 1, 0, 0, 18];
_methodParams[this.getKarachi()] = _kValues;
// ISNA
List<double> _iValues = [15, 1, 0, 0, 15];
_methodParams[this.getISNA()] = _iValues;
// MWL
List<double> _mwValues = [18, 1, 0, 0, 17];
_methodParams[this.getMWL()] = _mwValues;
// Makkah
List<double> _mkValues = [18.5, 1, 0, 1, 90];
_methodParams[this.getMakkah()] = _mkValues;
// Egypt
List<double> _eValues = [19.5, 1, 0, 0, 17.5];
_methodParams[this.getEgypt()] = _eValues;
// Tehran
List<double> _tValues = [17.7, 0, 4.5, 0, 14];
_methodParams[this.getTehran()] = _tValues;
// Custom
List<double> _cValues = [18, 1, 0, 0, 17];
_methodParams[this.getCustom()] = _cValues;
}
// ---------------------- Trigonometric Functions -----------------------
// range reduce angle in degrees.
double _fixAngle(double a) {
a = a - (360 * ((a / 360.0).floor()));
a = a < 0 ? (a + 360) : a;
return a;
}
//range reduce hours to 0..23
double _fixHour(double a) {
a = a - 24.0 * (a / 24.0).floor();
a = a < 0 ? (a + 24) : a;
return a;
}
// radian to degree
double _radiansToDegrees(double alpha) {
return ((alpha * 180.0) / math.pi);
}
// deree to radian
double _degreesToRadians(double alpha) {
return ((alpha * math.pi) / 180.0);
}
// degree sin
double _dsin(double d) {
return (math.sin(_degreesToRadians(d)));
}
// degree cos
double _dcos(double d) {
return (math.cos(_degreesToRadians(d)));
}
// degree tan
double _dtan(double d) {
return (math.tan(_degreesToRadians(d)));
}
// degree arcsin
double _darcsin(double x) {
double val = math.asin(x);
return _radiansToDegrees(val);
}
// degree arccos
double darccos(double x) {
double val = math.acos(x);
return _radiansToDegrees(val);
}
// degree arctan
double _darctan(double x) {
double val = math.atan(x);
return _radiansToDegrees(val);
}
// degree arctan2
double _darctan2(double y, double x) {
double val = math.atan2(y, x);
return _radiansToDegrees(val);
}
// degree arccot
double darccot(double x) {
double val = math.atan2(1.0, x);
return _radiansToDegrees(val);
}
// ---------------------- Time-Zone Functions -----------------------
// compute local time-zone for a specific date
/* getTimeZone1() {
TimeZone timez = TimeZone.;
double hoursDiff = (timez.getRawOffset() / 1000.0) / 3600;
return hoursDiff;
}
// compute base time-zone of the system
getBaseTimeZone() {
TimeZone timez = TimeZone.getDefault();
double hoursDiff = (timez.getRawOffset() / 1000.0) / 3600;
return hoursDiff;
}
// detect daylight saving in a given date
detectDaylightSaving() {
TimeZone timez = TimeZone.UTC;
double hoursDiff = timez.getDSTSavings();
return hoursDiff;
}*/
// ---------------------- Julian Date Functions -----------------------
// calculate julian date from a calendar date
julianDate(int year, int month, int day) {
if (month <= 2) {
year -= 1;
month += 12;
}
double A = (year / 100.0).floorToDouble();
double B = 2 - A + (A / 4.0).floor();
double JD = (365.25 * (year + 4716)).floor() +
(30.6001 * (month + 1)).floor() +
day +
B -
1524.5;
return JD;
}
/*// convert a calendar date to julian date (second method)
calcJD(int year, int month, int day) {
double J1970 = 2440588.0;
Date date = new Date(year, month - 1, day);
double ms = date.getTime(); // # of milliseconds since midnight Jan 1,
// 1970
double days = (ms / (1000.0 * 60.0 * 60.0 * 24.0)).floorToDouble();
return J1970 + days - 0.5;
}*/
//
// ---------------------- Calculation Functions -----------------------
// ---------------------- Calculation Functions -----------------------
// References:
// http://www.ummah.net/astronomy/saltime
// http://aa.usno.navy.mil/faq/docs/SunApprox.html
// compute declination angle of sun and equation of time
List<double> sunPosition(double jd) {
double D = jd - 2451545;
double g = _fixAngle(357.529 + 0.98560028 * D);
double q = _fixAngle(280.459 + 0.98564736 * D);
double L = _fixAngle(q + (1.915 * _dsin(g)) + (0.020 * _dsin(2 * g)));
// double R = 1.00014 - 0.01671 * [self dcos:g] - 0.00014 * [self dcos:
// (2*g)];
double e = 23.439 - (0.00000036 * D);
double d = _darcsin(_dsin(e) * _dsin(L));
double RA = (_darctan2((_dcos(e) * _dsin(L)), (_dcos(L)))) / 15.0;
RA = _fixHour(RA);
double EqT = q / 15.0 - RA;
List<double> sPosition = new List(2);
sPosition[0] = d;
sPosition[1] = EqT;
return sPosition;
}
// compute equation of time
double equationOfTime(double jd) {
double eq = sunPosition(jd)[1];
return eq;
}
// compute declination angle of sun
double sunDeclination(double jd) {
double d = sunPosition(jd)[0];
return d;
}
// compute mid-day (Dhuhr, Zawal) time
double computeMidDay(double t) {
double T = equationOfTime(this.getJDate() + t);
double Z = _fixHour(12 - T);
return Z;
}
// compute time for a given angle G
double computeTime(double G, double t) {
double D = sunDeclination(this.getJDate() + t);
double Z = computeMidDay(t);
double Beg = -_dsin(G) - _dsin(D) * _dsin(this.getLat());
double Mid = _dcos(D) * _dcos(this.getLat());
double V = darccos(Beg / Mid) / 15.0;
return Z + (G > 90 ? -V : V);
}
// compute the time of Asr
// Shafii: step=1, Hanafi: step=2
double computeAsr(double step, double t) {
double D = sunDeclination(this.getJDate() + t);
double G = -darccot(step + _dtan((this.getLat() - D).abs()));
return computeTime(G, t);
}
// ---------------------- Misc Functions -----------------------
// compute the difference between two times
double timeDiff(double time1, double time2) {
return _fixHour(time2 - time1);
}
// -------------------- Interface Functions --------------------
// return prayer times for a given date
List<String> getDatePrayerTimes(int year, int month, int day, double latitude,
double longitude, double tZone) {
this.setLat(latitude);
this.setLng(longitude);
this.setTimeZone(tZone);
this.setJDate(julianDate(year, month, day));
double lonDiff = longitude / (15.0 * 24.0);
this.setJDate(this.getJDate() - lonDiff);
return computeDayTimes();
}
// return prayer times for a given date
List<String> getPrayerTimes(
DateTime date, double latitude, double longitude, double tZone) {
int year = date.year;
int month = date.month;
int day = date.day;
return getDatePrayerTimes(year, month, day, latitude, longitude, tZone);
}
// set custom values for calculation parameters
void setCustomParams(List<double> params) {
for (int i = 0; i < 5; i++) {
if (params[i] == null) {
params[i] = _methodParams[this._calcMethod][i];
_methodParams[this.getCustom()] = params;
} else {
_methodParams[this.getCustom()][i] = params[i];
}
}
this.setCalcMethod(this.getCustom());
}
// set the angle for calculating Fajr
void setFajrAngle(double angle) {
List<double> params = [angle, -1, -1, -1, -1];
setCustomParams(params);
}
// set the angle for calculating Maghrib
void setMaghribAngle(double angle) {
List<double> params = [-1, 0, angle, -1, -1];
setCustomParams(params);
}
// set the angle for calculating Isha
void setIshaAngle(double angle) {
List<double> params = [-1, -1, -1, 0, angle];
setCustomParams(params);
}
// set the minutes after Sunset for calculating Maghrib
void setMaghribMinutes(double minutes) {
List<double> params = [-1, 1, minutes, -1, -1];
setCustomParams(params);
}
// set the minutes after Maghrib for calculating Isha
void setIshaMinutes(double minutes) {
List<double> params = [-1, -1, -1, 1, minutes];
setCustomParams(params);
}
// convert double hours to 24h format
String floatToTime24(double time) {
String result;
if (time == double.nan) {
return _invalidTime;
}
time = _fixHour(time + 0.5 / 60.0); // add 0.5 minutes to round
int hours = time.floor();
double minutes = ((time - hours) * 60.0).floorToDouble();
if ((hours >= 0 && hours <= 9) && (minutes >= 0 && minutes <= 9)) {
result = "0" + hours.toString() + ":0" + (minutes).round().toString();
} else if ((hours >= 0 && hours <= 9)) {
result = "0" + hours.toString() + ":" + (minutes).round().toString();
} else if ((minutes >= 0 && minutes <= 9)) {
result = hours.toString() + ":0" + (minutes).round().toString();
} else {
result = hours.toString() + ":" + (minutes).round().toString();
}
return result;
}
// convert double hours to 12h format
String floatToTime12(double time, bool noSuffix) {
if (time == double.nan) {
return _invalidTime;
}
time = _fixHour(time + 0.5 / 60); // add 0.5 minutes to round
int hours = (time).floor();
double minutes = ((time - hours) * 60).floorToDouble();
String suffix, result;
if (hours >= 12) {
suffix = "PM";
} else {
suffix = "AM";
}
hours = ((((hours + 12) - 1) % (12)) + 1);
/*hours = (hours + 12) - 1;
int hrs = (int) hours % 12;
hrs += 1;*/
if (noSuffix == false) {
if ((hours >= 0 && hours <= 9) && (minutes >= 0 && minutes <= 9)) {
result = "0" +
hours.toString() +
":0" +
(minutes).round().toString() +
" " +
suffix;
} else if ((hours >= 0 && hours <= 9)) {
result = "0" +
hours.toString() +
":" +
(minutes).round().toString() +
" " +
suffix;
} else if ((minutes >= 0 && minutes <= 9)) {
result = hours.toString() +
":0" +
(minutes).round().toString() +
" " +
suffix;
} else {
result = hours.toString() +
":" +
(minutes).round().toString() +
" " +
suffix;
}
} else {
if ((hours >= 0 && hours <= 9) && (minutes >= 0 && minutes <= 9)) {
result = "0" + hours.toString() + ":0" + (minutes).round().toString();
} else if ((hours >= 0 && hours <= 9)) {
result = "0" + hours.toString() + ":" + (minutes).round().toString();
} else if ((minutes >= 0 && minutes <= 9)) {
result = hours.toString() + ":0" + (minutes).round().toString();
} else {
result = hours.toString() + ":" + (minutes).round().toString();
}
}
return result;
}
// convert double hours to 12h format with no suffix
String floatToTime12NS(double time) {
return floatToTime12(time, true);
}
// ---------------------- Compute Prayer Times -----------------------
// compute prayer times at given julian date
List<double> computeTimes(List<double> times) {
List<double> t = dayPortion(times);
double Fajr =
this.computeTime(180 - _methodParams[this.getCalcMethod()][0], t[0]);
double Sunrise = this.computeTime(180 - 0.833, t[1]);
double Dhuhr = this.computeMidDay(t[2]);
double Asr = this.computeAsr((1 + this.getAsrJuristic()).toDouble(), t[3]);
double Sunset = this.computeTime(0.833, t[4]);
double Maghrib =
this.computeTime(_methodParams[this.getCalcMethod()][2], t[5]);
double Isha =
this.computeTime(_methodParams[this.getCalcMethod()][4], t[6]);
List<double> CTimes = [Fajr, Sunrise, Dhuhr, Asr, Sunset, Maghrib, Isha];
return CTimes;
}
// compute prayer times at given julian date
List<String> computeDayTimes() {
List<double> times = [5, 6, 12, 13, 18, 18, 18]; // default times
for (int i = 1; i <= this.getNumIterations(); i++) {
times = computeTimes(times);
}
times = adjustTimes(times);
times = tuneTimes(times);
return adjustTimesFormat(times);
}
// adjust times in a prayer time array
List<double> adjustTimes(List<double> times) {
for (int i = 0; i < times.length; i++) {
times[i] += this.getTimeZone() - this.getLng() / 15;
}
times[2] += this.getDhuhrMinutes() / 60; // Dhuhr
if (_methodParams[this.getCalcMethod()][1] == 1) {
times[5] = times[4] + _methodParams[this.getCalcMethod()][2] / 60;
}
if (_methodParams[this.getCalcMethod()][3] == 1) {
times[6] = times[5] + _methodParams[this.getCalcMethod()][4] / 60;
}
if (this.getAdjustHighLats() != this.getNone()) {
times = adjustHighLatTimes(times);
}
return times;
}
// convert times array to given time format
List<String> adjustTimesFormat(List<double> times) {
List<String> result = new List<String>();
if (this.getTimeFormat() == this.getFloating()) {
for (double time in times) {
result.add(time.toString());
}
return result;
}
for (int i = 0; i < 7; i++) {
if (this.getTimeFormat() == this.getTime12()) {
result.add(floatToTime12(times[i], false));
} else if (this.getTimeFormat() == this.getTime12NS()) {
result.add(floatToTime12(times[i], true));
} else {
result.add(floatToTime24(times[i]));
}
}
return result;
}
// adjust Fajr, Isha and Maghrib for locations in higher latitudes
List<double> adjustHighLatTimes(List<double> times) {
double nightTime = timeDiff(times[4], times[1]); // sunset to sunrise
// Adjust Fajr
double FajrDiff =
nightPortion(_methodParams[this.getCalcMethod()][0]) * nightTime;
if (times[0] == double.nan || timeDiff(times[0], times[1]) > FajrDiff) {
times[0] = times[1] - FajrDiff;
}
// Adjust Isha
double IshaAngle = (_methodParams[this.getCalcMethod()][3] == 0)
? _methodParams[this.getCalcMethod()][4]
: 18;
double IshaDiff = this.nightPortion(IshaAngle) * nightTime;
if (times[6] == double.nan ||
this.timeDiff(times[4], times[6]) > IshaDiff) {
times[6] = times[4] + IshaDiff;
}
// Adjust Maghrib
double MaghribAngle = (_methodParams[this.getCalcMethod()][1] == 0)
? _methodParams[(this.getCalcMethod())][2]
: 4;
double MaghribDiff = nightPortion(MaghribAngle) * nightTime;
if (times[5] == double.nan ||
this.timeDiff(times[4], times[5]) > MaghribDiff) {
times[5] = times[4] + MaghribDiff;
}
return times;
}
// the night portion used for adjusting times in higher latitudes
double nightPortion(double angle) {
double calc = 0;
if (_adjustHighLats == _angleBased)
calc = (angle) / 60.0;
else if (_adjustHighLats == _midNight)
calc = 0.5;
else if (_adjustHighLats == _oneSeventh) calc = 0.14286;
return calc;
}
// convert hours to day portions
List<double> dayPortion(List<double> times) {
for (int i = 0; i < 7; i++) {
times[i] /= 24;
}
return times;
}
// Tune timings for adjustments
// Set time offsets
void tune(List<int> offsetTimes) {
for (int i = 0; i < offsetTimes.length; i++) {
// offsetTimes length
// should be 7 in order
// of Fajr, Sunrise,
// Dhuhr, Asr, Sunset,
// Maghrib, Isha
this._offsets[i] = offsetTimes[i];
}
}
List<double> tuneTimes(List<double> times) {
for (int i = 0; i < times.length; i++) {
times[i] = times[i] + this._offsets[i] / 60.0;
}
return times;
}
int getCalcMethod() {
return _calcMethod;
}
void setCalcMethod(int calcMethod) {
_calcMethod = calcMethod;
}
int getAsrJuristic() {
return _asrJuristic;
}
void setAsrJuristic(int asrJuristic) {
_asrJuristic = asrJuristic;
}
int getDhuhrMinutes() {
return _dhuhrMinutes;
}
void setDhuhrMinutes(int dhuhrMinutes) {
_dhuhrMinutes = dhuhrMinutes;
}
int getAdjustHighLats() {
return _adjustHighLats;
}
void setAdjustHighLats(int adjustHighLats) {
_adjustHighLats = adjustHighLats;
}
int getTimeFormat() {
return _timeFormat;
}
setTimeFormat(int timeFormat) {
_timeFormat = timeFormat;
}
double getLat() {
return _lat;
}
void setLat(double lat) {
_lat = lat;
}
double getLng() {
return _lng;
}
void setLng(double lng) {
_lng = lng;
}
double getTimeZone() {
return _timeZone;
}
void setTimeZone(double timeZone) {
_timeZone = timeZone;
}
double getJDate() {
return _jDate;
}
void setJDate(double jDate) {
_jDate = jDate;
}
int getJafari() {
return _jafri;
}
void setJafari(int jafari) {
_jafri = jafari;
}
int getKarachi() {
return _karachi;
}
void setKarachi(int karachi) {
_karachi = karachi;
}
int getISNA() {
return _iSNA;
}
void setISNA(int iSNA) {
_iSNA = iSNA;
}
int getMWL() {
return _mWL;
}
void setMWL(int mWL) {
_mWL = mWL;
}
int getMakkah() {
return _makkah;
}
void setMakkah(int makkah) {
_makkah = makkah;
}
int getEgypt() {
return _egypt;
}
void setEgypt(int egypt) {
_egypt = egypt;
}
int getCustom() {
return _custom;
}
void setCustom(int custom) {
_custom = custom;
}
int getTehran() {
return _tehran;
}
void setTehran(int tehran) {
_tehran = tehran;
}
int getShafii() {
return _shaffi;
}
void setShafii(int shafii) {
_shaffi = shafii;
}
int getHanafi() {
return _hanafi;
}
void setHanafi(int hanafi) {
_hanafi = hanafi;
}
int getNone() {
return _none;
}
void setNone(int none) {
_none = none;
}
int getMidNight() {
return _midNight;
}
void setMidNight(int midNight) {
_midNight = midNight;
}
int getOneSeventh() {
return _oneSeventh;
}
void setOneSeventh(int oneSeventh) {
_oneSeventh = oneSeventh;
}
int getAngleBased() {
return _angleBased;
}
void setAngleBased(int angleBased) {
_angleBased = angleBased;
}
int getTime24() {
return _time24;
}
void setTime24(int time24) {
_time24 = time24;
}
int getTime12() {
return _time12;
}
void setTime12(int time12) {
_time12 = time12;
}
int getTime12NS() {
return _time12Ns;
}
void setTime12NS(int time12ns) {
_time12Ns = time12ns;
}
int getFloating() {
return _floating;
}
void setFloating(int floating) {
_floating = floating;
}
int getNumIterations() {
return _numIterations;
}
void setNumIterations(int numIterations) {
_numIterations = numIterations;
}
List<String> getTimeNames() {
return _timeNames;
}
}```
关于algorithm - 识别Namaz在特定国家的时间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61860360/
我使用的是linux的windows子系统,安装了ubuntu,bash运行流畅。 我正在尝试使用make,似乎bash 无法识别gcc。尝试将其添加到 PATH,但没有任何改变。奇怪的是 - cmd
ImageMagick 已正确安装。 WAMP 的“PHP 扩展”菜单也显示带有勾选的 php_imagick。除了 Apache 和系统环境变量外,phpinfo() 没有显示任何 imagick
我是这么想的,因为上限是 2^n,并且考虑到它们都是有限机,n 状态 NFA 和具有 2^n 或更少状态的 DFA 的交集将是有效。 我错了吗? 最佳答案 你是对的。 2^n 是一个上限,因此生成的
我有一个大型数据集,其中包含每日值,指示一年中的特定一天是否特别热(用 1 或 0 表示)。我的目标是识别 3 个或更多特别炎热的日子的序列,并创建一个包含每个日子的长度以及开始和结束日期的新数据集。
我有一个向量列表,每个向量看起来像这样 c("Japan", "USA", "country", "Japan", "source", "country", "UK", "source", "coun
是否有任何工具或方法可以识别静态定义数组中的缓冲区溢出(即 char[1234] 而不是 malloc(1234))? 昨天我花了大部分时间来追踪崩溃和奇怪的行为,最终证明是由以下行引起的: // e
我一直在尝试通过导入制表符分隔的文件来手动创建 Snakemake 通配符,如下所示: dataset sample species frr PRJNA493818_GSE120639_SRP1628
我一直在尝试通过导入制表符分隔的文件来手动创建 Snakemake 通配符,如下所示: dataset sample species frr PRJNA493818_GSE120639_SRP1628
我想录下某人的声音,然后根据我获得的关于他/她声音的信息,如果那个人再次说话,我就能认出来!问题是我没有关于哪些统计数据(如频率)导致人声差异的信息,如果有人可以帮助我如何识别某人的声音? 在研究过程
我希望我的程序能够识别用户何时按下“enter”并继续循环播放。但是我不知道如何使程序识别“输入”。尝试了两种方法: string enter; string ent = "\n"; dice d1;
我创建了这个带有一个参数(文件名)的 Bash 小脚本,该脚本应该根据文件的扩展名做出响应: #!/bin/bash fileFormat=${1} if [[ ${fileFormat} =~ [F
我正在寻找一种在 for 循环内迭代时识别 subview 对象的方法,我基本上通过执行 cell.contentView.subviews 从 UITableView 的 contentView 获
我正在尝试在 Swift 中使用 CallKit 来识别调用者。 我正在寻找一种通过发出 URL 请求来识别调用者的方法。 例如:+1-234-45-241 给我打电话,我希望它向 mydomain.
我将(相当古老的)插件称为“thickbox”,如下所述: 创建厚盒时,它包含基于查询的内容列表。 使用 JavaScript 或 jQuery,我希望能够访问 type 的值(在上面的示例中 t
我想编写一些可以接受某种输入并将其识别为方波、三角波或某种波形的代码。我还需要一些产生所述波的方法。 我确实有使用 C/C++ 的经验,但是,我不确定我将如何模拟所有这些。最终,我想将其转换为微 Co
我创建了一个 for 循环,用于在每个部分显示 8 个项目,但我试图在循环中识别某些项目。例如,我想识别前两项,然后是第五项和第六项,但我的识别技术似乎是正确的。 for (int i = 0; i
如何识别 UIStoryboard? 该类具有创建和实例化的方法,但我没有看到带有类似name 的@property。例如 获取 Storyboard对象 + storyboardWithName:b
如何确定所运行的SQLServer2005的版本 要确定所运行的SQLServer2005的版本,请使用SQLServerManagementStudio连接到SQLServer2005,然后运行
这个问题在这里已经有了答案: How to check whether an object is a date? (26 个答案) 关闭2 年前。 我正在使用一个 npm 模块,它在错误时抛出一个空
我正在制作一个使用 ActivityRecognition API 在后台跟踪用户 Activity 的应用,如果用户在指定时间段(例如 1 小时)内停留在同一个地方,系统就会推送通知告诉用户去散步.
我是一名优秀的程序员,十分优秀!