query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
bd58a64d08d886fbf9abf2cf1cab5378 | ef1f4657181a1b01801836569d13d876 | [算法] 判断两条线段是否有交点 | bool cross(LineSegment *lineSegment1, LineSegment *lineSegment2) {
if (equals(lineSegment1->start, lineSegment2->start) || equals(lineSegment1->start, lineSegment2->end) ||
equals(lineSegment1->end, lineSegment2->start) || equals(lineSegment1->end, lineSegment2->end))
return false;
if (ccw(l... | 1 |
655a82b500adeb81acd804a9e4aa62aa | 7309d211066d0b0d198f622cbb9db80b | Imprime a lista de palavras de uma determinada letra do dicionario. | void print_lex(char* lex, int tam) {
for (int i = 0; i < tam; i++) {
std::cout << lex[i];
}
} | 0 |
af25e8e26d9ca411382f8ad81af08db2 | 754f0863a67c2b4b4b225eedf95dc93b | Loads Tof traces and corresponding energy axis to
the GPU memory. Each array is sliced so that only
the relevant peak data is loaded | def load_alldata(trfile,vafile,dsize,begex=None,endex=None,verb=False):
hftr = h5py.File(trfile,'r')
trkeys = list(hftr.keys())
ntr = int(len(trkeys)/2)
if(vafile != None):
hfva = h5py.File(vafile,'r')
vakeys = list(hfva.keys())
nva = int(len(vakeys)/2)
else:
nva = 0; vakeys = []
xshape = hf... | 0 |
1e5937821d777226bbde168334380f41 | d27273481acc8da079e115a11bba35e0 | Checks if the hat has collided with an object, and whether or not it should
relinquish control to the newly collided object. | function resolveCollision(dt, obj)
function resolveHeld(obj, otherObject) {
var holder = robot,
shoulder = obj.geometry.parent.parent,
newCollision,
displacement,
worldToBody = new THREE.Matrix4(),
armVector,
arm... | 0 |
4f2d86e854529cd4269481f527af7937 | db5af9c0478cdf697e26877874cb5d39 | builder for transitionStateChange subtype | int newState = a.createState();
a.addTransition(state, newState, c, c);
return newState;
} | 0 |
1fe3ebf9694fc33c97771756ad03abc8 | 1826038b608fe751c7a88f7991fb6d3f | Возведение в степень через степень двойки
с домножением | class encrypted
private static function degree($a,$b){
$sum=1;
for ($i=0;$i<$b;$i++){
$sum*=$a;
}
return $sum;
} | 0 |
addbdf44b2e7a5d50ca814e0737bae92 | 90c1c070c23a0d652a7ea78d31b7b5d2 | 3) Define a function that checks if two numbers are equal. If they are equal, return true. If they are not equal, return false. | def is_equal(number1, number2):
return number1 == number2 | 1 |
02a6fb3f530925bac3f92455cfba64e5 | 3a2ca4d38a2abd5dfd090b0d8cb941f9 | Samples a full trajectory and returns it as a batch.
Returns:
(tuple): A tuple with observations, actions, next observations, rewards
and done indicators, as numpy arrays, respectively; these will correspond
to a full trajectory. The i-th transition corresponds
to (obs[i], act[i], next_obs[i], rewards[i], dones[i]). | class Dataset(object):
def get_episode(self, batch_size: Optional[int] = None,
truncate_episode_at: Optional[int] = None) -> Tuple[
EnvStep, Union[np.ndarray, tf.Tensor]]: | 1 |
c3b839a3a1801fafba3b3b18975a4504 | 397f2c6241722482cc447193b98b18b5 | @brief 警告スキン クラス. | WindowMessageWarning::WindowMessageWarning( std::string p_title, std::string p_message ) : WindowMessage(p_title, p_message, SpriteParameterFactory::getSpriteParameterIcon64X64(false), IC_64X64_WARNING, IC_16X16_MAIL)
{
} | 1 |
60b5845534b52092be8bf88b559486fe | 2ba181e73bcd642d4e13dc2b5e30b5b1 | Get the data associated with a Sample Billing based upon the primary key
$bid bill id | $sql = "SELECT * FROM __TABLE__";
$where[] = "sbid IN (?)";
$where_params[] = $sbid;
$where[] = "status < ?";
$where_params[] = $this->get_st_delete();
return $this->_m->fetch_array($sql . ' WHERE ' . implode(' AND ', $where), $where_params);
} | 0 |
eb82f52a75054874e6762b79b0e00a4a | 7334d9125ce951f7ec1564c08962de92 | 根据二叉树计算报价_European Call | d1 = (np.log(self.S / self.K) + (self.r + 0.5 * self.sigma ** 2) * self.T) / (self.sigma * np.sqrt(self.T))
d2 = (np.log(self.S / self.K) + (self.r - 0.5 * self.sigma ** 2) * self.T) / (self.sigma * np.sqrt(self.T))
call = (self.S * si.norm.cdf(d1, 0.0, 1.0) - self.K * np.exp(-self.r * self.T) *... | 0 |
e45fc1f733169d83fb3f99f042c012e9 | 76ee13615a696d0dd46afaab50da6c13 | Hademard (direct) product | a = self.data
b = self.data
c = a.join(b)
c.mapValues(np.prod)
return RddTensor(c, self.ndim) | 0 |
355a803c501419482ceaac4870bfc686 | 9d117bfe801d8c2485cebd2b5434f94d | 将中缀表达式转化为后缀表达式
e和f分别用于存储中缀表达式和后缀表达式 | namespace caculator
public partial class Form1_Main : Form
static void postfix(string e, char[] post)
{
int i = 0;
int j = 0;
Stack<char> st = new Stack<char>();
st.Push('#');
while (e[i] != '#')
... | 1 |
0153695d13756ae2ec39344a85278b12 | 7a766ff2da967f4a3a6e9a424e6f2336 | 安装人员添加数据页面 | String adjunctIds="";
request.setAttribute("state", "4");
String idArr = request.getParameter("idArr");
request.setAttribute("idArr", idArr);
String belongdeptid = request.getParameter("belongdeptid");
request.setAttribute("belongdeptid", belongdeptid);
request.setAttribute("adjunctIds", adjunctIds);
Li... | 1 |
6b6e334ada4d01372c9d45fd636e24de | 7f61448ad6da3ef0f9cb03f40c5be655 | check consolidates a common error checking mechanism into one call | cases like (1) | 0 |
653c8bee8ccc5a1c4221bc0cdeef73d7 | b4e60d7cb4528665ba98b71b31df532e | 根据座位编码列表获取座位信息 | public void getSeatList(long scheduledId); | 0 |
92d4e98eaab2e12f7e26035bc404b138 | c339ad553b629bb5286510367af9b0da | Use to get a list of all Users that have associated Jobs | public function getAllJobs(); | 0 |
31089a55392e3ca14796a9e3cdb95a4f | 788492913dece8f056e2e37c7cf4260d | login using a public key | function login_privatekey(password,privateKey){
b= Promise.resolve(web3.eth.accounts.encrypt(privateKey, password))
b.then(l => {console.log(l); keystore = l
a= Promise.resolve(web3.eth.accounts.wallet.decrypt([keystore], password));
a.then(function (result){
let address = result[0].address;
});
});
... | 0 |
d8d275027f650ac65e20c4e9203527fd | cc5116ca614fd1aa6e43bbaaf523090c | 网页加载完成后回调 | function PopupNotice:_onWebViewDidFinishLoading(sender, url)
print("PopupNotice onWebViewDidFinishLoading url = " .. url)
end | 1 |
32dd16cff392fe543dbc900847ae0256 | 0d91311d09a19495b358ddcc89d900c8 | Set regression parameters for BBSR | void BidirectionalRRT::setRunParams(double step_size, int max_nodes,
double term_thresh, int linear_limit, double ANN_epsilon)
{
this->rrtS.setRunParams(step_size, max_nodes/2, term_thresh, linear_limit, ANN_epsilon);
this->rrtG.setRunParams(step_size, max_nodes/2, term_thresh, linear_limit, ANN_epsilon);
} | 0 |
4083812ab031cae4ad677dbd3e7286e3 | 78d2321ca0cd96501649f5e4217885c5 | Score connections based on the follow weight | dist = self.universe[self][follower]['weight'][1]
distScale = dist/(2*max(self.radius, follower.radius))
return int(TPRIME*dist/follower.interest*distScale + random()) | 1 |
ea26a15736a38d72f5669dcd6255e528 | 45f46b0321ae15f432bf5dc65d3c0ddd | Returns request for changing song. | class SongManager(RadioManager):
def requestable(self):
song_request = apps.get_model(app_label='profiles',
model_name='SongRequest')
requests = song_request.music.unplayed().values_list('song__id',
flat=T... | 0 |
11aa4d17a1087e94dd8ee2373b276794 | c7d35c008ec3a0b6e0f074bdc5eeac75 | Returns all values for the given paramName | String[] getAllParameterValues(String parameterName); | 1 |
43670509a0f7fdf090eed2dd8046c74f | ce961892e265629b2f89a04ed031ee96 | 验证用户robot_id | public class DBToken extends DBManager
public static BasicDBObject checkRobotID(String robotID) {
BasicDBObject answer = new BasicDBObject();
BasicDBObject doc;
if (!isConnected) {
if (!connectServer()) {
answer.put(fStatus, 9001);
answer.put(fCheckRes... | 1 |
382a8bdec3d38a68865f29138e495427 | eee3c281f0cc9da4539226037914e507 | Views the option list. | result = ""
for code in self._myController._options:
self._myController._myView.show("Option Code: {}".format(code))
self._myController._representOption(self._myController._options[code]) | 1 |
55bd3e6c03c1c33ef060e20d2a7e622e | 037e3c0addcab88c7ea93052fa9ba955 | returns whether or not the judge button should be used | bool CTurn::DrawJudge() const
{
if(getTurn() < 9) return false;
return true;
} | 1 |
3f5b70d321607f088ab6cc0b9cff1e8c | 04011b50c0c92e2b0226b042e7b82d6f | delegate construction to the one with an explicit surface parameter | CircularPointContact::CircularPointContact
(ContactSurfaceIndex surf1, Real radius1,
ContactSurfaceIndex surf2, Real radius2,
const Transform& X_S1S2, Real radius, Real depth,
const Vec3& origin_S1, const UnitVec3& normal_S1)
: Contact(new CircularPointContactImpl(surf1,radius1,surf2,radius2,X_S1S2,... | 1 |
96f496cba4c4317c67351c6b906e3305 | f273159734e40e35a5685d5648a3a4e5 | Returns true/false whether the user is a participant in the conversation | if($conversation['Participant1']['id'] == $user['id']){
return $conversation['Participant2'];
}else if($conversation['Participant2']['id'] == $user['id']){
return $conversation['Participant1'];
}
return null;
} | 0 |
3c48a536f3c32d735e7de483e7538edc | 2f1a7bdb3e4d9f6c1e508c3294b8e0ce | Metaclass to make @property methods on a class with __getattr__
raise PropertyAttributeError instead of AttributeError. | class Protect(ABCMeta):
has_base = False
def __new__(mcs, name, bases, attrs):
if mcs.has_base:
for attribute in attrs:
if attribute in protected:
raise AttributeError(f'Overriding attribute '
... | 0 |
10fe3d8baec95a71dfbf8a1090beec69 | 9804d8e591d433b460287d4c4f5b61e3 | Returns a stored filter renderer by alias | public function removeFilter($alias); | 0 |
a73b22d0ccdad9b8acc952fec15914f1 | b765097efcff427b64abd7585317bb51 | Clicking anywhere on the game field pause/resume the game. | namespace Snake_Game
public partial class GameForm : Form
private void ClickOnMenuItem(object sender, EventArgs e)
{
if (!lbl_pause.Visible)
PauseGame();
} | 0 |
34451f455e3d9ba38580d8280946f72b | 67773810825841538002270828116b67 | Solve loopy belief propagation | m = len(x)
for i in xrange(m):
for n in xrange(np):
s = i
walk = 1
w = 1.0
while walk:
x[i][0] += w*b[s][0]
ns = sample(P,s)
if P[s][ns] == 0:
w = 0
else:
... | 0 |
1b799518fd81f8b69ae07d4032035a22 | 0ba442ba949a7e6f1bd1038e27c7ced9 | 控制桩点信息的文字是否显示 | public get showPointLabels(): boolean {
return this._showPointLabels;
} | 1 |
6741640ebdd81310d85bd496c1bf6836 | 09a7a0375450e2e0226e9ecbc084732a | 限制只刷新相同Tag的组,为空时不限制 | function BlogLabelDlg:refreshList(tagType)
local tags = BLOG_TAGS[tagType]
if not tags then return end
self.scrollView:removeAllChildren()
local contentLayer = ccui.Layout:create()
contentLayer:setName("ContentLayer")
local viewSize = self.scrollView:getContentSize()
local panelSize = self.t... | 0 |
ec59f616355eb037c0d67cbc7cdac55d | 0d38f100b4d3128396d6733eea5ee28f | Delete all documents from Solr. | @Component("solrUtility")
public class SolrUtility
public void deleteAllIndex() throws SolrServerException, IOException {
HttpSolrServer solr = new HttpSolrServer(solrTestServer);
int intTimeout = Integer.parseInt(timeout);
solr.setConnectionTimeout(intTimeout);
solr.setSoTimeout(intTimeout);
solr.delete... | 1 |
e79bf2590c60ec8d2960633ea8bba209 | 9425c8c4379d2c78b5e789a85c1a3f8e | Determine experience gains for a gang after a battle. | static void solo_gain(struct char_data *ch, struct char_data *victim)
{
int exp = 0, happy_exp = 0;
exp = MIN(CONFIG_MAX_EXP_GAIN, GET_EXP(victim) / 3);
if (GET_LEVEL(victim) > GET_LEVEL(ch))
{
if (IS_NPC(ch))
exp += MAX(0, (exp * MIN(4, (GET_LEVEL(victim) - GET_LEVEL(ch)))) / 8);
else
exp +... | 0 |
f39e6a4ef59a782a3be3bbd0df8889dd | 6d702bdd920f79313351808b2945e5ea | Check if QInt is zero | class LongDecimal():
def iszero(self):
return all(cipher == 0 for cipher in self._ciphers) | 0 |
ae408b48655e455b23c41a69b86b8ae9 | 10ffe2d824cecc7c8d3428e58d0240cb | Returns the maximum packet size as specified by the remote end. | public class UdpServer extends Server<UdpServerListener>
public int getMaxPacketSize() {
return maxPacketSize;
} | 0 |
133f8b79dbe1c396dc6b0fdd82e7fbd3 | 662c9c8c3b29eea88768752e45bc3894 | Checks if column drop is allowed when the schema changes. | class TestSchemaDiffer(TestCase):
def test_drop_column(self):
name_column = Varchar()
name_column._meta.name = "name"
genre_column = Varchar()
genre_column._meta.name = "genre"
schema: t.List[DiffableTable] = [
DiffableTable(
class_name="Band",
... | 1 |
03ae01da498b9b125050964112eee916 | 3c261fe4debb8c7d5eae46507c0bd5f4 | Called once all setters have been invoked, to allow Formatter to prepare
itself. | public class HumanReadableFormatter extends OutputFormatter
public void shutdown()
{
} | 0 |
4e5e1eb42326dc8b3046eef8b698093a | c9c0bcd03c097caec944b15b48b723d7 | Generator for leave-one-out cross-validation | ss = ShuffleSplit(n_splits=STEPS, train_size=BATCH)
ss.get_n_splits(self.features, self.labels)
for step, (idx, _) in enumerate(ss.split(self.features, self.labels), start=1):
yield self.features[idx], self.labels[idx] | 0 |
aed9cabbdb28ebdc8760ea69e4fa20ae | cc4ae80c562af903414b997b416c3498 | Metoda řekne zda byla hra vyhrána nebo ne | boolean jeVyhodena(); | 1 |
dc7451b32373b036613470d228cb8f00 | a135a6cc9ad1c073186e8469398b3b8e | Push channel buffer context into container. | {
m_xScalarBuffers.push_front( pxBuffer );
m_xScalarIndex.insert( make_pair( pxBuffer->Address(), pxBuffer ) );
} | 1 |
d4e8c8152279554dbe09dfc56aadeff9 | a0df0b4802396aee5f7ec9d1ec985293 | The waveOutGetVolume function retrieves the current volume level of the specified waveform-audio output device. | namespace SokoSolve.UI.Controls.Primary
class WindowsSoundSubSystem : ISoundSubSystem
[DllImport("winmm.dll")]
private static extern int waveOutGetVolume(IntPtr hwo, out uint dwVolume); | 1 |
7eab8f5f975b85f26bde6eaa3fe6cfe4 | 8dc5051214b4d7d0535f3cf115259ba2 | Removes the ID3V2 tag from a file | $temp_filename = $filename . 'temp';
$source_file = fopen( $filename, 'r+b' );
$id3_header = fread( $source_file, 10 );
$int_value = 0;
$byte_word = substr( $id3_header, 6, 4 );
$byte_word_length = strlen( $byte_word );
for ( $i = 0; $i < $byte_word_length; $i++ ) {
$int_value += ( ord( $... | 1 |
d422df15f20d112b0552b4a1fa7c0d4b | 1e826b8e2da6399a84a107bdd8926c6e | Открытие каталога с изображениями | function openGallery(id) {
closeAll();
var gallery = document.getElementById('gallery-' + id);
var card = document.getElementById('card-' + id);
gallery.classList.add('Gallery--active');
card.classList.add('Card--active');
hideGalleryBannners();
} | 1 |
5a1ab1315590c99e19da3150ea645840 | 47fe3b94adefb3309d824a25ed89fbfd | when help -> about clicked | {
var obj = e.target;
var hlpTab = document.getElementById('help-tab');
var mnuDiv = document.getElementById('menu-list');
var hlpDiv = document.getElementById('help-div');
if (obj.id == 'help-tab')
{
mnuTab.className = 'tab-back';
hlpTab.className = 'tab-front';
mnuDiv.style.display = "none";
hlpDiv.styl... | 0 |
27f8db09d5b7a8409acb5f0fc153ede3 | 275fa78c3b25874e5ce813e6223d8c0f | Permanently deletes a vertex from the graph. | public class Graph
public void deleteVertex(int id){
} | 1 |
21c71d8e8c00e5fdbe29aa1e7609bce0 | 9634dfb87d04abca087067b24ebc157a | 对 http://s.weibo.com/user/&work=%E7%BB%AB%E8%87%B4&page=2 的html响应做解析 返回搜索结果的uid 集合 | HashSet<String> uList = new HashSet<>();
String html = Login(comlink);
Document doc = Jsoup.parse(html);
Elements eles = doc.getElementsByAttributeValue("value", "跳页");
if (eles.size() == 0) {
return uList;
}
Element div = eles.first().parent();
... | 1 |
131a5e22ad1804727b3f15bed25db7e6 | 31d99279beb45650979f7bf65fc07a1f | Slices videos into N sections. | cap = cv2.VideoCapture(videoPath)
if not cap.isOpened():
return
frame_count = int(cap.get(cv2.CAP_PROP_FRAME_COUNT))
for i in range(10):
cap.set(cv2.CAP_PROP_POS_FRAMES, i * frame_count / 10)
_, img = cap.read()
newWidth = 120
newHeight = 80
img = cv2.resi... | 1 |
89eaa623f57b69dc2ba3f7d7398abe3b | fd83f364fe122fd9f7cbdb1893a3a874 | Set up API list action tests. | utils.setup_listing_api_fixtures()
utils.setup_fixtures()
_register(
'developments',
params=dict(
{
'fields': ''.join([
'id,title,description,logo,location,lot_size,'
'location_type,number_of_listings,number_of_groups',
... | 1 |
2eeaca21808fef5aab78c204b1facdef | e36c0f427162a7cece85a4a8868514ee | Writes attributes of EnvelopeType complex type | @SuppressWarnings("javadoc")
public class XMLStreamBindings extends AbstractXMLStreamBindings
public void writeAllowedValuesTypeAttributes(XMLStreamWriter writer, AllowedValues bean) throws XMLStreamException
{
this.writeAbstractSWETypeAttributes(writer, bean);
} | 0 |
278ff8bf51ae78d090ebc5bee54e5d54 | 362ee7f191f872258014aefcc9495f50 | get_all_named_actions gets the list of objects that show up in the current named policy. | class ManagementEnforcer(InternalEnforcer):
async def get_all_named_subjects(self, ptype):
return self.model.get_values_for_field_in_policy("p", ptype, 0) | 0 |
a4de4f106b120eca61913904757211e7 | d6fedf3d79b7446f9d3af12c8f92b3cd | * Fetch all steps with pagination | class StepsController extends Controller
public function index(){
return Step::get();
} | 0 |
4cfb56e84250ff8783ae3543be1129b0 | 3cb54cdf0fce7ef96b397ac4f580fac6 | Метод, вызывающий анимацию движения кубиков | class Cube:
def animate(self,myInterval):
seq = Sequence( myInterval , Func(self.setAnimated,False) )
return seq | 0 |
bcf447e889cb2249163c44f0efb6e425 | b7f3807e523637483c2bfe977ec61203 | Calculates the ratio of our compressed file to our original file. | void CWinLTCDlg::ShowCompressionStatistics(DWORD nOldSize, DWORD nNewSize)
{
CString sStats;
float fRatio = 0.0f;
if(nOldSize != 0)
{
fRatio = ((float)nOldSize - (float)nNewSize) * 100 / (float)nOldSize;
}
sStats.Format(IDS_INFO_COMPRESSSTATS, nNewSize / 1024, nOldSize / 1024, fRatio);
UpdateFileInfo(sStats);
... | 1 |
f8146f3502d05a97d66592a572d20627 | 2d238d2e4c732fbfe3f87728823cf159 | !
オイラー法(1次精度) | double tmp;
double omg[3] = {0};
double acosinput = (R[0][0] + R[1][1] + R[2][2] - 1.0) / 2.0;
if (fabs(acosinput - 1.0) < ZERO_VALUE) {
memset(omghat, 0, 3 * sizeof(double));
*theta = 0.0;
} else if (acosinput <= -1.0) {
if ((1.0 + R[2][2]) >= ZERO_VALUE) {
omg[0... | 0 |
8a034c9d2889d58af90cac78fc9079a3 | 9cefcb8f9cf22536e24b0165cbda5948 | Use this data source to get information of an available OpenStack Magnum node group.
## Example Usage
```typescript
import * as pulumi from "@pulumi/pulumi";
import * as openstack from "@pulumi/openstack";
const nodegroup1 = openstack.containerinfra.getNodeGroup({
});
``` | function getNodePoolOutput(args: GetNodePoolOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output<GetNodePoolResult> {
return pulumi.output(args).apply((a: any) => getNodePool(a, opts))
} | 0 |
bf75d2ce871fc4d32b4d12fbde10c6c2 | 74604d4217839e96ca2a755adf051185 | =================================================================
Gets the Bird velocity
================================================================= | glm::vec2 cRocket::getRocketVelocity()
{
return rocketVelocity;
} | 0 |
59c9afd2d8acdcd2917bc639f37280ff | 18984ce6f9edcb48a8114b320b042f12 | 个股公告(个股分析页面) | try:
url = 'http://news.stockdata.cs.com.cn/hqcenter/htmls/qcenter/index.html'
driver = webdriver.PhantomJS(PHANTOMJS_PATH)
driver.get(url)
time.sleep(7)
driver.switch_to.frame('main')
time.sleep(5)
tmp = driver.find_element_by_id('tab_body_rise').text.split('... | 0 |
fc45f5b78f62457512f3cc948633c80f | b3c2d75f85dc8934683c5a1017e513b3 | Returns DOM Strings | function toDOM(str)
{
const temp = document.createElement("div");
const fragment = document.createDocumentFragment();
let child;
temp.innerHTML = str;
while ((child = temp.firstChild))
fragment.appendChild(child);
return fragment;
} | 0 |
56c03498aaebecf0ebefa703b1d5506a | 3942f9cb1f0c49d0f6bf6be1127ecf2b | Get the row index for the top left corner of the chip. | dx = 61
dy = 98
chip_coords = np.array([[0*dx, 0], [1*dx, 0], [2*dx, 0], [3*dx, 0], [4*dx, 0], [5*dx, 0], [6*dx, 0], [7*dx, 0],
[0*dx,dy], [1*dx,dy], [2*dx,dy], [3*dx,dy], [4*dx,dy], [5*dx,dy], [6*dx,dy], [7*dx,dy]])
return chip_coords | 0 |
c2a00372216bd6af1fea4ab62a89c1a5 | 138888e61e12626c08dd397026fcb269 | 返回sys_ApplicationsTable实体类的ArrayList对象 | public class AppRunningFragment extends BaseFragment
public ListView getListApps() {
return listApps;
} | 0 |
ea7b6f4b9d39bbdce9efca29ddf5e92d | 074c7e0aae54094b26bf15729ca0300b | Determines whether the given member maps to a column participating in an isnull
condition. Useful to determine if a nullability constraint violation is going to
cause roundtripping problems (e.g. if type is based on nullability of a 'non-nullable'
property of a derived entity type) | {
if (member is null)
{
return false;
}
return member.Type.IsNullable();
} | 1 |
37772a9f827c86b6c93b4f077d921edd | 92a292e487c2574b39a6986c990cfcc2 | Метод удаляет email адрес из строки | if (list != null) {
for (int i = 0; i < list.size(); i++) {
if (list.get(i).email.equals(address)) {
list.remove(i--);
}
}
}
} | 0 |
35b5365feb839190a02a431be7c2e9ad | 9cd7d7da51ce6f7f4b73f5204db0ec47 | Create an instance of {@link TsResponse } | @XmlRegistry
public class ObjectFactory
public TransitServiceResponse createTransitServiceResponse() {
return new TransitServiceResponse();
} | 0 |
f2a3b15dc98910121f14f07d84018d6e | 97e2b709348a1109c77dfd67b599026c | Convert pipeline output to component output for pipeline
component. | class ModelmonitorDef(object):
def pipeline_component(self, pipeline_component):
self._pipeline_component = pipeline_component | 0 |
6c8f0c70fddfbcad108c950bec6e5b0a | fbf36d82f635a30264cbab9c6682f80f | Remplis le tableau des arguments a partir de la commande.
Renvoie le nombre d'éléments. | static int fill_args(char* s) {
char* token = strtok(s, " ");
int i = 0;
while( token != NULL) {
args[i++] = token;
token = strtok(NULL, " ");
}
args[i] = NULL;
return i;
} | 1 |
71cb49459628bbb8e284d0cc3b12cb14 | 8f0632e55314126a33ec736c8dcc6219 | Another test that the scraper correctly matches documents to the committee that published them | def test_developer_scraping(input_html, expected_json):
with open(expected_json) as file:
correct_repo_json = json.loads(file.read())
with open(input_html) as file:
raw_html = file.read()
articles_html = filter_articles(raw_html)
soup = make_soup(articles_html)
repo_json = scraping_d... | 0 |
c4f2cfbad3412b0214441872c0dce807 | c0150b3f756a38a7b3fee9a805cda47c | 创建算符优先关系表 | {
foreach (var s in slist)
{
table.Add(s, new Block[grammar.Symbols.Count]);
if (s.Rules.All(r => r.Expression.Last() == Grammar.P))
{
foreach (var rule in s.Rules)
{
var copyE... | 0 |
0ea0e2089042d773ddb7c46632ddc8d1 | 0c70d491b8c7226ef610ff6a3f8fac69 | se a tabela tem ao menos 1 entrada, libera a estrutura removendo os elementos. | if( !table ) { return; }
int new_capacity = 0;
{
if( (*table)->capacity == 0 ) {
new_capacity = 16;
} else {
new_capacity = (*table)->capacity * 2;
}
}
const int byte_count = sizeof(vetor_dist_t) * new_capacity;
vetor_dist_t * arr = malloc( byte_co... | 0 |
55780ca5a10d3621a02ad9f3bfccd945 | e23d232153859c2b5082e2c421327996 | 获取医生文章信息,并写入文件 | path = self.server
if not os.path.exists(path):
os.mkdir(path)
url_count = len(self.articles_url)
for i in range(url_count):
try:
self.browser.get(self.articles_url[i])
except Exception:
print("url error\n")
continue
sleep(2)
fileName = str(self.articles_name[i]).strip().replace('·'... | 1 |
857a4067d7e20118c182421bbaaa96b5 | 816317190256565547e3fe92b70a459d | devuelve el piso en el que se encuentra ese repetidor dentro del edificio. | class Pisos_model extends CI_Model
function devuelve_usuario_piso($idpiso) {
$sql = "SELECT idusuario FROM pisos WHERE id_piso=".$idpiso;
$resultado = $this -> db -> query($sql);
if ($resultado -> num_rows()>0) {
foreach ($resultado -> result() as $row) {
return $row -> idusuario;
}
} else {
return... | 0 |
ccb478685346a236b44e37be1e2dd07a | fefb33b3e0230a141beb901b528387ac | Returns the current value of the messagesProcessed" stat. | @JsonProperty("values_processed")
@JsonInclude(value = JsonInclude.Include.NON_NULL)
public Long getValuesProcessed() { return valuesProcessed; } | 0 |
623cd2d05c794ec485b5b5140a58a904 | 1825a81473254b1d82a91bb7d775b702 | Set the heading to face east | void setFacingEast() {
removeStepDelay();
while (!facingEast()) {
turnLeft();
}
addStepDelay();
} | 1 |
bf5c11b53ca5f598f458d039f6b11ddc | df8b9b891e1ab7b59a2d4afdbaa0f058 | 判断字符串属于哪种选择器 | if (!selector || typeof selector != 'string') {
throw new TypeError('The argument must be a selector string')
}
if (/^#{1}/.test(selector)) {
return {
type: 'id',
value: selector.substr(1)
}
}
if (/^\./.test(sele... | 1 |
ec4241f12bd04eadfa3182f4af2245c1 | 65c9306a56b36660034387b97258b754 | search a sorted array of string that contains empty strings | function searchStrings(s, item, left=0, right=s.length-1){
if(left > right){
return -1;
}
let mid = Math.floor((left+right)/2);
if(s[mid].length === 0){
let nonempty_left = mid-1;
let nonempty_right = mid+1;
while(true){
if((nonempty_left < left && nonempty_right > right) || nonempty_left ... | 1 |
08818b6cf8bc96e5fc4ee964e13b3bb5 | 758afc39be9be5371b62e6aeb62fa775 | The chosen map implementation is a <code>TreeMap</code>. | TreeMap<Integer, String> javaTreeMap1 = new TreeMap<Integer, String>();
for (int i = 0; i < 30; i++)
javaTreeMap1.put((Integer) i, "str=" + i);
System.out.println(javaTreeMap1);
TreeMap<Integer, String> javaTreeMap2 = new TreeMap<Integer, String>(new MyComp());
for (int ... | 1 |
99659cbc2b8ba3dc9d47ed1dadb0ac9a | b7598bf51fe72b6a0f5d546edd21878e | 지정된 초 수를 더한 새로운 (UTC) System.DateTime을 반환합니다. | {
return new DateTime(2016, 07, 08, 0, 0, 0).AddMinutes(minutes).AddSeconds(seconds);
} | 0 |
3c9fcc28eb1fbe92519a38e4f1590e1c | a217819f4ed705c0039312e433ea619f | 移除攻击者 | namespace battle public class HBattleActorUtil
public static void RemoveActor(HBattleActor actor) {
HBattleActorMgr.instance.RemoveActor(actor);
HSkillUtil.PlayFx("fx_teleport", actor.actorInfo.vector2);
GameObjectUtil.Destroy(actor);
CheckGameOver();
} | 1 |
a6d3c8b721730a1c86125b481eef4eb7 | 6c262eae592bd58d417700507f972cdb | 64-bit hashing function | def hash64(x):
x = (x ^ (x >> 30)) * (0xbf58476d1ce4e5b9)
x = (x ^ (x >> 27)) * (0x94d049bb133111eb)
x = x ^ (x >> 31)
return x | 1 |
6a8ac08bcc4fa4a29659299766265bbc | a6db2c3640d7c04e56bb7e80fd05beca | 解析字符串,一组数据中用分号隔开,同一组数据中的每个元素用|隔开 | List<String> list = new ArrayList<String>();
if (null == str)
return null;
if (str.equals("")) {
list.add("");
return list;
}
String[] array = str.split("\\|");
for (int i = 0; i < array.length; i++) {
list.add(array[i]);
}
return list;
} | 0 |
cd6435a17ac8a3a5afc4925bdaf1ffc1 | ec49fdc97edc3451a706702627027424 | 查詢特定城市所有訂單 | namespace ASP_NET_Core_Shop.Controllers
[Route("api/[controller]")]
[ApiController]
public class WebAPIController : ControllerBase
[HttpPost]
[Route("GetAllOrders/{city}")]
[ProducesResponseType(typeof(List<Order>), 200)]
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
public IActionResult GetAllOr... | 1 |
7bbb9618c8cdfd5c993552088a075ad4 | 76740e925ec5340166afd532d5b1f7bc | Gibt zurück, ob die Welt existiert | public class WorldConfig extends WorldConfigStore
public boolean isLoaded() {
return getWorld() != null;
} | 1 |
21d309e3971f73b18a5919f1e8c1dc9c | 653d4d54d90caa4d795618f19fd18ca7 | \brief This method turns the led on the button on | void Leds::LedButtonOn()
{
digitalWrite(DIGITAL2, HIGH);
} | 1 |
11ef061b7607432e4c715d4f6563357d | b894ecd9ae881999316fee6c735edc49 | Set pre uninstall program. | public class RpmPackage
public void setPreTransactionProgram(String preTransactionProgram) {
this.preTransactionProgram = preTransactionProgram;
} | 0 |
81b2e5c289d4ae8d687fadfd9fb6845f | dcde651b4e3e5e167f5f1f176aa0ba55 | target: test collection without vectors
method: create collection only with int field
expected: raise exception | self._connect()
error = {ct.err_code: 0, ct.err_msg: "Primary field must in dataframe."}
self.collection_schema_wrap.init_collection_schema(fields=[], primary_field=ct.default_int64_field_name,
check_task=CheckTasks.err_res, check_items=... | 1 |
924e7ea941edd12394f2f7e7ce6cbf11 | 81c3fcadb9cf7bd2d56a96a14f30e610 | ===================================================================================================
compare two speBuf
=================================================================================================== | int simbond_compare( const void *sim1, const void *sim2 )
{
int s1= ((SimBond *)sim1)->sim;
int s2= ((SimBond *)sim2)->sim;
if(s1 > s2) return -1;
if(s1 < s2) return 1;
return 0;
} | 0 |
2b84a8f817895fea05f0a4a6c36bdede | 43f5247cf0dfdb3723469ae5e7cb86ee | sets weights to random values and fills deltas with zeros
to the same size as weight matrix | namespace DeltaLearning
public class DeltaLearning :IAlgorithm
private void initializeWeights()
{
for (int i = 0; i < m_Dimensions; i++)
{
m_Weights[i] = 0;
}
} | 0 |
28e1d0ee4278c20314375318db48f2bd | 24eebe73bf366b86f38458aaadf3c5e1 | r"""
Return True if the number field that defines this element is not real.
This does not imply that the element itself is definitely non-real, as
in the example below. | def is_real(c):
if isinstance(c, ComplexRI):
return c.imag == 0
elif isinstance(c, ComplexMA):
return c.angle % pi == 0 | 0 |
c335c17f7b40ad5a30bb85c2719c1e24 | ffbb6b32188c814db9df529ca0614702 | 根据课程ID获取首页预览显示图片 | QueryResponseResult getCoursePicList(String courseID); | 1 |
ffceb36bc90d80d33083724bfa3fe53f | 5ad7e5e5071448125aa5a73387c595b5 | 跳转至个人基本资料页面。 | @SuppressWarnings("serial")
public class TaxPayerAction extends ActionSupport implements
ServletResponseAware
public String toPersonalPage() throws Exception {
return "toPersonalPage";
} | 1 |
cf87b5614fe5420ac52252ff7e85fac6 | 21139bc3cd16d69356ad351ce3b0ee87 | 获取茶青收购记录详情 | return fetch({
url:'/data/consume/record/' + id,
method: 'get',
params: form
})
} | 1 |
afb59fb0781521ad6fbaedfca2972b68 | 1c0da4b27ae769227f43795da3d16056 | 获取线程运行时间 | public class ToolDevice
public static long getRunTimes() {
long ut = SystemClock.elapsedRealtime() / 1000;
if (ut == 0) {
ut = 1;
}
return ut;
} | 0 |
567d8c5643cf5703810d6742bc03f5dc | 797d6926326312e86ed8fcb915567a16 | 数牌であればtrue,字牌であればfalse | public class GamePlayable{
public boolean isJoker() {
return joker;
} | 0 |
1b06c768ad25c4799c3b1c1d331c2945 | 45bb69fff89dbad032d164cd4ab91609 | 選択されたアピールアイコンの情報を取得します。 | public class JuchuTuminiDenpyoHako_CheckService extends KitService
public JuchuTuminiDenpyoHakoRecord getRecSelected() {
return new JuchuTuminiDenpyoHakoRecord(recSelected.getHashMap());
} | 0 |
71281bae235734544d70a088e8a988f0 | 5d0ecfe686444dbefda38a668f3a3216 | A convenience method to get the previous height level according to the order
in which they were declared. | $previous = false;
$sizes = static::sizes();
$key = array_search($currentSize, $sizes);
if ($key !== false && $key > 0) {
$previous = $sizes[$key - 1];
}
return $previous;
} | 1 |
26aee01835bb7e9106b9e94e73f9f13e | d7297b2a40bc853fb441b775c602dc7f | 全フレームのスコアの合計を取得
単純にスコアを合計して返す
(スペア、ストライク等の考慮なし) | {
int totalScore = 0;
foreach (var frame in Frames)
{
frame.FrameScore = frame.Roll1.GetValueOrDefault(0) + frame.Roll2.GetValueOrDefault(0) + frame.Roll3.GetValueOrDefault(0);
totalScore += frame.FrameScore + frame.Bonus;
}
... | 1 |
072904309a826cdd43b70c319833319b | 72aee285cf93488160309d26d34682af | 获取MediaRecorder实例 | val minSize = AudioRecord.getMinBufferSize(
AudioConfig.SAMPLE_RATE, AudioConfig.CHANNEL_CONFIG,
AudioConfig.AUDIO_FORMAT
)
audioRecorder = AudioRecord(
MediaRecorder.AudioSource.CAMCORDER, AudioConfig.SAMPLE_RATE,
AudioConfig.CHANNEL_CONFIG, Audio... | 0 |
4343a3a9d7811547032d464b18d905a8 | 7e91a12a1a0310a75244bcf4e790e65f | Checks if the sharding spec is compatible with the provided tensor. | class TensorShardStrategy(BaseShardStrategy):
def _shard_tensor(self, t: ShardedTensor, process_group: Optional[dist.ProcessGroup] = None):
if t.is_sharded:
return
if t.payload.device.type == 'cuda':
assert t.payload.device == get_current_device(), f"shard tensor on cuda device i... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.