query_id
string
corpus_id
string
query
string
code
string
label
int64
a3f9f1cb3d86aaf7639c79bc0d1c86bc
f96223cc77396beedd4ee668e3c68398
! @brief Set sea level reference pressure base If not set, the default value is 101325 Pa
{ if ( pressure_0 > 90000.0 && pressure_0 < 110000.0 ) { _pressure_0 = pressure_0; } else { Log::w() << "Atmosphere wrong value of sea level pressure." << std::endl; } }
0
1b2cff9c29d536c64fe22ade6aebf91d
56b6c4788a9e79d1569d52dbb8bc757e
assume there is only one name
void ESCSelectionSetObjectConfigurable::GetSetNames(std::list<CString>& sSetNames) { sSetNames.push_back(GetName()); }
1
7c32d02c814a72e2db97e7f1d6cc8757
7890eeb31f4c50d2f0eb10816fb8a248
WithLoggerFields attaches structured fields to a new logger in the returned child context.
func TestContextWithLogger(t zaptest.TestingT) context.Context { return logging.WithLogger(context.Background(), TestLogger(t)) }
0
0d5877a611e2c9fe1a9ffd31f5cc6420
d39859db7bee0c4d045ebe7c5fa46e7b
将s2中不在当前集合中的元素添加到s3中
m1 := make(map[T]bool, len(s1)) for _, v := range s1 { m1[v] = false } for _, v := range s2 { if _, ok := m1[v]; ok { m1[v] = true } } for k, v := range m1 { if !v { s = append(s, k) } } return }
0
2f0f0307a06446866d38de8e3cdf4231
697ecc2e85e84dd3984749fbc0ebd1ae
funkcja odpowiadająca za przesłanie prośby o rejestracje do serwera
function registration(){ showRegError(); $.post( src+'pages/user/createUser.php', $('#registrationForm').serialize(), function(data){ showAlert('Pomyslnie dodano nowe konto', 'Zarejestrowano'); $('#modal-registration').modal('hide'); }, 'JSON'); }
1
deb200e4cfa6beb9caa673f765642151
091dbee639564c1953860df1bf62c322
删除ServletRequest对象里所有的属性
public class DTOUtils public static DTO fromServletRequest(ServletRequest request) throws UnsupportedEncodingException { if (request == null) { return null; } DTO dto = new DTO(); Map<String, String[]> parameters = request.getParameterMap(); for (Map.Entry<String, Str...
0
e3bf5ab1a858ec9145716aae292358b0
58e0e899c675fc16d98204dda52aabcb
Watches and records the values of the monitored variables.
class DirMon(BaseProducer): def __init__(self, **kwargs): super(DirMon, self).__init__(**kwargs)
0
584ad86941dabb93721359d79ff4e859
5c5bdc7450b92cfeff96734f7aa13a29
Is required file extension?
class FileHandlerDefinition implements \Serializable public function getRequiredExtension() { return $this->requiredExtension; }
1
5a29ccce8c241551d8b54f842d88c401
0c69d7faca639f70f92a4991e1121adf
Tests release method Also tests printServiceBay
public class GarageTest @Test public void testGarage() { Garage gTest = new Garage(); assertEquals(8, gTest.getSize()); assertEquals(8, gTest.numberOfEmptyBays()); assertEquals("108", gTest.getBayAt(0).getBayID()); assertEquals("E01", gTest.getBayAt(5).getBayID()); }
0
8f025e91fbac9c99f12a710379810566
4f6dee6433518416452f33d22a2cd076
Deserializes the part of the <see cref="IVerifiable"/> object other than <see cref="Witnesses"/>.
namespace Neo.Network.P2P.Payloads void DeserializeUnsigned(BinaryReader reader);
1
38af40579b9872bc3acebc6e26eff2c1
7499d92942f8c4ee5032bb72a40078db
Set flag that upgrade is in process.
class Updates: def PackageInstallStarted(self): self.installing = True
1
15ea65b8ec9ed35649c5ac1623dbb9c4
6dd1ef20a0c1ddc2215a8f3558a89805
ensure we do not throw exceptions when unregistering an non-exisiting node
class TestNodeRegisterDelete: def test_node_register(self): api.node_register( node='node-99', obmd={ 'uri': 'http://obmd.example.com/nodes/node-99', 'admin_token': 'secret', }, ) api.get_or_404(model.Node, 'node-99')
0
5af20885a969f964baf0a01776407f94
180105eef3612fc881057727abc1b4fa
判断是否可以加入心愿清单或者赠送清单(不能同时加入两个清单,既然自己都想要,就不可能赠送) 书本既不在心愿清单也不在赠送清单才能加入到这个列表
public class TextAreaForDetail extends FrameLayout public void isWishBook(final Context context,long bookid) { if (!LoginUser.isLogin()) return; WebRequestHelper.post(URLText.wishStatus, RequestParamsPool.getWishBookParams(bookid), true, new MyAsyncHttpResponseHandler(context) { @Override public vo...
0
8bfe42c85995ad743d96216e6dafae6e
f30ccd22db3935f6086939a0a321da5c
Izpiše vse komentarje za določen film.
if (JDBConnection.getInstance().getConnection()!=null) { String request = "SELECT count(*) FROM remarks WHERE film_id = ?"; try { JDBConnection.statement = JDBConnection.getInstance().getConnection().prepareStatement(request); JDBConnection.statement.setIn...
0
a36abe72ef860f58c57c04b5f8db04e5
9d78e3a0759b42e49c739e1a8c4e203b
Instantiates the object onto the scene at <paramref name="position"/> with rotation <paramref name="quaternion"/> as child of <paramref name="parent"/>
{ ParamObject obj = Produce(parent.position, parent.rotation); obj.transform.parent = parent; return obj; }
1
96caee179bbab38c91ec9dba488f36c7
080d8635f5c635cb6140351d076634a1
Translate string to 7-bit ASCII Only works with UTF-8.
static void TranslateUTFString(unsigned char *s) { unsigned char *Source; unsigned char *Dest; if (s && s[0]) { Source = &s[0]; Dest = &s[0]; while (*Source) { if (*Source > 0xbf) { if (*Source > 0xc3) { *Dest = '*'; if ((*Source & 0xe0) == 0xc0) { Source++; } el...
1
5898acbb5d12a30a5f00c4a07897ab2d
4a5541107bb2214eee9ffa7095e418cc
Initialize framebuffer data in a way that's compatible with BRAHMA and b9s
{ uint32 length; bm->fd_w = width; bm->fd_h = height; bm->fd_wdwidth = ( width >> 4) + (( width % 16) != 0); bm->fd_stand = 0; bm->fd_nplanes = planes; bm->fd_r1 = 0; bm->fd_r2 = 0; bm->fd_r3 = 0; length = (( (( uint32)bm->fd_wdwidth << 1 ) * ( uint32)bm->fd_nplanes) * ( uint32)bm->fd_h...
1
9b383c7bb3e6b3545f5b75d9b2024163
2175a38aa3dca3dc0b8e94305e69e652
opt의 폴더 내의 모든 txt파일 경로 얻어냄
file_list = [] for file in os.listdir(path): file_path = os.path.join(path, file) if os.path.isdir(file_path): listdir(file_path) elif os.path.splitext(file_path)[1] == '.txt' : file_list.append(file_path) return file_list
1
775e374471c9b3a353ef5a3c73490589
546905d2cd248dc1b9df2f0d7ae32a42
A utility for putting together a morphology object using succinct, declarative code. See tests/test_morphology_builder.py for example usage.
class MorphUsageProperties(object): def __init__(self, ppl_threshold=100, ppl_slope=None, length_threshold=3, length_slope=2, type_perplexity=False, min_perplexity_length=4, pre_ppl_threshold=None, uncapped_ppl=False): if ppl_threshold is None: self._ppl_threshold =...
0
e1837590b184ba9b48b72ee1f2d2fb6d
79632ee4e2fd67392280ac4056e68e4d
Registers a validation method that ensures the specified <see cref="DocumentSelectionControl" /> has a document selection if the specified <see cref="CheckBox" /> is checked.
{ if (string.IsNullOrEmpty(name)) { throw new ArgumentException("name"); } if (target == null) { throw new ArgumentException("target"); } if (!validationTargets.ContainsKey(name)) { ...
0
7f922c700e9b64d78d820224505bccec
12f6de7ac39f177a33cf391a448b231c
==================== SV_Cancel_f Stops recording, and removes the demo ====================
{ MMRESULT mmReturn = 0; if (!fIsRunning) { return; } fIsRunning = false; mmReturn = ::waveInStop(fRecordingHandle); mmReturn = ::waveInReset(fRecordingHandle); int endTime = (int)::GetTickCount() + 1000; while ((fBufferCount > 0) && ((endTime - (int)::GetTickCount()) > 0)) { ::Sleep(10); } if (!mmRetur...
1
539e5169a887a049ed6f48cfaa92e560
02c55e966ab179167de906c00bbf8def
Return the joint proba at r1, r2.
if r0 <= r <= r2: return 1. if binary else r else: return 0.
0
8a6316da95f0b645e9accafe371f92ee
5eb75b12d87c47632173992c562fa1be
gets households as an array of households objects
class SurePetFlapAPI(object): def households( self, data ): if self.__read_only: raise SPAPIReadOnly() self.cache['households'] = data
0
e3bf308542b6d4ca15bad3fef57d91d3
ab19e73fab4154bf03314868e0ef00d9
returns a list of coordinates; 1 set for each face in the photo.
def get_face(img): detector = dlib.get_frontal_face_detector() gray_image = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) dets = detector(gray_image, 1) local = [] for i, d in enumerate(dets): x1 = d.top() if d.top() > 0 else 0 y1 = d.bottom() if d.bottom() > 0 else 0 x2 = d.left() i...
1
9f0674d1244a38d0685e10f0cb996bb7
09f06a8705e42cf2e64ca9578954c2d4
Определяет, связаны ли ребра
{ foreach ($this->connections as $connection) { if(array_key_exists('type', $filters) && $connection->getType() !== $filters['type']) { continue; } if ($nodeA === $connection->getSource() && $nodeB === $connection->getDestination()) { retur...
1
618e01d5f4818001cc236e6bbb8cf544
0c9d6ad16039ea417fc68e8e519ad048
register the "logger" example view type
void BasicSceneView::init() { qmlRegisterType<SceneQuickView>("Esri.Samples", 1, 0, "SceneView"); qmlRegisterType<BasicSceneView>("Esri.Samples", 1, 0, "BasicSceneViewSample"); }
0
837218321da77b3732a370beafef79cc
ec8d57582e5d85cde5a96d72ec2b6b3e
青色LED初期化
{ if (INVALID_GPIO != GPIO_LED_RED) { gpio_set_pin_dir(GPIO_LED_RED, GPIO_DIR_OUTPUT); gpio_set_pin_level(GPIO_LED_RED, GPIO_LEVEL_LOW); gpio_set_pullup_pulldown(GPIO_LED_RED, AK_FALSE); } if (INVALID_GPIO != GPIO_LED_BLUE) { gpio_set_pin_dir(GPIO_LED_BLUE, GPIO_DIR_O...
1
f9e6e3de7ddeda44e387bdfc781e69ea
4a5b0abf09917e040befd972c033aadf
将指定分支merge到master分支.
remote_commit = self.repository.revparse_single("origin/%s" % self.origin_branch) debug.message("Merge origin/%s" % self.origin_branch, indent=1) merge_result = self.repository.merge(remote_commit.oid) if merge_result.is_fastforward: reference = self.repository.lookup_referen...
1
267e79cd7fa6a1f213c43c76df564788
524b9090a22b0fa72e3719cec1728921
Verifies that the relation to the membersystem is valid. Since Focus may delete expired membership records at any time, we'll need to be able to detect and handle that here.
{ if (!Security::database_is_ready()) { return false; } $currentMember = Security::getCurrentUser(); if (!$currentMember || !$currentMember->exists()) { return false; } $statusCode = $this->owner->getResponse()->getStatusCode(); if (sub...
0
c12d47deb685942e18ef1492434eec93
5cf366ecddc172b2c863cc3199a427ae
Return TIOCSER_TEMT when transmitter is not busy.
static unsigned int mn10300_serial_tx_empty(struct uart_port *_port) { struct mn10300_serial_port *port = container_of(_port, struct mn10300_serial_port, uart); _enter("%s", port->name); return (*port->_status & (SC01STR_TXF | SC01STR_TBF)) ? 0 : TIOCSER_TEMT; }
1
3d8042ef0dde551f577818f1981d7447
58dd2dbca69e311dddd264bceccff9d0
List notebook instances which belong to user
class Notebook(Struct): def notes(self): return self.note_class.query.is_notebook(self).all()
0
b3036a80abd736a7335668cd9dd0c355
ff2bbc957e65ce00855d146b13f1c9dc
Returns the acceleration data currently stored.
class MazeSolver(object): def get_acceleration(self): return (self._acc_x, self._acc_y)
1
8e35b4076f78ae61514326239551f6d5
3e613a169d551910382473cb62c2fec4
Get working auth keys from environment variables
def get_tokens_from_env(): no_env_error_message = """It doesn't seem like I can find your .env file. Please make sure that it is in the same directory as this file and make sure that the variables are labeled accord to the README.""" if (rapid_api_key := os.getenv('RAPID_FIRE_KEY')) == None: rai...
1
cae3da457ea34bb72c8f7e6ac9f68ae6
19ac20b1743a61c3dfc7645d9b9aad4d
die_statement : DIE exit_expr | DIE
if len(p) > 2: if p[1] != None and p[3] != None: p[0] = "" elif p[1] != None: p[0] = ""
0
45a915d3a2378ca34b8b7b74c602451b
773b1f2a51db0999645cd3a43d359ce1
设置未读好友申请数(自增加1)
public class AddRequestManager public void unReadAddRequestIncrement() { ++unReadAddRequestCount; }
1
65fb09286c9c0eca69ddf2a6c88461e8
229df54cf9b9d8c517c91111c0b10af6
Enable strict validation.
impl Builder pub fn no_strict(&mut self) -> &mut Self { self.strict = false; self }
0
aa2d84d173f3cc1a4c8a83fc5c49239e
4210db7203f8e2958513daa515f3bf48
Check the value when the variable is not defined
class TestVariablesGura(unittest.TestCase): def test_with_error(self): with self.assertRaises(VariableNotDefinedError): gura.loads(f'test: $false_var_{time.time_ns()}')
1
af03b7510b3eed0747004928af51d7f6
90bd2089adfa759ba3516e043ae09c20
提交安全问题
class LoginController extends PwBaseController public function setquestionAction() { $statu = $this->checkUserInfo(); $mustSetting = Wekit::load('user.srv.PwUserService')->mustSettingSafeQuestion($this->loginUser->uid); $verify = $this->_showVerify(); $v = $this->getInput('v', 'get')...
0
1ce9cc98d1cb7db38a192714ebf14ee6
b3d0966339e5abe6ed59bf3eeda202f2
注入RabbitMq Bus默认实例
{ services.Configure(configure); services.TryAddSingleton<IEventBus>(sp => { var connection = sp.GetRequiredService<IRabbitMQPersistentConnection>(); var logger = sp.GetRequiredService<ILogger<RabbitMQEventBus>>(); var options =...
1
bf5afc46778a9f44b0130e774848e365
9ad02aaef1b71b054aaef5096ef3db7d
Method kept for backwards compatibility. Allows scripters to use the AddonManager to get LoadedAddons
class CoreSys: def addons(self) -> AddonManager: if self._addons is None: raise RuntimeError("AddonManager not set!") return self._addons
0
a80474fcb55fc267a7ef10dedc17b1f5
66b4bf94842f595d1f44c5c0dba3c586
Plays a frequency for a specified duration.
namespace FluorineFx.Messaging.Api.Stream void play(String name, double start, double length, bool flushPlaylist);
0
84dee05dfb20d427878c6a89b82a6731
275af04ea8a1483f0469e0382ccf1238
Set the distributor's name
class Distributor extends ModelAbstract public function getName() { return $this->_name; }
0
a88c77ff305bc5f45638222b26bbdc5d
a78d1eb8f041ce1b55f83cfc11657a68
银行卡充值修改状态
class UserController extends BasicController public function rechargeStatusAction() { try { $id = (int) $this->post('id'); $status = (int) $this->post('status'); $row = (new UserLogic())->rechargeStatus($this->uid, $id, $status); if (!$row) { ...
1
6efcd77c5ea501dcc83665a1eb4a7ab6
11f32d78d77d2fd5f14be16f960166c8
Registers a new device into the KMS according to the JSON provided by the platform.
public function registerDevice($params);
1
24603ad0cad2a7701fd08985797323f2
5e97f7c53f17b5b75d7219ebb7e312b7
Handles the Closed event of the menu control.
namespace Annotations public partial class MainWindow : Window private void menu_Closed(object sender, RoutedEventArgs e) { if (_sender != null) { ((FrameworkElement)_sender).ContextMenu = null; } }
1
9d8baa996d241631e3a1e5fefd11b237
95d21d3463327964cf8c79870e527ddc
Cette méthode montre comment obtenir une page de liste de tarifs client.
class ListTariffController extends CommonController public function actionIndex() { return $this->render('grid', ['model' => new ListTariff()]); }
1
fc21c8efaa2470e9c2fe0611220a6315
2a02bbd78131e06cb3dfdd7b03795bc7
http://stackoverflow.com/a/823240/350221
def chunks(l, n): n = max(1, n) return (l[i:i+n] for i in range(0, len(l), n))
1
f8a193e34c11a5095548e0ec37379aed
8a2571cd1983ea0bcd7f683c62a5134d
Names of the tokens in the order they appear in the pattern
public abstract class DXmlTokenPattern extends DUnaryPattern public NameClass getName() { return name; }
0
b9553addced16470a9c6e089318865cd
c554306d1ee8f4e1f23ec94dcdf71e9d
Returns the value of the '<em><b>Business Element</b></em>' container reference. It is bidirectional and its opposite is '{@link org.openhealthtools.mdht.mdmi.MDMIBusinessElementReference#getBusinessRules <em>Business Rules</em>}'. <!-- begin-user-doc --> <p> If the meaning of the '<em>Business Element</em>' container ...
@XmlRegistry public class ObjectFactory public BusinessElement createBusinessElement() { return new BusinessElement(); }
0
b9c6823f9ac24009ccb7f5a92dde0842
6458b7f10d4615831bd1a260cb58005e
Form designer JSON currently unused, but maybe used later for other settings on this page.
class MapBlock extends BlockBase implements BlockPluginInterface, ContainerFactoryPluginInterface public function blockForm($form, FormStateInterface $form_state) { $form = parent::blockForm($form, $form_state); $config = $this->getConfiguration(); $uuid = $this->uuidGenerator->generate(); ...
0
e775b03614357ab3d36e8106f225fb03
fc3e76f1b117dc91749436d06f54652c
Display a listing of the Facultad.
class FacultadsController extends \BaseController public function index() { return $this->faculRepo->selectAll(); }
1
6c214f0390c289fdef451de9a5ae2eb2
c03797184bef242a44c04b6972ce3b09
待办事项查询语句
public String getAppointmentDetailsQuery();
0
5d4e066febae81560c99f987f2365c8a
c9f4117fec663fc13d702ccc947f789e
Encodes a message (a byte sequence) into a SLIP-encoded packet.
def slip_encode(sting): result = bytearray() result.append(SLIP_END) for i in sting: i = ord(i) if i == SLIP_END: result += bytearray([SLIP_ESC, SLIP_ESC_END]) elif i == SLIP_ESC: result += bytearray([SLIP_ESC, SLIP_ESC_ESC]) else: result.a...
1
ccf8dccae6beb21943107a81727e50c6
8f31f500927416f4183bc6c3df787434
keeps generating new puzzles until a solvable one is found
void Soduku_Generator::search_puzzle() { Coord c(0, 0); do { init_blank_puzzle(); } while (not search_puzzle(c)); }
1
2c7c54cd180bd9cef57b94326608e3f2
e46c6bf5569b375d7b7adde6b3be4709
Draws a translucent rectangle
int z) { float f = ((startColor >> 24) & 255) / 255.0F; float f1 = ((startColor >> 16) & 255) / 255.0F; float f2 = ((startColor >> 8) & 255) / 255.0F; float f3 = (startColor & 255) / 255.0F; float f4 = ((endColor >> 24) & 255) / 255.0F; float f5 = ((endColor >> 16) & 255) / 255.0F; float f6 = ((endColo...
1
6b9aa84226ec1bbb2fff94af90f11d40
b239108fd21d91b4b80e0a0b16bf2855
收藏的经销商列表
class DealerController extends AdminController{ public function index(){ if (!empty($_GET['name'])) { $name = I('get.name'); }else{ $name = ''; } $like["company"] = array('like', '%'.$name.'%'); $list = M('xgj_ov_dealer')->where($like)->select(); $...
0
08be70f6c4de573bb8729ed6438dc460
d4b78286936d93a5885986e346d6bff6
Calculates the stellar mass function of the given galaxies. That is, the number of galaxies at a given stellar mass. The ``Model.properties["SMF"_history]`` array will be updated.
def SMFfromSMHM(M_s , M_h , sig , z , M_hforsigma = None): bins = 0.1 volume = (200*cosmo.h)**3 M_hmf , phi = HMF(z , bins , cum_var = volume) M_hmf = M_hmf phi = 10**phi cum_phi = np.cumsum(phi) max_number = np.floor(np.trapz(phi, M_hmf)) if (np.random.uniform(0,1) > np.trapz(phi, M_h...
1
7fd69eaac173f797bdbcc49641c000f4
fd9e2d7d53275fd7a4d442347b799a70
DESCRIPTION: Rate of change w/r/t time of relative number susceptibles. From equation 4.1,
dret = 0. swexcess = 0. if sw > fc: swexcess = sw - fc else: swexcess = 0. dret = swexcess * (1 - math.exp(-1 * (dt / dtPerco))) return dret
1
4ec513b005a7fac930aa9bbf1c83a058
a3d8bbb2fd041eae91919f21d5cbf9a1
NewResolver creates a new resolver for resolving dependencies
func init() { NewDefaultResolver() }
0
4c17ea2d5830235947e9c4eefd9ad165
96c2b6059f0df5fc50ca2ab045828747
calculate size of speech bubble and generate a rectangle
def speech_bub(): bub1 = GOval(10, 10, x=300, y=340) bub2 = GOval(15, 15, x=320, y=330) bub3 = GOval(150, 40, x=345, y=303) bub1.filled = True bub2.filled = True bub3.filled = True bub1.fill_color = 'white' bub2.fill_color = 'white' bub3.fill_color = 'white' word1 = GLabel('I lov...
0
955a0a6ef9b89e7d3c856147f991e2fc
7f6d27174c66c9eb7a61e56f9dd41fc9
Obtiene todos los registos de peso de todos los clientes
{ var u = this.getUser(); return db.Weights.Where(x => x.UserId == u.Id).OrderByDescending(e => e.Date); }
0
5e7cb694e0c3107bba7f99fd9b22fd6c
517129bbcbf697f13a493de4230203cd
Convert this color to a 16-color ANSI code
{ byte const red = ansi::graphics::high_red_component(col.value_); byte const green = ansi::graphics::high_green_component(col.value_); byte const blue = ansi::graphics::high_blue_component(col.value_); return out << "#" << std::to_string(int(red)) << std::to_string(int(...
0
67d4203e3714edeefee49515523b3867
613d51d7d302e4bad384b31c663b001c
使用队列作为桶容器的基数排序
num = 1 << radix length = len(arr) bucket = [None] * length count = [0] * num bit = 0 while True: for element in arr: count[get_pos(element, bit, radix)] += 1 if count[0] == length: break for j in range(1, num): count[j] += count[j ...
0
7872dfaa74b5d3ea28eb5c1958721b61
0ce65295fa59d853308fa2f152e6a404
Determine the last active schema.
TRI_ASSERT(!_activeScopes.empty()); while (!_activeScopes.empty()) { auto const& scope = _activeScopes.back(); ScopeType type = scope->type(); if (type == AQL_SCOPE_MAIN || type == AQL_SCOPE_SUBQUERY) { break; } TRI_ASSERT(type == AQL_SCOPE_FOR || type == AQL_SCOPE_COLLECT); endCurrent...
0
c9b707b692d904657a9bc26e390f2e8c
eaf1136230995787856add72b49c8a3c
Synchronise the panning of the used viewers
public class Usdriver extends JFrame private boolean _syncWindows() { if(isValid(true)){ try { if(driftModeEnabled.isSelected()){ _windowPairs.setXleftText( 0,Integer.toString(_syncStart(_windowPairs.getXleft(0), xbin, 1, 1056, 528)) ); _windowPairs.setXrightText(0,Integer.toString(_syncStart(...
1
100327bb3235d25c32d94c67807c69b9
073774f0d26c9cffac6e28cbdd967b35
Finds the Works model based on its primary key value. If the model is not found, a 404 HTTP exception will be thrown.
class BooksController extends Controller protected function findModel($id) { if (($model = Books::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }
1
c147b115a33ffd64ce1ce3f9d0421408
01935a4e65ee6e573281ff02af16be88
Add a single detection rule to head of list
class Rules(): def add_rule(self, rule): self.rule.append(rule)
0
bf40a46d98ea0ee6f508f5800299a86f
65637fd65885be56875ef0a018b09806
Create a login object to either generate or verify a login key.
class DefaultLogin public constructor(id: DefaultLogin.ID) { this.id = id; }
0
ab36091fb22ae01b4059680e6349777c
b305fea2aa57ba4445f6547a4e987eef
Checks if the event represents an arrow key code allowed.
{ return e != null && ((e.KeyCode >= Keys.D0 && e.KeyCode <= Keys.D9) || e.KeyCode == Keys.Add || e.KeyCode == Keys.Subtract || e.KeyCode == Keys.Oemplus || e.KeyCode == Keys.OemMinus) && !e.Alt && !e.Control && (!e.Shift || (e.Shift && e.KeyCode == Keys.Oemplus)); ...
0
d6af9acb02a07fd89010c6efb94a7046
55fdd2062a1f5dca8ce56a98c0423c6e
Tests the pin for bad result.
public abstract class MainboardTest extends TestCase public void testModifyPin__Pin() { fail(); }
0
44091c54fda8e6911ab85932bbcf32c8
ba475c711a8254057bd387073a1f629e
利用推荐人编号查找推荐人信息是否可用
$user = Users::find() ->where(['recommendCode'=>$recommendCode,'state'=>Users::STATE_NORMAL]) ->one(); if($user){ return $user; } return false; }
1
a33cfee731d4d70db66972513781d788
dc57fb56513e4857c9980be1588db913
Insert mock modules during context:: with mock(['target.module.name']): # mock modules are enabled here ...
public class MockTargetModule extends TargetModule @Override public void initialize() { }
0
7ed8686517767332539b2122f2e3c471
3225dfa513890294f7748528fe36ab28
returns the title, author, and punlication year of a book
return("Name: " + name + "\n" + "Author: " + author + "\n" + "Pages: " + numpages + "\n" + "Subject: " + subject + "\n" + "Year: " + yearwritten + "\n"); }
0
d3b01852671498e2b14b7e19ed1dee57
5f147051495b5046e3f8a9d25b1f4e01
Setter of XPS top margin.
public void setMarginTop( double marginTop );
1
49ad960ae9b8bcfaec2b2784eab23142
535bf9d622ed8e26711075dde7b7109c
根据Model层更新View层
{ if (modelstate.IsValid) { Update(entity); } else { throw new Exception("验证:数据无法通过,不能修改!"); } }
0
3f6fb1440609de9372414f822e24bc54
e8093ba613a19941fab12b8e11ad62a5
Get json object of all instances and their dependencies as key strings
obj = {} for type, deps in self.type_deps.iteritems(): obj[type] = list(deps) return obj
1
fe46dc23b6d09bddc18c9b9828b578ad
9071b0c2a392a00efdb3d58de1be5ab7
parses a given configfile.
bool Kernel::parseConfig(std::string file) { std::ifstream fin(file); if (fin.fail()) { log->print("Failed to open config-file: " + file, CRIT); } else log->print("Open config-file: " + file, INFO); char line[MAX_LINE]; char *key, *value; while(!fin.fail() && fin.getline(line, MAX_LINE-1)) { if (strlen(lin...
1
77fdd88d7a100330bc0e9e84863fcb2b
32789a6874afbcdfe2dfd4ff72f0d4f9
Returns the size of the Sprite in the Vector2 passed through. x = width, y = height.
void Sprite::getSize(Vector2& a_v2) { a_v2 = m_sizeV2; }
1
d372a7ac43e5daccfbd4e4d0a728b4b1
6f0382a47037466fb3e3bebffcb2ba67
Gets you an array of directions that are arrays of all possible positions diagonally. Primarily used for bishops.
class Board: def get_diag_dirs(): return Board._DIRECTIONS_DIAG
1
b2c87290303f5a155dce45b4f54b4f3f
438a6b93b0487d43345ab62fa9ec51bb
Function SelectReviews(). Selects all the docs belonging to the class being analyzed.
if (!dataWorkspace) { dataWorkspace = new lightSwitchApplication.DataWorkspace(); } $Screen.call(this, dataWorkspace, "BrowseMyDocumentReviews", parameters); }
0
65b9205a59c2e4f27ea4daa46ff3c7dd
55c0ebef1b000ec41bc038707b6df4bf
Kill the player process (rxaudio)
{ if (m_hPlayProcess) { TerminateProcess(m_hPlayProcess, -1); WaitForSingleObject(m_hPlayProcess, 500); CloseHandle(m_hPlayProcess); m_hPlayProcess = NULL; } if (m_hPlayThread) { TerminateThread(m_hPlayThread, -1); CloseHandle(m_hPlayThread); m_hPlayThread = NULL; } }
1
f949d3ce6cfce75fc786968d1e0f6fd5
e83925e09b8747dfbbd9b1baf7e070a5
Обновляет текст строчки, видимой определенному игроку, у которой переданный номер строки, на новую отформатированную локализованную строку.
namespace SKCell [DisallowMultipleComponent] [RequireComponent(typeof(SKLocalization))] [AddComponentMenu("SKCell/UI/SKText")] public class SKText : TextMeshProUGUI public void UpdateText<T>(T arg0, T arg1, T arg2) { UpdateArgs(arg0, arg1, arg2); ApplyLocalization(SKEn...
0
b78a627cbc806fb17a600f609e7c9212
fefefb660ff1481d53c9578c6b102903
重新计算房源出价
@Service("evaluate.statsHouseEvaServiceImpl") public class StatsHouseEvaServiceImpl public int houseEvaReCalculate(List<EvaluateOrderEntity> statList, EvaluateOrderEntity showEntity, int count){ StatsHouseEvaRequest statsHouseEvaRequest = new StatsHouseEvaRequest(); statsHouseEvaRequest.setHouseFid(showEntity.getHo...
0
0faa5844e9cb450af24747daecfb74b7
67f507ff7d3a6512a6404a8b33945911
Reseta todos os campos do form de agrupamentos.
function limparFormExercicios() { $('#Exercicio_Agrupamento').prop("selectedIndex", 0).change(); $('#Exercicio_TipoExercicio').prop("selectedIndex", 0).change(); $("#Exercicio_Serie").val(""); $("#Exercicio_Repeticao").val(""); }
1
dd3b9a14a5dbadc8db4ecc1b56a5761a
4003b253fefbb91ca16a83dc0c2d6483
Remove element from Builder.
{ if(element != null) { if(element.mBuilder.Length > 0) { element.mBuilder.Remove(0, element.mBuilder.Length); } element.mParameterType = ParameterTypeEnum.None; } }
0
f47350983322691d9fa3cd272c6af304
ad96cd0a068020f60f31db0c36eb4509
根据名称获取searchName() 去除名称中的符号,保留数字,字母,汉字首字母大写,最终返回结果为数字+大写字母
String name = sortName(self, "$2"); Matcher matcher = compile("(?<=[&()+.,-;<=>?\\[\\]_{|}~ ]|^)[\\p{Alnum}]").matcher(name); StringBuilder buffer = new StringBuilder(); while (matcher.find()) { buffer.append(matcher.group().toUpperCase()); } return buffer.toString(); }
0
531779ac2dfcba8ebfa4416546b41f9e
cb4eab7f725385bd31e8befc926b3892
Sets player's call sign.
public class Player public void setSource(String source) { this.source = source; }
0
1b262816419cb9dded6efd4f06cd85c8
af59468dc650e3e975ad3b2c5ba7d872
Sets the Order increment ID for the shipment.
public function setOrderIncrementId($orderIncrementID);
1
4837699f6686eb0736cb8bb4d1dfc545
7fcd421b384b7140f75f3ce2f840f2df
Helper to create a range of level names, represented by integers that start counting at 1.
let arr = [] for (let i = 1; i <= Config.level; i++) { arr.push(i); } return arr }
1
2422bda817a49cc96a4217748c5c94b2
8556a0b171c2801c41d7753ce648590b
Get Wk Order Select Info By Id.
namespace V5.DataAccess.Transact.Order V5.DataContract.Transact.Order.Order SelectByID(int id);
1
c96023698236261bbbf6c1725788fb10
9d638dd98b926501516ef05fe5e8b8f5
Get information about the original query. This includes the index, field, max. settings, and max. stats (whether the max. settings were reached).
public function getQueryInfo() { return $this->getApi()->getQueryInfo(); }
1
a469bab5d4cc93c9411a34f8cccceb84
c52b7aa9eca1804d9db271399b60d8b7
Função que Deleta os Hinarios que serão sobrepostos pela nova inserção
{ try { if (listaTesteHino != null && listaTesteHino.Count > 0) { List<MOD_preTesteHino> listaNova = new List<MOD_preTesteHino>(); listaNova.AddRange(listaTesteHino); foreach (MOD_preTesteHino ent...
1
292b586cee521e79e555012c8f95bc33
4dc48b44424f2c0d785b285f97f9a2fc
Get rota directory (create if it doesn't exist)
class Callback implements ICallback protected function getDir($create = TRUE) { $result = $_SERVER["DOCUMENT_ROOT"] . '/' . self::DIR; if ((!is_dir($result)) and ($create)) { mkdir($result, 0777, TRUE); if (!is_dir($result)) { throw new Exception("The directory cannot be created : {$result}"); } } ...
1
d8ef5cb0eda6821df337d8bf51dd643e
15b8d5bb0532918eb6b65ac4c0813ece
Properly disposes of a transaction.
public sealed class RootNestedDbContextTransaction : NestedDbContextTransaction protected override void Dispose(bool disposing) { base.Dispose(disposing); if (disposing) _innerTx.Dispose(); }
1
3afd5728749ece4a4309a284b49d2206
db8c87cf97ec3181ba3e8f55b7145fef
Creates a Fraction from a double value by attempting to create a reasonable parsing of the double and reducing it. It also handles indeterminate double values such as NaN, NegativeInfinity, & PositiveInfinity.
return if (num == 0L) { ZERO } else BigFraction( BigInteger.valueOf( num ), BigInteger.valueOf(den) ) }
0
39e8d21b59ad4c4d39052f43b5633817
9a66650a270f414e45eb9b41021f1785
Set 导入镜像的操作系统架构,x86_64 或 i386
public abstract class Target public void setOsArch( String osArch ) { this.osArch = osArch; }
1
3a40f34dedfe0d93eece3c8bbd40feee
4e245b0551c446d08f3f329ea5e32a55
Firebase reference to all friends.
mAuth = FirebaseAuth.getInstance(); mUser = mAuth.getCurrentUser(); refUserFriends = FirebaseDatabase.getInstance().getReference("Friends").child(mUser.getUid()); refUserInfo = FirebaseDatabase.getInstance().getReference("Users").child(mUser.getUid()); qUsers = FirebaseDatabase.g...
1
8d9db998a4c713edca5df81458a7590c
bf4eff4fd8417f3e6cf7082bb86cc3b7
原样输出字符串
class SelfDRFRawCharField(serializers.CharField): # DRF的charfield会强行转换成字符串,不符合需求 def to_representation(self, value): return value
1
b755c0c01d10d8270a98cc2b1223f3af
648d8111e69f851d6028d141841699e6
Tests the get_hostname function
saas = CheckInstance(ACTIVE_INSTANCE, debug=True) saas.check_hostname_valid() assert saas.get_location() == '\"Atlanta, Georgia, United States\", AS23413 AirWatch LLC, AirWatch LLC'
0
ff2f856931fdbe63a2f9ad8d28c6e3ea
3ad6eba8ee66866c87e69e7763e80404
Check to make sure file isn't already in database
pin = file_info['Pin'] date = file_info['Date'] time_in = file_info['Time'] try: HeadData.objects.raw({"pin_number": str(pin), "date_measured": date, "time": time_in}).first() except pymodm.errors.DoesNotExist: return False ...
1