query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
4f8f6a68975bfd497d3ab17dd7afc709 | 76be099abc96ea43ec128472160c2c9b | Get the width column index | uint32_t getColIndex() {
return ((nextPixelIndex % actualWidth) + actualLeft);
} | 1 |
9c85325740220e0967548696f6b40b18 | f7d128a7945ec976841b001fe8c36695 | builds a hash with the environment | class BaseTask(Task):
def build_env(self, instance, **kwargs):
env = dict(os.environ.items())
for attr in dir(settings):
if attr == attr.upper() and attr.startswith('ANSIBLE_'):
env[attr] = str(getattr(settings, attr))
return env | 1 |
6bd5b343893bdc1273faacfddd6ac046 | d7328d088efde1ba0f58fc535d0c3b2f | Sets the {@code ondragstart} event handler. | context: CoroutineContext = Dispatchers.JavaFx,
action: suspend CoroutineScope.(DragEvent) -> Unit
): Unit = setOnDragEntered { event -> GlobalScope.launch(context) { action(event) } } | 0 |
cec553ed1bb015084fa765bac0537136 | c8d8815fd7dbfd94a33da2b630eb318d | Get HealthCheck timestamp. | public class ModifyTCPListenerAttributeRequest extends AbstractModel{
public Long getHealthCheck() {
return this.HealthCheck;
} | 0 |
4e8578cf0b7992a4966f4952ab7b94cb | 0df1850f6fecd4842c4ae29d2aac3402 | Create an unsealed Configuration object from a Properties | public class ConfigurationFactory implements IConfigurationFactory
@Override
public IConfiguration createConfigurationFromArgs(String[] arrayArgs,
List<String> unconsumedArgs) throws ConfigurationException {
return createConfigurationFromArgs(arrayArgs, unconsumedArgs, null);
} | 0 |
27024ff9bfc715cc016bc7d7a9275d45 | 1ab2d4e6cc8e1789fd9db355ab7cf86e | \internal
\brief Common EIC line interrupt handler
The optional callback used by the interrupt handler is set by the
eic_line_set_callback() function. | void PIOS_I2C_internal_ev_irq_handler(void)
{
PIOS_I2C_EV_IRQ_Handler(pios_i2c_internal_id);
} | 0 |
62adde66bec9653878a66fe3a8b08673 | a948e2a62ff106e8c1b851b2c6ab0364 | leetCode第3题
获取字符串的最长子串,且子串中不含重复的字符 | String s2 = "aab";
String s3 = " ";
String s = "pwwdewndiewkew";
String s1 = "pwwkew";
leetcode3 l = new leetcode3();
int i2 = l.lengthOfLongestSubstring(s2);
int i3 = l.lengthOfLongestSubstring(s3);
System.out.println(i2+"====="+i3);
} | 1 |
f32fe5384bb88f40bcd347d0b7e9010d | 897882b1f0535f59dff55ae332cc719e | Initialize UART0 with receive interrupt | extern void UART0IntInit(void)
{
HWREGBITW(UART0_IM_R,4) = 1;
HWREG(NVIC_EN0_R) = (1 << 5);
CPUcpsie();
} | 1 |
840afffc24843eaedb07f39bf5e4ab22 | ec7595b373a4f7d42ad3a1c06a3b32e9 | Calculate the energy factor. | e = -1.0
self.calc.results = {
"energy": e,
"forces": np.array([[0.0, 0.0, 0.0]] * len(self)),
}
return e | 0 |
73acff84c99edeccd674537d6286db52 | 5e7081523dae24c5e4df52742578e4af | The SG-specific error type.
Understands that `ENO` is a common prefix for standard errors, like `ENOENT`. | Exception.__init__(self, *args)
if len(args) == 2:
self.errno = args[0]
self.strerror = args[1] | 0 |
61abed34cf5e97b4845d85d3ad246060 | 2f37f2170fb80989c3186e77112635ac | Verifies that diagnostics will be reported for all invalid object initializer definitions. | public void TestNoDiagnostics()
{
var test = string.Empty;
VerifyCSharpDiagnostic(test);
} | 0 |
d50824803129d3ebf9fd1c3ecc814adb | 9c328911af748514075bc79784216f13 | '''根据给出的文字,生成诗句''' | token_ids, segment_ids = tokenizer.encode('')
token_ids = token_ids[:-1]
segment_ids = segment_ids[:-1]
punctuations = [',', '。']
punctuation_ids = {tokenizer.token_to_id(token) for token in punctuations}
poetry = []
for ch in head:
poetry.append(ch)
token_id = tokenizer.toke... | 1 |
2d2e877e08bb20f1a412966834d4aeaf | e370c0aa2e9468a492963fe69956cadd | 返回最大值,和第二值 | public class Main<E>
public static void findSecondMax () {
Integer firstMax = 0;
Integer secondMax = 0;
Array<Integer> array = new Array<>();
for (int i = 0; i < 20; i++) {
array.addLast((int) ((Math.random() * 9 + 1) * 100000));
... | 1 |
25dc1a7da83efb9031f891669b473a08 | 4c55d284c260787504bed5f8463a1994 | Создаём игру, и подписываемся на её события | function init() {
prepareGameField();
document.getElementById("snake_start").addEventListener("click", startGame);
document.getElementById("snake_renew").addEventListener("click", renewGame);
addEventListener("keydown", changeSnakeDirection);
} | 1 |
a62bf1611a9010b14ab7084aa2274d93 | f0e9f2c2718042c4b3b34ce4a6f5a442 | 设置发表该评论的用户的出生日期 | @Table(name = "panoramic_user")
public class PanoramicUser
public void setBirthday(Date birthday) {
this.birthday = birthday;
} | 1 |
8536e6d5d90b9cccd9ac79b29f7380e4 | 47e76b7672d8397c0c850bda41da262a | Clamps a 2d vector to these bounds. | {
vec.x = Mathf.Clamp(vec.x, xMin, xMax);
vec.y = Mathf.Clamp(vec.y, yMin, yMax);
vec.z = Mathf.Clamp(vec.z, zMin, zMax);
} | 0 |
c950e4002cec547bb20651d6f6254c78 | 51526c63889c89620ba1ca5393418224 | Generates the Revision component of a revnumber to be used in a Revision_History.xml
file using the Book Version, Edition and Pubsnumber values from a content
specification. | public class InstantCreditCustomerBean extends ValidatingBean
public String getRevisionNumber()
{
return(Util.parseRevisionNumber(revisionNumber));
} | 0 |
15f7e932021e120bdf761aa34d4c734a | ecf26aab332e4bf4cbffa7cf4f4b5e4b | The number of times a health check must pass for a backend Droplet to be marked "healthy" and be re-added to the pool. If not specified, the default value is `5`. | class HttpHealthCheck(pulumi.CustomResource):
def unhealthy_threshold(self) -> pulumi.Output[Optional[int]]:
return pulumi.get(self, "unhealthy_threshold") | 0 |
04dab5e639e485698d8717637baa6822 | 237920f222b04d901620608adcf60407 | Terminates the error processor thread. | public abstract class AbstractProcessorThread extends Thread
public void shutdown () {
this.alive = false;
} | 1 |
b825fbf8704680b652a01bbfc07d7cb6 | 6c7d60e7a6ae8f28d434a9104ea5047b | metodo per inviare un file attraverso una socket | public class Experimenter extends RoboticsAPIApplication
private void filesend(String filename) {
Socket socket = null;
ObjectOutputStream outputStream = null;
boolean isConnected = false;
String sourceFilePath = "C:/KRC/Roboter/Log/DataRecorder/"+ filename;
FileEvent fileEvent = null;
Str... | 1 |
72c5107c949901caba0b810942f7e7c9 | a993a0f1f08d3b66350047dfd0df63b2 | Call this method when a player finishes a multiplayer game. This will report the result of the game
to the Skillz server, and return the player to the Skillz portal. | {
WorldServerRpcLogoutGameServerReply v = new WorldServerRpcLogoutGameServerReply();
v.Result = m_Result;
return v;
} | 0 |
77a6e45680174625bcb9dc6672571f2a | 67543b8850b127bfb2becc244e4648f5 | Perform a module-specific refresh operation. The typical/intended use to to
synchronize registers that may be altered by the FPGA (i.e. shadow copies are
stale). For TLO common carrier derived modules, this typically executes
CommonReg.Command.Field( CommandBF.CmdAbort ).Write( 1 ); | public class CANbusModule
native void jni_refresh(long addr); | 1 |
12c387075c35e40ed872b9e50a94c327 | 8aecc088328c4f9304ad8865af5aee8f | 根据基地id查询管理员列表 | class MessageModel extends Model
public function getAdminList($bid)
{
return $this->_boardAdmin->where('bid='.$bid)->select();
} | 1 |
0f7a7aae1e26146cd6d6c142dfb14bae | 85483db7e72201fe32d840faa0f1af7b | Tells if the given type is within the Java sources being compiled. | public class PhysicalPath
public boolean isSource() {
return logicalPath.getPath().isJavaSource();
} | 1 |
7a9c568177e36db699c9ba305cd61448 | 0e74f8cc1ccea1719ce331fff0f1b915 | The string to insert into the Dockerfile. | class ContainerRecipe(pulumi.CustomResource):
def dockerfile_template_data(self) -> pulumi.Output[str]:
return pulumi.get(self, "dockerfile_template_data") | 1 |
37eea00f1df1fdc9019a230af6419888 | 4c7ebcbbe6df13e75aedd4c5c033c78e | Make a paned window. | clip_GTK_PANEDPACK2(ClipMachine * ClipMachineMemory)
{
C_widget *cpan = _fetch_cw_arg(ClipMachineMemory);
C_widget *cwid = _fetch_cwidget(ClipMachineMemory, _clip_spar(ClipMachineMemory, 2));
gboolean resize = _clip_parl(ClipMachineMemory, 3);
gboolean shrink = _clip_parl(ClipMachineMemory, 4);
CHECKCW... | 0 |
8d0119b9dfbb17ca6fc42b713f9282ed | 600f74459fd5a689ef60442f94af1729 | Remove the host from the group model. | class ProxyGroup(object):
def delHost(self, name):
del self.hosts[name] | 1 |
5ada7a4a118fd39605e3073d52ba4705 | 0982e899f37d8352d3f442710d51178c | Sets the color of the placeholder. | namespace ReactNative.Views.TextInput
public class PlaceholderAdorner : Adorner
public static void SetTextColor(Control adornedElement, Brush placeholderTextColor)
{
if (adornedElement == null)
{
throw new ArgumentNullException(nameof(adornedElement));
}
... | 1 |
69dc40f6ae39f791099ddce9c971c7ab | 164b5cc83b666095b14b93735dbe1e6b | 画像の一部分におけるDifferenceHashを取得する
座標・大きさは画像に対する%指定なことに注意 | {
Bitmap NewBitmap = new Bitmap(OriginalImage.Width, OriginalImage.Height);
BitmapData NewData = Image.LockImage(NewBitmap);
BitmapData OldData = Image.LockImage(OriginalImage);
int NewPixelSize = Image.GetPixelSize(NewData);
int Ol... | 0 |
0823a53a5bd4b6649915c942e1cf15ae | fc8460a7d4df92a82a50368758f3cc03 | ValidateStruct validating struct based on their field tags. | func ValidateStruct(str interface{}) (err error) {
if G_Validate == nil {
if err = InitValidate(); err != nil {
return err
}
}
if err = Validate().Struct(str); err != nil {
return err
}
return nil
} | 1 |
69fa59384bf440456a6f4dd09348d247 | 758d6d6b0cb7076686b292d500ed69ed | Gets the registered candidates iterator. | public Iterator<Candidate> getCandidatesIterator(); | 1 |
6183f075a44af76bfed5be5ad618ad52 | b70a03f8cfd02fc121b8a1c995bf1dea | ЧТЕНИЕ ЗНАЧЕНИЯ ИЗ РЕГИСТРА | void getRegValue(HKEY hkey, LPCSTR lpSubKey, LPCSTR lpValue, DWORD& pvData)
{
DWORD pcbData = sizeof(DWORD);
LONG resGet = RegGetValue(hkey, lpSubKey, lpValue, RRF_RT_ANY, NULL,
(PVOID)&pvData, &pcbData);
if (resGet != ERROR_SUCCESS)
{
pvData = INT_MAX;
}
} | 1 |
d070a604d048024988de10423aee339a | abc7b47bce74ef807b73ee66edb98a0c | Use a relatively low heap size since nothing the worker does should require much memory. | public class CassandraTaskExecutor public static class Builder
public Builder setHeapMb(int heapMb) {
this.heapMb = heapMb;
return this;
} | 1 |
6c54d6ab454aae6fc91d0c7980e7bfca | 8159186e60848b8e934008e5bff94694 | 使用模型检测运动区域,并对检测的区域去噪、连接 | class MotionDetector:
def detect(self, frame):
p_frame = self.__preprocess(frame )
self.__mask = self.__fgbg.apply(p_frame )
_, self.__mask = cv.threshold(self.__mask, 25, 255, cv.THRESH_BINARY )
self.__mask = cv.dilate(self.__mask, None, iterations=2 )
_, contours, _ = cv.findCo... | 1 |
9208cc13dde5a7f07741acfe88073056 | 68250c9b9155ee831caf2d9a1705f8e6 | given a team, find their draft captain | static struct player *inl_draft_team_to_captain(int p_team)
{
int h;
struct player *j;
for (h = 0, j = &players[0]; h < MAXPLAYER; h++, j++) {
if (inl_draft_ignore(j)) continue;
if (!j->p_inl_captain) continue;
if (j->p_team != p_team) continue;
if (j->p_inl_draft == INL_DRAFT_CAPTAIN_UP ||
... | 1 |
b98afe9fba4b64b4a10db8c2336e2eb8 | c4c8179558bcb97162b39a7c195275b0 | Get all directives for the currently active state | class HugAPI(object):
def directives(self):
directive_sources = chain(hug.defaults.directives.items(), getattr(self, '_directives', {}).items())
return {'hug_' + directive_name: directive for directive_name, directive in directive_sources} | 1 |
c39db1280e0824329aa0435f19dfc11d | 52265f7cd6e7dd76d338d74d9854284f | 将dic中的内容保存在Filename.xlsx中 | def save_dic(dic):
fp = open("dictionaries.txt",'w')
number = len(dic)
num = int(1)
bar()
print("一共有"+str(number)+"个单词,如下所示:\n\n")
for key,value in dic.items():
words = key + ":" + value + "\n"
word = str(num) + ": " + key + ":" + value
print(str(word))
fp.write(str(words))
num += 1
fp.close()
print... | 0 |
e9e65b5e53cd3d7b0133505945076060 | b854833d2641d38fb11f75f4148335f7 | 将A[lo, hi)随机打乱 | validateNotNull(a);
validateSubarrayIndices(lo, hi, a.length);
for (int i = lo; i < hi; i++) {
int r = i + uniform(hi - i);
Object temp = a[i];
a[i] = a[r];
a[r] = temp;
}
} | 1 |
f4da1fe188c0d47cc556d73ac885e536 | bd7b73f1ddce96e11e9f3de0c734abf5 | Accessor to get the save icon | public class SaveAsScreen extends Screen
public ButtonComponent getSaveButton() {
return saveButton;
} | 0 |
be89467e269d1d4d4099f377446e1f06 | 27616cc15df1aaf7e97ef7a5580f3280 | Gets the projection criteria. | public abstract class DependencyObject
public ProjectionRule getProjRule() {
return projRule;
} | 1 |
35d74975c48b43ddfe5c4e3cd8459571 | c64c1243b7918ff0792ef7d651f316f7 | Determine the powerup associated with the given index | {
$level = self::getLevel($cpMultiplier);
if ($level <= 13 && $powerups <= 20) {
return 1;
}
if ($level <= 21 && $powerups <= 36) {
return 2;
}
if ($level <= 31 && $powerups <= 60) {
return 3;
}
return 4;
} | 0 |
b886572b0c52ba78a55423cecf64ff7b | 2c11cf9f441e2763e98ff426f6273ad8 | Prints letter L | public class BigHello
public static void letterA() {
System.out.println (" AAAA");
System.out.println (" AA AA");
System.out.println (" AAAAAA");
System.out.println ("AA AA");
System.out.println ("AA AA");
} | 0 |
e7fcb0df4a3c29d3c45d5389d3814bc0 | 98787fe341efb8f608f14f0545f66ab1 | Set up matrix for rotation around Y axis. | {
Matrix3 rmat;
rmat[2][1] = a_Y;
rmat[2][2] = 1.f;
return rmat;
} | 0 |
235f73334dfa20fe5de97a90349df0c8 | 6101028f2462d66bff95ab6cf5545770 | A recursive array key setter
Use this when you have multiple-levels array,
'key2' => 'value2];
to store value(ie: ['a', 'b', 'c']
will point to $array['a']['b']['c'])
if the key already exists, the old value of the array,
else null | class ArrayStore implements Countable, IteratorAggregate, JsonSerializable, Serializable
protected function _set(array &$array, $key, $value)
{
$keys = explode('.', $key);
while (count($keys) > 1) {
$key = array_shift($keys);
if (!isset($array[$key]) || !is_array($array[$key]... | 1 |
5b5066e936661daff9d0b94867128dba | b3c63323bdc19e220e3993d715ec6a19 | \brief Gets the angular velocity damping.
\author dcofer
\date 3/2/2011 | {
dgCorkscrewConstraint* contraint;
TRACE_FUNCTION(__FUNCTION__);
contraint = (dgCorkscrewConstraint*) corkscrew;
return contraint->GetJointVeloc ();
} | 0 |
922548bd298e16b527786b4729604cbc | 7a6eaeb97f88e717edf940c0233e1eae | Construct a `CameraGeometry` by guessing the appropriate quantities
from a list of pixel positions. | GeometryAssembler.__init__(self, exgeom_obj)
self.filename = filename
self.unit = 1e-3
self.pixel_size = 5e-4
self.frag_ss_pixels = 32
self.frag_fs_pixels = 128 | 0 |
3ff03895f4d0e73fe65fa4d4889f078c | fc871686777a92f7a4ce90c470aa0f17 | Get scope hierarchy. | scope_list = []
if self._parent is not None:
scope_list = self._parent._build_scope_list()
scope_list.append(self)
return scope_list | 1 |
065dd9fc23de9299f874f00b3531e471 | e67501178eeafb97102f2dc3c6d828c2 | 通过SQL中获取from_id对应的to_id | def tcFromlId(lId):
t = []
l = lIdLookup(lId);
t.append(tIdLookup(l["t1id"]))
t.append(tIdLookup(l["t2id"])) | 0 |
bd2f6f08be47ee1158a5058ff50e4377 | 454fb200add6ff279ab1be3161cc0733 | 构建INSERT语句
<para>需返回自增列</para> | namespace RepoDb.StatementBuilders
internal sealed class SqlServerStatementBuilder : BaseStatementBuilder
public override string CreateInsert(QueryBuilder queryBuilder,
string tableName,
IEnumerable<Field> fields = null,
DbField primaryField = null,
DbField identityFi... | 1 |
fe1c56c9e057da17b7c61873090c97ae | 47ee903a09c9e8e117d11e6a4199543f | 为被选择的对象添加一个引用实体属性值 | namespace MB.Util.XmlConfig public class XmlConfigHelper{
private void setRefrenceEntityValue(object entity, PropertyInfo info, PropertyXmlConfigAttribute att, XmlNode xmlNode) {
if (info.PropertyType.GetInterface("IList") != null) {
if (att.ReferenceModelType == null ) return;
... | 1 |
25b0a121f1a752543ed7e7b100a1390a | 05127cda60eb5e827782c0fc33f64f08 | 기울이기 방향에 따라, 구슬의 우선순위를 구하는 함수 | {
t_priority priority = PRIORITY_LOWEST;
if(mypos->dir == dir)
{
priority = PRIORITY_MID;
}
else if( ((4+mypos->dir-dir)%4) == 2)
{
priority = PRIORITY_LOWEST;
}
else
{
priority = PRIORITY_LOW;
}
if(isUnknown(x,y) == TRUE)
{
priority += ... | 1 |
13df7887eac1d101d0a6bf65446df486 | 17bc52efe1e7f38eaaae63c71ea1af99 | Permite saltar al personaje principal hacia el lado que esté mirando | public class PlayerController : MonoBehaviour
public void doLook()
{
RaycastHit hit;
Ray ray = Cam.ScreenPointToRay(Input.mousePosition);
if(Physics.Raycast(ray, out hit, 1000000))
{
Vector3 forward = (transform.position - hit.point).normalized * -1;
forwa... | 0 |
80e1526c22fb95c6f046f52e9a31d35b | 029671e02788fb9d3a2b59076967e233 | translate a concrete "abstract" value into a character | public abstract char convertTochar(Object obj); | 1 |
1e2b76ff49d62a16103abda25afd08e9 | eddfd3ca3300cc8bc6801e00362ed08f | Online learning method | mini_batch = random.sample(self.data_buffer, self.batch_size)
state_batch = [data[0] for data in mini_batch]
mcts_probs_batch = [data[1] for data in mini_batch]
winner_batch = [data[2] for data in mini_batch]
old_probs, old_v = self.policy_value_net.policy_value(state_batch)
... | 1 |
04983660865870f7bb558c60b6f91457 | 113ac8d41ba82b48febdc516e86a538b | saves value from misc text box to a file | public class SaveLoadFile : MonoBehaviour
void SaveData(Data data)
{
data.dataText = inputField.text;
} | 0 |
eb58c51573c943a4b81d0f30bf4907ee | a8560feeca65c1fbcd60d346d8f6255f | Initialisation du référentiel de decôtes par défaut | class Referenciel
public function __construct() {
$this->children = new ArrayCollection();
} | 0 |
aa31920caaded2e3516d13893384e19f | 03e8a87b00ea6f950bc68cfbc6c3b92e | 修改模板时,判断模板是否为当前用户新建,如果不是则不能修改 | {
if (isNew)
{
if (template != null && !string.IsNullOrEmpty(template.Content) && !string.IsNullOrEmpty(template.Name) && GetTemplate(template.Name) == null)
{
_pageTemplate.Add(template);
return true;
... | 0 |
bb1d29d771fd6d8d8f4be231bd88ba75 | d56966ce97821ef7b031e3d9917836b4 | Filter the message by resource type. | return func(input []*yaml.RNode) ([]*yaml.RNode, error) {
var output kio.ResourceNodeSlice
for i := range input {
m, err := input[i].GetMeta()
if err != nil {
return nil, err
}
if m.Kind != kind {
continue
}
output = append(output, input[i])
}
return output, nil
}
} | 1 |
61cadea21b2a8b3a6f8a7feae4dea1eb | 413f166832ef6eb389f3cf3975299b18 | Performs the usual and customary operations on a socket, such
as read or accept. | {
for (;;)
{
RTTCPSERVERSTATE enmState = pServer->enmState;
RTSOCKET hServerSocket;
ASMAtomicXchgHandle(&pServer->hServerSocket, NIL_RTSOCKET, &hServerSocket);
if (hServerSocket != NIL_RTSOCKET)
{
RTSocketRetain(hServerSocket);
A... | 1 |
a59244e1d2e9b34fb19bd408d98d1fca | ab88637d330db473e16c325d1a1dc70e | 转换成 / 模式的Jvm类描述 | @JvmStatic
fun toJvmType(type: String): String {
var typeStr = type.toJvmStyle()
val sb = StringBuilder()
while (typeStr[0] == '[') {
sb.append('[')
typeStr = typeStr.substring(1)
}
when (typeStr) {
"byte", "B" -> sb.append("B")
... | 1 |
e0caf9e96bd19972ba4c524a682cb50b | 349f92da10282915df0fdd5db69d8457 | =================
R_RotateForViewer
Sets up the modelview matrix for a given viewParm
================= | double eye[3], double coi[3], double up[3],
double a, double b, double c, double p, double r)
{
double Uplen;
double Up[3];
double A[4][4], B[4][4], C[4][4], D[4][4];
double Ai[4][4], Bi[4][4], Ci[4][4], Di[4][4];
p = sqrt(b * b + c * c);
if ((p == 0) || (r == 0)) return 0;
M3d_make... | 1 |
72152c78f7dc80811c3ccb426a527c4c | 2983746e2fbc3c74ef4f7ddfe67cbdb7 | 获取协程运行状态 | function Thread:status()
return coroutine.status(self.co)
end | 1 |
3f3305ddb6f8100bdf7959f4f6180add | cd9e0edbc99b8e829d273cdf4f555d24 | Check if a substring is cointained within a given string | def is_substring(s,sub):
return(sub in s) | 1 |
a39c4af527d6fd8124bec2c21290fdd4 | 39b7438d5c6e3a12513bcb81c34d0826 | Verifica se o usuario logado é o dono do assunto da pagina atual | class SettingsController
def owner_authentication
if current_user.id.to_i!=params[:id].to_i
redirect_to root_path, alert: t('errors.not_authorized')
end
end | 1 |
4b6242023ea103b7e074736c1f8ce576 | b9d8678a77c7fd976d980a6b51958975 | 爬取电影top250 | @FormUrlEncoded
@POST("satinApi")
Observable<ResultBean<List<Movie>>> getTop250(@Field("type") int type, @Field("page")int page); | 1 |
421f78dabc249a0196bf40489cc6395e | ca80773fda3939d3c1c022160d121917 | 开通银行账户获取验证码点击事件 | function getBankSendVcode() {
$('.btn_send_code').bind('click', function () {
if (!checkRechargeAmount($('#rechargeAmount'))) {
return false;
}
sendMessage();
});
} | 1 |
8e9a1863afd62abcec8ebf3669c45b7d | d6e66ad8b6f63d22efc93d57811a0aa7 | Whether the `eta.core.data.AttributeContainer` of attributes is
compliant with the schema. | merged_attribute_data = self.merged_attribute_data
return all(
attribute.validate(merged_attribute_data[attribute_name])
for attribute_name, attribute in self.attribute_metadata.items()
) | 1 |
d6b9a423e498dbb13b1cc47dad95cf7e | 65df8c6422ba49e16eedc705c74e12b5 | Gets the nutzung id. | NitriteId getId(); | 0 |
144ac91cc75c08cdc5293aa7f9108986 | a1a4205d6919b42d529ecfc6cb957666 | 每隔INTERVAL秒,ajax异步请求一次数据,更新data值 | function getData(){
flag = true;
n++;
let xhr = new XMLHttpRequest();
xhr.open('get','./data.json',true);
xhr.onreadystatechange = function(){
if(xhr.readyState ==4 &&/200|304/.test(xhr.status)){
let data = JSON.parse(xhr.response);
render(data);
flag = fa... | 0 |
7dce0e0bbc67f22311e3c23cc2a70a78 | a76af7a2df43a8a5d240d96618d5a807 | this method is to flat the 3D array into 1D array | numel = self.xyz_array[:, :, 0].size
self.flat_array = np.zeros([self._len_z, numel])
for dim in range(self._len_z):
self.flat_array[dim, :] = np.ravel(self.xyz_array[:, :, dim]) | 0 |
130094fe7fe19d21e017636e8fb13317 | f16069393316114ca698a079e2df81c3 | 利润计算 | export default class PaySlip
calculate() {
if (_.isNumber(this.salaryPerAnnum)) {
if (this.salaryPerAnnum >= Number(180001)) {
this.calculateIncomeComponents({ rate: Number(0.45), threshold: Number(180000), offset: Number(54232) });
} else if (this.salaryPerAnnum >= Numbe... | 0 |
13cdcbe3d6ba24dde71bab1733113738 | e13bb312f30cf8afd58366b94a507225 | Creates a yaml file parser. | namespace NuOLSRv2Port
PUBLIC nu_parser_t*
nu_parser_create(char* fn)
{
nu_parser_t* self = nu_mem_alloc(nu_parser_t);
self->config_filename = fn;
if ((self->fin = fopen(self->config_filename, "r")) == NULL) {
perror(self->config_filename);
exit(1);
}
self->line_num = 1;
self->le... | 0 |
2cef5331296f6434ced22294de4c9544 | 66da746cfcb507fd5c9afdce6395a2b9 | Attribute for a structure element that indicates the phonetic alphabet used by a {@link PdfName#Phoneme} attribute.
Applies to the structure element and its children, except where overridden by a child structure element.
<p>This value has meaning only for the PDF documents of version <b>2.0 and higher</b>.</p>
attribu... | public java.lang.Object getSym166() throws G2AccessException {
java.lang.Object retnValue = getAttributeValue (SYM_166_);
return (java.lang.Object)retnValue;
} | 0 |
f0979c8d7e923c0303040bbbde4d80ac | df08081d31ad3d2263ca4d4adfd6e1ba | Courseオブジェクトのリストを受け取ってjsonを返す | def list_courses(request):
response_data = [course.json_dict() for course in Course.objects.all()]
return HttpResponse(json.dumps(response_data), content_type='application/json') | 1 |
97ee4a857c96ee6a1d089fa897c68f92 | 6c2a0a7cb338f7948dc6e93faa1ab271 | When TF iterates over examples, map the labels and IDs from integers back to strings. | def labeler(example, index):
return example, tf.cast(index, tf.int64) | 0 |
fcd9c11d5a42ff0102ae89c4b126807c | 83b4c9e68d5b5156b76428f0010e8b6c | 获取楼栋相关宿舍号 | namespace BLL
public class StuBaseInfoBLL
public DataTable Back_DorNum(string DorBuilding)
{
return stuBaseInfoDAL.Back_DorNum(DorBuilding);
} | 1 |
3baa532873968a6abab5d86313db49d3 | 35b344c456b682e6f28b9abb1b1aa0dc | 校验节点是否可以编辑 根节点不可编辑 | class Node extends AdminBase
function edit($nodeid){
$callback = [];
$callback['submit_before'] = function($model, &$post) use($nodeid){
$post['pid'] = empty($post['pid']) ? 0 : $post['pid'];
$nodes = $model->getAllList();
if(in_array( $post['pid'], explode(',', $node... | 0 |
b9bc9fa0b9e8ca45d07e796b4327d5f2 | cb09f17fa418303d985fd052f2e20538 | Bind Region dropdownlist when response is sent back from server | jQuery.getJSON(url_get_regions, { country:country_ref}, function(data) {
var regions1 = select_region1;
var options = regions1.data('select2').options.options;
regions1.html('');
var items = [];
for (var i = 0; i < data.length; i++){
items.push({ "id": data[i]['id... | 1 |
2e9e8309cb770271d0c2ad356aa4e7d3 | 79badb4cdf2dd2e02eac6a70d6406658 | 正则获取商品名称 | public class HttpService
public static String getYiwangOrderProductName(String html){
String tdhtml = "<input type=\"text\" disabled=\"disabled\" id=\"PRODUCT_NAME\" name=\"PRODUCT_NAME\" value=\"(.+?)\" class=\"txt\"/>";
Pattern productPattern = Pattern.compile(tdhtml,Pattern.DOTALL);
Matcher p... | 1 |
156da9c0940ac4b08537c67a729c3f40 | fff984d654ac938e15cf3f35785bcce2 | Generate report and convert it by using report loader to load report. | void generateReport(ReportParam reportParam) throws IOException; | 0 |
a34e31aa6c8048cf04549a82477ffd5b | 75f91b6db219d099a4c415969a43d307 | Exit a parse tree produced by scriptingLanguageParser#command1ver4. | class scriptingLanguageListener(ParseTreeListener):
# This function the INITIALIZATION function called when the Listener is instantiated
def exitCommand7ver3(self, ctx):
pass | 0 |
fdc90f2729752cd04185ed923648c28d | 5adb8c6bb5ec1b9d59ac0b4c0ed4e6ea | The service endpoint for updating documents in a search domain. | const options = {
method: "PUT",
url: "/v1/{project_id}/vpc-endpoint-services/{vpc_endpoint_service_id}",
contentType: "application/json;charset=UTF-8",
queryParams: {},
pathParams: {},
headers: {},
... | 0 |
ca8fa2f19c3254e663d413a819a485da | 0f8f797ec77562ae3a9acd31f91e8d28 | Set virtual network configuration of the API Management service. | return this.client.sendLRORequest(
{
resourceGroupName,
networkVirtualApplianceName,
parameters,
options
},
beginCreateOrUpdateOperationSpec,
options);
} | 0 |
c24f9e01882e9944a19fc28ce79854e0 | f9620763b27e26d2a3b369134c3e03cd | int型二次元配列をバイナリファイルに出力 | int writeBoard(int arr[10][10]) {
int result = 1;
fstream fp;
fp.open("board.txt", ios::out);
char num;
int value;
if (fp.is_open()) {
for (int i = 0; i < 100; i++)
{
value = arr[i / 10][i % 10 ];
itoa(value, num);
fp.write(&num, sizeof(char));
}
}
else {
result = 0;
}
fp.close();... | 0 |
aa17e7d00d6ec03d7000308b9d310029 | 2cb27c914875d6dbe79ee824340a8b5c | Get all driver devices of a specific class | void CSysParamList::ListDevices(CONST GUID *pClassGuid, LPCTSTR pszEnumerator, const char *pCategory)
{
unsigned i;
DWORD dwSize, dwPropertyRegDataType;
DEVPROPTYPE ulPropertyType;
CONFIGRET status;
HDEVINFO hDevInfo;
SP_DEVINFO_DATA DeviceInfoData;
const static LPCTSTR arPrefix[3] = { TEXT(... | 1 |
4a7668da34cd202afb2a05a0e3ea7e15 | 4760ce54680517b2cf100d0a62f3ac2c | Checks if every box is occupied | class Game extends React.Component
checkIsBoardFull(board) {
const boxHasValue = (currentValue) => currentValue !== "";
return board.every(boxHasValue);
} | 1 |
bf6d4347059b71c20b3bfd3ffc633c0a | c185d772dbbd5785241668bff5ff1c85 | show songs, where there is at least one common author
of song authors and to-user-assigned authors | if (entry.title.$t.toLowerCase() != album.toLowerCase()) { songdebug(2, album, entry.title.$t); return false; }
var author = entry.author;
var f = false;
$.each(author, function (i, m) {
var d = m.name.$t.toLowerCase();
var t = artist.toLowerCase();
i... | 1 |
7d5113984092cbc60e5b9b8480a53c72 | d5e3d5c62724a876684da4b190d10b3a | Get all assessments on the remote server. | export class AddonModWorkshopOfflineProvider
getAllEvaluateAssessments(siteId?: string): Promise<any[]> {
return this.sitesProvider.getSite(siteId).then((site) => {
return site.getDb().getRecords(AddonModWorkshopOfflineProvider.EVALUATE_ASSESSMENTS_TABLE).then((records) => {
records.... | 0 |
254de8600fb10a6467852e1d53dd38c1 | 465c16b066ac61f6efe176c8c19c48f3 | Convert each image into a PDF page and merge all pages to one PDF file | index=0
if outputpath=='':
import datetime
outputpath='combinefiles_%s.pdf'%datetime.datetime.strftime(datetime.datetime.today(),'%Y-%m-%d-%H_%M_%S')
(maxw, maxh) = Image.open(input_paths[0]).size
c = canvas.Canvas(outputpath, pagesize=portrait((maxw, maxh)))
for ont_path in input_pa... | 1 |
7ff9ff3c2c0a5a005af71419b731fa6d | cadb0ab1bf048e1c2dd62e677d43fdd0 | 获取企业用户购买数量和已使用数量 | public async Task<IActionResult> GetUserShopCountAsync(string userGuid, string productGuid)
{
var response = await new MerchantBiz().GetUserShopCountAsync(userGuid, productGuid);
return Success(response);
} | 0 |
b8666a62430a95c7d8bb4e7cd558f599 | a0598e93433b9042ae6c616069c8041e | attempts to pass validation and create project on Enter or click of Add Button | if (this.projectNameInput.getText().isEmpty() || this.projectNameInput.getText().length() > 55)
showAlert(Alert.AlertType.ERROR, projectNameInput.getScene().getWindow(), "Error", "Please enter the name of the project (length < 55 characters)");
else if(this.projectDescriptionInput.getText().... | 1 |
391ef311f8acb53776ec5b1126b21fe1 | 01faf4aaf0b397d22eb7f01df86c0f36 | Get refCommandeFournisseur | class BonCommande
public function getFkFournisseur()
{
return $this->fk_fournisseur;
} | 0 |
5c8a99a23cca0e566b1e184f08195d28 | c393009227d8a57f2bcbe73fa813d0a6 | CALCULER LE NOMBRE DE REPONSES D UN SONDAGE | if(reponseEleve=="") return [[0,"Aucune réponse"]];
var formul=formule;
formul="("+formul.replace("TEST:","")+") ? "+points+" : 0";
formule.replace(/#UTILREP#/g,memo);
formul=formul.replace(/#PREC#/g,prec);
formul=formul.replace(/#REP#/g,reponseEleve);
formul=formul.replace(/#UTILREP/g,memo);
formul=for... | 0 |
2bd654ab9de65196ec8788f19a7d6990 | 9dba1dc633e0db086e6cd09ff9b31ae1 | 获取玩家今天的押注情况 | namespace Qg_EggQuiz.Data
public class SystemHandle : IHttpHandler, IRequiresSessionState
public string GetUserBettDay(string userid, string pageindex)
{
return SystemHandleController.GetUserBettDay(userid, pageindex, "12");
} | 1 |
5ab01439249da1ca323fe384a7ec86ff | 1193072f24fbd8aaf247c73edaab926f | 只要有消息来了,遍历map,给map中的每个成员广播此消息 | {
Iterator<Map.Entry<Integer, AcceptObject>> it = userMap.entrySet().iterator();
while(it.hasNext())
{
Map.Entry<Integer, AcceptObject> entry = it.next();
entry.getValue().send(message);
}
} | 1 |
cb3dcacb5e896f5134769ec1f45cfae2 | b187cb6a60c151529d412c4505f58fc8 | Retrieve session info cache identifier | class CacheLite implements SessionStorage
public function getSessionId($connectionKey)
{
return $this->cache->get($connectionKey);
} | 1 |
4f58973701d0e00c062fef4a3c3eeda5 | 5514168eb32220e88bd4e5ee483139bf | Reveal all connected empty spaces with no adjacent mines
Invalid spaces do nothing | public class Tile : MonoBehaviour
void ClearNeigbors(){
foreach(Tile t in connectedTiles){
if(t.getBombCount() == 0 && !t.isRevealed){
t.Reveal();
t.ClearNeigbors();
}
else if(t.getBombCount() > 0){
t.Reveal();
}
}
} | 1 |
5f0671f6dc6f7c3b8f1f873ba1597d70 | 5e35f795c2f1b0fe4fc46a08d29d39a4 | move userFish right | public class Fish2Move : MonoBehaviour
public void Right()
{
Fish2.transform.GetComponent<Animator>().Play("Fish2_Right");
} | 0 |
9a2c62cecf97a713e7664700ff0bc0a0 | 6e6ae92b85e32933cda4a0bfd609cec8 | Verifies that a claim with no samhsa diagnosis, procedure, or item-level HCPCS codes does
trigger filtering because the code array is empty and therefore does not contain known systems. | public class ComputablePolicyConsentTest extends TestCase
public void testValidateComputablePolicyConsentCode__DiagnosticChain_Map() {
} | 0 |
db87c98b0871e75b659296e8319d3b64 | b444b8ec6793841c4fed9b6b8f97df28 | bubble sort in descending order | for(x=0; x<a-1; x++){
for(int b=0; b<a-1; b++){
if(data[b+1]<data[b]){
roll=data[b+1];
data[b+1]=data[b];
data[b]=roll;
}
}
}
} | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.