query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
a624cf6c14b86a8d8d7614b3f9b47db4 | e468d2961f2ecac46de9051efcd05eef | If the model is a feature extractor model:
- evaluation model is on
- trunk is frozen
- number of features specified for features extraction > 0 | if self.args.batch_normalization == "basic":
self.feature_extractor.eval()
else:
if context:
self.feature_extractor.train()
else:
self.feature_extractor.eval() | 0 |
726ee347b27ef3b052de485a849b881e | de2562afa843093c1a5913b57248af0b | Each pile starts with one card | function OogaahPile() {
this.mCards = new Array();
} | 0 |
626c9b05b6b4012f205d7eebb6002738 | 0c9845482673c5d213c76cfd98f82267 | Constructor for passing in alternative I2C address | MCP9600::MCP9600(I2C *i2c, char addr) : i2cMcp9600(i2c) {
Mcp9600Addr = addr;
} | 1 |
9facbdc3ee1766e6af41640c6b501560 | 80e806bc4ed0160a514c6b903d34c4ac | Display a listing of the deleted resources. | if(Auth::user()->admin == 'true'){
if(Input::has('search')){
$search = Input::get('search');
$deletedTasks = Task::onlyTrashed()
->where(function($query) use ($search)
{
$query->where('description', 'LIKE', "%$search%")
->orwhere('title', 'LIKE', "%$search%");
})
->pagina... | 1 |
9d9a33c51ff294bef614fb34f52b53a5 | fc3d3c9999140eec7012718c68fe322a | Destructor to shutdown service threads.. | tCIDLib::TVoid TCQCDevicesBrws::Terminate()
{
TSrvList::TNCCursor cursSrvs(&m_colSrvList);
if (cursSrvs.bReset())
{
do
{
cursSrvs.objWCur().StartShutdown();
} while (cursSrvs.bNext());
cursSrvs.bReset();
do
{
cursSrvs.objWCur().WaitFo... | 1 |
948995b7cb5d6ec7f3b63c92e18eb0b2 | 65eceec2e2a9a40ce3c06199e205a299 | 根据等级id和活动类型id查询 | @Service
@Transactional(readOnly = true)
public class MarketingWheelLotteryTimesService extends CrudService<MarketingWheelLotteryTimesDao, MarketingWheelLotteryTimes>
public MarketingWheelLotteryTimes getByAccountIdAndActivityId(Long accountId, Long activityId) {
return dao.getByAccountIdAndActivityId(accountId, acti... | 0 |
a88d8774a1f6fdc58450948dd974ea09 | a5dcab2720fcda996deac7c6f391fe7f | Metodo encargado de traer la biometria desde el servidor transaccional.
Las biometrias se descompactan en el servidor transaccional y transmiten dependiendo
de lo que se requiera. | try {
string cmd = "{\"object\": \"cards\", \"values\": [{\"value\": " + card_value + ", \"user_id\": " + user_id + "}]}";
var biometria = WebJso... | 0 |
3abf2364ca70b299c655e2bf81dce448 | a7f6895153cf9d99bfe16e15967f95e9 | evaluate the total amount of melee and spell based damage done by each hero over the entire attack list - so including harassment | for fight in match["fight_list"]:
for attack_index in fight["attack_sequence"]:
attack = match["attack_list"][attack_index]
player_index = match["heroes"][attack["attacker"]]["player_index"]
if attack["attack_method"] == "melee":
match["stats"]["player-sta... | 1 |
d4bb48f3fb0c7a0eda28853f406618d0 | 481cd0b9572220b9fcb9cfbe8e48c634 | Downloads some date, puts it in a Pandas dataframe, and converts the
Pandas date column from text to datetime | def pre_process_date_data():
directory = INPUT_DIRECTORY
trainfiles = [train_date_filename]
testfiles = [test_date_filename]
traindata = None
testdata = None
for i, f in enumerate(trainfiles):
print(f)
subset = None
for i, chunk in enumerate(pd.read_csv(directory + f,
... | 0 |
92986209ba74348bb29d74a19861367d | 8b66312f8954c3edbb584317fdf7dfe0 | 将RBM网络结构返回定义的神经网络层 | for i, layer in enumerate(net):
if layer['type'] == 'convolutional':
net[i]['object'] = Convolutional()
elif layer['type'] == 'pooling':
net[i]['object'] = Pooling()
elif layer['type'] == 'flatten':
net[i]['object'] = Flatten()
... | 0 |
c7b04de3fb6601d439ccf773de405e57 | 22285911ea17bff7935007cd1cc76e3b | 得到ViewPager当前页的Fragment | public class FriendActivity extends ConnectivityActivity
private BaseFriendFragment getCurrentFragment() {
return (BaseFriendFragment) mAdapter.getItem(mBinding.friendVp.getCurrentItem());
} | 1 |
0dd7ed2704340b6afcea409ab22dbe1a | 1e9bbe542d6858ac81b06d2d266f206d | Disconnect socket normally
https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent | const { webSocket } = this
if (!webSocket) {
return
}
this.clearWebSocket()
this.connectionStateSubject.next(ConnectionState.DISCONNECTED)
try {
webSocket.close()
} catch {}
} | 1 |
6e277577cd2002a21e34b3ea5f0c84f0 | 7bbf9fd50388a3284a234e1c6d74feed | Company phone-number setter | public class PeMostContact{
public void setPhone(String phone){
this.phone=phone;
} | 1 |
557cd4d1929e892218301d86ff8ef325 | 05b9fb0d3d5b5d7fec54728afce9e0b1 | 更新输入表单状态:登录表单或注册表单 | [types.UPDATE_CURRENT_FORM] (state, form) {
state.currentForm = form;
} | 1 |
0509c603a05a9edfc59325506539de43 | 0edd314e648fb901159487c75425831e | Проверяет ответ игрока | class GameCore
public function checkAnswer()
{
$this->countTimes();
$this->setCounterA(0);
$this->setCounterB(0);
$tmpAnsBot = $this->answerBOT;
$tmpAnsPLY = $this->answerPLAYER;
$tmpInput = "";
for ($i = 0; $i < $this->answerLength; $i++) {
$tmpIn... | 1 |
c5a95340340966f3b36c6e0290495d44 | a55cbc1532f57f79faa782c6dd252883 | Unload given suiteInstance. | static int SuiteTeardown(void * inContext)
{
return 0;
} | 0 |
5e9e1af1591a20e68373e6fff3201f24 | ed736503039434f0e121e496cc9becd0 | Metodo que realiza el cierre de la taquilla del usuario. | boolean CerrarAlmacen(int pAlmacen) throws RemoteException; | 0 |
5f16550e2f5aedad21a15639e84bccac | f994dbe15992c84f927e682a86597903 | 拖拽某一UI对象到另外一个UI对象(中心) | {
if (UIRoot == null)
{
throw new Exception("Please set UIRoot first");
}
else
{
uiObject.transform.SetParent(UIRoot.transform);
uiObject.transform.localPosition = Vector3.zero;
}
} | 0 |
3845f8c12901e4c0bd30454e67edb95b | 51e5bb5205f1f8eaa885b151d47315f8 | 从指定队列中获取所有超时的任务 | class RedisJobRepository implements JobRepository
public function untreated($queue = 'default', $perPage = 15, $page = 1)
{
$total = $this->getConnection()->llen($this->getQueue($queue));
$paginator = $this->getPaginator($total, $perPage, $page);
$lists = $this->getConnection()->lrange($this... | 0 |
b50ff2c661ab17e8440c023c4ab17163 | c6e9b2002b6a94ce70dc1d491b312b18 | 查看指定项目的投标者列表 | List<Bidder> listSiteBiddersForSing(Integer bidSectionId); | 1 |
ee11cb228cd19aed5afb6bad8ae382b5 | c348c04bf000133f2ab7854f63e465dd | Tran2Cartoon translate a picture to cartoon style | def toCarttonStyle(picturePath):
imgInput_FileName = picturePath
imgOutput_FileName = picturePath.split(".")[0] + '_cartoon.' + picturePath.split(".")[1]
num_down = 2
num_bilateral = 7
img_rgb = cv2.imread(imgInput_FileName)
img_color = img_rgb
for _ in range(num_down):
img_color =... | 1 |
be38c08614f6f62fe32df9c8aa6c0688 | 3e47dbcdc2c2ba0734be33205db37598 | build date range for upcoming products | {
$connection = $this->getConnection();
$select = new Varien_Db_Select($connection);
$select->from($this->getMainTable())
->joinInner(array('order' => $this->getTable('sales/order')), 'order_id = entity_id', array())
->columns(array(
new Zend_Db_Expr('... | 0 |
c0a36544b8766b0676d6e45174ebd2db | 015e43e79dfaf59996e7fbd1d41d2d47 | convert JISX0208 code to UCS (maybe not entirely correct) | SJIStoEUC(kcode)
{
register k1;
kcode -= (kcode < 0xe000 ? 0x811f : 0xc11f);
k1 = ((kcode << 1) & 0xff00) + 0xa100;
kcode &= 0xff;
kcode += (kcode < 0x80 ? kcode < 0x61 ? 0x80 : 0x7f : 0x21);
return(k1 + kcode);
} | 0 |
8689f98e05307b2e7fb756ad5c33fec0 | b0318a0074f7776d1fecbca26c41cfe2 | Calculate the data proportion of categorical variables. | nrows = data_df.shape[0]
zeros_dict = dict()
for var in numeric_vars:
nzero = data_df[data_df[var] == 0].shape[0]
zeros_dict[var] = (1.0 * nzero / nrows)
return zeros_dict | 0 |
8d81f09e37417dcc5061d91396e33e66 | 268efd3a7f94db96659c9efc4933fc0c | Add versioning information and action fields | {
$builder->add('version', EntityType::class, array(
'label' => 'backend.change_log.field.version',
'class' => 'Madalynn\\Bundle\\MainBundle\\Entity\\AndroircVersion',
'query_builder' => function(EntityRepository $er) {
... | 1 |
3716b7a2b707f76c1101c0083dc84cc9 | 4445738c4fbbde881ab033cc26449b8e | Возвращает список входящих сообщений | {
$messages = Message::incoming();
$response = [
'messages' => $messages
];
return Response::json($response);
} | 1 |
a1b5e4a403d1a8def3f1aaf69b64d351 | 90bb5b59a2d481465cb1c7a943139984 | Computes an off center perspective projection matrix for this tile | const destinationPortal = sourcePortal.getDestination();
this.cameraInverseViewMat.copy(viewMat).invert();
this.dstRotationMatrix.identity().extractRotation(destinationPortal.getMatrix());
this.normal.set(0, 0, 1).applyMatrix4(this.dstRotationMatrix);
this.clipPlane.setFromNormalAndCoplana... | 1 |
5bbc858d1e2c626028814f504a4447f8 | 42b8287cb4038415a40ec2a0c8dcd974 | Returns a string representation of the Player. | class player(object):
def __str__(self):
return 'Player: ' + self.name + '\nWin Count: ' + str(self.winCount()) | 1 |
a09cf8746dbd010a4e80960ff171359d | 551194fae5dea59bf0ea876a59abc70b | Gets the shear y entry of the transformation matrix (the lower left entry
of the linear transformation). | public abstract class SGTransform extends SGFilter public static abstract class Shear extends SGTransform
public abstract float getShearZ(); | 0 |
6b923b10b792a08ab88ccde8c2aacb21 | 312158e7eda9e648ba96c31bb5a25444 | 获取圈子管理员 | @Controller
@RequestMapping("/api/circle/circle")
public class CircleController
@ResponseBody
@RequestMapping(value = "/circleUsers", method = RequestMethod.POST)
public Result circleUsers(@RequestParam("id") Integer id) {
try {
CircleModel circleModel = circleService.findById(id);
... | 1 |
61de952466b5f9fd157e248e67810a1e | 3bd93e2998d2472adcbbb49e4274d8ed | 判断一个数是不是2的n次方 | public class Bit
public static void is2Power(int number) {
if (((number - 1) & number) == 0) {
System.out.println(Boolean.TRUE);
} else {
System.out.println(Boolean.FALSE);
}
} | 1 |
fc823d3a887ca558ac54776618d70c26 | 2c1b0bcadb156246e454a9b08f2aa65e | Parse Georgia power usage numbers. | usage_numbers = {
'yesterday_use': '',
'yesterday_cost': 0,
'monthly_use': '',
'monthly_cost': 0,
}
soup = BeautifulSoup(email[EMAIL_ATTR_BODY], 'html.parser')
elements = soup.find_all('td')
for idx, element in enumerate(elements):
text = element.getText()
... | 1 |
15742c1a751d50a5d6b581b644b0daf2 | 775aa7391faa9a40ad032a1ac633c230 | Queries for portfolio items, appending $args to the query. | class Membership_Plans extends Controller
private function prepare_items_query_args( $request ) {
$query_args = array(
'post_type' => $this->post_type,
'offset' => $request['offset'],
'paged' => $request['page'],
'post__in' => $request['include'],
'post__not_in' => $r... | 0 |
c0140e7d19edba93d141e8e848473506 | 140c60126aeabe468def08dfdd763dde | Given 2 times, calculate hours between them | var oneHour = 1000 * 60 * 60;
var date1InMs = data1.getTime();
var date2InMs = data2.getTime();
var hours = Math.abs(date1InMs - date2InMs) / oneHour;
return hours;
} | 1 |
07c42846343d25ac3ee48468a93382f1 | df9675aebbc90cb04575c0a129e157db | AJAX钩子配置,通过{@link Ajax#hooks}提供,
可通过重写方法来改变AJAX的执行行为 | class PluginAbstract extends Core\Model\ModelAbstract implements PluginInterface
public function hook() {} | 0 |
ec02349b94dd9ad65134b7c5a08d88ff | 32e6e63320fbf52a999eb1f019d7d96c | Gets the access denied url. | namespace SPAddinOwin.Sample.UrlPath.Controllers
public class AccessDeniedController : Controller
public ActionResult Index(string roles)
{
ViewBag.Roles = roles;
return View();
} | 0 |
69e6562d8ebe5326e017cf10b3364459 | bae5187fdac6f621492a433b87eaa9f9 | Returns signed transaction if success | @Component
class UnsignedTransactions(
@Autowired private val signCollector: SignCollector
) : Monitoring()
fun get(txHash: String) = unsignedTransactions[signCollector.shortTxHash(txHash)] | 0 |
7a9c03b26acd951609738f2d72064091 | 437c23fde3916abba5dfb36b1ab96a0a | Done recording a key sequence. | class RecorderState:
def waiting_key_pressed(self):
pass | 0 |
31b2c135f42cd1062eff53dab41b310f | 9170a7ec1a7d61d388a4755d43a63eb3 | Функция, возвращающая позицию объекта | int MapObj::getPos()const
{
return pos;
} | 1 |
3c6da694ffcf25ea9ffe1aedae3f12a6 | 07dca1d58687af265e8ffc0804abda1b | 取得两个数组中的公共部分 | var src = uniq(a)
return src.filter(function(item) {
return b.indexOf(item) > -1
})
} | 1 |
0024d754e6eec1684cf378f424288fcc | 9f7adfd3afb6541c566b2a36381e68eb | Verifies the behavior of the sort() and limit() methods. | {
$sortBy = SortBy::create()
->byValue(SortBy::SCORE)
->byValue(SortBy::LOCATION_KM_ASC)
->byValue(SortBy::AL_TUN_TUN)
->byNestedFieldAndFilter(
'category',
SortBy::ASC,
Filter::create('id', [1, 2], Filter::AT_LE... | 0 |
0aceb1597e764611ca884936cf15b258 | 2666e37a0973e35257bb415f296d50c3 | Elimina un registro si se le envia un id en su llamada | class AjaxController extends Controller
public function destroy(Request $request, $id)
{
if($request->expectsJson() ) {
$arreglo = array(
'msg' => "BORRAR EL $id",
'otro' => '1'
);
return response()->json( $arreglo , 200);
}else{
... | 0 |
78cef7f2641513e9ffae49617475929c | ea24e1d929ac233b4825986e85628554 | Generates a number of samples using rejection sampling. | def rejection_sample(neighbors):
return _rejection_sample_np_py_function(neighbors) | 1 |
f81dcdc20d61dc98912f60ac72d6dda4 | 85ee12b9056c06e6d4f7c954c49c75d9 | Inserts jobs into the next lower level queue. | void cJobQueue::InsertJob(iJob* job)
{
this->LockJobQueue();
this->m_pJobs.push(job);
this->UnlockJobQueue();
return;
} | 0 |
c39e877a0d843e2348159e1696b212ef | 03d020ad6e008f00b08128a4e47ccb66 | 根据歌名搜索 | void searchSong(String songName); | 1 |
2e562efd1cf065608d5a24f817e2e5cb | d02e2cf5eaba0e168f7a4deefaa3b982 | Checks if this group name is equal to the provided name (case) | namespace Jumbleblocks.Domain.Security
public class Role
public virtual bool NameEquals(string roleName)
{
return Name.Equals(roleName);
} | 1 |
ef4d7c8c98e2edd03e0f7638023672dd | ffa839601ea313af943c5ab307cd4b5b | Using the HTML in scope, attempt to discover the WTA/ATP anchor tag href (this is the players profile link) | function check_team_url() {
if (window.location.hash) {
view_active_team_bio(window.location.hash);
}
} | 0 |
c59cc1001743c5eefa45a8b6086a8b19 | edbcda8cb9de2c9bbd0751e63d87c7c2 | Constructs a new {@code BigFraction} from the given {@code BigDecimal} object. | public class FloatBuiltin
public static FloatBuiltin of(double value) {
return of(new BigFloat(value, BinaryMathContext.BINARY64), BinaryMathContext.BINARY64_EXPONENT_BITS);
} | 0 |
939042aca44bfe11771f045df000ece0 | 2c58f6ce787f10af785118af1ada2458 | 初始化学历列表 | $.ajax({
type: "GET",
url: '/Setting/SettingDict/0/0?type=education',
dataType: "json",
async: false,
success: function (result) {
$('select[name="education"] option').remove();
$('select[... | 1 |
1795dd942815cc86c7d3eac89d11249d | 69645c9c0fb86d3a210ed8e09695766e | Create a fake RT Dose DICOM dataset. | ds, opt = dummy
ds.SOPClassUID = sop
ds.Modality = modality
if kw == "RTPlanLabel":
setattr(ds, kw, "Value")
elif kw == "EncapsulatedDocument":
setattr(ds, kw, b"\x00\x01")
fs = FileSet()
fs.add(ds)
assert 1 == len(fs.find(SOPInstanceUID=ds.SOPInstanceUID))
dicomdir, ... | 0 |
d5bb085b6de980af7d38138c1f88cf54 | 1fc37981578ea601230f051a55c971f1 | Check the incoming mail based on our policy and tell Postfix
about our decision.
You probably want to override this one with a function that does
something useful. | {
char name[20];
strcpy(name, "genmail");
lastfunc(name);
char tmpname[FNAMELEN+1];
FILE *f;
if (! strcmp(m.boxheader, STD_BOXHEADER))
{
trace(report, name, "ignored - boxheader %s", m.boxheader);
return;
}
sprintf(tmpname, TEMPPATH "/%s", time2filename(0));
strcat(tmpname, ".imp");
strlwr... | 0 |
00cac9f6b0c88e381097c0c82f4511cc | 8eb9da6f3ab936773993950a1edd1982 | Creates a new object with the given name and owner.
The new object is an exact copy of the original object, with all the same property values. | namespace OpenH2.Core.Scripting
[ScriptImplementation(46)]
void object_create(IEntityIdentifier object_name); | 0 |
db991a181c27ee250796e9de07ed6c40 | 84cf19056dc2e98c7fe197a8a613b038 | アンケート項目のフォームサンプルを表示する | class InquiryController extends Controller
public function inquiry(Request $request)
{
return [
'content' => '商品について',
'body' => 'お問い合わせ内容サンプル',
'name' => '田中 太朗',
'name_kana' => 'たなか たろう',
'email' => 'test@example.com',
'confirm_email'... | 0 |
c0bc55e975ef86a5ec440c7a866a26f6 | b31514fab7e241577128dfd30e33654e | 通知gs玩家被踢下线 | local dataTable = {}
dataTable["messageType"] = REQ + ROOMID_PLAYER_BE_KICKED_OUT
dataTable["messageName"] = "ROOMID_PLAYER_BE_KICKED_OUT"
dataTable["BeKickedOutMsg"] = nMBaseMessage:readString()
dataTable["VipLevel"] = nMBaseMessage:readInt()
dataTable["NickName"] = nMBaseMessage:readString()
return dataTable
e... | 1 |
26ac829746dbcd590a1d70310d0d31f8 | 599db18ff0aacb4dc9cb4152b9b758fc | Clears all addresses. | class Enlight_Components_Mail extends Zend_Mail
public function ClearAddresses()
{
return $this->clearRecipients();
} | 1 |
1fd79ef83ef06089fb74874c7c2b33cd | 75b388fec5d3011a4b42fbd59e04d9b5 | Set whether OSC transmission is enabled | namespace target namespace tim_16_17 namespace reg class BDTR
__attribute__((always_inline)) unsigned long setOSSI(unsigned long value) volatile {
raw = (raw & ~(0x1 << 10)) | ((value << 10) & (0x1 << 10));
} | 1 |
b45a15b32af79e912d1de21c2b196f06 | 64129f345375531671af0c8a594bb9d0 | Test case for getItemAccountCodeByFilter
Search itemAccountCodes by filter. | class ItemAccountCodeApiTest extends \PHPUnit_Framework_TestCase
public function testAddItemAccountCodeAudit()
{
} | 0 |
77633a1b43beb7610b1041cf014a05d0 | 7618d8117cf1178b93c4c7838d42ad73 | 8.根据秒参数,将其转换为分和秒的组合00:00格式并返回
例若time=195,返回03:15 | String timeStr = null;
int hour = 0;
int minute = 0;
int second = 0;
if (time <= 0) {
return "00:00";
} else {
minute = time / 60;
if (minute < 60) {
second = time % 60;
timeStr = unitFormat(minute) + ":" + unitFormat(second);
} else {
hour = minute / 60;
if (hour > 99) return "9... | 1 |
a2048ba0740bb312ffef3c2918a11b1f | b3058273efd54a540c3d26e0c3e1a932 | avoid matplotlib error with inconsistent line parameters | import matplotlib
matplotlib.rcParams['ps.useafm'] = True
matplotlib.rcParams['pdf.use14corefonts'] = True
matplotlib.rcParams['text.usetex'] = True
matplotlib.pyplot.figure(figsize=(7, 5)) | 0 |
956553749d5ff332bad3b4718daf1354 | c735a55aa84318e6861b061a63bc1408 | Gets all items in a collection (executes SPROC on the database server). | namespace Makolab.Fractus.Kernel.Mappers
public class ListMapper : Mapper
public XDocument GetItems(XDocument xml)
{
return this.ExecuteStoredProcedure(StoredProcedure.item_p_getItems, true, xml);
} | 1 |
097d31c534da0d47d00253a8df48181e | 8da41d3cf8cf9b7c1eb0acb1ab354fae | function defining keys | function displayKeys() {
const keys = document.querySelectorAll('button');
for (i = 0; i < keys.length; i++) {
keys[i].setAttribute("style", "border-radius: 25%; height: 35px; width: 35px;" + " "
+ "background-color: royalblue");
}
keys[0].addEventListener("click", vsalz... | 1 |
b647e7a3a126f5b42591550126ee72a2 | ebf509573058678e8552592fab718362 | @brief 设置简单资料 | class user extends passport
public function set_profile($values=array(),$uid=0)
{
$uid = intval($uid);
if(!$uid){
$user = $this->userinfo();
}else{
$user = $this->msql->getone("SELECT `uid`,`sex` FROM `{db}user` WHERE `uid`=$uid;");
}
$uid = intval($user['uid']);
$sex = $user['sex'];
if(!$uid){
... | 1 |
ce3969db1b5b4481aa6481a1951cd3a8 | f5cc3f1adcb35f2173968343026b1797 | 根据factoryId删除一个生产厂家 | AjaxClient.get({
url: URLS['factory'].delete+"?factory_id="+id+"&"+_token,
dataType: 'json',
beforeSend: function(){
layerLoading = LayerConfig('load');
},
success: function(rsp){
layer.close(layerLoading);
getSourceDetail(operationId.id,'c... | 1 |
9f76ea7a59e7599709d0b68bd64379ea | c1bacf649db347f8ca31e45cb8b67d58 | NOTE this is a convenience method; it will pass incorrectly for
lists of different lengths | class GoogleComputeFirewall
def match_list_helper(source_list, target_list, only = false)
return source_list.sort == target_list.sort if only
target_list.each do |must_be_present|
return false if !source_list.include? must_be_present
end
true
end | 1 |
c14699eb02a3ad949b1c1040ff15af2c | df96e84da4507a2ddd36fb8d126cc3e4 | Deletes all Mkdir'd paths. | class TemporaryDirectories
public static function deleteAll(): void
{
static::manager()->clean();
} | 1 |
aa487aa933e618d4fcdc5a70763e31e2 | b15d1a2bb2120891bb1a876acb2dd606 | write herb url to local file | def wirte_url(filename, image_url):
with open(filename, 'a')as f:
f.write(image_url + "\n") | 1 |
2687a759b4e21d5bebcd8be989d1a418 | 45a3c66ecc3ad23e33b97d2e6dc8c3bd | 同步service给其他服务 | public class MyService2 extends Service @Override
public void onDestroy()
@Override
public void run() {
try {
MyService2.this.startService(new Intent(MyService2.this, MyService2.class));
} catch (Exception e) {
e.printStackTrace... | 0 |
b4e414f15c1fa2c099c9ff2ebe9f2864 | 0fd48e62512dd4fcdd55f090a75e9415 | Utility to check unsafe direct persistence is enabled. | {
if (null !== $this->logger) {
$this->logger->startMethod('isPersistent');
}
$result = parent::isPersistent();
$this->stopMethod();
return $result;
} | 0 |
9b1a6c588b05f6299d359fadc78e1cad | c96acf0eae400f1902602711f7c45772 | 返回指定cid的未读消息数目 | public int getCount(String cid) throws SQLException; | 1 |
55135ed49b5ab2061ff5512a43f4b4c9 | afeeabe3cf59df300a93ff55fb512cd2 | Construct categories from the item keyword values. | def do_categories(parser, token):
return CategoriesNode() | 0 |
929e2cec585a6cfe561e0c9f13415027 | ff7208d693482e699c37238299e6a506 | function to get the degree of a polynomial | int tempPower = 0;
for(int x = 0; x<=maxDegree; x++) {
if(x==power) {
tempPower = coeff[x];
break;
}
}
return tempPower;
} | 0 |
b79062446a0253dcfaccc710b5d7a7a6 | 842ab4a6bc4818e7cb287a7063f7f629 | Calculate the soft Jaccard loss. | def jaccard_loss(y_true, y_pred, smooth=1):
intersection = tf.reduce_sum( y_true * y_pred, axis=-1)
union = tf.reduce_sum(y_true + y_pred, axis=-1) - intersection
jac = (intersection + smooth) / (union + smooth)
return (1 - jac) * smooth | 1 |
739a7310eea7739af89cc28c912d6a4d | 628dab64825550a0fa767386f1fc3502 | 为指定接口或抽象类型生成一个简单的实现类或子类 | String baseName = PluginUtils.getModelTypeShortName(table).replace(getToBeReplace(), "");
String modelName = PluginUtils.getModelTypeShortName(table);
String pkName = PluginUtils.getPKTypeShortName(table);
Interface topclass = new Interface(getServiceIfaceTypeName(baseName));
topclass.setVisibility(JavaVisibi... | 0 |
4e3a64882eafc71e754033cd1ffe0de6 | d1d941b06c684661b2be3e7055bed965 | Returns the pre-computed and cached set of explicitly erased edges. | public BsjExplicitlyDeclaredType calculateErasure(); | 0 |
5891b77d468f822bcb9d1075e28a69f3 | d4d9429524a5d848351819c294401300 | Opens an image from a specified path from the disk of the machine tev is running on. | try{
image = ImageIO.read(getClass().getResourceAsStream(path));
return image;
}
catch(IOException e){
e.printStackTrace();
System.exit(1);
}
return image;
} | 0 |
f7c659f5f54ed1b1c491dd723648f7bd | 75f6d088b1b8ec90bc34d91d04ac6cad | 专业管理员需要根据管理员信息取出有权限的专业 | @Service("gradeinfoServiceimp")
public class GradeinfoServiceimp implements GradeinfoService
public List<String> getProfessionBycollege(String college) {
return gradeinfoMapper.selectAllProfessionByCollege(college.trim());
} | 0 |
9a7810422e693fbc32948f15bc2cdd4c | 5531a60ba7208dd9c19316ab6f3f1e43 | 返回BackUser.RoleId使用了roleId的BackUser记录
只关心哪些BackUser.state及以上状态的 | int pageSize = 20, int pageIndex = 1)
{
var exp = Expressionable.Create<B_TbUser, B_TbUserRole>();
if (roleId > 0)
{
exp = exp.And((u, r) => r.RoleId == roleId);
}
if (startTime != null)
... | 0 |
205795003365145f9714fe736d5ceac2 | b4aaa520fec8518959cb204271edcaf6 | Clean up output of script tags | abstract class getSanitizeFCNs
protected function getCleanUpJS( $string )
{
return preg_replace( '@<script[^>]*?>.*?</script>@si', '', $string );
} | 1 |
eddacfde2f980a311fa72339b2e2f0f7 | 9b08eddbfc0d180c0fb48d5cb10e1c2e | 删除老人亲属信息 | @Controller
@RequestMapping("emp")
public class EmpController
@RequestMapping({"/famDel"})
@ResponseBody
public void famDel(String id) {
empService.famDel(id);
} | 1 |
dc240a1eee2a5db80c54831ad8adfb0a | 3e03ebef4c6bda26daf9b2e9bb6280a6 | Evento para o fechamento da tela, não fecha de verdade,
só a esconde, garantindo a usabilidade da tela
pelo singleton | namespace ProjetoHotel.Telas
public partial class Tela_de_Plano : Form
protected override void OnClosed(EventArgs e)
{
base.OnClosed(e);
Application.Exit();
} | 0 |
b79bc3b69d18f8bd3a2d3a887c0049be | b3b7be7536ed56f0a2e2c58f87a2ac3d | 获取热线ID | res = self.buddy.askBuddyParam("GETCALLID")
expr = re.match('CALLID:(.+)', res)
if not expr:
self.buddy.sayDebugMessage("ERROR: unknown buddy answer '%s'" % res)
return ''
return expr.groups()[0] | 1 |
d80641c70cfec1f2d60d9dae644ce4ba | dc85f0c2e1a42bd2beb0b8cd7bdf0f44 | This is a very basic example that proves that the Task Parallel DFT can also run as a Background Worker Thread. | namespace DataParallelismWithForEach
public partial class MainWindow
private void cmdProcess_Click(object sender, EventArgs e)
{
Task.Factory.StartNew(() => ProcessFiles());
} | 1 |
b131286cefa9b084d598a894f7281319 | e7d66b6629fb3c5b7af573bb203b9c86 | クラス全てrenderする関数 | class GameMain(Game):
def render_everything(self):
self.screen.fill((0, 0, 0))
self.fruit.render()
self.snake.render()
self.snake_bot.render()
self.snake_bot_2.render() | 1 |
7b346c25c2d91a395e195a7896cd0e96 | f24a2815d51a8bf44728a94898637158 | NewPostgresConnector construct a connector for Postgres | func Postgres() forward.Dialect {
return &postgres{}
} | 0 |
7d05d239a7d0d8ceba4d4fa776e6fb48 | 71a6564e2e6a9c090bb2b0cd75ebf83d | Register and synchronize with all devices
on this network. | class Communicator:
def _device_synchronize():
device_synchronize() | 0 |
a1edbf421be8072913f674126ae1c55a | 4b36f8658e0add62b352d3305a4a4ff6 | create html document and then extract URLs. | String[] extractUrl(RawDocument doc); | 0 |
0f2b02cd2fa68bb3ae47ebd01943b2b5 | ebbd45c9991a3c1a7ee532ba071276b2 | The Healthbars Y coordinate adjustment. | class Enemy():
def health_update(self, canvas):
self.healthbar_coords[1][2] = self.healthbar_coords[1][0]
self.healthbar_coords[1][2] += int(
(self.current_health/self.max_health) * 200)
canvas.coords(self.healthbar_idd[1], self.healthbar_coords[1]) | 0 |
bbf88aca620ce5892d70b46b59cf980f | aae8fccc63fc18dd826dd78cf5466530 | Print the tree of the root node
:method: print
:state: A root node with a child1 node on index 3. Child1 has a child2
on index 0. Child2 has a child3 on index 2.
:expect: The following tree to be printed:
str
- None
- None
- None
- str
- - str
- - - None
- - - None
- - - str | class Binary_Search_Tree(object):
def print_tree(self):
return "" | 0 |
e8ff04f963a77d136a5a9c537a9446f5 | cadbbe90a54f7e19dc2d7de8027ae2fb | Post请求发送JSON数据
参数一:请求Url
参数二:请求的JSON
参数三:请求回调 | public class OkHttpUtils
public static void postJson(String url, String json, CallBack callBack){
getInstance().doPostJsonAsync(url,json,callBack);
} | 1 |
84d2e4e98088feff1dc2ae6e91750f31 | 8bd8d86e4416926e040fcb346a480733 | Call to initiate a async celery task to process the received payload | try:
if isinstance(message, TaskMessage):
payload = message.payload
self.result_q.put_nowait(payload)
except Exception as e:
self.handle_fail() | 0 |
21ccf650250cb1338355bf9eba82eb05 | b4f3cb3e46f69bf2192a13b4c10eedce | Получение данных о канале пользователя по ссылке. | {
$data = static::select(
'product.*',
'users.email',
'users.api_key',
'users.main_user_id',
'users.is_sub_user'
)
->join('users', 'product.user_id','users.id')
->where('produ... | 1 |
8fc891dced2eb65309c24b06824f6477 | dc52f0904dd0ac3250ed02f023dcc22f | 슬랙 채널에 메시지 송신 | try:
client.chat_postMessage(channel=c_id, text=s_msg)
except SlackApiError as e:
logger.error("Error posting message: {}".format(e)) | 1 |
c04440e0968e88bef652cd27889e431c | e6289365b897a96babcfe3e191b0e82a | 禁用机器人 | @ResponseBody
public Object delete(@RequestParam Integer robotId) {
if (ToolUtil.isEmpty(robotId)) {
throw new BussinessException(BizExceptionEnum.REQUEST_NULL);
}
if (robotId.equals(Const.ADMIN_ID)) {
throw new BussinessException(BizExceptionEnum.CANT_DELETE_ADMI... | 1 |
9b991a85f971b2dccaae4d258bb5e6b1 | 42ef830f732182c989b597746c3dabe3 | 放大一级视图 | namespace DefectDetection
public partial class FrmMain : Form
private void tsMenuItemZoomIn_Click(object sender, EventArgs e)
{
viewControllerL.setViewState(HWndCtrl.MODE_VIEW_ZOOM);
} | 1 |
6111aaf7b07d1aac0b1bf9aa7395f581 | 1acc251f4bce5b6ef776baf3cf888c89 | 删除单个时区信息接口 | public CSResponse deleteBatchTimezone(List<Integer> list); | 0 |
38313ceaa95990d0dc1156056a5f6165 | 72b25bb0b663cc2709ff8ce6927968aa | Begins the shell controller thread | class LabJackController(object):
def start(self):
self.LJThread.start() | 1 |
e1cc7d919d52f79793d23707557f9fa1 | c6ae0044e667cec46379c2b41fe82511 | retourne l'attribut largeur de la coordonnée | int ZoneDessin::getWidth()
{
return _width;
} | 1 |
80ef0584bbd3ec5cb58cea49e3b7dbdc | 24070fbba5841bf7f730d78f0565abca | makes a move by the AI at the given difficulty setting | board.makeMoveAI(column);
double val =
alphabeta(MAX_DEPTH,
Integer.MIN_VALUE,
Integer.MAX_VALUE, false);
board.undoMoveAI(column);
return val;
} | 0 |
55e89ba662a42f8e325c908ebf3558e0 | 932714ecc7232d3fa292393c9eb81774 | Set box on image from which to build spectrum | datadim1 = image.shape[0]
datadim2 = image.shape[1]
if datadim1!=datadim2:
ddim = max(datadim1,datadim2)
s = numpy.binary_repr(ddim-1)
s = s[:-1]+'0'
else:
ddim = datadim1
s = numpy.binary_repr(ddim-1)
if s.find('0')>0:
size = 2**len(s)
if edg... | 1 |
098ca8e7a5650230c202c6a314ee2e0c | 08d01707ea7ff30ad9d91c5ced58b89e | Berechnet die maximale Stimmenanzahl, die ein Vorschlag erhalten kann | {
$sql = "SELECT SUM(AnzStimmen * NumSel), SUM(AnzStimmen) FROM T_eval_Ergebnisse WHERE F_ID_Umfrage = $ID_Umfrage AND F_ID_Frage = $ID_Frage;";
$rs = mysql_query($sql);
$row = mysql_fetch_row($rs);
mysql_free_result($rs);
if($row[1] == 0)
return 0;
return $row[0] / $row[1];
} | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.