query_id
string
corpus_id
string
query
string
code
string
label
int64
d58a8cc3ef4dcbe4e2f6c0fb65ad9e62
70e66502826f1d30bd9b46ba9873db0c
根据channelId删除merchant表数据
if (StringUtils.isBlank(channelId)){ channelId = "test_channelId"; } UserBankCardHisDOExample exam = new UserBankCardHisDOExample(); exam.createCriteria().andChannelIdEqualTo(channelId); userBankCardHisDAO.deleteByExample(exam); }
0
665627c23c0bacd1841b28bf2056a6e1
90ccf261df8c9f6c8fd3eed86bcabbab
Read file line by line
class data2redis(object): def readLine(self): with open(self.inputFile, "r") as inFile: for line in inFile: self.totalLineNum += 1 yield line.strip()
1
151ba6a8425c6841e7be25afadf3a8a3
4e92efe85c0eccff4a19113b9e5a2a58
Sets a log writer as the only one
class LogServiceProvider extends ServiceProvider protected function configureSingleHandler(Writer $log) { $log->useFiles( $this->app->storagePath().'/logs/laravel.log', $this->logLevel() ); }
1
18976ba014d8e35d9179eb910f4a0119
c4768eae52390fb27ed4026952f71d9f
Handles the Apply Button, either just re-populating the Table or looking for a different show name
public class AddShowDialog extends JDialog implements ActionListener, MouseListener, EpisodeChooserListener private void showsTableSelectionChanged() { this.okButton.setEnabled(false); int selectedRow = showsTable.getSelectedRow(); if (selectedRow >= 0) { SimpleTedSerie selectedShow = this.showsTableM...
0
73ecba1ce0f00338250f6dd9c3088877
862b3f7a818eb256d10e27865bc84592
Test of izvrsi method, of class ServerAviona.
public class PozoleRojoPiernaTest @Test public void testServe(){ pozoleRojoPierna.serve(); }
0
2f06209ea8d6a5b5356fea45cd979148
ab9a0e0aa6adc4d8159f115fc3513734
Finds the closest scope with an item of the type specified
public ComponentScope findScope(ScopeType type) { for(ComponentScope scope: scopes) { if (scope.getType() == type){ return scope; } } return null; }
0
0e5e9d60ee129dc1750365b25e1b45a8
4575ed2de1e6b482a31b53ca4227d657
Создание приложения с таблицой истинности
class Program static void Main(string[] args) { var myTruthTable = GenerateTruthTable().ToList(); foreach (var item in myTruthTable) { if (item.GetTruthValue()) Console.WriteLine("{0}, {1}, {2}", item.A, item.B, item.C); } ...
1
2c1fa40f2bfdc177425a32bf7a1facfb
a8d6bf99ae84030d80ccbe6e3ef1e6c9
按salnumber取得单个活动
global $xoopsDB; if (empty($sn)) { return; } $sql = "select * from `$this->tbl` where sn='{$sn}'"; $result = $xoopsDB->query($sql) or web_error($sql); $row = $xoopsDB->fetchArray($result); return $row; }
0
ae27bafaad6d2bc3d6c13c66835f564e
b737487cc94f05fd443435523eef02f7
return a generator of possible next moves
s = set(m.pos for m in self._play_seq) for i in range(self.n_grid) : if i not in s : yield TicTacToeMove(self._next_party, i)
1
a35bdf61c1b93f1bd15c6e10c84a64be
4016c18a5409232f5de09235c07625b1
Test the MC-sampled sqrt decomposition of the input Hessian.
if tf.executing_eagerly() and not JAX_MODE: return dtype = np.float32 true_mean = dtype([0, 0]) true_cov = dtype([[1, 0.5], [0.5, 1]]) true_cov_chol = np.linalg.cholesky(true_cov) num_results = 3000 counter = collections.Counter() def target_log_prob(x, y): ...
0
15a180e63b7040cedf5430064a414d9e
6b1bb81417bcba1091c78d259bc95a6e
子类型是否显示
class Permission static isShowChildren(children) { return children.some(item => !(item.meta && item.meta.hidden)); }
1
0892fa5743eae99b42d3680b4275ba7f
9194abbab37196ade3a02f3f20d61ea2
Throws an exception on the next tick.
function crash(Throwable $err) { Loop\nextTick(function () use ($err) { throw $err; }); }
1
1b37d0b6517e2c15f954e9e0f0d6f3ad
e56e3fe9ce0031979d62a5cc7a3c2d04
Format a terminal string for bold and optionally underline.
def inner(text, bold=False): c = code if bold: c = "1;%s" % c return "\033[%sm%s\033[0m" % (c, text) return inner
0
6e3ca6929a219c9b4ea24155f0c0c0d3
8744ee25aff2f69017f1003358c941b4
Gets the hand's root pose.
{ var wristPose = platformJointPoses[(int)HandJointKind.Wrist]; var wristProxyTransform = GetProxyTransform(TrackedHandJoint.Wrist); wristProxyTransform.position = PlayspaceTransform.InverseTransformPoint(PlayspaceTransform.position + PlayspaceTransform.rotation * wristPose.P...
0
5e53993b002086eb62f7c29b56a84389
228848fd4c9605956f1b770614dbbf87
Get value from internal stack
class Context(object): def get(self, item=-1): return self.stack and self.stack[item]
1
f114116109be4f571f594ad51509f5bb
4fe7333fbfd00a172c5363e1defb9d0f
获取我提交的请假申请
department, level = get_department_and_level(cursor, user_id) if level == 'employee': return [] elif level == 'manager': sql = """select LeaveNo as leave_no, Name as name, LeaveBegin as leave_begin, LeaveEnd as leave_end, LeaveReason as leave_reason, ApplyDay as apply_day ...
0
beebb9434d3990e7a21da0441d593c7d
9b4c875c73a073a3ad973926719e7ba4
Verifier si le nom d'une série fait parti des séries préférées de l'utilisateur
def ajoutSerie(request,account_id,user_input='Dummy'): user_input = request.POST['serie_name'] if user_input == "": return render(request,'webseries/SelectionSerieechec.html') else: json = recherche(user_input) possibleseries = [] for onepossibleserie in json["results"]: possibleseries.append(([ onepossib...
0
d0b93dc1fc7425a233242da540fd3f4d
421970d8198e55dce9b5be10cae01800
Gets the value of the poiSoftware property.
@JsonAutoDetect(getterVisibility = PUBLIC_ONLY, setterVisibility = PUBLIC_ONLY, fieldVisibility = NONE) @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) public class RegistrationRequestBody extends FFDCResponseBase public SoftwareServerCapability getSoftwareServerCapability() { ...
0
0e3218763a91218994a03d0f2dbe4eb8
c38df422c472b9a2f83b2434b6624e59
Replaces json schema file references referenced with a $ref property with the actual file content from the referenced schema file.
def resolve_refs(spec, store=None, handlers=None): spec = deepcopy(spec) store = store or {} handlers = handlers or default_handlers resolver = RefResolver('', spec, store, handlers=handlers) def _do_resolve(node): if isinstance(node, Mapping) and '$ref' in node: path = node['$re...
1
5c90c5352984bb4a28267f05268cd8dc
2bc2dc49377e3d05bc687be420600a68
解析exif信息,获取日期
$date1 = null; $keys = array( 'DateTimeOriginal', 'DateTimeDigitized', 'DateTime', ); foreach($keys as $k){ if(!empty($exifData[$k])){ $date1 = $exifData[$k]; break; } } if($date1 != null){ $date1 = date($format, strtotime($date1)); } return $date1; }
1
8806b5a55b8a0306efca662b1d199b10
824fad95a265c2687c496a6c535a7e06
Generate BPO paths.
class DtdGenerator(object): def generate(self): bdp_files = [] for file in os.listdir(os.path.dirname(os.path.realpath(__file__)) + os.sep + ".." + os.sep + "bdp" + os.sep): if file.endswith("_BDP.py") and not (file.startswith(".") or file.startswith("#")): bdp_files.append(f...
0
9593e49be1cf513c0942cbb5ff75819f
f3462c0ca5d4b7d110ad2723c9fbe2a0
実部と虚部を設定する。
class Complex(var re: Double, var im: Double) operator fun plusAssign(other: Complex){ re += other.re im += other.im }
0
f0ead78cfed2ad2e58fed094fe893646
cff01b5043c5dd0553f47349a4fc59d3
查询拼团活动Id
$where = array(); $where['user_id'] = $_REQUEST['user_id']; $where['good_id'] = $_REQUEST['good_id']; $where['order_id'] = $_REQUEST['order_id']; $Model = M('groupbuyingcus'); $data = $Model->where($where)->field('groupBuying_id')->find(); if($data){ $result = array(...
1
df28a25f35ffb00af0ccc44c49654cc8
167c3348e87b1b9fbe73b1347525e152
设置编辑模式,inline or popup。默认inline
abstract class AbstractRelation extends AbstractProperty public function setInlineEditing($inlineEditing) { $this->inlineEditing = (bool)$inlineEditing; }
1
53b29ee800c2ba139614e75b0b645fab
06aaa049076836ac2cc806e5af6797a8
清空上一个测评学生信息
{ txtInitStuName.Text = ""; txtInitStuID.Text = ""; AddDataToStudents(-1, ""); }
1
4784665d2a5ddeb994c212170cbd53ba
c4d30ddc7da4c75632a9332b4b923965
Add credits to student.
public class Member implements Serializable public void addCredits(double n) { this.credits += n; }
1
720708a1a19ccc5491eb0ae0f8c7a842
72d798b29b50833b99bfc0165cbbad64
保存声音状态
state.playAudioCurrent = audio state.playIndex = findIndex(state.playlist, { objectId: audio.objectId }) saveState(state) }
1
80aa29c433c5aabacc748dee5fb88b22
7cff673449c7ea0632f9014128a38653
Vérifie si une demande de récupération de mot de passé existe déjà pour un utilisateur donnée
boolean hasPassphraseFor(Long keyId);
0
8605cb597876bfd493b3fe7958c80199
54d1c4e3c74519f1f2a7e3078d4fab1b
Function to return the minimum distance between a line segment AB and a point E
{ double ret=0.0; Point3Dd v(ep); v -= sp; Point3Dd s(this); s -= sp; double num = v.scalarProduct(s); if (num < 0){ ret = distance2(sp); } else{ double den = v.scalarProduct(v); if ( num > den){ ret = distance2(ep); } else{ ret = (den*(s.scalarProduct(s)) - num*num)/den; } } return ret; }
1
f9f5e57f1151b1bf230f587b7a5ec447
797d327f7b4bd01ea4e581a6f2d67b79
Ermittelt den Sprachcode der installierten Windows Version. Der Sprachcode ist zweistellig und kleingeschrieben.
namespace Kapture ushort ClientLanguage();
0
52619edb4875f726202eec96fb103e78
f4586407d7022975d54abb21f991db52
Sets the maximum number of components that may be concurrently selected. A value of -1 indicates that there is no limit. maximum number of concurrently selectable components
@SuppressWarnings("unchecked") public class MultiComboEditor extends AbstractStyleParameterEditorPanel public void setMaxBoxes(int n) { maxBoxes = n; }
1
66481312e33421eb09713dff087bf029
8c84617948e6f10a532f86b7177defdd
암호화 키와 평문을 받아서 암호화된 문자열을 반환하는 함수
cipher = [] if not dec: keyword += plain cipher = [encode(letter, keyword[n]) \ for n, letter in enumerate(plain)] else: for n, letter in enumerate(plain): letter = encode(letter, keyword[n]) cipher.append(letter) keyword += let...
1
4bd4b6f62fffc99e49c9011070625ce4
8e8fa2a1855f52cea3d152eca377290f
获得所有车队在线司机位置
$re = pdo_get('make_speed_rider_driver',array_merge($this->where,[ 'status' => 2] ),['id']); return $re ? $re : false; }
0
56bc60c76b61d74cbaef6f72262418ca
af7e254939944115db1243447cc4d4fe
Sets the quaternion to an identity Quaternion
public class b2Rot public void SetIdentity() { s = 0.0f; c = 1.0f; }
0
ff4184fca50dd2af7e6791766de21a3b
d96661bc5a58fa43ac6eb262e8c361aa
Cambia el manager de la tarjeta por el que se indica
{ if (man != skins) { skins = man; if (skins != null) skins.setParent(this); viewManChanged(); vrp(); } }
1
c6b2bf8ebc3383721b86d15d89cb477c
c01c1ea9a71fa011c8f8753aeb3d06a0
Gets the selector for the container holding currently active page contents. This is useful when content is AJAX loaded and in the DOM but not actually on active display
class SemanticUI protected function getActivePageWrapperHTML() { return $this->activePageWrapper; }
0
e5ce086358ebbb981accd02f8b304098
c86e256d5b43f51cdf9c3cbcb3a5bbf0
Creates a new alias to virtual_aliases table.
class CommandProcessor public function createAlias($name, $alias) { $this->namespace[$alias] = $name; }
0
be7e78af2731f7d70d82b9577b3bc04e
45dc880443cd10ca3d79ef1f107f7217
ポーカーの交換カードの指定番号取得テスト5
public class HandTest @Test public void testSetCard() { Card assertCard = hand.getCard(2); Card swappedCard = hand.getCard(4); hand.setCard(4, assertCard); assertEquals(assertCard, hand.getCard(4)); assertEquals(swappedCard, hand.getCard(2)); }
1
63cf3ff8759f6b9470700a042d4d6fa3
75bf83d1536e64b8515ea2e338c40316
The dimensions of the mesh. Is equal to zero as a 0D mesh. Returns an int, 0.
class ASTRegion(ASTFrame, metaclass=ABCMeta): def meshSize(self): return self.astObject.get("MeshSize")
0
6d36c7ea3fa4a2f99978c53bcbd33218
4b5cbd84dd598401f368d87dbcbe5453
Tests building an HTTPS request
func TestNew_HTTPS(t *testing.T) { mw := New(Config{}) ts := httptest.NewTLSServer(mw(getTestHandler())) defer ts.Close() client, err := getTLSClient(ts) assert.NoError(t, err) client.CheckRedirect = checkRedirect res, err := client.Head(ts.URL) assert.NoError(t, err) assert.Equal(t, http.StatusOK, res.StatusC...
1
72f195c2217c94bb7942b83ac29ff5ab
50f8489556e607845688618ea2f007c8
Returns a random index from the given array
function get_random_index_from_arr(arr) { return Math.floor((Math.random() * arr.length)); }
1
453f70c8b0a45238567478615cf4e54b
a4efb88d7f5f814e755ed6aeb916acff
Convert the color to it's compliment (opposite position on the color wheel).
public class Palette public void makeComplement(final int i_color) { swatches = new Swatch[2]; swatches[0] = new Swatch(p, i_color); swatches[1] = new Swatch(p, i_color); swatches[1].rotateRYB(180); }
1
d579c91063efa530904d55ccc7b3559d
0db0463705f21bb13ce7019c11ec6c1f
Returns the meta object for class '{@link org.servicifi.gelato.language.kernel.references.Reference <em>Reference</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
EClass getReference();
1
599bcfc2cb63ddbf859cacbcab3168b8
0ff94992e4e4578407054ede30a1f4fb
Getter jumlah binatang pada cage. Mengembalikan jumlah binatang pada cage.
float sum = 0; for (int i = 0; i < z.getJumlahCage(); i++) { for (int j = 0; j < (z.getCage(i)).getTotalAnimal(); j++) { sum += ((z.getCage(i)).getAnimal(j)).getFoodMeat(); } } return sum; }
0
14bdc85e2fd92451ad2e50f7c75d7d60
89010082213e2012668ec58cbc021e10
Возврат во входной поток, восстановление лексемы
class Lexer: def put_back(self): self.current = self.previous
1
cd2d37eda3c93e19d4a34821304843c8
7ced74ede627ba4ceec312d2333a4420
获取布阵位对应阵容位的映射表 {key-布阵位, value-阵容位}
function IUser.getArenaFormation(index) return ArenaInfo.formation end
0
d9b3ded17473d5342931f4cd513769f9
235e0fc0384471f31cc9358b3594d8c4
put a stone into the default basket
@cups.each_index do |i| unless i == 6 || i == 13 4.times{ @cups[i] << :stone } end end end
0
9eb2b59f8c8c4ef7fa57a10cef5a9529
1e1ab4790d30273debdcabe2ecaa870b
Max number of multi tabs to open at a time
@SuppressWarnings({"unused", "WeakerAccess"}) public class MediaSelectorUtils public MediaSelectorUtils setMultiMaxNum(int multiMaxNum) { this.mMultiMaxNum = multiMaxNum; return this; }
1
ca631133fe85aa4c428cd30ddfce4b54
ac72be98d202b2b5334a115f8ef39504
取X-Forwarded-For中第一个非unknown的有效IP字符串
func ClientIP(ctx *fasthttp.RequestCtx) string { clientIP := string(ctx.Request.Header.Peek("X-Forwarded-For")) if index := strings.IndexByte(clientIP, ','); index >= 0 { clientIP = clientIP[0:index] } clientIP = strings.TrimSpace(clientIP) if len(clientIP) > 0 { return clientIP ...
1
e9ade62c67678869ea8e86f5e9e44fb5
d68cd349e08e24f5bbed124bbecabb28
Initialize recording helper structure.
{ lcx_audio_record_t * a = malloc(sizeof(*a)); if(NULL == a) return NULL; memset(a, 0 ,sizeof(*a)); return a; }
1
3e75cdccaa669775030181d6173e724b
d26b92e1813c8af7182c47558fbef6e8
Return True if the column specified by the zero-based index is read-only.
class _tablerow(TableRow): def iswritable(self): return self._iswritable()
0
7718b40a6ef07baadb28c3e7d2c3557c
459f6fedf9d2c32fc13bb56f7c502f65
50:50 chance between using one of the top 50 candidates (if there are already 50 candidates) and a random candidate
if favor is None: return cls.__pick_random() else: r = random.uniform(0, 1) if r > 0.5: return cls.__pick_random() else: return favor
1
7cd60a763a379e07a67f71dc73e29489
9bb6f6df91d2a67f7df3fd9d5b2acd05
Returns All Employees from file
with open(input_file, 'r') as json_input: json_text = json_input.read() json_list = json.loads(json_text) employees = [] for json_obj in json_list: new_employee = Employee.fromDictionary(json_obj) employees.append(new_employee) return employees
1
1959900fba493f5ddf8cf7eab20bc080
fd896ccb5ae036ad3a8b6e127f80107a
获取FailItem报表的信息
{ var query = GetListQuery(context); ReportModel data = query.FirstOrDefault(item => item.Report_ID == reportID); if (null == data) { return null; } int invalid = 0; if (string.IsNullOrEmpty(data.Quantity)) ...
1
60dfceae6cce57c3feb2d292402761de
07cd0493720863b65c73eef27e38b02b
Flushes the entity cache: Depending on the entity state, the required DbOperation is performed and the cache is updated.
namespace SharperUniverse.Core Task FlushEntitesAsync();
1
982f06ea23e328fc55c10920e4a75c01
147358ae5dff23986f22700d9824a6d3
Get Buttons for current View and current User
@Repository public class MenusDaoImpl extends SqlSessionDaoSupport implements MenusMapper public List<Map<String, Object>> getUserButtons(Map<String, Object> map) { return this.getSqlSessionTemplate().getMapper(MenusMapper.class).getUserButtons(map); }
1
efbff66ed10e750ecc4fb63e67e8affa
03aeb028749886cde7d8b4c72239ba72
# Download the spatial grid (if necessary) and return the path to it
grid_path <- file.path("data", "EmptyGrid", 'Empty_250_US.tif') if (!file.exists(grid_path) | overwrite) { spatial_grid_id <- '15bEuENdzVfKCc57DPQx2s1JSr3awqT14' grid_metadata <- drive_get(id = spatial_grid_id) zip_path <- file.path("data", "grid.zip") drive_download(grid_metadata, path = zip_path, ...
1
28109b56210b0735e2b80bffcd3768a1
04a1d610df6131f43533bf14d4006170
Gets whether this control is a focus group for keyboard navigation.
bool IsFocused();
0
3db812c7b7b407699d2698b32ad1b34d
f1a2605b28d4483ab0484c12083dbfa8
#Function to replace continuous variables with woe values
def trans_woe(var,var_name,x_woe,x_cut): woe_name = var_name + '_woe' for i in range(len(x_woe)): if i == 0: var.loc[(var[var_name]<=x_cut[i+1]),woe_name] = x_woe[i] elif (i>0) and (i<= len(x_woe)-2): var.loc[((var[var_name]>x_cut[i])&(var[var_name]<=x_cut[i+1])),woe_name...
1
8cc4d06ff2ff61177bb6c32c6b64f721
4187bbf5504dab21212df9420ec0e9aa
获取传送原因的描述
NULL === $reason && $reason = $this->reason[0]; return array_key_exists($reason, self::$reasonMap) ? self::$reasonMap[$reason] : NULL; }
1
76ad3b37ba03820efbf4d6c1fbd970ff
959ee115dec85108149f4da2a042cea0
Returns possible remaining cards in deck based on list of visible one
class DealerHand(Hand): def display_visible_cards(self, cards): return self.display_cards(cards)[1:]
0
f64abd76fa241cc98265225c7eda3db3
5a9407bcaeff61907b2be4ee8076904a
加载图标,如果加载不成功,那么使用默认图标
fun ImageView.loadImageOrDefault(imgUrl: String) { if (imgUrl.isNotEmpty()) { try { GlideToVectorYou .init() .with(context) .setPlaceHolder(android.R.drawable.stat_sys_download_done, android.R.drawable.stat_notify_error) .load(Uri.p...
1
9c0dc1cf9ce490a0eb054fb4760edc4d
b354ecde6c04bdacbf0917dd4bd3fec4
网站资金代还
class IndexAction extends Action public function finance() { if (!session('?user_name')) { $this->error('非法登录','index'); } $power = session('user_power'); if (!$power[6]) { $this->error('您的权限不能操作该页面'); } IndexAction::XuanranbianlanNDIS($this); $moneyform = M(...
1
8e524d22d31dd8ef92f47a7cc67ae4d2
07448a74d526727466abcce44946231e
Display and animate hotel select
{ $hotels = Hotel::with('city')->orderBy('id','DESC')->paginate(8); $cities = City::with('country')->orderBy('id','DESC')->get(); return view('hotel.manage_hotel',compact('hotels','cities')); }
0
2e4f06445d4523531ae99593884dffcb
e3a79690c69f041cc20746e6a8764721
Finds the landscape's coastline
public class ContinentGenerator private void findShoreTiles() { this.coastalTiles = new ArrayList<>(); this.lakeShoreTiles = new ArrayList<>(); for(int x = 0; x < this.size; x++) { CONT: for(int y = 0; y < this.size; y++) { if(!this.landMap[x][y]) for(in...
1
8fe4bb46603e404f9b697737a920b6c5
2a758fed81b0880d1462a6380e5fd5ac
Here we test ability to create Flavors.
resp, flavor = self.admin_client.create_flavor(self.flavor_name, self.ram, self.vcpus, self.disk, self.ephemeral, ...
1
5a76fbd6da7bdab4a375d62e58d74ddc
4167be7e12385dbe1b4cdef9c56c9a47
Get value for column or default value
{ if (false === strpos($columnName, '.')) { $columnName = $this->defaultSelectorName.'.'.$columnName; } $values = $this->getValues(); if (!array_key_exists($columnName, $values)) { throw new ItemNotFoundException("Column '$columnName' not found"); } ...
0
5c1abb9ea2601696eb83bdc5e0e44d0c
7586bdd76239ba84aae497b38bad04ba
CProcToStr
int error = (this == NULL || str == NULL) * PCB_NULL_ERROR; if (!error) { str[0] = '\0'; const char * format = "Max PC: 0x%05lx Term Count: 0x%05lx Terminate-on: 0x%05lx"; snprintf(str, (size_t) PCB_TOSTRING_LEN - 1, format, this->reg.MAX_PC, this->reg.term_count, this...
1
a8223325fde0d6119e5b8988a75da633
7a6cd8847d54045ecbb78482c294ca16
退出创建版本任务
let vid = this._all_data.vid; this._is_exit_finish = true; this.node.active = false; ya.dm.remove(vid); }
1
19e78c7dbfe0bc4814a00434d6b5c57a
936f695cb1c2c87668e4a7b3d7a4f801
Save model metrics
if self.train: self.log_dict[self.steps] = {} for key, value in loss.items(): self.writer.add_scalar(key, value, self.steps) self.log_dict[self.steps][key] = value with open( os.path.join(self.config["outdir"], f"metric{self.sav...
1
e7ac81546dc6554abb308d6ab4d852ff
8645bbf0e06958fed3408132bbc77866
强制转化为整形,非数字时返回99999
num = num ? num - 0 : 0; if (num > 99 ) { return "99+" }else{ return num; } }
0
e5855cacbce21fd7c9f837fee0ac46a9
dfe13f31f40c2f97815abb4ba3025a1f
修改系统变量
{ string strSql = "update SysConfig set varvalue='" + VarValue + "' where varname='" + VarName + "'"; return SqlHelper.ExecuteSql(strSql); }
1
82108a60c32e46a67584d5e732c6d226
6dfefc87865059cddedc255fdaf792fb
Преобразование из инфиксной нотации (алгоритм Дейкстра).
def polish_notation(expr): polish_not = [] stack = [] operations = {'*', '/', '+', '-'} dictionary = {'*': 2, '/': 2, '+': 1, '-': 1, '(': 0, ')': 0} digits = [str(x) for x in range(10)] number = 0 is_reading_number = False for symbol in expr: if symbol in digits: is_...
1
9728a5f876c3ab5f65eb7322b719df86
4ddf1b9219fa02b2e80e03a641141859
Perform all the pairwise distances.
class FuzzyCMeans: def _point_all_distances(self, point=[]): all_distances = [] for group in self.groups: centroid = group.center distance = self.distance.calculate(point, centroid, self.distance_method) all_distances.append(distance) return all_distances
0
b344e5f40e16740cf52d8d11e7dbed30
8b2e3c7159a5c41b20430e58478be3e3
黄色框选择按钮触发槽
{ QColor bgColor(0,0,0); bgColor = pCurve->pen().color(); QColor color = QColorDialog::getColor(bgColor, this, tr("颜色对话框"), QColorDialog::ShowAlphaChannel); if(color.isValid()){ btn->setStyleSheet(QString("border:0px solid...
0
42d31a94e968f4df08435b3dc61e3550
544f73810ceb1c608c6c1c6d1de64410
Removes a hold and enable the save buttons when all holds are gone!
foreach (Tile t in grids) { if (t.canHold) { t.canHold = false; } } }
0
0a792ba765f36e85fecfaaeb7fd1c776
04390c31e663daca30e60081920f2597
Simple model of a university student
super().__init__(name, address, email) self.student_number = student_num self.courses_taken = [] self.courses_taking = []
1
1e0b4c9503670370de4fe2ac585d623d
582c63f536e5f355c652e807e5359735
Exécution du code court (shortcode) de saisie d'une recette
function event_create_shortcode() { ob_start(); event_page_creer(); inserer_event(); return ob_get_clean(); }
0
5422b0ffc9a933eb90fa6dba50fa0ae9
a9877a406072f5a442de850c10a9ec58
Ajoute une entrée Gt_poeme.
class Authorship_poet(db.Model): def authorship_event(updated): entry = Authorship_poet( authorship_poet_user_id=current_user.get_id(), authorship_poet_poet_id=updated.poet_id ) try: db.session.add(entry) db.session.commit() return True...
0
b9a55441b95e9dc3b43a82fe22828673
e6afea4a533dc07fc1163482f97b2bc2
"""Вывод метеорита на экран."""
class Meteor(Sprite): def __init__(self, ai_settings, screen): super(Meteor, self).__init__() self.screen = screen self.ai_settings = ai_settings self.image = pygame.image.load('meteor2.png') self.rect = self.image.get_rect() self.rect.x = self.rect.width self.rec...
1
51d541dbd7c36c00d288a43a2fa5d61c
84b5c2ab6b77af1aba75cfe7c5a13df4
返回即将上映的8部电影,还有即将上映的电影数量。
namespace MovieBLL public class BLL public static DataTable select8_zongyi() { return MovieDAL.DAL.select8_zongyi(); }
0
5f7de650f35d70f789e85cff3f8a97a2
fb4ece6b6f75814fa0cab7927ef73ab5
Tests for QuestionQuery
answer_schema = { "type": "Number", "id": "age-answer", "mandatory": True, "label": "Age", } question_schema = { "id": "question_id", "title": "", "type": "GENERAL", "answers": [answer_schema], ...
0
31111ed82ff0600d4b397dd6208f16c4
7a2c0401ee09cf3905251c287f679293
Apply function to the files within the specified directory. No recursion is supported.
{ char name[MAX_PATH]; Dirent *dp; DIR *dfd; if ((dfd = opendir(dir)) == NULL) { fprintf(stderr, "dirwalk: can't open %s\n", dir); return; } while ((dp = readdir(dfd)) != NULL) { if (strcmp(dp->name, ".") == 0 || strcmp(dp->name, "..") == 0) { continue; } if (strlen(dir) + strlen(dp->name) + 2 > size...
1
2e2de7e7a398cd7fe707d27f962d9dee
89a9b3fe5d88cd2b59ea8fbc8d9c1dbc
Check an account/nick name and password to see if they are valid Returns the account display name if valid
cursor = self.connection.cursor() with_name = cursor.execute("SELECT * FROM users WHERE user_name = ? AND password_hash = ?", (user_name, password_hash)) with_name = with_name.fetchone() with_email = cursor.execute("SELECT * FROM users WHERE email = ? A...
1
5214e1f6e062a85912aa3445d186732f
e157523dea6b818328e97fa8fe7f8f19
Show LoginVoter Screen
namespace TEAM5OCOS.Controllers public class LoginController : Controller public ActionResult VoterLogin() { return View(); }
1
54d757a9bbaf89fc0d3ddf629ae04a3e
835153364f9e31284bfdcceefb78f5d0
Sets the channel bindings to be used during context establishment. Only valid before the context creation process begins.
class FunctionServiceServicer(object): def SetAccessBindings(self, request, context): context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!')
0
262e0a994a0b6c698c5ac8455455c383
d78d7a4a68384e5ed285772cce0e45dd
버튼 클릭 확인하는 스크립트
public class clickscript : MonoBehaviour void Start () { }
0
f42061e204e8f0e6a7835c08a4d58354
ea6f12a3d9de6db676657fba112f19fb
scale and move the coordinates so they fit [0; 1] range
{ x = (mx - centerX) / 500; if (x < -1) { x = -1; } else if (x > 1) { x = 1; } y = (centerY - my) / 500; if (y < -1) { y = -1; } else if (y > 1) { y = 1; } }
0
a70cfc22a06f6896b5b3be53ebb1a093
acb3ee9cd4a51e916144e474ada317d8
Tests whether a given code point is an octal digit `[0-7]`.
public class OctSingleCharacterOperator extends NullaryRegexpOperator public boolean isOctal(int number) { return Integer.toString(number).equals(Integer.toOctalString(number)); }
0
14ff1369c4981c186e15cca5de1e8016
f583c854f147ec8ec411523caf92f945
该方法在用户进行了web上某个需要上传文件的操作时回调。我们应该在这里打开一个文件选择器, 如果要取消这个请求我们可以调用filePathCallback.onReceiveValue(null)并返回true。
public class WebViewHelper public static class CommonWebChromeClient extends WebChromeClient void onImageSelected(ValueCallback<Uri> mUploadMsg, ValueCallback<Uri[]> mUploadMsgs);
1
85727973c82b80358c09098988308aa3
e09f4b9df1ecba8cf85e5f9db8f0fcaf
等待任务退出
$pid=pcntl_wait($status, WNOHANG); while($pid!=0&&$pid!=-1){ if(array_key_exists($pid,$this->pidCommdArgs)){ $curtask=$this->pidCommdArgs[$pid]; unset($this->pidCommdArgs[$pid]); --CronServer::$curActiveTaskNum; if(apc_exists("process-crashed-$pid")){ CommonTools::log('进程'.$pid.'异常退出: Comman...
1
0d051e2c5a5ad2071c363e07b5157ca2
c4d3925f6dc8f05045cbe7369c9f270b
ドロップ可能なQStandardItemModelの派生クラス。
class ModelImport(QStandardItemModel): # roles def __init__(self, parent=None): self.column_label_indexes = {} super(ModelImport, self).__init__(parent)
1
2f9b35a8f0d573ca5db01ecd9e0a79b9
60339784791e05bb3fa4fab601cba015
Sprawdza, czy dane odbiorcy są poprawne
public class DefaultIpnAssistant implements IpnAssistant protected boolean receiverIsCorrect(IpnData ipnData) { return ipnData.getReceiverEmail().equals(ipnConfiguration.getReceiverEmail()); }
1
22059151fb444980f805677af98cf747
40f1eb0ad2b18a542cba177667a3b7a4
Updates the state of the "Select all" checkbox.
function addRowSelectionLogic (scope, element) function updateSelectAllCheckbox () { var unselectedRows = $(element).find('.select-row:not(:checked)'); if (unselectedRows.length == 0) { selectAllCheckbox.prop('checked', true); } else { selectAllCheckbox.prop('checke...
1
f94aa7873b6bc6b8d9e46b0841eaa1f5
820e19c6ed7f1e668c5b41cf068489df
Parse out the xml string from the passed chunk data byte array
{ XmlSerializer xs; info = null; int index = packet[dataIndex]; xs = new XmlSerializer(typeof(ChannelInfo)); using(MemoryStream ms = new MemoryStream(packet, dataIndex+1, dataLength - 1)) { info = (ChannelInfo)xs.Deserialize(ms); } return i...
1
6aa1b19925a9af8e57475a8e1bebb662
4efd642095d2123dadb2a6f55772845d
Crée une image de prestation
function create_image($name, $sert, $text, $name_pos, $filename){ $image = imagecreatetruecolor(800, 600); $backColor = imagecolorallocate($image, 255, 255, 255); $textColor = imagecolorallocate($image, 134, 87, 59); $fontFile = './font/arial.ttf'; $imgBox = imagecreatefrompng('./img/sert.png'); ...
1
924fe670aa173c42011c8db020b22c61
2f70b545b88fe25694e55c66dceee329
set player camera dependednt on player type
public class PlayerDot : MonoBehaviour void Start() { if (vrPlayer.transform.root.gameObject.activeSelf == true) playerRef = vrPlayer; else if (keyboardPlayer.activeSelf == true) playerRef = keyboardPlayer; }
0
b83014022a3fec03ddebe8b229192551
02212e50eb2f659afc493f0abb7a4016
Creates Envelope Draft
function makeEnvelope(args) { let env = new docusign.EnvelopeDefinition(); env.templateId = args.templateId; let signer1 = docusign.TemplateRole.constructFromObject({ email: args.signerEmail, name: args.signerName, roleName: "signer", }); let cc1 = new docusign.TemplateRole(); cc1.email = args.c...
0
8b36023baf4e26b1e01e0e131db741f3
0cd5409bcfa6a16532d43f6c01689233
find the ratio of specific heats of the oil-refrigerant mixture
def find_thetal(press, temp, rt): rsat = find_rsat(temp, press) saturated = rt > rsat if saturated: rl = rt - rsat else: rl = 0. lv = find_lv(temp) theta = find_theta(temp, press) thetal = theta * np.exp(-lv * rl / (c.cpd * temp)) return thetal
0
d0c954b05a6125f9d20ef61b878202c1
592d9c3a60229ef5e54e3e9d21e48160
Test 'ping6 <ip> -O -p' on Centos 7.7
class MyTests(unittest.TestCase): def test_ping6_ip_O_D_p_ubuntu_18_4(self): self.assertEqual(jc.parsers.ping.parse(self.ubuntu_18_4_ping6_ip_O_D_p, quiet=True), self.ubuntu_18_4_ping6_ip_O_D_p_json)
0