query_id
string
corpus_id
string
query
string
code
string
label
int64
656e69b69613b4c1f57c794d63c02d21
fc6b315a2a76c4065bd6527e1c6e3dbb
Returns dataframe necessary for frst funnel chart.
df2 = df df2 = df2[(df2['stateInt'] == 0) | (df2['stateInt'] == 1) | (df2['stateInt'] == 2)] df2 = df2.assign(stateInt=lambda x: np.where(x['stateInt'] != 2, x['stateInt'], 0)) timeSections = pd.timedelta_range(start='0 days', end='100 days', freq='7D') timeIntervals = pd.cut(df2...
1
60270ac88a915496d0b36da6ef448921
9e1076fc93edfe0729b14eab3f9cdd39
Call an API with HTTP DELETE method and Service Owner credentials (without query parameters).
{ HttpWebRequest request = await CreateRequest( api, RequestMethod.Delete, null, _authenticated ); await SendRequest( request ); }
1
b32b3114018d3e13fcf6128df98fd1e2
ae47c55a16be10e7d38279ce4f03cc84
naive bitscan reverse (BSR) check.
inline int bsr(ll v) { return 63 - __builtin_clzll(v); }
1
04160929430cd1459fcbcb4e17188703
c015799b1cfed4ef3f9c9b886c0a250e
Basic data on query split up according to issue types.
class BaseQueryGenerator(object): def SplitQuery(self) -> None: raise NotImplementedError('SplitQuery must be overridden in a child class')
0
e1bad460026d1e63ca5377a7415e0887
c85a94ff552d3d61afd82c730c0da589
Augments and preprocesses CIFAR-100 images by cropping, flipping, and normalizing. Preprocessing procedure and values taken from `pytorch-cifar <https://github.com/kuangliu/pytorch-cifar/blob/49b7aa97b0c12fe0d4054e670403a16b6b834ddd/main.py#L30-L40>`_.
return transforms.Compose( [ transforms.RandomCrop(32, padding=4), transforms.RandomHorizontalFlip(), transforms.ToTensor(), transforms.Normalize(CIFAR100_INFO["MEAN"], CIFAR100_INFO["STD"]), ] )
1
b4053c863635106d6ac9b7fd8ea89d3d
3b4137f2fbe0ef872be46aec49534551
Only select executions which are part of a process that have at least one variable with the given value. Byte-arrays and <seealso cref="Serializable"/> objects (which are not primitive type wrappers) are not supported.
namespace org.camunda.bpm.engine.history HistoricTaskInstanceQuery processVariableValueGreaterThan(string variableName, object variableValue);
0
2497f869716acdd38d5ee552eee34eef
720aaf76264e5e3fc66f362d073ef39b
The smallest squared distance between the point and this bounding box.
namespace UnrealEngine public partial class FBox2D : NativeStructWrapper public float ComputeSquaredDistanceToPoint(FVector2D point) => E_FBox2D_ComputeSquaredDistanceToPoint(this, point);
1
f98275e3663b85893bc565ac26d2a59e
bd2bc3a0b6faff2cddf738ffd7f2bfe1
============================== | Check for overlaps in dates. | ==============================
return if self.listing_id.nil? self.listing.bookings.where.not(id: nil).each do |x| next if x == self if self.check_in <= x.check_out && self.check_out >= x.check_in self.errors.add(:check_in, "overlaps with #{x.to_json}") end end end
1
50f3218b96fbd003763f0af320d92254
f63599c94606c88232ddbd33c90c6c06
Specifies that object dependencies should be checked after object is created and configured.
namespace Chromely.Core public class ChromelyConfiguration public ChromelyConfiguration WithDependencyCheck(bool checkDependencies) { this.PerformDependencyCheck = checkDependencies; return this; }
1
83a0163f54732e06c9743aa3e46295f4
e4b96713dd9562bd269b337ebaddfb22
Récupérer les jeunes inscrits dans le fichier.
class PopulateYoungPlayersFromCsv extends Command public function handle() { $club = Club::find(env('DEFAULT_CLUB_ID')); $file = $this->argument('file'); $this->info("Reading file : ".$file); $csv = Reader::createFromPath($file, 'r'); $csv->setHeaderOffset(0); $csv->s...
1
393d5f67b15acded641a4e7108feb57b
f2306eb98bb9b60877fc70c2743c67d9
查询系统提示语信息-单个查询
String querySysMsg(String sysMsgRequest);
1
d25b6d7f54e08aab2a9af315775c9efe
3a94e47f4069b50f169489131d45a040
账户转账事件处理函数
auto it_from = accounts.find(from); graphene_assert(it_from != accounts.end(), "转账发送者账户记录不存在"); sub_balances(from, quantity); add_balances(to, quantity); }
1
81942ecc2e23d87711c81464d16726fc
935cbde134458d405c141083f7652352
@brief Does a forward search for an structure containing a pointer
PtrElement FwdSearchRefOrEmptyElem (PtrElement pEl, int Kind) { PtrElement pRet, pCur, pAsc; ThotBool stop; pRet = NULL; if (pEl != NULL) { pRet = FwdSearchEmptyInSubtree (pEl, FALSE, Kind); if (pRet == NULL) { pCur = pEl->ElNext; while (p...
1
e7112b0a55b2888b2fd9fec4643d147c
1f9e7ed28cc6e9c74873aa0f15d9510a
Detect clicks on the alien.
alienCount--; if (alienCount == 0) { notifyWin(); } for (Entity entity : entities) { if (entity instanceof AlienEntity) { entity.setHorizontalMovement(entity.getHorizontalMovement() * 1.02f); } } soundManager.playEffect(...
0
f39c21436da04418637ef2a177554936
b93b5f3596c4eeb89650d47518ac7b7d
Import the csv carton file into the database
class ProcessProducts implements ShouldQueue public function handle() { try { $this->csv_import(); } catch(\Exception $e) { dd($e->getMessage()); } }
1
d32837d223c4b8e485b1f229ed056bc8
415fa1634128e4f4c48a82795933a66d
keyがkeys,valueがFalseの辞書を作成する.
key_map = dict() for key in key_list: key_map[key] = False return key_map
1
fc14c8dcae86cd9151f2e2dd7b2eb3f4
542eb64d0b72108c257f4119b63e5423
! \brief Do a few common things to start a connection Do a few things that are common for setting up a connection for TCP, FTP and HTTP.
UARTprintf("ftp_OpenDataConnection Called!\r\n"); err_t err = ERR_OK; PI_Struct->DataConnection = tcp_new(); tcp_arg(PI_Struct->DataConnection, PI_Struct); tcp_err(PI_Struct->DataConnection, ftp_DataConnError); if (PI_Struct->passive) { tcp_bind(PI_Struct->DataConnection, &PI_Struct->ho...
1
f4fc7aed49149d80a9a5f8d38463af37
1c7c6e3cb06f20f5e2aba5f0df52b513
Sets the testo.
public class DetailQuestionFragment extends Fragment public void setQuestionTest(String questionTest){ mQuestionEditText.setText(questionTest); }
1
91617ea272e6034bf9ed3d3b9f6c85b1
1a67122868aca863825a1c28bd8b9c0f
First select a crop of random size, then resize to desired crop_size.
class RandomResizePadding(augment_bbox.RandomResizePadding): def __init__(self, size, p=0.5): self.p = p self.resize_padding = ResizePadding(size) self.resize = Resize(size)
0
642c6db14153c6cf0d262213b2aec5a4
bfdb9ca9cc337794a041399b03fecdce
Figure out how many backslashes there are between the indicated character and either the first non-backslash or the beginning of the string. If the number of backslashes is odd, then return True. Otherwise, return False.
return any( len(m.group(1)) % 2 == 0 for m in re.finditer(r'(\\*)[*?[]', value) )
0
c988156f95a945897494d77bb9e52c5f
dc13ebe658d39787293d5a4b55bf4d33
When the screen is swipe, the http request is executed
class ListViewFragment : Fragment(){ private fun configureSwipeRefreshLayout() { swipeRefreshLayout.setOnRefreshListener { executeHttpNearbyRestaurantsRequest() } }
1
966cc0a66e38aa63d603b6688aa5931e
c4f3e40696d2957f14f8f5572de6fa59
generates most active cities stats
def get_stats(): df = pd.read_csv(get_city()) df = pd.read_csv(get_time())
0
6802116d902aef437d91ef8fedad5df3
4342e772b5fb456c6b589b42a1179405
Test GET paginated questions with page out of range
class TestQueryQuestion(BaseTestCase): def test_paginated_all_questions_query(self): CommonTestCases.admin_token_assert_equal( self, paginated_all_questions_query, paginated_all_questions_query_response )
0
78c6df58b217ba1065025c37edcb9e5f
a9c54426ca5109bd14e57a24ecf5d42c
Computes log of cumulative density function of the Gaussian distribution.
def _gaussian_log_cdf(x, mu, sigma): if not isinstance(x, chainer.Variable): x = chainer.Variable(x) return _log_ndtr((x - mu) / sigma)
1
93678ef9893aac2025e00ab17e3bddfb
60b6bf0ed6423cd340a0a91b0679810f
设置属性columnSize的值.
public class SdColumn public SdColumn setLength(String length) { this.length = length; return this; }
0
0714cead3d1a7a49fd48fd3ccc075dbd
ea551178acb14a410b4ee8d9d818ccd1
优化轨迹 直线合并重合的线段
def merge(lines, dist_thres, ang_thres): if lines is None: return np.array([]) i = 0 while i in range(lines.shape[0]-1): ang1 = math.atan2(lines[i,3] - lines[i,1], lines[i,2] - lines[i,0]) ang2 = math.atan2(lines[i+1,3] - lines[i+1,1], lines[i+1,2] - lines[i+1,0]) angdiff ...
1
882fbde5731af6d7358d213b4fd9451a
7dfb6eca95cead81122dc541debf27c8
約数の数を数える
ls = factors(num) count = 0 ls.each{|factor| count += 1 if prime?(factor)} return count end
0
a226d61ff3ee4ed3ce42f6d306026a1b
204f0cae8c563e78424fa2e44b839843
获得所有支出的一级分类
List<Expendituretype> getAllExpendituretype();
1
ed43cb9977c380a881204df25dfce446
548dbc65dd621fb1d074265d43567fba
Calculate Convergence Criterion Calculates the Gelman-Rubin statistic, autocorrelation time factor, relative change in autocorrellation time, and the number of independent draws for each parameter, as defined by Ford et al. (2006) (http://adsabs.harvard.edu/abs/2006ApJ...642..505F). The chain is considered well-mixed i...
y = 1.0 * N / T X = np.concatenate((np.ones((1,T)),F), axis = 0) B_hat = np.dot(np.dot(Y, np.transpose(X)), np.linalg.inv(np.dot(X, np.transpose(X)))) alpha_hat = B_hat[:,0] Sigma_hat = (np.dot(Y, np.transpose(Y)) - np.dot(np.dot(B_hat, X), np.transpose(Y))) / T k = T - np.dot(np.sum(F, axis = 1), np.dot(np.linal...
0
9b488aca0b013e7333545f8b5a00461c
62aa8160ddec198ba061b84b9b33ca43
Делает лейблы скрытыми
{ this.interactiveLabelL.Visible = false; this.interactiveLabelV.Visible = false; this.button_acceptSelectionL.Visible = false; this.button_acceptSelectionV.Visible = false; }
1
e8ac26823b2a3355b496162168bae280
e93ca60d0e704fc9899023594ad25dae
Add difficulty for the game for each type of elements falling. Needed the new velocity of each type and number to decrease time of respawn
if(gameDifficulty == 1){ } else if(gameDifficulty ==2){ rockRate = 3.5; rockLength = 15; logRate = 5; logLength = 15; dropRate = 2; dropLength = 6; puddleRate = 2; puddleLength = 8; } else if(gameDifficulty ==3){ ro...
0
fa5da9d731c4e6997d2905956acea945
d633aa327bc9d9cdc2ddfb0b86aefd96
划分基本块
{ var basicBlocks = new List<AstNode>(); var entryLabel = block.Body.FirstOrDefault() as AstLabel ?? new AstLabel(block.SourceLocation, "Block_" + (nextLabelIndex++)); var basicBlock = new AstBasicBlock(block.SourceLocation); basicBlocks.Add(basicBlock); ...
1
91d7daceb6a161d9fc27ddebe97b14bb
984e3deec7cbc3d59a80cafc47e0b37d
根据用户Id查询单条投票信息
@Service public class VoteServiceImpl extends BaseServiceImpl<VoteEntity> implements VoteService public VoteEntity queryVoteById(String voteId){ return this.voteRepository.get(VoteEntity.class, voteId); }
0
c36bd6437a282b656cb9e3b22464bba8
ccacf509547f9de5da11f4dcbf8f3ed5
Extract the best key length according to the Kasiski examination
int Keylenth(string c) { int klen = 1; int clen = strlen(c.c_str()); while(1) { float IC[klen]; float avgIC = 0; for(int i = 0;i < klen;i++) { int out[26]={ 0 }; for(int j = 0;i + j * klen < clen;j++) out[(int)(c[i + j * klen] -...
0
6d497fa07cbbdb64c7f5e8d5fa286979
be130c0def75af2772f7e56898fd518f
Set the ADCP time.
function setTime(dev: Device, t: time.Time) { var mustClose; if (!dev.con) { dev.con = net.dial("tcp", dev.IPAddress + ":" + dev.port) mustClose = true; } try { let p = newPacket(dev.id, 0x39, [t.year % 100, t.month, t.day, t.hour, t.minute, t.second])...
1
314a6273aebed756eeb4f9dedd578abf
b58bb7740a919affb50ada53dadfc7e6
Generate a random eight-digit string to send out as an auth code.
class Serv(BaseHTTPRequestHandler): # Dictionary of users auth to their names # Users will be removed after they left the chat def generate_auth(self): return ''.join(random.choice(string.ascii_lowercase + string.digits) for _ in range(10))
0
4bf9e25d711d08f68f610c02a56e712d
3ec5bea00f7c6b116caee2f2db573293
Checks to see what dress type the given item is.
def get_type(item): if item in Item.items: return 'item' elif item in Weapon.weapons: return 'weapon' elif item in Armor.armors: return 'armor' elif item in UsableObj.usable_objs: return 'usable'
0
1fd94c59d464b1efcd3ecd6a187f7b25
12aabdbd2419185a4204586ce99b8455
Returns the status of the VM creation/deletion Returns the current deployment or undeployment status for a VM along with any other relevant current information, such as error messages.
vm = self.middleware.call_sync('datastore.query', 'vm.vm', [['id', '=', id]], {'get': True}) self._check_setup_connection() return self.status_impl(vm)
1
f6a3262ba83d885ee0dab2deb426611c
21030df529ed880d2fb83140afb52048
会員かつ、メールアドレスかパスワードが変更された場合、パスワードをチェックする
class UsersController extends Controller public function changePassword(Request $request) { if(!(Hash::check($request->get('current-password'), Auth::user()->password))){ return redirect()->back()->with('change_password_error', '現在のパスワードが間違っています。'); } if(strcmp($request->get('current-passw...
0
dee99177155b8579b9344c116552a565
65983332abbb05af11311941c7257741
取得末页页码。
public class RequestForm public String getEndPage() { return endPage; }
1
07e951f5501c8026627d90c404c165c6
195f377ca3fba706f7a30980421cd2ee
Translate 'CamelCaseNames' to 'Camel Case Names'. Used when generating names from view classes.
class Printer extends ResultPrinter protected function splitCamels($name) { return preg_replace('/(?<=[a-z])(?=[A-Z])|(?<=[A-Z])(?=[A-Z][a-z])/', ' $1', $name); }
1
0cd2f64dca63a7eac200cfa2e726adf0
a24f5605428042204dc3981fae2c4885
will compute whether or not a coding gene is highly preserved and if not how recent it is it uses the phylogenetic distances and the similarities amongst homlogies to try to find a good proxy
local n = math.max(#genome1.connections, #genome2.connections) local distance = (Settings.CoeffDisjointExcess * DisjointExcessCount(genome1, genome2) / n) + (Settings.CoeffWeightDiff * getAvgWeightDiff(genome1, genome2)) if distance > Settings.DistanceThresh then return false else re...
0
81544452baf2de44b0e183ccea2f5145
cd6116ffe3f330e14f303f45dc9001a8
Returns all elements but the first of a list
def exclude_first list list[1..-1] end
1
f725d124bc6914a33d5b3e51beb96285
ec55ca40db6b3841e84979f5e5559218
check if invoice is paid
public function is_paid();
1
bb351be319b973aae5d51eac5d4e174c
998426e57f9e035ef995d938cac6f8b5
Returns whether this value is greater or equal to zero.
namespace System public static class FloatExtensions public static bool IsPositive(this float self) { return self >= 0; }
1
e27719c27cb05d5a28d456144d694696
0b8f9422c316dcaba013774e257e39f9
将当前对齐方式更改为居中
void MainWindow::on_action_align_left_triggered() { setAlign(Qt::AlignVCenter | Qt::AlignLeft); }
0
c2bd536aa86b680c747db1b83273d7d1
740909aa7523f5751f6bf8aaec7bc5cf
Make a greedy (random) action based on current value (decaying) of epsilon else make an action based on prediction the NN inside the actor.
class Actor: def get_action(self, state, cur_episode, experienced_episodes, mainQN, isBacktest = False): epsilon = 0.001 + 0.9 / (1.0 + (300.0 * (experienced_episodes / TOTAL_ACTION_NUM))) if epsilon <= np.random.uniform(0, 1) or isBacktest == True: if USE_MEAN_REWARD_TABLE and isBacktest...
1
1ab86cf48ed306bd1912967a51305114
5b7b4233f97cb8e34cfb2bb60cd54529
Loads the next question in the list and updates the image, schema and SQL
public class QuestionEditor extends Controller implements ControllerWithWindow, DTOViewer2, ContextSensitive, DVContext protected synchronized void nextQuestion() throws SubmitValidationException { int selectedRow = parentPanel.tHHTable1.getSelectedRow() + 1; validateQuestionPanel(); submit(); ...
1
344ab7712e79f94201ec36c07b92499b
45ea5a0dd35e9ebaefe2021005faa29d
get the current player's hunt
local entities=0 for k, v in pairs(ents.GetAll()) do if v.HuntID == tostring(ent) then entities=entities+1 end end return(entities) end
0
e951666b0b349ff5c0657271a4d82598
6c86f4c72f2f7d66bfbf28817557186c
Nessa primeira especificacao, nada foi definido para o tratamento de maiusculas/minusculas. Entao, por enquanto, essa funcao nao faz nada...
string pre_processamento::NaoSensivelAoCaso(string frase) { for(unsigned int i=0; i < frase.size(); i++) { frase[i]=toupper(frase[i]); } return(frase); }
0
e5080c9eececdce5546fd9ab58525687
5d86ae984b263e061ac2ccca4d717949
Return all the enabled item entries.
public function getAllEntries();
0
3b54c626d52e9bac768774f996e5e4b8
ba3770882eb69a7b9993967ba6d71296
Determine the insert idx with a linear search, starting from the end since mostly we expect to be adding genes that belong only 1 or 2 genes from the end at most.
void CChainer::CChainerImpl::AddFShifts(TGeneModelList& clust, const TInDels& fshifts) ITERATE(TInDels, fs, fshifts) { if(fs->IsInsertion() && fs->Loc()<=la+2 && fs->Loc()+fs->Len()>=la) la = fs->Loc()+fs->Len()+1; if(fs->IsInsertion() && fs->Loc()<=lb+1 && fs->Loc()+fs->Len()>...
0
5b7dbc6d5e894b20aeb8375de1209e1e
1c453146687ae237705224ed92d38316
Using the Borg design pattern to achieve shared state between object instances:
super().__init__(*args, **kwargs) self.linted_views = set() self.view_syntax = {} self.__class__.shared_instance = self
1
5effab2b30a6d4bc995e6d194c3835b8
1e78397f812da24a6d5aeda0a6874890
Part of the integrator. Perform a step of size step_size in the U variables.
m_pair = self.des_pair x_now = self.this_x delta_x = x_now - m_pair[0: 3] jac = self.dic_vel_jac[m_pair[1]] delta_u = np.dot(jac, delta_x.transpose()) delta_u_out = np.array([0, 0, 0, 0]) delta_u_out[0:3] = delta_u delta_u_out[-1] += -delt...
0
57516a53007bbf9509302cb23d44bd34
d834a45646bc6cfc216a41d0632522dc
function that checks the answer the user selects and checks if its correct or not, this function also checks if there are more questions in the array or not to either show a 'next' or 'play again' button
function checkAnswer(answer) { answerCheck.style.display = "block"; if (myQuestions[questionIndex].answer === myQuestions[questionIndex].options[answer]) { correctAns++; answerCheck.textContent = "Correct!"; } else { totalTime -= 10; if (totalTime < 0) { timeLeft....
1
0585ed073d5a600c12b3a392b3800e97
864374dbe8b5c9f7ac187a627dec4433
Test deleting an artist by nonexistent ID
def should_not_be_saved(wrong_artist = @wrong_artist) expect(wrong_artist.id).to eq(nil) end
0
ea22a1df7aac2070a385b6b607f46511
8c0be0bc5d4824c026d04f3f9c0574c5
获取最新更新卷
class indexService extends Service async update() { const { ctx, app } = this; const data = await app.mysql.select('novel_content', { limit: 20, orders: [ [ 'update_time', 'desc' ] ] }); if(data) { result.code = 200; result.message = '获取最近更新小说成功'; for( var i = 0; i < data.length; i++ ) { ...
1
e1c2cb36405dba41ef68a67a9dbd98b5
f74d9095d2966b4e4eaeeede103d744f
Tests the draw_lines function.
void test_line(ei_surface_t surface, ei_rect_t* clipper) { ei_color_t color = { 255, 0, 255, 255 }; ei_linked_point_t pts[2]; pts[0].point.x = 200; pts[0].point.y = 200; pts[0].next = &pts[1]; pts[1].point.x = 600; pts[1].point.y = 400; pts[1].next = NULL; ei_draw_polyline(surface, pts, color, clipper); }
0
9cdd18449aaaad3f863e8dcc35e4c2cd
2c193022097d3fb1cb472e90aa9277e5
Get the displayName property: Localizable dimension of the metric.
public class MetricDimensionV1 public MetricDimensionV1 withDisplayName(String displayName) { this.displayName = displayName; return this; }
0
b77acc71f323987340edcb11a6aafbe7
fc945a4c0004a009bbe970995a06da08
Test a full stop of the dataset agent, then restart the agent and confirm it restarts at the correct spot.
class MMEnv(MultiAgentEnv): def full_restart(self): self._sc2_proc.close() self._launch() self.force_restarts += 1
0
47283f40d5c980b05a20690a90bf47a9
f5db24d1f849a32c2c9a95b17b38d405
Since we're getting potentially sensitive data (MAC addresses for all devices on the system), hash all the MAC addresses to provide basic anonymity and security.
def mac_string(device_id): return hexlify(byteswap('6', pack('u48', device_id)))
0
a3c6ad39fabc54e94cc134b32005b638
ee37da023905c66d0ddef239a1bb34d9
Return a single notebook in the project, by its primary key or URI.
class NotebookAsJSON(Resource): # If a notebook with the specified ID does not exist, # respond with a 404, otherwise respond with a JSON representation. def get(self, notebook_id): error_if_notebookid_not_found(notebook_id) notebook = data['notebooks'][notebook_id] notebook['@context']...
1
c5359255eaa53bd96a8672bf9ce51b3e
38778e1d610b00d2cba5c2c43de17592
Builds a modified version of the VGG16 model for transfer learning
if reuse: tf.get_variable_scope().reuse_variables() net = {} vgg_rawnet = scipy.io.loadmat('VGG_Model/imagenet-vgg-verydeep-19.mat') vgg_layers = vgg_rawnet['layers'][0] net['input'] = input-np.array([123.6800, 116.7790, 103.9390]).reshape((1,1,1,3)) net['conv1_1'] = build_net('conv', net['input'], get_weight_b...
1
6787b7ac7943dc8aa3bde5f8526b801a
6820feecbcc9579738404a485a8bcf25
Given a sample from the original posterior it applies the transform.
loc, scale = self.mean(x), self.scale(x) if isinstance(self, Observable): shape = _get_shape(loc if loc.dim() > scale.dim() else scale, self.ndim) else: shape = _get_shape(x, self.ndim) dist = TransformedDistribution(self.noise.expand(shape), self._transform(loc, ...
1
6b4e1825f85a071fde278daa2d9f4c3c
4584aa8df8d378aa7bfa5e4bce77b931
This method updates the free and in use memory segment textfields.
public class FileInfo public static void update_space(int n) { free_space=n; UI.jlbFreeSpace.setText(String.valueOf(free_space)); UI.jlbOccupiedSpace.setText(String.valueOf(total_space-free_space)); UI.jlbFreeSpace.repaint(); UI.jlbOccupiedSpace.repaint(); }
1
1612abbc56c518a58efd1da81c5cffbd
78343500833167cd583080448a7ca8bf
Second Order First Derivative in 1D
def second_ord_derivative(xs, vals): dx = get_dx(xs) diff = vals[1:] - vals[:-1] f_x_p_h = vals[2:] f_x = vals[1:-1] f_x_m_h = vals[:-2] dd_f = (f_x_p_h + f_x_m_h)- 2*f_x dd_f = np.insert(dd_f, len(dd_f), 0) dd_f = np.insert(dd_f, 0, 0) dd_f[0] = vals[2] - 2. * vals[1] + vals[0] ...
0
2129f661e46a5616037fd9c0ba5fbe0c
f0dd2537fcc8aed635e3b72b9d7ddb87
Atualizar entity do banco de dados com o novo Herói passado em parâmetro
export class HeroDetailComponent implements OnInit save(): void { this.heroService.updateHeroService(this.is_selected_hero) .subscribe(() => this.goBack()) }
1
28bbaa5933b83268bd0ea8bd5e15e6c0
423968bcdad5d4acf4fb5e60a0ad6b45
Opens the reporter window
namespace HpToolsLauncher public class FileSystemTestsRunner : RunnerBase, IDisposable public static void OpenReport(string reportDirectory) { Helper.OpenReport(reportDirectory, ref _uftViewerPath); }
1
6a73598238c44ce734d3de620e9dc7b8
eb863b4ba10f553d01a9f732591ebded
Quit Blender
def qt(): wn.bye()
0
81817cb0c85f69e8aa6f5d9f91b692a0
5a17e5da6c8f405ee8ba2a1af725e15f
Returns the edge's data.
public function getEdge();
1
51b60a9150f7b0a7207676735936d7b3
bd2b1cffd48d4b4a81eae1c5fcf33eb3
Return smoothed array by the mean filter
data[1..-1].reduce(data[0]) do |t, s| t + smoothing_coefficient * (s - t) end end
0
9f6588aa9878f9f368e641fb32405d04
aed0850624fb5c26caaf9308ed64ff1c
Convert SRGB value of a color channel to linear value.
export default class Color private static _sRGB_Linear(c_srgb: number): number { return (c_srgb <= 0.03928) ? c_srgb / 12.92 : ((c_srgb + 0.055) / 1.055) ** 2.4 }
1
46d0df044d3f58b0711279e9a0bf861f
8d8bcdbd6a1a9581528cc978d39ee038
Specifies the number of clicks needed to start editing. editing
public class InspectorCellEditor implements TableCellEditor, TreeCellEditor public void setClickCountToStart(int count) { clickCountToStart = count; }
1
2e710f80725eceedfcb46580c7f093cc
ebe81d4ff59aba0a582e9917bb5b4736
Sets a new unicode.
assert isinstance(symb, unicode) and symb != u"" self.__write([self.__get_symb_code(symb)]) self.__cursor_position += 1
0
39fc121c7440314dcab8bd6c1014d3fa
bb2c4b11cdb8ce112d16ac19f9ee8b5a
Setup Timer1 for Input Capture
void setupTimerInterrupt() { *TIMER1_IFC = 0x1; *TIMER1_IEN = 0x1; }
0
6544b98237e335cf498c274bdccb80b2
b1195e117cfa03a9319f8c72564d1863
Borra todos los datos que posee cada elemento.
this.cif = null; this.nombre = null; this.dpi = null; this.direccion = null; this.telefonoUno = null; this.telefonoDos = null; this.codigoTarjeta = null; this.encontrado = 'n'; }
1
e656f0a326b99668ac695ec58365a5b1
ff1c2afa732661ba7e0face7f29816d3
Changes the callback for beginning to drag an item.
public static class EventTriggerListenerExtensions public static void AddBeginDragListener( this EventTriggerListener listener, EventTriggerListener.PointerEventDelegate call) { listener.BeginDragEvent += call; }
1
754e7d7ce1b214c5fed68b71f514cc42
31f5d4a930abdf4f87f447e200389705
Get extra C compiler flags to build with.
class toolchain_gcc(): def getBuilderCFLAGS(self): return [self.CTRInstance.GetTarget().getcontent().getCFLAGS()]
1
28240ad7c75d8305369a338db4f8ce79
15014aab5e8818af1773a50476b3dca1
Add a bincl to the list.
class _BinsCollection(object): def AddBin(self, bin_to_add): self._bins.append(bin_to_add) self._total_num_points += len(bin_to_add.GetPoints())
1
7851329941eaf31675aa2d04c7408d49
ef1da1e052732dd65573c03ef98236be
Callback is invoked from the stylesheet to pre-create required output directories on the fly.
function Class:styleDirectory() self:no_impl() end
0
a32670e6085e53ae6e412f1902d555d7
18688064e92f1ddad112c4fc4012e966
This function prints the contents of a Node. The format is "(xPos,ypos)". The complete string is printed and is followed by a comma so that a new line is not printed.
class PUNode(Node): def __str__(self): return "PUNode: " + self.label \ + " (" + str(self.location.x) + "," + str(self.location.y) + ")"
0
95922e61df10dadf82de166cadcce7c5
0133bc39bfea25265d03381fafc65672
<pre> 查找部件的后道工序 </pre>
StringBuffer _sql = new StringBuffer(); _sql.append("select psl.objid,psl.prestepid,psl.aftstepid,psl.sort,ps.name as aftstepname , ps.steptypeid as aftsteptype \n"); _sql.append("from WF_ProcessStepLink psl "); _sql.append("left join WF_ProcessStep ps on ps.objid=psl.aftstepid "); ...
1
6af295c5657840b2d20e2b603b261f69
dee36267edc1c7fc5f1f2010029151fa
获取每章内容,并存储成文件
content_html = requests.get(each_chapter_dict['chapter_url'],headers=headers).text soup = BeautifulSoup(content_html,'lxml') content_tag = soup.find('div',{'class':'bookreadercontent'}) p_tag = content_tag.find_all('p') print('正在保存的章节-->'+ each_chapter_dict['title']) for each in p_tag: ...
1
ce2d46228025aa55fbf95157e4b34185
d653a2b7d96b663b3440a37ee46681a0
使用了PersonWriter 对象 将当前类的实例传递给PersonWriter实例的write()方法 这样就实现了Person类与writer解耦
public class TestToString public static void main(String[] args) { Person p = new Person("张三",20); String s = p.toString(); System.out.println(p); System.out.println(s); }
0
a731ed18590f1e6b643cf09ba596f683
66a84a6ee88ca51b8f84b44130dab032
Should not remove any of two.
namespace GitRocketFilter.Tests public class TestTreeFiltering : TestRepoBase [Fact] public void KeepTwoDirectoriesAndRemoveExcept() { var test = InitializeTest(); Program.Main("--keep", "/Test[12]", "--remove", "*", "--remove", "!a[12].txt",...
1
85a8e09ddb4266e9370852f9af67e12e
04156c5497843a82b405f88841e544bb
Expect a score matrix with scores of the positive pairs are on the diagonal
class peptide_sequence: def align_position_matrix(self,peptide_to_match,matrix): self.score_matrix=0 for i,p in enumerate(self.sequence): pair1=(p,peptide_to_match[i]) pair2=(peptide_to_match[i],p) if pair1 in matrix: value=matrix[pair1] else: value=matrix...
0
eae4e236fa453cc399ed48a3f5f6b0ee
f8e067ad53dafb3255b7b359695973e0
当activity创建的时候绑定receiver
public void onCreate() { super.onCreate(); myReceiver = new MyReceiver(); IntentFilter intent = new IntentFilter(); intent.addAction(NETSERVICE_RECEIVER); this.registerReceiver(myReceiver, intent); registerNetReceiver(); }
1
7a78c9ca24947c4328d3bc139cc15612
0d872883b8efc90493d864a02b467ae5
Gets an array containing the distance (number of punctuation marks) between every two terminal indexes.
class Page(object): def get_sep_len(self): if self.eos_idx == []: return [] else: return [self.eos_idx[0] + 1] \ + [x-y for x,y in zip(self.eos_idx[1:], self.eos_idx[:-1])]
1
c709f091f5554e2e8b676c7901b08923
f95a1f42545995d6a6dc90d759bed5f8
获得 自己的请假单
public String selectByEmployee(HttpSession session, int page, Model model) { Employee employee = (Employee) session.getAttribute("logged"); Page<Leave> pageInfo = leaveService.selectByEmployee(employee.getEmployeeNumber(), page); model.addAttribute("page", pageInfo); return "admin/on...
1
0b99944804015d233d51026aed6b84b0
c80d12ec9638a99dc0ac5f69c415ffd2
计算绝缘子串的风荷载和垂直荷载
lnd, xy, unit, m = lnd_xy_creack(nx, ny, dx, dy) mk1 = mk(unit, m, t, lnd, xy, kk) pp = heatload(t, kk, lnd, xy, unit, kk1, m) k = np.array(mk1) p = np.array(pp) wx = (np.linalg.pinv(k)).dot(p.reshape(p.shape[0], 1)) tpkk = t[kk] tpkk1 = t[kk1] xe = [0 for i in range(6)] stress...
0
4a5f53d7956a58a87b85f0c2f7ae6f47
82d0c2baffdc301ff35443670b0043fb
获取结果类型代码(检查结果的类型代码)
@Entity(id = "entity:com.chinacreator.dzjc_ruleEngine.SuperviseResult", table = "TA_JC_DIC_SUPERVISE_RESULT", ds = "acceptdata") public class SuperviseResult implements Serializable public java.lang.String getSuperviseResultCode() { return superviseResultCode; }
1
5a261015adef6157fccb5f51eeb18db9
d39d05e0414b8adac6a41f1f595d57c1
Draw gizmos to all spawn transforms
public class SpawnController : MonoBehaviour private void OnDrawGizmosSelected() { Gizmos.color = Color.magenta; Gizmos.DrawWireCube(transform.position, new Vector3(minSpawnRadius, 0, minSpawnRadius)); Gizmos.color = Color.cyan; Gizmos.DrawWireCube(transform.position, new Vector3(max...
0
98cc76f6692cb46e82c8589abea34424
f9a53db9d4b79463a06e474d587879b1
设置签证申请id
public class VisaOrderTravelerResultForm public void setPassportId(String passportId) { this.passportId = passportId; }
0
fd89a52379f44f7445b0e07266ada415
9389b5e0c2fc453c3f71baebbe040adb
This method accepts data and stores it in the appropriate columns using the static column indices. This version is for use when adding predictions from metadata searches, which won't have page ranges or parts assigned to them.
checkArgument(data != null && data.length == mColumnTypes.length); ensureCapacity(mRows + 1); for (int i = 0; i < mColumnTypes.length; i++) { if (mColumnTypes[i] == int.class) { int[] column = (int[]) mColumns[i]; column[mRows] = ((Number) data[i]).int...
1
0f8b787dd6bc687bcc6e1b35ad9e8280
09905c2d7c30c1a9d5ff1f7084c46915
不敏感的字符串大小写比较
def cmp_ignore_case(s1, s2): u1 = s1.upper() u2 = s2.upper() if u1 < u2: return -1 if u1 > u2: return 1 return 0
1
750fb370ada93fb9954bc9e909ad864e
4382e5479255b91dced584b136dbd603
proverava da li su parametri u odgovarajucem opsegu i ako nisu postavlja ih u odgovarajuci opseg
function checkTxtParameters() { if(isNaN(params[TXT1_X])) { params[TXT1_X] = String(border_right); paramAlert(TXT1_X,border_right); } if(isNaN(params[TXT1_Y])) { params[TXT1_Y] = String(border_top); paramAlert(TXT1_Y,border_top); } if(isNaN(params[TXT2_X])) { params[TXT2_X] = String(border_right);...
0
ae1736a3d92197c321d4f322349d6c18
106c38ab1b36b1a131a5c333f8800fb6
单链表归并排序,自底向上
void MergeSortL(Node *head, int k) { Node *n1, *n2; Node *tHead, *new, *rear; tHead = (Node *) malloc(sizeof(Node)); tHead->next = NULL; rear = tHead; int i, temp; if (head->next == NULL) { return; } n1 = head->next; while (n1) { n2 = n1; i = 0; wh...
1
63079027bc409c778d8b509081adb0ac
cc5df85ff69b83822219a0ea3dc55827
Removes date fields from the logs. Useful for snapshot generation.
public class LogConverter implements iVariables{ private static String getLogDate(String logName) { String logDate = logName.substring(0, logName.lastIndexOf("-")); return logDate; }
0
d6d3368045946ebd0c4f5af6ac62820f
8afc576449ce515d331f120c3803fa0e
See: https://tools.ietf.org/html/rfc6238#appendix-B
impl PrivateData pub fn additional_data(version: &[u8], protocol: u16, expires: u64) -> Result<[u8; 26], Error> { let mut additional_data = [0u8; 26]; let mut additional_data_slice = &mut additional_data[..]; additional_data_slice.write_all(version)?; additional_data_slic...
1
7b88aa57d91a5954ac674bd7291bade8
a962148627c1242f2957b158fe835cc5
This method is the starting point for the deposit document wizard.
{ OracleConnection connect = new OracleConnection(); CultureInfo cinfo = CultureInfo.CreateSpecificCulture("en-GB"); cinfo.DateTimeFormat.ShortDatePattern = "dd/MM/yyyy"; cinfo.DateTimeFormat.DateSeparator = "/"; Deposit dpt = new Deposit(Convert.ToDecimal(Request["dpt_id"]))...
0