query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
1df14664ef8a1ab12659d95d1f6fc823 | 26715170ae1a5cb548b84ec4f0d94224 | Returns an output buffer. | class ProcessThread extends \Thread
public function getOutputBuffer()
{
return $this->outputBuffer;
} | 1 |
6ba9e36314472209c505fd9e9e098119 | 1dfd9e857a8d75ebd91f37e86fbeddf9 | ボートマップからボートを削除 | road_mark = self.get_road_mark(road_mark_id);
if not (road_mark is None):
if len(road_mark.point_list) > 0:
road_mark.point_list.pop(); | 0 |
b3a6046c6709b8dd962f7f3413932079 | 0c4c0bb84cb85cec6da00d0f03f9d8ed | Store client connections to the TCP server.
Connections are non-blocking. | sock = None
if self.verbose >= 2:
print "Accepting tcp connections on port", self.port
try:
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
sock.setblocking(0)
sock.bin... | 1 |
a881479cead6ef521e3c7f52b9915a47 | 618373ff8a410a0d3749ef39ed330116 | Display program splash screen, get menu choice from user
Route to selected function. | int main() {
choice();
return 0;
} | 0 |
48065265c8b8650c1092747ce5ed5c83 | 17ea36880c7e8059055ac8aa256c7cec | Set to null to serialize all payload fields when a validation error is thrown, or set the fields you want to include explicitly.
) | public class JsonSerializer
public JsonSerializer excludeNulls(final boolean excludeNulls) {
this.excludeNulls = excludeNulls;
return this;
} | 0 |
f102ccd31e5b46892e2781051f7f805f | ad2444ecbd338442368b28e86859305a | Set the user's preferences for where the menu bar is displayed. On a
Mac, it can be at the top of the screen, in addition to the standard
position at the top of the main program window.
false if the user prefers it at the top of the window. | int mainWindowVerticalSplitPosition ) {
prefs.putInt ( MAIN_WINDOW_LEFT_VERTICAL_SPLIT_POSITION,
mainWindowVerticalSplitPosition );
} | 0 |
45765bd0673faa3bd9cd9c0ee51fd48f | aa066f789054477145ffdf527d353dba | retrieve our OAuth credentials from file | const clientSecret = credentials.installed.client_secret;
const clientId = credentials.installed.client_id;
const redirectUrl = credentials.installed.redirect_uris[0];
const oauth2Client = new OAuth2(clientId, clientSecret, redirectUrl);
fs.readFile(TOKEN_PATH, function(err, token) {
if (err) {
getN... | 1 |
30781dc0d6e6ca13512043973a2ee603 | 723ef33290f45cdd54433cd0a4e6817e | Obtiene el listado de LLave, Valor de los Sectores existentes. | namespace Application.Enterprise.CommonObjects.Interfaces
List<ZonaInfo> ListxSector(string CodSector); | 0 |
6ab53c1af3e5143e122031cb6634bdef | 88d8d4e8da2a638271406dd5ad5fb73d | https://discord.com/developers/docs/resources/guild#modify-guild-channel-positions | async editRolesPositions(options: role.ModifyPosition[]): Promise<void> {
await this.client.rest.modifyGuildRolePositions(this.id, options);
} | 0 |
551e8ff9c882fb6b8c4ad8ab0dfe4993 | 7abda14c32fef0ffafaa3173f6528838 | Invalidates the object's arrange. | namespace Digiphoto.Lumen.UI.Adorners public class ComposingAdorner2 : Adorner
void concludere() {
InvalidateArrange();
CambiatoQualcosa?.Invoke( this, EventArgs.Empty );
} | 1 |
748d255db2242d8417f7f46007abd6dd | f8256057a417fccf97db51a9f2d74a4d | 根据房间记录查看消费记录条数 | cursor = db.cursor()
cursor.execute("select count(detail_id) from detail \
where room_id = %s and \
b_time >= %s and \
e_time <= %s ",[room_id, b_time, e_time])
result = cursor.fetchone()
datails_number = re... | 1 |
2f8e3fa125c75610e5492fea7ec00458 | c6944f39cb60d540b9a1c37d5d960747 | \brief Tests snprintf implementation. | {
struct struct_test_sacs_snprintf_types test_struct = {0};
char result_string[512] = {0};
struct SacsStructFormat format = SACS_FORMAT_DEFAULT;
const size_t parse_result = SACS_PARSE_TYPE(struct_test_sacs_snprintf_types, &test_struct, test_string);
assert(parse_result == strlen(test_string));
const size_... | 1 |
551b51bd5d79e6191ef6ed6f98a8b4e0 | b33bdaf416000cc9ea54abbf51c11114 | Check if http code is 200 | class ResponseProvider extends Provider
public function isOk()
{
return 200 === $this->statusCode;
} | 1 |
f23ac3d0ba1e13bef1d63dd271ebbf6c | 2083a4613865f00b3156cd77cd024cfc | 设置首字母是否大写 | class WindidSchoolDm extends WindidBaseDm
public function setFirstChar($first_char) {
$this->_data['first_char'] = $first_char;
return $this;
} | 0 |
5d49f3a76289470b83261f4b51981834 | befd8dc805cb097449c2660ac5ae55da | Any Alive Cell with more than three Alive Neighbours dies | public void aliveCellWithMoneThen3Neighbours_should_die() {
boolean alive = true;
assertThat(Rule.futureOf(alive, 4), is(false));
assertThat(Rule.futureOf(alive, 5), is(false));
assertThat(Rule.futureOf(alive, 6), is(false));
assertThat(Rule.futureOf(alive, 7), is(false));
assertThat(Rule.futureOf(alive, 8... | 1 |
db348bc40cd684a8e51cbd1012837fda | dada864e2500bcab850d6e6af49d717b | Returns a string with the list of installed voices in a String
separated by new line symbol | def get_voices():
voice_cmd = "say -v '?' | grep 'en_'| cut -d ' ' -f 1"
return os.popen(voice_cmd).read().split('\n') | 1 |
92db89002f9301464ff98aed4638642c | c85def80c5c48e5613cbef0d707096cb | метод для обнаружения процессоров | reg = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, "HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0")
procesor = winreg.QueryValueEx(reg, "ProcessorNameString")[0]
return {'Processor':procesor} | 1 |
898c2a096fc9f3122ba68e385338335c | f256a52404417a8b69f3124b4143cd57 | extract run number from DQM-like ROOT files | class Operator( object ):
def RunNumber( self, datfilename ):
parentdir, datfile = os.path.split( datfilename )
stem, ext = os.path.splitext( datfilename )
stem = '-' + '-'.join( stem.split( '-' )[ 1: ] ) + '-'
m = re.match( '.*-R([0-9]+)-.*', stem )
if m == None: return None
... | 1 |
b616c91c32b938156b08e2c7d67a924e | 4b14e048026b3fa6132c1b533932eff4 | プレイヤーが挿入されるまで待機する | namespace TankSim.GameHost
public class TankSimCommService : IDisposable
public void WaitForPlayers()
{
_playerWaiter.Wait();
} | 1 |
cd862399b0b4edb8ac97bfd47c968d7f | 19a7b7683bd6104e05a96eba2371f10d | 设置异步导出服务 | {
var config = new ExcelConfig();
var section = cfg.GetSection("Excel");
if (section != null)
{
section.Bind(config);
}
services.AddSingleton(config);
var assembly = AssemblyHelper.LoadByNameEndString($".Lib.Exce... | 0 |
986aca6b949f224cddd887c243e4239a | 8b83a0851890b0670a8fa47c32208baf | Return a within clause that explicitly casts the ``latitude`` and
``longitude`` provided to geography type. Note that `ST_DWithin`_
will use a spatial index to filter out rows that are not within the
boundary box before doing a sequential scan of the remaining rows.
> This function call will automatically include a bo... | query_string = f'''
way["natural"="coastline"]
(
{loc.south_latitude},
{loc.west_longitude},
{loc.north_latitude},
{loc.east_longitude}
);
'''
return api.get(query_string, verbosity="qt body geom skel") | 0 |
1fa2a71aab594de2d87852b91eb9c053 | 34acb21947c9e3352687c70601fa075e | Find the optimal tour to be followed | {
int start = 1;
int distance;
int min;
int closest;
int num_cities = adj_matrix.size();
std::vector<int> tour;
std::vector<int> dist_list;
tour.push_back(start);
for (int i = 0; i < num_cities; i++){
for (int j = 0; j < num_cities; j++){
distance = adj_matrix[i][j];
... | 0 |
135d502b4a964027c7bf04de2ae00852 | 7e8beba734abddec3b990436c5185857 | finds common between two sets | set<int> I;
for (set <int>::iterator i = s1.begin(); i != s1.end(); i++) {
if (s2.find(*i) != s2.end()) {
I.insert(*i);
}
}
return I;
} | 1 |
b73fb66f44bf26dc921166861004c6b3 | d85f58c13ba994bf324c57c1db40635e | Returns the column that is needed for connecting two tables (Not for many to many relationships). | public function getForeignColumn(): string; | 1 |
ff8d9798c4e45869dacb7374310126db | 7c2cc5b46ec745319726f032adedd2ea | This test is to check the functionality of the drawing panel.
A figure is drawn, shrank and moved to check the functionality | radius = 3
imwidth, imheight = 100, 100
self._fig8Test(imwidth//2 - radius, imheight//2, imwidth//2 + radius, imheight//2) | 1 |
82a56072f2491e550c84b1ff5b7537df | 9acb6745029d4990cf0130176fd84281 | Reset eligibility of all states, performed in beginning of each episode | class Critic:
def set_current_eligibility(self, state):
self.eligibility[state] = 1 | 0 |
8e18f93994bed20860f6002ad266b97d | 5708d0cab544222311d4ec7050f535ab | true if all vertices
have the same number of edges | public class ModularityDetector
private boolean allVerticesInSameCommunity() throws JmodException, Exception {
int positives = 0;
for (int i = 0; i < currentSubcommunitySize_; i++) {
if (currentSubcommunityS_.get(i) > 0)
positives++;
}
return (positives == currentSubcommunitySize_ || currentSubcommunityS... | 0 |
be9d31b1ba2f5cb50f6ea8a3790a9001 | d8ba8702fe7ef27e4d1cde8febbb7ef7 | Sets the state the Hoiio Number belongs to | class NumberManager
private function transitNumberState($ctNumber, $newState=null, $options=null) {
$oldCtNumberState = $ctNumber->getState();
if ($newState) {
$newCtNumberState = $this->em
->getReference('\YpgCtNumberBundle:CtNumberState',
CtNumberState::stringToId($newState));
$ctNumber->setSt... | 1 |
90a03b2449064361316d5a9bcbea1a6b | cac01a39907878540cd0ef6491d47d45 | place two random tiles down to begin the game | class GameState:
def randomStart(self):
self.placeTile()
self.placeTile() | 1 |
0d0eecf05e0b5880055aed2ffa68e65c | d44ab0579e94da19d2217a1800bf07b9 | Return true if there are no submission files | public class OpsFileValidatorReport
public boolean isEmpty() {
return entrees.isEmpty();
} | 1 |
a58ec5f64e32d8f8e83d0239c03d7041 | 0e179c90a4235867e5e10a140bf6ae5b | Sends encoder_reading from the current controller to the master.
The encoder_reading sent has readings e1, e2, e3, e4. See the spec
for more details. | {
double enl1 = en_ptr->quaternion.x;
double enl2 = en_ptr->quaternion.y;
double enr1 = en_ptr->quaternion.z;
double enr2 = en_ptr->quaternion.w;
double enl = 0.5* ( enl1 + enl2 );
double enr = 0.5* ( enr1 + enr2 );
double ts= en_ptr->header.stamp.toSec();
{
if ( last_enl_ == 0 && last_enr_ == 0 ) ... | 0 |
afbf08239dbac59b3c0c74ffd5e39cba | d5ca60bde2f8c4d5090d94b7294f28fa | 当身份证号码位数小于18的时候返回false | class PtIdcard
static public function idcardCheckSum18($idcard){
if (strlen($idcard) != 18){ return false; }
$idcard_base = substr($idcard, 0, 17);
if (self::idcardVerifyNumber($idcard_base) != strtoupper(substr($idcard, 17, 1))){
return false;
}else{
return true;... | 1 |
f9b1a60d4c2714017ed3fa402a95bb19 | 0acfb99d5d61268cb92cab274d2680ff | Call the given middleware. | use(fn) {
this.middleware.push(fn);
} | 0 |
b41cb6ff1348444241a63326effb3aec | 460fcf127d18853329ac2beb2c0e812b | Left shift an integer by a given number of bits. This multiplies the number
by the appropriate power of 2.
Calc::Q(2) << 3 #=> Calc::Q(16)
Calc::C(2, 3) << 3 #=> Calc::C(16+24i) | if(rhs == 0)
return lhs;
return lshift(mul(lhs, 2), dec(rhs));
} | 1 |
26679c76cea94fa22152b72baa703a26 | c77e8c7babf3614a5ea4468825cb309a | Only allow - and numbers | var st = String.fromCharCode(e.which);
if ("0123456789-".indexOf(st,0) < 0) { return false; }
return true;
} | 1 |
73e8fc217f66dd2b6f676852e87da5a3 | 9d2a736dcde17e215a4d7279a5d90b04 | 获取数据, 该函数会等待至取到数据或超时,返回默认值 | data, exists, err := discovery.Default.GetValue(key)
if err != nil {
ret = defaultValue
return
}
v := string(data)
if !exists {
ret = defaultValue
defer discovery.Default.SetValue(key, []byte(ret))
return
}
ret = v
return
} | 0 |
5aefae6dcd0e347773ceec18d5b21bdd | e287dfb132d59f2c8d1f334941f27ab9 | Zooms to a selected portion of the space. | class Views:
def zoom(self, wn="", lab="", x1="", y1="", x2="", y2="", **kwargs):
command = f"/ZOOM,{wn},{lab},{x1},{y1},{x2},{y2}"
return self.run(command, **kwargs) | 1 |
1130d96ffb383e986f3a0b9967a065b3 | 2c2af6fd388ad3ffde233d6af910df0f | Lousy helper that indents the supplied python code, so that it will fit under
an if statement. | class OctaveCodePrinter(CodePrinter):
def indent_code(self, code):
if isinstance(code, str):
code_lines = self.indent_code(code.splitlines(True))
return ''.join(code_lines)
tab = " "
inc_regex = ('^function ', '^if ', '^elseif ', '^else$', '^for ')
dec_regex = ('... | 0 |
5dab75ea5f164ce238079fabbe8dc316 | 72a3fbbf4c107c6dc57f14c59adff994 | 新增排队顾客 | if(total >= customers.length){
return false;
}
customers[total++] = customer;
return true;
} | 1 |
83e08389dfc0d28381485b5a859396ea | 79195b5ba2faa4079f0eeea9ab9b650e | The HTMLElement.offsetHeight read-only property is the height of the element including vertical
padding and borders, as an integer. | @JsType(name = "jQuery", isNative = true)
public class JQueryElement<T> extends Node
public native JQueryElement<T> outerHeight(String value); | 0 |
88cacd81ed415cfb81dfb62edbcef282 | 3c6c859c21d174a1572c8332ae885b89 | Add genre and director for a movie. | namespace AngularJsSample.Model.Movies
int AddGenre(int genreId, int movieId, int userId); | 0 |
0c0fc7676dad328659c88412498d9bad | 1c5643c0ad69d7eb65647b7899d0b1c5 | Read from a file opened over NULL Stdio device | void far* file_read_fatal(const char* filename, void far* dst)
{
return file_read(filename, dst, 1);
} | 0 |
404f093d1840c389304fd8992bc4c63a | 272c46e6dbc6721aed865d2580a33a94 | RTC Print -- DONE
Reads time values from RTC
Prints time on LCD in format: HH : MM : SS | void RTC_display_time(void)
{
char time_print[20] = {"00:00:00"};
rtc_time.seconds = rtc_time.seconds_counter % 60;
rtc_time.minutes = rtc_time.seconds_counter / 60;
rtc_time.hours = rtc_time.seconds_counter / 3600;
rtc_time.minutes %= 60;
rtc_time.hours %= 24;
sprintf(time_print, "%2i:%02i:%02i \0", rtc... | 1 |
624a9d1cb39f2e0924a770cae06e3adc | 22a239bc51f4552377772694b74faed2 | ! ある文字がヒットするまでの文字を切り取ってくれる (結果にmarkは含まない) | $st =stripos($kw,$mark1);
$ed =stripos($kw,$mark2);
if(($ed==false)||$st>=$ed)
return 0;
$kw_re=substr($kw,($st),($ed-$st+3));
return $kw_re;
} | 0 |
e635458ca79c1b92aa437d62715211a1 | 7884f17fd90d34d6f50431dbf82c2cfb | funkcia pre neterminal stat (STATEMENT) -- Možné príkazy v tele funkcie | bool statement(){
bool state = false;
if(!strcmp(current,"i")){
if(valueStatement()){
state = true;
}
} else if(!strcmp(current,"if")){
if(ifStatement()){
state = true;
}
}
return state;
} | 1 |
d75062e7b0655eac2977dd7017a5d9cf | b5467d176103d2bcd78d176e0df44ffa | @brief Initialization of the device's ring rotation feature by rotary callback function attachment. | void view_set_rotary_event_callback(Evas_Object *obj, Eext_Rotary_Event_Cb rotary_cb, void *user_data)
{
if (obj == NULL) {
dlog_print(DLOG_ERROR, LOG_TAG, "[%s:%d] parent is NULL.", __FILE__, __LINE__);
return;
}
eext_rotary_object_event_activated_set(obj, EINA_TRUE);
eext_rotary_object_event_callback_add(obj,... | 1 |
44889756e2225d286fccb305ca4faa41 | 87a4859c73da36452417ecab6f47a2e9 | Exit a parse tree produced by {@link TSqlParser#column_name_list_with_order}.
@param ctx the parse tree | public class sqlQueryBaseListener implements sqlQueryListener
@Override public void exitColumn_name(sqlQueryParser.Column_nameContext ctx) { } | 0 |
5769f7c5a95f52454a26edb5bad39a0a | 8a75482fcb1347fd9912f469b82ee078 | 创建一个新的城堡坐标 | $errNo = T_ErrNo::ERR_ACTION;
$data = array();
$posArea = !isset(T_App::$map[$posArea]) ? array_rand(T_App::$map) : $posArea;
if (!empty($faceId) &&
isset(T_App::$genderType[$gender]) &&
!empty($cityName)
) {
$objPlayer = $this->objPlayer;
$cityId = $objPlayer->getId();
$cityInfo = $ob... | 1 |
dd90a6b2d3a88f2e400da8eed7fc4f5a | 21e3a131df03f7d5f5ac7a95b2793292 | Returns true if close() has been called already. | class HtmlWindow(PyV8.JSClass):
def closed(self):
return self._closed | 1 |
9131e6c5943a19ab2de8b94d4c5946d9 | feb0000f4c6af5014cd9e82796eff7e2 | Escribe el código que el invitado escribió en la pantalla host | public class ButtonEvent : MonoBehaviour
public void ClickInvite()
{
InputField invitado = GameObject.Find("/Canvas/InvitationPanel/TFEmail").GetComponent<InputField>();
Debug.Log("Invitation to: " + invitado.text);
string sender = Jugador.instance.Username;
string codigo = Lobby.inst... | 1 |
3ef0381e546ef3f28d9e138e9b744f91 | d13af800d4600920bbad8cd712d1ffff | Defines a simple prefixed string to stdout for autopkg | assert isinstance(msg, str)
assert isinstance(end, str)
assert isinstance(prefix, str)
outstr = prefix + str(msg)
print(outstr, end=end, file=fd)
fd.flush() | 1 |
737a60f3d8426968445f2680032da250 | 2fcc2e6ace846da88c19a7b0b511f28b | Deletes all of the contracts. | class TestContract:
def before_tc003052(self, admin_login):
self.contracts_api = ContractsAPI(admin_login)
self.contracts_api.delete_all() | 1 |
335181f841db7eab942c968107e59cd6 | 3228012fe9147f158cf292cc4a7456d9 | Draws all edges of the cube. | public class MyView extends View
private void DrawCube(Canvas canvas)
{
DrawLinePairs(canvas, draw_cube_vertices, 0, 1, bluePaint);
DrawLinePairs(canvas, draw_cube_vertices, 1, 3, bluePaint);
DrawLinePairs(canvas, draw_cube_vertices, 3, 2, bluePaint);
DrawLinePairs(canvas, draw_cube_... | 1 |
468232b82b8be5c4104168fe2ec33b42 | 46eab4fc6d3086631e1fee3221ab6368 | 获取最近一周所有日期 | String[] dates = new String[2];
Calendar cal = Calendar.getInstance();
int day = cal.get(Calendar.DAY_OF_WEEK);
if (day == 1) {
cal.add(Calendar.DATE, -7);
} else {
cal.add(Calendar.DATE, -(day - 1));
}
dates[1] = formatDate(cal.getTime());... | 0 |
1198bf8f741032ae5ad1b2ea38c5acbb | e00741f478f2914b56e23a244fb60928 | méthode pour actualiser le déplacement du serpent | xSerp = xSerp + deplX*tailleSerp;
ySerp = ySerp + deplY*tailleSerp;
bodySerp.push({x:xSerp,y:ySerp});
while(bodySerp.length> tailleBody){
bodySerp.shift();
}
} | 1 |
8c69ef6e671cf76cf290301bdb330193 | 79137b78f9b3b48f7a0a7b183fef03fb | 更改医疗器械类型 | {
DataTable dt;
if (cmbLBs.Text.Trim() == "西药")
dt = HisHelp.JianSuoType(LB);
else
dt = HisHelp.JianSuoTypeALL(LB);
cmbXMMC.Items.Clear();
foreach (DataRow dr in dt.Rows)
{
cmbXMMC.Items.Add(d... | 0 |
b5f5b43d3619314a5f78704bb8246f20 | 635f9cd056fe0375299f5ecc5dfd63eb | Gets The Service Bus fully qualified domain name. | @ServiceClient(builder = ServiceBusClientBuilder.class)
public final class ServiceBusReceiverClient implements AutoCloseable
public String getFullyQualifiedNamespace() {
return asyncClient.getFullyQualifiedNamespace();
} | 1 |
c9b77bd57aaf9f73e6eb55f7ad0b7ec7 | d6d5c8492b7486dc583506eb38b53f3f | YYYY-MM-DDTHH:mm:ss.oo -> YYYY-MM-DD HH:mm | func FormatDate(date string) string {
return date[12:16]+"-"+months[date[8:11]]+"-"+date[5:7]+"T"+date[17:25]
} | 0 |
dd8524bf19552f3d9925266e853b494b | a7c06d2612786b9f8c76a7158407c40a | 创建GridSizer | box1 = wx.BoxSizer(wx.HORIZONTAL)
box1.Add((25,-1), 0)
box1.Add(self.cfgLb, 1, wx.EXPAND | wx.ALL, 5)
box2 = wx.BoxSizer(wx.VERTICAL)
box2.Add(self.list, 1, wx.EXPAND | wx.ALL, 5)
sbox = wx.StaticBox(self.panel,-1,u"定时发送")
sbsizer = wx.StaticBoxSizer(sbox... | 0 |
5c22c83900f5f67bc56ad3118d1e3108 | cae1216ec25d3159d9672361e1954472 | Reading curl get contents with cache support | function curlGet($url)
{
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_REFERER, getHost($url));
curl_setopt($ch, CURLOPT_REFERER, getHost($url));
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/200... | 0 |
c685284b03f17f4b4e7eef171fe50fc7 | a71d2493252d640a1397266cc3f88120 | Fonction récursive réalisant l'exploration en profondeur pour chercher le total de cellule adjacentes | int cpt = 0;
int i, j;
ListeCase L;
init_liste(&L);
ajoute_en_tete(&L, k, l);
while(test_liste_vide(&L)==0){
enleve_en_tete(&L, &i, &j);
cpt += caseAdjacente(M, z, cl, i-1, j, &L);
cpt += caseAdjacente(M, z, cl, i+1, j, &L);
cpt += caseAdjacente(M, z, cl, i, j-1, &L);
cpt += caseAdjacente(M, z, cl, i... | 0 |
f9f7cc101a183a5b81aa5fc58df7f2f5 | 38bca60252718c74426eb2b659bd100a | GET: api/Marks | class MarkController extends Controller
public function index(Request $request)
{
if($request->ajax()){
$marks=Mark::all();
return response()->json($marks,200);
}
return view('marks/listmark');
} | 1 |
0a9efc0b8c68cbc8eccf29e022122e43 | 268867cba2880aa4db4dadcf51542a25 | Test usename is case-insensitive. | class CaseInsensitiveModelBackendTest(TestCase):
def test_passwords_case_sensitive(self):
result = self.try_login('Username1', 'pip INSTALL django=2.2')
self.assertIsNone(result) | 0 |
e511a9c760d40a11c53a1ff21e27c5a6 | 1e788df873a5f40863ba07debf62050f | Search for the display name of a property from a entity type. | namespace Moon.Validation
internal class AttributeStore
public string GetPropertyDisplayName(ValidationContext propertyContext)
{
var typeItem = GetTypeItem(propertyContext.ObjectType);
var propertyItem = typeItem.GetPropertyItem(propertyContext.MemberName.Split('.').Last());
... | 1 |
dafa5fb2c5a8c90e724b333b26ae2046 | deae8b9aa49adf177a1a6f678379b24e | Schedule a check to see if the session should be disconnected after a short delay.
The delay is to avoid disconnect and immediate reconnects. | {
if (SessionCheckTimer != null)
{
SessionCheckTimer.Change(Timeout.Infinite, Timeout.Infinite);
SessionCheckTimer.Dispose();
SessionCheckTimer = null;
}
} | 0 |
d80418d0dda3477cd0aa6b993b6c067c | f36210177a29a9e56f265d30b34ea2bc | Substitutes any generic type parameter in the field signature with the parameters provided by
the generic context. | {
Debug.Assert(metX != null);
string nameKey = metX.GetNameKey();
if (metX.DeclType.GetMethod(nameKey, out var ometX))
return ometX;
metX.DeclType.AddMethod(nameKey, metX);
IGenericReplacer replacer = new GenericReplacer(metX.DeclType, metX);
metX.ReturnType = Helper.ReplaceGenericSig(metX.DefSi... | 1 |
bba65ec40e4f2d3782f0c7a110895687 | 138cdcb9ab14a1d073e26354fd9a8c31 | Render a form to update an existing module. | {
return $this->formComponentRender(
$request,
$this->formTitle($request),
$this->formExtraActions($request),
$this->updateApi($request),
$this->updateFieldsWithinComponents($request),
$this->formActions($request),
$data
... | 1 |
24361eb11939a7a1e68ad9e1b2479f0c | 702a9424eb58caabc2c923792aa29482 | fill 1d array with random 2 digit numbers | {
for (int i = 0; i < arraySize; i++)
{
array[i] = rand() % 200 / 10;
}
} | 0 |
efb6fbd1135b9e690de5cec5169afe1f | e23864c183dd946850e3977abbfbe22d | Returns the hyperbolic cosine of the complex number <paramref name="x"/>. | public static partial class Extension
public static double Cosh(this double @this)
{
return Math.Cosh(@this);
} | 0 |
960460f19c18b6a24d83725ee8795c0a | 81df2e47df22d4768500d55215efc5c7 | Returns the draw box button. | class InputDialog(gui.Dialog):
def draw_left_mouse_button(self):
self.draw_box(self.btn_left_box, _(u"L")) | 0 |
e7ba8835dba8b8a3eb9f78b99a1ae984 | 9752fe553c5bb7ac449dd7c8f18d2688 | Display a listing of the Colectivo. | class ColectivosTest extends TestCase
function ObtenerColectivos()
{
$user = User::where('id', 2)->first();
\Auth::loginUsingId($user->id);
$this->get("/colectivo")
->assertStatus(200)
->assertJson([
'colectivos' => true,
]);
} | 1 |
09b794448926c5856def695a57bf259c | f7e49343290653d9bd303b42db91ea8a | Sets the type of the transformation. This doesn't actually change any of the values,
but it does initialize the fields required for the type if they are <code>null</code>.
To promote to a more general transform type, see {@link #promote}. | void setType(Object value); | 1 |
dae552f501835df26abcc8324854ad04 | be810e141401979f8317035e97d0faad | Verifies that filtering by the LESS THAN OR EQUAL TO operator (<=) functions as expected. | namespace Exprelsior.Tests.ExpressionBuilder.SimpleExpressions.Float.Contracts
[Fact]
void Assert_Nullable_Float_Less_Than_Or_Equal_Expression_Is_Generated_Correctly(); | 1 |
66f1f61c91ba56f7b30ce1af9014ee4a | 00db8cf0fd791ab43a0313707c28b1c5 | Pass data of selected RV item to Retrieve Note activity | public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Intent intent = new Intent(getApplicationContext(), NoteActivity.class);
intent.putExtra("ids", arrayList.get(position).getIds());
startActivity(intent);
MyNoteA... | 1 |
86b647bf61dba95ca59c7f9b5c25e23d | 643203483546147811b21325457ba352 | Metoda kopiująca wszystkie zaznaczone elementy z lewej listy na prawą | items = []
selected = self.right_listWidget.selectedItems()
for item in selected:
items.append(item.text())
self.right_listWidget.takeItem(self.right_listWidget.row(item))
self.left_listWidget.addItems(items) | 0 |
fe90cef16cbf82ef1be3c9bf50d55a91 | af630ef232fdd22722b7abcfb2a956e9 | Restituisce il Transfer Object di Configurazione che incapsula tutti i dati.
Il metodo sovrascrive le variabili d'istanza relative ai campi.
Potrebbe essere usata quando si vuole cambiare la configurazione
o null se c'è un errore di formato nel file o non esiste | public CAEXObject toConfiguredCAEXObject(); | 1 |
c7300decb2f7abb8a895f13079894e23 | 9bc7c8e7fdee5b1488566aa41825002b | Return to none scaling mode. | class drag_bar():
def autoscale_off(self):
self._autoscale = False | 1 |
7981706a0125c6fb28a22e81cf763750 | 4502f10c0d993c5146b817dcf68bd99d | Test method for {@link com.geekyaubergine.geekyjutil.network.NetworkConnection#getConnection()}. | public class TestBDDConnection
@Test
public final void testGetConnection() {
BDDConnection bdd = new BDDConnection();
assertNotNull(bdd.getConnection());
} | 0 |
be73614278953f2945feaa506167f91e | adc62bb864c41c8ed8fe6ecfd80998ff | 通过 继承的接口名 查找 对应的 实体类型集合 | {
if (!t.IsInterface || string.IsNullOrWhiteSpace(assemblyName))
{
return null;
}
List<Type> allClassList = GetClasses(assemblyName);
if (allClassList == null || !allClassList.Any())
{
return null;
... | 1 |
1554f560628599e5af1fa7d51969925e | be6f59cfac6533317dad8c911f58fc67 | Cancella oggetti IPC che sono : semafori, memorie condivise, code messaggi se sono rimaste aperte | void clearIPC() {
printf("OSS: Clearing IPC resources...\n");
if ( shmctl(shmid_sim_secs, IPC_RMID, NULL) == -1) {
perror("error removing shared memory");
}
if ( shmctl(shmid_sim_ns, IPC_RMID, NULL) == -1) {
perror("error removing shared memory");
}
if ( shmctl(shmid_pct, IPC_RMI... | 1 |
c06c02897b2df503b29f3567054491fe | f656773ead59b82695dd457b0f039c73 | Get subscription product price function. | if ( ! $product = _sumo_pp_get_product( $product ) ) {
return null ;
}
if ( _sumo_pp_is_wc_version( '<' , '3.0' ) ) {
return $product->get_price_html_from_to( $from , $to ) ;
}
return wc_format_sale_price( $from , $to ) ;
} | 1 |
7008b5168a70b8f741adc16ff91c9478 | bba24e49a3b0cdcd44834595fbce265d | Get the custom template of current section | sectionTemplateName = params.get("sectiontemplate", "default")
sectionTemplateName = "_sectiontemplate_"+sectionTemplateName.strip()
return s._processTemplate(sectionTemplateName, params) | 1 |
ade3bf4d25d5fd6c319b93304038a4d2 | 7f2519271306bddda9803d3cb403678d | 同步回复腾讯消息方法 | need_reply = False
send_to_tuling_content = msg.raw.content
reply_prefix = ''
reply_at_wxid = ''
if msg.from_id.id.endswith('@chatroom'):
try:
soup = BeautifulSoup(msg.ex_info,'html.parser')
at_user_list = soup.msgsource.atuserlist.contents[0].split(',')
i... | 1 |
5a247d0f43d2e523ae83ba3c53d5d3b9 | 32c5f3fe5acea9cc0d5d84c2a69c4169 | Sets activity as marker's click listener (used for customization of action) | class MainActivity : BaseActivity(), MainActivityMVP.View, GoogleMap.OnMarkerClickListener
private fun setMapClickListener() {
map.setOnMarkerClickListener(this)
} | 1 |
ee55e3ae0a7a234718b8377ae3f435ff | 263be60993230b99e38c4f82dd9a284a | Don't do any postprocessing when outlining Tapir loops. | override fun transformBlock(block: FirBlock, data: FirLazyAnnotationTransformerData): FirStatement {
return block
} | 1 |
851560d69445c05bba346ad7cc00c351 | 741188467fbd324c2e44cd95e59ea48b | Check whether an url was treated
Callback signature: true/false | cursor = connection.cursor()
cursor.execute("SELECT COUNT(*) FROM data WHERE url=%s AND user_id=%s AND queued=true", (url, user_id))
return cursor.fetchone()[0] >= 1 | 1 |
53c127a3e3bfb5b280694c8d394a9c75 | 16fde2d95bcc87ff54153c959f678ae3 | Создает выдавливание. | public function createScrew(); | 0 |
1d40ef0987e39dca3dcb49a10e23858c | 42d86c5070c09fcf482e08b9f24a4977 | we only retrieve new messages else nothing by sending a check-kounter first | const chat_id = sessionStorage.aktuelleChatId;
if (chat_id>0){
if(sessionStorage.lastMessage>0){
var functionString = '{"i":"getLastMessageIdFromChat","chat_id":"'+chat_id+'"}';
callChatctlWithSuccess(functionString, function (response) {
if(response == sessionSto... | 1 |
a968a11af6734b267ddbb70e0b0dcd14 | 63417ae23773272dd9efe37ca24c6180 | Obtiene el listado de agrupaciones.<br> | public List getGrupoProceso(); | 1 |
d67fc21cce354430dc7ecd8764786bbc | 24e8d38b727e4fd8aa39d14fc94958f7 | Returns the value of the '<em><b>Type Parameters</b></em>' containment reference list.
The list contents are of type {@link org.summer.dsl.model.types.JvmTypeParameter}.
<!-- begin-user-doc -->
<p>
If the meaning of the '<em>Type Parameters</em>' containment reference list isn't clear,
there really should be more of a ... | EClass getJvmParameterizedTypeRef(); | 0 |
d1d265e39ad0ca9654221bffdc78ba9f | 27163f43e32ed80ba1f1b0d029552225 | Добавление пункта меню выход из игры | public class MenuController extends MenuBar
private void createExitPresentation(Menu menu)
{
menu.addSeparator();
menu.add(this.menuItem = mkMenuItem(EXIT));
this.menuItem.addActionListener(actionEvent -> System.exit(0));
} | 1 |
becaba98ec6dcb074ba0ab8abfca6618 | 9074d9f1b8029f2ab278e070d732cffc | Sets whether the feedback should be shown.
true if feedback should be shown, false otherwise | set feedbackBubbleVisible(setVisible) {
LookbackBridge.feedbackBubbleVisible(setVisible);
} | 1 |
b35e2da718e56c3f3b36eda2e455009e | 34745d886d615a26478da841c87c7010 | Retrieves all transactions between two provided dates. | class CreditCard(Comparable): # pylint: disable=too-many-public-methods
def get_transactions_for_date_range(self, date_from, date_to):
start_date = self._parse_date(date_from).date()
end_date = self._parse_date(date_to).date()
if end_date <= start_date:
raise InvalidDate('date_fro... | 1 |
25b1c2ed227060fbd8ee2f494c0513c3 | 186c9d3810733237962d3558009ced97 | 商品情報編集画面で編集する商品を確定するメソッド | public class ProductControllerBase
@RequestMapping(value="edit/transactfinish", method=RequestMethod.POST)
public String transactfinish(@Valid Form form, BindingResult result, RedirectAttributes redirectAtt,
HttpServletRequest req)
throws Exception {
if(ErrorUtil.checkInvalidAndWriteLog(result)){
return this... | 1 |
72dfd459dc88e20e0acc831f1a6cffa4 | 7f6ff56c74aea435c44cd999b97e645e | Methode zum Erstellen von drei Default-Routen, um den Benutzer schon bei
Installation etwas präsentieren zu können | {
Router::instance()->setRoute(new Route('signup', '/signup', 'user'));
Router::instance()->setRoute(new Route('login', '/login', 'user'));
Router::instance()->setRoute(new Route('username', '/user/:username', 'user'));
Router::instance()->setRoute(new Route('defaultControllerActionPidId', '/:controller/:acti... | 0 |
7f861ab424f1c8130ee1e4cd327ec8a0 | f5675c7557c34f4ea8975e83762b833b | 返回session生存时间 | class Zyon_Auth_Storage_Session implements Zyon_Auth_Storage
public function getLifetime()
{
return isset($_SESSION[$this->_instance][static::KEY_LIT]) ? (int)$_SESSION[$this->_instance][static::KEY_LIT] - time() : 0;
} | 1 |
7f7a06be53da9c8aebcadef2486601b3 | 1e6b6ef0f102c1f691dbbc0d028a75d3 | 构建插入shiporder sqly语句 | class Hull(object):
def insert(self):
return self._sql_insert_hull.format(name=self.name, armor=self.armor, type=self.type, capacity=self.capacity) | 0 |
450ba533baf8ab3f0f7b7778c60f5b77 | ba8aed0132c5dbb4daa7fdee7260d3d7 | Generate the custom field in modal | $this->access_only_allowed_members();
$view_data['model_info'] = $this->Custom_fields_model->get_one($this->input->post('id'));
$view_data['estimate_form_id'] = $estimate_form_id;
$this->load->view('estimate_requests/estimate_form_field_modal_form', $view_data);
} | 1 |
a768b59e63c52baee21cc6d2fd0fbe5f | 5937f03f1bfa8de5ad1e886c859dd2fc | 获取玩家宠物数量 | class CharacterPetComponent(Component):
def getPetNum(self):
pets = self.getPets()
return len(pets) | 1 |
30accb1db1400e8bdf2c561f931f1518 | 8c2971772e290ef0fd103f809ef12355 | checks if should add extra 0 | function extra(x)
{
if(x < 10)
{
return "0" + x;
}
else
{
return x;
}
} | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.