query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
10562d81c5fa9d47e26c89efd1ca3b14 | 91b4f91006c344e32f315c54e2dfcb48 | Gets the access control policy for a resource. Returns an empty policy if the
resource exists and does not have a policy set. (tables.getIamPolicy)
requested. See [Resource
names](https://cloud.google.com/apis/design/resource_names) for the
appropriate value for this field. | namespace Google.Apis.CloudIAP.v1beta1
public class V1beta1Resource
public virtual GetIamPolicyRequest GetIamPolicy(Google.Apis.CloudIAP.v1beta1.Data.GetIamPolicyRequest body, string resource)
{
return new GetIamPolicyRequest(service, body, resource);
} | 1 |
afe2c910654e687454deeca78524ab88 | faf7b0d820759009634d2b896fd67a41 | 删除超过N天的数据 | export class DbMgr
static delDataTbMDay31(){
let timebefore = new Date().getTime() - Tools.ONE_DAY_TIME * 31;
let sql = "select * from tb_Media where time_local<" + timebefore;
return this.executeSql(sql);
} | 1 |
aa14bc99d2005b7790427c53794113b1 | 526f30ef735c64322b69dee9c8fe743f | Merges the reader to the state of another specified branch, and returns a string that contains the characters between the positions of the current reader and <paramref name="branch"/>. | {
long oldPosition = 0;
if (peek)
{
oldPosition = reader.BaseStream.Position;
}
reader.BaseStream.Position = position;
ArrayList readBuffer = new ArrayList();
byte b;
... | 0 |
506ce6c402302ed3be854cb0fb114dec | 5e760e4b012bc2b1d007279a6869478a | 将模块选择动态的添加到布局中 | {
EditorGUIUtil.DrawHeader("Add New Module");
GUILayout.BeginHorizontal("AS TextArea" , GUILayout.Height(30));
selectEnum = (ActModuleEnum)EditorGUILayout.EnumPopup("新模块", selectEnum , GUILayout.MaxWidth(Screen.width * 0.5f));
GUI.backgroundColor = Color.green;
if (GUILayout.... | 1 |
390b6114a0ea9ed8f83f85bd6d63fd81 | c062610d4192479f9ed35a397c11e15f | Get 是否过滤脏词(目前支持中文普通话引擎)。0:不过滤脏词;1:过滤脏词;2:将脏词替换为 * 。默认值为 0 | public class WordRsp extends AbstractModel{
public Long getKeywordTag() {
return this.KeywordTag;
} | 0 |
520b1f20cbe8b4f2e82fdd640cafa1da | 856e600d40d35d40b55e11ec90cccc3c | Test case for quickSearchesChangeShowFields
This call changes the flag that enable show of the search fields. | if (this.quickSearchContainer.isVisible()) {
this.quickSearchContainer.setManaged(false);
this.quickSearchContainer.setVisible(false);
} else {
this.quickSearchContainer.setManaged(true);
this.quickSearchContainer.setVisible(true);
this.quickSearch.requestFocus();
}
} | 1 |
2abfe807e63c310f813e0cd8848f0357 | 83243638fa09efc7be648128cd96ac6b | 根据指定路径和图片名称生成该路径下所有图片的url | namespace Web.Controllers public partial class AjaxController : Base
private List<string> GetImgsByPath(string path, string urlPre) {
List<string> datas = new List<string>();
if (!Directory.Exists(path)) return null;
var files = Directory.GetFiles(path);
if (files.Cou... | 1 |
62ac722f218d2f07853a5ac5c3c0dcb4 | e93def712e8544be348b53570dde1856 | an object that describes one occurrence of a function solution
provided in the corrections/ package
it comes with a week number, a sequence number,
a function name, plus the code as a string | self.time = time
self.offered = offered
self.section = section
self.sln = sln
self.children = 0 | 0 |
43912e102cff006ceb3472012c746ce2 | ae0fdc0411195eb125b67216b07c8f6d | funzione che aggiorna informazioni server | signal(SIGWINCH, sigwinch_handler);
ioctl(0, TIOCGWINSZ, &ts);
if(inchat == 1){
stampaHeader();
}
} | 0 |
eda0a48e2155c24d611b3776c94971a4 | 3e300f3355b68c3869865778b0bd5d05 | 根据新闻链接获得163评论链接 | def get_news_hash(news_id):
news_id = str(news_id)
l = len(news_id) // 2
url_page = 'https://www.ithome.com/0/' + news_id[0:l]+'/'+news_id[l:]+'.htm'
html_home = session.get(url=url_page,headers = headers)
tree = BeautifulSoup(html_home.text, 'html.parser')
hash_1 = tree.find('iframe', attrs={... | 0 |
d063feaee40a30f9143def5417cd0c2b | 9b09f338ef25b706e9e36a27f1682c08 | 设置用户裁剪好的图片,准备上传 | var imageDate = $(self).siblings('.container').find('.image').cropper('getCroppedCanvas').toDataURL("image/jpeg",0.7);
var data = {imgData:imageDate, object:'userlogo'};
$.ajax({
url: "/mzc/util/doUploadimg",
data: data,
... | 1 |
6f9475a9738aa0f0fcf8cdbe8f12546c | 1f53f5c035d0bf80accbfb3d147256d1 | 获取晋级选手列表 | class BodyBuilderActivityController extends CommonController
public function getEntryPromoterList()
{
$pageNow = intval(I('pageNow'));
$entryID = intval(I('entryID'));
if ($pageNow < 1)
{
$this->ajaxReturn(array("status" => 0, "errorMsg" => "缺少必要参数", "data" => array(), "j... | 0 |
56f511fc766f3e09f09f86b9a7d4af24 | d45cd3e933930efe12b178fb0e5a2be0 | 删除最后一个子节点 | let last = this.getNodeByLogicIndex(this.node.childrenCount - 1);
if (last) {
last.removeFromParent();
} else {
cc.log('没有节点可以删除')
}
} | 1 |
93f6d409a2f017d25a38ba3bf5345933 | 8275438f6920af98d55e0a10499b374a | first time purchase discount of 15% | public double getDiscount(ShoppingCart cart) {
double totalDiscount = 0;
for(Product product : cart.getAllProducts()) {
if(_isFirstTime) {
totalDiscount += product.GetPrice() * _firstTimeDiscount;
_isFirstTime = false;
} else {
... | 1 |
3773099eeee851d8eab6675344a6d121 | f15a6900bcd9373486a4b650ea66bddb | 3.3.23 Substitute_Higher_Priority_Req
During the XMIT_WAIT State, an MA_DATA.request or MA_ACK_DATA.request service
primitive is received which has a higher priority than the pending request. The pending
request is discarded and replaced by the new request. In this manner, the higher priority
request is granted access ... | {
WFM_CONFIG_CNF *pConfigCnf = NULL;
uint32 Status;
WFM_UMAC_INSTANCE *pUmacInstance = (WFM_UMAC_INSTANCE *) UmacHandle;
CHECK_POINTER_IS_VALID(hi_msg);
OS_ASSERT(pUmacInstance);
LOG_EVENT(DBG_WFM_HI, "WFM_HI_Proc_ConfigReq()\n");
pConfigCnf = (WFM_CONFIG_CNF *) &hi_msg->PayLoad.wfm_config_cnf;
Status = WFM_UMA... | 0 |
9367214ad9026a7db634e6d2e34645f6 | 741eeaea4ade57001bd841140cb6c550 | find next unused address | while(1){
for(int i=KERNEL_SPACE>>12;i<KMEM>>12;i++){
if(mmap[i]==0){
mmap[i] = 1;
return (i<<12);
}
}
}
return 0;
} | 1 |
6c2753bc6504290b93181dc540a3e75e | 7a49cd559f7a4a474571837b9382a68b | Rellena el comboBox de Actores que se usa al rellenar el elenco de
la pelicula | DefaultComboBoxModel model;
String [] arregloActores = new String [listadoTiendas.size()];
for(int a = 0; a < listadoTiendas.size(); a++)
{
arregloActores[a] = "Sede no. "+listadoTiendas.get(a).getTiendaID();
}
model = new DefaultComboBoxModel(arregloAct... | 0 |
815cc870437db8fcc610bfa8ce58f7fd | f80c62ef7d81aaef177ddbb6a11abd33 | Retrieves the commands for the client from the DB. | class DB
public function GetCommands()
{
return $this->ArrayQuery_("SELECT `id`, `mask`, `description`, `type`, `extra` FROM `commands`");
} | 1 |
efae378de467b9e0c85dfe4ed1bf6cbe | 3b160e2d998ac48667dee3a7d08f8cf8 | Подведение результатов коррекции | public ModelAndView correctionCorrect(JsonPage jp,String slave_ids,String begin_date,
String end_date,String sub_amt,HttpSession session) {
String gly_no = (String) session.getAttribute(USER_NAME);
Map<String,Object> paramMap = createMap()
.put("slave_ids", slave_ids)
.put("begin_date", begin_date)
... | 1 |
ced29abd9de127ac430a26e9b4ca8f69 | de1a1b7f01ca02476e0294d5065df4e5 | Поиск отеля по имени | {
var value = $(".filter-name__input").val();
Cookies.set('filter-name__input', $("#filter-name__input").val());
if (value=="")
{
$('div[class*="col-md-12"]').each(function(e)
{
$(this).show();
});
return;
}
$('div[class*="col-md-12"]').each(function(e)
{
if ($(this).find(".hotel-explo... | 1 |
a66a6dc45c01679bf7669689e7bf69eb | b36bd6aceaac1b301b154bdeb95a9c41 | a method to print out the diagram of maze on the output window | System.out.print('\n');
for(int i = 0; i < L; i++) {
System.out.print(i + "\t");
for(int j = 0; j < L; j++) {
if(this.mazewall[i][j] == 'S') {
System.out.print("\u001b[00;42m"+this.mazewall[i][j]+"\u001b[00m");
} else if(this.mazewall[i][j] == 'G') {
System.out.print("\u001b[00;41m"+this.ma... | 1 |
198428edf2d80d85bfcd8bf610c2d985 | 9124b3d3cea77f5c7c967ed40db88968 | Get accordion block default settings | class Elementor_Area extends Base_Data_Control
protected function get_default_settings() {
return [
'label_block' => true,
'show_edit_button' => false,
];
} | 0 |
13a5d93714e70f39b082692d8c4821fe | 78ab9dcb41d4ac60f680b0e0769882aa | Retorna un JSON con los incidentes creados por el Usuario. | class IncidentList(Resource):
def get(self):
permissions = get_user_permissions(request)
print (permissions)
return get_all_incidents() | 0 |
cf36affb11c06be04c2fd29db4a1e6eb | 554fa504bee12a59ccb21d865c386f62 | __wrap_malloc - malloc wrapper function | void *pointer;
int taskID,PC;
taskID = taskIdSelf();
PC = pc(taskID);
pointer = __real_malloc (c);
if (num_entries < 4096) {
mallocEntried[num_entries].pointer = pointer;
mallocEntried[num_entries].taskID = taskID;
mallocEntried[num_entries].PC = PC;
mallocEntried[num_entries].si... | 1 |
89804a20b63413632b49a864974c6bbf | b9fa69b175e44bd7ae8559dc15cd319b | 获取两个对象中不一样的部分 | var changeSet = {};
_.each(o1, function (value, key) {
var value2 = o2[key];
if (!_.isEqual(value, value2)) {
changeSet[key] = value;
}
});
return changeSet;
} | 1 |
56a8b62a947d19a9331b31742400ea87 | 38c5b857a7f1225c819bad8a57aa7464 | Sets up the list, begins loading user data, and sets the scroll and refresh listeners. | public class RankingActivity extends ListActivity implements Observer
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.ranking);
((PullToRefreshListView) getListView())
.setOnRefreshListener(new OnRefreshListener() {
@Override
p... | 1 |
345105bbf5090ef39c3fb71b1aef5dbe | 8f21d32f6c0f7f5ceb05a565b8be3573 | Increases counter and returns next token | class SyntaxParser{
int getNextToken(){
if (tokenIndex < tokens.size() - 1){
tokenIndex += 1;
cout << "token index " << tokenIndex << "\t\t" << currentToken()->lexeme << endl;
return 1;
}
cout << "no more tokens\n";
return 0;
} | 1 |
7d23802b93da46d854debe4631394c68 | d8b54c33f71a056062c21b153ec659fd | newDeleteableGenerator is responsible for creating a generator that will write out the Delete api methods. | func CreateDeleteOrganization(orgID *uuid.UUID) *DeleteOrganization {
out := DeleteOrganization{
OrgID: orgID,
}
return &out
} | 0 |
eaaf888ae7c06dd1d5ab20dbb056755a | 5fe9f75f1e3acea46531102438f3612d | Loads Habit Type settings and info | self.ipAddress = self.pluginPrefs.get('address', None)
if self.ipAddress is None:
errorText = u"No IP address set for the Hue hub. You can get this information from the My Settings page at http://www.meethue.com."
self.errorLog(errorText)
self.lastErrorMessage = errorText
return
self.getHueConfig()
... | 0 |
f417aa68526bddff17e7041a39954865 | 074aceda522351efcb18a4c173b420b1 | Compute probability mass function of Poisson distribution with paramter lambda | def dpoisson(k,lamb):
return lamb**k*exp(-lamb)/fac(k) | 1 |
16f5da1ca38adc193773770758d9f63c | 52397d25fb009d380706204f8dbf2d74 | Outputs a entry header within the Customizer, to aid with live previewing. | ?>
<# if ( data.caption ) { #>
<span class="customize-control-caption divider-{{{ data.status }}}">
{{{ data.caption }}}
<# if ( data.collapse === true ) { #>
<button type="button" data-status="{{{ data.status }}}" data-items="{{{ data.items }}}">
<i class="dashicons {{{ data.icon }}}"></i>
... | 1 |
475fbb6df68d0d6b11c84b4cf1295d56 | 43e642ba605b0776d8cc9f83b6b8673c | 生成 AST | void genAst(); | 1 |
8e62f59ad902bdce5d6e9e65e3851c5d | e3dddf2497569484bccbb32c53a4d272 | removes recipe from user library | export class RecipeEditPage implements OnInit{
private _removeRecipe():void{
this._recipeSrv.removeRecipe(this._recipe,(err:Error)=>{
if(err)
this._toastWrp.info(err.message);
else
this._navCtrl.pop();
});
} | 1 |
f531560d5e2c1542e3ff077b82ed90a4 | 4e4891cc332dffebee7277b90f0a9be2 | Generates a varying time interval between two log messages. There are
two components for the interval: a varying deterministic component and
a random component. New test scenarios can be incorporated here. | def online_data_augmentation_easy():
def integration_time():
return 10**np.random.uniform(np.log10(60), np.log10(600)) | 0 |
6e622bf3a62e9a29a4dc95325bbb4b73 | 699ef7c9c47f8473890d6786980dd230 | Returns true iff the scan pointer is at the beginning of the line. | int mark_is_at_bol(mark_t *self) {
return self->col <= 0;
} | 1 |
246b632db6ee530db0110f3901ff4d27 | 19ce0bcf1a46485372a174ac5b6a1dca | 搜索并删除列表中的元素 | int SearchList(pNode *head)
{
int number;
printf("Values are about to be deleted:");
scanf("%d", &number);
pNode *p;
p = head->next;
while(p != NULL)
{
if (p->data == number)
{
return number;
}
p = p->next;
}
return 0;
} | 0 |
cbb526099ef4247af13cce0ca9ce1571 | 1368a36ab6697c3171bd64382a438534 | Reset the spam counter | function spam_counter() {
$s_hits = get_option('spamjirut_spam_hits');
update_option('spamjirut_spam_hits', $s_hits+1);
} | 0 |
b0a101a5af7d484be5a81b9cb1a0f6dd | 14811363fe3e48c82ed40ca39f72a9eb | Проверка попадания по кораблю. | if (orient == 2 and (s + deck - 1) >= self.n) or (orient == 1 and (c + deck -1) >= self.n):
print('Не лезет!!!')
return False
if orient == 1:
for i in range(s-1, s+2):
for j in range(c-1, c + deck + 1):
if 0 <= i <= 9 and 0 <= j <= ... | 0 |
f4a8a0bf3a71f8cea4c5dfdcf2049be3 | 77b432410fdb946d8d443cdabea83d4a | Navigates to the starting screen. | namespace MyEvents.Client.Organizer.Services.Navigation
void NavigateToSplashScreen(); | 1 |
4649c0e27de037de871b05d956304dc6 | a8cf7e9cc5b3a4be13ed9cea51b457f6 | 根据招生老师的id查询点位表中的数据 | ListResult<TeacherPointsAssign> findByTeacherId(String teacherId, Integer pageIndex, Integer pageSize) throws RepsException; | 1 |
55660124cb39a8bcd1f75f1feec50b05 | bc60ce3432bf2c48ffa2eed562b985a9 | Get an ordered List of all versions. | public List<T> getVersions(); | 1 |
d38bc07c9b71e3080e6724e0fd75ef7b | 16324908a76509c88dac4bade276e942 | Check write permission of log file | class MUCD_Log
public function can_write() {
return ( is_resource( $this->fp ) && is_writable( $this->log_file_path ) );
} | 1 |
2d55ea76e01db33e146f002b68d52d35 | 80109a855e5092cf490aac250b081f0c | Increases the tutorial help button count when the help button is tapped | public class BudgetInfoActivity extends RestConnectionActivity
@Override
protected Integer getTutorialCount() {
return 2;
} | 0 |
88e0159da367bb79d7e255d0e19d4847 | af054a6eefa7e5b01f260d6d1e375f33 | Cell formula. Not calculate value. Only for export to Spreadsheet | {
foreach (Cell cell in _sheet.Cells)
{
if (cell.IsFormula)
cell.PutValue(cell.StringValue);
}
} | 1 |
1fbb897f6db6b2880c70a4ed35f871ce | edd7170330bb72f82c341b69558dd7fa | Set the cusip value. | @MappedSuperclass
@Embeddable
public class CreditCard implements Serializable
public void setSvn(String svn) {
this.svn = svn;
} | 0 |
d4191a81c99c68d455bfac59985112b7 | cb0dfcd321df9a86ad68037af9bdca0d | 是否已经包含指定名称的条件 | namespace NetSCADA6.NSInterface.HMI.Form
bool ContainsName(string name); | 1 |
96941971acecb40ba782939d36daddc6 | f53d9c6632cde6fb5661a4357967b0e4 | 根据账号和密码进行登录,返回用户名 | User login(long account,String password) throws LoginFailedException; | 0 |
4b73905927e85d8812815c8b9631a568 | 9482e0ff6b8655cd168384562110767d | Returns the class name along with the package path (if given). | class_module = _class.__module__
if class_module is None or class_module == str.__class__.__module__:
return _class.__name__
else:
return f"{class_module}.{_class.__name__}" | 1 |
c1bec1695908eb7b6195269cbb482403 | d1675920dfe0deaf6a52f717a27a0c18 | Columns become rows and are displayed backwards. | class PrintMatrix:
def turn(self, matrix):
col = len(matrix[0])
newMat = []
for i in range(col, 0, -1):
newMat.append([x[i-1] for x in matrix])
return newMat | 1 |
3a4ef4f50f2a8efa383c10422f1ecdc1 | 0194a88a54b2afa94b5650dfbdb1b697 | Set all probabilities to randomly generated numbers.
Resets probabilities of all initial states, transitions, and
emissions to random values. | class DoEBuilder:
def reset(self):
self.item_draw_probs = np.ones(self.num_items)/self.num_items
self.num_running_trips = 0
self.item_trip_counts = np.zeros(self.num_items) | 0 |
d4b532f2b227ec6bf4566efc4dd02e08 | 9061d48e015000b05e784959351d3e6a | 将long数组转成String | StringBuilder stringBuilder = new StringBuilder();
for (int i = 0; i < ints.length; i++) {
stringBuilder.append(ints[i]).append(",");
}
return stringBuilder.toString();
} | 0 |
16b61e3b901bf998c76001092e81845a | 64f3aec7c1be110c8136386d85ead59f | Load constant boolean value into register. | void ir::BuildIR::visit(bake_ast::BoolVal* n) {
int reg = getRegCount();
throwup = std::make_pair(reg, BOOL);
if(n->getValue() == true){
curr_bb->addOp(new Copy(std::make_pair(1, CONSTANT), throwup));
}else if(n->getValue() == false){
curr_bb->addOp(new Copy(std::make_pair(0, CONSTANT), throwup));
... | 1 |
4e1bd07a9de62ab5215407f906b63c3d | 2082a6a49be02dd7c5b313f72e2f8cde | Check that multiple photos can be updated using their IDs | {
$resource1 = self::$uploadApi->upload(self::TEST_IMAGE_PATH, ['tags' => self::$ASSET_TAGS]);
$resource2 = self::$uploadApi->upload(self::TEST_IMAGE_PATH, ['tags' => self::$ASSET_TAGS]);
$result = self::$uploadApi->updateMetadata(
self::$METADATA_FIELDS,
[
... | 1 |
c9375ea474804aab8ed40ace5bea8174 | e8537f6245c28977859d074fb43e331b | Clear a subset or all entries from the API key cache.
$params['ids'] = (list) A comma-separated list of IDs of API keys to clear from the cache | $ret = pantheon_wp_clear_edge_keys( $args );
if ( is_wp_error( $ret ) ) {
WP_CLI::error( $ret );
} else {
$message = count( $args ) > 1 ? 'Purged keys.' : 'Purged key.';
WP_CLI::success( $message );
}
} | 1 |
6c83628ca056736d4981b1e5ad8b9882 | 1244b4d2e3fca29cce924c715c735d42 | 查找角色,并校验角色是否可用,若不可用则抛出异常 | {
$role = $this->auth->getRole($name);
if (empty($role)) {
$this->invalidParamException();
}
return $role;
} | 1 |
453bd95f2a3ead05f8be4a8d1db1d3e3 | b93bca4735b56f28589fa1abc2c65dbc | Initialize the bundle option with the passed attributes and returns an instance. | class BundleSelectionObserver extends AbstractProductImportObserver
protected function prepareAttributes()
{
$parentSku = $this->getValue(ColumnKeys::BUNDLE_PARENT_SKU);
$parentId = $this->mapSkuToEntityId($parentSku);
$optionId = $this->getLastOptionId();
$childSku = $this->getValue... | 1 |
ed8a3dfd9a58fd6fa88dd774cb2a9606 | 3251881fe5a553f15e2dffb0b42532d2 | 初始化IdentityServer4数据库 | {
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.UseIdentityServer();
var scopeFactory = app.ApplicationServices.GetRequiredService<IServiceScopeFactory>();
using (var scope = scopeFactory.CreateScope())
... | 1 |
07f19aed84585efc9c07c20389c057cc | de306cba286312a907824d0e97f376ce | Find the norm of a vector a and divide a by it; a -> a / ||a|| | def vecdiv(a, s):
if s!=0.0:
s = 1.0/s
return vecmul(a, s) | 0 |
2f871f11a300fb9f1f69270a4eb0c320 | 926c2735d996eca2f2929689ecb013a9 | Symbol Table is a basically a dictionary, which is referred to in the book as a hash-table store. It is used to store
and resolve Symbols (labels and variables) and their associated addresses. | class SymbolTable:
def __init__(self):
self.symbol_table = {} | 1 |
5b17006b22c37ca1e088caf5a4f5a1d7 | b6b95a7ee9bcf32ac6f2550135c48baa | # return combined ep preds. | stopifnot(class(x) == "ElectPred")
Wb <- x$Wb[,,1]
for(i in 2:dim(x$Wb)[3]){
Wb <- Wb + x$Wb[,,i]
}
Wb <- Wb / dim(x$Wb)[3]
return(Wb)
} | 1 |
40ae5225b62c53e7f1435bae1e2886f7 | 05530d69ad88245f52140175a239b3d9 | Initialize the Strategy Registry so other packages can start registering strategies | void __stdcall EAS::Initialize( )
{
PSFStrategyI * pxPSFStrategyI = PSFStrategyI::GetInstance();
RegisterAssociationStrategies();
RegisterPropertyStrategies();
RegisterInheritanceStrategies();
RegisterPropertyNameStrategies();
RegisterUDPTypeStrategies();
RegisterBooleanStrategies();
Reg... | 1 |
923df735ca77fe925fa669a16b5e31f9 | b99738542ae901eca85e8141cc77ffff | Randomly mixes the given foreground seeds into new "mixture seeds". | std::vector<long int> MooreInitSvc::getSeeds( unsigned int seed1, ulonglong seed2 )
{
std::vector<long int> seeds;
int seed1a = seed1 & 0x7FFFFFFF;
int seed2a = seed2 & 0x7FFFFFFF;
int seed2b = ( seed2 >> 32 ) & 0x7FFFFFFF;
if ( 0 != seed1a ) seeds.push_back( seed1a );
if ( 0 != seed2a ) seeds.p... | 0 |
5864f25e752d5b355f529f4953b5bd0c | dfcc8d7804bb2c58775aca617e315871 | 오목판을 클릭합니다. | {
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
RaycastHit2D hit = Physics2D.Raycast(ray.origin, ray.direction);
if (hit.transform != null)
{
string[] str = hit.transform.name.Split(',');
int r, c;
int.TryParse(str[0], out r);
... | 1 |
4e58d6d9d847e5318e4f87533d18b52a | 067fa0ca1565ee7fb7cedc20cf55f92a | Form the 54-card Deck | void Dealer::setDeck(){
Card deckOrder[53] = {
{'1',"AC"},{'1',"AH"},{'1',"AS"},{'1',"AD"},
{'2',"2C"},{'2',"2H"},{'2',"2S"},{'2',"2D"},
{'3',"3C"},{'3',"3H"},{'3',"3S"},{'3',"3D"},
{'4',"4C"},{'4',"4H"},{'4',"4S"},{'4',"4D"},
{'5',"5C"},{'5',"5H"},{'5',"5S"},{... | 0 |
d233306bd3035d019169260ad53ec70d | 5759370dfdc2fe093f29cd2c1601e105 | 随机20个数 | Random random = new Random(20190829);
int[] a = new int[10];
for(int i = 0;i<a.length;i++){
a[i] = random.nextInt(100);
}
return a;
} | 0 |
8ab8712dba1dc0aefe7b32671f2b81cc | d253abf8733ae05b1f4e4e7eeb17fb68 | Removes a label from a Task. | void removeLabel(RemoveLabelFromTask cmd); | 1 |
d03d8b9b0fdbbaa629a4226e461e52e9 | fbc16c550b1adbb2e6422bbace86fa30 | we need to call this here instead of in OnDestroy because it removes tree items from views before they get destroyed | namespace Jk
public partial class FolderTreeView : TreeView
protected override void OnHandleDestroyed(EventArgs e)
{
DisposeAllNodes();
base.OnHandleDestroyed(e);
} | 1 |
14a7cee80f761784bfd7fc7a14e77280 | 1c08b1e29ddcdbd85114140285721abe | 一行一行读取文件,一行的内容就是一个list中的元素,按指定的格式读取
文件路径
编码格式 | public class fileUtil
public static List<String> readTxtFile(String filePath,String encoding){
List<String> strList = new ArrayList<String>();
try {
File file=new File(filePath);
if(file.isFile() && file.exists()){
InputStreamReader read = new InputStreamReader(
... | 1 |
0131a3432b015d9419a89ceabfdc4e76 | 0acbd78f103cab8479928f9a01637755 | A helper function to get sentiment of a comment | class listener(StreamListener):
def get_tweet_sentiment(self, tweet):
analysis = TextBlob(tweet)
if analysis.sentiment.polarity > 0:
return 'positive'
elif analysis.sentiment.polarity == 0:
return 'neutral'
else:
return ... | 1 |
0b9f71725caaf7b1f9029a95a1a47871 | b354ed86e79f523e9b7a57ac045d5059 | Returns the port used for communicating data through the net console
\note This function must be implemented by each protocol | namespace DS_Core class LIB_DS_DECL ProtocolBase : public QObject
int FRC_Protocol2015::netConsoleInputPort() {
return 6666;
} | 1 |
b9eb21100278b6f0f535a6aa097a8da6 | 79716222d9504add7adb4b9e76fbb4c9 | A legend image showing a graphical representation of the specified collection as it would appear in the corresponding map tiles of the specified zoom level in the specified style. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True | public BufferedImage getLegendGraphic(Dimension dimension, final LegendTemplate template,
final Style style, final String rule, final Double scale)
throws PortrayalException
{
MutableStyle mutableStyle = null;
if... | 0 |
6e508ed98f5fb0fef48375dd4b405f8e | 502630ab24060dae084523223eb68eb3 | As a user, I cannot create a RQS if the query server deny the query
or the query is not a json | url_p = reverse('confessions_cr')
url = reverse('confessions_rud', args=[1])
data = {'heading': 'Test Heading', 'text': 1}
response = self.client.post(url_p, data, format='json')
response2 = self.client.put(url)
self.assertEqual(response2.status_code, status.HTTP_501_NOT_... | 0 |
225723e49d780c458da12162afaf504c | f6eccfdace39ae9c598ae354d44e43cf | Returns employees who want a spot | {
$employees = DB::table('people')
->join('employees', 'employees.id', '=', 'people.peopleable_id')
->where('peopleable_type','App\Employee')
->get();
echo json_encode($employees);
} | 0 |
a5c8c8e1f5c796faa1174e488af94e39 | ed156810adf8395b420e0fe76741def2 | a function that sorts a randomly generated list | rand_nums = []
for x in range(0, num):
rand_nums.append(randrange(100))
return sorted(rand_nums) | 1 |
181bf6f14d9fb0cf736c33bbab964fb2 | b28b3ab3c58c0cfcae4d6be1d84d2513 | 初始化sip | {
TupCallCfgSIP tupCallCfgSIP = new TupCallCfgSIP();
tupCallCfgSIP.setServerRegPrimary(loginParam.getRegisterServerIp(),
StringUtil.stringToInt(loginParam.getServerPort()));
tupCallCfgSIP.setServerProxyPrimary(loginParam.getProxyServerIp(),
StringUtil.stringTo... | 1 |
b5267794193682b48cd45f07362a285f | dfff973e7ccda593f4a565c61a4056e8 | Fetches all bugs from Mantis. | List<Bug> getAllBugs(); | 1 |
caf80d101f0cc4371a565bd79d2fe8bf | 71253ad89bef6706823bb7f1da13aa6c | 创建渐变色图片 | Bitmap bitmap = null;
try {
bitmap = Bitmap.createBitmap(w, h, Config.ARGB_8888);
} catch (Throwable e) {
e.printStackTrace();
return null;
}
Canvas canvas = new Canvas();
canvas.setBitmap(bitmap);
Paint p = new Paint();
p.setColor(bgcolor);
p.setAlpha(alpha);
canvas.drawRect(n... | 1 |
d6b31cdf309047281bf788afc10b3f58 | ef21a2e74fd447ca36e486fde9f884c3 | returns a list of column pairs.
eg: [((table_a, col_a1), (table_b, col_b1)),
((table_a, col_a2), (table_b, col_b2)), ...] | class DB():
def list_columns(self, table_name):
results = self.query(
"PRAGMA table_info(" + table_name + ")",
output_type=OutputType.tuple)
return tuple((col[1], col[2]) for col in results) | 0 |
3c238ffb213d268aa3ec2600cbd5ee56 | ea1b4142366e4c4a26e6eb9cf27d9f5c | 是否十进制无符号整数字符串。 | {
return uint.TryParse(str, out uint v)
? v < 10 ? OperationResult.Failed("非有效数字!")
: OperationResult.Success()
: OperationResult.Failed("非有效数字!");
} | 1 |
60eef8b327bf97add56d0f4b734cc5b0 | 6a7c6f9c804570097ec24121a61c2aa6 | Validates a value for attached parameter, returns null if no errors found | String validate(final E value, final Object name); | 1 |
adcff26fc54b900b3659063c6973b758 | eff8e027ebbccffa87f79ce8c455687d | Get location for storing checkpoints. | class GetPath:
def get_checkpoint_path(self):
return self.checkpoint_base_path | 1 |
aa778822a2cf91b65e3e4952ce013d0b | 2dfd4c22f812a9a2f8aff4719008c66a | The timestamp of the last change in state | class gslbvserver(base_resource) :
def tickssincelaststatechange(self) :
try :
return self._tickssincelaststatechange
except Exception as e:
raise e | 0 |
f402d290a0fb897b24b3fad8f006d7b6 | bdf2fe048ae98da17377ce9b55a81608 | #################### Sum path- return true if path having sum equal to target exists ############# | def path_sum(src,target):
if src.left != None and src.right != None:
return path_sum(src.left,target-src.val) or path_sum(src.right,target-src.val)
elif src.left:
return path_sum(src.left,target-src.val)
elif src.right:
return path_sum(src.right,target-src.val)
else:
if s... | 1 |
ebf59b9f75a96741476eb55b8c483b6b | 9727c1b84fb2c6044d9bef1260badb57 | Disables the redirect, and sets a timer to re-enable it automatically | press_disable = false;
if (!t) {
timeout(1000);
} else {
clearTimeout(t);
t = null;
}
} | 0 |
53e39f4f9e51bce39e9a1fe6e740723d | 6e0bb64e5fa40d22793529ac84bb8b58 | Compute model matrices of the eyes with respect to the head. | t = [math.radians(x) for x in goals]
hs = [dh(0, -np.pi / 2, 4.3, t[0])]
if mode >= 2:
hs.append(dh(0, np.pi / 2, 0.0, t[1]))
if mode >= 3:
hs.append(dh(0, -np.pi / 2, 24.3, t[2]))
if mode == 4:
hs.append(dh(27.0, np.pi / 2, 0.0, t[3] - np.pi / 2))
m = np.eye(4)
for h... | 1 |
2485bf5d9950ea236d81b930e8d963b1 | 96ce0e9dd5f880fabccf23f32a132c89 | writeToFile() is used to save references to file and page link | class FileStorageBackend:
def pageToFile (self, wikiword):
return "%s/%s.markdown" % (self.directory, wikiword) | 0 |
721258665d50518f6a1a42211bac8ff7 | b124098f0766fb91be4fd7d3b402b414 | Return the time from timestamp to now. | now_timestamp = time()
offset = fromtimestamp(now_timestamp) - utcfromtimestamp(now_timestamp)
return utc_datetime + offset | 0 |
ba83446dd83f905d9571f3fe01644e57 | 3117bd65de7e0de42feb0d19f0a8f6de | 判断时间规则数量是否超过十个 | {
print_r($time11);
if($time11>$rule){
return true;
}else{
return "时间不合法";
}
} | 0 |
5134098f05cbda245f41f2142e31c327 | 0160d8a3709e46830220021ffc1d4c6a | 項の前に付く単項演算子の文字列からUnifiedUnaryOperatorへの標準的な辞書を作成します. | {
if (OperatorMap.ContainsKey(oper))
{
return OperatorMap[oper];
}
return null;
} | 0 |
ed65dcbe63af16fabf1f482870a21fb2 | b4f421937529a7e21cdbb557085fdcaa | Valida Inscrição estadual do estado do Alagoas
(Inscrição estadual) | class MinasGerais implements ValidadorInteface
public static function check($inscricao_estadual)
{
$valid = true;
if (strlen($inscricao_estadual) != 13) {
$valid = false;
}
if ($valid && !self::calculaDigito($inscricao_estadual)) {
$valid = false;
}
... | 0 |
7277fd6abf23918d496e731e15bb2ed3 | 6e28954fd327d987ca540536beaec3ce | senses the distance from each landmark | void ParticleFilter::dataAssociation(const Map &map_landmarks,
vector<LandmarkObs> &observations) {
for (int i = 0; i < observations.size(); i++)
{
int closest_landmark = 0;
int min_dist = 999999;
int curr_dist;
for (int j = 0; j < map_landmarks.landmark_list.... | 1 |
5f5685e0b35eafcb86c1cf2ab21f0219 | 1872bc8cb2e8126217c967fe67004637 | 根据id停用 友情链接 | $data=$this->request->param();
$id = $data['id'];
if(D('addons://superlinks/Superlinks')->where('id',$id)->setField('status',0)){
$this->success('成功禁用该友情连接');
}else{
$this->error(D('addons://superlinks/Superlinks')->getError());
}
} | 1 |
07a5fa244fcb70409b1908db93fed4db | 217a18f59917ae15dce48935d279d9a3 | constructor for a new vector | Vectornd::Vectornd(vector<double>& inp){
pt=inp;
vdim=inp.size();
} | 1 |
5e04453253d5b97fc3fbebfb29e0820b | 8e34af635398d24cb9056569428dad80 | Returns string without punctuation and white space. | def clean(x):
x = remove_punctuation(x)
return " ".join(re.split("\W+", x)) | 0 |
edbf3100660108c39a7770af84e65884 | 2500c705f23a31b7a1c9679253a112d4 | This function is called when the message class is loaded. It loads general information about the message from the
imap server. | {
messageDetails = null;
if (Inspector.CurrentItem is Outlook.MailItem)
{
messageDetails = new MessageWrapper((Outlook.MailItem)Inspector.CurrentItem);
}
} | 0 |
e76654276f604d55f572c527ed2170af | 060a879480c8ead2ec3b961b5b049693 | Get the key used to symmetrically (AESGCM) encrypt cookie values in v10 from Chrome Local State. | with open(os.environ['USERPROFILE'] + os.sep + r'AppData\Local\Google\Chrome\User Data\Local State', "r", encoding='utf-8') as f:
local_state = f.read()
local_state = json.loads(local_state)
master_key = base64.b64decode(local_state["os_crypt"]["encrypted_key"])
master_key = master_key[5:] ... | 1 |
098627647522ad7b5b43c0a2d3f91811 | ac81800336bce09e19b6ecb00d29e1ef | Sprawdzanie, czy plik znajduje sie na liscie plikow wyslanych | {
$downloaded = self::all(
'target_type=\'File\' AND target_id IN :ids AND author_type=\'Recipient\' AND author_id=:rcptid AND ip = :ip AND event=\'download_ended\' AND created > :since GROUP BY target_id, id',
array(
':ids' => $files_ids,
':rcptid' =>... | 0 |
36c74706a3b23aaab6925300a22d09d6 | f2ea1c75e6bbb327e6ad0b99dcc84c5d | 展示用户的喜欢的书籍 | {
$allBooks = Auth::user()->favourites()->leftJoin('books', 'favourites.book_id', '=', 'books.id')
->select('books.*')->orderBy('books.title')->paginate(15);
$favourites = Auth::user()->favourites->pluck("book_id")->toArray();
return view('user.favourites.index', compact('allBooks', ... | 1 |
3ca9bbb88fc013e29c01774fee73826f | 46d65e18fc7965622363fcd1da0144f3 | sets the input time to a new value | void Event::setTime(int t)
{
Time = t;
} | 1 |
308b582c97ec1e0d0b378ccc6c238e89 | 27eaf933de540e16731a8e4c41873c00 | Set the silence (mute) mode of this client. | namespace VkNet.Categories
public class AccountCategory
[ApiVersion("5.40")]
public bool SetSilenceMode([NotNull] string deviceId, int? time = null, int? chatId = null, int? userId = null, bool? sound = null)
{
VkErrors.ThrowIfNullOrEmpty(() => deviceId);
var parameters = new VkParameters
{
{ "device_... | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.