query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
bda793ce456ec59919fcaeab46698cb8 | 5329a47cdfae2e3b47a92d51452261ef | Write a histogram summary, for later analysis in TensorBoard's 'Histograms'
and 'Distributions' dashboards (data written using this API will appear in
both places). Like `SummaryFileWriter.scalar` points, each histogram is
The histogram is calculated over all the elements of the given `Tensor`
without regard to its sha... | class Logger(object):
def histo_summary(self, tag, values, step, bins=1000):
counts, bin_edges = np.histogram(values, bins=bins)
hist = tf.HistogramProto()
hist.min = float(np.min(values))
hist.max = float(np.max(values))
hist.num = int(np.prod(values.shape))
hist.sum = f... | 1 |
0a6331fa896570043231f6919bf364d1 | 83722c21607466ba3dd3ebe769977d97 | サイコロを使って、どの事象が起こるか決める | long r = random(4);
if (r < 1) {
play_charge();
} else if (r < 2) {
play_spin();
} else if (r < 3) {
play_merry_go_round();
} else {
play_first_call();
}
} | 1 |
b8661a2c213b70fe2d9bd401906fc794 | 9e0e6afed931df411035bb17f54a6ea7 | Gets the audio player buffer queue interface. | {
SLresult result;
SLDataLocator_AndroidSimpleBufferQueue loc_bufq = {SL_DATALOCATOR_ANDROIDSIMPLEBUFFERQUEUE,
2};
SLDataFormat_PCM format_pcm = {SL_DATAFORMAT_PCM,
1,
SL_SAMPLINGRATE_44_1,
SL_PCMSAMPLEFORMAT_FIXED_16,
SL_PCMSAMPLEFORMAT_FIXED_16,
... | 1 |
8f2b833eef52c48c8f407f10f65327ec | 30175c83c3e16bde447047a634169c42 | is the given handle a valid monitor handle | BOOL BeceemWiMAX_IsValidHandle(PVOID pArg)
{
PBECEEMWIMAX pWiMAX = (PBECEEMWIMAX) pArg;
if(!pWiMAX)
return FALSE;
return DeviceIO_IsValidHandle(&(pWiMAX->m_Device));
} | 0 |
3ecfd1bbcd87895a311033081b41597c | 0ecae02954dd31a58c0c9397c38782ef | Create cfe application directory. | {
$this->appDir = sprintf('%s/%s', $this->baseDir, strtolower($this->appName));
$this->appSrcDir = sprintf('%s/src', $this->appDir);
$this->fs->mkdir($this->appDir);
$this->fs->mkdir($this->appSrcDir);
$this->fs->mkdir($this->appSrcDir . '/Config');
$this->fs->mkdir($... | 1 |
0814ad7a6ea7241ee1a15542ffdba8b6 | f480bcabcaa997fbe61a88798251a14c | Returns 0 based index of the last page | export default class SSliderComponent extends __SLitComponent
getLastPage(): number {
return Math.ceil(this.$slides.length / this.props.slidesByPage) - 1;
} | 1 |
e32f4cef6c84acd9f30d376407cd0cc9 | 3c7e88467d0760a9fa60d950960dbc09 | WHEN ON BUTTON ACTIVATED THIS INVERTS THE AUTO FLAG, SETS THE MANUAL ON COMMAND CODE AND UPDATES THE BUTTON COLOUR | namespace ShivExcelLogging
public partial class FMain : Form
private void btnManual_Click(object sender, EventArgs e)
{
if (dataLogging)
{
btnStart.BackColor = Color.White;
btnStart.ForeColor = Color.Black;
}
btnManual.BackColor... | 1 |
f5e31775d652be9d5cf61c0e903befec | 7385b0775dc7dfe67ad33cdf3f53a213 | Adds node n to the head of the list. | {
n.Prev = _linkHead;
n.Next = _linkHead.Next;
_linkHead.Next.Prev = n;
_linkHead.Next = n;
} | 1 |
423299dd8204ff098d7a408e4f8c6347 | d04d73a466d1f11cbaaef5eec28a8728 | Create an ontology definition for BP. | import pronto
ontology = pronto.Ontology(obo_path)
with gzip.open(obograph_path, "wb") as file:
ontology.dump(file, format="json") | 0 |
b7595f5d0c99ce3980245f3044572a24 | 45ed43d5a3caeb5c7dc3e4605ed34966 | newAggregator returns an instantiated aggregator, ready for use. | func NewPairAggregator(pairName string, windowSize int) *PairAggregator {
return &PairAggregator{
PairName: pairName,
WindowSize: windowSize,
SizedPrices: make([]*SizedPrice, 0),
}
} | 1 |
08355a674bc1703d89e6ae8610ede079 | cc11595bba9c758a040120cd21a993b7 | 展示时固定一行三张图片,计算需要多少行。 | class PhotoGalleryFragment :VisibleFragmentReceiver(),ViewTreeObserver.OnGlobalLayoutListener, SearchView.OnQueryTextListener
override fun onGlobalLayout() {
Log.d(TAG, "onGlobalLayout: width = ${photoRecyclerView.width} , height = ${photoRecyclerView.height}")
val width=photoRecyclerView.width
... | 0 |
5093b662067944a50a736efdfbae5e4d | 4c8ddaa8329290e514f427fc46615063 | 通过openid群发 | {
StringBuilder sb = new StringBuilder();
sb.Append("{");
sb.Append("\"openid_list\"" + ":[");
int index = 0;
foreach (string item in openIdList)
{
if (!string.IsNullOrEmpty(item))
{
index... | 1 |
ecd02208eb31fd3fe78ff8bb3e17d299 | 7172cac58218274b63d3e2d334f59c90 | Given an elevation map find the retention of water which is the sum of all crevices of square size 1 enclosed between two respective elevations spread across the map. | int result = 0;
int[] horizon = new int[grid.length];
int[] vertical = new int[grid[0].length];
for (int i = 0; i < grid.length; i++) {
for (int j = 0; j < grid[0].length; j++) {
if (grid[i][j] > vertical[j])
vertical[j] = grid[i][j];
if (grid[i][j] > horizon[i])
horizon[i] = grid[i][j];
... | 0 |
7bc1bb7a928d673369140b36abe7ffc4 | 7a4321662abba97231a204ea3c27e892 | Look into terminals for a card. If state changed, e.g. terminals / cards switched,
makes necessary steps to be ready to work with this card. No authorization (to SD) is required. | {
char path[11 + 10 + 14 + 1];
int result = -1;
if (card.invalid) {
return -1;
}
sprintf(path, "GET /%ld/card/", acsettings.nodeid);
int len = card.uidlen ? 7 : 4;
for(byte i=0; i < len; i++) {
sprintf(path + strlen(path), "%02X", card.uid[i]);
}
result = get_url(path);
if (result == 1 || re... | 0 |
04effd6e9a6460a6d61a6105aa8f1d57 | 518c763b28416bd08cecb8882a93291c | Cuenta recursivamente la cantidad de nodos internos | int internalnode(struct node * head){
if(head == NULL)
return 0;
if(head-> left == NULL || head-> right == NULL)
return 0;
return internalnode(head->left)+ internalnode(head->right) + 1;
} | 1 |
5687b10ee7f72a300595794c6ac9bcc5 | 8cbaad95a0bb664bfa04009def8300da | Rotate 90 degrees clockwise from the facing direction | {
swapMouth();
swapEyes();
if (this.direction == "Right")
this.direction = "Left";
else
this.direction = "Right";
} | 0 |
0d95d525efb1076fe262ea967ca49ae9 | bfc63a7fe368864bb5da53ed4526b5f6 | Returns the elapsed time (in seconds) since the last time this function
was called. This elaborate setup is to guard against large spikes in
the time returned by QueryPerformanceCounter(). | os_timeE
os_timeEGet (
void)
{
os_timeE t;
LARGE_INTEGER qpc;
static LONGLONG qpc_freq;
if (qpc_freq == 0){
LARGE_INTEGER frequency;
if(QueryPerformanceFrequency(&frequency)){
qpc_freq = frequency.QuadPart;
}
}
assert(qpc_freq);
QueryPerformanceCounter... | 0 |
3f3ee7662795464e57153becd05cbca8 | f05d152392dbe4ef40e1f5cf8c6c5480 | Class for efficiently collecting the readings from multiple sensors | class Sensors(ConfigurableComponent):
def __init__(self, *args):
super(Sensors, self).__init__('NAVDATA', *args)
self.datatypes = {}
self.sensed = {}
self.referenceframe = {}
self.referenceages = {}
self.changed = False
self.interval = 1
self.passiveinte... | 1 |
5164e47444166e45f805475530814b8c | cc90d153fcccdeffba970d20c2c9fd5d | The value representing the discount factor used to calculate the present value of the principal exchange amount. | @Deprecated
@BeanDefinition
public class FloatingSwapLegDetails extends DirectBean implements Serializable
public void setPaymentDiscountFactors(double[] paymentDiscountFactors) {
JodaBeanUtils.notNull(paymentDiscountFactors, "paymentDiscountFactors");
this._paymentDiscountFactors = paymentDiscountFactors;
} | 1 |
3a690146a4d25fd1f37f678768d5b16d | cbd0a2289556d6f976e85475d022c685 | Get the current name of the uri. | def getName(uriRef):
return str(uriRef).rpartition("/")[2] | 1 |
375e22a9843235ed54ce33adafae9116 | cf48d7dbd4ea19d1f0b258cab7984664 | !\brief Computes the near field at specified points in space after the structure currents have been computed. | std::vector<array_1d<double, 3> >& rValues, const ProcessInfo& rCurrentProcessInfo )
{
} | 0 |
127238ea96be5e115cb9f98d8c2b0c92 | 7a556e26aaf5ba7791abb641771e8550 | Refreshes editor's value using source data. | namespace Rafy.WPF.Editors
public class TiledListReferenceEditor : EntitySelectionPropertyEditor
public void RefreshDataSource()
{
this.ListView.DataLoader.LoadDataAsync(() =>
{
this.SyncValueToSelection(this.ListView);
});
} | 1 |
5cc5a3a2377fe042d398ff23469af2a6 | 50b699005b040c5776a461b24e2166df | 删除数组首元素,并返回其值 | class MyArray implements Iterator{
function shift() {
return array_shift($this->arr);
} | 1 |
e56a9b2e5f9623a3d1c8db7f2f03853f | 4b0b081cc7c6813e45e3046d8c8b4095 | 播放特效,指定时间后删除 | {
GameObject gameObject = null;
if (!str.Contains("/"))
{
gameObject = m_PlayerObject.transform.FindChild(str).gameObject;
}
else
{
gameObject = GameObject.Find(str).gameObject;
}
if (gameObject != null)
{
in... | 0 |
fd11430c77e0d7c72180469db19580e2 | 8ece89e6418705764c928bf093f62da5 | Destructor for Weapon | Weapon::~Weapon(){} | 1 |
601ce1b0ae5aa8c2c506929b20b2f982 | 3fd52f64adbbcb8cb7b81a078add2dcb | Converts a <see cref="T:System.Enum" /> value to a Boolean one if it is one from the
specified in the <paramref name="parameter" /> values. | namespace Microsoft.Samples.Kinect.ControlsBasics
public class EnumToBooleanConverter : IValueConverter
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
return value.Equals(parameter);
} | 1 |
23b066f244fb10c3e16ff080893e9f5c | 13dc852aba6d0fb84c77c4bf447b1535 | Deletes the material type timing. | namespace ADit.Interfaces
string DeleteMaterialTypeTiming(int TypeTiming); | 1 |
aa0827bdd5c1106307ce86011c163594 | 74b45911fe2171b105f7278ce0e78e99 | 执行Hadoop命令移动文件到HDFS上 | public class HDFS2HBase
public static void main(String[] args) {
} | 0 |
8feacfcc3d704eff64e0b9d70ceb7d57 | aae9a4ab2754d34a1123e08cf5cb3202 | Retrieves the given archetype's ranged damage modifier. | {
if (stack != null && compostList.containsKey(new Pair<Integer, Integer>(stack.itemID, stack.getItemDamage())))
{
return compostList.get(new Pair<Integer, Integer>(stack.itemID, stack.getItemDamage())).right();
}
return -1;
} | 0 |
40ea0185a4f3f167c5838b61c319fdb6 | 36d34a83c809e99175c6b1e28d354d2c | Returns number of definitions in the list.
RETURNS | size_t CLRenderInformationBase::getNumColorDefinitions() const
{
return this->mListOfColorDefinitions.size();
} | 1 |
9283b565db7c523f8e4a4070e8a49a1d | e4cbf8349a7e77ed8d3fcb2247a39414 | Returns a string duration of now from a given time | s = now - since
m = math.floor(s / 60)
s -= m * 60
return '%dm %ds' % (m, s) | 1 |
c903c1cd5dbb7652f7130e80e123967a | 373ad1c0009f833b7fcd9baec05292a4 | Check to see if DurationUnits property is set | namespace Amazon.DynamoDBv2.Model
public partial class ConsumedCapacity
internal bool IsSetCapacityUnits()
{
return this._capacityUnits.HasValue;
} | 0 |
dadfeeecdc6b1ecd5f10a54f0e1ea80b | 2f619d0fb80c06d31316c15fa0faf908 | 分配未命名的数据槽。 | public string UnAssignDataProperty(AssignDataReq request)
{
var result = new Response();
try
{
_app.UnAssignData(request);
}
catch (Exception ex)
{
result.Code = 500;
result.Message = ... | 0 |
80b4525e349a41b80631a1713dc65e6a | 4a3dbf5f0cbe65686f92fd7a5c5f8386 | Define a table to be the active table. | print('[newgui] set_table_tab: %r ' % (tblname,))
index = ibswgt.get_table_tab_index(tblname)
ibswgt._table_tab_wgt.setCurrentIndex(index) | 1 |
773da1e2ab8e9bfd503355f71d9dc4f0 | 1c7058ec2f3d0a39cfce2e59d23cc14d | 加载所有的战神之巅玩家信息 | function USER_D:get_all_load_users()
return load_map
end | 0 |
605f517599e3c79e72069b503cea742c | 75e5ebb73b68f79b8f0604f426033747 | Retorna los artículos del kardex. | $sql = "SELECT * FROM kardexes
LEFT JOIN (inventories_categories, inventories)
ON (id_inventory_category = inventory_category_id AND id_inventory=inventory_id)
WHERE id_kardex='".$kardex_status_id."'";
$query = $this->db->query($sql);
return $query->row_arra... | 1 |
7b7b42784d8f25377729a83b9044111c | ef463257f9e7f82ca641feada282b150 | Disables the keyboard controls | {
foreach (Control c in pnlKeyboard.Controls)
{
if (c.Name != "btnPause")
{
c.Enabled = false;
c.BackColor = Color.Gray;
}
}
} | 1 |
b69b236ffb11564c18e6a0feb2c7ff69 | f38de63986a5553060608950304f9feb | 根据订单编号获取订单详情(不验证订单所属客户是否为当前登录客户) | class Order
static function getOrderDetail(&$result,$GET){
if (!Ajax::isLogin($result,$GET)){
return;
}
if (empty($GET["oid"])){
$result["msg"] = "必须传入订单号!";
return;
}
$uid = $_SESSION[$GET["client"]]["uid"];
$oid = $GET["oid"];
... | 0 |
fc8f82c96eb0a8c0461b087481dcf275 | 14236f6974b269b8622f48bb5e6e5ef5 | Закрываем форму при клике вне формы --> | function closeForm() {
document.querySelector('.form-close').addEventListener('click', function(){
console.log("ok");
document.querySelector('.background-form').classList.add('hide');
});
} | 0 |
d4437327585e4b32698d9b348703aa43 | 4caf1db3bfc20df0aaf96481dcf2edf3 | 获取网页中满足指定css选择器的所有元素的指定属性的集合
例如通过getAttrs("img[src]","abs:src")可获取网页中所有图片的链接 | String attribute, String value) {
List<String> result = new ArrayList<String>();
Parser parser;
try {
parser = new Parser(html);
NodeFilter attributeFilter = new HasAttributeFilter(attribute, value);
NodeList divList = parser.extractAllNodesThatMatch(attributeFilter);
if (divList == null || divLis... | 0 |
bf8c7b76c7f8957ad49ba0a73324fe5c | dc82e0dbe1bb90b9cb7ff0b3e1167472 | Prompts the user for an input string and returns the result of get_initials(userinput) | def get_user_input():
return sys.modules["pyzork"].user_input() | 0 |
ced4e0f3b6f2bcb45a1ae2b0132ed45c | 50ecf97c459e71c339fccca943afba20 | Generate an empty tldr file. | return {
'title': undefined,
'source': '',
'target': '',
'extension': 'html',
'blacklist': [
'test', 'public', 'static', 'view',
'views', 'template', 'templates'
],
'readme': '',
'package': undefined,
'template': {
'path': undefined
... | 0 |
17444661c3d3be6c9eb0832ccab8a0fe | a54d4de1235161116e6535f1555bf894 | Obtiene tareas según unos filtros especificados | export class TasksService
async getTasks(filterDto: GetTaskFilteredDto, user: User): Promise<Task[]> {
return await this.taskRepository.getTasks(filterDto, user);
} | 1 |
310f1fa10ddb3c6f0ef7133e3d1bb0ac | 371ee6777fd4e61ad3a6e950705eb0f8 | Devuelve un objeto de tipo Image. | public class Imagenes
public ImageIcon img2(){
return img2;
} | 0 |
32a107d723ab832b71189bffcd1076f1 | 0d1f3de5656672aa0862efb378b04400 | | Read the parameter file input.ffd | ifstream fid(sparams["parfile"], std::ifstream::in);
if (!fid.is_open()) cerr << " error opening " << sparams["parfile"] << endl;
vector<string> segs;
string buff;
while (getline(fid, buff)) {
segs.clear();
split(buff, " ", segs);
if (!segs[0].compare("mode")) {
sparams[segs[0]] = segs[1];
... | 1 |
cdc3f11a7f6be3e701e5211cc191a122 | 776a0f03dc6c2206ff84f1f52ae9492c | Get the distances between two residues —closest atom, not centroid.
Virtual residues may cause problems. | class BioPose(object):
def res_bond_distance(self, resi):
return self.peptide_bond_distances[resi] | 0 |
7c5e41e4a825549d2d67d34f1fe07c31 | 011a262481362aba2a4564bfe5edf567 | Removing the export functionality for the current CRUD. | class ImportExportOldFiles extends Controller
public function destroy($id)
{
$this->index();
} | 0 |
6181b7ce84afe34cf1e713292be87943 | 2c9dbb5200ef2478c1ef5ba2ed07dd95 | Getter for CsvDevice instances. | CSV getC(); | 0 |
ce02d761980ca90690a0bdeda6838163 | 061c2500f30776dca51c8d013ebf7918 | Abstract measurement function for Unladen's bm_* scripts.
Based on the values of options.fast/rigorous, will pass -n {5,50,100} to
the benchmark script. MeasureGeneric takes care of parsing out the running
times from the memory usage data. | functions = {}
for name, func in globals().items():
if name.startswith("_bench"):
name = name[1:]
functions[name] = partial(func, size)
bench = BenchmarkRunner(functions, iterations=iterations)
bench.run()
print(bench.report()) | 0 |
5f7bb8a235228c97163d8195fe3ce6b7 | db297e94037e610b65a6963db87cca40 | Returns the number of channels for the chosen audio output device. | class Pluginloader(object):
def get_output_channel_count(self):
assert self._as_parameter_
return zzub_pluginloader_get_output_channel_count(self) | 1 |
a849f0b4c1ff6301dd53688259b53c9b | 371cc299100b65c3c40f14ad0dcb346d | Gets whether the contest is multiple rounds. | public class SaveDraftContestAction extends ContestAction
public boolean isMultiRound() {
return contestData.isMultiRound();
} | 1 |
2935833523cc80509bd808091ec57e15 | 24d4e1e705b57d6c8d739a313641f5ec | Test generateLines on empty input. | number_of_lines = 1
spec = FWFSpec(
[FWFColumnSpec("a", 0, 4), FWFColumnSpec("b", 4, 5), FWFColumnSpec("c", 9, 6)],
True,
"utf-8",
)
lines = list(generate_fwf_lines(spec, number_of_lines))
assert len(lines) == number_of_lines + 1, "number of lines should be correct"
asser... | 0 |
c4d08393f47381420839ad67ba379ae0 | 2f5372566a83501fe09da74874ae1970 | #Adds Counts To Git Log For Each author/email combination | mergecounts=function(name,outname)
{
count_table=read.table(paste(name[1,1],'_count.txt',sep=''),stringsAsFactors = F,sep='\t')
count_table=count_table[1:(nrow(count_table)-5),]
n1=strsplit(name[1,1],'_')[[1]][1]
n2=strsplit(name[1,1],'_')[[1]][2]
n=paste(n1,n2,sep='_')
colnames(count_table)=c('gene',n)
f... | 0 |
a6b6341b0c74e76e6db20d6940089e29 | 438e68b2d788ca1adee8cdfc7b33cc37 | determine if FTDI string descriptors match monome device pattern | {
int i = 0;
int ad_match_found = 0;
int ad_len;
int ad_type;
while (i < (pResp->data.len - 1))
{
ad_len = pResp->data.data[i];
ad_type = pResp->data.data[i+1];
if (ad_type == 0x09)
{
if(memcmp(pResp->data.data+i+2, deviceNameString, 17) == 0)
{
... | 1 |
8aa4ff778d5f3de8732d5c7d8b370590 | f4b0c8c35e1c1f6f048e01d8c3b81d03 | Create a new one time password for a user | {
event(
app()->version() < '5.4'
? new OneTimePasswordRequested53($this->getUser())
: new OneTimePasswordRequested($this->getUser())
);
$expectJson = app()->version() < '5.4'
? $this->getRequest()->wantsJson()
: $this->getR... | 0 |
383640f3a4100ad8f926de336986025c | 430940d3c24d602c8fcf6d25e08db9ad | 抽象方法,需要子类提供dao | public class Classify1DAO extends HibernateDaoSupport
protected void initDao() {
} | 0 |
08a119ab0ca5262f69644a928602d0a5 | b7bcc7f7c74154f16abc68bf0badef35 | 获取身体状况睡眠选项表列元数据 | public class AdmissionNursingAssessmentDODesc extends DODesc
private IAttrDesc getEu_stzktlADesc(ITableDesc tblDesc){
Attr attrDesc=new Attr("Eu_stzktl", getEu_stzktlCDesc(tblDesc), this);
attrDesc.setJavaType(FType.Integer);
attrDesc.setLabel("身体状况听力");
attrDesc.setNullable(true);
attrDesc.setPersistence(tr... | 0 |
2c624db789f26a50a581f6d774121020 | 6821f671adbd425c2f6e7ed9b9ed947a | 判断文章的内容是否是一篇微信文章的链接 | boolean checkWechatMessage(); | 0 |
0fcad82b94f8ff0207aa59ef157cdb5f | 761654e48e1a0c39408734fbbedb5686 | Get the AS of the "other" interface of the link associated with this interface. | class Interface(models.Model):
def remote_as(self):
return self.remote_interface().AS | 1 |
01ac893e07ae649159ad7edf8c77f933 | 9d483d7e9a2062e042da5d6b624a940f | compute the fitness of every member of the population, in this case
use the distance as measure of fitness, also find the best order in
the population | def sort_fitness(points, population) :
fp = []
for individual in population :
fitness = calc_distance(points, individual)
fp.append((fitness, individual))
fp.sort()
sorted_population = []
for fitness, individual in fp :
sorted_population.append(individual)
return sorted_population | 1 |
3ef4500f0215d2e3bbb77e275e086264 | 99da7f2578e77103e1399fe00aa0aece | sign a raw transaction received from the back-end API, | payload = {'method': "signrawtransaction",
'params': [serializedtx, None, privatekeys]}
response = requests.post(url, data=json.dumps(payload), headers=headers)
response = response.json()['result']
if response['complete'] == True:
return response['hex'] | 1 |
39766834b56ea6740d073479f67924fb | 9aafccb83e43e006a538381f271e63ed | sl左边序列 sr右边序列 p比较的数字 0极小值 1极大值 2递增 3递减 | if(p==q||q==r||p==r){
if(p==q&&q==r){
return 0;
}else{
return 1;
}
}else{
return 2;
}
} | 0 |
f6eda4f2db1fa1195bc55996a94709b2 | cdfad64bd70d307ad81421612cb5a59c | POST: Medida/Crear | class GestionMiscelaneaController extends Controller
public function anadirMedidaAction()
{
if ($this->request->isPost() && $this->security->checkToken()) {
$medida = new Medida();
$medida->assign(Medida::asignarPropiedades($this->request->getPost()));
if (!$medida->valid... | 1 |
5cf96e6888d17dc7f5b34e8077ee32e0 | 2ef8c0fa0bbe9990cd3d7c0483396d40 | Check if argument read buffer empty; if yes, the corresponding stage has no active instruction | unsigned int bufferEmpty()
{
return HWREG(SOC_EDMA30CC_0_REGS + EDMA3CC_IPR) & EDMA3CC_IPR_I0;
} | 1 |
54e59593fbfb936e03a6428b9ee5143a | 360a1bc025f40d5c0457f25e3e679951 | 获取应用活动记录,并存入数据库 | Object dateFlag = params.getAttr("dateFlag");
Object isAdmin = params.getAttr("isAdmin");
List<Map<String, Object>> recordList = new ArrayList<>();
AppResult result = ServiceKey.doCallNoTx(params, ServiceKey.Key_busi_in);
if(result.isSuccess() && result.getRows().size() >0){
recordList = result.getRows();
... | 0 |
8ad58ed9f9b69a5029e2adc16026fd05 | 06f410400f67acf5b12c0044b967bcab | ## Maximisation step | max.its=400, PRINT=FALSE){
S = NULL;
if( !is.null(gg) && !is.null(W) && !is.null(SET) ){
N = length(V(gg))
E = length(E(gg))
Y = rep(0,N)
Y[match(SET,V(gg)$term)] = 1
S = rep(0,N)
t=1
diff=1
while( t < max.its && diff >... | 1 |
0f47e52645e068e660252ed862d7a8c0 | 2d2b3eb517d343aaf5f891006a294bbd | After all fields have been initialized, retrieve initial user list. | export class AdminUserViewComponent implements OnInit
ngOnInit() {
this.getUsers();
} | 1 |
8dfbf920bdbb642c4e4bb229160902f0 | 769a9fe085bfad0c6e53077ac1802ac9 | Normalize values to fit between 0 and 1 | class Attacker():
def _zero_one_norm(self, x):
min_x, max_x = tf.reduce_min(x), tf.reduce_max(x)
return (x - min_x) / (max_x - min_x) | 1 |
21a6a2b83ebf8ef9954c402047ab4d41 | 6254bede7c9e39e4dfeac2ac2d77c460 | returns possible enemy start zones that have been scouted. | local destinations = {}
destinations["sectors/colony"] = true
destinations["sectors/loneconsumer"] = true
destinations["sectors/loneshipyard"] = true
destinations["sectors/lonetrader"] = true
destinations["sectors/lonetradingpost"] = true
destinations["sectors/factoryfield"] = true
desti... | 0 |
52e1f9e31343254aa9b29cec97e43fd2 | 98e527afa37ff5e03cf648b48b045f13 | Plays the control menu click sound. | {
if (this.SoundOn && this.ClickMenu.Count > 0 && this.audioListener != null)
{
AudioClip ac = this.ClickMenu[Random.Range(0, this.ClickMenu.Count)];
this.WorldSource.PlayOneShot(ac);
}
} | 1 |
697de9236d26a91cdd526bb440a75791 | a4a3f800654c45ec287dc256729f3074 | 2.保存本地文件 | @Slf4j
public class FileUtil
public static void saveLocalFile(InputStream inputStream, String url) {
try (OutputStream os = new FileOutputStream(url)) {
byte[] bs = new byte[1024];
int len;
while ((len = inputStream.read(bs)) != -1) {
os.write(bs, 0, len);
... | 1 |
02af0fc02b85ff35288777e2eb4605c9 | 9e43b84bbbe329529f33daec7b9d1095 | checks whether it is opponent piece | def check_opponent(poss):
if poss == "[W]":
return "[B]"
else:
return "[W]" | 1 |
f2f9a8c960c8a3db8dac4b9678eda09e | d75086be32528684a9f4b0d8e5769294 | The field created_at is set only once and updated_at each time the object is modified. | {
parent::beforeSave();
if ($this->isObjectNew() && !$this->getCreatedAt()) {
$this->setCreatedAt($this->dateTime->formatDate(true));
}
$this->setUpdatedAt($this->dateTime->formatDate(true));
return $this;
} | 1 |
d21a9783697ff1eb169b957177cca6d6 | b3df4f728079bd0f33eeafc941c23d01 | Gets information about the system's video card and drivers.
<para> Almost everything returned by this function is highly dependent on the system running the code and should probably not be used to make run-time decisions</para> | new int GetSystemVersion(
[Out] out uint PlatformId,
[Out] out uint Major,
[Out] out uint Minor,
[Out] [MarshalAs(UnmanagedType.LPStr)] StringBuilder ServicePackString,
[In] int ServicePackStringSize,
[Out] out uint ServicePackStringUsed,
... | 0 |
e5f9532e5064126af54744057dd6b8ed | ca19a48023586a98bb84722f7cd12abf | 書庫を処理する | namespace LibraryProcessor
public class LibraryProcessor
public void ProcessBooks()
{
var book = _inQueue.GetNext();
while (book != null)
{
switch (book.Type)
{
case 1:
if(DateTime.Now - book.Che... | 1 |
b8fc6875264605df0c3b9d2a8dcaf741 | bac75bde47ee07dc5c1d47720b329940 | Deletes all CS channels, to be re-added later. | def reset_channels():
app.logger.info(f"reset_channels()")
for key in list(DATA.keys()):
del DATA[key]
return [] | 1 |
7308f4d5abc4aec612d03bcfe3cc20df | 451edf30a0b16b75c94901750a852585 | Return true if the provided map exists | class MapLoader implements Twig_LoaderInterface
public function exists($name) : bool
{
return array_key_exists($name, $this->map);
} | 1 |
6a25e167e9e6a5ef48a8452fc5839986 | 90f1f5bf58af2a2e6db232909b03b396 | Processes different messages that are passed from the ABMController or Person. | public Behavior process(final Message m)
{
if (m.getContent() instanceof Move)
{
Move i = (Move) m.getContent();
if (!i.getDestination().equals(Behavior.PROVIDER)
&& (m.getSender() instanceof MobileReference)
&& (m.getSender().getLocation().equals(
Behavior.PROV... | 1 |
2191f33d8aaa758415d095d726b1395d | ac46d431a87ead908d1a71d9190aad4b | 把订单id 改成新的订单id | {
$data = $this->db->create_mapper('order_detail_tm')->where(['tid' => $tid, 'oid' => $oid])->find_by();
$shop = $this->db->create_mapper('shop')->where(['id' => $data['shop_id']])->find_by();
if ($shop['channel_type'] == 'JD') {
$new_oid = ($created ?: date('Ymd')) . substr(impl... | 1 |
99970a6f5fd8ce4149f8669aeb284f1e | 27a2d4fe0357d14da9cd361f052b1f73 | Tests the distanceLoc2Loc function
Accuracy checked against online calculator http://www.movable-type.co.uk/scripts/latlong.html | def utGeoPos():
utLoc = {
'Saint Petersburg':
{'lat': 60.0, 'lon': 30.3, 'mpd_lat': 111000.0, 'mpd_lon': 55800.0},
'Greenwich':
{'lat': 51.48, 'lon': 0.0, 'mpd_lat': 111000.0, 'mpd_lon': 69470.0},
'Bordeaux':
{'lat': 44.73, 'lon': -0.58, 'mpd_lat': 111000.0, 'mpd_lon': 7885... | 0 |
114372d603b7d23b3639020d93db9206 | b4b5295245480bacc75d26c7dc81d1f1 | Removes the first occurrence of *item*. If not found,
raises a ValueError.
Unlike ``pop()`` and ``popleft()`` this method does not have
an option to block for a specified period of time (to wait for
item). | class Heap(object):
def remove(self, item):
if item not in self:
return
last = self._remove_last()
if last == item:
return
pos = self._index[item]
self._replace(pos, item, last)
self._siftdown(pos) | 0 |
24c6d6676e433fa2d8831b2d15484ab1 | e047fc58547b9f2ae3bccd9ce03e405f | Build the `t.model` dynamic output property. | {
if (!string.IsNullOrEmpty(tsInfo.TypeName))
{
string strInitialOutputValue = PropertyMode switch
{
TypeScriptPropertyMode.Null => " = null",
TypeScriptPropertyMode.Model => $" = {tsInfo.InitialOutputValue}",
_ => "",
};
string strStrictNullCheck = StrictNullChecks && (tsInfo.IsN... | 1 |
3f9a21c2c87264c19f14bf3dcea14904 | 6cd35f97c40dc9df0c633641bd041e07 | All resources that you want shown in sidebar nav. | {
return [
['id' => static::SIDEBAR_DASHBOARD, 'name' => Yii::t('CustomPagesModule.base', 'Dashboard'), 'accessRoute' => '/dashboard'],
['id' => static::SIDEBAR_DIRECTORY, 'name' => Yii::t('CustomPagesModule.base', 'Directory'), 'accessRoute' => '/directory/directory']
];
... | 1 |
3633755541554055dc78edcac1aa9f8a | 4537bbb0d3ebbe494f721ce850969922 | Get nos usuários ativos, que são possível matches, excluindo o usuário que solicitou | Integer obterQuantidadeMatchsAtivosPorBuscaIdAndTiposDoador(Long buscaId, List<TiposDoador> tiposDoador) ; | 0 |
57fed5f6ecd51d5a63317ea4c415f106 | 9c4070c42713a88df5ceb4baa4e36d84 | Free's allocations that span multiple pages | void free_pages(enum pool_flags pf, uint32_t _vaddr, uint32_t _pg_cnt)
{
ASSERT((_vaddr % PG_SIZE) == 0);
uint32_t vaddr = _vaddr, pg_cnt = _pg_cnt;
struct pool *mem_pool = pf == PF_KERNEL ? &kernel_pool : &user_pool;
while(pg_cnt-- > 0)
{
pfree(mem_pool, addr_v2p(vaddr));
page_table_pte_remove(vaddr);
vaddr... | 1 |
8cdcbc0aac684e2bdb3da95336549f75 | 05e50221a420cc34cba8d20e5a96a915 | prepare environment for device info command testing | class UnitTestDeviceUtils(unittest.TestCase):
def setUp(self):
self.conn = mock.Mock()
self.device_utils = AndroidDeviceUtils(self.conn) | 1 |
e163dbf9f8fecf5059ccb0e9de999f61 | 84feef5352d2b797e0e7e5b0932cc959 | Sets a new reverseTktgSegmentsInd
Applies a reverse sequence of the outbound travel to the inbound travel. | class BaseVO
public function setReversedRn($reversedRn) {
$this->_reversedRn = $reversedRn;
} | 0 |
260219b1adef59948d1e1cb7333e64e2 | b29d44cb92c963afe0fbc175461a7f2c | Mets à jour les positions des clients dans les véhicules du planning. | exec("INSERT INTO client_addr(client, type, street, house, flat) " +
"SELECT" +
" t.client_id," +
" adr.type, adr.street, adr.house, adr.flat " +
"FROM tmp_address adr " +
"JOIN tmp_client t ON t.num = adr.num " +
"W... | 0 |
3ae0f4aaf23c0d6cf3e066bd4f992373 | e89d224044c653ab9ece02412c55a877 | 替换zip文件内容 | var (
zipReader *zip.ReadCloser
realZipFileName string
)
if zipReader, err = zip.OpenReader(zipFileName); err != nil {
return
}
defer zipReader.Close()
if "" != destFileName {
if err = os.MkdirAll(destFileName, 0755); nil != err {
return
}
}
for _, zipFile := range zipReader.File {
if zipFi... | 0 |
53f6c67b7009b0cb8eb7f3c311a51b46 | dbec2286dac1752f48e58378ad4b02f1 | beim Laden der Komponente werden zuerst die QueryParameter ausgelesen, um anschließend an die Parameter-Variable angehängt zu werden
dann werden alle Räume von der API abgerufen | this.route.queryParams.subscribe(params => {
this.startTime = params['starttime'];
this.endTime = params['endtime'];
this.category = params['category'];
});
this.Params = (this.startTime === undefined) ? this.Params : this.Params.append('starttime', this.startTime);
this.Params = (this... | 1 |
6c211153b02cc6b3ab22ec834acf64ef | ff5ff902fe3249228c0511aaffd8b98f | Interrupt service routine, called when the button is pressed | static void btn_timer_function(unsigned long data)
{
g_data.state = gpio_get_value(pdata->gpio);
g_data.code = pdata->code;
ispressed = 1;
wake_up(&rwq);
} | 0 |
d9e996a4fe61bbd729067ee766a47289 | 507b235dea862dcffa66b3a5b1ba8495 | Get Config Value for SOAP Retry Limit | if retry:
return retry
elif 'retry' in config.GLOBALS and not config.GLOBALS['retry']:
try:
return float(config.GLOBALS['retry'])
except ValueError:
return 1
else:
return 1 | 1 |
b754c90aeb7949301da08316014e4f3a | b971cf63b45e975a13243e32001ae8bc | Change pull arrow direction (up/down) depends on the social window status (filling screen / not filling). | if(!isSwapping) {
if(emailPanel.position.x > -width / 2)
StartCoroutine(Swap(emailPanel, socialPanel));
else if(downloadPanel.position.x > -width / 2)
StartCoroutine(Swap(downloadPanel, socialPanel));
else if(socialPanel.position.x > -width / 2)
StartCoroutine(SlideOut(socialPanel));
else
... | 0 |
1fd4d2c36779f51b02b18af8951c5118 | 751eefb2ecd98a1b60d2dcaad57d715b | Add Application Insights data collection services to the services container. | namespace AutofacDemo
public class Startup
public IServiceProvider ConfigureServices(IServiceCollection services)
{
services.AddApplicationInsightsTelemetry(Configuration);
services.Replace(ServiceDescriptor.Transient<IControllerActivator, ServiceBasedControllerActivator>());
... | 1 |
4e88a9829bf13e198496f86f877ac624 | 8ca701bc5cb1952bdb598c3631c72ff6 | 计算x和y的数位之和 | {
int ret = 0;
while (a) {
ret += a % 10;
a /= 10;
}
while (b) {
ret += b % 10;
b /= 10;
}
return ret;
} | 1 |
664e30a0fe2583e8429767802c51eb65 | 26f54320509472d5ed0661413d8a0ec1 | test rendering partial with empty set as collection | {
$this->_view->myObjects = null;
$expected = '<div></div>';
$this->assertEquals($expected, $this->_view->render('testPartialCollection'));
} | 1 |
4090679a6c8f414af8d227e2a56e4482 | 0847e0faea9c31c28c6ed09007e1cd7a | POST /observation_states
POST /observation_states.xml | param! :per_page, Integer, default: 10, max: 50, min: 1
param! :page, Integer, default: 1, min: 1
response = StatesService.new(params[:per_page], params[:page]).paginated_list
render json: {
payload: response[:payload],
meta: response[:meta]
}, status: :ok
... | 0 |
7a97a110271d14029a63e8ab3d34ea43 | b978e5cc44cc71d84cc51d06508dcfa7 | Get the unique ID of the resource. | public abstract class AbstractResource
public long getId() {
return this.id;
} | 1 |
964ad64e464a3418e0034c938aeb5702 | f078744009f4e53f720b0f03b6c511c1 | 生成卡密,卡密的组合:[6位随机数字][5位由卡号算出来的值][4位随机字母加数字] | {
$calcFromCardNum = md5($cardNum . $this->CARD_PASS_KEY);
$cardPass = random_string ( 'numeric', 6 ) . substr($calcFromCardNum, 5, 5) . random_string ( 'alnum', 4 );
return $cardPass;
} | 1 |
c4b7c006e434959b501efab047ad3dbe | 211a5098280b0276440ac0d423afb434 | Assosciates an already-loaded Model with the given Model container. | if (not self.__CheckInstance(model_association)): return None
values = ToDictionary(model_association)
filter_expression = None
for role, instance_id in model_association.instance_ids.iteritems():
if role not in self.model_controller.unique_roles_set: continue
if ... | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.