query_id
string
corpus_id
string
query
string
code
string
label
int64
0bf516f8b0b90396b33df98d0a7191a5
46ec0f88dd827546acd1cd4c8b56209d
Kişinin yabancı dili ingilizceyse true döndüren metot
public class Student public Boolean hasLang() { if (lang == WITHOUT_LANGUAGE) return false; return true; }
0
4dfbb474d4d6c6dc2a0389fcefea1f03
12887ffe8c864a2eb00c4c8483ca5d77
Returns motifs property.
if motifkey not in self.data.keys(): raise KeyError("Cannot locate motif using accession id '%s'." % motifkey) return True
0
ef6a363435e2ddae6ddb6a8015164a1a
77319f23682d1c93e6fd24d54a0dce6d
Simple high pass filter in time domain as per wiki page
int i; float rc = 1.0 / (cutoff_freq * 2*3.14); float dt = 1.0 / sample_rate; float alpha = dt / (rc + dt); float *buf = malloc(sizeof(float) * n); for(i=0; i<n; i++){ buf[i] = data[i]; } for(i=1; i<n; i++){ data[i] = data[i-1] + alpha * (buf[i] - data[i-1]); } fr...
1
381de6c8cbb786c36c9da28f72b58bc8
25c77a9559b4811c795151f62e2770d1
tests for new note adding form page
class NewComputerTest(TestCase): def test_new_computer_form(self): response = self.client.get(reverse('agileHR:new_computer')) self.assertIn('<input class="form-control" type="text" name="make" id="make"'.encode(), response.content)
0
ee0c41c12d3301ac35848755c361f369
ef2f2418c8c1ca971eb6797ab5250660
Fonction supprimant la sauvegarde
class PoussinController extends Controller public function destroy($id) { try { $user=Auth()->user(); $folder="PoussinRemove/"; $name=uniqid().'-'.date("Y-m-d H:i:s").'-'.$user->name; $filename=$name."."."txt"; $filebackup= new BackUpFermeController(); $value=Poussin::findorfail($id); ...
0
28beb3946b864f22f99e57ced9cfd3f8
b59f5d9045e4519e9a8e53ef1600fe76
SRAIW (Shift right arithmetic word immediate) 命令。
namespace CSPspEmu.CPU.Interpreter public class CpuInterpreter [InstructionName(InstructionNames.Wsbh)] public void Wsbh() => AdvancePC().SetRD(CpuEmitterUtils._wsbh_impl(RT_u));
0
971c44718befd763898c3f4f4c8b0d5f
0d07c5c78d0e6fb3fd62148e1607b5aa
获得topic下所有的子分类
def getsubtopic(html): sub_list = [] soup = BeautifulSoup(html, 'lxml') tagsdiv = soup.find('div', attrs={'id': 'zh-topic-organize-child-editor'}) ans_tags = tagsdiv.find_all('a', attrs={'class': 'zm-item-tag'}) for tag in ans_tags: sub_list.append(tag['href'].strip()) if sub_list: ...
1
be7f829e47adc0004795041d2662cac5
963b44e6d42652185ccb56a637a21389
Retrieve the correct standard deviation of service time from the results of the experiments
def std_error(percent_error): ans = np.sqrt(percent_error*(1-percent_error)/500) return ans
0
8e64fa2cf255e674dd6073b7b90cb24b
82ad9dff36a114b745e9a628597e82ab
从samples_all里面筛选samples_query,产生布尔掩码
try: iter_queries = iter(remove_queries.items()) except AttributeError: iter_queries = enumerate(remove_queries) remove_flag = np.zeros(len(catalog), dtype=np.int) for i, remove_query in iter_queries: remove_flag[Query(remove_query).mask(catalog)] += (1 << i) return remove_fl...
0
eed2eba7b84ca28d71e9abf67d21ca54
03e33883015600880ab14c567c84b5cc
This function sorts the elements of the array according to the pointer to the function (Bigger).
void sortPointers (void **ar, int n, int(*cmp)(const void *,const void *)) { int i; for (i = n-1; i >=1; i--) { int maxPos = selectMax (ar, 0, i, cmp); if (maxPos != i) { void *tmp = ar[i]; ar[i] = ar[maxPos]; ar[maxPos] = tmp; } } }
1
9316e1244d6d8cc80392a7144f82e232
3822045b2fecbb18ded89e6707ccb82c
Collects a list of all participants with active streams
{ List<AudioSource> src = new List<AudioSource> ( ); GetPlayingStreams ( GetStreamContainer ( group ), ref receiver ); GetPlayingStreams ( GetUserStreamContainer ( group ), ref receiver ); }
1
291fbe464985f241a2ecac86ae493d00
1e6a7be87495195e687de5f1633c1667
json转换TreeMap对象
public abstract class JsonUtils public static String sortJson(String json) { if (StringUtils.isEmpty(json)) { return ""; } Map<String, Object> map = JSONObject.parseObject(json.trim(), TreeMap.class); for (Map.Entry<String, Object> entry : map.entrySet()) { Object...
1
5979361b82a6c0d81dbc92e0011407af
ce4e9865a3b7ad318fc457f2f13ccbc0
用于分隔标题栏和内容的视图
public abstract class TitleActivity extends RestorableActivity private void initTitleView() { mTitleLayout = (ViewGroup) getLayoutInflater().inflate(R.layout.activity_title, null); flTitleContainer = (FrameLayout) mTitleLayout.findViewById(R.id.fl_activity_title); flContent = (FrameLayout) mTitl...
1
751dcecafa56b7401f5481b42c31bd51
1555ac7f080ae0018e373d9e98a68ebe
Read the IAQ values. This command can only be exectued after a measurement has started with sgp_measure_iaq and is finished.
class Sgp30Module(I2cModule): def iaq_init(self): self._sgp_query(self.REG_ADDR, [0x03], 0.5, 0)
0
9ec72d4de228b2e5fd8d7e904ee3bc2f
340cdd4eac6963cc30dbe7641fb174d4
méthode qui permet de transformer une chaine de caractères en tableau. Si la chaine de caractères contient des espaces, ceux-ci seront ignorés
string_length = len(str) tab = [] for i in range(0, string_length): tab.append(str[i]) return tab;
0
9811916387671509d12464a22086054e
28ec27501c3e1351d3a369dc5cf5be55
Display the classes for the menu element.
class Appart_Nav_Navwalker extends Walker_Nav_Menu public function display_element( $element, &$children_elements, $max_depth, $depth, $args, &$output ) { if ( ! $element ) { return; } $id_field = $this->db_fields['id']; if ( is_object( $args[0] ) ) { $args[0]->has_children = ! empty( $children_elements[ $e...
0
b58214e3e6a9462e494e085441400254
217becbc380653e55cc856c11ce5b71e
Reinitialize an existing string buffer to be empty. The allocated memory is reused. The string buffer is not changed, so using the returned string buffer value is optional.
nu_strbuf_create(void) { nu_strbuf_t* r = nu_mem_alloc(nu_strbuf_t); nu_strbuf_init(r); return r; }
0
c0c8737bb6b4419828b23f2f901d1863
d88be850ff8c442ae57cd1018e5bb62f
function to get name of department from department id
class Net2XS(Net2Base): def get_department_name(self, department_id): dataset = self.query_db( 'select DepartmentName from sdk.Departments' ' where DepartmentID=%d' % department_id) if (not dataset or dataset.Tables.Count < 1 or dataset.Tables[0].R...
1
5478af6784d3e18db5b4728799240176
c05c6ce9e569ed0ebd34529ea8bca6cd
Called when web client has started to load a new page.
public class WebPageModule extends ExternalActivity @Override protected void onPageStarted(WebViewProvider provider, String url, Bitmap favicon) { if (url.startsWith("http")) { showProgress(); } }
1
341171d6e3a2a2b6a73eab421d3b6dc6
a20dc14cd1921d9b3cd99d1c8afe84ad
@brief Check if it is basket_id format
class Btrmanger_m extends CI_Model{ private function validateFormateBatteryId($batteryId){ $pregMatchBatteryid = "/^[a-zA-Z]{2}[0-5]{1}[0-9]{1}([0-1]{1}[0-9]{1})([0-3]{1}[0-9]{1})-[0-9]{4}$/"; if( preg_match( $pregMatchBatteryid, $batteryId ) != 1 ){ return FALSE; } return TRUE; }
0
e51347703ac5a197c06d204e22f9071f
8df9c2bf5254319e8cbe39a2f7ad1ad4
Seats the guests in order.
{ foreach(int index in RandomizedIndex) { AllSorted.Add(All[index]); } for (int unorderIndex = 0; unorderIndex < this.NumberOfParticipants; unorderIndex++) { if (unorderIndex < this.ParticipantsPerGroup) ...
0
249272d53e6dd6671d4abea3051a5a35
6945870718b5bd6717402b2cf633702a
@brief Initializes the values of the GameBoard, and adds the 2 initial Tiles
class GameController(object): def initialize(self) -> None: self._add_random_tile() self._add_random_tile() self._score = 0
1
df7ae931948f35d6e20679739aa6d3d0
228f535ba127d09f54017e0f99fb3c7a
Generates an arbitrary ElGamal secret/public keypair.
p = util.genprime(n_bits // 2, safe_primes) q = util.genprime(n_bits - n_bits // 2, safe_primes) g = 1 + p*q sk = PaillierSecretKey(p, q, g) return sk.public_key, sk
0
e69ad19b16bff42b116ed0f344cfb8ba
08ed6dde8a2dec1ecce4189e7e74e135
adds pressed keys to clicked keys
for (let i = 0; i < keys.length; i++) { if (keys[i][0] == keyPressed) { keys[i][1] = down; break; } } }
0
cf5a0b9744d3d8051efa2effaea9d27f
f545fbe4cb8e852544f90bd0f7258849
returns most common occurence time (hour) from an array of incidents
hours_counter = [0]*24 with open(csv_file, 'r') as f_in: data_reader = csv.DictReader(f_in, delimiter=',') for line in data_reader: if time_period == 'month': number_of_month = month_into_int(month_of_interest) if int(line['Start Time'][6]) == number_o...
1
02495230eaa0e3bea364b941909edbb7
53d1a6bd42a499cfac81eb668c1743d1
limit the download bandwidth used by this particular torrent to the limit you set. It is given as the number of bytes per second the torrent is allowed to download
public class LibTorrent public native int getUploadRateLimit();
0
d7e11aea199a78e35243473f46480916
b161353a9ef767a78bd503ea9a5d887a
moving average error per scanline
{ const PixelC* ppxlcY = m_ppxlcCurrMBY; Int iMean = 0; UInt iy; for (iy = 0; iy < MB_SQUARE_SIZE; iy++) iMean += ppxlcY [iy]; iMean /= MB_SQUARE_SIZE; Int iDevRet = 0; for (iy = 0; iy < MB_SQUARE_SIZE; iy++) iDevRet += abs (m_ppxlcCurrMBY [iy] - iMean); return iDevRet; }
0
c19326bdb4725da5c1206e66778dbc6e
7c3123033554d32b658b263dae77013b
Skip "CW "
pub const fn get_wczi_field(inp: u32) -> u8 { ((inp & 0b0000_0000000_111_000000000_000000000) >> 18) as u8 }
0
2ab9958272e0b0573e19adecd363bc17
ef9e408dfc8cb4826c2b5dd127505c22
@brief Initialize the LED driver, with the ESP32-C3-Devkitm a neopixel is used, for ESP32 based boards a standard LED.
esp_err_t initialize_LED(void) { esp_err_t ret = ESP_OK; static struct led_color_t led_strip_buf_1[CONFIG_LED_STRIP_LENGTH]; static struct led_color_t led_strip_buf_2[CONFIG_LED_STRIP_LENGTH]; led_strip.rgb_led_type = CONFIG_RGB_LED_TYPE; led_strip.rmt_channel = CONFIG_RMT_CHANNEL; led_strip.gpio = CONFIG_GPIO_NU...
1
032484b5783000a0b2b39e6699e661ed
68046d2afdeef8acdd23e7838be9416d
Method to stop the currently playing ME.
public class Controller implements Initializable @FXML protected void handleStopAction(ActionEvent event) { organizeMyMusic.stopPlaying(); nowPlaying.setText("Now Playing:"); }
1
2828d65a729d309971e8458a315a8277
37980e19d7f38ea18257ad605c038727
根据名字获取包装箱
namespace Vancl.TMS.IDAL.Sorting.Inbound SortingPackingBoxModel GetPackingBox(string boxNo);
1
e75ef81ef2b4274d8f0211f30ee641c7
bca968d0abfafccce8b20168e57cbca6
Tests the asynchronous backup.
namespace InteropApiTests internal partial class DatabaseFileTestHelper public void TestSnapshotBackup() { try { this.CreateDatabase(); this.SnapshotBackup(); this.CheckDatabase(); } finally { ...
0
26cd68590cbe7348b66baf78a882d171
5716cf7248bcc040a20519283a4b0e12
解析白板缩放数据
public class Reader private void parseDrawEntityData(byte data[]) { if (data == null) { return; } long pageIndex = OspUtils.getUintFromBuf(data, 8); long graphId = OspUtils.getUintFromBuf(data, 12); long contentLength = OspUtils.getUintFromBuf(data, 0); int e...
0
3a6f1c99fae38b1c62f6525dd1e1219f
59ec770fe7b366ab4d6b4d747553e316
设置色相值
public class HsvColor extends com.earthview.world.spatial.display.Color public void setSaturation(int s) { int sParamValue = s; setSaturation_ev_int32(this.nativeObject.pointer, sParamValue); }
0
7afedb969fbca7ddc5d5321a531a7102
70ad0ff86aa18d63641c1ae1305feedb
Récupère un argument de balise
abstract class Page protected function getArg($index) { if (array_key_exists($index, $this->args)) return $this->args[$index]; return null; }
1
1ccecdcd4c26a7dcd077936f6d18e966
c45c57b5bbf8665d7149f95efc8b4d39
Reduction along axes with product operation.
try: return elem_wise(lambda x, y: x * y, self, arg) except TypeError: return elem_wise(lambda x: x * arg, self)
0
68e6a91fe0f8f211078d626ba77c6e55
cda34b7faf86e920dfa8b9f5262ed6cc
Decode 短码转换为任意进制
$int = I('get.int'); $base = I('get.b'); if(!$int) return false; if(!$base) $base = 62; if($int < 1) return $int; $ret = $this->dec10fromany($int,$base); return $ret; }
1
6459d658e2dac7d0bad95140d6f40ea6
7c2bf7b005f0df1609416f5e418276f5
Page : éditer mot de passe d'un compte ADMIN
class Admin extends MY_Controller public function password_admin() { $this->load->view('update_admin_password'); }
1
3d9b46ad6060a6717671f1968715fc7c
9e1951545ee32a30bf12d5f6482d74ac
打开武器菜单
{ if (nCount) { for(int i=0; i<nCount; i++) pWeapon[i]->SetScene(hWnd); return; } else { pWeapon[0] = new CScrapGun(); pWeapon[1] = new CMachineGun(); pWeapon[2] = new CMissile(); pWeapon[3] = new CLaser(); pWeapon[4] = new CMine(); pWeapon[5] = new CJack(); pWeapon[6] = new CLeroy(); pWeapo...
0
d34e7532bb74ba30da61aa1b0d7025fc
d7c62853b079fae1594d82f81da06dd9
Save pixels to stream
namespace LeptonicaSharp public partial class _All public static int pixWriteStreamPam( FILE fp, Pix pix) { if (fp == null) {throw new ArgumentNullException ("fp cannot be Nothing");} if (pix == null) {throw new ArgumentNullException ("pix cannot be Nothing");} int _Result = Natives.pixWriteSt...
1
7446d56ab672e9e10e5a3100e9313c71
86abb8b665deadc2adabe56edf9c2271
Kiểm tra xem có tuần nào bị trùng lịch hay không
{ $schoolid=$this->schoolid; $term=$this->session->userdata('term'); $school_type=$this->school_type; $where="schoolid=$schoolid AND term=$term AND school_type=$school_type AND grade='$grade' AND classname='$classname' AND week=$week AND section=$section"; ...
1
ca141e3bcf0ddb894c2d678dfe84e639
f862843b876b332038bb2c1a8661adbf
恢复专辑图片默认
{ $id = intval($_GET['id']); if ($id <= 0) { showDialog(getLang('nc_common_op_fail')); } $model = Model(); $where = array(); $where['ap_id'] = $id; $where['member_id'] = $_SESSION['member_id']; $pic_info = $model->table('sns_albumpic')->whe...
0
ab9c7c89b53aff84dd8ecee57005c9b1
3f7e463b5a140fd29fcfb08490c19bcc
启发式合并
dis_between_class = [] if self.max_combine_num > 0: for i in range(self.current_class): for j in range(self.current_class): if i > j: dis = np.sum((self.centers[i] - self.centers[j]) ** 2) ** (1 / 2) if dis...
1
cf2c9d8c3ba7f3029c9f0502cd23fc8a
f14e13c15dbefe199f4450c2dc7f335e
Mettre à jour Po/Mana
if (mp > nbBalls) { mp = nbBalls; } manaPoints = mp; }
1
4a8d2cd0df9f37d4f5aef08cbd338d78
8f2614aac62eb6f65ec6230b8a29a03f
getAvailableFacts returns the facts available to the player
public List<String> getFacts() throws YapilyException{ final List<String> factIds = new ArrayList<>(); this.fetchRandomApi(factIds); return factIds; }
0
a9ef96639d90e90164b98ecbbc366dae
9916cc160c68e87c781ab64231ec6d09
Devolve o código do cliente que efetuou a compra.
class Delbank extends AbstractRemessa implements RemessaContract public function getCodigoCliente() { return $this->codigoCliente; }
1
02e73c683d81944ffdc28c6a0f5958e9
0d1d7a53c701a796c4ce5afc666e259a
* Returns the list of actively working hub devices.
class Connect(object): def getActiveHubList(self): cursor = self.db.cursor() cursor.execute(self.queryActiveHubList) result = cursor.fetchall() return result
1
8d80b5d5a7b329738e0371d4b9e29c04
de3118b39ae9cb0bfd77e85c6a52bbba
Returns the meta object for class '{@link smartHome.BooleanSensorType <em>Boolean Sensor Type</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
EAttribute getTYPE_Boolean();
0
a3883961756a8af1ae988099712d7d38
593ac0b3e8d65d6b248725abd7188e17
ビル名等(<code>ADDRESS2</code>)の検索値をセットします。
public class JisekiCategoryList_SearchForm extends KitSearchForm public void setShiteibi(String shiteibi) { this.shiteibi = shiteibi; }
0
b7b08103f5b46db4088fa07f5c3d729e
09cb6ba5720f9da8d5346adcb3a6c927
Find the ID of the CmObject in the database that matches this guid.
bool __stdcall MMAPersistenceUnitX::GetObjectGDMIdFromMasterId( const ObjectId_t knMasterId, GDMId_t& rnGDMId ) const { MapOfMMIdToGDMId_t::const_iterator xConstItr = m_xMMToGDMIdMap.find( knMasterId ); if ( xConstItr != m_xMMToGDMIdMap.end() ) ...
0
eb0f638463b8c1e59ce35a1f2da2dd8b
43fd37a56cfe70648d75ca9d94a26e51
Route to get all the registered users.
public async Task<IActionResult> Get() { var users = await _getAllUsersQuery.InvokeAsync(); return Ok(Mapper.Map<IEnumerable<UserViewModel>>(users)); }
1
d9685c5233f713f3cf3e1a7da28ec35f
19cb195db6ac5410f2c33d5b00110da5
Получение дохода за текущий месяц
def calculateIncome() -> float: return round(dtbTakingsMonth.cal() + dtbTakings.cal(), 2)
1
e5b80bb3a2a79b3afdd397a8dde57989
30c44fe0d75eba8d0695c18590b8880f
计算整体进度 0 ~ 1 1 - done
class Model extends BaseModel{ public getCurProgress ():number{ return this._curProgress }
0
8cb759c72768737bce0daf5e90e46b28
681c1d871d789d1cd43f9eba3697188b
A dictionary with journalling behavor.
self.jailroom_data = { 'cell_unlocked' : False, 'computer_hacked' : False, 'guard_bribed' : False }
0
163580635a5c2d020409fba411dd43fd
f0c0c55b8dd113a084d3e0b968d37cc9
计算授权树形图
{ $model = M('store_auth_rule'); $temp_auth_list = $model->where([ 'status' => 1 ]) ->order('id asc') ->select(); $auth_list = []; foreach ($temp_auth_list as $v) { $auth_list[$v['id']] = $v; } foreach ($auth_lis...
1
f6f9250a980f446b6d7a0316164ab7bd
ca7ab55b1a021963ad2456d5023a4cb1
Image should not be resized if it's already smaller than what is required
function resize (file, size) { const newFile = file.replace('.png', `-${size}.png`) if (fs.existsSync(newFile) && fs.statSync(newFile).mtime > fs.statSync(file).mtime) { return Promise.resolve(null) } return sharp(fs.readFileSync(file)) .resize(size, size) .max() .toFormat('png') .toFile(new...
0
6e8e17bf03e4b65a1cc78f46b6605ddc
f1d86aa8df71d9558ded7a94e08f898e
Converts the index of the upper left corner of the image to the lat lon of the 'middle' pixel
lng = round((self.left_up_x + pix[0] * self.scale_w) / 1000000.0, 6) lat = round((self.left_up_y + pix[1] * self.scale_h) / 1000000.0, 6) return [lng,lat]
0
4b5c934d20af5fd68f6205a2f1a620a8
50763f1bc3cde2e7ca439bb994e8557f
Formats money to begin with a dollar sign, group the whole digits into threes separated by commas, and with only two decimal places.
{ var aNum = ConvertToNumber(n); return ("$" + FormatNumberWithCommas(aNum.toFixed(2), true)); }
1
03f638902a3a7736b8776e2e607abe61
7659a4dfd8b6a0a47160e45f79752982
Force the bot to purge the messages immediatly instead of waiting 24 hours.
@Getter @Setter public class ChannelEndpoint extends AbstractTwitchEndpoint public void purgeChat() { getTwitchClient().getMessageInterface().sendMessage(getChannel().getName(), ".clear"); }
1
17a23b2dcaae00ae3f3dfc26a91acb6a
7650839306a909f17c19c4b681dd25eb
通知网络状态监听器
void notifyWatcher(NetworkType networkType);
1
93220fcb380b35868de0095992a2c25b
9e694669bf3063f3a75e10d1dee09e3e
获取key过期时间 -1表示永久 -2表示该key不存在
namespace Insight.Utils.Redis public static class RedisHelper public static int getExpiry(string key) { var ts = redis.StringGetWithExpiry(key).Expiry; return (int) (ts?.TotalSeconds ?? 1); }
0
cbd04a806ba0709f82d1cd3eb3e349ba
692225356b76d474a9c3c3bd8e703aca
Test correct raising of exceptions
with pytest.raises(Exception) as e: page = src.page.BernoulliPage(1.5) page = src.page.BernoulliPage(-3) page = src.page.BernoulliPage('Seems pretty likely')
1
c95bb1965977ac244469077b944dfc99
2ac1241dcf1fd96be1eac56f1aa0fc83
https://coda.io/developers/apis/v1beta1#operation/deleteRow
namespace Google.Area120.Tables.V1Alpha1 public abstract partial class TablesServiceClient public virtual void DeleteRow(RowName name, gaxgrpc::CallSettings callSettings = null) => DeleteRow(new DeleteRowRequest { RowName = gax::GaxPreconditions.CheckNotNull(name, nameof(name...
0
82e69d98904aa808a32273d1720092e1
eeb18616a5604d67bbc267f117f58ec6
Initialize teapot vertex arrays that can be reused in many teapots.
void CC3ModelSampleFactory::initTeapotVertexArrays() { m_teapotVertexLocations = CC3VertexLocations::vertexArrayWithName( "TeapotVertices" ); m_teapotVertexLocations->retain(); m_teapotVertexLocations->setVertexCount( num_teapot_vertices ); m_teapotVertexLocations->setVertices( teapot_vertices ); m_teapotVertexNo...
1
48551f4338890e7aa12ef7c6893a7270
3eeb379bd3ec2f3929b353d31549a71b
Implementation will use this method to set a timeout for output channel poll operation. Default is 10 seconds.
public abstract class WebCommunicator implements MessageCommunicator public void setTimeout( int value ) { mTimeout = value; }
1
c8c8a824c1446d0a479cced062b2e089
a8137b2fd19b2a635b343ad4075602af
Stringin sayi olup olmadigi kontrol ediyor
public class IntorString static boolean isNumber(String s) { for (int i = 0; i < s.length(); i++) if (Character.isDigit(s.charAt(i)) == false) return false; return true; }
1
75fd56a31a8822556d8a27b41c3d5460
ec5e0fd007adf17bfa96a6ce53b4781b
用于获取AD值,单位:伏
def getADC(addr,channel): VerifyADDR(addr) VerifyAINchannel(channel) resp=ppCMD(addr,0x30,channel,0,2) value=(256*resp[0]+resp[1]) if (channel==8): value=value*5.0*2.4/65536 else: value=(value*24.0/65536)-12.0 value=round(value*calScale[addr][channel]+calOffset[addr][chan...
1
9b7d3598527d1db0301cc15f83c444dc
c4cb2f1508dedb798e6b91005f986d5d
! Constructs a \l{isNull()}{null} node.
public class JsonNodeFactory implements java.io.Serializable, // since 2.1 JsonNodeCreator // since 2.3 @Override public NullNode nullNode() { return NullNode.getInstance(); }
1
ce34d5220085b8dcb168a7828d875640
7c6128735fc732747675ea1431c7f1fc
多线程生成渠道包
def gen_dt_user(): for _ in range(2): print(u'创建第{}个渠道商中'.format(_ + 1)) _gen_dt_user()
0
6a8e07920017e60f7abf1f3123c99f02
f549eea40984d4b7b1f4fc9dea167940
根据文件ID数组获取文件大小
public class FileUtil public static long getFileSize(File[] files) { long size = 0; for (File file : files) size += file.length(); return size; }
0
7aab46c49fd7c1edb345f4934c9105f4
03b085e2896528a704dfc3c3648c6787
Hands out the secret key through file download (saveas).
with open(filename, "wb") as f: f.write(key.private_bytes( encoding=serialization.Encoding.PEM, format=serialization.PrivateFormat.TraditionalOpenSSL, encryption_algorithm=serialization.BestAvailableEncryption, ))
1
b860619fee6d27d68cf21126121eb8f7
140295ad2d81f818092802952a8319d5
获得截断的日期
public class DateUtil public static Date truncateBegin(Date specifiedDate) { return DateUtils.truncate(specifiedDate, Calendar.DATE); }
1
e3e1a7f7b2a295e19f97605393de2482
5382d5fe604c24f683af1cb674ae3416
Algorithm f1 Computes resynch authentication code MAC-S from key K, random challenge RAND, sequence number SQN and authentication management field AMF.
unsigned char *data, uint32 len, unsigned char *mac) { psHmacContext_t ctx; unsigned char *key, *seq; unsigned char majVer, minVer, tmp[5]; int32 i; majVer = ssl->majVer; minVer = ssl->minVer; if (mode == HMAC_CREATE) { key = ssl->sec.writeMAC; seq = ssl->sec.seq; } else { key = ssl->sec.readM...
0
257b8151679ea6849e5a15020212a233
4dea93580e9efbae457cab8d5f47f482
wait until connection is established before setting up the rest of the page
export default class Chat extends PWDWindow init () { if (this.connecting) return this.connecting = true let infoBox = document.createElement('div') infoBox.classList.toggle('checking-holder') if (!this.chatBoard.classList.contains('.checking-holder')) { this.chatBoard.appendChild(infoBox) ...
1
e734db1bc25413e5690e73e518963e44
9e91842d72df3900b4f20c0cb538abc0
Security Questions by Access Token (GET)
class SecurityQuestionUsersController extends ApiController public function index() { $limit = Input::get('limit') ?: 20; $usersecurityquestions = SecurityQuestionUser::paginate($limit); if( ! $usersecurityquestions->count() > 0) { return $this->respondNoRecord(); ...
0
434e1757e4a14158ec278daf111de779
2a01d7762a5ecbf48194f85510b54b5d
숫자 배열이 주어졌을 때 10보다 큰 숫자의 갯수를 반환하는 함수를 만드세요.
let answer = 0; for (let x of arr) { if (x % 10 === day) { answer++; } } return answer; }
0
c94f206ca816e2a77cb06b6a0e4e1381
1d6a7ab0d38ae9a69ce60c3ae1e82ad1
批量更新CostDeptTypeDict
public int updateBatchCostDeptTypeDict(List<Map<String, Object>> entityMap) throws DataAccessException;
1
5f91bab67d7ed5e38bf4493d528d2f26
b195fe8d6b95244bbc526f28f4293bab
calculates the coefficient of moisture-tension, used for water flux estimation
K_h, g, dy, cp, dp, factor_air, factor_kair = funcparam if Base.parallelization == True: a1 = Vars.meridional * Vars.T[:, 1:] a2 = K_h * factor_kair * Vars.tempdif / dy a3 = cp * dp * const.mb_to_Pa / g C = (a1 - a2) * a3 * factor_air else: ...
0
d4ad6249c1962ff28f4f48efe3f8814e
ec37f379eae10d37b5c10cfb09315c7c
Fascade for all of the GraphQL logic.
{ if (types == null) { types = new Types(); services.Add(new ServiceDescriptor(typeof(ITypes), types)); } services.AddFluentValidation(container, types); var graphControllers = new GraphControllers(types); se...
1
ae84c35ee775f7157093485a760a64d6
4f6df7e9e8c717df12ff8dca4eb61456
Draw the parameter and its values only as labels, since <see cref="AnimatorController"/>s cannot be modified during PlayMode.
namespace Animancer.Editor public abstract class ParametizedAnimancerStateDrawer<T> : AnimancerStateDrawer<T> where T : AnimancerState public virtual object GetParameterValue(int index) => throw new NotSupportedException();
0
038d86c0840481bdf9b49ac5b42792b6
ec98e3d4989b607354f7002d672e9d1a
获取 RecyclerView 嵌套滚动开关
class NestedOuterScrollView : LinearLayout, NestedScrollingParent2, NestedScrollingChild2, NestedScrollingChild3 override fun setNestedScrollingEnabled(enabled: Boolean) { mChildHelper.isNestedScrollingEnabled = enabled }
0
758e9e792c07719c51bf88720272f1b4
8663535b265b9b5d6d69c12a946316d3
1 B <- E
B = matrix(0,2,N); for (l in 1:2){ B[l,N] = 1; } for (i in (N-1):1 ){ for (l in 1:2){ B[l,i] = A[1,l]*E[Y[[j]][i+1],1]*B[1,i+1]+A[2,l]*E[Y[[j]][i+1],2]*B[2,i+1]; } } return(B); }
0
6020798375a70e0ddbf1f04573e6ec17
cae8bd087ad518f60e59a18fec09ff75
prints the text-based user interface
def user_interface(): print(ANSI.green) while True: print("ramdisk.py by tobycode.") print("1) create a ramdisk") print("\nx) exit") tmp = input(">>>") if tmp.lower() == "1": create_ramdisk(input("tmpfs or ramfs?\n>>>"), input("Where should the ramdisk be mounted?\n>>>"), input("How large should the ramd...
1
0e9ec3cf077503a58f59d5341fdf175c
6b2bef2c5ef26608d5efe8c1cb2cfe5e
列車情報取得(路線ID指定)
namespace SendaiBusSearchAPI.Controllers.api [Route("buses")] [EnableCors(origins: "*", headers: "*", methods: "*")] public class BusesControllerBase : ApiController [HttpGet()] [ActionName("details")] public BusInfoResult GetDetailsData(string id) { var instance = DBMode...
0
8157192e421cb7ad3974ddda42643d57
bba4a5f226f19725b10c80fc03456216
Use like Resources.Load, but searches folders named EditorResources instead of folders named Resources. Remember that you should not include the file extension, just like when using Resources!
[ExecuteInEditMode] public class ResourceManager : MonoBehaviour public static AssetRef<T> LoadSync<T>(string resourcesPath) where T : Object { return LoadSync(resourcesPath, typeof(T)) as AssetRef<T>; }
0
2b9f8b3a0d7721fccba03011b8dde3d2
d2bee88c4f4fd1efc55a884e41e22c5f
Покачивание камеры
{ var pos = this.main_camera.transform.position; pos.z += (5 * inputNumber); this.main_camera.transform.position = pos; var pos_background = background.transform.position; pos_background.z = pos.z; pos_background.y = pos.y; background.enabled = false; ...
0
38bf5572fc3cc61000ec2b6576d1990f
0e6699be3947098ab55e2a5b5cb500f7
Check if bootstrap step needs to run during service update. Called during deployments to determine deployment workflow.
class TogglzFilterConfig public Boolean isPerformBootstrap() { String managerProvided = servletContext.getInitParameter("org.togglz.FEATURE_MANAGER_PROVIDED"); if (managerProvided != null) { return !toBool(managerProvided); } return null; }
1
6b58d4d49c258f3dc7570760c518020a
8c36dedd76bda519cb8937233af955b2
Returns the local object matrix for the transform. Combined with the parent's global `Transform` component it gives the global (or world) matrix for the current entity.
export class Transform extends paper.BaseComponent public getWorldMatrix(): Readonly<Matrix4> { if (this._worldDirty & TransformDirty.Matrix) { this._updateMatrix(true); } return this._worldMatrix; }
0
14559aa4b4eafdec93bc828505a52e09
f0d723e1d1487ad161f9add81c7defe7
Retrieve Event Counts for an Organization
{ if (!isset($filters['name'])) { $filters['name'] = null; } if (!isset($filters['period_created'])) { $filters['period_created'] = null; } if (!isset($filters['user_group'])) { $filters['user_group'] = null; } if (!isset($f...
1
032890e01ffe082690f1fa936f1eb23f
e6ae21b8554eb01a46c3ce3dca74c5dc
Returns a new DiagonalsPublicObjectiveCard instance with same properties of this one
const clone = new this.constructor(); Object.assign(clone, this); return clone; }
1
12566fc680750b6061bb67388a38245d
a2a10dee2c95b9621091b602a9996677
Removes the build configuration settings.
namespace AccessibilityInsights.SharedUx.Settings public partial class ConfigurationModel : ICloneable public static void RemoveConfiguration(string path) { FileHelpers.RenameFileAsBackup(path); }
0
aa9af6b34f963979e968ff02f836fc76
a1d938c082e694c7ea1ab145577493f7
发起json请求,返回json字符串
String requestParams) throws IOException { URL url = new URL(urlAction); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); if (requestParams != null && !requestParams.trim().equals("")) { BufferedWriter bw = new BufferedWriter(new OutputStreamWriter( conn.getOutputStream(), "utf-8")); ...
1
3625ceace4d08f5fd99aef7a8f5e3186
f49cdd285129082e7b6e8d75f48ffbe9
Returns list of withdrawal requests.
params = self.get_params() r = limiter.post(self.rootUrl + "/api/withdrawal_requests/", data=params, proxies=self.proxydict) if r.status_code == 200: if 'error' in r.json(): return False, r.json()['error'] else: re...
0
44f20ef01fd920095755b6eeaf37f242
9f164f861997bd7240909470d9b1e996
GET: Barrios
{ using (dbExequial2010DataContext barrio = new dbExequial2010DataContext()) { var query = from bar in barrio.tblBarrios orderby bar.strCodMunicipio select bar; return query.ToList(); ...
1
a622c5dd0695a57e962d7d38913ffb11
8fd2808a4f3637140e4148633473f83a
Metodi piirtää näytölle vuorossaolevan pelaajan kortit.
for (Integer numero : arvonta.arvotutNumerot) { for (KortinKuuntelija kuuntelija : lista) { JButton apum = kuuntelija.kortti; if (kuuntelija.indeksit.get(apum).equals(numero)) { kuuntelija.kortti.setBackground(Color.GREEN); } ...
0
0c61286a747c5abb66df3bed00289948
7e373ff3155b98e7e2a7ea57125304d7
Creates and returns a new Gasp from the specified walker.
this.gvtRoot = gvtRoot; if (gvtRoot != null) { this.walker = new GVTTreeWalker(gvtRoot); } else { this.walker = null; } }
0
3a522df9e510c738e0894125b9bdd96d
d5a250b0922192546a03a328953ce0e4
Adds to a list of methods NOT to be considered for patching.
final class BTraceClassWriter extends ClassWriter public void addCushionMethods(Collection<MethodNode> pillowMethods) { cushionMethods.addAll(pillowMethods); }
1
c6cd0402c14776f3d8aec643ea458358
bad8dc0caeb019eb265708037932efa2
used for sorting drawjobs by their closeness to the viewing plane
if math.fabs(item1[3]) > math.fabs(item2[3]): return -1 elif math.fabs(item1[3]) < math.fabs(item2[3]): return 1 elif item1[2] > item2[2]: return -1 elif item1[2] < item2[2]: return 1 else: return 0
1
d6facdaea6611962c4280cb20f1cec7b
40ea65ea67de3bd0111d2ee5dfca413f
Summarize reviews given assignment id, reviewee id and criterion id
def aggregate_subReviews(domcredReview, content_credReview, adoc, cfg): doc_mdref = markdown_ref_for_article(adoc, cfg) thresh = cfg.get('cred_conf_threshold', 0.7) content_conf = dictu.get_in(content_credReview, ['reviewRating', 'confidence'], 0.0) domcred_conf = dictu.get_in(domcredReview, ['revi...
0
095393aa9b9a96abae497fc0bb2da4af
c1a48b528a195a54dedbec3f3fef112d
Look at the currently aimed mob
public class Raycast : MonoBehaviour public string get_currently_looking_at() { return currently_looking_at; }
0