query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
0ea93849988cfe05dc96dceff18185ea | d6c95f6f8139afcd4bd93e40f26b3bb7 | Sets all writing systems in an FDO multi string from a LanguageForge MultiText field.
Destination is first parameter, like the order of an assignment statement. | namespace SIL.FieldWorks.FDO.FDOTests
[TestFixture]
public class MergeObjectsTests : ScrInMemoryFdoTestBase
[Test]
public void MergeMultiStrings()
{
string eng = "English Bib. Info";
string es = "Inf. Bib. Esp.";
int engWs = Cache.ServiceLocator.WritingSystemManager.GetWsFromStr("en");
int esWs = Cach... | 0 |
9fb237f035d57a7557806f87de7407a6 | 7f2821c0607f5b98d1098de7b97a7c6b | Start both motors. `run-direct` command will allow to vary motor
performance on the fly by adjusting `duty_cycle_sp` attribute. | def start_pwm(left_pwm, right_pwm):
left_pwm.start(INITIAL_PWM_DUTY_CYCLE)
right_pwm.start(INITIAL_PWM_DUTY_CYCLE) | 1 |
e802fc91f8405d713a3c0d651684ac01 | 92352eccc61ab6d3c1f13a852552431e | checks if player owns a country that can attack | public class RandomStrategy implements PlayerBehaviorStrategy, Serializable
private boolean isValidAttacker(Country country){
return country.getArmies()>=2 && country.hasAdjEnemy();
} | 1 |
89e7c1231749d7056fd939f99c36341f | 536e50fa3e0d9dda456b5afb1631b0ef | 测试TomcatStatus链接是否连通,是否能返回数据 | @Service
public class TomcatService implements BaseDynamicService
public String getTomcatStatus(NodeModel nodeModel, HttpServletRequest request) {
return NodeForward.request(nodeModel, request, NodeUrl.Tomcat_GetTomcatStatus).toString();
} | 1 |
0cd68b0fa2424c9756d5b1944017f136 | d55ded29bcfadb0b95c4d29e34f24be4 | 获取法人银行账户户名 | public class RfspC1806BackAccts implements Serializable
public String getBankName() {
return bankName;
} | 0 |
dc02dc5804d752249b68adbfbf411086 | 0acfee28cd65b91937f07f063a34e864 | Sets the default byte order of all new buffers created by this object
the requested byte order for all new buffers | public void setEndian(int endian); | 1 |
53cb71055231c2e8defb5cc195c9a322 | 1bc6e8422ce7906de82df4a8a17d728c | Retrieve Content objects first according to matching criteria and then "copy" them.
Possible values for $matches, refer to method "updateAction". | class eZContentObject extends eZPersistentObject
function contentActionList()
{
$version = $this->attribute( 'current_version' );
$language = $this->initialLanguageCode();
if ( !isset( $this->ContentObjectAttributeArray[$version][$language] ) )
{
$attributeList = $this->c... | 0 |
0f567c49885f70251dcd1e6a45077e22 | e70a2430ac22f713741ab7d8af42f4c9 | Unsets the value of the '{@link org.oasisopen.names.tc.opendocument.xmlns.text.UserIndexSourceType#getUseObjects <em>Use Objects</em>}' attribute.
<!-- begin-user-doc -->
<!-- end-user-doc --> | void unsetUseEnterInMessageMode(); | 0 |
980fa18ad4d51da49b4aa1e1e87deb1f | b8e9f04fba9b2f1c478ad0ce84f27120 | Найти жанр книги по индентификатору | namespace BookShop.Logic
string GetGenreById(int id); | 1 |
3015b9b50af3d6f44b4ef97ada3fc742 | 1de793d31c20f1d21da73e56ae6a8c56 | convert nanosecond to milliseconds on timestamps | public class Timer
private static double nanosecondsToMilliseconds(long timeInNanoseconds) {
return timeInNanoseconds / 1000000.0;
} | 1 |
54ebdfdcdab70cfd1887cf7d0d4b808c | a88328bee77ebced524ed1098d175463 | verify that simplify() works properly | e = Add(x,y)
substs, reduced = cse([e], optimizations=[])
assert substs == []
assert reduced == [x+y] | 0 |
38dadb710f0c953fc4c323f908616df2 | ad2928f61a48595b997facb1d02fdd4a | Get the capacityObjectId property: The object ID of the capacity resource associated with the auto scale v-core
resource. | public class JstatInstrumentorCalculatedImpl implements CalculatedJstatInstrumentor, JstatInstrumentor
public double getOCapacity() {
return raw.getOCapacity();
} | 0 |
fcd796d23d0b6ef1be998d582cc2a778 | 087c8f0f00d989e0de7391d0f36949d0 | Muestra todos los cuerpos de pedido de la base de datos. | class PedidosController extends Controller
public function index()
{
$Pedidos = Pedido::all();
return view('viewsprivadas.pedidos', compact('Pedidos'));
} | 1 |
eec30e4fe536b4ef305ec297e81ab953 | 8be2357d9ea8a42cb1e445b185e81a6d | Called when btnEditorHotspotApply is clicked. | var tmp = $('.nav_container .hotspot_container').clone(), html;
tmp.find('div.ui-resizable-handle').remove().end()
.find('.unit').attr('class', 'unit');
html = tmp.html().replace(/^\s+|\s+$/g, '');
App.Storage.set('hotspot', '');
App.Storage.set('hotspot', html);
} | 1 |
3f2069d14031587a98f279c89c1d4bd5 | 7aa6d0edfdc9868334317b75282a2b46 | Passing the wrong number of arguments to methods will raise exceptions. | class ErrorTest(APITest):
def test_bad_vote_args(self):
self.assertRaises(TypeError, self.congress.votes.by_month, 2010, 11) | 1 |
adc4f7ac0cebe1a691914b7afc75665b | 5ffc32225e234dfad0d3eecfedb97960 | 将本次取出的list中的重复记录删除,针对nagios_servicestatus告警 nagios_servicestatus出现ping异常告警,丢弃该设备的其他告警
nagios_servicestatus出现NRPE异常告警,丢弃该设备的dischealth告警 | List<AlarmDomain> li = null;
try {
String lastTime = timeRecord.get(AlarmTimeRecord.LASTTIME_NAGIOS_SERVICE);
AlarmDomain domain = new AlarmDomain();
if (null != lastTime && !lastTime.equals("")) {
domain.setAlarmTime(lastTime);
}
... | 0 |
70449ce4f2c0df5360643d11692fba04 | c5083e1dadcb7710a696c67f5f5f9b39 | Wait for a DMA channel to be idle. | impl DMAC
pub fn wait_idle(&self, channel_num: dma_channel) {
while !self.is_idle(channel_num) {
}
self.channel_interrupt_clear(channel_num);
} | 1 |
85a649510aad3ab8c291f1d1249260b4 | 8a32f121fcd06a4c32a2d5c34e911205 | Get annotations for the given test case. | {
$annotations = self::parseTestMethodAnnotations(
$className,
$methodName
);
$tickets = array();
if (isset( $annotations['class']['ticket'] )) {
$tickets = $annotations['class']['ticket'];
}
if (isset( $annotations['method']['ticke... | 1 |
70ce94bcf178c30ea6d368519b16593c | 7e991fd7e97ec14f03df9b2025736253 | Prints Header Feature Content Image | $featured_image = Display\Image::featured_image( get_the_ID(), 'full', ['center-block'], TRUE );
if ( empty( $featured_image ) ) { return; }
ob_start();
echo $featured_image['image'];
echo ! empty ( $featured_image['caption'] ) ? "<div class='img-caption'>{$featured_image['caption']}</div>" : ... | 1 |
a6c5d6b992cddf318dd1079f19ce4f17 | c6e77236bac25ca59b960c65274c67a0 | Обновляем описание выбранного примера и обновляем состояние кнопок | {
const UINT dwDemoID = this->pDemoListBoxWidget->GetSelectedItem();
if (!dwDemoID) return;
CDbDemo *pDemo = g_pTheDB->Demos.GetByID(dwDemoID);
ASSERT(pDemo);
if (!pDemo) return;
WSTRING wstr = (const WCHAR*)pDemo->DescriptionText;
const UINT dwAnswerTagNo = ShowTextInputMessage(MID_DescribeDemo, wstr);
if (dwA... | 1 |
4fd42de03c8187f2e214a6304ef4d03e | a27b9d87e22fdcc6905200028ea2a984 | Calculate the harmonic number of a given integer | public class BasicMath
public static double harmonic(int n) {
if(n < 0) return Double.NaN;
double h = 0.0D;
for (int i = 0; i < n; i++) {
h += 1.0 / (i + 1) ;
}
return h;
} | 1 |
b2e42c375c0f8f6688379ad9c1cd0cb8 | c5322518f98f8508f42a29e832ecbada | 根据任务id和用户账号查询段落id | Integer getTaskPropertiesID(Integer properties,Integer taskBill); | 0 |
449fbbd9d84c5481600f4f1a462df697 | a9169c23ea429249907e201fe6692b68 | Retourne une vue représentant cette instance. | class App_Application_Resource_View extends Zend_Application_Resource_ResourceAbstract
public function getView()
{
if (null === $this->_view) {
$this->_options = $this->getOptions();
$this->_view = new App_View($this->_options);
}
return $this->_view;
... | 1 |
71eee1008f6721959c994ae731c3c46f | d75e30cdd7d5d7ce5dc7a581137703f1 | Express the whole genome by expressing each gene indiviudally | def sumOfEx(gene_ex_r):
num = len(gene_ex_r)
temp_ex = 0
sumOfExpr = 0
i = 1
while (i < num):
temp_ex = abs(gene_ex_r[i])
sumOfExpr = sumOfExpr + temp_ex
temp_ex = 0
i = i + 2
return sumOfExpr | 0 |
5224ed7f5d594d5a3d4b6ca044084ae0 | 17de9a1039cd4b99d09250d2b2765299 | Converts tf-idf weight matrix to a pandas df. | class Space(Mapping):
def tf_idf(self, **kwargs):
tfid = TfidfTransformer(**kwargs)
tfidf_matrix = tfid.fit_transform(self.matrix)
return Space(tfidf_matrix, self.row_labels, self.column_labels) | 0 |
72dbc476692fa6257e58ff3e5d303960 | e5e1a8cf746ca6c66764e94355cb49f3 | ConfigGetTempDisplay()
Return the temperature display configuration value
None
uint8_t | {
BSP_TEMP_StatusEnum errorValue;
errorValue = BSP_TEMP_GetRegBuffer(MODE_CONF, configValue);
return errorValue;
} | 0 |
c8220fe4fecadb79acbd5c2d8a61bc12 | b94cc26a6ae993f92a63f483d1e39a97 | Detect javaw.exe via reg.
从注册表中查找可能的javaw.exe位置 | namespace JxCode.Windows.SoftUtility
public class JavaInfo
public static IList<JavaInfo> FindJava()
{
RegistryKey registry;
registry = Registry.LocalMachine.OpenSubKey("SOFTWARE");
IList<JavaInfo> javaInfos = new List<JavaInfo>();
bool is64Bit = Environment.Is... | 0 |
dddbb3ce32ccdcd37fa1c7fb0f811f4d | 858813d05b89e704cb91cb9e9fe7fa7b | Computes all the eigenvalues, and optionally, the eigenvectors of a
complex banded generalized Hermitian-definite eigenproblem (divide-and-
conquer).
http://www.nag.co.uk/numeric/CL/nagdoc_cl23/html/f08/f08uqc.html
TypeError will be raised when the following arguments are not instances
of numpy.ndarray:
ab, bb, w, z
Ty... | from nag4py.util import nag_double_type_check_and_cast
_a = nag_double_type_check_and_cast('f08kgc', a, 'a')
_tau = nag_double_type_check_and_cast('f08kgc', tau, 'tau')
_c = nag_double_type_check_and_cast('f08kgc', c, 'c')
f08kgc_ctypes(order, vect, side, trans, m, n, k, _a, pda, _tau, _c, pdc, fail... | 0 |
c27530bef5e1d611340dcde1387fe5d7 | cdd0518105ab62f1baf34a44f99be723 | Converts map element into a float or returns None if conversion is not possible. | class AnyValueMap(dict, ICloneable):
def get_as_float_with_default(self, key: str, default_value: float) -> float:
value = self.get(key)
return FloatConverter.to_float_with_default(value, default_value) | 0 |
656e69b69613b4c1f57c794d63c02d21 | 16f3dcbf38e3118025d41abeb8eea8f7 | Returns dataframe necessary for frst funnel chart. | class ContentFactory(object):
def funnel_df(self):
return self.fun.create_funnel_df(self.app_version) | 1 |
d01bfdafad4e25b6a67b5265a71bb82e | 7f61448ad6da3ef0f9cb03f40c5be655 | avoid special characters like []\ | cases like (1) | 0 |
b32b3114018d3e13fcf6128df98fd1e2 | 991ac408cca08ee6fef74e6e377a53ef | naive bitscan reverse (BSR) check. | isa_call(ins)
register alpha_instruction ins;
{
return ((ins.branch_format.opcode == op_bsr) ||
((ins.jump_format.opcode == op_j) &&
(ins.jump_format.action & 1)));
} | 1 |
04160929430cd1459fcbcb4e17188703 | c9d20917e60421daa4b7d01704fdca9f | Basic data on query split up according to issue types. | abstract class Issues implements ActiveRecordInterface
public function getSplit()
{
return $this->__split__;
} | 0 |
e1bad460026d1e63ca5377a7415e0887 | 8feae59159aa2ee9be8cb84aab5dc050 | Augments and preprocesses CIFAR-100 images by cropping, flipping, and normalizing.
Preprocessing procedure and values taken from
`pytorch-cifar
<https://github.com/kuangliu/pytorch-cifar/blob/49b7aa97b0c12fe0d4054e670403a16b6b834ddd/main.py#L30-L40>`_. | if not _TORCHVISION_AVAILABLE:
raise ModuleNotFoundError("You want to use `transforms` from `torchvision` which is not installed yet.")
self.flip_lr = transforms.RandomHorizontalFlip(p=0.5)
post_transform = transforms.Compose(
[
transforms.ToTensor(),
... | 1 |
b4053c863635106d6ac9b7fd8ea89d3d | 2e6139b07148aef72687c7b9794c3a0b | Only select executions which are part of a process that have at least one variable with the given value. Byte-arrays and <seealso cref="Serializable"/> objects (which are not primitive type wrappers) are
not supported. | ProcessInstanceQuery variableValueEquals(String name, Object value); | 1 |
2497f869716acdd38d5ee552eee34eef | 18e8b16e504b0ab96cf664b526425a0d | The smallest squared distance between the point and this bounding box. | float CBox::GetDistanceSq(const CVec3& point) const
{
CVec3 near = point;
near = near.Max(min);
near = near.Min(max);
return near.GetDistanceSq(point);
} | 1 |
f98275e3663b85893bc565ac26d2a59e | 0e0dbb472d7af296be492e66d355b266 | ==============================
| Check for overlaps in dates. |
============================== | int
CheckDates (
long hhbrHash,
long dateFrom,
long dateTo)
{
char tmpCurr [4];
sprintf (tmpCurr, "%-3.3s", local_rec.currencyCode);
strcpy (inal2_rec.br_no, local_rec.branchNo);
sprintf (inal2_rec.curr_code, "%-3.3s", tmpCurr);
inal2_rec.hhbr_hash = hhbrHash;
inal2_rec.date_from = 0L;
cc = find_rec (inal2,... | 1 |
50f3218b96fbd003763f0af320d92254 | bb4878d47c9eceadaa03de697d180e12 | Specifies that object dependencies should be checked after object is created and configured. | public class BeanDefinitionDefaults
public void setDependencyCheck(int dependencyCheck) {
this.dependencyCheck = dependencyCheck;
} | 1 |
83a0163f54732e06c9743aa3e46295f4 | 4da9569520c1c4c28982792324fea164 | Récupérer les jeunes inscrits dans le fichier. | public class Projet
public void inscription(File f) {
this.dossier = f.getAbsolutePath();
this.nomFichierCrit = f.getName();
Workbook wb;
String lettre = "";
try {
wb = WorkbookFactory.create(f);
Sheet sheet = wb.getSheet("Inscriptions");
int i... | 1 |
393d5f67b15acded641a4e7108feb57b | d1a22009cab6fbdd4ad88780a141b977 | 查询系统提示语信息-单个查询 | public object GetSysMessage(string UserId, string SysMessageId)
{
LogHandler.WriteServiceLog(UserId, "SysMessageId:" + SysMessageId, "开始", "GetSysMessage", "SysMessageController");
string ErrorMsg = "";
var sysMessage = sysMessageBLL.GetSysMessage(UserId, SysMessageId... | 1 |
d25b6d7f54e08aab2a9af315775c9efe | 7fbf53d70be54d3853bf87c02dada901 | 账户转账事件处理函数 | if (!currAccount && !isAdmin) return ERR_NOTSIGNIN;
int res;
if (isAdmin) {
string fromId, fromId_copy, toId, toId_copy, amount_str;
fromId = EasyX::inputBox("付款卡号:");
if (fromId == "return") return CANCEL;
fromId_copy = fromId;
fromId = MD5(fromId).toStr();
i... | 1 |
d26d4409f069ce596f231900c047e156 | 6554c0d76f8990ed3d7518dd253cec3e | Returns the class name and the event id for which we waiting.
{@inheritDoc} | String[] result;
Throwable t;
StackTraceElement[] trace;
int i;
result = new String[3];
t = new Throwable();
t.fillInStackTrace();
trace = t.getStackTrace();
for (i = 0; i < trace.length; i++) {
if (trace[i].getClassName().equals(Logger.class.getName()))
continue;
if (trace[i].getClassName()... | 0 |
e7112b0a55b2888b2fd9fec4643d147c | 24612db0a9f1318848e2692bd31bae2e | Detect clicks on the alien. | public class Attacks : MonoBehaviour
void detectClick() {
if (Input.touchCount > 0 && Input.GetTouch(0).phase == TouchPhase.Ended) {
onHideoutClick(Camera.main.ScreenToWorldPoint(Input.GetTouch(0).position));
} else if (Input.GetMouseButtonUp(0)) {
onHideoutClick(Camera.main.ScreenToWorldPoint(Input... | 0 |
f39c21436da04418637ef2a177554936 | a84ef40e621e3d305f1ef963b7585696 | Import the csv carton file into the database | {
$saleColumnMax = pow(2, 32);
$dataFile = $this->argument('data-file');
if (!Storage::disk('local')->exists($dataFile)) {
$this->error('Cannot find [' . $dataFile . '] locally, existing ... ');
return 1;
}
$this->info('Found [' . $dataFile . '] locall... | 1 |
f24bb42a785eeca9162f6ce2f17d281c | 6c7fb3edfba9d99386bed0ca0c747185 | 只清除ID不清除其它内容 | function clearid(index){
var newIndex = new Array(0);
for(var i=0;i<index.length;i++){
var flag=true;
var n=newIndex.length;
for(var j=0;j<n;j++)
if(newIndex[j] == index[i])
flag=false;
if(flag)
... | 0 |
fc14c8dcae86cd9151f2e2dd7b2eb3f4 | 50b967ef20ed62de05a83c138c274ff9 | !
\brief Do a few common things to start a connection
Do a few things that are common for setting up
a connection for TCP, FTP and HTTP. | {
ACE_Time_Value tv(MAX_CONN_TIMEOUT_SECOND, MAX_CONN_TIMEOUT_MILLISECOND);
std::stringstream USER, PASS, SYST;
std::string ftp_resp;
if (this->connector_.connect(this->peer_, this->remote_addr_, &tv) == -1)
{
ACE_ERROR_RETURN((LM_ERROR, ACE_TEXT("(%P|%t) %p\n"), ACE_TEXT("conn... | 1 |
e6482c123526fc1c6ef1c9615e2f65ed | 991b3b17d6ad8e0673f3301bf962579c | 規格1と規格2を組み合わせた商品規格を作成 | const m = [];
skuList.forEach(sku => {
m.push(sku.specs);
});
console.log("-*-*-*-" + m)
return new Matrix(m);
} | 0 |
91617ea272e6034bf9ed3d3b9f6c85b1 | d1c25e1412bb08ed8686bec453615ed3 | First select a crop of random size, then resize to desired crop_size. | class PascalBlobGenerator(BlobGenerator):
def _random_crop_image(self,im,fx,fy, proposals=None, gt=None):
crop_size = np.array([fy,fx])
_alert = np.vstack((crop_size>=0.,crop_size<=1.))
assert np.all(_alert), "Crop size must between [0.,1.]"
_im, _proposals, _gt = [None] * 3
h,w ... | 0 |
642c6db14153c6cf0d262213b2aec5a4 | 5594ffd49b7877b2447a5a24473a4e91 | Figure out how many backslashes there are between the indicated
character and either the first non-backslash or the beginning of
the string.
If the number of backslashes is odd, then return True.
Otherwise, return False. | assert amount_back != 0, "What are you trying to do? Get us all killed in a while True? Don't pass 0 to this."
backwards = amount_back < 0
index = -1 if backwards else 0
def get_using():
return self.before if backwards else self.after
return len(get_using()) != 0 and ... | 0 |
c988156f95a945897494d77bb9e52c5f | 8a04e0ba4ae09e26aa06f267a87a1fe7 | When the screen is swipe, the http request is executed | class FirstFragment : BaseFragment(), SwipeRefreshLayout.OnRefreshListener
override fun onRefresh() {
refreshLayout.isRefreshing = true
requestNetwork(true)
} | 1 |
966cc0a66e38aa63d603b6688aa5931e | 99e693f2600aa2e3acc16b9d2b94d160 | generates most active cities stats | city = get_city()
raw_data = pd.read_csv(city)
raw_data['Start Time'] = pd.to_datetime(raw_data['Start Time'])
raw_data['End Time'] = pd.to_datetime(raw_data['End Time'])
month = 0
day = 0
time_period = get_time_period()
if time_period == 'month':
month = get_month()
elif tim... | 0 |
6802116d902aef437d91ef8fedad5df3 | b605c476b99669048a0fe310b9ac5d28 | Test GET paginated questions with page out of range | NON_EXISTING_PAGE_NUMBER = 3
res = self.client().get(f'/questions?page={NON_EXISTING_PAGE_NUMBER}')
payload = json.loads(res.data)
self.assertEqual(res.status_code, 416)
self.assertEqual(payload['message'], 'Requested Range Not Satisfiable') | 1 |
c02e1c2e8506895cdad7d492da314fc9 | 81f0774c0550d5710a9e8821ff9b463a | moves the enemy based on the location of the ball | public class EnemyBSpawnerMovement : MonoBehaviour
void Update() {
transform.position = new Vector3(Mathf.PingPong(Time.time, 20) * direction, transform.position.y, transform.position.z);
} | 0 |
93678ef9893aac2025e00ab17e3bddfb | 863f6246024e8b920f8428164fd6730f | 设置属性columnSize的值. | namespace Akka.Persistence.SqlServer.Journal
public class SqlServerQueryExecutor : AbstractQueryExecutor
internal void SetColumnSizes(JournalColumnSizesInfo columnSizesInfo)
{
_columnSizes = columnSizesInfo;
} | 1 |
0714cead3d1a7a49fd48fd3ccc075dbd | 1cbf470d3b9864a5072e9b7b150e2aac | 优化轨迹 直线合并重合的线段 | def merge(lines, dist_thres, ang_thres):
if lines is None:
return np.array([])
i = 0
while i < lines.shape[0]-1:
ang1 = np.arctan2(lines[i][0]-lines[i][2],lines[i][1]-lines[i][3])
ang2 = np.arctan2(lines[i+1][0]-lines[i+1][2],lines[i+1][1]-lines[i+1][3])
angdiff = np.abs(ang... | 1 |
882fbde5731af6d7358d213b4fd9451a | f1c631872818da992454be258af5395b | 約数の数を数える | int num_divisor(int n){
vector<int> factor;
while(n > 1){
factor.push_back(minFactor[n]);
n /= minFactor[n];
}
factor.push_back(-1);
int cnt=2;
int ret =1;
for(int i=0; i<factor.size()-1; ++i){
if(factor[i] == factor[i+1]){
++cnt;
}
else{
... | 1 |
a226d61ff3ee4ed3ce42f6d306026a1b | a91793929de08698e9cadbe86b85a4e0 | 获得所有支出的一级分类 | namespace Falcon.Services.Expenses
public class ExpensesTypeService : BaseService, IExpensesTypeService
public IEnumerable<ExpensesType> GetAllParentExpensesType(int page, int pageSize, out int total)
{
string key = CacheKeyPrefix + "_GetAllParentExpensesType_" + page + "_" + pageSize + "_Total"... | 1 |
ed43cb9977c380a881204df25dfce446 | 34298eda9c05a44cfc24455c7d4d3c2a | Calculate Convergence Criterion
Calculates the Gelman-Rubin statistic, autocorrelation time factor,
relative change in autocorrellation time, and the number of
independent draws for each parameter, as defined by Ford et
al. (2006) (http://adsabs.harvard.edu/abs/2006ApJ...642..505F).
The chain is considered well-mixed i... | sigma1F=.25, sLength=260, rebal=22):
methods = {'getHRP': getHRP, 'getIVP': getIVP, 'getCLA': getCLA}
stats = {k: pd.Series() for k in methods.keys()}
pointers = range(sLength, nObs, rebal)
for numIter in xrange(int(numIters)):
x, cols = generateData(nObs, sLength, size0,
... | 0 |
9b488aca0b013e7333545f8b5a00461c | cb0fa28ea1a72e26fe9025d0ede4c5fe | Делает лейблы скрытыми | {
Label1.Visible = false;
Label2.Visible = false;
Label3.Visible = false;
Label4.Visible = false;
} | 1 |
e8ac26823b2a3355b496162168bae280 | 948801c3ffaf4f90f5c7c438234ed9e9 | Add difficulty for the game for each type of elements falling. Needed the new velocity of each type and number to decrease time of respawn | {
if ( elementType == STANDARD_ENEMY )
{
if (m_chosenEnemyTimeSpacing > 40)
m_chosenEnemyTimeSpacing = abs(rand()%31);
else if ( m_chosenEnemyTimeSpacing < 10)
m_chosenEnemyTimeSpacing = 10 + abs(rand()%41);
else
m_chosenEnemyTimeSpacing = abs(ra... | 1 |
fa5da9d731c4e6997d2905956acea945 | 7f0f230bf2616a3e8263bf7ca2c2336a | 划分基本块 | void basic_block(){
int inter_pointer = 0;
flow_graph node;
do{
node.front = inter_pointer;
for (; inter_pointer < inter_pro.size(); inter_pointer++){
if (inter_pro[inter_pointer].label == 1){
break;
}
if (inter_pro[inter_pointer].label... | 1 |
91d7daceb6a161d9fc27ddebe97b14bb | 65f20a8e52ae966b372d52802e156d30 | 根据用户Id查询单条投票信息 | {
using (var conn = new SqlConnection(connectString))
{
string sql = "select * from Vote where id=@id";
var data = conn.Query<VoteInfo>(sql, new { id = id }).SingleOrDefault();
return data ?? new VoteInfo();
}
} | 0 |
c36bd6437a282b656cb9e3b22464bba8 | d8e0539b9c78da7ba3ef84bae33f9bfe | Extract the best key length according to the Kasiski examination | {
text = string.Concat(text.Where(c => !char.IsWhiteSpace(c)));
int keylen = 0;
double keylenvalue = 0;
double freqs = 0;
for (int i = 1; i <= maxLen; i++)
{
freqs = 0;
for (int k = 0; k < i; k++)
... | 0 |
40675f2bb1fa14196cffd47e577efc26 | 13e442a3fa2c29b78f9e1170b1918a24 | Gets a state context. | namespace SimpleChat.Controllers.Core
IContextBuilder WithState(string state); | 0 |
314a6273aebed756eeb4f9dedd578abf | 2d662c2cbedea9a2952fb1c0e7612772 | Generate a random eight-digit string to send out as an auth code. | class GroupsController
def generate_code
(0..5).map{rand(36).to_s(36)}.join
end | 0 |
4bf9e25d711d08f68f610c02a56e712d | f37ccaee09aa02c8c02f468f59dfd95b | Checks to see what dress type the given item is. | $category_dress_type_id = Db_Actions::DbSelectRow("SELECT category_dress_type_id FROM cscart_products WHERE product_id=$productID");
if (!isset($category_dress_type_id->empty_result)) {
return $category_dress_type_id->category_dress_type_id;
}
return 0;
} | 1 |
749e271f5cca58c43c0a0fbb77772047 | 64e77ca6fd02301c590743f1b83eb33b | Handles tap on RESTART button on the migration failure screen. | UserPrefs.get(Profile.getLastUsedRegularProfile())
.setBoolean(Pref.INCOGNITO_REAUTHENTICATION_FOR_ANDROID, true);
RecordHistogram.recordEnumeratedHistogram(
"Android.IncognitoReauth.PromoAcceptedOrDismissed",
IncognitoReauthPromoActionType.PROMO_ACCEPTED,... | 0 |
f6a3262ba83d885ee0dab2deb426611c | 07e83966b10eae185a34b28360cd3f2c | 会員かつ、メールアドレスかパスワードが変更された場合、パスワードをチェックする | {
if (Hash::check($request->password, Auth::user()->password)) {
\DB::beginTransaction();
try {
$account = User::find(Auth::id());
$account->fill([
'email' => $request->email,
]);
$account->save();
... | 1 |
dee99177155b8579b9344c116552a565 | a5b9bb26d3e6954c754f07593d1f1faa | 取得末页页码。 | public class Task implements Serializable
public Integer getEndPage() {
return endPage;
} | 1 |
07e951f5501c8026627d90c404c165c6 | f5e554aba1e3cfb9193fbf6c790ebe58 | Translate 'CamelCaseNames' to 'Camel Case Names'.
Used when generating names from view classes. | {
$regex = '/(?<=[a-z])(?=[A-Z])/x';
$words = preg_split($regex, $camelCaseString);
return join($words, ' ');
} | 1 |
0cd2f64dca63a7eac200cfa2e726adf0 | 84c49aaab4d2c8673e5390c2c2971ceb | will compute whether or not a coding gene is highly preserved and if not how recent it is
it uses the phylogenetic distances and the similarities amongst homlogies to try to find a
good proxy | logtMS_yrs = np.log10(1e10 * (1./Ms)**(2.5))
logage = round(logtMS_yrs*.77 / 5e-2) * 5e-2
logages,Mss,Mus,Mbs,Mvs,Mrs,Mis,Mjs,Mhs,Mks = \
np.loadtxt('/Users/ryancloutier/Research/RVInformation/RVFollowupCalculator/InputData/isoc_z019_ubvrijhk.dat',
... | 0 |
81544452baf2de44b0e183ccea2f5145 | 58da9b558a73814bd7cd9b14b7b19916 | Returns all elements but the first of a list | function getAllElementsButFirst(array) {
return array.slice(1);
} | 1 |
f725d124bc6914a33d5b3e51beb96285 | 26c7a2724f450119959cf6c3cd7a2c68 | check if invoice is paid | if not self.is_cancelled and self.is_paid:
return True
else:
return False | 1 |
bb351be319b973aae5d51eac5d4e174c | 3a89884b49bff83a9456631e82bae813 | Returns whether this value is greater or equal to zero. | {
var v = (double)value;
return !(double.IsNaN(v) || double.IsInfinity(v)) && (includeZero ? v >= 0 : v > 0);
} | 1 |
e27719c27cb05d5a28d456144d694696 | fc39049d2bd928381666a1593376842c | 将当前对齐方式更改为居中 | {
if(!m_pGraphEditorMgr && !m_pGraphEditorMgr->graphEditorScene())
return;
m_Alignment = Qt::AlignRight;
alignAlgorithm();
} | 0 |
c2bd536aa86b680c747db1b83273d7d1 | ff00acd7d27426dbfc4003f800774942 | Make a greedy (random) action based on current value (decaying) of epsilon
else make an action based on prediction the NN inside the actor. | class FBAgent:
def act_e_greedy(self, obs, g, update_eps=0.2):
return random.randrange(self.env_params['action']) if random.random() < update_eps else self.act(obs, g).item() | 1 |
25ca24cf082d97109e061a1d2d2b48e8 | b4d8b149e0b3e69402d6db896e179704 | Retrieve a list of all referenced attributes within the filter setting. | class Attribute(SecondaryObject, PrivacyBase, SourceBase, NoteBase):
def get_handle_referents(self):
return self.source_list | 0 |
344ab7712e79f94201ec36c07b92499b | ec0567dd0883c66ee325a002dc7d04bf | get the current player's hunt | function getHunterByDiscordID(discordId) {
if (hunters[discordId] && !('block' in hunters[discordId]))
return hunters[discordId]['hid'];
} | 0 |
e951666b0b349ff5c0657271a4d82598 | 82f3103b64201821b616f211541e7c57 | Nessa primeira especificacao, nada foi definido para o tratamento de
maiusculas/minusculas. Entao, por enquanto, essa funcao nao faz nada... | void converterString(char *variavel) {
int i;
for(i = 0; variavel[i] != '\0'; ++i){
if((variavel[i]>=65)&&(variavel[i]<=90))
variavel[i] = variavel[i] + 32;
}
} | 0 |
e5080c9eececdce5546fd9ab58525687 | 6aeb6f9e76f75a6d9cb7481a4e271fe0 | Return all the enabled item entries. | size_t wxVirtualDataViewCtrl::GetAllDisabledItems(wxVirtualItemIDs &vIDs) const
{
return(GetAllEnabledItems(vIDs, false));
} | 0 |
3b54c626d52e9bac768774f996e5e4b8 | da0950a1c1e24bc6fa8b4133379d875b | Determine the insert idx with a linear search, starting from the end
since mostly we expect to be adding genes that belong only 1 or 2 genes
from the end at most. | {
double randomFitness = m_random.NextDouble() * (GAParams.FitnessTable[GAParams.FitnessTable.Count - 1] == 0 ? 1 : GAParams.FitnessTable[GAParams.FitnessTable.Count - 1]);
int idx = -1;
int mid;
int first = 0;
int last = GAParams.PopulationSize - 1;
mid = (last - first)/2;
whil... | 0 |
5b7dbc6d5e894b20aeb8375de1209e1e | 01594deb0a757db396b30586d3f16110 | Using the Borg design pattern to achieve shared state
between object instances: | if not hasattr(cls, '_instance'):
cls._instance = super(State, cls).__new__(cls)
return cls._instance | 1 |
5effab2b30a6d4bc995e6d194c3835b8 | df4b5a5b03eb33271f62174c13cf87a6 | Part of the integrator. Perform a step of size step_size in the U variables. | class FugModel(metaclass=ABCMeta):
def forward_step_uss(self,ic,num_compartments): | 0 |
57516a53007bbf9509302cb23d44bd34 | 89bfb058145a99df9bbc9d5866bd586d | function that checks the answer the user selects and checks if its correct or not,
this function also checks if there are more questions in the array or not to
either show a 'next' or 'play again' button | function checkAnswer(answer) {
if (answer === state.answer) {
correctAnswer();
} else {
incorrectAnswer();
}
state.gameCount++;
if (state.gameCount < question.length) {
showQuestion();
choiceQuestion();
} else {
gameEnd();
}
} | 1 |
0585ed073d5a600c12b3a392b3800e97 | 5b64c54a1f840d72b0b07cb02d12eee6 | Test deleting an artist by nonexistent ID | class ArtistTests(APITestCase):
def test_update_artist_invalid_id(self):
data = {
'name': 'of Montreal',
'founded_year': 1996,
'description': 'So good.'
}
response = self.client.put('/artists/1', data, format='json')
self.assertEqual(response.status_co... | 0 |
ea22a1df7aac2070a385b6b607f46511 | 6beb57da688e0c7e0f81d4e37d505d18 | 获取最新更新卷 | if self.finalupdateres and #self.finalupdateres > 0 then
for i,res in ipairs(self.finalupdateres) do
if res.count > 0 and i > self.updateversionindex then
self.updateversionindex = i
for i,v in ipairs(res.zipres) do
... | 1 |
e1c2cb36405dba41ef68a67a9dbd98b5 | 908827140454b6cff2a5d54368ccd651 | Tests the draw_lines function. | cwin.clear();
Line x1(Point(3, -9), Point(3, 9));
Line x2(Point(-3, -9), Point(-3, 9));
Line y1(Point(-9, 3), Point(9, 3));
Line y2(Point(-9, -3), Point(9, -3));
cwin << x1 << x2 << y1 << y2;
} | 0 |
9cdd18449aaaad3f863e8dcc35e4c2cd | 7bf17e9b9b8b3b661faf1b056dad3f77 | Get the displayName property: Localizable dimension of the metric. | public class OperationMetaMetricSpecification
public String displayName() {
return this.displayName;
} | 1 |
b77acc71f323987340edcb11a6aafbe7 | ae4640c1842ba974123ef212885eebfa | Test a full stop of the dataset agent, then restart the agent and
confirm it restarts at the correct spot. | log.info("CONFIG: %s", self._agent_config())
self.create_sample_data('first_data.mpk', 'stop_start1.mpk')
self.assert_initialize(final_state=ResourceAgentState.COMMAND)
self.dataset_agent_client.set_resource({DriverParameter.RECORDS_PER_SECOND: 2})
self.assert_start_sampling()
... | 1 |
47283f40d5c980b05a20690a90bf47a9 | 71ba6a5cf80f1a891339befa1d51b8fb | Since we're getting potentially sensitive data (MAC addresses for all devices on the system),
hash all the MAC addresses to provide basic anonymity and security. | func hashedAddressSet(s string) string {
return util.HashForOVN(s)
} | 1 |
a09d92db69991d995b73ec0a8c5b81e4 | 7f374d5bdddd6bff0ebf3bb40ba54018 | add a 2/4 at random available block | c = random.randint(0,len(self.blocks)-1)
new_block = self.blocks[c : c + 1 ][0]
if new_block['type'] != 'O':
c = random.randint(0,len(self.rotations))
if c != len(self.rotations):
new_block = self.rotate(self.rotations[c],new_block)
topy = 0
for [x,y] in new_block['bits']:
... | 0 |
9982d672369ca61b3163e7d4d3bc1e83 | 42382bad8afe5f20794557cfb40db716 | 经度,纬度转sphere球面坐标 | namespace EarthView
namespace World
namespace Spatial3D
namespace Analysis
public class MathUtility3D : EarthView.World.Core.BaseObject
public static EarthView.World.Spatial.Math.Vector3 SphericalToCartesian(double latitude, double longitude, double radius)
{
IntPtr __ptr = EarthView_World_Spatial3... | 0 |
ec0053aa2aff0a6186fdea3a55ffd9e0 | 48fbf6a789fbfc787d6ff52c87605905 | calcula o determinante de uma matriz n=3 | det = matriz[0][0] * matriz[1][1]
det -= matriz[0][1] * matriz [1][0]
return det | 0 |
6b4e1825f85a071fde278daa2d9f4c3c | bf0d193cdbcaa66dd58254aa92837d4b | This method updates the free and in use memory segment textfields. | int freeBlocks = 0;
for (Segment_Object e : segmentList) {
if (e.getObj().getProcessId().equals("0")) {
freeBlocks++;
}
}
directorMap.getMainC().setfreeAndInUseBlocksTxt(Integer.toString(freeBlocks),
Integer.toString((segmentList.size() - freeBlocks)));
} | 1 |
1612abbc56c518a58efd1da81c5cffbd | f6e7c21b7f70c99721cb99292e439105 | Second Order First Derivative in 1D | {
return -((pow((b - a), 3) / 12) * DerivSegF1(a + ((b - a) / 2))) ;
} | 0 |
2129f661e46a5616037fd9c0ba5fbe0c | 32da7d4373972819942030ddb4cb5567 | Atualizar entity do banco de dados com o novo Herói passado em parâmetro | export class HeroService
updateHero(hero: Hero): Observable<Hero> {
return this.http.put<Hero>(this.heroesUrl, hero);
} | 1 |
28bbaa5933b83268bd0ea8bd5e15e6c0 | 677ac2a426bc7534230b2fa6f9da690b | Opens the reporter window | public class ITManagerHelpController
@FXML
void gogenerateReport(MouseEvent event) throws IOException {
MainAllControllers.setWindowVar("ITManagerReports");
MainAllControllers.changeWin();
} | 1 |
6a73598238c44ce734d3de620e9dc7b8 | 232cacf90e43eac2a538c9afbfa17514 | Quit Blender | void ofApp::keyPressed(int key){
if (key == ' ') {
blender.showBlend = !blender.showBlend;
}
else if (key == 'q') {
blender.luminance -= .05;
blender.luminance2 -= .05;
}
else if (key == 'w') {
blender.luminance += .05;
blender.luminance2 += .05;
}
else if (key == 'e') {
blender.blendPower -= .05;
... | 0 |
81817cb0c85f69e8aa6f5d9f91b692a0 | b9e762d0d55b1321cc2f33d6c19d107e | Returns the edge's data. | public class CL_Pokemon
public edge_data get_edge() {
return _edge;
} | 1 |
51b60a9150f7b0a7207676735936d7b3 | ea12d4259c8937ab12f0c176275ae860 | Return smoothed array by the mean filter | float* smoothArray(float* arrPointer, int width, int height, int smoothAreaSize)
{
float* smoothedArr = new float[(width * height)];
for (int y = 0; y < height; y++)
{
for (int x = 0; x < width; x++)
{
smoothAreaSize = (smoothAreaSize % 2 == 0) ? smoothAreaSize - 1 : smoothAreaSi... | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.