query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
d0b73a81a9ae6d3da9b8cab234fc77ca | ea4d7adc9440518aa0f4f212104d641d | Toggle arrow direction and border color | class Switch
showArrow() {
this.content.hover(() => {
this.leftBtn.css('visibility', 'visible');
this.rightBtn.css('visibility', 'visible');
clearInterval(this.autoTimer);
}, () => {
... | 0 |
ba5d6eca3ebe0e0ea5681848e356b2e4 | 0c70496129ffb26ef2cc755cfab28aec | An unauthenticated user should see the normal landing page. | class UnauthenticatedViewTestCase(BaseTestCase):
def test_stream_view(self):
response = self.app.get('/index', follow_redirects=True)
assert 'Log In - dogpound' in response.data | 0 |
269830bd59a13b5efbb151b624dae702 | 391f1ffab014c88656479be65f49dff8 | ! \brief Returns the string value of the previous state. | unsigned long PI74HC165Control::previousState()
{
return (_oldValues);
} | 0 |
2e1efbeca7c0f6e64f70c5221717b3f1 | 4c6e6ea25c24d57a449ac684342ea734 | Opens a new parent undo unit, which becomes part of its containing unit's undo stack. | namespace ICSharpCode.Editor
IDisposable OpenUndoGroup(); | 1 |
cbf7471c8a72ec2ae80ded498637551d | b10058d58b8c99e06a46393296aa50a2 | ++
Routine Description:
This routine is used to log System Errors in human readable form.
Arguments:
err - Error number obtained from GetLastError()
str - String pointer holding caller-context information
Return Value:
None.
-- | {
LPVOID lpMsgBuf;
LPVOID lpDisplayBuf;
DWORD dw = GetLastError();
FormatMessage(
FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
dw,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPTSTR)&lpMsgBuf,
0, NULL);
lpDisplayBuf = (LPVOID)LocalAlloc(LMEM_ZER... | 0 |
073fb3a97b8753424c4dd352b907adf1 | 82642427dbb0721df77077fd27ae102b | Constructor: read image and specify dimensinons. | : HEIGHT{height}, WIDTH{width}
{
buffer = new unsigned char[HEIGHT*WIDTH];
} | 0 |
e8763df09e124465a87aeb5f9dfd470c | 825ae602ee9d64fb1fd739eca9d2f7d8 | find color number for position | int position;
switch(color){
case 'r':
position = 0;
break;
case 'g':
position = 4;
break;
case 'b':
position = 8;
break;
case 'y':
position = 1... | 0 |
39c3f34478348055b213b06bba25b9ad | 66e54f6a86ad0773db07cf520d3053f8 | 获取怪物战斗动画 | CCSpriteFrameCache:sharedSpriteFrameCache():addSpriteFramesWithFile(herodata:getHeroAnimationByResId(self.m_resId))
if aniType == kAniTypeStand then
local animFrames = CCArray:create()
for j = 1, StandFramesCount do
local frameName = string.format("%s_stand_000%d.png",self.m_resId, j)
local ... | 1 |
e19d300455d33823def41e2cba1acca6 | b65e1366873994a014d9d4c339652d9a | From https://www.iitk.ac.in/kangal/papers/k2012016.pdf | def Squared_distance_Ebin(g0, g1, a, mask):
inv_g0 = get_inverse(g0)
inv_g0_g1 = torch.einsum("ik...,kj...->...ij", [inv_g0, g1])
trK0square = trKsquare(g0, g1) - torch.log(
get_det(inv_g0_g1) + 1e-40) ** 2 / 2
theta = torch.min((trK0square / a + 1e-40).sqrt() / 4, torch.tensor([np.pi], dtyp... | 1 |
5c642587acca92c48060d720075b18da | 8e5f65ec7b2abb54d0c097d5fbca1416 | Obtiene del servidor el siguient correo del usuario y lo imprime por pantalla.Si no habia correos en el servidor informa por pantalla de ello. | if (campo.value === '')
return false;
var url = "PeticionesAjax?correo=" + escape(campo.value);
if (window.XMLHttpRequest) {
req2 = new XMLHttpRequest();
}
else if (window.ActiveXObject) {
req2 = new ActiveXObject("Microsoft.XMLHTTP");
}
req2.open("Get", url, true);
... | 0 |
57749e8e1f2822f6017c7a2d3ca3f64c | 9007d7d4f0d59b6fdafe8d0fabe04c0f | 解压ZIP压缩包, 存在文件名乱码的情况 | try {
return deCompress(new File(zipFilePath), dest, passwd);
} catch (ZipException e) {
e.printStackTrace();
}
return null;
} | 0 |
6675f294e21a76e8c184cdee1948e402 | 4ffd00acddcb20294169b7bf47f2ccab | Retrieves the node's name (I.E. the current move). | {
if (this.model == null)
return "";
return this.getNameForPlayer(this.model.getCurrentPlayer());
} | 0 |
79561090ad864d75dab24e027fb53cbd | 9e30ac416937f5c8c9467923573ab14b | Ritorna true se la cella è predefinita | public class SudokuPiece implements IPiece, Serializable
public boolean isInitial() {
return isInitial;
} | 1 |
033427c951a59d52ea67186369fdc630 | 0020203cce0c83277700dce5f953ef69 | Determines if the url is a url for the bookmark page. | boolean isUrlRef(); | 0 |
80784b420ed46fc8fc27a61d136c977c | 506cdf033e621fd072140257d81bbc2b | https://stackoverflow.com/a/12141511/7742211 | def chunks(iterator: Iterator[T], n: int) -> Iterator[Iterator[T]]:
for first in iterator:
rest_of_chunk = itertools.islice(iterator, 0, n - 1)
yield itertools.chain([first], rest_of_chunk) | 1 |
3d0ba1370624cfc1b97f498863ba5692 | 1b5f18a3b3baefe34a3763e28429f398 | Returns a face from the active queue to be completed. This needn't be the one at the end of the
queue, because the choice of the next active face can affect how many SPLIT symbols are produced.
This method employs a fairly simple scheme of searching the most recent 16 active faces for the
first one with the smallest nu... | public class QGrid
public boolean getCurrentFace() {
return activeFace;
} | 0 |
4ce1fb57a1b7fe4efea93984760c8baf | fc5a6b3c5ae1e07f874096fadf31bc68 | Checks if the agent reached the dead end. | for(int i = 0; i < agents.size(); i++){
if(agents.get(i).getLocation().equals(intermediateGoal)){
return true;
}
}
return false;
} | 0 |
8c05124855d40288ee3c42fdebda07d3 | 18d71d2b5f6519a78383c9481be8db42 | Gets the Enum by name. | {
foreach (T item in Enum.GetValues(typeof(T)))
{
if (item.ToString() == name)
{
return item;
}
}
return default(T);
} | 1 |
db25833871967474d9ab80da901d6199 | d185c188674e7a34b312ae49c5b878cf | 这个是根据id,修改数据 | let params = {
url:api[this.apiName]+"/"+data.id,
method:'put',
data
}
return request(params);
} | 1 |
33012667e6b181500ccb4bc9e00191cf | 84c1975d0eac4c4a3cc373029bcfd654 | 内部配列に登録されたパラメータを、hidden型inputタグで一括出力する
(除外リストのパラメータは除く)
引数 : : 無し
戻値 : : 内部配列をhidden型inputタグの形式で一括出力したもの | class MailFormResult
public function getValueForHiddenHTML() {
$buff = '<div id="hiddens">' . "\n";
foreach ($this->values as $key => $value) {
if (is_array($value)) {
$i = 0;
foreach ($value as $item) {
$item = htmlentities($item, ENT_QUOT... | 1 |
fbcc173a30c0d573b005bea357cffc5c | 40019e15323778f8d46fc0e11da6d49c | Return TEXT string of this service result.
For serialized data, JS consumer can unserilize it if using tool such as PhpJs
See http://phpjs.org/pages/home for mor detail.
FlexicaCMS use php.default.namespaced.min.js | class EccGeoIPCtryServiceGet extends EccGeoIPCtryWsdlClass
public function __toString()
{
return __CLASS__;
} | 0 |
ce8bfce3d97ec2bde2aec03bcc0403a3 | c86649f9c6c0c5a4404bbfeae22707c7 | 공통메세지관리 리스트 출력 | @Controller
public class AdminMainManageController
@RequestMapping(value="/admin/hpm/umm/selectMainManageList.do")
public String selectMainManageList(ModelMap model) throws Exception {
LoginVO user = (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser();
Boolean isAuthenticated = EgovUserDetailsHelper.isAuth... | 0 |
1b7b20b65ef5f8afb687c2460f801d35 | f969b49e89a0ff2afc6714502d771922 | Checks whether a share is currently active. | {
if (shareID <= 0)
{
ThrowError(new InvalidParamError("shareID"));
return false;
}
return true;
} | 0 |
b3fabfb390416379bc244f0c65df4273 | 27590f723bf5c1b8984cb76e96a81c80 | Assign media item to a media tree node. | BOOL bPages, BOOL bTreatments)
{
CXmlMedia* pQueueMedia;
CXmlPage* pXmlPage;
POSITION Pos;
ASSERT(pQueueTree != 0);
ASSERT(pXmlMedia != 0);
if(pXmlMedia->m_dwUser1 != 0)
{
pQueueMedia = (CXmlMedia*)pXmlMedia->m_dwUser1;
}
else
{
pQueueMedia = new CXmlMedia(pQueueTree);
ASSERT(pQueueMedia);
pQu... | 1 |
a61446720832fd211ea3593365699c83 | 0919e155fc6ae31cdc96f0fb0ad09ce2 | Get the default formatter name | namespace Controls.Logging
[Serializable]
[XmlRoot("LoggerConfiguration")]
public class LoggerConfiguration : ILoggerConfiguration, ISerializable
public string GetDefaultTypeFormatter()
{
return this.defaultTypeFormatter;
} | 1 |
b7d966d6c40b96f1313622069c7e4f18 | 1e8cfced1e384bf2651baa5267d3258e | Plays the blink_string back as audio. | def blink(str):
length = len(str)
for j in range(0,length):
c = str[j]
if c == ".":
GPIO.output(8,True)
time.sleep(SHORT_BLINK)
GPIO.output(8,False)
time.sleep(SHORT_BLINK)
if c == "-":
GPIO.output(8,True)
time.sleep... | 0 |
fd01f3016b7067ccd4954aaef759a011 | c5997c7317e01d3498fd7e8b3c15fdb8 | # Motif 4 | test_biostringsAlgorithm <- function()
{
printf("--- test_biostringsAlgorithm")
tbl.hits.b <- matchMotifInSequence(m4.biostrings)
checkEquals(nrow(tbl.hits.b), 1)
checkEquals(tbl.hits.b$chrom, "chr2")
checkEquals(tbl.hits.b$start, 88875627)
checkEquals(tbl.hits.b$end, 88875640)
checkEquals(tbl.hits... | 1 |
66418c7bcd19c7f801b655aac1ae4bf7 | e5ca3be5e443c0f1084b1d65741534de | 向buffer写入两个字节的int值 | public class BufferUtils
public static final void writeUB2(ByteBuffer buffer, int i) {
buffer.put((byte) (i & HIGH_GET));
buffer.put((byte) (i >>> BYTE_ONE));
} | 1 |
7590f6b14a2de29ea2a79d2135ab3565 | 2a1b7af5c8afbfbadfcb8ae175d149e2 | Is the right bumper pressed? [top one] | public class OI
public boolean isRightBumper(){
return xbox1.getRawButton(6);
} | 1 |
9f4e51f80ce642c6a0e609d5399100da | c6cff9162452b41d7b2e083b2d703bf0 | Get place units state for game manager | public class GameManager
public boolean getPlaceUnits(){
return placeUnits;
} | 1 |
58669e3d8950f50244bacadc8d7eeeb7 | 4117f6c51eb2def25ce920e2f4e0d83b | Returns a light. If the light is in the system already, it
returns that light. Otherwise it makes a shell light with name
and returns that. | Light *result;
map <string, Light *>::iterator light_iter;
light_iter = system->lights.find(name);
if(light_iter == system->lights.end()) {
result = new Light;
result->name = name;
result->roads[0] = NULL;
system->lights.insert(make_pair(name, result));
}
else
result = light_iter->secon... | 1 |
cdc8c1111da55b1b28a0f4be40be45fc | f129c32b18230ad0ff5ea76c907df6f0 | Creates a new adapter for an object of class '{@link org.oasis.xAL.ThoroughfareNumberFromType <em>Thoroughfare Number From Type</em>}'.
<!-- begin-user-doc -->
This default implementation returns null so that we can easily ignore cases;
it's useful to ignore a case when inheritance will catch all the cases anyway.
<!--... | public Adapter createRemoveobjectinstanceTypeAdapter() {
if (removeobjectinstanceTypeItemProvider == null) {
removeobjectinstanceTypeItemProvider = new RemoveobjectinstanceTypeItemProvider(this);
}
return removeobjectinstanceTypeItemProvider;
} | 0 |
78d4787f8347708b318e3598f661c384 | d6e3e0002c64111cebc5f005de2dd8d2 | Convert 2-D list of chars to 1-D list of strings. | def char_matrix2string_list(char_matrix):
string_list=[]
for row in char_matrix:
string_list.append(''.join(row))
return string_list | 1 |
701deca6c51b7a7a59013a1254c1bf15 | 5e81cf9e30a4586e0e7a2c64bc91f81d | Method called by Coroutine to start a ChillGameMode Mode round. If hasTimer is true then we call StartTimer on our CountdownTimer Class, and we
pass the amount of time that should be on the clock. Then we change the boolean "gameHasStarted" which will remain true until round end. | public class GameTimer implements java.io.Serializable
public void StartGame()
{
Choice choice =new Choice(astro,base);
Global.TextDisp("\n-------------- "+TurnCount+" --------------");
Global.TextDisp(base.getItems().getItemStatusString()+"\n");
TurnCount++;
actionTimer--;
Global.DebugMSG(5, "Action Time... | 0 |
74c9385f031694e9540ad9f51b8c175d | aef419743b312b762f90ad5e7a763a98 | Update static files | class Addon:
def update_static_files(self):
self.update_static("logo.png")
self.update_static("icon.png")
self.update_static("README.md")
self.update_static("DOCS.md")
self.update_static("apparmor.txt")
self.update_static("translations") | 1 |
37a41f3f22646828dbff0669dec7b7f6 | 2831ea1a90736a819431a9d5f7dd27a9 | Remove discovery data for deleted devices | if(pDescriptor->m_removed > 0) {
if(deleteDsc) {
for(auto it = m_dscVec.begin(); it != m_dscVec.end(); ++it) {
if ((*it) == pDescriptor) {
delete *it;
m_dscVec.erase(it);
break;
}
}
}
... | 1 |
056dc3b8ae0739324e8b84a88b8c132d | dfb66371d4ec75aa54b5e2fd399e5249 | creates a portfolio object of all the currencies owned on Bitfinex.
It has a Response object and a Tickers object. It has attributes:
self.data: the data of the Response object with usd price added and zero
balances removed.
self.total: the total amount of dollar value of the currencies owned. | {
$currs = array();
$response = $this->sendRequest("/portfolio/currencies","GET");
foreach ($response->payload->currencies as $currency)
{
$ticurrency = TICurrencyEnum::getCurrency($currency->currency);
$curr = new TIPortfolioCurrency(
$cur... | 0 |
fc8b573d3287f5f81976b66f684bf705 | f9ab426c9faeaa033c3838249a6ee2f0 | Return the argument that represents the given name in this AF. | public DomainFunctionArgument getArgument(String argumentName); | 1 |
80c05c18abf8f03ca6a009f1bdef8f22 | fde84712ccbbeefc39f5a869394d9174 | Returns information about Azure SQL database usages. | export class AppServiceEnvironments
listUsages(
resourceGroupName: string,
name: string,
options?: AppServiceEnvironmentsListUsagesOptionalParams
): Promise<AppServiceEnvironmentsListUsagesResponse> {
const operationOptions: coreHttp.RequestOptionsBase = coreHttp.operationOptionsToRequestOptionsBase(
... | 0 |
e0d99b30a8ce9ac2cce2669c7ffbe108 | 0350d73b5d01c9f878cfce74b7c4b21e | 中序遍历非递归实现 | public class BinarySearchTree<E extends Comparable<E>>
public void inOrderNR() {
Stack<Node> stack = new Stack<>();
List<Node> nodeList = new ArrayList<>();
Node popNode = this.root;
while (popNode != null || !stack.isEmpty()) {
while (popNode != null) {
stack... | 1 |
eb55e30da954b073cea18eac98bde9e7 | e0c17c17258742f5297a28a43e2fabb9 | Sometimes, Google Cloud takes a few seconds to make the image accessible | try:
urllib2.urlopen("http://www.google.com").close()
except urllib2.URLError:
logging.info('Not connected to the internet, sleeping for 120 seconds')
sleep(120) | 0 |
b729920d5e68dc8d53d72a32fe6addd0 | ea251583aa8f6aa923949272725f9fa2 | The proposed total fee for the closing transaction | namespace Accela.ACA.BLL.Finance
double GetTotalFee(CapIDModel4WS capID, string callID); | 1 |
740e284580400dbb6d8c0b4a4ee4ce78 | cbe2e4f68f0a255576ef2e4a853361e2 | Only select the historic process instances with which the user with the given id is involved. | public List<HistoricProcessInstance> findHistoricProcessInstanceByStartUseId(String startUserId); | 1 |
d6f1c26d7f4966002efe06776a3723aa | a277aa4b35bd6677f996d5e6828bf01c | 상근날드
햄버거와 음료를 하나씩 골라, 세트로 구매하면, 가격의 합계에서 50원을 뺀 가격이 된다.
가장 싼 세트 메뉴의 가격을 출력한다. | function solution(burgers, coke, soda) {
let cheaperPrice = 4000;
burgers.map(burger => {
cheaperPrice = Math.min(burger + coke, burger + soda, cheaperPrice);
});
console.log(cheaperPrice - 50);
} | 1 |
599a1456c34adbba43076834e4da327c | 0a9cf8ecd373e4060f9f09c639dc377d | 根据引擎功率计算现在的速度 | public class Car : MonoBehaviour
float getEngineRPM(float speed, int gear)
{
float engineRpm;
engineRpm = (speed*2.23693629f)/60;
engineRpm *= 880;
engineRpm *= FINAL_DRIVE;
engineRpm *= gearRatio[gear];
return engineRpm;
} | 0 |
05baa83a9c93403c883c6b5cc2716148 | e60dbdc66e621e3de02279598f668f5c | 设置SQL生成工具 | namespace Nightingale
public abstract class ConnectionFactory<T> : IConnectionFactory where T : IConnection
protected void ApplySqlEngine(ISqlGenerator sqlEngine)
{
SqlGeneratorManager.SqlEngine = sqlEngine;
} | 1 |
38cc84719f89fd2aa1dc05f8129b921f | 50167e73290b6adaa79632f6a08d6a92 | Returns the entire HTML source between the opening and
closing "html" tags. | public class HTMLParser
public Source getHTML() {
return doc;
} | 0 |
eb29080d1f663016dd6578acfbf8ec3d | 7c0000f691ed70ce3561d47932ed796f | 实现批量进货操作 | @Service(timeout = 60000)
public class ProductServiceImpl implements ProductService
@Override
public void xiajia(Long[] ids) {
productMapper.xiajia(ids);
} | 0 |
0932e1aba7fd89acf97f98f68d98b162 | 95510bf18e980cbe0dc7febc539c4c2c | Get the write start address of the receive buffer
受信バッファの書き込み開始アドレスを取得 | uint_32 _EVTMGR_get_wr_addr(void)
{
if( ! _EVTMGR_addr_is_valid (g_Info.write_addr) )
{
EVTMGR_reset();
wassert( ERR_OK == PROCESS_NINFO(ERR_EVTMGR_INVALID_R_BLK, NULL) );
}
return g_Info.write_addr;
} | 1 |
e8912ef85ae745f10baad980e0486753 | f641acb0e278b406f58512a44d240920 | 查询多个商品参与的活动 | List<ActivityGoods> getActGoodsByActIdList(List<Long> actGoodsId); | 0 |
5692ffff1705dae543e814460bb6c4fe | 8b455349cd9c40c1865c8a04c64aad02 | Get the history of all device states | public class ContextManager
public HashMap<String, List<HassioState>> getStateHistory() {
return this.hassioDeviceManager.getStateHistory();
} | 1 |
fb6cc868fbc1be80d32580c1630e8157 | 90fd15b2de7e51adcc9994e6720f9ee4 | 向服务器发送消息后会调用此方法 | public class UserClient
void onMessage(Message message); | 0 |
c9be67e17fede1fb924c4db2a17b1fd7 | f5afb41e936c16723cf0137f0886efb6 | Configure/Set radar Field of View, configurable attribute. | class CentralCamera(Camera):
def fv(self):
return self._fv | 0 |
02fc33b60cc171eff93ece10137bfc70 | d41a220117a7036c60eee8a8ac1bc5ae | whenever player is hit by an asteroid, decrement the health by 1 and update the UI hearts | {
hP -= amt;
heartImage[Mathf.RoundToInt(hP)].gameObject.SetActive(false);
vfx.Play();
AudioController.instance.PlayerTakingDamage();
Invincible(hitInvincibleDuration, true);
InterfaceController.instance.UpdatePlayerHP(hP, maxHP);
} | 1 |
6e7e40bd214255e6dcf82fff500eabc1 | d8d5a3dd1ba931274ec764eec5f21a27 | event handler for mousewheel forward event | void Window::wheelEvent( QWheelEvent *e )
{
int steps = e->delta();
if (steps < 0)
glWidget->forward(0.2);
else
glWidget->backward(0.2);
} | 1 |
2a8f32ebf2dc97d5697a394eb6c01876 | 43be6bb4545544aa4a03f4b61cefaf13 | Triggers the stashed error. | var errorWrapper = globals.JavaScriptException._on_(error);
try { errorWrapper._signal(); } catch (ex) {}
var context = st.getThisContext();
if(isRangeError(error)) {
stubContextStack(context);
}
errorWrapper._context_(context);
return errorWrapper;
} | 1 |
7b0ffaed60b7dac4269b8c01a37ac9fc | 9ecd80fa3418051c0a546764611e3df6 | Adds the gzip compression service. | {
services.AddResponseCompression(options =>
{
options.Providers.Add<GzipCompressionProvider>();
options.Providers.Add<CustomCompressionProvider>();
options.EnableForHttps = true;
options.MimeTypes = ResponseCompressionDefau... | 1 |
4e762641a91b72906474cdfbcdbc21e7 | 91067cd4d5b6edf84212320e7af03bd6 | 生成Java的Model类 | Log.blank()
Log.info("create_pojo", "生成 java pojo 类")
for tableInfo in tableInfos:
tableName = tableInfo["name"]
className = TableUtil.className(tableName)
columns = tableInfo["columns"]
columns2 = copy.deepcopy(columns)
TableUtil.addMo... | 1 |
ce796277399fda481329d5aa4962b024 | b5bcc7fd10b29f5bf2070b2f1793180c | Ramp the voltage from the current level to the specified output. | if self.cachedMode() != self.MODE_VOLTAGE:
raise RuntimeError('Not in voltage mode')
if abs(voltage) > self.MAX_VOLTAGE*1.01:
raise ValueError('Voltage out of range: %g' % voltage)
self.voltage.put('SET', voltage, wait) | 0 |
8317c5dff60ae535216bc5353492fb10 | 1923a3f52a1a601b1da00107ef3b86b6 | animation for background, non-interacting objects | function animBg(){
setInterval(() => {
game$.css('background-position-y', '+=10');
asteroids$.css('top', '+=' + tempo);
bullets$.css('top', '-=10')
asteroids$.each(function(){
let aste = $(this);
let asteTop = aste.offset().top
let asteLeft = aste.offs... | 1 |
7367c248b9ef91845fc5692ebd99a1bf | 4acc15443d6776b43247147314f03a0e | o Viết phương thức in toàn bộ danh sách các hàng hóa. | {
for (int i = 0; i < size; i++)
{
cout << goodsproduct[i].name << " " << goodsproduct[i].type << " " << goodsproduct[i].price << " " << goodsproduct[i].quantity << " " << goodsproduct[i].days_left << " " << goodsproduct[i].batch << endl;
}
return;
} | 1 |
f26dbce01d7846fc8feae0b6cd57902d | a0519e85e539b4eaaef8375d218c8c2f | 拡張子を元にContent-Typeを設定 | {
return ext in ContentTypes ? ContentTypes[ext] : DEFAULT_CONTENT_TYPE;
} | 1 |
fc14ff5c405f698ef03a136534e59877 | 41b911b856c724e5dfe91c1eef6b1a65 | convert from window to scaled coords | public class SwingDrawer implements Drawer
private int unitsToWindowPosY( int val){
return (int)(val*Game.getServices().getWindow().getWindowScale().getY());
} | 0 |
23d822f8280d6c06059121b0f3ea282b | 326e907b4c774b11b5bb7778f66e1f58 | Get products by arrival | $current_user = wp_get_current_user();
if ( 0 == $current_user->ID ) {
return [];
}
$customer_orders = get_posts(
array (
'numberposts' => -1,
'meta_key' => '_customer_user',
'meta_value' => $current_user->ID,
'post_type' => wc_get_order_types(),
'post_status' => 'wc-completed',
)
);
$product... | 0 |
afcb11383fd79cb2dea3622d584493a7 | 5c8dcede79b2f549285573f8a354725d | 京喜平台swagger转换成markdown | {
$markdown = sprintf("### `%s` %s ###\n", $data['method'], $data['uri']);
if (isset($data['deprecated']) && false !== $data['deprecated']) {
$markdown .= "### This method is deprecated ###";
$markdown .= "\n\n";
}
if (isset($data['description'])) {
... | 1 |
6dd8433d7537d18d3b6c15b759d836a2 | 2f8475bb24ba84814163fdf22e5a60f4 | 根据任务ID获取数据库凭证信息 | {
var baseParams = new SortedDictionary<string, object>(StringComparer.Ordinal) { { "jobId", jobId } };
var returnJson = q.RequestAPiAsync("GetCdbInitInfo", baseParams, APIUrl.Cdb, r);
return JsonConvert.DeserializeObject<CDBInitInfoRetrunType>(returnJson.Result);
} | 1 |
0490516f1a69ccace93b1e7e1bafd3ed | ee7f81569b4966c9958c74c1e36dee6e | Acquire unclaimed due schedules for processing.
This method claims up to the requested number of schedules for the given
scheduler and returns them. | public static partial class Prelude
[Pure]
public static Schedule take(Schedule s, int amount) =>
s.Take(amount); | 0 |
0d2e5bea134c7335e7366aebce6c986c | e7179646b5d0ad14b1a07d3c038da43b | 查询全部信息或根据news_assortment查询该类的所有的新闻 | news_list = []
news_type = self.__news_type(news_type)
id_list = self.r.smembers(news_type)
for int_id in id_list:
news_id = self.__news_id(int_id)
data = self.r.hgetall(news_id)
data['id'] = int_id
news_list.append(data)
return new... | 1 |
9ccd58d90d62665ef58e5887c80377c9 | 79ee6778d812df0d0fe08f06fdc0dd54 | 创建Res资源表 | namespace CK.DB.Res
[SqlTable( "tRes", Package = typeof( Package ) )]
[Versions( "1.0.0" )]
[SqlObjectItem( "vRes" )]
public abstract class ResTable : SqlTable
[SqlProcedure( "sResCreate" )]
public abstract int Create( ISqlCallContext ctx ); | 1 |
ac77a589a9c8254b8cef320ab35c061f | a873f06ffe4d1895b5c6ecdadb84374b | It is responsible to update the MD to completion and disk_worker layer
It then sets the inode as dirty, the flusher thread will eventually flush the MD to disk | {
int i;
struct m_inode *inode;
inode = 0 + inode_table;
for(i = 0; i < NR_INODE; i++, inode++) {
wait_on_inode(inode);
if (inode->i_dirt && !inode->i_pipe) {
write_inode(inode);
}
}
} | 0 |
fc2339e16eef8fe8a7625cccd26ad916 | fe979a3b3de16f61213efaec23641fc4 | 通过类对象访问类属性 | public class TestDemo
@Test
public void test7() throws Exception{
Person p=new Person();
Class cla=Class.forName("com.lhy.reflect.Person");
Field f= cla.getField("name");
Object value=f.get(p);
Type type=f.getType();
if(type.equals(String.class)){
value=(String)value;
System.out.println(value);
}el... | 1 |
ced97dd331b89d87793505c8f3f4cc55 | 063e1fe95bf39990bfc3250f9b7773f1 | Exiting editor, stuff common to both abort and save | static void editor_exit() {
editor_free(g_ec);
clear_screen();
disable_raw_mode();
term_state_restore();
} | 1 |
f3c4cfa515f2f1ea0686b4c3c8982c2d | b17d712bbc8c095b9026e6533972f6ca | Shows all exhibitions. | {
if(Auth::check()) {
$exhibits = Exhibit::all();
return View::make('exhibits.index')->with('exhibits', $exhibits);
} else {
return Redirect::action('UserController@showLogin');
}
} | 1 |
7f894391b2edb06d934e94c2dc0da95c | 4d2c0de387855a81889f412171f62ddd | Get all messages from a queue. | {
$output->writeln(sprintf(
'Get %d messages from queue "%s"',
$input->getOption('nb-messages'),
$input->getArgument('queue')
));
$fromChannel = $this->getChannel(
$input->getArgument('connection'),
$input->getArgument('vhost')
... | 0 |
1fa9f4c40073dfe5a1df67da080696cb | 695bfa4a488a5ddc7ebdd36a6fcc52be | 决定当前任务的参与者角色名 | @Service
@Transactional(readOnly = true)
public class ActTaskService extends BaseService
private void setTaskGroup(Map<String, Object> vars, Set<Expression> candidateGroupIdExpressions) {
String roles = "";
for (Expression expression : candidateGroupIdExpressions) {
String expressionText = e... | 1 |
2749881bf105f927906651628d96e03c | 48c6bc7a01e035be7c66730a75d9e556 | Constructeur privé qui initialise les attributs | class choixPresta
public function __construct()
{
$this->service="";
$this->$val="";
} | 0 |
2eae3caf05a6b90acd6df6544583e2ca | a8455d080693b1726aca9e86374ee03f | Clears the ads in the given range. After calling this method, the ad positions
will be removed from the placed ad positions and put back into the desired ad insertion
positions. | class PlacementData
void clearAds() {
if (mPlacedCount == 0) {
return;
}
clearAdsInRange(0, mAdjustedAdPositions[mPlacedCount - 1] + 1);
} | 1 |
d6ebe2669391005b73ed4f7d839b8f9d | 696c10afa82ff3255fa4090dad6832e3 | 打印勘误数据。包含勘误汇总和勘误明细 | @SuppressWarnings("serial")
@Namespace("/personInfoErrata")
@Action(value = "personInfoErrataAction")
@Results({
@Result(name="addOrEditBaseSiinfo",location="/jsp/cgManagement/baseSiinfoManagementEdit.jsp"),
@Result(name="expPersonErrata",location="/jsp/cardApp/baseSiinfoCheckMain.jsp")
})
public class PersonInfoErra... | 1 |
8f32c485c06e9a0e6dbc235374eb4ae1 | 3bbbc1b4dd41fe3abbb9f59b8d0e46a4 | Get the current level cap | public static class GameData
public static int GetCurrentLevel() {
return PlayerPrefs.GetInt("currentLevel");
} | 0 |
59ccd8f0672502abfd18dd274d4c4149 | 53ea3dc034274a14f6e731a7160da2e3 | Parses a unique ID used to resynchronize user state after a temporary disconnection from a server. | namespace Irc
public static class Parser
public static string ParseUniqueID(IrcMessage message)
{
try
{
return (message.Parameters[1]);
}
catch (IndexOutOfRangeException ex)
{
throw new FormatException(Properties.Res... | 1 |
e4ee3cd1a09998a2928ad1069b2d5857 | 4b50365e7884283450eed93ea234fe35 | methods to create default versions of enemies | Enemy::Enemy() {
health = 0;
verticies = 0;
enemyX = 0;
enemyY = 0;
enemyIncrement = .01;
r = 0;
g = 0;
b = 0;
} | 1 |
447f4f14114f312fdf8289cb632d89b0 | b636c5c3f968b4d14f573beb9de99fed | \brief Function to perform Vector Real Multiplication | VR4300DMULTU(struct VR4300 *vr4300, uint64_t _rs, uint64_t _rt) {
uint64_t lo, hi;
#if(defined(__GNUC__) && (defined(__x86__) || defined(__x86_64__)))
__uint128_t rs = _rs;
__uint128_t rt = _rt;
__uint128_t result;
result = rs * rt;
lo = result;
hi = result >> 64;
#else
#warning "Unimplemented function: V... | 0 |
537c77801d3ee452bb6d1a242970621a | 7d41f134dd2062b4ba95158a2ba2edf4 | Validates a MoveAction, BeginMoveAction, or ExitAction for the given state.
The MoveAction or ExitAction is invalid iff
1. The ShuntingUnit is blocked by another ShuntingUnit and cannot leave the current track towards the specified direction
The BeginMoveAction is invalid iff
1. The ShuntingUnit is blocked on both side... | export class Unit extends GameObject
protected invalidateMove(
player: Player,
tile: Tile,
): void | string | UnitMoveArgs {
if (!player || player !== this.game.currentPlayer) {
return `It isn't your turn, ${player}.`;
}
if (this.owner !== player || this.owner ===... | 0 |
8650d628731a0208b5a4c0653bfb263d | 022682dde64dd2413961a9b2dc0bdb98 | Returns Database Connectivity flag | class Helper
public static function isDbConnected() {
return Helper::$isDbConnected;
} | 1 |
c1f5d10af9890f0b03eda54247913937 | dec0f6bc724e135b679bdbd3a35e2dd8 | !
Returns whether ticks are shown on the major scale.
\sa setShowMajorTicks(), setShowMinorTicks(), showMinorTicks() | public abstract class AbstractGauge extends JComponent implements ComponentListener, ActionListener, Serializable
public boolean isMajorTickmarkVisible() {
return model.isMajorTickmarksVisible();
} | 1 |
58981ebe70e9bfd3788f6f6f58e90993 | 63e7cc9daa8572814a58dfdc45ca2d91 | 启用数据迁移。 | {
var migrationRunner = new MigrationRunner(ConnectionString, MetaData.GetType(), SelectDatabase);
migrationRunner.MigrateUp();
} | 1 |
205a19f6fdcff83b839d09ecf55f65f5 | 0807ec71da88508b9f7a22b11324b782 | Creates a new Product model.
If creation is successful, the browser will be redirected to the 'view' page. | class ProductController extends Controller
public function actionCreate()
{
$model = new Product();
$detailArray = [""];
$model->detail = json_encode($detailArray);
$specificationsArray = ["",""];
$model->specifications = json_encode($specificationsArray);
$post = Yii... | 1 |
b0501418c77fd9b67018f35795a09b6b | 4b89dbeb2d8a3b9441dba7ae6a069d7e | 从Kafka获取指标 | go func() {
for {
items := <-KafkaQueue
bs, err := json.Marshal(items)
if err != nil {
log.Printf("StartKafkaSender_json.Marshal_err:%+v", err)
return
}
errSend := MetricsBusSend([]byte("falcon"), bs)
if errSend != nil {
log.Printf("StartKafkaSender_error:%+v", errSend)
proc.SendTo... | 0 |
c719e16f5dc701c1a5ecbb6875e80bcc | 49171989041f004b934fc6dcd5f27f89 | 查询油耗信息总条数 | List<TransportProduct> selectOilTotalData(); | 0 |
eda08d84e1c12d120ed22c1b96fa6cd3 | db7f814ec5f2515558e3aed97e6f72fd | Get the domain record type that is subject of the request. | class CertificateDomainValidationOption(dict):
def resource_record_type(self) -> Optional[str]:
return pulumi.get(self, "resource_record_type") | 1 |
da4da100a90ad3da3cb486fd08c7580e | d568c27409d155ea3aa601554b23f917 | returns the intersection between 2 arrays | function getIntersection(a,b)
{
return a.filter(function(v){ return b.indexOf(v) > -1 })
} | 1 |
f1b9980b94a4d2aa9bd2ba80da1c6660 | 4d50f500c1e159207084e0354f90de9f | Exports the policies passed as dictionaries in the arguments to the
configuration file of the TestServer. The TestServer will serve these
policies after this function returns. | def sendPolicy():
return send_from_directory('publicpolicy', 'publicpolicy.py') | 0 |
0c68ebd22bb2f9823b05a535598da8ed | eb29764258dfac49369833c83debe01e | Returns all the user files | class fileController extends Controller
public function getUserFiles()
{
$user_files = Helper::getUserFiles();
return $user_files;
} | 1 |
91f855046dbf50806e53d573a18177c5 | 35564dd13a0587b94a0f97fb71d16466 | 删除点赞数、一级评论数的缓存 | namespace Sheep.ServiceInterface.Likes
public abstract class ChangeLikeService : Service
protected void ResetCache(Like like)
{
Request.RemoveFromCache(Cache, Cache.GetKeysStartingWith(string.Format("date:res:/likes/query/byparent?parentid={0}", like.ParentId)).ToArray());
Request.Re... | 1 |
541a9f166e7b00b67aa22d470d72ff54 | b8892d0a7d0d396030933070c1b305e0 | 在两个坐标包括的矩形框内随机产生一个坐标 | class Controller:
def GetRandomLoc(self, area):
rd_x = random.randint(area[0], area[0] + area[2])
rd_y = random.randint(area[1], area[1] + area[3])
return (rd_x, rd_y) | 1 |
a30812f4f70ca408233aefe245b38f67 | 29f46e9ff146bd671d62758213551036 | RepositoryConfiguration constructor. | public function __construct(array $config); | 1 |
98a3e0c094fc0ec10faa9aa6571c1c93 | 188f154777d048f181be524bdfa22939 | Queries the client queue for any clients awaiting registration. | (status, token) = getToken(request)
if status != c.OK:
return (status, '')
store = cdbw.getStoreFromCheckIn(token)
if store == c.DB_ERROR:
applogger.info(lm.DB_ERROR)
return (c.INTERNAL_SERVER_ERROR, '')
clients = cdbw.getAwaitingClients(store)
if clients == c.OBJECT_NOT_FOUND:
return (c.NO... | 1 |
73446bb76e17bfa4ae2be931e2eb9f0f | 239ab8662e5298d1ef9278c45348ef63 | This fetches all currently active alerts.
i.e. GetAlerts | global $aem, $debug;
$alerts=array();
if(empty($orderBy)) $orderBy = "aa_received_time desc";
$sql = "select * from aem_alert where aa_status = 'open' order by $orderBy";
$result = mysql_query($sql,$aem) or handleError("getActiveAlerts - alert",mysql_error());
while($row = mysql_fetch_assoc($result)){
$alerts[... | 1 |
7e557c7f188e70d9bb77973d33f9974d | 63e75c0ac02acb25fbe3226880de5706 | Validates the input parameters for the updateGlobal() method. | const oThis = this;
const userKeyConfig = {
id: { isNullAllowed: false },
userName: { isNullAllowed: false },
name: { isNullAllowed: false },
email: { isNullAllowed: true },
status: { isNullAllowed: false },
approvedCreator: { isNullAllowed: false },
profileImageId: { i... | 0 |
5b50e8ed640e38946b102e8ca9bf2d7a | 8e7b8139667244e2d2e3cb07f1822172 | Returns the meta object for the attribute '{@link uk.ac.gda.excalibur.config.model.AnperModel#getDacPixel <em>Dac Pixel</em>}'.
<!-- begin-user-doc -->
<!-- end-user-doc --> | EAttribute getAnperModel_DacPixel(); | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.