query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
ba73fd0e4842b03a70b81c6c72ea4bbf | 051e4a43365b23f9bc9e5d185c3ae70c | Function that spits out an random number to call an event every sixty seconds. | int main (void)
{
unsigned numSeconds = time(0);
printf("%i\n", rollDie(6));
srand(numSeconds);
return 0;
} | 0 |
7945690c3aa5765802f251fec80db2c3 | 7ba4822151e51d6c02871f36f295cf61 | The `gitlab.getUserSshkeys` data source allows a list of SSH keys to be retrieved by either the user ID or username.
Upstream API**: [GitLab REST API docs](https://docs.gitlab.com/ee/api/users.html#list-ssh-keys-for-user) | def ssh_keys(account_id):
return '{}/sshkeys'.format(account(account_id)) | 0 |
ce36881076bc9d0f3d52cdcc718990b7 | ebe46558dac9221bce884183f34de1b3 | 定位div(contenteditable = "true") 光标移到最后 | function placeCaretAtEnd(el) {
el.focus();
if (typeof window.getSelection != "undefined"
&& typeof document.createRange != "undefined") {
var range = document.createRange();
range.selectNodeContents(el);
range.collapse(false);
var sel = window.getSelection();
sel.... | 1 |
42fc8e24101312d669c28b6b5780a1db | a63bcd103bbd77c65532021953e18872 | HANDLES CURL REQUESTS | $ch = curl_init($url);
$request_headers = array('Accept: application/json');
if ($request_options && array_key_exists('bearer_token', $request_options)) {
$auth_header = 'Authorization: Bearer ' . $request_options['bearer_token'];
$request_headers[] = $auth_header;
} else {
curl_setopt($ch, CURLOPT_... | 1 |
eb96c6ffca93a4ca3f01d2e1824200f2 | b66bfa2a63cc7e4ec678d00403ffb6df | Sets args for url_patterns.USER_ID redirect. | if self.kwargs['from'] == 'usr_list':
prod_id = self.object.production.id
url = reverse_lazy('production:usr_list', kwargs={'prod_id': prod_id})
else:
url = reverse_lazy('production:prod_list')
return url | 0 |
e5e15986b94d57d45674d5c1a3078231 | be880f977a1d84bfb9a7affb3baa96ec | Cambia el valor de la primera coordenada del punto | class Punto:
def cambiarPunto(self, x, y):
self.x = x
self.y = y | 1 |
69c3fafb6ce9f259aa7fd17d666a9070 | 200823f4cadf20a8db0e03ad52da3c33 | Calculates the sum of all y values. If any such value is NaN, this will return NaN. | class LinearRegression
public function getSumY()
{
return $this->sumY;
} | 0 |
98f8db4ad836f7189c601b9a65a2ea8c | c3d542f946262baa41dd59a97c38c0e9 | 测试朴素贝叶斯算法,返回准确率 | cnt = 0
for i in range(len(x)):
train_x = np.delete(x, i, 0)
train_y = np.delete(y, i, 0)
test_x = x[i]
test_y = y[i]
naive_bayes = NaiveBayes(train_x, train_y, is_continuous)
naive_bayes.train()
test_result = naive_bayes.inference(test_x)
if test_... | 1 |
1ac142a08ce3b0a28dcee1f7f85c2ed0 | ba16dc7b8b1f4ffa2955d2dc1ec26403 | Gets the parameters for the sarima, sarimaX and sarimaX with time varying
residual models
RETURNS | par_dict = {'sigma': '0.8',
'l_corr': '0.3',
'f_infl': '0.2',
'method': "'full'",
'use_regr_cov': 'False',
'poly_order': '3',
'n_cross_val': '5',
'use_mock': 'False'}
... | 0 |
07ec8a9d9c0fb73360a2ca6037e0b530 | a5f9f12c64049b2b7ddd5ffcfec168c2 | Zwraca, czy jest aktywne połączenie z innym graczem. | public class ServerHuman extends ServerPlayer
public boolean isConnected() {
return !this.connection.getSocket().isClosed();
} | 1 |
bc7d06cab8d4cb59daa82edb6686f895 | 34f2cabd308464dea378e67d572c90ca | Получение списка оснований зачисления | {
$sql = '
SELECT tcid, cause FROM dw_tribunal_causes
WHERE language = '.\util\mysql\sqlval($lang).'
ORDER BY sort
';
return \util\mysql\query($sql);
} | 1 |
fb9b9f3c7ba8024ab7f8cb6409b2870a | eb2be2984057059edac0a9b7f61b03bb | 获取当前分页应该显示的页码 | class OrderController extends BaseController
private function get_page_list($current_page,$page_total,$limit=4){
$page_list=array();
if($current_page==1){
if($page_total==1){
$page_list[0]=1;
}
if($page_total>1&&$page_total<=$limit){
fo... | 1 |
0c094aff32956504a195c783ff823e6c | 465c8b345b5edaceb0511e4a9e5e391c | Build cube geo to represent this bbox. | class OBB(object):
def create_bounding_box(self, meshName="bounding_GEO"):
obbCube = cmds.polyCube(constructionHistory=False, name="obb_GEO")[0]
for ind, pnt in enumerate(self.boundPoints):
cmds.xform("%s.vtx[%s]" % (obbCube, ind),
translation=[pnt.x, pnt.y, pnt.z])
... | 1 |
bb3fbfbcc416387c200d34e42bdded27 | 67f193b2a3438fb6999cac501d97d8af | Возвращает текущий семестр (осень/весна) | function getSemester(): string {
const now = new Date();
const month = now.getMonth() + 1;
const year = now.getFullYear();
let semester = undefined;
if (month <= 9 && month >= 4) {
semester = "sose" + year;
} else {
const yearLastTwoDigits = year % 100;
if (month >= 1 && month <= 3) {
semester = "wise" +... | 1 |
d690af7ff4f1b4e3936986467cf003c8 | f2e6657fe0b648da8477b3066142965d | Invoke the base class version | LRESULT CListCtrlEx::OnGetColumn(WPARAM wParam, LPARAM lParam)
{
return CListBase::OnGetColumn(wParam, lParam);
} | 1 |
c5640aea2fb91929abd5d01e0b5d4d57 | de6629bbf71f36a817c43ac2b2e00564 | Sets the primary key of this dm port wharf. | public void setPrimaryKey(int primaryKey); | 1 |
b8006594ad41dd1685bfe787f82dd062 | 58a15083d58b9415be8da75494950833 | This is for the custom implementation of the Medium, No GSF-variable (trigger-friendly), no d0significance (for now) definitions.
This uses Online PDFs, and currently has no conversion bit either. Also note that the PDF for trackd0 comes from
trig_EF_trackd0_physics, but the LH tool requires it to be named el_trackd0pv... | return cms.PSet(
cutName = cms.string('GsfEleEBEECut'),
cutString = cms.string("full5x5_sigmaIetaIeta"),
cutValueEB = cms.double( wpEB.full5x5_sigmaIEtaIEtaCut ),
cutValueEE = cms.double( wpEE.full5x5_sigmaIEtaIEtaCut ),
needsAdditionalProducts = cms.bool(False),
isI... | 0 |
4bf6a3ef2e886442fb3a687fae1fc83d | 1ce0eadd48e05190611ca527871b8f4d | Populates the "Trace Analysis" panel. | audioDAQChannels = self.getParams("audioDAQChannels")
self.audioAnalysisWidgets['figure'] = fig = Figure(figsize=(7, 0.75), dpi=100, facecolor=WIDGET_COLORS[1])
gs = gridspec.GridSpec(1, 2, width_ratios=[6, 1])
chunkSize = self.getParams('dataChunkSizeSamples');
t = np.arange(int... | 1 |
8c49471660555eb76babea566468d55d | 925c12a8fef512ef6e916eaf9b032aef | 模拟一个失败呼叫,用于生成推送 | class HttpRouterTests(unittest.TestCase):
def test_push_fail(self):
sleep = mock.create_autospec(time.sleep, auto_set=True)
r = router._HttpRouter({}, 'https://bla.bla', _sleep_fn=sleep)
r._http = infra_libs.HttpMock([('https://bla.bla', {'status': 403}, '')])
event = LogRequestLite.LogEventLite()
e... | 1 |
a978db982361ebb3670ad52fca013a44 | 716260218f8b846337ae6399f26b4df2 | @brief This function is used to get the USART protocol version. | {
#if (GLCD_CFG_PARAM_CHECKING_ENABLE)
GLCD_ERROR_RETURN(NULL != p_version, SSP_ERR_ASSERTION);
#endif
*p_version = module_version;
return SSP_SUCCESS;
} | 0 |
e5b8badb8ec19e2cefd0f4f734cf8531 | 3682970a61403151f88048c55c72c8b2 | Routine pour gérer le click sur les items d'un context menu | {
hideNavContextMenu();
switch ($(this).data('action'))
{
case 'openLink':
var link = $(this).data('link');
if (typeof link === 'string')
{
window.open(link, '_blank', 'location=yes,menubar=yes,scrollbars=yes,status=yes');
}
... | 1 |
5788a76f9f3e9cfc69f830ccb337e3ac | e4228991a53ea60ccb306baa3b35707d | Construct a phone number
PhoneNumber constructor. | {
$this->user = $user;
$util = \libphonenumber\PhoneNumberUtil::getInstance();
$this->proto = $util->parse($this->user->mobile, "PH");
} | 0 |
c9c8e4ca92f973ebe27da106abaaabcc | a087b77cdaeda0f77e77b99b4afb712c | Tests when the callback has a return value to render as output. | class HelloWorldController extends ContainerAware
public function myCallbackMethod() {
$element = array(
'#theme' => 'theme_hello_world_primary_page',
'#items' => 100,
);
return $element;
} | 1 |
6c3eddc28a3fd4bc0b181269a7e82abf | 1f54aee1f3a15e43fc915a5aca91f8d0 | Set a welcome message or disable welcome in the current channel.
Use %user where they should be mentioned.
Use %guild_name if the server name should be added.
[Format: %welcome (Welcome %user to %guild_name!)] | class Welcome(commands.Cog):
async def channel(self, ctx: commands.Context, channel: discord.TextChannel):
if channel.guild != ctx.guild:
await ctx.send("The channel is not part of the current guild.")
return
await self.bot.db["welcome"].find_one_and_update({"_id": ctx.guild.id},... | 0 |
ed0ca9938c9f28e212d4b96d97ffa64d | 0a4794476c8805b634e8273a79a62e71 | 配件增加操作 | ActionContext act = ActionContext.getContext();
AclUserBean logonUser = (AclUserBean)act.getSession().get(Constant.LOGON_USER);
try {
act.setForword(addUrl);
}catch(Exception e) {
BizException e1 = new BizException(act,e,ErrorCodeConstant.ADD_FAILURE_CODE,"配件订单业务参数");
logger.error(logonUser,e1);
act... | 1 |
c8da0f98c4fc0f382304094365874f7c | c2879c6369ec86b519631d3aa55368c4 | Rotieren der Sonne | @Service
public class PlanetService implements IPlanetService
@Override
public void doRotation(Planet planet) {
double t = (Math.PI * planet.getPosition().getAngle()) / 180;
planet.getPosition().setX(planet.getSunDistance() * Math.cos(t));
planet.getPosition().setY(planet.getSunDistance() * ... | 0 |
72a67923c5b8baa1368ec0328bf0ccf2 | 83f41b94e3f04d70cb7ddd521fb48775 | 重新配置虚拟机 | public int reconfigVirtualMachineDevice(String ip, int port,
String userName, String password, String workloadId, String diskName,
long diskSize,long memorySize, long cpuNum) throws CloudRestException ; | 1 |
95f0a1dfc53123c0c97e2806b921efbf | 7f5ac8cd8b4b6d17488d0d554790cf97 | @brief 获取边框线类型 | int CViewLayout::GetLayoutType(void)
{
return m_Layout.ntype;
} | 0 |
6bc2480fd5706bb007583c0bba5c04ea | 38768138c0eff9dc10cc52d10f9d0dbe | 测试关机和重启 | assert wait_on_element(driver, 10, '//button[@name="Power"]', 'clickable')
driver.find_element_by_xpath('//button[@name="Power"]').click()
assert wait_on_element(driver, 5, '//button[@name="power-restart"]', 'clickable')
driver.find_element_by_xpath('//button[@name="power-restart"]').click()
assert ... | 1 |
670acd2a0f41f2ecbb4f5070b49d6230 | e585d22f86cab11ea9d00c2040a7480c | Get the color of a chess piece | class Piece:
def get_color(self):
return self.color | 1 |
06a4d6f75949f4a04f0a0302d04aec3c | 3cb126ecac3c0ca2b73850ebc340c0de | Función para cargar el pickle que se guarda en local
de la task anterior y guardar como variables X_test y y_test. | self.X_train = pd.read_pickle(self.X_TRAIN_PATH)
self.X_test = pd.read_pickle(self.X_TEST_PATH)
self.Y_train = pd.read_pickle(self.Y_TRAIN_PATH)
self.Y_test = pd.read_pickle(self.Y_TEST_PATH) | 1 |
739fb95eab1d7dd97da23750722356d1 | 7b1474caed0892562404b63815bc0991 | Retrieves the profile command. | class Profile(WriteOnlyProfile):
def command(self):
return self._simple_get("Command") | 1 |
a491f06bf3eec49ab90d81a349cd7162 | 22315b13e07a8ed1e0484e25d33946e6 | 爬取排名明星粉丝数据 | class WeibocnSpider(scrapy.Spider):
def parse_fans(self, response):
result = json.loads(response.text)
if result.get('ok') and result.get('data').get('cards') and len(result.get('data').get('cards')) and \
result.get('data').get('cards')[-1].get(
'card_group'):
... | 1 |
87ca35a5c3ba6c9b8e93baa94582e6e0 | bb7ee313c399e699371a52810edcb3b5 | Try to update with a user without an appropriate role to do so. | class UpdateUserAPITestCase(BaseAPITestCase):
def test_update_user_non_verified(self):
user = User.query.filter_by(id=4).first()
self.assertEqual(user.firstname, u_firstnames[3])
data = {'firstname': 'Bob'}
res = self.put(url='/users/4', data=data, role='admin')
self.assertExcept... | 0 |
11f6e15f024ac69296d49ab8380381bf | 4cd8bcd6785c55d797b9e8f07f572695 | 返回SessionRedisModel对象的单例 | if (!(self::$_instance instanceof self)) {
self::$_instance = new self($redisConfig);
}
return self::$_instance;
} | 1 |
068f38b60d1734f8e58104919cd0ddfe | 35f094186b2e0a089d20541dab83e6d0 | Saves the MCC object to a python pickle file. | with open(filename, 'wb') as fid:
try:
pickle.dump(self, fid)
except pickle.PicklingError as e:
self._logger.warning(f"Unable to pickle object due to the reason: {str(e)}. This object is not saved.")
return
self._logger.debug('Pickl... | 1 |
efd585247dab9582a2e6242458343972 | 377228e5d059aee3ffae6e1cc1fedd0f | Holt eine Liste aller wartenden Ueberweisungen vom einem Konto mit
gegebener Kontonummer ktoid mithilfe von
IUeberweisungsVorlage.getUeberweisungenVonKonto(ktoid), und speichert
diese in einer ArrayList von UeberweisungGrenz und sortiert diese
ArrayList mit Collections.sort nach Datum
nach Datum | public class Orderverarbeitung
private void umsaetzeAnlegen(Date datum) throws SQLException {
umsaetze = new ArrayList<Umsaetze>();
for (Transaktionen t : umsaetzeAlsTransaktionen) {
int zaehler = 0;
while (zaehler < 2) {
Umsaetze um = new Umsaetze();
um.setVerwendungszweck(t.getId());
um.s... | 0 |
f2205ad53754c8f34d1088f94ca2b59d | c5e66d0f1a9791c09e490206455c1f12 | 测试用例1新增授权用户 | self.log.log_start("addAuthorization_002")
user_data = self.get_table_data("add_authorization")
flag = False
for dataRow in range(len(user_data)):
data = user_data[dataRow]
try:
if dataRow == 3:
self.common_part(data)
self.add_user(data)
self.add_res_group(data)
self.authElem.save_... | 1 |
c28519c01e0d018e6d841d78e2a771a8 | 082a75ebcba2141532cffcc0dd9a3fce | Sort seasons by name | class Seasons(BaseSchema):
def name(cls):
yr1 = select([Years.yr]).where(cls.start_year_id == Years.id).as_scalar()
yr2 = select([Years.yr]).where(cls.end_year_id == Years.id).as_scalar()
return cast(yr1, String) + case([(yr1 == yr2, '')], else_='-'+cast(yr2, String)) | 0 |
1f41912efda3b729223bff7deec571c7 | 9564f847ea93ff1c82b64510b291f487 | Casts an input array to be the same dtype and backend as the second input. | class Backend():
def assert_same_dtype_device(self, a, b):
raise NotImplementedError() | 0 |
f8f965b5a81097fa7507fb1ef39faf2c | 92557c3535bdb10e5832f3634c787608 | Wrapper function to allow returning files from predict
This wrapper exists because buffer objects are not pickable,
thus cannot be returned from the executor. | if ct_bufferSize.value:
fileBuffer = (ct.c_byte * ct_bufferSize.value)()
ct.memmove(fileBuffer, ct_buffer.value, ct_bufferSize.value)
return bytearray(fileBuffer)
else:
return None | 1 |
89d2a7e3fa63776f4246ce5282e2a636 | 4deabd07c0c5c59f92233b3a2a1efd8d | put an XMB user record into a hash that can be inserted into the corresponding phpbb table | class forum_driver_wbb_shared extends forum_driver_base
function pget_row($name)
{
$rows=$this->connection->query_select('users',array('*'),array('username'=>$name),'',1);
if (!array_key_exists(0,$rows)) return NULL;
return $rows[0];
} | 0 |
b04a8cfe07be46be8913652f18a43fbb | 77503e7b4f6fc4483eb1082b19481277 | 判断游戏并设置图片和简介 | {
if (GameManager.Instance.GetGameScore() > GameManager.Instance.GetBestScore())
{
img_New.gameObject.SetActive(true);
txt_bestScore.text = "最高分 " + GameManager.Instance.GetGameScore();
}
else
{
img_New.gameObject.SetActive(false);
... | 1 |
ce8352b75830ee7b630453840e078e8c | 385c6abd664adce24454faf8d79cab7c | Merges subscriptions streams into one stream. | namespace Akka.Streams.Dsl
public abstract class SubFlow<TOut, TMat, TClosed> : IFlow<TOut, TMat>
public virtual IFlow<TOut, TMat> MergeSubstreams() => MergeSubstreamsWithParallelism(int.MaxValue); | 1 |
efec93d8a63c6a9cd8275f513eadd0a1 | b9aef172c7ea4884e7cededb9d79a7f7 | Display a save file dialog. | dialog.showOpenDialog(fileFilter, (filename) => {
if (filename === undefined) return;
fs.readFile(filename[0], 'utf-8', function(err, data) {
win.webContents.send('openSaveData', data);
win.webContents.send('changeWindowTitle', parseFilename(filename[0]));
});
});
} | 0 |
3a2931c2fb604019e342409e1545d4a0 | 3614626beb224d96329c25508bdad4e2 | 网站首页显示商铺列表 | class shopsController extends Controller
public function index()
{
$list = DB::table('type')->where('pid','>','0')->get();
return view('home.person.shops',['list'=>$list]);
} | 1 |
e4c8909b5e969f934e23727e3544dede | 3b20e648d0e46503aa82a2e941fe9b56 | permet d'avoir la duree d'une recette en fonction de ces etapes | class Model_Product_Order extends Model_Crud
public function get_moyTime()
{
if($this->end != NULL){
$date1 = new DateTime($this->end);
$date2 = new DateTime($this->start);
$diff = $date1->diff($date2);
$secondes = $diff->s;
$minutes = $diff->i;
... | 0 |
3a3d62e1f8b4f110855eee421c6533cd | d0108b2fcbeae0a247245076233caa44 | ==============
CL_StreamViews_CalculateZoomFactorAndCosFovLimit
============== | {
V360Context *s = ctx->priv;
s->flat_range[0] = tanf(FFMIN(s->h_fov, 359.f) * M_PI / 720.f);
s->flat_range[1] = tanf(FFMIN(s->v_fov, 359.f) * M_PI / 720.f);
return 0;
} | 0 |
35099773385700778b7e30e4f107975e | 03cdeb59aa389c87cfb5800038601085 | 通过position寻找他所属的SubAdapter | val viewHolder = recyclerView.findViewHolderForAdapterPosition(position)
if (viewHolder is MainHolder) {
return viewHolder
}
return null
} | 0 |
00c246223aec8e107b5f2cda03a964d8 | 04ea456660797e432e0e2b4ce0001e5d | Generator to iterate through available and enable RPC objects. | void onRpcAvailable(@Nonnull Collection<DOMRpcIdentifier> rpcs); | 0 |
d44adc8a4476bd0a2dd36f39dcb0c737 | 52db9c698106c3fe82042bab54ae4e96 | Базовый класс для изменения числовых(byte) значений. | value_max=0, unit="", is_multiplexer=False, multiplexer_id=None):
super().__init__()
self._receiver = []
self._raw_value = 0
self.name = name
self.start_bit = start_bit
self.length = length
self.little_endian = little_endian
self.signed = ... | 1 |
3e1fb8f916c109663b02c23e5bf6f588 | b51e3730182a8e146b8c8830aa6efb4d | 設定された文字列長毎に適切なsym_spell_medモジュールをあてがい、
それによる名寄せ結果のlistを返す処理 | l_hospital_headers_comp = l_hospital_headers[:]
l_hospital_headers.extend(l_header_additional)
l_strs = [str_[:]]
for head in l_hospital_headers:
if head in str_:
str_ = re.sub(head,'',str_)
l_strs.append(str_)
if '会' in str_[:3]:
str_ = ''.join(str_.split('会')[1:])
... | 0 |
faa1d9b26f01fe9ca4dbc5d130444bdc | a050ad935d8e3a6d92062c3b3bd2001f | Converts an id into its token representation using the vocab. | class LazyVectors:
def itos(self, i):
token = self._itos.get(i)
return token if token else 'UNK' | 1 |
2e61477d0d38dd3b1c755f1270a5fc38 | 4672d11ea56a13034cc6f97656e56b77 | 当前正在显示的fragment是否正在处于编辑状态 | public abstract class FRecyclerViewFragment<T extends FIPresenter> extends FFragment<T> implements FIViewRecyclerViewFragment
@Override public boolean fragmentState() {
return true;
} | 0 |
ff6e0995acf9bb1e34a8d7209712dca3 | 70ae935507d9403a28d3752713d6c8bb | Is it a header item type at first place. | public class HeaderRecycleViewHolder extends RecyclerView.ViewHolder implements View
.OnClickListener, View.OnLongClickListener
public boolean isHeaderItem() {
return mChildId < 0;
} | 1 |
acf4fcee534b2fdb70fbfa11c29c068a | 74d2d0fdd44a072171b5e531df46ab94 | Update global ServiceInsertion status for a context
Update global ServiceInsertion status for a context | class ManagementPlaneApiServicesServiceInsertionApi
def list_service_insertion_status(opts = {})
data, _status_code, _headers = list_service_insertion_status_with_http_info(opts)
data
end | 0 |
f27fb5b19845aab598949a5481b59869 | b0a3333cbe160b9a0180882d30f36f71 | Allows most inputs to be processed again since the user is no longer typing.
Is called when the user clicks elsewhere when an input field is selected. | namespace LICC.API
public abstract class Frontend
protected internal virtual void ResumeInput() { } | 1 |
9424fca5314555c074489204b056a0de | 3a8aa660275ed4fa58dd5da41ff02381 | 使用私钥对参数进行分段解密 | params = base64.b64decode(params.encode("utf-8"))
length = len(params)
default_length = max_decrypt_block
if length < default_length:
return decrypt_data(params, private_key)
offset = 0
params_lst = []
while length - offset > 0:
if length - offset > default_length:
... | 1 |
59032929f212e44722643746b06d3b12 | 171431b3b12befcc7e4cc10644d14da1 | 点击直接购买页面渲染数据内容 | function render(data) {
$('[data-key]').each(function (index, ele) {
$(ele).html(data[$(ele).attr('data-key')])
})
for(var i = 0; i < data.cannGetAmount.length; i ++) {
$('[data-amount]').eq(i).find('span').html(Object.keys(data.cannGetAmount[i])[0])
}
if(data.state == 0) {
t... | 1 |
8e90e67daf50df9c40210ad6f843957a | fe971dd0298ebd1873545988d68a36eb | Update Google fonts | $config = array(
"ssl" => array(
"verify_peer" => false,
"verify_peer_name" => false,
),
);
$context = stream_context_create($config);
$url = "https://www.googleapis.com/webfonts/v1/webfonts?key=AIzaSyD1b-JL1iKIb38mG8Aku1qZeJq3SqCg-V8";
$fonts = file_get_contents("$url", false, $context);
file... | 1 |
09a1deaf314c3cc8f56b3cf582496f1f | 9d0f7e32dcc272454b86ad7d9c3d4266 | executa uma ação retornando o dano a ser inflingido | int ataque::realizarDano(int bloqueio)
{
ValorDano=(ValorAtaque*2)-bloqueio;
if(ValorDano<0)
ValorDano=0;
return ValorDano;
} | 1 |
0ffab4bdea08965db13228d172c7ff8f | a90846af8d3c702b28d68e43fe8e0c3c | 확장자를 제외한 파일명만 반환한다. | public class FileUtils
public static String getFileNameNoEx(String allSavePath) {
File targetFile = new File(allSavePath);
String filename = targetFile.getName();
Log.d("FileExtractorUtils", "getFileNameNoEx : " + filename);
if(filename != null && filename.length() > 0) {
int... | 1 |
f0f300a4d3dd5651fecd2a6075d68124 | a66dbbd8402d92ebe82cce4b5c045a59 | If we have an audio source that isnt playing at the moment, return it. Otherwise create a new one. | namespace ReadyGamerOne.Script
public class AudioMgr : MonoSingleton<AudioMgr>
private AudioSource GetAudioSource()
{
foreach (var source in effectSources)
{
if (!source.isPlaying)
return source;
}
var newSource = gameObject... | 1 |
da8df0596ed888ce97319c4ae14f8c66 | bd32374c3ca5256b258b4f50606821b3 | Generate the target part affinity fields. | def makeTargetFieldsDict(tgt_fields):
global RES, NRES, HOTEL
out_dict = {}
for fld in tgt_fields:
use, suffix = fld.split("_SF_")
if use in RES:
act_field = "RES"
elif use in NRES:
act_field = "JOB"
elif use in HOTEL:
act_field = "HOTEL"
... | 1 |
27db30f901df43c7240b574da0f041de | 9566a16e65bcf2637461fd9a1a5b2100 | ! Responds to the end of a multitouch sequence | export default class Toucher extends Event
onTouchEnd(e, touches) {
this.status = 'pending';
if (touches.length === 0) {
let { st, direction } = this.touches[0],
tap = !this.disableTap && !direction && new Date() - st < 500;
this.disableTap = false;
re... | 1 |
ff686dd23e9f3b4522d3f2f57c7830bf | b664430acd223a562cd4064ff9b3ae82 | Finds the location of the longest run; a run is when the same number is produced consecutively | def calcNumRuns(seq):
r = 1
i = 1
cur_run = seq[0]
while i < len(seq):
new_result = seq[i]
if new_result != cur_run:
r += 1
cur_run = new_result
i += 1
return r | 0 |
ff22957088d071bafccc00efd2b7382b | 972265ef5863ae6e7dd85ba5a7f1087e | (internal) Fuzzy Compare two time values | {
if (t1.tm_year != t2.tm_year) return (t1.tm_year > t2.tm_year);
if (t1.tm_yday != t2.tm_yday) return (t1.tm_yday > t2.tm_yday);
if (t1.tm_hour != t2.tm_hour) return (t1.tm_hour > t2.tm_hour);
if (t1.tm_min != t2.tm_min) return (t1.tm_min > t2.tm_min);
if (t1.tm_sec != t2.tm_sec) return (t1.tm_sec > t2.tm_sec);
... | 0 |
cf4811e7d3612d741aa9323e60d4dde1 | 201b95f4efa1d0d53338124aae866817 | Get geo-location information from ipinfo service | class IpGeo
public function fetchGeo($url = "http://api.ipstack.com/")
{
$this->curl = curl_init();
$apikey = require ANAX_INSTALL_PATH . "/config/apikeys.php";
$accesskey = $apikey["ipstack"];
curl_setopt($this->curl, CURLOPT_URL, "$url" . $this->ipinput . "?access_key=" . $accesske... | 0 |
60a783fdc99e6ec057e009705650c6a7 | 09b9ab251a4db72bd6179550a9935394 | The suffix for cfg -a parameter names | abstract class ezcConfigurationWriter
abstract protected function getSuffix(); | 0 |
07b093aa29a8e0880c16f7b783bff7f2 | 9d2d4583e22d07fe1eca63bf2d2ebb4d | Rename files that have been analyzed to their hash. This is
a convenient lazy way to deduplicate the samples that are stored
on local disk.
Note: this will not prevent future samples matching this hash from
being processed. | if full_filename is None or not os.path.exists(full_filename):
return
md5full_filename = HumbleHash.md5filename(full_filename)
if os.path.exists(md5full_filename):
os.remove(md5full_filename) | 0 |
3cb5e58b32a536e587cf22939191dec7 | fe1d328bbad3230cf67d57baefecc8c8 | Convenience function for building a Cookie HTTP header value. | function getCookieString(userOptn, req){
var cDomain = userOptn.cookieDomain || req.headers.host.split(':')[0];
var str = util.format('%s=%s; Domain=%s; Path=%s; HttpOnly', userOptn.cookieName
,userOptn.cookieValue, cDomain, userOptn.cookiePath)
if(userOptn.expires){
var dt = new Date(userOp... | 1 |
cddf41d1cc358bf39de43d80ade773b4 | 9bfff2607cff87cba8d1b65c2a1ab369 | @brief Method checking if database files are created and present. | {
QSqlQuery query = QSqlQuery(activedb);
QString strQuery;
QFile file(PATH_RMDUBLE_FILE);
if(!file.open(QIODevice::ReadOnly)) {
qDebug() << "Cannot read file " << PATH_INIT_FILE << "\n";
return false;
}
QByteArray data = file.readAll();
file.close();
strQuery = QString(da... | 0 |
adff222222a4d6f1217f1f03462dc2d8 | f1c3d4603321156fe857da73e1af6138 | objekt na mape vlozeny ako parameter sa linkne s polikami do ktorych zasahuje | public class XMLSaver extends AbstractKomponent implements ActionListener
public void getObjectsToLinks() {
objectsToLinks = serviceModulMPG.getObjectsToLinks();
} | 0 |
b60edaeb5a7d087c7ba5c392147fad46 | 217b6aa9c0433c199f8502a6144c9c27 | Initializes our module using our above struct | int init_module(){
my_device.name = device_name;
my_device.minor = MISC_DYNAMIC_MINOR;
my_device.fops = &my_device_fops;
int register_return_value;
if((register_return_value = misc_register(&my_device))){
printk(KERN_ERR "Could not register the device\n");
return register_return_value;
}
printk(KERN_INFO "De... | 1 |
a0ccc9f795ad817e6e1da345556bc6e6 | 2ebd8d54a71679eee9b0c204b60845c0 | mahal no değişikliğini uygular | {
try
{
if (textBoxMalzemeMaliyeti.Text != "" && textBoxIscilikMaliyeti.Text != "")
{
double malzememaliyet = Convert.ToDouble(textBoxMalzemeMaliyeti.Text);
double iscilikmaliyet = Convert.ToDouble(textBoxIscilikMali... | 0 |
f0ba8a807b8d8ce579cbdd23ed9bc439 | a17de2ea3acbd055c72379c1355b626a | Types period, and capitalises the next letter | namespace Faker.Extensions
public static class StringExtensions
public static string Capitalise(this string s)
{
return Regex.Replace(s, "^[a-z]", x => x.Value.ToUpperInvariant());
} | 0 |
c913473bd92d076189d3ab6d72ba34b9 | 9224abc3d417a2f960c07263e1e35b44 | This function is called the SM engine when CCMA completes setting the
transport parameters (initiated via the call to CCMA_MngrSetTranParms).
Transport parameters are sent to BT_HCI_If when the script processor sends
a set transport parameters command | _CcmImStatus _CCM_IM_BtTranOnSm_HandlerScriptSetTranParmsCompleted(_CcmIm_BtTranOnSm_Obj *thisObj,
void *eventData)
{
_CcmImStatus status;
MCP_FUNC_START("_CCM_IM_BtTranOnSm_HandlerScriptSetTranParmsCompleted");
MCP_UNUSED_PARAMETER(eventDat... | 1 |
959ab2da64ef3258fc0d256a1d2195fc | 518c83e9a1bafc29b7e7125d47b2f8d5 | This api adds or updates the GroupProfile with Profiles related to a group | var d = $q.defer();
var url = '/api/profile/create_group_with_target';
$http({ url: url, method: "POST",
data: {
targetId: profileId,
newGroupName: newGroupName,
}
}).success(d.resolve).error(d.reje... | 0 |
68abee6becdf18f34291e8ec10cd1afd | bc9651a6d7218b0b98655131297484bc | finds the end of the current frame in the bitstream. | {
PV_STATUS status = PV_SUCCESS;
uint8 *ptr;
int32 i;
int32 initial_byte_aligned_position = (stream->bitcnt + 7) >> 3;
ptr = stream->bitstreamBuffer + initial_byte_aligned_position;
i = PVLocateH263FrameHeader(ptr, stream->data_end_pos - initial_byte_aligned_position);
if (stream->data_end_p... | 1 |
ccf9013ff1f779d0d33e7410f2b760e9 | bbc914176542f6ab210efb7a2f029dba | Se encarga de obtener el tamaño del archivo en bytes | {
struct stat buf;
fstat(requestFileDescriptor, &buf);
int size = buf.st_size;
char sizeString[10] = {0};
sprintf(sizeString,"%d",size);
strcat(response,respuestas[3].msg);
strcat(response,sizeString);
strcat(response,"\r\n");
return;
} | 1 |
b02709e4979e22aa17a0a83ca2a049d4 | 186e9e09f669b98a785da8fc9db039e6 | 固定容器的轨迹压缩算法 | {
int N = (int)P.size();
vector<Vec2> v;
{
vector<pair<pair<double, double>, int>> temp;
for (int i = 0; i < N; i++)
{
temp.push_back({{P[i].x, P[i].y}, i});
}
sort(temp.begin(), temp.end());
for (int i = 0; i < N; i++)
{
v.push_back(P[temp[i].second]);
}
}
vector<Vec2> a, b;
a.push_back(v[... | 1 |
70506ccfe964b395c28e8b43688de112 | 8a759a61fbf0dee4822b4f28739bc39e | 撤销拆分批次操作。 | {
$order_number = trim($_POST['order_number']);
$id = $this->getId();
$uid = Yii::$app->user->getId();
$spu_arr = $sku_arr = $id_arr = array();
$Purchases = new Purchases();
$purchase_info = $Purchases::find()->where(array('order_number'=>$order_number,'status'=>0))->... | 0 |
6634ee4df12a224982e4428a05032b7a | 67b0cbf84ed7b460dfae7e4dee3ed87c | Getter for <code>gouchehui2.0.gch_car_activities.createtime</code>. | @Generated(
value = {
"http://www.jooq.org",
"jOOQ version:3.8.2"
},
comments = "This class is generated by jOOQ"
)
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class GchCarLifeThumbsRecord extends UpdatableRecordImpl<GchCarLifeThumbsRecord> implements Record9<Integer, String... | 0 |
1d7772118e1bda27b1ddb6166bc479cf | 86832ff767f40f3c7eed894686280426 | MovieDataCollector constructor. | RecommendatorService $recommendatorService)
{
$this->moviesService = $moviesService;
$this->findService = $findService;
$this->commentsService = $commentsService;
$this->recommendatorService = $recommendatorService;
} | 1 |
768fe83a2bd60f4869ee2f1cbca608b0 | 20d1ac0d47bb405986b2bec60f11fb0c | Returns the meta object for the containment reference list '{@link tamm.ContextAwareSystem#getRouteTasks <em>Route Tasks</em>}'.
<!-- begin-user-doc -->
<!-- end-user-doc --> | EClass getRouteTaskToOutputCondition(); | 0 |
6f9a058a6e2077999c5ea4f385ec8b89 | c9a3a5ea010e03bfb98d130abe2f1333 | ProgPow header hash does not match calculated hash. | if bh.difficulty > bh.pow.to_difficulty() {
return false;
}
Cuckoo::new(&bh.hash()[..], cuckoo_sz).verify(bh.pow, EASINESS as u64)
} | 0 |
4dc05544ef93533a1b3a3211ade73bb3 | 07e1274f73d092a60ca781a765d44f66 | Constructor method for ModifyWhiteBlackList | class cblack_list extends crecord
public function __construct() {
parent::__construct();
} | 0 |
39a73c18f7ccba1f564faaafe40c00de | 72f1919785a4c7c49d6ea95f7a1ec020 | 過密.
自分自身と隣接セルの状態から, 過密か否かを判定する.
生きているセルに隣接する生きたセルが4つ以上ならば、過密により死滅する。 | class Cell(Subject, Observer):
def _is_under_population(self):
if( (Cell.ALIVE==self._current_state) and (1>=self._neighbor_alive_num) ): return True
else: return False | 0 |
afd7855d2e96ece1fa64d3dd79bd1f1b | a40e688acf69406b6be0d80879681c76 | 随机调整位置,0:左上;1:左下;2:右上;3:右下。 | public class MyPanel extends JPanel
public int[] setPosition(int length, int z)
{
int[] r = new int[length];
boolean orient = random.nextBoolean();
if(orient)
{
switch(1 + random.nextInt(size))
{
case 1:{r[0] = random.nextInt(z);}br... | 0 |
7f7c92c32a1b3463f80ab9a193503ff1 | f3d3c0094457a0dced83b563718ccf9c | Returns a list where values represent the nodes and index represents
finishing times (of Kosaraju's algorithm) | class Solution:
def topSort(self, graph):
if graph is None:
return []
nodes = self.dfs(graph)
return [_.label for _ in nodes] | 0 |
64ae59131015b3f144d742ab8e935403 | 3e852b1bf226ee1250caa9cc6af64b9b | Illustrate the usage of the method java.lang.reflect.Method.isDefault() | public class Interface
private static void interfaceDefaultMethodTest() {
Inter4 inter = new Inter4() {};
inter.print();
//:~
} | 0 |
1890d47164b49498e9092ca1662d529d | fdf5f49b694843efd170c55cd50b6530 | Creates a JavaScript array object. | jerry_api_object_t *
jerry_api_create_array_object (jerry_api_size_t size)
{
JERRY_ASSERT (size > 0);
ecma_number_t *length_num_p = ecma_alloc_number ();
*length_num_p = ecma_uint32_to_number (size);
ecma_value_t array_length = ecma_make_number_value (length_num_p);
jerry_api_length_t argument_size = 1;
ec... | 1 |
2e913f3723c2cc75abe6d561b7696f06 | 2e2ce86fa943345d305c18e8d92489ff | Clear out a named declare block PLUS any instances that depend upon it. | class ASTBlockWithVariables(ASTNode):
def clear(self):
del self.declarations
self.declarations = list() | 0 |
c913a38c9156e3023848b3aedd31b65e | 4889c79cc11b9502d4b58814351db983 | Center the atoms at the Centroid. | def center_system(selection):
centerSel = atomsel(selection)
center = centerSel.center()
negCenter = [-1.0 * item for item in center]
moveSel = atomsel("all")
moveSel.moveby(negCenter) | 1 |
85c2c3991202d9546162ab09f35ac729 | 6e3031c3a4b67ff3ffc2a0a65982764b | Funcao que permite dialogos independentes | PrimeFaces current = PrimeFaces.current();
if (tipo.equals("alerta")) {
current.executeScript("PF('DialogVarAlertaTelefone').show();");
}
if (tipo.equals("ConfirmacaoExclusao")) {
current.executeScript("PF('DialogVarAlertaExclusaoTelefone').show();");
}
if (tipo.equals("confirmação")) {
current.exe... | 1 |
4ff8cb5734692844c6dc6898ff0b021d | f439fdd5f7403a0aef4585098ddb552c | Returns unit max shield | public abstract class BaseArtemisShip: BaseArtemisShielded
public float GetShieldsFrontMax() {
return mShieldsFrontMax;
} | 1 |
5aff9df0e5a7da9e543898721d025621 | 8664be73debc5a18a3d68da08ad7c4c5 | 사용자에게 현재 폴더에 있는 이미지 목록 제공 | class Upload(APIView):
def get(self, request):
img_list = os.listdir(path)
i = 1
for img in img_list:
data[i] = img
i += 1
return Response(data) | 1 |
54794fbe168b4c94c708e66dd4946eff | ba17a7579513581603dbe80cf1bdc404 | GET: Notificacion | {
IEnumerable<noticia> noticiaObj = null;
HttpClient hc = new HttpClient();
hc.BaseAddress = new Uri("https://localhost:44316/api/NoticiaCrud");
var consumeapi = hc.GetAsync("NoticiaCrud");
consumeapi.Wait();
var readdata = consumeapi.Resul... | 0 |
4847faaf8533e30f9cb111f245ca39fa | 63bdd9d41b641147223c3dc0766b31fe | 打印100以内的偶数 | public class EvenThread
private static void printEvenNumbers() {
for (int i=1;i<=10;i++) {
if (i%2 == 0) {
System.out.print(i + " ");
}
}
} | 0 |
816cdf5474b3c0c643d091698ae112bf | 1f776204575baa1a61c1e7a30d21eee0 | Setea el ancho de la matriz | public class CreadorCamino
public CreadorCamino anchoLinea(double anchoLinea) {
this.anchoLinea = anchoLinea;
return this;
} | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.