query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
945aa59737d23a3c633bb5d2a3212e79 | f537cb7a1a7e179cdc25172bd5666f9d | Handles clicks on the start button in Welcome screen. | namespace Synthesis.States
public class DefaultSimulatorState : State
public void OnStartButtonClicked()
{
string selectedField = PlayerPrefs.GetString("simSelectedField");
string selectedRobot = PlayerPrefs.GetString("simSelectedRobot");
if (Directory.Exists(selectedFiel... | 1 |
9a6330a8d304ebc1f3b5e20aa81c7f47 | 8df8eeac7362710679797ff06496dfe4 | Inserts a process and its IO Burst amount at the end of the linked list of processes in IO burst mode | {
pcb* temp;
temp = (pcb*)malloc(sizeof(pcb));
L->num++;
if(L->head == NULL){
L->head = newpcb;
newpcb->next = NULL;
return;
}
temp = L->head;
if(temp->next == NULL){
if(temp->io_time <= newpcb->io_time){
temp->next = newpcb;
newpcb->next = NULL;
}
else{
newpcb->next = temp;
L->head = n... | 0 |
081d39053c156684ca14d7da9a91d497 | 982df052efdb08d3fedb7caaf78ef6d5 | esta funcion es la que cambia del juego al menu y guarda todo el progreso | {
speed = PlayerPrefs.GetFloat("PlayerSpeed", speed);
PlayerPrefs.SetInt("PlayerHealth", health);
PlayerPrefs.SetInt("Level", level+1);
PlayerPrefs.SetInt("Points", points);
switch ((level+1)%5)
{
case 1:
PlayerPrefs.SetFloat("PlayerSpeed"... | 0 |
c3790e48a5bec2491de7d28e949889d0 | eb7c9a28ea10b63976b00fc6eb85c188 | Delete Event Control from Event Controls list | namespace MCom.BankAnywhere.Framework.Core.Registration
RegistrationResult DeleteBankEventControl(
ISecurityContext context,
int bankId,
string eventName); | 1 |
f6a2a90015ba65c73d06fc49d22b6ea4 | 4a8e97f790908ee374f9527f40b50602 | Returns true if field paragraphId is set (has been assigned a value) and false otherwise | boolean isSetParlay(); | 0 |
dbc952bfd47c221a62927f856800a774 | 5c2b2b55a18d34dd9aa736509f4b5d79 | Concatenate a list of DatastDict objects sharing same splits and columns. | from functools import reduce
dfs = align_dataframes(*dfs, join=join)
values = np.concatenate(tuple((x.to_numpy() for x in dfs)), axis=1)
columns = reduce(lambda x, y: list(x)+list(y), [x.columns for x in dfs])
return pd.DataFrame(values, index=dfs[0].index, columns=columns) | 0 |
2dd7f76c9e4d5c8c8ce0ee23c1e389df | 8a2c97206d8d3d5693e3c3d9adbae216 | The number of years the programmer has been coding | public class MastersStudent extends AbstractStudent implements Cloneable
public int getMyYears() {
return myYears;
} | 0 |
212baa30a8ef30f526a25dfa40f80bdf | 364ed53d8dd13da259c57f8e903c92c8 | Maps the interfaces of the provided <paramref name="implementationType"/>. | {
if (typeof(TImplemented).GetInterfaces().Contains(typeof(TInterface)))
TypeMap.TryAdd(typeof(TInterface), typeof(TImplemented));
else
throw new ArgumentException("Not Implemented",
string.Format("{0},{1}", type... | 1 |
fa7ef5cf8d037654b59e702c07c00842 | 0c71710bf4684e234a9f0d3b270df7e9 | check if the VM execution state has changed. Useful on resume. | public class ResourceContext
public boolean hasChanged() {
return (Boolean) executionContext.get(getKey(HAS_CHANGED_KEY));
} | 1 |
c41b79f883d67c137ec5e376c2e35f3c | 0209f3c37cd9e151a5b4aa72395027ab | # The dropping of highly collinear variables, based on Variance Inflation Factor: | backwardElimination <- function(x, sl) {
numVars = length(x)
for (i in c(1:numVars)){
regressor = lm(formula = Profit ~ ., data = x)
maxVar = max(coef(summary(regressor))[c(2:numVars), "Pr(>|t|)"])
if (maxVar > sl){
j = which(coef(summary(regressor))[c(2:numVars), "Pr(>|t|)"] == maxVar)
x = ... | 0 |
ed0a8c723260d03573e95a9f824e7ddd | 06d29d8e2a564f47e68c08284c4109cd | Декодируем изображение и записываем его в файл. | with open(file_name, "rb") as f:
imgdata = base64.b64decode(str(f.read(), encoding='utf-8'))
file = open('convert.jpg', 'wb')
file.write(imgdata)
file.close() | 1 |
2a4b871f28e0889877ab9b0e7d13e086 | d54e29875fc05bc91ec118ac25d57a77 | Test signal set management. | fprime_test_api.send_and_assert_command(
"SG4.SignalGen_Settings", [1, 5, 0, "SQUARE"]
)
history = [0, 0, 0, 5]
pair_history = [{"time": 0, "value": value} for value in history]
info = {"type": "SQUARE", "history": history, "pairHistory": pair_history}
fprime_test_api.send_and_assert_com... | 1 |
be9e0a6ac1a64672bb7b2fe2c4ecfcb0 | 27a8b4e0d95588ce4d257d4ddc40c784 | Back to the datasources list. | if (this.source && this.source.id) {
this.router.navigate(['source', this.source.id]);
} else {
this.replaceSource(false);
}
} | 0 |
b5e7d4483e01db4c9ee2149e01dd8e5e | 5e3a8f885837e50ca283ce84c333d9b6 | for users to input information about PCB (process order, arrival time & burst time) | cout << "\tEnter the Number of Periodic Tasks : ";
cin >> NumOfPTask;
cout << "\tEnter the Number of Aperiodic Tasks : ";
cin >> NumOfApTask;
cout << endl;
cout << "\t주기 Task의 정보를 입력해주세요" << endl;
for (int i = 1; i <= NumOfPTask; i++) {
cout << endl;
int ctime, p;
cout << "\tPeriodic Task " <<i<<" Computat... | 0 |
bd927715152b6d3a288dce696c38a329 | 96edb30c2ab298c30aae60dc29227c24 | Test the api has machine creation capability. | class DeviceViewTestCase(TestCase):
def test_api_can_create_a_device(self):
self.assertEqual(self.response.status_code, status.HTTP_201_CREATED) | 1 |
78e09b4203ffb947340424959d2eaa00 | feaab53ad31272ac15c66c3c453b4513 | 在层表中添加记录,并返回层表记录 | @Service
@Transactional
public class LayerService
public void save(tb_layer layer) {
layer.setId(UUIDUtils.getUUID());
layer.setCtime(DateTimeUtils.getnowdate());
layerDao.insert(layer);
} | 0 |
9d65836ecdf4a2e792eca940064638b1 | f8ac4a9bb91384439d1106b3d58030e5 | Compute radii using the contour method. | from math import pi
img1 = cv2.fastNlMeansDenoising(img, 10, 4, 1)
img2 = cv2.adaptiveThreshold(
img1, 5, cv2.ADAPTIVE_THRESH_GAUSSIAN_C, cv2.THRESH_BINARY, 3, 1
)
img3 = cv2.Laplacian(img2, cv2.CV_64F, ksize=1).astype(np.uint8)
_, cnt, _ = cv2.findContours(img3, cv2.RETR_TREE, cv2.CHAIN... | 1 |
ad957f413d49166034e04b19f9b9d730 | 735703ef8ddacfe6f741815e0b5a50ea | Generates code to exit the monitor on an object loaded on the stack. | {
if (!childCodegen(node, 0, pState))
{
pushNull(pState);
}
if (pState->stackSize > 1)
{
writeInstruction(pState->stackSize-2, pState);
while (pState->stackSize > 1)
instruction8(OC_POP, pState);
}
ASSERT (pState->stackSize == 1);
endBlock(-1, -1, pSta... | 0 |
89bf92c3b9c57b1427c2f2ead91b4051 | f659794ece4cf96aaa9664cc6534f60a | Emulates the end of a horizontal blanking period. | {
g_ticks++;
pokeb(0xB800, 0, peekb(0xB800, 0) + 1);
outportb(0x70, 0x0C);
(void)inportb(0x71);
outportb(0xA0, 0x20);
outportb(0x20, 0x20);
} | 1 |
5d493657b8a95460efd69b628252c78a | fbb984ae6a9fc1145181c107ad781d1e | la funzione crea una stanza all'interno dei valori in input | if(
!empty($numero_stanza) &&
!empty($piano) &&
!empty($letti) &&
is_numeric($numero_stanza) &&
is_numeric($piano) &&
is_numeric($letti) &&
intval($numero_stanza) > 0 &&
intval($piano) > 0 &&
intval($letti) > 0
) {
return true;
... | 0 |
1e70c06a97f8798a3ae8a36424969010 | f350100aa4ab40843b2c296387806ab4 | Resume normal movement speed and toggle Attack off | public class ChargeAttack : MonoBehaviour, IAttack
public void StopAttack()
{
move.ChangeSpeed(move.moveSpeed);
} | 1 |
d340c3efe80d0b5b5ccce6e8b3264a85 | 4fa2003899ec187221872c8b44a2af89 | 保存网页字节数组到本地文件,filePath 为要保存的文件的相对地址 | {
FileOutputStream fos = null;
FileChannel fc_out = null;
try
{
fos = new FileOutputStream(filePath, true);
fc_out = fos.getChannel();
ByteBuffer buf = ByteBuffer.wrap(bytes);
buf.put(bytes);
buf.flip();
fc_out.write(buf);
}
catch (IOException e)
{
log.error(e);
}
finally
{
... | 1 |
10d89fa75c29c6b6528ecac3732a772a | 97143e797e789fb68c7e80780cf903c4 | adapted from Raymond Chen: http://blogs.msdn.com/b/oldnewthing/archive/2005/05/05/414910.aspx | {
LPTSTR Error = 0;
if (::FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
NULL,
err,
0,
(LPTSTR)&Error,
0,
NULL) == 0)
{
}
MessageBox(NULL, Error, L"Error", MB_OK | MB_ICONWARNING);
if (Error)
{
::LocalFree(Error);
Error = 0;
}
} | 1 |
470422e4aaa27b8b2b55d115d006284d | 064eb489a2393b98761e7afc1dd274f9 | ゲーム開始演出(レディー表示) | local node = display.newNode()
node:addTo(self.gameStartEffectNode)
local offsetX = (display.width - 1136) / 2
local layer = display.newLayer(cc.c4b(0, 0, 0, 153))
layer:setPositionX(-offsetX)
layer:addTo(node)
local black = display.newSprite(GAME_HHDZ_IMAGES_RES .. "anim_black.png")
bla... | 1 |
280864e3c9146aef567abc98a59b15b3 | 21255414df1a11476a247593829faf7a | Unwrap timestamps into one nondecresing series | class MatchDF:
def _compute_series(self, matches_df):
assert all(matches_df.startTimestamp
== matches_df.startTimestamp.sort_values().values) | 0 |
bb56fc27406aaddedbee047c14fc519f | e847201f8765f177aa61904922419e62 | runs the prime generator menu | {
if (!Running)
{
StartGenerating();
}
else
{
StopGenerating();
maxPrimeNumberIndex = CurrentPrimeNumberIndex;
}
} | 0 |
d07214b791f025c0178e58637224b4ee | 899115c7c5ad634840e8f2200863507b | Returns the width in pixels of the user interface for the calling SageTV UI context.
the width in pixels of the user interface for the calling SageTV UI context
5.1 | public class ClientSizeHelper
public static native int getClientWidth() ; | 1 |
b586f8f54823651cf7dde94577833ec5 | 4ef8455a412c5485e30a6d63fdb86aed | checks that reader-level statistics are the same | class SpacelabsTestCase(unittest.TestCase):
def test_read(self):
pd.testing.assert_frame_equal(self.spacelabs_reader.data,
self.expected_data)
pd.testing.assert_frame_equal(self.spacelabs_reader_repertion.data,
self.expected_dat... | 0 |
800315369bc0a14062d3291a0940539f | 7a4a4aa3dde12cee225aeb3ae6aae7a0 | turn on/off EAPD according to Master switch | class FeatureManager
public static function setMasterSwitch(bool $value)
{
static::$masterSwitch = $value;
} | 0 |
a9eed30a32e698240c0663d38faf43b1 | 2f855fc141f6e1f6841f193c898439c2 | 设置索引表空间的扩展信息.目前只有Oracle数据库能指定该参数 | public class PMValuePo implements Serializable
public void setEXTEND3(String eXTEND3) {
this.eXTEND3 = eXTEND3;
} | 0 |
16a63f1f0d9afaec460c6505c41662bb | c4932bdd8ca598e5d8edc5d71b33b2bc | Получить индекс ближайшей в сетке ширготы к заданной | {
int fromIndex = 0;
int toIndex = TreePoints.Count;
int selectedIndex = (fromIndex + toIndex) / 2;
CTreePoint selectedTreePoint = TreePoints[selectedIndex];
int counter = 0;
while (Math.Abs(selectedTreePoint.Y - pPoint.Y) > pMaxDiff && toIndex - fromIndex > 1)
{
if (selectedTreePoint.Y > pPo... | 1 |
62e73439b03e07f7a957526e305d8e08 | 5195bb2f4101dbe88013700614770fcb | 鼠标左键实现平移视图功能 | class treeViewApp(QtWidgets.QDialog):
def mouseMoveEvent(self, QMouseEvent):
if QtCore.Qt.LeftButton and self.m_flag:
self.move(QMouseEvent.globalPos()-self.m_Position)
QMouseEvent.accept() | 1 |
82a11bb1951411e2253cc5f4eeaa84f1 | 8d9bc2ba9bf35cc6cb9531146f0f1e65 | 量子コンピュータの回路を作成するためのクラス | self.paulis = paulis
self.qubits = None
if paulis == None:
self.paulis = [] | 0 |
2867f838c0a884fae2d17ca91f5eec58 | 9c03910698e1d04b2cd94934be01b1c5 | Set a callback to run when this entity has been added to physics world. | namespace Xenko.Navigation.Processors
internal class StaticColliderProcessor : EntityProcessor<StaticColliderComponent, StaticColliderData>
protected override void OnEntityComponentAdding(Entity entity, StaticColliderComponent component, StaticColliderData data)
{
ColliderAdded?.Invoke(component... | 1 |
32cfc8d6dd2d633b81f6994fcbfc7270 | 54f32340d6b000c2f4c130eec1e8c8c9 | True for .jar files or exploded directories with Bundle-SymbolicName in their manifests. | public abstract class WebappClassLoaderBase extends URLClassLoader
implements Lifecycle, InstrumentableClassLoader, WebappProperties, PermissionCheck
protected boolean isPackageSealed(String name, Manifest man) {
String path = name.replace('.', '/') + '/';
Attributes attr = man.getAttributes(pat... | 0 |
a2c305abe66e05911b84629b54f019d3 | d6572cf4b2dc8a5c0093354b6c196a3a | Updates the glyph and sends notification to the editor. | function Glyph:OnClick ()
local EditBox = GetCurrentKeyBoardFocus();
if ( EditBox and EditBox ~= NS.EntityName and EditBox ~= NS.CodePoint ) then
EditBox:Insert( self:GetText() );
end
end | 0 |
6e4df27a1be173b67a7ffa365d159f3a | f7fda0cb3f1dc37b08c6df01d3723ffe | Function to get application of the project based on its name
return application instance or null if not found | if (name == null) {
logger.error("AppEcosystem App name is null pointer");
throw new NullPointerException("AppEcosystem App name is null pointer");
}
if (name.equals("")) {
return null;
}
for (int i = 0; i < getTrackNum(); i++) {
for (App a : getObjects(i)) {
if (a.ge... | 1 |
5901879d64f709282cae476cc8cb1b71 | 82bffa0c0d1c7fac938672d98cbfa7c8 | Encrypting msg according to random choice | void encrypt(char* location_1, char* code_location) {
FILE* before_encrypt, * after_encrypt, * encrypt;
char* location_2 = "After_Encrypt.txt";
int ch;
int a[length];
int t;
f_rand(a, &t);
before_encrypt = fopen(location_1, "r+");
if (before_encrypt == NULL) return;
after_encrypt = fopen(location_2, "w");... | 1 |
3e02fbd30382913a4eaab49c7b8a4abd | 8f5fdeb9869c73624677ab44052b1121 | Calculates the number of years as a fraction, using period-based calculation and the given daycount convention. | final DayCount<GregorianCalendar> numerator,
final DayCount<GregorianCalendar> denominator,
final GregorianCalendar periodStart,
final GregorianCalendar regularStart,
final GregorianCalendar regularEnd,
final GregorianCalendar periodEnd) {
... | 1 |
56cb7626f594c17daa0c4feb8e4f0c92 | 1b168eba89aff0310bcfb44af1e20846 | Shows the TextView stating that login has failed | class LoginActivity : AppCompatActivity(), LoginView, View.OnClickListener
override fun showAuthError() {
Toast.makeText(this, "Invalid username and password combination.", Toast.LENGTH_LONG).show()
} | 0 |
acfeac125904bec6ddd1885b6aa2f461 | d440078efa45994b1c95b3519fdee507 | Pops a property and node from the parsing stack | namespace BrightWire.ExecutionGraph
public class GraphFactory
public void PopPropertyStack()
{
if (_propertySetStack.Any())
_propertySetStack.Pop();
} | 0 |
649cff8b9db30cd4a1000b66564ad1b6 | dec10d120108726387c97a36f86cf8ec | 从数据库调取入口函数和js函数 | function getEntry() {
var jsPath = path.resolve(srcDir, 'js');
var dirs = fs.readdirSync(jsPath);
var matchs = [], files = {};
dirs.forEach(function(item) {
matchs = item.match(/(.+)\.js$/);
console.log(matchs);
if (matchs) {
files[matchs[1]] = path.resolve(srcDir, 'j... | 0 |
73a7b029e5987d0cee5293ffe2d9abcf | 06fc2dc760a305e8bc3e35bd6a84a1bd | This method allows the functionality of brining an already existing form to the front of the screen
which allows it to be more interactive to the user since they requested a form that is open
so there is no point duplicating the form. | namespace cs362_pt_project
public partial class DocMenu : Form
private void doc_therapy_Click(object sender, EventArgs e)
{
docTherapyUC.BringToFront();
} | 1 |
a23fd0a3f21968e2fdd9e07d966cf47e | 23d9e9058c4d3a59b50925003a8aea1d | region Board Details screen UI related controls | {
mIVTHeader = (ImageView)view.findViewById(R.id.iv_hearder_image);
mTvHaderTitle = (TextView)view.findViewById(R.id.tv_review_pending_custom_text);
mLinLayCapture = (LinearLayout)view.findViewById(R.id.check_capture_layout);
mLinLayTransactionInfo = (LinearLayout)view.findViewById(R.id.transaction_check_detai... | 0 |
ab35c1081c8ab489d0f4807534b31f82 | cf79fa997a3714367c10ac9328167fb0 | Convert a vector of doubles into a String | {
return("(" + xStr(iVect.x, iNumberOfDigits) + ", "
+ xStr(iVect.y, iNumberOfDigits) + ", "
+ xStr(iVect.z, iNumberOfDigits) + ")");
} | 1 |
8ea3e6cb9fd7563bac022950d59cc53a | 96081d034155dcf1c3a84ac792169795 | **************************GET DATA**************************** | function get_all(){
axios.get('http://localhost:8081/data')
.then(function (response) {
console.log(response.data);
})
.catch(function (error) {
console.log(error);
});
} | 1 |
11d70d6994a0d524e955c20a1a6fdc92 | a2434c37da2b84352d7387b9f3682583 | Clears the pending layout update for this content | public void resetLayoutDirty(); | 1 |
7dcae80dd025297636529d0ce58d968b | 1d86858c08517301e77b26595baa88c8 | Set term id. | class Netterm extends \Magento\Framework\Model\AbstractModel implements NettermInterface
public function setNettermId($nettermId)
{
return $this->setData(self::NETTERM_ID, $nettermId);
} | 1 |
94fbe272ecc4ffebf95ab2e01cc1b643 | 4aad2f088b3e51080c9e8349b44d357c | Get list of all cocktails parsed from data | class Cocktails extends Controller
public function index()
{
return CocktailListResource::collection(Cocktail::all());
} | 1 |
20dbc72841b70f336e7631c02d2f0f09 | 0ed5f081e0190f1fbe480841681d59be | Returns an unmodifiable view of the filtered list of customers. | public class UniqueOrderList implements Iterable<Order>
public List<ReadOnlyOrder> immutableListView() {
return Collections.unmodifiableList(internalList);
} | 0 |
a58b13b705664aba9d0159fe66401d2b | 6506657b64f83ad98c643ea2a5db4d7c | ajax调用:创建挂件 | $this->parse_login(true);
$widget_name = $this->post('widget_name');
$widget_view_file_state = $this->post('widget_view_file_state');
if (!$widget_name) {
exit();
}
$this->parse_webapp_root();
$widget_name = ucfirst($widget_name);
$widget_dir = WEBAPP_ROOT . 'application/widgets';
if (!is... | 1 |
d1c5d1a3ae5d63a1c2f619cae4c4e0ba | a57c03f187b68046dd43a4f689a87a7a | set new leg position in xyz coords | class Leg():
def set_position(self, pos):
self.position_f = pos
IK(self, self.module_info)
self.__set_motorposition()
return 0 | 1 |
012305a38f6aa77936004c5c5ef47131 | e3c8e3a3598b664763b800f08b2bde5e | Calculate relation to proband values once object has been initialized | {
int i;
byte prob;
alloc_entry *table = alloc_kind_table;
for (i = 0; i < alloc_kind_size; i++)
{
if (object_hook)
{
prob = (*object_hook) (table[i].index);
if (prob > 100) prob = 100;
table[i].prob2 = (table[i].prob1 * prob) / 100;
}
else
{
table[i].prob2 = table[i].prob1;
}
}
} | 1 |
d63c1063afc838cfa730e0b4f1256147 | 0f4d1b4b9f1af28fd329885da298e99f | Площадь шара | {
$s = M_PI * pow($radius, 2);
return $s;
} | 0 |
d08daa3550d06154f68e53f9ae6076fe | 60d8beed794689de7fba6fd452ed738f | Set controls available based on field type | print(field_type)
if field_type == "integer":
return ControlEnum.number
else:
return ControlEnum.text | 1 |
79253b39543ed22efcf4b1f77508bd28 | 42a66018511385ad4fe40d1ef5442c47 | Clear Skills
[No longer a button, still used when a new character is created] | public class PlayerSkillsManager : MonoBehaviour
public void ResetAllEquipedSkills()
{
for (int i = 0; i < equipedSkillButtonArray.Length; i++)
{
equipedSkillButtonArray[i].gameObject.SetActive(false);
}
equipedSkills = 0;
multiplierTotal = 1f;
UpdateTotal... | 1 |
ee976ae0aa68b48af975b429f4b02896 | 0b5f87cd2a2b7687a32c60d1458d9a8b | 获取字典表数据(select元素ID,dict_code字典表,默认值) | {
using (var db = new CRMEntities())
{
StringBuilder sbsql = new StringBuilder();
if (table == "TD_SYS_BizOption")
{
if (dictType == "CustomerLevel")
{
sbsql.AppendFormat("sele... | 0 |
6b719a21ac1a26999dff592ef7743a69 | 864a4bc126d9bb03702e2f546995f7f0 | Standard acceptable content type. | namespace osquery class JSONSerializer : public Serializer
std::string getContentType() const { return "mock"; } | 0 |
9486ca8945f92d5cb491d27321fc745a | be7ab4c66b1362813838c0a5e2894b4d | 根据基础数据进行潮流计算 | namespace Calcflow
internal class ShoreFlow : CalculateFlow
public double CalculateShoreFlow(CalculateShoreFlowParam param)
{
this.BeamAngle = param.RiverDischargeInstrument.RiverDischargeBeamAngle;
this.PulseLength = param.RiverDischargeInstrument.RiverDischargePulseLength;
... | 1 |
575e969bfe8d868bc90c4b751fba22e5 | 8529a73f141b8b0035c129be1bcbc722 | Replace all place-holders for the dimensions rule. | repl_pattern=[('T','D'),('B','W'),('(',''),(')','')]
for k,v in repl_pattern:
dim = dim.replace(k,v)
return '(%s)'%dim | 1 |
596fc98b385df7b782c6a3f70d5b4414 | bd853fe5e490444d765ae0741ab1e9a6 | A function to calculate the intersection of two rectangles. Takes base
rectangle and then updates it to include only the rectangles that intersect
with the test rectangle. If there is an intersection, the function returns
TRUE and base now contains the intersecting rectangle. If there is no
intersection, then the funct... | {
if( Empty() || rect2.Empty() ||
left >= rect2.right || rect2.left >= right ||
top >= rect2.bottom || rect2.top >= bottom )
{
result.Clear();
return false;
}
result.left = std::max( left, rect2.left );
result.right = std::min( right, rect2.right );
res... | 1 |
54e945246a54c5b058bf3adb924c92f1 | 8b6763dddd9eee2cda38fad27a73912b | Action listener for activation button. | reset_activation_code()
if self.ok_button.text == 'Submit':
global registration_data
registration_data['msg_type'] = ACTIVATION
reg_activation_code = self.activation_code_textarea.text.strip()
if re.search(r'^[\d]{6}$', reg_activation_code):
... | 1 |
a528a68ab41388008ec36f5e914c432e | 1506aebfd8f185421532a978164de007 | Called by the scheduler at the time a <code>Trigger</code> is first added to the scheduler, in
order to have the <code>Trigger</code> compute its first fire time, based on any associated
calendar.
<p>After this method has been called, <code>getNextFireTime()</code> should return a valid
answer.
is also the same value <... | public void triggered(org.quartz.core.Calendar calendar) {
previousFireTime = nextFireTime;
nextFireTime = getFireTimeAfter(nextFireTime);
while (nextFireTime != null
&& calendar != null
&& !calendar.isTimeIncluded(nextFireTime.getTime())) {
nextFireTime = getFireTimeAfter(nextFireTi... | 0 |
8172692a8ccff4ca45fd381ee33cc005 | d11ad59515c190523dee68e4b61f20b7 | Convert a decimal number to a sexagesimal number | def decToSexagesimal(dec):
a = Angle(dec * u.deg)
return a.to_string(sep=':') | 1 |
ca637806d0016a7f59bd3c1ba9ef2c2e | 3936c7c9448831c505c6d4d2ab4b8090 | Handles the Click event of the UpDown control. | {
var plusAreaOffset = new Rectangle(
this.PlusArea.X + o.X,
this.PlusArea.Y + o.Y,
this.PlusArea.Height,
this.PlusArea.Width);
if (plusAreaOffset.Contains(p) && this.Value < this.MaxValue)
{
this... | 1 |
c09205012dc27dd61911e3a4b00f83c6 | 23dc91a7bbd8d5d9f2d70f79b406da00 | find a new target location, start moving there. | if not self.collision_check(coords):
self.target_coords = [int(coords[0]), int(coords[1])]
self.moving = True | 1 |
1eb783596cfb58a773783173f95bdd15 | bcdd382cb9a2da3239b7ee2876ffff15 | 将sedo上获取的相关交易写入我们的交易表 | {
try
{
TransTradeForm::sedoTransForm();
$data = $this->logic->getSedoList($this);
$this->load->view('trans/sedoList', $data);
}
catch (Exception $e)
{
CommonPage::errorPage($e->getMessage());
}
} | 0 |
e48fff4db36e43f216cd2d8746295871 | 80144ffe510aa8b6cffcc2cc94acef0f | Function that instalises level two | public class Level
public static void levelThree(){
for (int i=0;i<42;i++){
tiles[i][16] = new Path(i,16);
}
makeHouse(3,2,9);
makeHouse(7,25,12);
for (int i=12;i<16;i++){
tiles[5][i]=new Path(5,i);
}
for (int i=17;i<25;i++){
tiles[10][i]=new Path(8,i);
}
for (int i=4;i<Game.getBlockRows()-9... | 0 |
8624dfd8a85bbe66f43a75ef327c46cb | d1352e97ae0b2995bc793f94607b5d34 | Use this callback for commands that need to
be disabled if not supported (yet) | def isDisabled(cmd):
return cmd in g.props and g.props[cmd] == False | 1 |
e60ef725b652b0f22d3c27933177535c | fbadbbdf7bfdb63316a0508bb8acff6f | Disables the scrolling effect on touch devices.
(start code)
disableElastcScrolling();
(end) | function disableScrolling() {
} | 0 |
32220b2770aabb570c3d8ef98c821e1b | ee9cdd26cc573e9f613af8d51e97bdba | Number of bytes per disk sector. A sector
count element, such as 'sectors-read' and
'sectors-written', may be multipled by this
value to convert to a byte count.
Omitted if excluded by 'desired-attributes'. | if (self.clusters_per_mft < 0):
return 2 ** abs(self.clusters_per_mft)
else:
return self.clusters_per_mft * self.sectors_per_cluster * \
self.bytes_per_sector | 0 |
8601cc60bcf4e96f33491b1f40b73de9 | 901a9bd250e203ca58b714cb9926ed51 | 增加一条推荐饮食数据 | void addSetMealDao(SetMeal msg) throws Exception; | 1 |
54f5416798c2f0e9822e6eea470c0038 | 93d22802e14b7f23d0f273a6ff3aec11 | Méthode pour récupérer toutes les commandes d'un utilisateur | class Model_Users
public function commandeUsers($id_users) {
$query = 'SELECT * FROM commandes WHERE id_users = "'.$id_users.'"';
$commandeUsers = $this->db->get($query);
return $commandeUsers;
} | 1 |
ced5f08e5fcb8b46e74764bddd4ae8dc | 8666d4cfdd8d4faaa0bcec040443493c | Display a listing of the pengajar. | class PengajarController extends Controller
public function index()
{
$pengajar = $this->pengajar;
$ujian = Exam::where('id_pengajar',$pengajar[0]->id_pengajar)
->orderBy('created_at','desc')
->get();
return view('pengajar.home',compact('ujian','pengajar'));
} | 0 |
515ccc93cd2d5d7ff362e2b64ffac2bc | d08b900af2491f9143889ee16a6c9873 | Used recursively to traverse through the tree to find the data with
the highest value.
May also be used on a subtree. | class OperationTree:
def findMax(self, root):
if root.right:
return self.findMax(root.right)
else:
return root | 1 |
a3025ffd323a5fe2400519fd8c11e59b | 1dba4e2467be94842fa2c93b657b0b06 | 创建OrderItem数据层接口。 | {
string ClassNamespace = AssemblyPath + ".Shop.Order.OrderItems";
object objType = CreateObject(AssemblyPath, ClassNamespace);
return (YSWL.MALL.IDAL.Shop.Order.IOrderItems)objType;
} | 1 |
2acd8c7f17e5f6ba26b4d632d0d10688 | bb1b2021def18bc24a782b3f4b1dca92 | Gets the representation of a type when used as a C++ function return value. | if (type.compareTo("(none)") == 0) {
return "void";
}
if (type.compareTo("void") == 0) {
return "%struct.TObject*";
}
if (type.compareTo("Int") == 0 && !hasIntClass) {
return "i32";
}
return "%struct.T" + type + "*";
} | 1 |
3005d34c5939d2c03df42aaefed2ed5a | d3c0de705ec9d39972f0b111b1d21822 | 获取鼠标x,y绝对坐标 | getMousePos(event) {
let e = event || window.event;
let scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;
let scrollY = document.documentElement.scrollTop || document.body.scrollTop;
let x = e.pageX || e.clientX + scrollX;
let y = e.pageY || e.clientY + scrollY;
return {... | 1 |
990c4418bb0ba441d2e7dda387816c60 | e617b74eccf55c953f9bdf7681a722e9 | 设置确认文案大小 | public class DistrictPickerView extends BasePickerView implements View.OnClickListener
@Override
public DistrictPickerView setConfirmAndCancelTextSize(int textSizeSp) {
btnSubmit.setTextSize(TypedValue.COMPLEX_UNIT_SP, textSizeSp);
btnCancel.setTextSize(TypedValue.COMPLEX_UNIT_SP, textSizeSp);
... | 1 |
5368264456c9029ce3572b1d887ca02d | a3f871631ffc4e8d249f0208d02689a1 | Highlight some code in language 'lang' using pygments. The class name
in `cssclass` is attributed to the resultant code div. | code = u'\n'.join(code.splitlines())
try:
lexer = get_lexer_by_name(language)
except ClassNotFound:
lexer = TextLexer()
style = get_style(name_only=True)
formatter = HtmlFormatter(linenos=True, cssclass='syntax', style=style)
return u'<div class="highlight">%s</div>' % \
... | 1 |
0381e041c413f1fb068ae7aa931d0e47 | 0b00abcdafcabad31baa666c0e4f7659 | 设置相册ID
此参数必填 | class ImgzonePictureDelete
public function setImgIds($imgIds)
{
$this->imgIds = $imgIds;
$this->apiParas["picture_ids"] = $imgIds;
} | 0 |
df14d9dea41e19dd903d6a6e9e14daaf | 65a15217e567f5e327de45f4ebd90621 | Interceptorを入れる対象のメソッド名を取得する。<p> | public abstract class AbstractCallMethod
extends AbstractClassicTag
protected abstract String getObjectName(); | 0 |
c71c254223b9bd43a60a9bd625c65318 | efc210b402f97c969fe1fe9861290526 | Fibonacci sampling with additional points on the circular boundary | points = np.zeros((2*numPts, 4))
N = 4
surfaceArea = N * np.pi ** (N/2) / (N/2)
delta = np.exp(np.log(surfaceArea / numPts) / 3)
Iter = 0
ind = 0
maxIter = 1000
while ind != numPts and Iter < maxIter:
ind = 0
deltaW1 = delta
w1 = 0.5 * deltaW1
while w1 <... | 0 |
e55c191fe6805446bf5a5ffeb247b2d9 | f5baf5cba89fdabb5622afe8fb4d4d04 | 封装消费记录分析的树形图数据 | qs_Init = table_Initiation.objects.values(
'立项识别码', '父项立项识别码', '项目名称', '分项名称', '项目概算')
qs_Payment = table_Payment.objects.values(
'立项识别码', '本次付款额')
df_Init = pd.DataFrame(list(qs_Init)).fillna('')
df_Payment = pd.DataFrame(list(qs_Payment)).fillna('')
df_sumpay = df_Payment[['本次付款额']... | 1 |
2a3d57b33da9a0896b511ed940ed0873 | 9f420b21769f2e79968d569ef8b7233d | 获取当前选中行的客户全称 | class Orderlist extends Model
public function getCusNameAttribute()
{
return self::getType($this->attributes['cus_id'],$this->get_cusinfo());
} | 1 |
ef89b5e7446505706501536d5f93b5b7 | 0d99198b6d146da8a281c57de801d8d0 | Yields all direct (non-recursive) children of this node | class ScopeTreeNode:
def descendants(self) -> Iterator[ScopeTreeNode]:
yield self
yield from self.strict_descendants | 0 |
8803720aed3f76608d1b0c01c021b07e | ac03ad10c950f4415d7c9fd19d761a8e | Detaches all contained items from the list as if they had been removed, without actually removing
them from the underlying list. | namespace DigitalPlatform.Marc
public class ChildNodeList : MarcNodeList
internal void clearAndDetach()
{
foreach (MarcNode node in this)
{
node.Parent = null;
}
base.clear();
} | 1 |
03a639772f22148cfe4a2a4bfb3ec697 | ff6258988c69c3636816f42291fe668a | Initialization method, assigning the parameters for the algorithm a default value | MeInitParams::MeInitParams()
{
refPadding = 0;
SearchDirection = ME_BidirSearch;
MbPart = ME_Mb16x16;
UseStatistics = true;
UseDownSampling = true;
} | 1 |
f04183702500ef1fe1301a741fa81919 | 7268cc946e2b33c8a05bdfe6b95237e1 | Подсчитывает количество предложений для работодателя по всем его проектам. | int count = 0;
for (models.Department dep : deps) {
count += models.Workers.find("byDepartment", dep).count();
}
return count;
} | 0 |
c68aa81801463a8c09b64940e6ade7f4 | 8f1263790693689cea9b4c2af899e539 | Lance le téléchargement et le comptage des mots,
et retourne le résultat. | tweets = (self.nettoyer_tweet(tweet) for tweet in self.telecharger_tweets())
words = self.lister_les_mots(tweets, mots_max or self.mots_max)
filtered_words = (word for word in words if self.filtrer_un_mot(word))
self.compteur.update(filtered_words)
return self.compteur | 1 |
4fe80053683bf917bbc8b42b834e1e0b | c3c6625798e6ce3f23d98687056d9f03 | 上传文件,具有断点续传功能 | let _self = this;
if (_self.cancelling === true) {
if (_self.onabort) {
let e: Thinksea.Net.FileUploader.HttpFileUpload.AbortEventArgs = {
CustomParameter: _self.customParameter,
};
_self.onabort(... | 1 |
e824beb8c55d18e038e2c1ebab067795 | e448762928671b4d2d1b86589e01dd30 | Request to save current state | click(){
mainWindow.webContents.send('action', 'save');
} | 1 |
96975cc90e789ba2e399d1481152a1ec | f03ea27173478177d8985d6bc361386e | 批量签收组任务 | if self.task_destination:
groups = []
for ids in utils.grouper(content_ids, self.batch_size):
sig_ids = self.task_destination.s(list(ids))
groups.append(sig_ids)
group(groups).delay() | 1 |
778c9802ed94bd8bdbce33f7654920d9 | 30991fb4400af047d9df25e430e35a9e | Returns the Data as an Object array for use in the GUI. | public class Functions_GUI implements functions
@Override
public Object[] toArray() {
return Functions.toArray();
} | 1 |
a1ad30c7d1951c75e113e68282707aa0 | 3e9ea064f553511d37749b7f3d2c2113 | Gets query for [[LessonComments]]. | class Comments extends SqlBase
public function query() {
$query = $this->select('comments', 'ct')
->fields('ct');
return $query;
} | 0 |
1f67c2c63918a9f67157677760c6460e | 378f6a64d4c92a356404031e878883b9 | automatically scroll to top of page every time a new component is instantiated | class Terms extends Component
componentDidMount() {
console.log('Component did mount!');
window.scrollTo(0, 0);
} | 1 |
448c91ea10c74b9ee46df5bd67d66556 | c3f75e4f747d1274218cc1002cc4af1e | Add the pocket center as sphere. | eesphere = gm.StaticGeometricModel(name=name)
if rgba is not None:
gm.gen_sphere(pos=self.jlobject.joints[-1]['linkend'], radius=.025, rgba=rgba).attach_to(eesphere)
return gm.StaticGeometricModel(eesphere) | 1 |
fa75ce4dc27c33ec2784bc053a98bb50 | 47fa880718732a388024b2f2166fd8fd | calculates the weightings and the positions for Gauss-Legendre quadrature. | def get_gauss_legendre_weights_times(t_max, num_grid_points):
return gquad.gauss_nodes_weights_legendre(n=num_grid_points, low=0, high=t_max) | 1 |
766f8bace09823a26f5699cb54654fb0 | a766510d649bc45d32950c729d11c7a3 | 增加消费总额 | class MemberAccount extends BaseService
public function addMmemberConsum($shop_id, $uid, $consum) {
$account_statistics = new VslMemberAccountModel();
$acount_info = $account_statistics->getInfo(['uid' => $uid, 'shop_id' => $shop_id, 'website_id' => $this->website_id], '*');
$data = array(
... | 1 |
bb154ef6cd63c0d7ddf132a5788fd085 | cc74676f7322af089d90b6f91870fb25 | GET: api/HotelComments | namespace HotelServer.Controllers
public class HotelsController : ApiController
public IQueryable<vHotel> GetvHotel()
{
return db.vHotel;
} | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.