query_id
string
corpus_id
string
query
string
code
string
label
int64
5b27740e47a714d50c7102a961822a40
b67d77a6d797aa204946e52c1122dc5d
Test that profile route has a 302 response code when not logged in.
class ProfilesViewsTest(TestCase): def test_get_profile_page(self): response = self.client.get('/profile/') self.assertEqual(response.status_code, 302)
1
a98ea309c73300cc72d05b3d3e2dbb3e
41202f8f4b580ff26fcb49976cbb2f38
Allocate a vertex from specified position and normal vectors.
const double a_y, const double a_z, const double a_normalX, const double a_normalY, const double a_normalZ, const double a_textureCoordX,...
1
9d219f903355deae758d1574110cbadf
e226720169fe2fee9ceb2672b3d36dad
Extract labels from the .gz file
print('Extracting', filename) with gzip.open(filename) as bytestream: bytestream.read(8) buf = bytestream.read(1 * num_images) labels = np.frombuffer(buf, dtype=np.uint8).astype(np.int64) return labels
1
19e3ad6918f81838c9c77a6b870ce916
c6df9c1f8528971a99c59df60d5d71c2
adds a course using parameters pre: parameters contain valid data for a course post: new course with specified info is added
class Transcript: def addCourse(self, semester, department, number, title, credits, grade): self.courses[number] = [semester, department, number, title, credits, grade]
1
7705aa1b068b0d4df5019c30fdf2fbad
0c1e1ad86456ea849da7f80a6bebf940
Modify if the camera should follow
namespace ArenaMinimap public class MinimapMarker : MonoBehaviour public void SetFollow(bool p_shouldFollow) { _shouldFollow = p_shouldFollow; }
1
14a47455d02120327300d90bfed7f2a7
d537cdcb1f23d74f8131d65f20a75604
Convert a linked script src to an import statement with assumed side effects. The may break some JS resorces, as module imports are always strict.
function toBlob(url, txt) { return URL.createObjectURL( new Blob([ txt.replace(/(^|\s|;)(import\s*)(\(|.*from\s*|)['"]([^'"]+)['"]/gi, function (_, pre, req, type, loc) { return pre + (type == '(' ? 'window.dimport' : req) + type + "'" + new URL(loc, url) + "'"; }) .replace(/(^|\s|;)(import)(?=\()/g, '$...
1
6caae6402c01ed050178b438abce9667
a765a9ebf19100c51a9d199ccb7bed49
是否超出15分钟,验证码15分钟有效
pre_user = self.isValidity(email) if pre_user[0]: if (timezone.now() - pre_user[1].code_time).total_seconds()/60 <= 15: return True else: return False else: return False
1
3e978ab6261e990f477dcae25e1babf6
4202cbf9a8ec3837a25997f9c225bdee
! Returns address type to use for the I2C signal.
{ if (sensor_type < ATLSCI_MIN || sensor_type > ATLSCI_MAX) return ATLSCI_FAILURE; else return I2C_ADDR[sensor_type]; }
1
9905ee0ea4608ca6ac92ef87a0ece894
35e9dc35be055426ee3d6f8a47fb5a76
Modular w_RNN mask
attn_shape = (1, size, size) subsequent_mask = np.triu(np.ones(attn_shape), k=1).astype('uint8') return torch.from_numpy(subsequent_mask) == 0
0
ff6aabe2b9fc1c2acfb5ede8d5d569b3
5117504123468a6c4158ec06e65299bb
删除当前相册所有被选中的图片文件信息
void deleteSelectedPhotos();
1
ac5a7bac554c951da84ee4e26fdc3880
8e369a3864fc2f87d237b6b73bccdc90
Samples a function randomly with the provided distribution.
class LMSampler(Generator): def _sample_from_distribution(self, distr): keys, probs = list(zip(*list(distr.items()))) assert_approx_equal(sum(probs), 1.) return np.random.choice(keys, p=probs)
1
2db9051f5c1c47b416ff320507dc0434
40bc4a771eedec2ecb536d5e34833a9e
关闭log记录
namespace SHCre.Xugd.CFile public partial class XLogFile public void Close() { FileNameFormat = string.Empty; _evtToWrite.Set(); }
1
17181b9d1f4e4c311a3352bde41f9c82
2a9e6e4d73dfc85576f6320410af1553
merge supplied credentials with default arguments
{ $config += ['version' => 'latest']; if ($config['key'] && $config['secret']) { $config['credentials'] = [ 'key' => $config['key'], 'secret' => $config['secret'] ]; } return $config; }
1
8a100996db1684eb2f9c262c9855313d
17048b930da6c56535600a735a093f99
Save the affiliation in the db (for the faulty affiliations).
{ $logger = \Yii::getLogger(); $logger->init(); $logger->flushInterval = 1; $logger->traceLevel = 0; $this->setIsNewRecord( True ); $this->group_name = "internal_staff_affil"; $this->group_type = "org"; $this->user_id = (string)strval($this->user_id); if (intval($this->user_id) > 0){ $this->cre...
1
419e9b336e13b429f91c3aeef3a2150a
f8191ecb4738d7721251e0e2aa1ab4fc
Left mouse click.
def left_click(): left_down() left_up()
1
7eedbf60b62f7fa6d997497ca6db240b
09798a34c43b61e69c380a1d5618f3b5
Tests the CREATION of an ITEM using CLICKS
res = app.test_client(self) res.post( '/signup', data=dict(firstname="firstname", lastname="lastname", username="username", email="hey@gmail.com", password="123...
1
ccf01639cf98f0af27ae1b96a68fd015
b688ccc9651540cbd9e998d20a9850ab
Puts a \0 terminated string
void usbPutString(char *s) { while (USBUART_CDCIsReady() == 0); s[63]='\0'; s[62]='!'; USBUART_PutData((uint8*)s,strlen(s)); }
0
67e1108d6ad3b0f458e1cba797a6304b
e0d7426b325f9809d031eee86e48a378
Function to get trades that are to exit in a given interval during training
ma_newest = data["ma"]["%s_%i" % (self.preliminary_analyses["ma"].analysis_type, self.ma_lookback[0])][row] ma_middle = data["ma"]["%s_%i" % (self.preliminary_analyses["ma"].analysis_type, self.ma_lookback[1])][row] ma_oldest = data["ma"]["%s_%i" % (self.preliminary_analyses["ma"].analysis_type,...
1
192d618b6bc1a218e78de2185be168b3
06eb8d4e6f1ffe1b0e62eefd4abd1b7f
myTreeView控件节点展开之前判断鼠标按下的次数,并进行控制
{ TreeNode senderNode = e.Node; if (GetTreeNodeLev(senderNode) == 3) { AddButton.Enabled = true; EditButton.Enabled = true; DeleteButton.Enabled = true; curBDZ = senderNode.Parent; } else ...
0
b6c9b746421b76685e1785312d45f45e
a0f54f2b9698a2607ad4433aa25fee90
Adds one or more messages to the topic. Returns NOT_FOUND if the topic does not exist.
extraHttpRequestParams?: any): Observable<models.OffsetWithAvroSchema> { return this.produceMessageToPartitionOfTopicWithHttpInfo(topicName, partitionId, records, extraHttpRequestParams) .map((response: Response) => { if (response.status ==...
0
76956fc9058ee0b5115b222da8b68c16
5ee62606ce87a7a45fd85ba00cc1b2ad
checks the SDE descriptor override system will throw an error on multiple overrides
{ const native::ChainedStruct* chain = nullptr; native::MaybeError result = native::ValidateSingleSType(chain, wgpu::SType::ShaderModuleSPIRVDescriptor); ASSERT_TRUE(result.IsSuccess()); result = native::ValidateSingleSType(chain, wgpu::SType::ShaderModuleSPIRVDescriptor,...
0
29c3320a89779965c356763f851ce938
592bdedc7214945dd620cd89d3ccb136
Посчитать цену товара в указанной валюте с учетом НДС и скидки. Если в товаре указан +% НДС - то добавляем его. Иначе возвращаем просто цену.
class oxArticle extends oxI18n implements oxIArticle, oxIUrl protected function _calculatePrice($oPrice, $dVat = null) { if (isset($dVat) || !$this->getConfig()->getConfigParam('bl_perfCalcVatOnlyForBasketOrder')) { $this->_applyVAT($oPrice, isset($dVat) ? $dVat : $this->getArticleVat()); ...
1
b27bc23d4c16f4caea209a05769b5297
4ec81478222a887b4789e3a5176cd56c
根据权限id 获取分配该权限的所有角色id
List<String> getPermissionsIdByRoldId(Integer roleId);
0
7fc8380e6675a8468f3880cd71697d39
3e9954d6ec59a4ce9c376bbbbefda654
Format model outputs as html, with masked elements in red, with opacity indicating confidence.
class TorchClassifierAgent(TorchAgent): def _format_interactive_output(self, probs, prediction_id): preds = [] for i, pred_id in enumerate(prediction_id.tolist()): prob = round_sigfigs(probs[i][pred_id], 4) preds.append( 'Predicted class: {}\nwith probability: {}'...
0
327d4c3417af076af991c4c9e23d420b
3a4b4ae8873907517bec5583f78655ff
买礼物的订单支付后添加到商城订单中
InputStream inStream = Struts2Utils.getRequest().getInputStream(); ByteArrayOutputStream outSteam = new ByteArrayOutputStream(); byte[] buffer = new byte[1024]; int len = 0; while ((len = inStream.read(buffer)) != -1) { outSteam.write(buffer, 0, len); } o...
1
323423b5bc824e7e6504d884e209cd3c
a48bf3fc09b43ea2f7e05f1b0d030fc0
No undo point
public final class EResourceUtils private static final class SaveResourceEMFOperation extends AbstractEMFOperation @Override public boolean canUndo() { return false; }
1
320eb87718ccdf00df6d0a301fd5a21f
ca90b32ac28149d778f410074882058d
Load documents and create a common time fields across different type.
typeMap.clear(); type2Cate.clear(); cate2type.clear(); metaMap.clear(); type2metaMap.clear(); dao.each(DocumentType.class, null, new Each<DocumentType>() { public void invoke(int index, DocumentType docTp, int length) throws ExitLoop, Conti...
0
447c8215a9788b42cee937a6a0e96852
0785eb711d01a199ace620430db6d6cb
Elimina el primer elemento de la cola y devuelve su valor. Si la cola está vacía, levanta ValueError.
if not self.is_empty(): self._size -= 1 return self._values.remove_at_index(0) else: raise ValueError
1
f0bbcc7ec4c2e000dc2e5ae2c58cd2c1
21f2fc8f052acd77c855cb65d21b0b48
Method to navigate to another screen with some param information passed from previous screen
class EmployeeInfoScreen extends Component _goToPage(type, action, params) { this.props.navigation.dispatch({type: type, routeName: action, params: params}) }
1
b0b2db1b5104f1613d11d8550b93e174
48c0cb4f19900a8b69eb60534a6280d2
Gets the order product.
namespace Contracts [OperationContract] OrderItem GetOrderItem(int orderId, int productId);
1
a2cbb16fca56c51d45c814cd3416c6ca
dafe579b23a891c00255e799f25eefd6
move focus up to previous 'labkey-multi-value-input' field
function moveFocusUpFrom(startingNode) { var prev = startingNode.previousVisibleNode(); if (prev) { prev.focus(); } }
0
8b3c3b43d38a484d9541e52175379b15
6b0a52abab357c439dc9ae31d1ff7fc3
Creates a new Dialog instance.
this.dialog = dialogNode this.DIALOG_RESPONSE = Object.freeze({ OK: 'OK', CANCEL: 'CANCEL' }) }
0
bba31b79bb1c298057e28a782327b400
fbf16959be0f0921c62a55d9f1549689
查询当前用户关注的所有物件
{ string json = "{}"; var list = dal.GetMyFocus(this.UserName); json = Utils.Serialize(list); return json; }
1
20b762f6ea4fe00fbd4f65e603c7011c
6e46b5346b0d363f31f67392e75b0ee8
Sets the number format that will be used to format the labels of the gauge dial
{ this.Format = "G"; this.maximum = (decimal) 100; this.minimum = (decimal) 0; this.increment = (decimal) 1; this.showUpDownButtons = false; this.upDownAlignment = LeftRightAlignment.Right; }
1
7fd601475f3023e06fa5d05cd20b967a
4af1059e1b4b1ee8fcf82b1e2b96797f
清空操作记录表数据
@Service public class SysOperLogServiceImpl extends BaseServiceImpl<SysOperLogMapper, SysOperLog> implements SysOperLogService @Override public void cleanOperLog() { mapper.cleanOperLog(); }
1
93585d607561af6b0352911784302b43
79fa987ff051df8538f3d6dfebf7aa25
Asserts application defined permissions against user assinged ones
{ SecurityRight currentRight = SecurityRight.Inherit; foreach (IPermission permissionToCheck in permissions) { if (permissionToCheck.CheckUser(this, userName)) currentRight = permissionToCheck.CheckPermission(this, permission); if (currentRight...
1
216640eabc1e23c3baa65f13f4e5ae55
6adec47c65b6d07184a6768c86b5f15c
Tarefa que gerencia a exibição no display OLED
void taskDisplay(void* data) { DisplayData* dd = (DisplayData*)data; while(TRUE) { switch (*dd->mode) { case MAIN: printMenu(menuMain, *dd->scroll); break; case MEASURE: printMenu(menuMeasure, *dd->scroll); ...
1
a5fd05dd983a06d8e6b907548138262c
d767276ec50165dc8c8730b9717a3d60
Selects the number of decks
public class Ship public int getNumberOfDecks() { return numberOfDecks; }
1
fa0b7355faae8f545cbf70540fd29e5c
d759daf6661392a2cfd30f1e4915d8c1
# Testcase: scenario1
class GA_TapRuleScenarioTest1(ScenarioTest): def test_GA_taprule_scenario1(self): call_scenario1(self)
1
b5e8a1a42c83c4d6fbf6bef03180e0ef
c8b857a792c554fd35250b86c4c18b6b
Initializes several instances of Exercise to setup testing
{ IO_Operators ioo = new IO_Operators(); ioo.RunExercise(); Fibonnaci_With_Array fwa = new Fibonnaci_With_Array(); fwa.RunExercise(); Scope_Of_Variables sov = new Scope_Of_Variables(); sov.RunExercise(); Array_Of_Ints aoi = new ...
1
84870ba43d7e5c996a9e13e2841ca4d4
5b52b2a6be353556b060e8e69d19ec3c
Enables or disables the combobox for legend locations based on whether the box is checked Returns
public class HtmlBrowser extends JPanel public final void setEnableLocation (boolean b) { cbLocation.setEditable (b); cbLocation.setVisible (b); cbLabel.setVisible (b); }
1
cc1d0acd392a59fd314098f3919c79e2
cfeceb06bbd6a9cb80da8613ac14b3ab
Valida se entidade é nula após retorno de busca
data = self.get_response({'lat': 0, 'lon': 0}) empty_entity = { 'id': None, 'nombre': None } validations = [ data[field] == empty_entity for field in ['departamento', 'municipio', 'provincia'] ] self.assertTrue(validations a...
1
21516243e067a0c6fc847d84e9dbd2df
8f1e9c7c2d578ee9e861a1bfde4141a9
Here the cloud pixels are found using a threshold range estimated from earlier images from ISS
def stage2(birdseye_view): t1 = time.time() print('start stage2') combined = combined_threshold(birdseye_view, kernel_size=3, gradx_low_thresh=30, gradx_high_thresh=255, grady_low_thresh=40, grady_high_thresh=255, mag_low_thresh=30, mag_hig...
0
1fe072c53e572e2a0ee8ff65c51975c0
946db2b72b7e8f66f38d01250f06680e
The id of the Hana Instance.
class HanaInstance(pulumi.CustomResource): def hana_instance_id(self) -> pulumi.Output[Optional[str]]: return pulumi.get(self, "hana_instance_id")
1
0cd8025e94fb3f979f83e79696f5a65d
f824239cd1def5d53f929d2bc85b14b8
Handles the Navigating event of the webBrowser1 control.
namespace FormRegionOutlookAddIn partial class RssRegion private void webBrowserSearch_Navigating(object sender, WebBrowserNavigatingEventArgs e) { this.searchWindowProgressBar.Visible = true; this.searchWindowProgressBar.Value = 0; }
1
68b9db3e3b394459d721a0ca1611ae17
27ac9aa04f19562681df3dcc340ff2a3
商品の画像をダウンロードする
var url = imageDataList[imageIndex] ? imageDataList[imageIndex].url : null; axios({ method:'get', url: url, responseType:'stream' }) .then( response => { var fileName = url.substr(url.lastIndexOf("/") + 1); var filePath = IMAGE_DIR + `\\${fileName}`; response.data.pipe(fs.createWriteStream(filePath)); ...
1
22134af8a2375bfdbad28e81279ce5d5
e5bae6e39c64ad04ef319c071218037d
A function to save the user ID of the provide profile object
function saveUserInformation(data) { var user_id = data.data.user_id; storage.setItem("user_id", user_id); }
1
c3cc2a13dfdab0232f4b8052273a9b8f
8c56ce32d6273e7cee4155e88c64d791
Hämtar vårdnadshavare till barn
public class AnimalHusbandary public FarmCatalogue getAnimalHousing() { return animalHousing; }
0
12b2a5dffe490cb8f3ef2640a6d3005f
4ad15fde2c50a1983c659e90845981ab
Deselects the given item if it is already selected.
namespace PloppableRICO public class UIScrollPanelItem : IUIFastListItem<BuildingData, UIButton> public void Deselect(int index) { Component.normalFgSprite = _currentData.DisplayName; Component.hoveredFgSprite = _currentData.DisplayName + "Hovered"; }
0
aa3b71eb8279b283f42dbd8840a33315
5ef198b6320b7d311cfaa336d304e880
metoda da li je broj paran
public class Zadatak3 public static boolean isPrime(int number) { for (int i = 2; i <= number / 2; i++) { if (number % i == 0) { return false; } } return true; }
0
f3852676238dbad0c3a8a409746632b1
9da6db75aa060d017ff405ffa82c564b
#' @describeIn stem_volume_fonweban Applies the method in Laasasenaho (1982) to calculate stem volume.
param0_tvf <- species_parameters[species, "param0_vol"] param1_tvf <- species_parameters[species, "param1_vol"] param2_tvf <- species_parameters[species, "param2_vol"] stem_vol <- param0_tvf * (dbh^param1_tvf * ht^param2_tvf) return(stem_vol) }
1
e655ba8ab8b30f3b4a5a14f30b229101
3a082222cdbf74b3780a687de4a8ab91
Get an attack callable on the attack model.
def generate_attack(model, mode="simple"): if mode=="simple": return simple_attack(model) if mode=="multiple": return multiple_attack(model)
1
a7048e11b9761e2cbf2d45319925f4ed
94b0120131b1ebf310d8223a98927934
Initialize 2D grid graph with terminals added as node attributes
class graph_gridworld: def __init__(self, name): self.name = name
0
2e5c7301823ced35bc590266788d9d5a
425a44e5959a97c7ef1bd9c9838296a1
Detertmines the pixel format to use based on the current display and EGL configuration.
int format, int width, int height) { Log.v("SDL", "surfaceChanged()"); int sdlFormat = 0x85151002; switch (format) { case PixelFormat.A_8: Log.v("SDL", "pixel format A_8"); break; case PixelFormat.LA_88: Log.v("S...
1
b9c331549c4f2656b6d058683cd4e336
acc1983d46a59e7b10b698caf104b05a
低評価記事の情報を取得する(過去にソフトデリートされた物も含む)
$sql = "SELECT id, title, LEFT(content, 100) AS content, publication_datetime FROM articles WHERE publication_datetime < CURRENT_TIMESTAMP ORDER BY publication_datetime DESC;"; $stmt = $this->dbh->prepare($sql); $stmt->execute(); $articles = array(); while ($article = $stmt->fetch(PDO::FETCH_ASSOC)) { $ar...
0
3644cc5474ff51a23b41768e5c7f1f3a
caea1f9bfd4430d31e54190d6f6f8d1e
Adds a head route to the router.
def head(path, handler, method=None): return _Route(["HEAD"], path, handler, method)
1
371a9e95ed03a38e22751bcf1e7f1a09
45df26eb23138c2110a6affcc312cca7
Create a rectangle with everything set to zero. It will be located at the origin and have no area.
{ r->xmin = -1; r->ymin = -1; r->xmax = -1; r->ymax = -1; }
0
ed08f297a2cf421cc4e310d55aea6cc4
e51193686ac4d48ff7eecb267758027d
getter for 金融专员手机号
@Table(name = "biz_ks_sl") public class BizKsSl implements Serializable public String getYhZjhm() { return yhZjhm; }
0
5f1117ed03375347759e117acd64b4dc
1570ce36f9681d78ff0a9b3227a8f38c
Test that init doesn't raise an error when given a valid marker.
def test__parser__base_segments_raw_init(): fp = FilePositionMarker.from_fresh() RawSegment('foobar', fp)
1
4cb95c230fa77580ac4378a462ff5209
97fc6dd0fd7a75fbea30cc57134264fe
根据投票IDS 获得投票列表.
List<Vote> getTopVoteList(@Param("title") String title, @Param("voteIdList") List<Integer> voteIdList);
1
47b47b5330207c6189a9275eef6fb829
9035e157aaaa2a18ce0ef45b93ea94bf
Prevent making requests to yahoo to speed up testing
class YahooFinanceTest def setup FinanceCache.delete_all end
1
316f4ae88c2c4679ac32b975fc80b49f
cf213fc28e914f93ad9bb64637c309e9
Create a DSN for connecting to the specified database engine. Currently supports MySQL and PostgreSQL but may work for other databases.
func getDbEngineDSN(config *config.Config) string { engine := strings.ToLower(config.DB.Engine) dsn := "" switch engine { case "mysql": dsn = fmt.Sprintf("%s:%s@tcp(%s:%d)/%s?charset=%s", config.DB.User, config.DB.Password, config.DB.Host, config.DB.Port, config.DB.Database, config.DB.Charset) ...
1
68d56748f5a9659479c0fe88a2aec842
07593c4fd2f731dc485b907bd2f862eb
Compute the intersection-over-union via the confusion matrix.
def ious(cm): num = np.diag(cm) den = np.sum(cm, axis=1) + np.sum(cm, axis=0) - np.diag(cm) return np.divide(num, den, out=np.zeros_like(num, dtype=float), where=(den != 0))
1
b620fd6ddf7fa8231f6673b9c55161af
2770a8d2cf7bb3dcf68009bc87bdbb25
GET: RentalTypes/Create
{ ViewBag.VehicleTypeId = new SelectList(db.VehicleTypes, "VehicleTypeId", "Type"); ViewBag.MemberId = new SelectList(db.Members, "MemberId", "Name"); return View(); }
1
70914379598b91c0c4a5cc823108316d
6c790bc6379b034bb313e4c5a7f3a9e2
获取租户级别当前的设置的值。 由给定的租户重写。
namespace Abp.Configuration public static class SettingManagerExtensions public static async Task<T> GetSettingValueForTenantAsync<T>(this ISettingManager settingManager, string name, int tenantId) where T : struct { return (await settingManager.GetSettingValueForTenantAsync(name, ten...
1
a1f93c314067b5194958aa1909ba9bcb
ede3c0359f26d3ded7aab64d6fbb9513
展示所有采购人信息
@Controller public class PurchaseController @RequestMapping("/purchase/supplier") public @ResponseBody List<Map<String, Object>> showSupplier(){ List<Map<String, Object>> list = pService.showSupplier(); return list; }
0
8d358d4777b422f44c92f82b3722697c
d73e457c7c43bfa059e98c140ef9798d
默认注册商户为管理员
Result merchantOrdinaryRegister(ReqMerchant reqMerchant);
0
0e710ea4a3fbd6b5651b5795e0d19f68
5985c6d9dbec51437e15bad8b7022249
#COSTFUNCTION Compute cost for logistic regression # J <- COSTFUNCTION(theta, X, y) computes the cost of using theta as the # parameter for logistic regression.
cost <- function(beta) { m <- nrow(standardizedTrain.X) g <- sigmoid(standardizedTrain.X%*%beta) J <- (1/m)*sum((-train.Y*log(g)) - ((1-train.Y)*log(1-g))) return(J) }
1
997ac46162d2ac177c59afc2fe220c0f
6072fbb5e9a77bb3a670953d12e59340
get manager name for particular project on load
{ DataAccessLayer.MRF.MRFDetail projectNameDL = new Rave.HR.DataAccessLayer.MRF.MRFDetail(); BusinessEntities.RaveHRCollection raveHRCollection = new RaveHRCollection(); try { raveHRCollection = projectNameDL.GetProjectName(); retur...
0
1c0c51daefbf617eef03cf8533fc8c88
c94a38ad2ca4dadd6f5b8e90a1c6f37e
Checks whether this is a valid IPv6 address
public class NetworkUtils public static boolean isIp6Address(String ipAddress) { return VALID_IPV6_PATTERN.matcher(ipAddress).matches(); }
1
ef075f1da9767ab9e64575a81caea323
6b42656d73c7ba74c130dba2f1e61a36
Funcion para mandar a crear los PDFs, mediante AJAX
class DefaultController extends Controller public function crearPdfAction(){ $error = array('message' => 'Todo bien'); $vars = 12; $request = $this->getRequest(); $cedula = $request->request->get('cedula'); $webPath = __DIR__.'/../../../../web/'; $webUrl = $webPath.'app_dev.php/ver-hoja-de-vida'; $webUp...
1
f5372d47db59f9c3c9184442dc270e9b
e5fcffcddf1dea4213c4edd3cde6516b
Convert the left side (name) of a data point.
export class AttributeQueryable<T> extends Queryable<T> compileLeft(): any { return this.name; }
1
749629b1a59b46bd49a28f3b26f2ac04
59b06592fa4bfe9d34e0dc01efe875d4
Testa se o uso de dados inválidos no cadastro resulta em mensagens de erro
class UsuarioControllerTest extends TestCase public function testValidationLoginWithFail() { $user = new Request; $user->replace([ 'nome' => $this->name, 'email' => $this->email , 'senha' => 987, 'cpf' => $this->cpf, 'idEntidade' => $this...
0
ce3b4ba33951cd01f347c35b15d6d0fa
492a926bdd3ae45ce41eecf169a443c3
Get the maximum zoom level this tile provider can provide.
int getMaxZoomLevel();
1
2fe37988558e4cb091489cf6f95466ab
5c223627b461b2e15f7e8f15f0ef7fdb
測試動態大小的陣列
{ uint8_t arr1[12]; uint32_t arr2[7]; uint64_t arr3[9]; TEST_EQ(ARRAY_SIZE(arr1), 12, "ARRAYSIZE(uint8_t)"); TEST_EQ(ARRAY_SIZE(arr2), 7, "ARRAYSIZE(uint32_t)"); TEST_EQ(ARRAY_SIZE(arr3), 9, "ARRAYSIZE(uint64_t)"); }
0
8f1221a0ce5211112bc8b3d398276053
1b45c617225fd508ae15eac1470fb54e
向前合并(即:释放当前节点,将之合并到前一个节点)
let keyIndex: number = this.getIndexInParent(); if (keyIndex === -1) { throw new Error('This is root! '); } this.keys = this.keys.concat(sibling.keys); if (this.isKeysOverflow()) {debugger; throw new Error(`Node key's overflow, shouldn't merge!`); ...
0
e4ad0f08c940e071c1e5881e2ab6114d
cc3fae6348dc73fb9c5275e86a12c42a
Parse an ARM instruction.
class FalconIsa(Isa): def parse_abc(form): fields = FalconFields return [ ParseWord(fields.b), ParseWord(fields.c), ParseInsn(form), ]
0
165c4b2272b7769e4f1196d78c5359c5
8a45fe7eeeeb4d43e0a7098d7f3f2d53
用于返回 css 类,对象的属性名作为类名,值是对是否返回该类名的断言
function classNames(v: string | (string | IObject | undefined)[] | IObject) { const type = _getType(v); const includes = ['string', 'object', 'array']; if (includes.indexOf(type) === -1) { return ''; } if (type === 'string') { return _trim(v as string); } if (type === 'object') { let r = ''; ...
1
37f1b46166f22c958b8bfe8b445894c8
d528ffbe199a9b3aaf8f8d504a68aff3
function that replaces all occurrences of an element by another in a new list
void replace (list* l, char original, char new_char) { list* p; for (p=l; p!=NULL; p=p->next) { if (p->character == original) { p->character = new_char; } } }
0
c469fb819e496754318235c03bec3bc4
52b3327529b493f0ed5fbd7bd09f461b
Преобразование текстового абзаца в HTML, обработка списков
wfProfileIn( __METHOD__ ); $textLines = explode( "\n", $text ); $lastPrefix = $output = ''; $this->mDTopen = $inBlockElem = false; $prefixLength = 0; $paragraphStack = false; if ( !$linestart ) { $output .= array_shift( $textLines ); } foreach ( $textLines as $oLine ) { $lastPrefixLength = strle...
1
d53519d1c8c46683998c0bcc3e066864
13e864ccce41f91e0d8a974e0970dcf7
Disables all controls for the specific side bar
function disableSides(side,dimension,color,mount){ curtainFadeOutAndDisabled(side); $(dimension).css({"opacity":".5"}); var dimensionInput = (dimension + " input"); $(dimensionInput).attr('disabled', true); $(color).css({"opacity":".5"}); var colorSelect = (color + " select"); $(colorSelect)...
1
9824d81252c4f30cf8b20ac0815ac7b3
58b59dc19d8ea598502197773f452b7b
Return hemisphere of electrodes based on coordinates.
tracker::set_hemisphere(double x, double y, double z) { if (get_logging()) return; char buf[MAX_LENGTH]; sprintf(buf, "H%d,%lf,%lf,%lf\r", STATION, x, y, z); port->send_comport(buf); }
0
7657b8878a161ad53ebeef85615e01d0
b2df3d172570b0c3a41e8f995a68fdb7
清空排序字段映射表
class SortRulesMixin(base_command_module.BaseCommand0): def clear_sort_rules(self): self._sort_fields.clear()
1
96bace2afe077757d6523ba7d1966e27
46c534431ab5c5be4857e812226867d3
Returns type that allows to inject optional instances of the same type
function optionalDecorator(token) { const optional = new _Optional(); return token instanceof InjectionToken ? [optional, injectDecorator(token)] : [optional, token]; }
1
7f7257ac93bb130150dc17727ac91c3e
6f841e07812eb15b2377f7ba12845c3e
Наложение водяного знака на изображение по заданным параметрам
class ModelExtensionExchange1c extends Model private function applyWatermark($filename) { if (!empty($filename)) { $info = pathinfo($filename); $wmfile = DIR_IMAGE . $this->config->get('exchange1c_watermark'); if (is_file($wmfile)) { $extension = $info['ex...
1
384ce748ea1de4b011c8e40525504a6b
4d256765bf074d846255438fc4956ae9
根据学号查询学号预约记录
public void testQueryByStudent() throws Exception{ long studentId = 0; List<Appointment> appointments = appointmentDao.query(studentId); for(Appointment appointment : appointments){ System.out.println(appointment); } }
1
fe98ea89864174134f6ada62ca192fb3
10987c4ac24224e35d7b9bfe9f846f6d
Método para obtener los documentos pendientes de un usuario
class EloquentDocument implements IDocument public function getInBox($uid) { $user = $this->user->find($uid); $results = $this->user ->leftJoin('document_user','users.id','=','document_user.user_id') ->leftJoin('documents','documents.id','=','document_user.document_id') ->where('document_user.type...
1
7a3b82acb1d8a9768f263b11263c3d9f
354cf2c0c637ebcb2c8800ead674cd6d
获取CCommandPool对象。
namespace Com.Rainier.Buskit3D public class ServiceCommand : IServiceCommand public ICommandStack GetCommandStack() { return ctx.GetCommandStack(); }
0
fba4eb09d1e1ad6daf168f720f25f0ab
e9994b462d92a4e4945da58f23bee06f
Gets the thread corresponding to the given node.
DECLHIDDEN(PRTTHREADINT) rtThreadGetByNative(RTNATIVETHREAD NativeThread) { PRTTHREADINT pThread; RT_THREAD_LOCK_RD(); pThread = (PRTTHREADINT)RTAvlPVGet(&g_ThreadTree, (void *)NativeThread); RT_THREAD_UNLOCK_RD(); return pThread; }
1
d157cbb408dff4a112b13bd0d2bf51b3
3ad30681a159ef380105560cd4ef5672
Get the list of all the downloads (DCAT Dataset).
q = ( SPARQL_PREFIXES + """ SELECT DISTINCT ?value ?url ?propid WHERE { ?x rdf:type SO:Dataset . ?x SO:identifier ?y . ?y rdf:type ?tt . ?y SO:value ?value . ?y SO:propertyID ?propid . OPTIONAL { ?y SO:url ?url } . FILTER (?tt = SO:Prop...
0
d589f4aeb13196977b76b8d21b4494ae
c7dae168f5228951062604675c4c3e7e
Adds the given base plan to the beginning of the arguments array
class OptionParser def unshift(arg) Array === arg ? @args = arg + @args : @args.unshift(arg) end
1
34c48566e44b6c3113eb92cb459ab521
aa2b9165c60ff512fbe5f212820797c6
This is invoked when the flowable is completed - need to close any pending publishers
public class SegmentedPublisherAndProvider implements FunnelDataPublisher, FunnelDataProvider @Override public void close() throws IOException { workRepository.close(); if (provider) workRepository.delete(); }
1
4767f5fc09b0a7ac4b3fb843c6d13e55
d1a4f80df1d2957c73c03812a8e433d9
Check string for variable format and write argument into XML on success.
{ char *current_value = ct_dnsmasq_get_value(handle, service, port, parname, ""); if(0 != strcmp(current_value, value)) { handle->modified = true; int status = SUCCESS; xml_param_t *pp = xml_find_param(parname, service, false); char *xpath = xml_make_xpath(pp, service, port);...
1
b3c4a5956bddd9457a0b65b1a0bb8924
f2ecab0a23dced98fd9602e5e7b36bcd
Функция-генератор, читает из сокета заданое количество байт.
def socket_reader(sock, to_read, timeout=10, buff_size=2 ** 13): last_read_time = time.time() while to_read > buff_size: temp = sock.recv(buff_size) if temp: last_read_time = time.time() yield temp elif time.time() - last_read_time > timeout: raise soc...
1
64ba2b3507f4a59d19407fa526ffa655
b0d5ef6b67359af9457a84874067c70c
寫回資料庫 & 釋放資源
{ dt = (ViewState["DataTable"] as DataTable); bool master_ok = false; int write_count = dt.Rows.Count + 1; if (dt.Rows.Count > 0) { using (SqlConnection conn = new SqlConnection(System.Web.Configuration.WebConfigurationManager.Connectio...
1
7c94219a7c672203f3ec40ed8b77dbd7
4c243cf1bb1ce3e724b30b8517e89ca6
Clear memory of image data
int JPEGProcessor::freeImageData(){ imgDataStruct.imgPixArray = NULL; return 1; }
1
ddab66411f7802cd1d9e917fcc3d2969
52e213e44512cb24e8175700568721fa
Expected null value for invalid inputs
func testValidateInvalidValue(t *testing.T, value *api.Value) { err := validateValue(value) if err == nil { t.Errorf("Expected error for invalid value") } }
0
68ea28fbac41bf37da4d81632e0e3192
eccd506a58dd03cd1f613e56fe7efad5
Add an item to a specific slot
public class Slot : MonoBehaviour public void AddSlot(Item newItem, int num) { item = newItem; icon.sprite = newItem.icon; if (item.isConsumable) { numImage.GetComponentInChildren<Text>().text = num.ToString(); numImage.gameObject.SetActive(true); } ...
1
e8529337a5c48ccb45b4bad46205b771
a7cefa89908a3485e6a5be3d6d0bf9cb
Calcula intersecciones de todas las rutas con cuadros de grilla
$junctions = []; foreach( $this->arrRoutes as $routeA ){ $iLimit = count($this->arrRoutes) - 1; for( $i = 0; $i < $iLimit; $i++ ){ $routeB = $this->arrRoutes[$i]; if( $routeA->getId() != $routeB->getId() ){ $junctions = array_merge( $junctions, $routeA->intersectionsWithRoute( $routeB ) ); } ...
0
bf0b8691c0366399381f3ea6ace4e55a
700392395aeb056a0364a21f225eaf3f
Retrieve snapshots that are not a dependency to any other snapshots.
ImmutableList.Builder<String> builder = ImmutableList.builder(); DependencyStack next = this; String prevString = null; while (next.parent != null) { String string = Objects.toString(next.where); if (prevString == null || !prevString.equals(string)) { builder.add(string); } ...
0