query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
1d6d6539c73dff1d7c8f17b8ea9c9394 | 11fd7250afca071e51fe27c52483134c | Display max execution time. | class SystemInfo extends Component
public function getMaxExecutionTime()
{
return ini_get('max_execution_time').' Seconds';
} | 1 |
c574c84c50fe41830aeb4215645b668b | a8b98892726e016793fc410dbc06edc9 | Indicar detención del Servicio. | namespace Monitor.Service
internal class ServiceHandler : ServiceBase
protected override void OnStop()
{
Builder.DetenerServicio();
} | 1 |
f3b76d248346f9b61971225f70712646 | 30579d3241d81855f96856efba29a7fc | https://stackoverflow.com/questions/21617970/how-to-check-if-value-has-even-parity-of-bits-or-odd | {
int parity = 0;
while(n_bits > 0) {
parity += value & 1;
value>>1;
n_bits--;
}
return (parity%2) == 0;
} | 1 |
521a94907e3146dbae7fa3e7d2dfccfb | 62eba9ebe2ef6ee81e64c2b3aa770102 | method to get the average Price Close for particular sector all the year | public java.lang.Double getPPNE(String symbol,int year) ; | 0 |
779664a2cd817daa356b8002ad57fbcf | 0ea4f3d98c27aeed06e47491038a6ae4 | ! \brief Adds a phenomenon to the list associated with this domain | class Phenomenon(Occurrent):
def __init__(self):
pass | 0 |
23affd4102a721d6f5e12459d398d5ea | 2f883676f8c28e27589a0bb0905d0439 | 逻辑回归分类器,梯度下降求解 | x = mat(X)
y = Y
m, n = shape(x)
loop_max = 1000000
epsil = 1e-4
error = np.zeros(n)
alpha = 0.002
lanmuda = exp(-1)
count = 0
np.random.seed(0)
theta = np.random.randn(n)
while count < loop_max:
count += 1
sum_m = np.zeros(n)
for i in range(m):
... | 1 |
6336adcd375435dc66e7d25530bab4f4 | 93bca140a56179697882ac279639f7cb | 过滤掉已使用过的C类券 | @Service
public class CouponService
public List<Coupon> getCanUseCouponByUserCoupon(UserCoupon userCoupon) {
List<Coupon> coupons = getCouponByUserCoupon(userCoupon);
if (userCoupon.getUserId() != null) {
Map<String, Integer> couponCodeCountMap = getCouponCodeUsedMapByUserId(userCoupon.getUserId());
for (Iter... | 1 |
bf97309be8c9ae139ac09736b22b0dd2 | b30812843866dd738ccd9ffc59e07434 | Check if any checkbox is checked, otherwise open message box. | if (tree == null){
return true;
}
Enumeration<?> e = ((DefaultMutableTreeNode) tree.getModel().getRoot()).preorderEnumeration();
while (e.hasMoreElements()){
DefaultMutableTreeNode node = (DefaultMutableTreeNode) e.nextElement();
Object obj = node.getUserObject();
if (obj instanceof TreeNodeCheckB... | 1 |
b33da66203b9dc438c4bb0fdb9ccc5ad | 982df052efdb08d3fedb7caaf78ef6d5 | Store level stats, to be restored if the level is later continued/reloaded after death | {
speed = PlayerPrefs.GetFloat("PlayerSpeed", speed);
PlayerPrefs.SetInt("PlayerHealth", health);
PlayerPrefs.SetInt("Level", level+1);
PlayerPrefs.SetInt("Points", points);
switch ((level+1)%5)
{
case 1:
PlayerPrefs.SetFloat("PlayerSpeed"... | 1 |
75342fcda2ead4cc057e07a620a80ab0 | 6f7585d53bc4b6701785edd492465d03 | Metoda, která spočítá obsah pruniku s jiným čtvercem | {
$vyskaKusuPlaste = sqrt((($this->strana / 2) ** 2) + ($this->vyska ** 2));
$obsahKusuPlaste = $this->strana * $vyskaKusuPlaste / 2;
return $obsahKusuPlaste * 4;
} | 0 |
2bb4a2472359bc423bb9b887b720deb4 | 56a3156fadebaf1c215395be5ae55c77 | Clears the set of player participants. | public class EventEntry extends Entry
public void clearParticipants() {
super.removeElement(Who.KEY);
} | 1 |
d7eeddc382bc2ebda6cf2b2a70abff51 | 4a925fb3f55e4ef90d6d0c32037e8846 | Returns the current API version (major.minor) | class MachII
function apiVersion()
{
return '1.0.10';
} | 1 |
9745cacc82d8e985d3153050402c5c06 | 2ec2aa221634e75bd0b0c5074eb9a184 | Apumetodi, joka laskee pelaajan tämän kierroksen pisteet pelilaudalle lisätyistä Kirjainlaatoista. | public class CorgiRace : PhysicsGame
public void LisaaPisteet(IntMeter pelaaja)
{
pelaaja.AddValue(+PISTEITAPALLOSTA);
} | 0 |
b536ddd2035bec1116f009cd330cd227 | 77eee43ad642ed6ab0f3f4f836e3442b | This function writes a tempolate based submit.sh file, which can be executed to run a namd simulation. | writer = open(direc+'submit_jobs.sh','a')
if writer.tell() == 0:
print >> writer, '#!/bin/bash'
print >> writer, ''
print >> writer, 'echo %s.sh' % (fname)
print >> writer, 'sbatch %s.aci.sh' % (fname)
writer.close() | 1 |
22f38f080c0973e3ef1102e83fe2646d | b6207ffc430b46b875c56f9b52d31d50 | 根据token设置密码,用于找回密码 | ResponseResult resetPassword(Integer userId, Integer tokenUserId); | 1 |
094e206502895c6fffbc14d645774b49 | 489439dc326d9987d48256d76389b466 | 删除运动员的报名 | public class LeaguerRecDetailActivity extends BaseActivity
private void delRecord() {
mLeaguerRecDetailVS.delLeaguerRec();
} | 1 |
69e3827c7809e511efa72a9e2d67a1ef | f4a002fdbb56e1f74f043b02ed72b6a2 | Delete a share bandwidth. | class ZFSSAShareDriver(driver.ShareDriver):
def delete_share(self, context, share, share_server=None):
LOG.debug("ZFSSAShareDriver.delete_share: id=%s", share['id'])
lcfg = self.configuration
self.zfssa.delete_share(lcfg.zfssa_pool,
lcfg.zfssa_project,
... | 0 |
dabbb178cc21d33b159199480b480631 | 979712e59adc117bdef12699730371b6 | Poistaa referenssi otsikon ja sen alla olevat referenssit tietokannasta | for (int i = refByList.Count - 1; i >= 0; i--)
if (refByList[i].referenceID == other.getID())
refByList.RemoveAt(i);
save();
} | 0 |
78cf134998de3f52b0c828d8d8f2fcea | b8dec6e078c8e3d520c2b34efc32f391 | Constructor with deep copy | this->size = orig.size;
this->error = orig.error;
this->tableClusters.reserve(this->size);
for (auto cl: orig.tableClusters)
this->tableClusters.emplace_back(new Cluster(*cl));
} | 1 |
94944cf22e7528d95b16c664ac898ed9 | 67202570ae96c101dfee7d91729e95ba | 返回包括头结点在内的链表长度 | class MyLinkList:
def result1(head_a):
p, count = head_a, 0
while p.next != head_a:
p = p.next
count += 1
return count | 0 |
13c64a9b05cf84bfddffee9f72bfc81b | 34096695934caaacffa78ed6195f6f96 | Method returning the URL of a concrete miner on remote mining server (from config) | namespace Nimiq
public class NimiqClient
public async Task<string> MinerAddress()
{
return await Call<string>("minerAddress");
} | 0 |
559bffc0af1ccb8667579275e49fc374 | 20f9609928038fd342dbe9e3542b1316 | Copy N bytes of SRC to DEST, guaranteeing<br>
correct behavior for overlapping strings.<br>
<i>native declaration : string.h:18</i> | {
char* ret = dest;
u32 u32Cnt = 0;
while ((*dest) &&
(u32Cnt < u32Size))
{
dest++;
u32Cnt++;
}
while ((*src) && (u32Cnt < (u32Size - 1)))
{
*dest++ = *src++;
u32Cnt++;
}
if (*dest)
{
*dest = '\0';
}
else
{
}
return ret;
} | 0 |
07904a854ad3810382662d1059a29bbd | 3b5bc4dc2a3e3e36db51923a26b1046d | Введення дробового числа з символами табуляції
Passed | {
do
{
String str = Console.ReadLine();
if (Double.TryParse(str, out double a) && str.Length != 0)
return a;
else
ColoredWriteLine("Введенное значение не является дробным числом!\nПопробуйте еще раз!"... | 0 |
da9a4ede961d9d57d931eaef524a522b | 0858d37213a9ba936935f9fed5099564 | [illumos]: https://illumos.org/man/2/pwrite | int pwrite(int __fd, Pointer __buf, NativeSize __n, long __offset); | 1 |
b53f2dae2cea7ec17e9b41b31868cc39 | da008e985425b0fab5c5c505a522f557 | Interpolate along a subset of dimensions.
This method interpolate the array object along some subset of it's
dimensions. The array is sliced long the uninterpolated dimensions. | class Function(Element):
def select(self, *dims):
return select(self, *dims) | 0 |
61c0d4c20167608ad15f00da1b2a347e | e151fa903c7540ab2b8db0a17d35e332 | Carrega uma view passando dados por parâmetro | class controller
public function loadViewInTemplate($viewName, $viewData = array()){
extract($viewData);
require 'views/'.$viewName.'.php';
} | 1 |
af443314f76735536743d482d66594b4 | b79ba3762bfa8f3a6b60761cd90512ab | Return the approximated cardinality of
the set(s) observed by the HyperLogLog at key(s). | RHyperLogLog<Object> hyperLogLog = redissonClient.getHyperLogLog(key);
long count = hyperLogLog.count();
return count;
} | 1 |
a3643d2c1ec0941a046d9da3310dbe57 | 8aa21660b70380ce283ee3b2e9a7059f | separate certain labels from the main dataset | def seperate(df, label):
df1 = df[df['preds'].isin([label])]
df2 = df[~df['preds'].isin([label])]
return (df1, df2) | 1 |
6d99459eb487a5cd8961b0e9e15e415a | 6c56c19d1426c1eabf2e6f069ea310a1 | Get the associated class of the given string or symbol | if self._str in self._mapping:
return self._mapping[self._str]
else:
raise ValueError(f"Factory {self.__class__.__name__} doesn't map "
f"{self._str} to a class.") | 1 |
2d6dc84b7278eaa88bb37f7d4596dde4 | 590c5da29bd739c2186f61d2818150d9 | 获取指定ip端口号的FTP连接 | FTPClient ftp = new FTPClient();
try {
if (ftpBean.getPort() == null) {
ftp.connect(ftpBean.getIpAddr(), 21);
} else {
ftp.connect(ftpBean.getIpAddr(), ftpBean.getPort());
}
ftp.login(ftpBean.getUserName(), ftpBean.getPwd())... | 1 |
febfa8e0b669bec72a8f407e709ae359 | cbb3db1ce58ce7b90d8cc799ce324fdf | collects spported and available filsystem modules, writes to vector v_fs_modules | regetmntinfo(struct statfs **mntbufp, long mntsize, char **vfslist)
{
int i, j;
struct statfs *mntbuf;
if (vfslist == NULL)
return (nflag ? mntsize : getmntinfo(mntbufp, MNT_WAIT));
mntbuf = *mntbufp;
for (j = 0, i = 0; i < mntsize; i++) {
if (checkvfsname(mntbuf[i].f_fstypename, vfslist))
continue;
if (!... | 0 |
762cf7dadb2ee30eec236b6546d42ec9 | 5cebf75d2e0eac7abdf49784b1eb0783 | 判断是否为资源; | class Resource extends egret.EventDispatcher{
public hasRes(key:string):boolean{
let type:string = this.resConfig.getType(key);
if(type==""){
let prefix:string = RES.AnalyzerBase.getStringTail(key);
type = this.resConfig.getType(prefix);
if(type=="... | 1 |
6cb71bb041082bd44f8bd8feaabc7db1 | 4240915f303cc6192c4b1acf02bd6e36 | DownloadFile 下载文件,带进度 | @SuppressLint("CheckResult")
fun fileDownLoad(activity: Activity, progressView: ProgressView, downLoadUrl: String) {
Observable
.create<Int> {
try {
val url = URL(downLoadUrl)
val urlConnection = url.openConnection() as Http... | 1 |
0ab7de2e69ec20990c7e5d285d374b00 | f89f03c303482501ca451347fea7d9dc | This fails. Static classes cannot implement an interface | public class AbstractClassWithFinal
public static void main(String[] args) {
} | 0 |
4e45ededaebfa16f1e067eef8fe4f284 | b4beff1138f1d676e146004bc0cb2dca | Get the value of the #PROGRAMDRIVE# variable. | def getProgramFiles64():
import os
if OS_is64bit():
return os.environ['PROGRAMW6432']
else:
return None | 0 |
5a2bf27010276f560f2f50e01cfa2910 | 27644a2822b918797ff2031c3d15d31d | function for printing types of card used in payment in enhanced analytics required format | getSfccCardType(cardType) {
if (!empty(cardType)) {
switch (cardType) {
case 'visa':
case 'visa_applepay':
cardType = 'Visa';
break;
case 'mc':
case 'mc_applepay':
cardType = 'Mastercard';
break;
case 'amex':
case 'amex_ap... | 1 |
b22cf9117a45cd1e8e6d74490b31bb90 | ef5e8ffbb569bb0f520fe279c68f33ec | Recursivley search for a key in bst with linked list for duplicates and
print the number of comparisons. Data for each found node is output to a
seperate output file | recursive_traverse_search(node_t *root, double *key_coordinate,
double *nearest_dist, node_t **nearest_node,
int *num_cmp, unsigned depth) {
if (root) {
*num_cmp += 1;
double *coordinates = ((record_t*)((root->data)->data))->coordinates;
dou... | 0 |
4797197d8c526d914ab430be2fcd2a20 | 4a66ee25b63436a47b6f051fd3bd3c77 | Removes the ith "creator" element | public void removeCreator(String creator) {
if (creators != null)
creators.remove(creator);
} | 0 |
02483b2192ea6a2eaec434b96ef37a1e | 1e0a456b4d9d7d45db2de990f16b39d2 | 得到动物单价 | function getMaterialPrice () {
return request({
method: 'GET',
url: '/clesun/api/v1.0/livestock/getMaterialPrice'
})
} | 1 |
473bb5adc8d1a4c0356c2db4505081c6 | 41d6c5227d06d153806e3bb3b4eca5ba | Return the ClipData associated with this Intent. If there is none,
returns null. See setClipData(ClipData) for more information. | public Builder setClip(@NonNull ClipData clip) {
mClip = clip;
return this;
} | 0 |
eaf988d56f07db3f22ee2b9c45032a53 | 7faf336f4172fc13c732c8843bcd7adf | A partir de Marshmallow (6.0) se pide aceptar o rechazar el permiso en tiempo de ejecución
En las versiones anteriores no es posible hacerlo
Una vez que se pide aceptar o rechazar el permiso se ejecuta el método "onRequestPermissionsResult" para manejar la respuesta
Si el usuario marca "No preguntar más" no se volverá ... | if (!PermissionUtils.isOverMarshmallow()) {
PermissionUtils.executeSucceedMethod(mObject, mRequestCode);
return;
}
List<String> deniedPermissions = PermissionUtils.getDeniedPermissions(mObject, mPermissions);
if (deniedPermissions.isEmpty()) {
Permissi... | 1 |
81857e2affdfc1c7829f3bac9eed3bfb | c576aafea11bc6405cee831e3575b333 | Gets the date/time that the push message was received.
Date/time that the push message was received. | public class SmsLogs extends BaseEntity<SmsLogs>
public Date getPushTime() {
return this.pushTime;
} | 1 |
708dff81d31618d95009ac84901f0ad3 | 6589f5ef10de90a4c29252c348d64b1c | Updates the users' securitygroup membership list | public class TenantServices
public static Map<String, Object> updateUserLoginToSecurityGroupForTenant(DispatchContext ctx, Map<String, Object> context) {
LocalDispatcher dispatcher = ctx.getDispatcher();
Locale locale = (Locale) context.get("locale");
TimeZone timeZone = (TimeZone) context.get("... | 1 |
fb02605d3e7ae23c768a2f23e53c893e | 9332688fa3cf7f2c772e24695279e64f | 数字以外の文字と空文字を0に変換 | val = val.replace(/\s+/g, '');
var num = val.replace(/[0-9]/g, function(s) {
return String.fromCharCode(s.charCodeAt(0) - 65248);
});
if( isNaN(num) ) {
num = '';
} else {
if( num > maxNum ) {
num = maxNum;
}
if( num < 0 ) {
num = 0;
}
num ... | 0 |
db5390e8a891d0ea9db38ce6306795c9 | f6c9ef08977ee84c533de2efd3b096af | This function ensures that only one task is calling nlradio API.
nlradio is not thread-safe and requires this check. | {
int retval = k_nlradio_error_fail;
check_single_task();
if (s_radio_state == k_nlradio_state_disabled)
{
nlradio_init_internal();
s_radio_state = k_nlradio_state_sleep;
retval = k_nlradio_error_none;
}
return retval;
} | 1 |
c772e49d731fcead448eb4bdadbf756a | f00bcefdb122ef3b320bedb8f590fc17 | 统计站点降雨信息 | function siteforecastdetails ({ stcd, startDate, endDate }) {
return axios.get(`water/rsvr/flood/v1/basin/siteforecastdetails/${stcd}/${startDate}/${endDate}`)
} | 0 |
effebcde8e6df3c1b569e1be55e557ce | ec3310636fe1afe2bcf80236158dd985 | Vyvolá událost pro získání kontextového menu | void contextMenuEvent(int value)
{
application->getController().contextMenuEvent(value);
} | 1 |
04743fef201d1673cb6325bbb6c5a221 | 917bbcffd5f2de928e2cbf737db11b45 | Even though the last command may have finished there could be more output on the way.
Child processes may still be running or may produce final output when killed. We flush the output when closing the session
and also when opening it.
<p>e.g.<p><code>
<br>"logged on to gordon-netbook session 1 PID 8324 sessionId 7
<br>... | public void close() throws IOException {
if (!closed) {
closed = true;
flush();
super.close();
}
} | 1 |
c77fa8f272a1a12896ce0bbe84f61c48 | 37c6135f4203c74ca5b7161e8763cb4f | Устанавливает статус и вероятность закрытия. | public function setClosed($isClosed); | 0 |
c702d6e41279e50ff4ab910a8a68e0d5 | 2a4830eda8457cc1d40232184a5d3726 | Delete Reroute record by id | public function deleteById($rmssendId); | 1 |
fb01d7ee9202ce135910b2e2d599af71 | b88f5285ce8d9adde108f73687b29c6a | ReadinessHandler responds to readiness check requests. | func ReadinessCheckHandler(w http.ResponseWriter, r *http.Request) {
if shouldProxy() {
w.Header().Set(xhttp.MinIOServerStatus, unavailable)
}
<-globalIAMSys.configLoaded
writeResponse(w, http.StatusOK, nil, mimeNone)
} | 1 |
b1e05a7258ec3209a6055fe656c3d428 | 9d38be30bdb84f27a454337d14561efd | Given a list of sentences, randomly selects pairs of sentences | sentgen = src.sentpair_generator.SentPairGenerator(data_dir='./data')
tok_roberta = AutoTokenizer.from_pretrained('roberta-base')
tok_bert = AutoTokenizer.from_pretrained('bert-base-uncased')
tok_xlnet = AutoTokenizer.from_pretrained('xlnet-base-cased')
def is_single_diff(toks1, toks2):
if len(toks1) != l... | 0 |
fde1024a44df1d2ae50ae2da9dfe8a64 | f7f14a02a3988b7c6110f3fbc82cec12 | Sets the invoice number for filtering billing cost report. | class CaptureRequest extends AbstractRequest
public function setInvoiceNumber($invoiceNumber)
{
return $this->setParameter('invoiceNumber', $invoiceNumber);
} | 1 |
63a01d15d8cf854367f9e070d32e3d44 | 1783d5998b2e7b745e5b5efa6a00fe55 | Test generating a mesh from a simple polygon. | int main()
{
vtkSmartPointer<vtkPoints> points = vtkSmartPointer<vtkPoints>::New();
points->InsertNextPoint( 0.0, 0.0, 0.0 );
points->InsertNextPoint( 1.0, 0.0, 0.0 );
points->InsertNextPoint( 1.0, 1.0, 0.0 );
points->InsertNextPoint( 0.0, 1.0, 0.0 );
vtkSmartPointer<vtkPolygon> polygon = vtkSmartPointer<vtkPolyg... | 0 |
fc8327c8051839f8d14b5becc606f975 | 27728d1e371f0e857f27b1296dfc2418 | 获取本代发 正在退款中的订单 | @CrossOrigin
@Controller
@RestController
@RequestMapping("/sellOrder")
public class SellOrderController{
@RequestMapping("/getRefundSellOrder")
@ResponseBody
public List<SellOrderGroup> getRefundSellOrder(){
return sellOrderService.getUnRefundOrder();
} | 1 |
b749a5c706ec8fc69c900aae68c6810c | b0130cb9c770e6580883f2048294d986 | Execute a OleDbCommand that returns the first column of the first record aginst then database specified in the connection string
using the provided parameters | namespace GB
public abstract class AccessbHelper
public static Jobject ExecuteScalar(string connectionString, CommandType cmdType, string cmdText, params OleDbParameter[] commandParameters)
{
OleDbCommand cmd = new OleDbCommand();
using (OleDbConnection connection = new OleDbConnecti... | 1 |
bdc6fc98f5c3edf8729366385db7e24b | 00e8e7cd8065e929d4ddd72d72ffd43e | # NPC-Optionen laden (Start) | function loadSelect() {
loadSelectOption('EDSelect0');
loadSelectOption('EDSelect1');
loadSelectOption('EDSelect2');
loadSelectOption('EDSelect3');
loadSelectOption('EDSelect4');
loadSelectOption('EDSelect5');
loadSelectOption('EDSelect6');
loadSelectOption('EDSelect7');
loadSelectOp... | 1 |
0724e96f58a9057ed7956814017459e3 | dc03b8bc78e1807d4d1fe7f82bad12d7 | Returns the HTML page to serve for the URL "/"" of the hub. | async def hub(request: Request, x_vouch_user: Optional[str] = Header(None)):
hub_answers = {"request": request, "title": "Hub", "user": x_vouch_user}
return templates.TemplateResponse("hub.html", hub_answers) | 1 |
ba85cfdae4c450acb80780dc40bc0da7 | fc97c3d571b76a17fe191eef7a7b548a | Get the character set that is currently used from the environment variable | public String getCharacterSet(); | 0 |
d379673043544462b83cb931ee68fc4c | 70eba07dccd214199da62f859302b6be | Perform all the batch writes and deletes and empty the lists. | class BatchTable(object):
def __exit__(self, type, value, traceback):
if self._to_put or self._to_delete:
self.flush() | 1 |
28f705130256f4dca600e08422d97e9b | 4f38004f43183bdd42b40e6d7e387981 | Whether this state have the specified button in the callback doubly pressed. | bool Touch_DetectDoublePress(Button_EnumTypeDef Btn)
{
return Button.Button[Btn].DoublePressFlag;
} | 1 |
cc22981ac0c08484a31f80df8a48aa98 | b03dcd771e7fd65c33c4c7e5f276c6fa | Updates json property/element with specified value, | namespace FlubuCore.Tasks.Text
public class UpdateJsonFileTask : TaskBase<int, UpdateJsonFileTask>
public UpdateJsonFileTask Update(string path, string value)
{
_updates.Add(path, new JValue(value));
return this;
} | 1 |
88bcdc8c942ff91060da0c1979217107 | 14872b3a7196730b999d858347a80b87 | TestUpdate tests updating PeerConfig | dpd = {'action': 'hold',
'interval': 40,
'timeout': 120}
self._test_update_ipsec_site_connection(update={'dpd': dpd})
self._test_update_ipsec_site_connection(update={'mtu': 2000})
ipv6_settings = {
'peer_address': 'fe80::c0a8:10a',
'p... | 1 |
5baae96da5ef3c034b505b70852b3239 | 01be39ece2adb143d0ba360085700774 | Get the schema config for the given class name | public function getMetadataFor(string $className); | 1 |
a00fdc8080844cf403e88ba1913ba2d1 | 3606cd77b94b0d86cfa21ea30123f3b2 | This method creates a new window for normal mode sudoku. | final DancingLinksSudoku mainProgram = getProgram();
setOptions();
setVisible(false);
dispose();
Options.getInstance().setCreateAction(Options.CreateAction.GENERATE);
mainProgram.setPuzzleModel(new StandardSudoku());
mainProgram.getPuzz... | 0 |
4ca927b6849a3beff2983e1e0cf8126c | b9afff0dae8d0edf3051ab670bbe45a4 | A replica of Python's built-in split method | def split(s, d=None):
if s:
return s.split(d)
return [] | 1 |
ba56dc9fe62df94265d17e1d3b565dd0 | 1bd67f046900b92c34e0e3be7bca17af | 返回值:含有Huffman树的链表,非叶节点将插入到链表前面,并有左右孩子属性,叶节点没有左右孩子属性 | {
HuffmanList bp = (HuffmanListNode *)malloc(sizeof(HuffmanListNode));
bp->weight = 0;
bp->data = 0;
bp->next = NULL;
bp->pre = NULL;
bp->treeNode = NULL;
int i = 0;
for (i=0; i<count; i++) {
HuffmanListNode *np = (HuffmanListNode *)malloc(sizeof(HuffmanListNode));
if (np... | 0 |
c7ad86610645dca7082a5e159aa12faf | fc5c75fb199dcd78dfdcf4dd166d79f1 | 处理接收到的PONG消息,更新在线用户状态 | self.set_user_online(message,online = True)
content = {}
content['conected'] = self.get_users_online()
self.send(content)
pass | 0 |
78caafe520718618c08c3a838fc1cbaf | a92e1c46f1f0489b2c8da94a0cac2ebf | 缓存更新前的属性 | class Redis_Cache extends Redis_Class
function before_update_one($defined_vars)
{
$this->redis_cache_log("call before_update_one:",$defined_vars);
$this->remove_cache($defined_vars);
} | 1 |
cd8d6907388abd1046f4d6aef5210f7c | 8651b507272f28a0609346b4abb6581d | Removes all out-channels from the table, which are vacant (not connected to
any client). Also the channel-cipher is deleted. | int size = mapCiphers.size();
if (size < 1) {
return;
}
ArrayList<SocketHost> array = new ArrayList<SocketHost>(size);
super.lockMulti();
try {
Iterator<Map.Entry<SocketHost, Cipher>> iterator = mapCiphers.entrySet().iterator();
while (iterator.hasNext()) {
Map.Entry<SocketHost, Cipher> entry =... | 0 |
409e1512ee721e44c8f7755e12cebbed | a25105842130f73ac8c5f91a0045df72 | Create a new rend_data_t for a specific given <b>version</b>.
Return a pointer to the newly allocated data structure. | {
rdata_string_t *string_v;
string_v = calloc(1, sizeof(rdata_string_t));
if (string_v == NULL) {
printf("Memory allocation failed.\n");
exit(1);
}
return string_v;
} | 0 |
2b2dcabc11fd2f48a8b487e1e7e540c6 | 125a50aca16e78fde2debd35a3f2c1f4 | Basic slicing with a list. | class Py2Codes(ExecInterpreter):
def slice__3(self):
tos = self.stack.pop()
tos1 = self.stack.pop()
self.stack[-1] = self.stack[-1][tos1:tos] | 1 |
cdbf82575e3776f47c3694838cb2002a | 32e16cc0ac5efef483e38fcf440ce2e8 | Add an identity to the agent | async addIdentity({ commit }, payload) {
var res = await addIdent(payload)
return res
} | 1 |
bc70e2690fe6b2dd5fd86179f91246e7 | f1acbf8155c94aa9273b6c7859b18508 | Calculates contextual loudness features of a syllable
by taking difference to left or right neighbouring syllable
if there is no neighbour as it is first or last syllable,
average of all syllables of word is taking as neighbour value | if len(neighbourS1) == 3 and len(neighbourS1[0]) == 3:
temp = np.sum(neighbourS1) - neighbourS1[1][1]
if s2 == 1:
cx = 16
elif s2 == 0 and temp >= 1:
cx = 15
else:
cx = 14
else:
cx = -1
return cx | 0 |
60db1b2fd1fe6f7b8e04178f510c9359 | feb7d1bd73110a73efc28775728478cc | squareRepresentation returns a printable representation of a square. | func squareRepresentation(rank int, file int, p Piece) string {
var sb strings.Builder
var s []string
var c Color
if isWhiteSquare(rank, file) {
c = White
} else {
c = Black
}
if c == White {
s = []string{color.White("["), p.Unicode(), color.White("]")}
} else {
s = []string{color.Black("["), p.Unicode(... | 1 |
86d3ad94b79a3a32d7692506c46a30e6 | c03ea2ff5ed5f5a4b33622dfa677f4e0 | Processes the delete online extra service information. | [CheckUserLogin()]
public ActionResult DeleteOnlinePlatform(int onlinePlatformId)
{
if (onlinePlatformId <= 0)
{
throw new ArgumentOutOfRangeException(nameof(onlinePlatformId));
}
var onlinePlatformModel = this.onlineServices.GetSel... | 0 |
b5b19ae561ad402fba6591febb424dbe | b6297cc1e8e222e2cd7def1059d7f326 | @brief Affichage du menu admin -> config | {
$content = '';
Acid::set('admin_title', Acid::trad('admin_menu_config'));
$GLOBALS['acid']['tinymce']['all'] = false;
$content .= Acid::mod('SiteConfig')->printAdminInterface();
Conf::addToContent($content);
} | 1 |
19030b8f85027de4e2dccb73bd19f829 | 3f982a78df474f6b15eb27074b182c84 | Constrained Loss of Periodic Boundary Conditions | def CQ_P1(u,L,k):
u_x = der_fft(u,L,k,1)
ccu_x = np.conj(u_x)
return -1/(L)*trapezoid(np.imag(u*ccu_x),L) | 0 |
16afb8aa783614b037bc1b0887dce4d1 | c8220f3c91f6bf6706a700d2ab71eacc | Make requests with incorrect (not what is expected) json to all endpoints. | responses.add(
responses.POST,
"http://example.com/cardpayments/v1/accounts/0123456789/auths/",
json=UNKNOWN_EXCEPTION,
status=400
)
responses.add(
responses.POST,
"http://example.com/customervault/v1/profiles/123/cards/",
... | 1 |
c71a9e9fd2265af35254e4ed7b32ccf6 | d9ab82df37a2bd9c1006587625d66d7d | 返回指定日期的月份的第一天 | @Deprecated
public class DateUtils
public static Date getMonthFirstDate(Date date) {
Calendar cal = Calendar.getInstance();
cal.setTime(date);
int minDate = cal.getActualMinimum(Calendar.DATE);
cal.set(Calendar.DAY_OF_MONTH, minDate);
cal.set(Calendar.HOUR_OF_DAY, 0);
cal... | 1 |
2e2d19003154d11c66a3c49599cb9c4e | b63b6ee472f50b8ece6c65c2edc8e092 | our ValueIn16Bit = Volt_in / Vref+ * 1024, if we set Vref+ to b3 3.3 | {
int countOfBits = 15;
unsigned int binResult = 0;
P1 = 0x0FA;
CS_SHDN = 1;
CLK = 1;
delay();
CS_SHDN=0;
do
{
CLK=0;
delay();
CLK=1;
binResult = binResult<<1;
binResult |= DOUT;
countOfBits--;
} while ( countOfBits>0);
CS_SHDN=... | 0 |
49afe2d563387aa8f0aa9140c5e57f4a | 16c356e72be2a36283740fe691681097 | Set the Macintosh type and creator of the given file. | public class PdfLayer extends PdfObjectWrapper<PdfDictionary> implements IPdfOCG
public void setCreatorInfo(String creator, String subtype) {
PdfDictionary usage = getUsage();
PdfDictionary dic = new PdfDictionary();
dic.put(PdfName.Creator, new PdfString(creator, PdfEncodings.UNICODE_BIG));
... | 0 |
345592f24f6f20c7643f9953627f9e42 | 3e3f9455da2e928012948860caf867d6 | Sets the alert model. | {
if (Alerts == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "Alerts");
}
} | 0 |
0833da427965733853000ffdfc2fa2f6 | e40ee98cb63853dcf0c18d117d572d11 | Returns the percentage of the range max-min that corresponds to value. | {
if (max - min == 0) return 0.0;
return (Clamp(val, min, max) - min) / (max - min);
} | 1 |
e0f75149d6802e2d51574e911caa951e | 9920346d23e0624529ce9fe96b95aff5 | Move gun based on delta rotator between current gun position and aiming position | {
Quaternion lookRotation = Quaternion.LookRotation((targetEnemy.transform.position + new Vector3(0, enemyHeight, 0) - barrelLocation).normalized);
gunBarrel.transform.rotation = Quaternion.RotateTowards(gunBarrel.transform.rotation, lookRotation, rotationSpeed * Time.deltaTime);
} | 1 |
17d072a302fb005173ddf69a43edfb32 | f04fca3a64d3973cfce48ebd8c865dc6 | Get a GraphQL type instance from dock block return type. | peewee_type = get_peewee_type(info.return_type)
if peewee_type:
field_ast = info.field_asts[0]
args = field_ast.arguments
base_query = (
peewee_type.select()
if isinstance(info.return_type, GraphQLList)
else peewee_type.get()
)
return b... | 0 |
27700e9279e78036bc76d210dd6a7c9f | e5088450b278f6711ddadf00e7042eff | 列表倒序, join成一个字符串, 转int相加, 拆分为列表,倒序返回 | class Tools:
def listToInt(intList: list) -> int:
a = [i * 10 ** index for index, i in enumerate(intList[::-1])]
b = sum(a)
return b | 0 |
93275eb4bbd2608dc36cdc893fae4106 | 1fc7869610318d079d2a03628ca815b8 | 判断一个节点是否在文档内 | function isContains(node: Node, otherNode: Node) {
if (node.nodeType === 3) {
return node.nodeValue === otherNode.nodeValue
}
return node.contains(otherNode)
} | 0 |
22d1180acddac033b7f0938457e6246f | fa189d7d8629e689ef8617f15d645748 | Given how much data was written (in bytes), and how much time has
passed (in seconds), calculates the rate, and returns a
human-readable string | def timeSince(since, percent):
now = time.time()
s = now - since
es = s / percent
rs = es - s
return '%s (- %s)' % (asMinutes(s), asMinutes(rs)) | 0 |
9e62059b3a27930603ef73cf895e6f0f | 6e600bc704ca42826698b12802c22c6d | Sets visibility of grass in the simulation on or off. | public class VisualPreferences extends BaseComponent
public boolean showGround() {
return _attShowGround.getBooleanValue();
} | 0 |
945e0b86077ae65847c57d40500a2132 | 5f277e825428a45edebf9f392d0e4577 | Prepare and send TDLS setup request | void SCFCall::SendSetup (void)
{
TRACE_OUT(("SCFCall::SendSetup"));
LPBYTE packet_address;
ULONG bytes_accepted;
USHORT total_length;
PMemory memory;
total_length = SETUP_PACKET_SIZE + Lower_Layer_Prepend +
Lower_Layer_Append;
memory = Data_Request_Memory_M... | 0 |
e71b6708cdba6228b350cece2561ca53 | 6ad10aaf71e9ae2a5b04996fb3dabd3c | This method computes the predictions for a given test input dataset and then writes them in a text file | class Pipeline:
# set of evaluation metrics
def write_prediction(self, verbose = True):
if verbose:
print("computing predictions...")
test_input = self.get_preprocessed_data("test_input")
predicted_labels = self.model.predict(test_input)
self.preprocessor.data_writer(pre... | 1 |
a47545de73a2b504608cae8bef71abd4 | d73cc72be6f66227fd18ace70266ad41 | Convenience method to get root database reference. | function idb() {
return DB::getFacadeRoot();
} | 1 |
9d6e168fca5caafb2c556f017c50705b | 4e18791a03c4ae06dfd659a6f2562e8a | This method is to empty BTOS configuration. Usually this method is used for complete reconstruction from scratch. | public void resetConfiguration(); | 1 |
403d7b5f8da5b4fd5a12a3e05b86c871 | 14c555d999ea67b5ea749d064fd59b91 | Returns the name of the slave it was built on, or null if it was the master. | namespace CSRedis
public partial class CSRedisClient : IDisposable
public partial class NodeServerManagerProvider
public string SlaveOfNoOne() => _csredis.GetAndExecute(_pool, c => c.Value.SlaveOfNoOne()); | 0 |
cf2e10eede46d1e9f077dcc2ec016ef9 | 6a0944f7edd0e24d2d436b1d5f5cdea1 | Complex normalized Voigt line shape | if model_type == 'gauss':
return Gaussian1D(vars0[0], vars0[1], vars0[2])(wl) + vars0[3]
else:
f_G = 2.355 * vars0[3]
f_L = 2 * vars0[2]
return Voigt1D(vars0[1], vars0[0], f_G, f_L)(wl) + vars0[4] | 1 |
6012ec03b0f7f1901c1523117549dd15 | ac7ebe21e4d919b190af2b07be64e571 | Checks if the interact button is pressed while the player is focused on the hotbar. | namespace Valve.VR.InteractionSystem.Sample
public class Hose : MonoBehaviour
private bool FireMouseButtonIsPressed()
{
return Input.GetMouseButton((int)fireMouseButton);
} | 0 |
cea6b53e1b6e1a8a2e3552ab18bd17e3 | b9548bb141794087c7c2e6a178378b90 | FUNCTION
Function Name : DSPI_DRV_MasterTransferBlocking
Description : Perform a blocking SPI master mode transfer.
This function simultaneously sends and receives data on the SPI bus, as SPI is naturally
a full-duplex bus. The function will not return until the transfer is complete.
END | const void *txBuffer,
void *rxBuffer,
int count,
SPIDRV_Callback_t callback,
int timeoutMs )
{
Ecode_t retVal;
if ( handle->initData.type == spidrvMaster )
{
return ECODE_EMDRV_SPI... | 0 |
c5b29f169293f1ca72365c9bdc23cb4d | f1bd035c110e3e83df73f73437a36817 | Prints the bst to view the tree | class BST:
def printBST(self):
self._printBST(self.root) | 1 |
6555f2912b5347103ebcbf1d3e6a58a6 | bfe16dc407f1eca7fc331934a1fee12f | Удаляет сущность из списков сущностей с заданными тэгами, если она
там была. | self, object_type: ObjectTypes, object_id: int
) -> FlaskResponse:
tag_names = request.get_json(force=True)
if not tag_names:
return Response(status=403)
db.session.query(TaggedObject).filter(
and_(
TaggedObject.object_type == object_type,
... | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.