query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
6eb4a5a5ad1189b75b9cdd871134412f | 2518600b9cbafdd637acc94e53412686 | Add to current x number between -radius and radius | {
radiusValue += zoomStep;
radiusVector = new Vector3 (0, 0, -radiusValue);
this.Rotate (xRot, yRot);
} | 0 |
fb05f120ee31fab3d288c45bcb0809af | 96e0af0e59e63d1b1959edd30ccec4f7 | 根据键获取Byte数组 | public class NBTImp_v1_7_R1_R2_R3 extends AbstractNBTTagCompound
@Override public byte[] getByteArray(String key){
return (byte[])this.getBase(key,"getByteArray");
} | 1 |
ce39e4021cca4aaba5d74c1da7911c52 | 75283b697e3c252294ff300346150567 | According to the documentation modifying the text from this method is an error so we don't need to worry. | void CTextBoxWidget::SetText(const WCHAR* newText) {SetText(newText, true);} | 0 |
11bd3847c159c2748bd997662a6f0daf | 4610228dc87fa864f1869d87c4d4e799 | Parse an XML string and extract a map of all attributes | public final class Game
private Map<String,String> getAttributes(XmlPullParser parser) throws Exception {
Map<String,String> attrs=null;
int acount=parser.getAttributeCount();
if(acount != -1) {
attrs = new HashMap<String,String>(acount);
for(int x=0; x<acount; x++) {
attrs... | 1 |
c2b15f55a7710450cc07ab16fd3c2e1d | a1ee9a06475f15e38180f4af24a12222 | Use linked list to store the index of frames, the order of the list is the
order of victims. The larger index, the more recent frame. | class FifiLsFrames(SofiaFrames):
def __init__(self):
super().__init__() | 0 |
8b1a4b3eaaf6a092e38a13cefcfb9d34 | b11efd1b4510760bdccc6ab4a8c3a0d9 | Tells if this note letter can be assigned with any pitch modifier to a semitone distance
to C. Ex.: D can be assigned to 3, because D# is 3 semitones above C. On the other hand,
A cannot be assigned to 6, because only 8 (Ab), 9 (A) and 10 (A#) are assignable. | bool WavetableSound::appliesToNote(int)
{
return true;
} | 0 |
777c806845819631b13adcc012422861 | f6d9adaab2bedc3fb9ef85535083627f | 修改宠物属性 | this.m_petID = petID;
this.m_petInfo = G.DataMgr.petData.getPetInfo(this.m_petID);
this.m_isActive = G.DataMgr.petData.isPetActive(this.m_petID);
this.m_petConfig = PetData.getPetConfigByPetID(this.m_petID);
let length: number = 0;
let jushenStage = Math.floor(PetData.get... | 1 |
ca5bc9516beecb08dfb06f0f36741589 | 711bbc3fe948bd1c7c71046479a73c77 | 设置此窗口 y轴正位移
unit : px | class CommonDialog : BaseDialog() class Builder(private var activity: FragmentActivity)
fun setOffsetY(@FloatRange(from = -1.0, to = 1.0) offsetY: Float): Builder {
this.offsetY = offsetY
return this
} | 0 |
ec22394c76c625389f3a0c352bdaf683 | ae3a1d518e5c3220b49b3ac1a7c6bd4d | 检测是否有安装安全芯片 | void File_Check()
{
FILE *fp;
char szBuf[255];
GetSystemDirectory(szBuf,255);
char *filename="TCCSetup.exe";
char a[2]="\\";
strcat(szBuf,a);
strcat(szBuf,filename);
fp=fopen(szBuf,"r");
printf("\t是否安装安全软件:");
if(fp==NULL)
{
printf("未安装\n\n");
}
else {printf("已安装\n\n");}
} | 0 |
1ab269e739ba4bf8c3d71fb89c772d84 | ed380dff3a2682886d84732ae47ee861 | 栅栏密码解密(未知栅栏数,自动计算,返回第一个可分的结果) | if len(text_encrypted) % self.num != 0:
raise RuntimeError("待解密的密文应该是栅栏数的倍数")
text_decrypted = str()
groups = RailFence.__divide_group(text_encrypted, len(text_encrypted) // self.num)
for order in range(len(text_encrypted) // self.num):
for each_group in groups:
... | 0 |
64f681b06e084f5791a55ae8c54d0c70 | 8cd891ac7d93bd2ad3bc34974df01b65 | 取得各科的平均值,总分平均值为各科平均值的和 | let total_arr = [];
stuList.forEach(item => {
total_arr.push(item.subject[0].score);
total_arr.push(item.subject[1].score);
total_arr.push(item.subject[2].score);
total_arr.push(item.subject[3].score);
});
let median =getMedian(total_arr);
let total = total_arr.reduce... | 0 |
060f3da708cfa3392e0642e5039dce4b | fd5572b01e1b08641657cd9d482ce29d | find first selected extruder | {
if (isFilamentLoaded()) unload_filament_withSensor();
set_positions(extruder, true);
if (active_extruder == (EXTRUDERS - 1)) setSEL2pos(0);
else setSEL2pos(EXTRUDERS);
isEjected = true;
engage_filament_pulley(true);
tmc2130_init_axis(AX_PUL, tmc2130_mode);
move_pulley(EJECT_PULLEY_STEP... | 0 |
161f1f1b794c7e095372b6c114c09cfa | 81d1b9c3ef557cd0af68733e8470f11e | 登陆后将登陆前提交的反馈信息绑定到该账号 | personinfo = (Personinfo) account.getPersoninfos().iterator().next();
session.put("user", account);
session.put("personinfo", personinfo);
return "success";
} | 0 |
30b3db2bf81a6c4b6d7c76629830ed3f | 229ac307f7ed197333dd51ea8fea09a3 | Sets the uid to the incoming integer value. | public class LoginSession
public LoginSession setUid(String uid) {
this.uid = uid;
return this;
} | 0 |
afd9990184ad773c54986b785d106936 | f15c88cc18eab424ba68d4ecef319342 | Get contribution date. | class OneTimeContribution extends BaseOneTimeContribution implements SignableInterface
public function getContributionYear()
{
return parent::getContributionYear();
} | 0 |
3bfc6b2bcc02500cb66231b8ad1e1c95 | 92ae4fcb092960c4c71e72bc7f68e4aa | Postcondition: Returns the device's basic information. | class EC3PO(uart.Uart):
def get_device_info(self):
return self._device_info | 1 |
068ce21d95dba195b908cbc15479c995 | c63099379da32c621fb77e6458fba486 | Returns language code for the given command data. | {
$fieldNames = array_keys($data['fields']);
$languages = array_keys($data['fields'][$fieldNames[0]]);
return $languages[0];
} | 1 |
bfdfb9fff652835e04ebdb88e7d49cf0 | 2f78619b16f1b8957f56b37d6adcdb34 | アクセス認証を考慮したWeb APIのClientを生成します。 | namespace My.CoachManager.Presentation.ServiceAgent
public static class ServiceClientFactory
public static TClient Create<TClient, TService>()
where TService : class
where TClient : ClientBase<TService>, new()
{
var client = new TClient();
if (client.ClientCre... | 1 |
6f3ec0c62c01603478c139b3056e3dc6 | 0296c4b0cf811238939e35fdf93e6b42 | 双向BFS 时间复杂度为O(M * N) M为字符长度 N为wordList 大小 | if (beginWord == null || endWord == null) return 0;
Set<String> wordSet = new HashSet<>(wordList);
if (!wordList.contains(endWord)) return 0;
Queue<String> beginQueue = new LinkedList<>();
Queue<String> endQueue = new LinkedList<>();
beginQueue.add(beginWord);
end... | 1 |
9929a56394a3343e435e9eefd7ea9b14 | 770cf83505ff97e8ea0598965db262ff | Make sure that the judge works correctly for a correct C++ program. | $this->check_sandbox_enabled('liusandbox');
$sandbox = new qtype_coderunner_liusandbox();
$code = "#include <stdio.h>\nint main() {\n printf(\"Hello sandbox\\n\");\n return 0;\n}\n";
$result = $sandbox->execute($code, 'C', null);
$this->assertTrue($result->error === qtype_c... | 0 |
e98be14788e9dc2d73551601d05783e5 | c64f1c653002f664fcd5313c460adc66 | reads file at given test filepath | class TestPerfData(unittest.TestCase):
def _readTestFile(self, filename):
testFile = open(os.path.join(os.path.dirname(__file__), filename))
try:
return testFile.read()
finally:
testFile.close() | 1 |
cddc7f388739e9773873043a9126c22d | 6736219d05c7c0e97031d20b4a843bf0 | Returns a new object of class '<em>Rule Ref</em>'.
<!-- begin-user-doc -->
<!-- end-user-doc --> | RuleElement createRuleElement(); | 0 |
3b4931c5ce0ef239e1f6cc70ae65c2c4 | 9cef1c995947ea5dcb05b2fceeaf7461 | Returns the name of the role the user would prefer to have. | public class PlayerEntry
public String getSuggestedRole() {
return suggestedRole;
} | 1 |
ca8e698a1e492b09ad1e1a924e24a745 | 86cff4f176526064da9176b3b00db33b | Calculate the n-th moment of histogram about the value c. | if c > n:
return 0
if c == 0:
return 0
delta = (2 ** n) - self.B(n, c)
if delta <= 0:
return 0
return min(2.0 ** (log(delta, 2.0) - n), 1.0) | 0 |
97806a0fa9b4f21982b280468532b2bb | 3801bd94c7550c2962a77c615c9830f2 | how to convert the format of seconds to minutes and seconds MM:SS | class Utilities
static function seconds2MinutesAndSeconds($timeInSeconds)
{
$timeInMinutes = (int)($timeInSeconds / 60);
$newTimeInSeconds = (int)($timeInSeconds % 60);
if ($timeInMinutes < 10) $timeInMinutes = '0' . $timeInMinutes;
if ($newTimeInSeconds < 10) $newTimeInSeconds = '0'... | 1 |
f63548318ac89e17a5eab9d53ec24985 | 9c4538313a529b05c7cc12278bc758ad | если уже отправлял ранее | def just_pin(m):
if m.text == '@danekbel_chatbot':
try:
if m.reply_to_message.content_type == 'text':
text = m.reply_to_message.text
image_gen.image(m.chat.title, m.chat.id, m.from_user.username, m.from_user.id, text, 2)
bot.send_photo(m.chat.id, o... | 0 |
1b4eec9a0592934d0fc2e323c6aed964 | b01112e46699ab1f974c9ad0df9f3296 | slave : Address of the slave to which write is to be performed
addr : Offset address at which data is to be written
addr_size : Number of bytes of offset
data : Data to be written to the specified offset
0 on Success, -ve on failure | uint8_t SWI2C_Write_8bitSlaveAddr_8bitReg_8bitData(uint8_t uAddr, uint8_t uRegAddr, uint8_t uData)
{
volatile uint8_t u32Delay = 0x50;
SWI2C_SendStart();
while(u32Delay--);
if ( (SWI2C_WriteByte(uAddr,DrvI2C_Ack_Have,8)==FALSE) ||
(SWI2C_WriteByte(uRegAddr,DrvI2C_Ack_Have,8)==FAL... | 0 |
65dcb156113a96ddcc9c402cb478b7be | a5b99fbc6c8c8d62a70680e52f4f6823 | The OpenID Connect Issuer URI that represents the entity which issues access tokens for this application.
When using Azure Active Directory, this value is the URI of the directory tenant, e.g. https://login.microsoftonline.com/v2.0/{tenant-guid}/.
This URI is a case-sensitive identifier for the token issuer.
More infor... | class AzureActiveDirectoryRegistrationResponse(dict):
def open_id_issuer(self) -> Optional[str]:
return pulumi.get(self, "open_id_issuer") | 1 |
ec1e9562fc995f7c442892e6e3f5ca7d | 585ed58693ccb6e84cd42355fe5926df | returns number of points on hull. | {
int hull = 0;
for (int i = 1; i < npts; ++i)
if (cmppt(&pts[i*3], &pts[hull*3]))
hull = i;
int endpt = 0;
int i = 0;
do
{
out[i++] = hull;
endpt = 0;
for (int j = 1; j < npts; ++j)
if (hull == endpt || left(&pts[hull*3], &pts[endpt*3], &pts[j*3]))
endpt = j;
hull = endpt;
}
while (endpt !=... | 1 |
8fc2a5d71d81af5d84afa4cfe706e70e | 560bdd3147d08825892d8e1bf49edf54 | \brief Set server's callbacks | void NimBLEServer::setCallbacks(NimBLEServerCallbacks* pCallbacks, bool deleteCallbacks) {
if (pCallbacks != nullptr){
m_pServerCallbacks = pCallbacks;
m_deleteCallbacks = deleteCallbacks;
} else {
m_pServerCallbacks = &defaultCallbacks;
}
} | 1 |
968d2eb5375808c45797f88fb31343f3 | 26ffd6c2e5945a47db21be04be97238c | 清空MODEL中的options、table_name属性 | $this->options = array ();
$this->table_name = '';
return $this;
} | 1 |
95f9802a80a819dbf5d66a18fcacb21e | 50c68a6d156897e8a86354d57a9a756d | Opens a dialog and starts listening to file change events | return dialog.showOpenDialog({
defaultPath: logPath,
buttonLabel: 'Load File',
filters: [{
name: 'Logs and saved HTML/JSON',
extensions: ['log', 'html', 'json']
}, {
name: 'All files',
extensions: ['*']
}]
}, {
properties: ['openFile']
});
} | 0 |
caf6f61ef292b292d0abd6ed55707826 | 1a264129de571bebdb2245ddc0d51cc6 | saves the user's address to the database | class UserViewModel(private val repository: AppRepository) : ViewModel()
fun saveAddress(address: Address) = viewModelScope.launch {
repository.insertAddress(address)
} | 1 |
1f57c480b50a5f7e1d6e91f90d705b64 | 0f49046adaa9deddecfbfa1b2f554a08 | Function to replace stars with zeroes | char *fucking_star(int z, int dot, int nu1, char *ptr)
{
int len;
char *s;
char *ptt;
char *ko;
ko = ptr;
len = ft_strlen(ptr);
ptt = ft_strdup("");
s = ft_strdup("");
if (ptr[0] == '-')
{
ptr = ptr + 1;
ptt = ft_strdup("-");
free(ko);
}
while (nu1 - len != 0)
{
ptr = ft_strjoin(ft_strdup("0"),... | 0 |
d3b79a4f826e62b6a367c52577bb738f | bf2786f0ddd8b91297f9def110d74cd2 | [5.1c] | function question1() {
answer = prompt('Can I speak French (please enter yes or no)?');
answer = answer.toLowerCase();
if(answer === 'y' || answer ==='yes') {
alert('The user guessed "' + answer + '" that I can speak French. Oops wrong answer.');
console.log('The user guessed "' + answer + '" that I can ... | 0 |
83a8af422cb1b2eda58b2a35d9a8b981 | e38af2229dd74d870b9dda97b93519c7 | Sets the CIty Params for Complaint on Index, New and Create. | System.out.println("1090--ADD EVENT PARAMETRS ##########");
DCBindingContainer bindings = (DCBindingContainer) BindingContext.getCurrent().getCurrentBindingsEntry();
DCIteratorBinding paramIter = (DCIteratorBinding) bindings.findIteratorBinding("ParameterIterator");
String hasSitusAddrIn... | 0 |
88ded24f1d881f3770898dab9cebf9ea | b8b6442019f5029997b108ff3cb3f1f7 | Add the teleport State at the correct place in the State buffer. | {
if (_states.size() == 0)
_states.emplace_back("external_static");
else
_states[0] = State("external_static");
} | 0 |
103d4342b26e77cfa47b76bdaca1741c | 23998f635ac88e1b6dd234c3a522dd6c | 通过text查找到元素并且输入内容 | class BaseFrame(object):
def findbyresourceId_and_input(self, resourceId, inputtext):
ele = self.findbyresourceId(resourceId)
self.ele_input(ele, inputtext) | 0 |
7dda138d346a4675adb8dbb45a48a99a | b8ea6aef26e5e6042d760c1963eb0f48 | function which calls all the sub classes draw functions with variations on the given starting y position | y, max_y = @draw_y, @draw_y
layout_array.each { |dt|
@draw_y = y
draw_data(dt)
max_y = @draw_y if @draw_y > max_y
}
@draw_y = max_y
end | 1 |
40a8155ec1d592a4343f619ae532e1fc | 22e4c741a5a5c236c7adaced8dd75c6e | Tests that the context lookup created by TreeView.takeAction() only contains
the node once when the node doesn't contain itself in its lookup. | class GetChildrenTests(TestCase):
def test_task_action(self):
node = next(tasks_from_iterable([action_task]))
self.assertThat(
get_children(set(), node),
Equals([node.root()]))
node = next(tasks_from_iterable([message_task]))
self.assertThat(
get_child... | 0 |
e82a169ea38e43ebc1d3a5ce1a10fc5f | 395e7ebdcecce790aa66316c5f8becf8 | point is further away from the mouse pointer than this squared distance, the data tip will not
be displayed for that point.
<br> | export class DataTransferModifier
public set max_distance(value: number) {
PythonInterop.setFloat(this.interop, `${this.accessor}.max_distance`, value)
} | 1 |
17bd249e67030b39d82101ae843f83e2 | 181e7960ceb7e23bcdf07ca4268d380d | Le navigateur prend-il réellement
en charge l'élément vidéo ? | function isSupported()
{
return (isIE || isMoz);
} | 0 |
9542c2c3546ad915d01e2b825c007a3f | bd8eaaa6df33fc24bcd53e3130b60876 | that contains the area and perimeter of that rectangle | def rectangle_area_peri(length,width):
area = length * width
perimeter = (length + width) * 2
result = [area,perimeter]
return result | 1 |
efe4b39dbf680068b2671750a81ffd60 | 1f4412d4819da801e1f7fec414f77d79 | Performs status-checking on the response given from the LCBO API server. | try:
if resp['ResponseMetadata']['HTTPStatusCode'] == 200:
return True
else:
return False
except:
return False | 1 |
0ccdb900b2ba953a8b905834125c2aa1 | 9bd82502eda61636495c229f4bc27710 | Test the property 'TimeZoneId' | namespace Elli.Api.Tools.Test
[TestFixture]
public class LoanContractClosingCostLoanEstimate1Tests
[Test]
public void ClosingCostEstimateExpirationTimeZoneTest()
{
} | 0 |
ecd4a34a0f1e885c11e766e15b154618 | ed67efbec8ba0ab3a865e026b2358387 | 剩余数量转化为采购时的单位 | {
string strQuantity = string.Empty;
if (quantity >= 10000)
{
float tmp = (float)((int)((float)quantity / 1000)) / 10;
}
else
{
strQuantity = quantity.ToString();
}
return strQuantity;
} | 0 |
3bee1bd8af6313011f4536e6ca40ffef | 3d3dc7dfa5e23da7cfb8653e2b5d3fc5 | Update the default window co-ordinates | self.win_location()
self.win_x_offset = 1922
self.win_width = self.screen_width-8
mainWindow.geometry("{}x{}+{}+{}".format(self.win_width,
mainWindow.winfo_height(), self.win_x_offset, self.win_y_offset)) | 1 |
f6fa0842ce51e865208ff01c84547dbb | e82a3d889707d59331126393ead2ae34 | 不正コンディション一覧 | $objQuery =& SC_Query_Ex::getSingletonInstance();
$objQuery->setOrder('rank');
$result = $objQuery->select('product_condition_id, product_condition_name', 'dte_product_condition', 'del_flg = 0');
$arrProductCondition = array();
foreach ($result as $val) {
$arrProductCondition[$val['product_condition_... | 0 |
4154b78a28ec204eb93492c1b7307c3e | 958e6dd7f2363115138b90739d846681 | Perform a response heartbeat to keep the video download connection alive. | class Client(object):
def keep_alive(self):
try:
res = post(self._url + '/keep_alive', self._headers, b'')
except URLError as err:
self.handle_error(err) | 1 |
feac0e4662942f6895bc2acf6bf3de69 | e71bf56ea09eea1c18a8a0e2f1ff3d8f | レアリティ画像を設定する関数 | class LC_Page_Repair_Ex extends LC_Page_Ex
function lfInitFile() {
$this->objUpFile->addFile("修理アクセサリー画像", 'image', array('jpg','gif','png'), IMAGE_SIZE, true);
} | 0 |
54d88d46fe63a341cd656d60729a2d55 | 75ae961504c99ddb5eb67836a3704cf7 | It changes the mouse cursor into a hand | global handActivate
mouse.set_cursor((16, 16), (14, 1), (0, 0, 0, 6, 0, 30, 0, 124, 1, 252, 7, 248, 31, 248, 127, 240, 127, 240, 1, 224, 1, 224, 1, 192, 1, 192, 1, 128, 1, 128, 0, 0), (0, 7, 0, 31, 0, 127, 1, 254, 7, 254, 31, 252, 127, 252, 255, 248, 255, 248, 127, 240, 3, 240, 3, 224, 3, 224, 3, 192, 3, 192, 1... | 1 |
becbb4a2d8f665538c7fa86837ea6d26 | f60673530b0b239121852f0d943e2ed3 | 处理开福袋弹框-关闭 | local function closeItemClick()
popUpCloseAction(ThePlanOfBuyBallOwner, "infoBg", _layer )
end | 1 |
44a74c597836205780fbd21653dcebe0 | 3fed5f08fe97614cc4980e533e5ffd9d | 删除充值余额记录 | @Log(title = "充值记录", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@ResponseBody
public AjaxResult remove(String ids)
{
return toAjax(tAgentBalanceLogService.deleteTAgentBalanceLogByIds(ids));
} | 1 |
48c7c5e4bb2056e1a5856855f0b8777c | 1e4d7a6383562369f7c44499b995b58a | stops movement upon release | namespace Complete
public class TankMovement2 : MonoBehaviour
private void OnDisable()
{
m_Rigidbody.isKinematic = true;
} | 1 |
46dd610d4a4a8a6c02833992b404d71f | f3204f9e875ed2bf11a479b34103ad8b | Divides two ExtendedDecimal objects, and returns the
integer part of the result, rounded down, with the preferred exponent
set to this value's exponent minus the divisor's exponent. | namespace PeterO [Obsolete("Use ExtendedFloat instead, which supports more kinds of values than BigFloat.")]
public sealed class BigFloat : IComparable<BigFloat>, IEquatable<BigFloat>
public BigFloat DivideToIntegerZeroScale(
BigFloat divisor, PrecisionContext ctx) {
return math.DivideToIntegerZeroScale... | 0 |
995461c47a0dfbf5000a68d1fee39e7a | 55b504073c5c32b63b010bb92bb7fa48 | 设置重泡比Service | class ServerViewModel : ViewModel(), Observable
fun setThrottle() {
if (model != null) {
model?.setThrottle(throttle_value.value!!.toDouble())
}
} | 0 |
b007613dc2b1a998126a58622043c2a8 | 16332e6fac705095e4e59b7bcc974c70 | Convert the relative distance traveled along each axis from units of mm to steps | void Extruder::setAxisStepsPerMeter(unsigned long stepPerM) {
axisStepsPerMM = stepPerM/1000;
recomputeParameters();
} | 1 |
cb003ef314be2ea3125f77cc7689774c | 7473081a010067e8b32b692f9f1005f3 | Excluye las instancias que tengan problemas. | LinkedHashSet<SourceCodeInstance> filtered = new LinkedHashSet<SourceCodeInstance>();
for(SourceCodeInstance srci : srcInstances) {
if(filtered.contains(srci)) {
if(srci.mustCompile) {
filtered.remove(srci);
filtered.add(srci);
}
}else {
filtered.add(srci);
}
}
return new ArrayLis... | 0 |
9dffee40d580fd3ee3c5d21531d53097 | ec146117334b50035a5ca8d015b35857 | Get a list of giveaways for the given deal ID. | {
if ($dealId === null) {
throw new \InvalidArgumentException('Missing the required parameter dealId');
} elseif (!TypeCast::canCastToString($dealId)) {
throw new \InvalidArgumentException('Invalid dealId value: string required');
} elseif (strlen($dealId) < 36 || str... | 0 |
fd6cb7fa4693c885e72e4a30ed512b69 | 37c3e1dc7703721b2d55e028e7b2cc71 | Loads instances for analysis and give possibility to extract properties
of interest. | def load_instances(type):
global instances
extra = ''
if type=='cyclic':
extra = '_cyclic'
try:
instances = pickle.load(open('Instances/instances'+extra))
except:
instances = pickle.load(open('../Instances/instances'+extra)) | 1 |
421eb4dc5e46ae8f95e5e4fba62a65ff | 8adc439228867840102079ef8c37056a | Gets the upload information from the database. | {
UploadInfoEntity entity = null;
using (SqlConnection conn = GetConnection())
{
string cmdText = "SELECT UId, Url, Width, Height, Thumbnail, Title, Description, Tags, IsShare, Date, Owner FROM upload_info"
+ " WHERE Owner = @Ow... | 1 |
c41b635fb4b9e887b87f632fb60ba700 | c62055f107b4ef71be202cedc7b7399a | Setup the peer listener.
The peer listener listens on a tcp socket, the peer connections will come
through it. | public class Networkinterface
public boolean setupTCPListener()
{
return tcpService.setupTCPListener();
} | 1 |
c0a5def06ae51dd5ad83fcca658a0d2e | 155fdf610091d472b5456affd18e305b | Return all lemma names for all synsets for the given
part of speech tag and language or languages. If pos is
not specified, all synsets for all parts of speech will
be used. | if (pos == POS.ALL) {
return LightImmutableList.copyOf(uniq(merge(lookupWordSenses(someString, POS.NOUN), lookupWordSenses(someString, POS.VERB), lookupWordSenses(someString, POS.ADJ), lookupWordSenses(someString, POS.ADV))));
} else {
return doLookupWordSenses(someString, pos);
... | 1 |
d5db17c2bc512b087cdadb60ed27a5bd | 34f870e2b444bfaef8791d7a7e9afd19 | Memoization decorator for functions taking a nonzero number of arguments.
References:
http://code.activestate.com/recipes/578231-fastest-memoization-decorator | def memocpy(maxsize=100):
def deco(f):
memo = {}
@wraps(f)
def func(*args, **kwargs):
key = (args, frozenset(kwargs.items()))
if key not in memo:
if len(memo) == maxsize:
memo.popitem()
memo[key] = f(*args, **kwargs)... | 1 |
75ccb587c3b5e03465fbe988f3852296 | 63f5e38916e07e795479d80238122d3c | Launch histogram tool on a database. | options = GetOptions(False)
bv = BinaryViewType.get_view_of_file(options.bn_database)
bv.update_analysis_and_wait()
(success, error_message) = export_bn(options.json_file, bv)
if not success:
print "Error: {}".format(error_message) | 0 |
270911e1cc444a3f2b789f0aad419d3c | 42ff9266c8c4a16f9c636289c83ec053 | # Get the HEX of a colour | {
return str_pad(dechex($r), 2, '0', STR_PAD_LEFT) . str_pad(dechex($g), 2, '0', STR_PAD_LEFT) . str_pad(dechex($b), 2, '0', STR_PAD_LEFT);
} | 1 |
e51184359bfb946786564f7c694a39ac | 053490f88392c5f12dceb142aa2cd22c | 获取消息并发送给下一个组件的方法,会被storm 不断地调用
从goods数据中随机取一个商品名称封装到tuple中发送出去 | public void processElement(Order order, ReadOnlyContext ctx, Collector<Tuple2<Order, String>> out) throws Exception {
ReadOnlyBroadcastState<Integer, String> broadcastState = ctx.getBroadcastState(GOODS_STATE);
String goodsName = broadcastState.get(ord... | 0 |
7cfd284ee2d88bc420850b0bd82b294a | 3cf6af4e741aa32157d3200ed6735daf | Construct a boarding card. | class TrainBoardingCard extends AbstractBoardingCard
public function __construct(AbstractPlace $origin, AbstractPlace $destination, $trainNumber, $seat)
{
parent::__construct($origin, $destination, $seat);
$this->trainNumber = $trainNumber;
} | 1 |
2504675011de4970069e38ec9d3cef00 | 90c2944b3df45e2f60bbbd8e1dc96b4e | 删除填充矩形 | {
if (CurrentSelRect.Count() > 0)
{
foreach (ShapeEle item in CurrentSelRect.arrlistShapeEle)
{
myShapes.deleteShapeEle(item);
myShapes.addShapeEle(item);
}
}
this.Refresh();
... | 0 |
18cc25ae048e00492a68cb7aad1880d5 | de3728198febd582e01583fed70d0f5f | Dodaj novog zaposlenika u salon s id-jem $id. Postavi mu smjenu i ime na prazno te traži od salona da napravi izmjene u podacima. | @Repository
public class EmployeeMapper
public void addEmployee(Employee employee){
if(employee.getId() == null)
employee.setId(initialID++);
employee.setDepartment(departmentMapper.getDepartmentById(employee.getId()));
employees.put(employee.getId(),employee);
} | 0 |
7e8215718440f28d313f609abe589e68 | 31289da9a913e799b9e7ec2b40e3b66a | Display error message and exit out of this Activity | final String errorMessage = message;
final String messageTitle = title;
runOnUiThread(new Runnable() {
public void run() {
if (mErrorDialog != null) {
mErrorDialog.dismiss();
}
AlertDialog.Builder builder = new Alert... | 1 |
ddd858257b05f7e8ecb8f6fe1c3544ae | a7bd694c2cfe94f6cc0e9af5960185be | Получить задачи созданные пользователем | {
$tasks = static::TASKS;
$docs = DocumentManager::DOCS;
$result = array();
$simpleTasks = DatabaseManager::Select("*", static::TASKS,
"to_id=$userId and graph_id is null order by creation_date desc");
$graphTasks = DatabaseManager::Select(
"t1.* from $tasks t1 inner join $docs t2 on t1.graph_id=t2.id
... | 0 |
c4f1e3ba16c927c9bb9b0c69dfd9dcbf | 5dbb5a26bc2c7b3bad9595df41e7b15a | ! Resolve a integral de Gauss Legendre com 3 ponto | let xi, wi, resultado = 0;
for (let i = 0; i < n; i++) {
if (n === 2) {
xi = ordem2[i][0];
wi = ordem2[i][1];
} else if (n === 3) {
xi = ordem3[i][0];
wi = ordem3[i][1];
} else if (n === 4) {
xi = ordem4[i][0];
wi = ordem4[i][1];
}
resultado += wi * f(((b - a)... | 1 |
c2e59ac75f46fe8471323cf177e96beb | e16c1d33319da60bb7750c62730aa334 | Register redirection services. | def register_redirection():
return redirect(f'{request.url_root}/{config.URL_PREFIX}', code=302) | 1 |
16ae753fee9c1db4e50353238e0b6f69 | 6fb4611718d693c5606e8ceab57330a2 | Add newly created child directory to parent. | class MemDir(dict):
def create_child(self, newdir: 'MemDir' or str) -> 'MemDir':
if type(newdir) == str:
newdir = MemDir(name=newdir)
newdir.parent = self
super().__setitem__(newdir.name, newdir)
return newdir | 1 |
381100ba463d9bf7a4871b05b929b359 | a6dd4ff965719326c698b74d887ce0f1 | 根据当前的状态与child的布局属性,决定child是否显示 | public class ArcLayoutView extends ViewGroup implements ArcSlidingHelper.OnSlidingListener, ArcSlidingHelper.OnSlideFinishListener
private void updateChildVisible(View view, int index) {
} | 1 |
463ad2dc053f4c023487878aeba2c4c5 | 1b8cfcae8bbfbc0432b920820c0f40b7 | Holds meta data for different evaluation functions. | class Meta(object):
def __init__(self, name):
self.meta = {}
self.name = name | 1 |
dc395c366365f8e2314363ec8dec6521 | de9ff7515a560dcffba96f77a7eba93c | Adds a LabTest to the database | namespace MVC_Demo.Controllers
public class LabController : Controller
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult Create([Bind(Include = "Lab_Id,LabTestName,Price")] Lab_Information lab)
{
lab.Lab_Id = GetLabList().Max(d => d.Lab_Id) + 1;
if (ModelState... | 1 |
d0014ff7b619aa9c986811ca214a24b2 | b6e598a1b08a12d44c2becb2122eab35 | 可能であれば新しいビューへのトランジションを開始する | class IllustratorViewFragment : BaseIllustratorViewFragment()
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
binding = DataBindingUtil.inflate(inflater, R.layout.illustrator_view_fragment, container, false)
val root = binding.root
... | 1 |
e355478a6a19060a21dd3c2cb4574b96 | 4fca7238a9237bb3bc0302e8c6524314 | It returns an empty string if this instance is the source | class MtLoString implements ILoString
@Override
public ILoString getRest() {
return this;
} | 0 |
c259d03917f9bf8b79a3be9f0ec110f5 | 858d4e8c0becfeb2fb5f4fa2db1c67be | Tämä funktio tarkistaa, onko peli ratkaistu. | String voittaja;
String haviaja;
int voittajanPisteet;
int haviajanPisteet;
if (pelaajan1Pisteet == mihinPelataan || pelaajan2Pisteet == mihinPelataan) {
jatketaan = false;
if (pelaajan1Pisteet > pelaajan2Pisteet) {
voittaja = pelaajan1Nimi... | 1 |
c05eb757a7de34528a35bddd99863e14 | 81c21e762ee04aff4a6b075bd65cfaeb | 首頁的顯示 | {
$sliderMains = slider::where('position','<>',0)->where('position','<',999)->where('status',1)->get();
$sliderSub = slidersub::where('position','<',3)->where('status',1)->get();
$banner = banner::limit(1)->where('status',1)->get();
$healthtip = healthtip::where('position','<=',4)... | 1 |
3bcdf1fd63802af62a724b710e854493 | 8565de1dedaa8451ff0b9561b854f035 | 入库订单显示 | $o_order = spClass("o_order");
$param = $this->spArgs();
$order_id = $param['chk_list'][0];
$results = $o_order->findSql("SELECT (SELECT COUNT(*) FROM o_order_detail X WHERE x.orderId=o.id) productCount,GROUP_CONCAT(p.name,' * ',d.amount SEPARATOR '<br>') AS productDetail,(SELECT SUM(price * amount) FROM o_ord... | 1 |
669845e9843993e5f3838a7220d0cb7e | 3d0dbe174754a56513da332a73fb15d6 | Reads all ten yob files. | Map[] array = new Map[10];
for (int year = 2001, i = 0; year <= 2010 && i < 10; year++, i++) {
Map<String, String> map = new HashMap<>();
try {
java.net.URL url = new java.net.URL(
"http://www.cs.armstrong.edu/liang/data/babynamesranking"
+ year + ".txt");
Scanner input = new Scanner(url.ope... | 1 |
47ee8461d34dbe37dc5c028328f72140 | ea7ea1007c0a7008b59acf54242386b3 | Route for managing activity documents | class ActivityResource extends MultiViewResource
public function get($request) {
$response = new Response($request);
$ID = $this->parameters[0];
$this->view = $this->get_view($request);
$this->model->setLocation($request->uri);
try{
$this->model->load($ID);
}catch (Exception $e) {
$response->cod... | 1 |
394d87119204f0132754e5dbbf3a79e4 | 33a1fdfecc5182e7ca9266d2da3af1e0 | Generates the FluentHibernate automap. | namespace Cadru.Data.Dapper
void Map(); | 0 |
caeb5dc479e185d4fd400c9f89a92768 | de40f83f0de1125749acc37ab07cca64 | the buttons to sort by date, citations, etc | function SortSelect({ handleSelect }) {
const options = ['relevant', 'helpful', 'newest'];
return (
<div className="sort-option">
<select id="sort-select" onChange={handleSelect}>
{ options.map((option) => <option key={option} value={option}>{option}</option>) }
</select>
</div>
);
} | 0 |
a7e07ce2aca4df98c9f0e1b9cc3ba5e2 | 7e8e4ec9826f6300c8090ded3c548986 | 设置是否显示条纹 | class WeChatQRCodeOption extends Option
public function setIsHyaline($value=false)
{
$this->is_hyaline = $value;
} | 0 |
affc37ddeab29d93587e8e917617bab8 | 05e3353df3d99d893c7fa7c211463222 | Apply the transformations encoded in a transformation matrix to
a 4D point. | namespace Aardvark.Base
public static V4d Transform(M34d m, V4d v)
{
return new V4d(
m.M00 * v.X + m.M01 * v.Y + m.M02 * v.Z + m.M03 * v.W,
m.M10 * v.X + m.M11 * v.Y + m.M12 * v.Z + m.M13 * v.W,
m.M20 * v.X + m.M21 * v.Y + m.M22 * v.Z + m.M23 * v.W,
... | 1 |
6ef1fa99c249f74a3ec53976e17f556e | 7a1b7e3a69a0b682c2529fffe322fd71 | Проверка существования игрока по id аккаунта | def check_account_exist(id: int):
for x in db:
if (x["id"] == id):
return True | 1 |
badac693211c5bcd6863ed0d5cf027b5 | 44ad68ec7ecbcaebb366a42a626fc35b | Create a string node based on the current cursor and the one provided. | if (token.type === types.STRING && this.isAction()) {
this.createNode('action', token.value);
return true;
}
return false;
} | 0 |
e740c30447acc5d9f75a9f9c14d092da | 3e3471019ddaa2f3085b7122d821a24e | Функция, выводящая шаг работы алгоритма | def iteration(it):
print("+-----------------+")
print("| Iteration = " +"%3d" % it + " |")
print("+-----------------+")
return | 1 |
454e176ff1b208f9b7e8ea579a2b419e | be7f4a9555dd36a1dddb116eb27dc50c | Invoked by users to obtain a record from disk. It uses sector aligned memory to read
the record efficiently into memory. | namespace Kosson.Interfaces
IRecord ReadRecord(); | 0 |
378dde1b943512420dcef1696a490424 | b55aeebf4aa1d48878fe6e651c76464b | Multiplies how much the "vertices" of each cell are skewed.<br/>
0 will create perfect squares, whereas 1 will push those "vertices" around and create a cellular / fractured look. | public class FastNoiseSIMD
public void SetCellularJitter(float cellularJitter)
{
NativeSetCellularJitter(nativePointer, cellularJitter);
} | 1 |
74dd71aec7f6c2063b34a387385db946 | 883929ff566bdc3f7a9597475c14aaed | Change floors possible only when in preview mode | class BattleFragment : BaseFragment(), BattleRoomMessageObserver.UiCallbacks, View.OnClickListener
override fun onPreviewStarted() {
if (isReplay) return
prepareBattleFieldUi()
binding.battleLayout.setMode(BattleLayout.MODE_PREVIEW)
} | 0 |
f3745b88b280a404ef53fcd788e340be | b9aba505a3bf3be8ccec20314d444745 | createArray
Creates an array from a string and removes any blank elements | $tmp = explode(' ', $str);
$has_blank = false;
foreach ($tmp as $key => $val) {
if ($val == '') {
if ($has_blank === false) {
$has_blank = true;
} else {
unset($tmp[$key]);
}
}
}
return $tmp;
} | 1 |
59fd93dbfc010d1d225e27dd9b5dc9b1 | 2543bcf28aabc2b88b36494b6e1f4515 | Support creating a star using noctuasky model data json values. | assert jsonObj != null;
try {
if (!jsonObj.has("type") || !jsonObj.has("ra") || !jsonObj.has("dec")) {
throw new NameResolverException(Status.CLIENT_ERROR_NOT_FOUND, "Not found");
}
double ra = Double.valueOf(jsonObj.getString("ra"));
double dec = Double.valueOf(jsonObj.getSt... | 1 |
05574d20d46aab17bff9eabdf01e35a6 | 2d71c9b9d9e487079ebd8f6b787c1b57 | 设置商家当前状态:online->上线,wait->等待,freeze->冻结 | @Table(name = "t_goods_distributor_mer")
public class TGoodsDistributorMer
public void setOnStatus(String onStatus) {
this.onStatus = onStatus;
} | 1 |
0cc355b9c2c0d642ffd759ad08cb64a9 | 7f3475b4f1651464771ef805ebac2acd | Remove an existing object from the exclude list | class File_List
private function remove_from_excluded( $file ) {
if ( in_array( $file, $this->excluded_files ) ) {
$i = array_search( $file, $this->excluded_files );
unset( $this->excluded_files[$i] );
}
} | 1 |
a8493c639dd110c64fcd7792e13b6d86 | 4c8c097d243a9c2f61fdaf9fe72b1a30 | str representation | class NumStr(object):
def __str__(self):
return '[%d :: %r]' % (self.__num, self.__string) | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.