query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
b3f8dcbd0923c3b50873790c2b285e70 | cf2814c77cef132dbebce64bf66226d2 | Tests that coordinates at the orgin are added | public void testAddLocation() {
assertEquals("LWSN", locationLWSN.getName());
double[] xy = locationLWSN.getXY();
assertEquals(5.0, xy[0], 0.1);
assertEquals(10.0, xy[1], 0.1);
} | 0 |
6bc0b47779e49c6812dc5c3e71d8dfb1 | 455e351d7df0ba79b7d4b3cacbbd710c | WriteLocalBuffer -
writes out a local buffer (actually, just marks it dirty) | bwrite(struct buf *b)
{
if(!holdingsleep(&b->lock))
panic("bwrite");
b->flags |= B_DIRTY;
iderw(b);
} | 1 |
5a4462a796042797b812326e767d04c1 | 817b3fad3adc99e6f539d0cf91cedba1 | Загрузить учётную запись по логину | {
$db = Db::instance();
$sql = 'SELECT * FROM '. static::TABLE. ' WHERE login = :login';
$res = $db->query($sql,
static::class,
[":login" => $login])[0];
return $res ?: new static;
} | 1 |
f6a2f2e9fb3b7459c82803ea2f15cc1d | 70b2e8fa54791a6de5039ca0642a5d1d | 取充许上传商品的一级类目 | public class PublishGoodsActivity extends BaseActivity implements ActivityCompat.OnRequestPermissionsResultCallback
private void requestGoodsCategory() {
showProgressDialog();
serviceRestUsage.getProductClassfy(REQUST_PRODUCT_CLASSFY_TASK_ID);
} | 1 |
f04ae91b638beec22dfac89381c86b4f | 192da602c51772fca41d9724948d5332 | Adding a one layer dense neural network to make prediction | def addDense(num):
model.add(Dense(units=num,input_shape=(13,),
activation='relu',
kernel_initializer="he_normal")) | 1 |
d77985bc37a7dbc6a806687d04de2824 | d6550565175a274a4b41e28a84363915 | 获取文章类型并设置在select标签中 | function selectinfo() {
$.ajax({
method: 'GET',
url: '/my/article/cates',
success: function(res) {
if (res.status !== 0) {
return layer.msg('获取表单失败')
}
var htmlst = template('lay_cate', res)
$... | 1 |
c07e0a8ce449256c45cc6ec09a44b2b4 | 849f752e1e7ef4d5c91dd5ff9e34c0d1 | 送票上门 | class Controller_Supplier_Balance extends Controller_Supplier_Base
public function ticketAction ()
{
if ($this->isPost()) {
$iBalanceID = $this->getParam('iBalanceID');
if (!$iBalanceID || !$aBalance = Model_Balance::getDetail($iBalanceID)) {
return $this->redirect('/supplier/balance/index');
}
$para... | 1 |
c4c72d8cdb298a7f632bc321e42be9a4 | c506de9b09ece29755e3650ee0b87f27 | Returns the minimum level of messages to be recorded.
The default level is the ``MESSAGE_LEVEL`` setting. If this is not found,
the ``INFO`` level is used. | class LogInterface(Interface):
def get_level(self):
pass | 0 |
f83aff49cce04b6fa36545659ea01ea0 | a730283c0218c44f597cb114dbceed4d | GET: Traders/Create | {
ViewBag.idBroker = new SelectList(db.brokers, "idBroker", "lastname");
ViewBag.idCustomer = new SelectList(db.Customers, "idCustomer", "lastname");
return View();
} | 1 |
e11d9f75542edb13f99e4e729ea409af | 1e6188c07ac993cbe80730a0d6fc761e | 石を置ける場所があるかどうかの判定 | namespace Reversi
public partial class Form1 : Form
private bool CanPut()
{
for (int y = 0; y < MATRIX_NUM; y++)
{
for (int x = 0; x < MATRIX_NUM; x++)
{
if (CountStone(x, y) > 0)
{
return... | 0 |
df4ff3f63999554df517b5f856a1d5bb | 97585800e2d9e2ed88f6439b705c0ba0 | Control whether 2D slices use radiological or neurological convention. | class SlicerImage (ReconImage):
def slicing(self):
return [self.ax, self.cor, self.sag] | 0 |
2aeade26d60ec5cd465190bcd6c4d801 | 40f11efc6dc8458c061476143b641a3b | Makes the robot navigate to a relative metrical target pose2D expressed in FRAME_ROBOT. The robot computes a path to avoid obstacles. | prefillData();
printf("beginning move\n");
float thetaError;
do {
thetaError = moveToUntil(x, y, MAX_THETA_ERROR);
float goal = Util::normalizeTheta(_pose->getTheta() + thetaError);
if (thetaError != 0) {
turnTo(goal, MAX_THETA_ERROR);
}
} while (thetaError != 0... | 0 |
1af26cedabe2749da2012f6a76322c04 | 651b7f54c5b6e8eac6a74736b119f475 | Parse an ISO datetime ("YYYY-MM-DDThh:mm:ss.fffZ") in UTC. May be an offset relative to datetime.utcnow (see parse_offset). | def parse_isodatetime(time_string: str) -> datetime | None:
if not time_string.endswith("Z"):
raise ValueError(f"{time_string} does not end with Z")
return datetime.fromisoformat(time_string[:-1] + "+00:00") | 1 |
908fb47dcbc2db9c853cd1a0006603a7 | 38e50bf16bfec51e31b4dd4ef0e20b11 | Store the input change info in the local redux store | export default function ProfileEdit ()
function handleInputChange(event) {
const { name, value } = event.target;
setFormObject({...formObject, [name]: value})
localStorage.setItem(event.target.name, event.target.value);
} | 0 |
5f4e48a0d1e43b5003b65ec50e16148b | f05b26365cda3f9bfe6a9a1f3088c7d4 | Create a set of core BuildActions that are common in most
if not all Blueprints.
WARNING: This clears all BuildActions and replaces them
with the default set. | {
obj_t *obj;
myrefl_action_create(MYREFL_ACTION_RELOAD,
reload,
NULL);
obj = myrefl_obj_get_by_name_unconverted(MYREFL_ACTION_RELOAD,
OBJ_TYPE_ACTION);
if (obj) {
obj->i.flags.any |= OBJ_FLAG_BUILT_I... | 0 |
16164e4babf753454d96509bdebe4114 | 316cb4ff1710f05b5a706cf2274cd347 | Funzione che calcola il prezzo del biglietto (con sconto quando c'è) | var price;
var aux="";
for(var i=0;i<hotel.current_price.length;i++){
if(hotel.current_price[i]!="$"){
aux += hotel.current_price[i];
}
}
price = parseInt(aux);
price += flight.minPrice;
return price.toString();
} | 0 |
b2662c88c05b1e588c7588ffb960f1cf | f9768107d0cf72b8b4d91ed65ccd2b13 | Undo last macro execution to step backward | {
if(!CanUndo(ins)) return;
DeleteStep(UndoBuffer, ins, UndoBuffer[ins - 1].size() - 1);
} | 1 |
c6e35eef97e84eb411103827e24e8018 | 71536dcb8142e01596e4da79c030d534 | Clears the display back to grey | void ClearDisplay()
{
glClearColor(1, 1, 1, 1);
SDL_GL_SwapWindow(window);
glClear(GL_COLOR_BUFFER_BIT);
} | 0 |
511f60860bbe0495fab3e219c638a9bb | 935b7aa9b0bbf555dbfd8eeea4f2a11f | Beim Drücken der Entertaste soll versucht werden, sich mit dem Server zu verbinden. | namespace Display
public partial class WelcomePage : Form
private void ServerAddress_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyValue == 13)
{
ConnectToServer(ServerAddress.Text);
}
} | 1 |
2e2aecde1deb577a88f9c48f9eaeda6b | 0a4f198ba4bf36f086d05b5c62c2567d | wrterId attribute 값을 설정한다. | void setWriter(String value); | 0 |
edbd91b996bb32e89d5a649c76408d51 | 8e1c8ad527c31604bb15fb4ad148f5ab | [生成内容页JSON] | function getContentSearchPageJSON(pageElements) {
return collections.map(pageElements, function (contentAsset) {
return {
id: contentAsset.ID,
name: contentAsset.name,
url: URLUtils.url(ACTION_ENDPOINT_CONTENT, 'cid', contentAsset.ID),
description: contentAsse... | 1 |
d9fd33c411585d085434797a0c7b450f | defc107b0d73f444bc5563d90e08602b | questions end with question marks | def is_question(string_input):
return string_input.endswith('?') | 1 |
3b74a8b7d8727c1fa9350d3a4c0c1532 | fba7195384fa78774023870e685d9f58 | make sure that there are no spaces and that if they sent multiple space separated values grab the first | no_commas = re.sub(r'\d+', '',keyword.strip('(').strip(')')).lower().split(',')
no_spaces = []
for j in range(len(no_commas)):
temp = no_commas[j].split(" ")
for x in range(len(temp)):
no_spaces.append(temp[x].strip(" "))
return no_spaces | 0 |
177198c550155ebcc522124223d0cc18 | a251ba2787c6649e5b5a4289a28be4db | ProvidePositionReport_Pkg::EvaluateTrigger | void triggerForMA_manage_DMI_Input_Pkg(
DMI_Driver_Request_T_DMI_Messages_DMI_to_EVC_Pkg *fromDMI_driverRequest,
Driver2MAR_T_MA_Request *outForMA)
{
if ((*fromDMI_driverRequest).valid) {
(*outForMA).trackAheadFree = (*fromDMI_driverRequest).m_request ==
Track_Ahead_Free_is_validated_DMI_Types_Pkg;
(*ou... | 0 |
c76a4ec6fcf91c33d439a4f11b77bdc0 | 770fa4e5a2ab5b7e52a0f183f66738ab | Get pod object corresponding to pod name | func getKHPod(client *kubernetes.Clientset, namespace string) (*corev1.Pod, error) {
var khPod *corev1.Pod
podName, err := os.Hostname()
if err != nil {
return khPod, err
}
log.Debugln("Getting pod:", podName, "in order to get its node information")
khPod, err = client.CoreV1().Pods(namespace).Get(context.TODO(... | 1 |
b026240afba41a753ba0efc689eb5538 | ce42fc55e720e4ffca3db46d42868ccc | This function should be called at the start of each frame in order for this class to have valid values. | void CGlobalVertexBufferPool::BeginFrame()
{
} | 1 |
20fb3e7377caa63d49429ac06f5eda31 | 0de4d78f97212c4c1a59608c40903a09 | Calculate all 2D coordinates from 3D vertex coordinates and the perspective matrix. | {
RegionView3D *rv3d = ar->regiondata;
float dx, dy;
dx = 2.0f * mval[0] * zfac / ar->winx;
dy = 2.0f * mval[1] * zfac / ar->winy;
out[0] = (rv3d->persinv[0][0] * dx + rv3d->persinv[1][0] * dy);
out[1] = (rv3d->persinv[0][1] * dx + rv3d->persinv[1][1] * dy);
out[2] = (rv3d->persinv[0][2] * dx + rv3d->persinv[1][... | 0 |
46629d07d6d0789f5ebdb4cec87482a5 | 4a76657cda5c718acdd21e14443ef6ce | Raise a layer by one place in the layerstack and in the map layers. | {
Ogre::SpacescapePlugin* plugin = getPlugin();
if(plugin) {
return plugin->moveLayer(layerID,1);
}
return false;
} | 1 |
e9f8993f8498997237fc98c904bb3956 | 7e26840336bd26652321f588cf9cf92b | Alle menuitems testen | public void testContentMenuInit() {
Resources res = myActivity.getResources();
String[] menuElement = res.getStringArray(R.array.items_menu);
int nbElement = listMenu.getAdapter().getCount();
assertEquals(menuElement.length, nbElement);
for(int i=0; i<nbElement; i++){
... | 1 |
eb8406ee11abdaf20658ab0c5ec220cc | 871ecb981d653fad1390731bc9e3ef8d | Find an unused Thread Local Storage index.
Use AtomicExchange to avoid needing a mutex | {
unsigned int handle = 1;
while (mBufferMap.find(handle) != mBufferMap.end())
{
handle++;
}
mBufferMap[handle] = nullptr;
return handle;
} | 0 |
5e739c1bae67feaa6bccd9b9134a650f | c35b9cd320825cc3b425facbe75bf60c | hide all in game buttons | {
Button[] activeButtons = GameObject.FindObjectsOfType<Button>();
for(int i = 0; i < activeButtons.Length; i++)
activeButtons[i].gameObject.SetActive(false);
} | 1 |
042b68a5bbc58330c610fd98c1b3877e | 129913fd3ccfe399c60fff5006f670df | Tests the op executor routes iterative and recursive calls correctly. | public void recursiveFactorialCall() {
final Value facFn = createEnsoMethod("""
from Standard.Base.Data.Ordering import all
fac : Number -> Number
fac n =
facacc : Number -> Number -> Number
facacc n accumulator =
stop = n <= 1
if stop then accumulator e... | 1 |
148aa6f12c9d59cf6814b3d1257309c4 | f2ff537fc5f636e04e64f6ca004abff2 | Returns mapping of vertices to their corresponding x, y coordinates. | public abstract class MapItem
public float[] getVertices() {
return shape.getVertices();
} | 0 |
afc5e598757c0afb21440947dac4b41b | af30e59cc58b3a6d27353bd1f6a83084 | Gets the id attribute of the ProductCatalogPricing object | class Product extends \Phalcon\Mvc\Model
public function getId() {
return $this->id;
} | 0 |
16bf4696e5a95d5891ede92954f2a5ac | 2b987f923bef55da2866f9b483995e5d | Method Status
Functia se ocupa cu actualizarea cantitatii de viata ramasa si totala a caracterului | function Update ()
{
SeeHealth = Health;
if(Health > -1)
{
CurHealth = ((Health/TotHealth) * 100);
LifeBar.SetPosition(1,Vector3(((0.04 * CurHealth) - 2),-2,0));
}
if(Health < 0)
{
Destroy(this.gameObject,0);
}
} | 1 |
a719d9b065cab00b7495ae34769ba4a0 | 9b9a16302a70b2d9c61afeda08aa4dd0 | Добавляет новый номер контакту | namespace WpfApplication
[ImplementPropertyChanged]
public class MainViewModel : INotifyPropertyChanged
private void AddPhone()
{
Phone phone = new Phone
{
Id = 0,
Value = ""
};
CurrentUser.Phones.Add(phone);
Pho... | 1 |
13e7bf411ea2d8e23f223949c0972540 | 07bb0cb25dc343c72020ecfb57446644 | Retourne les annonces signalées | class Commentaires
public function getSignaler()
{
return (int) $this->signaler;
} | 0 |
68af17c6e25b1832aef70f041eaa4297 | 20e19a9ed05c0cf163e9ad299f4135da | Hooks onto key presses anywhere on the form (regardless of what control has focus) | namespace Galaga_Project
public partial class Form1 : Form
private void Form1_KeyDown(object sender, KeyEventArgs e)
{
PControl.KeyDown(e);
} | 1 |
c6916c2c9afeff0836351c8ad52ed290 | cccff38c8002d06b2d309035f9b69c26 | Replaces the contained value, and returns it. | public V setValue(V value) {
V oldValue = this.value;
this.value = value;
return oldValue;
} | 1 |
159ed8bc4f301b226c51486181f4e084 | ef09baad57ef66f7b48a70801aa706f3 | Nominate game master | function start_room(int $id_room): void
{
pick_random_game_master($id_room);
} | 1 |
4d1c1a1c4d5760048219942f5cf45df4 | 18180e682dc0bed08df4f72dc2ba61ea | Gets the name of the file this tasks associates with. | public class StorageTask extends StorageBase
@Override
public String getFileName() {
return STORAGE_TASK_FILENAME + FILENAME_EXTENSION;
} | 1 |
2c3fc42bcff419b8aca5fd51c806bcad | 951ce527c0176e6a4255706af9352cb5 | Extracts the contents of the given sysfs file.
Intended for use on the one-line files in sysfs that contain small amounts of
data we want to know. | class Component(ComponentBase):
def get_sysfs_value(self, addr, name):
cmd = "cat {0}{1}/{2}".format(SYSFS_PATH, addr, name)
p = subprocess.Popen(
cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
raw_data, err = p.communicate()
if err is not '':
... | 1 |
1a89069c2739c6c11acb19106d21fbb0 | c8028a66819f01db7a362764df1fd0fc | Get Length of purchase of instance. The default value is 1, indicating one month. The value cannot exceed 48 | public class CreateDBInstanceRequest extends AbstractModel{
public Long getPeriod() {
return this.Period;
} | 1 |
822bfb339b4014304bfa875cc55d7b3b | 3a096d124515d99aa53e223b798b4d28 | hash containing users in conversation: user_id as key and thier unread message count as value | class UnreadMessagesManager:
def __init__(self):
self._unread_messages = defaultdict(lambda: defaultdict(list)) | 0 |
a8ca9928ddd76091dca3ce222796ce04 | dac60c499d724e13876cf06c319a1bab | Actualiza los datos de la encuesta recogiendo un array de respuestas | {
$this->saveEnqueteData($this->getAnswers());
$this->clearTempAnswer();
$event = & $this->enquete->getEvent();
if ($event['flgo'] != '0' && $event['flgo'] != '2') {
$objNd = new Noduplication($event['rid'], HTML_ALREADYENTRY);
$objNd->recodeCookie();
... | 1 |
dc27b4dd5c7e567faf820915a9454a6d | 4a958b03ceee2f89fe639776c12df735 | Gets thumbnail of image using different approaches (EXIF, JPEG scale, resize) | namespace Pensieve
public static class StorageHelper
public static async Task<ImageSource> GetThumbnailImageSourceAsync(this StorageFile File)
{
BitmapImage bitmap = new BitmapImage();
using (var stream = await File.GetScaledImageAsThumbnailAsync(Windows.Storage.FileProperties.Thumbn... | 0 |
8e68d04a6cb17e0d1d1f974c14a5d643 | 9dff4cb4bbd053e6608c8af15ddfe792 | 获取类所有成员变量,包含定义在父类的成员 | List<Field> fieldList = new ArrayList<>();
parentFields(clazz, fieldList);
fieldList.addAll(Arrays.asList(clazz.getDeclaredFields()));
return fieldList;
} | 1 |
f5f6bab9dc2d27203e0576ba021b3b8e | 14c395ace6a45be459bf3a7fb168c056 | Find cosmology with the minimum value of Omega_m0 | def min_cosmo(cosmo_list, return_index=False):
min_value = 100000
min_cosmo = None
index = None
for i, cosmo in enumerate(cosmo_list):
if cosmo.model.Om0 <= min_value:
min_value = cosmo.model.Om0
min_cosmo = cosmo
index = i
if return_index:
return... | 1 |
9862b22ed65a8580a2cdd86690a23fa3 | 97e88ec2c0f322067895268382b50d4d | 训练bot的主函数 | if self.mode is None:
raise ValueError("没有发现模型参数信息")
bert_config = modeling.BertConfig.from_json_file(args.config_name)
if args.max_seq_len > bert_config.max_position_embeddings:
raise ValueError("设置的最大长度比bert模型的最大长度要长")
tf.gfile.MakeDirs(args.output_dir)
... | 1 |
d24d3d1b5f875aaacf1bcf7d0c30653e | 0356298d28165b55fc1afbc0a519d591 | A generic help system to show the arguments needed for custom commands | class SalesmanPrompt(BasePrompt):
def help_show(self, arg):
print("Command show can be invoked with one of the available args.")
print("Available args: " + ", ".join(self.__available_item_types)) | 1 |
30d7b081cd24237dee270d966e3a7fed | 552d152b6807c369cbd2225d3383c4cb | Comparo productos por precio | @RestController
public class ProductController class SortByPriceReductionDescending implements Comparator<ReducedPriceProduct>
public int compare(ReducedPriceProduct a, ReducedPriceProduct b)
{
return b.getPriceReduction().compareTo(a.getPriceReduction());
} | 1 |
221e6a4c3bf70013aca9a340d17465ae | 0a1236bf172635da6e7c1fd1ff36c0b8 | Preload partitions asynchronously. | {
var sw = Stopwatch.StartNew();
Task[] partitions;
await _lockInitializedPartitions.WaitAsync(ct).ConfigureAwait(false);
try
{
partitions = _initializedPartitions.Values.Select(v => v.Task).ToArray();
}
finally
... | 1 |
304c88ef099e80213428c2307d99aa8f | 50d9a4f910742fcab3cd2d0f8b837873 | 返回一个描述一手牌的字符串 | var pokerStr, markStr, pointStr;
switch (mark) {
case "H":
markStr = "红桃";
break;
case "S":
markStr = "黑桃";
break;
case "C":
markStr = "梅花";
break;
case "D":
markStr = "方块";
break;
... | 1 |
d624f2d97c7c44ddd517b0b1c9267746 | 5346da200398ef30837a5cdb72c5aec1 | Obtener detalle de un Técnico asignado a un Folio | {
try
{
gbloclsPacientesRepository.m_Get_Folio(pdb, (clsPacientesBE)this);
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
} | 0 |
4b1f80fa406e082a4c08a8f89173da36 | 1d4f7fb059d59e7a63fb013666c836b5 | Returns Patient Demographic Data based on Identifiers | public HttpResponseMessage GetPatientInformationById(int ID)
{
List<PatientDetails> PatientDetailsList;
HttpResponseMessage response = null;
HttpRequestMessage request = new HttpRequestMessage();
request.Properties.Add(HttpPropertyKeys.HttpConfigurationKey... | 1 |
210ecbb53cae67c9b7fd931b6364faa8 | 2b9a917b9deaaf8ed0e347388ecc2cbe | Return a paged set of instances for this model. | bottom = (number - 1) * self.per_page
top = bottom + self.per_page
object_list, count = self.object_list[bottom:top].to_queryset(self.view)
object_list = self.apply_filters(object_list)
self.count = count
if self.count > top and self.count - top <= self.orphans:
... | 1 |
f4419e9fa3f45438eb5a764fd2d05e3d | 3a267e52ad6cc0e146b382a746fc9220 | Test QuantizeActs where stats are such that min == max. | def test_fake_quant_grad5():
dout = np.random.uniform(-1, 1, size=[6]).astype('float32')
x = np.array([0.0, 0.0, 0.0, 0.0, 0.0, 0.0]).astype(np.float32)
min_val = np.array([0.0]).reshape(1).astype(np.float32)
max_val = np.array([0.0]).reshape(1).astype(np.float32)
expect = dout
net = Net(num_bit... | 1 |
7a9558f12ad2a1dd7bc4a2d63132fb8e | 4966b4d3998453329d91ae5423b1b0fa | 注册所有表单成员 | if (Field.forms[name] === undefined) {
Field.forms[name] = {};
}
Field.forms[name][field.fieldId] = field;
} | 1 |
715f31d53e33cb1fb8ed71106fddfeee | fcbc9de8b83c075dbcef9319c3fcf03e | 惰性async | function fs(){
console.log('惰性求值');
} | 0 |
72890c420144a6c612f183363c7227de | 904d0efb7e23430abc9f5e86dbe1880c | Get header from last captured response
None if not found | class FakeRequest(object):
def getResponseHeader(self, key):
value = self.responseHeaders.getRawHeaders(key)
if value is not None:
return value[-1] | 1 |
10e8b8731fdb1d0481fc40ad4751d60e | ba7328a17975f9f3ca255df94cb4f535 | Retourne le nombre de groupe | {
$request = "SELECT max(NumGroupe) from GROUPE";
$result = $connexion->query($request);
$max = $result->fetch();
if($max['max(NumGroupe)'] > 0){
return $max['max(NumGroupe)'];
}
else{
return 0;
}
} | 0 |
aab574e68d92fe572d0f2ec8fefa008e | eee5919af6924e9583325ca262612a79 | получить авторов, которых необходимо отображать на главной странице | $authors = [];
foreach($this->articles as $a){
if(!in_array($a->getAuthor(), $authors, true)){
$authors[] = $a->getAuthor();
}
}
sort($authors);
return $authors;
} | 1 |
63258280d5fe8d13484b33acca056dfd | 3c53b669b7328e493dd688dbdf4dca57 | Initial memory allocation for a children pointer when adding a person | void employee::addChild()
{
kid[amntChildren++] = new child();
} | 0 |
271693f20b4969f145f8bb9fa4e9b570 | 8f32efae6096621e13a729957296299b | Rejects from the first array anything found in the second array | result1 = [];
for (i = 0; i < firstArr.length; i++) {
if (secondArr.indexOf(firstArr[i]) === -1) {
result1.push(firstArr[i]);
}
}
return result1;
} | 1 |
4c3042865b78d3c5574d45c765ecf9c2 | 01fa52acab0de6e351223738f2db0c3c | Store session for guest user | {
$session = new Zend_Session_Namespace('global');
$session->userLevel = 'guest';
$session->nameID = '';
return $this->_redirect('/');
} | 1 |
49bf805fbe7f9dfa8eef26ecd82bf246 | 1f247cd5067796a3f9ba51339aabcfb0 | Obtem o ano atual | int getAno() {
time(&Segundos);
DataAtual = localtime(&Segundos);
return (DataAtual->tm_year + 1900);
} | 1 |
c9dfa0f214649f9a36547cfc124c4f09 | 3ec035a424abcd651a5f0e3d3ba7f04e | Removes the top/bottom borders: first and last line
Removes the left/right borders: first and last element of each line | {
while (($n = count($lines)) > 0) {
if (preg_match('/^\s*$/', $lines[0]) !== 0) {
array_shift($lines);
} elseif (preg_match('/^\s*$/', $lines[$n - 1]) !== 0) {
array_pop($lines);
} else {
break;
}
}
... | 0 |
7dc28c57be5a914a477a721983f8a334 | a38310eb5d661baff23c36e99c5bbb4e | Computes the Gaussian blurred image of an image given two sigma values in X and Y. Thus, the filterkernel can have non-isotropic shape.
The Gaussian blur is applied slice by slice in 2D. | int type = src.type();
Size size = src.size();
dst.create(size, type);
Mat ms[] = createGaussianKernels(type, ksize, sigmaX, sigmaY);
Mat kx = ms[0];
Mat ky = ms[1];
sepFilter2D(src, dst, CV_MAT_DEPTH(type), kx, ky, new Point(-1, -1), 0, borderType);
} | 1 |
1039f17b8a7c37d3d898443fbb59258a | 954ada486760b35dbc2300b3f7eec74e | Find durations of a (large) number of workshifts. | def compute_required_workforce(needs, day_shifts, night_shifts, shift_durations, shift_break_durations,
annual_hours_fix, annual_hours_var, week_indices, year, include_alsace_moselle=False):
fter_day, fter_night, _, _ = \
compute_required_workforce_details(needs, day_shifts, n... | 0 |
b5ff95f3d32345b26723fbce2d31989f | 26648754d1f152f58e5f7bc1a7b1b69a | Returns a pointer to the first element of the properly sorted list | while (*start != NULL) {
if (compareNodes(*start, toInsert) < 0) {
start = &((*start)->left);
} else {
start = &((*start)->right);
}
}
return start;
} | 0 |
c36d2362f34c9e49add73d172638d5a4 | 63a72c2e30dc123ddd3fb5164d218051 | 将要修改的权限的值赋值给表单模型 | class PermissionsController extends Controller
public function edit($id)
{
$perm = Permission::query()->findOrFail($id);
$permOptions = Permission::query()->pluck('display_name','id')->toArray();
return view('backend.auth.perm.edit',compact('perm','permOptions'));
} | 1 |
172fac9d0b44a10d8ac811976e5fd9b4 | da1a2723a69705ab3044da26c9ef1697 | Callback method for the Bing Maps Geocode service. | if (!geo)
return false;
if (geo.geometry !== undefined && geo.geometry.type == "Point") {
var coord = geo.geometry.coordinates;
if (typeof coord["map"] == "function") {
var req = new XMLHttpRequest();
req.onreadystatechange = function() {
if (req.readyState == 4 && req.status == "200... | 0 |
bfaf16592feb934ec0cd1b720448ef0e | 1d7788001bf28f8566c7d8ef64cec525 | Key function for sorting recipe urls. The sort will be done by the recipe id. | class URLMap(DictMixin):
def sort_apps(self):
def key(app_desc):
(domain, url), app = app_desc
if not domain:
return '\xff', -len(url)
else:
return domain, -len(url) | 0 |
224adb44d69b62285b95405d7438b850 | 23150ccaf0c91e37cdd90c83079ca7a8 | Zero-padded section number. | class ContractStages extends ModelBase
public function setSectionNumber(string $sectionNumber): ContractStages
{
$this->sectionNumber = $sectionNumber;
return $this;
} | 0 |
0a9fba42113a544b8d0e82327f5610c6 | 914b0049d71ce6f50361198a0abf5027 | returns true or false depending if the environment has specified a
provisioning mode | boolean isSetProvisioning(); | 1 |
5273c07ff5fc9f84a8f6e8d4b198ef3d | 6ccc4fb72878e814fa8496735f2755d7 | Function that clears/sets up the array while keeping the current X and current Y value the same | class Emulator
clear() {
this.x = [];
this.y = [];
this.refresh();
} | 0 |
05583845a1d61b0b5ff29d111ee618f0 | 6e11be2356d3c99dae0c5180d2316fb4 | If containing ".", this is the number of continuous digits before the dot
otherwise, it is the maximum number of continuous digits. | if (!str.contains("."))
return 0;
int num = MAX_AFTERDOT + 1;
while (str.endsWith("0") && str.length() > 1) {
num--;
str = str.substring(0, str.length() - 1);
}
if (str.endsWith(".")) {
num--;
}
num = num <= 0 ? 0 : ... | 0 |
722f00d4e9c71f155b6be43e61cd870e | 273b8161ebc28f1bdc3d7781720973c9 | See Page 119 of RFC 2445 - RRULE:FREQ=WEEKLY;UNTIL=19971007T000000Z;WKST=SU;BYDAY=TU,TH | {
$old = <<<ICS
BEGIN:VCALENDAR
VERSION:2.0
CALSCALE:GREGORIAN
PRODID:-//Ximian//NONSGML Evolution Calendar//EN
BEGIN:VEVENT
UID:20140813T153116Z-12176-1000-1065-6@johnny-lubuntu
DTSTAMP:20140813T142829Z
DTSTART;TZID=America/Toronto:20140815T110000
SEQUENCE:2
SUMMARY:Evo makes a Meeting
LOCATION:fruux HQ
CL... | 0 |
cb1f5dbf6e12e58fb73be27bedf24a38 | f65fb7d4a26e72c2470897f031bf2d3e | 设置页面只读 | abstract class PictureSelectEditorView extends LinearLayout implements OnLinearDragerListener
public void setOnlyRead(boolean isOnlyRead) {
this.isOnlyRead = isOnlyRead;
} | 1 |
7508a685d876fe85f796df4d10699ace | 184d1052c4b3f77b64d83f5a8d079f03 | 移除配置文件中某个section | {
foreach (var dic1 in ini)
{
if (dic1.ContainsKey(section))
{
dic1.Remove(section);
}
}
} | 1 |
d6882050d5f79d3dac9c69a7fea0f2f2 | 7d21421700c78468a9c6d0c6620d7c25 | Add the session to the session list | void Server::AddSession(SOCKET session) {
if (sessions != nullptr && session != INVALID_SOCKET) {
this->sessions->insert(this->sessions->end(), session);
}
} | 1 |
bc9f1825dcebdd5b7869d75ca2efd9b2 | 910026ec7393d7cafe1eb5e6ba290203 | Protects the file in Memory to Memory Protect mode. | bool LockMemory( int address, int size )
{
#ifdef _WIN32
DWORD dummy;
return ( VirtualProtect( (LPVOID)address, size, PAGE_EXECUTE_READ, &dummy ) != 0 );
#else
int ret;
int page1, page2;
page1 = address & ~( getpagesize() - 1);
page2 = (address+size) & ~( getpagesize() - 1);
if( page1 == page2 )
return (mprote... | 1 |
415bacaeb040eb519d3fac97ae5ea741 | 96f391b88333dd0fa5c09858829725c8 | Print an invoke instruction. | {
int rc;
int rv;
rv = fputs("ld ", f);
if (rv < 0)
return EIO;
rc = z80ic_oper_vr_print(instr->dest, f);
if (rc != EOK)
return rc;
rv = fputs(", (", f);
if (rv < 0)
return EIO;
rc = z80ic_oper_vrr_print(instr->isrc, f);
if (rc != EOK)
return rc;
rv = fputs(")", f);
if (rv < 0)
return EIO;
return... | 1 |
0cd603785dad1aade054100de08ff4a4 | d4157a031b4dd13a7f673fc8bfb38258 | Метод, возвращающий положение ствола оружия | public class PlayerBodyAnimation extends Animation
public Vector2 getGunOffset(){
return gunOffset;
} | 1 |
6426a555909de7ca1d7514e8f449b227 | 5cd17ad7b5d8da4094f7cf6ea466c57a | POST /workshops | @workroom = Workroom.new(workroom_params)
respond_to do |format|
if @workroom.save
format.html { redirect_to @workroom, notice: 'Workroom was successfully created.' }
format.json { render :show, status: :created, location: @workroom }
else
format.html { render :new }
... | 0 |
26b4da1f1af4a0393a27af4545a5d980 | 5bd37fdad7f4f463f87457532e6ba1d6 | Adds a question to the existing quiz with filling the form.
The form for creating a question should be on one page. | @CrossOrigin
@Controller
public class QuizController
@GetMapping("/addquestion")
public String getEmptyQuestionForm(Model model) {
model.addAttribute("question", new Question());
model.addAttribute("quizs", quizRepo.findAll());
return "addquestion";
} | 0 |
ae569dfdbf4d53b5c15600f008aff7a8 | fb8fdee75af0ba7bd2eea7c09b932062 | @brief Clear WDT Time out flag | {
if (unStatus & WWDT_WDMOD_WDTOF) {
WATCHDOG_vClearOption(WWDT_WDMOD_WDTOF);
}
if (unStatus & WWDT_WDMOD_WDINT) {
WATCHDOG_vClearOption(WWDT_WDMOD_WDINT);
}
} | 1 |
cc48dbb0886471b60bd29ee9dcff2a70 | d7b2c13844da9b5b414b095db447332e | 再生速度調節バーの生成 | {
scale = gtk_scale_new_with_range (GTK_ORIENTATION_HORIZONTAL, SPEED_MIN, SPEED_MAX, SPEED_STEP);
gtk_scale_set_digits (GTK_SCALE (scale), SPEED_DIGITS);
gtk_scale_set_draw_value (GTK_SCALE (scale), FALSE);
gtk_scale_set_has_origin (GTK_SCALE (scale), TRUE);
gtk_scale_set_value_pos (GTK_SCALE (scale), GTK_POS_RIG... | 1 |
a33ebd6369194b42fe9abf605547e2b3 | 1fc0fde42e45f7ace156b3a1407ba707 | n=3 initially empty board -> possible | class TTTBoard:
# board[0] represents turnCount, rest 9 int represents X's and O's on board.
def possibleStates(self, pNum):
possibleStatesList = []
positionList = []
currBoard = self.board[1:]
for i in range(9):
if currBoard[i] == 0:
currBoard[i] = pNum
... | 1 |
5ef2d4da11c579cefdf221bffe3af4a7 | 75ae80eb5b57792f58a83a11c7fd9cf4 | RefreshLists()
Keeps the list_ controls up to date per their
appropriate List vars | namespace Card_Creator public partial class Collection : Page
private void ResetLists() {
FilteredCards.Clear();
FilteredSearch.Clear();
FilteredLife.Clear();
FilteredDamage.Clear();
FilteredMana.Clear();
} | 0 |
af19296e2a7c0e7ac802d948b8e03188 | d4ff7d2f6069ac07b6b5c74a6a86b2eb | Update a primary-key id to a new value everywhere it is referenced. | def update_metadata_primary_keys(metadata, primary_keys, output_path=None):
return _update_metadata(
_add_primary_keys,
metadata,
output_path,
primary_keys=primary_keys
) | 0 |
0e811489e6be3e1fc9297f65f0d5c149 | 505ad4337c6039cea54e66fee2b433cd | Set the amount bet to the entire available cash | if (amount < MinimumBet) return false;
this.amount = amount;
this.lane = lane;
return true;
} | 0 |
e6175d8e1dce009f52f9fb52f744082b | a027027b852cd711b5abd9040653af3d | If user clicks the save button on the train select screen, save the name entered | name = $('#train-name').val().trim();
destination = $('#destination').val().trim();
firstTrainTime = $('#train-time').val().trim();
frequency = $('#frequency').val().trim();
database.ref().push({
name: name,
destination: destination,
firstTrainTime: firstTrainTime,
frequency: frequency,
});
$('#train-na... | 1 |
49698a7fd2fc02e7c59bd5b33afdefff | 6d076cc99e9f173225c7e9d7ed1b98f7 | 正解の経路を求める | vector<ll> check_route(ll goal) {
ll curNode;
ll preNode = goal;
vector<ll> route;
route.push_back(goal);
while (preNode != start) {
curNode = preNode;
preNode = rev[curNode];
route.push_back(preNode);
}
reverse(route.begin(), route.end());
return route;
} | 1 |
fed11fab444e4c6b5e8d061989f12a39 | 92474ebf984fb08882b172bc698d0741 | This method returns the Contact Us Page URL | public class PageObjectsAgency
public static WebElement lnk_contact_us(WebDriver driver)
{
element = driver.findElement(By.xpath(".//*[@id='ctl00_hlContactUs']"));
return element;
} | 0 |
9a1a0e919da0a822eb13522bd6736ba7 | ca943005080a477e102b4d2162243451 | Given
When | $this->posts = array();
$this->givenIHaveAPostThatSays("always do test driven development");
$this->givenIHaveAPostThatSays("always define classes outside of views");
$this->whenTheWordsAreCounted();
$this->thenTheWord_ShouldHaveTheCount("always", 2);
$this->thenTheWord_S... | 1 |
d39693dc03d490eb2ff458620de2fad4 | 29b06e9dc1b1241bd386c8c979523f69 | from https://gist.github.com/micc83/fe6b5609b3a280e5516e2a3e9f633675 | {
$range = $max - $min;
if ($range < 1) return $min;
$log = ceil(log($range, 2));
$bytes = (int) ($log / 8) + 1;
$bits = (int) $log + 1;
$filter = (int) (1 << $bits) - 1;
do {
$rnd = hexdec(bin2hex(openssl_random_pseudo_bytes($bytes)));
$rnd = $rnd & $filter;
} while... | 1 |
24804dc9667ca2e993e682f4eefc0403 | 980c9078d18cdcfc875c9a6587a6cbeb | 产生对角线交叉禁走点 | def Diagonal(posit, position_L, cur_p, j, q):
exclu = []
for i in range(len(posit)):
if posit[i]==None:
continue
if cur_p == posit[i]:
continue
if cur_p[2] != posit[i][2]:
continue
dx0 = (cur_p[0] - position_L[i][0])
dx1 = (cur_p[... | 1 |
a1f9dda7759024b27123dc0f204b5e52 | fe26cc61d3733d0e25fdc9a0f6c5313c | 获得纹理类型 | {
string extension = System.IO.Path.GetExtension(path);
extension = extension.ToLower();
switch (extension)
{
case ".bmp":
return ImageKind.BMP;
case ".png":
return ImageKind.PNG;
... | 1 |
7d8f67f54c93ed95ff5522c6095f61a1 | a05f1772d22360aa185214364ae9e680 | my_interests: tags that a user is interested in
input uid
return list of ints tids | class Db:
def my_interests(self, uid):
res = []
sql = "select distinct tid from interests where uid = '" + str(uid) + "'"
try:
cur = self.conn.cursor()
cur.execute(sql)
res = [int(row[0]) for row in cur]
cur.close()
except Exception as e:
... | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.