query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
002a4e434fa5652731d2dcb33ed5972a | 6cea03975cb0b5f1077f1e527816a224 | Applies an affine linear transformation matrix to a set of points. | def TransformPoints(tFormMat,pts):
pts = numpy.array(pts)
nPts = len(pts)
avgP = sum(pts)/nPts
pts = pts - avgP
res = [None]*nPts
for i in range(nPts):
res[i] = numpy.dot(tFormMat,pts[i])
return res | 1 |
4b21e028a73d62f4774ce32a298d5e1e | 92aa60d494668c572ced865fbe30e151 | Execute arbitrary function/object remotely. | def CallServerRequest(oRemote, sFuncName, *args, **kw):
return oRemote.callRemote(sFuncName, *args, **kw) | 1 |
64846f45fa9c8024d3727bc78ce68eaf | e4d43c6cecf9fe1e6676ddf8610fdbaf | function: convert movieName to movieID | def predicting_ratings(request):
def movieToID(movies_df, name):
id = list(movies_df.loc[movies_df["title"] == name]["movieId"].values)[0]
return id | 1 |
075043fbe57eaca2afc21abdd340502b | c2223eaea19f66bf8e6a53c38e6d61f3 | 公众平台网页oauth用户信息获取(带缓存处理) | {
$app_id = $this->getAuthorizerAppID();
$token_key = $this->oauth_access_token . $app_id;
$refresh_key = $this->oauth_refresh_token . $app_id;
if (is_null($base_info)) {
$access_token = $this->storage->get($token_key);
if (empty($access_token)) {
$refresh_token = $this->storage->get($refresh_key);
... | 1 |
18613b0be637f14634f2b9d12b4e4868 | efa983aa542952708061dce891108043 | Setter for <code>PUBLIC.T_2486.VAL6</code>. | public void setF61( Integer value ); | 0 |
44fcfab42ebf314af295ba2d73704962 | 5443f2a7a6b1c2f47bd46b95fb011bb4 | 用來判斷點擊按鈕(棋子)的所有事情 | function clickAction(x,y){
var changeX = x - clickTempX;
var changeY = y - clickTempY;
if(Math.abs(changeX)< 20 && Math.abs(changeY)<20){
return;
}
if(Math.abs(changeX) > Math.abs(changeY)){
if (changeX < 0){
updateBoard(0);
}else{
updateBoard(1);
... | 0 |
e9885db69ef8346d629781221215f98b | 408e001da21b112012b51d5bbe3ea8ed | This function is used to convert ascii to string | { uint8_t k;
ASCIIBitTable t;
std::string res;
uint32_t j = str.size();
for (uint32_t i =0; i < j; i++){
k=(int8_t)str[i];
if((k>32)&&(k<127)){res += t.ASCII_bit_table [k];}
else{res += t.ASCII_bit_table [32];}
}
return res;
} | 0 |
6df5b967d8db6ef670b02bf81673d4c1 | c734fe53ed878771b798899ce6e06d6b | Recupero di tutte le tipologie contratto | {
try
{
var listTiposContratos = db.TipoContratoes.ToList();
if (listTiposContratos == null)
{
return BadRequest("No existen Tipos de Contratos Cargados");
}
else
{
... | 1 |
f25815b93d7588df74ba6a9abd4d99aa | 1ec8172d3412b34c949a462b120663f3 | Siirtää näkymää annetun määrän pikseleitä. | switch (suunta) {
case YLOS:
y--;
break;
case ALAS:
y++;
break;
case OIKEA:
x++;
break;
case VASEN:
x--;
break;
}
} | 0 |
e08c06a76d67d3ce7a8333f522d69859 | 6a0b30457873c21b1bf7bc34012ee574 | NewHeader creates a new Header. | func ExampleNewHeader() {
h := frame.NewHeader(
"login", "scott",
"passcode", "tiger",
"host", "stompserver",
"accept-version", "1.1,1.2")
doSomethingWith(h)
} | 1 |
f837019e8cbb3d4f8f1e7f51a427bf8d | f33949d23d689d7832c2cc074afc689f | Applies the non-linear transformation to the inputs | class AffineTransform(tf.keras.Model):
def call(self, x):
return x * self.weight + self.bias | 0 |
91a2124c5cb4d0b9a9c79af89c781b9d | 7b7821fd8573cfad6a9333bfececf68b | Check if the colour was owned | public class SaveManager : MonoBehaviour
public bool isColorOwned(int index)
{
return(state.colorOwned & (1 << index)) !=0;
} | 1 |
b75e6f7c5b187bd7094b343eb5ccc422 | 6607a7f7f697de43350dc036c2a7df36 | Energy Smearing Algorithm | void Energy_step(void)
{
real_T energy;
int32_T k;
for (k = 0; k < 1000; k++) {
energy = rt_hypotd_snf(Energy_U.In1[k].re, Energy_U.In1[k].im);
Energy_B.b_y[k] = energy * energy;
}
energy = Energy_B.b_y[0];
for (k = 0; k < 999; k++) {
energy += Energy_B.b_y[k + 1];
}
Energy_Y.Out1 = energy;
... | 0 |
30a26de858bd4d2c648b7b264ed5d28a | e10d0e0bdf6ae0ebff32ac2ce79b80a5 | обход по спирали | namespace Methods
public static class MethodsImpl
public static void SpiralFill(int[,] matrix)
{
int counter = 1;
int l = 0;
int r = matrix.GetLength(1) - 1;
int u = 0;
int d = matrix.GetLength(0) - 1;
while (l <= r && d >= u)
... | 1 |
c0588175a2291d36364f53b6cf830935 | a4fbd16a13250f3ac6ccc5244fcb59c2 | Updates the statistics for the cache scheme. | static void
kmem_cache_update(kmem_cache_t *cp)
{
int need_hash_rescale = 0;
int need_magazine_resize = 0;
ASSERT(MUTEX_HELD(&kmem_cache_lock));
mutex_enter(&cp->cache_lock);
if ((cp->cache_flags & KMF_HASH) &&
(cp->cache_buftotal > (cp->cache_hash_mask << 1) ||
(cp->cache_buftotal < (cp->cache_hash_mask... | 1 |
ee59c15fec92134b1a3660ba7c79f2ec | b9caaa0e51efba162acda395a1273a71 | char_noにより名称を返す。仮データなので、データベースから排出される形式が決定次第ちゃんと引っ張るようにする。 | function convertIntoRoman(sheetName) {
var name = 'other';
switch (sheetName) {
case '吉田':
name = 'yoshida';break;
case '平田':
name = 'hirata';break;
case '丸山':
name = 'maruyama';break;
default:
break;
}
return name;
} | 0 |
03812339b62f5e3e76ca6f66447bd5f4 | e5abbb79c626638308751e7baad9c89d | Tests that create() throws an exception when the context ID has no
initial state. | throws Exception {
try {
statuses[0] = null;
statusDAO.createFixedBillingStatuses(statuses);
fail("Should throw an IllegalArgumentException here.");
} catch (IllegalArgumentException iae) {
}
} | 0 |
8a388ff003e20820c9283e8a9989c61e | 30cdde38ea8d13b9d2e7b06c79b566cc | @brief This function is to display the error message in console or file(if debug mode enabled) | {
#if !defined(EVE_LOG_IN_FILE)
m_p_mutex->lock();
va_list arg;
va_start(arg, p_format);
wchar_t * mess = eve::mess::Server::format_message_w(EVE_TXT("[ ERROR ]"), p_funcName, p_format, arg);
va_end(arg);
eve::mess::Server::print_to_output_w(mess);
std::free(mess);
m_p_mutex->unlock();
#endif
} | 1 |
c340a6dfe21252adb48d1872c409906a | 64f0d64bca8d8cfa0fc18d22e89b79b1 | Compute the positive acceleration coefficient (inherited classes should customize this). | namespace UnrealEngine
public partial class UProjectileMovementComponent : UMovementComponent
protected virtual FVector ComputeHomingAcceleration(FVector inVelocity, float deltaTime)
=> E_UProjectileMovementComponent_ComputeHomingAcceleration(this, inVelocity, deltaTime); | 1 |
6f487cecd782487c621e87331bccdee1 | bdec210145fee4274c28a0fad934fabf | Test found counts of character in format. | s := "this is a test"
counts := getCounts([]byte(s))
if counts[1-1] != 1 ||
counts[5-1] != 1 ||
counts[8-1] != 1 ||
counts[9-1] != 2 ||
counts[19-1] != 3 ||
counts[20-1] != 3 ||
counts[37-1] != 3 {
t.Errorf("incorrect counts for string 'this is a test'\n")
}
} | 1 |
e6cd41aeee4766e256bbd4b207e92eb6 | ab839ccb54d9f62a610de9d9e038b3c0 | 当前用户最新体检数据 | {
$healths = Health::where('user_id', 1)->orderBy('assay_date', 'desc')->get();
return response()->json([
'healths' => $healths,
]);
} | 1 |
5c9abd517ae4df693a39479f69fd1370 | e6bbe40ee80de4db22d780291295bef3 | Removes an ACL entry on the specified directory for the 'Users' account. | try:
file_system_client = service_client.get_file_system_client(file_system="my-container")
directory_client = file_system_client.get_directory_client("my-parent-directory")
acl = 'user:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'
if is_default_scope:
acl = 'default:user:xxxxxxxx... | 1 |
a135a20c0b38b14889f7a693c50ee5c1 | c06e1d72f38c254515f9479bb8705700 | This function return the amount of seats occupied in the entire pod. | class Pod():
def get_people_on_seats(self):
total_avaliable_rows = math.ceil(len(self.pod)/3)
actual_rows_people_sit = list()
for row in range(total_avaliable_rows):
actual_rows_people_sit.append(3*row)
people_seated = 0
for row in actual_rows_people_sit:
... | 1 |
b14f6987a5b1dc6404623980aed21e72 | a2a8e9038f1b9c74b3da1cff703773a1 | Generate a series of strings, each of which is one typo off from the
original string. | tweakedWords = []
charList = ['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']
for i in range(len(word)+1):
for j in range(26):
tempWord = word[0 : i] + charList[j] + word[i : len(word)]
tweakedWords.app... | 1 |
f6b80e40b0deba0ae0b9f89abcc8313b | c5f8ca0dfa17a634c6179ebc84f98c4a | 标记配置文件过期 | File nbproject = new File(FileUtil.toFile(makeProject.getProjectDirectory()), "nbproject");
File publicConfFile = new File(nbproject, "configurations.xml");
publicConfFile.setLastModified(publicConfFile.lastModified() + 1000*60*60);
FileUtil.toFileObject(publicConfFile).refresh(true);
... | 1 |
88887224d84ff072cd2c14cc82a838bc | e0219cda52d6fb199d0b299e85ceb46f | On affiche la traduction du mot en cours
On a affiché un mot en GB ou en F et on affiche sa traduction dans l'autre langue
Du français si on est dans le sens GB -> F
et inversement | public class AllToFrController implements Initializable
public void btTradAllToFrClick(){
if(this.textboxAllToFr.getText() != null && !this.textboxAllToFr.getText().isEmpty()) {
richtextboxAllToFr.clear();
try {
StringBuilder sb;
InputStream flux = new Fil... | 0 |
2ee374c2df693a28540f6f371b49e4f7 | 7ad6871ce80aa855880981ecc8184306 | It complements a MeshRenderer to add Morph Targets (Blend Shapes) to deform meshes.
Morph Targets of a mesh must have the same topology and number of vertex, otherwise it won't work. | class FPostProcessMorpheusVS : public FGlobalShader
FPostProcessMorpheusVS(const ShaderMetaType::CompiledShaderInitializerType& Initializer)
: FGlobalShader(Initializer)
{
} | 0 |
238924104fda9a20d99e296dc9a578fb | 803150a4f3434b185062eb2afb0e71a1 | Computes the betweenness centrality of a graph.
kind : string, either 'vertex' (default) or 'edge'
directed : bool, defaults to self.is_directed()
weighted : bool, defaults to self.is_weighted() | G = nx.DiGraph()
nx.add_path(G, [0, 1, 2])
b = nx.betweenness_centrality(G,
weight=None,
normalized=False)
b_answer = {0: 0.0, 1: 1.0, 2: 0.0}
for n in sorted(G):
assert_almost_equal(b[n], b_a... | 1 |
037d759cd87e76c9db6ab7ce225e8c18 | 915e4525bcd3b70c58267854125236c2 | Compute amplitudes for linear model basis functions for user-specified planet parameters. | h = cosmo.h
if len(M_arr) == 0:
M_arr = np.logspace(8, 15, 1000)
else:
M_arr = np.array(M_arr)
M_arr /= h
z_dat = [0., 1., 2., 3., 4., 5.]
M0_dat = [3.0e-10, 1.7e-9, 4.0e-9, 1.1e-8, 6.6e-8, 7.0e-7]
Mb_dat = [6.0e10, 9.0e10, 7.0e10, 5.0e10, 5.0e10, 6.0e10]
Mc_dat = [1.0e12... | 0 |
7a90fa96a5c651fc316ab5971148ee67 | e5a06931143d84bd2c8ee74ffa0fe8a9 | Build the the nodeModel. Used to know the possibles targets controller | function createNodesModel(context, config = {}) {
const { Events = [], Gateways = [], Tasks = [], Position = {} } = config
const eventNodes = Events.reduce((container, item) => {
const type = item.Type
const id = item.Id
if (type === 'StartEvent') {
return [
...container,
new nodes... | 1 |
6857f31860c627b172c0119129b57460 | 096b6e059635b39381587452e2692196 | Number of elements along the theta axis | class AcadosOcpDims:
def nsh_e(self):
return self.__nsh_e | 0 |
c1dadeda374d50ea85fa222c83464d4a | 8ccc1e35df7733c5dd5b0a5644c4fd56 | Desc : 해당 책이 내가 찜한 책인지 DB에 확인하는 추상 메소드 | public boolean checkBookmark(BookMarkDto dto) {
BookMarkDto isChecked=session.selectOne("member.checkBookmark",dto);
if(isChecked!=null) {
return true;
}else {
return false;
}
} | 1 |
694941fe4890d9c27b9352fc51e6a4e5 | a0186e4f08d33990cfb11b32b5c477e2 | Asks the current player whether he wants to confirm his last action. | public abstract boolean confirmExit(); | 0 |
cf1421f1edcb86c5c1829718d87d51b6 | 4173369622fa9a6454b27055c1662393 | Smaze prispevky podle ID uzivatele | class ModCK extends db_pdo
public function deletePrispevkyByIdU($idU) {
$where = array();
$where[] = array("column" => "id_uzivatel", "value" => "$idU", "symbol" => "=");
$this->DBDelete(TABLE_PRISPEVKY, $where);
return;
} | 1 |
7efc2d64659d58d0727cb7e2d72135e9 | b0c3625b40df6260d106a0f0d42cd946 | \brief Delete the given capability
Deletes (but does not revoke) the given capability, allowing the CNode slot
to be reused. | void Delete_GenericCapability(PS_GenericCapability x)
{
uint16 i = 0;
Delete_CapabilityIdentifier(&x->capabilityIdentifier);
if (x->option_of_maxBitRate)
{
}
if (x->option_of_collapsing)
{
for (i = 0; i < x->size_of_collapsing; ++i)
{
Delete_GenericParameter(x->co... | 1 |
3b62ec7e604df6729b6d8ccacc399e25 | de4e969a971329c84f1d6d4f236c9056 | 将不同alpha的岭回归Ridge和线性回归LinearRegression的w系数,并显示在图片上 | def check_lasso():
x_train, x_test, y_train, y_test = train_test_split(X_boston, y_boston, random_state=0)
lasso = Lasso(alpha=1, max_iter=1000).fit(x_train, y_train)
lasso001 = Lasso(alpha=0.01, max_iter=100000).fit(x_train, y_train)
lasso0001 = Lasso(alpha=0.001, max_iter=1000000).fit(x_train, y_tra... | 0 |
582ebd5c17cb0b2271be4deee3faf8fa | c5d0ce043498a2afccd066b650894a44 | 保存模型,并验证合法性 | $this->load->library('form_validation');
$callback = '|callback__check_model_name';
if ($name AND $name == trim($this->input->post('name', TRUE))) {
$callback = '';
}
$this->form_validation->set_rules('name', '内容模型标识', 'trim|required|alpha_dash|min_length[2]|max_lengt... | 1 |
a6e2d29f5677b481454302184d8a202d | 26211d6fc9689b87d9d0a35f29c0f5ea | Calculate the curl at position (i, j) in the fluid grid.
Physically this represents the vortex strength at the
cell. Computed as follows: w = (del x U) where U is the
velocity vector at (i, j). | double Vctr::Convection(int i, int j, int k) const
{
int id = ms.idx(i,j,k);
int ip, jp, kp; ms.ipx(i,j,k,ip,jp,kp);
const Scla &u = v1_;
const Scla &v = v2_;
const Scla &w = v3_;
return .5 * fabs(u[ip] + u[id]) / ms.dx(i)
+ .5 * fabs(v[jp] + v[id]) / ms.dy(j)
+ .5 * fabs(w[kp] + w[id]) / ms.dz(k);
} | 0 |
2133ba8e4cf3fbcadd6500e2489edbb4 | fc258afb667e0e308786a1db14cc69c6 | Set the run state to the given value | char stateTmp[2] = {0x00, runState};
VUC_sendCommandWithArgs(VUC_BYTE1_COMMAND, VUC_SET_RUNSTATE, 2, stateTmp, 2, stateTmp);
} | 1 |
54055ceb7bc1317d50ecbb2a4c3f10a3 | 14ea32b7feceac770fbcb71f2420d91f | ~~~~~~~~~~~~~~初始化子弹标签~~~~~~~~~~~~~~~ | for (int i = 0; i < ENEMYBULLETCOUNT; i++) {
enemybullets[i].height = 6;
enemybullets[i].width = 8;
enemybullets[i].row = -enemybullets[i].height;
enemybullets[i].col = 0;
enemybullets[i].rdel = 2;
enemybullets[i].cdel = 0;
enemybullets[i].active = 0;
enemybullets[i].index = i + 85;
enemyb... | 1 |
46d5e6b3d2b0712f4d67e7a1350bb02c | 2057ce01ec78454ee900346ed2e254a5 | Generate addition question and assist in displaying it | {
var ret = new ValueInt2();
ret.a = UniversalFunctions.Rand(1, 20);
ret.b = UniversalFunctions.Rand(1, 20);
ret.correctanswer = ret.a + ret.b;
ret.displayvalue = Convert.ToString(ret.a) + " + " + Convert.ToString(ret.b) + " =";
return ret;... | 1 |
d32510de3e70bce1f8d93c13d844b1f2 | 36b6055464ccd924d9088422e4d38a39 | 接收公会成员信息 | local function getInviteMembersList()
inviteMembersList.Guild = { }
inviteMembersList.Friends = { }
if nil ~= allianceData.OnlineMemberData then
for k, v in pairs(allianceData.OnlineMemberData) do
if v.Hero.Id ~= monarchsData.Id then
local memble = { }
mem... | 1 |
81f35073d5a757b93e82edacbc6be31d | d8c82cf2e9a35bfc2db77ad93533e8db | <para>Whether the layout of this item (to layout the children)
is valid.</para> | {
var scrollRectSpecified = scrollRect!=null;
var containerSpecified = Container!=null;
var currentLayout = containerSpecified ? ((layout!=null) ? layout : Container.GetComponent<LayoutGroup>()) : null;
var validLayout = currentLayout is EasyLayout.EasyLayout;
return scrollRectSpecified && validLayout;... | 1 |
9ad73688b99b21e42affc88a7b0284eb | a8872e295b2eca718f2c1e24e506da01 | Formulas consist of a series of numbers separated by the
operators '+' or '-'. Formulas may contain space characters
between the numbers and the operators. | @Slf4j
public class GradingService
public static String cleanFormula(String formula) {
if (StringUtils.isEmpty(formula)) {
formula = "";
} else {
formula = StringUtils.trimToEmpty(formula).replaceAll("\\s+", " ");
}
return formula;
} | 1 |
848d70a317581031728b8f23f523bf48 | b424f96abcb97c040ef47e56100c68f9 | Get underflow datetime value. | long getUnderflowInt64(); | 0 |
86ee345943f6e79540ba0df50a514802 | f63a65a64797a714f782fd0970929cc5 | sets the next shape to a random one | {
falling_shape = next_shape;
next_shape = rand() % 7 + 1;
} | 1 |
9e2c7a3e9d7b27e4ac6be5232799d8e5 | 78ce230a23ac9624363f40e56096d4a5 | Raise the <see cref="HistoricFileListBuildException"/> event. | namespace HTMLinjectorServices
void SignalBuildError(string eventMessage); | 0 |
15ef95c0ea457c3acbca7f49662397cc | f665f3191cc74b481f8e29f9db8f4595 | @brief allows to get cellular service automaton current state | sys_srv_status_e_type ds3g_get_current_srv_status(void)
{
sys_modem_as_id_e_type subs_id;
subs_id = ds3g_get_ps_subs_id();
return ds3g_get_current_srv_status_ex(subs_id);
} | 1 |
171f51aed225e7605218a19d19222178 | 70752100cf0ef2efd2dd0bb3508396f1 | Generates noise in the given configuration
Returns number of cells broken with noise. | for i in range(N):
for j in range(N):
a = np.random.randint(0, N-1)
b = np.random.randint(0, N-1)
s = config[a, b]
nb = config[(a+1)%(N-1),b] + config[a,(b+1)%(N-1)] + config[(a-1)%(N-1),b] + config[a,(b-1)%(N-1)]
cost = 2*s*nb... | 0 |
74fdd0ab80f4195a35c7e0df46df7a20 | bee15ce0172ad86a0df3dde5c8704119 | Get Workspace Layer selected on Layers List | {
string PathName = System.IO.Path.GetDirectoryName(sourceLayer);
IWorkspace pWorkspace = null;
if (sourceLayer.IndexOf(".shp") != -1)
{
pWorkspace = WorkspaceUtil.OpenShapeFileWorkspace(PathName);
}
else if (sourceLayer.Ind... | 0 |
70512a1faeeff85bdbad177b1184772b | dd98024faf827bf1be49ac50314e9e8c | @brief Check if the property is virtual | class Entity implements ITrace
public function isVirtual()
{
return !empty($this->_attribs['is_virtual']);
} | 1 |
e1de78d8e05debc4a250437e7e62412c | a0b21ece7a3197ed72a43f2aa9ccad57 | Get shortest path to getting all keys | w0 = (start_at, start_at)
initial_walker = (w0, set())
search_front = PriorityQueue()
search_front.put((0, initial_walker))
visited = set()
target = graph.all_nodes()
while not search_front.empty():
(distance, walker_with_doors) = search_front.get()
(walker, open_doors) = wal... | 1 |
fcc5e8b3845bd2005e982b4e75e92567 | 09153fe3e709232a843a550c477b76a7 | Returns the title of the table | abstract class LogTable
abstract public function getTitle(); | 1 |
5c0d5defc7d94bcef674d9b6e0f42ee9 | 4b2ca951a6a69473d4a4b064ef149c47 | Go through each node and add their frequencies | int totalQ = 0;
foreach (TreeLink li in links) {
totalQ += li.GetFrequency ();
}
return totalQ;
} | 1 |
f9f3335543b66e6ecdacd3264affde65 | 647d1416bc198530334a3037491189ca | 左上角图标,双击退出 | @SuppressWarnings("deprecation")
public class MainActivity extends BaseActivity implements OnClickListener
private void exitBy2Click() {
Timer tExit = null;
if (mIsExit == false) {
final int drawerState = mMenuDrawer.getDrawerState();
if (drawerState == MenuDrawer.STATE_OPEN
|| drawerState == MenuDrawer.... | 1 |
d3106b97238742f8ca065be58940fc01 | 06d3526e7772c888ea595d0ab4edace5 | 텍스트에서 대표 URL을 추출하는 메소드 | soup = get_soup_of(url)
if soup == None:
return None
text = soup.get_text()
link = url
try:
link = re.search("\"([^\"]*)\"", text).group(1)
except AttributeError:
pass
return link | 1 |
6c482ab5a0ebd913213a315ff7003888 | 77ae2dcbc5e5052d068820e0da77ddfc | Returns the value of the '<em><b>Waiting Time</b></em>' containment reference.
<!-- begin-user-doc -->
<p>
If the meaning of the '<em>Waiting Time</em>' containment reference isn't clear,
there really should be more of a description here...
</p>
<!-- end-user-doc --> | Long getWait(); | 1 |
89707a743ec3d84c111a10f5d29e74ce | 49bd70bd0a3831dfa87514e34b4bdc25 | 创建一个“关闭深度测试”的DepthStencilState | local function default_depth_stencil_state()
d = {}
d["DepthEnable"] = 0
d["DepthWriteMask"] = dx.D3D11_DEPTH_WRITE_MASK_ALL
d["DepthFunc"] = dx.D3D11_COMPARISON_LESS
d["StencilEnable"] = 0
d["StencilReadMask"] = dx.D3D11_DEFAULT_STENCIL_READ_MASK
d["StencilWriteMask"] = dx.D3D11_DEFAULT_STENCIL_WRITE_MASK
d["F... | 1 |
77291d47181af4fdc7f30da3c6e17827 | 8298b63037bfff23d71f49cb0fd04223 | Gets query for [[Likes]]. | {
$v = Validator::make($request->query(), [
'type' => 'required|max:255|exists:likes,likable_type',
'fid' => 'integer|exists:likes,likable_id',
'uid' => 'integer|exists:users,id'
]);
if ($v->fails()) {
return response()->json(['errors' => $v->e... | 1 |
02a6cbc3b7a1a1f8356c96ccc76f7257 | b538418ecd830db6b69108d9a6a5a9ad | 格式化二级科目编号 | namespace TDPPM
public partial class Gongxu_Tongyong : EditPanel
private void FormatGBNR()
{
int i = 0;
int j = 0;
foreach (DataGridViewRow row in dgvGBNR.Rows)
{
if (row.Tag == null || row.Tag.ToString() != "Zigongbu")
{
... | 1 |
ea7e6fa6d9d26fb7a357311bf71fa8c7 | 55e086288a0590ac2c4d646fd36ca8e9 | 当spider关闭信号发出时,调用handle_spider_closed | class QiubaiPipeline(object):
#开始打开spider时,回调的函数
def close_spider(self,spider):
print('___close_spider___')
self.db.close() | 0 |
0febc22c5ec41105c8de1c162c390ec9 | 01725744772cdc6574846a4f1cd86d75 | Method for predicting embeddings of nodes in the given graph. | class GraphSage(nn.Module):
def forward(self, nodes_batch):
lower_layer_nodes = list(nodes_batch)
nodes_batch_layers = [(lower_layer_nodes,)]
for i in range(self.num_layers):
lower_samp_neighs, lower_layer_nodes_dict, lower_layer_nodes= self._get_unique_neighs_list(lower_layer_nodes)
nodes_batch_layers.inse... | 1 |
c6bd6f53ee66a2ab2d2ab8fb37f2a42b | c480c67b09d6b1f066ea04926f437764 | 下划线格式字符串转换为驼峰格式字符串,正则表达式方式 | @Log4j
public class Toolkit
public static String myStrUnderlineToCamel(String str) {
int idx = str.indexOf("_");
if(idx>0) {
String sub1 = str.substring(0,idx);
String sub2 = str.substring(idx + 1, str.length());
StringBuilder sb = new StringBuilder().append(sub1).app... | 0 |
e9394931feddcf45718d6a7ba57b2ec2 | 8b48dc48cfa5c2bbeb4c6c5cd0455dd7 | This function turns the form json into an object like: { [rouproupID]: [field IDs] } | let fieldsMap = {}
for (const formField of serverData) {
const {id, config, optional, slug} = formField
let value = formField.value
const type = fieldTypeToInputType[formField.type]
if (formField.type === InputTypes.DATE && value) {
value = dateHelper.convertAPIDateToDate(value)
}
if (... | 0 |
f4cad19201f5d918857aacf40f4d807c | a869ed3e30ef10cf6f4c37324b1185fb | Fetch configuration from ini files.
Assume a file named foo.ini whose content is like bellow:
[product]
foo.bar.string = 'I am a string'
foo.bar.another = 'I am another string'
[dev:product]
foo.bar.another = 'I am the another string in dev environment' | class Arr implements ConfigInterface
public static function fromIniFile($file) {
if (!is_file($file)) {
throw new Exception("Config file $file not found");
}
$conf = parse_ini_file($file, true);
$all = [];
$queue = new SplQueue;
$environments = array_keys($conf);
foreach ($environments as $one) {
if... | 1 |
97b60f67099b99e46510fba66e71e3da | 28dc623d3c649fda8e98f48a3e849426 | Transforms recursively a list of iterables into a list of list. | final_list = []
for element in args:
if type(element) in SUPPORTED_LIST_TYPES:
try:
if type(element[0]) in SUPPORTED_LIST_TYPES:
for item in element:
final_list.extend(merge_to_list_of_lists(item))
else:
... | 1 |
6a516ebdfe42cc8719b7259771437b74 | e545305c17934563198584a08f854156 | Test that target media type is properly marshaled.
1. Create a link marshaler for an object with specific target media type.
2. Marshal link's target media type.
3. Check the marshaled target media type. | public class ResolvedSnapshotLinkTest extends AbstractFudgeBuilderTestCase
@Test
public void testTargetType() {
assertTrue(StructuredMarketDataSnapshot.class.isAssignableFrom(RESOLVED.getTargetType()));
} | 0 |
7695453c070410aebb0ff6678ad051df | ecbd2488691b899b9e2a482fb3e35a4d | Stops all Raft nodes running in the Raft group. | public class SeparateProcessesClusterManager implements IgniteClusterManager
@Override public void stopCluster() {
root.cluster().stopNodes();
for (Process process : igniteProcesses) {
try {
process.waitFor();
}
catch (InterruptedException e) {
... | 0 |
c6363a06ace3f99dd0379432239df049 | c265b18953830d16fd82ca0e1dc07078 | Read current power policy from Kernel, and set our variables. | {
unsigned int offset;
unsigned int tempPower;
unsigned char EEpowerSelect;
TBLPAG = __builtin_tblpage( &EEenergyUsedLifetime1H );
offset = __builtin_tbloffset( &EEenergyUsedLifetime1H );
tempPower = __builtin_tblrdl( offset );
if( tempPower == 0xFFFF )
{
EEpowerSelect = 8;
}
else
{
TBLPAG = __builtin_tb... | 0 |
70f017009439be56d99db6d9005bd471 | 061921cd4a459c59129bea02b803465c | set the callback for key release | class GameNode:
def SetKeyUpFunction(self,keyname,function):
self.KeyUpFunctionDict[keyname] = function | 1 |
e7a041a0b9a091261c55926275684024 | 4bca61dad144f32bca88fb6602f4612b | yyyymmddhhmmss | def get_current_YYYY_MM_DD_hh_mm_ss():
now = datetime.datetime.now()
string = "%0.4d-%0.2d-%0.2d-%0.2d-%0.2d-%0.2d" % (now.year, now.month, now.day, now.hour, now.minute, now.second)
return string | 1 |
76a17b729d63a6000d06fc502f0f643e | 5af865b0be3412c4ba37400b3884b2d9 | Enables {@link io.micronaut.multitenancy.tenantresolver.FixedTenantResolver}. Default value ({@value #DEFAULT_ENABLE}). | namespace Nec.Nebula
public class NbService
public static void EnableMultiTenant(bool enabled)
{
_sIsMultiTenantEnabled = enabled;
} | 0 |
73683854ddbf64609895bf1486035268 | 5af2f13cf73c1dc1d14438f781e189b5 | 检查监听服务是否开启 | public class NotificationActivity extends Activity implements OnClickListener
public boolean isOpenService() {
boolean result = false;
ContentResolver cr = getContentResolver();
Cursor query = cr.query(Uri.withAppendedPath(
Settings.Secure.CONTENT_URI,
Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES),
... | 1 |
a9a7c6e9a7fcf76b5f9036354a423052 | bcd89f7488c3905f69757d255d14fbf6 | 큐에 대기중인 작업 목록 중 가장 오래된 한 개를 가져온다. | Job job = null;
synchronized (queue) {
if (!queue.isEmpty()) {
job = queue.getFirst();
}
}
return job;
} | 1 |
eed5af86229cb3d650742b59b71d751e | 98c541fe93fbf55012a1a82648137132 | This is a function called by the automatic marker.
This function has the same purpose as 'solveSokoban_elementary', but
it should internally use macro actions as suggested
in the assignment description. Although it internally uses macro
actions, this function should return a sequence of
elementary actions. | current_position, position_0 = self.update_positions(target_row, target_col)
movements = ""
while current_position != (target_row, target_col):
movement = "l" * (position_0[1] - current_position[1])
self.update_puzzle(movement)
movements += movement
... | 1 |
37b9f585166b50113937d4e6d6d2a937 | ad81c37bef90fefd96782bf864588e74 | 修改附件分类 | function updateCategory() {
zTreeObj = $.fn.zTree.getZTreeObj("treeDemo");
var nodes = zTreeObj.getSelectedNodes();
if (nodes.length == 0) {
$.xljUtils.tip('blue','请选择附件分类树节点!');
return;
}
curTreeNode = nodes[0];
editMode = 'update';
window.open('attachmentCategory_edit.html?random='+Date.now(),'_bl... | 1 |
541e9206d12eac5b79ef0ba32e5b3831 | f29aa19f1e9b55a309155b2b9485c515 | Wait until the damon is finished. | class Dispatcher():
def wait_until_finished(self):
self.finished.wait() | 1 |
d8c8ff2878412a14d7622956801faad8 | b0fd3f5f34cf79c86e8aa54ee772a000 | Moves the arm closer to goal. Returns the length of dr. | assert CLOSED_POS <= width <= OPENED_POS
goal = control_msgs.msg.GripperCommandGoal()
goal.command.position = width
goal.command.max_effort = max_effort
self._client.send_goal_and_wait(goal, rospy.Duration(10)) | 0 |
e0ac491b1e2efc426f35c581a7b76646 | 18f481952a349d49ed3d1cef735ee495 | Gets ith "geometricObjects" element | {
IntPtr __ptr = EarthView_World_Spatial_Geometry_CGeometryCollection_getGeometryRef_IGeometry_ev_uint32(this.NativeObject, index);
if(__ptr==IntPtr.Zero)
{
return null;
}
EarthView.World.Spatial.Geometry.Igeometry csObj = new EarthView.World.Spatial.Geometry.Igeometry(CreatedWh... | 1 |
88114f8377edadc7af3ef48d088995c1 | e3c39ce22df3196251ff0d06f73af6d7 | 设置ToolBar背景色 | public class TransparentToolBarView extends RelativeLayout
private void init() {
setBackgroundColor(Color.parseColor(TRANS_COLOR));
} | 1 |
5c7464c543999210b9d7f9589c86cb18 | b0fcd2d77533228f033575620356600a | Returns AI's index by id (index: from 0 to n-1 same order at table; n: number of bots). | for index in range(len(self.hosts)):
if self.hosts[index].id == id:
return index
return None | 1 |
4bcbb4f5a347e2ceeb29fcebde477b86 | c369bf11474e01de67f5b824c41623c0 | 查找制定hxid的群组是否存在 | Result findPublicGroupByHxId(String hxId); | 1 |
cd206df6aa301ebbdb45bc3a49ac9434 | 6ffafa4b44e471f54e85c162ad73efda | 添加投放申请和投产代码清单 | @Controller
@RequestMapping("/wzjjmx")
public class WzjjmxController extends BaseController
@RequestMapping(value = "/plAdd")
@ResponseBody
public Object plAdd() throws Exception {
Map<String, Object> map = new HashMap<String, Object>(16);
String errInfo = "success";
PageData pd = new Pa... | 1 |
f996daa913e5c1bda8288f4546513b89 | 0a770e16289e90124b7ba2fd9f4e6ffd | 更新订单支付状态,司机确认货主支付尾款或货主全款支付,完成订单 | @Controller(Global.APP_SIGN + Global.MALL + "MergePaymentController")
@RequestMapping(Global.MALL_PATH + "/payment/merge")
public class MergePaymentController extends BaseMallController
private Order updateOrderStatusAndRedirect(Order order, HttpServletRequest request, HttpServletResponse response) {
Order newOrder =... | 1 |
903324630ae8e9f6267f591e3d77732b | a6b92345401ed6c8e9315cc06217b915 | Deletes all rows from the servico table. | class ServicoController extends Controller
public function destroy($id)
{
$servico=Servico::whereId($id)->first();
$servico->delete();
return redirect('/servico');
} | 0 |
79a40b7a2f3b800325e0afbab66a8e34 | c93b8ec65ffe6513406b9dd06e42a9ed | Produces a random graph in Erdos-Renyi model | def er_graph(N, p):
G = nx.Graph()
G.add_nodes_from(range(N))
for node1 in G.nodes():
for node2 in G.nodes():
if node1 < node2 and bernoulli.rvs(p=p):
G.add_edge(node1, node2)
return G | 1 |
e0ab724a6f052b8485f878ab3a9aa265 | 762708220ef40003b84efc016a9dd449 | 判断是否相邻版本 | class SystemUpdateAction extends CommonAction
private function isAdjoiningVersion($current, $upgradeTo){
$url = sprintf("%sisAdjoiningVersion/current/%s/upgrade/%s", $this->server, $current, $upgradeTo);
$result = file_get_contents($url);
if(!$result or empty($result)) {
return true;... | 1 |
a30a0992f5816355a11a971d2d6cf89a | eedc02f76398343aff9a0e812442282b | Gets all groups to be skipped | {
$query = "SELECT * FROM `" . $this->addTable('permission_groups') . "`
WHERE
`id` > 2
";
try {
$this->PdoWrapper->prepare($query);
$this->PdoWrapper->execute();
$result = $this->PdoWrapper->fetchAssocList();
if (is_array($resul... | 1 |
0cb3fa3009ef3b7e119b3a84c15ccd82 | 77aac7f181de29b58e8d2b73f37b2f62 | try writing a file, then open it without loading into memory and verify | savedFile := newTestingFile()
buf := new(bytes.Buffer)
savedFile.save(buf)
loadedFile := new(file)
err := loadedFile.load(buf)
if err != nil {
t.Fatal(err)
}
err = equalFiles(savedFile, loadedFile)
if err != nil {
t.Fatal(err)
}
} | 0 |
6e29eccb9ec1c5e1d5bbf5a6faaf5bf0 | 429fa076b01018a0ec347fb9e61e9094 | 发表投票帖子 | class ActivityController extends Controller
public function publishVote(){
if(session('?uname')){
$user = M('User');
$condition['uid'] = session('uid');
$user_info = $user->where($condition)->find();
$data['class_name'] = $user_info['user_class'];
$vote = M('V... | 1 |
12cda0312b5e5b1fc51fccfeacbd8dcf | 9e9b389f8acef596972f7029cd7f956d | Set whether to show extra columns for the data in the objects. | final class Builder
public Builder showFull(boolean value) {
object.setShowFull(value);
return this;
} | 1 |
714d647a0712677f31e9f11cee4a4419 | abace71f6b26a6d94df8e25d5affba00 | @brief 通过AD转换得到的电压值得到相应的氧浓度 | int32_t cal_diff_hight_to_vol_v(int32_t h)
{
float v1,v2;
float f1,D;
v1=(float)(stSysData.V1);
v2=(float)(stSysData.V2);
f1=(float)h;
D=(float)(stSysData.d);
if(f1<D/4){
f1=2*f1/D;
f1=m_interp1_float_fast(hKel,f1,sizeof(hKel)/sizeof(hKel[0]));
v2=(float)(stSysData.V2);
retu... | 0 |
78b1c1cd5be367d11d0412e281da1a57 | 4f19ae91fe3ff4cf5b01c73ec917fe3f | Gets the value of the customerDiscGroup property.
possible object is
{@link String } | @XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "CustomerDTO", propOrder = {
"langSpeak",
"langWritten",
"spid",
"existOctopus",
"addressMaintDTO",
"asiaMileNum",
"bcdRowSeqNb",
"bcpRowSeqNb",
"bcRowSeqNb",
"blacklistActCd",
"blacklistInd",
"chiName",
"chiNameCd... | 0 |
b2820321433976af310c007214673044 | 51fce32ccadd8aa8a2724e9d99b018d3 | auかんたん決済継続課金登録・決済を実行する | $entryTranJcbPrecaInput =& $input->getEntryTranJcbPrecaInput();
$execTranJcbPrecaInput =& $input->getExecTranJcbPrecaInput();
$output = new EntryExecTranJcbPrecaOutput();
$accessId = $execTranJcbPrecaInput->getAccessId();
$accessPass = $execTranJcbPrecaInput->getAccessPass();
$entryFlg = false;
if (is_nul... | 0 |
ed19d87ec93a2a6e3a9e0be126f6f65f | ec17c719a109e6110a592f51b4bd9f7d | get the character's width in bytes | int Sexy::SexyFont::CharWidth( wchar_t theChar )
{
if(!mUpLoaded) GetKTextFace();
if (mKTextFace != NULL)
{
KText* anImageFont = dynamic_cast<KText*>(mKTextFace);
if (anImageFont && mGlyphs.size())
{
for (unsigned int i = 0; i < mGlyphs.size(); i++)
{
if (mGlyphs[i]._c == (unsigned long)theChar)
... | 0 |
d9b834fefde1a7da34ca886829b2967d | 368232da5db8d6316872860d020ed4ce | Returns a value indicating whether this instance is equal to the specified Score instance. | namespace widemeadows.MachineLearning.Classification.Scores
[DebuggerDisplay("Score {Value}")]
public abstract class ScoreBase : IScore
protected virtual bool Equals([CanBeNull] ScoreBase other)
{
if (ReferenceEquals(null, other)) return false;
if (ReferenceEquals(this, other)) r... | 1 |
284451dc775c580ae50e7f494b0ed128 | d3b694a8355b72e1e146a3bb06ebb53a | 创建titles数据层接口。 | class MyService extends app.Service
async find({ keyword, types, nsfw, concern, offset, limit }) {
const notes = {
model: db.Notes,
as: 'notes',
attributes: [],
where: {
typeid: 0,
userid: this.ctx.state.userdata.userid,
},
required: false,
... | 1 |
c7a8e22eebf1c5a9ae1b93c8f1b4dafd | 7343e2faffd49b01f3b00539aff9e9cf | Sets the bits of a 64-bit value to indicate the comparison operator to use for a specified operating system version attribute.
This function is used to build the dwlConditionMask parameter of the <see cref="RtlVerifyVersionInfo(NativeTypes.OSVERSIONINFOEX, uint, ulong)"/> and
<see cref="VerifyVersionInfo(NativeTypes... | namespace Microsoft.Internal.OSVersionHelper
internal static class NativeMethods
[SecuritySafeCritical]
internal static void VER_SET_CONDITION(ref ulong dwlConditionMask, uint dwTypeBitMask, byte dwConditionMask)
{
dwlConditionMask = VerSetConditionMask(dwlConditionMask, dwTypeBitMask, d... | 1 |
f9430911c28327c93ccb1823ae3ba2b3 | 39523912f82ca59bcca2e497624498e2 | Returns new or existing node Peer builder class for this table. | public class DatabaseConnectionHandler
private void createPeerTable() throws SQLException {
createTable(this.schema, "peer", "peer_id SERIAL PRIMARY KEY");
} | 0 |
668d9139e06f5f05f4eba44dd0f40bd7 | 7620aef2aeac97417f5dfa3a4bdd0741 | Clears the days of week arraylist | public class View
public void clearCalendarDays() {
daysPanel.removeAll();
daysPanel.revalidate();
daysPanel.repaint();
aListDayButtons.removeAll(aListDayButtons);
} | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.