query_id
string
corpus_id
string
query
string
code
string
label
int64
0988bee496153115d814a4f12e8835d6
108be008e42cb03e5909b884bc31bdec
This function destroys a previously created Tensor descriptor object.
{ if(tens_op == NULL) return TALSH_INVALID_ARGS; int errc = talshTensorOpDestruct(tens_op); free(tens_op); return errc; }
1
2310045a73cf98f3260825ce7f939eec
73d477dca6c20d8e6541635ccbdafd9e
Day 7: Amplification Circuit
namespace AoC2019 public class Day07 : ISolution public string PartOne(string[] lines) { var source = new CPU(lines[0]); const int permutations = 120; return Enumerable.Range(0, permutations).Max(seed => new AmplifierSeries(source, seed).RunAll()).ToString(); }
1
2b0bb0612efbaef3a7f18926f61615fd
c229793eaec50bceb272cdedba4a0110
Add only if namespace doesn't already exist
class Autoloader public function add_namespace( $namespace, $path ) { if( ! array_key_exists( $namespace, $this->_namespaces ) ) { $this->_namespaces[ $namespace ] = $path; } }
1
19ebde878da344ec26c5700708f0d96a
2dbe08d80bc22676c1518415577bed58
XDeleteView deletes a view on scopeDb and manager db in a transactional manner. Access rights are removed along.
func XDeleteView(scopeDb *gorm.DB, viewEntry *T_scope_view) error { errTx := managerDb.Transaction(func(txManagerDb *gorm.DB) error { return scopeDb.Transaction(func(txScopeDb *gorm.DB) error { return xDeleteView(txScopeDb, txManagerDb, viewEntry.ScanScope.DbName, viewEntry) }) }) return errTx }
1
23c4be5bd39126b8cdfe488e643c9933
333e5e20242e5729b312f61c57d3f667
Go to member page
public partial class Login2 : System.Web.UI.Page protected void LinkButton4_Click1(object sender, EventArgs e) { Response.Redirect("EC08Member.aspx"); }
1
db273c77643a98b7e9d406502ed8beb5
c0bee297ed235d142617b404836e27c2
HttpResponseImplの各プロパティを設定、取得するテスト。 <p> 条件: <ul> <li>HttpResponseImplインスタンスを生成する</li> <li>各getterメソッドを実行</li> </ul> 確認: <ul> <li>正常終了。設定した値が正しく取得できることを確認</li> </ul>
public class FlightDataResultDtoTest @Test public void testGettersAndSetters() { FlightDataDto testFligthDto = new FlightDataDto(AirportIATACode.AMS, AirportIATACode.BCN, "IB2818", 120); FlightDataResultDto testDto = new FlightDataResultDto(testFligthDto, 200); FlightDataDto testFligth2Dto = new F...
0
6e4b0edca79079a31510a32bfdde18b2
6baa128a6705d192a3bb325f41102553
手札操作状態処理----------------------------------------------------------------------
public class MainPhase : Phase void HandCardTouch( ) { _handCard = _rayShooter.RayCastHandCard( _turnPlayer.gameObject.tag ); if ( _handCard == null ) return; _handCardPos = _handCard.transform.position; _handCard.gameObject.GetComponent< BoxCollider2D >( ).enabled = false; _handCard.CardExpansion( ); _mai...
1
5704827ce369b50692f96258ff0c93e4
163dbdde752149ae7f8a3b53e5630725
Construct a paddle for the player on the blue side.
AIPaddle::AIPaddle(){ rect.setSize(sf::Vector2f(10, PADDLESIZE)); rect.setFillColor(sf::Color(0,0,0)); rect.setPosition(750,250); }
0
401200f6e8710a4b30aab926eacb12ee
674b846f81529077a51b1c9dacea3abc
珠宝首饰搜索功能
{ $res = array(); $args = func_get_args(); $args = $this->decodeArguments($args); $logindata = $this->parseRequestUserHandle($args ['visa']); if (!$logindata) { throw new Exception ($this->RES_CODE_TYPE ['USER_VISA_PARSE_ERR']); } $DatasInf...
1
064c318a696a0a38348a1dcc9ec59eec
fccdd1949617bf90fe571cc417212b4b
Vrací objekty patřící spolenosti daného uživatele.
class sprava_uzivatelu extends ds1_base_model public function getDbObjektyPrideleniByIdRole($role_id){ $where_array = array(); $where_array[] = $this->DBHelperGetWhereItem("uzivatelske_role_id", $role_id); $objekty_prideleni = $this->DBSelectAll(TABLE_UZIVATELSKE_ROLE_DB_OBJEKTY, "*", $where_arr...
0
d1d07a2b4f4863576e7e42e4a07ccdd3
16fe1e97f0b6e9011de3e0a16f7331e1
向MainActivity发送结束定时指令
public class MainActivity extends FragmentActivity public void requestEnd() { Intent intent = new Intent(); intent.setAction(HiDataValue.ACTION_CAMERA_INIT_END); sendBroadcast(intent); }
0
98d1169d2e56d7edc7d2276b4975e6fb
420891233ea9a69483064b35346f8e90
Translates x and y values from a system that has the origin in the top left, to one that has the origin in the middle of the screen.
public class Canvas extends JPanel private Point inverseTransform(int initialX, int initialY) { return new Point( (int) (initialX + (initialY / Math.sqrt(3.0))), (int) (2 * initialY / Math.sqrt(3.0)) ); }
0
4191ef0824d60455836fa3a4cdf9cac5
79c5a838ee331f72571dd68e287cb147
随访记录查询(没分页) by huixian.pan
@ResponseBody public String query(HttpServletRequest request,@RequestParam(required=false) String data){ JSONObject jsonObject =JSONUtil.parseObject(data); int patientId = jsonObject.getIntValue("patientId"); List<Followup> followupList = followupService.queryPList(patientId); FollowupResponse response = new ...
1
5919dacd325c7cfedc40e556f60a0a79
78bdc491a271b83aa07f0c16a5687720
Retorna o tamanho da embarcação
class BaseBoardModel public function getBattleShipsSize() { return self::SIZE_BATTLESHIPS; }
1
1307edab951491611a680bc07be7e0a0
cb1ab0ba97624c5d1ce6575915aa87d2
Make the robot turn left at full speed
void turnLeft(struct DC_motor *mL, struct DC_motor *mR, unsigned char power) { mL->direction=1; mR->direction=0; fullSpeed(mL, mR, power); }
1
e2abcb975896af5c464e24d06a9857fb
326d4442e16ff2471d2eada5198e91a9
Creates a <see cref="Vector3"/>-typed face attributes collection, allocating an array suitable for the given number of faces.
namespace MakeIt.Tile public static class VertexAttributeUtility public static IVertexAttribute<Vector3> CalculateVertexNormalsFromFacePositions(Topology.VerticesIndexer vertices, IFaceAttribute<Vector3> facePositions) { return CalculateVertexNormalsFromFacePositions(vertices, facePositions, new Vector3[vertices....
0
d69c9e8fba5720dde4cd2e280ac544ce
2507e9c41e3a9e1e1b5a3278d45c7e94
Permet d'obtenir la position initiale de Pacman dans la Grille à l'instant 0 d'un niveau
public class Pacman extends Entité public static int getDefaultPositionX() { return DEFAULT_POSITION_X; }
1
5ffaad494608f0b29dd6068261175b0a
c4dcd1d3b8440b8f0e90d4698e9f336b
Method to set voltage at 5V
public int output5V();
0
78cf0574d326d2f1a5c243e5e8768585
6955da74be4f3a1a30c2915f640fc29b
Listens document scroll changes in order to capture the possible lock scroll position for history scrolling.
scrollLock += 1 if (scrollLock === 1) { scrollLockPos = {left: jqLite.scrollLeft(win), top: jqLite.scrollTop(win)}; jqLite.addClass(doc.body, scrollLockCls); win.scrollTo(scrollLockPos.left, scrollLockPos.top); } }
0
573263da1578fd6a1dd62a0be93c48bc
bbf6cd75b22e97d8879996ce18c4481a
游戏首冲列表
class DKApiController extends Controller public function dk_game_list() { $data = DB::table('dk_game_list')->Paginate(15); return view('admin.dk.dk_game_list',compact('data')); }
0
1a209b9a2aaed0244927bb5dec81f280
dd9c5fcb3c967a2ed84e2726b9146343
Display list of login data.
{ $items = Login::all(); return view('pages.admin.activity-login.index', [ 'items' => $items, ]); }
1
d97430fae85418679b06532b1cba8555
34719c594c3b0b3934070f8888143a20
API测试: 修改资产设备API接口测试
def test_equipment_update(id, instoragedate, model, no, organizationid, sim, type): start_time = time.time() MysqlClent.update(MysqlClent.get_conn(), 't_rap', 'is_exe = "Y"', 'id = 125') requesturl = baseUrl + "/equipment/update" LOGGER.info("新增设备/编辑设备请求地址:【{}】".format(requesturl)) params = dict() ...
1
cad5ede46bd63d35ee7d274b8383aac8
d9bcb59d3f92cf40c5fca356018a1c4d
使用可读字符串(例如"c4" or "pass")的着子方便方法,
if mv == "PASS" { Some(Move::Pass) } else { let mut chars = mv.chars(); if let Some(c1) = chars.next() { if let Some(c2) = chars.next() { let x = (c1 as u8) - 0x41; let y = (c2 as u8) - 0x31; if x <= 7 && y <= 7 { ...
1
3e963d5e746c84e825947f770b4680b7
1bede31365cc6e68773b27bb693dbe5b
Establece el Paquete de Navegacion para el Detalle del Contrato Seleccionado
namespace BPMO.SDNI.Contratos.Mantto.VIS void LimpiarPaqueteNavegacion(string key);
0
ec0569c9c5422c57a03a332720994302
9836ae9ab5b57e7d01d9cb969473ccce
(f) arm interrupt on PE1,2
void EdgeCounter_Init(void) { GPIO_PORTE_IS_R &= ~0x03; GPIO_PORTE_IBE_R &= 0x03; GPIO_PORTE_ICR_R = 0x03; GPIO_PORTE_IM_R |= 0x03; NVIC_PRI1_R = (NVIC_PRI1_R&0xFFFFFF00)|0x00000040; GPIO_PORTA_IS_R &= ~0x20; GPIO_PORTA_IBE_R &= ~0x20; GPIO_PORT...
1
5ac44f076c6e253c6b0d321f9e5d1e37
7f295f413585c5ff2d9cef93b7ca343d
Rebuilds and updates the 3D palette based on the current world palette.
Textures[1] = tilePalette.PaletteImage; Textures[2] = entityPalette.PaletteImage; if (tilePaletteLerp != null) Textures[3] = tilePaletteLerp?.PaletteImage; else Textures[3] = tilePalette.PaletteImage; if (entityPaletteLerp != null) Textures[4] = entityPaletteLerp.PaletteImage; else Tex...
0
f18822475de6505c2d193251b5eb2c8b
6dcf704ff735b4ddeeb35cb64eaef57f
Compares length measure of two paths. <p>This can be a distance or a potential. For the latter small potential means long distance.
function pathLength(pathToMeasure: IPath): number { if (pathToMeasure) { var fn = pathLengthMap[pathToMeasure.type]; if (fn) { return fn(pathToMeasure); } } return 0; }
0
f1fe5fb42ce256dbfde87246a8764b67
700e4486abb31f43cb072a3196a445c5
获取内容区域中心坐标
namespace EarthView namespace World namespace Spatial3D namespace SystemUI public class RegionAreaTool : EarthView.World.Spatial.SystemUI.Itool public EarthView.World.Spatial.Math.Vector2 GetCenterPosition() { IntPtr __ptr = EarthView_World_Spatial3D_SystemUI_CRegionAreaTool_getCenterPosition_CVect...
1
a2ca7288a1081672eac508bb40457d78
9020d0c02ba08775c3cfd85b7b967b16
If grayscale
if (src.spectrum() == 1) { return src; } CImg<unsigned char> gray(src.width(), src.height(), src.depth(), 1, 0); cimg_forXY(src, x, y){ gray(x, y) = 0.299*(float)src(x, y, 0)+0.587*(float)src(x, y, 1)+0.114*(float)src(x, y, 2); } return gray; }
1
07b6f1736ffcdbb93f6554ddd9dfc6b7
992679fc6d9dce68085c6e271877f28e
设置贷款单月最高逾期总额
@Table(name = "s_bounty") public class SBounty public void setLoanMaxRate(BigDecimal loanMaxRate) { this.loanMaxRate = loanMaxRate; }
0
c02f4934b86e48787151ade7736d7181
4b2d8bd854adaca287bd500bbb8a1eab
Declare a strided array memory.
if isinstance(shape, collections.Iterable): suffix = ('[%i]' * len(shape)) % tuple(shape) else: suffix = '[%i]' % (shape,) return self.ffi.new(self.ffi.getctype(self.cname + suffix))
0
ca79ad5ebfd67df22ef95ac9187255cd
c0c1ac08006dd1fae17036b73b64040d
@brief construct a light sensor
Light::Light(NetInterface *net, uint16_t light_pin) :IoTgo(net) { this->light_pin = light_pin; pinMode(this->light_pin, OUTPUT); }
0
ebd893f828bb7f23306158c392e614e9
508ad4ca1c0381ddefff9ec51cfe96af
回归树叶节点生成函数
float PMTree::generateLeaves(int level, mat4 modelMat, int leaves_per_branch, float interval) { float total_rot = 0.0f; float z = interval; modelMat = translate(modelMat, vec3(0, 0, z)); for (int s = 0; s < leaves_per_branch; ++s) { mat4 modelMat2 = rotate(modelMat, deg2rad(genRand(nDownAngle[level], nDownAngleV[...
1
e38c4b8f81b2b302f6fc0236f5372fa1
0de65d4f9ad1b47d340057de908a84b1
Plots the historical series and the projections.
identifier = name.lower().replace(' ', '').replace('-', '') projections = projection.get_data_station(identifier, start_year, end_year) data = location_data.find_closest_weather_stations(HOSPITAL_DATA_WITH_LOCATIONS, WEATHER_STATIONS_DIRECTORY) hist...
1
f2944f1d2207c3e130411a0a8ca8f6cb
9f95a3c88ec3dc4027279f59f3e7ce5d
Sets the receiver gain for the ambient light sensor (ALS). Value Gain 0 1x 1 4x 2 16x 3 64x
@SuppressWarnings({"UnusedDeclaration", "UnusedAssignment"}) public class YBridgeControl extends YFunction public int get_adGain() throws YAPI_Exception { int res; synchronized (this) { if (_cacheExpiration <= YAPIContext.GetTickCount()) { if (load(YAPI.DefaultCacheValidi...
0
e28bf39f392a3b823b4822d9aa147aec
08cb1db932993527dc2ff37e769105a2
Display text with blank line above and below
void printTextNL(char *string) { printRow(string, 0, 80); pos_y++; pos_x = 0; if (pos_y>=25) {pos_y = 0;} }
0
eb4253585f528ba3ef8a2e851214dc4f
03cd023b36f403d971891905b42ec6aa
根据当前选择的皮肤定位content位置
public class StartActivity extends SkinActivity public void skinLocal(View view) { startActivity(new Intent(this,SkinLocalActivity.class)); }
0
6dda36aae907ecce0585e6b2563cf949
64ca788279e4b588b3d4aa425ce7812b
Activate all breakpoints.
install_all_breakpoints(xp) target_t *xp; { breakpoint_t *bp; for (bp = Bphead.bp_next; bp != &Bphead; bp = bp->bp_next) { if (bp->bp_xp == 0) install_breakpoint(bp, xp); } return 0; }
1
b5bb7f297aac7ca704fa34792cc24d00
5ac8557de2654babb627908f34f01145
结束条件:path中有k个数
void getSumEqualsKPathInBinaryTree(BinaryTreeNode * root,int sum,int k) { if(NULL == root) return ; sum = sum + (root -> data); if(root->lchild != NULL && root->rchild != NULL) { if((root -> lchild -> number) < (root -> rchild -> number)) { getSumEqualsKPathInBinaryTree(root -> l...
0
3a585c230aa86948285d8ea54c8df5df
b630782c8366aefe3fe114bfc249df50
层级遍历整树(非递归)
int levev_tree(tree_t * root) { tree_t * queue[10]; int head = 0; int tail = 0; tree_t * temp; queue[tail++] = root; while(head != tail) { temp = queue[head++]; printf("%d ", temp->data); if(temp->lchild != NULL) { queue[tail++] = temp->lchild; } if(temp->rchild != NULL) { queue[tail++] = tem...
1
c2cae2d23ac5c919372b5e0f002c462f
11da6bb269718f61339124f5edd2e56e
获取表单中子列表的数据(手机专用)
function getSubmitDataListofCommonTable(tableKey, flId, acId, readFlag){ var tempList = getTableAllTRTDData(tableKey); var dataList = new Array(); $.each(tempList,function(index,item){ var participant = new Object(); participant.flId = flId; if(readFlag==true){ participant.type = 3; }else{ participant....
0
2e0ce87f3e42ef52cefb36d1c83dc91a
7a0e0979e2bc12954fa568e00d3496a2
Sets workerName
public class RetrievalPlanSearchKey extends AbstractSQLSearchKey public void setWorkerName(String arg[]) throws ReadWriteException { setValue(_Prefix + RetrievalPlan.WORKERNAME.toString(), arg); }
1
bde8b03b3d8e3c8f8623ddbfb552c3d5
bad981069d6e6dce6fbec60947383c51
留言页面的路由
@Controller @RequestMapping("/user/center") @Validated public class UserCenterController @GetMapping("/message") public String messagePage() { return "front/user/message"; }
1
a36bbc8144ea43d75cdf37b47b172708
918be04f1f06606e7162061fa6aa6e9f
InitGithub initializes the github templates service with the given config
func NewHelpers(a *config.AppConfig) { app = a }
0
4c22405e6ff86e2d8543d2f6fa5c5356
0b5ae1906ebedab39438ff5b6c09c57c
动画默认不导出Scale序列帧,除非该节点包含scale关键词(加scale关键词表示该节点需要进行scale变换)
namespace EarthView namespace World namespace Spatial2D namespace Display public class LayerLabelProperty : EarthView.World.Spatial.Display.Ilabelproperty public new bool IgnoreScale_NoVirtual() { byte ret=EarthView_World_Spatial2D_Display_CLayerLabelProperty_ignoreScale_ev_bool_NoVirtual(this.Nati...
0
0040c1a2fd3b934add3d3c6729691cdc
9f12d675738a5fbdf3bb1c1529dc9c87
判断d3是否在d1和d2之间
public class DateUtil public static boolean isBetweenDate(Date d, Date from, Date to) { return (DateUtil.afterDate(d, from) && DateUtil.beforeDate(d, to)) || (isSameDate(d, from) || isSameDate(d, to)); }
1
25405478556401668541d57f98c1d695
7ef7cbea4f0897c13e1880ea1a95d60d
Get all direct child organizational units under a parent organizational unit. This only provides immediate children, not all children.
namespace OnBalance.Models public class OrganizationRepository : BaseRepository public IList<Organization> GetByParentId(int parentId) { return GetByParentId(parentId, false); }
1
e48b90d2c692577cf6a831e72d2815a2
36add9864beccb7a2febed9cdbc4d098
完成某个合同及其所有子项,添加药品入库
try { if(gjMapper.updateStatusToFinish(gj.getLsh())!=1){ throw new MallfeException(ExceptionEnum.BILL_STATUS_ERROR); } for(GjDetail mx: gj.getList()){ Kucn kc = new Kucn(); kc.setHh(mx.getHh()); kc.setLx(gj.getLx...
1
a96b05aa129a47a0da77a73c7981376c
3c1ba0e0b7555fe7475c8241b98eb445
오늘 날짜에 특정 일을 더하거나 뺀 결과를 지정한 형식으로 반환한다.
public class DateUtils public static String calendarAddToString(Date date, int field, int amount, String formatStr) { Calendar c = Calendar.getInstance(); c.setTime(date); c.add(field, amount); return dateToDateString(c.getTime(), formatStr); }
1
409473d00fa2c12935cef93f636163a6
13b42cbf2b110fc0abf6aa4ddb69e2af
Set BOM Product. Bill of Material Component Product
public class X_M_BOMProduct extends PO public void setM_BOMAlternative_ID(int M_BOMAlternative_ID) { if (M_BOMAlternative_ID <= 0) set_Value("M_BOMAlternative_ID", null); else set_Value("M_BOMAlternative_ID", new Integer(M_BOMAlternative_ID)); }
1
8c62fb9f860d69a5dbbf1a9fa44f44da
68bc430fe6a34601ab85f1500fcb6a64
停止录音并存储至文件
public class AudioRecordImpl implements ISoundRecorder public void doStopRecord() { String currentFilePath = mAudioRecordFile.getAbsolutePath(); copyWaveFile(currentFilePath, currentFilePath.replace(".pcm", ".wav")); isRecording = false; audioRecord.stop(); audioRecord.release();...
1
ea15511e0258a0d4b1e4f5e0e725258c
89432e0d4baa2bfc9cba7ceeb8a8f9ac
Mark the current PDU as running.
class pulseblaster_no_dds(DeviceTab): # Capabilities def start_run(self, notify_queue): self.statemachine_timeout_remove(self.status_monitor) self.start() self.statemachine_timeout_add(100,self.status_monitor,notify_queue)
0
5448f0d2b3b90fba393e1a3ce1749588
180cf459dffaa54b93839c810e7b0e49
Validate that SSL Capabilities are available.
class SpamCaptcher private function is_ssl_capable(){ return defined('OPENSSL_VERSION_NUMBER') && is_numeric(OPENSSL_VERSION_NUMBER); }
1
98a0a4a3215891d2f741731974e3b05d
0ed7b463e8321d5c6ef5fafec2fc7960
cancel all timed events including global events.
namespace ZeldaWpf.Util public class ContinuousEvents public static void GlobalCancelAll() { foreach (ContinuousEvent timer in globalTimers.ToArray()) { timer.Cancel(); } }
1
73d2974fa2d5780f1a095d46275e6cd0
a8faecb8af9142abed5328386c37672f
Tests the findAndHoldSeats function of the ticket service
namespace TicketService.Contracts.Interfaces SeatHold FindAndHoldSeats(int numSeats, string customerEmail);
0
01d9cea6d341959df4aff431914b7044
9a4ca131cd09e0a484d4f7e59c03f493
Determine whether an attribute should be cast to a enum.
def enum_attr?(name) return false unless @enum_attrs @enum_attrs.key?(name) end
1
fd005b947a6de5edf795a937ec69166c
b342a7d24f61edd2f175e400b60d2092
Set whether line folding should be used (lines exceeding $maxLineLength will be continued on the next line).
class LogContains extends ProjectComponent implements Condition public function setMergeLines(bool $b) { $this->mergeLines = $b; }
0
e56814d2be8ab7a58c71600646f3ef8d
01048edb6b468ce14efd8a5648c2862d
skips to end of timeline
void skipToEnd();
1
b4de65ca1d4ec607f9f5cc9f925a5b1b
605dea4975d500559cc852b403011268
Sets every variable for the player back to level one. This should only be called when the player has just been created.
MapGenerator.Level = 0; hasSaved = false; playerData.hasSaved = hasSaved; playerData.normalDifficulty = normalDifficulty; PlayerStats.Health = 2; PlayerTopDownController.speed = 4.0f; PlayerTopDownController.maxHealth = 6; PlayerTopDownController.critChanc...
1
be8c8767132682fc5fa6be90baa356ee
f8d482bf23806bae54f2811ba044255e
Method to get a single row by the MongoId
{ var filter = Builders<T>.Filter.Eq("_id", ObjectId.Parse(id)); var result = await this.dataCollection.FindOneAsync(filter); return result; }
1
aee1fac5a4ff577105a02c9d01986d57
1058de0b98f33210e3ce19f5f57ef06d
Load exports and imports from LC_DYSYMTAB
sp, sp_symmap = [], [] sp_sorting = specifics['l2sort'] for k in sp_sorting: v = specifics[k] module, external_sym = v.split(':',1) symmap = {} if(module == '__HERE__' or module == '__PRIV__'): target_ast = ast else: mfile = path.join(ast_dir, ...
0
b379241a3a46c098011e3604e0f90190
12a1911739e488b34a795095c20502f6
Ordena uma lista de arestas em ordem crescente de peso
def sort(list): return sorted(list,key=lambda Node:Node.weight)
1
2658a1a3672a96f3eb69bcdad2b1b0d7
8cbdd02d5875807b5b49d4bdaf8fbf3a
clear all timers alarms and flags
{ NRF_RTC1->EVENTS_COMPARE[0] = 0; NRF_RTC1->EVENTS_COMPARE[1] = 0; NRF_RTC1->EVENTS_COMPARE[2] = 0; NRF_RTC1->EVENTS_COMPARE[3] = 0; NRF_RTC1->EVENTS_TICK = 0; NRF_RTC1->EVENTS_OVRFLW = 0; timer_timeouts_check(); }
1
a87e58b2bf517db31fe7f790a0b85db4
df95a6d48404228ebf6a24ab7bab25fc
Configure a pin as a servo pin. Set pulse min, max in ms.
class PyMata3: def servo_config(self, pin, min_pulse=544, max_pulse=2400): task = asyncio.ensure_future(self.core.servo_config(pin, min_pulse, max_pulse)) self.loop.run_until_complete(task)
1
3d6345242311b5426f6cfb9aabf389fc
3cadc384c4b11c3d13099a89e9d5794c
显示登录框,隐藏注册框
public class StartMenu : MonoBehaviour public void OnLoginShowClick() { registerTween.PlayReverse(); StartCoroutine(Hide(registerTween.gameObject)); loginTween.gameObject.SetActive(true); loginTween.PlayForward(); }
1
5c61a501dd2a5f166aa34bd381192d04
132742abee063e0b5bad68e737e20177
metoda de afisare a productiilor citite din fisier
class Admin void showProducts() { string dummyProductName; int dummyProductQuantity; double dummyProductPrice; productFile.open("productList.txt", ios::in); cout << "Product name\t\t" << "Quantity\t" << "Price" << endl; while (productFile >>...
1
6f11860283d20709487cd35f595b104c
9525ea7591359c180047ddba20b86b71
DB로부터 해당 스테이지의 최고 점수 찾아 반환합니다.
public class Record : MonoBehaviour public float getStageScoreBoard(int stage) { return OnplayData.record[stage]; }
0
a77499d30db83ca48dc3d18abf96f718
d0b879dbf2253dbd0615a5b7d17ae9ae
创建高尔夫比赛下一步信息
class ClubMainXMLSetter(BaseClient): def update_next_match_info_to_mainxml(self): if self._turn == 26: self.log("now is the last turn of the season, not need to handle next turn") return dev_match_infos = self.get_dev_match(True) for dev_match_info in dev_match_infos: ...
0
1f7a0b8c079dccbb315ab3f7319a56c6
f12259958e7a8b99c0603e0f6ddba89a
Запретим загрузку больших изображений в галереи
function mytheme_twentytwelve_setup() { set_post_thumbnail_size( 500, 9999 ); }
0
82f6ca99bac1ab8a5925142e724f015a
324ed15088180ba5a705f904ad080c14
Returns a promise that resolves when the sequential queue is done processing all persisted write requests.
this.verifyNotClosed(); const trackedBatches = this.batchQueue; const writePromises = trackedBatches.map(batch => batch.awaitBulkCommit()); this.sendReadyBatches(); await Promise.all(writePromises); }
1
0a91d9d0e5ee5dd9b6e2640c0896ec84
af38561874d74106d2b6cfc2be15d1cb
Before Java 5
System.out.println("################# Before Java8 #####################"); new Thread(new Runnable() { @Override public void run() { System.out.println("Before Java8, too much code for too little to do"); } }).start(); System.out.print...
0
cfe2118f359a47cab38e0c061197d7bc
3b8514f037e58bc06f85e48df4ef7425
特价商品列表
class GoodController extends ComController public function specialsale(){ $result_hot = M('goods') ->field('id,title,glogo,price,sell,yhj_num,yhj_sy_num') ->where(['zd_ddq'=>2,'state'=>2]) ->order('zd_ddq_time desc') ->limit(7) ->select(); $whe...
1
5dee80b48219d100a98c4fba30ffb0a8
0f0e5aba2264be89fc1baef944b344be
Method for decoding the value of a cell read from HBase.
@ApiAudience.Public public final class BinaryHTableBulkImporter extends KijiBulkImporter<ImmutableBytesWritable, Result> implements HTableReader protected DecodedCell<?> decodeHBaseCell(ColumnDescriptor columnDescriptor, byte[] hbaseCell) throws IOException { BinaryHBaseCellDecoder.Type type = BinaryHBase...
1
46c11dbfd748968c8fdec88e27540a90
02ca267d3ecd24a6d9b8be9b352f1d48
獲取当前bike圖標
class Taxi extends \Model\Taxi implements \Doctrine\ORM\Proxy\Proxy public function getActiveimage() { $this->__initializer__ && $this->__initializer__->__invoke($this, 'getActiveimage', array()); return parent::getActiveimage(); }
0
afc2dfe36ee23a5b91583e6eb3821dde
b8e90913693e63b1b963c9ced667b88d
Subtracts from player score
mScore -= x; if(mScore < 0) { mScore = 0; } }
1
46e476347bfc4d14b2a41e14b342980c
56c218029638ab0a61ac6fe81a429556
Indicates whether or not HTTP Live Streaming is enabled.
class LiveConfigEnableApiModel extends ApiModel implements LiveConfigEnableApiModelInterface public getHttpLive(): boolean { return this.enableHttpLive && ( Util.uaIsiOS() || Util.uaIsAndroid() ); }
1
ce433b6d1a67455141a517010399d6c3
783af01358f250af037ed5f8f89aacf0
Creates report from geodiff changesets for a range of project versions in CSV format. Report is created for all .gpkg files and all tables within where updates were done using Geodiff lib. Changeset contains operation (insert/update/delete) and geometry properties like length/perimeter and area. Each row is an aggregat...
years=None, startYear=0, asPercentChange=False, splitLand=False): writer = writeDiffsToCSV if ext == '.csv' else writeDiffsToXLSX writer(outFile, referenceFile, otherFiles, skiprows=skiprows, interpolate=interpolate, years=years, startYear=startYear, asPercentChange=asPercentChan...
1
a69e258d43a154ea05f2bffa04e3333f
66407fd4e7a89d41c328d3bc64d5e251
多进程操作文件,搜索基础信息
class fileSearchThread(QThread): def run(self): threads=[] path = [r"c:\\", r"d:\\", r"e:\\", r"f:\\"] for each in path: t = threading.Thread(target=self.search, args=(self.key,each,)) threads.append(t) t.start() for i in range(len(threads)): ...
0
e6929e16747d46b03b5e3d712d056963
ef5c51152b2b08204563182f4df96c19
Return the summation of all squared odd number smaller than n.
fn row_sum_odd_numbers(n:i64) -> i64 { n * n * n }
0
2615c059fead6e1e0ae4e2b12610c80f
04cca04e8827655cac0ce4e0c839a9b6
生成数值预报
class Forecast(Lorenz): def make_forecast(self): for i in range(self.nature_days): self.solve(days=self.forecast_days, init_data=self.Nature[4*i]) self.forecast[i] = self.sol.copy() self.station_forecast = self.forecast[:, :, self.stations]
1
bcb2320b336da95cd9ff2aa4681df88e
b684e0c95abff5efc5a697909897e295
Run when recipe card has been clicked.
class RecipesTab(QtWidgets.QWidget): def on_recipeBrowser_clicked(self, index): indexItem = self.model.index(index.row(), 0, index.parent()) self.selectedFilePath = self.model.filePath(indexItem) if os.path.isdir(self.selectedFilePath): if openroast.recipes.rowser.isExpanded(indexIte...
1
945709498982b3ffa739d5fbbb53f185
b5ef2a0bd3459bb7259094cc1e5ab897
每一次深度遍历找到j,就打印出路径,退出该层递归前消除对当前访问结点的访问痕迹,以便在下一条不同路径时利用该结点
void Ppath(int path[][NUMS],int i,int j) { int k; k=path[i][j]; if (k==-1) { return; } Ppath(path,i,k); printf("%d,",k + 1); Ppath(path,k,j); }
0
b927284f26c8568ec546a4406946a7ab
970fcd90fa203d1679119e128b622bad
树形表头调整列宽时自动刷新控件
namespace UserUI.industrialControl public partial class dataGridViewEx : DataGridView protected override void OnColumnWidthChanged(DataGridViewColumnEventArgs e) { base.OnColumnWidthChanged(e); if (!loadColWidthFromDb && this._ColHeaderTreeView != null) refreshHeader(); }
1
375ed133d025c448c92b449259548370
144298509611aded8735b3ff36eb2e47
returns if the atomic_types are lockfree this may very from system to system depending on the architecture and implementation
Atom atom{}; const Atom& c_atom = atom; const Mtype zero = values<Mtype>::zero(); const Mtype other = values<Mtype>::not_zero(); STD atomic_init(&atom, other); CHECK_INT(STD atomic_load(&atom) == other, true); STD atomic_init(&atom, zero); CHECK_INT(STD atomic_load(&atom) == zero, tru...
1
320bf72572e4045a4a591dec090760bc
2b3052afb9934d15d05616f7724d5196
Sets up the parent process to communicate with child.
class SECURITY_ATTRIBUTES(ctypes.Structure): _fields_ = [ ("nLength", ctypes.c_int), ("lpSecurityDescriptor", ctypes.c_void_p), ("bInheritHandle", ctypes.c_int), ] sa = SECURITY_ATTRIBUTES() sa_p = ctypes.pointer(sa) ...
1
d99be5131465b260e9f4a619ba207fa8
ee70a02b34986c02ef73ddb2d4e6bc2c
Allows you to get the coordinates the NPC will despawn at if it was spawned via MES as a Cargo Ship
min=100 min_point = me.shipyard.position for dropoff in me.get_dropoffs(): dist=game_map.calculate_distance(ship.position, dropoff.position) if dist < min: min= dist min_point = dropoff.position if game_map.calculate_distance(ship.position, me.shipyard.position) <...
0
5bc0370bc7a95ecd3e02ecec0345e430
5235db47fb60f365a5d77ac5edddf975
Recupera una llista amb tots els productes amb stock de la BBDD
public class ProductDB extends DataHandler public List<Product> getProductsList() { List<Product> products = new ArrayList<>(); CallableStatement callStmt; try { callStmt = getConnection().prepareCall("{ ? = call getProductsList() }"); callStmt.registerOutParameter(1, Ora...
0
e01bad111ca55b877411d59b60765800
3791c643b0cac3f6ec13b525003d61c1
即将选择商品分类树某个节点之前事件
{ if (goods_type_tvw.SelectedNode.Parent == null) { parent_type_tbx.Text = "无"; type_name_txb.Text = goods_type_tvw.SelectedNode.Text; parent_type_tbx.Enabled = false; type_name_txb.Enabled = false; } ...
0
5ce5dab43d0a0e72c77674f84d9af97b
e2a5cbde73a79affcd2f60db36b1d3ba
Do db_reset and then insert essential data
class Database(object): def db_reset(self): cur = self.db.cursor() cur.executescript(""" DROP TABLE IF EXISTS Books; CREATE TABLE IF NOT EXISTS Books ( id INTEGER PRIMARY KEY, title TEXT NOT NULL ); DROP TABLE IF EXISTS Auth...
1
c13abf112bc734d0500324eefa552fa3
baa2d0b98b7aa02eba2eb05e326942be
将屏幕坐标转换为地图坐标
function screenToWorld(sx, sy) { var wcx = mapParams.cx; var wcy = mapParams.cy; var scx = (gSelf.width) / 2; var scy = (gSelf.height) / 2; var scale = mapParams.zoom / (gSelf.width); var wx = wcx + (sx - scx) * scale; var wy = wcy - (sy - scy) * scale; return { x: wx, y: wy }; }
1
72e9d3e99759490290db219e2c0046d5
6f931c6e402940847f46cdddbbc7b6b3
Get groups (actual, finished, info)
$groups = $this->_select("groups", "id, name"); if(empty($groups)){ return $groups; } foreach ($groups as $key => $value) { $students = $this->_select('groups as gps, register as regi, users as usr', "usr.id, usr.firstName, usr.lastName, usr.u...
1
367f3cc31f0d4d82e75a76b3f7bb765d
5f00d0bc7c68c8d2e3da51629f10e92d
Test if brewery contents coming from database are in html page
result = self.client.get('/') self.assertIn('find a breed', result.data) self.assertIn('sporting group', result.data) self.assertIn('German Shorthaired Pointer', result.data)
0
7419e576c8c8e1c27abd5849070edaca
52dfe560fb97b8e2029e542da045c572
Returns a flattened hierarchy tree
public function getFlatTree($path, $rootAlias = 't') { return $this ->getFlatTreeQB($path, $rootAlias) ->getQuery() ->execute() ; }
1
67bf3ac05878b9aa6c5e93d7a6ec211a
0128ebea8dd94c668129ca6649f84275
function to read output of the mapper and splitting by tab
public class KPI2 public static class movieDataMapper extends Mapper <LongWritable,Text,LongWritable,Text> public void map(LongWritable key,Text value,Context context)throws IOException,InterruptedException { String []tokens = value.toString().split("::"); long movie_id = Long.parseLong(tokens[0]); String...
0
ba2a18721e0f8adda7d3bbd9973e5e64
21d00a71893e83770c16594bff75b38c
Determines whether MSM is installed.
namespace CoApp.Packaging.Service.PackageFormatHandlers internal class MSIBase public bool IsInstalled(Guid productCode) { try { lock (typeof (MSIBase)) { using (var i = Installer.OpenProduct(productCode.ToString("B"))) { if (i != null) { ...
1
de4e78d765106027731172173f5cebbb
fd1410b8d24a00909b263657c064f479
Enter a parse tree produced by TSqlParser#queue_id.
public class TSqlParserBaseListener implements TSqlParserListener @Override public void enterQueue_id(TSqlParser.Queue_idContext ctx) { }
1
200a50f835acc96818638154a4f5224f
ce840109ddc1416f6e69310480bf895c
Test case for uploadOrderInvoice Upload an order invoice to a given order.
{ $data = $this->getInvoiceForSuccessfulCase(); $response = $this->json('POST', '/api/invoice', $data); $response->assertOk(); $this->assertDatabaseHas('invoices', $data); }
0
7d5e32ca43a2f63fe1f998369e006627
0af30ed9ed106300cd9d326caef2f526
获取图层ID
@Table(name = "pa_patrol_point") public class PaPatrolPoint public String getLayerUnid() { return layerUnid; }
1
bbbd97a02859f83cb08e1cee97703efa
b437a4e0d2db758d8519c0814da05f5e
从此列表中删除所有索引为fromIndex (含)和toIndex之间的元素。 将任何后续元素移动到左侧(减少其索引)。
public class MyArrayList implements List,Serializable{ public void removeRange(int fromIndex,int toIndex){ if((fromIndex < 0 || fromIndex > size) || (toIndex < 0 || toIndex > size) ){ throw new IndexOutOfBoundsException(); }else{ if(fromIndex < toIndex){ for(int i...
1
214cbf15a65cecfab4e018d7b8c3fa3b
7bf27c06b9f890e590f385ae0aef4d82
ユーザを読み込みます。 存在しない場合、新規でデータを作成します。
@Dao interface UserTagDao @Transaction suspend fun makeUser(name: String) : User = findUser(name) ?: let { insertUser(name) findUser(name)!! }
1