query_id
string
corpus_id
string
query
string
code
string
label
int64
304823f543be6541608b52d82371fc47
bbeef386174cca89be6d8b5fac54be85
Plays a turn of a client.
if self.client_gui: self.client_gui.turn_card(self.current_choice[1]) self.client_gui.turn_card(self.last_choice[1]) sleep(0.5) self.client_gui.reset_board() else: self.server_gui.turn_card(self.current_choice[1]) self.server_gui.tu...
1
d1872b60fb9181bd6c7b33301c561155
0c8bb0041488252801d5c88bf4aa43bc
Страница жалобы недоступна гостям
def guestusernotallowed(request): context = { 'learn_server': LEARNFQDN, } return render(request, 'guestusernotallowed.html', context=context )
1
7bb8d5d6ec6e473136cdd3113a00409e
1cdf24666fda5f974aed28ef852badc9
Returns the output of this neuron. Though this is not strictly necessary (as the output field is publicly accesible), it is nice to have this method for elegance.
public class HiddenNeuron extends Neuron implements Serializable{ public float outputValue(){ return outputValue; }
1
c1301bad05d544f54d3dfaeba94b6b6f
6da6a264d6fcd343d1e9b2534b31998f
带有冲量的梯度下降法。
class opt(object): def BGD(self): while self.count < self.loop_max: self.count += 1 sum_m = np.zeros(2) for i in range(self.m): dif = (np.dot(self.w, self.input_data[i]) - self.target_data[i]) * self.input_data[i] sum_m = sum_m + dif ...
0
d890de44ebeb15377a814d15561b0931
4d3934a5a1fe6b2a64d80e2688f7a43e
\brief Função que liberta o espaço de memória da TCD_community.
void liberar(TParametros* param) { free(param->cuerpos); }
0
195e0ad6361fc68d132692411659041e
776e4840892576c5eaac9b8796a3dd84
Best solution:
function findLongestWordLength3(str) { return Math.max(...str.split(" ").map((word) => word.length)); }
1
5a957485c19f58a285624c090dd1637f
ab66a8a5d112e3b8b46d1300f3fa21c3
Handles Interrupts of Control Endpoints EP0 OUT and EP0 IN.
{ ushort_t control = USB_CONTROL & (USB_EP0_IN | USB_EP1_IN); switch (control) { case USB_EP0_IN: { USB_EP0_OUTPUT_STATUS &= ~USB_ACTIVE; usbEP0In(); } break; case USB_EP1_IN: { usbEP1In(); } break; } }
0
b36492ef33115cf812f048e4b9f3db79
52ade5979ea0c6853a891907cda93214
Return number of child objects (collections.abc.Mapping).
def __len__(self): return len(self.maps)
1
6cf36311b89978cdf57c6174ce7241f4
427cd40c690f9d5c9e930534170ab38f
Call as Fraction._validate_arithmetic(..); no self parameter Helper method raises exception with appropriate message if type(v) is not in the set of types t; the message includes the values of the strings op (operator), lt (left type) and rt (right type) An example call (from my __add__ method), which checks whether th...
class Fraction: def _validate_arithmetic(v, t : set, op : str, lt : str, rt : str): if type(v) not in t: raise TypeError('unsupported operand type(s) for '+op+ ': \''+lt+'\' and \''+rt+'\'')
1
8fefaa63227c5904a86df8700741788e
082d6265eb51b556c7910d2c939ab084
Getter method for property <tt>SendStatus</tt>.
public class PartnersManageSchema extends Schema public String getSendState() { return SendState; }
0
295e67b6c3a8d2392e487185792e1ca0
0ac82e27a6fc9b7ce2e7a1ef008a2e07
Divide shape on image by two parts with equal area.
int newAreaIdx = areaCount; int w = areas[_areaIdx].w; int h = areas[_areaIdx].h; if (rand()%2) { { areas[_areaIdx].w /= 2; areas[newAreaIdx].x = areas[_areaIdx].x + areas[_areaIdx].w; areas[newAreaIdx].y = areas[_areaIdx].y; areas[newAreaIdx].w = w - areas[_areaIdx].w; area...
0
f7b33a9cb699db0ab90471dca5058c47
f13d546b3f6c0574b622f5a7cb70df32
Renvoie la liste des animals d'un client (idClient)
path = "listePeseesPourAnimal", produces = { MediaType.APPLICATION_JSON_VALUE} ) public @ResponseBody List<PoidsPourAnimal> listePeseesPourAnimal( @RequestParam(required = true) final Integer id) { return dao.listePeseesPour(id); }
0
f91cc16a070fdc24448bca8a175aea26
fab5951e7aecab7f47a5f75b660df3f7
Return a random number 'r', s.t. 0<= 'r' < 'ubound', using /dev/urandom
long random_number(long upper, long lower) { double aux1, aux2; long val; if (lower > upper) { aux1 = upper; upper = lower; lower = aux1; } aux1 = uniform(0.0,0.2887)+0.5; val = (long) (aux1*(upper-lower+1)-1.e-10) + lower; if (val > upper) val = upper; if (val < lower) val = lo...
0
2c9d92864610f3dbde6cfc4ade777974
077df6f4b481abb212f48de0fa0b88c2
登録した本を削除する
class BookController extends Controller public function destroy(Book $book) { $book = Book::find($book->id); $this->helpers->logRecorder($book); $book->delete(); return back(); }
1
3e8b18abe273aa7bc4eb8efa0377a7ef
ee1fcd1fb371c307c511852a8b4c71e3
delete old user accounts (very likely unused)
def delete_inactive_users(): delete_threshold = datetime.now(timezone.utc) - timedelta(weeks=4 * 6) death_row = User.objects.filter(last_login__lte=delete_threshold)[:100] emails = [] subject = 'SWARFARM - Inactive Account Deleted' body = ( "Hello {},\n\n" "Your SWARFARM account ha...
1
a64b2d67d4084140ea0062c218f75b0b
a4f10b92acfca0dec5346017f072e853
Triggers the ConnectionDeleted event.
{ if (this.SeriesDeleted != null) { this.SeriesDeleted.Invoke(sender, e); } }
0
0ebb3bad27bc0f1bd7dcfbf1bbbca320
b4520b44e9fe8cae3626fcbf67d592e8
Determines the result type of an expression that references the specified symbol
{ var symbolInfo = semanticModel.GetSymbolInfo(invocationExpression, cancellationToken); return symbolInfo.Symbol == null ? default : ImmutableArray.Create(symbolInfo.Symbol); }
0
06542a0825f8cd306d31d9987e4108d2
9fc177dc9b7cf2b6409ef4fb94e7a624
get box to given coordinates or create a new one
public class Matrix public void set(Coord coord, Box box){ if(Ranges.inRange(coord)) matrix[coord.x][coord.y] = box; }
0
c8cf3e4062926efab0fb4b9ee0b40212
02ca3f22d80599b85dccdcd79c227095
Counts the total amount of downvotes given to a track
def down_votes_count (down_voter_ids||[]).length end
1
001fe7a999386a9591a203d292e1fc38
4b63db8e024a4bea2098bed1639497d3
Gets the value of the MerchantOrderID property.
namespace Kount.Ris public class Response public string GetMerchantId() { return (string)this.response["MERC"]; }
0
8db253b008e5a5174013fd88ba7accce
91cbde45f602fa52ef6c0f5d316907f6
! Returns an invalid position for selection. This position is set to the selectedBar property to clear the selection from this series. \sa QAbstractGraph3D::clearSelection()
void QGLBaseChart::axisRangeChanged(QGLBaseAxis *axis) { Q_UNUSED(axis); selectedRect = QRectF(0, 0, 0, 0); }
0
55e3f8a57dea85086641db9e3eee00c7
f125ecfe4e53b5595c92d94a9c3f73b1
Set the value of raisonSocial
class Journaux public function setRib(?string $rib): Journaux { $this->rib = $rib; return $this; }
0
83822337a1a0c09e4ecdfdc17d00b965
d675fad4b969f6e1e7498940263f05bd
绘制正方形到屏幕
void draw_square(int x, int y, int color, HANDLE h) { for (int i = 0; i < 4; i++) { gotoxy(x * 4 + i, y * 2, h); changeConsoleColor(color); printf("%c", 219); gotoxy(x * 4 + i, y * 2 + 1, h); printf("%c", 219); } gotoxy(0, 30, h); }
1
d29017262163a9f2c4e46c899e9250bc
dc9a65d6d18cccacb0280c1360b807ee
Lists all Warga_data models.
class WargaController extends Controller public function actionIndex() { $searchModel = new WargaSearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); return $this->render('index', [ 'searchModel' => $searchModel, 'dataProvider' => $dataProv...
1
b348c698035c3a89c1eefe5bef2c631d
32831a9e065d82a0286c8352d0f21549
Načtení seznamu všech dostupných hodnot parametů, spolu s přepsanými hodnotami z nastavení dané pobočky
public abstract class APIService implements APIServiceInterface public Map<String, String[]> getPresetParameters() { Map<String, String[]> tmp = new HashMap<String, String[]>(); tmp.putAll(getDefaultParameters()); tmp.putAll(getUnmodifiableParameters()); return tmp; }
1
0301603aad444d68f9f14f9bfdaba5e8
7c2c6052895d80d346c44a9577dd6b83
Function to provide character name
string nameselect[5] = { "Mikey Mike" , "Weird Schaults", "Biggy Bossman Rob" , "Scary Terry" , "The Hardest Worker" }; srand(time(NULL)); int ranselect = rand() % 5; return nameselect[ranselect]; }
1
fe166d7aba675ff6edc87c527fc30610
a9041c5f2c702eacf94410e7e939f75d
Проверка собственника на размещенные объявления
user = self.context["request"].user users_adv_count = Advertisement.objects.select_related('creator').filter(creator=user, status='OPEN').count() if users_adv_count > 10: raise serializers.ValidationError('Превышено количество открытых объявлений (10)') return data
1
f1a1dfe9ebdb7a32e3ac08ec6864b3e2
8c9642f8c905e981415363c9b5fc97b0
15引数関数をカリー化します。
namespace LangExt partial class Func public static Func<T1, Func<T2, Func<T3, Func<T4, Func<T5, Func<T6, U>>>>>> Curried<T1, T2, T3, T4, T5, T6, U>(this Func<T1, T2, T3, T4, T5, T6, U> self) { return t1 => t2 => t3 => t4 => t5 => t6 => self(t1, t2, t3, t4, t5, t6); }
0
dc8d12559fc27f723a258a6485b765b5
059922f3becb521bd0be9edd47dc4079
将传入的字符串加入到inlist中
void add_to_list(struct listhead *list,char *file) { struct filechars *fc=(struct filechars *)malloc(sizeof(struct filechars)); fc->len=strlen(file); fc->next=NULL; strncpy(fc->name,file,fc->len); if(list->first==NULL) list->first=fc; if(list->current==NULL) list->current=fc; else { l...
1
f069cb6315715c944a125f39fc1d3f8d
534ed6711415c14f259d4fef214df4a9
Invoque a GUI Sala.
public class Sala extends JFrame public static void main(String[] args) { EventQueue.invokeLater(new Runnable() { public void run() { try { Sala frame = new Sala(); frame.setVisible(true); } catch (Exception e) { e.printStackTrace(); } } }); }
1
8f8887f4abba13caa090c980a9fb6a08
7aa11340824f5c5c58f04c1b902b4a55
pridani priloh k zavodu
{ $hodnoty->IDZivocicha = $this->Id; if($this->database->table('staraSa')->where('RodneCislo', $hodnoty->RodneCislo)->where('IDZivocicha', $this->Id)->count() == 0) { $this->database->table('staraSa')->insert($hodnoty); } $form->getPresenter()->flashMessage('Úspešne pridané!', 'uspech'); $this->redirec...
0
261528324e8a651041f5b667a53c1855
bddafbdee545ca716d9537c4410148d1
Envía el comunicado al servidor.
public enviar(): void { if (this.jq == null) { return; } this.jq.submit(); }
1
ec5bf50edbbb7d335b5bc8b415ae047d
b895369eb2d85a9656c59d055deb8c29
找当前节点到根节点的路径(从下而上顺序),路径按item的名字存放在prefixPath
prefix_nodes = [] if node is None: return current_path = list() current_path.append(node) current_child = node.left_child while current_path: while current_child: current_path.append(current_child) current_child = cu...
0
49d10bdef3bc93ee63d053939cd5d9c8
a87eae1aaa217f42b97b3cd93a96379a
Replace nested-loop equijoins with hash joins.
class EvalPlanLoopJoin(EvalPlan): def __init__(self, outer, inner, using): self.outer = outer self.inner = inner self.using = using
0
cfde8454c60ddebdc4527d1718287fd9
e1486d9d288fd9e0a7fcfa3b241f5c99
Calculate simple euclidean distance
class MyUSV(OneStepUSV): def euclidean_distance(self, x1, y1, x2, y2): return ((x1 - x2) ** 2 + (y1 - y2) ** 2) ** 0.5
1
6dc5989defc6c43e0b15cfd9a9b4c9d6
659aa342fbbc2e362d5f46edb8dfb3b9
Helper function that places points on a sphere using the Fibonacci spiral.
golden_angle = np.pi * (3 - np.sqrt(5)) thetas = golden_angle * np.arange(num_points) radii = radius * np.sqrt(np.arange(num_points)/num_points) xs = radii * np.cos(thetas) ys = radii * np.sin(thetas) return xs, ys
0
b0642fd8fc54c0f36c6f2f24ca19fcf0
0ecf39566818127164b577ec19b791b6
根据二级域名获取当前应用的前缀
final class C extends CEnv private static function _init(){ $subdomain = []; defined("C::APP_SUB_DOMAIN_MAP") && $subdomain = C::APP_SUB_DOMAIN_MAP; if(C::APP_SUB_DOMAIN_DEPLOY && (isset($subdomain[HTTP_HOST]) && $subdomain[HTTP_HOST])){ $app_path = ROOT_PATH.'/'.$subdomain[HTTP_HOST...
1
a1be0827771135029fae407fd4fbebce
f0c06a6fc71a26e6765e37766d553cf6
GET: CarType
{ var query = _cartypesRepository.GetAll(); var cartypesCount = await query.CountAsync(); var cartypess = await query .OrderBy((x)=>input.Sorting).AsNoTracking() .PageBy(input) .ToListAsync(); var cartypesListDtos =cartypess.MapTo<List<CarTypesListDto>>(); return new PagedResultDto<...
1
0221d52235cafcacc0ed571e0dce96bb
f9883889f19fa03faeaf1e8d2ab01719
Load results when "Enter" is pressed or a selection from AutoComplete is made for position name.
e.preventDefault(); if (inputValue === "") return; const locationsArr = await autoCompleteSearch(inputValue); let locationsSplit = []; for (let i = 0; i < locationsArr.length; i++) { const tempSplit = locationsArr[i].name.split(","); const tempFinal = tempSplit[0] + "," + tempSplit[1]; ...
1
a0de7a1fbd85726cd8f86b0282e734c9
46c1b5ba26c85150d12d8d25ad93f4be
Run distance calculation on input files.
def compute(infile, outfile): pass
0
952a724ab945b2a766737b6dd534134d
acd8889d83900ff6e999909b51eb9822
通过循环,不断的比较当前节点的值和其父节点的值,如果父节点的值比当前节点的值小,则交换
T tmp = list.get(cur); for (int i = 2 * cur + 1; i < length; i = 2 * i + 1) { if (i + 1 < length && list.get(i).compareTo(list.get(i + 1)) > 0) { i++; } if (tmp.compareTo(list.get(i)) > 0) { list.set(cur, list.get(i)); ...
0
0550f3098d342fb83d808ced5cff0981
30ce8665f2b451cff56387f474c31011
Serializes this [DIDDocument] into a JSON string
{ if (defined('JSON_PRETTY_PRINT')) { return json_encode(\DocuSign\eSign\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); } else { return json_encode(\DocuSign\eSign\ObjectSerializer::sanitizeForSerialization($this)); } }
1
61b309d14a05ccef2862c39de012c79a
ba2216f23f942821d3b6621bc0eefc78
因子暴露图
data = pd.read_csv(path, nrows=nrows) feat = data.groupby(['file_id','label']).api.count().reset_index(name='val') print(feat) feat = feat.groupby(['label']).val.count().reset_index(name='val', drop=False) print(feat) print(feat.iloc[:, 0], feat.iloc[:, 1]) exp = [0.1, 0.1, 0.1, 0.1, 0.1, 0....
0
d3ba9e5b467f7539f441fe164cb2930d
c2853bfa96e5e9e8fd7ba56e058f4f1c
获取评审结果
$id = Input::get('id',0); $project = Project::find($id); if(!$project){ return $this->jsonErr("not found"); } $rate = ProjectRate::where('r_pid',$id)->first(); if(!$rate){ return $this->jsonOk("200",['result'=>0]); } $submission = [...
1
bf43159a29bdc425f2425f1b66bca8b6
cddf922b478760bc15b980412e657470
Si cancela se finaliza la actividad
public class MainActivity extends ActionBarActivity private void onCancelClicked() { this.finish(); }
1
252ae14823d9c5d6e43c8e4bb4e570f8
2f79333e0fb27d7277d704e4842f888f
Deletes an image file given the photo Path, returns True if deletion is successfull, false otherwise
class UserManager public function deletePhoto($F_UPLOAD_FOLDER, $F_NAME){ $file_name = $F_NAME; $file_dir = $F_UPLOAD_FOLDER; if(unlink($file_dir.$file_name)){ return true; } else { return false; } }
1
41f269c2dbf9c57a743adb49f67a01ed
e683b2901f22e0c32ec75563cd856325
Helper to make a queue_pairAlloc hypercall when the driver is supporting a guest device.
void *buf, size_t buf_size, int buf_type) { struct iov_iter to; struct kvec v = {.iov_base = buf, .iov_len = buf_size}; ssize_t result; if (!qpair || !buf) return VMCI_ERROR_INVALID_ARGS; iov_iter_kvec(&to, READ, &v, 1, buf_size); qp_lock(qpair); do { result = qp_dequeue_locked(qpair->produce_q, ...
0
6cdd4db0906295183cd4c856e0933035
8e9b80564b10a1fc011c74de57e8358d
Function to achieve 3-way partitioning for quicksort 1. Start with 3 pointers (lt, i, gt), choose first element (lo) as pivot 2. Invariant: everything to the (a) left of lt is less than pivot (b) between lt and i is equal to pivot (c) right of gt is larger than pivot 3. In each iteration, while i<gt do from left to rig...
public final class QuickSort public static void sort3(Comparable[] a, int lo, int hi) { if (hi <= lo) return; int lt = lo, i = lo + 1, gt = hi; Comparable v = a[lo]; while (i <= gt) { int cmp = a[i].compareTo(v); if (cmp < 0) exch(a, lt++, i++); else i...
1
67f09af6bd9d1d20af58988ff28eebc7
26d8d328aa1d9bf843832646e379f09d
Returns the meta object for class '{@link smartHome.SensorType <em>Sensor Type</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
EEnum getSensingflowSensorType();
0
b537e5eb410811195f2a2dafc9cd9c23
a45e180b17656f281b76ab40f5e094a3
通过手机获取账号
@Repository public class OrganAccountRepository extends AbstractCRUDRepository<EpOrganAccountRecord, Long, EpOrganAccountPo> public List<EpOrganAccountPo> getByMobile(Long mobile) { return dslContext.selectFrom(EP_ORGAN_ACCOUNT) .where(EP_ORGAN_ACCOUNT.REFER_MOBILE.eq(mobile)) .a...
1
2f8dd77b601802c20111c723f35b6d36
36b7454ca314c636251cdafd86589a8c
Linux下的宽高指定无效,仅仅是为了统一API
if (SCREENWIDTH != 0 && SCREENHEIGHT != 0) { return; } DisplayMetrics metric = new DisplayMetrics(); WindowManager mWindowManager = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE); mWindowManager.getDefaultDisplay().getMetrics(metric); SCREEN...
0
d60ba56169045582c01fd1407710329e
3d411e779c7cf312ddf4ca626bc2a78c
Gibt den Besitzer des Bullets zurück
public class BulletController : MonoBehaviour public void SetOwner(m_entityTypes entity) { m_bulletOwner = entity; }
0
c3b5e4ab0a46f75f8a351a13f148081d
30af42ac136d8139d0d8f0e743e262ef
Zwraca katalog (sciezke) w ktorej zostal umieszczony plik
try { String[] dirs = path.split("\\\\"); fileName = dirs[dirs.length-1]; } catch (NullPointerException e) { System.out.println("Blad odczytu nazwy pliku " + path); fileName = "UNKNOWN"; } }
0
9f8874089638780fbd4a247c5a384b57
db7e96770621b8719aefd5520684cbf0
分页好友个数统计
function putPageHelperFriend(data, curnum) { var count = data.data.records; layui.use('laypage', function () { var laypage = layui.laypage; laypage.render({ elem: 'page-helper-friend' , count: count , limit: 10 , curr: curnum , jump: fu...
1
65d4786d5bb11fda3e8ad0ed4610bd3d
84f5310ec14f4f74a74f8aea1e046788
Compute the inverse kinematics of the two legs
class Solver(object): def _ik_solver(self, target, phi): px = target[0] py = target[1] wx = px - self.links[2] * math.cos(phi) wy = py + self.links[2] * math.sin(phi) d = wx ** 2 + wy ** 2 if math.sqrt(d) > self.links[0] + self.links[1]: raise NotReachable("Ar...
0
6a7f7dc809893c777753224475faf3be
ce4c51b9d0c480e149ed37dbb47d9a94
スタックに確保したプリミティブ要素を box で包んだ場合にコピーは起きるか
size_t cnt; int var; get_random_size_var(MAX_SIZE, cnt, var); jrSTL::stack<int> src; for(size_t i = 0 ; i < cnt; i++) { src.push(var); } jrSTL::stack<int> des(std::move(src)); ASSERT_EQ(src.empty(), true); while(!des.empty()) { EXPECT_EQ(var, des.top()); des.p...
0
2cc2c1925a08da2141d5d4af2a352e74
f88029d0053537494552904a3e409014
WithQuotes configures inital quote symbols to subscribe to and the handler
export class UDFCompatibleDatafeed subscribeQuotes(symbols: any, fastSymbols: any, onRealtimeCallback: any, listenerGUID: any) { this.quotesPulseUpdater.subscribeDataListener(symbols, fastSymbols, onRealtimeCallback, listenerGUID); }
1
fceb095b366aea95dbef35baa9c98509
2ff86195941db86aaa552bbe5a89efc1
Main changelog ktor module
return new AbstractRulesModule() { @Override protected void configure() { forPattern("changelog/changeset").factoryCreate().usingFactory(new DtrChangeLogEntryFactory()).then() .setNext(ADD_METHOD_NAME); forPattern("changelog/changeset/d...
1
d97d6de9743220b9dce91fc2394d8f31
f6ac856d835e68d9085724830e33cfc8
Xử lý khi nhấn nút làm lại.
{ if (tBRePass.Text == "Xác nhận lại mật khẩu mới") { tBRePass.Text = ""; tBRePass.ForeColor = Color.Black; this.tBRePass.PasswordChar = '\u25CF'; } }
0
e13cadedd2c00945c981c07a3f14d767
afb3d215c7417a3b576b56d70aeb800e
Read dds sample with condition.
namespace DDS ReturnCode Read( ref <data> dataValues, ref SampleInfo[] sampleInfos, int maxSamples);
0
5245fbf9dba106e4834511cb7c2edc86
07130934bf0cdbfa1fe4de0e2661fc5a
Tests if the given validator or signer has been down.
if (this.from !== validator.currentProposer) { return false; } else if (validator.round !== this.round) { return false; } else if (validator.height !== this.height) { return false; } else if (!this.hasValidSignature()) { validator.log(`Invalid signature for proposal ${this.id}.`)...
0
56dfdfa4d0ccbe3ac535b9aff617c3f6
3c2df926d90cc5bcf755b7ee8658f3b5
判断对象obj是否可json序列化
function isJson(obj) { var isjson = typeof (obj) == "object" && Object.prototype.toString.call(obj).toLowerCase() == "[object object]" && !obj.length; return isjson; }
0
1f41f000fa0cba90a41adfdcea338a4e
4db878ccab36ddbdce0ccc05d5b9644f
打印预处理sql
public class DBQueryRunner private static String printSql(String sql, Object... objs) { String tmp = sql; String value = ""; String location = ""; try { StackTraceElement[] ste = Thread.currentThread().getStackTrace(); for(StackTraceElement e : ste){ if(!e.getClassName().startsWith("java.lang") && !e....
1
c9c0371ca3d35c09bd274f132fbde5b9
38a0c2f0696f807aeb41ca1799a0510c
对集合(Set)的操作
class TestCase @Test void testRedisSet() { jedis.sadd("set01", "a"); jedis.sadd("set01", "b"); jedis.sadd("set01", "c"); Set<String> set = jedis.smembers("set01"); Iterator<String> iterator = set.iterator(); while (iterator.hasNext()) { System.out.println(iterator.next()); } jedis.srem("set01", "a")...
1
bf48376f71214c9156d2690a27bbc365
1e3dce571f90503a04001df922564f86
функция заполнения массива аудиториями
int kabinet, nomer_para, day; nomer_para = 1; String data; ArrayList<Integer> prepod_id = new ArrayList(); ArrayList<Integer> predmet_id = new ArrayList(); ArrayList<Integer> group_id = new ArrayList(); ArrayList<String> bdate = new Ar...
0
debd8c0894bbb1785d3018e89eca8089
10acaaff512c45cb0dab8e82060f998a
블로그 > 대댓글 쓰기
var repText = $("input[name=repText]").val(); var userid = $("#sessionid").val(); var nickname = $("#sessionname").val(); var bno = $("#boardnum").val(); var section = $("#section").val(); if (userid == "") { alert("로그인을 해주세요.") return false; } if (repText == "") { alert("댓글을 입력해주세요"); $("input[name=rep...
1
c116a915c8da8e2dcb15eabc9a186599
7958c6f421edf5828c83c3c2c613e5d4
Load floor metadata
class StaticIndoorScene(IndoorScene): def load_floor_metadata(self): floor_height_path = os.path.join( get_scene_path(self.scene_id), 'floors.txt') if not os.path.isfile(floor_height_path): raise Exception( 'floor_heights.txt cannot be found in model: {}'.format(s...
1
768f63e0bbc807363a07088ac004a156
26fe66851d8d9db7bf06b0a658ee8e69
网络图片文字识别接口 用户向服务请求识别一些网络上背景复杂,特殊字体的文字。
{ JsonResponseModel<SentenceRecognitionResponse> rsp = null; try { var strResp = await this.InternalRequest(req, "SentenceRecognition"); rsp = JsonConvert.DeserializeObject<JsonResponseModel<SentenceRecognitionResponse>>(strResp); ...
0
4f9430c13f3e5a03ffa4a9efefb54075
12764b2d530bf396a3392d696f4964dd
从 application.conf 中获取配置,并依据这些配置来初始化爬虫
return cls( moci_user = crawler.settings.get('MERCHANT_USER'), moci_passwd = crawler.settings.get('MERCHANT_PASSWORD'), keyword = crawler.settings.get('KEYWORD'), exclude_pool = crawler.settings.get('EXCLUDE_POOL') )
1
6671ffa09b012a5414487c44d000183c
71d6a2ae3cf213ea7b5106ba8255f5bd
根据机房id ,当前时间取到当前班次信息
export class CommissionerService getTimeRoomfn(schuduleId:any,starTime:any,endTime:any){ let apiUrl = "http://localhost:4200/assets/mock-json/getTimeRoomfn.json"; return this.http.get(apiUrl) .map(res => res); }
0
2f118b6995f8a391959cab4ed67f71a8
e9ddc9b2b43be03f8a1c477c81b33142
Executes an operation after certain delay
namespace WJF_CodeLibrary.CommonUtility public static class CallbackUtility public static GameObject ExecuteDelay(float delay, Action onExecute) { DelayBehaviour behaviour = new GameObject("DelayBehaviour").AddComponent<DelayBehaviour>(); behaviour.delay = delay; behaviou...
1
07eb45f75010b004029c0420bda58659
ddf434d7386e56f7bccd51de2548a6ec
Used to send the player back to the game screen when the game is restarting.
public class GameOverUI : MonoBehaviour public void MainMenu() { Player.ResetGame(); }
0
7896c6a64761358e8106d7a4225783a9
e64b74f004963bdfb328116f31f84664
creates new font structure from a font datafile and returns pointer
{ FILE *Input; char *TexBytes; int Num; char filepath[50]; sprintf(filepath,"../fonts/%s.glf",FileName); if ((Input = fopen(filepath, "rb")) == NULL) return FALSE; fread(Font, sizeof(int)*6, 1, Input); Font->Tex=getNewTexture(); Num = Font->IntEnd - Font->IntStart + 1; if ((Font->Char = (GLFONTCHAR *)mall...
1
d709fa372f064fbb4292e209bf8d204f
5da30fc9a9634beed86fd0c8554e60dc
Bestämmer hur de svarta brickorna får röra sig
namespace Tetris class Kollision public static void RotationsKollision() { int i = 0; bool collision = false; while (i < 4) { collision = true; while (collision == true) { collision = false...
0
01d3b925c2a8aad41e7fe482d1e30f02
702c8bebca2d5994f7b50cc51e013250
FUNCIÒN CONSTRUCTORA "Nuevo Anuncio"
{ $this->ventaOp =$ventaOp; $this->usuario =$usuario; $this->cliente =$cliente; $this->ventaFull =$ventaFull; $this->documento =$documento; $this->config =$config; $this->image =$image; $this->image2 =$image2; }
0
45e23a4a82618f72a8587ed613521547
d4599c49188adc058e3159a0aee0b124
@brief Read B-node software configuration.
{ int fd = -1; int result = MBN_PARSE_FAILURE; off_t pos; uint16_t len; uint32_t info_offset; char* buf; *config_info = NULL; *config_len = 0; do { if ( (fd = open( file_name, O_RDONLY )) == -1 ) { RLOGE("Failed to open file name %s: %s", file_name, strerror(errno)); break; } ...
1
6640996157e908ac187da606dd43f936
5a3b13e2bea3b878d253109400fb4cfe
Funcion para calcular la propina
{ var x = parseInt(document.getElementById("importe").value); var y = x * 0.75; document.getElementById("resultado").value = y; }
0
ec5712a91f6e8560043ebfd492daf8dc
55000d15aa39c0aaa6e14ac71bc11a2e
Asynchronously invokes a member on the proxy instance.
public static class JSObjectReferenceExtensions public static ValueTask<TValue> InvokeAsync<[DynamicallyAccessedMembers(JsonSerialized)] TValue>(this IJSObjectReference jsObjectReference, string identifier, CancellationToken cancellationToken, params object?[]? args) { ArgumentNullException.ThrowIfNull(jsOb...
1
8697861e5f7968251e32d6fa2bd9eb26
2c78fd5feb7c153b3971d4a28750fe55
Fades the text in and out.
{ if (IsSelectable) { _fadeElapsed += time; if (_fadeElapsed >= FadeDuration) { _fadeElapsed = 0; _fadeIn = !_fadeIn; } float p = _fadeElapsed / FadeDuration; ...
1
9d441b7ba6761a111cd6d4c93220bc4e
96fb0faa78362edbe90de8ae00e219cf
* work as a filter for any other method that needs to be authencated. * after passing through it, an instance variable -- <tt>@current_user</tt> will be set up. * <tt>@current_user</tt> contains the #User instance of corresponded user id.
class ApplicationController def current_user @current_user end
0
9d3383f6872693cca3a34586350eaae9
0dd62482fadf19cfe9bc4647a9cb83b3
获取recordPerPage值
{ $wrk = Get(Config("TABLE_REC_PER_PAGE"), ""); if ($wrk != "") { if (is_numeric($wrk)) { $this->DisplayRecords = (int)$wrk; } else { if (SameText($wrk, "all")) { $this->DisplayRecords = -1; } else { ...
1
f90f08565dd74058c47a3d9a5c5f7eb6
996a723a8edf8564023a9c390fc86b9f
Returns the meta object for class '{@link de.fuberlin.winfo.project.model.network.Vehicle <em>Vehicle</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
@XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "vehicle", "catalogue", "pricelist", "location" }) @XmlRootElement(name = "createEverythingVehicle") public class CreateEverythingVehicle public Vehicle getVehicle() { return vehicle; }
0
939fe6aed50f49c0155daf7ba94006fd
b8bffa433a37dc9e2be0f4f3b0d30e58
获取Criterion标准的约束名称
public class Constraint public String getConstraintName() { return constraintName; }
1
350353e22a52293a180797500df05947
bc20ac81b9d9c05d8107aa55f8a22b6e
Click on the New option of Status filter.
class CoursesPage(BasePage): def click_on_filter_status_closed(self): self.click_on_element_by_css(cpl.FILTER_BY_STATUS_CLOSED)
0
106f1024a285a0a214ea6e12389ec48b
bbabc83337411e075f8df76ad010e599
极验验证方法
class AuthorizationsController extends Controller private function serverVerrify($geetest_challenge,$geetest_validate,$geetest_seccode) { $GtSdk = new GeetestLib($_ENV['GEETEST_ID'], $_ENV['GEETEST_KEY']); $gtserver = Cache::get('gtserver'); $user_id = Cache::get('user_id'); if ($gtserv...
1
52d937466adaa7595f14b2f70516493c
d7dd69a192df31f686e50866fbcc4260
backward as forward, e.g., madam
rev = '' for i in wd: rev = i + rev return wd == rev
1
851dc981c59ecc3836d687fb779025ae
95f00ad093147f571bb6fc5ad776674c
Reloads the renderer cache using the current state of the components.
{ for( int i = 0; i < cachedScenes.Count; ++i ) { cachedScenes[i].Reload( serviceProvider ); } }
1
a1c37dd49eb299f0ba7fa9c4bcb5a52c
04e39f6a3b70d63667eca9e84653dcc2
puhastab märgist ja tagastab sõne
void nepismena(unsigned int *spusteno, char *v) { int i = 0; (*spusteno)++; do { if (!(((v[i] >= 'a') && (v[i] <= 'z')) || ((v[i] >= 'A') && (v[i] <= 'Z')))) { printf("%c", v[i]); } } while (v[i++]); printf("\n"); }
0
c1e6bb3cffcc6b6d23c81b61b9758bc6
b94b7bc397c660ebca9932392743f769
# Write one or more data matrixes to an Excel file
WriteExcel<-function(values, fileName=paste(Sys.Date(), 'R2Excel', sep='_'), sheetNames=names(values), type='xlsx', settings=rep(list(), length(values)), verbose=TRUE) { options(java.parameters = "-Xmx102400m"); library(xlsx); if (length(sheetNames)<length(values)) sheetNames[(length(sheetNames)+1):length(values)]<-(le...
1
c497960432a6a9a60773203bfe1dc507
b21445404565cfb16af72e7864d2a273
Add quantity to the ammount of newly produced food.
public class Resources : MonoBehaviour static public void AddFood(int food) { instance._addFood(food); }
1
e44c8631354ea8552bde128babac3fe2
a7bc322f6ef4c7d980250e4015cb3342
push another page on to the navigation stack causing the nav controller to transition to the new page optional data can also be passed to the pushed page.
export default class navigationHelper static push(routeName: string, params) { const pushAction = StackActions.push({ routeName: routeName, params: params }); this.navigation.dispatch(pushAction); }
1
524051609207a4a8fe7d1993f8ad8d04
bdb0e5ecd2949c0afe04b4751c79f17d
400请求无效
class status(unittest.TestCase): def statusCode_400error(self, r): self.assertEqual(r.json()['code'], -1) self.assertEqual(r.json()['http_status_code'], 400)
1
22dafe875798c53f602c7f4d6fd1f1ea
8448da6c8dbe894b0fed65fcc2ad8e02
Function: rotate Purpose: A wrapper function to instruct an UAV to rotate Inputs: degree - a floating point value in degrees Outputs: none
void rotateDeg(float degree) { if(degree > 0){ int steps = ceil(C_CCW*degree); STEPPER_move_stwt( STEPPER_BOTH, STEPPER_REV, steps, SPEED, 0, STEPPER_BRK_OFF, STEPPER_FWD, steps, SPEED, 0, STEPPER_BRK_OFF ); }else if(degree < 0){ int steps = (-1)*round(C_CW*degree); STEPPER_move_stwt( STEPPER_BOTH, STE...
1
bc2e510b45a83efcbb38bdcad42a00e4
9c158aaed60b59dadc48e39bd31bb8aa
根据品牌名字获取所有汽车
public List<Car> findByBrand(@Param("brand") String brand);
1
49f43223dee10fe6e02b5af6efa8cd66
3dc3dbc164339d9e40b375ceefc1f590
Data Provider for NamingStrategy#referenceColumnName
{ return [ [self::defaultNaming(), 'someProperty', 'someProperty', 'Some\Class'], [self::defaultNaming(), 'SOME_PROPERTY', 'SOME_PROPERTY', 'Some\Class'], [self::defaultNaming(), 'some_property', 'some_property', 'Some\Class'], [self::defaultNaming(), 'base64E...
1
067590c0cc92e705d2f319a28ead898e
2de70a19896d14714d48122397ad4474
获取相应格子距离顶部的距离
function getTop(e){ return e.getBoundingClientRect().top; }
1
8fef38288ba0e8cdaef0e00ad49f853b
4b5a6e28b4ff9b64c10697a53faa33f4
Free memory used by citations
void freeTable() { destroyTable(&hashTable, &destroyCitation); }
1
627c5fd1c2562c45748cf2c4dc8dd117
4f346a0c35fc64ba7c43f278316f4a33
has the dude been hit by any of the pies in pie list?
{ foreach (var p in pList) { if (p.IsHit(point)) return true; } return false; }
1
68f122222cfd4510c03844957347b5da
d30500d50a3b3aadbbe08179afd5112a
노드기준 얻을 수 있는 이득 계산
int getmn(node x){ int ret = 0; for(int i=0; i<2; i++){ ret += max(T[i]-x.mx[i], 0); ret += max(x.mn[i]-T[i], 0); } return ret; }
1
eb9d6db5823579f3d2ef1263bd7e45c2
e52e9ce99f52876a17fda86b03b769b9
Refresh internal cache of API keys.
public class CacheManager public void refreshCache(){ refreshAccounts(); refreshAppKeySecretCache(); }
1