query_id
string
corpus_id
string
query
string
code
string
label
int64
a49da10d8af79bb23cdbb20cb1b183e7
26db00c1d0fe1ecb0db864734a4140c6
Disable binary_sensors by default.
def disable_sensors(tag): tag.IRtemperature.disable() tag.accelerometer.disable() tag.humidity.disable() tag.magnetometer.disable() tag.barometer.disable() tag.gyroscope.disable() tag.keypress.disable() tag.lightmeter.disable()
0
9a5426faa0043b29d2b207d8abea0d8a
9c41d81b04e3ef1d86bf3bc0b01329de
Initialize the refracted ray and trace it. in_hit (info about the ray-surface intersection) out_hit (info about the refracted ray) (b) Set out_hit.ray_ior and out_hit.trace_depth. (c) Remember that the function must handle total internal reflection.
void Trace(Line &ray, const Polygon *polygons, int polCount, const SpotLight *lights, int lightsCount, float &R, float &G, float &B, short lookCount) { float reflectR = 0.f; float reflectG = 0.f; float reflectB = 0.f; int crossedPolInd = 0; float t = 0.f; const bool rayHasC...
0
83a00cc4a8287be1f4b3da8b8ae74ea9
fc08b9351806a36854e9d2cad8068c60
busca por cedula o por numero de carnet
function buscarPersonaN(cedula){ var funcion="find"; console.log(cedula+" buscando persona..."); $.post('sistema/controladores/persona.php', {cedula: cedula,funcion:funcion}, function(result) { console.log(result.exito); if(result.exito=='true'){ $("#found-namecn").val(result.nombre); $("#found-lastcn").va...
1
fc865de6d8f5b5600af5e4d7ad010d00
2b0817e1929815b67ed041fe3f4faedc
Description: The Bernstein polynomial of n, k as a function of t Input: k, n -> int s -> time scaling [0 ~ 1], float Output: Bernstein polynomial Note: https://pages.mtu.edu/~shene/COURSES/cs3621/NOTES/spline/Bezier/bezier-der.html
namespace UniLib public class BezierCurve private static float Bernstein(int n, int i, float t) { return Binomial(n, i) * Mathf.Pow(t, i) * Mathf.Pow(1 - t, n - i); }
1
75d7f901bfe3f987186be6a884552021
f9378200ee9562b70782a77b3e180987
Transfrom grid coordinates to canvas coordinates
{ var wx = GRID_OFFSET_X + gx * VERTEX_MARGIN; var wy = GRID_OFFSET_Y + gy * VERTEX_MARGIN; return {x: wx, y: wy}; }
1
a7a69e8fa3790e169c0868b9d2e05281
b143c244b87cd717d0613c73b0a7affd
Initialize a given path environment from user-space.
init_env(env_t env) { reservation_t virtual_reservation; int error; allocman = bootstrap_use_current_simple(&env->simple, ALLOCATOR_STATIC_POOL_SIZE, allocator_mem_pool); if (allocman == NULL) { ZF_LOGF("Failed to create allocman"); } allocman_make_vka(&env->vka, allocman); error = s...
0
162f7ef19ce62c1345b60c1a46f32ea9
49da324e19e4a3e0c39697e6615a3a33
Makes changes to a ProductSet resource. Only display_name can be updated currently. Possible errors: * Returns NOT_FOUND if the ProductSet does not exist. * Returns INVALID_ARGUMENT if display_name is present in update_mask but missing from the request or longer than 4096 characters.
namespace Google.Cloud.Vision.V1 public abstract partial class ProductSearchClient public virtual stt::Task<Product> UpdateProductAsync(UpdateProductRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException();
0
25f3ab4a51b587c41eff618f6ce12b51
8892aef651c88615fc4e6ea6ad00e8a3
This method will read one ASCII character from given byte array, increasing given index as required.
{ if ((m_idx + peek) < Source.Length) return Source[m_idx + peek]; else return (char)0; }
0
953883e9b445897c148c71b9446917e1
af2e7250fe2c7ba06e5d5d4e2ad2d360
현재 실행되는 주소가 BreakPoint에 있는지 Linear Search로 판별한다.
bool BaseSystem::hasCurrentBreakpoint(unsigned int threadId) const { return currentBreakpoints.find(threadId) != currentBreakpoints.end(); }
0
f7dd6d5927965cbd849769f4ef6a8084
6bfa3e27be3f9b36838013a2acda0365
指定された Unicode 符号点が NameStartChar の範囲に適合するかどうかを調べます.
namespace WordsCheck class NameCheckInfo public bool IsInUnicodeZone(char In) { if (listUnicodeRange == null) { return false; } for (int i = 0; i < listUnicodeRange.Count; i++) { if (listUnicodeRange[i].Begin <= (UIn...
0
d3769e1cac27b9c05e0cc06601b4ee66
92da846cd3cc51b1d50e25647b7ce210
Verification que l'utilisateur souhaitant être modifié est bien l'utilisateur connecté
if(userConnect() && $_SESSION['membre']['statut'] == 1) return TRUE; else return FALSE; }
0
8f4ad4d0574a571633957c335c723705
864ff84c72e65390327a6e255a9a5eec
管理员根据No删除普通用户
try { Class.forName(DRIVER_NAME); System.out.println("正在连接数据库..."); Connection con = DriverManager.getConnection(DB_URL, USER_NAME, DB_PASSWD); Statement sta = con.createStatement(); String sql = "DELETE FROM user WHERE Uno = '" + no + "'"; ...
1
574dbbff07533b8faa7a5b0161ac65ae
6d84a385d5c356d19e215c53718d4b28
used in src/analysis/compare.py
def compare(df1: pd.DataFrame, df2: pd.DataFrame): assert (df1.columns == df2.columns).all() std = (df1.std() + df2.std()) / 2 df_result = pd.DataFrame(index=df1.columns) df_result["mean_ae/std"] = np.abs(df1.mean() - df2.mean()) / std df_result["median_ae/std"] = np.abs(df1.median() - df2.median())...
1
c6a38cb5604b6f0c7ab8be6c0112b87c
8428322259ad6e9e73e55e8c90a03138
列出不是某用户下的角色
namespace SecurityHttp.Repositories public class MemberRoleRepository : IMemberRoleRepository public Task<IEnumerable<Role>> GetExceptRolesAsync(string member) { return _commonWeb.GetCollectionAsync<Role>($"{Url}/except", new { member }); }
1
6865d20dbe5c363f29fb0db3622faa01
aba5e0537b7c0af8ed643f0a01e7ecdb
This load balancer strategy chooses one of the servers randomly to serve the request
public class RoundRobinRule_Dawei extends AbstractLoadBalancerRule protected int chooseRandomInt(int serverCount) { return ThreadLocalRandom.current().nextInt(serverCount); }
1
9279e699ce31bbeb3ea5ba1968f6cddc
43238748f6b8520a62767d00065f9641
实现卷积层的反向传播
A_prev, A_col, W, b, pad, stride = cache n_C, n_C_prev, f, f = W.shape dZ_reshaped = dZ.transpose(1, 2, 3, 0).reshape(n_C, -1) dW = np.dot(dZ_reshaped, A_col.T).reshape(W.shape) W_reshape = W.reshape(n_C, -1) out = np.matmul(W_reshape.T, dZ_reshaped) out_backward = transform_to_volume(out, A...
1
42d982be94dd725180ee9ce94a77737b
577ee8cdf1ff9866de70c271d76481d2
If context is not constant within an entity, raise an error.
def test_context_immutable(): with pytest.raises(ImmutableStateError): Context().abc = 1
1
28b00e930f852069c8b2a86ea46f3416
7f483895fc8fc2fa938b23f3731162b4
========================================================= RENDER DA LEGENDA DAS CORES =========================================================
public class CoresControle : MonoBehaviour private void SetupCores() { _fundo.color = _data.CorPanel; Camera.main.backgroundColor = _data.CorFundo; }
0
4cddbb3bdb28e4737c490177322a25ff
59a78d269314debd7e1f4687aac3a2d1
设置默认标题栏
public abstract class BaseActivity extends AppCompatActivity implements View.OnClickListener private void initDefaultTitleBar(View view) { MyLog.d(TAG, " init default titlebar ..."); if (view != null) { view.setBackgroundColor(getResources().getColor(R.color.common_color_green)); ...
1
a7a4caad2de27a29b49e2bfabd511667
29044efe0421c4737e7004a827c6e79c
going through freelist and finding best fit
void best_fit(struct memory_node * finder, int memory, char name[]) { int find = 0; struct memory_node * marker = NULL; struct memory_node * new; while(finder->next != NULL){ if(strncmp("Unused",finder->name,6) == 0){ if(finder->size >= memory){ ...
1
2d084f72cf6b3498bcb77fe0a55efd7a
a2bd793cc9e383ee2b5f03b1127d983d
Convenience method to check whether this song represents a custom song on Newgrounds or an official in-game song.
public boolean isOfficial() { return official; }
1
81ed93380c3451928cf1c3e377274e15
d976217302ab9acb9731c385a26df518
注册FixedUpdate委托
function looper:StartListenFixedUpdate(func, ...) AddListener(fixedUpdateList,func,...) end
1
9e5c677defb58f57bafcfedb82db02e4
afbc99d74bcfe09c3d6394e89640e0f5
Verify hmac signature.
if isinstance(token, str): token = token.encode() if isinstance(request_data, str): request_data = request_data.encode() if isinstance(signature, bytes): signature = signature.decode() if signature.startswith("sha1="): signature = signature...
1
fec1dff75b64f687a3b44ab207a43d20
c053b0812493f71355c94f6f876ccd8b
更新淘宝上的宝贝标题
String sql = "UPDATE t_bid SET title=:title WHERE id=:bid_id"; Map<String, Object> params = new HashMap<String, Object>(); params.put("title", newTitle); params.put("bid_id", bidId); return super.updateBySQL(sql, params); }
1
088bbe69324dbdf667759aee11065075
7170285c97e7a1777852d6e2552b69af
3. Показати останню покупку певного покупця по імені та прізвищу
{ try { string s = " "; List<Order> list = Create(); List<Order> list1 = new List<Order>(); OrderService service = new OrderService(); foreach (Order order in list) { if (o...
0
469ff8d068a4272e3fd1a5913afca3bc
57dee546682b0ca75391e2a044ed00e2
产生一个包含大小写字母的随机字符串 长度
{ if (is_null($chars)){ $chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; } mt_srand(10000000*(double)microtime()); for ($i = 0, $str = '', $lc = strlen($chars)-1; $i < $len; $i++){ $str .= $chars[mt_rand(0, $lc)]; } return $str;...
1
9b6ee79daffba7dea863301014cd4d3b
7ce4a8e57ff24e6d036c9d93f2bacf17
Desktop GL always supports BGRA formats.
bool Spout::IsBGRAavailable() { return interop.IsBGRAavailable(); }
0
4c478fe3baeb3cb16519c9f5c1b82dea
508bb393d5f45bbb2fdf4c54a401d3c5
Gets total posts group by language.
public function getTotalGroupByStatus();
0
51c30b9c05fa99ff5ef1399f8bf8fef1
88b1bd6ac5d82fdd0a896965c31f9af8
删除方法,如果ID 上是以","隔开的字符,会认为是一个数组,批量删除数据
if ((!is_numeric($ids)) && (!is_array($ids)) && (!is_string($ids)) && (!is_object($ids))) { return false; } if (is_numeric($ids) || (is_string($ids) && (strpos($ids,",") === false))) { $result = $this->del($ids); return $result; }elseif(is_object($ids)...
1
d0b73a81a9ae6d3da9b8cab234fc77ca
50a70a1c891ff26b5d252c7e2c6ea1aa
Toggle arrow direction and border color
{ if (this.UnlinkedTerragonGrid.ActiveRow != null && this.UnlinkedTerragonGrid.ActiveRow.Band.Index.Equals(1) && this.UnlinkedPolygonGrid.ActiveRow != null && this.UnlinkedPolygonGrid.ActiveRow.Band.Index.Equals(1)) { this.ArrowButton.Enabled = true; ...
0
ba5d6eca3ebe0e0ea5681848e356b2e4
ba513a894f4d897a76fe7a9aafa41889
An unauthenticated user should see the normal landing page.
client = Client() response = client.get( path = reverse('home') ) assert response.status_code == 401 response = client.get( path = reverse('redirect') ) assert_contains("example.org", response.content)
0
269830bd59a13b5efbb151b624dae702
0fa2059819552a811b157542730c07df
! \brief Returns the string value of the previous state.
public class FSM extends AppCompatActivity public String getPreviousState() { return previousState; }
1
2e1efbeca7c0f6e64f70c5221717b3f1
58b69eeeeb0159600b7e2bcc8b3c33c1
Opens a new parent undo unit, which becomes part of its containing unit's undo stack.
namespace System.Windows.Documents internal class ImmComposition private void OpenCompositionUndoUnit() { UndoManager undoManager; DependencyObject parent; parent = _editor.TextContainer.Parent; undoManager = UndoManager.GetUndoManager(parent); if ...
1
cbf7471c8a72ec2ae80ded498637551d
579fad15f3612fce789dfb6355f52df6
++ Routine Description: This routine is used to log System Errors in human readable form. Arguments: err - Error number obtained from GetLastError() str - String pointer holding caller-context information Return Value: None. --
{ LPVOID lpMsgBuf; int ok; if (!errnum) errnum = GetLastError(); ok = FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, errnum, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &lpMsgBuf, 0, NULL); len--; if (!ok) COPY...
0
073fb3a97b8753424c4dd352b907adf1
5bb5fbfdb40e7c825b4c85cf1ddaa645
Constructor: read image and specify dimensinons.
class Image: def __init__(self, img: str): self.image = cv2.imread(img, cv2.IMREAD_COLOR) self.height, self.width, self.channels = self.image.shape
1
e8763df09e124465a87aeb5f9dfd470c
d5db2b9815e96fd30def8c02dfff7ecd
find color number for position
int Puzzle::getSpriteNum(sf::Vector2f posn) { for (int i = 0 ; i <m_rows * m_cols; i++ ) { if (v_sprite.at(i).getPosition() == posn) return i ; } ;return 0; }
0
39c3f34478348055b213b06bba25b9ad
b8e1f61b1732c6cf0a3ef1992dfca3d2
获取怪物战斗动画
local filesExists,imageURL,plistURL,url = ObjectTool.checkAnimation(self.animationName) if(filesExists == true) then self.animation = ObjectTool.getAnimation(self.animationName,false) self.animation:getAnimation():playWithIndex(0,0,0,1) self.container:addChild(self.animation) self.an...
1
e19d300455d33823def41e2cba1acca6
8fcf695619d9ec97bc577cadbcc8de62
From https://www.iitk.ac.in/kangal/papers/k2012016.pdf
def kl_gaussian_gaussian_analytic(mu_q, logvar_q, mu_p, logvar_p): batch_size = mu_q.size(0) mu_q = mu_q.view(batch_size, -1) logvar_q = logvar_q.view(batch_size, -1) mu_p = mu_p.view(batch_size, -1) logvar_p = logvar_p.view(batch_size, -1) diff_mu = mu_p - mu_q trace = torch.sum(torch.exp(l...
1
5c642587acca92c48060d720075b18da
0437a234569becf0e1c447cc5b014d0a
Obtiene del servidor el siguient correo del usuario y lo imprime por pantalla.Si no habia correos en el servidor informa por pantalla de ello.
def enviarCorreo(): import urequests response = urequests.get("http://alex1423.pythonanywhere.com/") response.close() print("Movimiento detectado")
0
57749e8e1f2822f6017c7a2d3ca3f64c
5c0a6f8af45f16369b06a66e6c7099cd
解压ZIP压缩包, 存在文件名乱码的情况
class FileHandle(object): def unzip_file(self, zip_path, remove_dir=False, subfile=False): current_path = os.getcwd() name_list = [] path_file_list = [] messy_name = False with zipfile.ZipFile(file=zip_path, mode='r') as zf: zip_dir, zip_name = os.path.split(zip_p...
1
6675f294e21a76e8c184cdee1948e402
f112961e679c53c60a4d16b05c4a99d0
Retrieves the node's name (I.E. the current move).
public class UINode public String getNodeName() { return locationName; }
1
4b1143d994eba2965b83cc2417358c7d
6ad096b909c4192d4885fad64648fc80
Reset all of the static variables:
void JSphVarAccFile::Reset(){ MkFluid=0; AccCoG=TFloat3(0); AccSize=AccCount=0; delete[] AccTime; AccTime=NULL; delete[] AccLin; AccLin=NULL; delete[] AccAng; AccAng=NULL; delete[] VelLin; VelLin=NULL; delete[] VelAng; VelAng=NULL; CurrAccLin=CurrAccAng=TDouble3(0); AccIndex=0; }
0
033427c951a59d52ea67186369fdc630
9f2e6d9a3602b4887242e5bedd73320c
Determines if the url is a url for the bookmark page.
@Singleton class UserRegisterBookmarkModel @Inject constructor(private val bookmarkRepository: BookmarkRepository) fun isSameUrl(bookmarkUrl: String): Boolean = (this.bookmarkUrl == bookmarkUrl)
0
80784b420ed46fc8fc27a61d136c977c
88c855f56a97df6c5439e0c86a854eda
https://stackoverflow.com/a/12141511/7742211
def progress(iterable, prefix='', suffix='', decimals=1, length=50, fill='█', printEnd='\r'): total = len(iterable) def print_progress(iteration): percent = ("{0:." + str(decimals) + "f}").format(100 * (iteration / float(total))) filled = int(length * iteration // total) bar = fill * fil...
1
3d0ba1370624cfc1b97f498863ba5692
450c4f0e65b8a6f80262149781768bb8
Returns a face from the active queue to be completed. This needn't be the one at the end of the queue, because the choice of the next active face can affect how many SPLIT symbols are produced. This method employs a fairly simple scheme of searching the most recent 16 active faces for the first one with the smallest nu...
namespace MIConvexHull internal class ConvexHullInternal ConvexFaceInternal GetNewFace() { return RecycledFaceStack.Count != 0 ? RecycledFaceStack.Pop() : new ConvexFaceInternal(Dimension, EmptyBufferStack.Count != 0 ? EmptyBufferStack.Pop() : new VertexB...
0
4ce1fb57a1b7fe4efea93984760c8baf
16d4715f930fb32358a21d904438f874
Checks if the agent reached the dead end.
isDeadEnd (index){ return (this.deadEnds.indexOf(index) != -1); }
1
8c05124855d40288ee3c42fdebda07d3
f2c3d75ded1baa3e3be5ab21c3c31092
Gets the Enum by name.
{ $result = null; foreach (self::values() as $enum) { if ($enum->name() === $name) { $result = $enum; break; } } return $result; }
1
16c63db5a88d5d3f8eaa839edbf1ca6d
f8fa44f44af2cc32c6dbea0a02479046
Simple function which triggers evolution.
def _on_evolving(**kwargs): global _evolve_lock _evolve_lock += 1
0
33012667e6b181500ccb4bc9e00191cf
ad27f1019b43c49c95d33cff652aca05
内部配列に登録されたパラメータを、hidden型inputタグで一括出力する (除外リストのパラメータは除く) 引数 : : 無し 戻値 : : 内部配列をhidden型inputタグの形式で一括出力したもの
{ static $arrPARAMS; $fst = false; if (empty($nm)) { $fst = true; $arrPARAMS = ''; } foreach ($prms as $k => $v) { if (is_array($v)) { $nm[] = $k; printParams($v, $rtrn, $nm); array_pop($nm); } else { if (!empty($nm)) { $arn = $nm; $an = array_shift($arn); foreach ($arn as $c) { ...
1
fbcc173a30c0d573b005bea357cffc5c
ccedccb3f49e8e495f0815328dd2e229
Return TEXT string of this service result. For serialized data, JS consumer can unserilize it if using tool such as PhpJs See http://phpjs.org/pages/home for mor detail. FlexicaCMS use php.default.namespaced.min.js
class TWWServiceStatus extends TWWWsdlClass public function getResult() { return parent::getResult(); }
0
ce8bfce3d97ec2bde2aec03bcc0403a3
5e823a4e03f2e019c9807225903ea04d
공통메세지관리 리스트 출력
@Service public class MessageService public List<Map<String, Object>> getMessageList(Map<String, Object> map) { return sqlsession.selectList("messageDao.getMessageList", map); }
1
1b7b20b65ef5f8afb687c2460f801d35
4a4cd467a6b64928484383ac8ccdc8a2
Checks whether a share is currently active.
{ return $this->isOneActive() || $this->isTweetActive() || $this->isShareActive() || $this->isLikeActive(); }
0
b3fabfb390416379bc244f0c65df4273
25418e445e941890beb58c38c48680cb
Assign media item to a media tree node.
PointerByReference libvlc_media_new_as_node(PointerByReference p_instance, String psz_name);
1
a61446720832fd211ea3593365699c83
808098403b45f7c24a4967e5a4237905
Get the default formatter name
class OutputExtension extends BaseExtension protected function getDefaultFormatterName() { return 'pretty'; }
1
b7d966d6c40b96f1313622069c7e4f18
f2e42d1488729d62422744884c915691
Plays the blink_string back as audio.
def audio(): os.system('say ' + str(blink_string))
1
e13815ed4f6037b3c6b104f863240cd1
b99c215f8af4b9fbf679cc89a72c1f29
Extrapolation Length
export class NlaStrip public get extrapolation(): 'NOTHING' | 'HOLD' | 'HOLD_FORWARD' { return PythonInterop.getEnum(this.interop, `${this.accessor}.extrapolation`) }
0
66418c7bcd19c7f801b655aac1ae4bf7
c6b7ac837e7a5e92b10c184bf0e7a001
向buffer写入两个字节的int值
{ buf[off++] = (byte) ((value >> 8) & 0xFF); buf[off] = (byte) (value & 0xFF); }
1
7590f6b14a2de29ea2a79d2135ab3565
662ff4bf75a4d6522efbeb8d08317153
Is the right bumper pressed? [top one]
{ return ( myStateIsGood && ( myState.Gamepad.wButtons & XINPUT_GAMEPAD_B ) ); }
1
be5714b2180730a73d80d80fe567d0da
9fbbad2a4799d14657e82c8b4bb12191
Тесутируем получение категории, если она есть в дереве
class CategoryAdmin extends Admin public function preUpdate($category) { if (!$category->getParent()) { $category->setParent($this->getRootCategory()); } }
0
3decc1a39ea3187a4feacb8bb67e2473
deb816a1f6404f74ca469b81dce192b5
Instructs to emergency land.
public class AutomaticFlightGuidanceSystem implements Observer public void landingAid() { }
0
cdc8c1111da55b1b28a0f4be40be45fc
29fcd0df5f9f4a6397a62f7aa50d4194
Creates a new adapter for an object of class '{@link org.oasis.xAL.ThoroughfareNumberFromType <em>Thoroughfare Number From Type</em>}'. <!-- begin-user-doc --> This default implementation returns null so that we can easily ignore cases; it's useful to ignore a case when inheritance will catch all the cases anyway. <!--...
public class PhotoShopFXAdapterFactory extends AdapterFactoryImpl public Adapter createEObjectAdapter() { return null; }
0
0a199723291c3552e9e44e49216bb438
d1fd89c49f9c5c29e193e5adffdd1299
Gets page titles for this PageList from specified list, produced by bot query interface ("api.php" MediaWiki extension). The function does not clear the existing PageList, so new titles will be added.
{ $params = http_build_query(array_merge(self::WIKI_PARAMS, ['titles' => $query])); $url = self::WIKI_HOST . self::WIKI_PATH . '?' . $params; $response = HTTP::timeout(self::TIMEOUT)->get($url); return $response->throw()->collect(); }
0
701deca6c51b7a7a59013a1254c1bf15
30809376bdf9948c40631441c4e4e6a8
Method called by Coroutine to start a ChillGameMode Mode round. If hasTimer is true then we call StartTimer on our CountdownTimer Class, and we pass the amount of time that should be on the clock. Then we change the boolean "gameHasStarted" which will remain true until round end.
{ BeginCounterRemaining -= Time.deltaTime; if(BeginCounterRemaining <= 0.0f) { RoundBegun = true; RoundBeginCounter.DisplayNone(); ResetBall(); return; } RoundBeginCounter.DisplayNumber((int)BeginCounterRemaining + 1); }
0
74c9385f031694e9540ad9f51b8c175d
52ed3c55fbed64f5a4a4c6a1c34d7666
Update static files
function updateStaticCache() { return caches.open(version) .then(function (cache) { return cache.addAll([ offlineUrl, WEBSITE_BASE_URL, WEBSITE_BASE_URL + 'customer-preferences', WEBSITE_BASE_URL + 'speci...
1
37a41f3f22646828dbff0669dec7b7f6
152789f3f5c27e77af1c499d599c5422
Remove discovery data for deleted devices
def device_post_save(sender, instance, **kwargs): if instance.deleted: try: di = DeviceInfo.objects.get(ralph_device=instance) di.ralph_device = None di.save() except (DeviceInfo.DoesNotExist, DatabaseError): pass
1
056dc3b8ae0739324e8b84a88b8c132d
0fa9198a27fb52c56e63360b6a7897b8
creates a portfolio object of all the currencies owned on Bitfinex. It has a Response object and a Tickers object. It has attributes: self.data: the data of the Response object with usd price added and zero balances removed. self.total: the total amount of dollar value of the currencies owned.
self.start_date = start_date self.end_date = end_date self.portfolio = Portfolio(inital_fund,transaction_fee) self.max_investment = 1/max_stocks self.stocks = {} for ticker in ticker_list: self.add_ticker(ticker, start_date, end_date, period)
0
fc8b573d3287f5f81976b66f684bf705
2a5a4c16d3b5c9665cf2e138a065a4a9
Return the argument that represents the given name in this AF.
class Command(object): def __getitem__(self, name): found = False for ad in self.args_definition: if ad["name"] == name: found = True break if not found: raise KeyError(name) if name not in self.arguments: raise KeyError...
1
80c05c18abf8f03ca6a009f1bdef8f22
1b7cf5fbf0e287f5b269445d0faa243b
Returns information about Azure SQL database usages.
namespace Microsoft.Azure.Management.CosmosDB System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationResponse<System.Collections.Generic.IEnumerable<Usage>>> ListUsagesWithHttpMessagesAsync(string resourceGroupName, string accountName, string filter = default(string), System.Collections.Generic.Dictionary<strin...
0
e0d99b30a8ce9ac2cce2669c7ffbe108
8a847b2f620c7cb723ae2e4866fc0e02
中序遍历非递归实现
Status InOrderTraverse_Non_Recursion(BiTree T) { SqStack S; InitStack(&S); BiTNode *p; p = T; while (p || !StackEmpty(&S)) { if (p) { PushStack(&S, p); p = p->lchild; } else { PopStack(&S, &p); visit(p); p = p->rchild; } } printf("\n"); return OK; }
1
eb55e30da954b073cea18eac98bde9e7
7e65d73c51957a6db78ac17bf3eea1cd
Sometimes, Google Cloud takes a few seconds to make the image accessible
class GCPMachineImage(BaseMachineImage): def refresh(self): image = self._provider.compute.images.get(self.id) if image: self._gcp_image = image._gcp_image else: self._gcp_image['status'] = MachineImageState.UNKNOWN
1
863f3ab851cd83cc42bb80ed71751bbd
b079a1dca557a0b3b3d04aa982f89f86
Center first order statistics.
public class TotalVariability protected void loadFirstOrderStatistic(String fileName) throws FileNotFoundException, IOException { loadStatistic(fileName, firstOrderStatistic); }
0
740e284580400dbb6d8c0b4a4ee4ce78
89eb90e9edac29e33ed3db0bf8e6ac02
Only select the historic process instances with which the user with the given id is involved.
namespace org.activiti.engine.runtime ProcessInstanceQuery involvedUser(string userId);
1
d6f1c26d7f4966002efe06776a3723aa
637c950799f761fc8b4d993c60360c48
상근날드 햄버거와 음료를 하나씩 골라, 세트로 구매하면, 가격의 합계에서 50원을 뺀 가격이 된다. 가장 싼 세트 메뉴의 가격을 출력한다.
fun main() { var minBurgerPrice = Int.MAX_VALUE var minBeveragePrice = Int.MAX_VALUE for (i in 1..5) { val price = readln().toInt() if (i <= 3) minBurgerPrice = price.coerceAtMost(minBurgerPrice) else minBeveragePrice = price.coerceAtMost(minBeveragePrice) } val minSetPrice =...
1
599a1456c34adbba43076834e4da327c
2d408476762f7298a247a9a0435c61c8
根据引擎功率计算现在的速度
{ return (engineRPM * 6) / (gearRatio[gear] * FINAL_DRIVE * 88); }
0
05baa83a9c93403c883c6b5cc2716148
1af4af1eb364872809a75542f7ce496d
设置SQL生成工具
namespace Draco.DB.QuickDataBase.OracleClient public class OracleAdapter : DataBaseAdapter public override ISQLGenerator GetSQLGenerator() { return new OracleSQLGenerator(this); }
1
38cc84719f89fd2aa1dc05f8129b921f
0ae2523ba705e8ef4ef72f0fc57eea91
Returns the entire HTML source between the opening and closing "html" tags.
class Browser(): def get_html(self): xpath = '//*' source = self.get_attribute(xpath, 'outerHTML') return source
0
eb29080d1f663016dd6578acfbf8ec3d
e9151e5408330a5c296bdc8f5fca5c9f
实现批量进货操作
class MaterialCombineController extends Controller public function BatchInbound(Request $request) { $input = $request->all(); trim_strings($input); $respArr = $this->model->getBatchInBound($input); foreach ($respArr as $id) { $temp['material_requisition_id'] = $id; ...
1
0932e1aba7fd89acf97f98f68d98b162
aced263418cc7e5a071d2e9bf952a352
Get the write start address of the receive buffer 受信バッファの書き込み開始アドレスを取得
class Cbuffer(ct.Variable): def get_write_address(self): return self.base_addr + self.wr_offset * Arch.addr_per_word
1
e8912ef85ae745f10baad980e0486753
768bd79446950a60c415e12bc98730be
查询多个商品参与的活动
{ $goods_id = (array) $goods_id; if(!$goods_id) { return []; } $key = "db:activity:info:goods_id:".implode("-",$goods_id); $redis = new RedisService(); $activity_info = $redis->get($key); if(!$activity_info) { $whereId =...
1
5692ffff1705dae543e814460bb6c4fe
b7965746781d0a470647bba29e27b71d
Get the history of all device states
namespace Onbox.Store.VDev public class Store<TState> : IStore<TState> where TState : class, new() public List<StateEntry<TState>> GetHistory() { return this.mapper.Clone(this.stateHistory); }
1
fb6cc868fbc1be80d32580c1630e8157
f0fadd15efa9d250b654b99946cb4197
向服务器发送消息后会调用此方法
void callback(T t, JeroMsgSend jeroMsgSend);
1
c9be67e17fede1fb924c4db2a17b1fd7
add7f231a893fbc022ec77805c4222c9
Configure/Set radar Field of View, configurable attribute.
class Camera(Dag_Node): def set_verticalFieldOfView(self,value): self._edit(verticalFieldOfView=value)
0
5573b77582a91c71b6081461cafb94f0
8da6d71aee10a8997de170962f081ffc
acepta conexiones con un socket servidor y lo pasa a un hilo (server) nuevo para cada una segun van llegando.
try { ServerSocket server = new ServerSocket(port); Socket client; BufferedReader fromClient; PrintStream toClient; while (true) { client = server.accept(); fromClient = new BufferedReader(new InputStreamRe...
0
6e7e40bd214255e6dcf82fff500eabc1
9d6bf080ac26ab4560a1a8c4a67e0ee3
event handler for mousewheel forward event
function handleMouseWheel(event) { distCENTER[2] += event.deltaY / 10.0; }
1
46c2033d59b334c29ada0f0453e6c8b2
2837ec93aba80f686f6b251b1119318e
Constants for layout
COSExit = '-' COSContinue = '+' MSGSelfExit = "SelfExit" MSGChildExit = "ChildExit" MSGParentExit = "ParentExit" HAVEVALUE = '+' NOVALUE = '-' COIOSuccess = '+' COIOFailed = '-' COIOTimeout = '*' CODead = errors.New("Co Dead") }
0
7b0ffaed60b7dac4269b8c01a37ac9fc
64e1cfa23a41aca335d4485b53f0f144
Adds the gzip compression service.
namespace Cql.Core.Owin public class DefaultHttpConfigurationBuilder protected virtual void EnableSupportForGzip(HttpConfiguration httpConfiguration) { httpConfiguration.MessageHandlers.Insert(0, new OwinServerCompressionHandler(new GZipCompressor(), new DeflateCompressor())); }
1
4e762641a91b72906474cdfbcdbc21e7
0fc6f825e54ff558e7944c1d41a77dc9
生成Java的Model类
namespace ModelApp public class BuildingJava private static bool CreateModel_M(DataTable dtColumns, string tbName, string description) { bool successed = false; string strNamespace = tbName; string clsName = tbName; clsName = clsName + "Field"; Str...
1
ce796277399fda481329d5aa4962b024
a428c5d402adfda0355a43be4c126676
Ramp the voltage from the current level to the specified output.
now = old if old < new: delta = 0.005 else: delta = -0.005 while abs(now - new) > 0.005: now += delta self.em_core_module.pwrs_vbatt.set_current_voltage(now, self.em_core_module.ps_properties...
1
8317c5dff60ae535216bc5353492fb10
671a9c3032905acef008f21be87d67fd
animation for background, non-interacting objects
function animate() { requestAnimationFrame(animate) c.fillStyle = `rgba(${bgColor.r},${bgColor.g},${bgColor.b},${bgColor.a})` c.fillRect(0, 0, canvas.width, canvas.height) objects.forEach(object => { object.update() }) }
1
7367c248b9ef91845fc5692ebd99a1bf
cdf94328cde1a43f2e465eb4eb59a055
o Viết phương thức in toàn bộ danh sách các hàng hóa.
{ System.out.println(this.toString()); for (Product product_list1 : this.product_list) { System.out.println(product_list1.toString()); } }
1
f26dbce01d7846fc8feae0b6cd57902d
cfaaba8baed1b362d72d7ca992431f81
拡張子を元にContent-Typeを設定
function Response:SetContentTypeByExt(ext) self:SetContentType(MimeType[ext]); end
1
fc14ff5c405f698ef03a136534e59877
fdfbfbf1914d7e129acd5a54eb97b774
convert from window to scaled coords
CRect CAxBaseView::ConvertToWindow( CRect rc) { double fZoom = 1.0; CPoint ptScroll = GetScrollPos( ); rc.left = _AjustValue( fZoom, rc.left*fZoom-ptScroll.x ); rc.right = _AjustValue( fZoom, rc.right*fZoom-ptScroll.x ); rc.top = _AjustValue( fZoom, rc.top*fZoom-ptScroll.y ); rc.bottom = _AjustValue( fZoom, rc.bo...
0
23d822f8280d6c06059121b0f3ea282b
f2dd62a8fa9de931e127d505d42d40d8
Get products by arrival
class ReceptionController extends Controller public function index(Request $request) { return \response()->json( Arrival::WhereNotIn('state', ['VALID']) ->filter($request)->last()); }
0
afcb11383fd79cb2dea3622d584493a7
337ea06138386a303c3d420f04101dd5
京喜平台swagger转换成markdown
@SpringBootTest class DemoForswaApplicationTests @Test public void generateMarkdownDocsToFile() throws Exception { Swagger2MarkupConfig config = new Swagger2MarkupConfigBuilder() .withMarkupLanguage(MarkupLanguage.MARKDOWN) .withOutputLanguage(Language.ZH) .wi...
1
6dd8433d7537d18d3b6c15b759d836a2
ed48902c0006cb8eb1398ae01411053a
根据任务ID获取数据库凭证信息
public List<dbinfo> getdbinfoListByMissionid(String missionid) { Map<String, String> params = new HashMap<String, String>(); params.put("missionid", missionid); List<dbinfo> dbinfo=null; try { dbinfo=(List<dbinfo>) daoSupport.findForList("missionMapper.getdbinfoListByMissionid", params); } catch (Exceptio...
1
0490516f1a69ccace93b1e7e1bafd3ed
d20108d5061995d5c8926d6d8d63f28d
Acquire unclaimed due schedules for processing. This method claims up to the requested number of schedules for the given scheduler and returns them.
public function acquireNextTriggers($noLaterThan, $maxCount, $timeWindow);
1
0d2e5bea134c7335e7366aebce6c986c
209e792826fd3193d35b2e0bd4e421f8
查询全部信息或根据news_assortment查询该类的所有的新闻
public Object searchAllNews(@RequestBody ReleaseSystemDTO releaseSystemDTO){ PageHelper.startPage(releaseSystemDTO.getPageNum(),defaultPageSize); List<ReleaseSystemVO> allNewsListsByCategoryid = releaseSystemService.searchAllNews(releaseSystemDTO); PageInfo<ReleaseSystemVO> systemVOPageInfo ...
1
9ccd58d90d62665ef58e5887c80377c9
7f0cd4a5ff6da14cf4c89d64f4ecef7a
创建Res资源表
interface ResDataDaoImpl fun createResTable(table: String)
1
ac77a589a9c8254b8cef320ab35c061f
d8524d6b41fd3b3305de5289bf97ba48
It is responsible to update the MD to completion and disk_worker layer It then sets the inode as dirty, the flusher thread will eventually flush the MD to disk
namespace Kernel ErrorOr<void> RAMFSInode::flush_metadata() { set_metadata_dirty(false); return {}; }
0
fc2339e16eef8fe8a7625cccd26ad916
b2f5f7c7f4cc5ed86565e604bbb3b278
通过类对象访问类属性
func main() { var c1 *class = &class{"高一(一)班", 50, 25, 25} fmt.Printf("className=%s,number=%d,maleNumber=%d,femaleNumber=%d\n", c1.className, (*c1).number, c1.maleNumber, (*c1).femaleNumber) c2:=new(class) c2.className = "高三(一)班" (*c2).number=45 c2.maleNumber=45 fmt.Printf("*c2=%v\n",*c2) fmt.Printf("*c2=%+v\n"...
1