query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
aebf4f9aab09f22f4b0e3ed6376a39b2 | a51bc4ed7b20a0ad2ea5f229ff902d2d | Changes the master password of the filesystem. | var confFile *configfile.ConfFile
{
var masterkey []byte
var err error
masterkey, confFile, err = loadConfig(args)
if err != nil {
exitcodes.Exit(err)
}
if len(masterkey) == 0 {
log.Panic("empty masterkey")
}
if confFile.IsFeatureFlagSet(configfile.FlagFIDO2) {
tlog.Fatal.Printf("Password cha... | 1 |
f4bfd4baf9a8dca01ef4c03d10fa709c | c1ded9e0033b07e21c9e65c03367cfb2 | Leave the current block in the SymbolTable | class SymbolTable:
def leave_scope(self):
assert(len(self.scope_stack) != 0)
self.scope_stack.pop()
return | 1 |
0bbc6eaded1e17c8f7dafc0d79bea050 | c6fb7d60e192277a5cf5154e8e9c1068 | Primero se genera un número en el intervalo [0;1[ y si este número es menor que el valor de la probabilidad ingresada, se procede a la mutación | void mutation(vector<int> &cromosom){
int index = rand()%(n_bits*2);
if(cromosom[index] == 0){
cromosom[index] = 1;
}else{
cromosom[index] = 0;
}
} | 0 |
1c1b075734b0db0a288f0dfb68acb98e | 18c820fe720fb050c4e64a0f394bd941 | Ajoute une ligne à la table des positions des cibles | {
try
{
if (string.IsNullOrEmpty(textBoxIdPosition.Text) || string.IsNullOrEmpty(textBoxNamePosition.Text))
{
MyFunctions.MessageBlankFields();
}
else
{
int idPosition ... | 1 |
bbdd5573d26334546c644d599f13308e | 0e5ca09fdb58c0fec68287c9727c6337 | 跳转之后关闭当前页面 | function deplayCloseCurrentPage() {
setTimeout(function () {
if (history.length <= 1 || getUrlParamObj()['isFromApp'] == 'true') {
XuntongJSBridge.call('closeWebView');
} else {
history.go(-2);
}
}, 1500);
} | 1 |
396a068294ff8b5a39f0f8e667178ea7 | 20e3533ac614af4f47f8e995981193d3 | Compile year of birth | $today = date('Y-m-d');
$diff = date_diff(date_create($birthDate), date_create($today));
return $diff->format('%y');
} | 0 |
80dddc7dec496664b4fbb10743a83b4d | e5ab6f010a80101890b385e91265de43 | Wandelt die deutschen Topics in englische um, damit diese ordnungsgemäß
in der Nachrichtenbox angezeigt werden können. | if to == 'en':
mod_contents = mwp.parse(contents, 0, True)
for link in mod_contents.ifilter_wikilinks():
link.title.lstrip('Eng:')
if link.title == link.text:
link.text = None
if link.title.startswith('Category:'):
link.title = re.s... | 1 |
432a7b18e413c44349350af3004be41c | 277ba77f627fd526c47e89c360ef8028 | 根据河长获取河流 | namespace ZGM.WUA.BLL
public class PartsBLL
public PartsRiverModel GetRiver(decimal riverId)
{
PartsRiverModel river = partsDAL.GetRiver(riverId);
return river;
} | 1 |
5eee19b7fb27796e282ef17e7b49a3a5 | 3fbcae38b15c42bb870e01c23f455e49 | 设置取消按钮的文本和单击监听事件 | mCancelTxt = cancelText;
if (mTvCancel != null) {
mTvCancel.setText(mCancelTxt);
}
return this;
} | 0 |
9385d0c71a73b32dd2165e50cb7074e1 | bedeb1e8c7cbb37cfaf696bfb61ca42e | Get a certificate from a cluster.
Returns the CA.pem string on success | def _get_certificate(client, vault_base_url, certificate_name):
cert = client.get_certificate(vault_base_url, certificate_name, '')
return cert | 0 |
cf527e5ac6d786b432318273fd062b98 | f952ed8f99d75b07b32348314ae7eda5 | Добавляет к указателю кнопку для открытия внутренней карты | var target = e.target;
while (target != this) {
if ( target.classList.contains("map__pin") ) break;
target = target.parentNode;
}
if (target == this) return;
showCard(target);
} | 0 |
b72fde6359cf03afadbe938c683d1807 | 9583d90bfb6c45e82ee88cca067c91b0 | Searches for unique elements of Sign In page to verify it is opened | return waitUntilElementDisplayed(welcomeBackMsg, 2) &&
waitUntilElementDisplayed(mprMsg, 2) &&
waitUntilElementDisplayed(emailAddrField, 2) &&
waitUntilElementDisplayed(passwordField, 2) &&
waitUntilElementDisplayed(rememberMeCheckBox, 2) &&
... | 1 |
7900d54133fa2378d55bec8d6ff194b1 | a2fda667678b2abbe8eca9f8bd0ad089 | STATIC
Returns the base-10 logarithm of a given number | {
double ret;
ret = log10(intend_float_value(argv[0]));
return intend_create_value(INTEND_TYPE_FLOAT, &ret);
} | 1 |
ba60e1361b923fdfce54791bfccbdd7b | 9d44799aa73914a0c66d932b2bfe35fd | Update the states of the actions created by this object.
\sa createUndoAction()
\sa createRedoAction() | public class UndoAction extends CallableSystemAction
static synchronized void updateStatus() {
if (undoAction == null) {
undoAction = (UndoAction) findObject(UndoAction.class, false);
}
if (redoAction == null) {
redoAction = (RedoAction) findObject(RedoAction.class, false... | 1 |
86e921e457e66826b3bae00483fe9071 | 6f72d9ecaac3781722b51f62d5771f74 | 清空页面hash | function clearHash() {
history.pushState("", document.title, window.location.pathname + window.location.search);
} | 1 |
f4234580900abf91c1e4a400b174728d | 04b9e266a70b39261e6e2116ebae881a | Skip subsite when administrator has turned off page caching. | class BaseSubsiteTest extends SapphireTest
public function objFromFixture($class, $id)
{
Subsite::disable_subsite_filter(true);
$obj = parent::objFromFixture($class, $id);
Subsite::disable_subsite_filter(false);
return $obj;
} | 0 |
93e312a17a27867f07369dc4d58eedf7 | 0d40ecd53288fd4411d3e216de979fe9 | Gets maximum identifier of sealing slab by calculation identifier. | public class BeamParams
public int getMaxSliceId() {
return max_slice_id;
} | 0 |
a44b255483535ddc740b9526bb01ab63 | 98a7b966135092ce226081e3827c6707 | Verifica se uma mão representa um blackjack, ou seja, se contém
exactamente um ás e uma carta de valor 10.
Por exemplo, dada a seguinte mão:
[("A", "P"), ("10", "C")]
A função deve devolver o valor True.
Requires: mao: uma mão (lista de pares de strings (face, naipe))
Ensures: um Booleano (True ou False), consoante a m... | value_list = getValues(hand)
for value in value_list:
if value_list.count(value) == 3:
return True
return False | 0 |
c693b345767a31c71418801f82500acb | 58816b963533d9f6d8704fca54aae69d | Gets the url to the cart page. | public class CastPaymentFormHandler extends CommitOrderFormHandler
public String getCartURL() {
return mCartURL;
} | 1 |
ff64f3df0fd9f3182ac9241399be5eda | 2b757548f905ff3cb52b9afc16f78228 | Возвращает отформатированную дату создания комментария. | class Comment extends CActiveRecord
public function showCreateTime() {
return date('M d, Y', $this->create_time);
} | 1 |
39cf4a55dc9e75af923aff63ce4d8c59 | cf5a45362b97580631a52536cfd8d56f | Frank Grimes is a functional bot and below is his logic since
he is a systematic being
Monday: Follow back
Tuesday: Retweet
Wednesday: Appraisal
Thursday: Insult
Friday: Favourite Tweet and Direct Message recent follower
Saturday: Follow back
Sunday: Retweet | fObj = open('DayLog.csv', 'a')
upperBand, lowerBand, bandWidth = find10BBBounds(symbol)
x, y, bandWidth = find20BBBounds(symbol)
rsi = findRSI(symbol)
price = web.DataReader(symbol, data_source = 'yahoo',
start = datetime.now() - timedelta(days = 5), end = datetime.now())
price = price.iloc[-1]['Close']
upper... | 0 |
67bd435c0b1c384809690bb0f5644fbc | aa6a4812dcc8bc9b402d85dc9177f86e | M�thode permettant de modifier le pr�nom de l'utilisateur. | @ManagedBean
@SessionScoped
public class User
public void setName(String name1){
this.name = name1;
} | 1 |
1cc79a9b0e50b593ff4357cbc479657a | ac67419a1fce67cbd4bd936a75880435 | 面部朝向补间 | public class FSMUnit : FSMBase
void FaceTarget()
{
Vector3 direction = (shortTarget.position - transform.position).normalized;
Quaternion lookRotation = Quaternion.LookRotation(new Vector3(direction.x, 0f, direction.z));
transform.rotation = Quaternion.Slerp(transform.rotation, lookRotation,... | 1 |
8acd05f571851195cb53dacd807b8406 | c63b03e26b1a05b5b91027915570bcce | The number of initial characters which will not be "fuzzified". | public abstract class QueryParserBase extends QueryBuilder implements CommonQueryParserConfiguration
@Override
public void setFuzzyPrefixLength(int fuzzyPrefixLength) {
this.fuzzyPrefixLength = fuzzyPrefixLength;
} | 1 |
4167602f3022be74984487f066568cb8 | e847fe3aa15171bac7a84be59a92b84a | поиск организаций по инн | inn = ""
if ogrn is None:
return inn
s = requests.Session()
res = s.get("https://egrul.nalog.ru/index.html")
res = s.post("https://egrul.nalog.ru",
data={ "vyp3CaptchaToken": "", "page": "", "query": ogrn, "region": "", "PreventChromeAutocomplete": ""})
ans = json.loads(res.t... | 0 |
037d66a2b82b06511e555f6810787db2 | 5814a38c939b2b4c855251b01d718cd6 | Procedure cGen recursively generates code by
tree traversal | static void genDecl( TreeNode * tree)
{ TreeNode * p1, * p2;
int loadFuncLoc,jmpLoc,funcBodyLoc,nextDeclLoc;
int loc;
int size;
switch (tree->kind.decl) {
case FuncK:
if (TraceCode) {
sprintf(buffer, "-> Function (%s)", tree->attr.name);
emitComment(buffer);
}
p1 = tree->ch... | 1 |
068b512a052bd2de5e8e0baff0443c0c | 91acf3fd3839bb0730baf1dd5732f4ec | run the server with message queue from mq_drivers. | driver = furl.furl(url).scheme
if driver not in mq_drivers:
raise NotImplementedError(f"No mq driver named '{driver}'")
publisher_class = mq_drivers[driver]['publisher']
publish = publisher_class(url, 'snapshots', 'fanout', '').publish
run_server(host=host, port=port, publish=publish, pa... | 1 |
b9657ffc51b3b378be4b660fa870a828 | eb7871f52825d4c88fe897c373daef26 | Set the shown zslice | class Volume
setSlice(zIndex) {
console.log("setting slice at" + zIndex);
const datasetDefinition = this.imageData.get('extent', 'spacing', 'origin');
let scalars = this.imageData.getPointData().getScalars();
let increments = this.computeImageDataIncrements(1);
let data = scalar... | 1 |
053021d7b10a48eb3d0d56eda6b5bd96 | bd5e986fbe2d370a22b7ebf04539a4da | 관리자 선택된 페이지에 알맞는 영수증 리스트 조회 | public ArrayList<Return> selectAdminReturnList(PageInfo pi, HashMap<String, String> filter) {
return cDao.selectAdminReturnList(sqlSession, pi, filter);
} | 1 |
2192b93d229473378b37181b04d8a588 | 86100808ac89a937add2a4a10b6066b2 | Message displayed in notification when new device registered against the user account. | void deviceNotRegistered(); | 0 |
81622e72eb9335f5344ad162a68337b2 | 681800ca6adace6ee35e6ad79fdee30e | Validate attributes for assigning already assigned user ids | class CreateOperationsSerializer(serializers.ModelSerializer):
def validate_user_id(self, data):
try:
usr = User.objects.get(id=data)
except User.DoesNotExist:
raise serializers.ValidationError("🚨 The user does not exist. 🚨")
return data | 1 |
960014bca8de30c03f4e177032622e1d | 5aeed9c88bbab4be9f17ed493fe11c2c | fix forward references | bool
AST_Decl::is_fwd (void)
{
return false;
} | 0 |
8451d799b627c0f2452863c8aeb9f33a | c5295efd03a7b0f5e9c6ff7952d2e028 | Event called for every transmitted bytes. | void onDataTransmitted(); | 1 |
705aca492ba48f3da84271d93fb1f536 | 759e508844ad7ac14440d2509a71a383 | Sets the <see cref="CurrentItem"/> property to the last item in the collection. | namespace System.ComponentModel
bool MoveCurrentToLast(); | 1 |
8c5c828116dc808456cf0da3acb85060 | 3e6c0aeb0702e85014140e4e8f1cc190 | Initialize arrays for thermal evolution | self.nT = self.doy.max() + 1
self.nB = 7
self.nK = 3
self.x_p = np.zeros((self.nT, self.nB * self.nK))
self.C_p = np.zeros((self.nT,self.nB * self.nK, 3))
self.x = np.zeros((self.nT,self.nB * self.nK))
self.C = np.zeros((self.nT,self.nB * self.nK, 3))
s... | 1 |
03d727c78459dfac42e1c3f63b3a7737 | a339fb950a894734fa871e285f5eb903 | Left clicked on the next button. | class SGF_Board(tkinter.Canvas):
def handle_key_NEXT(self):
for n in range(10):
try:
self.node = self.node.children[0]
except IndexError:
break
self.node_changed() | 0 |
ccc27ee3a97ed0c0694de9fa10f994ee | 8d3d0850c8eec28acd35c5466f6411b7 | Update the abandoned carts list and act on the results. | class Quote
public function processAbandonedCarts()
{
$result = [];
$stores = $this->helper->getStores();
foreach ($stores as $store) {
$storeId = $store->getId();
$websiteId = $store->getWebsiteId();
$result = $this->processAbandonedCartsForCustomers($sto... | 1 |
dfa580c4b351753eeac4b71c7829f964 | b86da7f08321cdf688a42e0f77065a8b | CETTE FONCTION EST "LA MÊME" QUE "Aff_Tir_J1" MAIS CORRESPOND AU J2 | public class Jeu
public void tirAlea(int i) {
int k = 0;
if (i == 0) {
boolean b = true;
while (b && k < 1000) {
k += 1;
int x1;
int y1;
int x;
x = (int) (Math.random() * 100);
... | 0 |
3c3a766ea99852192a90c93b52aea857 | d6cbf8d284847f80e59824570fd7a9d7 | 去除对象数组中重复的对象,键值对必须完全一样的数据才去除 | export class OrderPage
deteleObject(obj) {
var uniques = [];
var stringify = {};
for (var i = 0; i < obj.length; i++) {
var keys = Object.keys(obj[i]);
keys.sort(function(a, b) {
return (Number(a) - Number(b));
});
var str = '';
for (var j = 0; j < keys.l... | 1 |
fec515121074ce08486d23d89723142e | b79d339d226bcd97df664184b25a3be6 | 取得图片分类ID列表 | @Controller
@RequestMapping("/wx/test/")
public class TestController extends BaseController
@RequestMapping(value = "getClassify", method = RequestMethod.GET)
@ResponseBody
public Object getClassify(){
List list=new ArrayList<>();
try{
list=ProUtil.getCatId();
}catch(Exception e){
e.printStackTrace();
}... | 1 |
21481776bc15b5ff0255b6f13e07dcec | 9d4d962a43fedb7b9c8c379149f71826 | Returns a platform configuration for VoLTE which may override the user
setting on a per Slot basis. | public class MSimPhoneGlobals extends PhoneGlobals
@Override
public int getVoiceSubscription() {
return MSimPhoneFactory.getVoiceSubscription();
} | 0 |
26bb24b176f034a2b777c05c229dd82d | c5bfd1b8cfc5d856e0f80d556fd0a552 | Function Name: `$INSTANCE_NAME`_SetEndpointHalt
This routine handles set endpoint halt
None | {
epNumber &= myUSB_DIR_UNUSED;
if ((epNumber > myUSB_EP0) && (epNumber < myUSB_MAX_EP))
{
myUSB_EP[epNumber].hwEpState |= myUSB_ENDPOINT_STATUS_HALT;
myUSB_EP[epNumber].epToggle = 0u;
myUSB_EP[epNumber].apiEpState = myUSB_NO_EVENT_ALLOWED;
if ((myUSB_EP[epNumber].addr & myUS... | 1 |
0cada7acdf832adc7603ee028ce0ec34 | 4ff3e391b0f674e0c63855414c247160 | Methode executée quand on clique sur une ligne du tableau des sous-tache | $("#nbr_piece_label").hide();
$("#nbr_piece").hide();
$("#m_carre_label").hide();
$("#m_carre").hide();
indice = value;
id_sous_categorie = aofsouscategorie_tri[indice]["id_sous_categorie"];
if (aofsouscategorie_tri[indice]["nbr_piece"] == 1) {
$("#nbr_piece_label").show();
$... | 1 |
81d0ba3f5cd3f5a983d2ddf57deb6557 | daf9bb8fb4d7a0aecdfc5bfb6399dce0 | deletes all old files from logs directory, except the files starting with dot. | {
bool retVal = false;
try
{
DateTime deleteBefore = DateTime.Today.AddDays(-logKeepDays);
var current = Directory.GetCurrentDirectory();
var logPath = Directory.CreateDirectory(current + "\\logs");
var files = D... | 0 |
a8b9d253e96b6176b8d3736f1ba7b05c | f269cf18b8a461098a9937086e4b8561 | How many messages will we send before waiting for an ACK? | public class SubscriptionOptions public static final class Builder
public Builder setAckWait(Duration ackWait) {
this.ackWait = ackWait;
return this;
} | 0 |
1c044266752fb489548dcc8c2f41c8f7 | 858b13231303693f754c2eb9e9240f6d | Draw a point (pixel) at the given co-ordinates, this also moves
the drawing cursor to that point so the next relative move will
be from that point. | void lcdDrawPoint(u16 x, u16 y, LcdPen* pen)
{
lcdSetCursor(x,y);
LCD_ADDR->lcd_cmd = 0x2c;
LCD_ADDR->lcd_data = pen->color;
} | 1 |
9ab06cd04b0d0d2738f37950f2d5bb36 | 1e97250b86cb1160dcb12672221ab8c6 | Returns true if the type is <see cref="IEnumerable{T}"/>. | namespace DeepCopier
internal static class Utils
public static bool IsIEnumerableExceptString(Type type)
=> _typeIEnumerable.IsAssignableFrom(type) && type != _typeString; | 1 |
f1eedd12ccd87fe562eaf0fd4cfa13cd | c0be0ef2827e4e8715318e7725ad55b4 | Delay is added to the end of sliding window | {
int32_t minTime, maxTime;
uint32_t duration;
if( JB4_CIRCULARBUFFER_IsFull( h->fifo ) )
{
JB4_JMF_popFront( h );
}
JB4_CIRCULARBUFFER_Enque( h->fifo, delay );
JB4_CIRCULARBUFFER_Enque( h->offsetFifo, offset );
JB4_CIRCULARBUFFER_Enque( h->timeStampFifo, time );
minTime = JB... | 1 |
882660c710ec9f41fa8a6343bd3073c1 | 236dc2ab7e9a50208c7678b34d9aab39 | Set initial forwarded event which is used for passing in
event and its headers for actions executed when sub state
is entered via initial transition. | def post_init
@state = :connected
@stream_receiver.rtmp_forwarder_connected = true
end | 0 |
07031d0977bf24b2b78d0627ab572751 | 0b1105bc5fe0bf37ecbafc961a473d4f | 点击添加按钮就动态添加Item | Add.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(ComName_List_Activity.this,Add_new_Item_Activity.class);
startActivityForResult(intent,1);
}
});
} | 0 |
6f8e13ab3806e4d3911e8d3cff18cbe3 | 7f887ab116552c9bf2679379f83ea78a | POST /registro_videoconferencia
POST /registro_videoconferencia.json | @ticket_conference = TicketConference.new(ticket_conference_params)
respond_to do |format|
if @ticket_conference.save
format.html { redirect_to @ticket_conference, notice: 'Ticket conference was successfully created.' }
format.json { render :show, status: :created, location: @ticket_confer... | 1 |
ff12ec6920c3d9c8d065af76a61c35c7 | ad415e0ac86819eac8dd06f7a5755da7 | Test create when parent is the root. | DATA = {
'name': 'Category 1',
'children': [
{'name': 'Category 1.1',
'children': [
{'name': 'Category 1.1.1'},
]
}
]
}
serializer = CreateCategorySerializer(data=DATA)
assert serializer.is_valid()
serializer.... | 1 |
a16cd1db8f210128d87ef6d4b42266b2 | 3321a481d75a12b6f13177d2923ef2f2 | recursive reverse print of an integer | {
if (!head)
return;
printReverseIntLinkedList(head->next);
printf(" %d ", *(int *)head->data);
} | 1 |
5d36eabc62cb229dd6fcf633ab53c8d9 | 23c9924823eb75a3662cd89553a2069a | Returns the detailed current season rankings | request = """
SELECT season_team.name AS team, sum(points) AS points,
count(season_table.week)-1 AS played,
sum(win) AS win, sum(draw) AS draw, sum(lose) AS lose,
sum(goal_for) AS goal_for, sum(goal_against) AS goal_against,
(sum(goal_for) - sum(goal_against)) AS diff
FROM season_team, s... | 1 |
ffe3b414dfb7d12e4ab9a256592d9720 | a71673fbd11a5bb9a27853a57fd3a79b | Create an RGBf with the given values | func GetColorF(Red, Green, Blue, Alpha float32) COLOR_F {
return COLOR_F{
r: float32(Red),
g: float32(Green),
b: float32(Blue),
a: float32(Alpha),
}
} | 1 |
2e7d97b4640db3e1959012aa9e2bd551 | 8ab40610498083516bae6de646b68206 | 添加热搜城市 | $('#cityselectul').html('');
for(var city in hotcitys){
var cityinfo = hotcitys[city];
var a = '<li class="citylili"><a class="cityselecta" href="javascript:void(0)" cityname="'+cityinfo[1]+'" surl="/'+cityinfo[2]+'" citypinyin="'+cityinfo[2]+'">'+cityinfo[1]+'</a></li>';
$('#cityselectul').append(a);
}
... | 1 |
0bf0d0b25a6b5c6858988006d16d9edb | 354422d9382c99b5254dd672cee3eb5e | Test get cluster nodes. | client = ClusterManagerClient()
cluster_info = client.get_cluster(name=TestGKECluster.name)
node_count = cluster_info.current_node_count
self.assertIn(node_count, [2,3,4,5,6,7,8,9,10]) | 1 |
16b3befae04f248accb768bec2220d95 | ed88ae50323256f6c826999d5f702ce1 | Go all the way back to the start screen, and clear the activity history. | public class Rules extends Activity{
public void backToStart(View view) {
onBackPressed();
} | 0 |
93476233d578cdb544d0d512a9ac7243 | 315e5efbceee855989cc1a1642f28714 | Does box select throw a valueError when the box dimensions aren't those
expected? | dim = Dimension("yolo", "uniform", -3, 4)
with pytest.raises(NotImplementedError):
assert -3 in dim | 0 |
f4c44cca83ecada89bcf0e7d2e175cb4 | 326c7a52bb4bba040c102f40ac5321f0 | 根据definitionId删除coupon_log表数据 | @Service
@Import({
PromotionDataSourceConfig.class
})
public class PromotionTestBase extends AutoTestBase{
public void cleanCouponTransferLogByDefinitionId(String definitionId) {
if (StringUtils.isBlank(definitionId)){
definitionId = "test_definitionId";
}
CouponTransferLogDOExampl... | 1 |
9d673bb87f4310f3f9bfebaabf9d1f9c | 5edf3b035269c89d02176473486d04c8 | r'''
@brief 設定されているシーンの解像度をセット | class SceneWriter:
def set_settings(self, settings):
self.settings = settings | 0 |
4d024b015e1305c471a8b0ca01be6c0e | 2e534fde767574310d7fe4d24c2f03ac | 设置隐藏表单和iframe | $("#iframe_PopupBox", window.parent.document).css("display", "none");
$("#mask", window.parent.document).css("display", "none");
try {
$(window.parent.document.body).find("input[type='button']").eq(0).focus().blur();
} catch(e) {
;
}
} | 1 |
675e7a3efc8d6f60260e4ee3fdbde8cd | ccee484886ec84241bc5ce58e256a50b | Given an array length 1 or more of ints, return the difference between
the largest and smallest values in the array. Note: the built-in
Math.min(v1, v2) and Math.max(v1, v2) methods return the smaller or
larger of two values. | function getDifference(arr) {
var min = arr[0];
var max = arr[0];
for(var i = 0; i < arr.length; i++) {
var num = Number.parseInt(arr[i]);
if(num < min) min = num;
if(num > max) max = num;
}
return max-min;
} | 1 |
6a8eef4a0b763e146ee9f837027d6ed9 | 0e1a412eea70c8571cc5982a4509d76c | Get time to wait after applying modifyers.
Apply the exponential sleep multiplyer, jitter and ceiling limiting to the
base sleep time. | float total = base;
TIntIterator modifierIter = modifiers.iterator();
while (modifierIter.hasNext()) {
total += modifierIter.next();
}
total = Math.max(0, total);
if (total == 0) {
return 0;
}
TFloatIterator multiplierIter = multipl... | 0 |
7e5417ff37641221ef2e34b603a5bc85 | 1cb1df4f98c2442f02c11c8b73abcc69 | Set text color from 0xRRGGBBAA format. | export class TextRuntimeObject extends gdjs.RuntimeObject
setColor(str: string): void {
const color = str.split(';');
if (color.length < 3) {
return;
}
this._color[0] = parseInt(color[0], 10);
this._color[1] = parseInt(color[1], 10);
this._color[2] = parseInt(color[2], 10);
... | 0 |
ad97510ac8e7697a8b6a4d94f7f1964f | 1abbf278d68215a32fa16df6421c6e79 | Get norm value of velocity | @SuppressWarnings("WeakerAccess")
public class ECEFVelocity implements Serializable, Cloneable
public double getNorm() {
return Math.sqrt(mVx * mVx + mVy * mVy + mVz * mVz);
} | 1 |
6dce9caf9bb931327531f8ed3696ca36 | a74fce69acdc00fdd310c2a79c3a2604 | List all the immediate sub-folders of the folder at `path`. | return [
x for x in cls.listdir(path)
if os.path.isdir(os.path.join(path, x))
] | 1 |
b7cd07014b3d4c222c28093f3090593d | 149055ad52d6c736a6cb8e28df0d4bda | Returns the mean speed of vehicles that have been within in this detector | if (numOfCars <= 0)
return 0.0;
return sumOfSpeeds / numOfCars;
} | 1 |
5beb93416559a6e5cf12a06711ac9d25 | a84ddc9f5d48d52e37033ca425d5cc9c | DeleteAgentPool.
[Preview API] Delete an agent pool. | export class PromiseAgentPoolApi
public deleteAgentPool(agentPoolLocator: string, options?: Configuration): Promise<void> {
const result = this.api.deleteAgentPool(agentPoolLocator, options);
return result.toPromise();
} | 1 |
3a7c6fca77a29365820ca61935a131e5 | 7283ee85d12b4dbd61bfd774281b011d | @test This test verifies that two circle ADT's are to be recognized as intersecting when they intersect at two, distinct points (i.e. slightly overlapping).
The test will pass if the function returns True for two circles that are slightly overlapping (i.e. two-point intersection). | {
Intersection::SupportShape a = Intersection::MakeSupport(&tetrahedron);
Intersection::SupportShape b = Intersection::MakeSupport(&cylinder);
return SupportShapeOverlap(a,b);
} | 0 |
a0bae7a30af0bc261b5971c5937fdc7e | 355116fe8364ecd88b3f0fd3d210375d | Returns a file-like object representing this drawer's content that can be written to.
Writing to the file will write to this drawer's content and will also
write to sys.stdout. | class TextUITokenDrawer(UIDrawer):
def __init__(self, fout, properties={}):
UIDrawer.__init__(self, properties)
self._fout = fout | 0 |
f0104dd135e25053f8e2e13493e5bf69 | f9676149e5a4e07c442f117879bac7b6 | Start a asynchronous thread to download the next song and set the appropriate flags. | class VoiceState:
def toggle_next(self):
self.bot.loop.call_soon_threadsafe(self.play_next_song.set) | 0 |
227e7ca830aca49ad9ad91eca823c1cf | 8c1831395880bd078fd3d525e7063527 | Tests getting channels related to a specific flow_request | void test_channel_valid6 (void)
{
#define RANDOM_ORDER "v=0\n\
o=- 115689375 1158953264 IN IP4 vam.vam-cluster.com\n\
s=Channel 1\n\
i=Channel configuration for Channel 1\n\
t=0 0\n\
a=rtcp-unicast:rsi\n\
a=group:FID 2 3\n\
m=video 50000 udp 96\n\
i=Original source stream\n\
c=IN IP4 224.1.1.4/255\n\
b=AS:5500\n\
b=RR:... | 0 |
df1e08b7ea18d5f9b7cb1cbbd2a32c1f | 7af2e993658547f1b7e0b41a1c034967 | Submit on enter key, disallowing blank messages | if (event.keyCode == 13 && event.shiftKey == 0) {
var message = $(chatboxtextarea).val();
message = escape(message.replace(/^\s+|\s+$/g,""));
$(chatboxtextarea).val('');
$(chatboxtextarea).focus();
keyboard_input = true;
var test_packet = {"type" : packet_chat_msg_req, "message" : message};
... | 1 |
63d4e267599ae95dd14ff2f63c8b1518 | 96b7ef9783adafe3b7b23c1c115ec79f | The bitwise union. | src = self.get_value()[1]
dst = self.get_value(False)
v = self.resolve(*dst)
self.set_value(dst, v | src, [0]) | 1 |
40112dd9f98905aeb14ebc33cb37ecbe | 800046d0e42afa71854773d063ad33e7 | tests deleting a non existent pd fails | class ProgramDelaCest
public function deletePDSPodentitetami(ApiTester $I)
{
$I->successfullyDelete($this->restUrl, $this->obj2['id']);
$I->failToGet($this->restUrl, $this->obj2['id']);
} | 0 |
e9cfff968bbf9b63adfe942c473c4c1f | ed6d9b46b0f0a0fb0ef5b51f08cb2b8b | 定义获取zabbix登陆token方法 | def get_toekn():
login = {
"jsonrpc": "2.0",
"method": "user.login",
"params": {
"user": ""+username+"",
"password": ""+password+""
},
"id": 1,
"auth": None
}
auth = requests.post(zabbix_api, data=json.dumps(login), headers=headers)
... | 1 |
2ebe1ac151c29ac99748fcc9bed56aa2 | 85419a8a13e8dbb5a63e83222d0861d8 | Forward-filling of NaNs in the direction of the second axis (axis = 1).
https://stackoverflow.com/questions/41190852/
most-efficient-way-to-forward-fill-nan-values-in-numpy-array | def numpy_ffill(arr):
mask = np.isnan(arr)
idx = np.where(~mask,np.arange(mask.shape[1]),0)
np.maximum.accumulate(idx,axis=1, out=idx)
out = arr[np.arange(idx.shape[0])[:,None], idx]
return out | 1 |
e5aeec6fb1c174ccfa416e8bb97336a4 | db384c5038f49ce2a0dec2e1a389a5e6 | Undefine a previously-defined string. | VOID undefine(P(const char *) name)
PP(const char *name;)
{
register struct symbol *sp;
sp = getsp(name);
if (sp->s_def)
sp->s_def = null;
} | 1 |
ff85508c75df80e8740f3cf9b2e2a30f | a9590e2ee04827593d4affef8203ebe9 | Descrição : Retorna o joystic do jogador | int x = joystick_get_x();
int y = joystick_get_y();
if (x < 80 && x > -80 && y < 80 && y > -80)
return NEUTRAL;
int angle = joystick_get_angle(x,y);
if ((angle <= 360 && angle >= 315) || (angle >= 0 && angle <= 45))
return RIGHT;
if (angle > 45 && angle < 135)
return UP;
... | 1 |
e5c3324bd5f2d757c14b2e960719563e | 26efbbb24c88121e82ec14fffa5f3e01 | Called when the character is attacking. | function OnAttack(user, target)
end | 1 |
92fdde2a7c55d4960606dd4d4a4b3c28 | 9d77c5f5dd445bed15fad6f5ce775f07 | Hide restoreButton when current accelerators in the dialog are the same
as default accelerators. | function btnConfigRestore() {
$scope.$broadcast('getSelections#cfgOptions', function (data) {
$scope.$apply(function () {
$scope.configRestoreDisabled = data.length < 1;
});
});
} | 0 |
d8306adb0f2abdd69481b176fb1007ec | aec7d3ef04d58a998a304c87c786027d | Calculates the mean squared error of every TrainingSet contained in the TrainingData object | {
double sumSquaredError = 0.0;
double[] xValues = new double[numInput];
double[] tValues = new double[numOutput];
for (int i = 0; i < trainData.Length; ++i) {
Array.Copy(trainData[i], xValues, numInput);
Array.Copy(trainData[i], numInput, tValues, 0, numOutput);
d... | 1 |
b310ffde4b65ec516c1ed55ca3cfaabb | 1af918f8a45b606ed8c1bec8febc55cd | We need to schedule this to occur later after databinding has completed, otherwise
focus appears in the textbox, but at the start of the suggested name rather than at
the end. | export class SelectSearchPage
ngAfterViewInit() {
if (this.searchbarComponent) {
setTimeout(() => {
this.searchbarComponent.setFocus();
}, 1000);
}
} | 1 |
5d3c692871b7295aaf8464a9ae5b4b97 | 921fdf660a6beb3bba824fd222b27a0b | FB bot doesn't follow meta/javascript | function <%= themeNameSpace_script_tag_defer($tag, $handle) {
if (is_admin()){
return $tag;
}
if (strpos($tag, '/wp-includes/js/jquery/jquery') || strpos($tag, 'ajax.googleapis.com/ajax/libs/jquery') || strpos($tag, 'maps.googleapis.com/maps/api/js')) {
return $tag;
}
if (strpos($_SERVER['HTTP_USE... | 0 |
081dd19b67e3b493116b7983837ea799 | 81429a2a461dc0b57dd9af5b69b255c6 | Gives the loaded attack icon. | if self.imgAttackableTarget is None:
self.imgAttackableTarget = \
self.imgTarget.subsurface(pygame.Rect(48, 48, 48, 48)).copy()
return self.imgAttackableTarget.copy() | 1 |
bdcef85d62745aa33561938dea646a2c | e3de880d4434d3fb2f71f34574acd966 | Check log level and print permissible logs. | class Command(BaseCommand):
def log(self, level=INFO, message='', no_label=False):
if level == WARNING and not int(self.options['verbosity']) == WARNING:
return
output_str = ''
if not no_label:
output_str = '%s: ' % LOG_LEVEL[level]
print "%s%s" % (output_str, mes... | 1 |
9da740a2e265f4e48bd08cc1f3fa7a90 | 8f7ac0f6d7830b9eb80ce764a07bc1c9 | limit percenatge by step size | f32 stepSize = *pValue * fraction;
if (stepSize > step) {
stepSize = step;
} else if (stepSize < -step) {
stepSize = -step;
}
*pValue -= stepSize;
} | 1 |
8b010e608a24500f87f55eebf20a8916 | 3298487f96cdc071f48499ac60a91010 | 檢查tbEmployees是否有存在此ID | namespace MYPAM.Model.DataAccessObject
internal class DaoSQL
internal bool CheckEmployeesIdAndUserID(int id, string userID)
{
string strSchema = string.Format("SELECT count(*) FROM tbEmployees WHERE ID={0} AND UserID='{1}'", id, userID);
string count = string.Empty;
_SQL.... | 1 |
40b1f3ecd99a6d2388378be29aad98cd | 39ffb1d40eca60e2c38aa0f24104e5c2 | Generates a multicast mac address based upon the multicast IP address. | {
var broadcast_address = new byte[address_bytes.Length];
for (var i = 0; i < broadcast_address.Length; i++)
broadcast_address[i] = (byte)(address_bytes[i] | (mask_address_bytes[i] ^ 255));
return broadcast_address;
} | 0 |
2a98e00260856665e61c5075e610a31b | 238d83a85d24f403a6a8a0fdb08a1796 | write a 256-color (8-bit) image palette to the file | {
using namespace themis;
std::uint32_t dword;
std::uint16_t word;
word = *(std::uint16_t*)("BM");
os.write((char*)(&word), sizeof(std::uint16_t));
dword = 54 + bitsize + 4 * npal;
os.write((char*)(&dword), sizeof(std::uint32_t));
word = 0;
os.write((char*)(&word), sizeof(std::uint16_t));
os.write((... | 0 |
8bc0353a75f5dc0a2c610f7b256f297d | 57c65217ced83183c2c253fb5cce296a | Lists all views of a given schema. | class IBM_DBAdapter
def views
puts_log "views"
query_values(data_source_sql(type: "V"), "SCHEMA").map(&:downcase)
end | 1 |
89a00034d21b5515a1f8c7a049cc3ac6 | 07e5266aa42e2fb0ab4d763b407a8d6a | Method used to delete a Transaction from the database. | public ResponseEntity deleteOneTransaction(@PathVariable Integer transactionID) {
transactionService.deleteOneTransaction(transactionID);
return ResponseEntity.ok().build();
} | 1 |
31e6b584c1a2f62c5545b80c6388010c | f6c6727f451ff13308b85cc5d9fde8d7 | Divide two scalars.
Division is implemented as inversion followed by multiplication. | a = self.__data
b = v.__data
return _newV(_MP(
a[0] / avoidZeroDiv(b[0], pre),
a[1] / avoidZeroDiv(b[1], pre),
a[2] / avoidZeroDiv(b[2], pre),
a[3] / avoidZeroDiv(b[3], pre),
)) | 0 |
a41889ffd931d9c2aca6b60475953aee | d2aa0f0fed61a9a00c57ba8cd9f72166 | same as gl_log except also prints to stderr | switch (severity) {
case GL_DEBUG_SEVERITY_LOW: LOG_INFO(message); break;
case GL_DEBUG_SEVERITY_MEDIUM: LOG_WARN(message); break;
case GL_DEBUG_SEVERITY_HIGH: LOG_ERROR(message); break;
#ifdef LOG_GL_NOTIFICATIONS
case GL_DEBUG_SEVERITY_NOTIFICATION: LOG_INFO(message); break;
#endif
defaul... | 0 |
22de289b6c28861639c0b591e51795d4 | 6f39710451529c768d58e9d475428744 | Returns basic information about the mgmt system. | class API:
def sysinfo(self):
data = json.loads(self.request("sysinfo").decode('utf-8'))
namespaces = []
for namespace in data["license"]["namespaces"]:
namespaces.append(Namespace(self, namespace["name"], namespace["size"]))
return SysInfo(
self,
data... | 1 |
a8ce6d7394780258ce765a078f712258 | 7a4c99275da90f878c5ba23aff24ca94 | 清空笔记 | var editor=$('#texta').xheditor();
var note_div = document.getElementById("note_div");
note_div.style.display = "block";
$('#texta').val("");
} | 1 |
8c8dcd67c0714459f4dfebfc497e12e9 | dcaa8bda5f1f121fc1a93cb566ce8ee7 | Fetches a 32-bit big-endian ("Java ordered") value from the
bytecode stream | if (buf.length < pos + 3)
throw new java.lang.IndexOutOfBoundsException();
int i1 = (int) buf[pos] & 0xFF;
int i2 = (int) buf[pos + 1] & 0xFF;
int i3 = (int) buf[pos + 2] & 0xFF;
int i4 = (int) buf[pos + 3] & 0xFF;
int iVal = (i1 << 24) + (i2 << 16) + (i3 << 8) + i4;
return iVal;
} | 1 |
3662aa0bdc129d4c5def5434f26fae78 | 3c92dac31647d6b55a9b3de39d42169e | Gets all of the latest stable packages in a feed | {
return allPackages.OrderByDescending(s => new NuGetVersion(s.Version))
.GroupBy(g => g.Id, StringComparer.OrdinalIgnoreCase)
.Select(z => z.First()).ToList();
} | 1 |
bd7f86773f47399a97f2e3925f072198 | c3e2a6f550585f792f11765c94e64dd8 | NewImageNameTranslator creates an instance of ImageNameTranslator | func NewBaseImageBuilder(baseImage string) *BaseImageBuilder {
return &BaseImageBuilder{
BaseImage: baseImage,
}
} | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.