query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
c00b888cd4108a856c296fdf458e0df3 | 20ac3cf9f555fc6f26ab144e2606837e | When the enter key is pressed on the input, add a new input
to the collection. | function addNewIfEnter(ev)
{
if (ev.keyCode == 10 || ev.keyCode == 13)
{
addNewCards();
return true;
}
return false;
} | 1 |
10ef571925ce420deab400b953d38a04 | bf6b954b2b8ec5dea516294a254f5c23 | 启动activity,选择模式为单选 | public class ImageSelectUtil
public static void singleSelectImage(Activity activity){
ImageConfig imageSelectorConfig = new ImageConfig.Builder(activity
, new ImageUniversalLoader())
.steepToolBarColor(activity.getResources().getColor(R.color.text_gray))
.titleBgC... | 1 |
29655cf4fa7b0d6f537b22eb4a4b3cf7 | 4ab43ca7c466978e70c205de59540e7e | 格式化时间,将秒转化为时分秒 | function formatSeconds(value) {
var secondTime = parseInt(value);
var minuteTime = 0;
var hourTime = 0;
if (secondTime > 60) {
minuteTime = parseInt(secondTime / 60);
secondTime = parseInt(secondTime % 60);
if (minuteTime > 60) {
hourTime = parseInt(minuteTime / 60);
minuteTime = parseInt(minuteTime... | 1 |
40a94cf8c3e7b33d304bd3e9a088abe6 | 740c69cfd8873e9542f12bcbff1907c3 | DebugHTTPForm helper to print the form url parameters | function debug_form() {
$user_key = '';
$password = '';
$first_name = '';
$last_name = '';
$email = '';
$suspended = '';
if (isset($_GET['user']) || isset($_POST['user']))
$user_key = (!empty($_GET['user'])) ? $_GET['user'] : ( (!empty($_POST['user'])) ? $_POST['user'] : '');
if (isset($_... | 0 |
a767144dc604e0430d2fa7fc12815383 | 355329514374296acbc5e5368c5030a9 | Gets the enrichment status for a given metric. Enrichment status is described by the service as the process
of detecting which data points of an ingested set of data can be classified as anomalies. Each status represents
a single data source ingestion. | namespace Couchbase.Analytics
Task<QueryStatus> GetStatusAsync(); | 0 |
6a0e1394eac9aac58c611cffa72803dc | 06a105cf782f899daa4a711e6cc857e4 | A service is deletable if there is no Machine using it. | class Element(MTModel):
def deletable(self):
return not self.environments.exists() | 1 |
4b1b0e74be576147ed421d554dcc56a7 | 771ab0e541387fe296f3e6f30f9fab35 | grab html and store it as text file named doi_[current time] | filename = response.url.split("&")[-1] + ".html"
with open(filename, "w") as f:
f.write(response.body) | 0 |
9375f2a9e3ff6e0a34df269f4cc868f8 | e5c7958b01c4857cc2a76b2ead8b7d76 | Shows list of users | class UserController extends Controller
public function index() {
return view('users.list');
} | 1 |
426e78ca737dcda11237b3edaff92a8c | a8431470fadfa930a7e7ec545bcaf90d | 添加连接时的初始化sql。可以添加多次,在初次连接时使用,比如指定编码或者默认scheme等 | public class ConnectionHandle implements Connection,Serializable{
public void sendInitSQL() throws SQLException {
sendInitSQL(this.connection, this.pool.getConfig().getInitSQL());
} | 1 |
4a1e281406facfe87077647b677d1014 | c804a35bd90c2031365fb7b475419240 | Funcion que obtiene y devuelve todos los tipos de propiedades inmobiliarias sin repetirlos | class Inmueble extends CActiveRecord
public function getPropertyTypes(){
$models = TipoInmueble::model()->findAll();
return CHtml::listData($models,'id_tipo_inmueble','nombre');
} | 1 |
302d7f62d4679687cf694f01ddae0ad5 | 5001e1fb61e8bf7a1407bfe1f4f44c80 | 获取相应key的float值, 不存在或转化失败则返回0 | public class JSON
public float getFloat(String key) {
return getFloat(key, 0F);
} | 1 |
1bc8604cf094bd1e625e3ae8ac5170b6 | 4afae58460df1ee8c512372939bbb9d3 | 发布终端软件 | login_verpush_sys(url,username,pwd)
sleep(2)
path_ver_push_href=driver.find_element_by_link_text(u'版本发布')
path_ver_push_href.click()
path_ver_push_button=driver.find_element_by_xpath("//button[@class='btn btn-primary btn-w']")
path_ver_push_button.click()
sleep(2)
path_choose_client_path... | 1 |
03c475afeb475e971e0ad1c4ca9649a6 | a08e42df858062273ea3680931231d6b | 根据产品名称模糊查找 | List<BuffetFoodProduct> matchSearchingByProductName(String key); | 1 |
de7d3f2d04d4edd9b606f48175287c4a | 1af06cf80d3e385201f9170fefb7c3b4 | @brief 显示退出游戏弹窗 | public class UIController : SingletonBehaviour<UIController>
public void ShowQuitGameWindow()
{
ShowWindowWithCurrentUIManager("ui_win_quitGame");
} | 1 |
6e3f027722b2c794eee1ad6bbf5a2365 | 58b9de911d10288e76b00a9ae32f3697 | Creates a panel for selecting multiple items | ScrolledPanel.__init__(self, parent, -1)
self.border = 5
self.list_items_names = []
self.current_selection = None
self.Bind(wx.EVT_LEFT_UP, self.cb_on_left_up)
sizer = wx.BoxSizer(wx.VERTICAL)
self.sizer = sizer
self.sizer.Add((0, self.border))
sel... | 0 |
7413d8c2ed8ba981efb143ac6c19feaf | 461acab7a6e57c4e8b58d3c1b4cbed8e | 区切り線を出力します。 | void outputDivider()
{
printf("╠═════════════════════════════════════════════════════════════════════════════╣\n");
} | 1 |
9ab9de2ec9d6a3ead6e816ce3336d9bb | 031a94ff6928dde38af8b1f992e58411 | 创建CDN资源URL地址 | namespace ShineEngine
public class ResourceInfoControl
public static string getCDNResourcePath(string url,int resourceVersion)
{
if(!ShineSetting.isRelease)
{
return getStreamingAssetsPath(url,true);
}
StringBuilder sb=StringBuilderPool.create();
sb.Append(ShineGlobal.cdnSourcePath);
sb.Append(... | 1 |
29fcc290acb6c27dd84610b5a4123e1d | 94d3d68285dbfd9bf623eb74300accf4 | Loads a tab-delimited file into a database table | if url and not filename:
filename = filename_from_url(url)
self.table = table
if url and not self.find_file(filename):
self.download_file(url, filename)
file_path = self.find_file(filename)
source = (skip_rows,
(self.table.column_names_ro... | 1 |
40cb6c26fa8973ec42b1c609a495b242 | f168df6b39ed3ef3d527c1daebd9aa4d | Move right by one step.. | void Board::MoveRight()
{
if (spaceX < size-1)
{
int tmp = board[spaceY][spaceX+1].getValue();
board[spaceY][spaceX+1].setValue(0);
board[spaceY][spaceX].setValue(tmp);
spaceX++;
}
} | 1 |
390df7bc48fd7de70b580586af355347 | 11bf4db4188929d0b28d33a8a0a85125 | загрузка всех новостей c БД (оффлайн работа) | void loadAllWorldNews(); | 1 |
00278df7352076471d25fc424be5b74f | c0b51081ff712983a4284d207fc73f15 | Makes the dialog window visible. | public class AiDuelOptionsWindow extends JDialog
private void showDialog()
{
setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
setLocationByPlatform(true);
setVisible(true);
} | 1 |
5eccd2a3d9dff6cde30b0c223d5cd8f3 | 28211ee15bbf6a8907c5216679dd2513 | Reads the content of the object onto the buffer with objid = objid.
Return value: Success --> #of bytes written
Failure --> -1 | long objstore_read(int objid, char *buf, int size, struct objfs_state *objfs, off_t offset)
{
dprintf("Doing read size = %d\n", size);
struct object* obj = load_object(objfs, objid);
u32 retval = size;
if(offset>>12 > obj->blocks) return -1;
u32 idx = offset>>12;
int temp;
while(size>0&&idx<... | 1 |
156de32b5c30804053c5cbd1cad255d6 | deef249b29bc6a69eb40c56e85eaab10 | Initiates a shutdown in which preexisting and new calls are cancelled. | async function cancelShutdown(verbose: boolean = false): Promise<void> {
await getDriver(process.platform).cancelShutdown(verbose);
} | 0 |
c8fbb675a8fdca0286b177ffe99e0b32 | 8266cd3acc9d95f83eee5888cc924a13 | Retrieve the reviewer's rating for the given movie. | namespace MovieData
string GetRating(int id); | 1 |
5cf45b55fc433bc742889593a933a493 | 785cf7c129d6d9a4dc79e1d9271b9416 | Increases the tab level. | namespace ReverseEngineer20.ReverseEngineer
public class FileBuilder
public void wTab()
{
_sb.Append(currTab);
} | 0 |
c7ecc10031501a168ad796a67ab8c52e | f6357e3e5c75f873f53dfb96624848ee | throw error 可以执行finally | public void test2(){
try {
throw new RuntimeException();
}finally {
return;
}
} | 1 |
4c1dfac25085044e3cfed62d4b58662d | 9e5dd29ff4376a62e26862f9e00ecf0c | Called when a 'partition closing' event is triggered. | {
using (Logger.BeginScope("OnStop"))
{
Logger.LogInformation("Stopping partition {partitionId}, reason {reason}", partitionContext.PartitionId, Enum.GetName(typeof(ProcessingStoppedReason), reason));
if (reason == ProcessingStoppedReason.Shutdown)
... | 1 |
a3cd45708f19942ba3c003485afc21a1 | 926e33db6663ecb8d637639c6937ecef | Lock list of specified parameters on the node. | auto &the_map = tree.node_param_list;
vector<ParseVariable> res;
switch (type) {
case N_PARAM_LIST: {
for (const auto &each : tree.node_children[node_id]) {
const ParseNode &node = tree.nodes[each];
if (node.type == N_PARAM_DECLARATION) {
... | 0 |
4c9b0b34391fe350f0a1ceb233fb6751 | ec3ed1ce9e40007c8956ab8a459dd79d | ___VISUAL__ | def visualize_concentration(mode = 'coordinate_axes', d = 500, n_simulation_iters = 15):
n = 3
mat_cov = np.eye(d)
arr_mean = np.zeros(d)
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
for _ in range(n_simulation_iters):
if mode == 'coordinate_axes':
degree_of... | 1 |
fd61cd28c765e1a35bf5b400461f3409 | 33366ae864a9bc98820f0e5974bf8e67 | initializes and fills 3D array with zeroes | {
int[,] ZeroArray = new int[buddhaBrotPictureBox.Width - 1, buddhaBrotPictureBox.Height - 1];
int rows = ZeroArray.GetLength(0);
int columns = ZeroArray.GetLength(1);
for (int y = 0; y < columns; y++)
{
for (int x = 0; x < rows; x++)
... | 0 |
a6d85293143af54d26b02aeb0d9fa3de | 064f894386a544ef52838192f3db5de4 | Invoked when an IdToken has been validated and produced an AuthenticationTicket. Note there are additional checks after this
event that validate other aspects of the authentication flow like the nonce. | namespace Microsoft.AspNet.Authentication.JwtBearer
Task SecurityTokenValidated(SecurityTokenValidatedContext context); | 0 |
4af2b8b71716b9fd3bd5f148e10debb8 | 5d2ee0f3958bc9e3780063e8c8854853 | 產生name card的function | let badges = '';
product.tags.forEach(function(tag){
const badge = `<span class="badge badge-warning">${tag}</span>`;
badges += badge;
});
const cardElement = `
<div class="col-md-4">
<div class="card mb-3">
<img src="${product.img}" class="card-img-to... | 0 |
c9cc10ae13d233361665056246a7a6ed | f0c5ad2e0c322f63f91234332a27bc25 | Use setsockopt(SO_REUSEADDR) set reusing port addres after close connection, not wait for lost packets on route.
param pointer to socket
return true if set was accepted. | bool CITUdpSocket::SetReuseAddr(bool bReuseAddr)
{
if (m_socket == INVALID_SOCKET) return false;
int nOptval = bReuseAddr ? 1 : 0;
if (setsockopt(m_socket, SOL_SOCKET, SO_REUSEADDR, (char*)&nOptval, sizeof(int)) == SOCKET_ERROR) {
int nErrorNo = GetErrorNum();
MKLOG(FORMAT_LOG(LOGSRC, LogError, "Error! Failed t... | 1 |
44e054c1e077aee0798543adb01ab854 | 7305ded8d2788c85ab35ca49196bf4ae | Provide valid and invalid permissions combos for testing. | class PermissionMapTest extends TestCase
public function provideDataForPermissionMap()
{
return array(
array('EXECUTE'),
array('CONSUME'),
array('CREATE'),
);
} | 0 |
1ed26267febbb24f778228893db4904a | 81b1f216a3e61a8f2c7defa021b5905f | 用于学生修改密码并返回一个bool值 | SQLiteDatabase db = null;
String sql = "update log set password = ? where student_id = ?";
try {
db = dbHelper.getWritableDatabase();
db.beginTransaction();
if(check(user.getId(),user.getPassword())){
db.execSQL(sql,new Object[]{newPasswd,user.... | 1 |
91e4b83ac5d2a56697000edf05e177f5 | 00e4b8148d5fda5e8c1fa754e6118541 | универсальная функция, которая в определенном массиве удаляет определенный класс | for (var i = 0; i < classes.length; i++) {
if (classes[i] == cls) {
classes.splice(classes.indexOf(cls), 1);
i--;
}
}
obj.className = classes.join(' ');
} | 1 |
8ae584d587b151f2807032635d73aea4 | 95ae892d775c5071eaef2dca1113affa | Импорт пользователей из файла в команду | Path file = Paths.get(importFileName);
try (BufferedReader reader = Files.newBufferedReader(file, CHARSET)) {
LOGGER.info("[AddressbookImport] "+file.toAbsolutePath());
String line;
while((line = reader.readLine()) != null) {
String result = command(li... | 1 |
749638f694d8b1db925ac921e31e198b | 4eee2dcc634fa6f54571b46eefd4f801 | 修改底部导航栏TextView的状态 | public class BottomNavMenuBar extends LinearLayout{ class MenuItem extends FrameLayout
private void refreshState() {
if (isSelected) {
if (mIconResSelected != 0 && mTextColorSelected != 0) {
ivIcon.setImageResource(mIconResSelected);
tvText.setTextC... | 1 |
58c492c695487a932b7a92a3e5e9f8be | 7f8fa5e20c7febf2e4c1bbc26644079b | Gets the appropriate database association from the Subclient.
Returns:
list - list of database associated with the subclient | self._DISCOVERY = self._commcell_object._services['EMAIL_DISCOVERY'] % (
int(self._backupset_object.backupset_id), 'Database'
)
flag, response = self._commcell_object._cvpysdk_object.make_request('GET', self._DISCOVERY)
if flag:
discover_content = response.json()
... | 1 |
432ff9fffd46b1280a932ddebb93205f | e21116cc0b568b5c288d878e62c9814f | What this should do:
Iterate over our movements, calculate the danger of the movement and
select the one that is going to give us the most for our buck! | PriorityQueue<MoveEfficiency> queue = new PriorityQueue(4, Collections.reverseOrder());
queue.add(getMoveEfficiency(this::left));
queue.add(getMoveEfficiency(this::right));
queue.add(getMoveEfficiency(this::up));
queue.add(getMoveEfficiency(this::down));
Move move = queue... | 1 |
dfd1f23719a8da7197d9878d76ba6638 | 60ad0e0156fa92c66a946dae1b0cf36b | Apply a list of transformations in a random order. | start_post_randomize_run = False
for _transform in self.transform.transforms:
if (
start_post_randomize_run
or isinstance(_transform, Randomizable)
or not isinstance(_transform, Transform)
):
start_post_randomize_r... | 0 |
0da30668d2f2e072de7738ee77a2d6e4 | f202a64b2d2bb52b439989adcdb18073 | 取得当前没有cd的技能,从左到右 | local skills = {}
local function validCheck(skInfo)
if not self:isAvailable(skInfo.sort) then
return false
end
if skInfo.cdCur ~= 0 then
return false
end
if skInfo.sort == 1 and not self.role:angerIsReady() then
return false
end... | 1 |
16899b06da1d5e406c0ffa93bb51c76a | d9618194b298b14a2840aea513a41198 | 设置IBottomListDialog的选项样式 | fun setBottomListButton(
textSize: Float = bottomBtnConfigs.textSize,
@ColorInt textColor: Int = bottomBtnConfigs.textColor,
text: String = bottomBtnConfigs.text,
height: Int = bottomBtnConfigs.height
) = this.apply {
bottomBtnConfigs.also {
... | 1 |
afb974c571e75cad0bc5cce467a9157a | 57228925e04782833ff170a7d9d120f8 | Modify the passed time with the current timezone offset | class Time extends \Mars\Time
public function adjustUtc(int $timestamp, ?int $timezone_offset = null) : int
{
if ($timezone_offset === null) {
$timezone_offset = $this->app->user->timezone_offset;
}
return parent::adjustUtc($timestamp, $timezone_offset);
} | 1 |
99b4c617a0b94704abac2749d66967a1 | bf298380246eb0ef8a738e67341b1741 | Parses a file in the STL ASCII format | vertices = []
normals = []
uvs = []
faces = []
materials = {}
material = ""
mcounter = 0
mcurrent = 0
mtllib = ""
group = 0
object = 0
smooth = 0
previous_line = ""
for line in fileinput.input(fname):
line = previous_line + line
if line[-2:-1] == '... | 0 |
42e4277c1c3f3d5fa512c8e6da62d7d2 | 3ff3967c9c8d1d202a58e5e1a6a0bf62 | Creates a new, empty deck of length 0.
Function exists to ensure that memory was allocated correctly.
Called from the primary public-facing @p createDeck() @p and from @p deckSplit(). | List *createEmptyDeck(){
List *deck = (List*) malloc( sizeof( List ) );
deck->TotalDeckCards = 0;
deck->FirstNode = deck->LastNode = NULL;
return deck;
} | 1 |
ffc9da6150bac9bc61aaaf17bef055d6 | 7289494ab7efb16d8af0bdb9cbb8f2d9 | Validation test for the Northridge SDSU scenario | class ValidationTest(unittest.TestCase):
def test_northridge_gp(self):
self.validation_test(event=1, code_base=1,
test_name="test_northridge_gp",
run_rupture_gen=False) | 1 |
cad2859a49d73ba3564a5e703768b8bb | b2a25504d29de8166d2ad6a2ce8d6cb6 | 加载所有的白名单配置 | var (
w withelist.WitheList
err error
)
if err = ctx.ShouldBind(&w);err != nil{
ctx.JSON(http.StatusBadRequest,gin.H{"code":"0","msg":"参数错误"})
return
}
w,err = withelist.WitheQuery(w)
if err != nil{
logger.Info("白名单未配置")
ctx.JSON(http.StatusOK,gin.H{"code":"0","msg":"白名单未配置,禁止准入"})
return
}else {
... | 0 |
2a380ca7f3d3b80936a437c4269bc162 | 2a8cdd6266a3aaf6ca8293e2f40e4be2 | function to update feedback_setting | $this->db->trans_begin();
$confid = $p1['confid'];
unset($p1['confid']);
$this->db->where('confid',$confid)->update('config', $p1);
if ($this->db->trans_status() === FALSE ) {
$this->db->trans_rollback();
return FALSE;
}else{
$this->db->trans_complete();
return TRUE;
}
} | 0 |
cc790fc1412e58c773b0c27a175729ed | b4c73a8f72530912eb28fba8fdc5f84d | Creates a new DeltaFlowFilter instance
Kwargs | if 'id' in kwargs:
self.id = kwargs['id']
self.type = kwargs['type']
if self.type not in ['show', 'block']:
raise AppDotNetError("Unrecognized filter type :%s" % self.type, None)
self.name = kwargs['name']
self.user_ids = kwargs['user_ids']
self.ha... | 1 |
2db6549947d103c8cc361240f22bbe28 | 841548ee27dc53e9e56350ea9f0236a2 | Find root without path compression. | class UnionFindSet:
def find(self, u: int) -> int:
if self._parents[u] != u:
self._parents[u] = self.find(self._parents[u])
return self._parents[u] | 0 |
aee4caa301cd62e51a61bb3e81573e3a | bbd0008d63c12523cc6140637df061ff | 生成加入房间的令牌 | str := fmt.Sprintf("%s%v%v%v", EnterGameKey, roomId, playerId, timestamp)
return MD5(str)
} | 1 |
04fa706417f0967ecce541427bc0f373 | 8ade08382b7e9ae3b9c2ced5b95e6926 | Pobiera grupę kolizji dla ciała(z pierwszego fixture). | public abstract class CollisionManager<T extends Sprite, S extends Sprite>
public SpriteGroup<S> getGroup2() {
return this.Group2;
} | 0 |
d76a537ba1ed944b242e0c5d40b8363e | 1ec332b96495b479d188920b077a15a5 | This function compares each field of the rule with those of the packet being checked | static Boolean
ssh_engine_find_equal_test_fun(SshEngine engine,
SshEngineLookupPreamble preamble,
const SshUInt32 *extensions,
void *context)
{
SshEnginePolicyRule pm_rule = (SshEnginePolicyRule) context;
SshEnginePolicyRul... | 1 |
809cd671a66e2d3ef41ddc3c76446ac1 | ad6e5d9e1932f91d7a86385a67f12f9f | Update the diffusive mass fluxes. | try:
data['hydro']['B_field'] = 0.5 * (data['hydro']['B_left'] +
data['hydro']['B_right'])
except KeyError:
pass
try:
data['hydro']['mass'] = data['hydro']['density'] * data['amr']['dx']**3
data['hydro']['mass'].to('msun')
except ... | 0 |
ef3dc9a91f53b21cca75ca686d84b115 | f6879ea39ccff14e6c4350f25e643979 | convert time to standard-time (12 hour) format string | CheckTime(timeptr);
sprintf_P(ascTimeBuffer, PSTR("%s %s %2d %02d:%02d:%02d %04d"),
__day[timeptr->tm_wday], __month[timeptr->tm_mon], timeptr->tm_mday,
timeptr->tm_hour, timeptr->tm_min, timeptr->tm_sec,
timeptr->tm_year+1900);
return(ascTimeBuffer);
} | 0 |
3f24110f381f8cb739de2fd8c9b0752f | ff0ae0e536b6fd773ea22de47098b42d | Checks to see if the supplied Object is set, e.g. not null.
It is expected this method would be used as a static import to increase readability as in:
if (objectIsSet(object)) | class Builder implements Activable, Registerable, Serializable
public static function isObjectSet($object)
{
$result = false;
$class = new Reflection_Class(get_class($object));
$defaults = $class->getDefaultProperties();
foreach ($class->accessProperties() as $property) if (!$property->isStatic()) {
$value ... | 0 |
ca5cd83cd48380b19cffb7292c26fc24 | 790d6553b08d9994db127f299fc29025 | Adds a new metric to the Cachet API. | requestBody: MetricCreateArgs,
): CancelablePromise<MetricCreateResult> {
return this.httpRequest.request({
method: 'POST',
url: '/metric/create',
body: requestBody,
mediaType: 'application/json',
errors: {
406: `Feature Not... | 1 |
aed69a3bb5173bcfec786129531be7d9 | 175e6c8257fe6da6d97c553cde4ae2de | Adds an entry to this cursor iff the id is unique | {
int i;
String index = CursorFactoryConstants.calculateCursorId(tableId, operationId);
for (i = 0; i < maxSize && (arrayIds[i] == null || !(arrayIds[i].equals(index) && data[i].getSQLSentence().equals(sqlSentence) && !data[i].isInUse())); i++);
if (i == maxSize)
{
return addElement(handle, index, sqlSent... | 1 |
e19cf1865e4251d6f2b5f65ce180b1e9 | f645d519bf60dfdbc1cefd8b18c1a101 | Send a packet with ARCnet header | u8_t
enc28j60_driver_output_noarp(void)
{
enc28j60PacketSend(uip_len, uip_buf);
return 0;
} | 0 |
9ed48499ef5bbe7e6837ed0cdcab23f3 | ee4720e0de6c10532b28350a43d9f372 | Commit the current partition table to disk. | ptable = open(pfile, 'r')
partitions = ptable.read().splitlines()
ptable.close()
partitions_sec = []
bytes_per_sector = 512
for i in range(len(partitions)):
partitions_sec.append('')
if i == 0:
start_of_part = 1
else:
... | 1 |
cd68c073205b27a673ebaa21fa8c6412 | 998353f2d3b91bce619f5ef60ea013a4 | Checks if any apps are installed that supports reading of PDF files. | public class ReportWizard
protected boolean isPdfAvailable() {
return true;
} | 0 |
7ec6f8256eeef976ccc31eae08401b9e | e156a0e8e387f1e4288325129e39e4cc | Not exactly following number definition (several dots are seen as OK, etc.)
but probably enough in most cases. | self.assertTrue(TestLexer.checkLexeme(
r"""
1.2 1. .1 1e2 1.2E-2 1.2e-2 .1E2 9.0 12e8 0.33E-3 128e-42
12. .05 12.05 1e-5 1.5e-6 0.0005e3 2e21
""",
"1.2,1.,.1,1e2,1.2E-2,1.2e-2,.1E2,9.0,12e8,0.33E-3,128e-42,12.,.05,12.05,1e-5,1.5e-6,0.0005e3,2e21,<EOF>",
... | 1 |
0268d904b0d10bfd1cb80d30f1bd2f08 | 21a0b060e43545f0d237bc70f774ec9d | Sets the maximum objects to be held in memory | public class Configuration public static class Cache
public void setMaxElementsInMemory(int maxElementsInMemory) {
this.maxElementsInMemory = maxElementsInMemory;
} | 1 |
62d4f0f1bc1ac00a8c536f9e34b6dd4f | 23d913cc24ee0a7b6a74676d182dc2f2 | Re-initialise running CPU(s) MTRRs to match the ranges in the descriptor
list.
XXX Must be called with interrupts enabled. | {
int ena = disable_mmu();
atomic_mb();
struct tlb_config *cfg = get_per_cpu(struct tlb_config, tlb_configs);
for (int itlb = 0; itlb <= 1; itlb++) {
for (int s = 0; s < cfg->num_tlb_sets[itlb]; s++) {
for (int w = 0; w < cfg->num_tlb_ways[itlb]; w++) {
write_tlbmr(0,... | 0 |
4481723b75f1046bbd5bf9d7d9a21b50 | f6e371f308e68b2002f0b9268b8c3903 | https://developers.google.com/gmail/api/v1/reference/users/threads/trash | class Thread:
def trash(self) -> dict:
return self.gmail_client.trash_thread(self.thread_id) | 1 |
981de90e914452326bf44e556dceea95 | 1ebe3ab088c263f35f4f1477f2e8344e | AJAX call voor een uurrooster van een combi-student op te halen. | namespace RicOneApi.Api
public class XPress : IXPress
public ResponseMulti<XRosterType> GetXRostersByXStudent(string refId)
{
return xRostersObject.GetXRostersByXStudent(refId);
} | 0 |
48ad6f9cdc36015a159a8f90dd73c397 | abb7b6090f3c527586ac2c52bb849d9e | Returns the watermark limit, when the LV usage reaches this limit an
extension is in order (thin provisioning on block devices). | class AbstractProvisioner(ABC):
def _get_user_data_limit(self) -> int:
raise NotImplementedError | 0 |
14a4a9a0955a68065e4de87551471b50 | bb3990f58341ff9fc6c40d00b5518dcf | Adds a target to a player's ignore list. | public class Player
public void addOptionalTarget(Player target) {
this.optionalTargets.add(target);
} | 0 |
bc340bf3d30ca1614cfb3913043d6dee | fb2f4a33daa809f5315d3eac1c1d35b1 | Prepare the image object pixels array. You must do this
if you want to access individual pixel information. | class CImage
implements IDAO
private function setRawData($data)
{
$pixels = new CPixels();
$pixels->createFromData($data);
$this->pixels = $pixels;
} | 1 |
7ea67a53492ec4e25cbc94f4f3d1e7fc | 3959a8c5ee0350fc51606c149c0d9375 | 为每篇日记创建单独的文件 | def main():
f = open('GhostData.json', 'r')
all_posts = json.load(f)['data']['posts']
f.close()
for post in all_posts:
created = datetime.strptime(post['created_at'], "%Y-%m-%dT%H:%M:%S.000Z")
if not os.path.exists('./output/%d/%02d/%02d' % (created.year, created.month, created.day)):
... | 1 |
224cf7d308ad622ebb7ff64eddfd71c0 | b5849105c39d3870e07d5c3484b5d82a | ▼中段にメッセージボックスを表示するアニメーターを管理するコルーチンを呼び出す関数 | {
Display(title, message, null, null);
instance.messageBoxContent.progressBar.gameObject.SetActive(true);
instance.messageBoxContent.progressBar.value = progress;
} | 0 |
d3bd51167b2340a072ac6362c9bf0e82 | b4789f0dec3661fc6cd7013258b1c2d1 | Exibe a tela principal da área de gerenciamento de usuários com todos os usuários cadastrados. | class UserController extends Controller
public function index()
{
$users = $this->user::all();
$gerentes = DB::table('users')->where('cargo_id', 2)->get();
$cargos = $this->cargo::all();
$municipios = $this->municipio::all()->sortBy('nome');
return view('user.content_user')-... | 1 |
bee27ac0c7d1c1d446bced89f2c291f4 | d2eeb910eef9dbd2b4dae274994feddd | -----------------------------------------------------------------------------------------------
Матрица поворота против часовой стрелки (угол в радианах) | {
float cos = (float)Math.Cos(Angle);
float sin = (float)Math.Sin(Angle);
return new Matrix4(new Vector4(cos, sin, 0.0f, 0.0f), new Vector4(-sin, cos, 0.0f, 0.0f), Vector4.UnitZ, Vector4.UnitW);
} | 1 |
1e1c58c4ce38d8363b1ce539dbb23853 | 85fa0e8a82e5fd87ded9beaace0c0c18 | Handles the Clicked event of the BtnConfig control. | namespace Helenium.Views
public partial class MainForm : Form
private void btnConfig_Click(object sender, EventArgs e)
{
var cf = new ConfigurationForm(Config);
cf.ShowDialog(this);
db.SaveChanges();
} | 1 |
51f28da9de034fe38c42dd424b808efe | fd73d41595f163ff4f77dafdc172c89d | Zatrzymaj syna pod warunkiem, że istnieje. | static void
sigalrm_handler(int signum)
{
if (kill(head->pid,SIGSTOP) < 0) {
perror("Error at stopping\n");
exit(1);
}
} | 1 |
743ff0ceea031045f4f7579724832af9 | 25498e6ff45d8860a8a889334e532d91 | Returns true if any of the elements makes it through the filter. | public abstract class Option<T> implements Stream<T>
@Override
public boolean anyMatch(Predicate<? super T> predicate) {
return stream().anyMatch(predicate);
} | 1 |
799d4e3035821cfcea36b48806d410a8 | d5ccb39713ad165390424ccd6d511234 | Returns the origin position and a fallback position based on the user's position preference.
The fallback position is the inverse of the origin (e.g. 'below' -> 'above'). | export class Tooltip extends GUI<TooltipStyleProps>
private autoPosition([offsetX, offsetY]: [number, number]): [number, number] {
const { x: cursorX, y: cursorY, bounding, position, defaultPosition } = this.attributes;
if (position !== 'auto') return [offsetX, offsetY];
const { offsetWidth, offsetHeight } ... | 1 |
e7b8eca79988cb5d1b77c6115c084965 | d832d0038ccf2fe31f5d1839f03d4a31 | Dao method that sets an OnlineUser's email. | public class UserLite
public void setEmail(String email)
{
this.email = email;
} | 0 |
ca2d2fe23b46b549707d5aa58f26e65f | fd06192db150d12bd847b537bf1c4f82 | Returns the path of this node.
@rtype: string | class Node(object):
def path(self):
return getattr(self, '_path', None) | 1 |
2c3e43854a790a219a31499c505a2d1e | 8c6084fb292d5f5c38bfdb5d3561b93f | @brief returns the options for an yearly repeating event | $currentyear = date("Y");
if (!$this->is_draft_message()) {
$isoptional = true;
} else {
$isoptional = !$this->draft_message->get_to_send_in_future();
}
return [
'startyear' => $currentyear,
'stopyear' => $currentyear + 1,
... | 1 |
b65238e02ee0160ea567cc064d6572c1 | f36d8f663c1aecdf4dc7d3d6a83ef206 | Lance ou arrête le métronome | ImageButton img = findViewById(R.id.runbutt);
if (running == 0) {
img.setBackgroundResource(R.drawable.bouton_no);
running = 1;
Animation animblink = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.rotate);
img.startAnimation(animblink);
... | 1 |
8311fada8eed7114038086fcdd15603a | f2a79a27344a7d06a0c0bb3df794f27c | construct the dns string used to make a connection | {
$protocol = $this->ssl ? $this::PROTOCOL_SSL : $this::PROTOCOL;
$count = count($this->domainController);
if ($count === 1) {
return $protocol . $this->domainController[0];
}
if ($this->useBackup === true) {
$connectionString = null;
fo... | 1 |
1defb958d42a70c20483e7edbc4fa0fc | 16ac98f78cd14c77782fb6260f18b284 | 更新声纳配置,true从文件中读出,false更新到文件 | {
UpdateData(true);
LPTSTR path = this->getTankDir();
PathAppend(path, L"Tank_Data\\Boxconfig");
std::fstream _file;
_file.open(path, std::ios::out);
std::string s = "";
if (this->right_lock)
s += "right_lock 1\n";
else
s += "right_lock 0\n";
if (this->damage_panel)
s += "damage_panel 1\n";
else
s += ... | 0 |
12ce7c08605159cc0107c1e5c604cdfc | a661420e578f61ebefaff6fc0ab9e52d | formats range in the requested format | if (spec.type == 'nominal' && typeof value == 'string') {
if (spec.formatter == 'formatMode') {
return formatMode(value)
}
if (spec.formatter == 'idToTag') {
return idToTag(value)
}
}
if (spec.type == 'ordinal' && typeof value == 'number') {
if (spec.formatter =... | 1 |
97b4b0dab62b0ac9b86025f125090f16 | 953d8d14de4b685edb8971e812d93b39 | 查询7天内的空闲预约情况 | {
string session = Common.utils.NewRequest("session", Common.utils.RequestType.Form);
string date = HttpUtility.UrlEncode(Common.utils.NewRequest("date", Common.utils.RequestType.Form));
string startcity = HttpUtility.UrlEncode(Common.utils.NewRequest("startcity", Common.utils.RequestType.Fo... | 0 |
9be1419f1bba424618c3c1a7e8ac455c | 2fd275df2cb2bbeff2ee841706fc2ed5 | https://www.codewars.com/kata/580a4734d6df748060000045 | function box(n) {
function boxTop(size) {
let b = '';
while (size > 0) {
b += '-';
size--;
}
return b;
}
function boxSide(size) {
let num = size;
let c = '';
while (num > 0) {
c += '-';
num--;
}
const split = c.split('');
const map = split.map((s, i) => {
if (i > 0 && i < split.len... | 1 |
2dc76582f6a0d4a2b5a3cd3f881a40eb | 3458c81d8760beb41c942e1ab8828c5c | Gets the title of the tab at a given index. | class HomePagerAdapter(val context: Context, fragmentManager: FragmentManager) :
SmartFragmentStatePagerAdapter(fragmentManager)
override fun getPageTitle(position: Int): CharSequence? = context.getString(tabTitles[position]) | 1 |
e9673aa8e748ad39bb330b8bcda30e15 | f1f168000b0f3a58d8d03974c1939bf4 | Test Sendgrid Client handling empty inputs | to = ''
fromaddr = 'aaron.kitzmiller@gmail.com'
message = 'Test message'
subject = 'Test subject'
try:
send(to, fromaddr, subject, message)
self.assertTrue(False, 'No error reported')
except Exception as e:
self.assertTrue('Empty email ... | 1 |
42be974c7f6f07025fe55436bd999d4d | d0959ae089087e9860d569ad6885aca4 | 空の入力を渡した場合、ログイン中のユーザーのユーザー情報は更新されない. | class ProfileUpdateUseCaseTest extends TestCase
public function testUnSpecifiedUsername(): void
{
$params = [
'email' => 'test@exeample.com',
];
$user = User::factory()->create([
'name' => 'original-name'
]);
Auth::setUser($user);
$this->profil... | 1 |
f92d3ee6b5cdf78d2e132482cc774579 | e2a368cbed1bcba4368bd95e5956f7e9 | this function will display the values that the user entered to the screen. | class MySpinbox:
# constructor
def display(self):
a = self.val1.get()
s = self.val2.get()
lbl = Label(text='Selected value is: '+str(a)).place(x=50, y=200)
lbl2 = Label(text='Selected city is: '+s).place(x=50, y=220) | 1 |
3390b77e1362a2b6cc2b9a0a4cc8367e | d5fe415dbc16ea9f6c229aee532df70f | Make Reed-Muller RM(r,m) parity check matrix. | (N, U) = r.shape
C = fcdiff.N_to_C(N)
t = np.zeros((C, U), dtype = 'bool')
c = 0
for n in range(N):
for m in range(n + 1, N):
for u in range(U):
if not r[n, u] and not r[m, u]:
t[c, u] = False
... | 0 |
1d6e044cf69fe211fb5e74b6f85d6a0b | 87ca14b8c2bd915233877ab3576d2a3e | 获取skip参数 | $skip = intval ( $skip );
$this->skip = $skip ? $skip : $this->skip;
return $this->skip;
} | 1 |
617bf90f7faf9d6230ea99a9a35aa6a4 | d41963146e9c2e1221f574e3a693985b | Validate whether the type object is a valid NUnit test suite. | {
return type.IsClass
&& type.IsPublic
&& type.CustomAttributes.Any(x => x.AttributeType.Equals(typeof(TestFixtureAttribute)))
&& !type.CustomAttributes.Any(x => x.AttributeType.Equals(typeof(ExplicitAttribute)))
&& !type.CustomAttribut... | 1 |
5b75cc068623119800ce96c575721d9e | 6c2a94763aa6d9d3732bb15b8d19fe5b | Gets all Web Hosting Plans in a current subscription and Resource Group.
(see http://msdn.microsoft.com/en-us/library/windowsazure/dn194277.aspx
for more information) | {
return Task.Factory.StartNew(s => ((IAppServicePlansOperations)s).ListByResourceGroupAsync(resourceGroupName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
} | 1 |
11fe3c156c94bdd51982749d60bc4ff5 | f40ef150d134af645ca43ca7ad66dfbb | Получить текст песни из БД | class ArtistDataMySql extends SimpleTableDataMySql
public function textDataGet ($artist_id, $language_code)
{
if ( $artist_id == 0 || $language_code == '' ) return '';
$q = "SELECT * FROM artist_text WHERE artist_id = ? AND language_code = ?";
return pdoQueryAssocFirstRow($this->m_dbPDO, $q,... | 0 |
6b70563c6a3611267cc38eec0b169352 | 1797a85ebc81298b8284c71fb0c7589d | Setter for context_name property. | public void setContextName(String newContextName); | 1 |
a4c80e73a31f8d61ef1c5a5880132cbe | f9ab8381236e10c9435c28d0b6cb56e2 | 自动获取 OSS 的图片原始地址,如果 OSS,自动会识别原图地址 | class OssHandler
public function getOriPath($path)
{
if (!$pare_url = parse_url($path)) {
return $path;
}
$zip_path = $pare_url['path'];
$cdn = config('filesystems.disks.oss.cdn');
$cdn = rtrim($cdn, '/\\');
$ori_path = Redis::hget(OssHandler::OSS_ORI_IMAG... | 1 |
d301bb2adde73cd88e44c59e89567103 | b6f53d7c4ab18b06c845dbc83d9b66a5 | function to find nearest prime greater than the users number | num = mynum+1
while True:
isPrime = True
for i in range(2, math.floor(math.sqrt(num))+1):
if num%i == 0:
isPrime = False
if isPrime:
return num
num = num+1 | 1 |
6336b446657f18a4d7ad59e1a801727b | 1e5917bb51c10521b9decd934ff4af13 | Obtiene un valor que indica si la casilla está dentro del tablero. | public class Tablero
public boolean existeCasilla(int x, int y) {
return !((x > ancho|| x <= 0) || (y > alto || y <= 0));
} | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.