query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
5f1f0c11390ff3f66c69086602015cc9 | 2fe1bee5e9067a950b6ee26ddd513f2b | カリー化 : 関数の引数をひとつだけに固定 | let s = "hello";
let mut c = || { println!("{:?}" ,s); };
c();
c();
println!("{:?}", s);
c;
c.call_mut(());
c.call_once(());
println!("{:?}", s);
struct Closure<'a> {
env_var: &'a str,
}
impl<'a> FnOnce<()>... | 0 |
61aae784ae4f1d1ce7aa77302584b8f5 | 63f511f6dabe8d3dcf6ffcc5c444f47a | Check if map wraps vertically. | public boolean pfWrapY (); | 1 |
f01960977190c9cf525b9c421447ddbb | 549cb51931b014d0adbeb9c2270bf9ef | Set a set of org search terms. | class Bookmark
public function setTerms($terms)
{
$this->terms = $terms;
return $this;
} | 1 |
a96bbf89ac37c5f40920e666c8f6f5e3 | 015ca0abeea33efd6e24578e90238927 | Rysuje menu ukończenia gry. | {
drawSolidRectangle(0, 0, width_, height_, ' ', menu_matrix_);
for (int i = 1; i < height_ - 1; ++i)
{
menu_matrix_[i][1] = 'X';
menu_matrix_[i][2] = 'X';
menu_matrix_[i][3] = 'X';
menu_matrix_[i][width_ - 2] = 'X';
menu_matrix_[i][width_ - 3] = 'X';
menu_matrix_[i][width_ - 4] = 'X';
}
for (int j = 5... | 1 |
e904f6243a8c77d8f70d84672da8d292 | 14a6875be9f99c4f21e5de14ce58819c | 更新临时条码对象 | @Service
@Transactional
public class BarCodeServiceImpl implements BarCodeService
@Override
public void update(BarCode info) {
barCodeDao.update(info);
} | 1 |
aa2655acfa2a249b37dbbc7ce93a913e | dba589ac8d6258c0ddc542f5df86d8ec | 为符合条件的标签添加链接 | class Tool_Analyze_Tag
public static function user_tag_to_link($content) {
$out = array();
preg_match_all("/\[TAG\](.*?)\[TAG\]/is", $content, $out);
if(empty($out[0]) || !is_array($out[0]) || empty($out[1][0])) return $content;
$search_domain = Comm_Util::conf('domain.search').'/user/&t... | 1 |
7c912158400dcc651b3c167162df0f21 | f5b3770fd06ba328a055fe5709c017e1 | The method to get the currency_symbol
Returns:
string: A string representing the currency_symbol | class Money:
def get_currency(self) -> str:
return self.__currency | 0 |
cd9d31edaa59ab0d496bfae813684497 | b7dc1d0b4a90b49ae1c49425a1c02c15 | Функция вычисляет определённый интеграл методом средних прямоугольников с заданным количеством разбиений. | {
double res=0.0, h;
h = (b - a) / n;
for (int i = 1; i <= n; i++)
{
res += Callback(a + h * (i - 0.5));
}
res *= h;
e = Math.Pow(h,2);
return res;
} | 1 |
a3031a1f8745d63e1e07f1856508f4d6 | 0afb2788368914e97b7aa3d3efff292d | 设置ImageView的内容 | public class NewsMainActivity extends AppCompatActivity public class MyAsyncTask extends AsyncTask<Void, Integer, String> @Override
protected void onPostExecute(String result)
public boolean setViewValue(View view, Object data, String textRepresentation) {
if (view instanceof... | 1 |
69ad902feaf3b0933febc6b3506810e8 | 6bf4f582414e87793f0302fb2170b83f | 相関係数による評価を表示する | class Titanic:
## コンストラクタ
def show_coef(self, columns):
n_features = list(columns)
fti = np.reshape(self.coef, -1).tolist()
print('説明変数の回帰係数:')
for i, feature in enumerate(columns):
print('\t{0:10s} : {1:>.6f}'.format(feature, fti[i]))
plt.figure(figsize=(4, 6))... | 0 |
4ee4ffb5017c24cff622e1e6b404a253 | 2c8480bc2e1855b8eee4cdc631d3c6a2 | 自定义登录验证方式,实现用户名,邮箱均可登录
实现逻辑:将用户输入的数据进入后台查询,如果查询成功,则认证成功,出现异常或失败,认证失败 | public String login(String userId, String userName) {
CustomUser customUser = new CustomUser();
customUser.setUserId(userId);
customUser.setUsername(userName);
return login(customUser);
} | 0 |
e9d512362b361cca25cb06c0ff4ea2d6 | b832d1ccdaf2c04bb4c234ceda78e298 | 新类型的元组,对于传入的迭代对象,只保留int类型且值大于0的元素 | def filter_list(my_list):
my_list = [element for element in my_list if type(element) is int]
return my_list | 0 |
a513aa26515a884d0a0b7a443f8c1efc | e7689cf12c7be110ebd5937a89ece66d | change the position of float window | void MainWindow::on_windowfloataction_triggered(bool checked)
{
ui->dockWidget->setFloating(checked);
} | 0 |
0530929f3259c0213af088e026f5c807 | df246cc147774fe84d390556203543dd | 用户更新账户通知用户 | class smcClass{
public function new_user_notification($user_id,$user_pass,$r){
if(!$this->option['smc_user_notice'])return false;
$blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
$name = $this->get_weibo_name($r['weibo_slug']);
$user_login = stripslashes($r['user_login']);
$user_email =... | 0 |
c815bec38267cba39b87ceb31964e4ea | 4ed17bd8e091795578d356cd0356545a | Chuyen mang 2 chieu thanh 1 chieu dung 1 vong lap | for (int i=0;i<row;i++){
MangMotChieu t=new MangMotChieu();
for (int j=0;j<col;j++){
t.addTail(arr[j][i]);
}
t.sortDescend();
int[] s=t.get();
for (int j=0;j<col;j++){
arr[j][i]=s[j];
}
}
... | 0 |
1e8c4c7e62574c7e58233eb7139a4159 | fbbba3f7ffe69f41dfb1a99496ab0e70 | Adds CloudFoundry service bindings from the JSON in the "VCAP_SERVICES" environment variable. | default_target = 'env'
default_targets = [
{
'filter': '[0-9A-Z_]+$',
'target': 'env',
},
{
'filter': '([a-z0-9]+\\.)+[a-z0-9]+$',
'target': 'file:config-server.properties',
'format': 'properties',
},
{
'filter': '[a-z0-9]+$',
'target': 'file:config-server.yml',
'format': 'yml',
}
... | 0 |
bf8e575a4ba3fb51b45da908237ec6c4 | 057945d2d186de5838037bec106268b4 | 获得0-9的随机数字符串 | public class RandomUtil
public static String getRandomNumString(int length) {
String base = "0123456789";
return getRandom(length, base);
} | 1 |
c0f62ef388a255e3e4c05c97099b18e3 | cede12e4945a4cd03d8b7a2035c5e22c | Mark the field's changed status according to the parameter. | public void setChanged(int type, Object oldValue, Object newValue); | 1 |
471214eef08c733d5c78cba32fea56c7 | e20461c4041757e386fc5ef00a2fa4e6 | 输时显示遗憾页面 | function showPageError(msg, box) {
var elem;
$("#js-liuliang-showTable").hide();
if(box) {
$(box).html('<p class="show-error">' + msg + '</p>');
$(box).parent().find("input[type='hidden']").val("");
return false;
}
if(chartsTab) {
elem = $(chartsTab.content[chartsTab.past]).find(".main-charts-item... | 0 |
4c54b614086157f77cfaca08b9867725 | a2d7d52d025c8cb91f036506c996cb7e | Execute a WPSOLR query. | class GSA(object):
def query(self, q, site=None, lr=None, num=10, output="xml", client="default_frontend", **kwargs):
self.data['q'] = q
if site:
if not isinstance(site, list):
site = [site]
self.data['site'] = "|".join(site)
if lr:
self.data['... | 0 |
65f22fce5426b79b99153f1c1f733d53 | 08b6b221dde2191baccca017cf5ef7be | Overwrite str method to print the character dictionary | class Character(object):
def __str__(self):
return f"{self.name}" | 0 |
b30340c2cc3fcfa0f844c46023ed4ca1 | b3b9de2cfccee8ed892cd560c17f592d | Get the control dependency map, used to manage extensions from control
dependencies. | export class Base extends Extension.Base
get dependencies(): Array<string> { return this._dependencies } | 0 |
dd5da81bc5b8154eff4e73a15587bdbf | 84dd639021cd9d65d28d32850d57a011 | 获取rt的字段转换为ignite中表字段后的字段信息 | res = MetaApi.result_tables.retrieve({"result_table_id": rt_id, "related": ["fields", "storages"]})
if res.is_success():
try:
res.data["geog_area"] = res.data["tags"]["manage"]["geog_area"][0]["code"]
except Exception as e:
logger.error("meta response error: {}, data={}".... | 0 |
2e7f5ae64c20735ffe6b6954a68b3995 | dbd51097a7e87ecde6a4a4871b8448fe | 获得电量 | if device.platform == "android" then
local ok, ret = utils.callJavaFunc(className, "getBattery", { }, "()I")
if ok then
return g_battery;
end
elseif device.platform == "ios" then
local ok, ret = luaoc.callStaticMethod(className, "getBattery", { })
if ok then
... | 1 |
1dc197bfd9fdd56829c6a53a1b898a3d | 402a415bbf7f34e63319ab6a95ebaac3 | Flag indicating if the Y gyro was valid. | public class Mpu6050 extends Service<Mpu6050Config> implements I2CControl, OrientationPublisher
public boolean getYGyroFIFOEnabled() {
return I2CdevReadBit(Integer.decode(deviceAddress), MPU6050_RA_FIFO_EN, MPU6050_YG_FIFO_EN_BIT);
} | 0 |
2955860507b2c36c1a38382d093be804 | 753828a183f5f81c90bcb2ac500c91ee | Creates a new <see cref="HttpClient"/> instance that uses a custom message handler. | namespace TestableHttpClient
public static class TestableHttpMessageHandlerExtensions
public static HttpClient CreateClient(this TestableHttpMessageHandler handler)
{
return CreateClient(handler, _ => { });
} | 1 |
0d0381888f1cc8df93f2706e6ec51b08 | 25982debeb50766b39fcb1845f005c7b | Get the animation speed label | const float Animation::getSpeed() const
{
return m_speed;
} | 0 |
abbe8e746a2d45419ac99888b7103668 | 35652f4b0063d0f4ca26e6713286e8b5 | Method to add to the total gross pay accumulator | def calcGross(hourlyPay, hoursWorked, grossPay):
grossPay = hourlyPay * hoursWorked
return grossPay | 0 |
01a3448f3b1284e7bd0becaf53bf31f5 | b88af1932d23c5d4a174106bae107339 | Method for checking which columns contain boolean data | class Dataset:
def bool_columns(self) -> Set[str]:
return self._columns_type.bool_cols | 1 |
130c5b560564706d03da1ab9763af0aa | 7c52b4f755af64ecfd8a9bcdfafa45c6 | Returns the filter for $attribute
If the filter is not currently in the bound filters, a new instance
of {@link Scorpio\SphinxSearch\Filter\FilterAttribute} will be created for
the specified attribute and that object returned. If the attribute is not
valid for the current index, an exception will be raised. | class ShibbolethController extends AbstractController
public function getAttributeFilter()
{
if (! ($this->_attributeFilter instanceof AttributeFilter)) {
$config = $this->getOption(self::OPT_ATTRIBUTE_FILTER);
if (is_array($config)) {
$this->_attributeFilter = new At... | 0 |
67052802a954ee93f6d0fbfdf1375f2d | 99eb1a83a79b73a148f800d7c07a16d2 | Test shearing and stretching deformation calculation with a complicated field. | def v_stripe_test(path, Lx, Ly, Nx, Ny, dt, nb_state, dX, dY, depth=15):
handle = create_initial_netcdf(path, Lx, Ly, Nx, Ny, dt, nb_state)
[X,Y] = np.mgrid[0:Nx,0:Ny]
F = np.zeros((Nx, Ny))
F[dX : Nx-dX, Ny//2 - dY : Ny//2 + dY] = \
F[dX : Nx-dX, Ny//2 - dY : Ny//2 + dY] +\
(np.abs(Y[d... | 1 |
412194888f36e8f9adc754efa9d08d24 | 431f5a8ab616103e0f93cbab67a4e5c2 | [allRoute 针对所有路由生效] | async [Types.ADD_ROUTE]({ commit, dispatch, state }, payload) {
let authList = state.authList;
let routes = filterRouter(authList);
let route = router.options.routes.find(item=>item.path == '/profile');
route.children = routes;
router.addRoutes([route]);
console.log(rou... | 0 |
2a096c7ec4d91a7ca2371b8004ef655c | f820206ef5adbc82ef3fad78c6b4fd27 | 加入购物车,计算按钮位置。 | function addcart() {
$(".chanpin_jieshao_bg").css("display", "block");
$("html , body ").css({
"height": "100%",
"overflow": "hidden"
});
local.setItem("join", "1");
} | 0 |
132d8789c81ea3eb1b6d292cf2f54edd | b297549034dba6c6625b9dd8339bc874 | 실명확인번호 Getter Method | class Human
public String getJumin() {
return this.jumin;
} | 1 |
07e03fbfe8a66f31edc4ce191b123c2b | 9c88131682cea57a1456bb3e1ffe90b1 | JavasScript DataView.prototype.setInt16(), see:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setInt16 | namespace JS
JS_DEFINE_NATIVE_FUNCTION(DataViewPrototype::set_uint_16)
{
return set_view_value<u16>(vm, vm.argument(0), vm.argument(2), vm.argument(1));
} | 1 |
7e4140b9278532648d386f301e340b16 | a483d469433a7512fad7e58b846db257 | Prevent the user from going back to either the ResultsScreenActivity or to the previous
location before the app. | public class GameResultsActivity extends ActionBarActivity
@Override
public void onBackPressed() {
} | 1 |
00a42e10191dced8a295a8efaa41c7fe | 72698246c7ad3799860eda6b9d2ab2ae | Initializes Gyro, Accelerometer and Magnetometer using default values. | void MPU6050_initialize() {
devAddr = MPU6050_ADDRESS_AD0_LOW;
MPU6050_setClockSource(MPU6050_CLOCK_PLL_XGYRO);
MPU6050_setFullScaleGyroRange(MPU6050_GYRO_FS_250);
MPU6050_setFullScaleAccelRange(MPU6050_ACCEL_FS_2);
MPU6050_setSleepEnabled(false);
} | 0 |
01911ecdfa7a23805c1f91238305fbd4 | 013847d0cde1282607c492cd53757553 | Команда поиска индивида | namespace UDPServer
class Requests
public byte[] FindIndivid(string number_s)
{
byte[] number = BitConverter.GetBytes(Convert.ToInt32(number_s));
string buf = "", s = "";
buf += "7F ";
buf += "00 ";
buf += "00 ";
buf += "00 ";
... | 1 |
39b3b728cb4aa8533d1c7f95adef8e4d | 3ff33a1652573bee3d4107717034b7ea | Retrieve the directory containing job logs for the specified repository | class JobController(object):
def get_results_directory(self):
return os.path.dirname(self.job_log_file) | 1 |
09aa68f470ae7bb93c4fe24b07815834 | 4ba3ed4e049be5b1b7fe1d009c97db88 | Called when the objective has been reached | {
if (_objective != null && _objective.IsComplete)
{
EndLevel ();
}
} | 1 |
b344248293631c9a8d6a3bdbea9f78f4 | 3c4d27c50ec77ab102dd4fff1e2c4eda | lấy ma trận vị trí các tile từ file matrix đồng thời trả về vị trí file tiles | string CMap::LoadMatrix(LPCWSTR filePath)
{
string tilesLocation;
ifstream tilesInfo;
DebugOut(L"filepath: %s\n", filePath);
tilesInfo.open(filePath);
if (tilesInfo.is_open())
{
getline(tilesInfo, tilesLocation);
string tmp;
getline(tilesInfo, tmp);
this->mapWidth = stoi(tmp);
getline(tilesInfo, tmp... | 1 |
d29fe55b9b3da13969f8c7f21f1604b6 | e85b30e4255a7b1802fdd443f03bdc0f | Writes a list of dictionaries to a file | def writing_file(filename, a_dict):
with open(f"{filename}.txt", "w+") as f:
f.write(str(a_dict)) | 0 |
cff51f8f5c3ddae24d9d57edebb97045 | e7f701f25e95fa44c2d6d34676404ca1 | Sets mailbox_name | abstract class dbs_templates_mailbox_maillist extends super
public function set_maillist($value)
{
$this->setdata ( self::DBKey_maillist, $value );
return $this;
} | 0 |
640321331e873ca6884ebc8c4f35666d | 7819d1c97dba802b939b5f7ee9fecba8 | Returns the base substitution type of the 2 state SNP | ret_type = 'Oth'
pass_SF = True
if Modified == Allele:
ret_type = 'Mod'
elif Reference == Allele:
ret_type = 'Ref'
if 'C' in Reference+Modified and isReverse == False:
pass_SF = False
elif 'G' in Reference+Modified and isReverse == True:
pass_SF = False
return... | 1 |
17f9d2ea7729ca1d0fdbcdcdac8c45aa | c1d6e66b8b8cd22ed8a1ed0710d7b226 | Send the bytes in chunks that are maximized by the maximum
FTP length | {
ULONG BytesSent, TotalBytesSent;
if(Len <= 0)
return (0);
TotalBytesSent = 0;
while(TotalBytesSent < (ULONG) Len)
{
pConn->InSend = TRUE;
if ((BytesSent = send(pConn->Sock, (char *) Buff + TotalBytesSent, Len - TotalBytesSent, 0)) == SOCKET_ERROR)
{
if(g_fNonBlocking && (WSAGetLastError() == WSAEWOUL... | 0 |
4e4b1bbbf4480ea4ea4662d8990978ec | 29e06ed8fc94950af87cab4e85a3042a | constroe as conversas do chat | $.post(v_pagina_acoes, {dataType : "json", href: 42}, function(retorno){
var objeto = jQuery.parseJSON(retorno);
var nome = objeto['nome'];
var online_offline = objeto['online_offline'];
document.getElementById("id_span_nome_usuario_conversando").innerHTML = nome;
document.getElementById("id_span_online_offline_us... | 0 |
773c4c6483d0754a1dfe47b8bab72f7e | d32542d4701393187c80999aebacb8aa | Serializes to bytes using PyTorch's
serialization tools. | serialize = OrderedDict()
serialize["cfg"] = lambda p: srsly.write_json(p, self.cfg)
serialize["vocab"] = lambda p: self.vocab.to_disk(p)
if self.model not in (None, True, False):
serialize["model"] = lambda p: p.open("wb").write(self.model.to_bytes())
exclude = util.... | 0 |
e1ceff46e726c41db01f152385c98424 | 41fd96626173c831acffe9fdd7bb4635 | Wandelt die übergebene Versionsnummer in ein nummerisches Array | namespace Hugula
public static class CodeVersion
private static int[] SplitVersion(string verion)
{
if (string.IsNullOrEmpty(verion)) verion = string.Empty;
var sp = verion.Split('.');
#if UNITY_EDITOR
if (sp.Length < 3)
{
}
#endif
int[... | 1 |
aa9aa3a75ff30f71b0a80e40b0f930f1 | 8ee2c729c50a552d1faed0e3a30477da | Add rows to the conditional table | var table = document.getElementById("AlertConditionTable");
var rowCount = table.rows.length;
var idx = rowCount-1;
var alertsHtml = '';
var addHeight = $("#AlertConditionDialog").height();
$("#AlertConditionDialog").height(addHeight+20);
alertsHtml = "<tr id='row"+idx+"'><td> </td><td>... | 1 |
34693cc9bd8aab9123d6b51028526dd1 | cb7b6af92f7dce102c94dc9ae2f12804 | 餐饮商品列表 | class FoodController extends Controller
public function index()
{
$list = Food::where('shopid', session('merchantname')->shopid)->orderBy("id",'desc')->paginate(5);
foreach($list as $v){
$name = Food_type::where("id",$v->typeid)->value("title");
$v->typename = $name;
}
$pa... | 1 |
e1715363092cab91bd7b4ac737742ef7 | 217ff552ef0f323894bdd10aa2d46b4d | Returns the number of objects this instance is following. | class InstaUser:
def getFollowuingCount(self) -> int:
return len(self.following) | 1 |
efbcb2cc9de66e03d35ebd90551b157f | 2b1f87a1d4621952d8c9ae4053315b1c | Function that will be used to add items from list to cart individually | export class ItemCardComponent implements OnInit
public addToCart(item) {
let newItem = {
prod_id: item.prod_id,
prod_name: item.prod_name,
prod_desc: item.prod_desc,
carton_price: item.carton_price,
qty_cartons: 0,
qty_units: 0,
total:''
}
this.addToCartList.push(n... | 0 |
22f1ba6b793765a0cba6124ee8f72532 | e88959013fd6d7931ccff3d60cd7de1d | 存储历史记录,要求每次查看疾病结果时都保存记录 | def save_history(data):
json.dump(data, open(HISTORY_PATH, "w")) | 1 |
29f003bec1db0ffd7d7a34f07b14ff84 | a3662e96ee83df3f8943d27556cf251b | Метод для удаления кластеров, у которых есть эквивалентные замены среди оставшихся кластеров. | {
if (klasses.Count > 1)
{
List<Dot> Dots = Kls_to_List(klasses);
List<Dot> nones = new List<Dot>();
List<Dot> cents = new List<Dot>();
foreach (Klass gls in klasses)
{
if (gls.name... | 0 |
6cf5c0bb2f4d0072ddde76ebc8ca3002 | a06c12cbcd3c7dc040ac1c74d1a00f15 | 根据音源获取不同配置设置硬件声音大小 | HAL_Status AC101_Setcfg(CODEC_InitParam *param)
{
if (!param)
return HAL_INVALID;
if (param->speaker_double_used) {
snd_soc_update_bits(SPKOUT_CTRL, (0x1f<<SPK_VOL), (param->double_speaker_val<<SPK_VOL));
} else {
snd_soc_update_bits(SPKOUT_CTRL, (0x1f<<SPK_VOL), (param->single_speaker_val<<SPK_VOL));
}
spea... | 1 |
6345ab54749ff1157a648c0ff17cdab4 | 3bde16e0cc12f70471e221081fd9fff0 | Obtains the <code>Content-Encoding</code> of the resource.
<code>null</code> if resource not yet encoded. | public class HttpHeaders extends GenericData
public final String getContentEncoding() {
return contentEncoding;
} | 1 |
0b10dc147968cd66888cfbdc27e05107 | af776f0949679a9eb2bd2b3c6e2d8cea | 检查文件列表是否全部存在 | var ids = docids.split(",");
for(var i = 0;i < ids.length;i++){
if(jQuery("div#" + ids[i] + "ItemId[_datatype='file'][canDownload='1']").length == 0){
return false;
}
}
return true;
} | 1 |
7938151d30edb59c328992d9430030fd | bb0f2cf034d1d7f54f9df754eda66074 | Parse a literal, find an object that's been registered, or evaluate a
function. | class Parser
parseLiteral(isKey) {
const pos = this.pos;
const options = this.options;
const litend = this.findLiteralEnd();
if (isKey === undefined) {
isKey = this.ordinal(litend) == CHAR_COLON;
}
if (litend <= pos) {
const emptyOK = isKey
? this.options.allowEmptyUnquotedKe... | 0 |
4248e5886d8a59956ca0b15014f24514 | 2dfbaf8f2fcb525ae4247c45a833fc73 | Returns a new object of class '<em>Filter Connection</em>'.
<!-- begin-user-doc -->
<!-- end-user-doc --> | {
synchronized (monitor())
{
check_orphaned();
eu.aladdin_project.xsd.SearchCriteria target = null;
target = (eu.aladdin_project.xsd.SearchCriteria)get_store().add_element_user(FILTER$0);
return target;
}
... | 0 |
03021d63aa62abbe138c821d4e2727e7 | bedeb5df315f024c764f9894ac57c314 | Sets the view for the horizontal tab scroller.
The horizontal tab scroller is optional | void setView(VTab tab); | 1 |
b41105efe4df981eaef2b4a8eb3c8580 | e8a5c8bf53aaed534c36616a976fce75 | Returns the meta object for the attribute '{@link org.oasisopen.names.tc.opendocument.xmlns.chart.DocumentRoot#getName <em>Name</em>}'.
<!-- begin-user-doc -->
<!-- end-user-doc --> | EAttribute getDocumentRoot_PositionName(); | 0 |
d618d019ddcf151b877c95de90b9bc70 | b76b352cff69872db1ef6706a84fab4c | sends a string of dumped json to the client | void __cdecl sendMessage(const json_t* message) {
char* buf = json_dumps(message, JSON_ENCODE_ANY);
printf("sendMessage, size = %d\n", (int)strlen(buf));
int sendsize = send(serv_sock, buf, (int)strlen(buf), 0);
free(buf);
} | 1 |
9b358fac0f38f428b09d629a61cefde1 | 92e92ffa0a55ca0558acf7acca06a93a | Is the Northbridge PState feature enabled? | BOOLEAN
F15CzIsNbPstateEnabled (
IN CPU_SPECIFIC_SERVICES *FamilySpecificServices,
IN PLATFORM_CONFIGURATION *PlatformConfig,
IN AMD_CONFIG_PARAMS *StdHeader
)
{
PCI_ADDR PciAddress;
BOOLEAN NbPstatesSupported;
BOOLEAN SkipHwCfg;
NB_PSTATE_STS_REGISTER NbPstateSts;
NB_PSTAT... | 1 |
95a66f1d7a3c350fc07b9cd6c1654554 | d6c2702e7935ed29d9f9150c3dc40e93 | Returns an array of css options from Cheezcap based on the page template being used | public class AmbraFreemarkerConfig
public String[] getCss (String templateName){
return getCss(templateName, defaultJournalName);
} | 0 |
14a23765ac02319d379738c9dd341d2d | 35a127054cf2c88da786cb2af4460357 | Get an answer draft by user | if ($this->answers()->whereUserId($user_id)->whereStatus(2)->exists()) {
return $this->answers()->whereUserId($user_id)->whereStatus(2)->first();
} else {
return false;
}
} | 1 |
8c1e74756da36780b0a3c3b044b0431f | 2a16fb5ab8dfd306dade8853d796e4f2 | Control camera birghtness.
***************************************************** | {
if(key_chk_enable_flag)
{
key_chk_enable_flag=0;
if(key_1_flag)
{
B_brightness++;
if(B_brightness>=254)
{
B_brightness=254;
}
}
if(key_2_flag)
{
B_brightness--;
if(B_brightness<=2)
{
B_brightness=2;
}
}
}
} | 1 |
06787e14ec621a57c062df89023a6e6d | 6055440ee202125afca11a5a288b999e | 处理请求,输出文件内容以及设置缓存响应头 | if info == '/':
filename = self.html + "/index.html"
else:
filename = self.html + info
try:
fds = open(filename,'rb')
except:
response = "HTTP/1.1 404 Not Found\r\n"
response += "Content-Type:text/html\r\n"
response... | 0 |
0ff74d1df8896f84d576c1d1a8c25422 | 5ace5a9a62ed4c56b73a956935c4d9e5 | 构建一个参数栈,把参数放到一个固定的区域中,可以通过argv来索引到。
返回参数个数 | int buildin_callsub (struct script_state *st)
{
int pos_ = conv_num (st, &(st->stack->stack_data[st->start + 2]));
int i, j;
for (i = st->start + 3, j = 0; i < st->end; i++, j++)
push_copy (st->stack, i);
push_val (st->stack, ScriptCode::INT, j);
push_val (st->stack, ScriptCode::INT, st->... | 0 |
499236cb33a8307d29bc49b825d41404 | 616e99800dac28b581357b5672dcaa07 | A flag indicating whether test devices can use the license. | @Fluent
public final class ContentKeyPolicyPlayReadyLicense
public boolean allowTestDevices() {
return this.allowTestDevices;
} | 1 |
93bfcd70d1915db167d6bca39c6824d7 | 2c8fd854ed0226367949d57760327deb | Get Invoices Count | class InvoicesApiTest extends \PHPUnit_Framework_TestCase
public function testFinanceInvoicesCountGet()
{
} | 1 |
d02c2c6ace20ee37437f4aabc3967d94 | b5b4fc83a1a9e532ca977322cda379ce | ## like scale_colour_brewer(), but allow arbitrary number colors via interpolation | {
NV = length(values)
values = (values-min(values)+1e-10)/(max(values)-min(values)+1e-10)
colo <- function(a) rgb(t((col1*(1-a)+col2*(a))))
return(sapply(values, colo))
} | 1 |
c71f24bf98a757cf733e6675a9f13d85 | 7d33ef26b6a267010253eb34b411bfd1 | Método que destruye la carta si el match ha sido correcto | playAudio("lift");
arrNewHand = [];
match = false;
$.each(arrHand, function (index, cardId) {
if (cardId == card && match == false) {
match = true;
}
else
arrNewHand.push(cardId);
});
arrHand = arrNewHand;
} | 0 |
119beb7aa208690a66ce819305fde3da | 97222db1256e10776b4639cffedc1ec4 | Get key code by the character. | namespace SWAT
public static class NativeMethods
[DllImport("user32.dll")]
public static extern ushort VkKeyScan(char ch); | 1 |
c65d8a68eaa934fd86b5da2bffe795aa | 8cae8600ea59b2cb80591978dfdf2b4c | Description:
This method is used to create a table in a hive database. | def create_table(table_name, columns):
client = py_hbase.DatastoreProxy()
return client.create_table(table_name, columns) | 0 |
3eb86f98d1c4dc455b19789a5bcf9a1c | da7845210a7abbf376aafea4882186ce | when we add a product to shopping cart, check if there is already that product there,
if so, we increase the quantity of that product,
else, we add that product to shopping cart with quantity as 1 | if (Object.keys(state.cart).length != 0) {
for (const [key, value] of Object.entries(state.cart)) {
if (key === product.reference) {
product.qty = value.qty + state.qty
state.cart[key].qty = product.qty
} else {
state.cart[product.reference] = product
}
... | 1 |
53e4e4a7317c1aa0cf1d0bf9c1f39636 | e8c180d3d598e234894db17eab24e069 | 根据返利金额获取用户等级 | class User extends Base
public function getUserlevel($points = 100)
{
if (10 <= $points && $points <= 90) {
$needpoints = 100 - $points;
return ['level' => 1, 'needpoints' => $needpoints];
} elseif (100 <= $points && $points <= 190) {
$needpoints = 200 - $points;
... | 1 |
a919b8696adbee55ea890f1d9cb3a09f | a47350f2b0eec75b29d4abee1e91fb55 | ensures the floating point offset corresponds to less than half a tile | void GameMap::SetOffset(int off_x, int off_y)
{
auto max_x_offset = this->x_extent - this->display_width;
auto min_x_offset = 0;
if (off_x > max_x_offset)
{
this->x_offset = max_x_offset;
}
else if (off_x < min_x_offset)
{
this->x_offset = min_x_offset;
}
else
{
this->x_offset = off_x;
}... | 0 |
9ddbad91b1461fbfb3bba5f1595163c6 | 82909f6ceb3a6b6b2d3eb150a800bf17 | \brief Converts azimuth fractional degrees to angle integral degrees, arcminutes, arcseconds. | {
uint8_t dm_deg = (uint8_t) dec;
return (dm_deg * 100.0f) + (dec - dm_deg) * 60;
} | 0 |
0316f78a582cdc0e260f9786974f9e0c | 649e2a1fd7f783d1ff7a47dbf59f411b | 获取sandbox中文本文件的内容 | StringBuffer sb = new StringBuffer();
File file = new File(SDPATH + "//" + fileName);
try {
FileInputStream fis = new FileInputStream(file);
int c;
while ((c = fis.read()) != -1) {
sb.append((char) c);
}
fis.close();
... | 1 |
0d682624a1e5f913f513184a83f0fc08 | 45ee7c0760f02e5c4f9cb3e3f78024d2 | Consolidates tempTIMDs for the same team and match | $id = $info[0];
$dat = $info[1];
$a = $info[2];
$b = $info[3];
$t = count($dat);
$link = DB::getDB();
for($i=0;$i<$t;$i++){
$sql = "UPDATE forecast SET startdata = :dat, team1 = :team1, team2 = :team2
WHERE id = :id and (team1 != :team1 or team2 != :team2 or startdata != :dat)";
$stmt = $link->p... | 0 |
c35ef3c654dca355992dd02008169f8d | 2da04aa557a42ec0ef8752ade3577564 | Returns all types used by classes on given source path (source root). | public class TypeResolver
public Set<Class<?>> resolve(final String baseSearchPath) {
return resolve(baseSearchPath, ALLOW_ALL_FILTER);
} | 1 |
ea30e2e04c4c4acfb19806fedec89b88 | f27005441bdc08ffcb9e34d0859a5291 | Will start a purchase flow for given sku name.
ObfuscatedAccountId and obfuscatedProfileId are optional.
Result will get back to [PurchasesUpdatedListener] | {
plugin.CallStatic("purchase", new object[] { sku, accountId, profileId });
} | 1 |
ee5c2cef69d29994ef27197056478012 | 0b3073b12954d60a52322ac65558ba59 | 根据父功能编号查询功能列表 | namespace DistributedBLL.Func
public class FunctionBLL
public List<FunctionInfo> GetListByParentId(int parentId)
{
return dal.GetListByParentId(parentId);
} | 1 |
3b9249bb56556570ff23f636c0b5c8fc | 51438d1a8d96d3e187e5126c75345cd8 | Функция, разбивающая текст на блоки по 16 символов | pieces = []
blocks = math.ceil(len(text) / length)
for i in range(blocks):
pieces.append(text[i * length:(i + 1) * length])
return pieces | 1 |
052e4a0fa387b3a942f6879c51d524c1 | aafd196a1083306dd34bd6afbf48a84d | Set the combo boxes and column indices given a list of column positions | class TokenListCtrl(wx.ListCtrl, ListCtrlAutoWidthMixin):
def set_columns(self, columns):
for i, colname in enumerate(columns):
self.InsertColumn(i, colname, width=90) | 0 |
fe70ec54510737d7f563415fe299402d | efa53fb0176afc275c6560057d63375e | Mock for abstraction of rospy.is_shutdown(). | class RobospectPlatformMissionManager:
def rosShutdown(self):
if self.running or not self.ros_initialized:
return -1
self._state_publisher.unregister()
self.ros_initialized = False
return 0 | 0 |
7c7cdf1ee172e455cce3b953cd74ac26 | f953803583eb069531c048b98bfbdb55 | 订阅turtle1/cmd_vel话题的回调函数,用于显示速度以及角速度 | class TestPub
void velCallback(const geometry_msgs::Twist::ConstPtr &msg) { twist = *msg; } | 1 |
b481fa37265f365e58a65207e894ecc9 | e5dcb426d69f2ffb27bcf40ef854774f | Get the airport code for the location that this data was recorded at | @XmlRootElement
@JsonPropertyOrder( { "_id", "key", "name", "fullName", "iata_airport_code", "type", "country",
"geo_position", "locationId", "inEurope", "countryCode", "coreCountry", "distance" } )
public class City implements Serializable
public Object getIataAirportCode() {
return iataAirportCode;
} | 1 |
d5891fc8ba97c1e73733f74e1a74b848 | 39cac306172c29e02ecd7d0c0e1d37f3 | ParamsFromContext extracts params from context | func FromContext(c context.Context) gql.Context {
return &ctx{c.Value(router.RequestContext).(router.Context)}
} | 0 |
873ec3691b366a1b62e227cfb085448c | a8a142192c146c0535101f508f68d7bb | 判断当前“时 : 分”是否在一天中某一区间内 | function isNowBetweenTimeEx(startHour, startMinute, endHour, endMinute)
{
return isNowBetweenTime(startHour * 60 + startMinute, endHour * 60 + endMinute);
} | 1 |
4f53447c1882abf2cd8b25da55221f9f | b8acaf05cfed8f6a3b05462aeffbadcf | right hand side of the simple harmonic oscillator | void rhs(const double &t, const vector<double> &x, vector<double> &dxdt)
{
double aux = a * x[1] * x[0];
dxdt[0] = r * x[0] - aux;
dxdt[1] = c * aux - d * x[1];
} | 0 |
b27b745914077637aa2b3926b4ce5736 | 443fa8ab9689dc833010790708b3f69e | Encodes an <see cref="ECPoint"/> object to a byte array. | @JvmStatic
fun serP(p: ECPoint): ByteArray {
return p.getEncoded(true)
} | 1 |
ae06484c3036a35f44836681e7de70e8 | 9ec248b1f08f897e07baea02156e5e12 | 项目名称处理, 项目中的所有短横杠全部转换成下划线 | if (projectName == null || projectName.isEmpty())
return "";
List<String> tokens = tokenizeProjectName(projectName);
StringBuilder sb = new StringBuilder();
for (String string : tokens) {
if (sb.length() > 0) {
sb.append(" ");
}
sb.append(string);
}
return sb.toString();
} | 0 |
dbc8603c5432dd1ea52e9a0e5d0c9cbe | fdec9dc100d62d4c8646d3a1dfe260b7 | 处理微信的请求消息 提供翻译服务 | public class CoreService
public static String processRequest(HttpServletRequest request) {
String respMessage = null;
try {
Map<String, String> requestMap = MessageUtil.parseXml(request);
String fromUserName = requestMap.get("FromUserName");
String toUserNam... | 0 |
825c278e7263e0584358a50f27bb6538 | 2af16f5ae48eaf9af162769f8932aade | フォームに値が入力されていればセッションから同じ値を返す関数 | function form_value($name){
if(isset($_POST['mode']) && $_POST['mode']=='REINPUT'){
if(isset($_SESSION[$name])){
return $_SESSION[$name];
}
}
} | 0 |
f521b904f68998559217f472d4e49364 | dd51808d11a12c331640597e41c6d98b | Computes the ReLU activation | class Relu(Activation):
def calc(x):
return np.maximum(0, x) | 1 |
3beb1c664b1a1c0b2a7d819e5739a3d8 | 6261baca52d0e820d42812980be1976e | преобразует строковое значение цвета формата ХХХХХХХХ в цвет | namespace Scada.Admin.App.Forms.Tables
public partial class FrmBaseTable : Form, IChildForm
private static Color StrToColor(string s)
{
try
{
if (s.Length == 7 && s[0] == '#')
{
int r = int.Parse(s.Substring(1, 2), NumberStyles.HexN... | 0 |
e175e8f2aa9956897118bea37d24ea35 | e42772d684a60459c7c8fbdd3150d463 | Retrieves the focal plane of a give data point. | if x is None:
x = aman.det_info.wafer.det_x
if y is None:
y = aman.det_info.wafer.det_y
if mapping_data is None:
fp_to_sky = sat_to_sky(SAT_X, SAT_THETA)
else:
mapping_data = (tuple(val) for val in fp_to_sky)
fp_to_sky = sat_to_sky(*mapping_data)
theta = -1 * ... | 1 |
c9edb51d8953ac24647f3ecb684e61b1 | 6bff20ef51f9769d260d1672d61736b6 | método que recupera las calles de un área guardadas en base de datos | this.streetarr = [];
this.billboardService.getallstreets(this.myForm.controls.AdCity.value).subscribe(res => {
res.forEach(element => {
this.streetarr.push(element)
console.log("streetarr: " + this.streetarr)
}),
(error) => { console.log("error") }
});
} | 1 |
d4e8a8bec6df790ff5103f7ebb579e7e | f602d8654a61779e5fcc261546739c4e | 読み上げ時の待ち時間を計算します。 | {
int restCount = e.RestTalkTaskCount;
if (restCount <= 2)
{
return TimeSpan.FromMilliseconds(250);
}
if (restCount <= 4)
{
return TimeSpan.FromMilliseconds(200);
}
if (restCount <= 7)... | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.