query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
b7cda4415ec2bd4be91e744159d9d798 | 992f2709ce82c5e755794f3f08aa0ecb | 更新阅读量 | "where id = #{id}")
int updateRead(
@Param("id") int id
); | 0 |
6e9d764fd80e23dbd578a38bd20ecf21 | 7ab4e8a4cda191f88e24aefe2f5aef6f | Get transaction resource usage set. | public StorageResourceUsage getStorageResourceUsage(); | 0 |
379c0c41c92bac4a77d3459c5aa2146f | ec5f9c4e41bfd3556531283ec89482f2 | Method to run the order waiter thread | {
shopping.RunShoppingThread();
try {
shopping.join();
} catch (InterruptedException ex) {
Logger.getLogger(SupermarketModel.class.getName()).log(Level.SEVERE, null, ex);
}
} | 0 |
057f81ffa9ac012534bb9f787793e616 | 119249559b0590b0dc1c95a15c965196 | 将输入的范围wkt转为[xmin,ymin,xmax,ymax] | List<double[]> coordinates = new ArrayList<>();
wkt = wkt.substring(wkt.indexOf("(") + 1, wkt.indexOf(")"));
String[] strs = wkt.split(",");
for (String str : strs) {
String[] coordinateStr = str.split(" ");
double[] coordinate = new double[3];
coordin... | 0 |
594b63a497737d99a320d46195c33e50 | eaf2d92f8ec5bcddb664eda66b462e72 | Retrieves the topic of a change. | public class CreateTopicOperation implements TopicOperation
@Override
public Description getDescriptionFor(@NotNull final TopicChange topicChange) {
return DESCRIPTION.getForResource(topicChange);
} | 0 |
451f168a09918eecab22ba2136d43c6a | 388bddde852e82a0286e9d13f1432111 | 删除Sys_PU_Config对象(即:一条记录 | namespace KNet.BLL
public partial class Pb_Products_Sample_Confim
public bool Delete(string PBC_ID)
{
return dal.Delete(PBC_ID);
} | 0 |
12a34463b117e2890191ced1248860e1 | 4d34ebbe1320b97d9fa15d5b1fc33133 | Deallocates C objects used to boost EBM. | class NativeEBM:
def close(self):
log.debug('Deallocation start')
FreeTraining(self.model_pointer)
FreeInteraction(self.interaction_pointer)
log.debug('Deallocation end') | 1 |
f47b9b88eada73a2d4411936c683a273 | e97f81fe630ec1d76bda088ec13e64bb | Function skips whitespace in a string | void _fastcall skip_ws(char** pString)
{
char* pStringEx = *pString;
while (*pStringEx == ' ' || *pStringEx == '\t') pStringEx++;
*pString = pStringEx;
} | 1 |
2d4599f49b3b2bbfe6c447624ba87740 | 965963e0ad54b504c5a0a94f49c015a8 | take average of X and Y acceleration as the zero G value | class TopShiftParam:
def d_Z_0(self, X_I, X_II):
return (X_I + X_II)/2.0 | 1 |
a859b3eb76d7e51ba1cc0c91da0887ea | aac87116a1c17ffaec5d2c0c4da6252a | Função para mostrar o form da pessoa jurídica | function init() {
$('.row-cadastro #wrapperFisicaJuridica').addClass('hide');
} | 0 |
30994874285ae521d6d5b64e0596151f | 0af51835887415a6d8bbec572c5dcead | LTL formula of CLOSE action. | d = self.Wire('d-wire')
e = self.Wire('e-wire')
self.OrGate(a, b, d)
self.AndGate(a, b, c)
self.Inverter(c, e)
self.AndGate(d, e, s)
return 'ok' | 0 |
9decedebad4f8f004621341b3b099528 | 1695e9a7cf50f340074a0db1e34de460 | get Pet Hotel order detail from Service order_id | $query = "SELECT * FROM tb_orderman_history WHERE service_id='".$service_id."'";
$result = $this->db->query($query);
return $result->result_array();
} | 0 |
d3e2b9bb7013766832c179de8896790a | b63677510fae341f2739d9437122a454 | Setter for relation 'Substitution->SubstitutingClassifier'
Metamodel description:
<i>null</i> | EReference getSubstitution_SubstitutingClassifier(); | 0 |
6bc6be9c7c8379fd4487071665fa9c73 | 7f3bc2f67f2b7ef8b7f1aac1afcfd8fa | 返回不存在另一个PCollection中的元素,相当于做容器减法 | operator fun <T> ImmutableCollection<T>.minus(elements: Iterable<T>): ImmutableCollection<T> {
return removeAll(elements)
} | 1 |
d7ce04850eab84f26309ed763a1b6c1f | d42575e2008f0e7e320421becbdc9658 | Listens for mDNS Service Announcements | public class MDNSClient
public void startListening() {
new AsynchronousExecutor().execute(jmdns);
} | 1 |
b9d78513a4a44110b716087469d2d539 | 90857f8a98ae12c19bb134086678c852 | Creates a encryptor session. | {
if ($this->resolvedOptions['encrypt'] === true) {
return $this->buildEncryptedSession($handler);
}
return new Store($this->resolvedOptions['cookie']['name'], $handler);
} | 1 |
52e6bf48c29f5bd6e3bb3d09815a8589 | 4d00b341e9d2aa1db31af5df4ffcb497 | Gets a very limited set of CSharp keywords. | class Python extends Language
public function getKeywords()
{
return [
'False',
'class',
'finally',
'is',
'return',
'None',
'continue',
'for',
'lambda',
'try',
'True',
... | 0 |
d577336d41436f4f68c2617b940752ac | 39d88160f08fa592a5a731ea6a54033d | Edits the bill | export class BillService extends BaseApi
updateBill(bill: BillModel): Observable<BillModel> {
return this.put('bill', bill);
} | 1 |
8fd5dc649495535364b57de39fc6e41b | 018d447a72280e91f8b6154dc6e70fd9 | Checks if the player name and cave are available | public boolean isNameAvailable(String playerName); | 0 |
f6b4f1921d5c3b2202b14b1a6fffb30d | ac4a8470a764d6941aa182641167d9dd | Reset depth offset. | public double getDepthOffset(); | 0 |
34cf3c0fb4e337d81749cd03de79cd27 | da3e3b500019fb2aa59d2344b71ae98c | 处理回报,对回报进行累计,并归一化 | self.totalcost[days] = self.cost[0][days] + self.cost[1][days]
self.totalfee[days] = self.fee[0][days] + self.fee[1][days]
self.totalvalue[days] = self.value[0][days] + self.value[1][days]
self.totalrate[days] = (self.totalvalue[days] + self.money_cut[0] + self.money_cut[1])/ self.totalc... | 0 |
e520e5aa3d74706c0364ebd6894a169e | 9dc5d660117e122aba13216f437933f4 | 获取艺龙id对应的远程xml地址 | url = "https://v1.itooi.cn/netease/url?id=" + id + "&quality=flac"
res = requests.get(url, headers=headers, allow_redirects=False)
return res.headers['location'] | 0 |
63b38e2ac5423a244aa77776c4bda7c5 | b780f0350c4fe2b8bb989adc90792f09 | Cleans orphaned published data before a given timestamp. | if date is None:
date = datetime.datetime.utcnow() - datetime.timedelta(365)
else:
date = normalize_date(date)
self.search([('create_date', '<', date2str(date))]).unlink() | 1 |
9008be1e6e775bbac45c04c9bd0b26cd | d0419e5e93563596ec50eb856a39b95b | Get user input on which conversion they would like to perform | char userSelection;
while (true) {
cin >> userSelection;
if (userSelection == '1') {
return 1;
}
else if (userSelection == '2') {
return 2;
}
else if (userSelection == '3') {
return 3;
} else {
cout << "Pleas... | 1 |
4e8d143dab1fc7d808e36f360ae7dead | c2053d7cb7602ed8655e8edf2cf4eb34 | Ensure we use an admin connection
Plugins can overwrite it to eg. construct a special admin user name | class TASK_cleanup extends BASE_Task
public function __construct()
{
parent::__construct(true, "admin@localhost", "admin@localhost", true);
} | 1 |
cef93e0b44b3e80860434f561839db5b | 566d34a64faef99a4560a6d5683f1058 | Test the upload files ensuring they can be encrypted then decrypted. | logger.debug("test_file_encryption_and_decryption begins")
encfno, encfname = tempfile.mkstemp()
decfno, decfname = tempfile.mkstemp()
os.close(encfno)
os.close(decfno)
logger.debug('Encrypting to: %r', encfname)
logger.debug('Decrypting to: %r', decfname)
... | 1 |
9fe01a7924e9fe0066cae96a1427ae3c | 5fd51123969ebe2c7959352a627cc526 | Method to invoke when the PopupUOMCommand command is executed. | namespace CPC.POS.ViewModel
public class ProductManualViewModel : ViewModelBase
private void OnPopupUOMCommandExecute(object param)
{
PopupUOMViewModel viewModel = new PopupUOMViewModel();
bool? result = _dialogService.ShowDialog<PopupUOMView>(_ownerViewModel, viewModel, "Create new ... | 1 |
7082c9780bfe95eb305713b9035ba283 | 7d54d184969f8d975e079e7001307725 | Gets the name of a file without the file extension. | namespace FileExplorerMobile.Core.Interfaces
string GetFileNameWithoutExtension(string path); | 1 |
8ce3a64180cbfaefbdbfcfba84e21308 | 76c8c791846fd29f2bd2b2b34aa86f22 | 控制远程鼠标移动事件 | void RemoteDlg::SendMouseEvent(int cmd, CPoint point)
{
MouseEvent me;
me.mouseLeg = cmd;
me.x = point.x + m_showX;
me.y = point.y + m_showY;
CString str;
str.Format(_T("x:%d y:%d"), m_showX, m_showY);
OutputDebugString(str);
Server_Head head;
head.cmd = CMD::MOUSEEVENT;
head.dat... | 1 |
60b26c52a4329b2adcbf06b11ef680a1 | dd8fb2a070bdb168cc1c9e97e08b353f | Invoked when multiple bullets must be fired, i.e. the triple shot upgrade | public class Player extends MoveableObject
public void shootTripleProjectiles(char currentDirection) {
if (System.currentTimeMillis() - lastFireTime > fireRate) {
Projectile p = new Projectile(getProjectile(), currentDirection);
p.setX(getX() + 20);
p.setY(getY() + 25);
... | 1 |
9eb7a36c0a16bb5096f24cafbdedc529 | 6009db85fd36d2fd5a72c4eb6c29e441 | ==============================================================================================================================
Returns a point (grid CRS) which is the rounded average of (i.e. is midway between) two other grid CRS points
===================================================================================... | {
if (src1 == src2)
return src2;
else if (src1 < src2)
return (((src2 - src1 + round / 2) / round) * round + src1);
else if (src1 > src2)
return (src1 - ((src1 - src2 + round / 2) / round) * round);
else
return 0;
} | 1 |
37257c7897fc95466f16e7d1b48b017f | faf0570cc3b774a83ecdf58b2f904c9a | Flag to control if shared secrets must be 32 bytes | class EventConnectionAuthParametersOauthOauthHttpParametersBodyArgs:
def is_value_secret(self) -> Optional[pulumi.Input[bool]]:
return pulumi.get(self, "is_value_secret") | 0 |
5526712c9aa42d8bb8dedfee22cc4846 | 1eca9cbebb5f2a5c8e9e62f2f49f52e9 | Retrieve the window handle (if any) for this browser. If this browser is
wrapped in a CefBrowserView this method should be called on the browser
process UI thread and it will return the handle for the top-level native
window. | namespace Xilium.CefGlue
public sealed unsafe partial class CefBrowser
public CefBrowserHost GetHost()
{
return CefBrowserHost.FromNative(
cef_browser_t.get_host(_self)
);
} | 0 |
f4deb3b2b80cb45efca624f3ae3f3692 | 77b4235602c6f885878451a1fc8ac103 | Retrieve Buy Service API Endpoint | abstract class AbstractPaymentConfig extends \Magento\Payment\Gateway\Config\Config
public function getBuyServiceApiMerchantId($storeId = null)
{
$merchantId = $this->commonConfig->getBuyServiceApiMerchantId($storeId);
return $merchantId ?: $this->getDigitalBuyApiMerchantId($storeId);
} | 0 |
805e23d30234667b059963ef1fc7292a | e1da3c5b91cb89c9cc3095b3cf48151d | estimate uses very simple algorithm to assign priorities based on CPU number required for the job | {
int jobSize;
if (numPages <= 10)
jobSize = 1;
else if (11 <= numPages && numPages <= 25)
jobSize = 2;
else if (26 <= numPages && numPages <= 50)
jobSize = 3;
else
jobSize = 4;
return jobSize;
} | 0 |
f29c3e1f68e0e10492345a4058896e8e | 05acd55a6994b0ed68252df89c4beb6f | 删除某个查询字符串上的所有侦听器
并移除这个查询字符串 | if (query != null) {
query.remove(trimToNull(id));
}
renderer.clearQueryBuffer();
return this;
} | 0 |
2f6a9cf8def2e124c408f44a03d1a81c | 76bfeba03ee6f71f46d72ff1d41bc6b3 | イベントページを公開するときの特有の処理を行うJobを追加する | String schema = RequestContext.getSchema();
Map<String, Object> eventData = new HashMap<>();
eventData.put("appointment_id", appointmentId);
eventData.put("schema", schema);
eventData.put("eventId", eventId);
Map<String, Object> jobData = new HashMap<>();
jobData.put("schema", schema);
j... | 1 |
2933daeda1cd3b743419037232954413 | 68e3471ea5a96d3d6c8bc9d8dd5bb287 | Asserts active filter data. | {
$cmsBlockIndex->open();
$data = $cmsBlock->getData();
$data['is_active'] = $data['is_active'] == 'Yes' ? 'Enabled' : 'Disabled';
if (isset($data['stores'])) {
$storeId = is_array($data['stores']) ? reset($data['stores']) : $data['stores'];
$parts = explode(... | 1 |
d724bcd189a107ad5c96bc7fba1ccf56 | 7a3bea848ac3cb8293f2de0995378329 | 获取登录用户收听的人的列表。 | class Doubanfm(object):
def get_playlist(sefl):
self.login_data['channel'] = self.channel
post_data = self.login_data.copy()
post_data['type'] = 'n'
s = requests.get('http://www.douban.com/j/app/radio/people?' + urllib.urlencode(post_data))
self.playlist = eval(s.text)
pr... | 1 |
7746c0de743a504879b2524802a0168c | 92bee2b17eeea7cfce962b2cabaec06d | Remove unwanted fields from the input data before deserialization. | class DataTransformer:
def remove_unwanted_fields(self, record) -> Dict:
unwanted_fields = ['GeoId', 'popData2018']
for field in unwanted_fields:
if field in record:
del record[field]
return record | 1 |
d76e8ea6391e37c0fdf296b60609b43a | ad5de2fd1373314cd9181598a85040b6 | Función que lista los tipos de equipamiento por categoría | class TypeEquController extends Controller
public function index()
{
$title = $this->title;
$list = TypeEqu::all();
$ruta = [['Inicio','/','fa fa-home'],['TipoEquipo','tipo','fa fa-th-large']];
return view('tipo.index', compact('title','ruta','list'));
} | 0 |
d79864620a376048bf32abb8541045cd | 36e78e1002e9ac6be858acee97cfaa98 | Get raw text from part of the page | public class Page
public String getRawText() {
return rawText;
} | 0 |
e57d5c9a1ddde4ce1845fb7d84f75379 | c9c85b0b1843121abb22c53529c3a98c | Integrates the given function via the midpoint rule. | dx = (b - a) / max_steps
s = 0
for i in range(max_steps):
s += (f(a + dx * i) + f(a + dx * (i + 1)))
return s / 2 * dx | 0 |
51b1720ef4ca27b68a21321c2e89974b | 4594891838e07d755c93c90b1c2093d2 | 三元组输入函数 | int a[3],b[3];
for(int i=0;i<=3;i++)
{
scanf("%d %d",&a[i],&b[i]);
}
for(int i=0;i<=3;i++)
{
printf("%d %x %d %x\n",a[i],&a[i],b[i],&b[i]);
}
return 0;
} | 0 |
a87dc3b95680954f3b3464bf6e049d37 | 8681abb3f64593f8ebb67f4bf42d5d22 | Runs alignment using the given code file and clone positions. All lines
are 1-based and inclusive. Returns the clone classes after alignment
(sorted by {@link StableCloneClassComparator}). | class Aligner(abc.ABC):
def run(self, read_paths, work_dir=None): | 0 |
ba6e3440dcfe950262ea4621e5ba5e5a | 0eb18b8cbb6fb34f1056718e6798b4a2 | # selected | the_booked_one <- function(data_in){
return(data_in[data_in$selected == "yes", ])
} | 1 |
6717260752b9e5cc1803d7add526e9ce | dda072a5bc2778d9247f7763a34b4641 | Initialize a Resp2079876Root object from a json dictionary. | dictionary):
if dictionary is None:
return None
partner_id = dictionary.get('partnerId')
borrowers = None
if dictionary.get('borrowers') != None:
borrowers = list()
for structure in dictionary.get('borrowers'):
b... | 1 |
4039d396ef0576d706b495e84c0a57ae | 86702d0e15352a87cf00a18e1e01ffdf | Checks if the data type has changed. | {
switch(column)
{
case LinkTypeColumn.LinkTypeId:
return entityData.LinkTypeId != _originalData.LinkTypeId;
case LinkTypeColumn.PipeFlowTypeId:
return entityData.PipeFlowTypeId != _originalData.PipeFlowTypeId;
case LinkTypeColumn.Name:
return entityData.Name != _originalData.Name;... | 0 |
5a044c47f2e2679f4f51de50394d972e | 4edfc79e5ec4e9bdfa924242181dc2a6 | @brief Get currently accessed register, which always equals to selected
register from anx7447 emulator. | namespace DebugExt namespace LuaFunctions
int getRegister( lua_State* L )
{
std::string reg_name( strToUpper( lua_tostring( L, -1 ) ) );
CPU::JoinFlags();
#define CHECK_REGISTER_PARAM( reg, var, is_flag ) \
if ( reg_name == reg ) \
{ ... | 1 |
5eb8cbdc01d4b58b40938144615aabb8 | 75a090c46c04d174b08fcd3c80dcc68c | Deletes one key and child from the sibling, depending on its position. | {
var leftSibling = node.LeftSibling;
var outdatedKey = node.Keys[0];
node.Children[node.KeysNumber + 1] = node.Children[node.KeysNumber];
for (var i = node.KeysNumber; i >= 1; i--)
{
node.Keys[i] = node.Keys[i - 1];
nod... | 0 |
e26f4c51383991ba48559a215e0e7a0a | 58fad40d6f8d74e1b2c3acae12dc7cb1 | Newlines | class LatexFormattingTest : BasePlatformTestCase()
fun testBacklashNewline() {
"""
Text hallo i.e.\
\[
\alpha
\]
""".trimIndent() `should be reformatted to` """
Text hallo i.e.\
\[
\alpha
\]
"... | 1 |
98e176ad3e1daeed79ebb894b4fb01e2 | 6347e30f7dfde06a003ca37c78e3238d | Returns whether this direction is horizontal, with the assumption that
only the four cardinal directions are represented. | public boolean isHorizontal() {
return this.equals(EAST) || this.equals(WEST);
} | 1 |
18c6f4924ec0add0a4a2e6b80357eb0c | 9aa6d713588abe92f3dc5385883d192a | determine batch or job directory from cwd and option | if 'GREATFET_BUILD_DIR' in self.shell.user_ns:
return '-C{}'.format(self.shell.user_ns['GREATFET_BUILD_DIR'])
elif 'GREATFET_BUILD_DIR' in os.environ:
return '-C{}'.format(os.environ['GREATFET_BUILD_DIR'])
else:
return "" | 0 |
5479fa6d61aa8cf8aaf95088f91d0d29 | c2bd3fb1502302daca8558e064e5491c | When click/touch down in mobile menu and moved to the left close the menu. | if (burgerMenu.classList.contains('active') && window.innerWidth > 768) {
burgerMenu.classList.remove('active');
}
} | 0 |
7f4717441296dd75994a8b2e490bdcae | 67947472e9e5d90391ae2fb1cd9e3de2 | <p>
Sets the Amazon Lightsail resources that can access the specified Lightsail bucket.
</p>
<p>
Lightsail buckets currently support setting access for Lightsail instances in the same Amazon Web Services
Region.
</p>
Asynchronous callback handler for events in the lifecycle of the request. Users can provide an
implemen... | public void setBucketLifecycleConfiguration(SetBucketLifecycleConfigurationRequest setBucketLifecycleConfigurationRequest)
throws ClientException, ServiceException; | 0 |
b9e23f309b0c218d99c011cae5bb17b7 | f79bb9a07d8e4c37b6047f823142ac1c | Hàm search class của GV | namespace QuanLySinhVien.GUI
class GiaoVienController
public DataTable SearchGiaoVienHD(string tenGV)
{
string query = "SELECT * FROM GIAOVIENHUONGDAN WHERE TenGV = '" + tenGV + "' ";
return DatabaseCore.GetDatatable(query);
} | 1 |
1e325cf639971b4380afbca5d5f7d959 | 15e542f9d03c9e54c56fc8cbf54a16e3 | assert that null is returned when passed coordinate is out of bounds | TEST(ConnectXTest, outOfBounds)
{
ConnectX connectObj;
ASSERT_EQ(-1,connectObj.at(20,45));
} | 0 |
51c85884fab469c49294f1c50bbcd62e | 2ec155a03efc670d7d1aebcc82347420 | 节点数据磁盘存储数目。 | @JsonFlatten
public class BigDataPoolResourceInfoInner extends Resource
public BigDataPoolResourceInfoInner withNodeCount(Integer nodeCount) {
this.nodeCount = nodeCount;
return this;
} | 0 |
14cd514381f268d90f6b6ed2ae4473b9 | 9faf2d45e668a7d1e49d5c725640b380 | 发送短信配置信息 ,找回密码/验证码 | @Controller
@RequestMapping("/settings")
public class BasicSettingController extends BaseController
@RequestMapping(value = "/sms", method = RequestMethod.GET)
public ResponseEntity getSms(
@RequestParam(value = "mobile") String mobile,
@RequestParam(value = "isModify", required = false) boolean isModify) {
Ma... | 1 |
a358b938198a2d8da7683c55522a1efa | 3b695f19cf0a2d915fb1b1db4213c3ba | 判断给定的牌是否碰碰胡 | namespace MahjongAlgorithm.Algorithm
Context IsHu(Card[] cards, Card card); | 1 |
3457be3d87c1c041503ca00bb3e1b37e | ea6a07e3d758f2713fa936ce22e49f96 | 获取报溢报损单 | let data = {
"BaseInfo": {"TradeCode": "GRP0017"},
"InputData": {
"ContNo": "66789984993872",
"RiskCode": "10021702"
}
};
let config = {
"method":"POST",
"url":"",
"data":data
};
... | 1 |
cab814433ae15963d95c820a2e3d3679 | cd758b26c4be8659912fb335177aab23 | @brief find the "best" encryption key
The "best" is the first one that is not expired, or simply the
first one. | {
AssertLockHeld(cs_wallet);
if (nCreateTime <= 1) {
nTimeFirstKey = 1;
} else if (!nTimeFirstKey || nCreateTime < nTimeFirstKey) {
nTimeFirstKey = nCreateTime;
}
} | 0 |
a6f2c1c67208a04e132b0de01c4d960b | 28885d65deb58096fb1a9ce4d99e1ec0 | Gets the location of a SqlParameter in the collection. | namespace SimpleAdo.Sqlite
public sealed class SqliteParameterCollection : IDataParameterCollection
public int IndexOf(string parameterName)
{
return m_parameters.FindIndex(x => x.ParameterName == parameterName);
} | 1 |
89ec5aa2af04e166564ae3072491c111 | 1fdb7339476f70e6d7275da7779aca36 | This function calculates the minimum number of bits needed to represent a given unsigned integer value. | namespace DSPUtilities
class FFT
private static int NecessarySignificantBits(int num)
{
int bitCount = 0;
while (num > 0)
{
num >>= 1;
bitCount++;
}
return bitCount;
} | 1 |
4c76b0fff23815b974b7997e5641ed2a | 7132bc72e31ab7be4e7e9b63a1e9cdd8 | 继承力导向网络的构造函数 | class NetWork(object):
def __init__(self, input_num, hidden_num, output_num, alpha):
self.input_num = input_num
self.hidden_num = hidden_num
self.output_num = output_num
self.alpha = alpha
self.init_parameter() | 0 |
2f4c8d1c84e0996d5747795e8f07cfb9 | fab6218415f7bc216420d71730fe9a31 | this makes a 9x9 filled it with numbers that conform to the rules of Sudoku. | {
int rando =0;
srand((unsigned)time(0));
int grid4[N][N] = {{0,0,3,4},{3,4,0,0},{0,0,4,3},{0,3,2,0}};
int grid4_1[N][N] = {};
for (int row = 0; row <N; row++){
for (int col = 0; col < N; col++){
rando = rand()%(N+1);
if (isSafe(grid4_1,row,col,rando)&&(col%rando)==0) grid4_1[row][col]=r... | 0 |
7465cfb619dc65c81da87c890b639590 | 5690d723b587ea158218d4914cfbc88c | Test the logic for getting mixed geounits outside a boundary at the
highest geolevel. | def test_high_level_above_top_limit():
plev = 1020
top_limit = 5
col = np.array([1000, 900, 3])
col = np.insert(col, 0, plev)
col = np.append(col, top_limit)
with pytest.raises(ValueError):
_p_level_widths(col) | 0 |
5d7acb64e39d7608ea06603abc8697ae | abc2095b2cf7e3e582e2989242a1735d | (PECL mongo >=1.3.0)<br/>
Get the read preference for this collection | def read_preference
session.read_preference
end | 1 |
07c84885c4671b2caf3adc5f4f126bbf | 1d9cff9df30f415a7ee6f683c1673960 | обрабатывает масштабирование изображения через ползунок | double zoomFactor;
zoomFactor = Convert.ToDouble(trackBar5.Value * 0.05);
if (bitmap_before != null) {
bitmap_after = bitmap_before.Clone() as Bitmap;
Color pixel;
int r, g, b;
for (int x = 0; x < bitmap_after.Width... | 1 |
ebb0233021d3287d55b3266b04c68339 | 2ee9eabf7d8dc0f13634c284fcca840a | Load the Recently Used panel with recently selected colors | leftPanel.setPrimaryCPColor(primaryCP);
leftPanel.setHighlightedCPColor(highlightCP);
leftPanel.setPrimaryLColor(primaryL);
leftPanel.setHighlightedLColor(highlightL);
rightPanel.setPrimaryCPColor(primaryCP);
rightPanel.setHighlightedCPColor(highlightCP);
rightPan... | 0 |
6e860214c9e5778e8411a36fb48735e8 | 9d90b386bef4c633d746e0c7060b1ab3 | Get list of finished challenges to show in the history | controller.readDataOnce(databaseChallengeResult, new OnGetDataListener() {
@Override
public void onStart() {
}
@Override
public void onSuccess(DataSnapshot data) {
challengeResults.clear();
for (DataSnapshot challengesSn... | 1 |
c481ece988995de87e39717c256c154a | ecbc790d09ceadc0ca001459f9435b45 | Move to the next stroke. | export class CurveOperators
public select_next(): void {
return PythonInterop.callVoid(this.interop, `${this.accessor}.select_next`, {})
} | 1 |
2f439764d2fa6e0e00d901e1614c5dff | 2cebba6294db59fde91d9099b2228ed6 | returns true if the `current` version string is greater than or equal to `required`
version string.
this converts version strings like '2.5.1' to 100210051001, then compares values. | namespace scripting
static bool CompatibleWithCurrent(DWORD required)
{
const int n = sizeof(versions)/sizeof(versions[0]);
return CheckCompatibility(versions, n, required);
} | 0 |
9233734fed1b99a3527efa0fe64ee7d2 | e49963ed0c04dc7f84ced43e2087c94b | Происходит при каждом переключении на текущую форму | namespace GridFormView
public partial class _Default : System.Web.UI.Page
protected void FormView1_ItemInserted(object sender, FormViewInsertedEventArgs e)
{
ChangeViewMode();
} | 0 |
6b86e8292ef3fa67f58e5857b4be3c17 | e421edc18cf0751907a79082e7cb21b4 | Origina numeros al azar para el eje x para que los asteroides aparescan en distintios lugares | {
for(int i = 0; i < asteroidsQuantity; i++)
{
float x = Random.Range(-8.0f, 8.0f);
float y = Random.Range(-5.0f, 5.0f);
Vector3 spawnPosition = new Vector3(x, y, 0.0f);
Instantiate(prefabAsteroid, spawnPosition, Quaternion.identity);
}
} | 1 |
3a267ad82c993dfe7257ceeb995845cd | 0b84b804dde40a761f43d4eee60576bd | function to get limb darkening coefficient u (Allen 1973) based on wavelength value | u = r/h
if (u<=1.): return -2./h*(u**2./3.-3.*u**4./20.+u**5./20.)+7./5./h
if (u<=2.): return -1./15./r-(4.*u**2./3-u**3.+3*u**4./10.-u**4./30.-u**5./30.)/h+8./5./h
return 0. | 0 |
e7a0fd34992d1846c14fa8c56f6894c7 | 36b860f1a4b5bf362ed4dc94a6b0ede9 | The business number (aka Tax ID). | class BusinessEntity extends RecurlyResource
public function getCode(): ?string
{
return $this->_code;
} | 0 |
1b736e8cac81515c2cc4cc7155116267 | f21301ca40a0541a11e582e38816675c | Returns the array of html classes. | class sly_Form extends sly_Form_Base
public function getClasses() {
return $this->classes;
} | 1 |
64ee005c38a65cd9a98e41695467decc | 3b64379c5a4c77d7a4b5ef3759a99bc9 | Checks if userInfo credentials is contained inside adminList
If userInfo is contained inside adminList, returns loggedIn as True. | def is_admin(user):
if user.lower() in admin_list:
return True
else:
return False | 1 |
b65db9211bbccbb347472cfd6b5269af | 51efb698179128b522c90299f047ac5a | Randomly create an individual.
In this GA, an individual is an array of integer indiced which
correspond to cube moves. | def create_individual(data):
chromosom = []
for i in range(0, len(data[0]) * len(data[1])):
chromosom.append(np.random.choice([0, 1]))
return chromosom | 1 |
b21594d3460d0e5e5eceba07a651d5c0 | eaeb238f2137ce29d379ec0c85a38b91 | Remove all and show the help | class Game(cocos.layer.Layer):
def showHelp(self):
self.remove('menu')
self.remove('bkg')
self.help = HelpLayer()
self.add(self.help,10000,'help') | 1 |
50479e7ab6eddb38abd3994a20968676 | d0a54afeb473b7e0f0e5a6ab71e085e2 | 测试兄弟孩子树的层次遍历 | void TestChild()
{
TEST_HEAD;
DataType array[] = {"abd##eg###c#f##"};
size_t size = sizeof(array)/sizeof(array[0]) - 1;
BiTree tree = CreateBiTree(array, size, '#');
printf("=====找 a 节点的孩子节点=====\n");
BiTree father = TreeFind(tree, 'a');
BiTree L = LChild(tree, father);
printf("expected ... | 0 |
c6c2917678b4e3e16e1c9da762dd9161 | 3f5beafe0c3fd2873d0ac52a4b642888 | Determines is the supplied gene descriptor is statistically significant in any of the agi
query list columns. | row = report_instance.table.rows[sample_rowno]
filtering_candidate_cols = [colno for colno in xrange(report_instance.table.num_columns) \
if colno != sample_colno]
def colno_score(colno):
if _label_score(row[colno]) == 0:
return 0
vals = [report_in... | 0 |
60cf3d4d98cbdce547d0c0c7be7f23ce | 062f9ed17e7c6d8aa06da4a670475606 | 每道题的错误率 | def error_rate(y_predict,y):
count=0
for i in range(y_predict.shape[0]):
if y_predict[i]!=y[i]:
count+=1
return count/y_predict.shape[0] | 1 |
4e7a7969146a7b317b29b2177fbcf818 | d3504da58c98626d4064a62060d00ba8 | Рисует области вокруг точек выбранным цветом | function DrawAreaPoint(fillcolor, strokecolor, strokewidth, strokeopacity) {
var DrawPolygonCommand = new mxLib.DrawPolygonCommand("", null, {
fillColor: fillcolor,
fillOpacity: 0.1,
strokeColor: strokecolor,
strokeWidth: strokewidth,
strokeOpacity: strokeopacity,
... | 1 |
c7613e9da14d567ba1712be678d26fe0 | 7eb21be17fc00382e3dd0facf757b457 | Setting turn direction either to left or right | public class PlayerMovement : MonoBehaviour
public void turnLeft(){
isTurningLeft = !isTurningLeft;
} | 0 |
24099b71f6db4f374264f6ad810b8816 | ad84cdc77b868dcebcc1edeb7805f32a | Sets the tuner count. Valid only for {@link #TYPE_TUNER}. | public void setCount(int count); | 1 |
df5086f72a21009c73dd5b74f91131d0 | f45a66c197791f374eb90a33814baf54 | Czy wspołrzedne wektora osiągają wartości nieokreslone bądź nieskończone | [System.Serializable]
public class PosePosition
public bool isSet() {
return x >= 0 || y >= 0 || z >= 0 ;
} | 0 |
a0322bf3a1f00d64b8da30d08ec70e26 | 51d5bd5a991b6360f0a8eb931e600ee7 | 默认选中一个学生班级 | if (flag == 1) {
$(".topChange").hide();
$(".ulClass").hide();
$(".content").hide();
$("#defaultPageClass").show();
$(".span").html('您还没有班级哦,请联系学校管理员创建班级吧!');
} else {
$("#defaultPageClass").hide();
$(".topChange").show();
$(".ulClass").show();
... | 0 |
40ce1f05ca33e5377dec967907a3b934 | a95b13984c7fe1aadb87b4261a370430 | Unveils all missing characters | res = []
for letter in list(string.ascii_uppercase):
if letter not in alphabet:
res += letter
return res | 1 |
3b11a6f9e0182552f6f2a58c2ac42f22 | 4bf5ba763a6e822a2ca9481556534ed6 | 替换文章 | {
$this->validata($article_id);
if (!empty($data['picture'])) {
$value['picture'] = ImagesUploadService::updaloadImage($data['picture']);
}
if ($data['attribute'] == 2) {
$category = $this->article->findOne('article_id', $article_id, 'category_id')['category_i... | 1 |
ca7db1708a4c37611f7f262b928006ff | 8e776a12c85d5ded102e36069a52febd | 新增创意资源的评价 | public PageInfo<CreativeResourceEvaluate> selectCreativeResourceEvaluates
(CreativeResourceEvaluate creativeResourceEvaluate) throws Exception; | 0 |
8abb019197dcf18a9b7ef2657b323ea8 | e5eb9714393a0114ac4e01fc1bcb5052 | copiar datos de la lista a la tabla | namespace Ejercicio5_2
public partial class frm_Productos : Form
public void Copiar_Datos()
{
listaprrodustos.Items.Add(nombre_producto + "\t " + lbl_valor.Text + "\t " +
lbl_Porcentaje.Text + "\t\t" + lbl_Redondeo.Text + "");
} | 0 |
1d0f9eeef35e4ded9546a4f4f46961e9 | ac386f4e4ee683e298aed3ba0660e240 | create a new section on the web page to maintain table layout | aName = "section_" + aName;
var tab = document.getElementById(aName);
var toAdd = document.createElement('toAdd');
toAdd.innerHTML = tab.innerHTML;
var tabToAdd = toAdd.getElementsByTagName('table');
var deb = tabToAdd.length - 1;
for (var i=deb - 1; i>=0; i--) {
toAdd.removeChild(tabToAdd[i]);
}
for (var i=... | 1 |
3ada33cc2809ba79f0baf6bad6975d04 | 04d0acf9fd0f9bba3343d4a43621408a | função para multiplicar duas matrizes e colocar em outra | qtd_linhas_a, qtd_colunas_a = len(matriz_a), len(matriz_a[0])
qtd_linhas_b, qtd_colunas_b = len(matriz_b), len(matriz_b[0])
if qtd_colunas_a == qtd_linhas_b:
matriz_multiplicada = []
for i in range(qtd_linhas_a):
matriz_multiplicada.append([])
for j in range(qtd_colun... | 1 |
14d94602f5e63ff7a2e8a6acc4367dde | 645a6dc4932dbd4dc0dd19d5f15147e3 | Returns whether this coin receptacle has enough space to accept at least
one more coin. Causes no events. | public abstract boolean makeRoom(); | 1 |
9bbdb8243e82eb2e34e9d27137c8fbe0 | 662dd865599ce29f7ca10b9feb8d23be | 현재 대기실에 있는 방의 제목을 반환하는 메소드 | @Repository
public class ReservationDAOImpl implements ReservationDAO
@Override
public List<Map<String, Object>> getRoomList(int workplaceNo) {
return sqlSession.selectList(namespace + ".getRoomList", workplaceNo);
} | 0 |
9b09c2af788abe9642eced944ad2d8a9 | 1cfb9798ea80bb113f57a3bf39c92795 | List Volume Attachments for a given Server. | namespace OpenStack.Compute.v2_1.Serialization
public class ComputeApi
public virtual Task<PreparedRequest> BuildListServerVolumesRequest(string serverId, CancellationToken cancellationToken = default(CancellationToken))
{
if (serverId == null)
throw new ArgumentNullException("se... | 1 |
26c962f0e0996f1ff7a3f20c8a409441 | 5c70a8ebaa6b976e55390765fd581b08 | Setea que las sesiones se guarden en Memcache utilizando los drivers nativos de php | {
$port = (int) $port;
ini_set('session.save_handler', 'memcache');
session_save_path("tcp://".$host.":".$port);
return $this;
} | 1 |
4e9d08e0273d12dab8a4a96289696f7d | 1494de2cdcec77e80aa363d895fb4899 | 演示使用asm动态生成子类,添加方法 | static void Main()
{
DynamicMethod dm = new DynamicMethod("Test", null,
new Type[] { typeof(string) }, typeof(string).Module);
ILGenerator il = dm.GetILGenerator();
il.Emit(OpCodes.Ldarg_0);
MethodInfo call = typeof(Console).GetMethod("WriteL... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.