query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
9297e78b7e33aebf28c620e42d1fb279 | 940de0156b3b4e4eaf2469d5915d4764 | Following Function generates
exponentially distributed
random numbers | double expdev(double lambda)
{
double dummy;
do
dummy = (double) rand()/RAND_MAX;
while (dummy == 0.0);
return -log(dummy) / lambda;
} | 1 |
63e369333097f288f8b71ed4c945d54d | 14b975cdb0d5804a53cd677e7cdb41bf | Generate random box id | $id = sprintf( '%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ),
mt_rand( 0, 0xffff ),
mt_rand( 0, 0x0fff ) | 0x4000,
mt_rand( 0, 0x3fff ) | 0x8000,
mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ... | 1 |
a4e938f6770768c50367657cda60e25a | 33bd858149afcf38cbc8cdff5c389309 | Displays that the lobby has been successfully created | namespace Network
public class NetworkLobbyManager : MonoBehaviourPunCallbacks
public override void OnCreatedRoom()
{
base.OnCreatedRoom();
Debug.Log("ROOM CREATED!");
} | 1 |
0bfab565ed788e4fc60c223e49dd166b | be23de21aee8a270f5680cf76c1c0016 | 发送一个字符串并且返回相同的字符串 | def echo (say)
return say
end | 1 |
823d991a67318d55e6c49f2fc2774087 | 31e34edb0260f9a14f2227d64b03a877 | Redireciona para a etapa de Carrinho de compras.
Redirects to the Shop Cart step. | {
if ($request->ajax()) {
return response()->json();
}
else {
session()->put('checkout-step-1', $request->input());
return redirect()->route('checkout-payment');
}
} | 0 |
7f5678f7a74192b4ce8078a8d413b676 | 88b99dbca1a6fdbe85353bccadc44ad4 | Sets the daisy-chain fields in the physical context | {
void *ddcp = pDdc->pDdCtx;
void *pMem, *pa;
DpalCtx_Zip2_t *pDpal;
int pri;
SYS_UINT32 i;
pDpal = (DpalCtx_Zip2_t *)ClnkOsal_Alloc(sizeof(DpalCtx_Zip2_t));
pDdc->pDpalCtx = (void *)pDpal;
pDdc->rxList.rxMemSize = sizeof(PktEntry_t) * (hparams->numRxHostDesc);
pMem = (SYS_UINT8*)Cl... | 0 |
f647db75354d8eb134eee5cef9b234bb | fe5c187237cafea2bd5cfadfb2b97b6d | Start event loop in separate thread. | class MultiAgentManager:
def _run_thread(self) -> None:
self._loop = asyncio.new_event_loop()
self._loop.run_until_complete(self._manager_loop()) | 0 |
d1928ccb23d0ec2fb942d7d52b3f38d4 | 1ae2492e1b5b41f97e650a32bb904ff2 | 删除ListView中的指定主机 | {
ContainerModel model = this.HiddenHostList.SingleOrDefault(x => x.Name.Equals(param.ToString()));
int index = HiddenHostList.IndexOf(model);
if (index >= 0 && index < HiddenHostList.Count)
{
HiddenHostList.RemoveAt(index);
OnPrope... | 1 |
3e292e95007bb929ce8212dcfa5f94bc | 9f496ee6a7aae2b3c8083241bbb46cf9 | 根据字典参数和请求的url获得数据 | showLoading();
$.ajax({
cache: true,
type: "POST",
dataType: "json",
url: "/Api/WebApi.aspx?action=requestdata",
data: {
"urltype": urltype,
"pageurl": pageurl,
"data": JSON.stringify(data)
},
async: true,
error:... | 1 |
3fee30dd187c3465fcf703b2dbc30bfb | 343f750a26179bf14f2e20ca1e371a6d | OnPaint event handler. Draws the alignment buttons and the position marker text. | canvas.create_rectangle(mode.toolBarMargin, 0, mode.width, 50, fill="grey", width=0)
for button in mode.alignBarButtons:
mode.drawButton(canvas, button)
if mode.curTool == 2 or (mode.curTool == 0 and mode.selectedHasText()):
mode.drawTextTools(canvas) | 1 |
98d0503e7edea14d32db8b2e33cdbd4a | d76902d7947914d1b06a0060266c7342 | Sets the Weighted AODE flag | class CSystemStatus():
def SetWeightA(self, weight):
self.weightA = weight | 0 |
3dbc8c35e2ca3c615e3dc7e5ccb97bc6 | 9bc019184a155f0e155ebe48a1d85532 | Returns a list of Card objects from the watchlist, raises an exception on failure. | found_cards = []
for card in self.__card_repository.read():
found_cards.append(card)
return found_cards | 0 |
df53923465ece39a91cf42389ea43d5b | 41e0553e8383ea5e67e8462111e4380d | Teleport to the specified player. | public class TpHereCommand extends BaseCommand
@Override
public boolean execute(CommandSender commandSender, String label, String[] args) {
if(commandSender instanceof Player player) {
if(args.length != 1) {
commandSender.sendMessage(ChatColor.RED + "Usage: /tphere <player>");
... | 1 |
1b747396cb671622606eaf137a4b5669 | 0fbfbd74b71260abf4f756edd5462d36 | get the votes for this image. | public function getImageVotes(); | 1 |
e854800356b6745c90ae7d711cc2839f | 89f440d1062e73488c311898dccb9e13 | 返回当天int时的时间戳,如当传入6时,返回当天6点的时间戳。 | Calendar cal = Calendar.getInstance();
cal.setTimeInMillis(System.currentTimeMillis());
cal.set(Calendar.HOUR_OF_DAY, hour);
cal.set(Calendar.MINUTE, minute);
cal.set(Calendar.SECOND, second);
long todayStamp = cal.getTimeInMillis();
return todayStamp;
} | 1 |
bdba47746f3fa518b3c5cbfc5aab224b | b8a4941e010d266e4fa5a5adf58788c0 | 指定したクラス名を持つDOM要素から指定したクラス名を消去します。 | function removeClass(domObject, cls) {
return domObject.removeClass(cls);
} | 1 |
d47a2eec0497b6a3a2d2653531402ee6 | 8bc14be696f0ae6042806f8839c092d1 | 刷新面板的数据 | function refreshData() {
finPanel.getStore().loadPage(1);
} | 1 |
c4dd4a151fab1de72ded2c4d0ab6777f | 7446bc85b37e27bc62c75f3a70c360e7 | Remove hostname (and IP address of hostname if we can get it) from the
local known_hosts file of the user running the command or a specified username. | class Scp(GenericUnixCommand):
def _handle_failed_host_key_verification(self):
if "rm" == self.known_hosts_on_failure:
self.connection.sendline("\nrm -f " + self._hosts_file)
elif "keygen" == self.known_hosts_on_failure:
self.connection.sendline("\nssh-keygen -R " + self.dest)
... | 1 |
97c0437b20a06d399e54aab6165d8928 | 08927691172f025dc6bedd547d61fad9 | Wrap progress parsing so app doesn't crash from bad input. | public class SimplicityActivity extends AppCompatActivity implements NavigationView.OnNavigationItemSelectedListener, Shortcut.CreateHomeScreenSchortcutListener @Override
// Remove Android Studio's warning about the dangers of using SetJavaScriptEnabled. The whole premise of Privacy Browser is built around an ... | 0 |
0a9aa1d74fcd815b329175bb3b5dd768 | e607a37f4a8f9fae0b418ca9c1f60166 | Grabs api credentials from the .api file | def get_creds():
global creds
thispath = Path(__file__).parent.resolve()
filepath = Path(thispath) / Path("creds.json")
with open(filepath, "r") as f:
creds = json.load(f) | 0 |
bdf6b5c94c451a1cd5b03ef11c574e91 | 8ae7ef904638218e1d0ae1594e188e7c | Gets the information for a food item. | type = FoodType.None;
offset = 0f;
if (index < 0 || _foods.Count <= index) return false;
type = _foods[index];
offset = _offsets[index];
return true;
} | 1 |
e5de9369405bbe41325b46c961f1ebe4 | 7c8c5fc0865b970c62ca8947d1c60959 | functia returneaza produsele dupa aplicarea filtrelor preluate de pe front , care au fost introduse de utilizator ,
cu exceptia filter-ului de marime , iar daca un filtru nu a fost bifat , acesta va fi setat pe false | class AdminProducts{
public static function getAdminProducts($post,$countProductsPage) {
global $pdo;
if (isset($post)) {
if (isset($post['adm_prod_f_code']) && preg_match('/^[^\s]{1,999}$/iu', trim($_POST['adm_prod_f_code'])
)) {
$code = htmlentities(trim($post['adm_prod_f_code']));
$... | 1 |
fec032d62090274d27ae8844eb81e113 | ee766c01a96729ebcb991b6be2ccfedc | Provides the data for OAuth version 1 authentication procedure. | class IndegoFlowHandler(config_entry_oauth2_flow.AbstractOAuth2FlowHandler, domain=DOMAIN):
def extra_authorize_data(self) -> dict:
return {
"scope": "openid profile email offline_access https://prodindego.onmicrosoft.com/indego-mobile-api/Indego.Mower.User"
} | 0 |
4d03ce81470fa38c59ea3967c7da286b | e0047d80e1ec6fee9bf7631eb75d2ea1 | 图文回复的添加 | if (IS_POST) {
$db = D ( "wechat_reply" );
$data = empty ( $data ) ? $_POST : $data;
if ($data ['MsgType'] == '') {
$this->error ( '必须选择回复类型!' );
}
$items = ($data ['items']);
$data ['ArticleCount'] = count ( $items ) / 4;
$data ['addip'] = get_client_ip ();
$data = $db->create ( $data );
... | 1 |
b63ec31fcb336b8bc696a0c2e2092a5d | b08bb48fb5dc7bdae4be6e1d292af176 | Export a ProcessDefinition into a specific format.
Returns the serialized value of the given ProcessDefintion. | BpmnModel bpmnModel = repositoryService.getBpmnModel(procdefid);
BpmnXMLConverter converter = new BpmnXMLConverter();
byte[] bytes = converter.convertToXML(bpmnModel);
return new String(bytes);
} | 1 |
d024624c3b5ff2e6ca92cdf34d1dfb99 | 82d6d192f1ca0d32469eb4bc52c86e68 | Method for copying data from one IntPtr to another. | namespace DotRas.Internal
internal class UnsafeNativeMethods : IUnsafeNativeMethods
[DllImport(NativeMethods.Kernel32Dll)]
private static extern void CopyMemory(
IntPtr destination,
IntPtr source,
IntPtr length); | 1 |
b66d5309a4c3f28cd768a17078f34204 | 1235d98edc0321917379c1349cdf6ac6 | SQLiteからJANコードで商品マスタを得ます | try {
String url = "http://www.amazon.co.jp/s/ref=nb_sb_noss?__mk_ja_JP=%E3%82%AB%E3%82%BF%E3%82%AB%E3%83%8A&url=search-alias%3Daps&field-keywords="
+ barcode;
Commodity result = null;
{
byte[] buffer = EagleUtil.getURLData(url);
... | 0 |
e41ca8701f5a3118b3ad87a7071dbbdf | 973a0e80fb2dc691b8e6ff1683d68f4a | 统计图中的FD节点和组合逻辑节点的扇出,打印到标准输出上 | print('+----------------+')
print('| Statics Check: |')
print('+----------------+')
print('')
from prettytable import PrettyTable
statics_table = PrettyTable()
statics_table.field_names = ['Load Combination', 'Sum FX', 'Sum RX', 'Sum FY', 'Sum RY', 'Sum FZ', 'Sum RZ', 'Sum MX', 'Sum RMX', 'S... | 0 |
809b08856df0c433a2bf5ac356ed4e67 | 2db10f26427b7cdea0ff6807c9debf40 | Allocates memory from the memory manager.
\par Description:
Called by the appserver to allocate videomemory for the bitmaps of the windows.
Can also be used by the display driver to allocate memory for the framebuffer.
\par
\sa FreeMemory(), AllocateBitmap()
\author Arno Klenke (arno_klenke@yahoo.de) | public class VPX
public static native long img_malloc(); | 1 |
a18e9287cb9eca63ec4853d3d07a67d7 | 80aeb377556a448ee2796e1aef9d6871 | get group memberships from session | Object groupNames = session.getAttribute(GROUPNAMES);
return groupNames == null ? null : (String) groupNames;
} | 0 |
944d20dc117dc81cd6b262149a0a7ce2 | 02c51a08f59ed7058da451016d4cb97d | 医生注册服务 | var doctorDao=require('../dao/doctorDao');
var uuid=require('node-uuid');
this.getAllDoctor=function (params) {
};
this.saveOrUpdateModel=function (params) {
console.dir(params);
if(params.id){
this.updateModel(params);
}else{
this.addModel(params);
... | 1 |
e87eb1e11b2292531f853a04ca218b7d | 236e0446019208c2893d61b9682dc45c | Plot the local density of states for the system. | class Simulator(object):
def plot_state_density(self, rho, cmap=cmap_state_density, **kwargs):
self.fig_axis()
self.ENV.plot_state_func(state_vals=rho, cmap=cmap, ax=self.ax, **kwargs)
self.ax.set_title('state density', y=1.) | 1 |
90e37c72a5f03142b7154e98d8ea3743 | 061076747bf7eb6a402699713164bec7 | Generate the saliency map by average feature maps then normalizing to (0, 255). | def saliency(input, model):
device = torch.device("cpu:0")
model.to(device)
input.to(device)
for param in model.parameters():
param.requires_grad = False
input = input.reshape((1, 3, 32, 32))
model.eval()
input.requires_grad = True
preds = model(input)
score, indices = torch.... | 0 |
e63b49fcfe549a4438541177588cc66e | 752d5ada321f34638738c1b4176d7295 | Возвращает mime-тип файла по расширению файла
Если не найдено, возвращает false | class Kohana_Helper_File
public static function mime_by_ext($extension)
{
$mimes = Kohana::config('Mime');
return isset($mimes[$extension]) ? $mimes[$extension][0] : FALSE;
} | 1 |
ba557c3d1abb7cdf39245146e654db1a | be526872f27a8c350af2b2f2bc117056 | 根据skuId 查询skuId商品属性和商品图片 | List<PmsSkuImagesVo> getSkuImageBySkuId(Long skuId); | 1 |
a299e0238205c4590ae1545e356fc9e5 | c915971f007316f53a3b54ab96a9dee8 | 根据中心点坐标以及形状设置一个小方块的坐标 | export class SquareGroup{
private setSquarePoints(){
this._shape.forEach((p,i) =>{
this._squares[i].point = {
x:this._centerPoint.x + p.x,
y:this._centerPoint.y + p.y
}
})
} | 1 |
03e1dceeedf33a5d142c6baa191f8de7 | ee33678ace8c4670b46a32f3e598ce85 | 从缓存域中移除三键对象。 | namespace Panuon.UI.Utils
public class PUCache<T>
public static bool Remove(string uid)
{
T obj;
return Caches.TryRemove(uid, out obj);
} | 0 |
60eab800a5952c416f0166e26b1927b0 | 1abd493c021816815506397b35dc476f | 查询轧制批号是否在表面质量检验表 | namespace CTCodePrint
public partial class QualityCheck : Form
public bool checkRepeat(string qualityNo)
{
foreach (QualityInfo compareValue in qualityInfos)
{
if (compareValue.QualiatyNo.Equals(qualityNo))
{
return true;
... | 1 |
1c86990d51bb532d35f0a6f94b4c87bc | 794a1ee2f516a657fab804392603fa74 | How far from the origin is this 3d point? | class Point3D(ArithmeticData):
def abs(self):
return (self.x ** 2 + self.y ** 2 + self.z ** 2) ** 0.5 | 1 |
b9c98b1aa09e74e0ac7d247390ed4ddc | 0c0cca3b3e8c81c63648119853409660 | 实体转Json,key按增序排列 | namespace BP.Tools
public class Entitis2Json
public string TranslateEntityToJson(BP.En.Entity en, string hidenKeys)
{
Attrs attrs = en.EnMap.Attrs;
StringBuilder append = new StringBuilder();
append.Append("{");
foreach (Attr attr in attrs)
{
... | 0 |
dd48f488ec92372511a8013ca94b042b | 78becf90567a78b725a98aeed6a00341 | prints courses taken by a student | {
for (int i = 0; i < studentCourses.size(); ++i)
{
cout<<i+1<<". ";
studentCourses.at(i).printCourse();
cout<<endl;
}
return studentCourses.size();
} | 1 |
c1e9235a20405aa402c9aac20724e1d0 | 5380cfdba81e5de21ffd5d026bbc6a24 | <p>Defines whether the Stores of the Business Unit are set directly on the Business Unit or are inherited from a parent.</p> | boolean isStore(); | 0 |
191000e03b6dacdfdf7a1f72dd4fecf9 | b2bfa48060931d389d31034f44d3f8b2 | !
Constructs a Logging widget. | namespace cx
LogMessageDisplayWidget::LogMessageDisplayWidget(QWidget *parent)
{
this->createTextCharFormats();
} | 1 |
06f4653d6e37c5f32d39e317e7705049 | 8a82cb64535ef2e5e28f8bd6ec1b2ba6 | Starts a partial export to the csv file. | namespace ASC.Api.CRM
public partial class CRMApi
[Read(@"export/partial/status")]
public IProgressItem GetPartialExportStatus()
{
return ExportToCsv.GetStatus(true);
} | 0 |
2cfbea03d0d890dfed25e6348afca7d2 | 4352bf04327a7e31d7436ef40c4ebe8b | 获取依赖于当前发生值变更的表单域的其它表单域 | public class Eventable extends DefaultEdge implements Serializable
public ImmutableList<FormInput> getRelatedFormInputs() {
return relatedFormInputs;
} | 1 |
e2737d49d807e085ce37932664a85b19 | ce852cf65bcd294e721f995f42107c02 | Функция активации нового аккаунта | $db = GetUsersDB($gl);
$ActivationKey = GenKey();
$sql_result = mysql_query("INSERT INTO ".$gl["sql_table"]." (username, password, homedir, mail, confirm_str) VALUES ('".$input["login"]."', '".$input["password"]."', '".$gl["ftp_dir"]."/".$input["login"]."', '".$input["email"]."', '".$ActivationKey."')");
... | 1 |
b7f5b62b294e3a5e2b03b2d8ac7592f6 | 1cf56d96c065f1ee7c18ce517ed2bd53 | Access the current validator. Returns nullptr if there isn't one. | public function getValidator():? ValidatorInterface; | 1 |
1d9c1ee32f9cce740ab9b322d1f2fbb2 | fbf10b6e7ae058391e2a35322a985a25 | 관리자단 이용안내 작성 페이지 | public String noticeWriteView(HttpServletRequest request) {
if (!accountService.checkAdmin(request)) return "/admin/unauthorized";
return "admin/board_noticeWrite";
} | 1 |
e32627907ef102e144acb2ebe3a3f53c | 3822aba9e32e6489496f0c89a81593f0 | Collect samples into a data structure so that they can be saved into JSON | samplingObj.mimes[0] = { mime: "mime0", type: "pdf", content: pages.toString(), contentSize: pages.toString().length }
writeFile(JSON.stringify(samplingObj), glgSamplingEboxFilePath, doneCallback);
} | 1 |
65af0e470de829ae700fe4e83ff43196 | a4a441be63bf3da32631dfb60b1f8667 | Convert stellar positions/velocities, centre of mass, and orbital position and velocity to pc and pc/Myr | def to_pckms(cluster):
if cluster.units == "galpy" or cluster.units == "radec":
cluster.to_kpckms()
if cluster.units == "nbody":
cluster.tphys *= cluster.tbar
cluster.m *= cluster.zmbar
cluster.x *= cluster.rbar
cluster.y *= cluster.rbar
cluster.z *= cluster.rbar
... | 1 |
dfd98f88cff9c171325d7c422fcd45c1 | 98b5e93fc665a042319018843e354804 | 获取医院医生解答问题排行榜 | class MembersController extends CommonController
public function getRankedProblem()
{
$request = json_decode(file_get_contents("php://input"),1);
$request = $request?$request:I('post.');
if (!$request['members_id'] || !$request['problem_cate_id']){
echo encode(array('code'=>2,'ms... | 0 |
2ac8500e9e23d9893431a7a8960d89e7 | ed4ece5579bfece92bdba58760e1835c | Returns the next available row for a piece, given a column
Returns -1 if index out of bounds | def get_next_row(board, col):
for r in range(ROW_COUNT):
if board[r][col] == 0:
return r | 0 |
dd4b2d749181e4aecfe1d89c95f5eb22 | 9f726b9b1183ffac6b922105eb8409c6 | 显示乒乓球 | class PlayActivity : BaseGameActivity(), TCPUtil
private fun openGlass() {
mShakeListener.stop()
v_glass_view.hide()
v_hint_text.hide()
v_glass_open.show()
v_glass_point.show()
v_open.show()
} | 0 |
a363768bba2c618708dab1ea52052078 | 8e577f26122e5f0c06cff2203aac586c | intoarce numarul de elemente din colectie; | int NrEQ(TCoada q) {
TCoada aux = InitQ();
int count = 0;
while (!Vida(q)) {
MutaQ(aux, q);
count++;
}
while(!Vida(aux))
MutaQ(q, aux);
DistrQ(aux);
return count;
} | 1 |
30c3fc6e51c42c94f34c0e52ef55e703 | 34c46dec9c004fac348623f3d8c544a0 | 全て1バイト文字かどうかチェックします | public static class StringHelper
public static bool CheckHalfSize(char c)
{
return c < 0x80;
} | 1 |
3ff2dbe7102aba25f44fe07e03e491f6 | d9283f9f6aef14d5aa68b11096b22fcd | 获取默认分类页码 | {
StringBuilder sql = new StringBuilder("");
try
{
sql.AppendFormat(@" select count(*) as countSta from web_content_type7 where content_status=1 and pag_id='{0}';", model.page_id);
return Convert.ToInt32(_access.getDataTable(sql.ToString()).Ro... | 0 |
169e69d04a7ecf9619ab9a9f5bcdb15d | 9609e86416a65e54f579313a115dd76c | split by dot, but only outside of quotes | const splits: string[] = [];
let start = 0;
while (true) {
const begin = str.indexOf('"', start);
if (begin >= 0) {
const end = str.indexOf('"', begin + 1);
if (end >= 0) {
splits.push(str.substring(start, begin));
splits.push(str.substring(begin + 1, end));
start = end + 1;
} else { break; ... | 0 |
33b2c09852901cbae011d0bb16275733 | d86ac3a90f937d22671df110116c30bd | Executes {@code command} and verifies that the command box displays an empty string, the result display
box displays {@code Messages#MESSAGE_INTERNSHIPS_LISTED_OVERVIEW} with the number of internship in the filtered
list, and the model related components equal to {@code expectedModel}.
These verifications are done by
{... | assertEquals("", getCommandBox().getInput());
assertEquals("Welcome to RestOrRant!", getResultDisplay().getText());
OrdersGuiTestAssert.assertListMatching(getOrderItemListPanel(), getModel().getFilteredOrderItemList());
assertEquals("Restaurant Mode", getStatusBarFooter().getCurrentMode(... | 0 |
0f046bbb4aee2653097a0c4f327a2742 | e829d986b5b5cd192f83d7179e3a6c20 | 销毁该监视器对象,调用后该监视器将不可用 | export class Watcher
destroy() {
this.observer.destroy();
} | 1 |
21b539f39ac5987ebc7efed7b6892463 | 776e392c2053fc6dffb7b1c80e4b9b21 | 判断当前数据库链接是否有效 | public class DBConnectionPool
public boolean isValidDBConnection(PooledDBConnection pooledDBConn)
{
PreparedStatement pstStatement_Query = null;
Connection realDBConn = pooledDBConn.getRealDBConnection();
try
{
String select_Sql = poolConfig.getValidationQuerySql();
... | 1 |
d638e5703ccce1e9b74b6ab436e64710 | fb7892d264b9921d80eff19e35cb5f55 | Parses the XML and determines the actual type of the update encoded in the XML | $composite = new CompositeQuery();
foreach ($xml->children() as $node)
$composite->merge($this->parseSingleUpdate($node));
return $composite;
} | 0 |
8a54cb4beaab59689db6f66d5236d5b6 | 52dfea2d56e6544a967bbfd7cd01534a | Deletes a specific MovieTV (need token authorization) | namespace texo.api.Controllers
[ApiController]
[Route("movies")]
public class MoviesController : Controller
[HttpDelete("{id:int:min(1)}")]
[ProducesResponseType(StatusCodes.Status202Accepted)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
public async Task<ActionResult> Dele... | 0 |
a7db825d4f3a5978f869620df7873f00 | 68da6a8ab465901645e17f4d282ad11a | Parses arguments passed to module.
Returns nothing. | def parse_arguments():
parser = argparse.ArgumentParser(formatter_class=argparse.RawDescriptionHelpFormatter, description=main.__doc__)
parser.add_argument('--config', default='./scrub.cfg')
parser.add_argument('--module', required=True)
args = vars(parser.parse_args(sys.argv[2:]))
main(args['module... | 1 |
c24bb6c5fa43de0fd21b16e67471029f | 4b33378425e1cc995ee4764e0e57b62f | 根据条件,改变好友关系的状态 | function ProcessFriend(mysid,friendsid, sFriendName, bRelation)
look("sid: "..mysid.." friendsid:"..friendsid.." sFriendName:"..sFriendName.." bRelation:"..bRelation)
if bRelation == 0 then
ApplyFriend(mysid, friendsid)
elseif bRelation == 1 then
RecommendFriends(mysid)
elseif bRelation == 2 then
Agr... | 1 |
3a876a8c71395f223945550f8ee9c3e4 | 32fac08f36c886373a7dcba36880087c | Euclidean 2D inner product | namespace Batting
public class BallSystem : ComponentSystem
float inner2d( float2 v1, float2 v2 )
{
return v1.x * v2.x + v1.y * v2.y;
} | 1 |
e7a9a7ea23ccbdae2693847073a0443c | 9513d04825d9396ca0ef5334d27eb8b1 | Returns title for given substance | {
wxString szTemp;
double dbAmountMAK = 0.0f;
if ( dbMAK > 0.00f )
{
szTemp = wxString::Format("%02.2f" , dbMAK);
szTemp.Replace( ",", ".", true );
if ( bMAKppm )
{
szTemp += " ppm";
if ( dbMolWeight > 0.0f )
dbAmountMAK = (dbMAK * AverageWorkplaceVolume * dbDensity) / dbMolWeight;
}
else
{... | 0 |
af0811893e87cb32b82f0a9ebb2447eb | 852be1377c55c6a7878f6ad06c4cb9db | Returns true if the user has recieved the beer pong challenge | $roomId = getRoomIdOfUser($userId);
$dbh = dbConnection::getConnection();
$sql = 'select step5 from ' . TABLE_NAME_STEP5S . ' where ? = roomid';
$sth = $dbh->prepare($sql);
$sth->execute(array($roomId));
if (!($row = $sth->fetch())) {
return PDO::PARAM_NULL;
} else {
return $row['step5'];
}
} | 0 |
23efb4a2a6a0c211fe34e918f0c2dbd8 | 53381131d15abc583cc09706fa016157 | 如果页面提交过来的页数大于总页数,则将当前页设为总页数
此时要求totalPage要大于获等于1 | public class ObjectPage<T>
public int getPageNo() {
if(this.getTotalPages()>-1&&this.pageNo>this.getTotalPages()){
this.pageNo=(int) this.getTotalPages();
}
return pageNo;
} | 1 |
2142ccc342b13e608ad884a411a8f7e0 | 5a643118915ff0fc4f35ceb11b5d4618 | Just add the current warning to the ignore list | namespace Dashboard.net.Element_Controllers
public class Cautioner : Controller, INotifyPropertyChanged
private void IgnoreListViewer_MouseRightButtonDown(object sender, MouseButtonEventArgs e)
{
AddToIngoreList(WarningMessage);
} | 1 |
a785ca7ed5b77e21deb9854795d7c6f6 | e6d08350b59a5c6dc7bf5be6a6e8d037 | Calcul des composantes connexes | void CNet::calBigestConComp(int **&ConCompList, int *numConCompList, int *sizeConCompList)
{
int i, j, k, curnumNode;
int *visit=new int [getSize()]; assert(visit!=NULL);
for(i=0;i<getSize();i++)
visit[i]=0;
*numConCompList=0;
for(i=0;i<getSize();i++)
{
if(*numConCompList!=0)
{ for(j=0;j... | 1 |
cb980e6ae67cd050ee21c95d88899db2 | 403a4ba9a02c7871ca079951a9ac1730 | Non-inclusive for the right side | class MarkType
get inclusiveRight() { return true } | 0 |
355c97ed43fac0433ca01d1048c887bf | cec842039c650c9847258800717e7763 | Only show the breadcrumbs if the option is enabled | boolean enableBreadcrumbs(Context context); | 1 |
f7d4e6012b066ffd1e3e7b3823dda1e6 | 58fd61d40a1b3694a4d90e501e444fad | 以 1/2 的概率进行饱和度变换 | if random.randint(2):
delta = random.uniform(-self.delta, self.delta)
image += delta
return image, target | 0 |
151070b9179ddcbec02d0d9d840d3be9 | 08b59fe492f47f1f12b22aad285f4019 | Asserts {@link PropertiesDynamicMethodHelper#setWidgetLayoutMethods(Properties, String, Widget)} sets {@link Widget}'s
callbacks flags to <code>true</code>,
when {@link Properties} with callbacks only is passed
Callbacks flags are checked by calling isCall*() methods of {@link Widget} instance
When {@link Properties} c... | public void testSetupLayout() {
TJiraInputProperties properties = new TJiraInputProperties("root");
properties.schema.init();
properties.connection.init();
properties.setupLayout();
Form main = properties.getForm(Form.MAIN);
assertThat(main, notNullValue());
F... | 0 |
e5476ffb0f5fb73c5aade360c82600ed | 7f57a258524e0a81d6330121a0f8c071 | EVALUATE SUDOKU BOARD AS CORRECT OR INCORRECT | int i,j;
int x,y;
int sum = 45;
int test;
for(i=0;i<nrow;i++){
for(j=0;j<ncol;j++){
if(board[i][j].sudoku != '.' && boardCorrect(board,i,j) == FALSE){
printf("Inconsistente\n");
return;
}
}
}
for(i=0;i<nrow;i++){
test = 0;
for(j=0;j<ncol;j++){
test += board[i][j].sudoku - 48;
}
if... | 1 |
c41544bd234cd5c7202dbb31d87a0345 | 45e1e166e7d8c8fbdb1305e76c624759 | 手書きOCRパターン辞書パス取得 | namespace OCRSDKTest
public static class Config
public static string GetJocrSynbolDictPath()
{
return ConfigurationManager.AppSettings["JocrSynbolDictPath"];
} | 1 |
a01d964d3d28defaca9ff457aa1a97e8 | a7529274cbfa2f5c1258d3bdfac500c3 | This fn reads the file by reading cells
and calling the apcontriate handler
to put the cell data in the data structures
Unknown cell types are silently ignored
An attempt is made to be as forgiving as
is feasable regarding cell order | readNASTRANData (char *ifile_name) {
FILE *ifile;
ifile = xfopen(ifile_name);
countNodesAndCells(ifile);
fclose(ifile);
allocateGlobals();
int i = 0;
int marker = 0;
char bufstr[LINE_MAX] = "";
ifile = fopen(ifile_name, "r");
while ( fgets(bufstr, LINE_MAX, ifile) != NULL) {
... | 1 |
af0b06078bd4504be44481ff9ba9be1a | 1f52930cded94a815e8c153ec8b8523a | 只显示今天的订单 | class OrderController extends Controller
public function today()
{
if(session('userid') == null) {
return $this->redirect(url('/index/login/login'));
} else {
$year = date("Y");
$month = date("m");
$day = date("d");
$start = mktime(0,0,0,$month,$day,$year);
$shop = Db::table('ycl_s... | 1 |
8cfe0b0e0d287293e1a1eb7e7a64a019 | 235bdad1708c35f8de2d7cc60bde10d8 | Updates a record in the Auditoria table. | {
if(!is_string($strVar1))
{
echo "Error: el tipo del parametro 1 no coincide\n";
return (-1);
}
if(!is_string($strVar2))
{
echo "Error: el tipo del parametro 2 no coincide\n";
return (-1);
}
if(!is_string($byVar3))
{
echo "Error: el tipo del parametro 3 no coincide\n";
return (-1);
}
$strBuff= "@... | 0 |
6a80bddfd69d7c44d1238eb1fdb12b58 | da691da2c7e3d582b8724199f5fb25aa | Выведите в консоль сумму всех элементов массива. | public class CreateTableAndFiveMethods_3
public static void printTableSum(int [] sum_table_of_ints) {
int sum = 0;
for (int value : sum_table_of_ints) {
sum += value;
}
System.out.println("Sum of array numbers: " + sum);
} | 1 |
6067ad719e5bafd75a2e4ced80d17549 | 5100ab721ab923a06e2a82221fa25e45 | Are any squares left | for (x, y) in self.squares:
if self.squares[x, y] == self.empty:
return False
return True | 1 |
a91b40afd2bfc4308554c8e79903ca87 | 06d52e7bb7e0238a6e2457f940e1969c | The Download already exists in the Session, i.e., a Download for
a torrent with the same infohash already exists. | val downloadTask = downloadTasks[task.hash] ?: return
val info: TorrentInfo
try {
info = if (bencode == null) {
TorrentInfo(File(task.hash))
} else {
TorrentInfo(bencode)
}
} catch (ignored: Exception) {
retu... | 1 |
2ac4cc80906f639999ac15d8363dcadf | 32701579b621033b347be5dd3ada5b2d | returns the objective function for a kmeans clustering | w = np.mean(X, axis = 0)
total_sum = 0.
for k, centroid in enumerate(centroids):
term1 = X - centroid
distances1 = np.sum(np.power(term1, 2), axis = 1).reshape(len(X), 1)
term2 = centroid - w
distances2 = np.sum(np.power(term2, 2))
temp = distances1 - distances2
... | 1 |
ea71099b0d232b452ddaabc7c7616143 | d50dfb172eb8282cb4c5b22eab63e65b | Returns True always. | def always_true(*args, **kwargs):
return True | 1 |
52a7c18c53d078a2dc369775659ec167 | 281e596222031dd6da6b41a5d0258062 | Add a metadata key value pair to the root of the metadata structure. | addMetadata(section: string, data: any) {
return addMetadata(this.__metadata, section, data)
} | 0 |
6431542e458ddedc17866a444e1ce2a1 | da863b19443212790a22fafb99055353 | Allocates the extra state data required for a control pipe. | (
DAL_sps_BamPipeType *pPipe,
DalSps_ConnectionType *pMap
)
{
DAL_sps_ConnectType *pCfg = &pPipe->Connect;
if ((pCfg->eMode == SPS_MODE_SRC && pMap->pClientSrc != NULL) ||
(pCfg->eMode != SPS_MODE_SRC && pMap->pClientDest != NULL))
{
return DAL_ERROR;
}
if ((pCfg->eMode == SPS_MODE_SRC... | 1 |
cda00582bb448079d6ae2026b955cc14 | 33bd3fa404b2db060fd5845d8142582f | パケットストリームから指定のセクションを返す | {
var code = (SectionCode)ReadVarUInt7();
uint payloadLength = ReadVarUInt32();
if (code == SectionCode.Custom)
{
uint startPos = (uint)Position;
var name = ReadString();
uint nameLength = (uint)Position - startPos;
... | 1 |
b67def0335b69b8ab72dc4ee5aa0cb4e | d396fec57b800f0444b0dcaec9879d4e | Shortcut to loading in the data on init. | export class EventListPage
loadEventData() {
this.storage.get('events').then((events) => {
if (events) {
this.eventList = events;
}
else {
this.eventListService.getEventList().valueChanges().subscribe(events => {
this.eventList = events;
this.storage.set('events... | 1 |
7f1e10a5c272f41bd1dae571226b111f | e239c29519ad333e184d09e3b916323a | Загружает данные и обновляет список рецептов | export default class App extends Component
async componentDidMount() {
const recipes = this.loadRecipes();
await recipes;
} | 1 |
746016a7fe55f3598ae10c843afc2582 | 80b3cd722f03ee4b098b67ad3293239a | Liste toutes les voiture en base | namespace App.Repositories
public IEnumerable<Voiture> FindAll(); | 1 |
2bed1e6cf6c7f4b602985525028f495c | 5ddbb2af16e5085bd90147cf8fe37b08 | Parse a JSON feed from a byte-string containing JSON data. | class JSONParser(BaseParser):
def parse(self, stream, media_type=None, parser_context=None):
parser_context = parser_context or {}
encoding = parser_context.get('encoding', settings.DEFAULT_CHARSET)
try:
decoded_stream = codecs.getreader(encoding)(stream)
parse_constant =... | 1 |
58e038e15cb9b449a80df0254fdeba37 | a9d609c580f107289a5e57af78f73cea | Test from_binary method. | class BinaryTest(unittest.TestCase):
def test_set_value(self):
model = ExampleModel()
data = six.b('Hello, world!')
model.binary_field = data
self.assertEqual(model.binary_field, data) | 0 |
41ee4ad5a2730c98b96399219265a011 | ff3935bb0ef807a5688057847bef8042 | 官网首页显示最近两条信息 | {
$information = DB::table('information')->orderBy('id','desc')->paginate(4);
$post = DB::table('post')->orderBy('id','desc')->paginate(6);
return view('welcome',compact('information','post'));
} | 0 |
778668313e01e84233632a88931750b7 | 8f4b3c295f320d60084c4066f6a4a5f8 | 更新卡的位置 | local count = #self.m_cardsVector
local pos, seq = {}
for i = 1, count do
seq = self.m_cardsVector[i]:getSequence()
pos[seq] = {self.m_cardsVector[i]:getOriginPos()}
end
local addIdx = self:getNewSequence(card)
local newSeqs = {}
for i = 1, count do
seq = self.m_cardsVector[i]:getSequence()
if card == se... | 1 |
c87e613f031d4445e0676e8e959544b5 | 6599f06356e342651baa92e6939850db | 문자열에서 번호 지우기 | namespace MyFramework public static class StringExtension
public static string RemoveNumber(string str) {
return Regex.Replace(str, @"\d", "");
} | 1 |
a8d59531c470f7ae0f4500797911002b | 0411338d257669a67cdbe8d80f364964 | Extract chroma cqt audio features from an audio file | fs, audio = wav.read(file)
mfcc_feat = mfcc(audio, samplerate=fs, numcep=26)
mfcc_feat = mfcc_feat[::3]
mfcc_feat = np.transpose(mfcc_feat)
return mfcc_feat | 0 |
de1f206db3849006200aec694f0cf75b | 6bc7dd2fba8433a38aa1f0f8532c65aa | Send a validation email to the user in order to validate his inscription | class UserManagerSettings
public function sendEmailValidationRequest($h)
{
$username = $h->cage->post->testUsername('username');
$userid = $h->getUserIdFromName($username);
if ($userid) {
$us = new UserSignin();
$us->sendConfirmationEmail($h, $userid);
$h-... | 1 |
74ec87694b080afddb3629647e0346dd | 0963080ff0b19a1b55322ea3145fb660 | Edit the wiki page.
Convenience function that utilizes
:meth:`.AuthenticatedReddit.edit_wiki_page` populating both the
``subreddit`` and ``page`` parameters. | public function wikiEditPage($subreddit, $pagename, $content, $reason = null, $previous = null); | 1 |
17b3d0f8da69d4ef5551749c78b04e33 | 25a376619597f9594e8da72d9ddcb88e | Put a car in a any free parking slot
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> Successfully picked the slot </td><td> - </td></tr>
<tr><td> 201 </td><td> Created </td><td> - </td></tr>
<tr><td> 401 </td><td> ... | @SuppressWarnings("unused")
public class ParkingManager
public Location RandomParkCar() {
Location loc = new Location();
if(allNull()) {
loc.setErrorLocation();
return loc;
}
else {
int findFreeLot = 0;
while(findFreeLot==0) { ... | 1 |
50e0d26eb35bcc886be9c69b3464ad14 | 75bca404cc0c422e8c1cef18cf4d68cf | ensure euler conversion for Quaternion matches that of Matrix4 | fn test_to_matrix() {
let roll_yz = Radians::full_turn_div_4();
let yaw_zx = Radians::full_turn_div_8();
let pitch_xy = Radians::full_turn_div_8();
let euler = EulerAngles::new(roll_yz, yaw_zx, pitch_xy);
let c0r0 = 1.0 / 2.0;
let c0r1 = 1.0 / 2.0;
let c0r2 = 1.0 / f64::sqrt(2.0);
let... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.