query_id
string
corpus_id
string
query
string
code
string
label
int64
aa715137f027647f048d2d8add32ea77
12dd70e90f35ae19c002b967421df572
Printing the list of games
BufferedWriter bw = new BufferedWriter (new OutputStreamWriter(System.out)); Zulu_and_Games temp = head; while(temp != null) { bw.write(temp.toString()); temp = temp.next; } bw.write("\n"); bw.flush(); }
1
d4c73e61617b59a44c86c950b5360491
823237d268c139d681c79c17875e3a36
通过汉字男或女得到性别枚举值
{ GenderType gender = new GenderType(); if (strGenderDescription == "男") { gender = GenderType.Male; } else if (strGenderDescription == "女") { gender = GenderType.Female; } else ...
1
112be988bee273f80c96238e9ded0e85
32a6b5032be51ec451b8c4dbf54c5c63
获取注册验证码缓存
{ if (type == 1) { return RedisStringHelper.Get("VerifyCode:BPhone_" + phone); } else { return RedisStringHelper.Get("VerifyCode:CPhone_" + phone); } }
1
79653cde50de3148067219e86f018de1
5aa20086cbe91ad0a2afa14d058ab28d
Set maximum scale hint
evas_object_size_hint_max_set(Evas_Object *obj, Evas_Coord w, Evas_Coord h) { MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); return; MAGIC_CHECK_END(); if (obj->delete_me) return; _evas_object_size_hint_alloc(obj); if ((obj->size_hints->max.w == w) && (obj->size_hints->max.h == h)) return; obj->siz...
1
349dc43fea7b6d366981e96e06f1bc5b
12a5a4faa659d73f136bbd362d31a766
<Snippet20> Duplicate a directory
namespace StoryEditor public partial class TextAdventureMaker : Form private static void DirectoryCopy(string sourceDirName, string destDirName, bool copySubDirs) { DirectoryInfo dir = new DirectoryInfo(sourceDirName); if (!dir.Exists) { throw new Director...
1
99ded303de4093d37ebf71abf79c9787
03618192490d3ea8e08c5037a21bd2ad
Returns the value of the '<em><b>Commentaire Sur Objectif</b></em>' attribute. <!-- begin-user-doc --> <p> If the meaning of the '<em>Commentaire Sur Objectif</em>' attribute isn't clear, there really should be more of a description here... </p> <!-- end-user-doc --> extendedMetaData="kind='element' name='CommentaireSu...
public String getCommentaire();
1
eb09aed02d49cdd4307ddc370cf4f6dc
ce5ca98c8b5a109d76cbf57c87ec14ed
Расчет суммы итоговой оплаты накладной реализации, с учетом возвратов товаров
class Service extends \SoapClient public function CalcOutSumm(CalcOutSumm $parameters) { return $this->__soapCall('CalcOutSumm', array($parameters)); }
1
df153b87a83137d09963e32bec58846e
e6778e5b0c92c3348b9482fcd5a09495
Set vApp Network Config
class Connection def add_vm_network(vmId, network, config={}) params = { 'method' => :get, 'command' => "/vApp/vm-#{vmId}/networkConnectionSection" } netconfig_response, headers = send_request(params) parent_section = netconfig_response.css('NetworkConnectionSection').first ...
1
a1be19a9977dbade4a319e70847ddbbb
6e9672aa8e2e83ea25e33df1190a2e0e
Tests skipping as a noop
func Skip(*testing.T) {}
1
f064a8ed5847a405af57314cf8020189
b70516cec69468a2575f05f350df31a4
从存储器中获取短信验证码
class Sms public function getCodeCache($key, $mobile) { return \Cache::get($key . '_' . $mobile); }
1
388e1b90600cb8d0a283e2fdaf1951d0
cccc4291420bed3542645c57dd053786
全角文字を2, 半角文字を1 とした場合の文字列の長さを返す
class StringUtils public static function len_halved($str, $is_type_float, $is_ceiling){ $len = self::len($str)/2; if(!$is_type_float){ $len = $is_ceiling ? ceil($len) :floor($len); } return $len; }
0
2f5b86506d0e5e1d50cc7f4f83709411
9945a51e6ffdf1200d930b18a9831574
根据含路径和文件名的字符串获取文件名部分
public class FileUtils public static String getPathStringForFileName(String pathStr) { int start = pathStr.lastIndexOf("/"); int end = pathStr.lastIndexOf("."); if (start != -1 && end != -1) { return pathStr.substring(start + 1, end); } else { return null; ...
0
af6d7948b600dc34890af26e84c2fd37
45c40326201e9f88b04ec0af017a7223
判断能否领取低保
export class TipMarkUtil static XunHuanChongZhiCanGet() { if (!G.DataMgr.funcLimitData.isFuncEntranceVisible(KeyWord.OTHER_FUNCTION_XUNHUANCHONGZHI)) return false; let infos = G.DataMgr.kaifuActData.xunHuanCzInfo; if (infos == null) return false; for (let i = 0; i < infos.m_ucListCnt; i+...
0
9445e6cb0a3a096c79313fbaecc9a6e8
f4529d31155a338a0d4774204907988f
获取设备图片的url,缓存
@SuppressLint("SimpleDateFormat") public class StringUtil @SuppressWarnings("deprecation") public static String imgUrl(BaseActivity activity, String url) { String string; String s; if ("null".equals(url) || url == null || "".equals(url)) return ""; s = IUrContant.BASE_URL + url.replace("\\", "/"); if (act...
1
c50737fe1595eaa75110acb0055a0fdf
476bec26a796b8c2a9f80bf155a14eba
function that when interacted with, get player program and equal their health to their max health
public class HealthManager : MonoBehaviour public void FullHealth () { playerHealth = maxPlayerHealth; }
1
3fa3eefc4ae0f2f7ffc8c506ecd369f7
a10a3a45a4dc4807358d68a0b3d180d4
Compute re-weighting 2D pdfs.
def reweight2d(d1,d2,data=None): global gamma, kT, fesfilename, numdat, col_fe, datafile, col_rewt, numrewt, col_bias, ngrid, s_min, s_max,fes if data != None: datafile = data load() numcolv = np.shape(colvar)[0] fes = np.zeros(numcolv) denom = 0. i = 0 for row in colvar: ...
1
5c30809830d62665194e52fcaf2ddddb
a35a1f8003b7506d8a936a6c6d97c1ea
Download the target build from server base on the build url.
public boolean downloadFileWithoutBuild(String param, HttpServletResponse response) throws FudsBaseException;
0
8b63a67c70da505617bc647154dc59d5
265a946aabb160d9fd9a9082ddc25918
将InputStream 转换为JsonNode对象
JsonNode jn=null; if(json==null||"".equals(json)){ return jn; } try { jn=mapper.readTree(json); } catch (JsonProcessingException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } return jn; }
0
5a08a5c919683aabb71376670d75b420
1ecec5122a4a2fe6f98a4cee35511cca
Установка компонентов вектора из наименьших компонентов двух векторов
namespace AlienEngine public static Vector2d ComponentMin(Vector2d a, Vector2d b) { a.X = a.X < b.X ? a.X : b.X; a.Y = a.Y < b.Y ? a.Y : b.Y; return a; }
1
b0261d6bdf9268c18fcfb8dfd7db30e4
dded5cf30edfe5472d29d9d5fdc6d0ab
根据开发人员邮箱检查数据是否存在,若存在则返回id
func searchIDByEmail(email string) int { sql := "select id from users where email=?" res, err := db.Query(sql, email) checkErr(err) defer res.Close() var id int if res.Next() { res.Scan(&id) } return id }
1
458afc5865f1354c406db000189c6555
582a1d6da185149e9ec9b076012b2aae
Converts from version 9 to 10. Version 10 contains hints and solution in each interaction.
exploration_dict['schema_version'] = 12 exploration_dict['states'] = cls._convert_states_v8_dict_to_v9_dict( exploration_dict['states']) exploration_dict['states_schema_version'] = 9 return exploration_dict
0
a2cada042c7472b124c55b08a8f68a85
7cb3f2a743deebe24f3b00da07579f1e
这个跟 LocalDateTime .now(ZoneOffset.UTC) .toInstant(ZoneOffset.UTC) .toEpochMilli() 是一个效果
public class SingleTonTest @Test public void test13() { Long time =1554220737119L; Instant instant = Instant.ofEpochMilli(time); ZoneId zoneId = ZoneId.systemDefault(); LocalDateTime localDateTime = LocalDateTime.ofInstant(instant, zoneId); System.out.println(localDateTime); ...
0
377c5e132f9fc7b424f392b2bf32b87c
ed43fd0ad106ac36219285ca901632be
Generates the contents of the GKE Connect agent install manifest.
namespace Google.Cloud.GkeHub.V1 public sealed partial class GkeHubClientImpl : GkeHubClient public override stt::Task<GenerateConnectManifestResponse> GenerateConnectManifestAsync(GenerateConnectManifestRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_GenerateConnectManifest...
1
6e2166b68be7bfffa27e0233266eb8a9
5362cbe5d80407129245769f5a1f082b
字符串根据关键字截取返还list
def L_listElmCutSubStr(strList,substr): newList=[] for i in strList: newList.append(s_cutSubStr(i,substr)) return newList
1
f0e2eea6ea4f87cd1898ff1070f1b94b
3c1a54f71476bd2b3e413c4497cfe406
This method is used to get back to the comments listpage.
public class CommentBoss extends AppCompatActivity @Override protected void onCreate(@Nullable Bundle savedInstanceState) @Override public void onClick(View v) { Intent intent = new Intent(CommentBoss.this, OwnerHomepage.class); startActivity(intent); }
0
b6769b486f895b02b9933578d5b0139f
44592cff621f870f5a1b1911dae384a9
Changes the `type` attribute on the `input` tag.
if type in HTML_CONSTANT.TYPES: self._set_attribute(HTML_ATTRIBUTE.TYPE, type) else: description = "Type cannot be of value {0}.".format(type) raise InvalidAttributeError([type], description)
1
39c5476e6c3815653688e857d7fa4100
5b538585659bf76c0751d33ea0492079
Comoving Distance Measure
H_0, omega_m0, omega_r0, omega_lam0 = cc.get_cosmology_params() ae1 = 1 / (1 + z1) ae2 = 1 / (1 + z2) dp1_res, dp1_err = cc.proper_distance(H_0, omega_m0, omega_r0, omega_lam0, ae1) dp2_res, dp2_err = cc.proper_distance(H_0, omega_m0, omega_r0, omega_lam0, ae2) dp1 = 3e5 * dp1_res dp2 = ...
1
9246136cb24d4e847b0b47a797c4d194
f20d65b176218614eb96413c6e84c4a0
Describes a runtime map. Issues a v4.0.0 request
{ var descriptor = new SimulateRequestDescriptor(); descriptor.BeforeRequest(); return DoRequestAsync<SimulateRequestDescriptor, SimulateResponse, SimulateRequestParameters>(descriptor, cancellationToken); }
0
2982f820c5021cfac392f2a3473aa710
7a5a9b1f23faffff0e83df64e40a69cc
Mass removal of html attributes to a model.
$target_atts = explode(' ', $target_atts); foreach ($target_atts as $target_att) { unset($this->atts[$target_att]); } }
1
6697de1bc35f780c0dee1b8feafab309
3451b6ebf962d9e60aa1dab2e70a795d
determined by both being JSON array types, and having the same size and same contained elements in the same order.
bool compare_json_arrays(const vector<object>& exp, const value& actual) { auto comp = [] (const object& a, const object& b) -> bool { return a.at("Partition").as_string() < b.at("Partition").as_string() || (a.at("Partition").as_string() == b.at("Partition").as_string() && a.at("Row")....
0
aae801ba421136deb716187a42198f51
dea3f75537619ffd993a5b7b1f92fdcf
Copy the shares to this list
class VolumeManager(object): def refresh_shares(self): self.m.action_q.list_shares()
0
6f50f1e8a2d49918ac59fdeec273f77f
ee725bbdb1ec167c5735794900f79a66
Корутина для движения объекта
public class DoorController : MonoBehaviour public IEnumerator moveObject(Vector3 position, float speed){ while (Vector3.Distance(this.gameObject.transform.position, position) > speed * Time.deltaTime){ this.gameObject.transform.position = Vector3.MoveTowards(this.gameObject.transform.position, posi...
1
0701d1597774ca94644a7b9d2c095c97
398248c83a178093a6181aa327f4d39f
手机找回页面
namespace LongjiangAgricultureCloud.Areas.Mobile.Controllers public class MobileController : BaseController public ActionResult Forgot2(string Username) { var user = DB.Users.Where(x => x.Username == Username).SingleOrDefault(); if (user == null) return Msg("没有找到该用户"); re...
1
fc6dfd04ce1901e2351b05ddf6b75d29
1db5ead20c241424a15a29e28e54dbb3
Gets the view with the specified key.
int childCount = getChildCount(); for (int i = 0; i < childCount; i++) { ChildView cv = (ChildView) getChildAt(i); if (cv.getAttachedKey().equals(key)) { return cv; } } return null; }
1
2e6ab71fa81bbb028f90e5dad141780a
27810854507e89ed870511e3463d6f86
make uncertainty band for ratio plot
def ratio_err(top,bottom,top_low,top_high,bottom_low,bottom_high): top = np.array(top).astype(float) top_low = np.array(top_low) top_high = np.array(top_high) bottom = np.array(bottom).astype(float) bottom_low = np.array(bottom_low) bottom_high = np.array(bottom_high) top_errlow = np.subtrac...
1
6bd8846a58f00679319f6c6de4d1191a
f43166047365116cfa5a4d1579b60b13
ISR for T2
void __ISR_AT_VECTOR(_TIMER_2_VECTOR, IPL5SRS) T2_ISR(void) { IFS0CLR = _IFS0_T2IF_MASK; }
1
9d2fe6da514c829d6cbb15823e2879b1
1d44428e543d04f6c3d4053f11346da8
Assert that a request to an URL returns 404.
{ $fakeData = $this->getFakeRequestData(); unset($fakeData['headers']['referer']); $uri = route('click', $fakeData['request']); $response = $this->withHeaders($fakeData['headers']) ->withServerVariables($fakeData['headers']) ->get($uri); $response->ass...
1
d16a1ccabe36a0f85efafb04a1cfd2f2
29a7e2aa9fae2eb2fb76c6f0cadefd9f
Set text of output to the string that is given by @string@.
namespace Gorillaz class IOinterface public void SetOutput(dynamic str) { Console.WriteLine(str); }
1
86a386431854588c545a9bdec580b71d
748af20d01c820e4d08816477722e76d
CondenseNet specific initial block.
bn_axis = 3 if backend.image_data_format() == 'channels_last' else 1 x1 = layers.BatchNormalization( axis=bn_axis, epsilon=EPSILON, name=name + '_0_bn')( x) x1 = layers.Activation('relu', name=name + '_0_relu')(x1) x1 = layers.Conv2D( 4 * growth_rate, 1, use_bias=False, name=...
1
f072dee6be6cd3f3921938fe6735b102
d33accb44b3c8bb596b4ea0a502368ee
新组合营销 - 审批拒绝后重新编辑 2017-06-23 qincai
@RestController public class Controller @PostMapping("/reEdit") public int reEdit( @RequestParam(value = "dangerId", required = false) Integer dangerId, @RequestParam(value = "limitTime", required = false) Date limitTime, @RequestParam(value = "zhenggaiDec", required = false) Str...
1
10d69a7cc4668838b8ae13e0debbd91e
8a10e00462f000641025ad70a900e47e
Test that studies are set as deleted when removed from dataservice
assign_perm( StudyPermission.READ_STUDY_RESPONSE_DATA.prefixed_codename, self.researcher, self.study, ) self.study.admin_group.user_set.add(self.researcher) self.study.lab.admin_group.user_set.add(self.researcher) self.study.save() self...
0
910c947a09e35decd2e7549f4e5ff37a
7599a56754c84bcc06f2153a72001ef3
Evento para escuchar los clicks al clickear en un cliente.
{ var idCliente=((Button)sender).CommandParameter; NotasDelClienteForm notasDelClienteControl = new NotasDelClienteForm((int)idCliente); notasDelClienteControl.Show(); }
1
79bc9708b63b55aeec98ce46b2acb2ec
7c5c0e79e3de7f762b40aba8a5dc475c
Outputs the reply natural time (e.g., 1 month ago, 5 minutes ago, etc.)
$reply_id = mb_get_reply_id( $reply_id ); $format = !empty( $format ) ? $format : get_option( 'date_format' ); return get_post_time( $format, false, $reply_id, true ); }
0
cb1c33161eee5eadb3cca1d6f8fdf691
995848ecd176cec06e175234892f5985
학생들 사이의 친구관계가 myInput으로 주어질 때, 정원이가 퍼트린 소문을 듣게되는 학생의 수를 반환합니다.
public class level08_01 public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLine()); int a = Integer.valueOf(st.nextToken()); int b = Integer.valueOf(st.next...
0
91a6db11bb76f907c645c3cd951fe69e
7ca3ea1d0b17efc9820706d79e4ccdb9
genera un JSON contenente tutti i servizi di una macchina
switch($_REQUEST['call']) { case 'get_all_services': $data = $this->oep->get_all_services(); break; } if(!$data) { echo 0; } else { echo json_encode($data); } wp_die(); }
1
ed2a0e54d442d126c0199fb252b808fa
12861da558f939a91bc5ad5c0101d75b
product表和categorysecond表关联查询,根据categorysecond表cid字段查询
List<CategorySecond> getCslistByCsid(ProductExt product);
0
40eda3cb4e77baef5d5550712e32c692
b72bd9c742cf8ad7c089062db7addac7
Show all events for a day
void Day::printDay(){ for (int i = 0; i < eventCount; i++) { eventList[i].printEvent(); } }
1
9d9bb81741e5cd3f0900207927591001
abed42cb892f5e7ad29f8257c64425e5
Unequip oItem from whatever slot it is currently in.
{ if ((item != null) && (source.PairedSlot != null) && (!source.PairedSlot.IsEmpty) && (source.PairedSlot.ItemInstance.Item.Hands == 2)) { _character.UnequipItem(source.PairedSlot); } if ((source.PairedSlot != null) && !(item == null) && (item.Item.Hands == 2)) { _character.UnequipItem(source.PairedS...
0
0e27b5056dbfabd3fac687e2d996edf8
7853520d82468e1a6f2af790366d4737
Returns a new object of class '<em>Live Pan Set</em>'. <!-- begin-user-doc --> <!-- end-user-doc -->
@XmlRegistry public class ObjectFactory public com.ctl.as.domain.geo.v2.GetServiceAddressLiveResponse createGetServiceAddressLiveResponse() { return new com.ctl.as.domain.geo.v2.GetServiceAddressLiveResponse(); }
0
a692ecff74d5343d21aefab7b02ce7ec
edb0b6fe9e51fbbbf5d5923f844e029a
Calls any listeners to tell them about a piece up event.
public void onOnePieceChanged(@NotNull final FilePartition filePartition, @NotNull final int pieceId) { Log.i("Piece #" + pieceId + " is completed."); for(final Map.Entry<Peer, PeerToPeerInformation> currentInformation: mConnections.entrySet()) { final PeerToPeerInformation information =...
0
92387e995e5b57f5beb2980f7ff64656
d6b3fd187d40286c26e701121f1fa4da
Updates the database with the current state of the <paramref name="entity"/>, using a temporary <see cref="ISession"/> that is disposed of at the end
{ bool ifRollBack = false; try { if (ifMangeSession) { OpenSession(); } m_currentSession.Update(inputEntity); m_currentSession.Flush(); return true; ...
1
18fbe9c87e70bd001f57234460b78521
40dde280ac234e123c0d89b6eaae24ff
Cancels the copy operation.
public class Global public static void CancelFileCopy () { sagex.SageAPI.call("CancelFileCopy", (Object[])null); }
1
71e3c5d7696b711c88082693d48bc555
ba5e6208eafa5d02c4c746e0efc67a6d
Starts the preprogrammed blinking sequence. <para> The sequence is run in a loop until it is stopped by stopBlinkSeq or an explicit change. </para>
class YColorLed extends YFunction public function startBlinkSeq(): int { return $this->sendCommand('S'); }
1
9a06a39dc16a05d96545c5a34225536d
101226e53d65513bc029d4997c4d4668
Check if the input contains number and letter only.
function isAlphaNumeric(input) { return validate(/^[0-9a-zA-Z]+$/, input); }
1
f18d6845803ecd3a15f9bf3d87147bcc
f1d187cfd96674d794e93ad7080d34ba
Display a listing of the FacturaProducto.
class DetalleFacturacionController extends Controller public function index(Request $request) { if (!$request->ajax()) return redirect('/'); $buscar = $request->buscar; $criterio = $request->criterio; if ($buscar==''){ $detalle_facturacion = DetalleFacturacion::join('fact...
1
41e922cfc5f8ce5039dd695e6753726a
024eb317528af5edc39520f8bf70d2a5
Get the shared var library instance.
public class ActionLibrary public static ActionLibrary getInstance () { return actionLibrary; }
1
cf20f6b1858a1fb47c55d94adde0c8a9
66699f2f6fbcbcd58d9bcb79396571f8
Returns the pointer to PCI device configration space
UINT64 SerialIoSpiPciCfgBase ( IN UINT8 SpiNumber ) { return PCI_SEGMENT_LIB_ADDRESS ( DEFAULT_PCI_SEGMENT_NUMBER_PCH, DEFAULT_PCI_BUS_NUMBER_PCH, SerialIoSpiDevNumber (SpiNumber), SerialIoSpiFuncNumber (SpiNumber), 0 ); }
1
840b685cd7b6ca51f24f3fafe5cc08f0
3266a0afc5e5b4341cabbc2045bda6e3
Get the amount still owed for the transaction
public class Transaction double getAmountReturned() { return amountReturned; }
0
e0c59a2699842886074d617948fb3d64
86fd27dfb8bc55b6a7c4fa2cca76b189
Register quicklink filters
$this->base = Soliloquy_WooCommerce::get_instance(); add_filter( 'soliloquy_output_classes', array( $this, 'output_classes' ), 10, 2 ); add_filter( 'soliloquy_pre_data', array( $this, 'pre_data' ), 10, 2 ); add_filter( 'soliloquy_output_item_classes', array( $this, 'output_item_classes' ), 10,...
0
9b1db245441198bb00ec95eb8dffea42
76ef825d9c6af3eaf4298f0073f77ecd
Based on https://gist.github.com/steen919/8a079f4dadf88d4197bb/d732449eb74321207b4b189a3bcbf47a83c5db65
function hslToHex({ hue, saturation, lightness }) { const a = (saturation * Math.min(lightness, 1 - lightness)) / 100; function f(n) { const k = (n + hue / 30) % 12; const color = lightness - a * Math.max(Math.min(k - 3, 9 - k, 1), -1); return Math.round(255 * color) .toString(16) .padStart(...
1
69be7fd0ca1d79eee093d03f9375a787
49e8ede94d877a02a93ef9b955051a9a
根据渠道channelid获取所有到签约历史记录
if (StringUtils.isBlank(channelId)){ channelId = "test_channelId"; } SettleChannelDOExample exam = new SettleChannelDOExample(); exam.createCriteria().andChannelIdEqualTo(channelId); return settleChannelDAO.selectByExample(exam); }
0
050bb31bf98156947804f9f382781f76
217eac24f9a9869f4135014a821bf2b9
this is just the multiplication element to element of two lists
list3 = [] k = 0 while k < len(list1): list3.append(list1[k]*list2[k]) k += 1 return list3
1
fc3a4693f3a54cdbe17884d48cd638ef
f72fdb80c6aae64925c1117fe922d4e7
Asserts the first argument is greater than the second argument. <para> If the assertion fails, the method adds the values and comparison to the error message so the user does not have to supply this information in the <paramref name="message"/> argument. </para>
namespace Testing.UnitTest public static class Assert static public void Greater( IComparable arg1, IComparable arg2, string message ) { Assert.Greater( arg1, arg2, message, null ); }
1
6334caeb3c1db8eca05d4f91aaf27141
e7107cb453c40989967423a38aa8c357
Metodo che ritorna true se i dati inseriti dall'utente sono validi, altrimenti ritorna false
public class ListenerRegistrati implements ActionListener private boolean controllaDati() { if (!( frmRegistrati.getRBhoLetto().isSelected() && frmRegistrati.getRBdatiPersonali().isSelected() && frmRegistrati.getRBautorizzo().isSelected() )) { retur...
1
69d70debcce2c63f242b41a79fa5369f
27cdbb0e26943b0c2f25ade7c2cdaba4
Runs the rule set against the current cell and its neighbour count. Returns the final cell state.
public class Cell public boolean getNextState() { int greenNeighbours = countGreenNeighbours(); if (isGreen) { return greenNeighbours == 2 || greenNeighbours == 3 || greenNeighbours == 6; } else { return greenNeighbours == 3 || greenNeighbours == 6; } }
1
f7f313654217bf893bac5412da240414
561d4f7bc5921dbe9fb25c024e9c9c16
Сравнить лекторов по среднему баллу за лекции
namespace WindowsFormsApp15.Data class DataSearch public double AverageRatingForLecturer(Lecturer lecturer) { double sum = 0; List<Course> courses = GetCoursesByLecturer(lecturer); foreach (Course course in courses) { sum += AverageRatingForCou...
1
2dd89336509d1276c5c5caf6c394ce0e
ef69fbc8f6e3774f23eba0e262ae8ae5
Returns the meta object for class '{@link it.univaq.coevolution.emftext.emig.language.emig.MParameter <em>MParameter</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
EClass getMParameter();
1
06f6a5414cf110a6a0424d966920a670
09fba8d0621ea8889ce3c45af856ade0
Counts leading zeros. Used in Merkle tree hash validation .
namespace Redzen public static class MathUtils public static int LeadingZeroCount(ulong x) { if(x == 0) { return 64; } return 64 - (Log2(x) + 1); }
1
df26be8f29fff29b5021e5d5a0f6719e
6afa1d37473ef933c791d5b7d29a2a9d
Redirect the user depending of him being connected or not
class SecuredBaseController extends BaseController protected function manageUnconnectedUser() { if(! $this->isUserConnected()) { return $this->redirect('fos_user_security_login'); } }
1
e1bd16b84f6f2fdf48fe6be2d1c0f962
2b749dcedcf2565396b1d45f65504a7a
Executes selling of a product with the given id. Decrease number of related articles. Method should ensure data consistency using appropriate locking on articles.
{ Article matchingArticle = this.Article ?? Article.LoadByArticleNumber(this.InternalArticleNumber); if (matchingArticle != null) { matchingArticle.SoldCancel(this); } }
0
e66ea685758325526a5a3230fbcb9302
3724ba853f638eef8633ae90f1749917
Синхронизирует значение в цифровом input'e с его отображением на ползунке
function syncCharacterAmount(e) { var value = e.target.value; characterAmountNumber.value = value; characterAmountRange.value = value; }
1
2170f2ccd914dac79f1b205232c175b1
59ecdbf8d3c8c7a817847662d82950dc
调用打码接口获取图片角度
public class HttpUtil public static void getCode(Object tag, final GetCodeListener getCodeListener) { OkGo.get(TextUtils.concat(UrpUrl.URL, UrpUrl.URL_YZM).toString()) .tag(tag) .execute(new BitmapCallback() { @Override public void onSucces...
0
136907ed0f594097a616ff4f9869cf65
0d51d50c3e9730ad707c42a09f00eb7c
# Compute payer swaption price
{ S0 = data['Var2'] Maturity = data['Var1'] d1 <- (log(S0/K)+(r - div + 0.5*Sigma^2)*Maturity)/(Sigma*sqrt(Maturity)) d2 <- d1 - Sigma*sqrt(Maturity) if(opt_type == 'c') { return(S0*exp(-div*Maturity)*pnorm(d1, 0, 1) - K*exp(-r*Maturity)*pnorm(d2, 0, 1)) } else { return(-S0*exp(-div*Maturity)*...
0
535741046972c90d427e9c6bc7723017
1b0ce82d9533a980eea3c3b1303abce9
Returns the value of the '<em><b>Agent Stack Size</b></em>' attribute. <!-- begin-user-doc --> <p> If the meaning of the '<em>Agent Stack Size</em>' attribute isn't clear, there really should be more of a description here... </p> <!-- end-user-doc --> extendedMetaData="kind='attribute' name='AgentStackSize'"
itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_DB2Manager_agentPoolSize_feature"), getString("_UI_PropertyDescriptor_description", "_UI_DB2Manager_agentPoolSize_feature", "_UI_D...
0
c214c846ccfe559bcc3d14cc7fa8e103
514605b67b753ba9fb4380c3119e16b1
Remove the archives directory if it exists
class TaxiUpdatesPackage extends TaxiObject public function removeOldArchives() { $dir = $this->getArchivesDir(); $helper = new TaxiFilesHelper(); if (is_dir($dir)) { $helper->removeDir($dir); } }
1
1458fa2bd20a062a83af2db9863c32c8
c6f488bf178611ddaf2cff1e1e22ff17
Get information about a given List of summoners.
url, query = SpectatorApiV3Urls.by_summoner( region=region, summoner_id=summoner_id ) return await self._raw_request(self.by_summoner.__name__, region, url, query)
0
145c01bd7cd744459cf4989c7a94df61
2ac1c332df016e97c90cd24cd05a9611
解析出search请求中的 数据库名列表
def get_db_list(db): if not db: return [] else: return db.split(',')
1
ef4150cf19ae5b01ae504045e7365fee
58cf160582f8569fecc15b1bee2e55d3
Get certificate file extensions.
public function getExtensions(): array { return $this->extensions; }
0
06ee0a31d46b1b2ea186ba2fd2f6296a
f649a1768f224916491fd97f3f0b8f85
AdImageUploadV2 上传图片v2接口
func AlibabaIcbuPhotobankUpload(clt *core.SDKClient, req *icbu.AlibabaIcbuPhotobankUploadAPIRequest, session string) (*icbu.AlibabaIcbuPhotobankUploadAPIResponse, error) { var resp icbu.AlibabaIcbuPhotobankUploadAPIResponse err := clt.Post(req, &resp, session) if err != nil { return nil, err } return &resp, nil ...
0
7b0be8921c6cb9bd1fcd895c73e32abc
b3d7f0ff539cd641b8ad4dfb07fa25e1
True iff no value has ever been added to the stream.
@OptIn(ExperimentalContracts::class) @JvmInline internal value class MutableTestValueClassList(val list: MutableLongList) public inline fun none(): Boolean = list.none()
0
74efd55b5bc0aa5d5a7fbfc8672d5969
dd60c9508e356524729937e1b38aa993
获取最近lines行消息记录
class State: def get_last_n_lines(self, n): return self.last_lines[-n:]
1
5a3c6aa9dc7961b908e58634710b9a6f
27409dc38f60e36d08bc36e5ae91be1f
。这段代码的意思就是读取一个128位的随机数,然后转换为Java的byte数组
public class SecretManager private char[] seed0(){ beginTime=System.currentTimeMillis(); char[] ch8=new char[8]; String temp=String.valueOf(beginTime); StringBuilder sbu=new StringBuilder(); if(temp.length()<8){ sbu.append(temp); for(int i=0;i<8-temp.lengt...
0
80282ab8e591c0df3f9ae7a5b1c701ac
378ac846abe15212bc66ea144bd1f28e
Returns the meta object for the containment reference list '{@link kieker.tools.slastic.metamodel.typeRepository.ComponentType#getOperations <em>Operations</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
EClass getOperationType();
0
ac22f5b4db2684c137161200a2fe7523
9fdec574bc1ac4390d6a79147acbb504
指定したTokensを使用して、AccessTokenを作成し、追加します。
List<OperationClaim> operationClaims) { var jwt = new JwtSecurityToken( issuer: tokenOptions.Issuer, audience: tokenOptions.Audience, expires: _accessTokenExpiration, notBefore: DateTime.Now, ...
1
303c3e4224c9ff6b62c9c2300c905079
6834964840d3cf2e9af2357491584479
Load dependencies from requirements file
load_env_file(env_file) if is_install_deps: requirements_path = REQUIREMENTS if Path(REQUIREMENTS).exists() else None do_install(ctx, requirement=requirements_path)
1
44730de20d9c815d1ee964766305d04b
c3bbc409569aeaa1cfd1ad7ac3b47405
Initialize and allocate memory for reporter.
void kubsan_init(void) { kubsan_reports = (void *)uvm_pageboot_alloc( sizeof(struct kubsan_report) * KUBSAN_NSLOTS); kubsan_cold = 0; timeout_add_msec(&kubsan_timo, KUBSAN_INTERVAL); }
1
74440dfa4bea33eee15de0043daff88e
386e71573b10457b43ed6c64bfc579fd
Event listener called just before entity copy.
class Items extends DataModel protected function onBeforeCopy() { $this->onBeforeCopyVersioned(); $this->enabled = false; }
1
1b1390ca822b0f77d885c439c57e4e70
6cf3ed78ccf6f3066f5fac319f7f2598
获取当前登录用户及其所关注用户的最新微博。 暂时不带参数
$url = Comm_Weibo_Api_Request_Platform::assemble_url(self::RESOURCE, 'by_me'); $request = new Comm_Weibo_Api_Request_Platform($url, 'GET'); unset($url); $request->add_rule('filter_by_source', 'int', false); $request->support_cursor(); $request->support_pagination(); ...
1
8674f2f284fd40b047500aa1759e409f
0114377ed799f2ee7c4f270910c297d6
Aktualisiert alle geänderten oder neuen Angebote des angegebenen Kunden.
namespace Products.Model.Services public class ProductService public void UpdateProducts(Kunde kunde) { DataManager.ProductDataService.UpdateProductCpm(); DataManager.ProductDataService.UpdateSonderpreise(kunde.CustomerId); }
1
e1751e6a6835c5469e8dd95baa9aa941
12aef92ca87fb435baf260b402b5281c
Set the max level of logs to be printed in standard-output. Only log-operations with level less-than or equal to the echo-level will be printed to standard-output. This method affects all logging operations afterwards, and does not affect any logging performed before-hand. Default level is INFORMATION.
class Logger: def setLevel(self, maxLevel): if isinstance(maxLevel, str): tmp = self.kLevelMap.get(maxLevel.lower()) if tmp is None: raise ValueError(maxLevel) maxLevel = tmp if maxLevel > self.kDebug: maxLevel = self.kDebug elif ma...
1
7ef86aa0f645b079d37ea673111fec51
d5baa863f6e4bf049030f5cecd8c329c
Initializes the chrome engine.
args = { 'headless': True, 'dumpio': False, 'autoClose': False, 'handleSIGTERM': True, 'handleSIGINT': True, 'timeout': 0, 'handleSIGHUP': True, 'args': [ '--no-sandbox', '--disable-gpu', '--disable-infobars', ...
1
15041f05a6dc5833a5d48e51e21c29b0
a829ae94a91379f21bcd6b4964953017
Replans paths for all registered agents for map, considering all current observations
boolean calculateAgentPaths();
1
c1ebcc6acd3f76bb578135f0d1040ecc
a5aeb0f278b82ffae9b394e29b5bfb1c
Constraint to ensure the capacities are kept constant across all the subproblems.
self.n_items = param_dict['store_capacity'].shape[1] self.n_stores = param_dict['store_capacity'].shape[0] self.n_warehouses = param_dict['warehouse_capacity'].shape[0] self.store_item_to_warehouse = param_dict['store_item_to_warehouse'] self.addConstant() self.addPara...
0
7accaa8ff4386f697e2b774495b6cd3d
e7460e4495a6b0ccc15a2e20e9fd05f3
Get the Singleton instance of the WindowManager. The WindowManager is created if it does not yet exist.
public class AutomationServer implements Runnable static WindowManager getWindowManagerInstance() { return windowManager; }
0
243c27024ec3af9a4c2fbbdbcb21d4d3
5a772ce1e11d4654c585215a480f7ed1
Saves a new product's stock record
$this->getAndPrepare('products_stock_id', $get, $products_stock_id); $this->getAndPrepare('productStockBarCode', $get, $productStockBarCode); $data = array( 'products_stock_barcode' => $productStockBarCode ); amDB::perform(TABLE_PRODUCTS_STOCK,$data, 'update',"products_stock_id='$products_stock_id'"); }
0
434ff23aa39422512b296d556dd99732
3394bea029c45619d0fe77c2f0cbdc9a
Sets the top score of the specified game level for the user account.
this.l3EasyBestScore = l3EasyBestScore; gameDB.execSQL( "UPDATE users SET l3EasyBestScore= '" + l3EasyBestScore + "' WHERE username = '" + this.getUsername() + "'"); }
1
1d0060d1dd129217d8fbfc01c0df4e96
55da7d694f3abfd24884fc7b153325f8
Obtém todos os acessos para o perfil informado.
{ try { return BOAcceso.ListarAcceso(pIdPerfil, pUsuario,""); } catch (Exception ex) { BOExcepcion.Throw("CierresService", "ListarAcceso", ex); return null; } }
1
73d701ba16a3bb1bec9b15d0b294e1cd
e57961438e8fb5cf974792d8d166fe55
Make sure that the buttons are refreshed when something in the listbox has been clicked
namespace locationserver public partial class WindowInterface : Form private void refreshButton_Click(object sender, EventArgs e) { dictionaryListBox.Items.Clear(); updateDictionaryListbox(); }
0
d3fce110add8ba683dafddd9528894a2
061347a1418e50ecbdbf9de1696b5b85
获得机器人软件Joint最大限位
limit = ctypes.c_double() result = motion_api.LCA_GetAxisPosMax(self.handle, ctypes.byref(limit)) qmixbus.throw_on_error(result) return limit.value
1
2c31cf18ea2e7fba032fb1053d6ba7b7
55ae0035dfc9388946d35bcafab13053
Send verification email to user on request
{ $('#spinner').spin({color: '#fff'},'tiny'); $('#spinner').reveal({animation:'none'}); $.post("../client_api/user.php", { request : "send_email_verification" }, function(result) { var obj = jQuery.parseJSON(result); if (obj.status == 0) { $('#spinner').trigger('reveal:close'); $('#spinner').spin(false)...
1