query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
cb8f8ed1253bb19fb50b34bbe5283dc9 | 309365ea990bf8e6eee067f8040867b5 | testIsFlagPassedYes creates a flag and mimics it being passed. Then, it confirms the flag was passed. | class FeatureToggleHelperTest(unittest.TestCase):
def test_create_override_flag_mask_one_flag(self) -> None:
flags = [FeatureFlag.SAIL_FORMS]
expectedResult = 4
self.create_override_flag_mask_runner(flags, expectedResult) | 0 |
e01c1735118f66449625d291b03ca81f | ed9fd3460c605c77253231110fff36e9 | 跳转到云盘资源下载界面 | function downLoad(){
location.href = "service/uploader/download?wbid=" + encodeURI(params.bmsah);
} | 1 |
774a40afa9f5fabd4603e34c7d7d4659 | 0369aed5e096dfe75794bad1bbd8a07d | @brief Initialize IPC RX FIFO for the stream mode. | void init_fifo(void)
{
fifo_init(&rx_fifo, rx_fifo_buffer, sizeof(rx_fifo_buffer));
} | 1 |
13b646231d33d6c373cbbe96cf726165 | f1b434a4bf45071f28928a5e07bffdd3 | @brief Unlock the FLASH Option Bytes Registers access. | void FLASH_OB_Unlock(void)
{
if((FLASH->PECR & FLASH_PECR_OPTLOCK) != RESET)
{
DATA_EEPROM_Unlock();
FLASH->OPTKEYR = FLASH_OPTKEY1;
FLASH->OPTKEYR = FLASH_OPTKEY2;
}
} | 1 |
2d2fa93c6aab9c09765818722203893c | 782bc6b3c0633aab24a567d64b7a3ff9 | 文件替代,没有目录则会自动创建目录,文件已存在则会进行覆盖 | if (string.IsNullOrEmpty(file))
return false;
byte[] data = Get(name);
{
string dir = System.IO.Path.GetDirectoryName(file);
AppHelper.CreateDirectory(dir, false);
}
AppHelper.DeleteFile(file);
using ... | 1 |
bcfe526883d861e6d2ba30599b0ea8d6 | 6db2519f3a60c6f957f6c9929c164a51 | деление на минимальный | int MCD(int min, int mas)
{
while(min!=mas)
{
if(min>mas)
min-=mas;
else
... | 0 |
c850cd4ff8c064b53cfc485cdf339eae | 07a946a71428a0bbf1dd9aaf8e821187 | Returns all the arrivals for a station for the current local time
CAUTION: This makes 2 API calls | class ICapTravel(IBaseCap):
def iter_station_departures(self, station_id, arrival_id=None):
raise NotImplementedError() | 0 |
5e3c9c81aa39db4ca7ea0970e2653b4c | 4e015ffb6b0f92428b59efb25a535130 | Lists all Visit models. | class ApiVisitController extends Controller
public function index()
{
$visits = Visit::all();
return VisitResource::collection($visits);
} | 1 |
fa977d12e9b681742f2b45bbfc92d2bf | 05803176d9066c86738edc7a5ab79624 | lowercase all mime_types. | public class RewriteHtmlStage implements Pipeline.Stage<Jobs>
private static String getMimeType(String contentType) {
int typeEnd = contentType.indexOf(';');
if (typeEnd < 0) { typeEnd = contentType.length(); }
return Strings.toLowerCase(contentType.substring(0, typeEnd));
} | 1 |
574ac7b5e8185c9307e74395ea90648c | 7129df66147a8eb264bedaac3538a911 | リレー接続中の視聴制限タイマー満了時に通知される | public class PassiveRecordBaseListener implements PassiveRecordListener
@Override public void exitLimiting(PassiveRecordParser.LimitingContext ctx) { } | 0 |
658a1ff814e3cd7933fc4cd1159783e4 | 2f83ad33d2c8fe8fad5b2eb1ea182cff | Loads CPlayer data | {
LPDIRECT3DDEVICE9 pDevice = CRenderer::GetDevice();
CPlayerLoad *playerLoad = new CPlayerLoad();
playerLoad->Load(CSocket::GetID());
m_Part = playerLoad->GetParts();
std::vector<CMotion*> motion = playerLoad->GetMotions();
for (int nCntMotion = 0; nCntMotion < STATE_MAX; nCntMotion++)
... | 1 |
ff074e24fd4299595ed29fff23b148cc | fce66f3995d2f02240fcab83cdf28175 | @brief 初始化网关监听 | int
gate_init(struct gate *g , struct uboss_context * ctx, char * parm) {
if (parm == NULL)
return 1;
int max = 0;
int sz = strlen(parm)+1;
char watchdog[sz];
char binding[sz];
int client_tag = 0;
char header;
int n = sscanf(parm, "%c %s %s %d %d", &header, watchdog, binding, &client_tag, &max);
if (n<4... | 1 |
77c217d72333f98414ed254889615368 | ba977298f71e4826626096c0670ab8fa | An implementation of saving to imitate arbitrary latency. | void save_page( const std::string& url ){
std::this_thread::sleep_for( std::chrono::seconds( 2 ) );
std::string result = "fake content";
std::lock_guard< std::mutex > guard( g_pages_mutex );
g_pages[ url ] = result;
} | 1 |
b5bf168e056444f1beb8fcaf978be45b | a7b58f3c3b48c39434fcdac8ae260333 | 初始化口味组 | void IcePopStepLayer2::initMoule()
{
m_vTypesTaste.clear();
Sprite* brush = Sprite::create(__String::createWithFormat("images/ice_pop/2/moule/brush%d.png",G_IcePop_MouleNum)->getCString());
for (int i = 1;i<17;i++) {
__String* str = __String::createWithFormat("images/ice_pop/2/taste/%d.png",i);
... | 1 |
006b2a313db3028a33b088bf49c5fb5e | 242748bf542ea0c2405eb422934a54f1 | Get the buffered reader object from the file | public class ReadCsv
public BufferedReader getReader() {
return in;
} | 1 |
c2aee7179e7c1379f7589a9919e70f03 | 80fa5f847e806f4b94eff6d013b7c5c8 | 控制显示一般兼职或者是勤工校招兼职 | Class TemporaryWork extends CI_Controller
public function temporaryWork() {
if (isset($_SESSION['user_id'])) {
if ($_SESSION['level'] <= 0) {
PublicMethod::permissionDenied();
}
$common_worker = $this->Moa_user_model->get_all();
for ($i = 0; $i < count($common_worker); $i++) {
$uid_list[$i] = $com... | 0 |
948288026a8a9a11758c06eb03a4f243 | 633452cf7f09a5c56eb1c3a88c1266af | 编辑被选中的记录 | grid.stopEditing();
Store store=grid.getStore();
for(Record record:records){
Long recordId;
try {
recordId = Long.parseLong(record.getId());
} catch (Exception e1) {
recordId=0l;
}
if(recordId>0){
removedRecord.add(record);
}
store.remove(record);
}
removeRecordsButton.setDisable... | 0 |
b2d47090d006848b93761fbd7b40a67b | 3bf17c1e1fefa3a8d4da20b53a0810e4 | Check if any of the listening IDs are equal to the event ID and trigger the event | {
int eventid = -1;
if ((eventid = EventManager.GetEventID(eventType)) != -1)
this.Trigger(sender, eventid, eventArgs);
} | 0 |
9ea18d48d039f28428024d5dbe395166 | 2537d66c5b7ae03e8ca84fd8384b7b56 | Creates table used to store logs. | {
$this->db->exec("CREATE TABLE log(
id integer PRIMARY KEY autoincrement,
urls varchar(200),
ip varchar(200),
datetimes datetime default (datetime('now', 'localtime'))
)");
} | 1 |
19c27b0629ed67cb3faed3837d1694df | 94a82fedd96ea3d9cef45ddb64e5c037 | Reverts the effect of a previous call to gtk_widget_freeze_child_notify().
This causes all queued #GtkWidget::child-notify signals on @widget to be
emitted. | @GtkDsl
abstract class Widget
fun thawChildNotify(): Unit = gtk_widget_thaw_child_notify(self) | 1 |
ab206333bd3ac88f9d44698fefd6fcda | 1f2040c8c958e35da90807dd6cae7d3c | SI no hay proyectos al arrancar, creamos 3 para hacer pruebas. | {
$supervisores = DB::select("select u.id as id, u.name as usuario
from users u
inner join roles_tipo r on (r.id = u.id_roltipo)
inner join roles ru on (ru.id = r.id_roles)
where ru.title = 'Supervisor' or ru.title ='Administrador'");
$arrsupervisores = [];
fo... | 0 |
d23268ba0057d55fdf70e7190c452183 | 4597ec2ce39029dcdc98abbfd5d8bbb7 | Check that the current tile has all edges that are expected based
on the adjacent tiles (surrounding edges).
Additionally, collect information on corresponding edges, that can
be used to determine what transforms are needed to bring the tile into
desired orientation. | if self.oriented:
return False
top_transforms = {
Tile.TOP_FWD: Transformation(),
Tile.TOP_BWD: Transformation().flip_horizontally(),
Tile.RT_FWD: Transformation().rotate().rotate().rotate(),
Tile.RT_BWD: Transformation().flip_horizontally().... | 1 |
9b2d8f7ed21a34f7bcbf3f5c36b46de5 | ce0ae02ec1289c23acab42f76b95f441 | Retrieves the configuration information for this site and checks
that the expected paths are all defined.
Will raise KeyError if an expected path has not been defined | class SiteMoveVerifier(Component):
def _expected_config(self) -> Dict[str, Optional[str]]:
return EXPECTED_CONFIG | 0 |
9f60e17b6c59dd2fe85591a8f1a661d5 | f0fd22d80cdff892bc900669c8a68e01 | Returns true if animations are enabled. | @SideOnly(Side.CLIENT)
public class FeatureDisableAnimation extends Feature
public static boolean animationDisabled () {
return disableAnimations;
} | 0 |
25cc2d8d931f05a8132caaa1b42b3694 | b98bc4e29df38966b95c7bceae123070 | shows error message and list of files with wrong checksum | class serendipity_event_autoupdate extends serendipity_event
function showChecksumErrors($version) {
global $serendipity;
$updateDir = $serendipity['serendipityPath'] . 'templates_c/' . "serendipity-$version/";
$checksumFile = $updateDir .'serendipity/checksums.inc.php';
include_once ... | 1 |
683fb63bc90c5d341003174f5e0e4843 | 696cc6a39df8664857367cb837c09196 | Graba en el archivo una l�nea con un dato num�rico sin decimales (int, long) | bits = unpack("!I", pack("!f", datum))[0]
fo.write(chr((bits) & MASK))
fo.write(chr((bits >> 8) & MASK))
fo.write(chr((bits >> 16) & MASK))
fo.write(chr((bits >> 24) & MASK)) | 0 |
d3d12e354f5de09caf08279b5eea6323 | e9dd2a5270c53635620a0830abdc3017 | 获取识别结果的区域坐标。数组包含 4 个元素 [x1,y1,x2,y2],依次表示区域左上点、右下点的横纵坐标。 | if (resultPoints != null && resultPoints.length == 4) {
float left = Float.MAX_VALUE;
float top = Float.MAX_VALUE;
float right = Float.MIN_VALUE;
float bottom = Float.MIN_VALUE;
for (PointF pointF : resultPoints) {
if (pointF.x < left) ... | 0 |
c09044d7eb1a9b8be6af13188dfef9bb | ab4611a4bff6c042bc7d85d327596ba7 | find the average encoder valuse of both right motors | public class DriveSubsystem extends SubsystemBase
public double getAverageEncoderDistance() {
return (leftMaster.getSelectedSensorPosition() + rightMaster.getSelectedSensorPosition()) / 2.0;
} | 1 |
74adf0761f20d0a999dc136e5b91f4f9 | 0b601769813d71627608e977a8c2aa01 | 変更前を設定する。 | interface Config : ItemContainer
fun beforeSet(beforeSetFunction: (item: Item<*>, value: Any?) -> Unit): Handler | 1 |
6d76a25697150b1db1db2eb8cfa6ee6a | d53039b5cb625ae07a2166b759d85bcb | Method to check the if the field is a currency field | if(null != _customField && CustomField.NUMBER_CODE.equals(_customField.getTypeCode()) ){
return true;
}
else{
return false;
}
} | 0 |
618986bfe1ea92cda798adb128ef4fa1 | e9fbace1c0c34433ff571061b886f33b | Remove all resource pools. | {
foreach (var p in pools.Values)
{
p.UnSpawnAll();
}
} | 0 |
540ded9c9929f1ac13d8d3a36a0ac8cb | 87e70c7d7a84cd63cca626d6871c6b7b | https://dom.spec.whatwg.org/#dom-node-issamenode | function isSibling(a: Node, b: Origin): boolean {
return b instanceof Node
? a.parentElement === b.parentElement
: a.parentElement === b.node
} | 0 |
383bdfe25061c6747740d4850cf700aa | 07bf941411eac8c9e56ab09d9069a111 | Gets the value of electrical power at the settlement. | double getReactivePowerpall(); | 0 |
1722ae74726268e3560f5b4adedcd9e7 | ad9bbcbc6c816f3b8b7ba94408fd5615 | Enter a parse tree produced by {@link Protobuf3Parser#reserved}. | public class HTTPMessageBaseListener implements HTTPMessageListener
@Override public void enterUnreserved(HTTPMessageParser.UnreservedContext ctx) { } | 0 |
4e162f6034d8744be2e60e69c1fdea43 | e5e1c5bb2f411887a588b2689f5f7eb4 | Run an iterator function that might throw an exception. Call the callback with the exception
if it does or null if it finishes without throwing an exception. | try {
runThis()
} catch (exception: Exception) {
val contains = exceptions.find {
it.isInstance(exception)
}
if (contains != null) catchBlock(exception)
else throw exception
}
} | 0 |
5000c86d90414f36cefbecb6f88431ec | 3c1d6832d650e27421a72a7764e226e7 | Obtener los custom fields de ACF, dependiendo de el lengaje actual. | function d7_add_acf_to_json_api_v2($object, $field_name, $request){
if ( function_exists('get_fields') ) {
return get_fields($object['id']);
}
} | 0 |
fa1d18076a28aeed788df6e08c3c6b39 | 2a6fbe59a540ba3fea8dca0655465794 | Permet d'avancer un horaire lors d'une modification d'horaire | $sql = "UPDATE creneaux_bis SET jour = ?, heure = ? WHERE id = ?;";
$stmt = $db->prepare($sql);
$stmt->execute(array($jour, $heure, $creneau_id));
} | 0 |
cf8059e5e0976b65cb0a532bcad28a5a | 5837d0697f5ad8b88cc58aaaecd0e3a5 | ボールの削除と落下アニメーション | public class MainActivity extends Activity
class MyAnimationView extends View
@Override
public boolean onTouchEvent(MotionEvent event)
@Override public void onAnimationEnd(Animator animation)
{
balls.remove(((ObjectAnimator)animation).getTarget());
} | 1 |
36c5f98387c9e0a017ba3c2456c64d63 | ce1f16b653cbf09a885878f9dfa1e8dc | IsErrorResponse checks if the message holds a standard JetStream error | if err != nil {
var aerr awserr.RequestFailure
if errors.As(err, &aerr) {
return aerr.StatusCode() == http.StatusNotFound
}
}
return false
} | 0 |
e03e33598a0b0b7de1e64706185364be | 97c43966d0ea766fd086c4f916613f6a | Garbage collection removes the unresponsive neighbors row from the routing table | namespace NetTrafficSimulator
public class RoutingTable
public void DeleteRecord(Record r){
Record test;
if (bestRoute.TryGetValue (r.Address, out test)) {
if (test == r) {
if (!test.Expired)
activeRecs--;
bestRoute.Remove (r.Address);
}
}
} | 0 |
71aa401dc9945873751197e6f234f819 | 67528388461a2836414f2e9ea8715b89 | Deletes an object Cntry from database | namespace MorseCodeHelper.Lib.SqlDataManagement
public partial class SqlDataManager : IDisposable
public int Delete(Country country)
{
SqlConnection conn = this.CreateSqlConnection();
try
{
this.InitializeConnection(conn);
SqlCommand cmd = ... | 1 |
d17074bedf7b93dd096e30af6858ad9f | bedd1413f04f6fd5731003d99cbfe751 | Queue to hold and send all outbound messages. | public class ChatUnit extends DataObjectCommon
public LinkedBlockingDeque<DbChatMessage> getOutQueue() {
return outQueue;
} | 1 |
0a5854db71eacedfa8bb8ad285ea3d89 | 68a6ab23cefb7427fb1bfa29806a16c3 | This method parses the given response and returns chart of
accounts object. | Gson gson = new Gson();
UserAccountResponse userAccountResponse = (UserAccountResponse) gson
.fromJson(jsonResponse, UserAccountResponse.class);
return userAccountResponse;
} | 0 |
b63b596a9143014a6a357d4fa2bdd7b3 | 7d1f7cf89dd3a2a89b4857f046224ab8 | @brief 고정된 크기의 오브젝트 풀을 만들고 타입별 분류를 위해 배열형 리스트를 타입수만큼 만든다. | namespace Chasa
public class PoolObjects : MonoBehaviour
public void CreateObject(string object_name, GameObject object_pf, int object_num)
{
GameObject parent = GameObject.Find("PoolObjects");
GameObject tempParent = new GameObject();
tempParent.name = object_name;
... | 1 |
3df2d4be93a6ea4a49ba1b3118f949e9 | dc272339af4265b3a5d7478bfd296ccf | Decodes a base64 string (formed by long_encode) into a long | public class Encrypts
public static long r62StringToLong(String r62String) {
String r62str = r62String;
long result = 0;
boolean negative = false;
if (r62str.indexOf('-') == 0) {
negative = true;
r62str = r62str.substring(1);
}
for (int index = 0; index < r62str.length(); index++) {
... | 0 |
e8b267c5a99a5a3c429054ed367b865a | 752634e9f67fe30971f6bb2e289433a2 | 获取出库单号. | @Table(name = "tbw_rollover_order")
public class RolloverOrder
public String getOutWarehouseId() {
return outWarehouseId;
} | 0 |
04fff871904834bc87b32d7bd029abae | 3165065b16fd4ee7b529d64b09143e38 | Get logical bit from physical bit | bool bit = false;
size_t iLimb = iBit / limbBitSize;
if (iLimb < limbs_.size()) {
bit = (((Limb)1 << (iBit % limbBitSize)) & limbs_[iLimb]) > 0;
}
return bit;
} | 1 |
d090b68aa44b1d4e0bd0470c39de83dd | cb690ca52bbc1e61ebd72cb48b17e8eb | sorts the words based on their part of speech; some go in multiple arrays | for(int i = 0; i < wordList.size(); ++i){
if(!wordList.get(i)[2].equals("OTHER")){
String[] temp = wordList.get(i);
int j = i+1;
while(j < wordList.size() && wordList.get(j)[2].equals(temp[2])){
j++;
}
if(i == j-1){
wordList.get(i)[2] = "S_"+temp[2];
}
else{
wordList.get(... | 0 |
5b213943ff450c83649813cd3cfc2996 | f40dbfed0496befa09c4ebb4ef2bde03 | OR between 2 IndexList objects. What it does is take 2 IndexList
objects and OR's each element in the first and second list
respectively. | final ArrayList<Object> combined = new ArrayList<>();
if (firstList != null) {
combined.addAll(firstList);
}
if (secondList != null) {
combined.addAll(secondList);
}
super.setSourceList(combined);
return super.createInstance();
} | 0 |
09d25f069569577dc7ca885263f298a4 | 83e06204961c06470c5d348daa7e0649 | 6A Calcular un �rbol de expansi�n m�nima (MST) con criterio distancia,
utilizando el algoritmo de Prim, aplicado al componente conectado (subgrafo)
m�s grande. | Agm Prim::getAGM() {
std::vector<std::vector<std::pair<int, int>>> adjacencyList(n_);
for(int i = 0; i < m_; ++i) {
const Edge& e = edges_[i];
adjacencyList[e.getA()].push_back(std::make_pair(e.getB(), e.getCost()));
adjacencyList[e.getB()].push_back(std::make_pair(e.getA(), e.getCost())... | 1 |
afa9756b91d6db98c8ba3388628fe4a1 | 526ffa47eb7e3da7ca3e6ddd04d93ee9 | calculates ambient occlusion value for a vertex | float NdH = clamp(dot(N, H), 0.f, 1.f);
float HdV = clamp(dot(H, V), 0.f, 1.f);
float r2 = roughness * roughness;
float d = r2 / (pi * square(NdH * NdH * (r2 - 1) + 1));
return (d * NdH) / (4 * HdV);
} | 0 |
da6a450c30e48259479013d00ee4608f | 43be2592bca16d99f91de5146185b221 | Adds the Ness framework services to the application while
also pulling the application settings from the configuration. | {
$service = $this->getService();
$this->setFrom(sprintf('node:%s-alpine', $service->getOptions()['version']));
$this->applyWebServiceConfiguration();
$this->applyShellConfiguration();
if (true === $service->getOptions()['dotfiles']) {
$this->applyDotfiles();
... | 0 |
03b0e98e7236d5260d68041ec1a47c70 | aa3ca4ecc75da0371ed7e0335dec93c1 | Populate Exams Data | class HomeFragment : ToolbarFragment()
private fun getExams(){
GlobalScope.launch(Dispatchers.Main) {
ExamRepo(getRoomDao()).fetchExams()
.catch {
Log.d("Ryan",Log.getStackTraceString(it))
}.collect {
examAdapter?.setData(it)
... | 1 |
877295f9c9ca88b4421254bee5b8b7ce | 9b177bd5fafa0c96c081f3a5869ed7d6 | 绝对值表示设置点数,增多补0,减少截取,正负号表示设置方向 | {
if(len <= point_pos)
{
len = point_pos;
opra[point_pos] = '.' - '0';
}
else
{
char tmp[126];
memset(tmp,0,126);
tmp[point_pos] = '.' - '0';
memcpy(tmp,opra,point_pos);
memcpy(tmp + point_pos + 1,opra + point_pos,len - point_pos);
len ... | 0 |
884c4676c2390812f5400cb8c06e2379 | 97033894cad69da37b41fb7ac9a969f3 | cityオブジェクトが持つすべてのpathnum
このオブジェクトで管理されているcityオブジェクト
が保持するpathnumを返却する.
Returns | class CitySet:
def get_pathnum_all(self)->List[int]:
return list(self.pathnum_city.keys()) | 1 |
57e5abc7638b96207375d2df9c332a1e | b7b4dfc6cdb0eb8666d0f7bed9e76a5c | Oculto el precio del producto. | class ProductosController extends Controller
public function show(Categoria $categoria, Producto $producto)
{
$preciopromocional = ($producto->precio - (($producto->precio * $producto->descuento) / 100));
$producto->preciopromocional = round($preciopromocional, 2);
return view('prod... | 0 |
6266d9bb96d8203a2f15aef56ede6dc9 | 33d74550ae1ab7c9be9dc2a2ece85615 | Compares the department type of two Employee objects. | public int compareTo(Employee e) {
if(this.getEmail().equals(e.getEmail()) ) return 0;
return 1;
} | 0 |
426203b565b7f80c17ef627e7bbb5f75 | f8015c007bb580cafe671fab972714a5 | Tests that `_containerHas()` works correctly when using integers to check for numeric string keys in `stdClass` objects`. | $id = 1;
$model = $this->_modelName;
$methodName = $this->_methodName;
$result = $this->$model->$methodName($id);
$this->assertEquals(['Container', 'Box', 'Page'], array_keys($result));
$this->assertEquals('1', Hash::get($result, 'Container.id'));
$this->assertCount(1, Hash::get($result, 'Box'));
$this-... | 0 |
7d4a8a67f446c143b9491f8ad3d78381 | d6387e3a6eb7d6b5160eca427578a0e7 | make sure all code is checked in -- fail if it's not | stage("CodeChecker analyze:")
env = {
"CC_ANALYZERS_FROM_PATH": "1",
"PATH": "/bin:/usr/bin",
}
logging.debug("env: %s", str(env))
command = "%s analyze --jobs=%d --skip=%s %s --output=%s/data" % (
CODECHECKER_PATH,
multiprocessing.cpu_count(),
CODECHECKER_SKI... | 1 |
dd861756e6c4fbfc588f1b436712961b | ecc4e2c7b8ad6e8b231b6e8b4e62c41f | Format dictionary data into InfluxDB string for upload | class LoggingClass(LakeDataLoggerBase):
def dictToLine(dataRecord):
s = dataRecord['date']+', '+dataRecord['satellite']
for k in dataRecord:
if k in ['date', 'satellite']:
continue
v = dataRecord[k]
if v == False:
s += ', '+k+', NA, N... | 0 |
136615424c9828e4389c54ae9c751e60 | 4b291b89c41572ad80605a5fc7447b56 | иммитация кнопки добавления элемента в грид | public class Controller
public void buttonAddRowAction() {
items.add(new TextRobot(""));
} | 1 |
eb6e4d28dc346863656b0f92c9d12399 | c8862882d211a5831d19032b4e3d7054 | a student must have a first name | class CommuniqueUserCreationForm(UserCreationForm):
def clean_first_name(self):
first_name = self.cleaned_data.get('first_name')
if not first_name:
raise forms.ValidationError('The user must have a first name', code='invalid')
return first_name | 1 |
5aab2ef0ccfcd3a1650629b31b208be6 | 58fdb5190a5f70f73b0ea565c04376d1 | A convenience function used to set the upper and lower bounds in one call. | class RV(object):
def set_bounds(self, lower, upper):
self.pf._rvs[0][1] = lower
self.pf._rvs[0][2] = upper | 1 |
b07003b87d92b4373776fe2297008010 | 573d455f6bf0d6d90df048fe9548a1fa | 添加几何点到指定索引处 | namespace EarthView
namespace World
namespace Spatial
namespace Geometry
public class LineString : EarthView.World.Spatial.Geometry.Curve
public virtual uint Add_NoVirtual(EarthView.World.Spatial.Geometry.Coordinate coord, int index)
{
uint ret=EarthView_World_Spatial_Geometry_CLineString_add_ev_ui... | 1 |
24f455c8a3dc940082f2ad045cd65181 | b09f64ce727674971664635f58e8c6a2 | Selecciona el par de progenitores de acorde a los dos métodos disponibles. | def select_parents(pop, pop_fitness):
turnament_candidates_idx = random.sample(range(0, len(pop)), TURNAMENT_SIZE)
candidate_fitness = []
for n in range(TURNAMENT_SIZE):
candidate_fitness.append( pop_fitness[ turnament_candidates_idx[n]] )
best_candidate_fitness = max( candidate_fitness )
ca... | 1 |
c8774a7f3f64dddfe4ee2db9623fbfbf | 22c8b31a22bd20ee79e516d32d7a4c1b | 获取部门年度工资统计信息 | List<SalWorkerIncomDetailsBo> incomeYearDetails(SalIncomeYearDetailsForm salIncomeStatisticsForm); | 1 |
adb0bb95234ea6fa94fd148ab7950a74 | 125f931f4bb7f9f1acba99f5c4776bab | adapted from: https://stackoverflow.com/a/2533142 | function copyTextToClipboard(text) {
var textArea = document.createElement('textarea');
textArea.style.position = 'fixed';
textArea.style.top = 0;
textArea.style.left = 0;
textArea.style.width = '2em';
textArea.style.height = '2em';
textArea.style.padding = 0;
textArea.style.border = 'no... | 1 |
9a0126df3f2bbad379f5ba6a60b97e71 | 61c5abea93ab8a2808a485f200679ddf | Update the notification dismissal option | if ( isset( $_POST['type'] ) ) {
$type = sanitize_text_field( wp_unslash( $_POST['type'] ) );
update_option( 'dismissed-' . $type, true );
}
} | 1 |
edb6f08ab66d277a25635bcf0c32b105 | 2ee7bf36f59100ac8d8b3eadaf391384 | Funkcija za zamjenu dva stupca generirajuce matrice | {
Matrica modificiranaMatrica = this.VratiKopiju();
for (int k = 0; k < brojStupaca; k++)
{
modificiranaMatrica[i, k] = this[j, k];
modificiranaMatrica[j, k] = this[i, k];
}
return modificiranaMatrica;
} | 0 |
63a13d8d26e6a73ec335c3bd60fcabff | 73f12b5b87c36824a360e7b82dbc47ac | Save contact list | {
foreach (KeyValuePair<uint, vk.profile> item in vars.VARS.Contact)
myContactList.ContactList.Items.Add(item.Key);
myContactList.ContactList.FinishUpdate();
} | 0 |
37aee9574f9150729a68f08ab7491649 | b54a11a82516afb41902a63ee0ec4d56 | Devuelve como arreglo el valor del campo lista_tablas | class CatCuestModulo extends ModeloBase{
public function getArrCmpListaTablas(){
return $this->arr_lista_tablas;
} | 1 |
0357718358d7b03ace15457f5f5b7651 | 5131458663cdf842e0674477f40bc007 | Сохраняет файл, возвращает путь к нему | function save_file(array $lot_img): string
{
$file_name = $lot_img['name'];
$ext = substr($file_name, strrpos($file_name, '.'));
$link = '/uploads/'.uniqid().$ext;
move_uploaded_file($lot_img['tmp_name'],
substr($link, 1));
return $link;
} | 1 |
29bd9cb9ccde558c971fd11b24fd8c54 | 9413c6df3dee8ab9e6596b96380c372a | 为单个角色授权 | @Slf4j
@RestController
@RequestMapping("/api/systen/account/role")
public class SystemAccountRoleRestController extends BasicsRestController
@PostMapping("/authorize")
@RequiresPermissions("56474559620055040")
public APIResult<Object> authorize(String accountRowId, String roleRowIds) {
if (StringUtils.i... | 0 |
21a03893530fcadb2e13d09f3c6ed2ca | 8871897fef9de9b073060bd00e66cb79 | Return a true Python function based on this function/code object | class Action(object):
def get_function(self):
return (lambda: self.action[0](*self.action[1], **self.action[2])) | 1 |
e5464f4df429a02bdc1d3f1c3eac480a | 977c23098ac6aff2be7095fc4a412195 | Removes a Java to IANA encoding name mapping. | namespace RestSharp.Portable
IRestClient RemoveEncoding(string encodingId); | 0 |
aef77c063d21819b05ced7b7127f0618 | 40a6883572ddccc14e31fb372af523e9 | Returns a `torch.Tensor` representing the prediction matrix. | class TrainStateProtocol(Protocol):
def predict(self, input: torch.Tensor) -> torch.Tensor: | 1 |
b88b1f8b6e5e38d25608c005c7ccae6b | a08dab6ec35fdf475e9f644b7e4cfd2d | usuń obramowanie pola | if ($('.textSafety').attr("disabled") == "disabled")
return;
var value = $("#" + id).parent().parent().attr('value');
$("#" + id).parent().parent().detach();
event.stopPropagation();
} | 0 |
60550e8fd2fa1f8cba268911650d6559 | f538c44057af55c2bde97c3d253cbb1d | openweathermapから緯度・経度を用いて天気情報取得 | openWeather_request(void)
{
static char data[256];
static char lat[10];
static char lon[10];
os_sprintf(lat, "%d.%d%d", configs.meteo.latit / 100, (configs.meteo.latit % 100) / 10, (configs.meteo.latit % 100) % 10);
os_sprintf(lon, "%d.%d%d", configs.meteo.longit / 100, (configs.meteo.longit % 100) / 10, (confi... | 1 |
5946fb0c4567b2345a5fc9a16f42b76f | 5782bcfd1f86174d013eb366f5d82e92 | Döljer/Visar svaret på fråga 3 | public class Application{
public String getAnswer3(){
return this.ans3;
} | 1 |
dff95e5fecbb8847d6195f38368a4b3d | 79975335e43ec81a5e083b13591c1cf9 | draws from current to new by direction and number of steps | {
steps_so_far+= num_of_steps;
digitalWrite(dir, REVERSE_DIRECTION);
for(uint32_t i= 0; i<num_of_steps; i++)
Stepper_step();
} | 1 |
861cc3d1baf903ab86748e5e0c00e2fc | c555308c6086e63cde52db18cd69616a | Returns number of boats per boat type | def ships():
ships_dict = {"carrier": 4, "submarine": 3, "frigate": 3}
return ships_dict | 1 |
079e7ba327b129fe985b21725a457983 | f5c347a59ec9a179a6c375d0e33c6d28 | Load the extension tree so we can correctly invalidate caches. | class PermissionsCacheWarmer implements CacheWarmerInterface
public function warmUp($cacheDir)
{
$this->treeBuilder->getTree(true);
} | 1 |
c5998e1e359220470e58babd381bfa15 | 953a2aef19702730b81ed8c1ac70226d | Retourne les horaires futurs d'un utilisateur | $pssHoraire = maConnexion()->prepare("SELECT idHoraire FROM disponible WHERE idUtilisateur = :id");
$pssHoraire->bindParam(':id', $idUtilisateur, PDO::PARAM_INT);
$pssHoraire->execute();
return $pssHoraire->fetchAll(PDO::FETCH_ASSOC);
} | 0 |
1cb6e2ce0d8f5f82b82b6175b5f54bb2 | 62e6a5b0469e0d09ca9a948287644922 | <p>specKbn を取得します。 | @Bean(table="受注B")
public class Juchuu_B
public String getShouhizei_kbn() {
return shouhizei_kbn;
} | 0 |
0e6152bb9d1be104eab9e93d8b160f51 | a0f8d8ea050159e7e5d6a62d2c623524 | Hide the overlay with the enabled bookmarks on it. | namespace SampleBrowser
[Activity(ConfigurationChanges = Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
public class CustomToolBarPdfViewerDemo : SamplePage
internal void CollapseBookmarkToolbar()
{
if (isBookmarkVisible)
{
... | 1 |
568c9b9cc3705597e4f56b591d76d689 | f0e42a7525a03c5589f16378883741a8 | 打开所在房间的设备 | class Index extends BasicBaby
public function device()
{
$uRoomId = $this->request->get('room_id');
$uGiftId = $this->request->get('gift_id');
$uPrice = $this->request->get('price');
Log::info("device: uRoomId= " . $uRoomId);
session('room_id', $uRoomId);
$userId = se... | 1 |
b0905415a8d6ee7d0dcfde7552960a9b | 2ceeca061f3a8607acc23c80de23730f | checks validity of an ini section name | {
__ASSERT_DEBUG(aSection.Length() <= KMaxIniDataSectionNameLength, User::Panic(KSpecAssert_ElemCommsFwcftl, 1));
__ASSERT_DEBUG(aVarName.Length() <= KMaxIniDataSectionNameLength, User::Panic(KSpecAssert_ElemCommsFwcftl, 2));
TBuf8<KMaxIniDataSectionNameLength + 2> sectionToken;
TInt sectionStart = 0;
TInt sec... | 1 |
32bd6a737f8c0d9254c1aa1f0a45f2e0 | 604faa36a2c630e7255c648c5852b4ff | Turn off pushing entities to the cloud using SPARQL. | public class RcsApi
public static int disablepush(RcsState state, Callback callback){
int sid = nativedisablepush(state.statePtr());
if(callback != null){
state.addCallback(sid, callback);
}
return sid;
} | 0 |
823b6531b6608ccdf13d62fc518b613d | d96cbc5729f28b743cbfe15c0cebaa7f | mafValidator should fail when sequences ranges go outside of source length | Range.objects.create(
start_str="fe6:4:5::",
end_str="fe6:4:55::",
network=self.s2,
ip_type='6',
)
Range.objects.create(
start_str="fe6:4:60::",
end_str="fe6:4:63::",
network=self.s2,
ip_type='6',
... | 0 |
2018e033fcbcbbc4fae2378a0615ecd3 | 2a6a34c99415377b965099b6d379131b | Метод проверки отправленного токена пользователя
Объявлен как protected для тестов | abstract class Auth
public static function checkToken(string $token): bool
{
throw new \BadMethodCallException('checkToken() is Unimplemented');
} | 0 |
5992141da45134dbb27d85b9f8b2787d | d880fe4e2bde7e07d63007d05a126ed9 | only climb when touching a ladder | {
if (!myFeetCollider.IsTouchingLayers(LayerMask.GetMask("Climbing")))
{
myAnimator.SetBool("isClimbing", false);
myRigidbody.gravityScale = gravityScaleAtStart;
return;
}
Vector2 climbVelocity = new Vector2(myRigidbody.velocity.x, (moveInput.y *... | 1 |
19ee40b22d038f6128c1f36b6504b76d | b4b6e2b7f81b596c426d4ac9746b8826 | Set CSS hash. | public class HTMLAnchorElement extends HTMLElement
public void jsxSet_hash(final String hash) throws Exception {
setUrl(UrlUtils.getUrlWithNewRef(getUrl(), hash));
} | 0 |
bf7f2bafc029a53e30745d3914f164d9 | c45f90052018cc267c133099def2e161 | 轮盘赌选择操作 | int k, i, selectId;
double ran1;
for (k = 1; k < scale; k++) {
ran1 = (random.nextInt(65535) % 1000 / 1000.0);
for (i = 0; i < scale; i++) {
if (ran1 <= Pi[i]) {
break;
}
}
selectId = i;
... | 1 |
e11c7671d8522db85b0916c3d3244478 | 702f00758a62b7c967554c86aad0afdf | Funcion que desabilita el boton del formulario | function disableButton(){
const butt = document.getElementById("send");
butt.disabled=true;
} | 1 |
8bb5231a6734b4412c5093841cf3403b | 520a75e1f0cb16c6d3b583624e3527aa | Gets an npc definition by its id. | function get_npc(name)
{
var npc = parent.G.maps[character.map].npcs.filter(npc => npc.id == name);
if(npc.length > 0)
{
return npc[0];
}
return null;
} | 1 |
60af5b5ea1df93b9795f50c00cf797be | 47cc85261e017837646ddac47fefb2f8 | function to update the sunset time | void sun_set(){
sun_spin = sun_spin + 0.006;
sun_spin2 = sun_spin;
sun_color -= (0.7/4417);
if(x<6625.5){
sky_color1 -= (0.6/2208.5);
}
if(x>6625.5){
sky_color2 -= (0.85/2208.5);
}
} | 0 |
07f0b418c0da5de9e334565d9201098a | 25123489c929a0f333f06279cac2b38c | Toggle the saved value for the selected mount | local setting = this.value;
if (TitanDefense_options[TitanDefense_pname][setting]) then
TitanDefense_options[TitanDefense_pname][setting] = false;
else
TitanDefense_options[TitanDefense_pname][setting] = true;
end
end | 1 |
e5d786f1a2901d63fddae46cf4008e00 | 6d3b767c9cd20d70abcb6ed84ccadb59 | Getter method for property <tt>Contacts</tt>. | {
if (array_key_exists("contacts", $this->_propDict)) {
return $this->_propDict["contacts"];
} else {
return null;
}
} | 1 |
9f60ab91dd4d4e4c38f9ddcbb4d66155 | 88a189dad10ee487bef73131d6bce2d9 | Subscribes to all animation behaviours and component events. | {
EventSystem.StartListening("OnRun", StartRunAnimation);
EventSystem.StartListening("OnStop", StartIdleAnimation);
EventSystem.StartListening("OnJump", StartJumpAnimation);
EventSystem.StartListening("OnFall", StartFallAnimation);
EventSystem.StartLis... | 1 |
871d1f1c948e547d09f5dde49ada1230 | 6d41a6966a9aca85e3220c4731f289d8 | Deletes all repo contents and reclones it from remote. | public class VCS
public static void cleanCloneRepo(String url, File dir) {
cleanDirectory(dir);
cloneRepo(url, dir);
} | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.