query_id
string
corpus_id
string
query
string
code
string
label
int64
27e4166f3624d5bdb253da2895fdbd56
b72ff5f5cd6182c1d20245a7490c0526
Compte le nombre de dislikes d'une conversation
function getDislikes2($id) { global $conn; $sql = "SELECT COUNT(*) FROM rating_com WHERE comment_ID = '$id' AND rating_action='dislike'"; $rs = mysqli_query($conn, $sql); $result = mysqli_fetch_array($rs); return $result[0]; }
1
ab1ea9cb4b340958106b027bfb31c547
d3b8528c8d3a4efc212e32119dfc842b
Checks the ability vital, making sure there's enough to activate the ability.
bool PlayerController::CanUseAbilityPreview(Ability* ability) const { if(ability->mana > unit->mp || ability->stamina > unit->stamina) return false; if(ability->type == Ability::Charge) { if(!unit->CanMove() || unit->IsOverloaded() || unit->GetEffectMax(EffectId::SlowMove) >= 0.5f) return false; } return tr...
1
172100472f106dc7ac4125c84fb78594
f0dc6062f401cd5d60ab85f1b0cc1a23
insert line break to the current position
public function lineBreak();
1
49ba815e8c48b06470d85f41754f6ffa
7f8560c3248d09917f3dfe0919a8291b
get the first letter and convert to number(Ascii)
{ int iValue; string sValue; iValue = Convert.ToInt32(x, 16); sValue = System.Text.Encoding.ASCII.GetString(System.BitConverter.GetBytes(iValue)); sValue = sValue.Substring(0,1); return sValue; }
0
9e27a8a978f55772a7f8bc3e81af7103
3a1ee979ee1eade3e10a3c13757b1902
Печатает расширенную матрицу на консоль с вектором правой части
void printm() { for (int i = 0; i < cnt; i++) { for (int j = 0; j < cnt + 1; j++) if (j == cnt - 1) printf("%.1lf | ", matrix[i][j]); else printf("%.1lf ", matrix[i][j]); printf("\n"); } printf("\n"); }
1
edaee6409dbab2888ea7725cc5fdb4a1
1707bdb1ec414b837919e41020036d2a
Returns the meta object for data type '{@link org.eclipse.emf.common.notify.Notification <em>Notification</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
EClass getParameteredNotification();
0
5ffaa1c1e3173f6bdd25d2a4be0b0fd4
63709dbd821ca35e625e6cd3cc273a76
separate thread blocks waiting for stdin, signals on arrival
let (tx, rx) = mpsc::channel::<Key>(); let handle = thread::spawn(move || loop { for key in stdin().keys() { let key = key.unwrap(); debug!("Sending {:?}", key); tx.send(key).unwrap(); } }); (rx, handle) }
1
0ef7a1444e5d8e3406ab1714c6f2afdf
6db06aa6a9f64164d023025a2dd3c9a8
This definition is overridden if FPU is present
bool ParameterManager::FPUOption() { return iFPUOption; }
0
277f2ba730ca8fb2640f9ec1d4c4dbde
77c34ee63515c644eadba86089dd829e
@brief ランダムなルームIDを生成する
{ JID jid; jid.setHostname(hostname()); jid.setUsername(username); do { char buf[80]; sprintf(buf, "%4lX-%4lX-%4lX-%4lX", random() % 0x10000, random() % 0x10000, random() % 0x10000, random() % 0x10000); jid.setResource(buf); } while ( getClientByJid(jid) ); return jid.resource(); }
0
53a93c2e29586efb876e6946a1fa8e10
c602aad6288b875beeda773598f31994
POST /course_reviews POST /course_reviews.json
class ReviewsController def create review = course.reviews.new(review_params) if review.save render json: ReviewSerializer.new(review).serialized_json else render json: { error: review.errors.messages }, status: 422 end end
1
12f0c948d7c7ebe544e9d87c8bc681ae
a53bdefcf0e3d93748b5f36f5304c1c6
Initialise the Database with host, username, password
class DatabaseManager(MySQLBase): def __init__(self, dbHostName, portNumber, user, password): MySQLBase.__init__(self, dbHostName, portNumber) self.user = user self.password = password self.connect(user,password)
1
2079f8f9d66165101b0be726e6577f5c
b1f63adffcdbb785d52a8fa947d3ade8
Transform images with semantic classes encoded as colour into one-hot encoded images
class CamVid(Dataset): def one_Hot(self, image): output_shape = (image.shape[0], image.shape[1], self.classes.shape[0]) output = np.zeros(output_shape) for c in range(self.classes.shape[0]): label = np.nanmin(self.classes[c] == image, axis=2) output[:, :, c] = label return output
1
ef4ac67782cc975a394c99ef7403c276
e472011959e0d07bab3ddbe807e9b757
excel with first row header, use header as key
def yield_xlrd_to_pyobj(s): keys = [k.strip() for k in s.row_values(0)] start_n = 1 row2 = s.row_values(1) if not isinstance(row2[0], (int, float)): start_n = 2 for i in xrange(start_n, s.nrows): row = s.row_values(i) if row[0] is None or row[0] == '': continue ...
1
23e8b39e8d2246430ac5affeec6cd350
c9bf00c3479533714949d96f1cd508bb
Stops and removes old RoboCI containers
class ContainerSandbox(object): def stop(self): self.stop_and_remove_containers()
1
49d95f7211d16f3911b97e5665176af7
dc03cc204099b13fa93e17bb68fef35a
Function CalculateRemainingAnnualLeave This function calculates the number of days annual leave that an employee has remaining. $employeeID(int) ID of the employee to calculate this for.
$start = strtotime($start_date); $end = strtotime($stop_date); $timeDiff = ceil( ($end - $start) / (60 * 60 * 24))+1; $day_work_hrs = getColumnValue($db,'personal_system_parameters','day_work_hrs','(1=1)'); for ($i=0; $i<$timeDiff; $i++) { $current_time = strtotime("+".$i." day...
0
1834e7d6004109784b5639fa8afd8d99
ea42ea4ef98fe7712a309c8a900501e3
Resets rate limit counter
class BlockingRateLimiter(object): def _reset_actual_rate(self): self._cluster_rate_lock.acquire() try: self._num_actions = 0 self._first_action_time = None self._last_action_time = None finally: self._cluster_rate_lock.release()
1
1461a4ac4cb56de9ed75c8cdc66ec030
12735704a8e77487c2fa1f15b818c552
Counts the number of materials that are applyed to a specific item
int getMaterialsCount();
0
3457dcaa24f1ed464617b5c37134a351
d5e7d31ec2f1f6663900b1b77d42fc33
Ensure a Transaction was started before a read is attempted
namespace Contoso.Core public partial class Pager static int pagerBeginReadTransaction(Pager* pPager) { int rc; int changed = 0; assert(pagerUseWal(pPager)); assert(pPager.eState == PAGER_OPEN || pPager.eState == PAGER_...
1
dcdd11532fa044b8dedd42793f48711f
bd9091797c4b55c27b6281a052abf108
Initializes the scene with a control panel, grid, population panel.
public class Gui extends Application public void controlpanel( Stage controlpanel, Stage mainstage ) { Scene controllerscene = new Scene( panel, 200, 300 ); controlpanel.setScene( controllerscene ); controlpanel.setX( controlpanel.getX()+(Controller.X/2) ); controlpanel.show( ); ...
0
e5be2de789b35979ae78bc86084155cd
44801847b2dd2c18fc94c9d3bc3b0136
Method for running molecular visualization; spawn another thread
{ JFrame frame = new JFrame("Visualization"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JComponent newContentPane = new Visualization(); newContentPane.setOpaque(true); frame.setContentPane(newContentPane); frame.pack(); frame.setVisible(true)...
0
ca898615453d7adb63bc7d7e28cc8223
73d94ddcdba6596b974001dbb2c61648
Test NDCG computation
class ComputeAuxMetricsTest(unittest.TestCase): def test_compute_ndcg(self): with self.subTest("Worst ordering of grade values"): self.assertTrue(np.isclose(compute_ndcg([1., 2., 3.]), 0.6806, atol=3)) with self.subTest("Best ordering of grade values"): self.assertTrue(np.isclose...
1
abef9a6ec3750e96ef8e7ca468da013f
9d26d2ea9a5bbaa2646318b78f75640d
Verify that correct nonce was used with time limit. The user is given an amount of time to use the token, so therefore, since the UID and $action remain the same, the independent variable is the time.
global $yourls_user_passwords; $random_user = array_rand($yourls_user_passwords); $_COOKIE[yourls_cookie_name()] = yourls_cookie_value( $random_user ); unset($_REQUEST); $this->assertTrue(yourls_check_auth_cookie()); $this->assertTrue(yourls_is_valid_user()); }
0
c014ef4bb4aab41d7802b9f980e3e876
5e9c399c9c50d8b92b3e73180dab9f3c
returns compressed size divided by its original size (length)
def calcCompessionRatio(uncompressedSize,compressedSize): return round((float(compressedSize) / uncompressedSize) * 100,1)
1
c355ae7ccf3d0e1f3bffee7778451e4c
45558fd0859bddc418338042ed5142a3
Reenables appropriate toolbar items upon leaving debug mode.
void SnapDeadEndstate(void) { ToolBarSetButtonEnabled(hDebugToolbar, DEBUGTOOLBAR_RUN, 0); ToolBarSetButtonEnabled(hDebugToolbar, DEBUGTOOLBAR_PAUSE, 0); ToolBarSetButtonEnabled(hDebugToolbar, DEBUGTOOLBAR_STOP, 1); ToolBarSetButtonEnabled(hDebugToolbar, DEBUGTOOLBAR_STEPINTO, 0); ToolBarSetButtonEn...
0
dcd933847a0151a0e0728eef85ec3a4a
4db95c351bb6d7ed69c15b84620724ee
e.g. 02-Apr-1994, 00:01
def _parse_date_string(dateString, isInterval=False): if isInterval: offset = 0 else: offset = 1 dateString = dateString.replace('_', ' ') if ' ' in dateString: ymd, hms = dateString.split(' ') else: if '-' in dateString: ymd = dateString if ...
1
d2821c9df2990556863fcc70cdbba0f6
48864c9835271f2a6b710ecdefd61ed1
080A - Validate successful removal of an existing character
name = "Sora" _create_char(runner, name, 0, 0) result = _delete_char(runner, name) assert result.exit_code == 0 rows = _select_char(name) assert len(rows) == 0
1
fe4fa4382694489bf8e377201993cb20
1db7d499e54166db04c7d166432bcb6a
Creates faq item.
class FAQController extends Controller public function show(FAQItem $faq) { return view("support-ui::frontend.show", [ "faq" => $faq, "extends" => config("support-ui.frontend.template_to_extend", "layouts.app"), ]); }
0
413dbaa38bce8601e6e3072dac928b0c
3a278a5d6a216b6a6bb0f463fc08a14a
Tests the method which let us query the CNAME record for the case that a non string is given.
rrs = ['auth1.{0} hostmaster.{0} ' '1412191487 16384 2048 1048576 2560'.format(TEST_DOMAIN)] query.return_value = make_answer(rdtype, authorities=rrs) resp, code = self.lookup('CNAME') self.assert200(code) self.assertDictContainsSubset({ 'QuestionSectio...
0
9b49be777f3e2e435743f1adcf30bc0b
9df5b2400509fdfcf916a49bf3ed6923
删除友言Cookie
{ HttpCookie cookie = HttpContext.Current.Request.Cookies[strCookiesName]; if (cookie != null) { TimeSpan span = new TimeSpan(-1, 0, 0, 0); cookie.Expires = DateTime.Now.Add(span); HttpContext.Current.Response.AppendCookie(cookie); } }
0
144bb3e6b57140b0426f7b683b74826a
765b82242a20833c263b66200c78d57f
Get available print file names.
class _CUPS: def listPrinters(self): return self.con.getPrinters().keys()
0
87ca164903b6eb8690a2f0146af3587a
14be487fdedb88d3deddd5146fb0cffd
Start device discovery. (keep discovering for about 12s) The device discovered will be sent as broadcast.
const config = await this.readConfig(); this.deviceDiscovery = this.discover(_timeoutSeconds * 1000, config); }
1
3bc0f8a43d806e5aa645fc363ff3af04
1c3a89111d60129db9b798577a670aa6
An antigen-presenting cell presents antigens to a naive t-cell, causing it to enter an activated state.
class DendriticCellTranslocation(Event): def __init__(self, patch, reaction_parameter): Event.__init__(self, patch, reaction_parameter, [DENDRITIC_CELL_MATURE], [DRAINAGE]) self._lymph_edge = self.patch.edges[LymphaticDrainageEdge.__name__][0]
0
458b617b083620c02b58dd1ed6d1e6ce
999f99dd6c78ff942d6f50946e2a470e
Convert wide characters to narrow multi-bytes
const char *WideToMultiByte(const wchar_t *s) { int n = wcstombs(NULL, s, 0) + 1; char *t = new char[n]; wcstombs(t, s, n); return t; }
1
aa45b98d571b43ce1adf77c0370373a8
4e765b528e45f1158c0a4068c17162a1
Play sound for whether current player wins or loses
public class GameSummary extends Activity implements OnClickListener private void playOutcomeSound() { if (settings.getBoolean("pmusic", true)) { if (win) outcomeSound = MediaPlayer.create(this, R.raw.gamewin); else outcomeSound = MediaPlayer.create(this, R.raw.gameloss); outcomeSound.start(); } }
1
c520cec765e8f1f497c78585388af283
25e4838e7a26ab91a8b4846ba507e705
Test that when removing an animated sprite the correct sprite is removed.
const int newFrame = 3; animSpriteWithAnim->runAnimation(0); animSpriteWithAnim->setCurrentFrame(newFrame); BOOST_CHECK(animSpriteWithAnim->getTextureRect() == animSpriteAnimTextureFrameRects[newFrame]); BOOST_CHECK(animSpriteWithAnim->getCurrentFrame() == newFrame); }
0
a4dbdc4be7ccbf1958e5b398ad4ef0ce
afd077aa6fc265785c8ba462c3e59b21
为筹码增加 0- 0.5s 的延迟,让其错乱飞 --OK
function M.FlyBetChip2ToPondList(arg) local t=0 for i=1,#arg.flyCMLs do local comChip=arg.flyCMLs[i] comChip.visible=false GTween.Kill(comChip) end for i=1,#arg.flyCMLs do local comChip=arg.flyCMLs[i] comChip.position=arg.fromPos local _t = Vector2.Distanc...
1
5985f3a4426eddb83f88fc9175886b48
503d44ce63fc084bc0b05684aee6edb4
设置技能中心背景图片
if self._imageInfo.imageBg ~= bgImageUrl then self._imageInfo.imageBg = bgImageUrl if not self._image then self._image = display.newXSprite(bgImageUrl) self._image:retain() self._image:setAnchorPoint(ccp(0.5,0.5)) self:getContainer():addChild(self._image) else self._image:setImage(self._imageInfo....
1
704aae07740662ba3dcf3188e19135e1
446af0f95b3d35c3989109d7843d9baf
Convert QName to the Clark notation, e.g., {namespace}localName
def _localname(qName): qName = str(qName) return qName[qName.find("}")+1:]
0
bddf9e2ad3f998639979e27f9effecad
3974d75ac1c910c139a82e75354c56e7
Show aggregated result of number of overdue reasons by reason id
" yy.Number,\n" + "\tyy.Priority,\n" + "\tyy.opened,\n" + "\tyy.opened_new,\n" + "\tyy.Resolved,\n" + "\tyy.resolved_new,\n" + "\t(\n" + "\tyy.DiffDate- ( SELECT COUNT ( * ) AS dd FROM sheet2 WHERE Hoilday >= yy.opened_new AND Hoil...
0
59bde1c479b39545090cde705217eb2b
53ab204316f6a298d00462b4cf92b97a
社員登録の「社員ID」入力チェック 第1引数:社員ID
if (chkClientEssential(document.getElementById("EmployeenameStr"), "社員名")) { return true; } if (chkClientEssential(document.getElementById("EmployeenamekanaStr"), "社員名(カナ)")) { return true; } if (chkClientEssential(document.getElementById("EmployeeloginidStr"), "ログインID")) { return true; } if(document.getEl...
0
ce34eb21048d7e598c442f6bb535d130
7c2c9a875ccfdfb68dd83d67a4e97a36
Get the number of consecutive failed login attempts.
class Authenticate_Brass extends Authenticate protected function _get_failed_attempts($user) { return $user->__get($this->_config['columns']['failed_attempts'])->as_int(); }
1
a34a91382da883d753d95c34eb36b2c4
5c0d79754ddc173436ba9d42843145c2
Initialize structure keeping days data
{ this.timesToDays = new Dictionary<DateTime, TimeCollection>(); DurationPerDay = new Dictionary<DateTime, int>(); this.Days.Clear(); }
1
29fed951f14b72e6c534dfc3507023b5
71f2bff7fccae769251977a9c7fff376
是就输出yes,不是就输出no
func main() { var Yes bool fmt.Printf("No01:%t\n", Yes) fmt.Printf("No02:%T\n", Yes) fmt.Printf("No03:%%\n") fmt.Printf("No04:%q\n","自动加引号") }
0
a0ef1596cc46d1838c067f86a3beb122
c7017b25fab4b22698a4a95e8ff67d87
This will be called when the state provider is registered with Diffusion.
public abstract void register();
1
15200e39c22f80887e3474f171d6e2ea
dd2bec1cb49a3fe8a12161d2a78e7440
Updates the avatar's position and joint orientations.
{ foreach (SkeletonJoint j in Enum.GetValues(typeof(SkeletonJoint))) { if ((int)j < m_jointTransforms.Length && m_jointTransforms [(int)j] != null) { m_jointTransforms [(int)j].rotation = transform.rotation * m_jointsInitialRotations [(int)j]; } } Transform elbow = m_jointTransforms [(...
1
b576916f128f61390398232bde229969
fa493c279baabf6d6334e17db5dc4d4a
Convert pupil parameters to integers. Useful when drawing.
pupil_params = dict() if create_empty is True: pupil_params['radius_min'] = None pupil_params['radius_max'] = None pupil_params['dist_thr'] = None pupil_params['max_nblinks']= None else: pupil_params['radius_min'] = radius_min pupil_params['radius_max'] = radi...
0
4469ccce8d88459bdfd1bf4ccb3e5409
8421ea3979c5793519674c520e56d55f
通过存储过程修改
namespace BrnMall.Core.DBUtility public class ProcUtility public int Pro_Modify(string tableName, string fields, string where) { SqlParameter[] parameters = { new SqlParameter("@talbe",SqlDbType.NVarChar,100), new SqlParameter("@fields",SqlDbType.NVarChar,...
1
c7969e1084e1e4c5783a0ecf22939118
b5c9eda2ba63288a830b13df6306120d
Converts sensor type character to the equivalent string
class f_sensors(IntEnum): def __str__(self): ret = "NONE" if(self == self.ADC0): ret = "ADC0" elif(self == self.ADC1): ret = "ADC1" elif(self == self.ADC2): ret = "ADC2" elif(self == self.IMU_ACCEL): ret = "IMU_ACCEL" elif(s...
0
5d03c91853d621c4269721e0fa97c19e
6cd3737e98f2c0f6319e31f36d0c1dbc
将 “数据对象” 转换为 “key为下划线分割的JSON字符串”
namespace TCG.Utils public class objectHandlers public static string ConvertObjectToString(object Data) { if (Data != null) { PropertyInfo[] piSrcPropertyInfo = Data.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance); string strReturn...
0
598cfca204bb0dd77f42ad9b4fb61d74
1c2ede5104f4b90f05b95258b4a3e4f2
Load the dataset that maps ISO to geo coordinates
cityLatLonData.insert(std::pair<string, std::pair<string, string>> ("beijing", std::pair<string, string> ("39.90420", "116.4074"))); cityLatLonData.insert(std::pair<string, std::pair<string, string>> ("cairo", std::pair<string, string> ("30.04442", "31.23570"))); cityLatLonData.insert(std::pair<string, std:...
0
9c0efd0cb19920b220bae50eb1d32d11
d753c7acd49076c944f80756df8696ba
合同管理服务没有开通的处理方式
class LYB_Search_TopPanel(wx.Panel): def contract_text_change(self, evt): contrct_text = self.contract_combox.GetValue() if contrct_text == '': self.order_combox.Enable(False) self.component_combox.Enable(False)
0
b867f08d9d042e4e33fb9b80ede44ef3
093e5a5dfe96e3853a9b3380b30f26d6
\internal Wątek rozwiązujący nazwę.
{ IN0("\n"); const char* pName = ""; OUTR(" ", (int)pName); return pName; }
0
3c2be82893b6a6528695045977b8e92e
6997201a85352d974d57850270fb0a0d
# Extract entities from an AnnotatedPlainTextDocument
getAnnotatedPlainTextDocument = function(doc,annotations){ x=as.String(doc) a = AnnotatedPlainTextDocument(x,annotations) return(a) }
0
510526b1ecb27e1d3d8d9a9e8bd6e7bf
b8f60cfde728c0cc0e1cc7175d9743ca
Function which compute the anysotropic diffusion filter
def anisotropic_filter(img): img_copy = img.copy() img_anisotropic = anisotropic_diffusion(img_copy) return img_anisotropic
1
3f2f1b4872f480943352b2a290f211e8
10983d3dab661e4aeb04cd03c2f86a18
To make sure the image wasn't corrupted during transmission, the Elves would like you to find the layer that contains the fewest 0 digits. On that layer, what is the number of 1 digits multiplied by the number of 2 digits?
with open(INPUT) as data: digits = list(map(int, data.read().strip())) layers = decode_layers(digits) layer = min(layers, key=lambda l: l.count(0)) return layer.count(1) * layer.count(2)
1
529513df6e17f6a6bdeb99a9623ce0c1
83b440d08d8afe8f1b0d0994478e4451
10. STRING
int main() { MyString test1, test2("The quick brown fox jumps over the lazy dog "); cout << "String 1: \"" << test1 << '"' << endl; cout << "String 2: \"" << test2 << '"' << endl; cout << "Char #41: " << test2[40] << endl; test2[40] = 'h'; cout << "Changing char #41 to 'h': " << test2 << endl; MyStrin...
1
031c5cd346a3e57cd0036fcdf45d11ae
c87c84174724e256c97a8970c7b0cee4
用于非管理员通知管理员已解决
c.BindJSON(&notifi) id := notifi.User_id admin_name := notifi.Admin_name user_id, _ := strconv.Atoi(id) user_name := notifi.User_name content := "您的账号已被解封" timeNow := time.Now().Unix() time := time.Unix(timeNow, 0) sendtime := time.Format("2006-1-02 15:04:05") var code int if models.AbleUserComments(admin_na...
0
5edc79dda953d086919c68bb8e11d004
a9eb27d42a46547fd9bb3fdd4a51747c
Deletes an advent calendar.
( $cal_id ) { if($cal = Database::selectOne("SELECT start, duration FROM event_calendar WHERE cal_id=? LIMIT 1", array($cal_id))) { if($cal['start'] + ($cal['duration'] + 30) * 86400 <= time()) { Database::startTransaction(); $pass1 = Database::query("DELETE FROM event_calendar WHERE cal_id...
1
200761aa3bb1d141467c01e24249e937
b6689fbeafe188698310dbd269cdf09b
This override removes the reference to the SQL server connectivity service.
namespace TestPluginAssembly1.Implementations public class MySqlDbConnection : SharedServices.Interfaces.IDbConnection public void Dispose() { }
0
3c3b33bb8c3f8e00a16e7f419bc85c29
381f3d10e991faff77e3f62af6888fd2
Check to see if OnDemandPercentageAboveBaseCapacity property is set
namespace Amazon.ElasticMapReduce.Model public partial class InstanceFleetModifyConfig internal bool IsSetTargetOnDemandCapacity() { return this._targetOnDemandCapacity.HasValue; }
0
d3ad27a3fe321311015befe11fa4d4e3
5507a3804f77c4b3739455ad2ef39fbf
Enables the spectating camera and disables the main camera
public class GameController : MonoBehaviour public void EnableMainCamera() { _battleCam.enabled = false; _mainCam.enabled = true; _battleCam.gameObject.tag = "InactiveCamera"; _mainCam.gameObject.tag = "ActiveCamera"; TopPanel.Instance.gameObject.SetActive(true); Game...
0
f7cd62e4e8021f0de3af5f975d9767cd
15059b1b39d1b8e7d21f514a98cf1e9b
Returns the timestamp of `message` if there is one, or `None` otherwise
class Message implements \Serializable public function getTimestamp() { return isset($this->message['__timestamp']) ? $this->message['__timestamp'] : null; }
1
eb26163cca614e57c64e437f3e753ed8
650a6edc9768d30a6a6b03ee3f76f322
Method to delete an existing Raavare stored in the database.
public class AveriaService protected AveriaDTO delete(String id) { return (AveriaDTO) averias.remove(id); }
0
211376c5ca88ecf1d772388ee435500e
1e585605c6c09c66f7820305aaf2c100
Refreshes the swap rates. Function is called when the 'Refresh Rates' button from the pricer menu is clicked.
public void refreshRates() { long currentTime = System.currentTimeMillis(); this.refreshCurrentRates(currentTime); this.refreshPrevRates(currentTime); }
1
02398ff94eedc75c6cb04bcc79f05bc4
1d97a16b160f6131017576280c529980
Custom tag overrides to allow blocked tags to display.
class WebHookCustomContentTests(TestCase): def test_with_blocked_debug_tag(self): with self.assertRaisesMessage(TemplateSyntaxError, "Invalid block tag: 'debug'"): render_custom_content('{% debug %}')
0
d3572adaa94ab1eb71f798721789651a
cf2272f1b7eb8191b1804d86bb43ad93
Returns a task that should be run next according to FPS Schedule
void WW_H264VideoSource::doGetNextFrame() { double delay = 1000.0 / (FRAME_PER_SEC * 2); int to_delay = delay * 1000; m_pToken = envir().taskScheduler().scheduleDelayedTask(to_delay, getNextFrame, this); }
1
93bf9bd52808bd4df8f1c5e5e541be8f
b5cde558d4cbf0f95834a11c4d250bb2
Converts a JsonElement into a JsonArray.
namespace ES.Linq public static partial class EsLinq public static JArray? AsJArray(this string json) { return JsonConvert.DeserializeObject<JArray>(json); }
0
44a48b27a7c822bde05964c5c67e45d3
fce4ea18cd4c2d6e89cacc4a4cdc499f
Strips an SSH key string of white space and line endings and returns the new string. key_string The string to be stripped.
function hkm_secureHeader($str) { return trim(str_replace(["\r", "\n"], '', $str)); }
1
59b5ca724e5d5681beba228c6d320cf4
37eaec3d4ffffd17f5d4660776baa29c
根据坐标获取地图元素
class g2dMap: def GetCellByPos(self, pos_x, pos_y): return self._MapImg[pos_y][pos_x]
1
24e0d312d6ef26b53c765de2b09c99c1
f9f7228129c04165376d91c06ee6b734
已经上传的文件展示
self.write("Has been uploaded files:<br />") for root, dirs, files in os.walk('./upload'): self.write("%s<br />" % files)
1
8e7b48048da3426f789f48d7529b1b8c
a1d2fdf3ced092f11f182e9cf1dd7227
Retrieved quote history for specified range
export class Ticker extends TickerType public getHistorical(startDate: string, endDate: string, cb: any) { Finance.getHistory(this.ticker, startDate, endDate, (err, quotes) => { cb(err, quotes); }); }
1
8f91d4f2d58674e1fbbf1a300c90b1fe
bc9467e0e7cdf189fd93a10e1e32d8d5
Sets the orderJoinItems attribute of the OrderJoinData object
class Order extends Model public function setItemsAttribute($value) { $this->attributes['items'] = json_encode($value); }
0
1bcb060cafd6e93bcadd33899f69bff6
a906873f229851574fd07a360450b959
Removes parameter from rest like urls Example "http://bodgeit/fooo/123/foo1/11" => "http://bodgeit/fooo//foo1/"
$url = trim($url); $url = preg_replace('/&'.$param.'(=[\s\S]*)?((?=&)|(?=#)|(?=$))/Ui', '', $url); $url = preg_replace('/(?<=\?)'.$param.'(=[\s\S]*)?(&|(?=#)|(?=$))/Ui', '', $url); return $url; }
0
6003b9c4f0f1592ae17c81d259cc75af
e24f136d98a977a2d543a1847b667632
Starting sector number for mini FAT.
{ __u32 fat_val, entry = 3; while (1) { fat_val = get_fatent(mydata, entry); if (fat_val == 0) break; entry++; } return entry; }
0
6179fa1a08bc240586fac90742fceb19
a36cfde1da757c536d71e5d38850ceb8
禁用产品类别
{ try{ DB::table('product_type') ->where('producttypeid', $request->deleteId) ->update(['isActive' => 0]); } catch(\Illuminate\Database\QueryException $e){ $err = $e->getMessage(); return redirect('producttype') ...
1
c71fd08ec7afbd95816a3616c8646ed6
26f0f0af5095d9907c8b6674f4951a76
Takes in all of the symmetries in a group, chooses 'best' one, removes all other ones from the other nodes
if (v.size() < 2) return; ArrayList<ForbiddenClass> orig = new ArrayList<ForbiddenClass>(); ArrayList<ForbiddenClass> auto = new ArrayList<ForbiddenClass>(); ArrayList<ForbiddenClass> temp = new ArrayList<ForbiddenClass>(); for (ForbiddenClass ni : v) { if...
0
725fbc8a999c4d169ab4322182ec51c5
255f84edc298487bbc5e77e1df092917
统计企业充值金额数据总数
Integer selectCompanyDetailCount(CompanyAccountReqVo vo);
0
d9494363392417d5e631368bbf7fe9d0
a450826693441f94a8e38b4fe32bf46a
load configuration, default if no config file found
cfg = defaultCfg; if os.path.exists("config.json"): with open("config.json", "r") as f: cfg = json.load(f); return cfg;
1
b8a9aecf6c24856a09539319eee62a24
15f2c7e12f9354a8b747e751bd4c5b84
Default collection period for a Participant. Creates if missing.
public CalendarDate getStartCollection();
0
84c503d181bb8ac367b1afef627cfc81
1187409c03ec6422f1784ab7c3974642
Removes all the result callbacks specified before.
callbacks = self._callbacks.get(name, []) [callbacks.remove(c) for c in callbacks] self._callbacks[name] = callbacks
1
c87a69f438771c2cdd4a2c1f4a298fc9
54414682192f1d8063bd113f5e7391e9
Static method for creating a markup open tag string.
export class StringWriterImpl private _openTagBegin(name: string): void { this._beginLine() this._refs.markup += "<" + name }
0
cb53e8f96588ee0d4096f703853bc673
694ff7de1935aa47c802adc90f5b7ef4
Calculates the new rating for a player based on their rating prior to the match, the outcome, and the expected outcome.
namespace ChessScoreboard.Core public class RatingCalculator public (double winnerRating, double loserRating) GetNewRatings(bool gameWasADraw, double wOriginalRating, double lOriginalRating) { double wTransformed = GetTransformedRating(wOriginalRating); double lTransformed = GetTrans...
1
c2ee1a191ceb9005e0af4e73de31201f
6612390941601fc1ba496440dfeb8ac3
! @brief Capture the system time in microseconds
uint64_t getus() { register _u32 cached_ms, cached_tick; _u32 context = enter_critical_section(); cached_ms = _systick_val; cached_tick = SysTick->VAL; if (SCB->ICSR & SCB_ICSR_PENDSTSET_Msk) { ++cached_ms; cached_tick = SysTick->VAL; } leave_critical_section(context); re...
1
7fea4b82198d75e0c618d6c1cc4b1b3e
22f718f89476a1ee1831f8cc99b8c825
Changes the set of optical slots occupied in all the traversed fibers of this lightpath
public class WLightpathUnregenerated extends WAbstractNetworkElement public SortedSet<Integer> getOpticalSlotIds () { SortedSet<Integer> res = getAttributeAsSortedSetIntegerOrDefault(ATTNAMECOMMONPREFIX + ATTNAMESUFFIX_OCCUPIEDSLOTIDS , null);if (res == null) throw new RuntimeException (); return res; }
0
4fee09064dade43add309bbbf8f3d95b
06e016186dea2b88d5253c3f24caa463
显示战斗标题
func TitlePropertyChanged(pl player.Player) (err error) { propertyManager := pl.GetPlayerDataManager(types.PlayerPropertyDataManagerType).(*playerproperty.PlayerPropertyDataManager) propertyManager.UpdateBattleProperty(playerpropertytypes.PlayerPropertyEffectorTypeTitle.Mask()) return }
0
cadc82fc8a8e75b955aca3a70203b28a
42827fc79bf6fd5c73beecf528fa0586
gets a mail's x-bcc field
public class Enron_Mail public String getXBcc() { return xbcc; }
1
98b9fe10495c00959279003be018ea36
20960a0d5a22e8d6fb40bbda0fb6acdb
Register for callbacks with the line handler. If we are already registered and have up-to-date point data, then this will immediately generate a callback. This behavior is important for generating initial COVs for event subscriptions.
{ sensor.line_filter_func = line_filter_func; sensor.line_filter_args = line_filter_args; return 0; }
0
c585378a0b6f31642d86226cc75e3e7c
093ddd6eb670f8f468b28a1223dca684
获取拥有者的贴吧列表
class Tieba(object): def get_tieba_member(self): pass
0
35c509bbba925304c7b2470990e71821
fb1a42b3506854f4efbaef0a7924ff84
used to know if a topic has changed since we read it last
{ if (!topicid || topicid > (int)numberOfTopics) return false; topicBlock* block = TI(topicid); id = TOPLEVELID(id); unsigned int byteOffset = id / 8; if (byteOffset >= block->topicBytesRules) return false; unsigned int bitOffset = id % 8; unsigned char* testByte = block->topicTimingRule + byteOffset; unsigned...
1
8daf1b72c0e0a36f460806c4e72a8939
7f0d984741f65a3c7d3d73b0899a93e3
This method determines whether the tiles can be moved right
public class Player extends Mob public boolean canMoveRight() { if(x + 8 > level.getWidth() * 8) return false; for(int i = -sprite.SIZE/2 + 1; i < sprite.SIZE/2 - 1; i++) { if(level.getTile(x + 8, y + i).solid() == true) return false; } return true; }
1
e52efc3a9cfc0740317c89c388103b83
5e412c5cb723bde8cff9b433719dbd39
確認是否在routers_table名單上
class User extends Model public function hasRouter(AdminRouter $router) { $routers = $this->routers()->pluck("router_id")->toArray(); if (in_array($router->id, $routers)) { return true; } foreach($this->roles as $role) { if($role->hasRouter($router)) { ...
1
a732f6033cf6b5b039ba7a5c1f9a9cc2
de42cf338e34cf8e2fc40511dbf5998b
Checks whether the requested solver backend was found.
class BluepyBackend(AbstractBackend): def check_backend(): try: import bluepy.btle return True except ImportError as importerror: _LOGGER.error('bluepy not found: %s', str(importerror)) return False
1
603e2923f3f41f388529fe502246af7f
12c98ee52db8a5cb7701a6787a4ea6f6
Read zmapplus grid (surface mesh); returns triple (x, y, z) 2D arrays.
def read_cice_grid (file_path, return_ugrid=False, return_dA=False): lon = fix_lon_range(read_netcdf(file_path, 'TLON')) lat = read_netcdf(file_path, 'TLAT') if return_ugrid: ulon = fix_lon_range(read_netcdf(file_path, 'ULON')) ulat = read_netcdf(file_path, 'ULAT') ny = lat.shape[0] ...
0
c699eef743310475612608f25fef1f27
e983725cf285a9a36a925fa572f5eec7
Sort amino acid codons by occurrence score in descending order.
def sort_codons_by_values(aa_codons): return sorted(aa_codons.items(), key=itemgetter(1), reverse=True)
1
3c9782ff41ef64d9762d95a303bc8fda
9d70a64b3a641ff07304bc54f92c5284
Gets all published portfolio items and their categories
class Portfolio_Items_model extends MY_Model public function get_all_portfolio_front() { $this->db->select("p.title, p.slug, GROUP_CONCAT(c.slug SEPARATOR ' ') as cat_slug, p.img, CONCAT('img', p.id, '_small.jpg') as thumbnail", FALSE); $this->db->from('portfolios as p'); $this->db->join('po...
1
e6261495cb58060e1fc7e1434ab54d72
7eb593c8873863bbf48e725c1eb27758
Delete each of the filters on this document
public void removeAllFilters();
1
a21440a94c19e54ea96d542b15cb1882
f843a79697a01d01d29fd9059befb345
Envia email segun parametros de configuracion
{ var html = txtEditor.Value; var emails = ""; try { #region Enviar E-Mail _db = new BasesDatos(""); if (Session["IDENTEMI"] != null) { _db = new BasesDatos(Session["IDENTEMI"] != ...
1
8294ea0171ba0401402d44abeb49a720
8db21982e77933c592ca1a9f1d29f3bb
通知メッセージのクローズボタン押下時処理を行います。
public class UIPlazaPanel : MonoBehaviour private void OnCloseNoteBtn(GameObject go) { AudicoManager.instance.Play("effect", "Effect/press button"); Notice.SetActive(false); }
1
a9fd66c9209cae6a0fcfb2cd77eb3ef1
90111c5f107700b018f676099a07397e
recupera las tareas al entrar
{ $idUsuario = Auth::user()->id; $query = DB::table ('asignas') ->where('idEstudiante','=',$idUsuario) ->where('Estado','=','Abierto') ->get(); if($query){ return view(('ListTareasEst.index'),compact('query')); ...
1
582a623cc479a75e279012889b2d1270
87d4880623ebfd60af57e509035f987e
Calculates the checksum associated to the files that the build configuration uses.
hasher = self.hasher_generator() for file_path in sorted(build_configuration.used_files): if os.path.isdir(file_path): hasher.update(dirhash(file_path).encode(DEFAULT_ENCODING)) else: with open(file_path, "rb") as file: hasher.u...
1