query_id
string
corpus_id
string
query
string
code
string
label
int64
dac3e7350c6195403d9ac4b0b19606e1
53d5f495411c469786d682aee6c28f2d
Try to acquire an exclusive lock around the contained value
bool SharedExclusiveLock::TryAcquireExclusive() { int value = m_value; if ((value & (LockOwned | LockExclusiveWaking)) != 0) return false; return InterlockedCompareExchange(&m_value, value + LockOwned, value) == value; }
1
27760f59e0455a14e6e17eb6863294d7
d94ec910093c58d274383542bcec380a
Открыть окно для добавления новой записи в базу
namespace Rushtell_Bunk class PresenterForMain public void CreateAddWindow() { AddWindow addWindow = new AddWindow(); addWindow.ShowDialog(); }
1
8638847542cfef344390e81d30d49dd6
bb7fb2214aa2b25d4f073f5cfad783ca
find image that matches a given timestamp
last_scan_of_session_images = os.listdir(current_session_scans + '/' + getDate() + '/' + last_scan_of_session) i = 0 for x in last_scan_of_session_images: try: current_camera_ID = get_exif(current_session_scans + '/' + getDate() + '/' + last_scan_of_session + '/' + last_scan_of_session...
0
e1787c2a355e7d362e6bbdf3f8c36352
fef29fd514495640e28cc2c26aa4c376
跳转到众筹发布页
@Controller public class PublishController @GetMapping("/publish") public String publish() { return "publish"; }
1
a65ab83a8125e105736ad2cdb25c8310
d7c61f5489ca8c0ddd8a43a8047ff2c4
指定されたDateTime値から年を取得する
public final class DateTimeUtil public static int getYear(final Date sourceDate) { final Calendar calendar = Calendar.getInstance(); calendar.setTime(sourceDate); return calendar.get(Calendar.YEAR); }
1
0b24392e65363f030047aff36024d674
e4e959e558f724e07c1eca44812ce155
Test count aggregation, which simply counts input records.
class TestAggregate(unittest.TestCase): def test_aggregate(self): yield self.coll.insert([{"oh": "hai", "lulz": 123}, {"oh": "kthxbye", "lulz": 456}, {"oh": "hai", "lulz": 789}, ], safe=True) res = yield self.coll.aggregate([ {"...
0
6b602a16807d2b5c3356c690ddd3e3ed
464704943cf694dd627cb075dbc6a5eb
saving the include history option value to be retained for all Add to Type in add activity
fun setSearchHistoryMode(isActivityed: Boolean){ Log.d(TAG, "SharedPrefManager - setSearchHistoryMode()") val shared = App.instance.getSharedPreferences(SHARED_SEARCH_HISTORY_MODE, Context.MODE_PRIVATE) val editor = shared.edit() editor.putBoolean(KEY_SEARCH_SHITORY_MODE, isActivityed) ...
1
78bed6f36326e065fbddfba36e3abda3
a36f642a15c2c694b95c0df5a7ac2274
获取每日0点时计数总量
{ DateTime endTime = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd 0:0:0")); return GetCount(null, endTime); }
1
86a3b31a193d19acba8dcf73b350c254
378441b5d8b352e0d4dd224b2415c779
Return the number of session variables.
class Session{ public function getNVars(){ return $this->nVars; }
1
dfb14592681ddc52af7f4ed9b3600455
17ad522f9d11430638b93c751b5e35f3
Build a new restriction for the branch and bound algorithm.
{ parent::_prepare_restrictions (); $this->_calculated_restrictions [] = "etob.branch_id = {$this->_branch->id}"; }
1
94c1db4bfe578d0c17c8d0ffad98f58d
a7119237def74685262aca81919e8ae6
Returns a surface Object of a named frame
if(this._frames[f]==null)return null; var frameInfos2:Array<any> =this._frames[f]; for (var j:number = 0; j < frameInfos2.length; j++) { this.data = frameInfos2[j]; if(this.data instanceof Array == false){ if(this.data["name"]==_name){ var display:any; if(this._displayObjects) display = this....
1
0cbef710280b77a74c21d252991e70b3
565fb83f51a174ad04f27b0f1026e502
Enable writing to the RTC's oscillator control register. This function should only be used internally.
void rtc_ctl_init(void) { am_hal_rtc_osc_select(AM_HAL_RTC_OSC_XT); am_hal_clkgen_osc_start(AM_HAL_CLKGEN_OSC_XT); am_hal_clkgen_osc_start(AM_HAL_CLKGEN_OSC_LFRC); am_hal_rtc_osc_enable(); }
0
d3fcc9f9285b6e27226fc371d069428e
a22164e2d31ccf321117231c974a1309
Reloads the translation hashes
function reload_all_translations() { global $CONFIG; static $LANG_RELOAD_ALL_RUN; if ($LANG_RELOAD_ALL_RUN) return null; foreach ($CONFIG->language_paths as $path => $dummy) register_translations($path, true); $LANG_RELOAD_ALL_RUN = true; }
1
69975c356313e0a64db03347db90f632
74aad9a5723d039b04f01a3aa1d3a188
GET: UserCv
{ var user = Session["user"] as User; if (user == null) return RedirectToAction("Login"); ViewBag.Career = db.Careers.ToList(); ViewBag.Candidate = db.Candidates.FirstOrDefault(x => x.User_ID == user.ID); return View(); }
1
e791efdb3a61f38df396eae28d7bb3e1
054845355651b0ecdb1dfd603d57bd86
This function populates the Select and Expand field lists in the class from reading the data from the Odata URI. <see cref="SelectExpandClause"/>
{ PropertyAccessMap<BOL.ExpenseReport> baseEntityMap = this.AccessMaps.GetPropertyMap<BOL.ExpenseReport>(); PropertyAccessMap<BOL.ExpenseStatus> statusMap = this.AccessMaps.GetPropertyMap<BOL.ExpenseStatus>(); PropertyAccessMap<BOL.Resource> resourceMap = this.AccessMaps.GetPropertyMap<BOL.Resource>(); Pr...
0
4be428fc57c8a3be015c19f128ad417b
88c32d99b90a1567d1cca1dd82cf9264
Returns the HttpRequest factory instance.
class Builder public function getRequestFactory() { return $this->requestFactory; }
1
ba7d83fc1e189fef955156e7611e69fb
c058324628971114cf621eb495b2a8bc
Test for axis=2
axes=(1, 0) in_shape = numpy.asarray(self.input_shapes['2d'])[list(axes)] out_shape = numpy.asarray(self.output_shapes['2d'])[list(axes)] a, b = self.create_test_arrays(in_shape, out_shape, axes=axes) self.run_validate_fft(a, b, axes, create_array_copies=False)
0
b29a85903f2a3e90b00972cd51a3bf4d
9e8bfe6a94261e32ff09843b295453ef
竞赛统计页面
def home(request): uid = request.GET.get('uid', '') kind_id = request.GET.get('kind_id', '') created = request.GET.get('created', '0') try: kind_info = CompetitionKindInfo.objects.get(kind_id=kind_id) except CompetitionKindInfo.DoesNotExist: return render(request, 'err.html...
0
2549accb9053a893fc7a5be5f5fc5202
a970c28e50546fa468b89c356f5588ce
开始直播.
class Raffle public async Start() { await tools.XHR({ method: 'POST', uri: `${apiLiveOrigin}/room/v1/Room/room_entry_action`, body: `room_id=${this._options.roomID}&platform=pc&csrf_token=${tools.getCookie(this._options.user.jar, 'bili_jct')}`, jar: this._options.user.jar, json: true,...
0
6294b10a5746d903c5feda61076abcf0
7142018d2332aa1ba33b3a2d870061a8
Test that a logged out user can not like a comment
class LikesDislikesTests(BaseTest): def test_user_cant_like_own_comment(self): response = self.client.post(self.like_url, self.like, format='json', HTTP_AUTHORIZATION=self.author_token) self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
0
76d00c528ad59db4f72892d76f4ea2d6
40bf521fbc576545a98a3c4d7fedb724
Creates a new timer group
public function newTimer(): int;
0
2fac1a92b68407d73ba896c8e7ddbb83
56779d12e12e1b7246c1540daebdc5b3
棋譜を再現
self.board=chess.Board(fen) for tsquare in self.genSquares(): piece = self.board.piece_at(tsquare.square) tsquare.piece=piece tsquare.fieldState=tsquare.getFieldState()
1
653ff856b3e7c74693518093e793de60
fb09de9745924a7e12399b39db1cd392
Test whether a stack can accept more pushes
if (s->dynamic) { return false; } else { if (s->top == s->capacity-1) { return true; } else { return false; } } }
1
fbabdeafb79205c616b47f49f93603d4
e9c9562046cf24a83968d9a14bb86a00
Close the Predictor window for the selection of the input data and renames the selected varaibles in the window. When closing the window, the label in BCI window will be updated
static void dialog_name_experiment_close (GtkFileChooserDialog * dlg, int response_id, void *data) { char *buffer; unsigned int i; #if DEBUG_INTERFACE fprintf (stderr, "window_name_experiment_close: start\n"); #endif i = (size_t) data; if (r...
0
d2be97abdc4bafca72a08e1b5be75401
7763a6963ada901f9e79b202ff0e4dee
sets up the dimensions, number of walkers, number of steps, and bounds on the coefficients
self.inputdims=inputdims; self.outputdims=outputdims; self.numpars=numpars; self.output = range(self.outputdims) self.k = 0.12; self.p = 0.25;
0
1528dfe598ddb3818cdbb6b225ae9ed3
f43923a230455279aa4a99844f22eada
Plays cast animation facing right
public class PlayerModel : MonoBehaviour public IEnumerator TurnRight() { if ( twoDEffects.inAnimation ) { twoDEffects.StopReleaseEffectAnim(); } animation.clip = animation.GetClip( "playerMoveRight" ); animation.Play(); EnableDust(); yield return new WaitForS...
1
286afb939cbc69b0d233664a192cf971
63acc5daa51f60200131029d4f7b25f9
sqsにキュー登録を行う
{ $params = array( 'name' => $queue_name ); $result = $this->request($params, $queue_data, self::POST); if ($result["data"] == "HTTPSQS_PUT_OK") { return true; } else if ($result["data"] == "HTTPSQS_PUT_END") { return $result["data"]...
1
54dfa746fc86cb23046565f505400ca5
3706ec9d7a4c34fccdba865d274ba89a
Extracts the number of data layers and data blocks from the layer around the bull's eye
def extract_info(basename): splits = basename.split('_') n_layer = int(splits[4]) n_hidden = int(splits[7]) try: n_conv_channel = int(splits[10].split('.')[0]) except IndexError: n_conv_channel = 0 return (n_layer, n_hidden, n_conv_channel)
0
ae59df0eba0effa0a266b195c9672afe
45d99aa075b9ff1d91ee9d65d19d3204
Gets the device_type of this Thermostat. # noqa: E501
class StorageInitiatorPathInfo(NetAppObject): def device_type(self): return self._device_type
0
9f536e6a6dd402dfcc69301d0a302165
b25024bb03342327c49b69dd5bae723a
Simplification in place
void SimplifyFraction(fraction& f) { int gcd = GCD(f.n, f.d); f.n /= gcd; f.d /= gcd; }
1
216abfe15c3afc90f8dcf83a26f640eb
27211ae2f5b6565ee4db794f2978ec29
противоположная скобка
{ if(this->POZ_Z_D()!=0){ Integer* opposite = new Integer(this->Arr,this->n,!this->sign); return *opposite; }else return *(new Integer(*this)); }
1
657345c2db67671725b8852820ccc62b
e909bfa9bf44b4ff5e43ac4292ed2507
LL rotation 新节点在root的左子树的左子树下,root为最靠下的bf为正负2的节点
let rc = T.rChild; if (rc.bf === -1) { rc.bf = 0; T.bf = 0; return this.L_Rotate(T); } else if (rc.bf === 1) { let ld = rc.lChild; switch (ld.bf){ case 1: rc.bf = -1; T.bf = 0; break; case -1: rc.bf = 0; T.bf...
1
e3028945e418e54a93e5e3adfc8342ae
2b5b114e51f0d35b0d1420345e88fa83
Metodo responsavel por converter modelo de entrega para response dto de entrega
{ return new entidad.ENTREGA_URGENCIA() { ENTREGA_URGENCIA_ID = m.EntregaUrgenciaId, DESCRIPCION = m.Descripcion, ESTA_HABILITADO = m.EstaHabilitado }; }
1
ec5a2ca7f4c8e9d4df70fd68023e80e6
ed03d212b90d64e15ad9f8418b83d423
! \brief Probe at30ts75 nonvolatile configuration register
{ unsigned char ucControlRegVal; short sTemValue; TC72Configure(TC72_MODE_ONESHOT); ucControlRegVal = TC72ControlRegValGet(); TestAssert((0x15 == ucControlRegVal), "TC72 API error!"); sTemValue = TC72TemperRead(); PrintN(sTemValue); TestIOPut('\n'); TestIOPut('\r'); }
0
973e781fc5db7cd3dee6a0df0115cb0a
bf09c48be4e5f0e0edcf5e4226636650
Causes a call to {@code System.out.println}.
@kotlin.internal.InlineOnly public actual inline fun println() { System.out.println() }
1
d163db55fe745c09ea9a91c75499142f
36c9ca3ffe06b238831255eee1aa4490
求当前矩形区域和指定的矩形区域重叠的矩形区域
namespace Atlass.LAS.Lib.Types.DataType [Serializable] public class TcRectangle public static TcRectangle OverlapArea(Double prmULX1, Double prmULY1, Double prmLRX1, Double prmLRY1, Double prmULX2, Double prmULY2, Double prmLRX2, Double prmLRY2) { if (!HasOverlap(prmULX1, prmULY1...
1
7aff11d428f30dac836be119eceeb1ef
76086f2eb3acb10dd3a516996bb40951
p2p接続での着呼要求を拒否
namespace InTheHand.Net.Bluetooth.Factory bool RefusePinRequest(BluetoothAddress device);
1
40ddac97f963626a23920380c4a47ef0
cb1a3cc9ca4a02a7f906ef0640bc03b4
Handles the CellEndEdit event of the dgvRoleSettings control.
{ if (!ValidationHelper.IsValidInt(this.PMLimit.Text.Trim())) { this.PageContext.AddLoadMessage(this.GetText("ADMIN_EDITGROUP", "MSG_VALID_NUMBER")); return; } if (!ValidationHelper.IsValidInt(this.Priority.Text.Trim())) ...
0
7547a24f554db5e05ac47f0e6f1dc08f
c71bc84e55440cad049a1251b5031fc1
Put back into the pool only good connections
public class JdbcDataSource implements DataSource private void pushConnection(Connection connection) throws SQLException{ final PooledJDBCConnection pooledJDBCConnection = (PooledJDBCConnection)connection; synchronized(POOL_LOCKER){ activeConnections.remove(pooledJDBCConnection); ...
1
079e49359e52a49581e8d93dbac19143
3349c9b6ca109c11153643b65b71de64
Returns the directory (e.g. `/home/john/dev/project/src/jvmTest/kotlin`) containing the source code of the class represented by this Kotlin class or `null` if it can't be located.
final File sourceDirectory = new File(getSourceDirectoryName(path)); if (!sourceDirectory.exists() || !sourceDirectory.isDirectory()) { return null; } return sourceDirectory; }
1
b12a7ec58ab86926ba820651b74a38b2
b98c8fe76eef6eeb1bb82f11736a4283
¨Permet de définir la Pole Position
public class Palmares public void setPolePosition(int polePosition) { this.polePosition = polePosition; }
1
2160ba289e6ae92e245fd1d3ad6ba675
3b2157a770b8d79b5cc29f7613e4889f
Finds the initial equations by finding equality through buddies, match, etc.
self.parent = {} for eq in equations: self.parent[eq[0]] = eq[0] self.parent[eq[3]] = eq[3]
0
c4a29621bf6ff5b3a8db6396fde8e532
a967ddd1b4f3329cc82b3184ddd83f69
select one recipe by cookingId.
@Select("SELECT * FROM `cooking` WHERE `cookingId` = #{cookingId}") Cooking findById(@Param("cookingId") long cookingId);
1
d00c691176d5dcb67178a4412fc2988a
fee3c6e7ea76994f3f9a8384c5f90086
Returns true if ctrl (linux, win) or meta (mac) has been pressed and not the other.
{ KeyboardEvent keyEvent = getKeyEvent(); if (keyEvent != null) return keyEvent.isCtrlKey(); MouseEvent mouseEvent = getMouseEvent(); if (mouseEvent != null) return mouseEvent.getCtrlKey(); TouchEvent touchEvent = getTouchEvent(); if (touchEven...
0
22d70bea7be68e911f75bb9521c6a536
8d851c3978808f0b84ff3ee820d812ee
Given the desired servicePort, return the allocated nodeport
all_service_instances = client.read('/'+service).value all_service_instances = ast.literal_eval(all_service_instances) my_instance = all_service_instances[container] port_mappings = my_instance['port_mapping'] port_mapping = port_mappings.get(port) if port_mapping is None: return default return port_mapping['e...
1
006e1207b7eaea1cda0605a1f5be976a
e5f71b370cda2e0a8d1196a3f2855626
Specifies that this IntervalVar must be present.
void notPresent();
0
c344a8769ee87b48f718574ab59a9c19
cf1e2ad31e0d07d1fe85db91d8a35a3a
获得一个文件资源管理器实例。
if (fileManager == null) { fileManager = new FileManager(context); } return fileManager; }
1
95a0481b9db76fe68352bb7a0a5fa3d3
5c3bd096da9061d49ca6a24d2afa9d3a
Método de persistência genérico, ultiliza reflection para leitura das propriedades
class Config extends \Marabaixo\Seguranca\Dominio\Config implements \Doctrine\ORM\Proxy\Proxy public function persist() { $this->__initializer__ && $this->__initializer__->__invoke($this, 'persist', array()); return parent::persist(); }
0
969ebac64794478f1e4bd9781f2d262c
ddb0189976cbf6eba56d6c86cafa67b3
处理请求的数据 表明处理由"-"隔开的数据数据,并转成DemoObj的对象
var dataObj = {}; const FUNC = TAG + "_parseDataObj()--- "; try { dataObj = buzz_cst_game.getDataObj(req.body.data, req.body.aes); } catch (json_parse_err) { if (ERROR) console.error(FUNC + "msg:", hint + "失败(json解析错误)"); if (ERROR) console.error(FUNC + "err:", json_parse_er...
0
b13d031ed7225b428c14ba8443f459b3
7af5d40343e2418177d7678001df9726
获取收件人姓名和电话号码,并将它们显示出来
tv_phoneNumber_show = (TextView)findViewById(R.id.tv_phoneNumber_show); tv_userName_show = (TextView)findViewById(R.id.tv_userName_show); informationHelper = new InformationHelper(this); database = informationHelper.getReadableDatabase(); Cursor cur = database.query("Information"...
1
9537489c6a02421fee7eac8f5c680f8f
f60c588251107c6befdf31c64eff4d7a
Hooked to filter: manage_edit-shop_order_columns. Add a column to the shop orders table.
{ $new_columns = array(); foreach ( $columns as $column_name => $column_info ) { $new_columns[ $column_name ] = $column_info; if ( 'order_date' === $column_name ) { $new_columns['order_referrer'] = __('Source', 'wc-refs'); ...
1
94835d346efe97082859d777a5a18b74
1067e28a2ff3a2f0a6e4d34adfd71cd2
Saves Current Game Data and Returns to Main Menu
public class MainMenuManager : MonoBehaviour public void BackToMainMenu() { SaveSystem.SaveGame(); OpenMainMenu(); needCoins = false; }
1
fb00bae6aaf0507b050fe944ba9185cd
8bd06e8d3311ff36790d13e842781591
Returns the MMTF version number (from the specification).
public class RXN2CMLConverter extends AbstractConverter implements CMLConstants public String getVersion() { return "V2000"; }
0
a342e61ab554bd5c7903c5c96d1656dd
1264e2a8506dbc509352cb7653021feb
\brief construct a list of available devices of a given type
int if_get_list(char ***listp, const char *mtype) { char **list = NULL; int errno_save; int num = 0; u_char *buf; u_char *ptr; int len; if ((len = if_info(&buf, TYPED_MEM_TEMP)) == -1) return (-1); for (ptr = buf; ptr < buf + len; ptr += ((struct if_msghdr *)(void *)ptr)->ifm_msglen) { struct if_m...
1
cb1edfb952ec37d9e8ab6cc97682c4e8
1bc119d1bebf24d4862014dfd07da051
Should raise OnPropertyChanged event when Folder title is updated.
public void UpdateFolderParent() { Folder folder = new Folder(); Folder childFolder = new Folder(); EventedList<Folder>folders=new EventedList<Folder>(); folders.Add(childFolder); folder.Folders = folders; Assert.AreEqual(folder, ch...
0
c964a173818def472deab1e8f4f15360
f8a4a61c8c6e9073da3969a35321f436
Rendering session configuration.
{ if ($this->_hsConfigRendered && !$runSilenthly) { return ''; } $config = array(); $config['graphics-dir'] = $this->getGraphicDir(); $config['outline-type'] = $this->getConfig('general/outlineType'); if ($this->getConfig('size/maxWindow')) { ...
1
f82d3d0da26d3987bc0f1355b89976ef
6a14af2bdfbe96472187cfee411fd0c4
# 2. Functional Evenness
evenness <- function(x) { x <- x / sum(x) - sum(x[x > 0] * log(x[x > 0])) / log(length(x)) }
1
5b48d007eb96f94c6ece4dc55fd16585
34279392b2fc69d410409df8f179166c
获取加密身份证
function GetIDCard() { var address = randomNum(999999, 100000); var date = new Date(); var yearfull = date.getFullYear(); var y = randomNum(yearfull + 1, yearfull - 70); var m = randomNum(13, 1); var d = randomNum(30, 1); var z = randomNum(9999, 1000); if (m < 10) { m = '0' + m; ...
0
b97897d96089797db9ae4f53b1fc70b2
f00434067c2b6e27fb984ab5669c0c65
绑定产品编辑事件
function ProductEditCtrl($scope, $routeParams, $http, $location) { console.log($scope) $scope.$on('EventEditPoduct', function (event, product) { console.log("EventEditPoduct"); console.log(product); $scope.productEditPage = 1; $scope.PTypes = angular.copy($scope.$parent.$parent.c...
1
b656d40bb8d06037c896dd07998760c7
09d904d5bf353170c102c8e56dd1a528
Mark project as incomplete.
{ return DB::table('projects') ->where('id', '=', $request->input('id')) ->update(['Completed' => 1]); }
0
fc81057cb01a3a53a6008b2481159b86
c2be7186359c0ed720df3ed9d8faaeca
カード売上フラグの取得
public class CartDTO public boolean isDeleteFlg() { return deleteFlg; }
0
5d3f30dfbe42caf673ffe73329a817cc
4922e1f11f64e5b5df0c3c750fa7e111
随机数组不同的值(不会改变数组)
function random(arr) { var newArr = []; var len = arr.length; do{ var index = Math.floor(Math.random()*len); if(newArr.indexOf(arr[index]) === -1){ newArr.push(arr[index]) } }while (newArr.length < len) return newArr }
1
d099588355450081982757cb1adc7341
5bf51767e187097ceeb1d843f08cdf5e
Saves the changes applied to the <see cref="Album"/>.
namespace SmartPresenter.BO.Common.Entities public class MediaPlaylist : IPlaylist<Image> public void Save() { }
0
918d06a3c6db3c6bec668e5f208886e0
37d069cbdb88c04a00edda5811e5a0e1
Get a list of all spells
namespace DungeonResource.Components.Service public class SpellService : ISpellService public List<Spell> ReadAllSpells() { return _genericRepository.Read(); }
1
262100655f26c0f8f8d62c7f88c9d4e9
2c1ffee3dd71f3d8651510700e7ef01e
显示动态图
List<String> recentCourse = Utils.getRecentCourse(); showRecent(view,recentCourse); String content = "这是一个动态的正文;这是一个动态的正文;这是一个动态的正文;这是一个动态的正文;这是一个动态的正文;这是一个动态的正文;这是一个动态的正文;这是一个动态的正文;这是一个动态的正文;这是一个动态的正文;这是一个动态的正文;这是一个动态的正文;"; List<String> imgs = new ArrayList<>(); List<Dynamic> dy...
1
ea531753ba28d9746ab43986b344b310
4dc918c993354923416ea51149f409db
@brief Set the start display point of lcd.
void Set_Start_Column(unsigned char d) { ssd1306SendCommand(0x00+d%16); ssd1306SendCommand((uint8_t)(0x10+d/16)); }
1
9ad679b76a9e07023e72a3fed5048740
e1f04582dfa85e7141b7d91c91e50ff9
测试标准输入能否被设置偏移量
let mut stream = BitStream::new(vec![15, 16, 17]); assert_eq!(stream.read_bits(5).unwrap(), 1); assert_eq!(stream.bit_offset, 5); assert_eq!(stream.read_bits(3).unwrap(), 7); assert_eq!(stream.bit_offset, 0); assert_eq!(stream.byte_offset, 1); ...
0
53ed4c0739c7072ea54967c17f295032
9c5969c538eac6fc161a88ba523180a0
convert Earth Centered Inertial (ECI) to Perifocal Frame
def eci_to_ecef(time, r_eci, v_eci=None, a_eci=None): OMEGA_E = 7.29211585275553e-005 th = time_to_gast(time) t = vt.Matrix([[math.cos(th), math.sin(th), 0], [-math.sin(th), math.cos(th), 0], [0, 0, 1]]) t_dot = vt.Matrix([[-OMEGA_E*math.sin(th), OMEGA_E*math.cos(th...
0
542155119eb3c4358158d3ead6cd41bd
697356a10a449c7cc6bfa092f85e3dbb
A dict whose items can also be accessed as member variables.
class dictobj(object): def __init__(self, d): self.d = d
1
7c7a505138732526eb5cb1d8627de2ee
38cdc197e0cab145cadff9107ec98570
Gets the last base.
namespace SharpNeat.Genomes.Neat public class NeuronGeneList : List<NeuronGene>, INodeList public void LocateLastBase() { for (int index = 3; index < Count; ++index) { if (this[index].NodeType == NodeType.Local_Input) { _lastBaseInd...
1
58cf5c8bdad8eb29f9c607f71bd0d667
ddfd05229d0448624b604af3c87d5ecc
Reverse slice of integers
PyObject obj0 = frame.stack.pop(); PyObject obj1 = frame.stack.pop(); PyObject obj2 = frame.stack.pop(); PyObject obj3 =obj2.__slice3__(obj1,obj0); frame.stack.push(obj3); }
0
4271f6cc1105badfe41e3b8b0305354d
ee83353abf38a2e80c9a46a2dbc7989f
@brief Sets the local (per model) clipping on or off.
public class VolumeSurface extends VolumeObject public void SetClipEyeInv( float[] afEquation, boolean bEnable ) { m_kLightShader.SetClipEyeInv(afEquation, bEnable); m_kLightShaderTransparent.SetClipEyeInv(afEquation, bEnable); }
1
fb9fac0bbfb061039998473bfe984d36
ae7d25b994f7045666b79ccbde43fc11
Test one MC simulation, where Size, temperature and MC steps need to be input.
fmu = pyfmi.load_fmu(building_model.fmu_path) opts = fmu.simulate_options() t_start = 0.0 t_end = 86400.0 opts["ncp"] = int(t_end / self.step_size) res = fmu.simulate(start_time=t_start, final_time=t_end, options=opts) output = res.result_data.get_data_matrix() ...
0
1d93269a7898e9c2be1cabfbeac7b4ad
0fddd8ad8e16a176a6878ecd4f9b83f9
print some shuffled arrays to make sure they look right
namespace Spr2019CS_ArrayCollections class Program private static void PrintArrays() { Console.Write("dValues: "); IEnumerator enumerator = dValues.GetEnumerator(); while (enumerator.MoveNext()) Console.Write($"{enumerator.Current} "); Console....
0
e8a0719bb4742066219f29abe02e8c3a
9b9763ca13c28eb39f2effde9f9395eb
根据指定主键获取一条数据库记录,takeheart_summary_day
req.dataKey = dataKey; rcp.getDetailInfo(req); let beforeData =yield this.beforeAccessDB(req, sqlCommand || this._daoModel.getByIdSql, req.params.id, "detail"); if (beforeData.canceled) return {successed:false,errorcode:1,errormessage:"canceled"}; let result = yield this._daoMode...
1
4475b6747042451891fbcc8c38290cfc
92f8c5f47d0306543ff37de8d837c2ea
search for a make.
$.ajax({ url: 'api/', method: 'GET', data: {distinctMake: '1'}, success: function(data) { $.each(data, function(index, value) { $('#selectMake').append("<option value=\""+value.make+"\">"+value.make+"</option>"); }); }, error: f...
0
665a5f1dd28c4181679adf3bb1384c0d
31d557b124b7c33840a8fc502f6b36ba
编辑框居中显示
obj.style.display="block"; var screenW=document.documentElement.clientWidth; var screenH=document.documentElement.clientHeight; obj.style.left=(screenW-obj.offsetWidth)/2+'px'; obj.style.Top=(screenH-obj.offsetHeight)/2+'px'; window.onresize=function(){ showCenter(obj); }; }
1
b65beb52aeb2845eb3273b69ddf59ddd
067fe10b440a020310f2df7e67293ec1
根据lab_id获取实验室基本信息
class Lab_tb_serv{ function getLabById($lab_id){ $sqlHelp=new SqlHelp(); $sql="select * from lab_tb WHERE lab_id='$lab_id'"; $res=$sqlHelp->execute_dql_quick($sql); $lab_tb=new Lab_tb(); $lab_tb->setLabId($res[0]['lab_id']); $lab_tb->setLabName($res[0]['lab_name']); ...
1
f582e11279e8b0ec36eb4b1c0336d490
dc083c9c7d42ccc4aef2aa20f6ad9c0d
编辑体重
[ProducesResponseType(200)] public IActionResult Edit(GWeightSonModel model) { var response = ResponseModelFactory.CreateInstance; if (ConfigurationManager.AppSettings.IsTrialVersion) { response.SetIsTrial(); return Ok(response)...
1
32091786aeb012d0ca4de83fbf73efea
9067cf46af1309826d3c04d80742c674
Lấy danh sách danh mục của tin tức
function GetCategories($cat = 0, $line = '', $result = array(), $level = 3, $post_type = 'news') { global $db; if (!$result) { $result = array(); } $langArray = GetLanguagesActive(); $q = $db->selectpostcat("hien_thi=1 and cat='" . $cat . "' and post_type='" . $post_type . "' and lang_id='" . $langArray["...
1
97fa92d7e9fb2ea561ce88d31d422c83
5f8a4cbfd39e83e19f6ed8ac8a862a9e
No interaction, so only main effect terms are expected.
class IRTModel(SkillModel): def feature_matrix_from_interactions(self, df): return
0
822997b93512c1160b2379d530248fab
b96fb4c3e96f2a6213573aad918e27f0
起動停止スクリプトを更新する
{ if (File.Exists(startupData.ShortcutFilePath)) { buttonStartUp.Text = "スタートアップ解除"; } else { buttonStartUp.Text = "スタートアップ登録"; } }
0
aba24b8e8f4b20eb2945b83aa6e03124
366ecfd35acd1be0af0be441a2c25169
Saves the current scene.
{ if (string.IsNullOrEmpty (scene)) return false; var currentScene = CurrentActiveScene; if (string.Equals (scene, currentScene)) return true; #if UNITY_5_3 || UNITY_5_3_OR_NEWER bool saved = EditorSceneManager.SaveCurrentModifiedScenesIfUserWantsTo (); #else bool saved = EditorApplicatio...
1
08426e5dd47774c4cfe52af6c8f00d25
3c30b72e41711da9934173689d64f25b
龙与地下城游戏:左上角出发,只能向下或向右,每个值代表加血或减血,求到右下角至少剩1血量,骑士所需的初始血量.
int rowNum = dungeon.length; int colNum = dungeon[0].length; int[][] dp = new int[rowNum][colNum]; dp[rowNum - 1][colNum - 1] = 1 - Math.min(dungeon[rowNum - 1][colNum - 1], 0); for (int i = rowNum - 2; i >= 0; i--) { dp[i][colNum - 1] = 1 - Math.min(dungeon[i][colNum...
1
13d3a6dac446d6054955d90f7c99d000
72b98a2604471df404be924792125663
扫描控制层,自动注册所有控制层的方法,作为websocket的事件
EventBus.$on('addLayerToMap', (layer) => { this.addLayerToMap(layer) }) EventBus.$on('removeAllLayer', () => { this.removeAllLayer() }) EventBus.$on('instanceMapServer', (layerUrl, layerName) => { this.instanceMapServer(layerUrl, layerName) }) EventBus.$...
0
e8f67ded6a9fbee3c215d687c6367b2c
8769eb03a3378e410e6c7e16abe53928
Create schema models from an API service discovery document.
self.client = client data = json.loads(requests.get( urljoin(self.client.base_host, schema_url)).content) self.detail_methods = data['allowed_detail_http_methods'] self.list_methods = data['allowed_list_http_methods'] self.default_format = data['default_format'] ...
1
755d8a926ae3eeacbddbae1e3b63aa5d
5a3947af7e79499402bb1e7bffc3820c
Delete a custom showcase thumbnail
class ThumbnailController extends Controller public function destroy(Thumbnail $thumbnail) { $thumbnail->delete(); return response()->noContent(); }
1
e6544a366ded3d45b839d1e0d4e07a6d
cbeccadb58a0855c453eedc9026bd0af
Create user if the login was successful
namespace EDC.ReadiNow.Security.AuditLog void OnCreateUserAccount(bool success, string userName);
0
46d866160e03b2a980be32ddba91f4af
3db7159565325573eacb5270031d6191
第1引数座標との距離が第2引数の値以内に位置するキャラクター全てを格納したリストを返す
public class NearestFilter:AbstractFilter public override List<Creature> ConcreteFilter(List<Creature> orignalList, int max) { float[] distanceSquare = new float[orignalList.Count]; float cursor = 0; int num = 0; for (int i = 1; i <= orignalList.Count; i++) { dist...
0
046568d24a98d936b29c551758e25a3f
534100a25624dc19380036ec156f8acf
Exit a parse tree produced by {@link TSqlParser#generate_new_keys}. @param ctx the parse tree
public class TSqlSyb155ParserBaseListener implements TSqlSyb155ParserListener @Override public void enterGenerate_new_keys(TSqlSyb155Parser.Generate_new_keysContext ctx) { }
0
c1575249df09c0bbd4579f505f8221e8
9992d694a706e53d15710e74a1b773be
Without Using Swapping:
public class SwapStringWithoutThirdVariable public static void main(String[] args) { Scanner in = new Scanner(System.in); String string1=in.nextLine(); String string2=in.nextLine(); System.out.println("String before swapping: "+string1+ " and "+string2); int length = string1.length(); string1=string1+string...
1
da9cdebd6cea8b2236771b77c7d45121
59a9a854d00d582c803c9ecd444455db
Test unlinking of file from dataset and aborting.
def test_unlink_file(unlink_file_setup): svc_client, headers, unlink_payload = unlink_file_setup response = svc_client.post("/datasets.unlink", data=json.dumps(unlink_payload), headers=headers) assert_rpc_response(response) assert {"unlinked", "remote_branch"} == set(response.json["result"].keys()) ...
0
aa10469246bacefb1ea175fab214fadd
c7469b33428b37bebec702e37055d537
Load file contents and check for any server-side code
if (is_file($filename)) { ob_start(); include $filename; $contents = ob_get_contents(); ob_end_clean(); return $contents; } return false; }
1
c7fcda92f38adc3f5baca1c93df596b6
89ffc60726c3cfb0dedf68922f9be850
Vote on a comment. OAuth authentication required.
class Comments extends EntityRepository public function vote(bool $upVote = false, int $id, string $remoteAddr) { }
0
5200937f13247321e34bb4460eeeb11f
5287c0c4c16060a4c64d49511f9603c2
True if block has additional content attached to it.
export class ContentAccess extends ComponentElement @prop({attr: true, boolean: true}) get block() { return false; }
0
0bd506a81aeb632305cd5d160ac498cc
da61698651df6b7c532db112e6d09709
Copy pixels from program memory (flash) to the display
register char c; while( (c = pgm_read_byte(progmem_s++)) ){ uart_putc(c); } }
0
a1ba4c24ef853190b4cdee34a22e673b
676885a8d11c4a0fc54a3067e88d56c5
check if vertex is in vertList and return it
class Graph(object): def getVertex(self,key): if key in self.vertList: return self.vertList[key] else: return None
1
0d4494fbc1b529ac11cdca4686944710
c05c47976f4602e201424ab6a7b5b5e3
Get a batch of observations X from a batch of factors Y.
class FedModel(ABC): def process_y(self, raw_y_batch): pass
0
ef354f97a036c537eaeaca571349a46b
63be0ee1c8add1c288f4bed24ff9ef92
Retrieve a list of check-ins at a particular spot.
class Foursquare(object): class Users(_Endpoint): def checkins(self, USER_ID=u'self', params={}, multi=False): return self.GET('{USER_ID}/checkins'.format(USER_ID=USER_ID), params, multi=multi)
0
7ea8f1b9778c29ed6e4661f7ace6491b
b9ee41a7f77e41abf62276365841e846
Function to send acknowledgements with the given acknowledgement number.
void sendACK(uint32_t e, uint32_t n) { Serial3.write(65); uint32_to_serial3(e); uint32_to_serial3(n); Serial3.flush(); }
1