query_id
string
corpus_id
string
query
string
code
string
label
int64
04577a2878ae3bd54bcdb1dfd7c2ecc2
4eaeb2ac263f1754ba1663a0731146a3
gets all project_type s or the project_type of the sent parameter
void getProjectType();
0
e3f7501faddb833e2cc5f4916f73edcd
df2d6f38f27e6c0940a6c543ae70459a
Append text to a status text widget.
public class MainController extends GridPane void appendStatusText(String string) { textArea.appendText(string + '\n'); }
1
8f87245fa3b79e12a2cf8f50e9871bab
cfe3afd6a8a244d9c23937c41723f077
Returns all subsets of length 1, ..., n of the iterable
class Digits(S3Iterable): def subsets(self): return range(10)
0
a30e164601a727abb9b7ceab15056ba2
50fb0ddda8af049d2c14c4ffe0613811
Convert SRM to deg Lovibond
obConversion = openbabel.OBConversion() obConversion.SetInAndOutFormats("smi", "smi") mol = openbabel.OBMol() obConversion.ReadString(mol, smi) outMDL = obConversion.WriteString(mol)[:-2] return outMDL
0
40fe7793b4d21cd45ebd115a1059dd4a
061fda0a28e76980172f204fd1ff85a4
Checks or unchecks the list of available boards
obj = sci.object if sci.old_state.id == 'locked': obj.unlock_board() elif sci.new_state.id == 'locked': obj.lock_board()
0
2b122af5d4465bbcaa652ce1c62c5f39
74d75d489896c574bc6b8a1e51e389f9
put date in universal format, no seconds
struct tm *mytm; mytm = gmtime ( &sec ); sprintf ( buf, "%.4d-%.2d-%.2dT%.2d:%.2d:%.2d.%.3d", mytm->tm_year + 1900, mytm->tm_mon + 1, mytm->tm_mday, mytm->tm_hour, mytm->tm_min, mytm->tm_sec, (int) usec/1000 ); }
0
5c23596f855ce7e7cef9555cefadb836
d9e70854ce97a15e9802dc1f553ce7b8
Moves top content to a new position
public function moveToAction($params = array(), $compositePart = false) { $result = array(); if (isset($params['oldPosition']) && isset($params['newPosition'])) { $oldPosition = $params['oldPosition'] + 1; $newPosition = $params['newPosition'] + 1; $searchValues = $th...
1
c7b58b9feb108c9ab1c0068601353782
9904bcb091d4be8a654a0b901f8e8a16
Check if we want to get market statistics update in the data feed
abstract class AbstractSubscriptionGooglePlay extends AbstractPeriodicalSubscription protected function needWriteStatistics() { return !$this->isTestSubscription(); }
1
b969b92dd9f6a377731e85176f2efb2c
706c5083eb2b4be6c3b1066149836f7b
Calculates the mean dF/F value of the given data after getting rid of the lower quantiles of it.
class MFEStatistical: def ft_t_mean(cls, N: np.ndarray, pcut: float = 0.2) -> np.ndarray: if not 0 <= pcut < 0.5: return np.array([np.nan]) return scipy.stats.trim_mean(N, proportiontocut=pcut)
1
a7bc122825ff9bb4b48e383bfb8199f8
47cc56922fd7bd280fdbc8e88f05629e
Returns a list of the physical disks available to the server.
class DRACClient(object): def list_physical_disks(self): return self._raid_mgmt.list_physical_disks()
1
cc299317cbf4bfa640a12954131f034e
c9e65df2f42adf0ab4e1118fb2afea75
Funktion som låter användare skapa konto om sådant inte redan finns - Nima & Axel
public class Server implements Remoteinterface public boolean createAccount (String username, String password) throws RemoteException{ if(userInfo.containsKey(username)){ return false; } else{ userInfo.put(username, password); return true; } }
1
57a6c3c13457a977ba82b8a819accee2
38540d932cfeb9c160241ee152415017
Вычисляем цену с учетом скидки
class CatalogController extends \yii\rest\ActiveController public static function markup($price, $category = null, $with_user=false) { $markup = isset(self::$retail_params['markup']) ? self::$retail_params['markup'] : 20; $penalty = $with_user ? self::getPenalty() : 0; if(!empty($category)){ ...
0
ed3afeb36b5e8989aa73bb0cc48f19eb
df3083f8435cb59b0626755ea536a4a1
Sets the mid year.
public class ModelYear public String getMidYear() { return midYear; }
0
14ef82bdc8179a9fb9a90c2575649c27
2c36653f3135bd80308e0852365cd55a
Método que devolve se temos permiso de acceso á galería
class CatAdd : AppCompatActivity() private fun checkPersmission(): Boolean { return (ContextCompat.checkSelfPermission(this, android.Manifest.permission.READ_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED) }
1
5c85a94e1b2961f0c2986746dd8979f5
414d725abc4557b16e1b4c0473c7608e
Removes a format node updating the offset of the next format node and the text nodes pointing to this node.
static void _evas_textblock_node_format_remove(Evas_Object_Textblock *o, Evas_Object_Textblock_Node_Format *n, int visible_adjustment) { { Evas_Object_Textblock_Node_Format *nnode; nnode = _NODE_FORMAT(EINA_INLIST_GET(n)->next); if (nnode && (nnode->text_node == n->text_node)) { ...
1
4f63cb17b1ee57766acf7f80fca2573c
2664567f2052b4f0e2b55b3cbb536246
Get background and active connection icon acccording to day or according to current theme settings
static void change_theme(bool forcechange) { if (!forcechange) { time_t temp = time(NULL); struct tm *tick_time = localtime(&temp); char buffer3[] = "1"; strftime(buffer3, sizeof(buffer3), "%w", tick_time); current_theme = atoi(buffer3); } if (current_theme == 0) { gbitmap_destroy(s_bac...
1
b774f9b66574279968d6e897779aa548
c791041301ab67c5a84576fa4b4545e0
Returns the meta object for class '{@link org.eclipse.emf.ecp.view.validation.test.model.Book <em>Book</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
EClass getFamilyBook();
0
6f03e0ebd0b954b4d770c79666e92fcf
0404c24f0d5e2ae9b8fa26958bed8ccd
Controls the players movement as they dodge.
if (playerDetected) { Vector2 followPlayerVector = playerPos.position - transform.position; movement = followPlayerVector; changePatrolTime = 0.5f; speed = PatrolSpeed; } else { int Xdirection = Random.Range (-1, 2); int Ydirection = Random.Range (-1, 2); movement = new Vector2 (Xdirection, Ydi...
0
87d40c4231937cc8e4fd5ee0cc42c3bd
570897b8e18ce0acd6837ec7a429c796
保留2位小数的四舍五入(格式化金额)
public class TrayOrderDealActivity extends BaseActivity implements OnClickListener,AbsListView.OnScrollListener private String DoubleCast(Double data){ NumberFormat nf = NumberFormat.getNumberInstance(); nf.setMaximumFractionDigits(2); nf.setRoundingMode(RoundingMode.HALF_UP); return nf.format(data); }
1
cd264c33851c4f1ac91dc8aefa528864
8972591250621e60ae8557ad57f30b94
# 檢查資料,並在空的資料欄位中加入'-'字串
replace_m_with_na <- function(x){ x[x=="M"] = NA x[x=="-"] = NA x }
0
96c851c47692f6fa4d249115b3322272
099058f42f8169295ac45945af3eeef0
阻塞式RPOPLPUSH
@Component public class RedisTemplateList public void rightPopAndLeftPushWait () { System.out.println(redisTemplate.opsForList().rightPopAndLeftPush("3111", "3112", 1, TimeUnit.SECONDS)); }
1
e1f5bd8efd6f6985097dff10d5ac15dc
51bc5b66686604018e5c94abf738a444
Returns the status of an environment. found
class SEnvironment: def __contains__(self, item): return self._get_env_with(item) is not None
0
924ecbc8f22559b716d4de774d002e40
594d204d3d2a85e5a8ca3cad0e977399
Add the values in another spectrum to the values in this one, and return a new Spectrum object.
New = copy.deepcopy(self) if isinstance(b, SPM_image): New.pixels += b.pixels New.channel += " + " + b.channel elif type(b) in [int, float]: New.pixels += b New.channels += " + {:.2f}".format(b) return New
1
828287f36d0ffb84cb7ef7d196796548
317c2b18d8bb7bf94153119f5910d264
<p> Update the configuration of an event destination for a configuration set. </p> <p> In Amazon Pinpoint, <i>events</i> include message sends, deliveries, opens, clicks, bounces, and complaints. <i>Event destinations</i> are places that you can send information about these events to. For example, you can send event da...
java.util.concurrent.Future<UpdateDestinationResult> updateDestinationAsync(UpdateDestinationRequest updateDestinationRequest, com.amazonaws.handlers.AsyncHandler<UpdateDestinationRequest, UpdateDestinationResult> asyncHandler);
1
f2b1e6878177fc8716c75633e2007f2d
cc4ac62fe5a00ad690abcf032d16b633
Canonicalize special operators to basic operators. This can simplify latter analysis. (e.g. Expand bias_add to expand_dims and broadcast_add.)
namespace toy void ReshapeOp::getCanonicalizationPatterns( mlir::OwningRewritePatternList &results, mlir::MLIRContext *context) { results.insert<SimplifyReshapeConstant, SimplifyReshapeReshape, SimplifyNullReshape>(context); }
1
9a13d866e942536c69fc62e614f26c5e
3567b1a9f5caf8dca832f0a746d351c3
Defines the action selection policy during training.
class Policy: def select_action(self, action_func, training): return action_func()
1
9211a83c69e4442c48192850c594d44d
57cffb44e9ad146c92ce220037dc600a
Read a table from a sqlite3 db file
layout = os.path.join(basepath, 'Layout.xlsx') filepath = os.path.join(basepath, database, table + '.txt') schema = create_schema(layout, database=database, table=table) df = sqlc.read.csv( filepath, sep='|', ignoreLeadingWhiteSpace=True, ignoreTrailingWhiteSpace=True, ...
0
129b82a8cebe1853064d104c6649851b
46a2a0ed85e1abd483c112f2d18451cc
p(b,a) = sum(r(s,a)*b(s))
def expectedReward(R, P, oldState): cumReward = 0. for a in range(R.shape[0]): for newState in range(R.shape[1]): reward = R[a][oldState][newState] prob = P[a][oldState][newState] cumReward += reward * prob return cumReward
0
0eac7cc09469d56c6d8f17e7954e5662
83d07e831d469546f52003114dfd371c
生成短信号码
{ try { GenerateShortCode shortCode = new GenerateShortCode(m_app.SqlHelper); string[] code = shortCode.GenerateStringShortCode(name); this.txtPy.Text = code[0].ToString(); this.txtWb.Text = code[1].ToString(); }...
1
6c6cea77f60f24d7854b570b6ad3c0db
9668c0c19c7e8ca409de6a931b519a28
CACHER OU AFFICHER UNE DIV AVEC UN BOUTON RADIO
function deroule_suite(radio){ var valeur_radio = radio.value; var enf = document.getElementById("form_enfant"); var par = document.getElementById("form_parent"); var conj = document.getElementById("form_conjoint"); var choix_radio = document.getElementById("choix_radio"); switch(valeur_radio) {...
1
587bb3a64a3a4536968241c9df77275d
306818e010deb3fd915ba6258d635cc5
查询视频剪辑工程列表。 允许通过条件过滤查询,支持的过滤字段如下: - projectId[eq] 按照工程ID精确查询
listVideoMotionCaptureJobs(listVideoMotionCaptureJobsRequest?: ListVideoMotionCaptureJobsRequest) { const options = { method: "GET", url: "/v1/{project_id}/video-motion-capture-jobs", contentType: "application/json", queryParams: {}, ...
0
53e852717e026f6237b12e14eca60ffa
624c823f17fc04461aabc4079a9fc1e2
Deleta os Modelos da Campanha
{ $campanha = crm_campanhas::find($request->id); $campanha-> delete(); \Session::flash('success', 'A campanha foi apagada com sucesso'); return Redirect::to('/campanha'); }
0
470cc376b24d845c756b787492b572cc
17e01c8dc213278bf8008bebf74a9810
Doppler shift a spectrum.
if v==None and z==None: raise ValueError('Please provide either v or z to shift it') c=3e5 if v != None: shiftSpec = self.__class__(self.wave * np.sqrt((1+v/c)/(1-v/c)), self.flux, mode='waveflux', var=self.var, dq=self.dq) e...
1
d7c9bbc969c83e8ec8da02d5c23ab4d2
178a40d79ac9293943ecd4be4c72b402
Gets related changes of a specific change revision.
public Promise<ChangePreview> getChangePreview(final RefactoringChange change) { final String url = pathToService + "change/preview"; return newPromise(new AsyncPromiseHelper.RequestCall<ChangePreview>() { @Override public void makeCall(AsyncCallback<ChangePreview> callback) ...
0
66a1e69ae281c72b97c31bfeb852a582
6395053d85ac5e94d45905386e607f3e
Sets the ticket type.
class Card public function setTicketSubType($ticketSubType) { $this->ticketSubType = $ticketSubType; return $this; }
0
ed1972587bdcdcad5b324cdae31a7578
7ce2b81ba730dc9d6b9d6cfef2e1088b
Recursive function to help create parse tree from postfix notation
( PTREE expr ) { if( NULL != sym_op || NULL != sym_at ) { expr = PTreeTraversePostfix( expr, &insertNode ); } return expr; }
1
ae97f39c56343a8ec8b20c7e501c5b83
7773ee86159a9e86e46b05d33c16215b
orders format: [ {"security": "000001.SZ", "action": "Buy", "price": 10.0, "size" : 100}, ... ] return (result, message) if result is None, message contains error information
dataList = re.findall(r'(?:((?:2cn_)?((?:sh|sz)[\d]{6})(?:_0|_1|_orders|_i)?)(?:=)(.*)(?:\n))',message) result = list() for data in dataList: if (len(data[0])==12): wstype = 'quotation' elif ( (data[0][-2:]=='_0') | (data[0][-2:]=='_1') ): wstype = 'deal' elif ( data[0][-6:]=='orders' ): wst...
0
ab4af0ba34965c4e7c5ff2f72705f04d
34938b9e30152626a5884a3103279840
判斷字符串長度,超過指定長度返回false,不超過返回true。
function CheckLength(str,len) { var flag =false; var strLen = str.length; if(strLen <= len) flag = true; return flag; }
1
fcc260ae391becc7bfa4034013372701
e97c44dbc5e9b64620d04189a7931024
TranslateExtension constructor.
class DateExtension extends AbstractExtension public function __construct(TranslatorInterface $translator) { $this->translator = $translator; }
0
f7b499b7f203e83f9c291f7054ba4e7b
8bcee629df293e5ba10434c3f0ac9d75
Set 是否更新到关联的Datahub任务,默认为true
public class DescribeDatahubTaskRes extends AbstractModel{ public void setTaskType(String TaskType) { this.TaskType = TaskType; }
0
d66bc7bb1127eca6822f6605bf38a30c
0dd0ecddbfd82bebd6a3732b8f00ee25
Size per timepoint.
class BaseDiscretization(BaseModelDependent): def tau(self): return getattr(self, '_tau', np.inf)
0
ea82cf55ab28e643dddb7cb4dfc26443
150b6167d37f06ea23836332e83273de
Validating XML response using XPath
Map<String, String> namespaces = new HashMap<String, String>(); namespaces.put("tns", "http://samples.springframework.org/flight"); namespaces.put("xsi", "http://www.w3.org/2001/XMLSchema-instance"); NamespaceContext ctx = new SimpleNamespaceContext(namespaces); XpathEngine engine = XMLUnit.newXpathEngine(); ...
1
6e2479cee159f89646c65e8f2b8f989f
708668dcbc7fb42a6cf26b9e9db0f4df
metoda na to czy zwierzak sie najadal czy nie
class Person public boolean erEier() { if (erEier == true) { return true; } else { return false; } }
0
4ce88a588aabf5600936d124dd40f717
e769ed4453963bbc73bc879e2ba31708
Update registry key path bar.
IntPtr r_main, r_tree; if (IntPtr.Zero == (r_main = FindWindow("RegEdit_RegEdit", null))) { Process.Start("regedit.exe"); Thread.Sleep(100); if (IntPtr.Zero == (r_main = FindWindow("RegEdit_RegEdit", null))) throw new InvalidOperationException(GetLastError()); } ...
1
3c2dbe791907ae8ea3792d6eabdab79c
17f0d743443a69fd73ea0e1b12dac039
Initiates the asynchronous execution of the ModifyHsm operation.
export class ManagedHsmsImpl implements ManagedHsms async beginCreateOrUpdate( resourceGroupName: string, name: string, parameters: ManagedHsm, options?: ManagedHsmsCreateOrUpdateOptionalParams ): Promise< SimplePollerLike< OperationState<ManagedHsmsCreateOrUpdateResponse>, ManagedHsms...
1
3b2d4e26c0dc263514828073de5fd257
e3d746a02ccad9bb31f6d62e97e5593e
Sets the format which postal codes from the country are expected to adhere to
namespace UglyToad.MakeMe.Specification.PostalCode public class PostalCodeSpecification : ISpecification<string> public PostalCodeSpecification WithFiveDigitFormat() { Country = IsoAlpha2Code.Unknown; return this; }
1
036e6d309447d0896b54f9e26114de3a
59465603d6ada7289840e619ea3027c3
Gets the player sha, if it's been explicitly declared. If not, mark metadata as an update field.
namespace Mudpie.Server.Data public class Player : ObjectBase [NotNull, Pure, ItemCanBeNull] public static new async Task<Player> GetAsync([NotNull] ICacheClient redis, DbRef playerRef, CancellationToken cancellationToken) => (await CacheManager.LookupOrRetrieveAsync(playerRef, redis, async (d, token) => aw...
0
0b4d182b7fbf4ea765b9ac1a3c30670d
221392e1567e6564505c757b5ace95d8
Executes a phrase query on the index with the given sequence of terms.
raise ArgumentError, '"docs" argument must be Array' unless docs.kind_of?(Array) raise ArgumentError, '"index" argument must be String' unless index.kind_of?(String) or index.kind_of?(Symbol) raise ArgumentError, '"words" argument must be String' unless words.kind_of?(String) raise ArgumentErr...
1
a60f8928ebce148e64b94c4c104ec8f1
55739d5eb4adb5a3b2b9cd4a0775a8cf
裁剪超出的内容, 并且追加符号 ( 如 ...)
function strCat(text, start, length, mode) { let index, len; let result = ''; const words = split(text); for (index = start, len = length; len > 0; index++, len--) { const value = words[index]; if (!value) { break; } else if (meaw.computeWidth(value) == 2) { ...
1
3cb0032fbda346480ef278fe0bde0454
cebd3d1d88193d1a51a33fc016c0d085
Runs data processing scripts to turn raw data from (../raw) into cleaned data ready to be analyzed (saved in ../interim).
def main(input_filepath, output_filepath): logger = logging.getLogger(__name__) logger.info('making final data set from raw data') cycle3 = pd.read_csv(Path(input_filepath) / FILE_NAME) cycle3 = preprocess(cycle3) cycle3.to_csv(Path(output_filepath) / 'cycle3.csv')
1
391193d03a00ecd3a4b0426d9b33e4cd
916507fcced04ad977b390411df01a28
Return a StoryContents domain object from a dict.
class Synopsis(tuple): def from_dict(cls, d): return cls(SynopsisRole._from_dict(role) for role in d.get('roles', []))
0
c0cfa6cb70d42214b60142666604aacf
72c357afe2c3ec6b759da864c4041f6c
error handler, should reset I2C slave internal state
{ i2cErrno = (I2C2STAT & I2CSTAT_MASK); switch (i2cErrno) { case I2CERR_BUSERRORx: { I2C2CONSET = I2CONSET_STO | I2CONSET_AA; master_i2c_ackpoll = ACKPOLL_NO; #ifdef __BOOTLOADER__ master_i2c_in_use = 0; #else i2c_trans_com...
1
68e163ad343ef0e39473941b9f63da85
70f6c2208dbbdb2f19e4f60401e5e8f5
把二进制字符串转化为十进制字符串
int[] temp = BinstrToIntArray(binStr); int sum = 0; for (int i = 0; i < temp.length; i++) { sum += temp[temp.length - 1 - i] << i; } return (char) sum; }
0
e3ead9eb6c24dab6749dc12378d71452
2f8e623b95832bfb474a9d903b35768d
print the addresses, so we can verify we're dealing with the same objects
function printAddresses(addresses){ console.log("Addresses:"); for (let address of addresses) { console.log(address); } }
1
9e2464cc796180aa212a709a90786a91
c4c770b58d692bec8c7a740467904427
Adiciona uma notificação caso um determinado número seja menor que outro.
{ if (notificavel == null) return null; if (numero > numeroComparado) notificavel.AdicionarNotificacao(mensagem, informacoesAdicionais); return notificavel; }
0
d1d53952eca65fb90b420fc20c4293ac
d709f6ca3f68626e7fc78a5099c4b8fb
Wrapper function for init uplink task one initialisation
void radiolinkInit(void) { if(isInit) return; nrfSpiInit(); isInit = nrf24l01Check(); if(!isInit)LedseqRun(LEDR,seq_armed); nrfSetInterruptCallback(interruptCallback); vTaskSetApplicationTaskTag(0, (pdTASK_HOOK_CODE)TASK_RADIO_ID_NBR); vSemaphoreCreateBinary(dataRdy); rxQueue = xQueueCreate(3, sizeo...
1
5d6425adf11e92dffd3fa0001f88c107
839c68b4b3eb353c3f011bdd6ddd9daa
Can be used to force reconnect for next execute method.
public function reConnect();
1
4aa7600c63e4120b8efede5783bdeabb
0ce3977607a2270a7ff96ede1a8b0830
Class that handles Social Auth AuthExceptions by providing the user with a message, logging an error, and redirecting to some next location. By default, the exception message itself is sent to the user using a flash and they are redirected to the location specified in the SOCIAL_AUTH_LOGIN_ERROR_URL setting or to the u...
class AuthError(Exception): def __init__(self, code, description, status_code): self.code = code self.description = description self.status_code = status_code
0
c819952be05e4ac8ca2d1c2e8ff86dc8
3aa07b360199e97ce7f12660a9a844fb
Return a flattened list of jobs. This method will flatten a list of jobs, and if an entry is an array the method will recurse.
for x in items: if isinstance(x, Iterable) and not isinstance(x, ignore_types): yield from flatten(x) else: yield xj
1
40f9ca5489081b88b9b0445303e67055
7f61448ad6da3ef0f9cb03f40c5be655
SRID
cases like (1)
0
54d65b1bc2938c3bb26030b20ac62104
0ee45afeded38a4b3f0c47f28b8db9ac
해당년월의 처리 업무 건 수 와 고객 수 가져오기
public int monthCnt2(Map<String, Object> map);
0
8c2615e191f21c46066e9b2dfc186fb9
bf867b2b0446f256966dc6c40666925a
Validação sessão do usuário de 12 horas caso tempo excedido o mesmo necessitará fazer login novamente caso não irá logar direto.
export class CommonDataService public deadlineSession(): void { var idleTime = 0; $(document).ready(() => { var idleInterval = setInterval(timerIncrement, 60000); $(this).mousemove(function (e) { idleTime = 0; }); $(this).keypress(function...
0
550ca522e19c8c008f12a704d818acfb
aea5ec6ce4ca6f133ec5e3d21d539328
异步上传采集数据到服务端
class CTCC() : def uploadData(self, data): try: headers = { 'Accept':'*/*', 'Content-Type':'application/x-www-form-urlencoded; charset=UTF-8', 'User-Agent':'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.284...
0
ea320d76b63b438324d78cf3d5bb5a3f
82c0ccc68ff6bae816e2df746ed135b4
该位置插入的该值在区域上是否合法
boolean isOutOfRange = p > topRegion || p < bottomRegion; return before != NONE_POINT && p != NONE_POINT && ((p >= before && p > after) || (p > before && p >= after)) && !isOutOfRange; }
1
6ddc0c05eed2ec491c1cfd40b1d79cfe
595e88c9e5f4b72c26f5cd4dda1e8f0a
from: https://gist.github.com/zachguo/10296432
func round(x float64, prec int) float64 { var rounder float64 pow := math.Pow(10, float64(prec)) intermed := x * pow _, frac := math.Modf(intermed) intermed += .5 x = .5 if frac < 0.0 { x = -.5 intermed -= 1 } if frac >= x { rounder = math.Ceil(intermed) } else { rounder = math.Floor(intermed) } ...
1
8db5cb48daca28058282ee80a5fc2cd4
0d28e180cfa4a387d4e6b3de78f0123a
Elimina un {@link Plan} a partir de un id
public class ProCable public boolean eliminarPlan(String nombrePlan) { return planes.eliminarPlan(nombrePlan); }
0
01c42c1301685f6ca2e7867017faab56
a1b76b756489fe74700fbc8632dce5d0
Gets the value of the privilege property. possible object is {@link Picklist }
class IoImageIds implements ModelInterface, ArrayAccess public function getPrivilege() { return $this->container['privilege']; }
1
6687039dfcb8306884077ebbeecefd2d
92885f739f79c3d2e6ae8df9d17a0c3a
Bottom line across screen below time.
return OnscreenText(text=text, style=1, pos=(-0.1, 0.09), scale=.07, parent=self.a2dBottomRight, align=TextNode.ARight, fg=(1, 1, 1, 1), shadow=(0, 0, 0, 1))
0
8deb15f32a09b0666d7e6418262d8933
6ebd3829d58b6a48e9c69f44509c9060
Ignores n, reads a line from stdin, and returns a number given in that line.
{ char line[LINE_LENGTH]; int done; int val; int i; int isdigit(); i = 0; done = FALSE; while (!done) { line[i] = getchar(); if (isdigit(line[i]) || line[i] == '-') i++; else if (i != 0) done = TRUE; } sscanf(line, "%d", &val); ...
1
ba16a2619b95463a43598f128c311a65
c3776473189af1b151e6e7eb25dff42c
获取应用注册的权限
PackageInfo appInfo = null; List<String> perls = new ArrayList<>(); try { appInfo = FUtils.getAppContext().getPackageManager() .getPackageInfo(FAppUtils.getAppPackageName(), PackageManager.GET_PERMISSIONS); String[] perms = ...
1
81db31f78519acd90b95826dd4b85130
53b6eb2bed0d6927e876f057edca8c6d
Instructor section (instructor to change before distribution)
{ Section = await _context.Section.Where(s=>s.InstructorId == _userManager.GetUserId(User)) .Include(s => s.ApplicationUser) .Include(s => s.Course) .Include(s => s.Term).ToListAsync(); }
1
7f59be41b95be2e1e0d6e64022b8d7fa
27e6c4ae4a81a13f7a22a37aedf9ee75
Update the coordinates with respect of the actual keypad layout.
if coord == 9: coord = 14 elif coord == 16: coord = 18 elif coord == 20: coord = 8 elif coord == 26: coord = 30 elif coord == 37: coord = 42 elif coord == 44: coord = 24 elif coord == 56: coord = 52 elif coord == 59: coord = 41 elif coord == 63: coord = 66 elif coord == 69: coord = 65 eli...
1
b630319f8aeefa3727a11c5481cd2c13
f4493f4f368b9657ee5c6caf11cada89
A simplified check inspired by ProjectUtil.openProject() for file existence before we show a trust project dialog
public class SetupProject implements Parcelable public boolean exists(Context context) { return Environment.getProjectFile(context, mName) != null; }
1
2abc4d2411a1451f3f9a9e8546c3463b
21c697ea1562af7d4bfbe5a73b7fbe0c
The uniform resource name of the reserved ip
class GetDomainResult: def reserved_ip_range(self) -> str: return pulumi.get(self, "reserved_ip_range")
0
d59feec1226b49b0bec9fedcaa36e168
89ae5f0d24ae2ef4d6906128477f8248
Crea el cuaternión a partir de la parte escalar y la parte vectorial
result = Quaternion() result.escalar = self.escalar * other.escalar - (self.vector.Escalar(other.vector)) result.vector = self.escalar * other.vector + other.escalar * self.vector + (self.vector.Vectorial(other.vector)) return result
0
1fa2c359b3cf5a730c85b794e2d8c513
166c5582293360b719b7168f35249251
更新陌生人列表
for _,id in ipairs(friendIdList) do if gotoBlack == true then self._blackFriendList[id] = id self._suggestFriendList[id] = nil end self._friendList[id] = nil self._applyFriendList[id] = nil end self:dispatchEvent({name = self.EVENT_UPDATE_FRIEND}) self:dispatchEvent({name = self.E...
0
7c5394a30bf74d285b5cf0707d8881fa
8665057daed03feab4daed97dbf8df58
Pozitia platformei se actualizeaza la fiecare miscare a mouse-ului
class MonAppli(QtWidgets.QMainWindow): def mouseMoveEvent (self,event): self.table.plat.queue.x, self.table.plat.queue.y = event.x(), event.y() self.ui.con.update ()
1
dce7dfa9eacb47f2841e9417b843a90c
42c90e632a434306aebc197d0604e142
ランダムな12桁の文字列を返す
$char_list = array( "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"); $size = sizeof($char_list); $ret_str = ""; for ($i = 0; $i < 12; $i++) { $...
1
8e791cee15f5a95e528421e4d8140041
a464c585df751574cca0d8cff8b83cfa
Find the principle moments of a shape given its moments. The array returned contains the moments sorted so that the smallest moment appears first. The argument array can be computed from a shape by calling {@link #momentsOf(Shape)} or {@link #momentsOf(Shape, AffineTransform)}. <P> The principal moments are the eigenv...
namespace Rhino.Geometry public class VolumeMassProperties : IDisposable public bool CentroidCoordinatesPrincipalMoments(out double x, out Vector3d xaxis, out double y, out Vector3d yaxis, out double z, out Vector3d zaxis) { x = RhinoMath.UnsetValue; y = RhinoMath.UnsetValue; z = RhinoMath.Unset...
0
8ca38802fd34ad17efc86ae8f8248e45
2c5abe6ce94019f4142072122adaf14e
Outgoing Avro schema for each record created from a CSV row
public class ImportAvro static class AvroImporter implements Mapper<AvroWrapper<GenericRecord>, NullWritable, ImmutableBytesWritable, Put> public void map(AvroWrapper<GenericRecord> key, NullWritable value, OutputCollector<ImmutableBytesWritable, Put> outputCollector, Reporter reporter) throws IOException { ...
0
9bda6bc92346cae035adb5c1743c2e2f
f2833d1533880ab7ae0799ab71be55a7
function to show all the mines when the user loses
def show_mines(slots, board, board_size): for r in range(board_size): for col in range(board_size): if board[r][col] == -1: slots[r][col] = 'M'
1
2be8e14f0cb3c5183ceb12a75a9e4dde
358cc16815deb2776cc6b35c3233b9d1
Infinity loop: wait for any new item in queue:instagram Redis list, pop it and process. Wait for 2 seconds, go to the begining.
class InstagramHelperThread(Thread): def run(self): while True: data = jloads(self.redis.blpop('queue:instagram')[1]) try: url = 'https://api.instagram.com/v1/media/shortcode/{}?access_token={}'.format(data[1].split('/')[4], IG_ACCESS_TOKEN) photo_data = get(url, stream=False, timeout=10) except (Ind...
1
5052707e9c926035f42d8e10c1e96e9d
4edaf99ce85e4659aeaf8fbb04f728d8
V4L2 interface - ioctl function
static int LegVpDvrIoctl ( struct inode *pInode, struct file *pfile, unsigned int cmd, unsigned long arg) { int result = 0; LegVpDvrInfoType *pDvrInfo = pfile->private_data; switch ( cmd ) { case LEG_VP_DVR_IOCTL_MK_DEV_OBJ: result = LegVpDvrIoctlMkDevObj(pDvrInfo, arg); ...
1
0585174ae3ecf8085f60f4174b2c37fc
d4a86dc0cbcacf1abeef3aa695d2a434
Checks if tracer ``name`` is enabled.
class IntegrationConfig(dict): def header_is_traced(self, header_name): return ( self.http.header_is_traced(header_name) if self.http.is_header_tracing_configured else self.global_config.header_is_traced(header_name) )
0
0b260bccfa0497cf1f68cc341c6bb74d
25f6f3e1e2df89216268099c51913fd0
没有target时取当前节点
let parent = this.targetNode.parent let isAllExpanded = true while (parent) { if (!parent.isExpanded) { isAllExpanded = false } parent = parent.parent } if (isAllExpanded) { return this.targetNode } else { let node = this.targetNode while (!node.visibl...
0
ba9ec98f57b8ee116219bd05a49e5896
cef16ca737b017e6cb9be609247f0ce9
分解n,计算每个位置上的数字的平方和
func getSquare(number int, result chan int) { sum := 0 dch := make(chan int) go digits(number, dch) for v := range dch { sum += v * v } result <- sum close(result) }
1
b1fa3d78ac512fa8f820d4abc182e1cc
d41621f0d9c849aa0e125a9ede527130
Sets the CKEditor config manager.
void setConfigManager(ConfigManager cm);
1
96d29b98a173af149291a13ce6161e07
f7702ed4ad56901c5626900bead448f5
使用同步队列线程池解决上述问题
public class TestProcessData2 public static void main(String[] args) { ExecutorService pool=Executors.newCachedThreadPool(); final SynchronousQueue synchronousQueue=new SynchronousQueue(); final Semaphore semaphore=new Semaphore(1); for (int i = 0; i < 10; i++) { pool.execute(new Runnable() { @Override ...
1
8841376734c3a143bcabef3d62bb5a61
a8eab3aec393af4336d526f0f030afec
Обновляет информацию о массиве заметок.
[Route("api/notes")] [NotesExceptionFilter] public Note Put([FromBody] Note note) { _logger.Info("Запрос на обновление заметки с id: \"{0}\"", note.Id); return _notesRepository.Update(note); }
0
78e526fa8815d19a533661c53d2a3a70
d65bdac8149b2ed9b754321d6d9bf771
# Return the major version of the package
public function getMajorVersion();
1
6f0865dac461d882c89120aad8373e7d
7381bd52d7bf01a267613f1a00eb5bb2
Returns the options related with the indicated file format.
namespace SE.Halligang.CsXmpToolkit public class XmpFiles : IDisposable public static bool GetFormatInfo(FileFormat fileFormat, out FormatInfo handlerFlags) { return XMPFiles_GetFormatInfo(fileFormat, out handlerFlags); }
1
9bff178f6c288d697e94b7163dd7d996
4bd90ec367ab4cec630e4d486f4757d7
Counts the number of documents in the song_segmentation collection Returns
counting() { return this.connecting() .then(colDb => { return colDb.count() }) }
1
fe6720874abb8c4106db54041fc07422
97585800e2d9e2ed88f6439b705c0ba0
Groups slices into stacks with the same image orientation
class SlicerImage (ReconImage): def slicing(self): return [self.ax, self.cor, self.sag]
0
cb500fdc2d9cc8a01db0f33555801c75
5b8e0e15adab44e6b568862b85c2e1be
Deal a card from the stock to each column of the tableau.
public class Solitaire public void dealOneCard() { if (!stock.isEmpty()) waste.push(stock.pop()).turnUp(); }
0
27653d196a90de54b6a6397e75a83512
ea3056c4990e4cc540686191c337dae3
returns the number of jobs a specific client has had done
public class Manager public int numberJobClient(int user_id, int client_id) throws JobManagerException { return job.numberJobClient(user_id, client_id); }
1
a1f98ce21f7d550933b92cbe46a5fe41
3177beae68d97f3f54b9e6d3e58b05f4
Wrapper function to make sure lock causes no unexpected errors
void get_lock(void *lock) { int rc = pthread_mutex_lock((pthread_mutex_t*)lock); if (rc) { puts("trouble obtaining lock"); exit(3); } }
1
bea7b95730276cfa01b0a1b060901819
0847346a96c6c7ffcdccaf28989db176
Purpose: This function finds all of the methods of a class and organizes them into a dictionary with method names as keys and the methods themselves as values.
method = tables.Method.__table__ rtype = tables.Type.__table__.alias('rtype') joined = method.join(rtype, method.c.return_type == rtype.c.id) where = sql.and_(method.c.argcount == 0, rtype.c.name == ret_type) sel = sql.select([method.c.id, method.c.name, method.c.fqname, method....
0
cbd6b661c18c49a21120825783e92d72
6e4707c8b56c71d6b5f0800b8e40b37b
获取允许上传文件的类型
class UploadFile public function getAllowType() { return $this->allowType; }
1
1eee03ecd6933e6ff0c9d263e392791f
f5268610ffb000b7dbc69b79c9226d58
Get the distance between two angles
{ float n = Mathf.Abs( a - b ); if( n > 180 ) { n = 360 - n; } return n; }
1
8c17827693cd97fd1a02f536c8d8f947
8406f701040f8a2cc78075d19fb53d2f
Deletes the specified Issue Comment
class IssueController extends Controller public function destroy($id) { if($this->repository->delete($id)) { return response("Deleted!"); } else { return response("Something went wrong!", 500); } }
0