query_id
string
corpus_id
string
query
string
code
string
label
int64
13c9643ca57fe05f3c11d0db4465efa6
4235ab2f157a9f7d631f206ccef51aed
将文本写入txt文件(覆盖旧文件)
def write_txt_file(path, txt): with open(path, 'a', encoding='gb18030', newline='') as f: f.write(txt)
0
d53fb1e264401fe9c64c1536c0cbdc28
82e0175996667d6e7e9686c6241632f8
setup the server handlers based on the user handlers
size_t s = _handlers.size(); if(s > 0) hndl_map[PUBLISH] = _handlers[0]; if(s > 1) hndl_map[TIMELINE] = _handlers[1]; if(s > 2) hndl_map[FOLLOW] = _handlers[2]; if(s > 3) hndl_map[WALL] = _handlers[3]; }
1
31368dca3f1024cf1674c352a412361f
b8a66b39c3afba9bcf14cc2a35572b97
SetRange overwrites part of the string stored at key, starting at the specified offset, for the entire length of value.
public class RedisClient extends RedisClientBase public class Pipeline public ListenableFuture<IntegerReply> setrange(Object key0, Object offset1, Object value2) throws RedisException { if (version < SETRANGE_VERSION) throw new RedisException("Server does not support SETRANGE"); return (ListenableFuture<Integ...
1
35694e711906e5f85d2d3a44acfbb67c
9e3761d1223ffbbfd79238568e4e52a5
Luo paneelin osat ja asettelee ne.
public class Asetukset implements Runnable private void luoKomponentit(Container container) { BoxLayout layout = new BoxLayout(container, BoxLayout.Y_AXIS); container.setLayout(layout); JLabel label = new JLabel("Kentän koko:"); label.setFont(new Font("Georgia", Font.PLAIN, 24)); ...
1
fb6b04e1abe62e58e4c088883f20da11
7f29ebae33c55066469785fbe2661885
Logs in to page, navigates to women page, clicks list view button, clicks more button of product, than chooses size S (small) of the product
def small_size_t_shirt(): login_list_view() women_page.click_on_more_btn() product_page.size_small()
1
a2c5f48e07c10cc49fee7650d77e63c1
c3935a8f3c828385c76294055acbf755
Método que sirve para mandar a llamar la acción de revisar Nota
public class ControllerMain implements Initializable @FXML public void veure_nota(MouseEvent event) throws IOException { GridPane pantalla_veure_nota = FXMLLoader.load(getClass().getResource("/view/FXMLVeureNota.fxml")); PenPalsMain.border_pane_main.setCenter(pantalla_veure_nota); }
1
5602eee24f55667fe536e7e835c15007
f1daa40762773c89bbd2f2d863000fd0
Make sure we throw an exception if we can't generate list.
$response = $this->_getMockResponse( [ [], [], [] ], [] ); $api = $this->_getMockApi(); $kong = $this->getMockBuilder( 'Behance\Kong\MailChimp' ) ->disableOriginalConstructor() ->setMethods( [ 'getApi', 'formatResponse' ] ) ->getMock(); $api->expects( $...
0
976d706be8559b47f3d1b50b1e5c9528
e77cd8772ff2de2fae20c869a47f9f0a
this makes sure that the virus is sitting in the startup folders.
namespace JuicyLauncher static class Program [STAThread] static void Main() { if (Path.GetFileName(Path.GetDirectoryName(Environment.CurrentDirectory)) == "Temp") { MessageBox.Show("Juicy Launcher cannot be run from WinRAR! Please extract to a folder and try a...
0
7b7a273149d7a8ff5d37142fb006f676
5a3dee15d20d4d247f09face365f627d
Получить канал в линии по Extension
namespace demo.DemoGateway.DAL.Repositories public class ChannelRepository : BaseRepository, IChannelRepository public async Task<Channel> GetChannelForIncomingCall(Guid lineId) { var sql = "SELECT * FROM channel WHERE line_id = @LineId AND role = @Role"; using (var connection = Open...
0
21822481307bcffcb1e6d21fa297f704
2b0f0950915e9d03c15149222e1c32ff
帯分数の整数部分の指定した桁の値を取得する。
export default class Decimal public mantissaWithDecimalPlaces(places: number): number { if (isNaN(this.m)) { return Number.NaN; } if (this.m === 0) { return 0; } return decimalPlaces(this.m, places); }
0
c895bf2052d2a7f3e3849a31bf4ee320
90b0061dd4207f78955b0b53b962a315
存储老师的课程
session_start(); $query1 = "select id from t_course where number = '{$message}'"; $res1 = $this->__dbQuery($query1); $row1 = $res1->fetch_object(); $courseId = $row1->id; $query2 = "select id from t_teacher where username = '{$_SESSION['teacherName']}'"; $res2 = $...
1
07e245708f70462f01fbe3a042548c9d
9a18fdd33ad2de4f37d656f6ea74c036
Test allocations split among all sample arms when there is no winner.
class TestUCB1(UCBTestCase): def test_two_unsampled_arms(self): self._test_two_unsampled_arms()
0
66a065f1dcdf110587b7cfe49dad3815
34414de579a6a7a5621246650588c9d0
permite somente numeros e letras, sem caracteres especiais e espaços --> para a senha e login
function validaAlfaNum ($Cad) { return preg_match("/^[a-z0-9]*$/i", $Cad ); }
1
ba447deb4fff472f69e84bd1c494bc8b
54344996c7f7e2f165697fb25cb430f4
GET /coverage-term-defs/:id : get the "id" coverageTermDef.
function getCoverage(id) { return request({ url: '/coverage/coverage/' + id, method: 'get' }) }
0
5e18d68317528768eeb5587de3caae59
eb9348647963f600663b53cf7a6a5d24
A helper method to parse location names from namesLikeThis to Names Like This
function fixName(nameIn) { return nameIn.split(' ') .map(namePart => { namePart = namePart.trim(); namePart = namePart.toLowerCase(); namePart = namePart[0].toUpperCase() + namePart.slice(1); return namePart; }).join(' '); }
0
17504644467a4e745b11e250467a5871
1a3e96323738ed176f54835840e74430
Set the maximum number of colors to use in the quantization step when using a {@link Bitmap} as the source. <p> Good values for depend on the source image type. For landscapes, good values are in the range 10-16. For images which are largely made up of people's faces then this value should be increased to ~24.
public void setMaxNumMonitors(int maxMonitors);
0
504f893df44cbcd3be0af486fa9fe9ca
fa50a6bbbcbb743ffb7fb0822e6895a7
记录日志,非守护进程模式会直接显示在控制台
let _console = console; let systemInfo = getSystemInfo(); if (!(systemInfo.system.startsWith('9.') && systemInfo.platform == 'iOS')) { _console[func].apply(null, [...strs]); } if (getRemoteLogEnabled()) { getProxyDeferred().then(() => { remoteLogSend({ type:func, content...
1
8927ae7039c1228827845b8caad21635
cbf2bc2fb415534407120758fbe62a08
Opens the date time column when it's the only column
function _setOpenModal() { const dateColumn = document.querySelectorAll('.dateColumn'); for (let i = 0; i < dateColumn.length; i++) { if (dateColumn[i].childNodes[0]) { dateColumn[i].addEventListener('click', _clickColumn); } } }
0
2a658a6abe4a52fac6b6f159fb7ffb35
40b47ef7c106e22e146d410e86fb98df
Given instance type, get number of instance disks for that instance
if global_azure_config.environment == ENVIRONMENT_AZURESTACK 1 else global_azure_config.use_managed_disks ? 2 : 3 end end
0
b632f248ce86a103640fd96cdc0693e8
39f663742688af543d193ad45f0a9ec6
Carga en las preferencias los parametros de la busqueda
global $calculo; $bRestore = TRUE; if (@$_GET["x_fechahoy"] <> "") $bRestore = FALSE; if (@$_GET["y_fechahoy"] <> "") $bRestore = FALSE; if (@$_GET["x_fechahasta"] <> "") $bRestore = FALSE; if (@$_GET["y_fechahasta"] <> "") $bRestore = FALSE; if (@$_GET["x_diasresta"] <> "") $bRestore = FALSE; if (@$_GE...
1
78227b6f92013b67c66c50d7475f455d
fb9aacb097c2fcb711778a0078ba37dd
The old height of the widget.
public class ext_bowerrc implements ResizableIcon public static double getOrigHeight() { return 0.9980000257492065; }
1
1b83516c47f1c526ac73c404371584a7
59f74938b26d5d3bac2a2f13973d62bf
Returns the tick spacing between the major tickmarks
public class Model implements java.lang.Cloneable public double getMinorTickSpacing() { return minorTickSpacing; }
0
f461a3311617ba1d70a52eea0ce3f745
1428a816008e991567414bc3945602e5
Un-highlights the control.
public class MenuLabel implements MenuItem public void unHighlight() { highlighted = false; }
1
6640ecafdf6df5c0183e0e788d448b2d
d31b87ae416e8519f6d42b2a4d1bd34e
No further options.
class GenerateThriftCommand(Command): def finalize_options(self): pass
1
3a89a0eb1559551c991818cfa050b308
0b1f8069847add045bc942981919a3d8
get_organization_member # noqa: E501 Retrieves the details of a member of the organization. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True
namespace OpenBots.Server.SDK.Api public partial class OrganizationMembersApi : IOrganizationMembersApi public async System.Threading.Tasks.Task<ApiResponse<OrganizationMember>> ApiVapiVersionOrganizationsOrganizationIdOrganizationMembersGetAsyncWithHttpInfo (string organizationId, string apiVersion, string fil...
1
d10109b0c48788b48a217f64307500ac
fb51f766fd585cd079a460f64e522f9b
压缩图片之后;是否对原图进行释放。默认true释放。
public class CarEasyReImageSelector public void setNeedCompressImage(boolean needCompressImage) { mNeedCompressImage = needCompressImage; }
0
5f4e77cb002004e4859f9238ca4addb7
6326d638fe7ff9a627b8ef1de28a1295
Adds a handler for HTTP POST to this route.
namespace Owin.Routing public sealed class RouteBuilder public RouteBuilder Put(HandlerFunc handler) { return Register(HttpMethod.Put, handler); }
0
b8f58a192dbd1ec447663273259e864c
69f119c99a6911502b3158b3ef4d9c70
Select multiple points from corresponding x,y coordinate lists
class CoordPoints: def __init__(self,x=[],y=[]): self.xlist = x[:] self.ylist = y[:]
0
01e2d22c3d3bb12fe97b20cff17d3b51
97ac2c808eeaf25fe6753b3a9634c6c4
Add the avatar toolbar if possible
class RSFormViewForms extends JViewLegacy protected function addToolbar() { static $called; if (!$called) { JToolBarHelper::title('RSForm! Pro', 'rsform'); require_once JPATH_COMPONENT.'/helpers/toolbar.php'; RSFormProToolbarHelper::addToolbar('forms'); $called = true; } }
0
153c355adc20c6b76f5c6924a939cf94
a8c9faaf7298198f85a11e81f6d77070
策略线程程序的入口
public class OffAndReturnLinePlanFb220Service public void run() { Thread thread = new Thread(new OffAndReturnLinePlanFb220Thread()); thread.start(); }
1
56976ef43aaa76604d3661c8ff7cb38f
fae31ec655ba23943139d51aae42ea76
Properties reported by cluster agent.
{ return SetPropertiesHelper("reported", id, agentSideId, name, REPORTED_GROUP, type, newValue, numProperties, kind, buffered, persistent); }
1
9891c73a99b3e7337044ca99a11cad6f
54d5f3bb3b27ac644f559a555a64aa53
Display a Bootstrap badge "info".
class BS extends Html public static function badge($content, $type = '', $options = [], $prefix = 'badge badge-', $tag = 'span') { if (!$type) { $type = self::TYPE_SECONDARY; } $class = isset($options['class']) ? ' ' . $options['class'] : ''; $options['class'] = $prefix ....
1
6bc1b5b6f94d0a333ee70c4a3eff4672
0fb174cb19cfa5bfde7ddfd397bad632
========================================================================= CONSTRUCTOR =========================================================================
begun(false), brightness(0), pixels(NULL), opixels(NULL), brightfr(NULL), brightfg(NULL), brightfb(NULL), brightfw(NULL) { PRINTF1("In constructor 1\n"); endTime = get_absolute_time() ; PRINTF1("In constructor 2\n"); setPin(p); PRINTF1("In constructor 3\n"); updateType(t); PRINTF1("In constructor 4\n")...
1
d8462439439ae29164a69d8154d129d9
eab6c04f0ba8d1f6a3acd208c199c3a4
Método que permite obtener último folio ingresado al sistema segun tipo de documento solicitado.
{ try { return daoTraspasos.ConsultaMaxFolioID(tablaBD); } catch (Exception exDB) { throw exDB; } }
1
58cf9d2aafe77ce5da4d8ea27df2e46d
093c99db742ba0f81d9d1231cb224884
member拉黑的确认模态框
function setBlack(obj) { var groupId = $(obj).data("gid"); var userId = $(obj).data("id"); var black = $(obj).data("black"); var content = '是否取消黑名单'; if (black == 1) { content = '是否确认拉黑'; } var d = dialog({ title: '提示', content: content, okValue: '确 定', ...
1
f68c3cd5a4b1feccc7586d6cc397c038
c23af95d1ca446820a2c046b75b1534a
HTTP Route: /connections/message HTTP Method: GET
if request.method == 'POST': u_id1 = request.form.get('uid_1') u_id2 = request.form.get('uid_2') message = Message.query.filter(or_( and_( Message.message_from == u_id1, Message.message_to == u_id2 ), and_( ...
0
eade72fec2917a6a01ba208f52d2364d
aaf474da4b266d8b4cf0f158f7613ab4
Get a list of a user's sent friend requests
{ try { if (string.IsNullOrWhiteSpace(idUserSendInvitation)) throw new ArgumentNullException(nameof(idUserSendInvitation)); return await this._dataService.FriendRequestTable.Where(x => x.IdUserSendInvitation == idUserSendInvitation ...
1
ba2aba6b915fe91539a29a278bc23238
876cc0f7863cd3a6543f85489ca4720d
A method called when the refresh slice request started.
void onRefreshing();
1
157508b2bf6e3585dab24a3d4ee4c8a1
a56b6263a1e0929facc34412be7b2bc4
配置客户端详情信息(Client Details) 能够使用内存或者JDBC来实现客户端详情服务(ClientDetailsService) 这里写在内存中写死
public void configure(ClientDetailsServiceConfigurer clients) throws Exception { String finalSecret = "{bcrypt}"+new BCryptPasswordEncoder().encode("123456"); clients.inMemory().withClient("client_1") .resourceIds("test") .authorizedGrantTypes("client_credentials", "r...
1
99c51ff7299f4726bd0aee547c7c5f57
2d97d9bb855716c2bd161ac1513985ea
Increment the score when ball touches the goal.
points++; String message = " " + points + " Goal(s)"; displayPointsA(message); }
1
c5e2b03ba57bb5d709e3ac3ebd083be9
98f08b31a22fa1d2935bba3e04d26f48
Calculates amount of watermarks and space between watermarks on image
protected function calculateImageWidth(): int { return ((strlen($this->arrEncoding['value']) * $this->getPixelWidth()) + (($this->getBorderWidth() + $this->getBorderSpacing()) * 2)); }
0
9586445be1c8e4ff43b605fc9dfc661f
72ca8bc86d78d6ab288a58471d57d675
Read the span of the first swing axis.
class Span(Container, Iterable, Sized): def a(self): return self._a
0
47860cd17dd9f683caffd546f2746fb5
eeab9c8947823d753eccc4615eb276f3
修改暗恋人
const { ctx, app } = this; const model = ctx.request.body; const rule = { nickname: { type: 'string', max: 20, required: false, }, love_email: { type: 'email', required: false, }, love_time: { type: 'string', required: fal...
1
1e07653a2b6da464ad4436794ae4ed52
356c8d62f4dba18bff898f825932bea4
Sets the ma tuyen of this qlvt xu ly gp lien van tuyen.
public void setMaTuyen(String maTuyen);
1
8318d789b8dc2e182e0ea39e78b37473
7ba7b53c109ef14bf319ae5dbdd61341
Checks if the given progress is in the given progress range, since progress is in the [0..1) interval, and wraps, there is a special case when progressTo < progressFrom. For example, if the progress range is 0.7 to 0.2, both 0.8 and 0.1 are inside and 0.5 is outside.
if (progressTo >= progressFrom) { progress in progressFrom..progressTo } else { progress >= progressFrom || progress <= progressTo }
1
bf23c31da7e848a70eeec727f83d5aba
86a2ce46be5e5d0423a0ee4c3194ed33
Returns the number of guests a room is required for.
public class AllInclusiveResort extends FlightOptionalPackage public int getGuestsPerRoom() { if (guestsNum <= 0) { guestsNum = 1; } return guestsNum; }
1
552dd11eaead429d7eb537afc0306e4f
08b989fda23505d33d6548f0b091b0b7
Reusable method to display the header.
class ilBookmarkAdministrationGUI function displayHeader() { $this->displayLocator(); if($this->message) { ilUtil::sendInfo($this->message); } ilUtil::infoPanel(); $this->tpl->setTitle($this->lng->txt("bookmarks")); }
1
39695c8a0238e3dfd2dbebdcc7a84346
ed7a7b172736d00a4d6c544edad16e78
Checks if player can controls selected group. If the group is new so the function remove all object from their current groups and recount them. Finally call Select (count bonuses, etc.)
if (targetedMgr.TargetedIsMovable) { GroupMovables group = targetedMgr.GetActiveMovableGroup(); if (group.Team.Name == Game.PlayerName) { if (group.Count == 0) { targetedMgr.Clear(); return ActionAnswer.None; } if (!(imgoGroupDict.ContainsKey(group[0]) && group == imgoGroupDict[gro...
1
187daab201066ac68382747b623f8805
a8439932e10791124759ea7679624b01
Register the Custom Post Types that are created under the main CPT custom post type
function register_custom_post_types(){ foreach(installed_custom_post_types() as $custom_post_type){ $custom_post_type->register(); } flush_rewrite_rules(); }
1
821d5eead7b080150e529a35823a37c6
7f61448ad6da3ef0f9cb03f40c5be655
has to be line by line
cases like (1)
0
af2d577b9db27230b6999c216e985a76
d0c046f1ea8eaebf422ececdf8c6eecb
创建一个消费者协程
print("Consumer start") pid = str(os.getpid()) create_obj(pid) game_dict = {} item = 0 while True: user = q.get() user = User(user) print("user get") game_dict = scrapy_user(user, game_dict, pid)
0
92e08ad920885471f976113d827c1e01
7a65e95d5d56ac649a140b057803d0d3
NewWaypoint creates a new waypoint
void NewWaypointInterMarker(InteractiveMarkerServer* inServer,string inName, geometry_msgs::Pose InPose) { visualization_msgs::InteractiveMarker wp_itr_marker; visualization_msgs::InteractiveMarkerControl wp_dis_ctrl; visualization_msgs::Marker wp_dis_marker; visualization_msgs::InteractiveMarkerControl...
1
93e486d89511d396fb30a7df5c713c26
0796171c5afc2ccebaf4962d54ec511f
Returns the number of words in the current dictionary and how many words have been processed. Only here for live testing purposes.
unsigned int size(void) { return dictionaryWords; }
1
03a027d167ca0ae45cfcb09fa32355f7
5c55ec6e4b4cd76adffc1eaf7646fb1a
Allow to group observables for group cancellation with [ObservableGroupManager method CancelGroupExecution]{@link ObservableGroupManager#CancelGroupExecution}
namespace SharpKit.Rx public static partial class Observable [JsMethod(NativeParams = true)] public static IObservable<TResult> when<TResult>(params Plan<TResult>[] plans) { return null; }
0
a271ead26cf1a65c1658392f9977e63c
a890400d0adeca66bfeca83a881bfa7c
展示回复血量或者复活界面
function ResurrectionDialog:show(killer_name) local win = UIManager:show_window("resurrection_dialog"); if ( win ) then if killer_name ~= nil then win.kill_title:setText(Lang.resurrection.model[1]..killer_name..Lang.resurrection.model[2]); end win.time:setText(Lang.resurrection.mode...
1
230386880f1893fc56b11fe834a1c4d9
4d20755105dcfd072d002a2b29d77398
https://kolibree.atlassian.net/wiki/spaces/SOF/pages/2755032/Brushings+file+format+V1
bool ImportK2Model::ParseHeader(GrDriver& driver, EFile* file, int blockSize) { int version = file->ReadInt(); E_VERIFY(version == 3, return false); _numMeshes = file->ReadInt(); _numSprites = file->ReadInt(); _numSurfaces = file->ReadInt(); _numBones = file->ReadInt(); _bbMin = file->ReadMVec3(); _bbMax = fi...
0
1df13ec3cd3e7e3c6c04c3e3007128cb
6613bfa35a347e794a29b2db3b374a19
Get BAM file names from an input file
headers = pysam.view('-H', bamfile) sampleName = re.search(r'SM:(.*)\n', headers, re.M|re.I).group(1) return sampleName
0
e2421947bf45025bc775948e0d408d26
e0c5a254e4ba8aa3979bdd3adf1b062c
check if there are any diagonal solutions (with a negative slope)
solution: number[] ): boolean { return (solution[0] * solution[1]) < 0 }
0
eea76b2c4bd631d0debe6a34ae54c927
508d0db72bf0d0367bbb0bcc330a0431
The total duration for all tests in this collection. Returns: int: The total duration for all tests in this collection.
class TestRecord(object): def duration(self): return self.__duration
0
b7f10193eb55de741bfca8fb6187999b
9c4755992fc069ed6e1de15bb6b2ae0e
Find out if current player is online, if so add an indicator
if ( socket.id === getCurrentPlayer().id ) { document.body.classList.add('myturn'); } else { document.body.classList.remove('myturn'); } }
0
19872f954ccb3d57a7e1edff0f2f9bf4
090c637368434d01229ad9e05d82d668
Returns the target tag URL.
{ if ($source = $this->getSource()) { return $source->Link($this->TagAction); } if ($source = $this->getDefaultSource()) { return $source->Link($this->TagAction); } return $this->TagAction; }
1
a7e534a62de2553df6255ffc0c0345ed
b667cb6d8df88b261d04a0b8189d8fcd
Grab images from the webcam and detect eye positions. Returns
cap = cv2.VideoCapture(self.path) detections = 0 self.x1_avg_face, self.x2_avg_face = 0, 0 self.y1_avg_face, self.y2_avg_face = 0, 0 self.x1_avg_landmark, self.x2_avg_landmark = 0, 0 self.y1_avg_landmark, self.y2_avg_landmark = 0, 0 self.x_max_landmark, self.y_max...
0
e41be1775f3279d8fcbdd1f37766a0a4
d9b960615e82a745991e196346367423
Returns if a field will only be highlighted if the query matched in this particular field
public class FieldDefinition public boolean isSelectOnly() { return selectOnly; }
0
05af24ffe517a42fbe92e9e10cf0f9df
127681ceb724adbcb037d51176c87a17
The precision of the readback PV, as reported by EPICS. Returns
class ChannelBox(UI_Object.UI): def get_precision(self): return self.query(precision=True)
1
f89703e565ee89c6cf4914d2b996864c
72d069103eef5c716a5b4c36e841edc0
Test of editAccount method, of class Database.
public void testEdit() throws Exception { System.out.println("edit"); ResponsableEntity responsableEntity = new ResponsableEntity(); responsableEntity.setNombre("responsable"); responsableEntity.setApodo("apodo"); responsableEntity.setEmail("responsable@mail.com"); re...
0
121fda45c285e16aef5b60d92cd81185
a06214cd7131880ca9b50fdefbbd5c23
Value of the parameter with the passed ``.``-delimited name (e.g., ``savefile.dpi``) in the external ``matplotlibrc`` file. If no such parameter exists, an exception is raised. Raises
class Element: def get(self, paramName): import revitron return revitron.Parameter(self.element, paramName).get()
0
977a8f3cfebfa56a39eab4c162d704d4
9b562ae3c4f06e3edca038e8a005d79b
Funcion recursiva que inserta y organiza bajo las condiciones AVL los nodos del arbol.
string ident = loc->getCityName(); if (ident < test->getIdent()) { test->plusCL(); if (test->getBalance() < -1 || test->getBalance() > 1) { balancePoint = test; childOne = L; } if (test->getLeft() != NULL ) reAddNode(loc, test->getLeft()); else { Node* node = new Node(loc); node->setIdent(i...
1
0e5df5a7b3db5ed26f053db8bc0795b7
ffc586847908b2cbedeb485fa9176278
Test if the Windows terminal API is available.
{ return DIRECTORY_SEPARATOR === '\\' ? getenv('ANSICON') !== false || getenv('ConEmuANSI') === 'ON' : function_exists('posix_isatty') && @posix_isatty(STDOUT); }
1
c9d7351edfb41f839fad4e02a1eb978c
06255309dcf6aa52431149d900e27085
istantaneous tangent angle of the trajectory
n = cross(self._tps(2) - self._tps(0), self._tps(1) - self._tps(0)) if normalize: n = norm(n) if not right_hand: n *= -1 return n
0
521256bb3f8fbee9df0766254aeaa785
08968f2d4692bf3f04f071e79a654aaf
Envento acionado ao clicar no botão "Editar" Habilita os campos para edição, nete momento.
let inforItems = document.querySelectorAll(`.info`); inforItems.forEach((info) => { info.removeAttribute(`disabled`); }); let btnEditar = document.querySelector(`.editar`); btnEditar.setAttribute(`value`, `Aplicar alterações`); btnEditar.setAttribute(`onClick`, `document.querySelector(...
1
3fe7bdd416b7cf9c5dbb093aa3442e28
7d4707e1d353209c47085a8eed8d9e4c
读取节点文件 格式 : node_id label
public class FastModularityOptimizationNew public void read_from_file(String path) { List<String> lines = FileEncodeUtil.read(path); for (String line : lines) { String[] str = line.split(" "); int node1 = Integer.parseInt(str[0]); int node2 = Integer.parseInt(str[1]); int w = Integer.parseInt(str[2]); ...
0
18c03699bac471b52ef09ddb0952c55a
f28fa6f64fcc4a61639d7ae342ffe2f3
filter out the pixels with the highest value
class CylinderDetector void thresholdFilter(std::vector<cv::Point> &points, cv::Mat &accumulator) { int accum_x; int accum_y; std::vector<int> to_remove; for (int i = 0; i < points.size(); ++i) { imageToAccumulator(points.at(i).x, points.at(i).y, accum_x, accum_y); ...
0
342fe36aae68c7c15bf6fa843c660525
732cfe076d7b699ef98186095ff521c0
Deleting model 'NYCMImage'
class ImageTestCase(TestCase): def tearDown(self): self.obj.delete()
0
91fe16dd3e2dd4d0eee7769eebb3f994
7454c834c16bffc327cd9fc32d174012
从文件中获取获取银行代码
{ $data = DB::table('co_bank_code')->select(); if($data){ $this->result($data,1,'获取成功'); }else{ $this->result('',0,'获取失败'); } }
0
93bc53d370b5d5dbbb808f93a64000de
d39ddb3a5369c14e6a8c4d62f3133db0
從sqlite載入朋友名單
public class FriendListActivity extends AppCompatActivity public void loadNAME(){ joinDatabase.child("users").addValueEventListener(new ValueEventListener() { @Override public void onDataChange(@NonNull DataSnapshot dataSnapshot) { if (dataSnapshot.getChildrenCount() != 0...
0
9faf3b4a9d35a151134d4a73bd1f78ed
93d29c21d336f84fa19b3be994a69d40
Shows all borrowed books for staff.
{ if (!isStaff()) return new HttpStatusCodeResult(HttpStatusCode.BadRequest); var tblBorrows = db.tblBorrows.Include(t => t.tblAccount).Include(t => t.tblBookDetail).Where(t => t.IsEnd.Equals(false)); return View(tblBorrows.ToList()); }
1
60628505de8267080a345a4e35d0f6b6
87d7736cdd4b67bea55d2a15e8b91bd4
Get All the BenefitPlanSizeClassificationTypes from the repository
namespace Insurance.Policy.Api.Services public class CoverageTypeService : ICoverageTypeService public List<CoverageType> GetAll() { return this.coverageTypeRepository.GetAll(); }
0
1a1e505e9cef8ee4891d22e95bd59fb2
2054d767f174e4d71bc6a024149c1619
delegate to the ScrollBarSkin.
public class PinkThemeWidgetFactory implements WidgetFactory @Override public ScrollBar createScrollBar() { return new PinkThemeScrollBar(); }
0
80d05af4e0cc1b1e50446949d1651dfe
e676f633b1cd40c91ec4b522434599e5
Searches for transmitter using a predicted path of its movement
{ AreaObject transit = null; int current = 1; transit = findNode(AreaObject.generateId(Config.TRANSIT_PREFIX, current)); while (transit != null) { if (Generator.determineObjectPosition(transit, true) == territory) { return transit; } ...
0
5bee3cf0fd22e9e3774ad2f38afd6d5b
33773e37a6ae4067b0c3b7edf79a3b04
计算灰度直方图,并归一化
w,h = grayArray.shape hist = {} for k in range(nums): hist[k] = 0 for i in range(w): for j in range(h): if(hist.get(grayArray[i][j]) is None): hist[grayArray[i][j]] = 0 hist[grayArray[i][j]] += 1 n = w*h for key in hist.keys(): hist...
1
1f95940a81f7fd30994939e8ae3ddb28
b6719d26f7692f1892ab2649bada9ae4
<para>Returns the (computed) value of the property userData.</para>
public //#endif final class cmsxform public static Object _cmsGetTransformUserData(_cmsTRANSFORM CMMcargo) { lcms2_internal._cmsAssert(CMMcargo != null, "CMMcargo != null"); return CMMcargo.UserData; }
1
20bbb52681db9a61feb010b44a761fb2
43cfed97e9d6ef2c04e148c8d984e22c
Execute a test iteration (called repeatedly for each testing iteration).
class LipschitzTester(object): def execute(self, interface): while not rospy.is_shutdown() and not self.finished(): print 'Round %d/%d...' % (len(self.rounds) + 1, self.num_tests) x_center, x_tests = self.get_next_inputs() print 'Evaluating %d inputs centered at %s...' % (len...
1
48b3418b1b858f3ca842c05f2ab36c3e
7ffdf1289da71330b56e06e0a4ddd554
Encodes the given URI port.
if (encode) { UriPctCoder uriPctCoder; return uriPctCoder.encode(recompose()); } return recompose(); }
0
995aaf424e096befd0636d0095372ded
0de9fc436b1fedc0daee0bb03e718067
Populate a transmit ring buffer and start UART transmit
{ uint32_t ret; uint8_t *p8 = (uint8_t *) data; Chip_UART_IntDisable(pUART, UART_IER_THREINT); ret = RingBuffer_InsertMult(pRB, p8, bytes); Chip_UART_TXIntHandlerRB(pUART, pRB); ret += RingBuffer_InsertMult(pRB, (p8 + ret), (bytes - ret)); Chip_UART_IntEnable(pUART, UART_IER_THREINT); return ret; }
1
695ab270b02501388bf576edb6503a0d
238302a056d47aea62e3fa27e16c7622
选择购买结束日期
class Common(Action): def choose_endtime(self, key): driver = self.conf.driver driver.implicitly_wait(10) xpath = LC.COMMON[key] endtime = WebDriverWait(driver, 10).until(lambda x: x.find_element_by_xpath(xpath=xpath)) time.sleep(2) endtime.click() time.sleep(2) ...
1
9dc92d60ba553a297a36a64b7d42b338
6122d9a186808851e5c871ae79ae6d3b
Show all categories and the items for the selected category
categories = dao_category.get_all_categories() category_items = dao_category.get_category_items(category_name) items_quantity = len(category_items) return render_template('showitem.html', categories=categories, category_name=category_name, ...
1
c038ca345763b1e19f1e8615aee43c7d
74ab346cad3e934e2aa00ce08d806e23
Devuelve el nivel del jugador.
class Player(pygame.sprite.Sprite): def getLevel(self): return self.level
1
d4333a76aa716093f01c844b0a706362
367dd359dc108a7f86a32f0ab1567e5e
Retrieve tables that food has been cooked for
def view_cooked(app_session): print(bcolors.BOLD + bcolors.UNDERLINE + "View Cooked Recipes" + bcolors.ENDC) cooked = app_session.session.query(Recipe.name, CookedBy.scale, CookedBy.cook_date, CookedBy.rating) \ .filter(CookedBy.user_id == app_session.user.id) \ .filter(Recipe.id == CookedBy.rec...
1
2e8b5ba980165dfe3bb2ff489085ac2e
6571047ed7b3c403e95aa6d6d3c9190f
LastUpdate reports the time when the files database was last modified.
{ try { return File.GetLastWriteTimeUtc(DBPath) != CurrentFileOldLastModified; } catch (Exception ex) { userMessage += ex.Message; } return false; }
1
f634f335a6fd9773268fa231ff15db9a
92f802de0eec9ff7112032477f5c3ab0
Linked list add to front - returns the head of the list
class SLL addNodeToFront(val) { var newNode = new SLLNode(val); newNode.next = this.head; this.head = newNode; }
0
18b8ae3024bc7d9b58472bd30ae5cc70
9ef6377b74db6d531aebf4c1175be16a
The function to run Unix commands inside Python.
def RunCommand(*cmd, **kwargs): cmd = list(cmd) input_string = kwargs.get('input', None) cwd = kwargs.get('cwd', None) stdin_type = None if input_string: stdin_type = subprocess.PIPE logger.info('Running: %s', cmd) p = subprocess.Popen( cmd, stdin=stdin_type, stdout=subprocess.PIPE, ...
1
8e26f9ded93b5eaf82568eb0bbe604f9
2fe9a4450c8343749a0df15751a43060
Método responsavel por buscar do serviço as imagens relacionadas a um chamado
export class NewCalledComponent implements OnInit private getImagesByCalledId(id: number): void { this._calledService.getImagesById(id) .subscribe((images: Array<string>) => { this.receivedImagens = new Array<string>(); this.receivedImagens = images; }, error => { if (error.statu...
1
7a961d0577ca66769cc9ae07b6377953
85afd93fb654b52c01b8fd890f984ec0
通过专业ID,获取专业信息
Profession infoProfession(String professionId);
1
55c11dbdd3c6634343bf86c428e9fe35
b656b110b7b73866f57ac034f88ddb6e
This function provides an audited zread capability It performs a similar function to zread, in that it will pad "invalid" pages. The main difference is that it allows us to collect auditing information about which pages were actually present and which ones were padded.
{ struct vm_region *vmr, vmr_copy; unsigned long nr_pgs_this_vmr; unsigned long nr_filled = 0; struct page *page; int pte_prot; spin_lock(&p->vmr_lock); while (nr_pgs) { vmr = find_vmr(p, va); if (!vmr) break; if (vmr->vm_prot == PROT_NONE) break; pte_prot = (vmr->vm_prot & PROT_WRITE) ? PTE_USER_R...
0
b5a476b90aa1a4f93db623e0a2b02f2a
55d36f41b3045c30a369a8e5d2785ca1
按照給定的怪物類型激活怪物 停止所有協成 將當前激活狀態的怪物 (如果有的話) 轉變為未激活狀態 激活給定的類型的怪物 調用死亡時間的協成
{ StopAllCoroutines(); if (activeMonster != null) { activeMonster.SetActive(false); activeMonster.GetComponent<Collider>().enabled = false; activeMonster = null; } activeMonster = monsterArray[type]; activeMonster.SetActive(true); ...
1
ec1778e53cce341a32d8d6d030b7b0bc
03e1a5b7dcb613350a72cf5644f9f5f8
Read two numbers and print their sum
{ string[] result = new string[2]; Read.ReadNumberFromConsoleAsString("Input number a:", out result[0]); Read.ReadNumberFromConsoleAsString("Input number b:", out result[1]); Console.WriteLine($"{result[0]} {result[1]}"); }
0
76ebc7c199130a62e89d6aa98edf6419
284cab670a1e58397c87ededf9079565
Predicts the opponent's next move based on the pattern of last played moves.
opponent_class = None if selfmoves == []: return C if len(selfmoves) < 6: return D if othermoves[-1] == D else C if len(selfmoves) % 6 == 0: if othermoves[-6:] == [C] * 6: opponent_class = "COOP" print("COOP") print(othermoves[-6:]) if ...
1
bf45066c0ff6925df919cef572a0f2d7
5f82c045c3ecd93c866706baeb3b002e
修改事件监听的回调函数和掩码 当$read_callback不为null时,将修改可读事件回调函数为指定的函数 当$write_callback不为null时,将修改可写事件回调函数为指定的函数 $flag可关闭/开启,可写和可读事件的监听
function swoole_event_add($fd, $cb_read, $cb_write, $event_flag){ }
1
a6aec3362983fb48b884462b2591acca
4077df34b9dc9f8336e9f5a9e8d59356
returns feature list of how many times the gradient changes sign
feature_grad = get_gradient(feature_list) changes_sign_list = [] for i in feature_grad: transposed = np.transpose(i) changes_sign = [] for j in range(len(transposed)): count=0 for k in range(1,len(transposed[j])): if (transposed[j][k]>0 and tra...
1
8494e03405387ac61e8ecb1cabffb9bd
d95c17aa144524c7d6ea1088dc3059f7
Override save. Updates the total price by multiplying the product quantity and it's price.
{ $quantity = $this->measure ? (float) $this->quantity : $this->quantity; $cart_quantity = $this->measure ? (float) $this->cart_quantity : $this->cart_quantity; $this->merge([ "price" => (float) $this->price, "quantity" => $quantity, "cart_quantity" => $ca...
0