query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
f3760ff9ccff9b82d0428803e6493ac8 | 9fa7f51ecdf2fa10e3fa392f40b3cc4a | 마크다운을 읽어서 현재 문서에 반영한다.
다만 설계상의 문제로 마크다운의 루트 소제목은 반영되지 않는다. | let docURL = location.pathname.replace(/[^/]+$/, '') + markdownName;
const renderer = new marked.Renderer();
renderer.image = function (src, title, alt) {
const exec =
/=\s*(\d*(?:px|em|ex|ch|rem|vw|vh|vmin|vmax|%))\s*,*\s*(\d*(?:px|em|ex|ch|rem|vw|vh|vmin|vmax|%))*\s*$/.exec(
title,
);
let res = '<img... | 1 |
f95f02482cb28df5b5b098c286f7631c | 5037dfa3f107789bd91af79fbf1f18a5 | Simulates a single mouse _click on a button | namespace WindowsInput
public class MouseSimulator : IMouseSimulator
public IMouseSimulator XButtonClick(int buttonId)
{
var inputList = new InputBuilder()
.AddMouseXButtonClick(buttonId)
.ToArray();
SendSimulatedInput(inputList);
return th... | 1 |
6e84f02e458a068be7a68b402cb7af76 | cc0dfd1cba8233b41cd5689d5f676976 | add product to coupon | class Coupon_model extends CI_Model
function add_product($coupon_id, $prod_id, $seq=NULL)
{
if(is_null($seq))
$seq = $this->get_next_sequence($coupon_id);
$this->db->insert('coupons_products', array('coupon_id'=>$coupon_id, 'product_id'=>$prod_id, 'sequence'=>$seq));
} | 1 |
41d678761bb27f94b310190ae2401d95 | af0e7cb59adb9c883465d32e8dab6306 | Metoden pausar programmet för bättre interraktion med användaren | namespace Exercise_5
public class Program
public static void Pause() {
Console.WriteLine( "\nPress any key to continue..." );
Console.ReadKey();
} | 1 |
b74fc0d6199fa93bc64df5d969930380 | 3b74a88735f479dae993cd8fc306ee4c | Rollback a migration for all the connections | @Component
public class ReachChairmanImporer implements Importer
private void rollback(List<Connection> connections) throws SQLException {
for (Connection connection : connections) {
connection.rollback();
}
} | 1 |
194b3cb50730fb74e0a9904fd975ab39 | 6b9aff97932e7acda0faf9d8843eb6ea | Given a search token, returns a configuration which would match a JSON. | if field.is_default:
return {
"multi_match": {
"query": self.token,
"fields": ["name", "corpus"]
}
}
else:
return super().to_query(field) | 1 |
a9ffc68194fc9a31c7557fc270f8504c | 24f348354227c0d3df43ba47fa591553 | 返回正常的界面想要展示的View的Id | abstract class BaseActivity : Activity()
protected abstract fun getContentViewId(): Int | 1 |
a0d7c5f120eb42eec1265860aab1bccb | 68eb0e606d9d529f2adb0e7ace9d0388 | Visualize one or many regular triangular prisms with different features. | plotter = pyvista.Plotter(lighting=None)
for plane_y in [2, 5, 10]:
screen = pyvista.Plane(center=(0, plane_y, 0), direction=(0, 1, 0), i_size=5, j_size=5)
plotter.add_mesh(screen, color='white')
light = pyvista.Light(
position=(0, 0, 0), focal_point=(0, 1, 0), color='cyan', intensit... | 0 |
c0bdd337a0ac309475386954fd5256fe | 405ae93e55709938b2e9060b8eb384b4 | 获取用户备注的所有信息 | class UsersRemarkController extends Controller
public function show(Request $request, $openid)
{
$openid = e($openid);
$exists = GrantUserModel::where('openid',$openid)->exists();
if (!$exists) return response()->json(['success'=>false,'msg'=>'非法的请求,没有该用户存在!']);
$user = UsersRem... | 0 |
20c4e9e7d95238a129e2dc30715ee822 | bf7c6e8c72441d2b3cd64abfae643ead | change la couleur de fond de la fenetre qui a le focus | global ent_couleur,link1,label_change,label_taille,label_police,background
ma_couleur=ent_couleur.get()
background = ma_couleur
accueil.config(bg=ma_couleur)
parametre.config(bg=ma_couleur)
compte.config(bg=ma_couleur)
classement.config(bg=ma_couleur)
label_police.config(bg=ma_couleur)
... | 0 |
b79396edfa2a0326b7d5e030656f5daf | 13bec29bfef6de5a944537f8c6587fd0 | Получить идентификаторы для подчиненных только первого уровня | public int[] GetOneselfAndJunior(int[] ArrParentID)
{
try
{
int[] ArrJunior = _Repository.GetAll().Where(p => p.IsDeleted == false && ArrParentID.Contains(p.ParentId))
.Select(s => s.Id).ToArray();
if (ArrJunior.Length == 0)
... | 0 |
1269eb11e1bb1c252b851b5d8aa1f9ae | acd332b6baf48c888516ed0370b53859 | Gets all of the keys/values collection from state. | @NonNull
KeyValues getAllKeyValues(); | 1 |
ce4e0c91cb36cdc245b7bf63cd647c36 | db3afe0aed76fb4e07b7ee5573775670 | Asserts a fact into a prolog knowledge base. | namespace SCPropositionalLogic.Inference
public class ResolutionKnowledgeBase_FromAIaMA : IKnowledgeBase
public void Tell(Sentence sentence)
{
sentences.Add(new CNFSentence(sentence));
} | 0 |
6a48b9973bc48caf13ccd297cae9ce38 | 862651c6f35f9a10e29f8a2eac69de56 | <p>
根据输入的Pattern获取传入时间
</p> | public class DateUtil
static public Date parseTimeByPattern(String s,String pattern) throws ParseException {
SimpleDateFormat format = new SimpleDateFormat(pattern);
return format.parse(s);
} | 1 |
35971831c46f7f8216705785179cb6d4 | 07fdc37550f029051131ed8a50f5aef9 | Return true if the response was taken from the cache. | class APIResponse
public function wasCached() {
return $this->wasCached;
} | 1 |
7cc701f512ca54858191f08941addfcf | f47e96993c9e77aafe91f22126289a4d | Парсинг свойств json .env файла. | export class EnvParser
public parse(envString: string) {
const envCollection = dotenv.parse(envString.trim())
return Object.keys(envCollection).reduce((result, key) => {
result[key] = this.interpolate(envCollection[key], envCollection)
return result
}, {})
} | 1 |
424e65bac9b45bfce73c4f1c3860a116 | 73e6ebb12e7aa771700e5bafb844a944 | Returns values corresponding to major and minor classes (in two-class classification problem). | lower = self.clfl.predict(x )
upper = self.clfu.predict(x )
ret_val = np.zeros((len(lower),2))
ret_val[:,0] = lower
ret_val[:,1] = upper
return ret_val | 0 |
1aae77a179a2a4c2b41177becccca490 | ccb0e132accc6000c3d1a77b2640ba91 | Returns the number of pull request events | ccs = commit_comments(pr)
prcs = pr_comments(pr)
ics = issue_comments(pr)
(ccs + prcs + ics).reduce(0) do |acc, ic|
unless ic[:body].nil?
acc + ic[:body].gsub(/`.*?`/, '').\
scan(/#([0-9]+)/).\
select do |x|
!pull_request?(pr, x[0].to_i)
... | 0 |
6df61e9e323ad74c92c4743883698cac | c555ef7228b78452e34141fb496cc07d | takes in raw .wav data, parses needed data to play on codec | try {
ArrayList<String> lineTokens;
String tkn;
for (String line : data) {
lineTokens = parseLine(line, 2);
if (lineTokens.size() > 3) {
if (lineTokens.get(1).equalsIgnoreCase("video")) {
tkn = lineTokens.get(2).trim();
Format = tkn.substring(0, tkn.indexOf(' ')).trim();
tkn = ... | 0 |
b1b543233e28826534cee2f6f797ee4e | b371d2f3c51f14281d8331498bd7912a | An action for analyzing a given string. | try:
action = Action.parse(action_string)
language.validate_action(action)
game.evaluate(action)
except ValueError:
LOGGER.error('syntax error in action "%s"', action_string)
print('syntax error: ACTION is VERB PREPOSITION OBJECT')
except InvalidActionException:
... | 1 |
964fc8d807792fb37ce00e31400a03da | fcda6fb0fc4c29f9638620684b21676f | Retourne un tableau de forme [x, y] représentant les coordonnées
auxquelles le fantôme de couleur demandée se trouve en début de niveau. | int[] coordPiece(Echiquier echiquier, IPiece pieceCourante); | 0 |
11827631746e69e7120555fbc30f5e51 | 7444464e785121cedbeb40079af935aa | Check if the given file extension is a vector image file extension. | namespace OpenXcom
bool Mod::isImageFile(std::string extension) const
{
std::transform(extension.begin(), extension.end(), extension.begin(), toupper);
return (
extension == ".BMP" ||
extension == ".LBM" ||
extension == ".IFF" ||
extension == ".PCX" ||
extension == ".GIF" ||
extension == ".PNG" ||
exten... | 0 |
0fd872b0745377a20b0ee62d352a7a1c | 9e18e339385d41e7a23f30aefcf14904 | Sets value of attribute EndTime for DrTestAction node. | @JsonFlatten
@SkipParentValidation
public class WorkflowRunActionRepetitionDefinitionInner extends Resource
public WorkflowRunActionRepetitionDefinitionInner withEndTime(DateTime endTime) {
this.endTime = endTime;
return this;
} | 0 |
7126fe212a8571875cee79f7ce9a55ea | f768ee453b1394a5fdf986aa064c70da | Ensure permissions for study-level views are properly configured. | class LoadRequestViewTests(EddApiTestCaseMixin, APITestCase):
def test_create_load_no_permission(self):
url = rest_reverse("rest:study_load-list", args=[self.study.pk])
self.client.force_login(UserFactory())
response = self.client.post(url, format="multipart")
assert response.status_code... | 1 |
c29faa51aaa89c26f8bb199a2c29174d | 89b00ccd6e4de48214bd8d068a26632e | Return a list of all buff names | public final class BuffRegistry
private Set<Buff> getAllBuffs()
{
return new HashSet<Buff>(_buffMap.values());
} | 0 |
888d730c505ff3e2f788490dcad61d84 | 0d248432f411b12b9882981bd1818d3d | Verify that parsing succeds with problematic .changes files. | public void oscWrite() {
InputStream input = getClass().getResourceAsStream("/test2.osm");
OsmParser parser = new OsmParser();
try {
parser.start(input);
Storage storage = parser.getStorage();
assertFalse(storage.isEmpty());
File file = File.cr... | 0 |
62eeddf51e66606a43b6bb94a5f5bfc1 | e31c1894d11e468532f741915898ed13 | The version of the managed rule set. | class GoogleCloudBillingBudgetsV1beta1AllUpdatesRuleResponse(dict):
def schema_version(self) -> str:
return pulumi.get(self, "schema_version") | 1 |
db8a94f1430ec0c9a24f2f049dc425e9 | 47d0e1f282df8e27d93fbbc2bae841a6 | Get the resolution bits of the sensor.
00 = 15-bit,
01 = 16-bit,
10 = 17-bit,
11 = 18-bit | uint8_t AT30TSE75x::geNVConversionResolution() {
uint16_t config = getNVConfiguration();
return (config>>AT30TSE75x_NVCONFIG_NVR_BIT)&(0x0003);
} | 1 |
de19580bb68ec262f3b65f6cd3f5a593 | 1decfc130c9c354f88deb934534994d5 | overriding the not equals (!=) operator | class Item():
def __ne__(self, other):
return not (self == other) | 1 |
d9d9d96c0f32a191335cb2b059946103 | ce9c117cc2579e53287e000754f3abe5 | adds one seven meter for Team B after the 7m button was clicked and displays the new value | public class MainActivity extends AppCompatActivity
public void addOneCornerTeamB(View V) {
cornersTeamB = cornersTeamB + 1;
displayCornersForTeamB(cornersTeamB);
} | 0 |
c3c2ac1b51386e8409155d90cf9f92f3 | 2e4f153fd078b1542cce80a72e289021 | converts image_vector (784,) into a matrix(28, 28) | def convert_2d_to_vector(img):
return np.reshape(img, img.shape[0] * img.shape[1]) | 0 |
44dbe8c6a8e3b01e52c8f3b0ee895f29 | 38b8be221e61ce51eec6e3efbe533fe9 | Initialise a classifier that classifies query strings as either smltk or qna. | self.queries = queries
self.classes = classes
self.labeled_entities = labeled_entities
self.class_index = class_index or {}
self.named_entity_index = named_entity_index or {}
self.context_set = context_set or set()
logging.basicConfig(level=logging.INFO, stream=sy... | 0 |
51a03d16bc6307c06ecc72a621ca3a46 | 1b1853be45dac834a9f9bf3f534ec8aa | Вью групп.
Выводит посты относящиеся к одной группе, разбивая по страницам. | {
$filter = new PagesFilter(self::ARTICLE_TYPE);
$articles = $this->pages()->getChildPagesQuery($data['page'], $filter);
$data['articles'] = $this->paginator()->paginate($articles, $request->get('page', 1), self::ARTICLES_PER_PAGE, ['wrap-queries' => true]);
return $this->renderPage(... | 1 |
39f6bfbb57bcd4bd3c27971a027c7b14 | 7cf9a47114d2f895ce3e07fd2ef49d77 | Method to set the value of field ext_number | public class SDataCfd extends erp.lib.data.SDataRegistry implements java.io.Serializable
public void setExtraNumber(int n) { mnExtraNumber = n; } | 1 |
3da230f4bec75a0035a6d64bf116d2aa | 3754bec7b8a50a4c9c32ac1051432763 | Sets the value of the JobProperty and lock it in one command . | {
using (LazyLock())
{
if (!this.propDic.TryGetValue(name, out object current) ||
!Util.GenericEquals(current, value))
{
this.propDic[name] = value;
this.RaisePropertyChanged(name);
... | 1 |
48d0f03c7ff2ce85a83120ff82c73d18 | 87e14f0f36be6e00bb07a510758c18ae | Parses a function declaration given a return type and a function name. | int
inb_rdr_parse_function(INB_strm* strm, Function** ret)
{
const Type** frame = NULL;
unsigned frame_size = 0;
ResolveList* local_resolves = inb_rslv_new_resolves();
SKIP_WHITE(strm);
const TypeFunction* typ = NULL;
if(inb_rdr_parse_function_sig(strm, &typ) == STATE_FAILED){
return STATE_FAILED;
}
cstring* ... | 1 |
1fd552257b3bd50315df94e412bd60fb | 4a2e20aa01f64c37b4203f97470c9883 | Baixa todos os links marcados (removido) | {
DB::transaction(static function () use ($request) {
collect($request->data['ids'])
->chunk(1000)
->each(static function ($bulkChunk) {
DB::table('itens')->whereIn('id', $bulkChunk)
->update([
... | 1 |
c763e48c916da78790eab89365a0430d | 4a1eb76808bdf495fde06dfbfa6fc36a | Writes a mesh to collada file format. | {
var vertices = mesh.GetVertices();
var normals = mesh.GetNormals();
var indices = mesh.GetTriangleIndexes();
if (0 == vertices.Count || 0 != vertices.Count % 3 || vertices.Count != indices.Count)
{
throw new ArgumentException(Properti... | 0 |
a65ef3f1e5516ca439ddf329554ad4a4 | 3110355a5162b2c97dda5b0ef81b986f | Localizes all the display names of the model properties by using the resource mapper to generate the keys.
Display names are later used in validation and error messages. | public partial class UserProfileUserControl : System.Web.UI.UserControl
private void SetLocalizationResource()
{
this.UserNameLocalize.Text = UserProfileResource.UserNameLabelText;
this.MiddleInitialLabel.Text = UserProfileResource.MiddleInitialLabelText;
this.Localize1.Text = UserProfileResource.Localize1Text.R... | 1 |
3692a348ae532d7cd7389071955df1ca | 799ac6cddb5f76ed8f73a6e6bd656123 | ログを取ります。 | {
string key = AuthManager.User.UserId;
FirebaseDatabase.DefaultInstance.GetReference("logs/" + key).GetValueAsync().ContinueWith(task =>
{
if (task.IsFaulted)
{
Debug.LogError("Cannot read log from DB.");
}
else if (task.IsCompleted)
{
Debug.Log("Success to read logs from DB.");
log_s... | 1 |
ef5b079195c11783a9034e97e82b5266 | efda58812f9c65900baaddf7359ed21f | Updates screen for day view button click | public class WorkoutHomeActivity extends CustomActionBarActivity implements IGraphSetup{
private void updateDayScreen(Calendar cal){
this.cal = cal;
workoutActivityList = (ArrayList) diary.showDaysActivities(cal);
updateActivityList(workoutActivityList);
} | 1 |
0a729cf87f13039c603305bad92bc48e | b00b5524cd5742ff14bb8aba2e592408 | 更新今天推荐人数 | $where['id'] = array('NEQ',0);
$data['today_one_num'] = 0;
$data['today_five_num'] = 0;
$data['today_ten_num'] = 0;
$data['today_twenty_num'] = 0;
$data['today_thirty_num'] = 0;
$data['today_fifty_num'] = 0;
Db::name('user')->where($where)->update($data);
} | 0 |
2648361d8ebc3efd45580d2f0d82721a | dac24ef0e61d16dfe4ea8484f65031d2 | função para realizar o cadastro de Usuário | function fCadUser(){
const msgBox = document.getElementById("msg-box")
const txtName = document.getElementById("txt-name")
const txtBirth = document.getElementById("txt-birth")
const txtPhone= document.getElementById("txt-phone")
const myBody = {
name: txtName.value,
birthDate: txtBi... | 1 |
65142be1833edf41d8d80fb49fd985b0 | 9cbfc232293391575a1ff926c1f9fb9b | Emulates a real-image Sawyer Env without access to robot, only works together with the Offline Agent! | class OmniscientAgent:
def __init__(self, env: warehouse_env.WarehouseEnv):
self.env = env | 0 |
4757628977222c8f27dde2e62aa8745c | 342a7928dd567eccbeb388edd14bc144 | <pre>
If [code][google.spanner.v1.Type.code] == [ARRAY][google.spanner.v1.TypeCode.ARRAY], then `array_element_type`
is the type of the array elements.
</pre>
<code>.google.spanner.v1.Type array_element_type = 2;</code> | boolean isSetTypeElement(); | 0 |
98630c1956cdf3eb7ab68a4201c1a416 | abf20ecff4609fba8c3933fda62774ce | Returns the TCP server socket. | public DatagramSocket getServerSocket(); | 0 |
6075c347676eb157925fb2f5d57d5e53 | c9e477b76a7a1c94ebc3955d6ae2ae12 | Check that the newton powerUp correctly get the possible targets and move them on the chosen position | public void testTargets1_4() {
beforeAll();
BoardCell cell = board.getCell(1, 0);
board.calcTargets(cell, 4);
Set targets = board.getTargets();
assertEquals(7, targets.size());
assertTrue(targets.contains(board.getCell(0, 3)));
assertTrue(targets.contains(board.getCell(3, 0)));
assertTrue(targets.conta... | 0 |
e5879a73ebc4d1fff649de0467efda39 | 7690846cb2b6eafae44d0da56a98fa50 | Like [forwardCursorPositions] but moves backward. | class Marky
expandSelectionBackward(num = 0, editor = this.editor) {
const start = editor.selectionStart - num;
const end = editor.selectionEnd;
editor.setSelectionRange(start, end);
return [start, end];
} | 1 |
b4a260ebcc0b1a843293690513d7a3c1 | b581d2013da522690ac819b057e89bca | Shared at: http://stackoverflow.com/a/28236548/1522342 | let result = '';
while (true) {
if (!haystack.length) {
return result;
}
const index = haystack.indexOf(needle);
if (index === -1) {
result += haystack;
return result;
}
result += haystack.substr(0, index);
... | 1 |
0eb2a9c9715e45a05be3de311299fbbc | abf49860d9ec7684b576a7c656028b68 | Возвращает ссылку на выбранный в списке расчётный счёт | public class MainWindowBean implements Serializable
private AccountDto getSelectedAccount(final UserDto userDto, final String accountNumber) {
for (AccountDto a : userDto.getAccounts()) {
if (accountNumber.equals(a.getNumber())) {
return a;
}
}
return null... | 1 |
cfc561767335f6488a10b62bcdb41a8b | d4b8325885a90989121466f64cbf3398 | Move the cursor to the end of the current logical line. | class Cursor:
def end(self):
while self.position < len(self.document.characters) and self.document.characters[self.position].character != '\n':
self.position += 1 | 1 |
656599b30f70275290ce988a0bb9f365 | 5d3872bb04aa53d194a766945fcc8c2c | method to set the time slots adapter | public class ScheduleActivity extends AppCompatActivity
public void setScheduleAdapter()
{
scheduleAdapter = new ArrayAdapter<>(
ScheduleActivity.this,
android.R.layout.simple_list_item_1,
schedule.getCourseNames());
scheduleListView.setAdapter(schedul... | 0 |
628ab8d9935c05e14b514c3bb943c2ef | 03ab9b25901893cbb840bae1096bcee9 | 距離のインデックスを返す。 | for i in sorted(self.points.keys()):
if i == self.getLastIndex():
return i - 1
lp = self.points[i+1]
if lp.linearDistance is None:
self.setPointDistance(lp)
if lp.linearDistance >= d:
return i | 1 |
9965b21309f78a2608e1c3b6557622e8 | 0ea45d47a271afdefb542d2702951d6f | Check if this player is related to the current member | {
$alliance = $this->getAllyRelation($aid);
$friend = $this->getPlayerRelation($userid);
if(!($alliance instanceof stdClass))
{
$alliance = new stdClass;
$alliance->acs = false;
}
if($alliance->acs || $friend || (!empty($aid) && $aid == $this->aid))
{
return true;
}
return false;
} | 1 |
da3fa0eec830dc4736e544deef05f1c0 | 1c3565b9cda77106917c1593c9b2d228 | 更新资金池记录 | $fundId = isset($fundId)?$fundId:'';
$fund_last_fair_value = isset($fund_last_fair_value)?$fund_last_fair_value:'';
$fund_balance_amount = isset($fund_balance_amount)?$fund_balance_amount:'';
if(empty($fundId) || empty($fund_last_fair_value) || empty($fund_balance_amount)){
if($this->isInTransaction()){
... | 1 |
3b96334690c059e2dc6ccfe538cc3549 | cacc02b401558fa192b630a1a6b9b6a6 | Gets IDB record for style ID. | class SLSSession extends CookieSession
public function getStyleID() {
return $this->styleID;
} | 0 |
389245fbfd2d6c349ae88d4ed78962e5 | 3019a570a3cb7c832f4e7d11a512ea23 | 通过用户id和订单状态分页获取订单信息 | public Page<Order> getOrdersByUserIdAndStatus(Long userId, String status,
Page<Order> page); | 1 |
629824bca69107d96726e087f3893d79 | d355e84fab73c0b85f99e0b4d32389a4 | Hide the switching roles prompt | btn_cancel_change_role.setOnClickListener {
hideKeyboard()
layout_change_role.visibility = View.GONE
layout_profile_user.visibility = View.VISIBLE
}
} | 1 |
56030b4cb7cdccc3811b8d30911bb813 | da4266538fcbf84782f72a44c28d8a47 | 圆等分函数 | def func_01(num, is_count=None):
r = 0
hight = 100
for i in range(num):
r += hight
hight /= 2
r += hight
return hight, r | 0 |
26a89988e0b3ebbd45bbc25da7b4fbf3 | db849a3f138dd5527e0ed9a4a5a65f0b | Setea la salida de video para camara de filmación y fotografía. | class Mobile
public void setCamera(String camera) {
this.camera = camera;
} | 0 |
aa398ea45b4415ab657274c2fec939b2 | 0ce9c67a532f69cba06f6cb94b127676 | Returns the list of Lake Areas | ArrayList<String> lsAreas = new ArrayList<String>();
lsAreas.add(COMBINATORY.toString());
lsAreas.add(MUSIC.toString());
lsAreas.add(OPTIMIZATION.toString());
lsAreas.add(GRAPHS.toString());
lsAreas.add(GPGPU.toString());
lsAreas.add(COMPUTATION.toString());
lsAreas.add(LIAMF.toString());
lsAreas.add(... | 0 |
c9832640bdba252eeb5ab96b0ed44859 | c7670aa1d81db6ddd2802e6de6dd920c | Apply app state to all environments | function reducer(state = defaultState, action) {
if (!state.getIn(moduleDomainRoot)) {
state = state.setIn(moduleDomainRoot, defaultState);
}
switch (action.type) {
case ENVIRONMENT_GET_INFO:
return state
.setIn(["environment", "state"], "loaded")
.setIn(["environment", "ab... | 0 |
56ebffe9346d1c21dce66a1eb05c48a6 | 8cbba77725c8c2dd5440ed2ee1efa3a8 | Verifies if the login page is loaded | class LoginPage extends Base
checkLoaded() {
this.wdio.wait(this.title)
this.assert.equal(this.title.getText(), formData.title)
} | 1 |
56655553d27351171921dd8fb2e0f77a | f9c182be6e69427d99b7d64885df7072 | Range returns a new Range element. | {
Range* range = (Range*)Obj_allocate(sizeof(Range), Range_classVTable);
Range_make(range, start, end, exclusive);
return range;
} | 1 |
aba5dfd4b567c1f0dfaff8e3124dc990 | da945b96db716d6df71944d849bacedc | Create an action to update Snapshots. | com.azure.resourcemanager.AzureResourceManager azure) {
azure
.virtualMachines()
.manager()
.serviceClient()
.getSnapshots()
.createOrUpdate(
"myResourceGroup",
"mySnapshot",
new SnapshotInner()
... | 1 |
68c1d89b5248671799d623778a42c6ed | 186660cc0c35d4fea987c4f02da65d4d | メッセージの送信先ユーザを取得 | public class MessageBean
public String getMsgTo() {
return msgTo;
} | 1 |
b2a501a41889ed330ec07c9c8711ce24 | 04c8ecd489c4b6311b4e9d21a8f411a5 | 设置弹幕样式 | barrageContext = DanmakuContext.create();
HashMap<Integer, Integer> maxLinesPair = new HashMap<>();
maxLinesPair.put(BaseDanmaku.TYPE_SCROLL_RL, 20);
HashMap<Integer, Boolean> overlappingEnablePair = new HashMap();
overlappingEnablePair.put(BaseDanmaku.TYPE_SCROLL_RL, true);
... | 1 |
f302f7dee6b91833e8dbe23affe82b2b | d3bb3a722b142b2317c3bf103ed11e74 | Finds the Dictcategory model based on its primary key value.
If the model is not found, a 404 HTTP exception will be thrown. | {
if (($model = ProdCategory::findOne($id)) !== null) {
return $model;
} else {
throw new NotFoundHttpException('The requested page does not exist.');
}
} | 1 |
70ba2370de14e7b7dcefd94af3054926 | 6470d4b17d7e82148ffb504e3d073c8d | Add the value found in Step 4 to every element of each covered row,
and subtract it from every element of each uncovered column.
Return to Step 4 without altering any stars, primes, or covered lines. | class Munkres:
def __step6(self):
minval = self.__find_smallest()
for i in range(self.n):
for j in range(self.n):
if self.row_covered[i]:
self.C[i][j] += minval
if not self.col_covered[j]:
self.C[i][j] -= minval
... | 1 |
d365709d2d948644f78a1f66fca9d96b | 3eb993a39911c5e5a2f42d4fcb6c4943 | Counts the no of uncompleted tasks | class TodoHeader extends React.Component
getUnfinishedCount() {
return this.props.todos.filter((i) => {
return !i.isComplete;
}).length;
} | 1 |
a42ae20392974bb5a4149ca06c25e5b6 | ebb339dfd7751bb2dc8df31966990b64 | 将long类型的time 转化成format的string | public class CopyOfMyTools implements java.io.Serializable{
public static String LongTime2StringTime(long lo,String format){
if(isNull(format)){
format="yyyy-MM-dd HH:mm:ss";
}
return new SimpleDateFormat(format).format(lo);
} | 1 |
6f6dbac3eb2a9d22e8bf51f641e143a7 | 2aae2c35c4bda850e1b8b972a50ccfaa | Generate Toolbar Left hand side data | $_tool = function($class, $title, $icon) {
return '<a class="' . $class . '" href="javascript:void(0);" data-toggle="fks-tooltip" title="' . $title . '"><i class="fa fa-' . $icon . ' fa-fw"></i></a>';
};
foreach($rows as $k => &$v) {
if(isset($v['active'])) { $v['status'] = $v['active'] == 1 ? '<span cla... | 0 |
323e1eaa2a171ecc2d3cd1dd6648dda5 | bb87106f6628731e924ed6dbb47cd921 | erase the cell from the canvas | {
setka[Ycoord, Xcoord] = 0;
gr.FillRectangle(er, 21 + SizeOfCell * Xcoord, 41 + SizeOfCell * (Ycoord - 1),
SizeOfCell - 1, SizeOfCell - 1);
} | 1 |
78b7abe56f2bf3eb7023df370a91d022 | 8ef2a0e220a72010fdad8716ccc053a3 | Checks if the project and sub projects should be visible. | @Singleton
public class ShowHiddenFilesAction extends Action
@Override
public void update(ActionEvent e) {
e.getPresentation().setVisible(appContext.getCurrentProject() != null);
} | 0 |
77bc8a901bb850a4b450f8a69a385c05 | 2d426e95d5ac062e11e0c9fb89dde1a3 | accepts hh:mm format - convert hh:mm to "minute-stamp" | const int MINUTES = 60;
size_t pos = str.find_first_of(":");
if (pos != string::npos) {
string hh = str.substr(0, pos);
string mm = str.substr(pos+1, str.length() );
return atoi(hh.c_str()) * MINUTES + atoi(mm.c_str());
}
else {
return -1;
}
} | 1 |
1293ea471aab38293dd0a3574c7e7087 | c067ad0c6e0ef072c93987dbbd5d0881 | 接受服务器广播弹出参加提示框(进入各种决赛的玩家会出现提示) | public class MatchHandler : HandlerBase
private void startBro()
{
promptMsg.Change("所有玩家准备开始游戏", UnityEngine.Color.blue);
Dispatch(AreaCode.UI, UIEvent.PROMPT_MSG, promptMsg);
Dispatch(AreaCode.UI, UIEvent.PLAYER_HIDE_STATE, null);
} | 0 |
feb540bb5f813a7fcbb401e5e4483733 | b349f3c56425e557425fa3e6541b9938 | 跳转微博首页 | class WeiboController extends AppController{
public function toWeibo($uid, $sid){
$this->flash('即将离开豆壳网,进入新浪微博页面!', 'http://api.t.sina.com.cn/'.$uid.'/statuses/'.$sid, 2);
} | 0 |
09394c13c2ac8bf8f40d0be0027d83af | 838a44d54328e3bdfb76f1c0ad1638bd | 压缩bitmap 为长边小于某个值得bitmap | val bm: Bitmap
if (mBitmapWidth > mBitmapHeight) {
bm = Bitmap.createBitmap(bitmap, (mBitmapWidth - mBitmapHeight) / 2, 0, mBitmapHeight,
mBitmapHeight)
mBitmapWidth = mBitmapHeight
} else if (mBitmapWidth < mBitmapHeight) {
bm = Bitmap.cre... | 0 |
677bb511088f1721a0368baee5378003 | fd0851663a20e31c000cf4ecdecc8c93 | Returns a new object of class '<em>Task Priority</em>'.
<!-- begin-user-doc -->
<!-- end-user-doc --> | public class TaskItemProvider
extends StandardclassItemProvider
implements
IEditingDomainItemProvider,
IStructuredItemContentProvider,
ITreeItemContentProvider,
IItemLabelProvider,
IItemPropertySource
protected void addPRIORITYPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(crea... | 0 |
e984c4f4443cbac0bc545f398c4aae86 | 863c1be99701e21f73b81320a5630ec4 | 查询商户当前应用下的用户(最多一条,当一条也不存在时sql会报错) | public List<MerchantUser> selectMerchantUserList(MerchantUser merchantUser); | 0 |
053b0d54418549cdb2a14bb5ebefa417 | 2fa13743740ccea9eb3517d3fe68144e | Free routine for DF_PathHistoryPointList. | int DF_PathHistory_free(PathHistory_t *path_ptr)
{
int result = 0;
if(path_ptr != NULL)
{
if(path_ptr->initialPosition != NULL)
{
DF_FullPositionVector_free(path_ptr->initialPosition);
FREEMEM(path_ptr->initialPosition);
}
if(path_ptr->currGNSSstatus !... | 1 |
4d2118aa80c77fee64f669c48d1832d7 | bab304b6da01d701e94429df667680ec | Gets the first visible and enabled item | {
for(int i = 0; i < itemList.Length; i++)
{
if (itemList[i].childCount == 0)
{
return itemList[i];
}
}
return null;
} | 0 |
f861b8ff6a766c594c163a4165de2fe7 | 8e5e59f622f69c56e459d84147932d32 | Returns the badge code from its name | public function getBadgeName(); | 0 |
dc397c4acf12ac99d01930380b80986a | 5fd35c9fe3a66bcdd433426d069590f3 | 检查player正上方是否有物体 | {
RaycastHit2D hit2D;
if (isClimb)
{
if (nowDir == PlayDir.Right)
{
hit2D = Physics2D.Raycast(objTrs.position, Vector3.right, boxSize.y, playerLayerMask);
}
else
{
hit2D = Physics2D.Raycast(ob... | 0 |
72eddae484fef9e535bfb0a500fcbf1e | b71b066620a70c823645a24f55db47e5 | Get request rules reflection. | class RequestLimitRules implements ModelInterface, ArrayAccess
public static function getters()
{
return self::$getters;
} | 0 |
e1094bac0f55c9a4afefdded079eba23 | 48d9533fee4c3fcc69d8a7bf8026b640 | Array of response headers which have already been set. | {
if (myResponseHeaders == null)
{
myResponseHeaders = New.map();
}
return myResponseHeaders;
} | 0 |
15cbb9b144ccac9f9b415600f51fd566 | 629c09248032a34ea1d15b27be3ec5eb | 删除二维列表data中指定列的元素 | col = []
for row in data:
col.append(data[i])
return col | 0 |
30a9873395036acb06e767723bdb4fd6 | 7962ed506ccc6ddf5e6a65b622135beb | Factory method returning an :class:`IsoJobCreator` for the passed ISO
request. | class RackPositionPlanner(_LayoutPlanner):
def _create_container(self, pool_pos, pool_container):
return RackPositionContainer.from_iso_request_position(pool_pos,
pool_container.stock_concentration) | 0 |
ea37ca7630b4c569bd1166d0ba88ca9a | 2030faed85021de06e84a0c0d13b73af | Removes the nodes and edges according to the
desired degrees-to-trim (input value). | boost::graph_traits<ARCS::Graph>::vertex_iterator vi, vi_end, next;
boost::tie(vi, vi_end) = boost::vertices(g);
std::vector<ARCS::VertexDes> dVertex;
for (next = vi; vi != vi_end; vi = next) {
++next;
if (static_cast<int>(boost::degree(*vi, g)) > max_degree) {
dVertex.push_b... | 1 |
c8feef26010234511485a5ea7cdf25c3 | 5bee9d2d4992d2e5f6fee1618cfa84ef | 模糊匹配搜索文档 | public class SearchUtil
public void searchByFuzzy(int resultNum){
IndexSearcher searcher = getSearcher();
Query query = new FuzzyQuery(new Term("name","make"));
findQuery(resultNum, searcher, query);
} | 1 |
aa7fbef94c3ef37d60509b22a183b75e | 8c67fe8e9dd021eb3d77020eb49a2fb2 | I2C Driver Queue Entry Type
Defines the object used for an entry in the i2c queue items.
This defines the object in the i2c queue. Each entry is a composed
of a list of TRBs, the number of the TRBs and the status of the
currently processed TRB. | volatile __attribute__((coherent)) typedef struct
{
uint32_t count;
I2C_TRANSACTION_REQUEST_BLOCK *ptrb_list;
I2C_MESSAGE_STATUS *pTrFlag;
} | 1 |
f23b07d7820677cf6d8fba9243f0ff0c | de1979838e9d6c0afea4e05df0b84810 | Restore the contents of the question text box. | {
Question currQ = tempTest.Questions[questionPosition - 1];
Text = tempTest.Name;
txtBoxQuestion.Text = currQ.Name;
txtBoxVar1.Text = currQ.VariantsAnswers[0].Name;
chkBoxVar1.CheckState = (currQ.VariantsAnswers[0].isCorrectAnswer) ? CheckState.Checke... | 1 |
dcd11173a6475a46dc40ee221394e274 | b4a4d0d7fb2123189ef5f02736e9b437 | Test that when the cryptotoken is offline the status code is 503. | class SingleRepoTest(TestCase):
def test_single_repo_popularity_wrong_token_value(self, mocked_env):
response = self.call_github_rest_api_for_popularity()
self.assertEquals(response.status_code, status.HTTP_500_INTERNAL_SERVER_ERROR) | 0 |
b5da6cf2d18c3ca8c0b0b90234ec04ad | d35fee385f885655fb3ee23b57a18c47 | 打印错误日志并返回数据对象 | public class LogUtil
public static void printResponseErrorLog(String content,Exception e) {
logger.error("<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<" + content + DateUtil.dateStr(new Date(), DateUtil.DATEFORMAT_STR_025),e);
} | 0 |
391fdf2dc8e96e18a5fa8e0e0383216c | 3d89a983e4954c0d121eadcdc221f999 | @brief Função que cria um Jogo novo. | function NovoJogo()
love.audio.stop(intro)
GameOver, Comecou = false, false
ContInimigos, NumTiros, Contagem, Tempo, Pontos, TempoExplosao = 0, 0, 0, 0, 0, 0
TempoCarregarMissil = -1 tempo = 1
VelInimigos = 9 VelMissilInimigo = 12
Submarino = {img = drawable.newDrawable("img/sub.png", 20 , AreaY /2), conf... | 1 |
b9e9438dd53a3b5dd54d9ebc7f7a1a10 | 2d805b0f9bbf7cf0d9af2b6c578ee4d2 | Creates a key concatenating the parent key with the sub-key. | {
if (string.IsNullOrEmpty(key1))
return string.Empty;
return string.Format("{0}{1}", RootKey, key1);
} | 1 |
a745bdfd0dde5fade536ae8e611ee0e9 | 312429699bea5dcefe77c0a44deb680b | This function computes the differences of successive RR intervals. | list_count_rr_flag = []
for i in range(1, len(globals.list_count_rr_intervals_flag)):
if globals.list_count_rr_intervals_flag[i] != 0:
list_count_rr_flag.append(globals.list_count_rr_intervals_flag[i] + 1)
else:
list_count_rr_flag.append(0)
return list_count_rr_flag | 0 |
c5141f823742580df84f86de00d54ed5 | 2223bd83927a11a05949212c3312e688 | Calculate the current score of the board, with white being positive and black being negative | BoardAndTurn bat = (BoardAndTurn)myBoard;
int rv = 0;
for(int i = 0; i < 8; i++){
for (int j = 0; j < 8; j++){
if (bat.b[i][j] == WHITE)
rv = rv + 1;
else if (bat.b[i][j] == BLACK)
rv = rv -1;
}
}
return rv;
} | 1 |
6f5589c983ca5246ef6270a556efe49b | 04aaa3b14355ba38e96be1299b7d01ac | Kamera sensöründen cihazın ekranına oryantasyon sağlar | void karsilamaekrani()
{
readimagefile("karsilamaekrani.bmp",0,0,900,600);
Sleep(5000);
cleardevice();
} | 0 |
d1469cc0701a600aa71d3162cc762ee3 | 36e906d515348ae805240bc924b008d6 | MsoFDigitCh
Returns TRUE if and only if ch is a digit. | {
return ((ch >= '0') && (ch <= '9'));
} | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.