query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
61f53e1a5e6fa8a47c1e398591c6887c | b620e3bf1734f2c29374b5322c1c58d1 | Checks that the specific model version is truly associated with the model attribute
that is specified. | @Component
public class VersionHandler
public boolean isLatest(RequestModel model) throws VersionNotFoundException {
ApiVersion modelVersion = getVersionByModel(model);
return versions.getLatest().equals(modelVersion);
} | 0 |
262fb60838aca669aa997b464a5df0ee | 766ca885a1b00bdadcc4b1bcb3bbef44 | compile cuda source file and execute it | basename = '.'.join(filename.split('.')[:-1])
if self.language == 'c':
cflags = self.params['cflags']
command = f"gcc {cflags} -o {basename} {filename}"
compile_result = subprocess.run(
command.split(),
stdout=subprocess.PIPE,
... | 0 |
c5de788af7fb2f0c01e781a84826defb | 9e869c1b08ef05d5f010fc008f663168 | ==== Constructor ====// | PCB::PCB(int size){
PCB_id = -1;
PCB_size = size;
PCB_memory_start = -1;
PCB_memory_end = -1;
PCB_creation_time = " XX:XX:XX";
PCB_state = "EMPTY";
file_size_to_print = 0;
file_size_to_disk = 0;
PCB_printer_number = 0;
PCB_disk_number = 0... | 1 |
36c3af50a467711ebb2aaf2fe5292e42 | 0747f4c8b917dae4e46f76d6f8c6ddaf | Returns the chain head. | class GoBoard:
def chain_head(self, p: Point) -> Point:
return self._board[p].chain_head | 1 |
71ef376517509ef94fb5d5a8c7a9e859 | 1e2374bcb5e7a9ca1dd4291afd4c7a6d | tests that __unicode__ or __str__ method of all models with more than one record does not return empty string
these methods used for history log | class PartModelTests(TestCase):
def test_Str(self):
all = PartModel.objects.all()
self.assertGreaterEqual(len(all), 1)
for x in all:
s = str(x)
self.assertIsNotNone(s)
self.assertGreaterEqual(len(s), 1)
return | 1 |
0c356172ad547086ad37734318f9b786 | 397dc4d0974692409eec4d22d0370326 | When the user clicks on any of the related companies buttons, close dialog and fill in search | namespace Rac.VOne.Client.Screen
public partial class PA0101 : Form
private void btnSearchCompany_Click(object sender, EventArgs e)
{
ShowCompanySearchDialog();
} | 0 |
134a6b7d9f8a64e66a5fe9768526f2f6 | 6289266468e4056dd4eca624fc985495 | Reset all component holders // | func clearAll() {
buf.Reset()
lib.Clear()
registerComponent(compId1, compFragment1)
registerComponent(compId2, compFragment2)
} | 1 |
01389105e6ecfc6ea71eecbce0c192f9 | cc9c3d98684d00c14e47ddc432e6c938 | Process hosts and detect invalid certificates. | class OpenStackProvider(Provider):
async def validate_hosts(self, reqs):
for req in reqs:
self.validate_host(req) | 0 |
0480b23236aaf820fe9a8dfcc87f39f1 | c062213b2ada0ce02ac0cfda67ec52b0 | Get array of Range from given string Range
Delimiter "," | $strArr = explode ( ",", $str );
return $strArr;
} | 1 |
8d845d0b05c658ba9f1936e73f456438 | f905a73c613ddbdc1265dbc211ee8f1b | Get recent tweets from local file if they exist | if config.tweet_log.is_file:
with open(config.tweet_log, "r") as file:
tweet_id = file.readlines()[0]
return tweet_id | 0 |
53c820043fb2642b7b055c59ad1252ca | d6d29a71da0c9dd58fe4d33ceaf72145 | While the jumping animation is active, update at every frame the vertical position
according to the physical law of x(t) = v0 * t + 1/2 * a * t^2 | global POSX, POSY, VY
for p in np.arange(len(POSY)):
if POSY[p] + VY >= HEIGHT:
POSY[p] = 0
else:
POSY[p] += VY | 0 |
96114a2237cd659ec0a5ef2e31c35b8b | d871d6928e8b952812532da648b6d97e | 查询缓存Redis实例的规格配置信息 | namespace JDCloudSDK.Redis.Client
public class RedisClient : JdcloudClient
public async Task<DescribeSpecConfigResponse> DescribeSpecConfig(DescribeSpecConfigRequest request) {
return await new DescribeSpecConfigExecutor().Client(this).Execute<DescribeSpecConfigResponse, DescribeSpecConfigResult, Descri... | 1 |
fcf4ed2c2b0321dd9fb781ccdc379a29 | 3bcd2a1d4fa3054ac5831214935dd921 | Function for padding spectrograms | if method == "interp":
x = np.linspace(0, full_length-1, full_length)
xp = np.linspace(0, full_length-1, data_to_pad.shape[0])
fp = data_to_pad
return np.interp(x=x, xp=xp, fp=fp)
elif method =="steps":
temp = np.zeros((full_length, 1))
... | 1 |
e0a5f3ed32160895ff40ff98ea60d6f4 | a62ba3c3223242d94efdaa117859355e | BuildMagnet builds a magnet link from an info hash and a static list of trackers. | StringBuilder m = new StringBuilder();
if(getBody() != null) {
m.append("xl=");
m.append(getBody().length);
}
if(hash != null && hashAlgorithm != null) {
if(body != null) m.append("&");
m.append("xt=urn:");
m.append(hashAlgorith... | 0 |
ed50a80a95507b58379ce273a7ae1c25 | 892033f73d997f5668a6ee5815d07a90 | 生成require一维数组文件 | function addRequireConfig(option) {
var mainJs = option.mainJs || 'main.js';
var pathConfig = {};
var mainFile;
return new Transform({
objectMode: true,
transform: function (file, enc, callback) {
var fileName = path_1.basename(file.path);
if (fileName !== mainJs)... | 0 |
b260b0ed590c0b9725e69d426edcb1cb | c05066b5f3de020b0add3e16a90a1306 | convert all state abbr to full | for key,val in stateAbbr.items():
if val == abbr:
return key
return -1 | 0 |
55a0f13c93d9f5750160ec6c3e5ba139 | 580792fcfa73c0c95d80387196a19346 | 检查是否抓到物品 | {
bool haveItem = false;
if (currentQuest != null)
{
if (currentQuest.GetType() == typeof(FindingQuest))
{
FindingQuest temp = (FindingQuest)currentQuest;
haveItem = temp.IsCollect(MapID,position);
}
}
return... | 1 |
14b365b985f60b5ed35ee31cbca6ccb9 | 16de82df67c18b5fe4d64051d175191c | Given a clothing item the user wants to purchase, also recommends other clothing items that share
a lot of similar traits. | class item_similarity_recommender_py():
def get_similar_items(self, item_list):
user_pieces = item_list
all_pieces = self.get_all_items_train_data()
print("no. of unique pieces in the training set: %d" % len(all_pieces))
cooccurence_matrix = self.construct_cooccurence_matrix(
... | 1 |
f8773ef009191aaa38c98776a7a56d88 | e5eb05991b4d968bded400fafb4ec87b | Make the enemy invulnerable for a set amount of time | public class Damageable : MonoBehaviour
IEnumerator makeInvincible(float duration)
{
float startingTime = Time.time;
isInvincible = true;
while (Time.time - startingTime < duration)
{
if (spriteRenderer.material == originalMaterial)
spriteRenderer.material... | 1 |
33a4cb1ebd4d3425e1681226ec492516 | 1f34a9cc03f68d8d79eb200a26aad25c | Sets the reporet count. | public class AgmeReportHeader{
public void setReporetCount(int reporetCount) {
this.reporetCount = reporetCount;
} | 1 |
5abb0311377bfe67ad2b36a63c55f0e8 | 2b3841bc1f2e4fa187a16f235cbd6588 | ● 卡片數量 | class Deck
def cards_left
@cards.length
end | 1 |
98572e14e324345d37c7352d01bdce2b | 9a0979892e4aa4115a27c5341c470870 | should not happen IRL, would be a broken vcard | class LOMVCard(LRMElement):
def PrettyPrint(self):
return False | 1 |
8829001fb8c8af5b23400798d6e05ac2 | 0e29abc44b0bc7ae3b4589374cf4338c | Downloads the latest RSS feed from the City of Edmonton Events page.
Returns:
A string containing the RSS XML feed. This string will need to be parsed
by an XML parser in order to be useful. | def load_rss():
response = requests.get(RSS_FEED_URL)
return response.content | 1 |
27815a68d16346ec7a8d5ef41e3fe96d | 081fefd9236a177c6e445d49a96dd984 | Prevent Tank Shell explosion suicide | Bullet.__init__(self, lifetime, alpha, beta, x, y)
self.h = h
self.w = tank_shell.get_width() / tank_shell.get_height() * self.h | 0 |
6cd3eddcfe89ac31d89d31aafbd43aaf | 9464fc71fc9e5d41399baf4c51b00388 | Determine the filtered media pool for a user. | class GroupGuessingGame(GuessingGame):
async def _determine_filter_pool(self):
group_ids = self.host_user.gg_filter_group_ids
groups = [await Group.get(group_id) for group_id in group_ids]
affiliations_ = []
for group in groups:
affiliations_ += group.affiliations
aff... | 1 |
30deaf2390781a7dd2cda2147615571e | a250e6dfa454aa884d5fe589c2134858 | Helper object that can be used to propogate server trace state. Typically over different threads. | )
{
m_bIsTracing = TRUE;
m_bIsStoringTraceData = FALSE;
ZeroMemory(m_threadHistory,sizeof(m_threadHistory));
m_nextThreadIndex = 0;
m_nextThreadColor = 0;
m_lastProcessId = 0;
m_LastLogEndedInNewLine = TRUE;
m_hWnd = NULL;
m_hStatusWnd = NULL;
m_hControlWnd = NULL;
m_hWnd... | 0 |
8ca8c737f02e193dbff64743fb9a77c4 | 78f76ed4fc2130f2fdfa91b6d28ab5be | Shoot a bullet from an entity | {
Vector vecOrigin = ptr->vecEndPos - vecDir * 4;
if( pev->takedamage )
{
AddMultiDamage( pevAttacker, this, flDamage, bitsDamageType );
int blood = BloodColor();
if ( blood != DONT_BLEED )
{
SpawnBlood( vecOrigin, blood, flDamage );
TraceBleed( flDamage, vecDir, ptr, bitsDamageType );
}
}
else
{
... | 0 |
6c591412563b55e9353df73bf2111375 | 99597db344f4fe60f4c9aa2d79b3f288 | Test if deletion works and if it considers if there are dependencies to other objects | def test_deps_delete():
state = reactive({"foo": 5, "bar": 6})
state["baz"] = 5
assert len(proxy_db.attrs(state)["keydep"]) == 3
del state["baz"]
assert len(proxy_db.attrs(state)["keydep"]) == 2
state.popitem()
assert len(proxy_db.attrs(state)["keydep"]) == 1
state.clear()
assert len... | 1 |
7cd16091226678159692e17cfdbeb53f | 5dd101da466e1f47b63bcff467e0fc9a | Set flags in an object of type of_meter_features_stats_request. | static int
cstat_flags_set(int unit, bcm_pbmp_t pbmp, int rx_tx, int counter,
args_t * a)
{
int flags_index;
bcm_port_t port, dport;
uint32 count_index;
uint32 start;
uint32 end;
if (!ARG_CUR(a)) {
cli_out("Error: No input triggers\n");
return -... | 0 |
678edaa32e3858dec38d34679a8326a2 | 8b438bb5ae8b1edd90b6aba2a5694a47 | 获取收支统计金额 incTotal:收入 expTotal:支出 | "WHERE (accounting_type = '收入' AND accounting_account_first_class = :accountingFAccount AND accounting_account_second_class = :accountingSAccount) " +
"OR (accounting_type = '转账' AND accounting_account_2_first_class = :accountingFAccount AND accounting_account_2_second_class = :accountingSAccoun... | 0 |
9cbc2f1b0421253f8e096c43f04a81d6 | 48966364cedb45662663d6b34b0be194 | This is used to run operations. | void runOperation() throws IOException; | 1 |
744d3c718ac26c20500a60d25778e90d | cf77f33149ccd6744fe588ab7317af72 | Create content values for the trailers of the movie currently displayed | if (StringUtils.isNotBlank(container.getYear())) {
movieDate.setText(container.getYear());
} else {
movieDate.setText(R.string.details_view_no_release_date);
}
if (container.getDuration() != null) {
movieDuration.setText(
String.for... | 0 |
fb34a1dc40e6abf5a52abc7fb2c7d582 | 673a2549af38986a0376c19a2f6915aa | Takes a board object and returns all possible moves (where one move may involve
several steps and only ends once a players turn is over) in a neatly ordered array | function neatifyAllMoves(board) {
let validMoves = board.validMoves;
let canCapture = validMoves[0];
let allPossibleMoves = [];
for (let moveInfo of validMoves[1]) {
let initialX = moveInfo[0][0];
let initialY = moveInfo[0][1];
let finalX = moveInfo[1][0][0];
let finalY = moveInfo[1][0][1];
... | 1 |
75e8724e3a32e6a286fc3f188ea9e68a | e7ad2a98849f5e64a7fd4059effe2800 | Suspend function: Wrapper for readCollection | namespace Arango.Client
public class ATransaction
public ATransaction ReadCollection(string collectionName)
{
_readCollections.Add(collectionName);
return this;
} | 0 |
4526217fef8432a9e9025f2c6f77f0af | 94bac84e91abf3921acd915f129e8a3c | Sets EventListeners For Bézier Calculations. | this.canvas.addEventListener('mousedown', (event) => this.connectDots(event), false);
this.interface.dotsConnectInput.addEventListener('input', (event) => this.changeConnectedDotsCount(event));
this.interface.dotsColorInput.addEventListener('change', (event) => this.changeLineColor(event));
} | 0 |
ddb3d344339e20ba1bfe2dc996493cc9 | df89110556c96f918ef59e9287719e78 | 使用单引号包围元字符串 | namespace RZ
[ExecuteInEditMode]
[DisallowMultipleComponent]
[RequireComponent(typeof(Text))]
public class StringTools : MonoBehaviour
public static string InQuotes(string s)
{
return "\"" + s + "\"";
} | 0 |
2e6de262bd363eb2680c14c8de7bbed7 | 7214b79f4a2ac1ceda6bde0e1ca7d001 | Acts like `Array.prototype.concat` but does not create a copy of the original
array. It extends the original array and return it. | export class ObservableArray<T> extends ObservableVariable<readonly T[]>
concat(...items: (T | ConcatArray<T>)[]): T[] {
return this._value.concat(...items);
} | 0 |
5f6941bb7fdc6a061f43eb77216ee6ea | cb7e5e482bca0307cfef95d99af7b796 | Checks if the image is too blurred to be processed | var pixelError = 1
pixelError += (width.coerceAtLeast(height) / 1000f).roundToInt()
return (mMaxResultImageSizeX > 0 && mMaxResultImageSizeY > 0
|| abs(mCropRect.left - mCurrentImageRect.left) > pixelError
|| abs(mCropRect.top - mCurrentImageRect.top) > pixelError... | 0 |
615873a1d41dcf4acc9fec610d46d2d1 | e0ff9455d73a6ad9357746f05a87f415 | \brief Returns true if this entity does not react to the sword.
If true is returned, nothing will happen when the hero taps this entity with the sword. | namespace Solarus
bool Hero::SwordTappingState::can_sword_hit_crystal() const {
return true;
} | 0 |
7f4f78cb6f6f4f652fb381cf51ea88c0 | b9009ad4f2338da261ab7df0f1182d67 | execute update check (if not already performed) then return result | {
if($this->use_prepared_statements != 'Y')
{
return parent::_executeUpdateAct($queryObject);
}
$this->param = $queryObject->getArguments();
$result = parent::_executeUpdateAct($queryObject, $with_values);
unset($this->param);
return $result;
} | 0 |
158a5981f33a5dde7906436e3695dbda | 4856f3beaf8901e2b000c0c0316260d6 | 根据条件查询业务通知单对应的工单表 | NotifyCustomerConditionDto queryNoticeList(String waybillNo); | 0 |
977b67e6f995ddefa85145ff69a86be8 | b060908ed7297f2581f95f2dfd3777f1 | Methode appelee apres un clic droit / Ajouter apres sur l'un des elements de
la tournee | class TraiteBean extends BaseBean
public function actionSpecialeParTour() {
} | 0 |
f2ef1af3fced059cbcd0a401d2371973 | 838664977dcc15612bf14cc9ae745c8b | Creates a user in the Users DB (created on first time start up) | public class Registration_Page extends javax.swing.JFrame
public void createUser(String firstName, String lastName, String username, String password) {
try {
connectionObj = DriverManager.getConnection(dbString, userName, dbPassword);
statementObj = connectionObj.createStatement();
... | 1 |
4389a00eb106cecb73ec8297bf412220 | 65b9974da35c504570f5d9aebfe47aca | Removes the chart that displays the heart rate chart. | public class ChartActivity extends BaseActivity implements ScannerFragment.OnDeviceSelectedListener{
private void disconnectToHeartRateService() {
heartRateServiceFunction = null;
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN_MR2) {
if (heartRateService !=... | 0 |
f55a7357b0a04fdfae05fd0865d0f812 | 2d9b38ee0f56bfaf67f66fc3d8472fa9 | Refreshes the banner ad regardless of whether autorefresh is enabled or not. | namespace Heyzap public class HZVideoAd : MonoBehaviour
public static void Fetch() {
HZVideoAd.Fetch(null);
} | 0 |
b74a548db5c2010f07b932b8fea768f1 | 8a9fc07b5233d8cf2ccb3ac186addb14 | Internal representation of the sort portion of mergesort. | if len(nums) < 2:
return nums
else:
mid = len(nums) // 2
left, right = nums[:mid], nums[mid:]
return __merge(__merge_sort_internal(left), __merge_sort_internal(right)) | 1 |
99bd1dd420bdaf5b60c2a1ae35620922 | 732c774aa39d1d821eac6e68625dd409 | Convertit une coordonnée exprimée en fraction de l'étendue (0 à 1) en espace-écran. | public class AreaPicker extends View
private float fracToScreenCoord(float fracCoord, float screenRange) {
return fracCoord * (screenRange - 2 * padding) + padding;
} | 1 |
7dc947940b30827dee6649780d5fbd0c | 85de774c6c789a830df1b7362c4291ae | Returns the detected languages files in the language directory | {
string[] extensions = new[] { ".dat" };
if (!Directory.Exists((_basedir + LOCALE_DIR)))
return new string[0];
return Directory.GetFiles(_basedir + LOCALE_DIR, "*", SearchOption.AllDirectories)
.Where(e => extensions.Any(a => a.ToLower() == Pa... | 1 |
11338bf078bf5a0072da92730aa65e1d | 8af2ad8998c892010c692b705be8474c | Method for initial setup reading from the config files | config = ConfigParser.RawConfigParser()
config.read("chatterd.conf")
global PORT
global Allow_duplicate_usernames
global Welcome_message
PORT = config.getint("Server Settings", "port")
Allow_duplicate_usernames = config.getboolean("User Settings", "Allow_duplicate_usernames")
Welcome_message = config.get("Serve... | 1 |
c9f59dfc45e69c2959ccf3d5cfe8a968 | 692563989b32d4b65eb82f27069f9837 | Get the maximum unavilable pod budget. | public class AddProjectRequest
public double getMaximumBudget() {
return maximumBudget;
} | 0 |
770251f44fa233fa7a1aebac2b8c6c2b | 1802de15b412456809114b63ed9cd0a0 | 将当前项目向下移动 | void AnimationForm::slot_itemMoveDown()
{
QModelIndex index = m_pEditData->getSelIndex();
if (!index.isValid())
{
return;
}
ObjectItem *pItem = m_pEditData->getObjectModel()->getItemFromIndex(index.parent());
if (!pItem)
{
return;
}
if (index.row() == pItem->childCoun... | 1 |
c0813e4756c86ee213fac803d3591ff5 | b0ef6593e3d1adef4f83479c91612192 | Gets a node with the given name. Returns null if not found. | public class Graph
public Node getNode(String name) {
return nodes.get(name);
} | 0 |
806777880408befdd069a49cac5e1959 | d7101d5ec868604c04e0f79a78a45f3f | Gets the inheritedFrom property value. If this content type is inherited from another scope (like a site), provides a reference to the item where the content type is defined. | {
Value value = (Value)GetInheritedValueInstance();
if (value != null && value.ExtendedValues != null)
{
return value.ExtendedValues;
}
return null;
} | 0 |
09aee488b4b5e5583363dd8dd1814738 | 999b4c3f110d3c5152475ec7aab8b2b4 | function to recalculate the total with overdraft applied | int calculate_with_overdraft(int newTotal, struct Account account){
int existODApplied = account.amount/500;
if (existODApplied>0){
existODApplied=0;
}else{
existODApplied=abs(existODApplied);
}
int overdraftMultiplier = (abs(newTotal/500)-existODApplied) + ((account.amount>=0) && ne... | 1 |
be6181e76e940616cd533ba69baaea6a | 5059e7ae582397238c99b5e61ce36c2b | 查询所有小区月租车用户信息 | public class JzdqJddylMainDao
public List<JzdqJddylMainUser> queryAll()
{
List<JzdqJddylMainUser> list = null;
try
{
list = mDao.queryForAll();
} catch (Exception e)
{
e.printStackTrace();
}
return list;
} | 1 |
4d28346b499096af8275c45f958b93d8 | 54d3ac872cb5df70c228b1083f23900b | 获取与当前登录的学生的所有一同入学的综测成绩 | conn = new JdbcConn().getConn();
String sql = "SELECT * FROM score WHERE sid in" +
"(SELECT sid FROM student WHERE classid in" +
" (SELECT classid FROM class WHERE (cteacherid =? or cchinaid=? or cmathid=? or cEnglishid =? )))" +
"and scient =?;";
try {
ps=conn.prepareStatement(sql);
ps... | 0 |
ecc36dc2cc47788ce1f96cd66eecf74d | 7857eb70396fc7f9850be7044729dd56 | Cleanup all UART when system cleanup | static void native_tty_cleanup_uart(void)
{
DT_INST_FOREACH_STATUS_OKAY(NATIVE_TTY_CLEANUP);
} | 1 |
ff807f666be6754a745e5f8ef1740263 | 61002fcc24416483a264a189efe7e1db | If true is returned, the buildable is considered "rotatable"
and it's state can be changed with r and shift + r. | boolean isRotating(); | 1 |
cad4319f9e621ca245f4020b85dfc90f | 60ddd0410d83d56fa63819ce9f3fb72b | Fonction ... | function ditBonjour()
{ alert("bonjour !");
} | 1 |
7a3269ee635f6ff260a98ae7c422b99c | 69f18664b03bb0cd993ea51e52ab7b72 | Clear any necessary caches when an Undo or Redo occurs. | {
ISubDeclaratorUtils.CriticalSection.WaitOne();
try
{
foreach (IModelElement modelElement in Impact)
{
modelElement.ClearCache();
}
}
finally
{
ISubDeclara... | 1 |
1892a8706bcde12e5552d13a23620313 | 42cd355772b5d6abed30dc5aac087817 | change account info | const { id, email, username } = ctx.request.body;
try {
await Account.findByIdAndUpdate(id, { email, 'profile.username': username})
.setOptions({ runvalidators: true });
return ctx.body = {
"result": true,
}
} catch (e) {
... | 1 |
60acb9260b1952c57e95c4130090fa2b | f34b93e37fc5677ae3140c2a9c09c7a1 | POST /diaries | namespace exchaRazor02.Pages
[Authorize]
[AutoValidateAntiforgeryToken]
public class SettingsModel : PageModel
public async Task<IActionResult> OnPostAsync()
{
if (!ModelState.IsValid) return Page();
string id = HttpContext.User.FindFirst(ClaimTypes.NameIdentifier).Value;
Diary diary = awai... | 0 |
c817421a068e76febeb80056c46b1b08 | 1fb2159b25eeb37b27b05b02126bf02e | Maps the keywords of bibtex record to portfolio "keywords" | return function(hubs) {
const lowerTerm = term.toLowerCase()
const keyValues = new Set()
hubs.forEach(hub => {
const datasets = hub.data.datasets
const samples = hub.data.samples
toList(datasets).forEach(d => {
const item = {
...(d.ihec_data_portal || {}),
.... | 0 |
4ce3b89fffc3de44d65ff58c98e9231b | 2d29049617702b2f6b55f55d0b0e873c | 订单创建成功时,相关处理业务 | public function onAfterCreate($order_id); | 1 |
b94a1eec65975ca54005effd542af871 | e1bb46b0d7d9f5e80c8bdd7949b9004f | 设置是否进行自动开火 | self.m_autoShoot = b
if self.m_cannonPoint.x == 0 and self.m_cannonPoint.y == 0 then
self.m_cannonPoint = self:convertToWorldSpace(cc.p(self.m_fort:getPositionX(),self.m_fort:getPositionY()))
end
if self.m_Type >= g_var(cmd).CannonType.Laser_Cannon then
return
end
if self.m_autoShoot then
local... | 1 |
c0c0646593323efd53cd7aa55b84e088 | f9d6a810d64b5cf99c3d34b85ca45843 | 将NavigationBar 添加到父布局中 | void attachParent(View navigationBar, ViewGroup parent); | 1 |
ad0482dd4b28adf1aee413901ef44ed5 | d92af18a90c24468bcdccde4823025bc | Verifica se o voo existe | {
using (tecAirlinesEntities entities = new tecAirlinesEntities())
{
var i = entities.Aeronaves.Find(id);
if (i == null) return false;
else return true;
}
} | 0 |
c8d837e9c025284f26902ef090fa642d | 05b058dddee8dab440a93c9ad4fcdd9e | 取得 N件统一价的 obj_ident,product_id 由小到大 | qs = cls.objects.filter(in_active=True).order_by('-modified')
if max_age or min_age:
if max_age is not None:
qs = qs.filter(age_max__gte=max_age)
if min_age is not None:
qs = qs.filter(age_min__lte=min_age)
elif category is not None:
... | 0 |
44381a32f7c8d35c8918356f03df987c | 775106483788d88a04161b3b7e67562d | Calculate the custom cnn root-mean square error, which measures the
similarity between the original abundance fractions and the predicted ones.
Zhang, Xiangrong, Yujia Sun, Jingyan Zhang, Peng Wu, and Licheng Jiao.
"Hyperspectral unmixing via deep convolutional neural networks."
IEEE Geoscience and Remote Sensing Lette... | class Evaluator:
def get_eval_wrmsd(self, functional):
def eval_wrmsd(parameters_x, parameters_css, parameters_cos):
xc_energies = self.formula_matrix @ self.eval_xc_energies_for_mols(
functional,
parameters_x=parameters_x,
parameters_css=parameters_css,
parameters_cos=pa... | 0 |
560c9ac1f1780925297d541f76c835b7 | 85ddda8b3bde74340ee6770bc2196217 | 根据nodeName获取nodeId | public class HongbaoService extends AccessibilityService
private String getNodeId(AccessibilityNodeInfo node) {
Pattern objHashPattern = Pattern.compile("(?<=@)[0-9|a-z]+(?=;)");
Matcher objHashMatcher = objHashPattern.matcher(node.toString());
objHashMatcher.find();
return objHashMatche... | 0 |
24c610a9f3fb45b7545b8232f9cdb1fd | de521047c5c27d2fc918d8a7a43f9ee2 | Método cuando se pausa la actividad, se desactiva la música, si se pausa justo cuando el camión estaba avanzando se para también el sonido | public class MainActivity extends ActionBarActivity
@Override
public void onPause() {
super.onPause();
mv.stopPlayback();
} | 1 |
5e5ce6f67ea046dbf91968212927aa43 | 4479882d6cfc02f70f7d5e8d6cea4f4e | Data provider for the password match test. | {
return [
['user1', '', 'The password field is required.'],
['', 'user1', 'The username field is required.'],
['hello', 'password', 'The selected username is invalid.'],
['user2', 'user2', 'The selected username is invalid.'],
];
} | 0 |
44afbe528584d0a8b270359c3adf9e1e | 264d16cc4300dbdfee471af3f5d41a98 | 用户操作类 | UserService userOperations(); | 1 |
6820ef0f2eb093407942608b888cfcb6 | 3e3e39d96a9bc3530e709b3171ff4239 | 获取每一种贵金属种类的最新详细信息 | class infoController
static async getGoldInfo(ctx) {
let params = Object.assign({}, ctx.request.query, ctx.request.body);
if (!params.kinds) {
helper.responseFormat(ctx, 412, "查询失败", { info: "参数缺失(kinds)" });
logger.info("getGoldInfo", "response:", { info: "参数缺失(kinds)" });
} else {
const ... | 1 |
04aad8786a347b91b2d2ca8924e9a938 | d7e33ade6214bc3eced83d3d3b27bd20 | Registers call-back method for Azure ServiceBus message pump | namespace TBUNamedPipe
public class PipeClient
[DllImport("TBUNamedPipe.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Unicode)]
private static extern void RegisterOnPipeClientSentCallback(PipeMethod aCallback); | 0 |
94c00bc4e67cbc50580008e67d9d5a96 | 4058412d2e4a2885d128684b62e3bc61 | 绑定数据库中配置的服务 | class Bootstrap extends Yaf\Bootstrap_Abstract{
public function _initService(Yaf\Dispatcher $dispatcher){
$service = \Service::getInstance();
$service->register('dbo', function(){
$db_config = $this->_app_config['db'];
$db_config['option'] = [
\PDO::ATTR_CASE => \PDO::CASE_NATURAL,
];
return new \Db... | 1 |
f3d0fc69d364c58044ced4acb09649f9 | d17cf3e9940f38e1f88f1022febcf4c6 | Get the strings from the input fields, check if they are correct
and display a message if any errors occurred.
Create a Credential with the old password and the users email address,
check if it is valid, if any error occurs the password was incorrect
so display a message, otherwise change the password. | public void onClick() {
boolean isOldNewPasswordConsistent = modifyPasswordPresenter.checkConfirmPassword(newPassword.getText().toString(),
confirmPassword.getText().toString());
if (isOldNewPasswordConsistent){
modifyPasswordPresenter.modifyPassword(oldPassword.getText()... | 0 |
d3ca6c5ebc4af88c5efa447fe721609d | 6f95c796d46128156d5ecf2b4eb8957b | Compute signed distances to circular obstacles. | class Environment:
def distance_obstacles(self, drone):
distance_obstacles = np.array([-1] * self.simulator.n_obstacles)
p3 = np.array(drone.coords)
for en, ob in enumerate(self.obstacles):
p1, p2 = np.array([ob[0], ob[1]]), np.array([ob[2], ob[3]])
distance_obstacles[en]... | 0 |
facbf4a980d6053f2680c709e49fcf4c | 7d43d6e5ba65e778a683e00df3045468 | 查询学生学籍变更信息 | @Override
@Transactional(readOnly=true)
public List<Map> selectStudentChanges(int stuId) {
return this.stuDao.selectStudentChanges(stuId);
} | 1 |
bf4b34c2c7d515c27580381ff23c2620 | e432e6c553fbf525bf19e21e6136a645 | 判断今天是否已经已经发送过邮件提醒 | void sendTodayMail(); | 0 |
7303aae8241b95492c1bcd285f807431 | 8807f154ed0c88d36c83c745d20c4f63 | Returns the meta object for the containment reference '{@link q7dsl.Where#getTopics <em>Topics</em>}'.
<!-- begin-user-doc -->
<!-- end-user-doc --> | EReference getTopic_Subtopics(); | 0 |
00eb037efbb859c9cf497a0ab0849a77 | ad7d9cb90b63af74d135d3bbf7f0e4d6 | Obtener la lista de tareas relacionadas a una categoria | @Dao
interface TaskWithCategoryDao
@Query(
"""SELECT * FROM task
LEFT JOIN category ON task_category_id = category_id
WHERE task_category_id = :categoryId""",
)
fun findAllTasksWithCategoryId(categoryId: Long): Flow<List<TaskWithCategory>> | 1 |
61faa5ddffd3e280785909b0a08d352a | e915c35e2b61c8380f9ac8fc836865d6 | UpdateShare updates existing file server information in Storage Sample Resource Provider | Update withNewSharedAppServicePlan(); | 0 |
fe69f83672702c3a6cb0127b31e69e22 | a609b65e1fb67588b0b01e0bae5fb3c9 | 返回所有distinct的供应商 | $sql = " SELECT distinct storage_vendor_name,shop_company_name FROM doc_contract order by created_at desc";
return $this->dbh->select($sql);
} | 1 |
edbdbdd6d227506b460be973f7e50c1c | 8577cbf4a4879b6a19722edb9f1e12dd | Cause a layer's transformation to be mapped to each node called on. | class Pipeline
map(fn: (file: File) => MapNode.AcceptableResults): Pipeline {
return new Pipeline(new MapNode(this[nodeSymbol], fn))
} | 1 |
66c40363740db73c16fd06d621c31422 | 240cc43a2a5717b05d236dfc6f99a84f | snippet-start:[python.example_code.dynamodb.DeleteTable] | export class Timestream extends PolicyStatement
public toDeleteTable() {
return this.to('DeleteTable');
} | 0 |
f32665ef0ee6eaeb8104a0215b151b07 | 3f1285bd1f8ff73a4c0dbc3b7006f194 | 分页查询所有时间对象 | String hql = "from TimeFrame order by orders";
return queryByHQL(hql);
} | 0 |
c1a7cd78306a02a7b97c40e579115de3 | 7f3b92c5c3283cf32d318dacb28e90bb | Get a trimmed mean value from array, with low and
high percentage ignored. | public class ProcessSpectrum
public static double getMean(double[] v, int i0, int i1) {
double sum = 0.0;
if (i0 < 0) i0 = 0;
if (i1 >= v.length) i1 = v.length-1;
for (int i=i0;i<=i1;i++) {
if (new Double(v[i]).equals(Double.NaN)) v[i] = 0;
sum += v[i];
}
sum = sum / (i1+1.0-i0);
return sum;
} | 0 |
68ebcd29715dd7a90b35b922bd9f9745 | 554332adddcbec087e7a32f8159fc89b | returns if there are still more blocks to render | class BlockInfo:
def has_next(self):
return self.next and not self.next.is_empty() | 1 |
8981d46389bc54681bac0b564ed2131f | b13f0514e8c0b2aeead0fed0a336847b | 返回未完成订单列表 | @Controller
@RequestMapping("/chehang/")
public class Chehang_orderservlet
@RequestMapping(value = "get_uncompleted.do")
public ModelAndView get_uncompleted( ModelAndView mv)throws Exception{
User user= (User) session.getAttribute("user");
List<order> list=new ArrayList<>();
try {
... | 1 |
62defe67bb55a24baf6a3c42cfea4e90 | 8f19a61755c4df2405723074eadb0deb | Returns dict in same format as SDB Notices | class Notice(object):
def to_str(self):
return pprint.pformat(self.to_dict()) | 0 |
3e9dca7c7850a85132477faca0f7c34c | ecea1e808fa6bb899e3de8190a8394c1 | 登出过程拦截器 | logOut(){
axios.interceptors.reject.eject(axiosIns)
} | 1 |
4f196aba236d31fe27e7f228b73e1af0 | 777e5b733211bd8f3beac12d6819fa78 | Generates the PodDisruptionBudget for operator managed pods. | @SuppressWarnings({"checkstyle:ClassFanOutComplexity"})
public class ZookeeperCluster extends AbstractModel
public io.fabric8.kubernetes.api.model.policy.v1beta1.PodDisruptionBudget generatePodDisruptionBudgetV1Beta1() {
return createPodDisruptionBudgetV1Beta1();
} | 1 |
2e40caa39a664eb18d8d926fad739bdc | e6a4ebd4b8b2013162f649b2aa454139 | Establishes a subclass of Command. This is important because commands
are actually classes in CommandSet; their instances are specific
executions of the command, which allows for undo's, and history
management. The block will get run in the context of the new class,
allowing you to quickly define the class completely... | class WLangCommand
def initialize()
end | 0 |
7b3545fca7dc15934882bcb187e4ca88 | 66a5dba5bd3c83521378220e80fa474a | Funcion para asignar variables provenientes del select de metricas | function bindMetricsData(mdata){
$scope.metricdata.currency = mdata[0].currencyCode;
$scope.metricdata.branchName = mdata[0].branchName;
$scope.metricdata.branchId = mdata[0].branchId;
$scope.metricdata.exchangeRate = mdata[0].exchangeRate;
$scope.metricdata.missionPercentageRate... | 1 |
8e5e51c5aad6191e0b8e477cc165147f | ed7700e5e20d39576772686f26da7887 | Turn printing with double width on. | class MessageListener:
def double_height_text(self):
self.__is_double_width = False
send_command(SET_TEXT_DOUBLE_HEIGHT, self.__printer_out_ep) | 0 |
2f5abdd219b252454ad5f06bc016d4c5 | 6bcc322a51570479ab8dcb92b07020d1 | CTIMER4 peripheral initialization | RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM4, ENABLE);
TIM_TimeBaseStructure.TIM_Prescaler = ((SystemCoreClock/2)/1000000)-1;
TIM_TimeBaseStructure.TIM_Period = 1000 - 1;
TIM_TimeBaseStructure.TIM_ClockDivision = 0;
TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up;
TIM_TimeBaseInit(TIM4, &TIM_TimeBas... | 1 |
665263d26975e3b4ddecf36a65fea756 | 8db694d6761b779734b853e559eb03fc | Update the double-tap zoom. | if ( sender != null ) {
double m = mag.ZoomFactor;
if ( e.Delta > 0 ) {
m -= 0.02;
} else if ( e.Delta < 0 ) {
m += 0.02;
}
if ( m <= 0.1 ) {
m = 0.1;
} else if ( m >= 1 ) {
m = 1;
}
try {
mag.ZoomFactor = m;
} catch {
}
}
} | 0 |
12d1a2c38a90c47472c55aff09abf544 | 98361b472a24504197c8cf21bca91287 | shutdown core (the task management system), which cancels any tasks in progress | progressMessage("Shutting down");
if (isShutingDown()) progressMessage("Was already shuting down");
shutingDown = true;
abortTasks();
knownObjects.clear();
} | 1 |
b6c5fc43cda7d3190bea7321001d6a87 | 476f1b14d40cb33f668dfe6da55054a9 | Get publicDs | class CreditPackages extends \Diagomail\AppBundle\Entity\CreditPackages implements \Doctrine\ORM\Proxy\Proxy
public function getPublic()
{
$this->__initializer__ && $this->__initializer__->__invoke($this, 'getPublic', []);
return parent::getPublic();
} | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.