query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
51fb7a5a91686f737d0e9e7d4eddf094 | 837349207cd26adc2c53372b37fee3a1 | Configure and start the periodic task for snapshotting the `MetricStore` | connection: Connection,
dumpManager: DumpManager,
uploadManager: UploadManager,
logger: Logger
): void {
const runTask = (task: () => Promise<void>, intervalMs: number): void => {
AsyncPolling(async end => {
await task()
end()
}, intervalMs * 1000).run()
}... | 0 |
df1143367a47b4571921cbe155c549c5 | 7743a81735fdd9e269d19db3a61aa711 | Returns the WSDL locator for this definition. | public class WsdlServiceContract extends ServiceContract
public QName getWsdlQName() {
return definition.getQName();
} | 0 |
e6f152225632dae37d89d7ea62785ea8 | 34f6f251a79324600a8aebb2fbbb88a5 | 공통헤더부문 데이터 생성 및 반환 | String headerData = "";
headerData = getMsgId() + columnSep
+ getInterfaceId() + columnSep
+ getInterfaceSubId() + columnSep
+ getHopCnt() + columnSep
+ getTraceLevel() + columnSep
+ getMsgSeq() + columnSep
+ getSndSystemName() + columnSep
+ getRcvSystemName() + columnSep
+ g... | 1 |
121dff174c6beec5d2373856c9f26eff | 88381817a67c0fca3461b20b6544daa5 | 在已选择的表之后增加一个表 | function addRowAfter(state: EditorState, dispatch?: (tr: Transaction) => boolean) {
if (!isInTable(state)) return false;
if (dispatch) {
let rect = selectedRect(state);
dispatch(addRow(state.tr, rect, rect.bottom));
}
return true;
} | 0 |
58944cb04dd001ca115fdcd463589026 | 05ccb9a14319e42e447cfaf464b12307 | Returns the file title (file name w/o extension) of a fully specified file.
for example: /foo/bar/test.html -> test; /foo/bar/.test.html -> .test | function getFileName(str){
return /([^/]+\..+?)(?:$|\?)/.exec(str)[1];
} | 0 |
faf109511988a34c833b84570bbb3e99 | 4c22b588d7146b02baebd1bcb8749939 | Send a CTCP to a target. | class FullParse(base.fullparse.FullParse):
def replyctcp(self, message):
self.reply(ircutils.ctcp(message), "NOTICE") | 1 |
ef50bf3b9ad0cf6805dab5227544aa19 | 0288c693186486a513addd88b8a9d080 | 设置来自电话打断事件状态 | public class MtcCallDb implements MtcCallDbConstants
public static int Mtc_CallDbSetDoNotDisturb(boolean bEnable) {
return MtcCallDbJNI.Mtc_CallDbSetDoNotDisturb(bEnable);
} | 0 |
d314e5120f6d27d720890ce577dbad44 | 5861f27d384400265fc14e3118812f4d | Convert timestamp (ordinal number of days since date 1.1.1) to datetime obj. | def datetime_from_timestamp(timestamp):
return datetime.fromtimestamp(timestamp) | 0 |
2d25ccf2770c74dd94f5f0a28ec1615e | ea0965426e5c23539eeae3e64ad71af1 | 休憩時刻重複チェック。<br> | public class Bean_Result
public boolean checkSameDay(){
try {
if (entryDayList.get(entryDayList.size() -1 ).equals(exitDay) ){
if ( entryPriceList.size() > 0 ){
entryPriceList.remove(entryPriceList.size() - 1);
}
if (entryDayList.size() > 0 ){
entryDayList.remove(entryDayList.size() - 1);
... | 0 |
5e9b100303d99253019a141bdf60a3d1 | d3be0d6872476babeb4f93328c6222cc | Function
Synopsis [Creates a unique node equivalent to the given node.]
Description [A unique node is used to represent the funtionality of the
given node without overlapping with functionalities that hash into the
same node. The unique nodes are essentially duplicates of some nodes
in the table. The unique nodes ar... | Node* state_graph_new_node (Graph* graph, State state, Node* parent, Operation op)
{
total_state_count++;
uint64_t hash;
if (parent)
{
hash = incremental_state_hash(graph, state, parent->state, op, parent->hash_value);
}
else
{
hash = state_hash(graph, state);
}
Node protonode = (Node)
{
.state = state... | 1 |
be0c609e5fbcd8967b7aaa338ac6340c | 8ba5d2e12364e5fdec6d02bd61a51fb8 | 切换医院选择 | @NotifyChange({ "addresslist", "grouplist", "itemlist", "isopen", "ecm" })
public void changeaddress(@BindingParam("c") Combobox c,
@BindingParam("cid") Integer cid) {
if (c.getSelectedItem() != null) {
EmBcSetupAddressModel ebam = new EmBcSetupAddressModel();
ebam.setEbsa_ebcs_id(Integer.valueOf(c.getSele... | 1 |
d4e4a70d3f263dd030a5c165ead60d38 | 6aaec3c67f0b414ab9162db5b2c8e93e | Returns the number of buttons on a given joystick port. | if (stick >= kJoystickPorts) {
wpi_setWPIError(BadJoystickIndex);
return 0;
}
std::lock_guard<priority_mutex> lock(m_joystickDataMutex);
return m_joystickAxes[stick].count;
} | 0 |
d89f07d735a044731dd63c7c4d927bbf | fbd02b21e52794f3668e05901f0d5c8e | 정수 제곱근 판별하기 | char is_sqrt(int n){
int sq = sqrt(n);
if(n == sq*sq){
return 'Y';
}
return 'N';
} | 1 |
71dcc876f3995357e18c847a96e1f642 | 23e3957628de9a0c0e727bd4699da547 | Checks if the resource must be ignored and not processed. | class Model
public function isIgnored()
{
return $this->ignored;
} | 1 |
00c47cda12679ec909180b6297a61e3e | 9174cd0f797e5499860ee1e9ab40acb6 | 处理请求接口的数据,并发送请求 | {
char *text = NULL;
buildRequest(socket_fd,file_data,len,asr_type,realtime,index,identify,host);
long start_time = getCurrentTime();
printf("Send finish at %ld.\r\n", start_time);
getResponse(socket_fd, &text);
long end_time = getCurrentTime();
printf("Response finish at %ld.\r\n", end_tim... | 1 |
ac7d7176338814e42cc66ff593bee2f7 | 3082f6407b2569c9e8c929471b5a640a | Generates a chemical proteoform hash for the specified proteoform. | def getImphash(pe):
return pe.get_imphash() | 0 |
0e296210242e267b6a112f6ab8cd96f8 | 96b6121f2b9591dfbfe313e4cbc6737e | GET: ReportInf | namespace RoSAT.Controllers
public class ReportController : Controller
public ActionResult Index()
{
ViewBag.Department = new SelectList(db.Departments, "Id", "Name");
return View();
} | 0 |
5a8bb3b8690d46fd48a1edafdbaeff13 | 465b266e5597c1fd90fbad4cb386d4a0 | COND : TkIf BOOL TkHacer INSTR TkEnd
| TkIf BOOL TkHacer INSTR TkOtherwise TkHacer INSTR TkEnd | self.tip = "if"
self.ambito+=1
x = ctx.expression().derecha
bloqueDer = ctx.block1.statement()
for i in range(len(bloqueDer)):
self.amb +=1
try:
bloqueIzq = ctx.block_else.statement()
except:
bloqueIzq = []
for i in rang... | 1 |
2fc902eaa396761be62facabace6a244 | cf0174500369681fa7e61a36727c650b | 查询当月预约信息 | String urlString = MakeURL(ORDER_MONTH_URL, new LinkedHashMap<String, Object>() {{
}});
JsonObjectRequest req = new JsonObjectRequest(urlString, null, new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {
LogHelper.i(TAG, response.toString());
if (isResponseEr... | 1 |
d06069c8ecafb455b9f106d9292eb7ce | e0843bbeb8985c6394b3fb34421d1c99 | 返回请求的资源需要的角色 | public class MySecurityMetadataSource implements
FilterInvocationSecurityMetadataSource
public Collection<ConfigAttribute> getAttributes(Object object)
throws IllegalArgumentException {
String requestUrl = ((FilterInvocation) object).getRequestUrl();
if(resourceMap == null) {
... | 1 |
c1bdabb8a01a5e0d38746b376eb873bc | ac4852d56b6be8b18edfd9fa3839ef34 | 删除采购清单空白项 | @Service
public class PurchaseOrderServiceImpl implements PurchaseOrderService
private List<PurchaseOrderDetail> removeEmpty(List<PurchaseOrderDetail> purchaseOrderDetailList) {
for (int i = purchaseOrderDetailList.size() - 1; i >= 0; i--) {
if (StringUtils.isEmpty(purchaseOrderDetailList.get(i).get... | 1 |
1263cff11c6489e0520eecd77d9e903d | 4806a5445d33a399bf51d1053d13ae4a | Creates the library from the archive | void CCUnitTypeLibrary::Create(CDataArchive Archive, CCMap *pMap)
{
SUnitTypeLibraryHeader Header;
CArchiveFile HeaderFile;
CDataArchive cArchive_GraphicsClone;
cArchive_GraphicsClone = Archive.CreateArchiveClone ();
HeaderFile = Archive.CreateFile("Library.Header");
{
SUnitTypeFileVersionHeader sFileVe... | 1 |
924c3aecbe511a2ceff5732311991038 | ffa5347f569deb8d72f113dbf9d6f4fe | Create a dictionary whose keys are events names and values are corresponding timestamps | reduced_dict = defaultdict(list)
for event in big_dict:
time_in_ms = event["startDate"]
date = PACIFIC_TZ.localize(datetime.fromtimestamp(time_in_ms / 1000))
date_string = date.strftime("%m/%d/%Y")
reduced_dict[event["title"].lower()].append(date_string)
return reduced_dict | 0 |
0b9b91fb5223faa9e94226af6a9148e3 | eec293f677805f42228a898d87f1e604 | Retries a function/method until it returns True.
initial_delay: initial delay in seconds
exponential_backoff: multiplicative factor of delay with each extra try. 1 means the delay stays the same. | if not isinstance(tries, integer_types):
raise ValueError("tries must be an integer type")
if tries < 0:
raise ValueError("tries must be >= 0")
if initial_delay <= 0:
raise ValueError("delay must be greater than 0")
if exponential_backoff < 1:
raise ValueError("exponentia... | 1 |
7c182e6d787084c8ae45d4dcd905895a | 93b51ff5dc36c79c0381df57b0a4b4d8 | Switches to last active panel, makes all other panels invisible
This function may be used when no cleanup is required in the currently
active panel. | if self.__active_layer == layer:
return
if layer == 0:
self.__panels[0].visible = True
self.__panels[1].visible = True
self.__panels[2].visible = False
self.__panels[3].visible = False
self.__panels[4].visible = False
se... | 0 |
6e24fa9646b78529be99029fd7a96bd0 | 2f87a957779eff950855d2b6f442ac3b | Removes all isotop information, i.e. sets all atoms to the natural isotop abundance. | if not self.peaks:
return
indexes = []
for x, peak in enumerate(self.peaks):
if peak.isotope != 0 and peak.charge != None:
indexes.append(x)
self.delete(indexes) | 0 |
27cb66a44a4e15ee1d9eac1edcfe924c | 2644f71822ffef46da3cfb260501ca3a | Forces user to create pin and ends the main activity so the user can't use the back button to get to home screen | public class SignInActivity extends AppCompatActivity
protected void onCreateClick(View v){
Intent createIntent = new Intent("CREATE");
startActivity(createIntent);
} | 0 |
1f54b044ff6578b46ccc56706c9c997b | 0bbd223d9b82c112c6f15ca093f726a4 | 单选全中 | function selAll(arcID)
{
var checkboxs=document.getElementsByName(arcID);
for (var i=0;i<checkboxs.length;i++)
{
var e=checkboxs[i];
e.checked=!e.checked;
}
} | 0 |
7ec14667ad71af96e949996f9602c7e9 | 75f8f8a101c9fdaeeb02d04fc3ead6d0 | Danh sach can bo theo don vi, chuc vu va ten | class CanboController extends Controller
public function index()
{
$canbos = Canbo::join('danhmucphongs', 'canbos.danhmucphong_id', '=', 'danhmucphongs.id')
->join('danhmucchucvus', 'canbos.danhmucchucvu_id', '=','danhmucchucvus.id')
->select('canbos.id', 'canbos.name as hoten', 'danhmucphongs.name as phong'... | 1 |
145274bdf7f820da257756807943ce9a | 7b7a16343623584c9a760b1180d4ce4f | [EARLY ACCESS] GetGroupProperties: Get group properties # noqa: E501
List all the properties of a single portfolio group. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True | if group is None:
raise ValueError("Invalid value for `group`, must not be `None`")
self._group = group | 0 |
f41ad5a45848940e66df126c2b15fb71 | 12f298434d7d852f9b8c82aae93f38dc | Changes every time assets finalize, when this manager notifies the assets' observers. | public abstract class AssetsFactory
protected void NotifyObserver()
{
foreach (ObserveFactory ob in observes) {
ob.ObserveAction();
}
observes.Clear();
} | 1 |
3dacb3f6b6f160cdb68439f5db6144c9 | f71d7d168d04f22e636ce5772f4c9319 | Function to input information into input element | function tableInput (inputElement) {
let tableExists = document.getElementById('myTable');
if (tableExists) {
let changeInText = document.getElementById(inputElement.id).value;
id_targetTD = 'TD' + inputElement.id.slice(3);
document.getElementById(id_targetTD).innerHTML = changeInText;
... | 0 |
d72ea0c2f6ca156a15266fe094bd71fc | b63d3f8b3194c231670d55a675650f27 | Increases the execution index for the operator.
This index number would be increased once for each call to the operator
so that the operator can be executed multiple times. | MutableInt numParentsDone = replicateOperators.get(replicateOperator);
Integer newNumParentsDone = numParentsDone.getValue() + 1;
numParentsDone.setValue(newNumParentsDone);
} | 0 |
008e89c11d8bf06796a744ef707d936e | f44c34d1fc59200a52912425d20f5065 | Tells each screen to draw itself. | namespace SGameEngine.Screen
public class ScreenManager : IScreen
public void Draw(SpriteBatch spriteBatch)
{
for (var i = 0; i < visibleScreens.Count; i++)
{
visibleScreens[i].Draw(spriteBatch);
}
} | 1 |
0ab1e38d9772b69249ed0c3b1b04efa0 | 07cc9dad9cdcdef04e9c94cfc72019cd | https://crackstation.net/hashing-security.htm
Meant to compare two byte arrays in length-constant time. This comparison
method is used so that password hashes cannot be extracted from
on-line systems using a timing attack and then attacked off-line. | namespace WebApplication1.Controllers
public class LoginUtils
public static bool slowEquals(byte[] a, byte[] b)
{
int diff = a.Length ^ b.Length;
for (int i = 0; i < a.Length && i < b.Length; i++)
{
diff |= a[i] ^ b[i];
}
return di... | 1 |
35f5c52da116e0312fa18881c95ff9fc | e09e2d36d3120fcb5072738e7873e78b | * Updates Character Sprites | {
if (character != null)
{
character.UpdateCharacterLeft(leftPos, leftRot);
}
} | 0 |
e58c5e58759d544bbf627ab2192e29c8 | 92f4f580f0b02632ebfdcd9499cc070c | Get Dice ID - Get the Unique Identifier for the Dice | function sci:get_identifier()
return tonumber(self:send(2623, 0, 0))
end | 1 |
9d7ca47ff607970890c8c6775da07a94 | 627130cf6a9d5413bb01b3257dddf853 | Test case for delete_featuregroup_contents
Delete featuregroup contents # noqa: E501 | class TestObjectGroupApi(unittest.TestCase):
def test_delete_object_group_by_id1(self):
pass | 0 |
bf3e749182ec66d68c2752c8862955c8 | a9779031e5f065b568ab0757e1303138 | 根据条件(多条件)获取指定页码的 会议室使用记录 集合 | List<MeetingInfoModel> selectByPageWithCheckIn(MeetingInfoCommand meetingInfoCommand); | 1 |
8d18892529ad461b9df996222db40f1d | 6f3a102a0ec4f77786f96b0f20b430cb | Retorna tipos chamado. | def chamado_form(**kwargs):
return ChamadoForm(**kwargs) | 0 |
1d7447f23abec44d96c569a333baa13d | 7d97436a3cee62f9796ec31bf19b6472 | 根据dto定义,得到ServiceResponse | class ServiceMoudle
fun <T> createResponseService(tClass: Class<T>, listener: ProgressResponseListener): T {
return builder
.client(HttpClientHelper.addProgressResponseListener(listener))
.build()
.create(tClass)
} | 0 |
ff69065befe4ee174eac8d61cb56cdd7 | 4549ba795d300115bdce54eec0051b1b | 逆S盒置换 | for (int i = 0; i < 16; i++) {
result[i] = inv_Sbox[result[i]];
}
} | 1 |
635faa3ed5357d07e4e00a495fc69ea6 | 5052f38b7c973ee22e81add32a84c58e | Given a number returns :odd or :even | def to_parity
self.to_i.modulo(2).zero? ? 'even' : 'odd'
end | 1 |
e596784404110b79b0d1e0d9bc963bcd | fe3671bf12479e5c298059bfc0c2db61 | dùng lấy tất cả danh sách tất cả loại tin | function DanhSanhLoaiTin()
{
$qr="
SELECT *FROM loaitintuc
";
return mysql_query($qr);
} | 1 |
135acabc8cd5768caea346f892507c4c | 7f16693a6ee8357a877341fb5f7db25a | https://stackoverflow.com/a/2450976/13036807 | function getRandomColor(seed) {
return `#${`00000${((seededRandom(seed) * 0x1000000) << 0).toString(
16
)}`.substr(-6)}`;
} | 1 |
822bd7bc80e17dbea8e9e2ddaa24b9c6 | f4f77059866b1742396a50e4e5ed391a | Sets the trnsprtn distance. | public class ClmHdrAmbulanceDtl implements Serializable
public void setTrnsprtnDistance(BigDecimal trnsprtnDistance) {
this.trnsprtnDistance = trnsprtnDistance;
} | 1 |
4677236ef34d4f0134ddb75c6ba992bd | dd49b19e10e08e56ce76fe8af7e970f7 | 执行SQL后影响的行数 | class Mysqli extends Db
public function affectRows()
{
return $this->_affectRows;
} | 1 |
edd2a24320ff430d16e4f13c89176b73 | c0d78895692de862b18814de1fdc8099 | Read all information in show file. Dispatch to methods reading the
information that comes with the different identifiers. | if disp_file.endswith('.gz'):
disp_contents = gzip.GzipFile(disp_file,'r')
else:
disp_contents = open(disp_file,'r')
pd_one_par=[]
pd_par=[]
npar=int(disp_contents.readline().split()[0])
nlo=int(disp_contents.readline().split()[0])
self.deporig=[0.0]
self.depf=[0.0]
... | 1 |
b56fdc7b76b5dcf0a2d2862902e3f33e | c8e9ee3d65762030f593f812bb1c2645 | Makes call to VRE and retrieves a token. Token is valid for 3 minutes so we just fire this on every api call | class BluemixVoiceToText:
def __renew_token():
request = requests.get(PRODUCTION_SERVER + APP_PATH + TOKEN_API)
return request.text | 1 |
deaca56467d8c9ad9a49b60f04e622d0 | df7b52789855da826df5bafd1f7df54f | 如果str1小于str2,则返回true。 | class String
bool operator< (const String& s) const
{
const char* str_left = _str;
const char* str_right = s._str;
while(*str_left && *str_right)
{
if(*str_left < *str_right)
{
return true;
}
else if(*str_left > *str_rig... | 1 |
d5449cf2d72897b4d7ea84d623e12981 | fb060309a24f9c4dfbfd8dd15309667d | Force conversion to an arraybuffer | public asArrayBuffer() {
return ZipUtils.string2Uint8Array(this.asBinary()).buffer;
} | 1 |
228cb2886d7fbf62b525b526fb6034be | ce19f7af74f4543a532d48b38c6d23e1 | Used in simulated annealing determine whether to change a tyre compound or a lap number | {
if ((m_CircuitController.CircuitLength * (x.CurrentLap - 1)) + x.TotalDistance
< (m_CircuitController.CircuitLength * (y.CurrentLap - 1)) + y.TotalDistance)
return 1;
else return -1;
} | 0 |
95e2e5f7368d6b5c44342805d5e4c4fb | 6fdf0f6885f54208c2d7c74ae6abaa06 | Switches to the HTML mode. | public class Story implements Serializable
public void setHtmlMode(boolean value) {
htmlMode = value;
} | 1 |
75dff251cc511e0faf13dc83b5642f5f | 31ef006eb661b988e2daef8685a7469a | sets the start cell and end cell colors in the game. | {
PPatchSim.cellColours.add(Color.black);
PPatchSim.cellColours.add(Color.LIGHT_GRAY);
PPatchSim.cellColours.add(Color.LIGHT_GRAY);
PPatchSim.cellColours.add(Color.LIGHT_GRAY);
PPatchSim.cellColours.add(new Color(255,0,0));
PPatchSim.cellColours.add(new Color(255,165,0)); ... | 0 |
6570044d4fd545445f369d7ba9da2abd | 53f67b356468c8ccd5336b60cdf312f0 | 급여 지급 함수 | public class InputManager : MonoBehaviour
public void payRent() {
g.payRent();
} | 0 |
41d59c182451b0976bf449cc5382fcee | 0d15c328a57bbe7c7f17258ebec3c1f4 | To set the quantity values for the NurseryStockDetails table. | public class NurseryStockDetailsCriteria implements Serializable
public void setQuantity(LongFilter quantity) {
this.quantity = quantity;
} | 1 |
f2baf109b92aef13e47e718a8f7c2b4d | 7bdfbb004bbd0c2f78ae09581283a8a9 | 通过cookie的信息登录 | class User extends CI_Controller
public function cookie_login(){
header('Access-Control-Allow-Origin:*');
$username=base64_decode($this->input->post("username"));
$password=$this->input->post("password");
$arr=[
"user"=>$username,
"password"=>$password,
... | 0 |
999acd7196a5f0c6ebc25e68433ac707 | 829f4dd0a794911b8f8cd888a8fc3811 | This method is called independently of the others in the CaptureCallback, when a capture
sequence finishes.
<p>In total, there will be at least one
{@link #onCaptureProcessStarted}/{@link #onCaptureFailed}
invocation before this callback is triggered. If the capture
sequence is aborted before any requests have begun pr... | void onCaptureDone(byte[] pictureData); | 1 |
a13fa7e1bde1488fff1f2091b85a4bd2 | 389c7c63958e2a2cf77d6f2bbffa548f | 获取餐具工厂 | class Factory extends BaseService
public static function getFactory($orderSource = OrderSourceEnum::MASTER)
{
static $classObj = [];
if (!isset($classObj[$orderSource])) {
$classObj[$orderSource] = new static::$class[$orderSource];
}
return $classObj[$orderSource];
} | 0 |
a43f409fcbc954d6b845f6e8d8d5a1cc | 6fa1f1a4e5ef42519f7a64ff201c7bf1 | Low lever terminal initialization; get current terminal parameters
and save current speed in cur_term and ospeed | int
term_init(sp)
SCR *sp;
{
GS *gp;
KEYLIST *kp;
TKLIST const *tkp;
int cnt;
char *sbp, *t, buf[2 * 1024], sbuf[128];
(void)setlocale(LC_ALL, "");
key_init(sp);
gp = sp->gp;
#ifdef VERASE
term_key_set(gp, VERASE, K_VERASE);
#endif
#ifdef VINTR
term_key_set(gp, VINTR, K_VINTR);
#endif
#ifdef VKILL
term_key_... | 0 |
a56af3c1f91533856e37951f44a0e34b | da6810e9e760fbfd91568d3ab8396202 | vlozi novou instruci na konec seznamu | void InstructionList::addInstructionToTail(Instruction *instruction) {
if(head == nullptr) {
head = tail = instruction;
} else {
tail->setNextInstr(instruction);
tail = instruction;
}
} | 1 |
1ce6633133e19979c027b120fdb1e68b | 4dd2e6194f1f0c5f0d129e6952e453bd | Set items to boots inventory | foreach (Equipment _item in defaultItems) {
Equip (_item);
}
} | 0 |
8e24f1a40c56b11c26c67e01fb303ece | 5ab21ee901fc91d23b2b7cca85800a4a | # This function checks if a string is regular expression | checkText <- function(s,t){
grepl(s,paste(t,sep="",collapse=TRUE))
} | 0 |
8137481b107b58d1da090275f47a7dd0 | 51b084f1802ae1d7b9af41a530e614d4 | 根据单词ID查找句子 | class WordBookSql(SqlDb):
# ================================== 单词本 =================================================
def find_word_by_id(self, word_id):
sql = "SELECT vocabulary FROM wordbank where id = '%s'" % word_id
return self.execute_sql_return_result(sql) | 0 |
599837d5e50c24d96e23a888ea666f75 | e9051d527f0821ccce870fc07a2eea95 | Called from main unit.
Posts BT_task processed by main unit to answer queue. | def post_outgoing(task):
answer_queue = open("bt_answers.txt", "wb")
pickle.dump(task, answer_queue)
answer_queue.close() | 1 |
cf19c3dd4a5cf74cd09b10da1f7fad66 | a0b22a11382d8cb5ae7875b1821500b0 | Управление галерей: лево, право, ввод. | function Gallery() {
this.keyCodes = {
LEFT_ARROW: 37,
RIGHT_ARROW: 39,
ESC: 27
};
this.gallery = document.querySelector('.overlay-gallery');
this._closeBtn = this.gallery.querySelector('.overlay-gallery-close');
this._leftClick = this.gallery.querySelector('.overlay-galler... | 1 |
3880ed522242f2de08b514e438b6affb | 44b75cfc2f2b7c5513038b3857a99a52 | Funcion que obtiene la lista de todos los torneos existentes en la BD. | {
$fecha = getdate();
$torneos = $this->Torneo_model->consulta(NULL, $fecha['year']);
$html = '';
foreach ($torneos as $i)
{
$html = $html . '<p>' . $i['nombre'] . '</p>';
}
$this->variables['torneos']=$html;
} | 0 |
18c0f6cdd0694a3f8c5234428e9e1693 | a774da90781abdbee2dbf86c49309c97 | Implementing filter bill and audit accounts grid functionality | class RoutePage(BasePage):
def filter_suggested_trunks_grid_account_column(self):
filter_item_list = [self.suggested_trunks_grid_first_row_account]
self.grid_filter_details(self.account_column_name, filter_item_list) | 0 |
63fea00a738216b95f9471082dda0746 | e483700e1fb2a3f883110815acbb0a96 | Retrieve not direct friends who have at least 2 common friends with
a person | $arr = array();
foreach ($uids as $someone) {
$arr[$someone] = $this->_getCommonFriends($uid, $someone);
}
return $arr;
} | 0 |
48dd25ca20c160c384c475af05e8b013 | 7eae2046ad442ea67c915fd373285286 | 创建myrealm对象 交给spring工厂管理 | @Configuration
public class ShiroConfig
@Bean
public MyShiroRealm myShiroRealm() {
return new MyShiroRealm();
} | 1 |
77734871f434fdd20ccbbd53323e08ff | afe2a4a921167b536dac3a5931276857 | Converts object1 and object2 into binary stream. | {
Byte[] returnBytes;
IFormatter formatter = new BinaryFormatter();
MemoryStream stream = new MemoryStream();
formatter.Serialize(stream, obj);
StreamReader reader = new StreamReader(stream);
stream.Seek(0, 0);
returnBytes = stream.ToArray();
stream.Cl... | 0 |
11f37879365e8a23b7d3ef13185cfdb2 | 553a14a4628c64cac65d2fa3711b32e4 | Shows error about missing revisions. | $this->load();
$srev = $this->article->getStableRev();
if ( $srev && $this->article->revsArePending() ) {
$revsSince = $this->article->getPendingRevCount();
$tag = "<div id='mw-fr-revisiontag-edit' class='flaggedrevs_notice plainlinks'>" .
FlaggedRevsXML::lockStatusIcon( $this->article ) .
FlaggedR... | 0 |
08d540861c718eba38636a55eac9e48a | 8e7cbe652c7f12fcb05f56f904b5550d | 将一个uuid对象转化成byte[] | UUID uuid = UUID.randomUUID();
byte[] highBytes = Bytes.toBytes(uuid.getMostSignificantBits());
byte[] lowBytes = Bytes.toBytes(uuid.getLeastSignificantBits());
return Bytes.add(highBytes, lowBytes);
} | 1 |
8f6b5f4c7cf2342939c2b9a88ae84987 | 5e929cc3332dc6e65d71cbc5f569a194 | 写入支付文件 | class ApiController extends Controller{
public function PaySetLog($is_dir="./PayLog",$cname="HLBQP",$txt="")
{
if(!is_dir($is_dir)) {
mkdir($is_dir);
}elseif(!is_writeable($is_dir)) {
header('Content-Type:text/html; charset=utf-8');
exit('目录 [ '.$is_dir.' ] 不可写!')... | 1 |
f13ff12043922443df23b7598eb2d2ce | 37e76a8918753228b6bec1623bf58b31 | Determine maximum number of banks for the DDR DIMMs installed in the channel
Return the number of banks encoded for the SCHEDULER_ENABLES_BS register.
with the maximum number of banks.
Will be 0 if there are no DDR DIMMs in the channel. | NumBanksLookup (
IN PSYSHOST Host,
IN UINT8 Socket,
IN UINT8 Ch
)
{
UINT8 Dimm;
UINT8 NumBankBits;
UINT8 NumBanks;
UINT8 MaxNumBanks;
UINT8 NumBanksEncoded = 0;
struct dimmNvram (*DimmNvList)[MAX_DIMM];
DimmNvList = GetDim... | 1 |
176230d0bbe458081a88bb57b367a63b | f3e1c0d03731af8c3ea5c6c4a744c968 | Creates length ratio colors. | class WindroseAxes(PolarAxes):
def _colors(self, cmap, n):
return [cmap(i) for i in np.linspace(0.0, 1.0, n)] | 0 |
7b814318cb0efa4b0a6f099b4bc3a10a | d1103f760967b594a7b8ce0efb4c6680 | Get MS-DOS header signature - 'MZ' | namespace retdec namespace fileformat
std::size_t PeFormat::getMzHeaderSize() const
{
return sizeof(PELIB_IMAGE_DOS_HEADER);
} | 0 |
a573546bf1f638b2f761a4c147877aaf | 11ff078f5a4767f0ab8899291a9fee07 | Draw a rectangular polygon with given vertexes and map texture
coordinates. | void drawPolygon(bool texture, int npolygon, bool border) {
float x_min_polygon, x_max_polygon, y_min_polygon, y_max_polygon, z_min_polygon, z_max_polygon;
switch (npolygon)
{
case(1):
x_min_polygon = Constant::DIM_X_MIN_TARGET;
x_max_polygon = Constant::DIM_X_MAX_TARGET;
... | 1 |
778d169b68fe486858325975fb1bc874 | 75fc4887073c8a379c10d430a47efaa9 | 关节空间三次插值,计算插值的每个三次函数系数值 | v0: Vec2,
v1: Vec2,
v2: Vec2,
v3: Vec2,
t: number,
out: Array<Vec2>
): void {
if (!isInRange(0, 1, t)) {
throw new Error(`interval is ${t}, it should range from 0 to 1.`);
}
const v01 = vLinearInterpolation(vCreate(), v0, v1, t);
const v12 = vLinearInterpolation(vCreate()... | 0 |
cb36df2dfc6c96d862efa7ce9eb31f6a | 9d2fbdff839d01dbacbc7ddca0f94426 | get references to the HTML canvas elements | export default class Canvas
constructor(settings) {
this.canvas = document.getElementById(settings.canvas);
this.c = canvas.getContext('2d');
this.colorSelect = document.getElementById(settings.color);
this.widthInput = document.getElementById(settings.width);
this.valueInput = document.getElem... | 1 |
4d38cb1cc91793c22f0706ac20c94771 | 3d98c54565fcfc5c765ab76885595a07 | [Function to find the start of square peaks in a time series.
Useful for example to find frame starts or stim starts in analog input data] | found = False
n = data.shape[0]
for i in range(window_size,n-window_size):
window_ind = range(i-window_size,i+window_size)
window_data = data[i-window_size:i+window_size]
fit = pylab.polyfit(window_ind, window_data,1)
if fit[0] > slope_threshold:
found = True
... | 0 |
575f21de4b555d7319aff5d94b7adcec | 6b33b8999ecea474343ba40cfb4458fd | Returns the file and line number for the given offset in the method. | int getOffset(int lineNumber, int column) throws BadLocationException; | 0 |
1883b65b55718aa1daaa038343b94b6e | 1175ee40af6dc2bd56c6a0e0aa5c02fb | Test to see if the PID file already exists | {
if ($this->pidFile == null) {
return true;
}
if (!flock($this->pidFile, LOCK_SH | LOCK_NB) || !flock($this->pidFile, LOCK_EX | LOCK_NB)) {
return true;
}
return false;
} | 0 |
a5afff3d71ec4c62eceebf9ddf92627d | 35f630d15d9ded9648ae4c4faae5b5b2 | 装饰物右旋 | static Position SingleRotateWithRight(Position K1){
Position K2;
K2 = K1->Right;
K1->Right = K2->Left;
K2->Left = K1;
K1->Height = Max(Height(K1->Left), Height(K1->Right)) + 1;
K2->Height = Max(Height(K2->Right), K1->Height) + 1;
return K2;
} | 1 |
2e98556f59c8e50f30c5e5010fabd5dd | b6f4bec4bc20ea02360a8d3f52fff2ed | Returns True if autosave multisave mode is currently on.
Use this function instead of directly accessing the autosave variable. | public class NBSHeader implements Writable
public boolean isAutosaveEnabled() {
return autosaveEnabled;
} | 1 |
fcf142a00d1cbcd14093e44eb5da3698 | 3fb96f17949a4d849b9fcc10d4d0fa5c | A general poisoning attack against logistic regression. | class GammaPoison(object):
def __init__(self, alpha, beta):
self.__dict__.update({"alpha": alpha, "beta": beta}) | 0 |
5d1d9f7f0e5d3951626d1cf967a68afb | af207e1325b342841281903ec2d66e7e | 読み込んだdom情報を画面別にリスト化してディクショナリーに 格納する | function readJsonFile() {
for (i = 0; i < test.length; i++){
for (var j in test[i]) {
switch (j){
case 'form_name':
$('#_title').append(
$('<h1>',{
class: 'title_name'
}).text(test[i].form_name)
);
break;
case 'input':
$('#doc').append(
$('<div>',{
id:... | 0 |
18349d0b7b1e593ee0b24e2456f7e595 | d980184cc1bc2ae73527259375061232 | Boxの文字列表現を返します。 | function boxToString(box) {
var p1 = map.locationPoint(box[0]);
var p2 = map.locationPoint(box[1]);
return p1.toString() +" "+ p2.toString();
} | 1 |
884610fe0906926a154238a6af672a7b | 9bd40f75e6baea741837d0732f450efa | Configures the attributes of the signal generator that affect arbitrary
waveform generation | class SignalGen:
def __init__(self, **params):
self.N = params.get('N', 1024)
self.M = params.get('M', 256)
self.T = params.get('T', 4)
self.A_type = params.get('A_type', 1)
self.lambda_ = params.get('lambda_', 0.08)
self.zeta = params.get('zeta', 0)
self.sigma2... | 1 |
2b0fbda08d6fee2dc6ddcdf4af213ddb | 036bc497571f47c9051f5122bc6a3cfc | Tests that blockGiagonal generates an actual block diagonal matrix | {
Model current_model;
ModelPart& r_model_part = current_model.CreateModelPart("Main", 3);
BasicTestBuilderAndSolverDisplacement(r_model_part, true);
SchemeType::Pointer p_scheme = SchemeType::Pointer( new ResidualBasedIncrementalUpdateStaticSchemeType() );
LinearSolverType::... | 1 |
41778cbb44b2dee33814ef80a1b95692 | ebe52bb4b6873dc17a4cfcf8e4a6d08b | 利用正则表达式输出接口IP地址信息 | reg_rule = r'<div id="result"><div class="well"><p>查询的 IP:<code>(.+?)</code> 来自:(.+?)</p><p>(.+?)</p><p>(.+?)</p></div></div>'
reg = re.compile(reg_rule)
try:
html_list = re.findall(reg, html)
return json.dumps(html_list[0], ensure_ascii=False, indent=4)
except:
return None | 1 |
23d8e6ae2c7914f0beb927551901d25d | 8f264342b48ffc7c6976f0f87915d397 | The id of the observer. | class MSCDLLObserver:
def get_name(self):
return self._id | 1 |
1ee9b09bcc8b2747eda21d2de609bbc8 | 07dca0d22759bd425bd5279082a3fea0 | 对应idx,每个态的自旋数 | int x;
Edge edge3[3] = { UR, UF, UL };
int b = idx % 6;
int a = idx / 6;
for (int i = 0; i < BR+1 ; i++)
ep[i] = BR;
for (int j = 1, k; j < 3; j++)
{
k = b % (j + 1);
b /= j + 1;
while (k-- > 0)
rotateRight(edge3, 0, j);
}
x = 2;
for (int j = BR; j >= 0; j--)
if (a - Cnk(j, x + 1) >= 0) {
ep... | 0 |
52c875c02399da2e0e5bfcfa9b7e25bf | 3295cbdbe438b7f7091c492913bd7de7 | Construct a customized Pyomo AbstractModel using the Switch modules or
packages in the given list.
This is implemented as calling the following functions for each module
that has them defined:
define_dynamic_lists(model): Add lists to the model that other modules
can register with. Used for power balance equations, cos... | def network_lopf_build_model(network, snapshots=None, skip_pre=False,
formulation="angles", ptdf_tolerance=0.):
if isinstance(network.snapshots, pd.MultiIndex):
raise NotImplementedError("Optimization with multiindexed snapshots "
"using pyomo i... | 0 |
cf77209b05ec7ff56cbe51a850813519 | e9227f23b59ff11264f518ac2e46b5a3 | Defines polymorphic has_many association using composite key with models in other database. | class User extends Model
static associate(models) {
User.hasMany(models.Peliharaan, { as: 'peliharaan' })
User.hasMany(models.Appointment, { as: 'appointment' })
} | 0 |
4625e7eff31b940adbe15a27afbdad11 | 65a021d04abaf528bebae2d47f786708 | Set eula declined. | timestamp = subprocess.run(['date'], capture_output=True).stdout.decode('utf-8').rstrip()
file_path_name = f'{msm_server_directory}/{server_name}/eula.txt'
with (open(file_path_name, 'w')) as eula:
eula.writelines(f'#By changing the setting below to TRUE you are indicating your agree... | 0 |
90e1c5a4084a2d00f2901c26b82c5817 | ebd2c9608183f4bde7a65875ba8e579d | sets up MC soma spike probes | tmp = []
tmp += list([128 for j in range(self.numMCs)])
tmp += list([64 for j in range(self.numTargets)])
self.initChannel.write(self.numMCs + self.numTargets, tmp) | 0 |
91b66f38c9e8b4abb760bf4120e5c45a | d951781b6b62d9ece715ffea1ddc72f5 | 添加商品评论测试 评分为2的场景 | public class Comment_Test extends BaseTest
@Test(priority = '1')
public void Add_comment() throws Exception {
webtest.open("http://localhost:8032/wordpress/wp-login.php?");
action.login("yty", "12345678");
webtest.open("http://localhost:8032/wordpress/");
for (int i = 0; i < 10; i++) {
webtest.KeyDown();
... | 0 |
c6d76656824c7732e127b7d0439e9c25 | a74535cb738a61806b569a81f05f7566 | This method is used to retreive all users and Departments for Reassign
all | {
$usersRequest = DB::table('users')
->join('departments', 'departments.id' ,'=', 'users.department_id')
->select('users.id','users.name','users.cell','departments.department_name')
->get();
return $usersRequest;
} | 1 |
04a6f908b1161c8a7980b8806e66a92d | 59f2622c7930f85824e94e0548efc32d | Insert a soft newline `\n` that converts to `<br>` in HTML. | def br(value):
return value.replace("\n", "<br>") | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.