query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
5a9ec068c3e1f9d9cedd586fa272008c | 0f82dd33fc3fc4dd10aedd388ac16226 | 编辑发布的作品名称 | class PostController extends BackedController
public function actionEditname() {
list($fid, $name) = $this->getInput(array('fid', 'name'));
$Category = Category::model()->findByPk($fid);
$Category->catalog_name=$name;
$Category->save();
echo 'success';
} | 0 |
139a4951ff393154c04a6530ca398888 | ff65cf0fd322c2134ff4ef3cad00025c | Return an exact copy of self (every cell is duplicated)
* *Returns* : | def clone(self):
return cover(self.pos_int) | 0 |
ce5337f07f689a27525ff3554eaa4041 | d7e9c99130b7a1b55eb41c612df79c21 | callback for save config | int CVICALLBACK ShiftConfigSaveCB (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2)
{
switch (event)
{
case EVENT_COMMIT:
WriteShiftConfiguration();
break;
}
return 0;
} | 1 |
19fd54964c6dc271744e5d76ec9bc19e | 5316212c7e283ab3c22315547f75545a | Returns a dict of node id's and their centrality score (0.0-1.0),
which is the amount of shortest paths that pass through a node. | def betweenness_centrality_distribution(G, return_dictionary=False):
if return_dictionary:
return nx.betweenness_centrality(G)
else:
return nx.betweenness_centrality(G).values() | 1 |
944a2e52ce7393ce2dbb99b51ac949df | 1c94d51191f10efd3940839e857f40e7 | \brief The number of design variables stored in this optimization problem | class DTLZ2(ModelBase):
def number_of_design_variables(self):
return 30 | 1 |
66fd98841229c9cd254e1f163b008286 | d0f8edbfe7d224287fb1d87c4dcf295a | Test construction of Markov word chain | signed int nb_transitions = 0;
signed int marking[1] = {1};
struct PN * pn = new_pn(1, nb_transitions, marking);
assert_non_null(pn);
} | 0 |
6a9b91e908092043cc8ec3a712ed1026 | d6565d2ab1e7ca53fad4b2296d82f13d | 毕业生信息接口 添加毕业生信息方法 | if(empty($_FILES)){
$this->showjson(1001);
}
$csv=new CSV();
$result=$csv->getCsvData($_FILES);
if(!is_array($result)){
$this->showjson($result);
}
$str_encode=A('Admin/Student')->getStringEncode($result['result'][0][0]);
$i_d... | 0 |
3349e52674fe04180472021a65ddfba9 | f483aa27564e291b3171d18be99addf5 | When the target gets out of line of sight of the seeker's FOV or out of range, it can no longer track. | {
if (TraveledDistance() >= this.DistanceToTarget)
{
makeInvisible(true);
inMotion = false;
setPosition(xOrigin, yOrigin);
}
} | 0 |
57ecef025a16c95fb260f00350df3fa0 | ffe7d60cc8d00d644d4d45b6fe1ff145 | This method sends a message as a command to the specified sensor. It returns a boolean representing whether it
was successful or not. | if self._currentlyConnected:
self._sendBytes(struct.pack('<cbf', b'M', dacChannel, dacMagnitude))
return struct.unpack('<c', self._readBytes(1)) == b'A'
return False | 1 |
1cabd2426feee9d05ada8a688be0d86d | 977a0455f2f7101d1bf8d44da8ac1676 | Определение OID'а алгоритма ключа по названию
алгоритма ключа. | namespace Bytescout.PDF
class PKCS7
public static String GetDigest(String oid)
{
String ret = (String)digestNames[oid];
if (ret == null)
return oid;
else
return ret;
} | 0 |
14368df37c299c4c1c28a1b026c55f62 | b74e65ec0ede29b89188c30c76b0749a | description:处理离线数据列表响应 | public void onHttpResult(final String str, final int httpRequestType) {
ThreadPool.addToSingleThreadExecutor(new Runnable() {
@Override
public void run() {
switch (httpRequestType) {
case OffLineUtil.OFFLINE_MTDM_ADD_RESULT_CODE:
mtdmBusiness(str);
break;
case OffLineUtil.OFFLINE_BWDM_ADD... | 1 |
3328c253582590cbb16d0fb39d7bcc88 | de515cb8412235b749e890db66e0ca69 | 打开疾病史详情模态框 | export default class Detail extends Component
@Bind()
handleOpenModal() {
this.fetchModalData();
this.setState({
addModalVisible: true,
});
} | 1 |
d039a82b56a089adb7ed56990c9a758b | 1d0027b4f0f8110b1b96a908e4a06724 | 在接收到新的 props 或者 state 之前立刻调用。在初始化渲染的时候该方法不会被调用。
使用该方法做一些更新之前的准备工作,你不能在该方法中使用 this.setState() | export default class Index extends Component
componentWillUpdate(nextProps, nextState) { } | 1 |
df73105f5421ffd0a9341dfab6f65896 | ddfa123bf4dafd641afc501279743a1f | Wraps the Django :func:`send_mail` function into a parallel thread
for immediate reactivity on the web-front side.
.. versionadded:: 1.17 | def _send_async_mail(app, message):
with app.app_context():
mail.send(message) | 0 |
40a08bd5fc2be8c8929a5d6f5e7d6839 | 0b23248c9f4bbe672a4a363056c692c6 | 2.定义一个方法:求2个数的和。2个数由参数传入。。 | def sum_2_num(num1, num2):
result = num1 + num2
print("%d + %d = %d" % (num1, num2, result)) | 1 |
0254ddb20820a3a770cff3650139849a | 35c5bba610f22caaf703da02af78ad01 | 功能 5:按学生总成绩由高到低排序 | class StudentManagerController:
def order_by_score(self):
self.__stu_list.sort(key=lambda x: x.score,reverse=True) | 1 |
b34a8bbb8cd32a24302b99301a58086b | 6d85b8c5f4e24ed03e7c7149a7326542 | Get all routes built by TsExpressDecorators and mounted on Express application. | export class Router
public getRoutes() {
return api;
} | 0 |
2018a827a07522d844175ca116b0a8d4 | ab02d07dd7356b76858fbbbe2b4040b1 | handles the vertical size of the carousel changing (ie. on window resize when aspect ratio has changed). | export default class Siema
resizeHandler() {
this.resolveSlidesNumber();
this.selectorWidth = this.selector.getBoundingClientRect().width;
this.sliderFrame.style.width = `${(this.selectorWidth / this.perPage) * this.innerElements.length}px`;
this.slideToCurrent();
} | 0 |
4ef79b0a0f791d59dfb7bd27318bf2ac | 08ebc0272b11a927195ef4cb58136097 | Funkcija za registrovanje korisnika. Na kraju funkcije se korsnik
automatski loguje na sajt. | class GostController{
public function register(){
if(empty($_POST['username']) || empty($_POST['password']) || empty($_POST['password_validation']) ||
empty($_POST['email']))
$poruka0 = "Sva polja moraju biti popunjena!";
else{
if(strlen($_POST... | 1 |
56b17b0c220ad2c4b45bc1298e75332f | 278df25fcb1577ddd0bf64f6c2736807 | takes provided string and converts low-order characters to javascript hex notation. | function rstr2hex(input)
{
try { hexcase } catch(e) { hexcase=0; }
var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef";
var output = "";
var x;
for(var i = 0; i < input.length; i++)
{
x = input.charCodeAt(i);
output += hex_tab.charAt((x >>> 4) & 0x0F)
+ hex_tab.char... | 1 |
98dbd4918a15698e3e099b594936938e | 9aeb7a196862921c37deac608c31d6de | get the median from an array of doubles
array A should be sorted, but sort a copy if it isn't | if (size == 0) return a[0];
double temp[size];
double median;
for (int i = 0; i < size; i++) temp[i] = a[i];
for (int i = 0; i < (size - 1); i++) {
for (int j = 0; j < (size - (i + 1)); j++) {
if (temp[j] > temp[j+1]) {
double temp_val = temp[j];
t... | 1 |
573d52d9d673aa143ceadf16fb211c26 | 84e69b35ee175bf0d7dbdaf8345e9a1f | 重新构建子问题 | let subWidth = this.rect.width / 2,
subHeight = this.rect.height / 2,
x = this.rect.x,
y = this.rect.y
this.child[0] = new QuadTree(this.depth + 1, new Rectangle(x + subWidth, y, subWidth, subHeight))
this.child[1] = new QuadTree(this.depth + 1, new Rectangle(... | 1 |
b868ab4af63b28263906faef02442ccc | 4b11e16db4939dd6eb66f5121f57000b | Given a posix timestamp (seconds since unix epoch) return a
datetime, with the timezone set to utc.
Shortened to make it quick to use in our test module. | def datetime_from_timestamp(ts):
if settings.USE_TZ:
return datetime.utcfromtimestamp(ts).replace(tzinfo=timezone.utc)
else:
return datetime.fromtimestamp(ts) | 1 |
cea9340437dae4365cd994b7d7d99fbd | 0f8b89973040dfd9ab6c159fb5407654 | We unmock the methods mocked in set up. | export class Etcd3 extends Namespace
public unmock(): void {
this.pool.unmock();
} | 1 |
0ad820b5c001571232f7040a4bad11d8 | 692e497e7c7375fe1d8f072cb14b3548 | Возвращает единичный вектор того же направления. | namespace Raylib
public static partial class Raylib
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3One(); | 0 |
a676e4a5ef687e94d382c7af69ba45b0 | 41653605ba2a4405a80c56a2f67f4e21 | Determines whether the specified <see cref="SemanticVersion" /> equals the current <see cref="SemanticVersion" /> . | namespace Microsoft.TemplateEngine.Utils
public class SemanticVersion : IEquatable<SemanticVersion>, IComparable
public int CompareTo(SemanticVersion other)
{
return CompareTo(other, out bool ignored);
} | 0 |
4c78e83293e56c54d8cf2597c435ebc8 | b5648337ed13245b9ca121658ea49651 | 将树形结构数据转化成一维数组 | function transferToFlatTree(treeData, childrenName = 'children') {
const result = [];
recursiveTreeNode(treeData, childrenName, (item) => result.push(item));
return result;
} | 1 |
86a1b1e712d802c3586eb11a34f7bf40 | ef27a2fe2fbc490eb5a4557efae8e6a4 | Coerce a value to None if it is nan, else return value. | def NoneIfNaN(value):
if np.isnan(value):
return None
return value | 1 |
8764e61886475871b5fcce7b62317c4c | d984bf03120281597a7140563c76b1a1 | @post
The current coordinates of the image are updated. origin - topleft,
+x - right(0-472), +y - down(0-472). | res = self._resolution
loc = self.loc
self['loc'] = [round((loc[0] + dx) / res) * res,
round((loc[1] + dy) / res) * res] | 1 |
e0602f3a190f1e4636c7d5a17de4686a | 7f710a8a04d4585245f6949f48927011 | Translate from Method into ObjCMethodInfo and write it out. | throws java.io.IOException {
HashMap methodNames = new HashMap();
Iterator it = root.getMethods();
while (it.hasNext() == true) {
MethodNode node = (MethodNode) it.next();
String name = node.getCPPName();
Iterator params = node.getParameterList();
... | 0 |
9ed86bf5233d70c4bf8f399e643164b4 | 1292dd2c91a9f7836fb7676691286542 | Create a minmax scaler component. | super().__init__(interface)
sliderLabel = self.Label(label, scaling, interface)
sliderLabel.setGeometry(x, y, self.LABEL_WIDTH, self.HEIGHT)
self.setGeometry(x + self.LABEL_WIDTH, y, width / 1.5 - 1.1 * (x + self.LABEL_WIDTH), self.HEIGHT)
self.setOrientation(self.HORIZONTAL)
... | 0 |
b3bc840fdd9d21cc9239cfd57e6e8fe5 | 1bd63e69070db351cebd0dab6c347e3e | Return the mean sidereal time of day from moment tee expressed
as hour angle. Adapted from "Astronomical Algorithms"
by Jean Meeus, Willmann_Bell, Inc., 1991. | longitude = astronomia.globals.longitude
THETA0 = sidereal_time_greenwich(jd)
deltaT_days = deltaT_seconds(jd) / seconds_per_day
m = (raList[1] + longitude - THETA0) / pi2
if m < 0:
m += 1
elif m > 1:
m -= 1
if not 0 <= m <= 1:
raise Error, "m is out of range = " + st... | 0 |
421ed1a93543ca61abd28199e59e00c3 | 46569d8c39d01d7cd2ca62e3fe7361c4 | 접속한 방이 살아 있는지 체크 | class ChatAgent(
val queueName : String,
private val chatService: ReceiveChatService
) : Thread()
private fun checkRoom(roomId : Long) = this.chatService.getRoomInfo(roomId) | 1 |
39144770d912189ccd0b10db0b95a9e7 | f90b962e137a76648d4cf9d28a59de4f | 得到当前的毫秒值 | public class CommonUtils
public static long getCurrentMillisecond() {
return new Date().getTime();
} | 1 |
fa6b936f59f2ca24994310a8b2d1a5fb | 4e0b112039aba27aa6f5645d68008864 | Ищет парсер по имени | {
var matchByTypeName = m_types.FirstOrDefault(t => t.Name.Equals(typeNameOrAlias, StringComparison.OrdinalIgnoreCase));
if (matchByTypeName != null)
return matchByTypeName;
return m_registeredParsersByAlias.ContainsKey(typeNameOrAlias)
... | 1 |
cab3faae956d2d41d0b0287e42bdb4c5 | 342c7254fc0790ab7ea49748edcb2375 | Преобразует координаты игры в координаты графической сцены | public final class ScreenManager
public static Point2D sceneToGame(Point2D sceneCoordinates) {
return sceneCoordinates.subtract(sceneCenter);
} | 0 |
82777817010b69cec297da5cb64421dd | edfbacb9c0748363797cadaf899fba0b | Ricerca sintetica paginata modulare delle quote afferenti al documento di spesa | @Component
@Scope(BeanDefinition.SCOPE_PROTOTYPE)
@Transactional
public class OperazioneDiCassaDad extends ExtendedBaseDadImpl
public ListaPaginata<OperazioneCassa> ricercaSinteticaOperazioneDiCassa(Bilancio bilancio, CassaEconomale cassaEconomale, Date dataOperazione, TipoOperazioneCassa tipoOperazioneCassa, StatoOper... | 0 |
f403f1f4fe85752e349cd2fd131cc100 | 11655d0bc0cd5503001a0f12e7593ec1 | Get tuple (field,value) for search engine query. | public function getSearchField(): array; | 0 |
fda483b4e5d867b9205af95adced9a0e | b4f94b253ae0e080935a305d0f99d2fe | Deletes the whole molecule and it's connections | cmd.delete("pseudoX")
cmd.delete("pseudoY")
cmd.delete("pseudoZ")
cmd.delete("pseudoXZ")
cmd.delete("Oreo")
cmd.delete("SecondNeighbor")
cmd.delete("Nitrogen")
cmd.delete("Hydr")
cmd.delete("HydrNeighbor")
cmd.delete("Halogen")
cmd.delete("FirstNeighbor")
cmd.delete("Seco... | 0 |
1c27c7ccd1464aa61b39ae031dddbddb | 83690f65e65b12e26621dda5f22f248c | Updates the settings with new hidden layer structure. | namespace COSYNNC
void NeuralNetwork::SetHiddenLayers(vector<int> hiddenLayers) {
_hiddenLayers = hiddenLayers;
_depth = hiddenLayers.size() + 1;
} | 1 |
98682e51446f55406557b24434c89911 | 148b7703f0f3d00c07e0525c8f18d3ec | Caches irradiance photons on a single texture mapping. | {
unsigned int irradianceMapID;
glGenTextures(1, &irradianceMapID);
glBindTexture(GL_TEXTURE_CUBE_MAP, irradianceMapID);
for (unsigned int i = 0; i < 6; ++i)
glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, GL_RGB16F, 32, 32, 0, GL_RGB, GL_FLOAT, nullptr);
glTexParameteri(GL_TEXTURE_CUBE_... | 1 |
f7565d7ad30c0dd4f5581722a5411595 | 42809c3404d0c277f0d2629558b33d63 | Get the status config name from transaction status code. | const statusesByType = {
'deposit': {
'1': 'failed',
'2': 'pending',
'3': 'pending',
'4': 'pending',
'5': 'ok',
'6': 'pending',
'7': 'failed',
},
'withdrawal... | 1 |
d225b3d38256d37ff7bcef30f81d2f6c | 5ab6489ff5b371fd752a1f6534a22602 | Returns all <code>{@link AppUser}</code>s in the repository in an <code>{@link ArrayList}</code><<code>{@link AppUser}</code>> | @ApplicationScoped
public class JPAUserRepository implements UserRepository
@Override
public Set<User> getUsers() {
final Set<JPAUser> jpaUsers = this.userDAO.getAll();
return jpaUsers.stream().map(JPAUser::user).collect(Collectors.toSet());
} | 0 |
6e66c43680be1c6f3a931516a63c8592 | b8a8670bcd8647e66ace235cd7ef0edc | Play switch scene sound. | public class CharacterMenu : MonoBehaviour
protected void PlaySwitchSound()
{
if (switchSound != null)
SoundManager.SoundManagerInstance.Play(switchSound, Vector3.zero);
} | 1 |
37fa0d991b029d020e59f8279cb24bee | 7f68aa06272425e7ce96616dc5667468 | Presumption - no errors, unless indicated below | func NoError(t *testing.T, err error) {
if err != nil {
t.Fatalf(`Did not expected to receive error "%s"`, err)
}
} | 1 |
b436b31579d10e45d19b7f3bd8949f5f | 15bae365bd40843af4b55ef878dc0e21 | create animations for all enemies and towers | class Enemies(TextureLoader, Inventory, Weapons, DeltaTimer, SoundMusic, TkWorldDataShared, BookKeeping):
def load_enemy_animation(self):
self.enemy_legs_frame_cycle = self.tk_cycle(xrange(len(self.legs_textures[self.enemy_legs][1])))
self.enemy_legs_frame_index = 0
self.enemy_torso_frame_cyc... | 1 |
6b073b633e017a733be25f5c2ea25ffe | 9c62fa3325c79561b8fb92bc787eaa81 | --------------------------------------------------------------------------------------------
Generate 3D volume geometry of rectangular prism
Each side can be other material / color
-------------------------------------------------------------------------------------------- | {
var vSliceVertex = new Vector3[]{
new Vector3(-0.5f*width,0,0),
new Vector3(0.5f*width,0,0),
new Vector3(-0.5f*width, height, 0),
new Vector3(0.5f*width, height, 0)};
var holeSize = 0.1f;
var vertexes = new List<Vector3>(4 * 3);
verte... | 0 |
f382adafcd905b6dcd22551c1a783f98 | abae7533380a417cd485388e715c8d5c | remove final newline character | export class GlyphData
toJSON() : string[] {
const data: string[] = this.toString().split("\n");
data.pop();
return data;
} | 1 |
83866aa832e17f4d95c57f306c5792be | 3486437d89401975e0d3d8f3ab61d33e | Function addHeader add header variables such as (Web Page's name, styles, js, favicon) | class FrontendLayout
public function addHeader($name, $data)
{
$this->_header[$name] = $data;
return $this;
} | 1 |
1623d343b9b19dd01e0b9eef1a655a6e | 39876a5d3b341f8e35091cdb65c5b8ae | Gets the <typeparamref name="TUser"/> from the given <see cref="ClaimsPrincipal"/> as an asynchronous
operation. | namespace AnonymousIdentity.Services
Task<ClaimsPrincipal> GetUserAsync(); | 0 |
82ebdfb4aa3c0c4520be696ffa3e5f8a | 9f22faf19b08897b56c5ffa2071f7dc4 | Point the queue's element link pointer
at the specified transfer descriptor. | static inline void
tx1(volatile struct txgbe_tx_desc *txdp, struct rte_mbuf **pkts)
{
uint64_t buf_dma_addr;
uint32_t pkt_len;
buf_dma_addr = rte_mbuf_data_iova(*pkts);
pkt_len = (*pkts)->data_len;
txdp->qw0 = cpu_to_le64(buf_dma_addr);
txdp->dw2 = cpu_to_le32(TXGBE_TXD_FLAGS |
TXGBE_TXD_DATLEN(pkt_len));
tx... | 0 |
ebcff2b35e660a82f099ce3323dde742 | 81bd056b854c375322d980b6cc6b9651 | Returns the value of the '<em><b>Local Name</b></em>' attribute.
<!-- begin-user-doc -->
<p>
If the meaning of the '<em>Local Name</em>' attribute isn't clear,
there really should be more of a description here...
</p>
<!-- end-user-doc --> | int getLocalNameKey(); | 0 |
d236cac2f1a945e168ed911a49577eda | 8b4c86760a8285eae6e58162db2c9de4 | Set the status of this cacheData as done fetching fresh cacheData. | void dataFetched(); | 0 |
901e7cc597d2d74e7d163827f1f852d6 | 12d18da0636454b8b1f5e092aa426426 | 获取当前结点的最后一个指定名称的孩子结点,若没有指定名称就获取最后一个孩子结点 | namespace DatAdmin
ITreeNode GetNamedChild(string child_name); | 0 |
9e2f4a0b2876a6b6656070e4aad6f59c | eb23a527464cae838580bf93ca845a39 | Gets the status of this Todo.
to-do Status # noqa: E501 | class Budgets(ABC):
def get_status(self):
return self._status | 0 |
8b76a4def7b5a7ef4b3660898aa076ea | eadbba97f510f3938199b48aea4bd92f | Constructor code logs the time it was instantiated. | class EcrLogconsole
public function __construct()
{
$this->runTime = microtime(true);
$this->setupLog();
JLog::add('|¯¯¯ Starting');
} | 1 |
9a054a16aeb42e2b5dfb2f46e9991ed9 | 704fc6a9da7885ca199989ba8325d90b | Determines whether the filter is valid. A valid filter has to have a column, value and operation. | namespace Microsoft.Online.Metrics.Serialization.Configuration
public sealed class MetricFilterDetails
public bool IsValid()
{
return this.Expression != null && !string.IsNullOrEmpty(this.Expression.Trim());
} | 0 |
c548559ae37fba6be0eafdc8b4ee2347 | b046d35125ff602e5aad32764f86169f | Función para la obtención del listado de edades disponibles. | {
echo "<select name = 'years'>";
for(;$i<=2021;$i++)
{
echo"<option>".$i."</option>";
}
echo "</select>";
} | 0 |
fd2db759cd119797b359896916378c3b | 87363fc244ad2c68f116e8e34064654a | Get the FTP connection request info | namespace UTSOFTMAIN
class tools
private static FtpWebRequest GetRequest(string URI, string username, string password)
{
FtpWebRequest result = (FtpWebRequest)FtpWebRequest.Create(new Uri(URI));
result.Credentials = new System.Net.NetworkCredential(username, password);
re... | 1 |
1551d2936c00a465a4c0c83645c9f35f | 447fffedd2cd95d13c242b4eb07c2bb7 | This method deals with the package renaming, and makes sure old KnowNER models work with the new structure. | args = split_args(args)
if len(args) == 1:
m_folder = CLF.__models_folder__
model_file = path.join(m_folder, "%s.%s" % (CLF.__name__, STR_MODEL_EXT))
model_new_file = path.join(m_folder, "%s.%s" % (args[0], STR_MODEL_EXT))
cache_file = path.join(m_folder, ... | 1 |
12d4db0fc592b6deefbd32467cf4fb25 | 803e588353059618283e7cbfe817c740 | Make HTTP request to get player teammate details based on other player's ID | [ResponseType(typeof(GetTeammateResponse))]
[HttpResponseCodes(HttpStatusCode.OK, HttpStatusCode.BadRequest)]
[HttpGet]
public IHttpActionResult GetTeammate([FromUri] long id)
{
var target = searchFacade.GetTeammate(id);
return Ok(target);
} | 1 |
e5803514952c743f4b8c431e28f576c9 | 725ecb7550e68f0c9d18bb2486427288 | 按照注册的方法,对请求进行过滤操作 | public class MyFilter implements Filter
public void doFilter(ServletRequest req, ServletResponse resp, FilterChain filterChain) throws IOException, ServletException {
HttpServletRequest httpServletRequest = (HttpServletRequest) req;
HttpServletResponse response = (HttpServletResponse) resp;
Http... | 1 |
07806a4f23e60fabe82d91d7ab194e3e | ca4115860317e4fb43c4aa0921baa25f | cannot remove initial nor final | function removeChar(str){
if (str.length >= 3){
var chopped = str.slice(1, -1);
}
return chopped;
} | 1 |
4e0dda14971ae2a88aa13c43cd647352 | dac7bf80830690e8333537af252ad94b | 将box校正为正方形,方便作为下一阶段的输入 | def norm_boxes(boxes, shape):
if boxes.shape[0] > 0 :
height = shape[0]
width = shape[1]
scale = np.array([width-1,height-1,width-1,height-1])
shift = np.array([0, 0, 1, 1])
boxes = np.divide((boxes-shift), scale).astype(np.float32)
else:
boxes = boxes.astype(np.f... | 0 |
524ab731d3be2e3eb90f52c3407280b0 | 8010d6083b0b962aa51ec11555a27766 | Funksjonen som utfører bubble sort algoritmen som tar inn en liste. | for i in range (0, len(A) - 1):
done = True
for j in range (0, len(A) - i - 1):
if A[j] > A[j+1]:
A[j], A[j+1] = A[j+1], A[j]
done = False
if done:
return | 1 |
b94ef693a6e1bc11a530e60334a89f31 | 6bc33304893acaf2375b0bbac19c46c7 | @brief This function is an application I/F function which is used to send the data for other then TCP mode.
Unlike TCP transmission, The peer's destination address and the port is needed. | bool isData,
unsigned msgSize,
double timeoutDelay,
bool dstNodeIdPresent,
unsigned dstNodeId)
{
} | 0 |
16df37361ecc7077da6fa1d1774d3813 | c49a9f9cdcbfacbdd6eb88b6dfdc9445 | Applies all changes but does not close the dialog. | namespace HtmlElementsDBEditor
public sealed partial class AttributeTypesDialog : Form
private void OnApplyButtonClicked(Object sender, EventArgs e)
{
this.ApplyChanges();
} | 1 |
59f31fead266d1055f019a865c4a13a2 | 925eb430509955de9beaba849892842e | Returns number of changes in tilt. | public int numChanges(); | 1 |
f8dccd92d01a434358da3b6dfacc2485 | 2a18a76ec1d6f058b59ed58adfa6501d | Поиск информации о Монете | public VkCollection<Market> Search(MarketSearchParams @params)
{
return _vk.Call("market.search", @params).ToVkCollectionOf<Market>(x => x);
} | 0 |
02f962a23d36bec54184e66bb102a46e | d1c7752fd74669329b942ee67badaa1e | Проверка созданного объекта в гриде | namespace Leisure.Sport
[ToolboxItem(false)]
public partial class SportSectionObjectDialog : DetailFormBase
public override bool Check()
{
if (!base.Check())
return (false);
if ((txtObjectType.Tag as Guid?) == null)
{
Dialogs.CheckFailMessageShow(this, "Не выбран объект", txtObjectType);
ret... | 0 |
a7ec238b696fd8005ffdc4c79a2a6d86 | 0f99b603dfa63b48d5820c63e7cae394 | Create a symbolic graph of the distribution parameters. | nodes = nodes or model.parameter_names
gradattr = 'gradient_pdf' if log is False else 'gradient_logpdf'
grad_nodes = _add_distribution_nodes(model, nodes, gradattr)
return [g.name for g in grad_nodes] | 1 |
e9fd319b2c3143f8c2a12c8e337de8e1 | 8e50cf07c630c53b6f2efa9c226aacbf | 4. 함수의 인자로 시작과 끝 숫자가 주어질 때 시작부터 끝까지의 모든 정수 값의 합을 리턴하는 함수 작성 | def print_sum():
count=0
numbers=list()
i=0
x=int(input('정수의 개수를 입력하시오: '))
while count<x:
s=input('정수를 입력하시오: ')
numbers.append(int(s))
count+=1
sum=0
while i<len(numbers):
sum+=numbers[i]
i+=1
return sum | 0 |
2c8802a9ad4f4503134e22d9d834d980 | b5fc2ed3ac7451f6cf62b6659bdaa6cc | Sets selection value without notifying to event listeners | if (this.value) {
this._selected = undefined;
this._selectValue(this.value, false);
}
} | 1 |
71feb3d4ac063165f5d3b584d8ed41b9 | ac3642485b9cfd968efe42fe1dddd2e7 | マウス出力 | pygame.init()
screen = pygame.display.set_mode((SCREEN_W, SCREEN_H))
pygame.display.set_caption(u"マウスイベント")
clock = pygame.time.Clock()
x = 0
y = 0
RECT_SIZE = 10
while True:
clock.tick(60)
screen.fill((0, 0, 255))
mouse_pressed = pygame.mouse.get_pressed()
... | 1 |
0762504080cc3645beefab76d40c1477 | 14f486560f0065c07cd1e10ac4636b76 | データ開始位置を0スタートで返す。データベース問い合わせ用 | class DB_ZDE
function DataSeek($result){
$this->result = $result;
return mysql_data_seek($this->result,0);
} | 1 |
bc50df5493264d0333c5dd13bf4f2e8d | 72da64547228e287b61f4d632f181f32 | 计算当前血量恢复满需要吃多少个云南白药 | if self._data == nil or self._data._id == nil then
return 0
end
local privileges = self._modelMgr:getModel("PrivilegesModel"):getAbilityEffect(PrivilegeUtils.privileg_ID.PRIVILEGENAME_7) or 0
local privilegeBuff = 0
if privileges then
privilegeBuff = privileges or 0
end
loca... | 0 |
20b3f35df7f460ed9dc8daac7fed82b6 | 4e0c651c338d61f9952ebbbff750aeb6 | 执行容器初始化 | {
DIContainerContainer.DIContainer = new DIContainerDefault(serviceCollection, serviceCollection.BuildServiceProvider());
DIContainerInit.Init = new DIContainerInitDefault();
DIContainerInit.Execute(dISetting.SearchAssemblyNames);
} | 1 |
f3336f8c71a5202be5c50fdcec918b3e | b9c5a2be3a3f83fbfcea2e22691103d2 | Called when "remember me" checkbox status changes. | SharedPreferences settings = getSharedPreferences(PREFS_NAME, 0);
SharedPreferences.Editor editor = settings.edit();
editor.putBoolean("rememberMeCheckBox", isRememberMeCheckBox);
editor.commit();
} | 1 |
471ccf465c5a51504de5ff67f19b509a | 5c97c71dbf6131193d1867524e1d66b6 | 使用指定的文件创建存储 | namespace Symbol.Data.SQLite public class SQLiteHelper
public static bool CreateFile(string file) {
if (string.IsNullOrEmpty(file) || string.Equals(file,":memory:", System.StringComparison.OrdinalIgnoreCase))
return false;
if (System.IO.File.Exists(file))
retu... | 1 |
63f92d9886d631454de317e72d9051f4 | bdf5084b54400a552e2a78b735a825ce | 获取客户性别,MAN=男人;WOMAN=女人;UNKNOW=未知 | public class Customer implements java.io.Serializable
public Sex getSex() {
return sex;
} | 1 |
92d423839a909997ce903a20c8ec25c5 | 9ce0ddde2cf6666d9a6def1d0a8cb49f | Control used to select "User" entities for relationships. | class OgUserSelection extends DefaultSelection
public function getSelectionHandler() {
$options = [
'target_type' => 'user',
];
return \Drupal::service('plugin.manager.entity_reference_selection')->getInstance($options);
} | 1 |
c97f957e8a5266e94d14e287f5162eda | c49ee730ec57d1dc40815a429ef79431 | Constructs a new ingredient object. | export class Ingredient
constructor(public name: string, public amount: number) {} | 1 |
ce4e7f2e77610f61e6287f32daed5cea | 9a2941f83bdf95e34b7c68272b30a08f | Should raise if state is empty | class GameTreeTests(unittest.TestCase):
def test_init_fail2(self):
with self.assertRaises(GameNotRunningException):
GameTree(self.__state1) | 0 |
b71f90a9dbf26aff8d6830e899db4245 | 7de50d8a4586051013a3d6f0ab419586 | Map the send history transaction to a Ledger Live Operation | this.path = LedgerPath.parse(path);
this.recordType = recordType;
this.name = name;
} | 0 |
4dc11f3360e431dd4ca6fb118b41dbc4 | e03990d8e631bbd22c62f20caf5dba9d | 从PBXFileReference中读出所有的FileReference,并剔除掉重复的FileReference | ArrayList<RepositoryFile> ret = new ArrayList<>();
Iterator<ItemAwareReference> objit = pi.listAllItemAwareReferences();
while (objit.hasNext()) {
ItemAwareReference item=objit.next();
SWBClass obj = item.getProcessObject();
if (obj != null) {
... | 0 |
8ee2be86681d2f1b318918a97483f23f | 4b55e5802d16a86528cfe0b1a0a0f37b | Generates a type of document defined in its subclasses.
Uses the file name given and returns the full path file name generated | if cached:
d = [ f.title for f in self.document.attachments ]
if self.document_type not in d:
att = domain.Attachment()
att.title = self.document_type
att.data = self.generateDoc()
att.language = self.document.language
... | 0 |
fd4129575e8f0a93810f905622358ca3 | 9a75a4b231b7ee7fcdeee83bc679663e | 检测某个时间是否在预约时间内 | SimpleDateFormat sdf = new SimpleDateFormat("HH:mm");
time=time.split(" ")[1];
Calendar calendar=Calendar.getInstance();
Date date=sdf.parse(time);
calendar.setTime(date);
Calendar calendar1=Calendar.getInstance();
Date begin=sdf.parse(strDateBegin);
calen... | 1 |
5d6154bd16cdf0a3289bdbe6169f7882 | 660ca1c4b342866c98f33399d9131518 | Popup with a Video | function videoPopup(){
mask.style.display="block";
videoPlay.style.display="block";
} | 1 |
084beb3dcf85d2077f01a415094642aa | b98b3e6e8c802c02189469711f088b88 | mengembalikan nilai diskon berdasarkan index | {
foreach ($p as $id_penyakit => $nilai_p) {
$nilai_l = $l[$id_penyakit];
$pos[$id_penyakit] = round($nilai_p*$nilai_l,3);
}
return $pos;
} | 0 |
a6d20172b73df627479630ceae308c26 | 9810f6dbfbf2d3b51e8ae8c1b45d13b6 | System.Collections.IList转成指定的List对象 | {
if (targetType.IsGenericType == false)
{
return this.NextConvert.Convert(value, targetType);
}
Type defindtionType = targetType.GetGenericTypeDefinition();
if (defindtionType != typeof(List<>))
{
return thi... | 1 |
057a6791af32c8a7b76638de7e91362b | 3a1dbd01fa1a1a996a357c77961b2853 | 设置文字框是否可见 | public class MailCompleteTextView extends AutoCompleteTextView
public void setShow(boolean textWatch) {
isTextWatch = textWatch;
} | 0 |
80f557762a17ed8e02308126017c1038 | 8cd7be93985870afc4585d458575048d | Converts Miles per Hour to Kilometers per Hour | {
return parseInt((((kmhValue * 0.621371) + 0.5) * 100) / 100);
} | 0 |
49c84f75952977d5c744fc6f2e8412b9 | 6fbcde4c2c61ee15422da52867572d96 | method deletes repository and returns info message | {
$result = [];
$repositoryId = $args['id'];
$repositoryModel = $this->container->get('repositoryModel');
$commitInfoModel = $this->container->get('commitInfoModel');
try {
$this->database->beginTransaction();
$rec = $repositoryModel->getById($reposito... | 1 |
fa97f8f28a5f2646a423ffcb81bf0b2b | 855a8685e6941f5ac1eab445799caa52 | [START bigtable_reads_filter] | {
BigtableServiceApiClient bigtableServiceApiClient = BigtableServiceApiClient.Create();
TableName tableName = TableName.FromProjectInstanceTable("[PROJECT]", "[INSTANCE]", "[TABLE]");
using BigtableServiceApiClient.ReadRowsStream response = bigtableServiceApiClient.ReadRows(... | 0 |
bff3f1b0b5b809079f3276fb19287184 | afc8c6806300c8585bbdbd6153a6cd3d | Get TSeg1 from CAN_CSR_CFG | uint16_t tsi_group1_cycle_get(void)
{
return (uint16_t)TSI_G1CYCN;
} | 0 |
7a0bc4669f92cf20efecb20e1f03e34a | edaa3cbe03d759364dd74216cd77222a | 由前序遍历构造二叉树 | {
S_BITREE_NODE *pstRoot = NULL;
static int num = 0;
if (!(*(szData+num)))
{
return NULL;
}
pstRoot = farsight_createBiTreeNode(*(szData+num));
num++;
pstRoot->pstLChild = farsight_createTreeByPre(szData);
pstRoot->pstRChild = farsight_createTreeByPre(szData);
return pstR... | 1 |
a5720af9c009f02ba2b4ae5e8293f210 | c1464a24fff185e599be685cf6894c95 | Wrapper for getting masked data. | export class Validation
__getValidValue(unmasked_value, selection) {
return this.opts.mask
? this.mask(unmasked_value, selection).value
: unmasked_value;
} | 1 |
8de61e616420b1c76956860bee2d04be | 0cac6ef9499a33fefbd1d90cb4c374af | 分页加载某漏洞的所有补丁列表--Ajax加载数据 | namespace X3Platform.Plugins.Bugs.Ajax
public class BugWrapper : ContextWrapper
public string GetPaging(XmlDocument doc)
{
StringBuilder outString = new StringBuilder();
PagingHelper paging = PagingHelper.Create(XmlHelper.Fetch("paging", doc, "xml"), XmlHelper.Fetch("query", doc, "x... | 1 |
6d21c8b1ddfec01d8ee57a38e1cd3ab1 | 456099ac6663a7ee22e8c9df975d9ce0 | 域名隐私保护 | class Organ{
public function privacy_field($data,$auth_id,$fields){
if($this->api_auth>0){
return $data;
exit();
}
if(in_array($auth_id,$this->auth_id)){
return $data;
exit();
}
$array_fields=explode(',',$fields);
if($array_fields){
foreach($array_fields as $value){
if(!empty($data[$v... | 0 |
623951813d9d3f4a5893ba78af36c784 | 68208d7c16068c1bdcae4f0275dcbe5e | 通过城市编码获取预警信息 | public String info(String city); | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.