query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
901f7be90c6d32f100b31c9952d6fbb7 | aa2b34e96e28a760cd9220912bc7c0d2 | GetURINamesFromExtensions retrieves URIs from the SAN extension of a slice of extensions | func GetURINamesFromExtensions(extensions *[]pkix.Extension) (uris []string, err error) {
for _, ext := range *extensions {
if ext.Id.Equal(oidExtensionSubjectAltName) {
uris, err = getURINamesFromSANExtension(ext.Value)
if err != nil {
return uris, err
}
}
}
return uris, nil
} | 1 |
dff7bf74719dccb1e91e187d52858496 | 8609728a7c9bcbe222bff6e9031fd076 | 输出网格点上的值 | class Map():
def visit(self,coord):
map_point=self.map[coord[0],coord[1],coord[2]].tolist()
return map_point | 1 |
4ce21e54771a4caa67436234b99930c0 | 3fcbe339e8c900e79ee5bc75fa09a33c | a,b - c,d ==> (a-c,b-d) | def tuple_subtraction(a, b):
subtracted = (a[0] - b[0], a[1] - b[1])
return subtracted | 1 |
6eb6d401a5f6c353786c2b7e9fa9dfaf | 3b9054156c9d34b303dfa52a302e5aba | Source: https://gist.github.com/mislav/ca62231f776526729b5d4ddd74ad6657 | func zipDir(source, target string) error {
zipfile, err := os.Create(target)
if err != nil {
return err
}
defer zipfile.Close()
archive := zip.NewWriter(zipfile)
defer archive.Close()
info, err := os.Stat(source)
if err != nil {
return err
}
var baseDir string
if info.IsDir() {
baseDir = filepath.Base(... | 1 |
a3fd858084bbca9f1db5ed72c3038a91 | 0a401b111adc4444e31ec5b4ce35f529 | Given two teams, home and road, computes the home team's win probability
based on 538's model. Can also handle neutral site games | def predict_away_victory(home_info, away_info, home_spread=0):
vote_prob, lr_prob, svc_prob, rf_prob = predict_game(home_info, away_info, home_spread)
return vote_prob[0], lr_prob[0], svc_prob[0], rf_prob[0] | 0 |
a51a6fba46c441e658916c681b25a2ab | 167138b456f4536182c388b931145819 | Retrieves the creature at the given coordinate | public Meteor getObjectAtCoords(int x, int y); | 1 |
46599074a3056607794a58b29cce0d23 | 4371bcd291a6cde561a18c9ec5fe1314 | returns the complex magnetization for high symmetry lattice points | s = 0
dim = len(G)/2
for n in range(dim):
s = s + G[2*n][2*n+1] - G[2*n+1][2*n]
del dim
return 1j*s | 1 |
9a55b63f02c90352407954e060dc7060 | 4914fbd2c4c01931290a66419731c533 | Reads borders from the document node. | {
for( int childPropertyIndex = 0; childPropertyIndex < node.nChildNode( ); ++childPropertyIndex )
{
XMLNode childProperty = node.getChildNode( childPropertyIndex );
if( strcmp( childProperty.getName( ), PROPERTY_BORDER_COLOR ) == 0 )
{
Color borderColor = ReadXMLAttribute( childProperty, STRING_VALUE, Color... | 1 |
8fb12fb1b88f260d19af164174f1724b | 739f32ebe7997113e6b3a20714203fb8 | Verifichiamo se è presente il MAGIC Number nel Settore | magic_offset = 0x30
setend_be = 0xf1010200
setend_be_thumb = 0xb658
fp = open(kimage, "r")
fp.seek(magic_offset)
val = struct.unpack("=L", fp.read(4))[0]
fp.seek(magic_offset)
val16 = struct.unpack("<H", fp.read(2))[0]
fp.close()
if (val == 0x01020304) or (val == setend_be):
... | 1 |
f22ae58f84a34ea083277eceaaf9594e | 47fa6715dbda25e90afac1a414c51a0e | no operation needed. | public class EnrolmentRequestSerializer implements Serializer<EnrolmentRequest>
@Override
public void close() {
} | 1 |
9b0475825e39d38780b2fa3b7f0c2ef5 | 8edc5dbf1c1fc4bfe209d0df4c43ee35 | Get the final y of the third arc | public class CircleFit
public double yref()
{
return _yref;
} | 0 |
4b52db8f6b1bc2f00d283828b9fe5a80 | 95f67bf0863950403a7164d547370af4 | Get the value of similarity | public class NumericalSimSearch<K extends Comparable<? super K>, V> implements ISimSearch<K, V>
public Double getScore() {
return simScore;
} | 1 |
79d87b11b3b5fd5f5d169107c0035372 | 749cecc5e3ec9c9cd1c9588385f03ef5 | 获取用户所有软件ID和名称 | class DBSqlite3Serializer(DBSerializerIf):
def getAllPackageName(self, user=""):
packageNameList = []
cursor = self.__conn.cursor()
if (user == "") :
queryTblSql = '''select distinct(cname) from t_conan_pkginfo'''
cursor.execute(queryTblSql)
else :
que... | 0 |
46bbd5d132353b4416d444ef9ddf6d80 | ad9510f6067d606d5d2f5fbeba809444 | Handles actions occurring when some metafile is being removed. | public void actionsRemoved(edu.mit.dig.saveface.model.Post.Post source, com.ibm.adtech.jastor.Thing oldValue); | 0 |
e80f983708e9a89b99b83fcf5e7bc755 | ae6f253436f332b496018e01f4aafa43 | recupera se a conta está ativada ou não | class UserConta extends \User\Entity\UserConta implements \Doctrine\ORM\Proxy\Proxy
public function getAtivo()
{
$this->__initializer__ && $this->__initializer__->__invoke($this, 'getAtivo', array());
return parent::getAtivo();
} | 1 |
3e9d84f414968fa21f8cb1c5b7e639a2 | 0f8d48f32e0b9cb98af871bc2c53c269 | 将需要写入文本的字符串添加到队列中.线程休眠时,再唤醒线程写入文件 | class ParserProcess(mp.Process):
def add(self, txt):
self._in_queue.put(txt) | 1 |
cde38d8d11e31cafaa74a28feeb9d8b3 | 8a45b2c273358e7dc451f9e869270248 | Test response false if no URL | class testURLhandler(unittest.TestCase):
def test_invalid_url(self):
print("@test_invalid_url")
url_str = "google"
urlhndlr = URLhandler(url_str)
self.assertFalse(urlhndlr.check_url()) | 1 |
0cfd503774aca25b0a4178eb21e6754d | 5d6c0b22e0f4852bbcf765da4ef700b5 | 게임 오버 시 소리 발생 | public class Xogo
public void createSoundGameOver() throws IOException {
try {
soundGameOver=AudioSystem.getAudioInputStream(new File("resources/Music/game_over.wav"));
clipGameOver=AudioSystem.getClip();
clipGameOver.open(soundGameOver);
clipGameOver.start();
}catch (Exception e) {writeException("class... | 1 |
f5b8db72804eaf7a14b7fabe8ecef1af | 314adaeb5e1cc64efcb913df9bd1abfe | Sets the reverb length in seconds. Changing this is expensive,
for realtime this should be set before creating any sources. | if ( this.reverbGainNode ) {
this.logGain( this.reverbGainNode, duration );
}
} | 0 |
3db9725d8dce77b88ece96812a540540 | f082c985c174f4af2740cfb1263da77b | 批量生成SKU | function create_sku() {
save_skuArray();
$('.js-goods-stock').show().find('table.table-sku-stock').children()
.remove();
var $provpList = obj.props;
var html = '';
var $skuObj = prepare_sku();
var $count = $skuObj.count;
switch ($count) {
case 1:
var index = $skuObj.indexObj[0].index;
html += ... | 1 |
f4ef2992205424529ae00fff68c9060e | 85f6b14bdf9a32638ba28a8d526a366d | Indicates that the authorization page should be opened in the user's browser automatically. | default boolean isAutoOpen() {
return !getElement().getProperty("autoOpenDisabled", false);
} | 1 |
320a4b4cb043047d8ac709204d0c4534 | a87812ff3eb7e1a0448a35a00bbf3689 | Add the item to the back of the array. | abstract class GodotArray<T> internal constructor() : NativeCoreType<godot_array_layout>(), Iterable<T>
abstract fun pushBack(value: T) | 1 |
b1bd3ccdf7d3bd89b10adb9ad587ea75 | 3eb4a6345729a7e83ac7ce9e770d6c9e | Returns the bids that the user has previously made | class User extends Model implements AuthenticatableContract,
AuthorizableContract,
CanResetPasswordContract
public function bids() {
return $this->hasMany('\App\Bids');
} | 1 |
3f38c901569dc4e9cd17f300f6bf322e | 7130fd15781a24e98b69ce9a1d2873f0 | Given a node that should remain selected, deselect another selected node.
This is used only when one node at a time can be selected (Single/SelectionFollowsFocus). | {
if ((button.SelectionGroup == SelectionGroup) && !ReferenceEquals(button, this) &&
((SelectionStyle == ImageLabelButtonSelectionStyles.ToggleSelectionAsFirstTwoStyles) ||
((SelectionStyle == ImageLabelButtonSelectionStyles.ToggleSelectionThroughAllStyles) && button.IsSelected... | 1 |
2e8feef38a8a55dc5557b690a2df23e2 | 7d808995aa9820d70783a8fb7ccc1fda | Exit a parse tree produced by logoParser#fontsize. | if (ns.length() < 2)
return;
int slot = firstDigitBaseThirtySix(ns);
if (slot < 1)
return;
int val = Aaa.extractPositiveInt(ns.substring(1));
int standardSize = LIN_STD_FONT_SIZE__smaller_than_min;
if (val > 120) {
val = 120;
}
if (slot <= 4) {
if (val < 30) {
val = (val * 7) / 5;
if... | 0 |
10b744322c831f452db8a9483ae741c2 | e547ef4c046759bcfbd52abc069513ab | Function used to add a challenge to the database.
Return this new challenge object. | namespace LiftLog.Service.Interfaces
Task<int> CreateChallengeAsync(NewChallengeDto dto); | 0 |
7c5f45db989d10604ec1a22848fdd41e | 906c3d924605008e5bd246d8612bb92f | Use this decorator when defining new configuration classes! | def ContextConfiguration(cls, configure_with=singleton, suffix=""):
ConfigClass = provide_all_singletons(cls, configure_with, suffix)
if getattr(ConfigClass, "set_app_context", None):
return ConfigClass
configured_dict = {}
configured_dict["set_app_context"] = _set_app_context
configured_dic... | 1 |
46dd668df88af13811631562fa43f79c | 2d3f437affca0dd4e086fed3d9ace5ac | You are passed in a dataframe called turnstile_weather.
Use turnstile_weather along with ggplot to make a data visualization
focused on the MTA and weather data we used in assignment #3.
You should feel free to implement something that we discussed in class
(e.g., scatterplots, line plots, or histograms) or attempt to ... | def tsplot(df):
import matplotlib
import matplotlib.pyplot as plt
matplotlib.style.use('ggplot')
axes=plt.gca()
df.plot()
plt.show() | 1 |
f97e072fa2a52b2f1de8ac07ba87a248 | df09f8128c517984b121ad56714af27f | Returns `true` if the implementation supports a cycle counter | pub fn feature_implemented() -> bool { false } | 0 |
bef96673ddb8ef62eb592e92e1bd841a | d6e258467a9a23dc88c29736f4f99e14 | Returns the meta object for class '{@link org.talend.designer.core.model.utils.emf.talendfile.ProcessType <em>Process Type</em>}'.
<!-- begin-user-doc -->
<!-- end-user-doc --> | EDataType getComponentProcessType(); | 0 |
f6149a990751c7db0533bf8699aeb169 | f363cfd999cf7d98710d4c217d4c64a7 | 2를 임의의 위치에 삽입하기 | int locate, number;
srand((unsigned)time(NULL));
if (rand() % 10 < 8) number = 2;
else number = 4;
do {
locate = rand() % 16;
} while (arr[locate / 4][locate % 4] != 0);
arr[locate / 4][locate % 4] = number;
} | 1 |
3db7ba77028a1ce501355f80c5a9f073 | 225707c26ef6687db484fc1684977344 | Unsets the value of the '{@link mpia.schema.TypeTypeBatiment#getChargeEnLourd <em>Charge En Lourd</em>}' attribute.
<!-- begin-user-doc -->
<!-- end-user-doc --> | void unsetChargePointSerialNumber(); | 0 |
75def952be5f95962af691dcd5a2ec12 | c4a73b3baf65e3868f2079c93a540361 | 根据用户id和群id获取用户群关系 | @GetMapping("/{id}/users/{userId}")
CommonResult<Map<String, Object>> getGroupUser(@ApiParam(value = "群组Id") @PathVariable Long id, @ApiParam(value = "用户Id") @PathVariable Long userId); | 1 |
eb89910da2f3d147b33a281873de07a6 | 87e47a240fd9dd5e3f4e1eb66cebbffb | Create email autoresponder
Returns true on success or false on failure. | global $CFG;
$submission = $this->generate_csv($rid, '', null, 1, 0);
if (!empty($submission)) {
$answers = $this->get_formatted_answers_for_emails($submission);
} else {
$answers = ['html' => '', 'plaintext' => ''];
}
$name = s($this->name);
... | 1 |
432abaf126bdce2b1109e1ad81b8df69 | f275d610f89fb63383edd8a6d3fb18ae | <p>
Creates a domain resource for the specified domain (e.g., example.com).
</p>
<p>
The <code>create domain</code> operation supports tag-based access control via request tags. For more
information, see the <a
href="https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-controlling-access-using-tags"... | CreateDomainResult createDomain(CreateDomainRequest createDomainRequest); | 1 |
0a0b1d91120c19056ee11670bad940a7 | de910177d899351684b44fb7b52982b0 | https://leetcode.com/problems/two-sum-iv-input-is-a-bst/description/ | class Solution:
def twoSum(self, root, n):
if not root:
return None
res = []
nodes = set()
self.dfs(root, n, nodes, res)
return res[0] | 1 |
3583c8c1a620fc3daeee6a788bb836b5 | dc633c313a6ea09a8fb7430df26842c6 | test creation with invalid range values | instance = Range('10:~')
assert 10.0 == instance.start
assert float("inf") == instance.end
assert not instance.inclusive | 0 |
2b7d80503ba4090e758fb1d844d811f5 | c30aacf3d6622a8e0d6c9098027c98f0 | Called under interrupt. Refer #NDEFT2T_FIELD_STATUS_CB. | static void nci_rf_field_info_ntf_process(void) {
nci_evt.header = nci_evt_rf_field_info_ntf_rec;
} | 0 |
3aa3e73f2d2bac2e6c4c56edb2f7cf61 | 095a76366a824294ed4482388f29fe70 | Create a new table caption object or return an existing one.
@return A <code>CAPTION</code> element. | public class TableDocumentImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements org.w3.x1999.xhtml.TableDocument
public static class TableImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements org.w3.x1999.xhtml.TableDocument.Table
public org.w3.x1999.xhtml.CaptionDocu... | 0 |
dc336e59f716b47d6c417a3980b28bc0 | fdd088c5518b161624f3c342f67daa2e | mean number of galaxies per halo | class HaloModelWDM(DMHaloModel, MassFunctionWDM):
def mean_density_halos(self):
return self.rho_gtm[0] | 0 |
891c4a1f2a60de528668926325b97877 | beeead45ebbf5e0ed11134e2181647d5 | 上传ZIP模板包 | @RestController
@RequestMapping("/scc")
public class SccController
@PostMapping("/zip")
public void uploadZip(@RequestParam("file") MultipartFile file) {
sccService.uploadZip(file);
} | 1 |
5f29b0e306e4149468047fc1ca1daf55 | b3a17287eba3ca454e93510ee965b5aa | Retorna Id do Local Destino. | class Partido extends \AppBundle\Entity\Partido implements \Doctrine\ORM\Proxy\Proxy
public function getIdLocal()
{
$this->__initializer__ && $this->__initializer__->__invoke($this, 'getIdLocal', array());
return parent::getIdLocal();
} | 0 |
21fb23d38bd2547ceb68597bceb28f96 | 3dec6236569e54703c25aa336f6c56d8 | Causes the last character to be read again. | {
Serial_st *st = self->st;
USING (MUTEX, &(st->rd.mu),
if ( st->rd.ungetted == UNGETC_NOCHAR ) {
RAISE_Rd$Failure( 3 );
}
st->rd.ungetted = st->rd.lastread;
);
} | 1 |
2e4492b9098628189ca32cbb48943c0d | f33767c2f65e01066d1319f58e90fe48 | Finds the function to call based on keywords and
modifies *argc_va to skip them | void CVmBifTADS::get_func_params(VMG_ uint argc)
{
vm_val_t val;
vm_val_t func;
CVmFuncPtr hdr;
vm_obj_id_t lst_obj;
CVmObjList *lst;
check_argc(vmg_ argc, 1);
if (G_stk->get(0)->typ == VM_OBJ
&& G_predef->obj_call_prop != VM_INVALID_PROP)
{
uint argc = 0;
vm_obj_... | 0 |
9f8ffa86c20eb506acece032ceda3a50 | 90dadfff07cdb326596dfde9887f2437 | # http://stackoverflow.com/questions/23901907 | EightBall <- function(question){
if (grepl("\\?", question) != TRUE)
stop("You must ask the magic eight ball a question.")
answers <- c("As I see it, yes",
"It is certain",
"It is decidedly so",
"Most likely",
"Outlook good",
"Signs poin... | 0 |
05ec3a51423c798bf974add5637937ea | 8501ca9da7ae3ef73ef773f91745f709 | ================= bind_download_file ================= | namespace MettleSystems.dashCommerce.Web public partial class product : MettleSystems.dashCommerce.Store.Web.SitePage
void dlFiles_ItemDataBound(object sender, DataListItemEventArgs e) {
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) {
Download download = e.... | 1 |
ca008ed75d9989fe0181d4b725e0763d | b14f971a146c19bfef9f6ea8d14b81d9 | Provide initial datas when creating an advertiser. | {
$categoryList = Cache::remember('categoryList', 60, function () {
return Category::MainCategory()->with('getSubCategory')->get();
});
$countryList = Cache::remember('countryList', 60, function () {
return Country::all();
});
... | 1 |
e68bf87c644150ff5c1df6e5824f88ee | b3c5d146157a6c144a16e55fd3664763 | handles http 304 Not Modified response | namespace TerumoMIS.CoreLibrary.Code.Csharper
public abstract class WebPagePlus:IgnoreMemberPlus
public abstract class page : IDisposable
protected void notChanged304()
{
if (socket.Response(SocketIdentity, fastCSharp.net.tcp.http.response.NotChanged304)) PushPool();
... | 1 |
9a7942ca630577bbac3667929e1a03f7 | 8fa627148994fe79fed7463d1897b2b6 | 按照偏移量放大 | class jmControl extends jmProperty{
offset(x, y, trans, evt) {
trans = trans === false?false:true;
let local = this.getLocation(true);
let offseted = false;
if(local.position) {
local.left += x;
local.top += y;
local.position.x = local.left;
local.position.y = local.top;
offseted = true;
}
... | 0 |
1614b4c9c4dd06c42e9656f29707dca9 | 10781f08e2f41529cf2cf8f075199a79 | returns true if any device is reporting an alarm condition on the bus | namespace TempSensor
bool is_alarm_set()
{
OneWire::init_communication();
OneWire::write_byte(TEMP_SENSOR_CMD_ALARMSEARCH);
for (int i = 0; i < 64; ++i) {
uint8_t byte = OneWire::read_bit();
uint8_t byte_compl = OneWire::read_bit();
if (!((byte == 1 && byte_compl == 0) || (byte == 0 && byte_compl == 1))) {
... | 1 |
f6ee640151dd55ee202b22e68382fe39 | 93e4ce22fbe4fce72d5dcaf021ccd924 | Determine whether the user can view the layoutsection. | {
$layout = $this->get_setting_layout( $layout );
if( $layout != 'left_sidebar' && $layout != 'right_sidebar' )
{
return false;
}
if( $check_containers )
{
return ( $this->is_visible_container( 'sidebar' ) || $this->is_visible_container( 'sidebar2' ) );
}
else
{
return true;
}
} | 1 |
dd1f2724ed4488e5cfb64471f7268451 | a0690a7a486209dece84732cba8fd61f | Consistency check for the size of the hopping matrices. | H = self.m.get_Hamiltonian()
h = numpy.zeros((3,3),dtype=numpy.float)
h[1,1] = 1.0
h[2,2] = 2.0
self.assertTrue(numpy.allclose(H.data,h)) | 0 |
9774a3f790866ec1e8caa6d51b9d9a4b | ebc5f7bde8d2e73e685e901c87c93d92 | Stack two images horizontally. | (width1, height1) = image1.size
(width2, height2) = image2.size
result_width = width1 + width2
result_height = max(height1, height2)
result = Image.new('L', (result_width, result_height))
result.paste(im=image1, box=(0, 0))
result.paste(im=image2, box=(width1, 0))
return result | 1 |
f3d92d5e52c3237e947d7da3de4cf63a | d7ee04fcc8405163111d0c78d3a98db6 | @brief 安全附加拷贝字符串,从给定目标字符串结尾处开始拷贝
限定拷贝的字符串附加到目标串结尾后不能超过目标数组的大小,如果超过了,则只拷贝一部分字符 | void safe_strcat(char *dst, char *src, int len)
{
char* dst_over = dst + len+1;
dst = dst+strlen(dst);
while ( dst < dst_over )
{
if ( *src == '\0' )
{
*dst = '\0';
return;
}
*dst++ = *src++;
}
*dst = '\0';
} | 1 |
0a76e3ecd784e95d3fdf51c8fb01ba46 | 58ec60e034ba73de75308bc74c10df67 | Shows the limits dialog for the main chart. | {
try
{
await LoadLimits();
}
catch (InvalidClientIDException)
{
return;
}
} | 0 |
9d7c6a22f13027e449dc92c18d6bde9e | ea99a1094b97639ad73b90fb2ecaedf5 | 批量新增(产品参数) | int batchInsert(List<NideshopSpecification> param); | 1 |
0ac69b27bc0dda2bf346144f04efc43b | ca4352a490e34243c2867864b62ccfeb | 将list中的entity对象处理成JSONObject对象 | List<Object> list = new ArrayList<Object>();
try {
JSONObject jsonObject=new JSONObject(json);
JSONArray entityListJson = new JSONArray();
if (jsonObject != null) {
if (Boolean.parseBoolean(jsonObject.getString("flag"))) {
entityListJson = jsonObject.getJSONArray("list");
for (int i = 0; i... | 0 |
cbc8bf7479686d3b713a4e143e9a8d23 | 7a3fc1cebbf8d60f2dee6ac484571e25 | 只提取这两列 | def get_feature(data):
new_data = data[:, 0: 4]
return new_data | 0 |
977e536840a8e52762e48b616b33ddc1 | 7983c28daa92dcabdd6c983e2f4b21e6 | @brief Constructor. Sets directory structure. | Project::Project(const string &_name, const string &_folder) :
File(_name, _folder) {
this->projectName = _name.substr(0, _name.find('.'));
this->sourceFiles.emplace_back(_name, _folder);
this->projectPath = utils::formatFolder(folder) + projectName;
this->searchFiles();
} | 1 |
63af5dad3cac60e67077ab2ff5022a64 | 9ff25a7cbcddf2a1ed52686cfd48607a | 查询标准报价 | {
#region 设置参数集
SqlParameter[] prams = {
SQLDatabase.MakeInParam("@StandardPrice", SqlDbType.Int, 4, StandardPrice),
SQLDatabase.MakeInParam("@Client", SqlDbType.Int, 4, Client),
SQLDatabase.MakeInParam("@Staff", SqlDbType.Int, 4, Staff)
};
... | 0 |
cc66b344712d7fd6fb311be9f30e2a9f | 019cb001897b310ace800518ae687adc | 是否要求包含三连号 0表示没有,<0表示有没有都可以 | $opencodes = array_slice(explode(',',$opencode),-3);
$tzcodes = explode('|',$tzcode);
$dans = explode(',',$tzcodes[0]);
$tuos = explode(',',$tzcodes[1]);
$zjcount = 0;
if(count($dans)>2 || count($dans)<1){
return $zjcount;
}
if(count(array_unique($opencodes))!=3){
return $zjcount;
... | 0 |
fcc9575a65d446e4f176a14163e5e05b | ec8405ffd021ef9b7f2adcba3957d6f6 | Register participant for an event | $person=new DB\SQL\Mapper($this->f3->get('db'), $this->f3->get('PARTICIPATEdb'));
$person->mem_id = $idUser;
$person->evt_id = $idEvent;
$person->par_dateInscription = date('Y-m-d H:i');
$person->par_participated = 0;
return $person->save();
} | 1 |
e37ccc04fb56c3fb7460dc522bf38abc | 49de880fa7c3710bd83dece81c16fe13 | Get the number of items in the level selected list. | public class PlayerInfo : MonoBehaviour
public int GetLevelCount()
{
int levelCount = transform.Find("LevelsScreen/Scroll View/Grid/").childCount;
return levelCount;
} | 1 |
01468a473b589694290ca092d07afcff | 72a74608689141df20f8a2fcbb2b427e | Inserts a new Link l in the net. Of the link is already in the net is updated | public class router
private boolean updateTopology(pkt_LSPDU pktIn) {
circuit_DB cdb = router_network_DB[pktIn.routerID-1];
link_cost lc = new link_cost(pktIn.linkID, pktIn.cost);
if(cdb.nbrLink == 0) {
cdb.linkCost[0] = lc;
cdb.nbrLink++;
return true... | 1 |
1f16b69d5fcd12fd382acb261e7e2897 | fa8e0fcc619c8ba0692cfcc06763d74c | Changes the Highlight Color to #1CAf9A on mouseenter Event | function mouseover(d){
d3.select(this).style('fill', '#91c29e');
} | 0 |
d23e33f4aa3a45bf686f5f6d22aeae3e | f01217d17bd62c1c5032695b0fce9f10 | 得意先店マスタ検索処理 | {
string messageCD = string.Empty;
ArrayList messageList = new ArrayList();
this.searchMSeikyusakiTantoDs.Clear();
this.searchMSeikyusakiTantoDs = EspaScrBaseUtil.GetMSeikyusakiTanto(
this.dmComboBoxKaishaCDIn.exText.Trim(),
this.dm... | 1 |
6847422b703ae1c13bef6830d6a15b0b | 6863ce1e4085071bb12133fd001788b5 | Input:
directory: name of directory where plots will be saved (string)
LR: learning rate used (float)
val_errors: list of validation errors
Compute:
plot of validation error over number of epochs
Output:
fig: plot of val. errors over number of epochs (.png file)
LRval_errors: list of the validation errors (.csv file) | def error_rate_lr():
train_plots = []
validation_plots = []
for lr in np.arange(0.001,0.01,0.001):
print "Computing for learning rate" + str(lr)
train, validation = cross_validate_movielens_test100k(300, 2, lr, 0, False, lr, 0)
train_plots.append(train)
validation_plots.appen... | 0 |
96bfb6d31fa7a3f102f1cb34a506d4ff | 5270057937ac8d592216970791b02d34 | 统计相应的计划加入记录总数 | function countPlan($dateid){
$m=D('plan');
$where['dateid']=$dateid;
$arr=$m->where($where)->count();
return $arr;
} | 1 |
f533a00ef04961fd1efeed7ae24a77a0 | 2e66f28611046f8c037c425dd92e5fd5 | Determines what ships the player owns | for planet in self.planets:
if(isinstance(planet, MilitaryPlanet) and planet.owner == playerID):
return True
for fleet in self.fleets:
if fleet.owner == playerID:
return True
return False | 0 |
a255adc8604d4a0761674bd86e8fd57c | 3b9f8b22ee39b3324490789c42808775 | 用户账号正则表达式判断
1、必须以半角的字母开头
2、不能包括任何标点符号
3、长度不超过10位
4、不能为空
5、不能有中文 | class UserNameValidate(object):
def __init__(self, message=None):
self.message = message
self._reg = re.compile(ur'^[a-zA-Z0-9\u4e00-\u9fa5\s]+$') | 0 |
b39992c5612ff2b4b4efcb0aaea399e5 | 2bb6e0090c606a85978984f854fa312d | Executeアノテーションがついており、ログインされていない場合ログインページに飛ばす。 | class LoginController extends BaseController
public function beforeExecuteRoute()
{
if ($this->_checkLogin()) {
$this->_trueLogin();
}
} | 0 |
cc009812157e75592e57ce5c4fe65e75 | 81f70b40522f6402371fb79f9ffa21eb | Gets the location terms. | public class TemplateBuilder private class Builder
private Map<TermKey,Location> getLocMap() {
return this.locMap;
} | 1 |
14b4235d63f2f0a4c0747851147965d9 | ebc725857a58207c27863c92264fca0e | Redirect to icegram if required | function wolf_discography_template_redirect() {
if ( is_page( wolf_discography_get_page_id() ) && ! post_password_required() ) {
wolf_discography_get_template( 'discography-template.php' );
exit();
}
} | 0 |
528a1abdccc9b162ec17bf7bd9e9f14f | d9e451a08cdacc8db9d1d95139ac2e53 | 获取订单提交次数 | class distribution
public function getDistributionOrderNum($dist_user_id, $time)
{
$sql = sprintf("SELECT count(*) num FROM %s WHERE dist_user_id = %d AND buyer_id=0 AND create_time >=%d LIMIT 0,100", ORDER, $dist_user_id, $time);
$this->db->query($sql);
$rs = $this->db->fetchRow();
return $rs['num'];
} | 1 |
4fa5b2b485e4e439ce71a9271474a1d7 | e3a9a15d062d121008e6e3b32cd485c5 | rekursiver euklidischer Algorithmus | if y == 0:
return x
return euclidsAlgorithm(y, x % y) | 1 |
879283acb9f6383f87954d4c39da8a10 | 90b9f6af6ac4884aa87772d89011ee67 | Bean para q nuestr app pueda determinar la localización q está utilizando
actualmente | public class NewLocationActivity extends AppCompatActivity
private void startLocalizacion() {
if (ContextCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED ||
ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_C... | 1 |
0619b1d8941e5c1b277b89665e73009e | 05ee066d3094a8fa99e250680c567c5c | Moves the contents of the given first coordinate to the given second coordinate and vice versa. | class Grid:
def swap(self, coords_1, coords_2):
temp = self.get(coords_1)
self.place_object_f(coords_1, self.get(coords_2))
self.place_object_f(coords_2, temp) | 1 |
c0f687ded79d005c3aea44cb81d1f1bd | 59c91da5bb19deb36e00fb0edec34ca4 | Method to remove package from elasticsearch index | document = {
'id': name,
'model': model,
'package': datapackage,
'origin_url': datapackage_url,
'dataset': dataset_name,
'author': author
}
self.es.index(index='packages', doc_type='package', body=document, id=name)
... | 0 |
e837362d8c50e0cd7ed79635010ba794 | de95539722ef7791da20d01b70015b97 | Retrieve whether auto-completion cancelled by backspacing before start. (Scintilla feature 2111) | void QsciScintilla::cancelList()
{
SendScintilla(SCI_AUTOCCANCEL);
} | 0 |
94644b2962e577d09230541ed5934f0d | a68fb4dd87e5644fdfa9942e2691a624 | Minimum allowed date based on metric type | class DateTypeCustomFieldDefinitionModel
extends CustomFieldDefinitionModel
public function setMinDate(
$MinDate
)
{
$this->MinDate = $MinDate;
return $this;
} | 1 |
c8b0868d7492891ec91544484452757b | af8deeb99c5606684e2e4dbf2d27341f | CustLoan导出Excel | @Controller("/customer")
public class CustomerController extends BaseController
@PostMapping("/exportExcel")
public Result exportExcel() {
return doAction(CCustomerExportExcel.class);
} | 0 |
e927fb6c2f3de3ce06c5661dd3b3e64e | 8f7009425b136d32388a0593c37600fa | to find who won the turn | int SnakeLadder::checkWinner(){
if(board[0][0]==1)
return 1;
if(board[0][0]==2)
return 2;
if(board[0][0]==3)
return 3;
else
return 0;
} | 1 |
e3d80998f6b1ddacecbc225aba7da21f | ad0131b8cdcb597995e97069b4ee7b97 | 保存最近崩溃时间(long值). | void saveCrash(BlockBean blockBean); | 0 |
7ede61d7ee93b70c683933916da96a77 | 0e7c81764521f33ef1428d5be4e8e85c | Test of setTosServerId method, of class TOSConfig. | public class ToTest extends Assertions
@Test
public void testTos() {
List<Class<?>> toClasses = getToClasses();
SoftAssertions assertion = new SoftAssertions();
for (Class<?> toClass : toClasses) {
ToExclusion exclusion = EXCLUSIONS.get(toClass.getName());
testGetSet(toClass, assertion, exclus... | 0 |
d17247fef8ec366435198ea86dcb400a | 0cd9f2e0268f25a57aecf9dd00ff2bc8 | Handle a POST request to modify admin's password. | {
$args = func_get_args();
if (isset($_POST['changePassword'])) {
$this->view->error = true;
if (!empty($_POST['userpass']) && !empty($_POST['conf_userpass'])) {
extract($_POST);
if ($userpass !== $conf_userpass) $this->view->notice = "Passwords do not match";
else {
... | 1 |
98aa80be9e106a2b509b574dca775afd | d3401abe6f23391702ea1269709b349e | Returns an object subset of `obj`, whose properties are in `keys`. | function pick<
T extends Record<string, unknown>,
K extends keyof T,
>(obj: T, keys: K[]): Pick<T, K> {
const output = {} as Pick<T, K>;
for (const key of keys) {
output[key] = obj[key];
}
return output;
} | 1 |
120ec5d593290037009f23277e61fda0 | 06a17176f3c35446734d88a199696fea | 1.
Allow the backup of the selected product and the selected
replacement product. | self.question = input(
"Pour quel produit cherchez-vous un substitut?\n")
system("cls")
self.select_product() | 0 |
c102183cfc58a34ab6833ad7c991f28e | ebd4c528c511bfeda7f16bf12649f100 | Create a Ghtk\Client using a HTTP client. | class Client
public static function createWithHttpClient(HttpClient $httpClient)
{
$builder = new Builder($httpClient);
return new self($builder);
} | 1 |
3e418ba23f0bfacbccfd0e8248ceaa3d | 93501e69bf820d2a223f20abda7295dc | Desc : Test model on a TweetVO instance and returns the predicted label or labels , depending upon the configurations
for Ranked result or not. | class SentimentModel(object):
def predict(self, tweet_obj):
tweet_obj = self.preprocess(tweet_obj)
return self.model.predict(tweet_obj) | 1 |
6a3635390aa70aafbe4422bb0e4ef47e | b3c7f6fe8cbfc722942b03b5f3789023 | 新增采购类型 | {
string procurementtypeformData = System.Web.HttpContext.Current.Request.Form["procurementtypeformData"];
string otype = System.Web.HttpContext.Current.Request.Form["otype"];
var procurementtypeforminfo = DataConverterHelper.JsonToEntity<ProcurementTypeModel>(procurementtypeformData)... | 1 |
73c6b3ac32cdf8a35e9a6aaeeb9120f8 | 7f5dbdb7d338353bc6816730d20823af | Get a default "middle name" value, if any is available | abstract class BaseApplication extends BaseObject implements Persistent
public function getMiddleName()
{
return $this->middle_name;
} | 0 |
08b65785eab8eeb6e44e3d0fc57fd64b | bc5bcdcd3a114a5459f149e2b3b41fbc | Gets the applicable membership dues products for a customer. | public function CreateMembershipDues (); | 0 |
06ebcf83e61d58dad7964f157da120c6 | 64a5f0f446e9fc9768dd2c38c53892d9 | Fonction interne : Retourne l'element submit depuis l'id du form | function submit_form(id)
{
$("#"+id+'_form').find('div:first').html('<input type="hidden" name="action" value="'+id+'" />');
document.getElementById(id+'_form').submit();
return false;
} | 0 |
ca2c32932dd37bbcfe72c544344c487f | 6b871e9d9330247a4a74f0f9c2bc30b9 | get favourite songs from database again. | public class FavoriteSong implements CommonDb
public Cursor getAllFavoriteSongs()
{
SQLiteDatabase database = musicDb.getReadableDatabase();
return database.query(FavoriteSongColumns.NAME, new String[]{FavoriteSongColumns.SONGID}, null, null, null, null, FavoriteSongColumns.TIMEADDED + " DESC", null... | 1 |
a8c21372f7d529745802569eaff1d1c0 | 6e49d097bc5dc47edbb6aadd2f300855 | Find all constructors. | @AutoValue
public abstract class ClassMemberRecord implements TypeMappable<ClassMemberRecord>
public final ImmutableList<ClassMemberKey<?>> findAllConstructorMemberKeys() {
return findAllMatchedMemberKeys(ClassMemberKey::isConstructor);
} | 1 |
e5e4ff59d4cf15dae7bb3fd92395a086 | 8fcbfcf69cc24521168496dc1ee9da43 | Uncheck all menu items | int noOfItems = navigationView.getMenu().size();
for (int i = 0; i < noOfItems; i++) {
navigationView.getMenu().getItem(i).setChecked(false);
}
} | 1 |
8286a5c4b7375a6457544856c8fe8807 | 8ab3f5fb605ee95731792ff8f05419a9 | Returns the value of the '<em><b>Specification Name</b></em>' attribute. <!--
begin-user-doc -->
<p>
If the meaning of the '<em>Specification Name</em>' attribute isn't clear, there really
should be more of a description here...
</p>
<!-- end-user-doc -->
extendedMetaData="kind='attribute' name='specificationName'" | public abstract class NodeExtractor<K extends Serializable>
public String getSpecificationName() {
return _specificationName;
} | 1 |
c8bd3174650f1e9ea22e7d96cd974e7d | 2da94cdd385bbe2855e4b68dd08b77b7 | Returns register button label | class RegisterHandle(object):
def get_register_text(self):
return self.register_p.get_button_element().text | 1 |
51ba628682f4bdd2d83ce3f5faec0801 | eddd39a7af8d44022d1aff9196aaf835 | Turn unit name into floating point unit value | floating unitVal(const string &str) {
floating buf_val;
string buf_str;
istringstream ss(str);
ss >> buf_val >> buf_str;
if (buf_str.empty()) return buf_val;
buf_str = tolowerStr(buf_str);
if (prefix::dict.find(buf_str) != prefix::dict.end()) {
buf_val *= prefix::dict.at(buf_str);
... | 1 |
235c7f8b8e039ed83ea38fbbdfa8c22e | e8d660981570bc53b1342f0cfa4e0308 | Increase Total Games Played by one | public class CrapsMetricsMonitor
public void incrementTotalGamesWon() { ++this.totalGamesWon; } | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.