query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
164e52199cbb47cc961ca1ea44db3f62 | dae28fd45d2c3c98e99fdce564ecab2b | Initialize a new instance of the class LROs class. | class CaliopL1:
def __init__(self):
pass | 0 |
045e5df92019863578a67fec7daf1e62 | bbd117ae47a362252b6e70faa918b3ae | cephOSDPoolExists checks whether a given OSD pool exists. | policy, err := getPolicy(d, m)
if err != nil || policy == nil {
return false, err
}
return true, nil
} | 0 |
9575258ebab850520759b27246e77ebf | 7f12d1c0333ae1710f5dd0afbd49f7c2 | Поиск вопроса по Id | namespace Aldentea.SweetMutus.Data
public class SweetMutusDocument : DocumentWithOperationHistory
public SweetQuestion FindQuestion(int id)
{
return _questions.Single(q => q.ID == id);
} | 1 |
432a5347ab3fd38f5f5fa9dc3d9728e0 | 0e21b424ad1169f8729797f6f967e673 | 从URL中提取出文件路径,如果是动态网页的话,还需要提取出CGI参数信息,并且返回值代表是否问静态网页 | void Post(int clientfd, string URI)
{
string URIpath = "htdocs/cgi-bin";
size_t i = 0;
while (i < URI.length())
{
if (URI[i] == '?')
break;
URIpath += URI[i++];
}
i++;
string URIquery;
while (i < URI.length())
URIquery.push_back(URI[i]);
struct sta... | 1 |
9a2656cdbfb9c0a1efc690e7ac15a0e3 | 20667e915d13d1edb7ea189d615e3769 | 验证手机号是否入驻过了 | class OfficialCoinController extends CoinController
public function checkPhone(){
$data = $_POST['datami'];
$datami = trim($data);
$datami = json_decode($datami,1);
$phone = trim($datami['phone']);
$customid = trim($datami['customid']);
$where['cu.linktel']=array('eq',$ph... | 1 |
3b3c3ec40ca86b53551f8bee42b7f84c | be165b3a93428b5c052903118d7c33ad | Methor that returns weather or not a given point is inside the image | namespace ImageHandler.Utils
public class IntegralImage
public bool PointIsInside(Point p)
{
bool xInside = p.X >= 0 && p.X < Width;
bool yInside = p.Y >= 0 && p.Y < Height;
return xInside && yInside;
} | 1 |
d3c74dac01521b973367cdc6be6595d8 | d97dde41e2ab8247b8d447a0a88fbe1a | 固定されている場合のマーク(赤枠)を描画 | xMark: BooleanArray) {
if (checkMark[0]) {
grid[6][6] = GridColor.GREEN
}
if (checkMark[1]) {
grid[6][8] = GridColor.GREEN
}
if (xMark[0]) {
grid[2][6] = GridColor.RED
}
if (xMark[1]) {
gr... | 1 |
d70c8e239553b62d75d08f58b712f68d | 0291e7ac27f6698b6083865d294359d7 | step1 - training | def faw_step1():
print("=== create data gen")
np.random.seed(2)
pat = r'/([^/]+)_\d+.jpg$'
data = ImageDataBunch.from_name_re(path_img, fnames, pat, ds_tfms=get_transforms(), size=224, bs=bs).normalize(imagenet_stats)
print(data.classes)
print(len(data.classes), data.c)
print("=== instantiat... | 1 |
7b0b37c34d071315797519fb01f484a6 | 83a046a9fa9c6ef3e9295e8ecb85ef94 | Set if we should show a GPS position marker | public function onGps()
{
$this->onGps = true;
} | 1 |
21d12f623bc5042fbec124c6834b6d0a | 02373da1405a8ea1758624566bf67a69 | Set an operator in a combo box, if the operator does not exist, the first value is selected. | {
if (this.tagInput == null)
{
return;
}
this.cmb.addOpcao(objValor, strNome);
} | 0 |
40b1126a1df457551adec0eb11b81b0b | 3bed732d9140a5aa958a5b438f34c271 | 获取两个日期之间的小时差,除去节假日或周末休息日 | @SuppressLint("SimpleDateFormat")
public class DateTimeUtils
public static long getIntervalHours(String fDate, String oDate) {
long seconds = getIntervalSeconds(fDate, oDate);
return seconds > 0 ? seconds / ONE_HOUR : 0;
} | 0 |
67505b8666c490bbf91fc467c006fbea | 2be2de958e7f5f6de479062116310fd0 | Initialise service, by fetching the rate conversion multipliers
from the various third party providers. | class MarketComponent implements Configurable
public function __construct(array $config= [])
{
$this->set_currency_services($config);
} | 0 |
ffe415dac26ce91e9f11cb68f303f50f | aed1c506d7b92fba6e878cf740732ca3 | Method invoked after circle controller middle button is clicked | public class ARCanvas : MonoBehaviour
public void HandleCircleControllerMiddleButtonClicked()
{
_placementController.PlaceModel();
} | 1 |
2d2b17813af199f64037e16537759380 | b9cc21c5f28048453375e7a11df34ae9 | 以插件模式加载mailer | class FredtroMailerExtension extends Extension
public function load(array $configs, ContainerBuilder $container)
{
$configuration = new Configuration();
$config = $this->processConfiguration($configuration, $configs);
$loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__.'/.... | 1 |
b4185d1f47c2b13f9d465106ddcbb059 | a665166e671ca49906f162df7422856f | Checks for the presence of a field of the specified type in the packet. | namespace NetworkCryptography.Core.Networking
public sealed class PacketHandlerCollection
public bool Contains(ClientOutgoingPacketType packetType) => Contains((int) packetType); | 0 |
6e5cfffeb982d7f230f44d0f4a5d8271 | 8a3dab9a48375987353bc31f8e69d65e | This function returns the coordinates of the element centers | class Boxes:
def get_centers(self) ->torch.Tensor:
return (self.tensor[:, :2] + self.tensor[:, 2:]) / 2 | 1 |
ecb1a98affdf761c4144608a820d7eec | 7970c3020fe1d974408e987630b4ef3f | Высчитываем показатель освоения программы | {
double c = Counter_Correct;
double q = this.data.Count();
double res = 100 / (q / c);
res = Math.Round(res, 2);
return res;
} | 1 |
7d1901db96527275225f1a32d426e511 | d9064c45d36745ac02dcb7a533e420c1 | UI坐标转逻辑坐标 | {
let bg = Main.instance.gameView.gameBg;
if(changeCoordinate)
point = bg.globalToLocal(point.x, point.y);
let col = Math.floor((point.x -MapManager.offsetX) / MapManager.cellPix);
let row = Math.floor((point.y - MapManager.offsetY)/ MapManager.cellPix);
if(col == MapManager.colMax)
{
col = MapManage... | 1 |
a62365cf6b58f966d358387f841a5dd0 | 433e44dbef360011be9fed9afb151ef2 | Returns the value of the '<em><b>Heure Limite Fourniture</b></em>' attribute.
<!-- begin-user-doc -->
<p>
If the meaning of the '<em>Heure Limite Fourniture</em>' attribute isn't clear,
there really should be more of a description here...
</p>
<!-- end-user-doc -->
extendedMetaData="kind='element' name='HeureLimiteFour... | XMLGregorianCalendar getHeureFinApplication(); | 0 |
e3ea22e0de4a3a16754448ecf8e24774 | 571f083bfc5bfd2ecc4cbdd3b4b4d963 | Check - have user timezone or not | def has_timezone(chat_id):
timezone_list = timezone_db.all()
for chat_tz in timezone_list:
if chat_tz['chat_id'] == chat_id:
return True
return False | 1 |
355da9d239203868c03bc34ef1a3c100 | 9772aa4a9abdf98e0c4928dae7d8186f | The amount of short (sell) positions. In the case of FX instruments,
it is expressed in the instrument base currency. In the case of CFD
instruments, it is expressed in contracts. If short positions exist for
the instrument traded, the value of this field is positive. Otherwise,
the value of this field is 0.0.
Returns:... | public class StrategyTestResult
public int getShortPositionsLost() {
return shortPositionsLost;
} | 0 |
25fb4429f339d02d308377ce160e8d2f | 7ba1425fa150499ea3bc56b30b4fe438 | Create a deep clone of all currently selected objects and display them on the slide, slightly offset from the original objects. Throws error if unsucessful. | class SlidesApi
def post_slides_copy(request)
data, _status_code, _headers = post_slides_copy_with_http_info(request)
data
end | 0 |
d277120429731188ca62f359125831ca | 42e24b75078b0bd0a6a55d59541f0367 | 定位图片中的数字 | cxt.fillStyle = "rgb(36,101,162)";
for( var i = 0 ; i < digit[num].length ; i ++ )
for(var j = 0 ; j < digit[num][i].length ; j ++ )
if( digit[num][i][j] == 1 ){
cxt.beginPath();
cxt.arc( x+j*2*(RADIUS+1)+(RADIUS+1) , y+i*2*(RADIUS+1)+(RADIUS+1) , RADIUS , 0 , 2*Math.PI )
cxt.closePath()
cxt.fill... | 0 |
d294e14577b2b751a466a7fdc6029850 | 5545d286ead09f72d51a29a5bb6adad6 | 找r行c列左侧下一个不为0的位置 | function getPrevInRow(r,c){
for(var prevc=c-1;prevc>=0;prevc--){
if(data[r][prevc]!=0){
return prevc;
}
}
return -1;
} | 1 |
5777cfb1df51f54942d4474cd2c21bc7 | f707dec6c94b27b150c91d00bd97a023 | <p>Preconditions</p>
<p>Creates Category to use during tests</p> | class CategoryTest extends \NIMIUS\Workshops\Tests\AbstractUnitTestCase
protected function setUp()
{
$this->subject = new Category;
} | 1 |
14739d56d4fecc2fea4e622c93b4c48f | dc85d5a41df4ef4f2053aca5a33cb2a2 | Creates reusable app pools. | {
try
{
DTEManager.ProjectService.Logger.ActivateOutputWindow();
DTEManager.ProjectService.Logger.WriteLine("========== Recycle All App Pools ==========", LogCategory.Status);
DTEManager.SetStatus("Recycling All App Pools...");
... | 0 |
e170e71aa131e6fc217f1a5e69568eb0 | 1a87fd2e0b010750b47cd2bd98f6352e | Test for allowed state transitions for non-individual, responsible postpaid
subscribers. | public class SubscriberStateTransitionSupportTest extends ContextAwareTestCase
public void testResponsiblePostpaidStateTransition()
{
final Subscriber subscriber = new Subscriber();
subscriber.setSubscriberType(SubscriberTypeEnum.POSTPAID);
subscriber.setId("1002");
subscriber.setBAN... | 1 |
8940d13bc4dcf422400a97d07c5fe13b | e33dfeef83397aa6bce3d61a7c34dbd4 | testing uniq on exceptional case - file not exists | url = self.gen_rand_str()
assert self.mapper.exists(url) == False
f = open(self.mapper.url2path(url), 'w')
f.close()
assert self.mapper.exists(url) == True | 0 |
cac415b774b69ca7d11541a60af396f1 | 88be5e7d338479ccca1d42adae5c711a | Si los dos valores son iguales no despachará
ninguna acción | {
if (intr.registers[intr.x] == intr.registers[intr.y])
{
intr.pc += 4;
return;
}
intr.pc += 2;
} | 1 |
7b3fa9019ad344bf09784e489ac60ae6 | 4993673a584e0f95f333b7a02b84853a | Helper function to visualize the state of the 8 tile puzzle | void outputPuzzle(int** state) {
for (int i = 0; i < SIZE; i++) {
for (int j = 0; j < SIZE; j++) {
cout << state[i][j] << " ";
}
cout << endl;
}
} | 1 |
cdcf5c249791356db595fd679edf86a3 | 00078e1699ec6d59fb4834388ea8e9a6 | Nastaví kolik vteřin musí uběhnout od načtení stránky, než uživatle může poprvé odeslat formulář. | $count = (int) $count;
if ($count <= 0) {
throw new Forms_Exception();
}
$this->_linesOnPage = $count;
} | 0 |
1429ddb66bd30cbb8a6343d230bafed8 | 8dbd13916a8a306bae712f12c4684ab5 | 把异常的请求信息以及错误堆栈存入数据库 | @Slf4j
@ControllerAdvice(basePackages = "com.example.vip.aop")
public class GlobalExceptionHandler implements RequestBodyAdvice
@Override
public Object afterBodyRead(Object o, HttpInputMessage httpInputMessage,
MethodParameter methodParameter, Type type,
... | 0 |
102f0145d566fd88160fbfac3262da6a | 0d920e2c7ab884b87c85fbfef886f7af | Gets the price of the given service at the particular location | TaxiPriceEntity getPriceFor(CarCategory category, boolean weekend, boolean nightTariff); | 0 |
18ee2cce09dac5b9e49e4e8d0f417bfb | 0af962170c8268135c2a4afdcd7aa316 | Gets all punishments for a guild. | Observable<Punishment> getPunishments(String punishmentId); | 0 |
9e630e661db1e5604e9f729b1213b02e | c024a2d97491c78c7bab32fdd6119370 | 用DataSet绑定GridView控件(常用) | namespace Examples.Web
public partial class _07DataBinding : System.Web.UI.Page
public static void GridViewDataBind(GridView gridview, DataTable table, string EmptyText = "No Data !")
{
if (table.Rows.Count == 0)
{
table = table.Clone();
table.Rows.Add... | 0 |
b5544bddc02e4d9bc8d1d42750d0bead | 43652de68712461b9cb2602164c5eb18 | Set the semester by which the total needed credit amount must be achieved. | public class TermSelectionViewPane extends VBox
public void setCreditLimit(int creditLimit) {
termSelectionButtonPane.setCreditLimit(creditLimit);
} | 0 |
8c6a64fb812550a0367c27f391ba079a | 0673802fdf7a85610486861d40508e8e | r"""
Saves the array of particle energies from the nMC simulations at proton energy, Ep, to a .npy file titled [Ep].npy located in the save_directory. | class Gaonep(Gao):
def save_nep(self, phase_nep_fname='phase_nep.dat'):
freq_nep = np.hstack((self.comb_freq_phase[:, 0].reshape(-1,1), self.nep.reshape(-1,1)))
np.savetxt(self.save_dir+phase_nep_fname, freq_nep, delimiter=' ', header='freq(Hz) NEP[W/Hz^1/2]') | 0 |
4f9f6297058dd12140a4428283849ef2 | f11b67afc8b3747c72e29e31a5f30387 | r"""The Application Protocol Port of the Profile.<br/>Minimum value = 1<br/>Maximum value = 65535. | try :
self._port = port
except Exception as e:
raise e | 0 |
8845625d5b78286501d8f0239af29567 | b80d39dc878930549e38b24120e46f18 | Called when a SetRelayOutputEvent is received. | class LcnRelayLight(LcnEntity, LightEntity):
def input_received(self, input_obj: InputType) -> None:
if not isinstance(input_obj, pypck.inputs.ModStatusRelays):
return
self._is_on = input_obj.get_state(self.output.value)
self.async_write_ha_state() | 0 |
ea6c0435e69235bac044dbbbcaf495a4 | d7f07899b76d8b976d1b328ba45486f8 | Adds a value to the heap.
Completes in O(log n) time.
:@param val: The value to push onto the heap. | hv.push_back(val);
int i = len;
len += 1;
Heap_fixup(i);
} | 1 |
1251c4399dac4efef86a43136612b2fc | e51e06db43310ab824b2f2c0e551be8a | returns the dates a user / group did change something in the system | class FindSpotsAudit extends Pas_Db_Table_Abstract
public function getChanges($id) {
$finds = $this->getAdapter();
$select = $finds->select()
->from($this->_name,array($this->_name . '.created', 'recordID', 'editID'))
->joinLeft('users','users.id = ' . $this->_name . '.cr... | 1 |
f9d0f53afac24168880dd55e400be5de | 73c09131f087c2a680fd08c40613ac57 | Возвращает множество координат элементов тела змейки | public class Helper
public ArrayList<Point> getMyBody(int xHead, int yHead) {
ArrayList<Point> body = new ArrayList<>();
body.add(new Point(xHead, yHead));
for (int i = 0; i < sizeOfBoardX; i++)
for (int j = 0; j < sizeOfBoardY; j++)
if (board.isAt(i, j, MY_BODY))
... | 1 |
414d053b3d215f21f301e9174d92cf5f | 26eed7ad5aeec4ea0944d5b338bfb5df | Cette méthode s'occupe de bouger les photos vers la droite | function goRight(){
if(!animStarted){
animStarted = !animStarted;
var firstRowLastItem = $('.firstRow .onlyImages').children(":last").width();
$('.firstRow .onlyImages').children(":last").width(firstRowLastItem);
$('.firstRow .onlyImages').children(":last").width(0);
var newPictureAttr = $('.firstRow .onlyI... | 1 |
0768f11e96b599d7560c829012890a36 | 1f8db10fbfd67620c1e6382fcd09b880 | Сортировка по имени и возрасту | public void whenListBySortToNameButAge() {
User u1 = new User("Александр", 6);
User u2 = new User("Александр", 33);
User u3 = new User("Александр", 44);
User u4 = new User("Дима", 2);
User u5 = new User("Дима", 20);
User u6 = new User("Макс", 20);
User u7 = ne... | 1 |
529449395a0fb8e7253328d56c9c169e | 4b9cc072c05b7058ba459680161f40ce | Resets number of tricks each team has won | public class SoftballTeam
public static void resetTeamCount()
{
teamCount = 0;
} | 0 |
95525e9d7831fae7eeac3511e74e5190 | 69bfa33094e7d873645e996d4bf56391 | Find all folders with template objects | {
$project_dir = ROOT.'projects/'.$project.'/templates';
$folders = array();
if(is_dir($project_dir))
{
$dirs = scandir($project_dir);
if(count($dirs) > 2)
{
foreach($dirs as $dir)
{
if(!in_array($dir, array('.', '..', '.svn')))
{
$folders[] = $dir;
}
}
}
}
return $folders;
} | 1 |
e8a4bdf7fbc0ed0704d5e7bd2c6b4cf7 | 4763d1a10e13a8c5907c588d6a2d28e9 | \brief gives legal kills for pawn | movelist *pmoves(square loc)
{
int color = getcolor(getxy(getx(loc), gety(loc)));
int x = getx(loc);
int direction = color;
int y = gety(loc);
int start = (color == WHITE) ? 1 : 6;
movelist *res = newlist();
if (getxy(x, y + direction) == empty)
{
push(&res, makemove(loc, makesquare(x, ... | 1 |
978b031c0a21dbc6210a19a0518c31db | a6706d3b01cb45958d041e4f905d8705 | Sort vehicle groups by the number of vehicles in the group | namespace taskDEV10.Pages
public class MarkPage
public Dictionary<string, int> SortedByNumberOfCars(Dictionary<string, int> modelAndNumberCarOfModel)
{
return modelAndNumberCarOfModel.OrderBy(pair => pair.Value).ToDictionary(pair => pair.Key, pair => pair.Value);
} | 1 |
3671a352f7043c76f297da2028646731 | 1a1fed86218f529680db976619dcf7ba | Vacia el combo indicado por ID. | function clearSelect(idSelect) {
$('#' + idSelect).empty();
$('#' + idSelect).append('<option value="" selected disabled>Seleccione opción</option>');
} | 1 |
302cf8065ebc6f444c57befe762ba3b5 | ad7264bb3736004badcd365a9de8db78 | Driver for the bonus assignment. | int main(){
unsigned int Uid,Ubouns;
cout<<"We will hold our lucky draw today.!!!\n"<<"Please enter your student number for matching bonus\n";
cin>>Uid;
switch (Uid)
{
case 15692:
Ubouns=500;
break;
case 65421:
Ubouns=450;
break;
case 98741:
Ubouns... | 1 |
528ea49fd20c72e4fc714f92e4393731 | 3f4e7f01de90b4aa03b5c37ffdd61ad9 | If key field supplied: returns [key=>value,key=>value,..]
If key field not supplied: returns [value,value,..] | class DataMethods extends DataMethodsFinal
public function getValueAsKey(string $keyColumns, bool $returnAsObjectArray = false): array
{
return $this->manipulateColumnAndValue($keyColumns, false, $returnAsObjectArray, false, true);
} | 1 |
7e6e9d64f78558459967b52b45f3dcce | 98cb06728bc2a19a53f254ce4c6258a5 | returns the exception without printing it, useful for expected exceptions, signaling that an exception occurred | SQLException ex = this.exc;
this.exc = null;
return ex;
} | 1 |
2f47920d652316490cc1049a40d49474 | 20be0703152c0ecbea36a33c2f70f307 | Save meta information for candidate CPT | class KS_CV_CPT
public function save_box_cpt_job($post_id) {
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
return $post_id;
}
if ( 'kscv_job' != get_post_type( $post_id ) ) {
return $post_id;
}
if( ! isset( $_POST['kscv_job_box_data_nonce'] ) || !... | 0 |
8eef0f9fd7fc376b399deb875009dad6 | b9041d89ac700469f8f8c8804c443e03 | Calculates the cross-entropy loss between true labels and predicted labels for a time series which each time
step has a binary label. | target_output = self.features["target_output"]
if self.time_major:
target_output = tf.transpose(target_output)
max_time = self.get_max_time(target_output)
self.batch_seq_len = max_time
crossent = self._softmax_cross_entropy_loss(
logits, target_output, label_smoothing)
assert cross... | 1 |
d45a550973f0426ef0af34ea8dbaec4e | 34b780edde405a6f29af1b16b5df1722 | Send the frame done event. | class GeoTouchLower(object):
def hd_end_frame(self, geo_touch_handle):
self.geo_touch_dll.hdEndFrame.argtype = HHD
self.geo_touch_dll.hdEndFrame(geo_touch_handle) | 1 |
4bfc5c88236af15faaf7f700716d582a | 313e1c9365f6473ae6b942463a5bf321 | 查询固定表名的所有数据 | public class HomeWork19
public static void queryAllRecords(String tableName){
JdbcTemplate jdbcTemplate = new JdbcTemplate(DruidUtils.getDataSource());
String sql = "select * from " + tableName;
List<Map<String, Object>> recordList = jdbcTemplate.queryForList(sql);
for(Map<String, Object... | 1 |
76f7679186aa785b1f25eba5959a1e79 | f587d89e723543ce7243fc73f50e4a2a | computes mean word length ina given text | textstring = ' '.join(text)
sents = sentsplitter.tokenize(textstring)
totalsentlength = 0
for s in sents:
totalsentlength = totalsentlength + len(s)
numsents = len(sents)
return totalsentlength / float(numsents) | 1 |
2f02c0a67f69500cb62eb78e495ce4e6 | d84fa990f4b7a30531264f6ad0fea98e | Set the 24Hr Graphs weather data. | function setGraphData(){
var obj = ajaxLoading('http://www.vita-factory.com/api/getchart','post','json',{lineid:lineid,lineno:1});
console.log(obj);
if(obj){
var wk;
for(var i =0; i<obj.length; i++){
wk = JSON.parse(obj[i]);
setPlot({celsius:wk.celsius,
... | 1 |
a79a798d6152e30395cb8a560e75cde9 | 5578387d94d19d008eb38ceb20b57ea3 | Dopasowanie obrazu do okna z zachowaniem proporcji | image.height *= canvas.offsetWidth / image.width;
image.width = canvas.offsetWidth;
if(image.height > canvas.offsetHeight){
image.width *= canvas.offsetHeight / image.height;
image.height = canvas.offsetHeight;
}
ctx.drawImage(image, 0, 0, image.width, image.height);
console.log(... | 1 |
a01bddaa4045b93271ae4ee8ec00e5ce | a812bbaa9c4c5f419707356dd9abd10c | ListContainers returns the lists of containers for given cluster. | containers := []api.Instance{}
allContainers, err := c.GetInstances(api.InstanceTypeContainer)
if err != nil {
return containers, err
}
for _, container := range allContainers {
if container.Config[userConfigKey] == "true" {
containers = append(containers, container)
}
}
return containers, nil
} | 1 |
398afe30ad77fab4690a862f31351267 | dd8f4f1f27280115b530687e8fd9dbea | return arguments as a null-terminated array of pointers | {
int i;
for (i = 0; i < argc; ++i) {
auto const count = Win32Support::unwiden(buffer, bufsize, collection[i]);
assert(0 < count && (size_t)count <= bufsize);
argv[i] = buffer;
buffer += count;
bufsize -= count;
}
argv[i] = nullptr;
} | 1 |
ded153178a0625e579592a46e2f630e8 | 9d25e97301f8042817018e4262a3956d | 更新没个批次的循环的堂堂清的结束状态. | @Service
public class BatchService
void updateBatchSettle(String settleDate, TermBatch termBatch) {
curCupqrcTranDao.updateSettleDate(settleDate, termBatch.getMerchantId(),
termBatch.getTerminalId(), termBatch.getBatchNo());
termBatchDao.updateBatchNo(getNextBatchNo(termBatch.getBatchNo(... | 0 |
a178956a49acf06ad657809e20c4b7bc | bbb8c6652118d0b1498746146c9cddc3 | Once our scene has loaded correctly, spawn the player, assign it to the camera, and begin the first level. | public class SpawnOnLoadController : MonoBehaviour
void Start () {
} | 0 |
ef52fee24ea9fa678207bc813cbcb252 | 0b1fb0400386c18e616955aa458e5397 | Stores the restore config as yml and by given name defined in job | class Generator
def store_configuration(payload, config_path)
object_key = json_key(payload)
asset_store.put(object_key, File.open(config_path, 'r'))
File.delete(config_path)
payload.set(:data, :repository_generator, :config, object_key)
true
end | 0 |
6dd2cad24eb0d40396436a08d95592c0 | 5af1afa6a56bb22a14ea3c2d274a5c54 | 配列のn列目とm列目の入れ替え | {
for (int j = 0; j < m; j++)
{
int d = A[nr1, j];
A[nr1, j] = A[nr2, j];
A[nr2, j] = d;
}
} | 0 |
171e9f544f35f1ccee26adbb23c9bc2d | ed577020835451ad3e8b1fc54008452b | 显示住院视图列表中具体长期药物医嘱信息 | namespace NFine.Web.Controllers
public class BenDingController : ApiController
[HttpGet]
public ApiJsonResultData QueryPrescriptionDetail([FromUri]QueryPrescriptionDetailUiParam param)
{
return new ApiJsonResultData(ModelState, new QueryPrescriptionDetailListDto()).RunWithTry(y =>
... | 1 |
4783e736f440dc532c62243a4529b4ef | 16bf56d1682d598727c1a3b014961c5d | Gets the enabled state for a set of DNSSEC key. | {
dns_fixedname_t fixed;
dns_rdataset_t *rdataset, *sigrdataset;
dns_rdata_t rdata = DNS_RDATA_INIT;
dns_rdata_t sigrdata = DNS_RDATA_INIT;
dns_rdata_dnskey_t key;
dns_rdata_rrsig_t sig;
dns_keytag_t keytag;
dns_name_t *name;
isc_result_t result;
dst_key_t *dstkey;
isc_mem_t ... | 1 |
c23c0403d80f8be7068be869af4675a7 | f1865bb46155c56ddd5fd6bac23ab0d9 | ako je vec ulogovan, redirektuj ga | function logged_in_redirect(){
if(logged_in() === true){
header('Location: userProfile.php');
exit();
}
} | 1 |
a98748e5dfe76aed7e77b80826814fed | b3f61b9c0f55adaf21156d6541029146 | 返回函数的声明体,未包含定义部分 | const String &FunctionDef::GetNPDeclaration(String &Result) const
{
return _GetDeclaration(Result,false);
} | 1 |
23a422da31ac122510a97c35d8f9d3f8 | 822aeff035cb77e047ac335c806dfef3 | 通过ID获取UsersContact | namespace DotNet.Business
public partial class BaseUserContactManager : BaseManager, IBaseManager
public BaseUserContactEntity GetEntity(int? id)
{
return BaseEntity.Create<BaseUserContactEntity>(ExecuteReader(new KeyValuePair<string, object>(BaseUserContactEntity.FieldId, id)));
} | 1 |
86bccdcd747fe0eb7bdf07c9d8b402b2 | 0ccd8722168c11963df04f2d53e2dd22 | returns dataframe for the csv found at pth
input:
pth: a path to the csv
output:
df: pandas dataframe | def getDF(path):
i = 0
df = {}
for d in parse(path):
df[i] = d
i += 1
return pd.DataFrame.from_dict(df, orient='index') | 0 |
c16b66dae7403075fa3b7108a47e2e26 | b7510358f120f0a0edbd1736cfde0d54 | Récupération des actions sur une fiche grain de sable rattaché à la fiche evenements nouveaux | {
return new List<bool> { IsActionEnCours, IsActionRealise, IsActionRetard, IsActionCloture };
} | 0 |
78257c6985fe268e11bc2c14c6ffb905 | d831244822ee38969331608b2053c9fe | 設定想法列表 | console.log( data );
var discussList=data.data.discussList;
if(discussList){
for(var i=0;i<discussList.length;i++){
var t=getAToken.formatDate(discussList[i].updateTime);
var updateTime={updateTime:t};
$.extend(discussList[i],updateTime)
}
$('.QAdetail_top>span').html(discussList.len... | 1 |
384c18e4529a930ba1a86c13041e92a5 | 4e11bf25b9ace116a6dd37ba8338f52c | 查询排行榜的总条数据 | @Controller
@Scope("prototype")
public class CountAction extends ActionSupport
public String findRankCount() {
jsonArrayInfo = profileService.findRankCount();
return SUCCESS;
} | 1 |
bdee63e9c7313df147e6371db6784bee | 0d5be3a00b8dc72d894e847657c9bbb3 | #' methods for exploring the coverage of confidence intervals for the median calculated in varying ways from the data. Borrows many methods from methods-CI-mean.R | conf.interval=.95, .drop=TRUE) {
require(plyr)
length2 <- function (x, na.rm=FALSE) {
if (na.rm) sum(!is.na(x))
else length(x)
}
datac <- ddply(data, groupvars, .drop=.drop,
.fun= function(xx, col, na.rm) {
c( N = length2(xx[,col], na.rm... | 0 |
03609c3dc17de95d9f035f5932722046 | 42cacbaffe207a3fd712b2db50bd2f96 | 查询选中省内所有的市,优先从数据库查询,如果没有查询到再去服务器查询 | public class ChooseAreaActivity extends Activity{
private void queryCities() {
cityList = ppWeatherDB.loadCities(selectedProvince.getId());
if (cityList.size() > 0) {
dataList.clear();
for (City city : cityList) {
dataList.add(city.getCityName());
}
adapter.notifyDataSetChanged();
listView.setSel... | 1 |
dc039146ccd85c2bafebb8856bf0cbf5 | e4e6bfdc335e5988dc3991a7afce71d2 | Abstract method. Its implementation will fit (train) the model, and makes
prediction on the test data. | class MyAlgorithm(LearnerI):
def predict_with(self, test_x):
pass | 0 |
f98bfb73cbca4bb64e23a02cd105cc7c | a9704784993176929f6ba2446376af90 | VAE with convolutional layers. | super().__init__()
self.encoder = ConvEncoder(H, W, input_channel, channel_list, hidden_dims, z_dim)
channel_list.reverse()
hidden_dims.reverse()
self.decoder = ConvDecoder(H, W, input_channel, channel_list, hidden_dims, z_dim)
self.noise = noise | 1 |
46de65c7b4316b9d489c444d1eea28c2 | 16b279d7cc376e26c7f346160f4f006e | Double version of {@link #glVertexAttrib2f VertexAttrib2f}. | pub unsafe fn VertexAttrib2fv(index: GLuint, v: *const GLfloat) -> () {
mem::transmute::<_, extern "system" fn(GLuint, *const GLfloat) -> ()>(*GL_API.get_unchecked(VertexAttrib2fvIdx as usize))(index, v)
} | 1 |
e34fe5f54639dc81934a88cab4f469a9 | 1ed901d62f620bfe130031c8b72e174f | Get a new Memcache instance. | class Memcache extends Phalcon\Session\Adapter implements Phalcon\Session\AdapterInterface
protected function getMemcacheInstance()
{
if ($this->memcacheInstance === null) {
$this->memcacheInstance = new Phalcon\Cache\Backend\Memcache(
new Phalcon\Cache\Frontend\Data(array("lifet... | 1 |
b6442821bf7325dccd00ecd6f97fda0c | 42eb56285071090ebf77694214a34b1c | 重定向到淘宝授权登录地址 | @Controller
@RequestMapping("/site")
public class SiteRest
@RequestMapping(value = "/redirect", method = RequestMethod.GET)
public ModelAndView redirectTaobao(HttpServletRequest request,
HttpServletResponse response) {
return new ModelAndView("site/redirect");
} | 0 |
fec33d582b62c651377b5e5343d8238f | fe239d151265544476c34a07ed616021 | Alternativa para Enum | var nome:String?
nome = null
println("Seu nome é: "+nome)
var a:Int?
var b:Int
a = null
b = a?:0
println("A vale: "+a)
println("B vale: "+b)
var x:Int? = 5
var c:Int = 0
x = null
try {
c = x!!
} catch (e: NullPointerException){
println("Deu prob... | 0 |
3a7e6de8a87aa7a48bb710b1d12d6e54 | fe10cc96d25575d5926535cc1fe2ff24 | Initialize a Markov model with a particular prefix length | class MleMdl(Mdl):
def __init__(self, vocab):
Mdl.__init__(self, vocab) | 0 |
0ac541a99c09aaff3ddcd59ca8d0d267 | 51b086d1b1fc4538bd7fe6763064cf64 | should be a list of strings | class TiffImage(delta_image.DeltaImage):
def _prep(self, paths):
if isinstance(paths, str):
return [paths]
return paths | 1 |
4097963f5555defc34cd7246c4cfe2dc | a96e3bb53ffe6d90cd3fa873b873ef98 | Sets whether the document should compress images in generated file formats like PDF. | public function compress($compress = true)
{
$this->options['compress'] = $compress;
return $this;
} | 1 |
4365299d0715a5e0ea78c110b70f7358 | a023a65ecbe349bc2733d24a453a5aa1 | Tests the decorator syntax for creating transforms | def test_whatable_decorator():
@whatable
def normalize(x, loc=5, scale=3):
return (x + loc) / scale
assert normalize.what().id() == 'normalize(loc=5,scale=3)'
assert normalize.__name__ == 'normalize'
assert normalize.__doc__ == 'returns (x+loc) / scale'
normalize6 = partial(normalize, lo... | 1 |
271b43f05906c2bfafefc366102a26b6 | 1dd2d3696fc894daf260bcf418c514c4 | 标准md5加密 | try {
str = new String(DigestUtils.md5Hex(str.getBytes("UTF-8")));
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
return str;
} | 1 |
a3c386dc6cf4ba62bae67679c887279c | 4cfe9a810d8766ad72515832eda7cb27 | Takes a number of days and returns the timestamp for now + number of days | function daysFromNow(day: number): string {
let d = new Date();
d.setDate(d.getDate() + Math.abs(day));
return d.toISOString().split('T')[0];
} | 1 |
873f159d3f9d05a1eafb750f931a46d5 | 9f859010cabcab2b7d10ad5831d0f9bb | Overloaded stream insertion operator for printing diet plan to the screen
Takes a reference to an ostream object for the left hand side and a reference to the diet plan object as the right
Returns the modified left hand side | void FitnessAppWrapper::displayDailyPlan(DietPlan argDietPlan) {
std::cout << argDietPlan;
} | 0 |
6b28b0a4479413bcbf0fe91fcd39d2de | 01b9bb684cd9a32ddb73cbcfc8eb4b12 | Print application config path. | static void print_download_path(void)
{
show_download_path();
} | 0 |
479e67e62df016d7a3429847107bf8d7 | 8086b0d3ef241dd01cd5c1c1574b1b66 | 在旧的HTML后面append上一串HTML | let UIChildren = oldChildren.map(v => v)
let oldStartIdx = 0
let newStartIdx = 0
let oldEndIdx = oldChildren.length - 1
let newEndIdx = newChildren.length - 1
let oldStartNode = oldChildren[0]
let newStartNode = newChildren[0]
let oldEndNode = oldChildren[oldEndIdx]
let newEndNode = newChildren[newEn... | 0 |
2a4828863f507132b4e619bb16f46e4e | d5f025cdc46528e93a9a71cbf781a168 | Maps two lists of generic types index's together using matrix distance calculations | {
List<Tuple<int, int, double>> products = new List<Tuple<int, int, double>>();
for (int fromCntr = 0; fromCntr < from.Length; fromCntr++)
{
for (int toCntr = 0; toCntr < to.Length; toCntr++)
{
if (isFromSameList && from[fro... | 0 |
be6102b9eaa0013435fbf7c08fcc0803 | afecd9507e15d9c6db74d821c8088cc6 | 컨트롤러 프로바이더 설정 함수 | namespace B_MALL
public class Startup
public void ConfigureServices(IServiceCollection services)
{
services.AddScoped<IUserService, UserService>();
services.AddScoped<IAccountService, AccountService>();
services.AddDbContext<UserContext>(options =>
options.UseSqlS... | 0 |
629f04719029929da97fdcc7dfe1bc1e | 384e7445b05d3e0131f394a18f674281 | 中序遍历整个二叉树 , 然后将遍历结果保存到一个数组 nuns 里面 | public class TreeNodeUtil
public static List<Integer> inTraverse(TreeNode root, List<Integer> nums){
if(root == null){
return null;
}
inTraverse(root.left, nums);
nums.add(root.val);
inTraverse(root.right, nums);
return nums;
} | 1 |
70468e053329844730fa862c828bcb4a | b067572fbceaec9b660810372387582a | Waehlt die naechste Umgebung aus | function callNextRoom($action)
{
global $steps, $db, $response, $gamestatus;
$roomid = $gamestatus->ort_id;
$gamestatus->last_ort_id = $roomid;
$gamestatus->updateData();
$orte = new Orte($db, $roomid);
$x = $orte->x;
$y = $orte->y;
if ($action == 1) {
$x += 1;
}
if ($act... | 1 |
7735932e5750c2164ac81f075518f88f | 8aa3e4469bbbbf1a19865f9d38fc8cf0 | Тестирование выхода из несуществующего аккаунта. | {
$fromAccount = Account::make(['owner' => 'anotherTest']);
$toAccount = $this->account;
$this->expectExceptionMessage('Unable to withdraw amount from source account');
$this->service->transfer($fromAccount, $toAccount, 100);
} | 0 |
fa24b028ff4e5a744d7109e82edd50fd | 97e1daae78951700fb1306edeca25cc5 | 初始化 傳送訊息按鈕 | {
SetContentView(Resource.Layout.image_send);
this.FindViewById<Button>(Resource.Id.img_back_menu).Click += To_menu_Click;
TextView user_id = FindViewById<TextView>(Resource.Id.img_user_id);
this.FindViewById<Button>(Resource.Id.select_img).Click += To_select_img_... | 0 |
e1277075620097e9cbcd3d38612c6412 | d1127e2f8c633fca25fa1ff953d7ee14 | проверка введеныъ данных в форме на существование в бд | namespace BL
public class requestBL
public Boolean check(requestDTO request)
{
var requestMapper = iMapper.Map<requestDTO, request>(request);
return requestDAL.check(requestMapper);
} | 1 |
157e46e9f8fba7d79f3a334826491ad1 | a297989aba2eaca29fa1dee60c901acb | Renders the road layer of the map | {
if (!this.GridCell.HasRoad)
return;
Image image = GetRoadImage(this.GridCell);
this.Graphics.DrawImage(image, this.Bounds);
} | 1 |
c7b8750ec68cef95f34dff2d3f97d099 | a8782b1cb9d4c81076233b6b4a570bcf | 中断脚本执行,返回PHP E_ERROR错误 | global $db;
$debug=debug();
if(isset($db)){
$db->error('PHP',$message,$file,$line,$severity,$debug);
}else{
restore_error_handler();
print_pre($debug);
}
return true;
} | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.