query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
e408b87cf9033cf2dddb07cc007d80fe | 4e9246d14802fbf22b1e3c8b93fa83c8 | Performs linear interpolation on all rows of a matrix | class Matrix4x4
def lerp(matrix1, matrix2, amount)
end | 1 |
121182375d26e618cc2d74006937c652 | 4cc25ae4f6c1b79be931110bf6b76f11 | Configures the set reg creds form submit event handler, so an ajax post is
performed instead of a normal form post. | function configForm_onSubmit(evt) {
evt.preventDefault();
} | 0 |
0444ab10a56b78f0af5529a1476d632b | d8d50f20a7425f1adb5416257200c6af | Sets default values for a HitObject. | visible(defaultVisible),
posX(0),
posY(0),
angle(0),
alphaBlend(1.0f),
startFrame(0),
maxFrames(0),
frameWidth(0),
frameHeight(0),
currentFrame(0),
painted(false),
isFloor(floor),
texture(0),
copied(false),
sizeX(0),
renderTarget(0),
sizeY(0),
usingLife(false),
life(0),
beforeObj(0),
afterObj(0),
... | 1 |
c0e0f49380b435b8bda57887d6c355ef | 626fa8a605fe0763a4f01f3986cd93ae | Lista todas las entradas de un usuario | {
$entries = Entry::where('user_id', $user_id)->get();
$user = User::where('id', $user_id)->firstOrFail();
$tweets = $this->twitterController->getTweets($user->id);
return view('entries.list', [
'user' => $user,
'loggedUser' => $this->getUser(),
'e... | 1 |
c790e01ba404bfccbbb8f5e606b496f3 | b9f5b58430d16820bb75cf1f3bbebd46 | Computes the log (base 10) ligand concentration using and exponential gradient. | {
double l = exp(phi);
double ans = dkdlambda(l);
return l * ans;
} | 0 |
ff3da48d1392cf8001c9be7e8a3a6c8b | 62f6724ba69fefa4ced923601f8de0e8 | This method takes the two different classes as testing data, labels them, takes its
prediction with trained parameters, check the prediction against actual label, count the
true preictions and then return the accuracy of the model | c = GradientBoostingClassifier(n_estimators=20, learning_rate=1.0, max_depth=5, random_state=0).fit(repTr,labelTr)
p = atleast_2d(c.predict(repTe)).T
a = sum(p == labelTe) * 1. / len(labelTe)
return a, p, c | 1 |
cb0f834b9b039ac05f133663dcd408fb | 9a1150ea0d7aea6f301b1d38165ec0c0 | 根据treeId查询表sys_menutree_config中的数据 | List<JsonTreeData> selectMenuInfoListById(Integer systemId); | 0 |
6e4557b957c27292e8d11bd646e383c9 | fb2e93923c513c2a0c7309957ac7a203 | create object of predefined type | void *vlc_object_create( vlc_object_t *p_this, size_t i_size )
{
return vlc_custom_create( p_this, i_size, "generic" );
} | 0 |
6c9d90452d11f56ed39b407f9820b38b | 45f235155d98cad18ec43b8e2e4e5faa | 批量打开格口. | {
if (MonitorGraStatus.Length == 2)
{
try
{
int sd = Convert.ToInt32(MonitorGraStatus, 16);
if ((sd & 0x08) == 0x01)
{
EventUI nuilog = new EventUI();
... | 0 |
8953a6a65ba8de42fa416696157ec3b6 | cb436fc4b8c248527b28b7aef07760fb | 根据年份和月份获取月份天数 | public class JDKDateUtil
public static int getYearOrMonthDays(int year, int month) {
YearMonth yearMonth = YearMonth.of(year, month);
return yearMonth.lengthOfMonth();
} | 1 |
0490b93528849294a1b7891f3da9ad15 | 6371013485ae8a3507b3e65be85abc01 | The goal of fake GET is to check if this function was indeed called or not | def fake_callback( arg ):
pass | 0 |
74127debe558c68bbdadc946654d60c7 | 3ef00a10c3c1b397052f0dd11a4ec03e | カテゴリーの番号を指定してkindテーブルの値を割合が高い順に取得する関数 | {
s16b aux[MAX_DEPTH];
(void)C_WIPE(&aux, MAX_DEPTH, s16b);
s16b num[MAX_DEPTH];
(void)C_WIPE(&num, MAX_DEPTH, s16b);
if (alloc_kind_table)
C_KILL(alloc_kind_table, alloc_kind_size, alloc_entry);
alloc_kind_size = 0;
for (int i = 1; i < max_k_idx; i++) {
object_kind *k_ptr;
... | 0 |
5f7fb84970e2deab82a8eac14bb2d49e | 1d417e09597b6eca78275809080613db | Composes an HTML build report. | class ReportViewBuilder(ViewBuilderInterface):
def build(self, data: typing.Dict) -> str:
task_list: typing.List[dict] = []
for day in data:
day_ = {
'_': {'sum': 0},
'date': day['date'].strftime('%Y-%m-%dT00:00:00.000'),
'entries': []
... | 0 |
95d37158e05f81ca3dd06b22f103e788 | f72f10babab342871dc1d2b4bbdced42 | Sets the Nth element, counting row after row. | {
for (int i = 0; i < rows * columns; ++i)
SetElementN(i, sample);
} | 1 |
d33cfb77b736225f76a9efdcc6e45488 | 0ca810ca0f42bc18e694314e37ef36f3 | 显示当前的body | void CBodyDlg::OnBnClickedButton2()
{
displayBody->Render();
m_isClear = true;
} | 1 |
adcd989e6df9202761f2e6acbadb1c6a | de76ac13f56a5b5ab8be0a3924e7622b | If status is already in the list, don't add (return false) | class EventHandler(AbstractHandler):
def is_processed(self, status):
evstr = "%s::%s" % (status.author.screen_name, str(status.created_at))
if evstr in self.processed:
return False
else:
self.processed.append(evstr)
return True | 1 |
24e43a84cf6a5795e0fadeb655344356 | 3c1e0953b91036035e6bb5f6b0d1098d | Returns if there is a next {@link ISlice}. | abstract public class DS implements CCSDataSource
public boolean hasNext() {
return next;
} | 1 |
1a0a7baba959a8336e7a44d3f8f391b9 | 76f0f0d663855c43106562103888dc0a | Listar Mantenedoras (retorna um ResultSet) | throws Exception
{
List<Maintenance> list = new ArrayList<Maintenance>();
try
{
}
catch (Exception e)
{
}
return list;
} | 0 |
5dcab01b2f14369c72c5c464cd46abba | 322546299cbbbb7f401f205e1db7355a | Price Stream Get a stream of Account Prices starting from when the request is made. This pricing stream does not include every single price created for the Account, but instead will provide at most 4 prices per second (every 250 milliseconds) for each instrument being requested. If more than one price is created for an... | namespace Oanda.RestV20.Api
public partial class DefaultApi : IDefaultApi
public InlineResponse20020 StreamTransactions (string authorization, string accountID)
{
ApiResponse<InlineResponse20020> localVarResponse = StreamTransactionsWithHttpInfo(authorization, accountID);
return lo... | 0 |
ea7e45a0f68ecd5f5320d4ab853d3195 | ca506fa45b670ef1ba89361d4af38f17 | Updates the title for an already shown icon.
This is a platform dependent implementation. | class GenEditFrame(Object.OwnerObject):
def update_title(self):
debug.virtual('GenEditFrame.update_title') | 0 |
b662fc810cfcbaa9923c0f8169d7cba1 | 127af91047d56c274297fe9e85697c15 | Get the ITAUpdateControl interface from the TA Display Manager
Store it as a member variable for future use
The DisplayManager is a singleton so the reference should never change | kcg_int l_tafdisplay_int)
{
L_TAFDISPLAY l_tafdisplay;
l_tafdisplay = l_tafdisplay_int;
return l_tafdisplay;
} | 0 |
f66134d0e81edca64c8576019094ceae | 44cf3a49f396f6d17eb813167e695364 | Sets event handlers, and default variable values | function setEventHandlers() {
setAjaxEventHandlers();
} | 0 |
be310857a284fbe0023ba27f24365ca8 | 51f524c324d4f477f83c255c9750e915 | Attempts to upload a file tuple to Discovery using REST API (tuple includes the file name, the file content, and file content type).
Has a single retry on HTTP code 429 status. Returns a response with following format"
{
"success": True / False
"response_code": HTTP response code
"doc_id" : "The uploaded document Id, o... | self.active_endpoint = FileUploadEndpoint(ts_connection=self, initiate_file_upload=True).get_endpoint()
self.active_headers = self.default_headers
response = requests.post(url=self.active_endpoint, headers=self.active_headers, verify=self.ssl_verify)
return response | 0 |
a894fbc0eb98a62b7624614f08f714eb | a45641147d2a30467cdeed6ba2a7ff46 | 吧double转变成一个小数点两位的string 会四舍五入 | DecimalFormat df = new DecimalFormat("#.000000");
String str = df.format(dou);
return Double.parseDouble(str);
} | 0 |
0c0b32d0b837f95a3fbae530337bd4ea | 75a683974c5675bcd13dd88293c64cd6 | 기 등록된 서버정보를 수정한다. | public int updateServerCfg(IPConfig serverConfigInfo); | 1 |
69caaaebfa99134e6107554bf0caedde | ae6a5f3d386445a06045e95c43f7b26c | Test error is raised if coordinates do not match | class Test_apply_extraction(IrisTest):
def test_error_non_coord_units(self):
constraint_dict = {
"name": "probability_of_precipitation_rate_above_threshold"}
units_dict = {"name": "1"}
with self.assertRaises(CoordinateNotFoundError):
apply_extraction(self.precip_cube, con... | 1 |
0fd2cabd9f2e09c893af6f1c9c2fd040 | 691a845304572366762e65d23f5cf250 | Get list of reminders today | {
if ($now == null) $now = \Carbon\Carbon::now();
return $query->where('reminder_date', '>', $now);
} | 0 |
825a92eb67fe51284194712c716abb54 | c80ef9541b5e1be626a91f20521666b6 | 包含核心公共的函数库 | {
require_once(COM_PATH.'/common.php');
$list = [
CORE_PATH.'/Action.class.php' ,
CORE_PATH.'/Model.class.php' ,
CORE_PATH.'/Db.class.php' ,
CORE_PATH.'/Log.class.php' ,
CORE_PATH.'/View.class.php' ,
] ;
foreach($list as $key=>$value) {
if(is_file($value)) {
require_once($value);
}
}... | 1 |
ff3bd14cdace7eda8e08d0a7b36b4f38 | fb32a296cf6a7e335b9f8224e01e23d2 | Traverse and return the tree's nodes, yielding parents first. | node = self
while node:
node = node.parent
yield node | 1 |
e446038603e92555cc1db79860073a48 | 56f736ca403d0d0f00f44fd35e1fffa9 | Trim scale to the image size | self.scale = scale
self.xdim = int(self.imgx * scale)
self.ydim = int(self.imgy * scale) | 0 |
927e761a544d6f0372505396cc4b5b93 | 0d162a841b5414ae7375518a94a42b78 | Set the value related to the column: STAT_NB_SMS. | ContentValues values = new ContentValues();
values.put(CustomersSMS.CN_sent, sent);
db.update(CustomersSMS.TABLE_NAME_CUSTOMERSSMS, values, CustomersSMS.CN_ID + "= ?", new String[]{String.valueOf(customerId)});
} | 0 |
4f21ac263a79e90df2e6826f9f3e9279 | 927153f915a83912c23c56e16ad28eb5 | Team validieren | function validateRegistrationForm() {
let passwordV = document.forms["RegistrationForm"]["password"].value;
let passwordREV = document.forms["RegistrationForm"]["passwordRE"].value;
let emailV = document.forms["RegistrationForm"]["email"].value;
let emailREV = document.forms["RegistrationForm"]["emailRE... | 0 |
471d267b505247ef00c1d12c29f2a256 | df38e5394d84d72dde34babd774d8526 | gets the bumped version from the environment variable
passed by the `tag-and-deploy` script in the project root | deploy_version = local('cat %s/Dockerfile | \
grep -e "^LABEL.version" | \
cut -d \\" -f 2' %
web_dir, capture=True)
return deploy_version | 0 |
37ab6a894b6786dba15e64ead8472df6 | 3e978a929af7187c5e89e5e1637de3cb | Show contact point locus | class TwoView(object):
def cld1(_):
return cvu.triangulate_points(
_['KP1'], _['KP0'],
_['pt1'], _['pt0'],
) | 0 |
ec500057d02db18d44c813701002fe91 | 01938acbf812a3e98ee9e3cc272c502a | Convert wind mph to wind knots | namespace WatchSpeed
public static class Extensions
public static double MpsToKnots (this double mps)
{
return mps * 1.943844;
} | 0 |
27e8d71c670b581685fc9314052986d8 | 07e036edf3e46d1a74369058a4166837 | Maybe replace noscript elements with placeholders.
This is done because libxml<2.8 might parse them incorrectly.
When appearing in the head element, a noscript can cause the head to close prematurely
and the noscript gets moved to the body and anything after it which was in the head.
See <https://stackoverflow.com/ques... | function removeNoscript(doc: Document) {
const noscripts = Array.from(doc.querySelectorAll('noscript'))
noscripts.forEach(element => element.parentNode?.removeChild(element))
} | 0 |
8232b8e23f7ec802c046f9d0cf2a7b04 | e19a91950732874a31c74a6950b4afcb | Returns the meta object for the attribute '{@link org.abchip.mimo.biz.model.order.return_.ReturnItemType#getDescription <em>Description</em>}'.
<!-- begin-user-doc -->
<!-- end-user-doc --> | itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_ArtifactTypeModel_description_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_ArtifactTypeModel_description_feature... | 0 |
bb3f8eacfdd08bbc51affaa5b21452b8 | 34b5ebe299a3f211f80735443a643d57 | Primero pregunto al usuario cuántos números introducirá, para así poner un máximo | function mostrar() {
let num;
let max;
let min;
let resp;
let bandera = 0;
do {
num = parseInt(prompt("Ingrese un numero"));
if (bandera == 0) {
max = num
min = num
bandera=1;
}
if (num > max) {
max = num;
}
else if (num < min) {
min = num;
}
resp = prompt("Ingresa otro? ... | 0 |
071c62c38fc9f589df390471795bc95d | d2da5d409a93148339f1a1a1be3c920b | Create delta coordinates by subtracting other coordinates from
this coordinates. | class SmartCoordinate(object):
def __sub__(self, other):
return SmartCoordinate(self.x - other.x, self.y - other.y) | 1 |
c3bca22a968fc6b2b54667255a0b3797 | 7a4dc69064d6d338acad8d5b5dcde34e | guaranteed to be 0 or 1 | bool generateSecret()
{
return generateRandom()%2;
} | 1 |
75cc839a9f81e9532919c2031fd646b5 | 6d50cb2cdd9394a55fa068ee772030e4 | used to reload Messages table again from database to memory | public sealed class MsgUtils
public void Refresh()
{
Db.MsgUtils.Instance.Refresh(System.Configuration.ConfigurationManager.ConnectionStrings["HrContext"].ConnectionString);
} | 1 |
fb8862a3cd9013c69f626b7843d39793 | 246bed7be9d82382ea2598e185503a50 | Retrieves a single audit log for the given Id.
Attributes:
audit_log_id: The Id of the audit log to retrieve. | namespace JohnsonControls.Metasys.BasicServices
AuditItemProvider GetSingleAudit(Guid auditId); | 1 |
d9130420e2271508b3ea579fe557a6c6 | 33db73d42a9bedda6634a14184e9e159 | Lists all single values. | $value = $this->decorated->value($interpreter);
if (isset($value)) {
return $value;
}
if (!$this->access('view', $interpreter)) {
return NULL;
}
$property_wrapper = $this->propertyWrapper($interpreter);
$wrapper = $interpreter->getWrapper();
if ($property_wrapper instanceof \... | 1 |
c02861f5d5ce41b87e2b1d01d413939c | 3673711ba525e6b4973985a0e1749802 | @brief 分配大块内存,超过一页 | {
unsigned int index;
unsigned int oldSize;
unsigned char *newAddr = NULL;
if (!p)
return mem_malloc(newSize);
index = (((unsigned int) p) - ((unsigned int) memory)) / MEM_BLOCK_SIZE;
oldSize = memtbl[index] * MEM_BLOCK_SIZE;
if ((newAddr = mem_malloc(oldSize)) != NULL)
{
... | 0 |
a7e23fced38c7b4a79a9eced98529c2c | 3eea37de4d831b56b0024662e8d197e4 | 分析RTU上行非协议(调试)数据 | byte station,
string address,
byte[] values)
{
OperateResult<byte, int, ushort> operateResult = SiemensPPIOverTcp.AnalysisAddress(address);
if (!operateResult.IsSuccess)
return OperateResult.CreateFailedResult<byte[]>((OperateResult)operateRe... | 0 |
0a2bca4eb6ed7319b3759d78e08e7707 | 3c35e14bcc27dd2d8ac60a6647d3daa4 | Deselect NRF24L01 chip | static
void deselect (void)
{
CS_HIGH();
xchg_spi(0xFF);
} | 1 |
b8ab3ed26c05bd42d38265c1cd3a1b65 | e73040021beb1677b1c9285b23a500bc | Returns store with any possible keyword
ending at store.chars[position - 1]
identified as such in store.typeface | char ch;
i1 = pos;
i2 = pos;
while (hasChar()) {
ch = chars[pos];
if (isOneOf(ch, terminators)) {
break;
}
i2++;
pos++;
}
return getToken(false);
} | 0 |
992d5a4f37096bfedc31713926fdab56 | 2f63fab92b0e08c242692f19e07ac3cf | 获取所有的预测话题 | def get_all_topic(data, model, dictionary,t_num):
test_cut = list(jieba.cut(''.join(re.findall('[\u4e00-\u9fa5]+', data))))
doc_bow = dictionary.doc2bow(test_cut)
topics = model.get_document_topics(doc_bow)
top_list = [0]*t_num
for i in topics:
top_list[i[0]] = i[1]
return (top_list) | 1 |
f8266c4766222f91f016c55eadf910ae | 72c2267f3e41430d5c93819a41b47695 | Vložení událostí s tříděním podle druhů | {
foreach ( $events as $event ) {
if (!$this->events->contains($event)) {
$this->events->add($events);
$event->setReport($this);
}
}
} | 0 |
c937d4effd844101925d5ec95a80e8d9 | 7a99c8bb7e978f7e94e49b2fdd399785 | Sets the normalized username. | public class Profile implements Serializable
public void setUsername(String username) {
this.username = username;
} | 0 |
56f0e00384aa268246ccf02a7c471f02 | c74fb1be98207823a0a22ac19b130231 | Configures services that are used by the Kaponata Operator. | class OpenstackDashboardBasicDeployment(OpenStackAmuletDeployment):
def _configure_services(self):
horizon_config = {}
if self.git:
amulet_http_proxy = os.environ.get('AMULET_HTTP_PROXY')
reqs_repo = 'git://github.com/openstack/requirements'
horizon_repo = 'git://gith... | 0 |
d04354e3f86d5890d07ea81616d30e0d | 6a0b47e7d0fb2b7156c5c7e34ecabd98 | Opens the audio connection for the bot | namespace VoiceAssistantTest
internal class BotConnector : IDisposable
public async Task Connect()
{
if (this.connector != null)
{
await this.connector.ConnectAsync().ConfigureAwait(false);
}
} | 1 |
d1bacadabdcc5da25d9d24306d21d253 | 77c373b453e829527df1bf29d0aa23eb | 将当前 <see cref="HandleUnion"/> 的值复制到指定字节跨度中。 | private static void CopyInputBytes32(out ByteUnionBase32 unionBytes, byte[] inputBytes, int offset)
{
unchecked
{
unionBytes.Byte3Value = inputBytes[offset + 3];
unionBytes.Byte2Value = inputBytes[offset + 2];
unionBytes.Byte1Value... | 0 |
ef92953752a8017ca8b104e7efecfff4 | 5c976f47712fdf885b3a1fa858f5f821 | When the asteroid is destroyed | class PlayState
def asteroid_destroyed (asteroid)
unless asteroid.is_live?
@score.add(asteroid.points)
@ship.statistics.asteroids += 1
@bullettime.restore(2.0)
end
end | 1 |
3edcbc6036ae153db07f867719eb0c31 | 2f3be133eab0231a2af563e2ed9f2e60 | expanding '/:year/:slug/' scheme into e.g. '/2011/awesome-title/ | function breakdownSlugIntoUrls(slug) {
const parts = slug.split("/").filter((x) => x)
const urls = parts.reduce((acc, current, i) => {
acc[i] = (acc.slice(-1)[0] || "/") + current + "/"
return acc
}, [])
return urls
} | 1 |
f0a19db7db08454329e32d19525565ef | 77d0eaf8f8453c22f1644e4878f79882 | Create an instance of {@link NotofiableAuxsType } | @XmlRegistry
public class ObjectFactory
public Notional createNotional() {
return new Notional();
} | 0 |
b7ae9ae65742037686ac858b5301452d | ddd5aa005a6a9f85c75982fb48b8afe5 | Show all mibici stations | class StationController extends Controller
public function index()
{
return Station::get();
} | 1 |
528e8573420b56ec263d14ff7bab9145 | 5f651f196614e4f184cba8913b864f93 | 检查密码版本号 | void checkVersion(); | 0 |
9a5b3e360dceca53800e4858d003ab77 | d463a903625ebbfd866c45e53e8ade02 | Bring device back after doing sky2_detach | static int sky2_reattach(struct net_device *dev)
{
int err = 0;
if (netif_running(dev)) {
err = sky2_open(dev);
if (err) {
netdev_info(dev, "could not restart %d\n", err);
dev_close(dev);
} else {
netif_device_attach(dev);
sky2_set_multicast(dev);
}
}
return err;
} | 1 |
11a7e620e7e0e8ef7df872e5bd1e51af | b00136332f335d7ac9ecb022d9095886 | Number of connections per user | def avg_connections(users):
return total_connections(users) / len(users) | 1 |
318878d60799b2e0773da135ae7ea6d5 | d78ba9024f6def28da6f0a7f10a8f99f | Genera y retorna identificador de menu | abstract class Portal
public abstract function generaMenu(); | 0 |
df01bbcb0a52b8c2738f2113347d9a80 | dd1789c6fe902ef224490cc9b2ee53e4 | 判断 100以内的素数 | Boolean flag;
for (int i = 101; i <= 200; i++) {
flag = true;
for (int j = 2; j < i; j++) {
if (i % j == 0) {
flag = false;
break;
}
}
if (flag == true) {
System.out.pr... | 0 |
02fd5d65bc4cf409693b4cdfc6cbfde2 | 90dadc8f8498c83ad8534bfd5b41f5b8 | Set logradouro | class Endereco extends \Db\DataBaseBundle\Entity\Endereco implements \Doctrine\ORM\Proxy\Proxy
public function getLogradouro()
{
$this->__initializer__ && $this->__initializer__->__invoke($this, 'getLogradouro', array());
return parent::getLogradouro();
} | 0 |
7ae770ce99c1a71190d9d94ed005a6bf | 62df5a5777cc5aa52be82678be307bd0 | Gets the rect in absolute coordinates by relative. | class Camera:
def get_relative_rect(self, rect):
r = (rect[0] - self.position[0], rect[1] - self.position[1], rect[2], rect[3])
return r | 0 |
e4db90d87128fc77f8c849a6922378c0 | 82b562b974e28e9cbbf10c0b9d5e1bd2 | Computes hold-out predictions for a trained RankRLS | YU = self.Y * self.U
filteredevals2 = self.evals2 / (self.evals2 + self.regparam2)
foo = np.multiply(YU, filteredevals2.T)
foo = foo * self.U.T
foo = np.array(foo)
rlsparams = {}
rlsparams["regparam"] = self.regparam1
rlsparams["Y"] = foo
rlsparams... | 1 |
28afa7a7497ce78e09d97ecd1acd5a86 | 7d1e53dc3220453ecfecc4ec727aee20 | 将编号为ID的机器人进行一次操作,如何操作根据next_step决定 | class Referee(object):
def deal_robot_action(self, robot, cmd, param1):
if not self.do_user_action(robot, cmd, [CONFIG.game_id, cmd, param1]):
return
self.turn_to_next(self.__curr_seat_id) | 0 |
6775fd8e0431d663d55967e2aa12fd76 | fbd7b638b83841336ff11b2a344b0c55 | Returns a list of DisplayField objects selected for this group. | namespace AutotaskCorporation.Autotask.Data.BusinessObjects.Entities
public class WidgetFieldOptionConfigurationItemAuditDisplayAdaptor : WidgetFieldOptionPickListFilterBase
public override IList<WidgetFilterValue> SelectedValueList()
{
return WidgetFilterValuesProvider.GetSelectedDeviceAuditDisplayAdaptors(this.... | 0 |
c9408edb8fd1beefa0b86f41a7cc776c | ab0f438fd95e0586eb6e7a4e2982fffb | Pull down all gems | {
int i = -1, j = -1;
CheckForFloatingGems(out i, out j);
while (i != -1 && j != -1)
{
MoveGemDown(i, j);
CheckForFloatingGems(out i, out j);
}
} | 1 |
923139b133964decd8864daef3a00b48 | 89154881a02f72dab0e8ff0d17e249c7 | Test if the sudoku solver gives the same solution
Input and output files are from online (Sample problem 7, easy)
http://www.nikoli.com/en/puzzles/sudoku/ | def test_solve_sudoku_easy1():
sudoku_input_filename = "data/sudoku_easy1_in.csv"
sudoku_output_filename = "data/sudoku_easy1_out.csv"
verify_sudoku_solution(sudoku_input_filename, sudoku_output_filename) | 1 |
a070921c5ce0c19319c53eabb5b35c2d | 75dcff55fbdcec45decf6766e4a0bc03 | Returns the Notice Recipients button of this panel. | if (buttonPanel == null) {
buttonPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT, 10, 10));
JButton okButton = new JButton(language.getString("Common.ok"));
JButton cancelButton = new JButton(language.getString("Common.cancel"));
okButton.addActionListener... | 0 |
fe1fea78364395245d7cf6303125dae4 | 37efa3043345c1a8b742f38c1af5ef12 | 配置下拉根元素类名 | class CustomizeDataItemContext extends ApiContext
public function setRootClassName($className)
{
$this->set(self::ROOT_CLASS_NAME, $className);
} | 1 |
bd58a64d08d886fbf9abf2cf1cab5378 | 4bb88ec6081a1f4d75a7b677ddf554c6 | [算法] 判断两条线段是否有交点 | export default class Line
static isIntersection(line1, line2) {
let p = Line.intersection(line1, line2);
if (p === null) {
return false;
}
let p1 = line1.points[0],
p2 = line1.points[1],
p3 = line2.points[0],
p4 = line2.points[1],
a = (p.x - p1.x) * (p.x - p2.x) + (p.y - p1.y) * (p.y - p2.y) <= 0... | 1 |
655a82b500adeb81acd804a9e4aa62aa | 0b8917400c2dd30cf0d778fa3fc13513 | Imprime a lista de palavras de uma determinada letra do dicionario. | {
String outputString = "";
for (var wordNumber = 0; wordNumber < wordList.Count; wordNumber++)
{
if (wordList[wordNumber].word == word)
{
String[] stringSentencesNumber = wordList[wordNumber].sentenceNumber.Split(',');
... | 0 |
af25e8e26d9ca411382f8ad81af08db2 | 19fe27591b0f396100659abb39b617a8 | Loads Tof traces and corresponding energy axis to
the GPU memory. Each array is sliced so that only
the relevant peak data is loaded | ene = np.loadtxt(dirname + '/td.general/energy')
iterations = ene[:, 0]
times = ene[:, 1]
energy_dict = {'Total': ene[:, 2], 'Kinetic': ene[:, 3], 'Ion-Ion': ene[:, 4], 'Electronic': ene[:, 5],
'Eigenvalues': ene[:, 6], 'Hartree': ene[:, 7], 'Int': ene[:, 8], 'Exchange': ene[:, 9],
... | 0 |
1e5937821d777226bbde168334380f41 | 590de0a3ca0ce5e26ffddb2232b26dea | Checks if the hat has collided with an object, and whether or not it should
relinquish control to the newly collided object. | boolean shouldHold(); | 0 |
4f2d86e854529cd4269481f527af7937 | 6f36a4d5720e822e47caf53292cf128d | builder for transitionStateChange subtype | {
$this->checkState();
$state = FSM::getState($this->states, $stateId);
return FSM::newEntryExitActionBuilder($state, false);
} | 0 |
1fe3ebf9694fc33c97771756ad03abc8 | 0daf0bb41c0d058704eba1d756112795 | Возведение в степень через степень двойки
с домножением | namespace Task1
public class NewtonSqrt
private static double Pow(double a, int n)
{
double res = 1;
for (int i = 1; i <= n; i++)
res *= a;
return res;
} | 0 |
addbdf44b2e7a5d50ca814e0737bae92 | 37d7eaf3c89c1ad588b724ebdb309217 | 3) Define a function that checks if two numbers are equal. If they are equal, return true. If they are not equal, return false. | function checkEqual(a, b) {
return a === b ? "Equal" : "Not Equal";
} | 0 |
02a6fb3f530925bac3f92455cfba64e5 | d55f355410a27e7e09aa94d12053656a | Samples a full trajectory and returns it as a batch.
Returns:
(tuple): A tuple with observations, actions, next observations, rewards
and done indicators, as numpy arrays, respectively; these will correspond
to a full trajectory. The i-th transition corresponds
to (obs[i], act[i], next_obs[i], rewards[i], dones[i]). | trajectory = self.sample_policy(policy_idx=policy_idx)
context_env = self.sample_env_context(trajectory, env_idx=env_idx)
state_action_list = []
target_list = []
source_list = []
for k in range(k_traj):
eval_episode_rewards = []
init_state = torch.... | 0 |
c3b839a3a1801fafba3b3b18975a4504 | c19715aa79d8bb9eb73abe9f5350676b | @brief 警告スキン クラス. | class WarnSkin(Skin):
def __init__(self):
Skin.__init__(self) | 1 |
60b5845534b52092be8bf88b559486fe | 86e1fe80b3b2745e0909eabf1acab4e6 | Get the data associated with a Sample Billing based upon the primary key
$bid bill id | function getRecord($brid); | 0 |
c9adc5e8408526139e1c705818ebb131 | f63235c642921c1d60237901662f7da5 | Show the form for creating a new doador. | class DonorController extends Controller
public function create()
{
$doadores = $this->doadorModel->all();
return view('Donor.create', compact('doadores'));
} | 1 |
e45fc1f733169d83fb3f99f042c012e9 | e9345ec142b19a26a3845077126eab9a | Hademard (direct) product | def hd(x,y):
return hw(x^y) | 0 |
355a803c501419482ceaac4870bfc686 | cc44190c4d72f0bf891e626de1920b04 | 将中缀表达式转化为后缀表达式
e和f分别用于存储中缀表达式和后缀表达式 | operators = {'#': -1, '(': 0, '+': 1, '-': 1, ')': 2, '*': 2, '/': 2, '%': 2}
stack = ['#']
suffix = []
for each in exp:
if each not in operators:
suffix.append(each)
else:
if each == '(':
stack.append('(')
elif each == ')':
... | 1 |
0153695d13756ae2ec39344a85278b12 | 98aac37d8c5d2cbe129482eab834209f | 安装人员添加数据页面 | class MyselfController extends CommonController
public function actionAddemployee()
{
return $this->render('addemployee');
} | 1 |
6b6e334ada4d01372c9d45fd636e24de | db5629169677bc26fb3f86e8e99bbc58 | check consolidates a common error checking mechanism into one call | def consolidate(writeFile, readFiles):
w = open(writeFile, 'wt')
fieldnames = ['Shipment', 'Box', 'BatchName']
writer = csv.DictWriter(w, fieldnames=fieldnames, lineterminator='\n')
writer.writeheader()
rowList = list()
for readFile in readFiles:
r = open(readFile)
reader = csv.DictReader(r)
for row in rea... | 0 |
653c8bee8ccc5a1c4221bc0cdeef73d7 | 173339326241e132459c6b288311dd22 | 根据座位编码列表获取座位信息 | {
IWCFService.ISeatManageService seatService = new WcfServiceForSeatManage.SeatManageDateService();
bool isError = false;
try
{
return seatService.GetSeatInfoBySeatNum(seatNo);
}
catch (Exception EX)
{
... | 0 |
92d4e98eaab2e12f7e26035bc404b138 | 7c51aa38f95085bfd255c1c037f9110f | Use to get a list of all Users that have associated Jobs | class JobRepository extends EntityRepository
public function getUserList($userId)
{
$qb = $this->createQueryBuilder('j')
->where('j.user_id = :userId')
->setParameter('userId', $userId)
->orderBy('j.created_at');
return $qb->getQuery()->getResult();
... | 0 |
31089a55392e3ca14796a9e3cdb95a4f | 3b7448a42b619ed2e31e830a9b9189cd | login using a public key | var query = "show_public_key"+"?email="+email;
var resp = $.get(serverURL+query);
return JSON.parse(resp);
} | 0 |
d8d275027f650ac65e20c4e9203527fd | 9e1379042d016c3edc240e153c40b51a | 网页加载完成后回调 | public class BaseWebView extends WebView
public void onWebViewLoadEnd(); | 1 |
32dd16cff392fe543dbc900847ae0256 | 019c7603a1296f601082a26611ffa923 | Set regression parameters for BBSR | namespace DISCRETEOPT{
void SRegDiscreteModel::set_parameters(myparam PAR){
myparam::iterator it;
it=PAR.find("lambda");m_lambda=boost::get<float>(it->second);
it=PAR.find("CPres");m_CPres=boost::get<int>(it->second);
it=PAR.find("SGres");m_SGres=boost::get<int>(it->second);
it=PAR.find("... | 0 |
4083812ab031cae4ad677dbd3e7286e3 | f05c8832101e3201886cc36ef51cd8f3 | Score connections based on the follow weight | var totalScore int
const (
Weight_PickupOnPassing = 50
Weight_DistanceToOrder = 10
Weight_ActivityStateRunning = 1
Weight_ActivityStateIdle = 50
Weight_ActivityStateOpenDoor = 45
)
if (peer.Dir == S.MD_Down) && (order.Floor < peer.Last_floor) && ((order.Button == S.BT_Cab) || (order.Butt... | 1 |
89bd1880c47ab49388e839b97c1e01b6 | 9a42b13579b5f519b107e2412d5f982e | Получить общее количество ДТП | Long getAccidentCount(); | 1 |
11aa4d17a1087e94dd8ee2373b276794 | 5510653809edad3cd210e133e3524617 | Returns all values for the given paramName | @Nullable
String[] getParameterValues(String paramName); | 1 |
43670509a0f7fdf090eed2dd8046c74f | e156185b423930c06f9edb33d9eab6b5 | 验证用户robot_id | if(isset($_GET['midoks']) && ('discuz' == $_GET['midoks'])){
include_once(WEIXIN_ROOT_LIB.'weixin_robot.php');
global $weixin_robot;
if(!isset($weixin_robot)){
$weixin_robot = new weixin_robot();
$weixin_robot->valid();
exit;
}
}
} | 0 |
382a8bdec3d38a68865f29138e495427 | 32b9af3ff022df39aed36c3f045f1724 | Views the option list. | class OptionsController extends BaseController
public function index()
{
return View::make('options.index');
} | 1 |
55bd3e6c03c1c33ef060e20d2a7e622e | a407ee78d790d6ad4387b42406ab31a1 | returns whether or not the judge button should be used | {
yield return new WaitUntil(()=> madeJudgement == true);
StartCoroutine("WaitForNext");
} | 0 |
3f5b70d321607f088ab6cc0b9cff1e8c | b653e1b748eb68f73a08b8d85df2f815 | delegate construction to the one with an explicit surface parameter | ret = self.__class__.__new__(self.__class__)
newDict = dict(self.__dict__)
del newDict['surface']
ret.__init__(surface, **newDict)
return ret | 1 |
17b903040c03869cc104aa8181fd027e | afb1ada01e5b0b30c2a082d0906b49d5 | set LM73 mode for reading temperature by loading pointer register | void lm73_set_ptr_to_read(void){
lm73_wr_buf[0] = LM73_PTR_TEMP;
twi_start_wr(LM73_ADDRESS, lm73_wr_buf, 1);
return;
} | 1 |
3ca53bab41df7d9be8e2b0632dbf1849 | 73e3092c85b06f6c89c0923cba09cc78 | Determines the current encoding paths to all leaves by traversing the
tree. | public class EncodingTable
private void updateEncodingTable() {
encodingTable.clear();
traverse(tree.getRoot(), "");
} | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.