query_id
string
corpus_id
string
query
string
code
string
label
int64
8dbcfa457b3a0cd7ecc778d105a278a8
6a8647cb362dd6dd679a507b771e8f28
Indicator: Decreasing
public void testDecreaseValue() { final QualityChange qc = QualityChange.DecreaseQuality; assertEquals("The 'DecreaseQuality' should have code: <-Q>", "<-Q>", qc.getSymbol()); }
1
76bc0a6c9e61a7740b01f288bf69a406
f6e17f9239296e6d2090546dc2a32bc3
The add method requires at least two arguments but can add an variable number of parameters It will attempt to convert any string into a Number It then returns the total of all parameters as a Number
function add(...args) { return args.reduce((a, b) => a + b); }
0
4bbbf7da75d978287784fec5ff169b53
797ccd1152ffa66f38465c0792bf08ab
state recibe estado del juego actual, o sea una instancia de Env board es el tablero temporal con las posibles jugadas i sirve para determinar cuántos valores se toman en adelante Se calcula la función de valor de cada acción que se pueda realizar
int movimientos[6] = {0}; int puntuacionJugador = state.getScore(jugador); int i = 1; while(i<=6){ if (state.getSeedsAt(jugador, (Position) i) == i) movimientos[i-1] = puntuacionJugador + 1 + i; i++; } int j = 0; while(j<6){ if (movimientos[j] > mejorValor) mejorValor = movimientos[j]; j++; } if ...
1
c38bb1b0f673701fd8e0827d2f14b041
fa2adfbd6cd526b19a685767ce612c1b
Gets all the bankruptcy data from a company given vatnum, if there are any.
public function companyByVatNumber($vatNumber);
0
08702a3ea86bfbb21b80ca415274e499
df7e8e08dd7c0482765a7000de606b2a
Append a APSRecord to the list if it is not already there.
{ apstaessidl_t *zeiger, *tmp; unsigned long long int c; zeiger = apstaessidliste; for(c = 0; c < apstaessidcount; c++) { if((essidlen == zeiger->essidlen) && (memcmp(mac_ap, zeiger->mac_ap, 6) == 0) && (memcmp(mac_sta, zeiger->mac_sta, 6) == 0) && (memcmp(essid, zeiger->essid, zeiger->essidlen) == 0)) { return; ...
1
f8d111c45048552b10d80551779da575
bf03d26be94d4cd45fd46d9d7606b09a
Verify that the component has a no-arg aka default constructor.
try { return (clazz.getConstructor(new Class[] {})) != null; } catch (SecurityException ignore) { } catch (NoSuchMethodException ignore) { } return false; }
1
6dcb05b52180db51a9b4330a85e1a56c
653e046e13eb4dda20554e43c4fee82b
名前セルをスクロール固定する。
{ while( true ) { if( null == SelectedCells ) { break; } if( 1 > SelectedCells.Count ) { break; } if( false == SelectedCells[0].Visible ) { break; } if( true == SelectedCells[0].Displayed ) { break; } FirstDisplayedScrollingRowIndex = SelectedCells[0].R...
0
1a9a1d9b618e3e7ba23ff0b22032e0e2
58dae2778861abcdabca786e1f4a12de
Restore signal props that were mutated for serialization
{ hor_Prop = serializedObject.FindProperty("hor"); list_prop = serializedObject.FindProperty("list"); state_Prop = serializedObject.FindProperty("state"); player_Prop = serializedObject.FindProperty("player"); disableAtStart_Prop = serializedObject.FindProperty("disableAtStar...
0
3f33989586088b1c4bea92c99878fedf
422615c20597209572dd8155ba8e0d30
Function used to generate an instance of input parameters. They are linked to a function instance and is required for varied tasks used in type checking and semantic analysis.
return func(r *dedicatedRenderer) { r.inputParametersSecretRef = ref r.inputParametersCollection = parameters } }
0
e7b5330aa16c5ecd831f01d9a8f00fb2
b5b1b684c003875acffb1e109889f78c
Method to find Tax Residence textbox
{ try { con.Open(); MySqlCommand c = new MySqlCommand("SELECT * FROM vat", con); MySqlDataReader reader = c.ExecuteReader(); while (reader.Read()) { string vat = reader.GetString("vat_valu...
0
2a4b2301687dce5b7f04a13ff8ffa9e0
3a2c2c704883a8f2a45b182822797c3c
构造函数,初始化文件名
class ErrorLog(object): def __init__(self): self._file_name = 'Error.log'
1
6f9aeac2302aff9962f22c149f4c6ff0
8fa87b6ff9d81c3e4790bb989f2d6ede
生成默认录入样式多行文本格式的字符串
nsource_list = [] for rows_list in source_dlist: nrows_list =[] col_nums = range(0,len(rows_list)) if len(col_nums) == 0 else col_nums for i in col_nums: row = rows_list[i] nrow = str(int(row)) if isinstance(row,(int,float)) else row nrows_list.append(nrow) nrows = " ".join(nrows_list)+'\n' nsource...
1
d50eb151b37acc4b524b6607b5947b02
bc2605f978a5cb011da611c46f4888bb
<a href="https://material.io/components/sliders" class="external" target="_blank">Material Design slider</a>. Sliders allow users to make selections from a range of values. Sliders reflect a range of values along a bar, from which users may select a single value. They are ideal for adjusting settings such as volume, br...
@Composable fun Slider( value: Float, onValueChange: (Float) -> Unit, modifier: Modifier = Modifier, enabled: Boolean = true, valueRange: ClosedFloatingPointRange<Float> = 0f..1f, @IntRange(from = 0) steps: Int = 0, onValueChangeFinished: (() -> Unit)? = null, interactionSource: Muta...
1
b8f15fe066e17d921511bf0991d00ea9
f2bd9003223e0fda5fa8751b97778f86
Adds Clay management toolbar context object to the request.
context = {'api_root': settings.CENTRAK_API_ROOT} if utils.is_admin_view(request): context.update({ }) return context
0
9618e992a53d5c040167c0704bfce189
05aaf9609d6de3ca1bd6106026c5406f
Returns the number of different states sent to the .update() function. For continuous state spaces, counts the number of different discretized states.
s = 0 for a in self._env.action_space.spaces.values(): if isinstance(a, Discrete): s += 1 else: s += a.shape[0] return s
0
b8cf9cff9e4e29f521616a9007c4e748
a8625e4d45aaeeed6cab8b3ec65adf43
Extracts the failed value from the error.
const errorCode = toErrorCode(this.error); if (errorCode != null) { const error = new StdError(errorCode.value); error.revert(); return <T>unreachable(); } return this.value; }
0
0ad8e2125e6c8c41eaeeb25fe495f768
7f61448ad6da3ef0f9cb03f40c5be655
given during lecture: https://courses.engr.illinois.edu/cs126/sp2018/slides/L20-Big5Lists.pdf
cases like (1)
0
8f87eaa74eb26d9acdde18e3ef5036d5
0ce551cdc15dd7e6d59ceded08117046
Returns list of directories for the files in |source_files|.
class Dsc: def source_files(self): if self._source_files is None: self._source_files = self._process_source_files() return [x[0] for x in self._source_files]
0
1028f2b57f1dc2d43df1ac0af1d3935a
2edffb19492052a7ec69ae4052341d25
Returns true if the verification of the tag should be skipped.
function isVerifiedTag(exp) { return isVerifiedSplit(exp) }
0
9b8be83d85672c7d35901139a0c7d048
b44c6096c78480ef2b66952af2a0e9ff
置灰功能按钮
export class ComCostTextButton extends CComponent public set gray(isGray: boolean) { if (this.m_bIsGary == isGray) return; this.m_bIsGary = isGray; Utils.isGray(isGray, this); }
1
4c2bea9d1f71fe9a6ece91f18f8375fe
c4f177d36382ac435b989b61199791e8
Injects Glider functions and properties to HTML element
function injectGHTMLElement(t:HTMLElement):GHTMLElement{ let g = <GHTMLElement>Object.assign(t, {"add":add, "addGs":addGs}) return(g) }
1
247b17e4d5328e66b0d71f8549412360
9c4414c0f1815aa451654d7c5d475588
Sets the node's layoutX and layoutY translation properties in order to <p> This method does not alter translateX or translateY, which if also set will be added to layoutX and layoutY, adjusting the final location by corresponding amounts.
public void setLayoutX(double layoutX);
1
45474f65749d8b6e44c2207ad3e799e3
dc837be30d0e11a350f271b3ecadb1cb
Manages method calls for different manufacturers.
public class Factory public static Car manufactureCar(Brand brand) { if (brand == null) { return new Other(); } switch (brand) { case HONDA: return new Honda(); case BWM: return new BMW(); case VOLVO: ...
1
df69111f3a5ef9a10da0f6078edbf39d
5c0d015cf7dbef5559ee2e459f2a2a8f
Get 默认连接池名.
public class BoneCPConfig implements BoneCPConfigMBean, Cloneable, Serializable public String getPoolName() { return this.poolName; }
0
58a8002e6d1b8b6a4ad13dc397509f36
04cf79468b60306cc136a550ca1450a5
Calculate the union of two bounding boxes.
min_vals = np.minimum(bounding_boxes_a[..., :2], bounding_boxes_b[..., :2]) max_vals = np.maximum(bounding_boxes_a[..., 2:], bounding_boxes_b[..., 2:]) unionized_bounding_boxes = np.concatenate([min_vals, max_vals], axis=-1) return unionized_bounding_boxes
1
96b6c0201840d4a0fc09db93f8bc4737
91fb9aca4e0ed76d212162a468c3677d
显示当前题目位置和题目总数量
{ TextView questionIdxText = (TextView) findViewById(R.id.textViewQuestionIndex); String str; if (viewPager.getChildCount() > 0) str = (viewPager.getCurrentItem() + 1) + "/" + controller.getQuestionsCount(); else str = "-/0"; questionIdxText.setText(str); }
1
874425502f5ad03b751aba06767eca81
fcfdb71d418d8883d209e77de286e985
Injects the storage for the virtual hosts.
namespace Elf.MailServer void LoadVirtualServers();
0
9b70cb9e20bca7ed26dd3321d8f4b379
bc96c0fb92033d6a1e892be27c0b7464
Gets the 重量(单位:千克)(派送单明细).
@Entity @Table(name = "xx_order_item") @SequenceGenerator(name = "sequenceGenerator", sequenceName = "xx_order_item_sequence") public class OrderItem extends BaseEntity @JsonProperty @Column(updatable = false) public Integer getWeight() { return weight; }
1
3fc876c4101757c0601ba1c49daac393
c6c50190b8b74b73fd2a3e0c34bd9808
스택을 이용해서 문자열이 대칭인지 체크하는 함수
void symmetric_stack(char* arr){ StackType* s = (StackType*)malloc(sizeof(StackType)); char ch; int r=1; init_stack(s); for (int i=0; i<strlen(arr) ;i++){ ch = arr[i]; push(s,ch); } for (int i=0; i<strlen(arr) ;i++){ if (pop(s)!=arr[i]){ r=0; break; ...
1
909f5c79cfebc4dc7517b225dfc27e8d
fa774c6f328a12d38beb1062542c5a66
引数を2つ持ち、2つ目の引数がデフォルト値を持つ
function defaultParameterExample2(firstName:string, lastName:string ="Stevens"):string{ return firstName + " " + lastName; }
1
67d8299c835a2a654e09658e5cfd4e09
a09fd0d842eb4b2b7465710ad200e553
Thermal mitigate init function.
void rr_thermal_task_start_init(void) { memset(&rr_therm_data, 0, sizeof(rr_therm_data)); #ifndef PERLUTF npa_resource_available_cb( "/therm/mitigate/pa", initialise_event_cb_fn, NULL ); #endif }
1
0633c37b1a325435293c7cb999b5b423
076acc3174f631bc6d7f07f7224f4d9e
Returns the ellapsed time the user has had no input applied to the game
public class PCState public static int getIdleTime() { User32.LASTINPUTINFO lastInputInfo = new User32.LASTINPUTINFO(); User32.INSTANCE.GetLastInputInfo(lastInputInfo); return Kernel32.INSTANCE.GetTickCount() - lastInputInfo.dwTime; }
1
36cd8bebab10bba82b86286423e6e978
fe10cc96d25575d5926535cc1fe2ff24
albert 文本模型。
class MleMdl(Mdl): def __init__(self, vocab): Mdl.__init__(self, vocab)
0
88a518a7b6bb3b3272589e2eddb01486
0002b0e2b5494b7415d3f557411967a4
Convert sampling variance to 95% CI.
def get_95_ci(x1, x2): signal = x1.mean() - x2.mean() noise = np.sqrt(x1.var() / x1.size + x2.var() / x2.size) ci_lo = signal - 1.96 * noise ci_hi = signal + 1.96 * noise return ci_lo, ci_hi
1
9be213ae41fbb4fc7237ac7260ba00fc
8a5da62f04cd02470d13a1a865f07252
Function for checking whether this number narcissistic or not
int isNarcissistic(int num){ int n, pow=0; n=num; while(num > 0){ num/=10; pow++; } num = n; int narsum = 0; while(num>0){ int rem = num%10; narsum += power(rem, pow); num /= 10; } return (n==narsum) ? 1:0; }
1
3df7e6f35c4d135e93833ee08470e9ab
318b21a19d9efdc3015e0fdd35a94f54
Returns a view with the message that the validation is succeeded.
def view_success(request): return HttpResponse('success')
1
54f7982cee882cc1350d81caad68608d
2fb7c3e526ac06cb4c6acecb186521ad
Attempts to find the path to Google Cloud SDK.
fs: typeof fsPromises, env: NodeJS.ProcessEnv, ): Promise<string | undefined> { if (await canAccess(fs, env.EDGE_PATH)) { return env.EDGE_PATH; } }
0
ff4c3cdca2f3bbeb379d7e8e7c70dae6
653a991d830778cdb989ee7d9c6c9dbf
Benchmark view creation with row and Split By.
public void testForceSplitMultiFamily() throws Exception { int numVersions = HColumnDescriptor.DEFAULT_VERSIONS; int blockSize = 256; byte[][] familyNames = new byte[][]{ Bytes.toBytes("cf1"), Bytes.toBytes("cf2") }; int[] rowCounts = new int[]{ 6000, 1 }; splitTest(null, fam...
0
b0de00682f204a2291e4561e0b827c54
6493c394e78c4e15b80f3cd6d8dd8973
获取指定大小的一页道岔信息表
{ string sql = "select TS_ID,TS_NAME,TP_ID from ( select rownum rn ,t.TS_ID,t.TS_NAME,t.TP_ID from T_STREET t where rownum<=" + (pageSize * pageNo).ToString() + "" + where + " order by TS_ID desc ) a where a.rn >" + (pageSize * (pageNo - 1)).ToString(); return DBHelper.QueryToDataSet(sql...
1
60c3391d96c5afbc4098ceca192dafe5
e34f1c1f1ce39c28e86779df7178506e
Test if the URL has XMLRPC up and running.
String soapURL = collabNetUrl + CollabNetApp.SOAP_SERVICE + "CollabNet?wsdl"; HttpClient client = new HttpClient(); try { GetMethod get = new GetMethod(soapURL); int status = client.executeMethod(get); return status == ...
0
12e7844393260d13cb32007c1f79321d
0dc66871b4f64fcac0913c3e3946bfa8
Test the str() function for ipv6 - worth a separate test.
{ assert(ip4_to_str(k_htonl(0xA0A1A2A3)) == std::string("160.161.162.163")); uint32_t test_addr; assert(str_to_ip4("160.161.162.163", &test_addr)); assert(test_addr == k_htonl(0xA0A1A2A3)); std::cout << "-- pass ipv4 string convertor test" << std::endl; }
0
b8e84f19992b7fe0d8f553f1efca8ded
455419d59755cb1acad2081b87e2d0ab
Camera calibration by DLT using known world coordinates and their image points.
def DLTPoseEstimation(image_points, world_points, K): image_3d = np.concatenate((image_points, np.ones((1,len(image_points[0])))), axis=0) image_points_normalized = np.linalg.solve(K, image_3d) Q = np.zeros((2*len(image_points_normalized[0]), 12)) for i in range(len(image_points_normalized[0])): ...
1
eccb51811e7634c8f2503615b4bbabf8
70a66386f625d2c2b60d651397bdd7c8
Inserts the nodes in a collection into the directed graph at the specified index.
namespace DataStructures.Trees void Insert(List<T> collection);
0
a50110dfcd7a9e6d25ecdef0438951b9
c90b0f6a52e4a14bd37871d465aec1d5
Sets the score bits of the alignment
public class Blast4SimpleAlignmentDocumentImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements gov.nih.nlm.ncbi.www.Blast4SimpleAlignmentDocument public static class Blast4SimpleAlignmentImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements gov.nih.nlm.ncbi.www.Blast...
1
b4590ac3940fb2946664f2ec5c660b89
df46e3d36ef83fc45e09465944d68992
Создает или обновляет стек навигации
{ if (Request::filled("id")) { $nav = Nav::find(Request::get("id")); } else { $nav = new Nav(); } $nav->name = Request::get("name"); $nav->lang = app()->getLocale(); if (!$nav->validate()) { return json_encode($nav->errors()); ...
1
6eb45af42b7ced607ab068381bf3f641
ed67ad2bd83ab68e4203d6d2c1edf47f
Method allowing worker agents to improve skills so as to get job.
void learnSkill();
1
093ecdbcf068fe501a19e5486b4c828a
4f28df6e3090bdb88920828ea485886e
更新李转盘占用时间
export class MagicCubeView extends SpecialPriBasePanel private updateTime(): void { let startTime = Math.round(G.SyncTime.getCurrentTime() / 1000); this._timeNum = Math.floor((this.magicCubeData.magicCubeInfo.m_uiLuckyTime - startTime)); if (this._timeNum > 0) { this.mainTimeCheck = ...
1
259db6d85180f7ad314dad4b574b9ab2
6a9e1a8e1bc820e1d3b7a4f5d8539096
write buffers to file and close files
namespace Sudoku public partial class Form1 : Form public void File_Closing() { sw.Flush(); sw.Close(); fs.Close(); }
1
356d52f562bd33e17aa88865fb286cd0
6cc16d36ee9db21df483cfe55a65bece
Get logged in time of current user
class User extends \ArrayObject public function getTimeLogin() { return $this->timeLogin; }
1
541ef53893d08d53921527a35397add7
92f4303681c4d0311420d2e1d94dfcda
若之前有创建,先删除
class FileUtil fun removeAndCreateFile(file: File) { if (file.exists()) { file.delete() } file.parentFile.mkdirs() file.createNewFile() }
1
c5eaee95fd7a3b9d44fff6f88498b8db
4a10bf7ee64c046b576f5001d8fc8631
博客点赞,异步提交
const res = await this.$axios.$put('/post/like', { id }) if (res.success) { commit('LIKE_PLUS', id) } return res }
1
a5d2bc17a3423c1edf5e37409d370c1f
37b40c5f434813465eeaf1fcbd15a444
PC置换,输入56位01字符串,输出48位01字符串
{ vector<string> s1 = {"0000","0001","0010","0011","0100","0101","0110","0111","1000","1001","1010","1011","1100","1101","1110","1111"}; vector<string> s2 = {"1110","0100","1101","0001","0010","1111","1011","1000","0011","1010","0110","1100","0101","1001","0000","0111"}; vector<string> s3 = {"0000","0001","...
0
8fdf48739f1be88fd112acba60f398fd
3320a4bd80c0056bf0ff6d26190e6dcb
Вызывается после получения полей сущности из БД
public function onAfterHydrate(ClassMetadata $metadata, $instance): void;
1
68e03aa3c2abf1e390fcfc4f2c62b23b
f838ad8e5db4271439f2e32fa9ff1bc2
Indicates that this server should provide the assemblage service, possible values are: "internal" - the assemblage should be configured for using internal REST resources, this means that the ally core http component is present in python path. "external" - the assemblage will use an external REST resources server, you n...
class NSSSLVServer(NSBaseResource): def get_ersa(self): return self.options['ersa']
0
149f13cfaeb89c08a0f3248e9737bef9
22264a481df90c4c10fcc4ad49dd0daf
Annulla l'invio del messaggio
{ if (Destinatario.serialPort != null) Destinatario.serialPort.Write(Dati.Replace((char)126, ' ') + (char)126); else throw new Exception("Porta non inizializzata"); }
0
0b3dba751f263a5d7f5c32d1e3fb2f89
47352034c1c60b049636255abe3a4b7b
这个方法决定了要抓取的URL及其内容。
urls = [ "http://en.wikipedia.org/wiki/Main_Page", "http://en.wikipedia.org/wiki/Python_%28programming_language%29" ] for url in urls: yield scrapy.Request(url=url, callback=self.parse)
1
b371be0fe8e1a83c42befa01572f371d
65f77a16da42738828161a0d64a8ea1b
Lista todas los niveles de un indicador de desempeño existentes en la base de datos
{ ArrayList unidades = new ArrayList(); string query = "SELECT nivel FROM " + GetTable + " WHERE idProyecto = " + _idProyecto + " AND papelera = 1 GROUP BY nivel"; query += " order by CASE WHEN ISNUMERIC(nivel) = 1 THEN RIGHT( '0000000000' + nivel, 10 ) ELSE RIGHT( 'AAAAAAAAA...
1
f592f46b82f4770f021e6112afc1f8b9
d06f512ea46db27e261e56dbef1af8f9
@brief Trampoline to jump into the class main method
Class* classdef = runtime->getClassLoader()->resolveClass( classname ); if( classdef != NULL ) { Method* method = classdef->lookupMethod( MAIN_METHOD ); if( ( method != NULL ) && method->isStatic() && method->isPublic() ) { vector<Parameter*> parameters = getMethodArguments( argc, args ); return execute( me...
1
cd326a89b3927cd77ebd21ac47d724d6
af034eb5b6ee182636764ab98a3ba725
Provides a value for injection at runtime. If the value could not be provided, this method should return <c>null</c>.
public function provideValue(UriContext $uriContext, $options);
1
f0622779869182d47e38ef83769756e1
9f1b4781c19c6587be2ba3e6cafe37c5
Get the average accuracy for a population
def avg_population_points(pop_points): avg = pop_points[0] for i in range(1, len(pop_points)): avg = np.add(avg, pop_points[i]) return avg/len(pop_points)
0
3f0ce18c6ba3d464ce8f42eefbc2cff8
d63ace5b45e7a6d53430d77b9b50bab2
渲染checkbox组件(左侧文字,右侧选择/未选中框)
function checkboxRender(rowdata, rowindex, value, column) { var iconHtml = '<div class="chk-icon'; if (value) iconHtml += " chk-icon-selected"; iconHtml += '"'; iconHtml += ' rowid = "' + rowdata['__id'] + '"'; iconHtml += ' gridid = "' + this.id + '"'; iconHtml += ' ...
0
32df5667b8d3c7e845fd9432be31441d
c00c52d27a2656a4e7ac284c550b9ecc
Build file name from parts. path is NULL for "current directory". path is "" for "root directory".
{ int ix, iz; char *filename; ix = 0; if (path != NULL) ix = strlen(path); iz = strlen(name); filename = malloc (ix + 1 + iz + 1) ; if ( ix == 0 ) { strcpy (filename,name); } else { sprintf (filename,"%s\\%s",path,name) ; } return ( (void *) filename ) ; }
1
70b1c094735d26f1a4cb820d344ba323
c20d023eed88983844fb955a882502eb
Retrieve the set of values that occur in matches for event.
namespace TBAAPI.V3Client.Api public partial class TeamApi : ITeamApi public async System.Threading.Tasks.Task<TBAAPI.V3Client.Client.ApiResponse<List<string>>> GetTeamEventMatchesKeysAsyncWithHttpInfo (string teamKey, string eventKey, string ifModifiedSince = default(string)) { if (teamKey == n...
1
69fcd6419e7a24c3797cd256bc3e1e4a
ccbef43d3dbfe0826701d73862d0bd6a
哈希查找算法,hashArr表示哈希表,value表示要查找的元素
int hashKey = hashFunc(data); int cnt = 0; while (hashArr[hashKey] != null) { if (hashArr[hashKey].getData() == data) { return hashArr[hashKey]; } ++hashKey; hashKey %= arrSize; if ((++cnt) == arrSize) { ...
1
983c265b6851534c3d42a6164d83ef58
47d5e715c95649b840f6a3137387513d
Loop and check how many pairs of conflicts are in the current configuration
void stepstep(void) { int index = 0; for (int boolean = 1; (boolean == 1) && (index < SIZE); index++) { for (int dimension = 0; dimension < D; dimension++) { for (int direction = -1; direction <= 1; direction += 2) { if (index != nneighbour( nneighbour...
0
99c9edf67c5a3fc93031c3cc54a3eb84
a88409f9701415ad1bd37f08426ad264
Método para cadastro de um Historic no banco de dados
try{ await knex.insert({ID_Medico, ID_Paciente, ID_Unidade, descricao, data, id_consulta}).table("historico_de_consultas"); }catch(err){ console.log(err); } }
1
cc97df77f7396878d1737bda8ff9873f
1611a9e6206f10cd32ec9a2fed025b11
Se encarga de subir la imagen al servidor.
public class ClientTools protected static String saveImage(File img) { try { if(twi == null) twi = (TwitterInit) Naming.lookup(SERVER_URL); ByteArrayOutputStream array = new ByteArrayOutputStream(); InputStream ie = new FileInputStream(img); byte[] buf = new byte[1024]; int leidos; while((leidos...
1
7738563d0094ab726790039c4111ba73
0e25fc5ea11e92acc9c82eebd3d2a114
创建临时顺序节点
try { znode = this.zk.create(znode, new byte[0], ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.EPHEMERAL_SEQUENTIAL); log.info("create node : " + znode); } catch (Exception ex) { log.error("Create node error : " , ex); } }
1
24adf9085dfd44067085a4ee5006901e
b3d14a93437e3cd30bdd7e47cc3e704d
Add a new component with the given descriptor to the beginning of the list
const std::type_index& serviceType, ServiceDescriptorPtr&& serviceDescriptor) { auto& descriptors = getOrCreateEmptyDescriptors(serviceType); descriptors->emplace_back(std::move(serviceDescriptor)); }
0
4646b354795419b22c39ee9263e83e47
d73e6045eea6610d670e47523416752f
获取转换为px的宽度
function getWidth(el, defaultValue) { let width = this.getStyle(el, 'width', defaultValue); if (width === 'auto') { width = el.offsetWidth; } return parseFloat(width); }
1
f12e7b6e441f855c640b40ad4118ce83
2a192317a7a2937a1e01e9d7fbec1a44
ページ内のボックス情報表示用のフォームを開く
namespace AutoCabinet2017.UI.EF public partial class FormArvInfo : XtraForm void txtArvBoxID_DoubleClick(object sender,EventArgs e) { FormArvBox frmArvBox = new FormArvBox(); if (frmArvBox.ShowDialog() == DialogResult.OK) { LoadArvBox(frmArvBox.ArvBoxDto);...
1
5326a80d5222f158ab33654cab84f949
5ac9952c8130ac714bc4b7fb772d47a0
Добавляет чек обслуживания на воздушное судно
$start = microtime(true); try { $services = WtDB::Ref()->PassengerServicesRows(new WtMapArgs('ids', $args)); if (!$services) { $this->longQueryLog($start, 'addSSR no services'); return false; } $service['id'] = $services[0][...
1
eb36beea95d522b19009fa0b980f332d
bd81bcb5e267ee5859b9ca3949442e5c
Loads cortex dataset.
class DataLoaderCASIA(object): def __init__(self, root, txt_path) : self.root = root self.txt_path = txt_path self._df = self._read_dataset_paths()
0
cf67db1681ba4608aa60470ee6ef8dea
77c4ae708523dc35d9568f95efeb9e12
下载 seed_url 网页的源代码
def fetch_page(url: str): try: response = requests.get(url, headers=HEADERS, cookies=COOKIES) response.raise_for_status() return response.text except (RequestException, ConnectionError) as exc: log.exception( "%s was encountered while getting seed_urls", exc.__class__...
1
720c5d634f4b1af33be3635f488473d8
8091cfd94ddad41fe5734c4b403354ef
Checks if it's legal move. If not, the error message comes out.
class Manager(object): def is_legal_move(self, from_pos, to_pos): return self._move_validator.is_legal_move(from_pos, to_pos)
0
f93b8cccdae8359ea71bc5698fd0e068
8473574ce74ae0c10f3e58b4f92b9281
.. method:: bind(address) Binds the socket to *address*. *address* can be: * an integer representing a port number. In this case ip is set to the local one * an ip address with a port A tcp socket needs binding when it is used to accept incoming connection (e.g. a http server socket). A udp socket needs to be bound bef...
class RDTSocket(UnreliableSocket): def bind(self, address): self.src_ip = address[0] self.src_port = address[1] self.tcp_ports.append(self.src_port) super().bind(address) if self.debugBtn: self.logger.debug(f"{self.socket_id} - Socket bound to local address")
1
b4faea0d8172661a2c1eb76e5d91727e
c9122d868c062f11b0b214966a226bfb
round d to 5 sig digits
round5 = function(x, digits = 0) { round(x + 1e-10, digits) }
0
d0a7e023d36f39bd7987aa7bc6ad7250
1c461e286036ea31a715bd0288a82c4d
initialise un graphe d'apres la liste d'adjacence l_adj et son ordre n
class LGraph{ LGraph(int len){ this->len=len; n=m=0; K=new H*[len]; for(int i=0; i<len; i++) K[i] = NULL; Adj=new Lista<int>*[len]; for(int i=0; i<len; i++){ Adj[i]=new Lista<int>(); } }
0
753c36b4b05f938ed7d9e76a431358aa
b2da80267b979542c8ac1fd52a7c9cdc
重置关节角
reset_angles = self.robot_cfg['neutral_joint_angles'] for i, angle in enumerate(reset_angles): pybullet.resetJointState( bodyUniqueId=self.arm_id, jointIndex=i, targetValue=angle, physicsClientId=self.physics_id)
1
8fd62b647d450c10d56cfbdc1d9a4074
e92904b84ededd2e531c5d204c423a36
Retrieves an existing Brain.
if(!this.ipAddress) { await this._ipAddressPromise; } await this.isProvisioned(); return (await this.brainInfo()).brain_id; }
1
cf3694ed0f9e6af3248a30435e6d78f1
edcb4fcb352567e6081903b68ed17b50
キー入力 4 の入力キーの設定を既定値にリセットする
{ this.F1Key_Visible = false; this.F2Key_Visible = true; this.F3Key_Visible = false; this.F4Key_Visible = true; this.F5Key_Visible = false; this.F6Key_Visible = false; this.F7Key_Visible = false; this.F8Key_Visible = false; this.F9Key_Visible = false; this.F10Key_Visible = true; this.F11Key_Visib...
0
98ca9d6d2cd2130f3657b451c2508bb7
5f7906c3a6a1a513bb25124f1f93cecb
将0所在的行与列均赋值为0
namespace _7_清除行列 class Program class Clearer public int[][] clearZero(int[][] mat, int n) { bool[] row = new bool[mat.Length]; bool[] column = new bool[mat[0].Length]; for (int i = 0; i < mat.Length; i++) { for ...
1
c21ae42f5160274e1d2b6a501dcd06b5
5041e1ad4ec61f05b32f9d28eaabebfb
Recursive function that calculates the Pascal Triangle values using summation property
function pascalTriangle(n, i) { if (i == 1 || i == n) { return 1; } else { return pascalTriangle(n - 1, i - 1) + pascalTriangle(n - 1, i); } }
1
cae8c66c952c2b47b45c6543eaac48ff
1f1d96b75b604d776069fda2832f50f6
配送先住所変更の対象データを取得
{ $town = $this->getAddressQuery(); if (!$town) { $this->setQueryErrorMessages(config('messages.error.E010-0101')); return; } $this->response_data['select_prefecture'] = request('select_prefecture'); $this->response_data['select_city'] = request('selec...
1
a3fa8fe254a2afd25716ef4a991cb824
cb12aec2bbd73e4999a0979376a933c9
Поворачивать и перемещать врага к цели
{ direction.Normalize(); float angle = (float)Math.Atan2(-direction.X, -direction.Z); var oldPosition = GameObject.Position; GameObject.SetRotationZ(angle); GameObject.MoveBy(direction * _enemyComponent.Speed * delta); if (_colliderComponen...
1
c7c6389609d3237d76af381d3fbe6b9b
45b343f113feeae51fca08fd1753cc02
Must return True or False and tell if rpc must challenge authentication for the current peer.
void oncrpc_rpc_is_allowed( void ) { }
0
770e8b0d36c19ffbc654fa38ddc54805
70c4bb03ddf68fbb8a2afa39bdb82114
Returns a collection of Profile objects. (asynchronously)
public final class ProfilesClientImpl implements InnerSupportsGet<ProfileInner>, InnerSupportsListing<ProfileInner>, InnerSupportsDelete<DeleteOperationResultInner>, ProfilesClient @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux<ProfileInner> listAsync() { return...
1
1abb08f4eb0d69320503207f8256efa7
f39a0a2bb97bb8c3c588d6db6fd73036
intSeq这个函数返回了另外一个匿名的函数,返回的这个函数对i形成了闭包
func anonymous() func() int { i := 1 fmt.Println(i) r := func() int { return 5 } return r }
0
79e41e33b273c9a21140664472aa2713
ead3108bafa14f992dc3b34a96dc1595
updates the page number when user moves to next page
public class MainActivity extends AppCompatActivity public void updatePageCounter() { pages.setText(currentPosition + 1 + "/" + pagerAdapter.getCount()); pages.clearAnimation(); AlphaAnimation animation1 = new AlphaAnimation(1.0f, 0.0f); animation1.setDuration(1000); animation1.setStartOffset(4000);...
1
b3f31f3e91afed73561eab77a6660d72
a552cc382ca82ca9cfc8e20f1efa337b
Remove the repetitive matches that appear in different simulations and retain only one
matches = [] dedupped = [] for singList in varList: if singList[0] not in matches: dedupped.append(singList) matches.append(singList[0]) return dedupped
1
2e51719a476f7483d5802ea15f2d9523
c8856bc63dd1a7118a64bdf58e536ef5
Delete a batch of supplied messages that have been handled.
message_ids = require_list(message_ids) data = dict() for i, message_id in enumerate(message_ids): data["message_ids[{}]".format(i)] = message_id r = self._post(self.req_url.DELETE_MESSAGES, data) return r.ok
1
adb91dbd5ec0a5ccbf5b44253f9ecd6b
626124b04e38d3df1423503e185c7f9c
Creates a condition to search by a Framework Id.
namespace FlaUI.Core.Conditions public class ConditionFactory public PropertyCondition ByProcessId(int processId) { return new PropertyCondition(_propertyLibrary.Element.ProcessId, processId); }
0
7b6a6f6da0cd299b3b311fd62edb2555
8ea808c36fa54e6ae0ca84db98be455d
Sends the result from worker to master
namespace ProcessPipe public partial class Form1 : MaterialSkin.Controls.MaterialForm private void SendResult() { _pipeClient = new PipeClient(); _pipeClient.Send(_result, nameServerReceiver, 1000); }
1
222cdfe2d40b27f936b6c8bb486503a4
ef853df688b66d6a216eb3deb1587def
根据页面查询条件(商户号,商户名,当前等级)查询商户评级信息临时表
@Component public class MerchantTempManager extends ServiceImpl<MerchantTempMapper, MerchantTemp>{ public List<MerchantTemp> queryMerchantTemp(MerchantTempDTO merchantTempDTO) { QueryWrapper queryWrapper = new QueryWrapper(); queryWrapper.eq(MerchantTemp.FieldNames.status.getTableFieldName(), merchantTe...
0
150931a4f4e4b0eee1c402b54fe78e80
de8fa3b80253ee03097911ec7c265849
用一个纹理绘制指定范围内的所有可见字符
{ #if 0 FontData* fontData = TEXT_MGR->GetFontData(fontType, fontSize); if (!fontData) { fontData = TEXT_MGR->GetFontData(fontType, 0); if (!fontData) return; } m_currShaderID = SHADER_ID::SHADER_FONT; Shader* currShader = m_shaders[m_currShaderID]; currShader->Bind(); glBindVertexArray(m_vao[FONT_QUA...
1
3b5a620ebb45751e5acf2b8220602f51
bc84ca633029aad5d61742875c26aa1e
##================== COMPUTE FUZZY MEMBERSHIP MATRIX [SAMPLES * POINTS] =============================
ssetsNK <- subsets(m, vin) ssetsNKpd <- subsets(m, vout) ul <- unlist( lapply( ssetsNKpd, function(y) sapply(ssetsNK, function(x) containsQ(y,x)) ) ) mat <- matrix(ul, nrow = choose(m, vout), ncol = choose(m, vin), byrow = TRUE) mat <- (mat+0L) colnames(mat) <- sapply(ssetsNK, paste...
0
127fc9be720262729c7ee27858a334b3
60c4571d4db7eaad6db72e17f8311699
获取1分钟负载监控数据
long Processor::getOneMinuteLoad(){ return loadAvg.loads[0]; }
1
2e160018a90b7f0ad75b22ca6affe78d
f7b3d20a6c9c7de598ea781c03d1a364
Function Name: StepPulser_ReadRxStatus Returns the current state of the receiver status register and the software buffer overflow status. None. Current state of the status register. Side Effect: All status register bits are clear-on-read except StepPulser_RX_STS_FIFO_NOTEMPTY. StepPulser_RX_STS_FIFO_NOTEMPTY clears imm...
uint8 RadioController_ReadStatus(void) { uint8 tmpStatus; #if ((RadioController_TXBUFFERSIZE > 4u) || (RadioController_RXBUFFERSIZE > 4u)) RadioController_DisableInt(); tmpStatus = (RadioController_GET_STATUS_TX(RadioController_swStatusTx) & ~(1u << RadioController_STS_SP...
0
4218ceee30748b98f2d6a804db0baa8f
bcbca48e19630e3333c249e69f067bfa
초과 근무 관리 페이지
@RequestMapping("/pages/J_CalculationHoliday") public String J_CalculationHoliday(HttpServletRequest req, Model model) { int sys_rank = ((MemberVO) req.getSession().getAttribute("loginInfo")).getSys_rank(); System.out.println("sys_rank" + sys_rank); String name = ((MemberVO) req.getSession().getAttribute("login...
0
a5adea9fbb3b803f4ca8d7312d16d0d4
87dc618dd244e66679cf505ccdde6ba1
convert from DTO > save into DB
@Service @CacheConfig(cacheNames = "c1") public class UserServiceImpl implements UserService public UserResDto saveUser(UserReqDto userReqDto){ UserResDto userResDto= UserConvertor.INSTANCE.reqToRes(userReqDto); return userResDto; }
0