query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
9a55eed485330425fc4123762c7ca7c5 | f55961ac746f3bf8acf8297eca9d189e | 重置DI容器 | namespace Framework.Web
public class AspNetDependencyContainer : IDependencyContainer
public void ResetContainer()
{
throw new NotImplementedException();
} | 1 |
8890dd659e51d904f5fef332f06f74b6 | af24ac2ee6ae8a0a87dbd82aa0149cf4 | 获取由$receiverId用户接收的维修工单历史记录 | {
$sql = "select * from " . $this->dbtable . " where receiveUserID=$receiveUserID";
return parent::query($sql);
} | 1 |
187dd3d3a9f0d88b8479e120e1e5a633 | a1b82e5279c2e62fad94a7e17100c810 | +++++++++++++++++++++++++++++++++++++++++++++++++++++
Invoked to render animated version of the ASCII maze
+++++++++++++++++++++++++++++++++++++++++++++++++++++ | {
for (int i = 0; i < mz->height; i++) {
for (int j = 0; j < mz->width; j++) {
if (getTile(mz, i, j) == 1) {
printf(" ");
}
if (getTile(mz, i, j) == 2) {
printf("-");
}
if (getTile(mz, i, j) == 3) {
... | 0 |
7481b3101742e5b7728c48006c60bc21 | 1c35d9f63a5d7e2ecf12577f91b2b836 | Test case for get_audit_log_entries
Get a list of all audit log entries. The query parameters allow you to restrict the returned results by date ranges, resource specifiers, or a full-text search query. # noqa: E501 | class AuditlogsController(BaseController):
def get(cls, request, pk=None, *args, **kwargs):
if pk:
try:
response = cls.model.objects.get(id=pk)
except DoesNotExist:
raise ReplyError(404)
response = response.get_dict()
else:
... | 0 |
b4ec1fde2e32b0a8c2e0d5cff59ee9fc | b1a4b68bb6edb5c892d21f60474a88e9 | 로그인 버튼을 누른경우 로그인창을 띄운다. | public class StartActivity extends AppCompatActivity @Override
protected void onCreate(Bundle savedInstanceState)
@Override
public void onClick(View view) {
Intent intent = new Intent(StartActivity.this, LoginViewActivity.class);
startActivity(intent);
} | 1 |
a4ea1baa996385c2e6f482b80c6031dd | 9694c2720cbd2f95d8f605d60d9cc879 | 根据pid获取产品库存; | namespace BrnMall.Core
IDataReader GetProductStockByPid(int pid); | 1 |
c2db93bc49a8dea958f315053d7f09a2 | fa6d556578efa299af9bcbeccaa7eabf | Grid search in one dimension. Evluate the objective function at equally
spaced locations between the lower and upper boundary of the decision
space. | if self.loss_array is None:
if self.one_sided_dist is None:
self.one_sided_dist = bool((data.min() >= 0).item())
self._define_search_range(data)
self.optimization_method(data)
return self.current_xmin, self.current_xmax | 0 |
5fb09200aa61689801c3a3cd6fa6dfba | 7607a8d0fd377948383268997cb995e6 | Cambiamos la hora de una operación | function changeTime($date, $H, $i) {
$date = getdate($date);
$datetemp = mktime($H,$i,0,$date[mon],$date[mday],$date[year]);
return $datetemp;
} | 1 |
d93ea46b601138d897edc9ce0676d8f8 | 5267a786f9a0932587dd6b317af9e3f2 | 7.3.7 APB2 peripheral clock enable register (RCC_APB2ENR) in [1]
Enable APB2 peripheral clock for PORTC | {
CLOCK_EnableClock(kCLOCK_PortA);
CLOCK_EnableClock(kCLOCK_PortB);
CLOCK_EnableClock(kCLOCK_PortC);
CLOCK_EnableClock(kCLOCK_PortD);
CLOCK_EnableClock(kCLOCK_PortE);
PORT_SetPinMux(PORTE, 0u, kPORT_MuxAlt2);
PORT_SetPinMux(PORTE, 1u, kPORT_MuxAlt2);
PORT_SetPinMux(PORTE, 2u, kPORT_MuxAlt2);
PORT_SetPinMux... | 0 |
f324fcba2ad411078c7305b4f35b951a | de1928fba1e78cae754576f4b7fa8eba | Adds an unweighted edge between two given distinct vertices that are currently in this graph. The desired edge must not already be in this graph.
In a directed graph, the edge points toward the second vertex given. | public boolean addEdge(GVertex<VT> v, GVertex<VT> u, double weight) {
this.addVertex(v);
this.addVertex(u);
HashMap<Integer, Double> tempH = this.edges.get(v.id());
HashMap<Integer, Double> tempHe = this.edges.get(u.id());
if (tempH.containsKey(u.id())) {
return f... | 0 |
949445c3f9046da59cc60999a76e3bc8 | 06c33d61c7f88d903321f3a2027fe326 | Checks whether the foreground tile at the given coordinates is a creature. | if (isInvalidPosition(x, y)) {
return false;
}
return !isUnknown(x, y);
} | 0 |
97a2812f0f2d59461db7ba5fe2dc304f | 95b442d50908a2289e002930f1d71771 | \brief Function: USBH_PowerControl
\details
The test function \b USBH_PowerControl verifies the \b PowerControl function with the sequence: | int32_t val;
TEST_ASSERT(drv->Initialize(USB_PortEvent, USB_PipeEvent) == ARM_DRIVER_OK);
TEST_ASSERT(drv->PowerControl (ARM_POWER_FULL) == ARM_DRIVER_OK);
val = drv->PowerControl (ARM_POWER_LOW);
if (val == ARM_DRIVER_ERROR_UNSUPPORTED) { TEST_MESSAGE("[WARNING] Low power is not supported"); }
else { TE... | 1 |
985952442d66db5690e7c5544344d0da | 794e5b597ad7e663e631f55aacf08f1a | 导入数据,进行预处理,输出两张图像,
分别是输入图像和目标图像(例如,在图像去噪中,输入的是一张带噪声图像,目标图像是无噪声图像) | def process_data(data):
x = []
y = []
for d in data:
dst = cv2.resize(d[0].transpose(1,2,0)*255, (224,224))
cv2.imwrite("s.png", dst)
x.append(d[0])
y.append(d[1])
x = np.array(x)
y = np.array(y)
return x, y | 0 |
fe1dd039a77812ae8cc1516e38d902d4 | 990995c112db7b9c5bfe4135cedc883a | Rotates player position moving the last person to the first position and everyone else down one position | def rotate_players_left():
temp_player = PLAYING_PLAYERS[0]
PLAYING_PLAYERS.remove(temp_player)
PLAYING_PLAYERS.append(temp_player) | 0 |
9826ef0846ecacce58072fbd8282c962 | 5b99344c8ef5494c0bc6d149e94b9225 | Function to make a random 3D movement on a point. | def make_random_movement(position):
assert isinstance(position, np.ndarray)
assert position.shape == (3, 3)
assert is_real_position(position)
emptyCellCoords = []
for i in range(0, 3):
for j in range(0, 3):
if position[i][j] == 0:
emptyCellCoords.append((i, j))
randomIndex = np.floor(np.ra... | 0 |
8071180292839ce31fa8e6185fc0c4ef | 34a38ec2fdb66523afff3576883b6f58 | Método para asigna el ambiente de webpay a la
varible de la clase. | class ObtenerRfcs
setAmbiente(env) {
this.#env = env;
} | 1 |
93caae9d299cc3909b3d2321a0f0a1b3 | 54679144b48d2e5a6f95471abdf50086 | r"""Number of LSN DS-Lite UDP Received bytes. | try :
return self._lsntotnat64udprxpkts
except Exception as e:
raise e | 0 |
a2a388c945a3ec924e238bd7fa3f1646 | 84a69e5ddeb61146b294f88761b7dcdb | 获取电机端轴承、水泵端轴承震动、温度、转速曲线 | {
StringBuilder str = new StringBuilder();
try
{
string pumpJZID = Request["pumpJZID"];
string sql = @"select isnull(day_time,convert(char,dateadd(DD,-6,getdate()),23)) as T_Time,0 result,isnull(data_max,0) as data_max,isnull(data_min,0) as ... | 0 |
b833f6d6f64c223792fd2b8be6aa9d5f | 1a71891faf5da4425742e47e291a1958 | Gets the source network interface instance on which this event occurred
. | public abstract NetworkInterface getNetInterface(); | 1 |
90f9b838fa3a9a2f8d07328667a108b0 | 6aa15b630ae7046ce2560a046149bf8e | Create a magic window to look into another room | script("move 73,102", "move 8,5", "face n",
"command talk", "select yes",
"move 5,0", "exit n")
end | 0 |
48417aa95fd03b6b77ac4870d8c43561 | 3a555dbb10e3ee32366d1cf2ff46e9a6 | Sets the ConversationStore used by this servlet. This function provides a common setup method
for use by the test framework or the servlet's init() function. | public class ActivityFeedServlet extends HttpServlet{
void setConversationStore(ConversationStore conversationStore) {
this.conversationStore = conversationStore;
} | 1 |
5fb349dc99fcbc949f88302fa9e67585 | 08f6090a2002af70851335e0b0c9a0bc | OptQueueParallelism sets the queue worker parallelism. | func WSSWithWorkers(workers uint) WSSOpt {
return func(wss *wqSyncStore) {
wss.workers = workers
}
} | 1 |
df472c38fe420fe1260242ea1eb9dd1f | e99a0aea87a97dd87657a7b04224973a | 类型五添加题目 | @Controller
@RequestMapping("teacher")
public class PaperController
@RequestMapping(value = "{courseId}/paper/{paperId}/addTfQuestion",method = RequestMethod.POST)
@ResponseBody
public Map<String,String> addTfQuestion2(@PathVariable String courseId,@PathVariable String paperId,
... | 0 |
b2399804bc6bc3ff91bdd9e913e61596 | 8a1b18373fbb9db797f21700f2b0667d | 按照买家昵称下载 | class sitemap
function seller($nick) {
set_time_limit(180);
$items = array ();
$this->_seller($items, $nick, 1);
$editHtm = TPL :: module('xintao/sitemap_baidu', array (
'items' => $items
), FALSE, FALSE);
return RST($editHtm);
} | 0 |
1802b6283d7515211104a57b36737883 | e33181654f7b0c780de23d470efe70a6 | Register perf counter storages | int perf_cntr_start(int which, int mode, int count_type) {
perf_cntr_clear(which);
PMCR_CTRL(which) = PMCR_RUN | mode | (count_type << PMCR_CLOCK_TYPE_SHIFT);
return 0;
} | 0 |
106c4b28dc581885c160af8d5fffeaaf | 8f76e2bea62cc9e72e32b762c4b53ebe | Returns the next coordinate to explore in a sudoku puzzle, regardless of
whether or not the cell is actually empty. The order is left to right,
top to bottom. | for i in range(4):
for j in range(4):
if not puzzle[i][j]:
return [i, j] | 0 |
a3b5fbced6bfbae1762131ee5769ca59 | 9dc63688144c1ae47afac88ebbd58843 | Correct any violations of the RBT properties after performing
a standard BST insert. There are only two possible property
violations (See notes for full details). | public class RBT<E extends Comparable<E>>
private void fixInsert(Node<E> curNode) {
Node<E> temp = null;
while(curNode.getParent().getColor() == 'R') {
if(curNode.getParent() == curNode.getParent().getParent().getLeftChild()) {
temp = curNode.getParent().getParent().getRightChild();
if (temp.getColor() =... | 1 |
0e81d8ff6eb5dd4c10af92ca99e7043c | 4e895b871f272a53cf51d185b473c6c3 | Gets the energies in the same order as the fragments were returned. | class Atom1e(object):
def get_energies(self):
return [mF_level['energy'] for mF_level in self.get_mF_list()] | 1 |
352832b0754c32a385c29eb47c500e91 | 4ce0360ec057abf2a455e50f7ce56e2b | dado un número entero por parámetro determinar cuantos 1’s tiene en binario | def numOnes(intInput):
if intInput==0:
return 0
else:
if intInput%2==1:
return 1 + numOnes(intInput//2)
else:
return numOnes(intInput//2) | 1 |
7572c574bd32778d3a36766922409d87 | 43b2880dd1dedccfa15dbe28503a8d93 | <pre>
Cluster-level autoscaling configuration.
</pre>
<code>.google.container.v1beta1.ClusterAutoscaling autoscaling = 26;</code> | if (autoScalingGroups == null) {
autoScalingGroups = new com.amazonaws.internal.ListWithAutoConstructFlag<AutoScalingGroup>();
autoScalingGroups.setAutoConstruct(true);
}
return autoScalingGroups;
} | 0 |
c77f2f1516b42c0d1aab571893fbc199 | 627b370cc46997f345b583e036bd3766 | 从文件中读取单个字符, 使用fgetc函数 | {
char c;
if (read(kfd, &c, 1) < 0)
{
perror("read():");
exit(-1);
}
return c;
} | 0 |
69f5852c72c0547cf18110d081d0e89f | cded56aa9354b7016401dc29e15763d8 | Vérifie si l'hôtel existe déjà dans la base de données
levée | public class PlannerActivity extends androidx.fragment.app.Fragment implements
IWebServiceTaskResult
private void checkIfHotelExist() {
if (((AutoCompleteTextView) Objects.requireNonNull(getActivity()).findViewById(R.id.autoCompleteHotel))
.getText().toString().equals("")) {
showToast(getResources().getStrin... | 1 |
84480069bd29f4b54331abf4236a4ab2 | 0042cb35b2660a85b732834e1c5f6db2 | 存储分类数据 | class CategorysController extends CommonController
public function store(Request $request)
{
$result = $this->categorys->createCategorys($request->all());
return redirect(url('admin/categorys/create'));
} | 1 |
1b513ee53a25418268f3ee960182cb90 | 8d34aed22925a2e4f57269c9206e97c7 | Returns the meta object for class '{@link su.nsk.iae.reflexdt.reflex.shift_expression <em>shift expression</em>}'.
<!-- begin-user-doc -->
<!-- end-user-doc --> | EClass getexpression(); | 0 |
b9d412c91386037cfbeecfe85435a92a | 0436598d2a5569108361ded6d33ad981 | Specifies if threads should be used and if so what the maximum number of threads should be. | namespace System.Threading
public static class ThreadPool
public static bool SetMaxThreads(int workerThreads, int completionPortThreads)
{
return false;
} | 1 |
1feea9a9aaf09e1ac96e08eb5cc7177c | c9169316a076733b9f6692f24e905526 | Applies the changes linked to the '2' remove button. | model = self.table.model()
if not isinstance(model, QSqlTableModel):
return
model.setEditStrategy(QSqlTableModel.OnManualSubmit)
currentSelection = self.table.selectionModel().selectedIndexes()
for selectedIndex in currentSelection:
if selectedIndex.column... | 1 |
eef0850f11081aa1840ada95e8b2d869 | e06369d03c5038ef5a84523012e6bd14 | 判断是否是同一个请求 | namespace DotnetSpiderLite.Scheduler
bool IsDuplicate(Request request); | 1 |
36b70ace7750563db57a053424660eba | edc2af23d2cbaeb6c95e620151663f8e | 获取三个点组成的三角形外接圆圆心 | namespace kGIS_App
public class CTinClass
public class Triangle
public void CirclePoint()
{
circlePoint = new z_doublepoint();
double a, b, c;
a = Math.Sqrt(Math.Pow(p1.x - p2.x, 2) + Math.Pow(p1.y - p2.y, 2));
b = Math.Sqrt(Math.Po... | 0 |
e58299cb864e1fa3f75689b79bbfe815 | 6483dd749ec644b5ef10d56646dcf11e | Override the __repr__ method so that we are able to print a displayable board
for the user. | class Board:
def __repr__(self):
result = ""
for row in self.rows:
for cell in row:
result = result + cell
result = result + "\n"
return result | 1 |
178e3eeb11d7e2bab44998eb7bbfdb5f | e203d89523a7e498ffa25aba6f3f986b | Set the selected base index to a specific DNA index. | public class VARNAPanel extends JPanel
public void highlightSelectedBase(ModeleBase m) {
ArrayList<Integer> v = new ArrayList<Integer>();
int sel = m.getIndex();
if (sel != -1) {
v.add(sel);
}
setSelection(v);
} | 1 |
53869e5a9a874b5c01fac3228fb2bca2 | 409ceb40cc0f704bac69bfcbc29c6a91 | @brief
Clear the reset cause register.
This function clears all the reset cause bits of the RSTCAUSE register.
The reset cause bits must be cleared by software before a new reset occurs.
Otherwise, reset causes may accumulate. See @ref RMU_ResetCauseGet(). | {
RSTCU_PeripReset_TypeDef RSTCUReset = {{0}};
RSTCUReset.Bit.CMP = 1;
RSTCU_PeripReset(RSTCUReset, ENABLE);
} | 0 |
88734bb7707f45b66cb1130e2840b94b | 7ac0a25383752de7362feff7734d68c1 | Retreives the current user via the configured role provider implementation. | namespace Microsoft.Extensions.DependencyInjection
public static class ServiceExtensions
public static ClaimsPrincipal GetCurrentUser(this IServiceProvider provider)
{
try
{
IPrincipal user = provider.GetService<IPrincipal>();
return user as ClaimsPrin... | 0 |
24d9b5f20d4efdeefe31608eed003a72 | 0df6e813d061e6a78bbd4e3ba50060e5 | {@code DELETE /guild-server-strikes/:id} : delete the "id" guildServerStrike. | @RequestMapping(value = "{id}", method = RequestMethod.DELETE)
@ResponseStatus(HttpStatus.NO_CONTENT)
public void delete(@PathVariable("id") ID id) {
this.repository.delete(id);
} | 1 |
1a3536ddf885112b548c928a22a6c5fa | fa30ff3c880d3dfcfbc22c8a11e8855c | 首先判断该路径是文件夹还是文件,如果是文件,直接删除,
如果是文件夹,看他里面是否有内容,如果没有内容,直接删除,如果有内容,遍历每一个内容
针对每一个内容,重复上述步骤 | boolean flag = false;
File file = new File(sPath);
if (!file.exists()) {
return flag;
} else {
if (file.isFile()) {
return deleteFile(sPath);
} else {
return deleteDirectory(sPath);
}
}
} | 0 |
58d53003b7d0a3df166f43b03b1ebeee | 5d9409f06600117db7d5aeba2dd24618 | Home Page: Get lists of posting and users and display them as cards | main_list = Post.objects.filter(status='published').order_by('-created_on')
featured_list = Post.objects.filter(status='published').filter(is_featured=True).order_by('-created_on')[:3]
paginator = Paginator(main_list, 5)
page_number = request.GET.get('page')
try:
main_list = paginator.page... | 0 |
baee1c5c8874eb4533f6c1ea6733ec16 | 2fc27331e43020971e6c2c1cc3d5152e | Verify the home page title | public void homePageTitle() {
HomePage homepage = PageFactory.initElements(driver, HomePage.class);
homepage.go(driver);
assertTrue(driver.getTitle().contains("Automation Training"));
} | 1 |
07fd8b5a8434bff8e3411473c6b3afb1 | fec128562bf82e6c8aa770e7a07698bb | Returns occupation names by text | names = self.mainMenu.agents.get_agent_names()
mline = line.partition(' ')[2]
offs = len(mline) - len(text)
return [s[offs:] for s in names if s.startswith(mline)] | 0 |
fc99334dbc491d53d04e60510179b53f | 215833ac634d4c17824e7f90b9a3f897 | Handler for ShowAttractor_Checkbox click event. | namespace DiffusionCurves
public partial class MainWindow : Window
private void DisplayDiffusion_Toggled(object sender, ExecutedRoutedEventArgs e)
{
if (CheckCurves.IsChecked.Value)
CheckCurves_Unchecked(null, null);
else
CheckCurves_Checked(null, null... | 0 |
590cf8fff93cf3b5c9d0076e62f9db6c | 01a029b1614e65b84bfd315252e39080 | 返回前一天日期字符串 | public class DateUtil
public static String getPreDay(String dateStr) {
String afterDay = "";
Date originDate = DateUtil.dateString2Util(dateStr, DATE_FORMAT);
afterDay = DateUtil.dateUtil2String(DateUtil.getNewDateByAdd(originDate, -1), DATE_FORMAT);
return afterDay;
} | 1 |
e6c233a8097374b678bdce9a520f22c2 | 575792cb990ce5bbd1b1b4521e8b7ced | Our entry point in to the system. | namespace Monitor.Sentry
public partial class Sentry : ServiceBase
static void Main(string[] args)
{
_container = new StructureMap.Container(new GlobalRegistry());
var sentry = _container.GetInstance<Sentry>();
if (Environment.UserInteractive)
{
sentry.OnStart(args);
Console.WriteLine("Sentry run... | 1 |
6b36514da1c03102e9373818a2ec9ec8 | 4951bb97bf551ba91357e5d633d6f8c4 | Handles the Click event of the btnAssociate control. | namespace ViverMais.View.Farmacia
public partial class Inc_AssociarSetorUnidade : System.Web.UI.UserControl
protected void OnClick_Salvar(object sender, EventArgs e)
{
if (CustomValidator_Associar.IsValid)
{
try
{
ISetor iSetor = Fa... | 1 |
d847f148179cfd16b964ed8cf5f5900a | e69d1132141664d491c4945898e02faf | Extract message length. eg: `~m~457~m~` -> 457 | var messageText = message.getText();
var messageElements = messageText.split(":");
return parseInt(messageElements[2]);
} | 0 |
f5dfd396a31d379c9f5482d30186eb8d | cad239df1f6f8dc195d2ad3a7eeee192 | 根据条件返回图纸集合 | {
SQLHelper.connString = Globals.connStrGroupDBName;
StringBuilder sb = new StringBuilder();
sb.Append("select DrawingId,DrawingClassId from code_Drawing where 1=1 ");
if (String.IsNullOrEmpty(fileId) == false)
{
sb.Append(" AND DocIdMo... | 1 |
77e991662ea11c5be6412a47dd32e079 | 2e72053a406410cb9edacef01b4dad7e | 在members表中更新$data信息 | class MemberModel extends RelationModel
public function saveData($where, $data) {
return $this->_Member->where($where)->save($data);
} | 1 |
317fec484dfc62c5117291e76a9e2eb4 | 9a0af77ae51e806902b74ab94ece7eb4 | Set the buy confirm indicator. | int setOrderToBuyerConfirming(Long orderId); | 1 |
4cef67b315fb4aae81d1b3910b891c51 | 57cecbcfddeaf40aa943a39cacb5ab04 | If the local player died, send the drop flag event to all players | public class EntityPlayerMP extends EntityPlayer implements ICrafting
public void onDeath(DamageSource par1DamageSource)
{
minecraftInstance.getConfigurationManager().sendPacketToAllPlayers(new Packet3Chat(par1DamageSource.func_76360_b(this)));
inventory.dropAllItems();
} | 1 |
68380678f5988b13c2222a40e1dedd07 | cdb5e805ddefef75ff4284472750d1a6 | Calcule l'integrale d'une fonction par la formule des point milieux | def pt_milieu(f,a,b,n):
h = (b-a)/n
xm = a + (0.5+np.arange(n))*h
Q = h*np.sum(f(xm))
return Q | 1 |
12de1c4bf6cc182e3e28c1f997f81e42 | 89fbddc7a6d6c061fe40b8a248a3e199 | Calculate the r distance derivative of the indirect ray. | class SpecializedRayTracer(BasicRayTracer):
def _r_distance_derivative(self, theta, z0, z1):
if not self.valid_ice_model:
raise TypeError("Ice model must inherit methods from "+
"pyrex.AntarcticIce")
beta = np.sin(theta) * self.n0
beta_prime = np.cos(theta... | 1 |
c345b7f9a4ec45735aae7c8570dbe639 | be86d81d959cf76d5c2c530a5e8522ad | Sets the time stamp attribute to the current date time in utc format. | void TInternetMessageHeader::setCurrentDate()
{
setDate(THttpUtility::getUTCTimeString());
} | 1 |
e0ede825c84f651d45ce5f4bdd21fb55 | b0da03999e01a8aa27afe169048a9b90 | 3.16. Replace consonants w/ following consonant in alphabet | TEST_F(SoundexEncoding, ReplaceMultipleConsonantWithDigits)
{
ASSERT_THAT(soundex.encode("Acdl"),testing::Eq("A234"));
ASSERT_THAT(soundex.encode("acdl"),testing::Eq("A234"));
} | 0 |
20d597cd4f9a16b75d78eb11a22db790 | 8c1265a9c86600f8989819a6543614b7 | helper to get the system default selectable background | public class BackgroundHelper
private int getSelectableBackground(Context context) {
TypedValue outValue = new TypedValue();
context.getTheme().resolveAttribute(R.attr.selectableItemBackground, outValue, true);
return outValue.resourceId;
} | 1 |
758ff66b4add943a5b313a21ea27c293 | e7dcd8ba8597106677e72fabe4ebabce | Check if a given object is this specific Tank | {
Vector2D topLeftWall = new Vector2D(w.GetStartingPoint().GetX() - 55, w.GetStartingPoint().GetY() - 55);
Vector2D bottomRightWall = new Vector2D(w.GetEndingPoint().GetX() + 55, w.GetEndingPoint().GetY() + 55);
Vector2D tankLocation = new Vector2D(tank.GetLocation().GetX(), ... | 0 |
63defc8b3e27d74f9453d0a0d9574d1c | 4fc89583baedcd9f7a779aba2f91c922 | Metodo que se encarga de actualizar la Observación del concepto en la BD al Ingresar un Nuevo REPORTE MENSUAL, | {
using (TransactionScope ts = new TransactionScope())
{
try
{
SqlCommand cmd = new SqlCommand();
cmd.Connection = con;
cmd.CommandType = CommandType.StoredProcedure;
con.Open(... | 1 |
bead6e57d71e03fff43004de56d5b99f | 95dcfbd63e006fd480554f3661809a19 | Run the a priori algorithm and return the applicable item_models & generated association rules | item_sets, rule_sets = apriori.runApriori(data_iter, min_support, min_confidence)
rule_entities = []
for r_set in rule_sets:
rule_entity = AssociationRuleModel(list(r_set[0][0]), list(r_set[0][1]), r_set[1])
rule_entities.append(rule_entity)
_print_items_and_rules(item_sets, rule_entitie... | 1 |
e9a03139091ca4d479e94b28ae20fdc8 | 38f28d4654e3e7895b6b49b57f0beb55 | 查看某一班级已布置到早高作业的次数 | namespace XGhms.BLL
public partial class homework_student
public int GetStuWorkNum(int stuID)
{
return hwstuDal.GetStuWorkNum(stuID);
} | 0 |
852e3bc53419d2df24e195227d15197c | 95fe2f13516d5767cd0b6df67f378447 | Get current seconds since epoch as an int.
Returns:
int representation of seconds since epoch. | def timestamp() -> int:
return int(time()) | 1 |
dec7bd4cbd4ce5d5e34a43fa5d88224a | 472324dc8a968b2f18694e09ab1e2f5e | 跳转到 日期选择页面 | openDate(){
wx.navigateTo({
url: '/pages/date/date',
})
} | 1 |
47a2e502d99b2f85db8e9815316a741e | d3df278fcfde1d2260cb395042e12c65 | Gets the first face. | {
PointF[] bounds = GetFaceBounds();
PointF min = bounds[0];
PointF max = bounds[1];
PointF center = new PointF((min.X + max.X) / 2, (min.Y + max.Y) / 2);
return new Matrix4(new Vector4(center.X, center.Y, 0));
} | 0 |
da50b6139410aa47b3a8627a1a69876e | 262fdd5a535197431fc6d9d5dac7a363 | 返回队列的第一个元素,如果为空则等待直至有元素被加入队列,超时时间为None则一直等待 | class RedisQueue(object):
def get_wait(self, timeout=None):
item = self.__db.blpop(self.key, timeout=timeout)
return item | 1 |
6f1b67ca1115cb1148ab9384f38dc66c | 5a2335dc3af860a0d3e89d5e697f62e7 | 律师注册参数检查 | class RegisterController extends BaseController
public function getTeacherParam($request)
{
$data = $request->param();
$data = parent::getParam($data);
if(!parent::inspectIllegalString($data['TEA_Name'])){
if(parent::inspectPhoneNum($data['TEA_Phone']))
return $da... | 0 |
78af6d9dbab66fca6e9f1ac8c07735f0 | 88c5fc836cd95a7a045c5d60c6ec9f71 | 选中当前行的下一行。 | public class WebTree<E extends DefaultMutableTreeNode> extends JTree implements
EventMethods, SettingsMethods, FontMethods<WebTree<E>>
public void selectNextRow() {
selectNextRow(true);
} | 1 |
8e1e8ea3ab79d592016504e42a94eb4d | 613e11d140b30f89acd82e9d2389b2ad | Estimate percentile locations from a sample from distribution | x = validate_samples(x, n_dim=1)
y = np.empty(len(x))
for i, x_ in enumerate(x):
for j in range(self.n_bins):
if (self.bins[j] <= x_) & (x_ < self.bins[j + 1]):
y[i] = self.means[j]
return y | 0 |
77d3d4b94490c64a92a16ffdbca644a9 | 03d3502fd039f2da7e8f40a93c5434b7 | 教师一学年发布的作业数量 | @Query(value = "select count(*) from homework where course_id in (select cs.course_id from course_selection cs, course c where cs.course_id=c.id and c.term=:term and cs.student_id=:studentId and cs.valid=true)",nativeQuery = true)
int getHomeworkTermCountByStudentIdAndTerm(@Param("studentId") int studentId, @Param(... | 0 |
4231e23632994952d8d18f74da0f8a48 | 982b4e1fa5ca584abf5333823a927eab | funcion que da permiso al usuario para que sea administrador | $db = new PDO('mysql:host='.HOST.'; dbname='.DATABASE.'; charset=utf8',USERNAME,PASSWORD);
$query = "UPDATE users SET rights = 2 WHERE username = ?";
$sQuery = $db->prepare($query);
$sQuery->bindParam(1,$username);
$sQuery->execute();
} | 1 |
f5c821d803921fcb080510fc71fab1c4 | 3c14120994a26ceff2365266b3fee8e0 | Retrieve the list of cards that contain this keyword. | self._verify_key()
with self._database.open(self.db_cards) as db:
cards_list = db[self.db_key]
return cards_list | 0 |
b3aa83a9c4ba7dfcc51af4e12f8d2bd9 | 557d3b5d3ca1e310ac8e57f72d1ba400 | 更新mock值 | assignMock (newMock, oldMock) {
for (const key in newMock) {
if (typeof oldMock[key] !== 'undefined') {
if (this.isString(newMock[key]) && !(this.isArray(oldMock[key]) || this.isObject(oldMock[key]))) {
newMock[key] = oldMock[key]
} else if (this.isObject(newMock[key]) && this.isO... | 1 |
f6e2b3ccc4878e3adfd3a59462a973e9 | ed8dfe70e3fe2c377098698262f09c50 | NewSessionBuilder creates a SessionBuilder object | s := bboltStorage{db: db, bucket: bucket}
return SessionStorage{
Session: kv.NewSession(s, key),
}
} | 0 |
fb34cf37479d69f4f78442f3246c7fcd | 6062eeccef903eb9a036f66093a93b23 | Flips the conveyor belt horizontally | public class ConveyerBelt : MonoBehaviour
void Update () {
transform.position += new Vector3(gameManager.beltSpeed, 0, 0);
if(transform.position.x >= 8.05){
ResetLine();
}
} | 0 |
5439c4606abd42303a41591ec078724a | 3836192a0e03f54fb8c448a2d0a4851b | Return a list of service codes currently in the database | class BaseInterface(object):
def get_svc_list(self):
return self.services_if_pool.get_transients_available() | 0 |
626838bc3ae137c670d8af91b6ce36c6 | b4b2a50cbbbe4960ec256ab1a6411287 | Checks if a recovery message has to be triggered | try {
const recoveryEvents = await apolloClient.query<
RecoveryEventsForSessionQuery,
RecoveryEventsForSessionQueryVariables
>({
query: RecoveryEventsForSessionDocument,
variables: {
colonyAddress,
blockNumber,
},
})... | 1 |
82a4e05c84d1bbda8b49d840809a272b | 76046b88e9eab67c7abe34225c081cbc | Test search for a question based on substring | res = self.client().post('/api/questions',
json={'searchTerm': 'soccer'}
)
data = json.loads(res.data)
self.assertEqual(res.status_code, 200)
self.assertEqual(data['success'], True)
self.assertEqual(data['total_que... | 1 |
feae48deaebdc839bb50c7361f95b220 | bb15f9af88a1222533e0e08a37e6a9b2 | calculate the number of hashes per second by the running machine | {
var sw = new Stopwatch();
sw.Start();
calculateHash(iteration);
return (int) sw.ElapsedMilliseconds;
} | 0 |
e06ae5f2f0798026251ab67c815f3097 | b7acdc479016ad8e0dbdab8c49fe10b6 | Free blast file. | {
for(int i = 0; i < Blasts_N; i++)
{
blast->gone = 1;
blast->color = al_map_rgb_f(1, 0, 0);
blast++;
}
} | 0 |
3dc1196175c64bec7159fba7d8c0714b | d445cd652d159148f277c0a5c523c7c3 | Deletes an existing LookupDistrict model.
If deletion is successful, the browser will be redirected to the 'index' page. | {
try {
$this->district->destroy($id);
return redirect(route('district.index'))->with('message', trans('province.delete_success'));
} catch (ModelNotFoundException $ex) {
return $ex->getMessage();
}
} | 1 |
382bc1efdcd29ca81a42af43a1ef98eb | e3ab44482a11521add1d6db6fee8b997 | Sets the edge detection sensitivity. | class TisCamera(Base, EmptyInterface):
def set_edge_detection(self, boolean):
self.edges = boolean | 0 |
1920b47ff5e7453ab9c452cf1b0435e0 | d7d03e042c1f57c6cd939f0a64fce0bc | Initialize with the three args. | class GuessThree(AlgoBase):
def __init__(self):
AlgoBase.__init__(self) | 0 |
f7cdfd1069efd40bc4bfd81e7c44fa3b | 6e14eac7d852cb4e4b8b79e7a3d79cc2 | Updates a shipping option's availability status | {
string cs = ConfigurationManager.ConnectionStrings["JerseySure"].ConnectionString;
int rows;
using (SqlConnection connection = new SqlConnection(cs))
{
SqlCommand command = new SqlCommand("usp_toggleShipActive", connection)
{
CommandType = Com... | 1 |
4dcad9e62975dfd2e31d74cf80a87563 | 41fbff6dd803449dbbcf31c5500ebff3 | Open the file in filepath using defaut OS Application
Return:
True / False | try:
if os.path.exists(os.path.abspath(filename)) and os.path.isfile(os.path.abspath(filename)) and os.access(os.path.abspath(filename), R_OK):
return True
fullPath = str.join(os.getcwd(), filename[1:])
return os.path.exists(fullPath) and os.path.isfile(fullPa... | 0 |
cc5de17b48fc0825c2020dd310721335 | a2ac3508827380b14ff0158391f2159f | 整数向上取整除法 | unsigned int iDivUp(unsigned int dividend, unsigned int divisor)
{
return (dividend % divisor == 0) ? (dividend / divisor) : (dividend / divisor + 1);
} | 1 |
68c66f0035f804177c0424b01b910eb7 | 910beb8d7b7f1cc07faa809a516b7f17 | 根据装车任务ID和派送单号查询历史装车差异报告
装车任务ID
派送单编号 | @Override
public List<String> queryUnResolvedDiffReport(int threadNo, int threadCount,Date bizDate,Date deliverBizDate) {
Map paramsMap = new HashMap();
List unloadTypeList = new ArrayList<String>();
unloadTypeList.add(UnloadConstants.UNLOAD_TASK_TYPE_LONG_DISTANCE);
unloadTypeList.add(UnloadConstants.UNLOAD_... | 0 |
b269807755a2a2f549b4f2858cd9f0c9 | b14035b79047cfc91a46c094c67094be | Permite cargar las centrales de la empresa seleccionada | if (!isset($id)) {
$idAux = \Auth::user()->id;
try {
$id = Enterprise::select('id')->where('user_id', '=',$idAux)->get();
if (!$id->isEmpty() && $id[0]) {
$id= $id[0]->id;
} else {
abort('500');
... | 1 |
abfb432a2f1a3f8cb077d31d73d025eb | 7b1f20533932f9d76a362c2819033901 | 通过登入的学生id得到他的课表 | namespace DJTUStudentSystem.MVCWEB.Controllers
public class GetJsonController : Controller
public ActionResult GetStudentNowKCBWithStuID_Json()
{ if (Session["Student"] == null) { return Content("登陆信息丢失,请重新登陆!".ToUpper()); }
var CheckSessionResult = SessionHelper.CheckSession("获取学生课表", 10);
... | 1 |
eea2530d71c6ec96ef02cd591778ba61 | 829c47b5fa343548b0aee3fa9460f8f4 | Gets the paid listing enhancements chosen for the listing | {
$baseVals = [
self::REQUIREMENTS_LISTING,
self::REQUIREMENTS_LISTING_PRODUCT_ONLY,
self::REQUIREMENTS_LISTING_OFFER_ONLY,
];
return array_map(function ($val) { return strtoupper($val); }, $baseVals);
} | 0 |
f75be18076d08fa6d96378155507dc6b | 7abcb21548a86d58b2334b71cdca3223 | Overrite string to an .osu file readable format. | output = ''
card_lines = []
for card in card_list:
split_card = str(card).split('\n')
for i in range(len(split_card)):
split_card[i] = uno.get_color_str(card.get_color()) + split_card[i] + uno.bcolors.ENDC
card_lines.append(split_card)
for row_in... | 0 |
1253c5df2eb43248c50f2c1151c6f581 | 97d501841fc68b9741df950b0a3d4b5f | 获取sql详情,包括:sql类型、sql中使用的表名 | sql = string_module.removeNoise(sql)
tableName = string_module.getParenthesesContext2(sql, "INSERT INTO ", " ")
columns = tableInfo[tableName]
return (tableName, columns) | 1 |
0578e4738d73c1993e3f3b8992552164 | 8cb4c78f8c123e845ef716304d6773d9 | 将字典转为namedtuple,生成的数据将不可更改,比AttrDict更节约内存 | def convert_to_namedtuple(dict):
return namedtuple('X', dict.keys())(*dict.values()) | 1 |
7aced53470b1f9f8dc1202cef4bb1f63 | b58e37eb2d9f220151eaf5d9355d28e6 | Átkonvertálja a world pozíciót grid pozícióvá | namespace COCSLG_Game
public class HomeGridManager : Singleton<HomeGridManager>, ISingleton
public Vector3 WorldPosToGridPos(Vector3 worldPos)
{
Vector3 result = worldPos;
result.x -= center.x;
result.x /= cellSize;
result.z -= center.z;
result.z /... | 1 |
ebd28f840a42e131d616e0a5c50954ef | 3bca06f2c0aea3fddf9c5cbabfbb1851 | Combine 'load' and 'spawn' to fire projectiles based on a schedule. | {
bool bIsReloaded = (GetWorld()->GetTimeSeconds() - fLastFireTime) > fTankReloadTimer;
if (ensure(TankBarrel) && bIsReloaded && iCurrentAmmo != 0)
{
FVector SpawnLoc = TankBarrel->GetSocketLocation(FName("ProjectileLocation"));
FRotator SpawnRot = TankBarrel->GetSocketRotation(FName("ProjectileLocation"));
if... | 1 |
c316bc3f108bfc6d51892496a06578ee | df9e0347d1602fdf9f04f6347b6675e1 | Returns a deferred that will be called once the process starts. | if self.shutdownDeferred:
return self.shutdownDeferred
if self.is_starting():
cancelDeferred = defer.Deferred()
self.startupDeferred.addCallback(self._stop_when_started, cancelDeferred)
self.startupDeferred.addErrback(self._stop_when_started, cancelDeferred)
return cancelDeferred
... | 0 |
394a4e17c9667b3f2011378ccd97a545 | b70b78b1f169041cc475a0625379c0bf | 费用报销统计 | $start_time = strtotime(I('get.start_time'));
$end_time = strtotime(I('get.end_time'));
$where =[];
if($start_time){
$where['create_time'] = ['egt',$start_time];
}
if($start_time && $end_time ){
$where['create_time'] = [
['egt',$sta... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.