query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
1d1d632a01a0bc3de6114d122fc757a4 | be59e5d6f8f10d7f45f4e2553f0aafd2 | Test la validité d'un champ | function check_field($name, $value)
{
$output = false;
switch ($name) {
case 'ajout_FR':
case 'ajout_EN':
case 'ajout_ES':
case 'mot':
case 'langue':
case 'keyword':
$output = check_trad($name, $value);
break;
case 'submit':
... | 1 |
54c1941c200b00c429edeeae71be357e | 26e98aaf6f0b6b2f5bd69d75102e7b9b | test vector from RFC 7748, section 6.1 | namespace RandN.Rngs
public sealed class ChaChaTests
[Fact]
public void Rfc7539Vectors()
{
var seed1 = new Seed(new UInt32[] { 0x03020100, 0x07060504, 0x0b0a0908, 0x0f0e0d0c, 0x13121110, 0x17161514, 0x1b1a1918, 0x1f1e1d1c }, 0x4a000000);
var rng1 = ChaCha.Create(seed1);
... | 0 |
4f407e190b6413c92bbf2b1d5983e12b | a0c24edcacfaaf3e5600bba3fd4c311c | ツアー名を取得する為のメソッド | public class SelectCartAction extends ActionSupport implements SessionAware
public String getTour_name() {
return tour_name;
} | 1 |
6fe09b580e378932d07d9fb0882bd589 | e4fa0b3f2627147b1db2971ed80ba3be | 在子类中的调用,类名可能是 `ChoosePicView$startAnimator$1` 这样的形式,一般我们屏蔽一个类的日志输出后,内部类的类名同样需要进行屏蔽
判断调用类是否被屏蔽了日志输出
false ->不可以进行日志输出
默认是可以进行输出的
ChoosePicView$startAnimator$1 | protected void onMethodEnter() {
if ("<init>".equals(methodName) || "<clinit>".equals(methodName)){
return;
}
mv.visitTypeInsn(NEW, "java/lang/StringBuilder");
mv.visitInsn(DUP);
mv.visitMethodInsn(INVOKESPECIAL, "java/lang/StringBuilde... | 0 |
08c5b44d528b1955e594a87bffc59c68 | 8454a45fe3b32f91fa1c320b405411f3 | Save competence as new record or update an existing record. | @competent = Competent.new(params[:competent])
respond_to do |format|
if @competent.save
format.html { redirect_to @competent, notice: 'Competent was successfully created.' }
format.json { render json: @competent, status: :created, location: @competent }
else
format.html { re... | 0 |
6bce373e0a7c0a0fa38149850f41ce63 | ceb9f4c326a4dcfe88faccf2b0dd3bfd | Genero numeri pseudo-randomici per scegliere una frase di risposta casuale | int
French_stick:: generator_number(){
srand(time(NULL));
int alea = rand() % 480;
return alea;
} | 1 |
1d1eabd6b5c75bfd9c99b114bbe1401e | 39cc986a44019967e38cc0f4b943b0b5 | 获取结算方式名称 | class DfsPay extends \yii\db\ActiveRecord
public function getPaymentName(){
return Payment::findOne(['payment_code'=>$this->getPaymentCode()])->payment_name;
} | 1 |
c5b88c24874289952f32e53a3ac314ae | 59fa6414ec75108a62405cb315c8ad0d | 修改优秀作品 | @Update("update works set is_good=#{is_good} where id=#{works_id}")
public Integer setGoodWorks(@Param("is_good") Integer is_good,@Param("works_id") Integer works_id); | 1 |
69f4d5629cc6f4a2567487789647bc21 | 94c052b5807429e66661d411864d7f13 | Fetch raster height in pixels. | class GdalImage:
def YSize(self):
return self.dataset.RasterYSize if self.dataset else None | 1 |
41131a397d0b6b6e26da3cbf2ee447ad | d9dabfeae5e6224e38f9987bc1ded81b | GET: AttributeValue | class AttributeValueController extends Controller
public function index()
{
$attributesValue = AttributeValue::with('attributeGroup')->paginate(10);
return view('Admin.attributes-value.index', compact(['attributesValue']));
} | 1 |
77058677e9e5f453b39da1200e79de02 | d37d19963171c416c68c36806b0acc61 | 返回担保付款时显示style属性值 | String payment = "";
if ("T".equalsIgnoreCase(gi.getPayment()) && "CRED".equalsIgnoreCase(gi.getGuarantee()))
payment = "K";
else if ("T".equalsIgnoreCase(gi.getPayment()) && "COMP".equalsIgnoreCase(gi.getGuarantee()))
payment = "G";
else if ("T".equalsIgnoreCase(gi.getPayment()) && "P".equalsIgnoreCase(g... | 0 |
75f90f4365fde08cc5b5096cce5b2c8e | 4a2b31bbd9d02944c5a6bfd4b2d25e4b | PointCloudの情報をClusterに格納 | self.x = cloud_point_array[:, 0]
self.y = cloud_point_array[:, 1]
self.z = cloud_point_array[:, 2] | 0 |
697a873dde5070e8d6109344b618c925 | 82115dbe7873d0d7bd2b2c4bc9429443 | Returns:
a string, the local path of module | class ModuleWrapper(IPlugin.IPlugin):
def path(self):
return inspect.getfile(self.__class__) | 1 |
f9d18f5141e161b8e87befaf618e6aa4 | 63527b264a09d489ac49e1ca3a1f4c5b | POST /book_lists
POST /book_lists.xml | @book = Book.new(params[:book])
@book.current_user = current_user
respond_to do |format|
if @book.save
flash[:notice] = 'Book was successfully created.'
format.html { redirect_to(book_url(@book.id)) }
format.xml { render :xml => @book, :status => :created, :location => @book }... | 0 |
f28f4033fd4e42d5bd4e0b8a6351e18f | b44f93d8496cd8ab862a2725e1d207ab | Tests AverageValue if only NaN Values | for func, result in (
("Sum", 15),
("Avg", 5),
("Min", 1),
("Max", 12),
("StdDev", 4.96655480858378),
("Variance", 24.666666666666668),
("AvgCountPerInstance", 1),
):
stats = mommy... | 0 |
97188dda928a2f72db293ed5941e3ff1 | 025c2229cc4d55ae77593f6e346800ce | Handles all communication with TT server via suds | zeep_settings = Settings(strict=False, xml_huge_tree=True)
zeep_transport = Transport(cache=SqliteCache(timeout=86400))
client = Client(f"{self.endpoint_url}/{request.service}?wsdl",
settings=zeep_settings, transport=zeep_transport, plugins=[self.history])
xsd_use... | 0 |
e8488294d71f5dcc4a8b57d40dce60e5 | 40199617cf4d489a3b72dfbd60546f41 | sor | void ss(int n, int* vet) {
int i, j, menor, tmp;
for (i = 0; i < n; i++) {
menor = i;
for (j = i; j < n; j++) {
if (vet[menor] > vet[j]) {
menor = j;
}
}
if (menor != i) {
tmp = vet[i];
vet[i] = vet[menor];
vet[menor] = tmp;
}
}
} | 0 |
ff552436cef0b5daa2f6c02abd3a8d01 | c4d513035eb974c7bf012e6a743c36ac | Resolve a hostname and port.
Synchronous version, without -4/-6 preferences. | static int resolveHost( const char *host, unsigned int port, int family,
struct addrinfo **res )
{
struct addrinfo hints;
memset(&hints, 0, sizeof(struct addrinfo));
hints.ai_family = family;
hints.ai_socktype = SOCK_STREAM;
hints.ai_flags = 0;
#if HAVE_DECL_AI_ADDRCONFIG
hints.ai_flags |= AI_ADDRCONFIG;
#endif
... | 1 |
4cd4debc2c7a683dfe6528df603f81d4 | fc162df7de68fefe755017f5b9d30178 | 向对端发送 Chunked 数据分片 | public class TimeoutHandler implements Runnable
private void sendChunkTCP(Peer peer, ProtocolState state) throws IOException {
this.state.initRestoreResponseState(peer.getProtocolVersion(), state.getFields()[Peer.hashI], this.chunkPath, state.getFields()[Peer.chunkNoI]);
byte[] msg = this.state.getParser().cr... | 1 |
65d250dc614d0cef381fefdf0a9a80a2 | 6215c852f20cc85c10e99a1c7c6c0c37 | 判断两次单击是否相同图片,不相同:恢复默认图片 相同:完成数量加1,记录图片状态 | class GameTwiceJoyMainView extends StateEui
private cardMatchCheck(currentItem: GameTwiceJoyCard, posX: number, poxY: number): void {
if (this.selectCardArr.length == 2) {
for (var i: number = 0; i < this.cardsItemArr.length; i++) {
if (this.cardsItemArr[i].cardPosId == this.selectCa... | 1 |
cf53d438d160d0e24a9f416058bb2d7e | da24f0416657e0d5f2e28e57b6dd9353 | 服务端测试 | func TestCS(t *testing.T) {
hst := GetRandomHost()
if err := hst.Server().Register(new(RpcService)); err != nil {
t.Fatal(err)
}
hst.RegisterGlobalMsgHandler(func(requestData []byte, head service.Head) (bytes []byte, e error) {
t.Log(string(requestData), head.RemotePubKey, head.RemotePeerID, head.RemoteAddrs)
... | 1 |
dc54d19848313e6150b27197f02a24bd | 1863a9e6f471daeafd9daaf778c3a8ee | Metodo que se encarga de agregar las bodegas al sistema | function InsertarBodegasDocumentosdLib($Consecutivo,$numeracion,$concepto,$Codigo,$Cantidad,$costoProducto,&$dbconn){
$query = "INSERT INTO bodegas_documentos_d(consecutivo,
codigo_producto,
... | 1 |
56bd5fcae048bb6cac5e23be512cebb4 | 2fc56d8bd726a8a443642ad3290a833b | 根据特产id查询特产存量 | Object queryNumByProductId(Long id); | 1 |
8302b0f1c494ce357579866adce692b1 | 07c094e45bfac37ef7e350fb204523c3 | Academic Registration button click from student home | public partial class wfstudent : System.Web.UI.Page
protected void lbRegisterForCourse_Click(object sender, EventArgs e)
{
Server.Transfer("wfRegister.aspx");
} | 1 |
dde7babb454eaabe8d34746b46eaa49c | b7825c6e882bc2b90d0d1bde8eb4099b | This part describes the behaviour when using the current camera rotation to compute the angles
for the rotation of the next camera.
This is not used right now because of reason explained at the beginning of this script. | {
float horizontal = Input.GetAxis("Horizontal");
float vertical = Input.GetAxis("Vertical");
Vector3 diff = m_rigidbody.position - m_oldPos;
diff.Normalize();
if(diff.x != 0.0f && diff.z != 0.0f)
{
m_rigidbody.transform.rotation = Quaternion.LookRotation(... | 0 |
2228a82fa25af255863171bffdf09672 | a2d85e3bf77049498be7e0bfffe39b1d | Play one round of tournament. | class RPSTournament
public function round_plays(array $players) : Player
{
$winner_arr = [];
if(count($players) == 1) {
return $players[0];
}
else {
for($i = 0; $i < (count($players) - 1); $i+=2 ) {
$winner_arr[] = $this->each_play($players[$i]... | 1 |
de118512c9184aa7a8a5fdc1fd4ab2e5 | 63b4e732265f08a744da60cdf5eb64e3 | Compute the cosine similarity between documents d1 and d2.
Input: two dictionaries representing the TF-IDF vectors for documents d1 and d2.
Output: the cosine similarity. | result = docVect1.transpose().dot(docVect2).sum()
dis1 = math.sqrt(docVect1.transpose().dot(docVect1).sum())
dis2 = math.sqrt(docVect2.transpose().dot(docVect2).sum())
return result / (dis1 * dis2) | 1 |
59e8b7b6137c2458fb81f04057293de5 | fc5d38c9824a0e2207e2dd703f08a8f5 | 将TiledMap坐标转换为屏幕的坐标 | function MapManager:convertScreenPosToMapPos(pos)
local posMapX, posMapY = self._pTmxMap:getPosition()
local posResult = cc.p( - posMapX + pos.x, - posMapY + pos.y)
return posResult
end | 0 |
32b39f245041dde31ffb2c43c5569438 | 9b018b8b559cc72cf47fd9aa2e6bf42f | Returns true if there is an intersection between the given ball and paddle
Using simple boolean algebra | public class Hole extends GameObject
public boolean intersectsBall(Ball ball) {
return getBounds().intersects(ball.getBounds());
} | 0 |
6f8138767980896456f7c39ce0d120cd | 756a29f544ce140acb9957b8da945893 | Expose the LiveData Categories query so the UI can observe it. | disposable = chuckAPI.getCategories()
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribeBy(
onNext = { onSuccess(it) },
onError = { onError() }
)
} | 0 |
0f1d1734d94e4e85eef1e38b7ab37c38 | ed26d5e12b177ce60bc266d4910b6787 | Registers a subsystem implementation based on the given subystem parameters. | class Bot(object):
def register_subsystem(self, identifier, classname, **kwargs):
if identifier in self._subsystems:
raise SubsystemRegisteredError
clazz = self.get_object(classname)
self._subsystems[identifier] = clazz(self, **kwargs)
self.__runlevel_map[clazz.RUNLEVEL.level... | 1 |
87ea9acf738ade5cbf3353ed5b46d9e1 | 85b93f42e27bd5b25ae64df4b675f6d9 | <para>Toggles the (computed) value of the boolean property showCommandLabel.</para> | namespace qx.ui.core
[JsType(JsMode.Prototype, Name = "qx.ui.core.Command", OmitOptionalParameters = true, Export = false)]
public partial class Command : qx.core.Object
[JsMethod(Name = "toggleEnabled")]
public void ToggleEnabled() { throw new NotImplementedException(); } | 0 |
25866088f65cc9dd72ec3a4b1f45679f | a73e898ca5f9410831b7812d87a248b1 | 根据文章的articleId返回图片的url | namespace DTcms.Service
string GetArticleImgUrl(int articleId); | 1 |
d33a1d1b798a43390f2b7a2f08fad285 | 4dbe41b7101d3c08487570a13eecdd07 | Function responsible for storing the Chat Model | class ChatConsumer(AsyncWebsocketConsumer):
async def save_model(self, sender, receiver, message):
from .models import Message
return Message.objects.create(sender=sender, recipient=receiver, message=message) | 1 |
54249ecbe753c3504f5720b941f421fc | cd84256a831fd60c6541dac254cda49e | Get all event days from Calendar data | {
using (MySqlConnection conn = GetConnection())
{
String sql = "SELECT * FROM evt";
using (MySqlDataAdapter dataAdapter = new MySqlDataAdapter(sql, conn))
{
using (DataSet ds = new DataSet())
{
... | 1 |
756e1054d3c1e13e6c9640e36a6a5553 | 4cb77a99a5d35e2a13d64cd81fa93299 | Search bo handle in shared bo map to get va information | namespace LPFW.ViewModelServices.Extensions.OrganizationBusiness
public static class DepartmentModelServiceExtension
public static async Task GetboVMRelevanceData(this IViewModelService<Department, DepartmentVM> service, DepartmentVM boVM)
{
var boId = boVM.Id;
var bo = await service... | 0 |
2a56062ed880e3565e5fc6d73e1829dd | cbb00dfa9f776d8732549aca49fd61a1 | se busca si existe un nodo de un tipo ya creado con el nombre deseado | if (!nombre.equals("")) {
for (Nodo nodo : lista) {
if (nodo.getClass().getSimpleName().equals(tipo) && nodo.getNombre().equals(nombre)) {
return true;
}
}
}
return false;
} | 1 |
98a7f6f3971ef567b2c89cde8e7b9609 | 53c23341ecfba3b4cb94eb51ed4bb162 | Vectorized calculation of the great circle distance between two points
on the earth (specified in decimal degrees) | rad_lat, rad_lng, rad_pt_lat, rad_pt_lng = map(
np.radians, [d_lat, d_lng, p_lat, p_lng]
)
dlng = rad_lng - rad_pt_lng
dlat = rad_lat - rad_pt_lat
a = np.sin(dlat / 2.0) ** 2 + np.cos(rad_lat) * np.cos(rad_pt_lat) \
* np.sin(dlng / 2.0) ** 2
c = 2 * np.arcsin(np.sqrt(a))
retu... | 1 |
b1d958e67d78e30615b2df3c2b5432b9 | 4b96cdb032381681aa3561b49a7b2556 | Get the passport's ExpirationDate for forms. | class betacrewinfo
public function getPassportexpiredate()
{
return $this->passportexpiredate;
} | 1 |
f9aef8c1293fb8414bc0420308922c13 | 5e59958fad2f66a2c835f2949749e643 | Enqueue of messages LinuxDB::sensapp::registerSensor | {
XSensorMEP500Data *data = (XSensorMEP500Data *)packet->data;
char command[512];
char *table = xdb_get_table();
sprintf(command,
"INSERT into %s "
"(result_time,nodeid,parent,epoch,voltage,"
"therm,humid,humtemp)"
" values (now(),%u,%u,%u,%u,%u,%u,%u)",
table,
packet->no... | 0 |
6c24f02845fea406e00d7eb60433930d | 9c3fde3bdfc9fa9676c03923f4ec38c2 | Método para alterar o valor do atributo quantidade no banco de dados, através da aplicação. | {
DataTable dtSource = null;
try
{
dtSource = (DataTable)this.dgItems.DataSource;
dtSource.Columns["qtd"].ReadOnly = false;
dtSource.Rows[this.dgItems.CurrentRow.Index]["qtd"] = this.txtQtdPeca.Text;
this.dgItems... | 0 |
2ff3c63046261c9ec72f42efb33e22a8 | efc17cc67a5ef94db38826f4b4cbbbf6 | given a pointer to a sorted x[i], returns mean, median, and
stdev | Tango::DevDouble &a_mean, Tango::DevDouble &a_rms, Tango::DevDouble &a_peak)
{
a_mean = 0.0;
if (m_valid == 0) {
a_rms = 0.0;
a_peak = 0.0;
return;
}
Tango::DevDouble hi_peak = a_buff[*m_SAStatNumSamples - m_valid];
Tango::DevDouble lo_peak = hi_peak;
Tango::DevDouble... | 0 |
68312d9dfba26a5116c6ac1ce70ea60c | 2e7bea19655c428b8221a0efa8511f46 | 使用尾递归实现波那契数列结果 | func fbn(n int) int {
if n == 1 || n == 2 {
return 1
}else {
return fbn(n-1) + fbn(n-2)
}
} | 0 |
c82efeb176d9ff62c4ee870c4ee20600 | 9715d243f61d5846483e1d859eef90aa | 检查文件是否是通过 HTTP POST上传的,如果不是则可能是攻击性质的上传 | try {
Set<FileItems> fileItems = context.getFileItemList();
if (fileItems != null) {
for (FileItems fileItem : fileItems) {
if (fileItem.isFormField()) {
if (verify(fileItem.getFieldValue())) {
AttackInfo attack = new AttackInfo(
SYS_MODULES_FILEMODE, fileItem.getFieldName(),
... | 0 |
b3b89e06c06a196f2f027bb7e1f92c4f | 4d2438424dbda1e3ebf3c1214a7dec05 | functie care verifica daca un string e numar | int i=0;
while(str[i] != '\0'){
if(str[i] < '0' || str[i] > '9'){
return 0;
}
i++;
}
return 1;
} | 1 |
fd3310982b24e8252e20e3acf7121135 | 40441f9bd7c130cb348abc8de932a87e | Verify that the initial state zeroes all possible EV_REL axes. | actual = bootstrap_perfect_model(
PM_ds_initialized_1d,
PM_ds_control_1d,
metric="rmse",
comparison="e2c",
dim="init",
sig=50,
iterations=ITERATIONS,
)
for var in actual.data_vars:
actual_init_skill = (
actual[var].sel(skill="initia... | 0 |
90e9d4c50045265b3bc95d0814a7b11c | f22879d6eaf74e6bb6a04e8e2aa3d040 | 累加末尾的阶乘和 | int sum(int x) {
int ans = 0;
for (int i = x; i; i -= lowbit(i))
ans += C[i];
return ans;
} | 0 |
9a8e6497cdb4f95e0cf8e4a19a9c5c58 | 90b4faa3cb8c34b87ccaabb452bbd8fa | 将已经读取到缓存中的VOList分页展示给前台 | if (originv == null)
return new ArrayList();
page.rowcount = originv.size();
List v = new ArrayList();
if (page.npage < 0)
page.npage = 0;
if (page.getPsize() < 0)
page.setPsize(100000);
int index = page.npage * page.getPsize();
int i = 0;
while (i < page.getPsize() && index < originv.size())... | 1 |
c2620682dbcdfe50c041746c58e99824 | 69dd9da8cee23c8695a258f6ef27035a | Gets the value of the specificationVersion property. | public final class ServerLibraryDependency
@CheckForNull
public Version getSpecificationVersion() {
return specificationVersion;
} | 1 |
9dbbb0db25e78e52987d88335611e3e0 | 16fe7fdb5cd55c85358b57388cc27e77 | activity销毁时,调用,关闭请求返回 | @SuppressLint("Registered")
public class BaseActivity extends FragmentActivity implements OnClickListener
@Override
protected void onStop() {
super.onStop();
JVolley.getInstance(this).cancelFromRequestQueue(getTag());
} | 1 |
55e5894e8452e9bc1587aa4a4a54a473 | d563aba5910a45cc825f3ac732f347a3 | 新增代金券方案 | @PostMapping("v1/add")
public Result add(@Validated(VoucherGenerateTO.TestAdd.class) VoucherGenerateTO voucherGenerateTO, BindingResult bindingResult) throws ActException {
try {
List<VoucherGenerateBO> voucherGenerateBO1 = voucherGenerateAPI.addVoucherGenerate(voucherGenerateTO);
... | 1 |
ab65270e706def3e6ea23f45563cf4ec | 7015818545d24c1c32d43953acc2ff36 | Runs when the file is about to be included. | {
$this->includedFiles = [];
$allIncludedFiles = get_included_files();
foreach ($allIncludedFiles as $filename) {
$includeVersion = filemtime($filename);
$this->includedFiles[$filename] = $includeVersion;
}
} | 0 |
09daed760bbceabdd1e3bc2b35f820d6 | bd358247004690a1226d5bf915585a73 | Set the flag to control whether certain well-known imports are blocked
from being automatically loaded if they encountered in an <code>imports</code>
statement. Note that automatic loading of all imports can be switched of
with {@link #setLoadImportedOntologies}.
autoloaded, even if autoloading is on | abstract class TableBase implements TableInterface
public function setAutoImport($autoImport) {
$this->autoImport = (bool)$autoImport;
} | 1 |
0e6ec9370fe940869568e4853405f23e | d12b53b838f1b371133183ce1e5a48aa | https://mesosphere.github.io/marathon/docs/marathon-ui.html#application-status-reference | app_attrs = app&.slice(
:id, :uid, :dxid, :scope, :title, :readme, :revision, :dev_group, :release
)&.merge(link: app_path(app))
challenges_attrs = if app
challenges.map do |challenge|
ch_app = challenge.app
{
id: challenge.id,
name: challenge.name,
... | 0 |
f8e579604db8253db4475aa582e77cf5 | bc5df577f19d2f0c075a5a16e884571d | Add a parameter (its key and value) to the list | {
if (params->capacity <= params->size) return SDB_E_CAPACITY_TOO_SMALL;
params->params[params->size].key = strdup(key);
params->params[params->size].value = strdup(value);
params->params[params->size].parent = params;
params->size++;
return SDB_OK;
} | 1 |
11de1660e7b6419ff84261be33a90ef9 | 0db30695f55e5ded8ab3fd6936a0d84a | Returns a list object of next changed categories. | class CategoryChangesAsRdf extends Maintenance
protected function getNewCatsIterator( IDatabase $dbr ) {
$it = $this->setupChangesIterator( $dbr );
$it->addConditions( [
'rc_namespace' => NS_CATEGORY,
'rc_new' => 1,
] );
return $it;
} | 1 |
c885a303f930de5daae70ee4eeaae93c | e5ddbdb1b391549a067862257837a6a8 | finds shortest path to reach from one vertex to another in graph | Path shortestPath (Graph g, Vertex v1, Vertex v2); | 1 |
5b5ba6fffd8eab307795585496996970 | 5270637ced707369eec5d2199b0321ea | 商品価格2(税込)を取得する<br> | @Bean(table="特別単価マスタ")
public class Tokubetsutannka_M
public String getSt_dt_tsuujou2() {
return st_dt_tsuujou2;
} | 0 |
dcaad9cd7284ea44411c6ced9710f9de | eaee0ad26e74ec0b9ef1f95df2024995 | GET: Disponibilites | {
ViewBag.list = new List<string> { "Location", "Vente" };
return View();
} | 0 |
b52d8ffe329de7e3203ffc7e879b20c9 | 4c1c04638293a9d7e18f3d1f272e7237 | 对佣金的处理, 默认万分之几, 保留小数点后一位. | class Item
def calc_fee(price)
rate = self.commission_rate / 100
(price * rate).floor
end | 0 |
87844da97cace13031d67e4540872c20 | 306fafbbafecee7ec7616e91181968b2 | 尾插法创建链表
备注:
教材中默认从控制台读取数据 | public class LinkList
public void createListTail(int[] num){
Node tail = head;
for(int i = 0; i < num.length; ++i){
Node s = new Node();
s.data = num[i];
tail.next = s;
tail = s;
}
} | 1 |
be99ddf9d4d6f95f8b09048c81e8bf3b | ab2325d15a26ffc2965dbe504e03707f | shows a number of hearts corresponding to the enemy's health | {
bool empty = false;
int i = 0;
foreach (Image image in heartImages){
if (empty)
{
image.sprite = heartSprite[0];
}
else
{
i++;
if (curHealth >= i * healthPerHeart)
{
... | 1 |
a713e8df1e63b27d888e457c8e4d9cee | 55571cd6e4dbbf2f003bde09e692d6bf | Activates the Metro draw pile for instances when the player
clicks on the draw pile. | {
activeBlueprint.SetActive(false);
activeBlueprint = rallyBlueprint;
activeBlueprint.SetActive(true);
currentEvent = MouseEvent.RallyCursor;
} | 0 |
82a747148fdeec1de407852a480db9ae | 722b5c7b6415c628a3cfab32e1faeacb | Checks if a value is really meant to be "true". <br />
Can be usefull when checking smarty params for the value true | class Liquid
public static function isTruthy($value) {
return !self::isFalsy($value);
} | 1 |
3ab75412f583393d660c4cb9e1a4abff | ee1bf53a7012b7eb33b4a57f446f675c | 检查忘记密码表单 | class User extends Controller
function checkForgetPassword(){
$this->csrf_token_validation(false);
$login_name = $this->input->post('login_name');
$email = $this->input->post('email');
$userModel = UserModel::instance();
$user = $userModel->getUserByLoginName($login_name);
... | 1 |
4995251995a058c3640e03dfda855634 | 5d1bd7b5c8a0d4d8e6f1096bb6f1eb28 | Method is used to get all hsn codes | ArrayList<String> hsaList = new ArrayList<String>();
String query = "select hsa from hsa order by hsa";
ArrayList<Object[]> rs = runQuery(query);
if (rs.size() > 0) {
for (Object[] oa : rs) {
hsaList.add((String) oa[0]);
}
}
return ... | 0 |
fc7eb9093edc05feadea8d7c2a776bc6 | 7502d3b9a80761d50aa632609a5cdfb6 | Get customerAddressLine4 | @XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "AddressType", propOrder = {
"fullAddress",
"contactName",
"companyName",
"jobTitle",
"propertyNumber",
"propertyName",
"addressId",
"addressLine1",
"addressLine2",
"addressLine3",
"addressLine4",
"cityCode",
"city... | 1 |
dfb597d2a2a017cf463b25a73553aa1e | d4543e91db3065b35c6760d6ae82c140 | Test that kinetics search accepts 1 reactant and 2 products | family = self.database.families['R_Addition_COm']
reactants = [Molecule().fromAdjacencyList("""
1 *1 C u0 p1 c-1 {2,T}
2 *3 O u0 p1 c+1 {1,T}
"""),
Molecule().fromAdjacencyList("""
multiplicity 2
1 C u0 p0 c0 {2,D} {7,S} {8,S}
2 C u0 p0 c0 {1,D} {3,S} {9,S}
3... | 0 |
22e51e7bafa9e30efbe268156fe71cbe | fbc271bf947f7ab217818ba8eb9d06b7 | This function finds open spot for Func/Sub in CallTable | int getfunc(char *func_name){
int i = 0;
int found = 0;
int out = -1;
int a,b;
while (i < func_table_top && !found){
if (strlen(func_table[i].func_id) == strlen(func_name))
found = (strncmp(func_table[i].func_id, func_name, strlen(func_name)) == 0);
++i;
}
if (found){
... | 0 |
63249bfb3be8532cbf4c6a0226bb000d | a1518bc4d4782340496a716c21e38579 | Copy ovf env file from dvd to hard disk.
Remove password before save it to the disk | with cd(self.tempPath):
for file in glob.glob('*.bin'):
with open(file, 'r', encoding='latin-1') as f:
contents = f.read()
if 'dummy_field' in contents:
self.origKeyfile = file
self.origXML = contents
... | 0 |
1e021b4103167d676b4316ed2762a348 | f09d6249483d0c637024d346b085bf38 | Counts the time in milliseconds from the human-friendly representation | function timeMs(val) {
var regex = /(\d+):(\d{2}):(\d{2}),(\d{3})/;
var parts = regex.exec(val);
if (parts === null) {
return 0;
}
for (var i = 1; i < 5; i++) {
parts[i] = parseInt(parts[i], 10);
if (isNaN(parts[i])) parts[i] = 0;
}
return parts[1] * 3600 + parts[2] *... | 1 |
cb9246abe1087e7dd6643fa00d133d74 | f2a79a27344a7d06a0c0bb3df794f27c | 获取Connector域名 | {
$protocol = $this->ssl ? $this::PROTOCOL_SSL : $this::PROTOCOL;
$count = count($this->domainController);
if ($count === 1) {
return $protocol . $this->domainController[0];
}
if ($this->useBackup === true) {
$connectionString = null;
fo... | 1 |
a94e87a72b21887f3e6b19ccc0b1b46d | 6703812a8af2e999690396f27d935896 | Returns the names of all existing remote branches. | l = [str(x).strip('\t *') for x in self.repo.git.branch('-a').split('\n')]
lenOf = len('remotes/origin/')
return [ x[lenOf:] if x.startswith('remotes/origin/') else x for x in l if not x.startswith('remotes/origin/HEAD')] | 1 |
a5b00a95486a31b26f6e75d639b0b5c8 | 90d5b7a1ec969caedc9fedcf8fc0ae7b | Returns the absolute extension path.
Wrapper around the static method. This makes the method mockable. | {
$this->requireFile('ext');
$class = ucfirst($this->shortname) . '_ext';
return $this->getFullyQualified($class);
} | 0 |
68001c16942e634c28c4e4694a79eb6c | 98f8f5a10be2d6c94f1c4f134d3125e0 | 将unicode编码转化为中文,转化失败返回原字符串 | export class NotificationInterceptor implements HttpInterceptor
private chinese(ovalue) {
if (ovalue) {
const omt = ovalue, uReg = /\\u(\w{4})/img;
if (uReg.test(ovalue)) {
const ret = ovalue.replace(uReg, function (str, subs) {
return unescape('%u' + ... | 1 |
4e0a0ce8f024a284e20d65392c2a2c68 | 81b448440ce4718b5e8b8ddb91bf5d24 | Get Z_PickingProd ID. | {
BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_QtyPickingEnt);
if (bd == null)
return Env.ZERO;
return bd;
} | 0 |
bfc2649cc5044606c6a177a2f95f2872 | bcf2dee41d55ca0bb13486fd23a650ed | post a new club request. | checkClub (data) {
return db.handleRequest(db.request.post('checkClub.php', {
data: data,
showLoading: true
}))
} | 0 |
62f2f298a79091d58aa5cca415576768 | 4eccd605fafa32f7399160403d6c842c | Method to get data set directory
Returns:
data set directory | def get_data_directory():
lib_dir = os.path.dirname(__file__)
data_dir = os.path.join(lib_dir, "dataset")
return data_dir | 1 |
598c8febf2b2385bb2cc1f8e926e1f6a | 59a43f51887c19d4637850a9bf9536ea | salva os dados complementares ao cadastro de pessoa (endereço e contatos) | function dw_save_extra_register_fields( $customer_id ) {
if ( isset( $_POST['email'] ) ) {
update_user_meta( $customer_id, 'billing_email', sanitize_email( $_POST['email'] ) );
}
if ( isset( $_POST['billing_first_name'] ) ) {
update_user_meta( $customer_id, 'first_name', sanitize_text_field(... | 1 |
23332ebb541646db3317829fe1b88a9f | 0fbd165ced9d83d3805495ce4a878443 | map array of JSON results to array of { label: _, value: _ } | var results = {};
if (dataArray[0]) {
var item = dataArray[0];
var fieldNames = Object.keys(item);
if (!primaryKeyField) {
if (item.id) {
primaryKeyField = "id";
} else {
var keyFields = fieldName... | 0 |
bd5b5430eca267c923f0cee3cf7ae792 | 3ae8b413ec71c996820c42ee902dfa29 | Calculate the feature size according to the input size, used only for the network using pooling to downsample. | img_w = input_shape[2]
img_h = input_shape[3]
fc7_feat_w = img_w
fc7_feat_h = img_h
for i in range(num_pooling):
fc7_feat_w = np.floor((fc7_feat_w + 2 * 1 - 1 * (2 - 1) - 1) / 2 + 1)
fc7_feat_h = np.floor((fc7_feat_h + 2 * 1 - 1 * (2 - 1) - 1) / 2 + 1)
... | 1 |
5d52ac1a12c302fe316ba9cc4a94b85d | 5e74b5cb9b40e4416e87f30828d846e4 | Return an iter of jobs that match this time pattern | class ScheduleIterator:
def __iter__(self: ScheduleIterator) -> Iterator[Job]:
return self | 0 |
34747f355531b488ce20c7878f76ef32 | 6040b1de3a0b7f57c768601a8d6fef8c | Regression: Test that we can read taxalabels delimited by spaces not new
lines. | data = '\n'.join([
'@SQ SN:ref1 LN:10',
'query1 0 ref1 2 60 2=2X2M * 0 0 TCTAGG ZZZZZZ',
'query1 0 ref1 3 60 2= * 0 0 TC ZZ',
]).replace(' ', '\t')
with dataFile(data) as filename:
ps = PaddedSAM(filename)
(read1, read2) = list(ps.queri... | 0 |
d006e53a6849b3de0eb10dd89dde7b72 | f23267ea5753639c4b2edb9eece0aaa2 | Clear <stop_id> value | Stop getStart(); | 0 |
d47f88a7cc2684f2abd8f75bc4abb707 | 4ca944bd4e272ef2377cb7b2ad171056 | Set the total number of subtests | public function setTotalAnswers($totalAnswers); | 0 |
00b219f7f30ab02c5466e10b55393aa3 | 15a3422485bfc40e28a2fc5263761aab | How many different repositories the user opened pull requests in. | margin = 100
limit = await remaining(github)
pr_repo = 10
if limit - margin <= pr_repo:
return 0
return math.floor((limit - margin) / pr_repo) | 0 |
afe5903418c786e9a8373121307c3fbb | 77f4e97955cdbd9720bf873db5a009a5 | 车辆出场上报信息 | long batchNum = DataFormat.getLongKey(inParam, "batchNum");
OrdDepartInfoYqSV ordDepartInfoYqSV = (OrdDepartInfoYqSV) SysContexts.getBean("ordDepartInfoYqSV");
List<Object[]> deaprtList = ordDepartInfoYqSV.getOrdDepartInfoWeb(batchNum).list();
OrdDepartInfoOutWeb departInfoOutWeb = new OrdDepartInfoOutWeb();
... | 1 |
5b2d23a643062f6b157801a8f8966da3 | e5f90e1b8ba18d3abc5cf596deb63e2b | Returns true if the cached projection is valid. | public class TransformContext
public boolean isCacheValid() {
return _cacheValid;
} | 1 |
5d72eb922c37c9845edbc0118504ac18 | 9f3e914c37f737d496fabe5836a853d6 | 获取文件名称,包含后缀名 | namespace TrainCommon
public class FileHelper
public static string GetFileName(FileInfo fi)
{
return fi.Name;
} | 1 |
f4cfea9f9ce839da4ff7e6234ada0a9a | 8321fd089c242a980f30ce99ae378710 | 保存图片,返回图片路径 | File filePic;
try {
filePic = new File(savePath);
if (!filePic.exists()) {
filePic.getParentFile().mkdirs();
filePic.createNewFile();
}
FileOutputStream fos = new FileOutputStream(filePic);
mBitmap.compress(Bitma... | 1 |
9441c1276e816c79a2804a2a1e564c0f | 464cc1724300a197a06b1e20d82e6fae | Computes the element-wise error function of `x`:
The output tensor has the same shape as ``x``.
This implementation is from the Handbook of Mathematical Functions and
has error less than 1.5 * 10-7 for all inputs.
book can be found here 'http://people.math.sfu.ca/~cbm/aands/frameindex.htm | def exp(x):
return tensor_exp(x) | 0 |
c6ea5a58b04d2c13667df225a0b12c64 | 082fe721d526647f081e40d03dc83126 | 消息处理 统一让房间数据管理来进行处理 | Object attribute = session.getAttribute(Config.USER_SESSION);
if (attribute != null) {
UserSession userSession = (UserSession) attribute;
if (userSession.getRoleId() > 0) {
if (!userSession.sendToHall(MsgUtil.clientToGame(msgID, bytes))) {
log.... | 0 |
c4e2d1df8c2fc4c822fbfe171be3fedb | bc5cbb135734e32473e6b3c24e75a208 | Copy the header buffer into this network buffer
This is to support the case where the client doesn't know ahead of time
how many packets it will write | NetPacket::NetPacket(const NetPacketHeader& header)
{
m_packetHeader = header;
} | 0 |
26d8f31e347cb3b3243897f9d32b0a96 | e8aac4482acdabf0b83fc61ffda1a28c | Tests the state getter and setter methods with an invalid state. | public void staleStateExceptionTest(); | 0 |
b85b6ef022e60908cfa2a5be5c251a48 | 823c747c59d0775856845b6785c56a04 | Asserts that the given argument is not null. Throws an exception if null. | if(value == null) {
throw new NullPointerException("value == null");
}
} | 1 |
5f3988d40086a3044ce10b384974fc5b | a4f87552a79f57b13715ef3bfffc8587 | 获取上墙信息 | const param = {
url: '/map3d/storey/' + id
}
return new Promise((resolve, reject) => {
get(param)
.then(res => {
commit('SET_FLOORONEDATA', res.data)
resolve(res.data)
})
.catch(err => {
reject(err)
})
})
} | 0 |
cd71fdc348d06c9f66119ed918fd2336 | aa201af169c40bc5c7a3a1039e6a415d | 物品の棚卸評価単価取得 (API0008) | public class LO01010E extends AsetecSessionFlex implements ISaveCallableWithType
@SuppressWarnings("unchecked")
public static Parameters getOrderItemPriceInfo(Parameters params, String strOrderDate, String strOrderNo, String userLang) throws Exception {
logger.info("##################### getOrderItemPriceInfo Sta... | 0 |
099696c9dc1c22be309a00703a8000b3 | 966162839fb4ec5878d396abd46bf05c | Specifies that depth-first-search will be used for the traversal of a graph, and returns a builder to
further configure that traversal. | const b = new Bytecode(this.bytecode).addSource('withPath', args);
return new this.graphTraversalSourceClass(
this.graph,
new TraversalStrategies(this.traversalStrategies),
b,
this.graphTraversalSourceClass,
this.graphTraversalClass,
);
} | 0 |
9a2e53466cd5a3a39fa1faf7fb2d51c7 | 1e699e9345084ba9f3f8bbe3a6e7edd3 | Add an item to the inventory
@param itemID: ID of the item to add
@param quantity: Number of items to add | public class Inventory : MonoBehaviour
public void AddItem(int id){
for (int i = 0; i < inventory.Count; i++) {
if (inventory [i].itemName == null) {
for(int j = 0; j < database.items.Count; j++){
if (database.items [j].itemID == id) {
inventory [i] = database.items [j];
}
}
brea... | 0 |
a78ff10241def04143358f0a431de2be | bae01787ca1e5a4d79b27ec63ba97183 | Commands related to setting up a new game build notifier | InterruptedException {
File workDirectory = new File(homeDirectory, config.getWorkDirectory());
if (!workDirectory.exists()) {
workDirectory.mkdir();
}
List<Notifier> notifiers = new ArrayList<Notifier>();
File rssNotifierWorkDirectory = new File(workDirec... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.