query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
85967b96e11ab956f780221deb0434bd | 22f343f351e5962a56e9c5690bc83797 | リニア値 → dB値に変換。 | public class MainMenuSFX : MonoBehaviour
private float LinearToDecibel(float linear)
{
float dB;
if (linear != 0)
dB = 20.0f * Mathf.Log10(linear);
else
dB = -144.0f;
return dB;
} | 1 |
4baf6c6199f266e3a8a0b41f6cda2937 | b5e0d3aad7ad91892da05404db23551f | 폴더경로를 가져온다. | public class FileController
public static String getPath(String file) {
int idx = file.lastIndexOf(File.separatorChar);
String path = file.substring(0, idx + 1);
return path;
} | 1 |
bd16e30e7767a8a3bc890c1129ae1472 | db9c50c0bf8319505503c5a71aaa3985 | 通过政策查询商品列表 | @RequestMapping(value = "queryItemByPolicyNo", method = RequestMethod.POST)
List<PrpCitemKindDto> queryItemByPolicyNo(@RequestBody Map<String, String> map) throws Exception; | 1 |
e9a31464526669b0b4b4f6154f9361de | e0f6c2d213a8f02bb6f5e19507127e7d | на удаленном экземпляре класса clazz вызывается метод method с аргументами params | abstract class Func
public static function invokeMethod($class, $name, $arg0 = null, $arg1 = null) {
$method = new ReflectionMethod($class, $name);
$method->setAccessible(true);
return $method->invokeArgs(is_object($class) ? $class : null, array_slice(func_get_args(), 2));
} | 1 |
63dcbc4991aad752ac886e94b27d06dd | 88705fdbb991dcb01d1a37101d6f001b | 遍历消费元宝文本组,设置消费元宝 | local accum = ActorManager.user_data.reward.cumu_yb_exp;
local rewardNum = ActorManager.user_data.reward.cumu_yb_reward;
consumeStack:RemoveAllChildren();
local rewardData = {}
for i=1, 5 do
local theData = resTableManager:GetRowValue(ResTable.activity_consume, tostring(i));
table.insert(rewardData, theDa... | 1 |
109fbf58baef8ec9e4904395e330d6bb | 8d0f4e58b5d363ddcc6b11b0835fe3e1 | フレーズの分割数を返します. | public class Sentence
public int length() {
return splitted.length;
} | 1 |
e3f8eb10a84cf5535908ad858e607d89 | ea5ca926c4d7e101cbdf646171f61d80 | Prevents authenticated users from coming this way. | class VoteSettingsController
def authenticate
deny_access unless signed_in?
end | 0 |
0ed919f8077f3717e847ac6fa04ba040 | d639893195e8124428e88e64953aae04 | Disables items upon acquisition. | function ListBox:OnAcquire()
self:SetDisabled(false);
end | 0 |
29f6f3bddec9a90e98f848c67fa8ebf7 | 2fbf8cf4165013f831686d9889792de8 | 新しいアクションを予約する。実行中のアクションがなければ直ちに開始する | export default class ActionComponent extends Component
_remove() {
this._queue.shift();
if (this._queue.length <= 0) this._queue.push(this.defaultAction);
if (this._queue[0].isPaused) this._queue[0]._resume();
else this._queue[0]._start();
} | 0 |
e2cbf652318941b6cc27c623f77fc9f6 | 4845433e5d1e4884a805fda696100296 | Spawn all minions at a regular interval | public class SpawnManager : MonoBehaviour
void Start () {
InvokeRepeating ("Spawn", spawnTime, spawnTime);
} | 1 |
4091ec2d2059ef28b0d19d8213904021 | 9adf60afdce45d4055fcbd2af1e06166 | function to convert binary to hexa | string hexbin(string s)
{
int i=0;
string bin = "";
for(i=0;i<16;i++)
{
char tmp=s[i];
switch (tmp)
{
case '0' :
bin += "0000";
break;
case '1' :
bin += "0001";
break;
case '2' :
bi... | 0 |
456a7c253e5017e8391f28ab868991cb | 00c64671e9eea0f9366384d4a28310ec | Sets the leaveDateTime
The time the attendee left in UTC. | class ChatParticipant implements \KGC\Bundle\SharedBundle\Entity\Interfaces\ChatParticipant
public function setLeaveDate(\DateTime $leaveDate = null)
{
$this->leaveDate = $leaveDate;
return $this;
} | 1 |
6ea0ae308a864128042051a7cc30db1c | 190db4ec9353a7adb5693d4c67fe20b3 | Print list of telescopes in current layout. | MATRIXLIST *ml
) {
int i;
Matval matval;
printf("nr\tmatrix\tpl\tfr\tgate\tbed\tstartblk\tblknr\n");
for(i=0; i<ml->matrixNr; i++) {
mat_numdoc(ml->matdir[i].matnum, &matval);
printf("%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\n", i+1, ml->matdir[i].matnum,
matval.plane, matval.frame, matval.gate, matval.be... | 0 |
2a0ca008f618f0e9ba89c1f1e6801d63 | 303cfa1dc7c7f7318b34610f11b19dd4 | 发送指定的商品分类 | {
$gc_id = intval($_POST['gc_id']);
$deep = intval($_POST['deep']);
if ($gc_id < 0) {
$gc_id = 0;
}
if ($deep < 1) {
$deep = 1;
}
$model_goods_class = Model('goods_class');
$seller_goods_class = $model_goods_class->getGoodsClass... | 1 |
2cc54eaa60268c6b5f25ac3fefc6fd66 | 9a9a2ebac5ec1d96bd3b060b8ee2ddcd | 实验8 投影查询:使用Object数组类型接收查询结果 | QueryRunner qr = new QueryRunner(C3P0Util.getDataSource());
Map<Object,Map<String,Object>> map = qr.query("select * from sunxiaozhe", new KeyedHandler(2));
for (Map.Entry<Object,Map<String,Object>> m : map.entrySet()){
for (Map.Entry<String,Object> mm : m.getValue().entrySet()){
... | 0 |
d8e035d4c2778ddbe224dbaa2bf1dbc3 | 980781da0c931ea4bb6b73b11ec5e55a | 对分词结果进行切分,并去除停用词 | def cut(sentence):
jieba.load_userdict('./jieba_dict/user_dictionary.txt')
with open('./stopwords.txt', 'r', encoding='UTF-8') as input_file:
stopwords = input_file.readlines()
words = []
for word in jieba.__lcut(sentence):
if word not in stopwords:
words.append(word)
ret... | 1 |
c03b65fe0a91c4bf34312f12ca4fa571 | a1b791225d3df7275d679fd0b8b3b4ce | 单独处理读取FTP服务器上卫星云图的资料列表 | path = str(data[7:]).strip()
logger.info('SFTP path: {0}'.format(path))
sftp_file_name = os.path.split(path)[1]
if os.path.exists(os.path.join(local_tmp_dir, sftp_file_name)):
logger.info('该文件已经处理过,忽略。')
else:
handle(path) | 0 |
f5285690acc09c24780fb300accceeee | 12a4da141059fa866342618a7f7694a5 | Needed for question 3.2 (Minimum Value). | def min(l):
l.sort()
return l[0] | 1 |
368bd14a23ef89039a9962b74f24ca60 | e05f9457f745ca249feafdd10112d5fa | 判断字符串是否非null && 非空字符 | public class CommonUtils
public static boolean isStrNotNull(String str) {
return str != null && str.trim().length() != 0;
} | 1 |
a4683a4f354fb43ead266e63bca8c7ce | f3af1d3baccf05dab4c592a74e6ae03c | Update the entry indexes and stats, and not update crawling result. | class BaseEpisodeCrawler:
def update_crawl(self):
self.populate_episode_info()
self.info_reader = logger.InfoReader(self.directory)
self.shallow_crawl() | 0 |
b45e3e3a41be9e9e64d4296054be48bb | 2ae94e69561118521b2d534908b8ef84 | Устанавливает список смайлов | class jSmileHelper
public static function smilies_init()
{
$wpsmiliestrans = array(
':mrgreen:' => 'icon_mrgreen.gif',
':neutral:' => 'icon_neutral.gif',
':twisted:' => 'icon_twisted.gif',
':arrow:' => 'icon_arrow.gif',
':shock:' => 'icon_eek.gif',
':smile:' => 'icon_smil... | 1 |
ed20bc49f03602931bf6715e773d3f38 | 6ae4535c465a07fe3a15255768d813fc | get the next empty slot in the global file list array | {
T_stfs_fcbl *p_fcbl;
uint32_t i;
p_fcbl =&g_fcbls[0];
for (i = 0; i < SFFS_NFILE; i++)
{
if (!(p_fcbl->status & (STFS_OPEN_TO_READ | STFS_OPEN_TO_WRITE)))
{
p_fcbl->status = 0;
p_fcbl->p_thread_id = (uint32_t)tx_thread_identify();
return (i);
}
p_fcbl++;
}
return ... | 1 |
3c69f6a2982b801c85dee035cfc372d8 | b34d95c4b7912d3b526fbf52663b9c97 | Measure the symmetrical distance between two songs.
It is the mean of the metrics between the two songs
taken in both direction | sound = parselmouth.Sound(pathSound)
sound = sound.extract_part(from_time = start_time , to_time = end_time + 0.02)
pitch = sound.to_pitch()
pitch_values = pitch.selected_array['frequency']
outliers = Features_f0.get_outliers_in_frame(pathSound, start_time, end_time)
low_... | 0 |
7773e22524fe099c57c8a1f79de596a4 | 4cae65b562b3b992fbae6ca5b392c49d | Caricamento delle liste dei titoli. | public class GeneralView extends AbstractClientView{
public void loadTitles(List<String> titles) {
articles.clear();
for(String title: titles) {
loadTitle(title);
}
reloadArticles();
} | 1 |
6bcbfc74790050a35578a87a6254a521 | 873b8dc183d44b6e633c42da55e56455 | アンケート作成 | System.out.println("モバトク:アンケート回答機能開始");
driver.get("http://pc.mtoku.jp/research/");
int pointLooperAn = driver.findElement(By.cssSelector("body > div.content.research > div.c-box > table > tbody "))
.findElements(By.cssSelector("tr")).size();
System.out.println("モバトク:クリック要素数 : " + pointLooperAn);
List <... | 0 |
3372ed5e6e707415c850854a0298a925 | 1b59ed1a24c282c9b1c7560bc95360b0 | Initializes and sets the default Redis persister. | class RdsPersist
public function __construct()
{
$this->redis = new RdsDb();
} | 1 |
03dc7d52e8a06c0294d1fda9198ed102 | 93d523ad65acbcf9ac61da85c51a6b07 | Returns the transform from source display coordinates to target display coordinates.
This transform may change every time that a zoom; translation or rotation is applied
on at least one canvas. The transform may be absent if an error prevent to compute it,
for example is no coordinate operation has been found between t... | public class TransformContext
public AffineTransform getScreenTransform() {
if (!_cacheValid) {
validateCache();
}
return _screenTransform;
} | 1 |
29896f58dd97cd64b349acaef62eebf8 | 10623684ea48a71d08afdf0f09037498 | 启动添加笔记Activity | public class MainActivity extends AppCompatActivity
public void newNote(View view) {
Intent intent = new Intent(this, activity_add_create_note.class);
this.startActivityForResult(intent, MY_REQUEST_CODE);
} | 1 |
b464ca0e9bceb0ce82c0dad97e650d68 | 7f61448ad6da3ef0f9cb03f40c5be655 | Tuong tu nhu find_max | cases like (1) | 0 |
9af0b5d702a64bb13826249d432d66c8 | 3e7c69cfea252010648ac8ac0b3b546a | Performs the rollout. Starts at start_node, gets an action from Actor and moves to the next state/node.
Continues this until a final state is reached | found_goal = False
self.node_pos = DynamicArray(d=start.shape[1])
self.node_parents = DynamicArray(d=1)
if self.all_actions is not None:
self.node_action = DynamicArray(d=1)
self.node_pos.append(start)
if self.all_actions is not None:
self.node_act... | 0 |
48554733fdf3e56e20c4e208b53e2120 | 586634cda4e14a0ea0ba9de8126577ee | Gets the collateral agreements by credit agreement. | const path = api.getCDPsByCollateralType + '/' + collateralType;
const res = await tx.getTx(path, this.baseURI, timeout);
if (res && res.data) {
return res.data.result;
}
} | 0 |
6e1d5a761f566ed4b6a357b967c8e291 | 30008f17990bee79be2d68d34e7eeb5d | テキストをセットします。指定回数表示された後は表示されません。 | public class TextMessage : MonoBehaviour
void TextCount(ref char[] text)
{
if (isPopText) return;
if (_count > text.Length)
{
_count = text.Length;
isPopText = true;
}
_textMoveCount += Time.deltaTime;
if (_textMoveCount > _textPopTime)
... | 0 |
3100c5953dd728f48b7d083afb516722 | 74cda4bafedd5e09b1d02f0b9724d0e3 | Converts the specified value to Kilobits per second. | namespace Juniper.Units
public static class BitsPerSecond
public static float KibibytesPerSecond(float bitsPerSecond)
{
return bitsPerSecond * Units.KibibytesPerSecond.PER_BIT_PER_SECOND;
} | 0 |
0322f1aa8fbc62d8e9571034bdc2db25 | 88bff83a1531aa93a0e7ccc7a396cbaf | 保存产品历史 | {
if (data == null || data.Count == 0) return false;
var isok = _service.InsertBatch(data);
if (isok)
{
_service.ExecuteCommand(
@"insert into crm_product_screw_history
select 0 pHistoryId, a.* from crm_product_screw a
where (S... | 1 |
14f56e4f2deabe5da8d1ff02df65a96a | cecfb487dd340ecbe1f01118136ddab7 | Get the associated Tax object | @EFapsUUID("89710086-ecfa-4868-a185-cf4f6e8f290b")
@EFapsApplication("eFapsApp-Sales")
public abstract class Tax_Base
implements Serializable
public TaxCat_Base getTaxCat()
{
return taxCat;
} | 0 |
921431b22dc13b5554c74f8cf25cf0cf | db5eeb5ad18e24969f74fd348505f2d0 | bit-nor | def NOR(values):
if OR(values):
return False
return True | 1 |
aa7d5040adda80aa244d09d421d7608b | 954b4b7acfb2c6b8e465824607812470 | 开始录像回放 | startShootVideo() {
var ctx = wx.createCameraContext();
ctx.startRecord({
success: (res) => {
wx.showLoading({
title: '正在录像',
})
}
})
} | 0 |
af8bb7a5d841fd35870eb7835af928e0 | bf5e071a0193bee7e21a27df764996b1 | 获得给定域名下按主机名首字母的统计情况 | List<CountStatItem> getHostAccessCountByDomain(String domain); | 0 |
ec49c282b5212393fd4c2e4edbf9bace | 541e463f20e2ae11a4c9648a4ea1459f | 测试用应用1所对应的CAP,返回两个CAP | namespace class TestDriver : public SampleDriver
Return<void> getCapabilities_1_2(getCapabilities_1_2_cb cb) override {
cb(ErrorStatus::NONE, {});
return Void();
} | 0 |
385c7ee2a8a7293840676b5dcf999cf8 | 51313949523703bf64f3b7849789d862 | 新增保险计划. | function addinsu(params) {
return request({
url: 'S100013/insurance/new?id=' + params,
method: 'post',
})
} | 1 |
43733214b549dec363f38c9d86ac4c74 | 4240915f303cc6192c4b1acf02bd6e36 | 下载资源并计算时长 | @SuppressLint("CheckResult")
fun fileDownLoad(activity: Activity, progressView: ProgressView, downLoadUrl: String) {
Observable
.create<Int> {
try {
val url = URL(downLoadUrl)
val urlConnection = url.openConnection() as Http... | 0 |
61d3aa86d5ef76d7d9ab0101994c4039 | 587d7c4eb7289990d655b6f0e6d957e0 | Gets current time and stores it in a time structure | void Robot::log_file::init_time()
{
time( & current_time );
time_info = localtime( & current_time );
} | 1 |
ffe3d247d4fe9116f4779f217731d22b | c531b9beaed0861ea147e153c959c555 | ログイン状態であっても、自分以外のユーザーが作成したレシピの編集機能へは403で利用できない | @recipe = Recipe.find(recipe_id)
@user = @recipe.user
redirect_to root_url unless @user == current_user
end | 1 |
fab92ba5bb4daf60c560a0fbaaee705e | 21b9182383f27b5a230a7f3bbef257a8 | Constructor - initialize as Empire | Unit S;
S.id=3;
S.max_health=800;
S.health=S.max_health;
S.attack=300;
S.heal=0;
S.max_mov_points=4;
S.mov_points=S.max_mov_points;
S.atk_type=1;
S.atk_chance=true;
POINT P;
P=MakePOINT(0,0);
S.location=P;
S.evasion=0.2;
S.recruitment_price=200;
S.upkeep_price=20;
*s=S;
} | 0 |
da444f2b88beec12453079e00b7bbda5 | 7cd92598aa5e7dc699c848185e467de9 | Check task_data has the right format, and set it to the right empty state if not | function checkTaskData($taskName, $taskDescription, $beginDate, $deadline, $taskComplete, $taskWorkedTime) {
$taskWorkedTimeRegExp = "^([0-9]{1,})$";
$err = array("taskName" => "wrong", "taskDescription" => "", "taskWorkBeginDate" => "wrong",
"deadline" => "wrong", "complete" => "", "workedTime" => "wro... | 1 |
7dcd790429e716321bd69e1227ef0822 | cd5809284e701de9a4aaf0cbed7fa56a | 我的微博页面实现收藏功能 | class IndexAction extends Action
public function colmblog()
{
if($_SESSION['member']){
$uid = $_SESSION['member']['id'];
$poro = $_SESSION['member']['poro'];
if($_GET['bid']){
$bid = $_GET['bid'];
}else{
exit("参数错误!");
}
$operation = M("operation");
$op_data = $operation->where("uid = ... | 1 |
ae602e5c68307af4603a9e00276f299e | c398fc49e626386b289654cc295acde6 | Session ID for the given stream. The session id is an optional
human-assigned identifier of the recording session. While it is
rarely used, it can be used to prevent concurrent recording
activitites on the same sub-network (e.g., in multiple experiment
areas) from seeing each other's streams (assigned via a configurati... | public class CurrentState extends HelixProperty
public String getSessionId() {
return _record.getSimpleField(CurrentStateProperty.SESSION_ID.name());
} | 1 |
8babbd9cb5ca490a1e84e6a3db3f559b | 8d74a0b7190f906000a38c5c2d226d9d | Assign newly defined Year-Month to coordinates, then group by it, then take the mean | public function groupResultsByYear(); | 0 |
33ce4c9dd52709089821d686c4041bf7 | 7f61448ad6da3ef0f9cb03f40c5be655 | Used by tests to ensure consistent behaviour. | cases like (1) | 0 |
fa11ad541d08feb29451374f0d85cac6 | 326de46e96bc561cad3c0868ea72cc15 | Notification function to indicate teletext reset end | {
oric->nonrawend = 0;
if( oric->rawtape )
{
oric->tapeout = oric->tapebuf[4];
via_write_CB1( &oric->via, oric->tapeout );
oric->tapeoffs = 5;
tape_next_raw_count( oric );
}
else
{
oric->tapeoffs = 0;
oric->tapebit = 0;
oric->tapecount = 2;
oric->tapeout = 0;
ori... | 0 |
7a1214c20fcf932e4e1853eca1c34fe1 | f7dbe6c30661e5059db33f7008415dff | the original list shouldn't be modified. | class Solution:
def reset(self) -> List[int]:
return self.original_list | 1 |
28a58b5af5024ecad8be1b30106e9836 | 29be375bb28d9a7e82583c85c3ce429c | handles removing a part from the associated parts array
shows dialog to confirm it has been removed | public class Inventory_GUIController implements Initializable
@FXML
void onActionDeletePart(ActionEvent event) throws IOException {
stage = (Stage)((Button)event.getSource()).getScene().getWindow();
Part partToRemove = partTable.getSelectionModel().getSelectedItem();
if(partToRemove ==... | 1 |
e71912189a0e0533b1d1fab84e0cf44f | d98b1e8016ad11893d90651c52b66fe3 | 汽配订单支付 | @Controller
@RequestMapping("app/order")
public class OrderController extends BaseController
@Deprecated
@RequestMapping("payParking")
public void payParking(HttpServletRequest request,
HttpServletResponse response,
@RequestParam String payPassword,
@RequestParam String orderId,
@Reque... | 0 |
8a4710c22b73875651e02f6b27599a96 | 869ed19ac53ae540577cec604d488a5c | Print parameters (and much else) for the csp3 packet handler | char *IndentStr)
{
int i;
printf("%s", IndentStr);
printf("Priority: %d\n", pTxCHOpts->Priority);
printf("%s", IndentStr);
printf("Service: %d\n", pTxCHOpts->Service);
for (i = 0; i < pTxCHOpts->NMCS; i++)
{
printf("%s", IndentStr);
printf("MCS[%d]: %d\n", i, pTxCHOpts->pMCS[... | 1 |
c3f27beffe8068891816d7d3af3c7f17 | 721d8d74e4c445d336d1d2b4aadf9640 | reset the start and destination corodinates to allow the graph to be built correctly | sourceVertices[0] = Point(700,605);
sourceVertices[1] = Point(890,605);
sourceVertices[2] = Point(1760, 1030);
sourceVertices[3] = Point(20, 1030);
destinationVertices[0] = Point(0,0);
destinationVertices[1] = Point(640,0);
destinationVertices[2] = Point(640,480);
destinationVertices[3] = Point(0,480);
} | 1 |
48c878347039cddd8e25a253504eea45 | bb05d3d73e3dadeea584ad62c917ff3e | imgur에 업로드 후 주소 반환 | files = {"uploadedfile": open(uploadedfile_path, 'rb')}
url = 'https://www.tistory.com/apis/post/attach'
data = {'access_token': app_config.access_token, 'blogName': blog_name}
res = requests.post(url, params=data, files=files)
print(res.url)
if res.status_code == 200:
print(res.text)
... | 0 |
253e3371e8e392995c782ab19eb5ccbf | 994ed5398f74c3051cf7e809a0415c10 | 注销当前场景 | delete res[sceneName];
let w: any = window;
let scene: any = w[sceneName];
for (let i in scene) {
delete scene[i];
}
delete w[sceneName];
scene = null;
} | 1 |
9c9e8e11c17c6335011ce2d13a592a9d | a1f7c6e0da4891693ee1d75efebe02ab | Converts an equatorial position vector to an ecliptic position vector. | class CoordinateSystemService
static convertFromEclipticToEquatorialCoordinate(eclipticCoordinate, localDate) {
var lambda = ACS.d2r(eclipticCoordinate.longitude);
var beta = ACS.d2r(eclipticCoordinate.latitude);
var eclipticObliquity = ACS.d2r(CoordinateSystemService.getEclipticObliquity(localD... | 0 |
208f68acaf36c4249dc09593de0b4c76 | f303e87ff76115787922dccf8122c65f | Relations should only be allowed for databases in the pool. | original_weights = settings.DATABASE_POOL
settings.DATABASE_POOL = {
'other': 1,
'utility': 1,
}
self.router = WeightedRandomRouter()
self.obj1._state.db = 'default'
self.obj2._state.db = 'other'
self.assertTrue(self.router.allow_relation(s... | 1 |
03bfe484653629ffbeff0222313d437f | 8bd45fa7d304b205276c53707da7792d | A convenience function to test if the site is marked as down according to the config panel.
This method includes handling the preference that indicates that site-down behaviour should
be disabled for certain IP address ranges. | {
global $CMS_INSTALL_PAGE;
if( isset($CMS_INSTALL_PAGE) ) return TRUE;
if( get_site_preference('enablesitedownmessage') !== '1' ) return FALSE;
if( get_site_preference('sitedownexcludeadmins') )
{
$uid = get_userid(FALSE);
if( $uid ) return FALSE;
}
if( !isset($_SERVER['REMOTE_ADDR']) ) r... | 1 |
b203410b7723fb091543c2e3417b8715 | c38804ab8b0a8be0e9df3eae67d8dfba | 엑셀sheet 선택시 보여주기 위한 함수 | namespace PTGame.Utils.CVS
public class ExcelTools : EditorWindow
void OnSelectionChange()
{
Show();
LoadExcel();
Repaint();
} | 1 |
f741c43ade26acdca911d44708ee06eb | b97cd0e1e53bedebf308505263782180 | Get a new HibernateCallback for finding objects by the content of a
property, paginating the results
class of the hibernated object
name of the property
property must contain this value
the first result, numbered from 0
the maximum number of results | public List<T> findByPropertyForPage(final Class<T> entityClass, String propertyName, Object value, Integer offset, Integer length); | 1 |
e7f9a9cdafb5895411a7151af75ef019 | d7163c96f60ee70a5c1271004ec2e1ec | Computes the <see cref="AABB2" /> that is in common between the specified <see cref="AABB2" /> and this <see cref="AABB2" />. | {
Vector3 end = End;
Vector3 topLeft = new Vector3(Mathf.Min(_position.x, end.x), Mathf.Min(_position.y, end.y), Mathf.Min(_position.z, end.z));
return new AABB(topLeft, _size.Abs());
} | 0 |
8a9354b56204a2f764d88951844c32cc | 070e20dfc8720dbd2e7f6e6cef7557bd | copy attributes to get nice figure labels and change Kelvin to Celsius | class Temperature:
def __init__(self, param):
self.__name = param[0]
self.__root = param[1]
font = {'family': 'Verdana', 'weight': 'normal'}
rc('font', **font)
self.__figure = None
self.__plot = None
self.__prepare_figures() | 0 |
b08f96b542c0175a4cb319d0e006b094 | 4dc9220cf8150fe411dc1b99626030ab | Toggle env testing | err := os.Setenv("ENV", config.TEST)
if err != nil {panic(err)}
log.SetOutput(ioutil.Discard)
envConfig = config.LoadConfig()
srv = server.NewServer(envConfig)
testHub = srv.Service().Hub().(*hub.VoidHub)
code := m.Run()
srv.Release()
os.Exit(code)
} | 1 |
82b75b246eb34626be1e7b9b5701ce08 | 6f8a6079ba65597d73266d108c9a57e4 | Initializes the bonus balls. | public class NewBall : Bonus
void Start () {
} | 0 |
d67cd893191882e41b9cf139c8fc55d0 | 565b916457b9be357a22308c4d2096ba | # PUB/SUB: reads from the socket until there is a message. | class AmiCtl(object):
def _soc_reader(self, soc=None, rPut=None):
self.ctllog.critical("Spawned _soc_reader")
while self.soc.connected:
sleep(self.timeout)
recv = self.soc.recv()
self.reactor(recv[1])
log_msg = "[ Received from AMI %4s bytes -- %s ]:\n%s"
... | 0 |
2608204cfe40e537f0b6af342b50a5b5 | 596efa647614eca868211e6317a18e2f | Gets if the file title should be shown in explorer view.<p> | public class CmsPreferences extends CmsTabDialog
public String getParamTabExFileDateReleased() {
return isParamEnabled(m_userSettings.showExplorerFileDateReleased());
} | 0 |
51f4191f6fdaa50980dc372a832734e1 | 3e4935b42b60f7acf36dbb914d297a95 | @brief Funcion que procesa un vector de muestras de entrada con el compresor de audio. | void updateAudioProcessorFsm(audioProcessorFsmStruct_t *audioProcessorFsmStruct)
{
uint8_t status = 0;
uint32_t k, stateCounter = 0;
ui_VectorProcessor(audioProcessorFsmStruct->vectorLength, &audioProcessorFsmStruct->inputVector[0]);
if(audioProcessorFsmStruct->audioProcessorStatus == ENABLE)
{
for(stateCounter ... | 1 |
96625ce771760f28aa6d8b546bb57624 | d2f7ad20410dca2d02d1fc115df10cae | Projection matrix from all edges to boundary edges.
Constructs and returns a matrix :math:`\\mathbf{P}` that projects from
all mesh edges to boundary edges. That is, for a discrete vector
:math:`\\mathbf{u}` that lives on the edges, the values on the boundary
edges :math:`\\mathbf{u_b}` can be extracted via the followi... | class DiffOperators(object):
def project_face_to_boundary_face(self):
is_b = make_boundary_bool(self.shape_faces_x, dir="x")
if self.dim > 1:
is_b = np.r_[is_b, make_boundary_bool(self.shape_faces_y, dir="y")]
if self.dim == 3:
is_b = np.r_[is_b, make_boundary_bool(self.s... | 0 |
adcac9892ca8b4e1c6ab76da9bd095b8 | 948902476d6a1fc779af4a71a498e219 | Returns currently active buffering blocks. | extern int CurrentBlocksCount()
{
return queue_count(curblocks);
} | 1 |
c6fd331ed607c3d85308336bfa43749a | 62bba30820c50ec2bf17e430db3e9348 | Get sessions for current user | class Redis extends AbstractStorage
public function getUserSessions()
{
$sessions = array();
$identifier = $this->getUserId();
$key = $this->getStoreKey().':';
$dbSessions = $this->getActiveSessions();
if ($dbSessions == false) {
return $sessions;
... | 1 |
0f95c0812fb85ee5f9a58d6228d15c05 | 594d7f522b22610a95d2f60bfbaa665a | 当发生错误时是否要重置 | interface SweetExceptionHandler
fun onException(isRecoverable: Boolean, throwable: Throwable): Boolean | 0 |
cd09c24608bb5d33892493bf89786398 | 89a0c1922406636e4cf522348f04272c | Test the reading of passwords. | public class BasicTest extends MPXJTestCase
public void testPasswordProtection() throws Exception
{
File in;
try
{
in = new File(m_basedir + "/readpassword9.mpp");
new MPPReader().read(in);
assertTrue(false);
}
catch (MPXJException ex)
{
... | 1 |
fd17edc634fde544d5e0420b1bf8388f | 93b467871120d9322a971f8690bc99af | 顯示當前建築狀態 | public class BuildingScore : LevelObject
public void UpdateState()
{
var state = ScoreController.GetStatusForBuilding(_building.BuildingColor);
if (_state != state)
{
switch (state)
{
case BuildingScoreState.PlayerStar:
StarIcon.col... | 1 |
9ccb049c6e38052856836d61ba2d4b4d | 6707bc5a8fb67e087535dd91ebf22068 | Restore base optimizer fp32 weights from checkpoint by:
1) Merging fp32 weights from checkpoints of all partitions
2) Extracting fp32 weights for current partition from merged weights
3) Using extracted weights to update base optimizer weights directly. | checkpoint_path):
model_vars = checkpoints.restore_checkpoint(checkpoint_path, None)
params = model_vars['optimizer']['target']
batch_stats = {}
return {
'optimizer': {
'target': params,
},
'model_state': {
'batch_stats': batch_stats,
}
} | 0 |
b5ad41b40b5867c7119aa803e8933c77 | 1c3460ef3a750279657c4727ed4ebb6f | 5. Find the Number Occurring Odd Number of Times | public class FindTheNumber
public int findTheNumberOccursOddTimes(int[] arr){
int res = 0;
for (int i = 0; i < arr.length; i++){
res = res ^ arr[i];
}
return res;
} | 1 |
5be45e5774a37d0dbba25e7e8d072dd4 | d3f069b78ec5f3894c6d9f1fe44194de | 获取密保问题答案2 | public class QuestionModel
public String getAnswer2() {
return answers[1];
} | 1 |
0f4e0ff4b2e81e358b8f947346e75f95 | 61aa629aaccf3e13838d18fe737d5895 | Find organization by INN or OGRN | namespace Midway.ServiceClient
Organization GetOrganizationByInnKpp(string inn, string kpp); | 0 |
8484313f1386386ff9e1e8658b319242 | 6fad7d108af448bcbc0434ff703b8c45 | Combined dictionary containing all request parameters except headers | class BaseRequest(object):
def values(self):
return CombinedMultiDict([self.args, self.form]) | 1 |
440d5fedcdcfe4c442a453a3604c50ac | 0f13350395568566686af4c4c8b31c8b | create a pre_transform_specs df from json file. | class PreTransformSpecsUtils(TransformUtils):
def create_df_from_json(sql_context, jsonpath):
schema = PreTransformSpecsUtils._get_pre_transform_specs_df_schema()
pre_transform_specs_df = sql_context.read.json(jsonpath, schema)
return pre_transform_specs_df | 1 |
71dd58b1dfb28804c9abfd9e4d021fe7 | 0f9dfd7511adbe902499d02c3176116b | List of cidrAddresses that should be associated with a single vpc within our network
environment | public class CreateElasticResourcePoolRequestBody
public String getCidrInVpc() {
return cidrInVpc;
} | 0 |
3422cc34a16a884a2afc9c2f8ffa4738 | 9366e8221dc6f07460e884ebbe4146f5 | Multiplicar base por altura para sacar el área del segundo rectángulo | function areaRectangulo(b,h){
const base = Number(b);
const altura = Number(h);
let area = base * altura ;
console.log(
`
-----------------------
El area del rectangulo es
-----------------------
${area}
-----------------------
`);
} | 1 |
66763a70e41a19e71f469b348f13bb75 | 2f70eb36adbb8617da1a2a0e6337ff88 | issue a compiler error if container tries to move | MoveStruct() = delete; | 1 |
b90ae5d6d474cd34e16cfda69e53a62a | cffc2ef3771b16f2e00f76f817a37158 | ========================================================================
AUTHOR: Jeff Henry
PURPOSE: This will update the minimum date on the second calendar so
the user can't select an end date that comes before the start
date.
UPDATED: 11/7/2014
======================================================================... | def wmEvent_datechange(self):
bdate=self.sel_begindate.date()
edate=self.sel_enddate.date()
if edate<bdate:
self.sel_begindate.setDate(edate)
self.sel_begindate.setMaximumDate(edate) | 0 |
7894e48ef2fc9bc74346855bef518315 | b9eb41958750971341838dc23512cbb2 | function adds a coordinate to vector of rooms that have been visited before | public class AutomaticMazeExplorer extends MazeExplorer implements MazeAutomaticExplorer
@Override
protected void movingToHook(MazeDirections coordinate) {
visitedCoordinates.add(coordinate);
} | 1 |
0e3ed5d498bccdf3ae886eb11f6db0e3 | c85e0ea2fe3bd4d7643f5c3b9876625a | Allows access only to admin or django_admin users. | def django_admin_only(wrapped_function):
@functools.wraps(wrapped_function)
def _wrapper(*args, **kwargs):
if args[0].request.user.is_superuser:
return wrapped_function(*args, **kwargs)
else:
raise PermissionDenied
return _wrapper | 1 |
bda658606e3123091105b54c3bb4889c | f785d06da9da5ecf5684d58c59d9be74 | Set toolbar button size
OUTPUT : None | {
static QList<int> sizes( QList<int>() << 16 << 22 << 32 << 48 );
for ( QToolButton *button : std::as_const(_toolButtons) )
{ button->setIconSize( QSize( sizes[index], sizes[index] ) ); }
_toolBar->setIconSize( QSize( sizes[index], sizes[index] ) );
} | 1 |
b1cea528ada55fc809206ba68b8b51d8 | ed2ebc0cf883dad5f3daeff2dda71f87 | Returns an integer value equivalent to this <see cref="Rational"/>. | namespace CSF
public int ToInteger()
{
if(!this.SimplifiesToInteger)
{
throw new InvalidOperationException("This fraction does not simplify to an integer");
}
return (int) (this.Numerator / this.Denominator);
} | 1 |
c7ad9a48ebab915b38bf5e24a5483328 | 661dfe438c5f77515dbc4391b23b6879 | 发送测试485测试并检测测试状态 | namespace ACA_BreakCommunication
public class SuyiMCCB
public bool CommunicationTest()
{
communicationOK = false;
ReadCmd readCmd = new ReadCmd();
readCmd.start = Start;
readCmd.address0 = Address.a0;
readCmd.address1 = Address.a1;
rea... | 1 |
097de91bf3c06a050e185945a7a9297e | 35f5c0fd966dbd79625a161e1d1df761 | Ensure missing bank name fails | {
$client = $this->createClient();
$parameter = [
'domain' => '2',
'depth' => '6',
];
$client->request('GET', '/api/bank/check_unique', $parameter, [], $this->headerParam);
$json = $client->getResponse()->getContent();
$output = json_decode($js... | 1 |
fea1e44241314d31929a9fe662d5b475 | 538ced068658c19ef1434af9eea1ddef | ミューテックスをロックする | void mmrll_lock(void) {
lock_acquire(&mmrll_lk);
} | 1 |
1c539173052ae527df819e7424853665 | a2a22d539b31d7cb4ce0c22a370e49f1 | 新增电能表资产检定记录 | ApiResponseResult addMMeterRecord(MMeterRecordAddVo vo) throws Exception; | 1 |
d8b806cb48e28a6b753d991dffcd737b | 0d5af0234271adc0c2d82c85034e8714 | Get the number of the last successful build of the given job. | class RemoteAccessApi(basePath: kotlin.String = defaultBasePath, client: OkHttpClient = ApiClient.defaultClient) : ApiClient(basePath)
@Suppress("UNCHECKED_CAST")
@Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun g... | 0 |
9858def61645c717d261df9bf5b442a6 | 0038c8aa8841664b94202da03edbbbba | 获取可被多个进程共享的Int值,若key不存在,则返回0 | public class SPUtil
public static int getInt(String key) {
return getSharedPreference().getInt(key, 0);
} | 1 |
229e3d3842841570a71e0d517cd7cf35 | e6698435fc83d83ca8a2c282cf873a54 | # Can deal with complicated labels, e.g.
# xlab="Example:"~bolditalic("V")["max"]~"[km s"^"-1"*"]"
# ylab="Example: "~frac(sigma,bolditalic("V")["max"]) | append_units.default <- function(
x,
...,
open = getOption( 'yamlet_append_units_open' , ' (' ),
close = getOption('yamlet_append_units_close', ')' ),
style = getOption('yamlet_append_units_style','plain'),
target = getOption('yamlet_append_units_target', 'label')
){
stopifnot(style %in% c('plain', 'late... | 1 |
1c76eec892aef9eb7014b8b29bf018e5 | 1ab7bc5492f70a5288dcfdd7195f200f | Gets the siac r liquidazione classes. | try {
List<Alicuota> items = new ArrayList<Alicuota>();
for (Alicuota item : items) {
getItemsBIC().addBean(item);
}
} catch (Exception e) {
LogAndNotification.print(e);
}
} | 0 |
f72bedef9a68849994120000ca2b06f6 | 6cb7949618f92dd7e5a04308545fec95 | Create pycocotools COCO dataset from records | input, output_fn = argv
from glob import glob
categories = [{"supercategory": "jie", "id": 0, "name": "节"}, ]
info = {
"description": "WOODBOARD 2019 Dataset",
"url": "http://dyh.org",
"version": "1.0",
"year": 2019,
"contributor": "dyh,hhh",
"date_created... | 1 |
5f0df7bb12cf07954bccd10c8a7713fb | 05e8223f07314d64c5da81693e30e50b | Projects when a comment is added | function addComment(req, res){
return knex.transaction(function(t){
return knex('Project')
.transacting(t)
.insert({
project_name: req.body.project_name,
project_text: req.body.project_text,
project_karma: 0,
project_projecttype: "newComment",
... | 1 |
979529969952941ba907c2aa37851109 | d14e2d730f1bc579fc0f494862bfca4f | ACQUISITION FUNCTION FOR UCB TO BALANCE ECPLOITATION & EXPLORATION. | c = np.sqrt(2)
ucb = self.wins / self.sims + c * (np.sqrt(np.log(n_tot) / self.sims))
return ucb | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.