query_id
string
corpus_id
string
query
string
code
string
label
int64
9693c3ba9b6e37a95423b9e2d2601afe
8bbaec7243b1ed76421d6f105570ec9a
Display completed tasks assiged to logged in user
global $db; if (isAuthenticated()) { $user = get_object_vars(decodeAuthCookie()); try { $query = $db->prepare('SELECT * FROM tasks WHERE user_id = :userId AND status = "1" '); $query->bindParam(':userId', $user['sub']); $query->execute(); $resu...
0
2fc82e25ee0618f99dced94c0cf0ea40
2dd246558f6427ba4017d5a82e93bbbc
adds an item and sorts the list
void CListBoxWidget::AddItem( const DWORD dwSetKey, const WCHAR *pwczSetText) { LBOX_ITEM *pNew = new LBOX_ITEM; pNew->dwKey = dwSetKey; pNew->pwczText = new WCHAR[WCSlen(pwczSetText) + 1]; if (!pNew->pwczText) { ASSERTP(false,"Bad pwczSetText or alloc failed."); return; } WCScpy(pNew->pwczText, pwcz...
1
369115f648f9181c28aa7c0cd72644bb
1922cfe2fd547f7839fa2599418915d6
Finds the Mailing model based on its primary key value. If the model is not found, a 404 HTTP exception will be thrown.
class MailController extends Controller public function show($id) { try { return response()->json($this->findModel($id)); } catch (\Exception $e) { return response()->json([ 'success' => false, 'errors' => [[ 'code' => $e->g...
0
d951cfbfbf43b4b88740f7415802dbea
356f816eb649d50e2d04041b8e68fbe4
Task 1: Write a function called int_return that takes an integer as input and returns the same integer.
def give_me_an_integer(): return 1
0
307d398df7afa59b1f8d44d09c732903
1653c4ad5b3d59346887898a6acfa8a2
Is credit points amount valid?
class BookModel extends Model public function validatePayWithPoints($payWithPoints) { return intval($payWithPoints==true); }
0
35d26bf73287a6615160888567c900d0
10f23ad59a6825a811512b62811abbd6
floyd算法遍历出所有点之间的最短路径和记录路径
public class Graph public void floyd() { int len = 0; for (int k = 0; k < dis.length; k++) { for (int i = 0; i < dis.length; i++) { for (int j = 0; j < dis.length; j++) { len = dis[i][k] + dis[k][j]; if (len < dis[i][j]) { ...
1
03c1c12f74acedaaa931fcff9442061f
6d2a63afcb59bd1831a504fc06598aa2
RECLAIM DELETED INODES The following thread scans the file system once looking for deleted files
struct ext2_inode i_info; read_inode_info(inode_num, &i_info); if((i_info.i_mode & 0xf000) == 0x4000){ int i, j; int num_entries; for(i = 0; i < 12; i++){ if(i_info.i_block[i] == 0) continue; struct ext2_dir_entry_2 *directory_entries; ...
1
429f6d66d28bff05704622ac39c0c894
bbbcbb00cea20d772a155b8381287d27
Test the ToListOf converter.
public void testMapToList() { TrelloMapper trelloMapper = new TrelloMapper(); List<TrelloListDto> trelloListDtoList = new ArrayList<>(); trelloListDtoList.add(new TrelloListDto("1", "new", false)); List<TrelloList> trelloLists = trelloMapper.mapToList(trelloListDtoList); asse...
1
27a17dd4ce978684a7b17a59e0d61880
1c14fb36d87cc8ed93cfb49589b80f3b
Cerrar todas las tabs excepto la de uso actual
namespace AMLHelper.Controller public partial class TabController : UserControl, INotifyPropertyChanged public void CloseAllTabs() { ResponseTrigger.MarkBusy(); for (int i = TabView.Items.Count - 1; i >= 0; i--) { TabItem tabItem = (TabItem)TabView.Items.G...
0
734cb05efc81b0297be399e0159e1907
482f63e3d6c166b35b7df4a0b04317fb
Returns the comma-separated list of argument values.
class ListField(Field): def str(self): return " ".join([str(el) for el in self._arg])
0
d62d2f81e1027cd9d82341e7ded75f63
9b1940273ae466c94c1c450dc8eb4f3d
将URL转化成bitmap形式
public class BitmapUtils public Bitmap getBitMBitmap(String urlpath) { Bitmap map = null; try { URL url = new URL(urlpath); URLConnection conn = url.openConnection(); conn.connect(); InputStream in; in = conn.getInputStream(); map ...
1
758ae2f2b1725bb8ac51e0ded84e4170
8bba65032da38bcc3a60baa5b5afc3e3
将fruit_item 布局加载进来,然后创建一个ViewHolder实例, 将加载的布局传给ViewHolder的构造函数中。就可以获取布局中的控件
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.fruit_item,parent,false); ViewHolder holder = new ViewHolder(view); return holder; }
1
e603f692e7d4dfb3c5fe9c8b3e1fd38e
4af4fd583891ea7618c1e25408a9a359
Load entries for converting to compressed codes.
public class DataInCodeCommand extends LinkEditDataCommand public List<DataInCodeEntry> getEntries() { return entries; }
0
7a9b674fd50389523c59934efbb760ae
89ea60ce7497de54703c3f0993d099b4
创建数据并且返回编号
public int create(${className} ${classNameLower});
1
7d69136455d4840bc696841bdc34cc7d
145f1d1eee1f362a8ad87145b4cd0e5a
Получаем инфонрмацию о категории по транслиту названия
{ $culture = sfContext::getInstance()->getUser()->getCulture(); $query = self::getInstance()->createQuery('c') ->innerJoin('c.Translation t'); $c = $query->copy() ->where('t.slug = ?', $slug) ->andWhere('t.lang = ?', $culture) ->andWhere('t.is_...
1
420f7d0e0037c13cd97fae556651ae6b
d77f227c0792871e411e154cda9cd205
Normalizes choices into values for Solr query. Transforms predefined ranges and validates choices. The result is always an array with two values (start and end).
result = [] if self.values is not None: result = self.values.split('|') if len(result) == 1: result = result[0].split('-') minval = result[0] maxval = result[1] minplus = '+' in minval maxplus = '+' i...
0
927c0acf114902baba4ca6394a76024b
3a6f19df38c438a3512e9917d63698c7
Listener welcher darauf reagiert wenn das Fenster geschlossen wird
namespace TransportGUI public partial class Abfahrtsplan : Form private void Abfahrtsplan_FormClosing(object sender, FormClosingEventArgs e) { Application.Exit(); }
1
4cf12d6407d95f40205943b33baafbc0
d5b584bfcd60eaa7f2c7b8fa7fff2f45
Add filter by orderId and verify that only the details of the orderId which was passed on filter is displayed in History book
class Detail extends AbstractFilter public function filterCustomerHistory($custID) { $q = SalesHistoryQuery::create(); $q->filterByCustid($custID); $q->select(SalesHistory::aliasproperty('ordernumber')); $ordn = $q->find()->toArray(); $this->ordernumber($ordn); $this->query->sortBy('oedhyear', 'DESC'); re...
0
3d63a71160a2e9c8410ed2ada4fb225d
38182e5acac0df505b3bca94cb6d1432
从所有数据源得到属性,这里是多个ZooKeeper
StringBuilder sb = new StringBuilder(); sb.append(ConstantPath.ZOOKEEPER_SEPARATOR + ConstantPath.DS_ROOT); for (String path : paths){ sb.append(ConstantPath.ZOOKEEPER_SEPARATOR + path); } return sb.toString(); }
0
b4bed5eea4f1616d91a263f8e46bb00b
2b13855c9372894a6436ccc083137c09
将dataFrame格式数据导入数据库表tb,默认数据库链接。
tb_name = get_name(infile) conn = sqlalchemy.create_engine(conn) code = encoding if encoding else judge_code(infile) it_df = pd.read_csv(infile, delimiter=sep, encoding=encoding, chunksize=200000, dtype=np.object) if_exists = 'append' if appending else 'replace' for ii, df in enumerate(it_df): ...
1
a38d8846a78ae38e104410edeb132f67
eaec5e9a218c90fa3e0cc89400136e47
Test that the correct names of active customers is returned
class TestBasicOperations(TestCase): def test_list_active_customers(self): setup_db() result = list_active_customers() self.assertEqual(3, result)
0
ea6a52f88e99f5dbecce5fce3b18b803
62fe5b92b627d3c90105334b61ee361f
Test inserting into a filled priority q, with priority already present.
def test_inserts_two_val_same_pri(priq): priq.insert(6, 1) priq.insert(44, 1) assert priq.pri_dict == {1: [6, 44]}
1
44cdb787c796ca998f0cc8a3274cd052
887eaa2c4cc35e6cc352ea0c2ec639f5
界面控件_取得播放前等待
double CTMMovieCtrl::GetMinTime() { return m_Player.m_dMinTime; }
0
b1c09f48a7fa3ab26c7b051a141d58ca
08b43ad699c35ba5e22ffb56160a8883
Return the partition of the nodes at the given level A dendrogram is a tree and each level is a partition of the graph nodes. Level 0 is the first partition, which contains the smallest communities, and the best is len(dendrogram) - 1. The higher the level is, the bigger are the communities
starttime = timeit.default_timer() nodeLevel={} for n,lvl in nx.single_source_shortest_path_length(self.G,start).items(): try: nodeLevel[lvl].append(n) except: nodeLevel[lvl]=[n] return nodeLevel,timeit.default_timer()-starttime
1
71274bb1847b25600280a8114343a69d
aabde4023d67112de3c536574af8bd4e
add an additional objective function
class OASProblem(): def add_objective(self, *args, **kwargs): self.prob.driver.add_objective(*args, **kwargs)
1
07bae7f553a501dc1b9f29e60fa56b20
b1f99cd6e27dd8a09625fcb5d894c6c8
Default execution for API methods.
abstract class ApiActionBase abstract protected function execute($params);
0
855eaba66e2eb302b01d73de2167ab39
f258461d77082b1a767bd72c7e6a4c60
Get the currently configured cache implementation for template calls.
class Zend_Cache_Manager public function getCacheTemplate($name) { if (isset($this->_optionTemplates[$name])) { return $this->_optionTemplates[$name]; } }
0
51b17658cf54fe2a8dec249d15b9fc26
2e2f1d278e984e90c0cf21c234a456da
연봉에서 총 공제액을 제하여 리턴
public class Disability01_01 extends AppCompatActivity public int appraisal(int business01, int property01, int public01, int free_hiring01, int free_food01, int work01 ){ int ect_month = business01 + property01 + public01 + free_hiring01 + free_food01; ...
1
fb896246d9918ec76821a9fc66fa3f69
8e5d71143b1c1c75fd4b5de5e676b472
! true iff the thread is suspended
public class ExtendedThreadInfo implements ExtendedThreadInfoMBean, Serializable @Override public boolean isSuspended() { return delegate.isSuspended(); }
1
41817cd035b0edd664fa08775d6df6a1
1abbc29d404ce3c79f8812b747c9bb46
Funzione utilizzata per pagare quanto dovuto dopo un'asta. Attualmente impiegata solo dalla versione delle simulazioni non bufferate.
public double userProfit(IncentiveNode n, double price, double authorRate) { return price*(userIncentiveRate(n, authorRate) - 1); }
0
17c393bbc62581c2fae8e81c09bfb81b
6f137f23560c5e660582468fda77b147
是否为服务器插件
try { return __isServer; } catch (e) { return false; } }
0
2fd48d1109cfcee4007e3812b5bfd77a
3821e6500e080b3a83a474b47421f0f6
Changes batchsize depending on the performance of the reward
class FixmatchExperiment(training.Experiment): def __init__(self, distribution_strategy, hparams): super().__init__(distribution_strategy, hparams) self.hparams.learning_rate.base_lr *= self.batch_size / 256
0
db5637f7b436bc8f28d857b9769d807a
6734d7b76d1142b1b495a8be9a0648a9
返回客户的名称字符串,多个pk_customer使用|分隔,返回的name也使用|分隔
{ var str = ""; if(GridA.Data.length > 0) { var len = GridA.Data.length; for(var i=0;i<len;i++) { str = str + GetClientObject(GridA.Data[i][0],GridA.Data[i][3]) + "|"; } } if(str != "") { str = str.substring(0,str.length-1) } return...
1
636ddf87d138852416a92fe542801123
3c5f5a54d413ee71aaf34c751c4f3c91
Randomly samples sequences and outputs to files.
def sample(sequences, samples, ordering = None, material = 'rna', dangles = 'some', T = 37, multi = True, pseudo = False, sodium = 1.0, magnesium = 0.0): args, cmd_input = \ setup_nupack_input(exec_name = 'sample', sequences = sequences, ordering = ordering, material =...
1
16ca5d1f57de3e0513d7eaf9b180bbb7
48cdc9b9fbf2c74a2e366fb962061ee1
Gets "system" information. Calls snd_seq_system_info() and puts the relevant values into the passed array.
RETRO_API void retro_get_system_info(struct retro_system_info *info) { memset(info, 0, sizeof(*info)); info->library_name = TIC_NAME; info->library_version = TIC_VERSION; info->valid_extensions = "tic"; info->need_fullpath = false; info->block_extract = false; }
0
e91efa58ab483eba0815c51a609a0223
d32595193ee9694aae883bc556489a2f
Test for PhilippinesZoneI
{ $this -> object -> setData (pi ()); $this -> assertTrue ($this -> object -> isValid ()); }
0
4fb0474addd36b727b36d975b0f79780
ea1b990504e0c40289b0f89cc67d1a22
加入到"我的商品"清單 (代表已按下新增按鈕)
if (($this->session->userdata('usr_id') != "")) { $userid = $this->session->userdata('usr_id'); $this->product_model->addwebList($userid); } else { echo "0"; } }
1
9b34f0001cb078d198306fdcdc0c7504
b66da158d5abf514fc828836bef58e20
Not required for this operation.
public class MakeRightClusterOperationImpl extends MakeRightOperationImpl<ClusterPresenceInfo> implements MakeRightClusterOperation @Override public void addToPacket(Packet packet) { }
1
7b49363225ef26d3d9c68128fccda8bf
993fbc77c99b8431b3c80fc770ee0552
Keep track of indices of splits of file reader chunks (chunks of data).
class Reader: def __init__(self): self.started = False self.segment = [] self.segmentLock = threading.Lock() self.change = False self.filename = ""
0
25c4c76244557b87bc978a255d84c0b4
a391a2b4e1a4418921378e4af272bcd5
Asserts that the products specified by the provided products IDs are all exist.
where TEntity : IHasId { if (entities is null) { throw new ArgumentNullException(nameof(entities)); } var foundId = new bool[ids.Length]; foreach (var entity in entities) { for (int i = 0; i < ids.Length; i++) { ...
1
9aaa7e00a14f80628ab26b241195368b
b1387e620aa83478c55b95cbd030e65c
services api does not allow org admins to update their own orgs
def test_reg_user_cannot_update_org(reg_user_headers): org = str(uuid.uuid4())[:MAX_SHORTNAME_LENGTH] res = requests.put( f'{env.AWG_BASE_URL}{ORG_URL}/{org}', headers=reg_user_headers ) assert res.status_code == 403 response_contains_json(res, 'error', 'SECRETARIAT_ONLY')
0
81a91e73e5a9617ed870c71a65ab7934
70e84782960f4d463706a69b90c743fe
Show info about an earthquake.
public void onItemClick(AdapterView<?> adapterView, View view, int position, long l) { Quake currentEarthquake = mAdapter.getItem(position); Uri earthquakeUri = Uri.parse(currentEarthquake.getmURL()); Intent intent = new Intent( MainActivity.this ,DetailedActi...
1
b02f396e5cfc82cab1189ed986b3c075
3b6866169a9375ddd0e6d6d195a05738
@brief 入力から当該層の出力を算出
void BackPropagationLearner::calculateOutputs() { for(size_t l=0;l<layers.size();l++) { vector<BackpropNode*> layer = layers[l]; for(size_t n=0;n<layer.size();n++) layer[n]->calculateOutput(); } }
1
8618d0996accddc65db3a2d0032aced8
43df692c725657567c40c5b22db9fa90
Prevents starting a background thread under any circumstances.
namespace NewsComponents.Feed internal class NewsGatorModifier public void StartBackgroundThread() { if (!this.threadRunning) { this.CreateThread(); } }
0
8b3f37aed9f109a006dbc401456b60cb
f229d2a06ce8cbb90b2125a9d3d64fe6
判断字符串是否半角字符
function isHalfAngle(content){ var length = content.length; for(var i = 0;i < length;i++){ if(content.charCodeAt(i) < 0xFF61 || content.charCodeAt(i) > 0xFF9F){ return false; } } return true; }
1
e1f9d4000ce0a5aea9a9ed65a4d0b3d5
141a1927e91e7cd7966bcbd12f47e253
gets the full yelp details to flesh out the record from just its phone number
requests.packages.urllib3.disable_warnings() yelp_path = requests.get(restaurant_url, verify=False) soup = BeautifulSoup(yelp_path.text, "html.parser") result_data = {} business_info = soup.find("div", {"class": "short-def-list"}) if business_info: scrap_business_info(business_info, resu...
0
1d7b9797b96475f1394b5f327a282c36
0838f4761caade37c495c9ab83b4e821
Añade un listener de eventos al comando para una propiedad
{ source.PropertyChanged += (x, args) => args.On(propertyName, action); return source; }
1
16287435ac24d994b02d5407eeb914a1
8b77393f1ba640ba2f6c3cb17c01c684
Override a mouse click on the titlebar to allow a move.
namespace Laffey public partial class MainWindow : Window private void fxTitleBar_MouseDown(object sender, MouseButtonEventArgs e) { Win32.SendMessage(new System.Windows.Interop.WindowInteropHelper(this).Handle, Win32.WM_NCLBUTTONDOWN, (int)Win32.HitTest.HTCAPTION, 0); }
1
174f8ebc5d35bd49fe6388e905dbfaf6
d9d60951505f3fe7c9d274bfe2c75a81
提取所有帖子,每个子类都必须覆盖此方法
class BlogFeed(Feed): # 标题 def items(self): return Article.objects.all()
1
f74547851722a9e6179673407c37e5cd
7ab0e492d34bac8f8cef175582caf1bd
Remove unused (but auto-added) tags.
class Tag extends Model public static function cleanupUnused() { return static::where('count', '=', 0)->delete(); }
1
267249e344b7cd940766d1c2557819ca
10c8bb45177281afa793efe902e8e23f
Sets the selected layout and closes the dialog.
if (this.classList.contains('layout-item-selected')) { return; } for (let a = 0; a < layoutList.childNodes.length; a++) { if (layoutList.childNodes[a].classList.contains('layout-item-selected')) { layoutList.childNodes[a].classList.remove('layout-list-sele...
0
b3fcdc5b760533996401368b5621419f
3076ca5a539e720430ed7d755b58707e
Permet l'affichage d'un écran noir, servant à cacher le menu précédant pour en afficher un nouveau en évitant toute superposition
{ blackScreenPanel.GetComponent<Image>().CrossFadeColor(new Color(0, 0, 0, 1), 3.0f, false, true); }
1
33fa2caf42480d49f5523fc6ada7ecf9
28fe6efdf2be643b9bce3050a1112a23
Lap의 랭크 업데이트
public void RpcNewLapTime(float time, GameObject player) { mutex.WaitOne(); PlayerInfo p_Info = player.GetComponent<PlayerInfo>(); p_Info.LapTime = time; p_Info.FinishTime = Time.time; Debug.Log(p_Info.Name + ": " + p_Info.LapTime + ", " + player.GetComponent<...
0
5ea7dc1d7d4af5db2700128ab42152f1
fc94c560ce4302c7eb09d9a45ab25d31
test 2: encrypt/decrypt a big file
iv_str = "UEr9si9EynusD5GGVuiqKw==" password = 'this is very long password to test file crypto' my_cipher = FileCrypto(password, iv_str) my_cipher.encrypt('./testdata/test.mp4', './testdata/test.mp4.aes') print(my_cipher.iv_str) my_cipher.decrypt('./testdata/test.mp4.aes'...
1
671974432447b78bc50a881cdf1b72b5
4d41f0931f34aae333728ac0c60b453a
Obtain DBMS specific SQL code portion needed to declare a timestamp field to be used in statements like CREATE TABLE. of the field being declared as array indexes. Currently, the types of supported field properties are as follows: default Timestamp value to be used as default for this field. notnull Boolean flag that i...
class TimestampField(django.db.models.DateTimeField): def _db_type_mysql(self): type_spec = ['TIMESTAMP'] ts_default_default = 'DEFAULT CURRENT_TIMESTAMP' ts_default_on_update = 'ON UPDATE CURRENT_TIMESTAMP' if self.auto_now: type_spec.extend([ts_default_default, ts_default_o...
1
5fe0b98a4aa5876663cc48e8db1c6a20
cc895128dbb0b4a5d89976267242b7d8
check if string ends with needle
$length = strlen($needle); if ($length == 0) { return true; } return (substr($haystack, -$length) === $needle); }
1
34ea3a4c36f1060cbcea76a2e7c1ae99
c69439fbca1ddd8a29afca87dbc0d521
handler for the mouse click in the generation state
gboolean on_click(GtkWidget *Window, GdkEventButton *event, gpointer data) { x_mouse = event->x; y_mouse = event->y; for(int i=0; i<RR; i++) { for(int j=0; j<RR; j++) { if(x_mouse > j*RR && x_mouse < (j+1)*RR && x_mouse < (j+1)*RR && y_mouse > i*RR && y_mouse < (i+1)*RR && x_mouse < HEIGHT) { ...
1
17536c99f1f97e4fc9d154d6ab3ab437
27f59d4c7335b907bb59919875a25138
403 errors won't happen in client only apps, so we can stub this method.
def stub_request_and_returns_403 stub_request(:get, /^#{API_ENDPOINT}*/).to_return([ error_403_response ] + ok_responses) end
1
ad61ec68591dce5e380241fdaa9e1913
1ef88a85eea246e45aa4abd087c2fb6a
Teste de pesquisa de cliente
public void testFindAll() { final Cliente cliente = this.createCliente(); final List<Cliente> clientes = clienteDao.findAll(); assertTrue(clientes.stream() .map(Cliente::getCpf) .anyMatch(cliente.getCpf()::equals)); }
1
b5ea87bb5a2e309939cadcce77248f5f
79721a6060c591d45bfb84def0b6e034
参数转为JSONArray
List<String> paramList = new ArrayList<>(); JSONArray jsonArray = JSONArray.parseArray(params); Object[] objects = jsonArray.toArray(); for (Object obj: objects) { String param = obj.toString(); paramList.add(param); } return paramL...
0
584fc5fad8915eee61667db1249a73d0
316c4df977602225aa7a22d0e70b6bf0
创建春节猪头底板
for(let i: number = 0;i < 3;i++) { let box: egret.Sprite = new egret.Sprite(); box.width = 135; box.height = 427; box.x = i * box.width + (i + 1) * ((Lantern.lanternBox.width - box.width * 3) / 4); box.y = 110; box.alpha = 0; le...
0
ef04576a178ed1241d669b4d46d2dbda
0d51d50c3e9730ad707c42a09f00eb7c
# Black-Scholes IV apporoximation formula by Hagan(2002)
{ 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
9d4b344b34ccbc40ed1276fb1336ccac
01b1f75ea5614d2bedef30eeb303831c
# 改行を取り除く
splitlines <- function(intext) { inputlines <- strsplit(intext, "\n")[[1]] inputlines <- inputlines[!grepl("^\\s*$", inputlines, perl=T)] inputlines <- gsub("^\\s+", "", inputlines, perl=T) inputlines <- gsub("\\s+$", "", inputlines, perl=T) return(inputlines) }
0
447db3ab8e99feaa50c6bea8017ab516
a6bd6049c96a3f3e40c82dc660b54055
查找所有可用端口 Find all available ports
namespace KR_network class PhysicalLayer public static List<String> searchPorts() { String[] ports = SerialPort.GetPortNames(); List<String>portsList = new List<string>(); foreach (var port in ports){ SerialPort p = new SerialPort(port); if...
1
18fda1b123b7ce69c12d7927f1f6e3a5
e84326f8a58d4346b69fb53c7749975a
NewModbusTCP creates an instanc eof the ModbusTCP protocol class
ModbusTCP::ModbusTCP(void) { _u8MBUnitID = 1; _u16MBTransactionID = 1; }
1
a85902df94c50900ea271e7ecd9c6702
fe88cb25020aae7238b9a742e26b496b
computation average magnetization over all spin states of current model configuration
class TriangularIsing2DTF: def M(self): return np.sum(self.s)/self.L**2
1
f4c03947fe8f561383d990c457c0db66
905b9241a71d61cea703df26ab1d22fa
这是获取技能影响范围的函数 用以UI显示,提示怪物的技能影响范围
CCRect CalSkillCastRect(WorldCreature* attackObj, SkillCfgDef* skilldata, ObjOrientation atkOrient) { if (skilldata == NULL) { return CCRect(); } if (skilldata->isBothSide) { return CCRect(attackObj->getPositionX() - skilldata->getCastRangeX(), attackObj->getPositionY() - skilldata->getCastR...
1
85fb76d6e25f7c867147d3636809ecf4
df091983507bc7985eb216e40cb281d1
throws an exception to prevent saving an empty last name
@RunWith(SpringRunner.class) @DataJpaTest public class CustomerRepositoryValidationTest @Test public void missingLastName() { Customer customer = new Customer(); customer.setFirst_name("Stephen"); customer.setUsername("sjshephard003"); assertThatThrownBy(() -> {entityManager.persist(customer); entityManager.fl...
1
b8b52f317613d00d3c9ef9ddd9332dd0
4dbeb259936a86cfddeec88b5bc92cb8
短文本相似度接口 短文本相似度接口用来判断两个文本的相似度得分。
sentenceSimilarity(json) { ajax('POST', '/api/functions/sentenceSimilarity', json, 'SENTENCE_SIMILARITY'); }
1
037ae6b46d3f75a4052f90eb17e48fac
83f951933a9573fa39eba76905a2ea98
Get html code for the order line error info message image
class Name extends \Magento\Framework\View\Element\Template public function getImageHtml() { return $this->_objectManager->create('Simi\Simirewardpoints\Helper\Point')->getImageHtml($this->getIsAnchorMode()); }
0
4fc39cb6510d8e44eeff1678d067cbcb
252167afed3d40fb565cb1ab1b904ff9
We should be able to add sparse arrays properly.
class _test_cs: def check_add_dense(self): sum1 = self.dat + self.datsp assert_array_equal(sum1, 2*self.dat) sum2 = self.datsp + self.dat assert_array_equal(sum2, 2*self.dat)
0
211dd0e729bf16b7b43e23f9cc0f5152
51ffddef486787cf5407c302b7644e39
Returns the specified experiment as dictionary.
def gather_experiment_info(experiment_name, altmodel=None): if altmodel is None: module_name = experiment_name else: module_name = "-".join([experiment_name, altmodel]) exp_file = op.join(os.environ["LYMAN_DIR"], module_name + ".py") try: exp = sys.modules[module_name] except...
1
ff61ad9c4c4ff05627a72f8228a1925f
3bacaa57041d15dd26a5f7a355d41f1e
Compare two port's path for the sort in initPortsContainer First compare the port code and sort alphabetically, second compare the number part, sort from small to big
{ if(a.desPort < b.desPort) { return -1; } else if (a.desPort == b.desPort) { return 0; } else { return 1; } }
0
53fae0df79784221b3056164cdbafce4
3ed2ab23d0651e7bec43648acf36cd74
Remove a place from a Petri net
void PNTrans::removeConnectedPlace(PNPlace * place, bool isIn){ StringToPnplaceMap * names = (isIn)? &in_names : &out_names; StringToPnplaceMap::iterator it; for(it=names->begin(); it!=names->end(); it++){ if((*it).second == place){ names->erase(it); return; } }...
1
330872e3c84a943716097a0fafbd12aa
4fc9fa3ca0e14104d5b41be7fc17f082
This method returns results of passing tests for certain user.
@Component public class TestsRepository public List<Result> createResult(Test test, User user) { jdbc.update("INSERT INTO \"RESULTS\" (\"USER\", \"TEST\") VALUES (?, ?)", user.getId(), test.getId()); return jdbc.query("SELECT * FROM \"RESULTS\" WHERE \"USER\" = ? AND \"TEST\" = ?", new ResultsMapper(), ...
1
e6ca2acdc6fceee98d69c69df22e65b6
32bb2775c3d51b55502f7823d9e7ec61
Returns the optionalTLVList.
LinkedList<PcepValueType> getOptionalTlv();
1
7ed3619f0e3ad410d597356952d22a0e
50fd0aae2e2f640ec46240e992735a00
Method to change address field positions
public class AddUpdateCustomerController implements Initializable public void onAddressTextField( ) { postalCodeTextField.requestFocus(); }
0
c18cea6dff03db3ebc0ff70958a45e54
6fb06264160debf340a1e413ce436820
Возвращает ид офферов по указанному типу оффера
public function getByType($type);
1
4dd32e607601187e091edce068629648
f282528c1cfd89c2838a2afd2914ee0a
Deletes record is clerk exists, ignores otherwise
@Service public class UserService public void deleteById(int id) { insuranceService.deleteByClerkId(id); recycleService.deleteByClerkId(id); userRepository.deleteById(id); }
0
7be2927ffc5cc022af494745c4521df5
5cef5a07cd7e20d60106d0df73b9987c
Returns the image width of the contained dicom image.
def get_image_width(self, image_id): if self.image_infos[image_id]['width'] is None: self._populate_image_hw(image_id) return self.image_infos[image_id]['width']
1
e20d320786ecaf55287b238a1dc883cf
ed984b4d8ca96fab91ca9c1cb82201aa
======================================================================================= inthandler0c関数 プログラムが変なことをしたら飛んでくる割り込みを受け付ける関数 一般保護例外 =======================================================================================
void inthandler2c (int *emp) { struct BOOTINFO *bootinfo; bootinfo = (struct BOOTINFO *)ADR_BOOTINFO; io_out8(PIC1_OCW2,0x64); io_out8(PIC0_OCW2,0x62); unsigned char data=io_in8(PORT_KEYDAT); fifo8_put(&mousefifo,data); }
0
4d85a790111f1f73a3aa4d0cbb4dfb9b
6bde01d6fc351f72cddbe81bbc12480c
convert the stored dwell time (sec) to milliseconds
{ Dwt = DwV[Nr]; if (Dwt<60) { return (Dwt + " Secs") ; } if (Dwt>=60 && Dwt<=3600) { return (Math.round(Dwt/60) + " Mins") ; } return (Math.round(Dwt/360)/10 + " Hours") ; }
0
764df3cdd99832654453df5b7b87be2e
98166884d1f21052bfdf2fc6732a402f
Get the login options.
class Login extends ProvidesEventsForm public function getAuthenticationOptions() { return $this->authOptions; }
1
fff788a28a5acc444ce1a92fb6253f48
61cc67c1273d8c6492671a2cc64093b4
Navigates through an array and sanitizes the field. default (text). Custom single argument callable allowed.
class WireInput extends Wire protected function sanitizeValue($method, $value, $getArray) { $sanitizer = $this->wire('sanitizer'); $values = is_array($value) ? $value : array($value); $methods = strpos($method, ',') === false ? array($method) : explode(',', $method); $cleanValues = array(); foreach($values as...
1
bada1fdfac7d063da37577abbdb8cb6e
3bd52b625e036555376e43056f52317b
Checks the specified phone number, to see if it is valid.
{ if (Regex.IsMatch(phoneNumber, MOBILE_NUMBER)) { return; } else { throw new AddressBookCustomException(AddressBookCustomException.ExceptionType.INVALID_PHONE_NUMBER, "Invalid Phone Number"); } }
1
ea9753ce402a13610634a7f480ea71c4
29789f0924de545a43adccf0d038c8d4
finds the arguments of a function from the extended class
int Montador::functionArgs(string funct){ vector<string> functions = {"add","sub","mult","div","jmp","jmpn","jmpp","jmpz","copy","load","store","input","output","stop"}; vector<int> arg = {1,1,1,1,1,1,1,1,2,1,1,1,1,0}; for(int i = 0; i < functions.size(); ++i){ if(funct == functions[i]){ return arg[i]; } } ...
1
da361b3e8973f2e102c46cd0987b449a
9d9cf6382e1a732a074bd7266ceeff5c
Test coaddition of spectra with different wavelength grids
nspec, nwave = 3, 10 s1 = self._random_spectra(nspec, nwave) self.assertEqual(s1.flux['b'].shape[0], nspec) s1.fibermap['TARGETID'] = 10 coadd(s1) self.assertEqual(s1.flux['b'].shape[0], 1)
0
6bcea5579429d62adcaea7a1d1860738
4dae40aef6471a2c7b8b7c1b901445ef
盘点时,将某货品的库存数设置为盘点数 本来货品的库存数是实时计算的,但是由于各种原因,库存数和盘点数对不上 因此根据老敏要求,盘点时直接将库存数修改为盘点数
int incount = 0; int remnantNum = 0; for (Item item : detail.getItems()){ if (item.getScItemCode().equals(old.getScItemCode())){ if (Integer.parseInt(item.getInventoryType()) == GoodsStatusEume.GENUINE.getGoodsStatus()){ incount = item.getInCount()...
0
5f1fa3fdb705d2a1fab35fddb3ff8364
7004a3220fc4df03c24e9485f45e69d2
Lists all coordonnee entities.
class EntiteController extends Controller public function index() { }
0
e9456fb654a7c4e82dbfd8cb7148b1e8
c9a9811f7b46339943e2272021f7b211
Method for getting all Graph Dimension Names
String[] getDimensionNames();
1
0440984716dbd140ea0b2aeaad1b0fb8
dd788707867513849c1a15f816fb4f03
Returns average rupture length for a given magnitude from Wells and Coppersmith
class DataPlot(object): def v_d_Lhermitte_1988(self, d): d = d * 10 ** (-3) v = 9.25 - 9.25 * np.exp(-(68000 * d ** 2 + 488 * d)) return v
0
0a1e54b4dd5a8994edaa1e12f2858fe3
aeb5d83ec4ba5228cdc16bfcff30bab0
判断绘制的多边形是否在倾斜摄影图层上
namespace EarthView namespace World namespace Spatial namespace Carto public class Igeometryinsert : EarthView.World.Spatial.Carto.Imapsurround public virtual bool IsDrawFrame() { byte ret=EarthView_World_Spatial_Carto_IGeometryInsert_isDrawFrame_ev_bool(this.NativeObject); return Convert.ToB...
0
83ff16b4d914e0f8010c46c81aa84bb5
82b220dd322cfb4399832f1ca0a23cfb
Set the maximum amount of stamina for the player.
{ if (CurrentStamina != maxStamina) CurrentStamina = Mathf.Lerp(CurrentStamina, maxStamina, Time.fixedDeltaTime * statModifiers[Stats.Fitness].StatValue); }
0
aeea0250c946698cddfa7beafc325d76
1904634633d0563e44a8e1e21dde3e1c
Permet de réinitialiser le champion de référence
public class JeuDesChasseurs public void reset(){ partieFinie.setValue(false); tour.setValue(0); nbCoups.setValue(0); chasseur1.setX(1); chasseur1.setY(1); chasseur2.setX(size); chasseur2.setX(1); bambi.setX(size/2); bambi.setY(size); }
0
983f17b9989bc131528b749b1ede5b59
84af07915920c0bb9083668bf53f6d32
Method used to add an operation to a transaction
class TransactionBuilder public function addOperation(AbstractOperation $operation) : TransactionBuilder { array_push($this->operations, $operation); return $this; }
1
adada29393be097ff19b13bd76728756
f29dfad3c2c6907b9539629cece6f3f1
获得所有城市,技术以及技术所属分类,然后request城市X技术的url
def getCity(url_list): city_all = [] count = 0 for url in url_list: data = getUrl(url) selector = etree.HTML(data) cityList = selector.xpath('//tr[@class="citytr"]') city = [] for i in cityList: cityCode = i.xpath('td[1]/a/text()') cityLink = i...
0
0a993b234d4b8b4b85b7cf35a76a1e01
0189c493861a6514769251cb95784e70
根据商品类型和商品品牌获得全部商品
List<Item> findAllByItemSiteTypeAndPriceType(ItemSiteType siteType, ItemPriceType itemPriceType);
0
41fcc4dee9cb04fd8c0aef45539d5ec7
6df7e0489431881f235b2f0fbc3e6816
Test the Presidential Papers Resource Endpoint.
NodeType::create([ 'name' => 'article', 'type' => 'article', ])->save(); $this->container->get('router.builder')->rebuild(); $promoted_nodes = []; for ($i = 0; $i < 8; $i++) { $promoted = ($i % 2 === 0); $node = Node::create([ 'type' => 'article', 'title' => $...
0
061f21eb675b360703d5ec0dd3fddb0a
55139b06af94c6c2380dadd4c6d3702f
whether the test has run to completion and gotten results, regardless of outcome
class Runner(object): def has_finished_run(self): return self.output is not None
1
ed3b73885cb12b6b2f600926fcb7bce9
adfe0999bd5dc6e2ecce71086aeb3679
Update a notary
namespace DocuSign.eSign.Api System.Threading.Tasks.Task<ApiResponse<NotaryJurisdiction>> UpdateNotaryJurisdictionAsyncWithHttpInfo(string jurisdictionId, NotaryJurisdiction notaryJurisdiction = null);
1