query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
d1ae821a5671055b2a4de1e1f3561525 | d0683098b8b3811cfef15116322dcc9d | Is this a y scale, axis, etc. | class Surreal(numbers.Number, metaclass=SurrealMeta):
def is_dyadic(self):
pass | 0 |
75a99ea3b7bd484dc5fbf06822311b41 | 50d0824f581b914dd995b434ae0aed2a | Gives a name of this request which is used in [[Await]] component.
The same effect of [request.name()](./request.html#name) | export class Request
name(requestName: string) {
this.requestName = requestName
return this
} | 1 |
e7e0f937f4168aa85335d3bd58bb0675 | c849411576f7e9ffdd01a66383897c69 | @brief Return information on requesting peer if applicable.
A server-type ChannelProvider will use this method to discover if a remote client
has provided credentials which may be used in access control decisions.
The returned PeerInfo is only required to have valid values for: peer, transport, and transportVersion.
Pe... | OpcUa_CharA* a_achPeerInfoBuffer,
OpcUa_UInt32 a_uiPeerInfoBufferSize)
{
int apiResult;
struct sockaddr_storage sockAddrIn;
socklen_t sockAddrInLen = sizeof(sockAddrIn);
int ... | 0 |
91572409e3f69797b83e675f84b9df03 | 43bc26afe45dfef91953208841fe702a | sort array in increasing order | void sort_array(unsigned char * arr , int size ){
unsigned char i,j ;
int temp ;
for(j=1;j<SIZE;++j){
for(i=0;i<size-j;++i){
if(arr[i]<arr[i+1]){
temp = arr[i];
arr[i] = arr[i+1];
arr[i+1]=temp;
}
else { }
}
}
} | 1 |
4650b1fd88c79fd9a736ce7748416abc | a91bb3a889e8eb9ef0fc7ad92dd1c2f8 | This method returns a list of all costitems by category | namespace SWNI.Website.Controllers
public class ItemCostsController : Controller
public async Task<ActionResult> Index()
{
return View(await Task.Run(()=> itemsService.GetAll()));
} | 0 |
22a5e878b3f73d836b20ce0ed9c5591c | efe4d7841bb8a72d0a54462c6ec4e7ff | 为manifest注册chapter文件列表 | {
int chapterCount = CHAPTER_NAME_TABLE.length;
String type = "raw";
String packageName = m_context.getPackageName();
BookChapterInfo chapterInfo = null;
InputStream in = null;
chapterInfo = new BookChapterInfo();
chapterInfo.m_chapterName = CHAPTER_NAME_TABLE... | 0 |
0c7230a354ed9ff6dc08e5e73da33bc6 | 0704e330602d06fd70afb56fb678963d | 根据 Camp_index获取数据 | $postData = json_decode(file_get_contents("php://input"));
$campSearchInfo['country'] = $postData->country;
$campSearchInfo['m_idx'] = $postData->m_idx;
$campSearchInfo['pageNum'] = $postData->pageNum;
$result = $this->camp_model->getCampByCountry($campSearchInfo);
echo j... | 0 |
06f299e5475258f8cf745223ec3b31a8 | 7114810d55a580718aaada161f8660f9 | Queries the power state of the Bluetooth device.
<P> | {
NxtProperties props = NxtRobot.getProperties();
final String btName = props.getStringValue("BluetoothName");
if (SwingUtilities.isEventDispatchThread())
value = askInternal(btName);
else
{
try
{
EventQueue.invokeAndWait(new Runnable()
{
public void run... | 0 |
5b30335947c1d49ce55301cc7b31e5f7 | 37249faee8f6afc10e868deab712974c | Decrement the number of attempts.
This is intended for application logic when a login attempt can be forgiven. | void increaseAttempts(); | 0 |
41ba395aa9c71e2b10165dbabd47f3f4 | 7117f85759178546716e3399635e6618 | Hilfsfunktion, um eine neues Zeitintervall zu erzeugen, dessen Beginn und Ende im darstellbaren Zeitraum eins
Datenbankservers liegt. | {
List<PeriodInterval> periods = new List<PeriodInterval>(0);
int position = 0;
while (periodFromTime <= periodToTime)
{
position++;
string name = periodFromTime.ToShortDateString();
periods.Add(new PeriodInterval(po... | 0 |
44f40df34afa2368c4b4c8efbe92e302 | 1fa9d12b5db2647eb0d01174f00a62cc | Performs provided fx on params a,b. a and b are passed as <code>fx.apply(a,b)</code> | try {
return this.applyX(a);
} catch (Throwable e) {
throw Handling.nestCheckedAndThrow(e);
}
} | 0 |
b1b6552393c74049c25b3d58ca8ee780 | dc10a81cb201aad38b49b40650cd9073 | Get the encoded data for requests authorization | class TwoLeggedOAuth extends OAuth
private function getCredentials() {
return base64_encode(rawurlencode($this->consumer->getKey()) . ':' . rawurlencode($this->consumer->getSecret()));
} | 1 |
36ab1c1eb12d0ae67592b78568b1da6a | 97685c275454dcec4fcf78b58a6295af | Adds taxonomy filters to the posts admin page | class TaxonomyAdminFilter
function __construct($cpt = array()){
$this->cpt = $cpt;
add_action( 'restrict_manage_posts', array($this,'my_restrict_manage_posts' ));
} | 1 |
e34e12e3e2d65dd368083b868e363833 | e2760b33a2b0c11de0098e20591b6173 | Returns the value of the '<em><b>Yn Generated</b></em>' attribute.
The default value is <code>"false"</code>.
<!-- begin-user-doc -->
<!-- end-user-doc -->
<!-- begin-model-doc -->
If set, the page is generated from the outside of the GUIDesigner.
<!-- end-model-doc --> | SPG getNgEna(); | 0 |
cd4ddccaa838bc1d85897d8c0bf9ec4f | 572d28960b539d2b6fae204d1af5f495 | Shows quit menu buttons and hides all others. | public class EscapeGrid extends JPanel implements MouseListener, KeyListener,
ActionListener
private void hideSongButtons()
{
queen.setVisible(false);
elvis.setVisible(false);
} | 0 |
dd44de7fad83bc1380d0ed2d1cc47883 | a7f551335202ce9ad2487ea6977cfd18 | +++++++++++++++ FUNCTION DESCRIPTION ++++++++++++++++++
<p>
<p>NAME : addOrEdit
<p>
<p>DESCRIPTION : 添加或修改测点档案记录
<p>
<p>COMPLETION
<p>INPUT :
<p>OUTPUT :
<p>RETURN : String
<p> | @Transactional(readOnly = false,propagation=Propagation.REQUIRED)
public String saveRecord(ElectrodeRecord record) throws Exception {
boolean flag = false;
if(StringUtils.isBlank(record.getErId())){
record.setErId(IDUtil.getUniqueId(Constants.MODULE_CODE_ELECTRODE_RECORD));
flag = true;
}
electrodeRecor... | 1 |
74f5c4c568d5ead881a78bb855f424cb | 96b142bf88cd871f37d0c338e2972880 | Register the reference to the authentication service | public class DatabaseManager
public void registerAuthenticated(String username) {
this.authenticatedUser = username;
} | 0 |
4b710303933065a07eac97d5e0f6f474 | 280e6b08f0f1e4b4a2fbea15848e3b3b | 自定义子组件, 用来显示房屋列表 | return this.state.housesList.map(item => (
<HouseItem
onClick={() => this.props.history.push(`/detail/${item.houseCode}`)}
key={item.houseCode}
src={'http://127.0.0.1:8080'+ item.houseImg}
title={item.title}
desc={item.desc}
tags={item.tags}
price={item.... | 1 |
e052a32250d0ba8b114829313ad0b1f9 | 396d422e63ccceee06a5e33b1ff464b0 | ! \brief Handle Device Upgrade Peer Connected State | dm_event_t const * p_event,
api_result_t event_result)
{
wk_printfn(WK_DEBUG_LEVEL_DEBUG, "");
switch(p_event->event_id)
{
case DM_EVT_DEVICE_CONTEXT_LOADED:
case DM_EVT_SECURITY_SETUP_COMPLET... | 0 |
52ac36e06d9dbc15d210b884dbdf47ea | d7a705f8b6f7e4aa86349ad839e90966 | Method called by the server in order to check if there are enough players to start a game | public class MainActivity extends BaseGdxActivity implements FragmentSignIn.Listener, ShockeyActivityListener,
RoomUpdateListener, RoomStatusUpdateListener,
OnInvitationReceivedListener, UpdateUserInformation{
public boolean shouldStartGame(Room room) {
int connectedPlayers = 0;
... | 1 |
834965fa755a1137b6cc557e21044d38 | 436562e999c48a81ae07d9796413ceb7 | 查询历史评级 | try {
Map<String ,Object> result = service.businessRankCheckHisQuery(this.entity);
this.getRequest().setAttribute("result",result);
} catch (Exception e) {
throw ToftException.ThrowSYSException(e);
}
return "success";
} | 1 |
ed076287532e86365e841e92bfc50d8c | d951b077b66bb501ce60210ee7b51dcd | Hello World! | fn main() {
println!("Hello World!");
} | 1 |
f4bfb43be10b6ecd3b990012dcc42b2a | 998b8209f8ee6ef6b30d95060d3a1a6c | Returns the graphical interface of the score. | public class Scoreboard
public VBox getScoreboard(){return scoreboard;} | 1 |
5ba0667ed0c11d0a6e5f510644d7903f | 625592e1516b85cad7ef01a0768422f8 | Returns the index of the given UI group | public class UButtonGroup : UIBehaviour
public int GetItemIndex(UButtonGroupItem _nItem)
{
if (!ValidateItemIsInGroup(_nItem))
return -1;
return m_ButtonItems.IndexOf(_nItem);
} | 0 |
13ee9715ec128d2e4ca7c0eb4ba57b94 | dd5ab6a4ce5733a23364c10b8f04cb89 | 根据消除目标球的位置来显示特效 | {
GameObject eff = Instantiate(m_effect[1].gameObject);
eff.transform.parent = this.transform;
eff.transform.position = pos.position;
eff.GetComponent<ParticleSystem>().Play();
Destroy(eff, 2);
} | 1 |
90ed1812bd5b0e9933eccb56b5c00959 | 8cb8a1ef0bff7fbfd2a4c90cb4d2dd5a | Находит минимальный цикл в графе | def main():
graph = build_graph(10**6)
print(min(cycle_search(graph))) | 1 |
6a7030dbe3973ef7336b9d39c0522fbd | d375a95fcdbe264e31e0d02c0873dfd7 | carrega a lista de emoticons do sistema | namespace YellowEar
public partial class FrmChat : DSkinForm
private void LoadEmotinosDropDown()
{
lock(emotion_panel)
{
emotion_panel.ImageScalingSize = new Size(18, 18);
emotion_panel.LayoutStyle = ToolStripLayoutStyle.Table;
((TableL... | 1 |
05937f63761d3f69e9f1393dfc5d2334 | a4e10d4bcb3fce33a7961550a4c439f4 | Vytváří formulář, který slouží pro zrušení celé rezervace | class ReserveController extends Controller
public function create()
{
return view('reserve.create', [
'rooms' => $this->room->getAll()
]);
} | 0 |
23c7204e3d60725696adc4811d77dd2f | 4e0ad8b814004c6fcc66ccd0b5be374e | This method will update the current step name. | public void updateStepName(BigInteger feedId, String stepName) throws ContentAcquisitionException; | 1 |
e2946e181d3b7c6284b4275922b1418a | 71e0f4ff49486907ad9343325911ddb4 | Converts Premiums to Work Details and sets the override flag. | {
if (customerProduct?.AverageMonthlyPremium == null)
{
throw new RuleException(ErrorMessages.AverageMonthlyPremium);
}
customerProduct.OtherMonthlyPayments = Math.Round(customerProduct.AverageMonthlyPremium, 2);
return customerProduct;... | 0 |
f3f044c4b091e6b8268dec13939342c8 | f2fa5409d9a9a7d9c3a6332a960f662f | adds an ad to the end of the ads list | if (adText && !containsAdCustomizers(adText)
&& adTextArr.indexOf(adText) === -1) {
adTextArr.push(adText);
}
} | 0 |
5c7acf654db13c842f11730913853216 | 307781ea7e95c3ddb28ad9e4b719fda3 | Gets the certificate by subject name | {
if (name == null)
throw new ArgumentNullException();
if (name.Length == 0)
throw new ArgumentException();
IntPtr prev, cert = IntPtr.Zero;
if (previous == null)
prev = IntPtr.Zero;
else
... | 1 |
6bed518524846edfd5553566427e6261 | 64702ba9d0fbcd498c3c6d33b763ff85 | 以恒定速度追踪玩家 | public class RangeEnemyController : MonoBehaviour
void FollowPlayer()
{
Vector3 vec = (player.transform.position - transform.position).normalized;
vec.y = 0;
move(vec, FollowSpd);
} | 1 |
3706a3b386ea9238a8807f1544dd565b | 001855027922354b74960bbfd0fe2139 | Decodes and yields each message event from the contents byte string. | tick = read_varlen(track)
self.RunningTick += tick
stsmsg = ord(track.next())
if MetaEvent.is_event(stsmsg):
cmd = ord(track.next())
for etype in self.MetaEventRegistry:
if etype.is_meta_event(cmd):
evi = etype()
... | 1 |
98c76ac289080887ca73cd7437e8ffce | f027baf6c35821500bba5fda0e7f5316 | # discard variants in Encode DAC black list regions | {
tbl.dhs <- getEncodeDHS(trenaProject)
tbl.tmp <- tbl.dhs[, c("chrom", "chromStart", "chromEnd", "score")]
colnames(tbl.tmp) <- c("chrom", "start", "end", "score")
loadBedGraphTrack(session, "DHS", tbl.tmp, color="black", trackHeight=25, autoscale=TRUE)
} | 0 |
3c1207a9f2f33585ed07d9551b6212e4 | 17ff7266957ab228ea70316ee7bd8ac8 | Store a new student, with their face, in the DB | known_face_encodings.append(face_encoding)
face_id = get_face_id()
conn = sqlite3.connect('face_image_database.db')
cursor = conn.cursor()
cv2.imwrite(r"D:\Learning_material\Ideas\Face_rec\project\final_model\face_dataset\User_"+str(face_id+1)+str('.jpg'), face_image)
with open(r"D:\Learning_mat... | 1 |
e4b4c5e4967d235cb25329e6ebfa1fac | c0cefb76a6bd5df8f2d001e8b6225a7d | Setter for origURL | class Image implements \JsonSerializable
public function setOriginalUrl($originalUrl)
{
$this->originalUrl = $originalUrl;
return $this;
} | 1 |
86a6b1ea7d3b4f1e22b5380b786d4dea | 5bec9abeb88df80398f804ce7684cc29 | Read tags: <tags><tag> ... </tag> ... </tags>. The
tags are translated as keywords. | match = content.match(/^[tT]ags: (.*)$/o)
if match
@tags = match[1].split.collect! {|tag| tag.downcase }
content.gsub! /^[tT]ags: .*$/, ''
else
@tags = []
end
return content
end | 0 |
c60e8422151b40ff94fe4a644626f866 | 1810785b7f99f0d0a24134fcb1f0a67d | 解析单条匹配返回的XML字符串 | public void parse(String responseXml); | 1 |
f240f26e699d4c88386a53c2f17188e9 | 88a7c1e744277e307b1f4cb88370d77c | The strings that define the SQL statements for creating the tables | public abstract class RDBMSStoreBase implements PersistentStore
private void createSql()
{
this.clearSql = "DELETE FROM " + getSessionTable() + " WHERE " + getSessionAppCol() + " = ?";
this.keysSql = "SELECT " + getSessionIdCol() + " FROM " + getSessionTable() + " WHERE " + getSessionAppCol()
... | 0 |
f0bca99f6520800ef040b8c52429d96d | 3d396f19aebe03476d9552b5b3791bfd | Returns paramteres of the active menu item | class Menu
public function active_items()
{
return $this->_active_items;
} | 0 |
761f7c38b58ce98510ee48dccc267b80 | 8c3c64d4c4aea76391a3eff94fd69a27 | Kysyy käyttäjältä nostettavan summan, ja palauttaa sen kokonaislukuna. | {
string input = Console.ReadLine();
decimal amount;
try
{
amount = Convert.ToDecimal(input);
}
catch (System.FormatException e)
{
Console.WriteLine("Nieprawidłowa wartość, podano: " + inp... | 0 |
53909713783c17112620a7e0a8e17d1e | f4a162cca2914161e988dbcd9603837d | Gets the total number of items purchased. | public class AdminPurchaseHistoryDTO
public int getNumberOfItem() {
return NumberOfItem;
} | 1 |
7f276fd1209b14c5da5e444857738cef | 26ddbe3cc8e4086604199e51509c0f62 | 自定义验证器:广告类型是否有效 | {
$type = $this->request->get('type');
if ($type == "0") {
throw (new HttpResponseException(response()->json([
'code' => 500,
'message' => '请选择广告类型!'
])));
}
} | 1 |
ccae1a05f8678b7ee62e7e31db5af55d | c2da6705f04cd2a28f1db52e7b235e56 | 生成订单号的随机数字 | class OrderService extends Model{
function createOrderNumber(){
$res=time();
$rand=rand(111,999);
return $number="DH".$res.$rand;
} | 1 |
b4712a036cb852da9d8f17a18570d4bd | 10bf51e30032682ad7e731281bc0fa35 | creates the training operation for a neural network
in tensorflow using the Adam optimization algorithm | class AccusationNN:
def build_train_op(self):
with self.graph.as_default():
train_op = tf.train.AdamOptimizer(beta2=0.9999).minimize(self.loss)
return train_op | 1 |
6c6efbd5d2e19df092cd6d27e1d1967a | c71adec3ce73decca00b17cf3f217b03 | Non-windows is case-sensitive. | {
#ifdef _WINDOWS
return strcmpi (f1, f2);
#else
return strcmp (f1, f2);
#endif
} | 1 |
689cabfd5c8c9db70e836b6a71ecfbf8 | 191a111a234c8d59f7a7083b5fc904ba | Set if the property is excluded from access. | public function setExcluded($value); | 1 |
16d344e49fcbe20846074239ebda7d1f | ab3182c261d0c7cdb226c033a8298889 | 2D Heat kernel | n = 1+2*size
h = np.zeros((n, n))
for j in range(-size, size+1):
for k in range(-size, size+1):
h[j+size,k+size] = np.exp(-1 * (np.power(j,2) + np.power(k,2)) / (2 * np.power(sigma,2)))
Z = 1/np.sum(h)
h = Z * h
return h | 1 |
b250d676acc1e86715ced67701fa7e70 | 59f603edc1106b40816d0e243e3a7f42 | Zwraca UNIX timestamp z wiersza DB | abstract class AbstractModel
public function getTimeInsert() {
return (int) $this->aData['time_insert'];
} | 1 |
3bf9d9511c8b4fe1b22d3b7530620f09 | 00d258c9c889cdf1f86c7008ea5aa8fe | Move component order down. | {
$model = $this->model();
if (! $model instanceof Sortable) {
throw new RuntimeException(
sprintf(
'The model "%s" must be a type of %s.',
get_class($model),
Sortable::class
)
);
... | 1 |
e542ba906f0b6ea1c9d5d66d3d3887ed | 65e1762c645b0552022b9e203a808920 | 设置节点处理中 | class WorkFlowController extends AdminController
protected function setNodeMarked($flowArr, $from, $to)
{
$nodes = $flowArr['nodes'];
$lines = $flowArr['lines'];
foreach ($nodes as $key => $value) {
if ($key == $from) {
$nodes[$key]['marked'] = true;
... | 1 |
11c8e32407be13cf70b6a3e960d3df66 | 5cc520e37216c99c3015199b5b8294b5 | Run a pipeline job synchronously. | {
return ExecutePipelineAsync(
connection ?? throw new ArgumentNullException(nameof(connection)),
null,
map ?? throw new ArgumentNullException(nameof(map)),
cancellationToken
);
} | 0 |
a514ab9f65833166d642b50ecccb9a28 | c0295d3d7bb993a380bfaff085da0588 | Performs 1D range search | {
if (size <= 0) return -1;
stack<Range> rangeStack;
rangeStack.push(Range(0, size-1));
while (!rangeStack.empty())
{
Range currentRange = rangeStack.top();
rangeStack.pop();
int mid = (currentRange.lower + currentRange.upper)/2;
if (arr[mid] == X) return mid;
if (arr[mid] > X)... | 1 |
814c7cdd27c2d93684b4c5b4016773f2 | 817c78b9763046be0290596c1328eff3 | 送信するパケットをキューに入れる | public class Link
public void sendPacket(Packet p) {
addPacketOnQueue(p);
} | 1 |
25eab1cd95a5435cca422749b709594f | 9bc3784b55cc33bbfbd41cfb79a8bfe6 | Function for checking the capacity of the matrix and increasing it's size
if necessary. | if (row > col) {
for (int i = 0; i < row; ++i) {
mat[i] = (int*)realloc(mat[i], row * sizeof(int));
}
for (int i = 0; i < row; ++i) {
for (int j = col; j < row; ++j) {
mat[i][j] = 0;
}
}
}
if (col > row) {
mat = (int**)realloc(mat, sizeof(int*) * col);
for (int i = row; i < col; ++i) {
ma... | 1 |
14f3ee692f0e2ae334084f141c3b1569 | 66e84d6bdc592c138230433a05e1e31c | True if the expression is of the type that can return a value (property,field,cosntnat, method call) | ParseTree parseTree = this;
while (parseTree.type == ParseTreeType.PAREN_EXPRESSION) {
parseTree = parseTree.asParenExpression().expression;
}
switch(parseTree.type) {
case IDENTIFIER_EXPRESSION:
case MEMBER_EXPRESSION:
case MEMBER_LOOKUP_EXPRESSION:
case ARRAY_PATTERN:
... | 1 |
691306eb7edd321df4eada356508381a | c11eee3f4830fcc845dd545a6590da8b | Extract case dictionaries from "Archive" html page
and add them to self.cases | if self.html is None:
self._get_report()
regex_title = re.compile(r"node.*\'text\'.*\"(.+)\"")
regex_rcp_no = re.compile(r"node.*\'rcpNo\'.*\"(.+)\"")
regex_dcm_no = re.compile(r"node.*\'dcmNo\'.*\"(.+)\"")
regex_ele_id = re.compile(r"node.*\'eleId\'.*\"(.+)\"")
... | 0 |
277f63037a64af17c464dd68f9b881fb | 97d1a259cb9f9dcbe8337488e46a4584 | Fonction qui retourne la liste des cartes encore non-révélées du jeu | def unrevealedCards_ai(board):
unrevealedCards = []
for i in range(1,10):
for j in range(1,7):
unrevealedCards.append((i,j))
for i in range(0,9):
for j in range(1,7):
if board[i][j] != (0,0):
unrevealedCards.remove(board[i][j])
return unreveale... | 1 |
ff898653b063716fc78fc7e25c191134 | 5bf226b1f5f0c96b355a6de692a46a40 | [ resizing_lattice_resize_function | void lattice_func(void) {
int i,j;
for (i = 0 ; i < ag_num ; i++) {
initialization_1(lattice_mdl[i],ag_num);
initialization_1(cd_nw[i],ag_num);
}
for (i = 0 ; i < ag_num ; i++) {
for (j = i ; j < ag_num ; j++) {
if (i == j) {
lattice_mdl[... | 0 |
5070d8b2102aff26f1ce206a1caf24ee | b0b21b2a5ce1e2e2bf4afb23f7812edc | 露出優先設定を取得 | class TodoListViewModel
findPriority(): SelectMenuData {
return this.priorityDataList.filter(data => data.val === this.selectedPriority())[0];
} | 1 |
ebc851e11ff199b1f6a9abc4d9af364b | fea1dbb71d611639ae9f6aa8af5438e6 | For border cells, returns an wall (line) that is on the outside of the maze | const CDbRoom *pRoom,
const UINT wCol, const UINT wRow)
{
const UINT wSTileNo = (wRow < pRoom->wRoomRows - 1) ?
pRoom->GetOSquare(wCol, wRow + 1) : T_WALL;
if (wSTileNo == T_WALL || wSTileNo == T_WALL_B)
return TI_WALL_B;
else
return TI_WALL_BS;
} | 1 |
264305f0ccaa332af1a92b9bd3e4c41b | 6ca3b6923302a35f8cbb0f4f8eba22c7 | Build the String representation of this bar graph and return it. | {
if (DataHelper.DataSourceIsEmpty(DataSource))
{
if (EmailMode && SendOnlyNonEmptyDataSource)
{
Visible = false;
}
return String.Empty;
}
if (EmailMode)
{
EmailFormatEnum format = EmailHelper.GetEmai... | 1 |
5309ca791a23394ab0225e2f7d862ecf | b04b6494bc231f86d9d368314c8b6bb7 | 返回两个数组对象中,有相同属性的对象集合 | if (typeof (array1) !== 'undefined') {
for (var a1I = 0; a1I < array1.length; a1I++) {
for (var a2I = 0; a2I < array2.length; a2I++) {
if (array1[a1I].id === array2[a2I].id) {
array1[a1I].compare_result = 'same'
array2[a2I].compare_result = 'sa... | 1 |
10a74cefcf4bca86b688c16fd05e121c | 33976abdc35718f8cce4f4177e867a79 | 判断一个角色是否所有技能都已经完成 | function getComplete(callBack,next,to){
fetchGetMess().then(res => {
if (res&&res.status) {
sessionStorage.isComplete = res.data.isComplete;
}
if(sessionStorage.isComplete=='N'){
getSkill(callBack,next,to);
}else{
if(callBack){
callBack(next,to);
}
}
})
} | 1 |
49447df10dcd1f362301d2f854bbb650 | ce1b392a46e70b4ec2604f42a07b5904 | SQLite message processor | {
extern char dbfile[];
extern char name[];
extern char datstring[];
extern char keystring[];
extern GDBM_FILE db;
extern datum dbkey;
extern datum dbdata;
extern int verbose;
extern char msgstr[];
int level = 0;
int multi = 0;
int i, n, j, k;
int retval;
char tstring[5][80];
char instring[80];
char cmd[40];
char s... | 0 |
58108702cd47bd26385513dbb494833c | 868dfaa480ebdb055fe6ee7cd3ff72cf | Returns dict of variables to restore from ImageNet-checkpoint. | def get_init_fn():
checkpoint_exclude_scopes = ["InceptionV4/Logits", "InceptionV4/AuxLogits"]
exclusions = [scope.strip() for scope in checkpoint_exclude_scopes]
variables_to_restore = []
for var in slim.get_model_variables():
excluded = False
for exclusion in exclusions:
if... | 0 |
5b4f684596c05a18b33900679d2a4a30 | bdcd670444136443b7a158b53b8e4dfb | Returns the XML DocumentBuilder pool to use for this app. | public final class DomUtilImpl extends AbstractComponent implements DomUtil
protected DocumentBuilderFactory getDocumentBuilderFactory() {
return this.documentBuilderFactory;
} | 0 |
0310ec54bfb176815e2105023f3cbb17 | 3fe358871326e4c701c6557cc2527ceb | Randomize by swapping two cities in the path. | route = random.choice(self.routes)
while len(route.fields) < 2:
route = random.choice(self.routes)
total = len(route.fields)-1
index1 = random.randint(0, total)
index2 = random.randint(0, total)
while index1 == index2:
index2 = random.r... | 1 |
bac1b383f05197846abc786f4f3c97b6 | f83c00d3d146d0809941885c55b43bc6 | Gets the debark date. | public class Sailing implements Serializable
public final String getEmbarkDate() {
return embarkDate;
} | 0 |
04cb457b154b67c068f9827a7813e3f5 | 0126f55d492b72464139061664d90440 | Serializes the file item into a javascript array. This method should be overriden only when developing
a custom FileBrowser control. | [Serializable]
public class ItemPackage : ISerializable
public byte[] Serialize()
{
byte[] data = new byte[512];
return data;
} | 0 |
356b8090c16f8063616bd37f9c3e9695 | a2a87e98a025213dbeb72c14140f4d4d | Makes the tool window visible if it was closed or hidden. | Visible = true;
if( WindowState == FormWindowState.Minimized ) {
WindowState = FormWindowState.Normal;
}
Activate();
} | 1 |
1f2b4b69e15983a0b74427989b7ee3ce | c1e1f26ba22a0482169d99ba6b609902 | Wrapper for loading compressed models. | class CompressedModel(EmbeddingModelBase):
def __init__(self, emb_path, cb_path):
super().__init__()
self.normalized = None
self.distinct_cb = None
self.decode_func = None
self.words = None
self.vocab = dict()
self.sizes = dict()
self.cb = []
self.... | 1 |
08d117223e65a74843e14cf722a2d840 | 3e36e1d763c96ab8d6e647aa5ce619e3 | Simple function returning number of arcs. | public class DirectedGraph
public int numArcs() {
return aList.getNumOfEdges();
} | 1 |
687fc5bb4a9edbaa08d1b4f421a2c75c | e924dd08cf6d9348aab329586c9728df | Método para verificar se o comentário foi feito | public function getHasCommentedAttribute(): bool
{
return $this->comments->where('user_id', auth()->id())->isNotEmpty();
} | 1 |
22f087d4bf74c0b3472a2f48010791bc | ac9c6393f5706cf87ed34dac92873f9a | Negate the last number on the screen | let input = document.getElementById('display');
input.value = input.value.substring(0, input.value.length - 1)
} | 0 |
7daa7fcb13d5b0cce6ec680ff71e173c | ec418e3b90b0a646b154e22384679827 | Cleans and compiles all given files/directories. | class Assets
public function compileAll()
{
$this->emptyCompileDir();
$this->compileOtherFiles();
$manifestNames = $this->config()->precompile;
foreach ($manifestNames as $manifest) {
$ext = pathinfo($manifest, PATHINFO_EXTENSION);
$paths = $this->findAllFiles... | 1 |
eed1a4a95153f46dc974ff82971e4dca | ed0c86ac0ffae20402e9580643ad5e1d | Find all ETDs what will expire in the given number of days | public function findExpired(); | 0 |
4d0c13ae1cb8471924864657636bef6a | e528d8ba14bef7a725afd0013e48443e | Parameterizes strings and replaces underscores with hyphens | function hyphen(target) {
return target.replace(rhyphen, '$1-$2').toLowerCase();
} | 0 |
03e3779bd08485c42847cc6fcfeb4eb8 | e9ae041828429780f81078d36602f2a8 | Can a schema name be used in an index definition statement?
<p>
Schemas are not currently supported by this driver. | public class AfmDatabaseMetaData implements java.sql.DatabaseMetaData
@Override
public boolean supportsCatalogsInIndexDefinitions() {
return false;
} | 1 |
9ff44c3af91cbbaf3cc12f72a75ac685 | e2b9f02baa9604dbeda824938c1ee81a | Магічний метод для встановлення значення поля об'єкту | abstract class Field
public function setValue($value)
{
if (is_string($value)) {
$this->value = $value;
}
} | 0 |
34351acb89c6cc01206c45956301bce9 | f1c86029a7e75153e9f2ba8252fdb1c0 | 加载柱状图1数据 | var myChart = echarts.init(document.getElementById('echart21'));
option1 = {
tooltip: {
trigger: 'axis',
axisPointer: { type: 'shadow'}
},
grid: {
left: '0%',
top:'10px',
right: '0%',
bottom: '0px',
containLabel: true
},
xAxis: [{
... | 0 |
49cfca32db2f7f79788db41f74e6c255 | 281c6bb69bce75ef7b02ed4b358a39b2 | Function findIndexOfRegister: | {
int i;
for ( i = 0; i < REGISTER_LEN - 1; ++i )
{
if ( reg[i].isUsing &&
strcmp( reg[i].id, id ) == 0 )
return i;
}
return -1;
} | 1 |
6e71bd9d02a1841ee0ce8a4b5aaba3ce | be81d6a7b0b586c5fc1d9f9d4d2a61e6 | Function to compress a directory | bNum = 1
while True:
zipName = path + '_' + str(bNum) + '.zip'
if not os.path.exists(zipName):
break
elif not os.path.isfile(zipName):
break
bNum += 1
zipFile = zipfile.ZipFile(zipName, 'w')
print('Creating ' + zipName)
for folder, subFolders, fileNames in os.walk(path):
zipFile.write(folder, compr... | 1 |
ce6c12a19829f38b4e515b37eb7b8572 | 734e67745a4cf8e121a357918210035e | Retrieve the "toggle model" if any of an action. An action only has a toggle
model if it has an assosciated boolean state which should be displayed as a check
box.
By default there is no toggle model. | boolean hasToggledPanel(); | 0 |
722a6922951b376e4afdde66018688c5 | 854f2d9be636bf2903f4b1971f78d331 | Cette méthode montre comment obtenir la liste des salariés répondant à un critère. | namespace DemoWebServices100.Common
public class TiersServiceDemo
public void GetTiersSalarieList()
{
TiersService service = new TiersService(_webServiceUrl);
IList<Salarie> tiersList = service.GetListSalarie();
} | 0 |
a0da34577b4a2c1e47c95829d1257c96 | 6a2b4bf55b47f97e0a01d2f8ca0d0abc | 获取 指定class的 元素 正则 | function getEle(className, eles) {
var ary = [];
var reg = new RegExp("(^| )" + className + "( |$)");
for (var i = 0; i < eles.length; i++) {
if (reg.test(eles[i])) {
ary.push(eles[i]);
}
}
return ary;
} | 1 |
0d33cb80a9e258f8a78b2cdb95d7b940 | d53822a2a59a19b4acb3e768320b1abc | 获取远程文件中的字符 | class ZipArchiveEx extends \ZipArchive
public function getRemoteContents($remotefile){
$k = 0;
while($k++ < 3){
$content = file_get_contents($remotefile);
if($content!==false){
return $content;
}
}
return '';
} | 1 |
fd81d4b998fbd9392066fa93b0b5b0ab | 408e266f9852c43eb99b798279baceac | Subscribe cascaded SC with in active cascaded client. | public class DatabindingTestCase
@Test
public void testSCALocal() throws Exception {
HelloServiceSimpleClient helloServiceSimpleClient = node.getService(HelloServiceSimpleClient.class, "HelloLocalServiceSimpleClientSCAComponent");
performTest(helloServiceSimpleClient);
} | 0 |
ab6ac87f9972f101232d7b6fa2f55ce9 | 2bd82c728aafe19b1de1f146da7b1f18 | Получить path для объявления | {
$oCategory = $this->find()
->alias('t')
->joinWith('alias')
->where(['t.id' => $this->id, 'alias.is_deprecated' => false])
->one();
$path = '';
if (!empty($oCategory->alias)) {
$path = $oCategory->alias->url_path;
}
... | 0 |
54c8cf1448160ac4b66fa7812e9b8976 | b2a10d95884daf167cf71c59d9329bff | Method to build string from Media list. | export class ReactiveMediaDevices
deviceListToString( devices ) {
const toDeviceIdString = ( deviceString, currentDevice ) => {
return deviceString + currentDevice.deviceId + ', ';
};
return devices.reduce( toDeviceIdString, '' );
} | 1 |
2babe71b295cf0108c05bd552f681a5a | 6b073f90e9c3c2c7e8b1480940b86085 | FUNCTION
DESCRIPTION
PARAMETERS
simInterface [IN]
RETURNS
void | static Int16 PbnSimInit(
PbnSimPrms *pPbnSimPrms,
PbnSimState *pPbnSimState
)
{
if ((pPbnSimPrms == NULL) || (pPbnSimPrms == NULL))
{
return -1;
}
pPbnSimState->pbnSimDone = FALSE;
pPbnSimState->pbnSimLoop = pPbnSimPrms->pbnSimLoop;
pPbnSimState->curTestPbnState = -1;
pPbnSi... | 0 |
85400eb14eb2d1fbecd90470f884046d | ac283fdaa24e6f5a8acc258bb90bbf86 | withブロックを抜ける際に実行される後処理を実装
例外が送出された場合は、引数でその情報を受け取れる | class A:
def __exit__(self, exc_type, exc_val, exc_tb):
print(exc_val)
return True | 1 |
24ad10eb99a936e2317d0c265e0a7e15 | 3fef341fb265b6c5beeb813edbd5f233 | Update the hold mode of the thermostat. | class FreeAtHomeThermostat(ClimateEntity):
async def async_set_hvac_mode(self, hvac_mode):
if hvac_mode == HVAC_MODE_HEAT_COOL:
await self.thermostat_device.turn_on()
if hvac_mode == HVAC_MODE_OFF:
await self.thermostat_device.turn_off() | 0 |
6d214d4d6c0e8f24a1fb7d026768a634 | b965ff2dc2573d58311a5abe07b99417 | удаление пробелов из введенной строки | namespace FindMaxWordsInSent
class Program
static string DeleteRepeatSpaces(string str)
{
string resString = "";
bool flag = true;
for(int i =0;i<str.Length;i++)
{
if(str[i]==' ')
{
if(flag)
... | 0 |
a0d7ae533393ec7a7529f08c68cf6723 | afe5df61fcf241465191435dace249c3 | 読み取り専用の切り替えを行う | default void switchToReadOnlyMode(boolean readOnlyMode) {
if (readOnlyMode) {
switchToReadOnlyMode();
} else {
switchToReadWriteMode();
}
} | 1 |
e4ef2c4acc026c7c67175246b6a1b3ad | 285abb7c900ab1a4334eb0c58563f32b | concatenation of two last expressions in stack | PRIVATE void concat_(pEnv env)
{
Node *my_dump1 = 0;
Node *my_dump2 = 0;
Node *my_dump3 = 0;
TWOPARAMS("concat");
SAME2TYPES("concat");
switch (env->stck->op) {
case SET_:
BINARY(SET_NEWNODE, env->stck->next->u.set | env->stck->u.set);
return;
case STRING_: {
c... | 1 |
4271827ae12b93e54b75fb34fa62953c | 757fe3534a82da44f37b3429b7a1af01 | Hides the start screen overlay, calls getRandomPhrase(), then adds phrase to gameboard | class Game
startGame() {
document.getElementById('overlay').style.display = 'none';
this.activePhrase = this.getRandomPhrase();
this.activePhrase.addPhraseToDisplay();
} | 1 |
3153eaf8b118adbe94b34dae7b70e21d | 3ba33331d2fcab1ecfe78b778e6ce60f | Löscht den gesammten Inhalt von addresses und setzt current auf -1 | {
free(row_address);
rowsInUse = 0;
currentCapacity = 0;
return;
} | 0 |
0bad83a590fa638d59deff96d5bda9a4 | 8875dcfcc425470ba99b2561a2071d01 | For convienance, this method returns the protocol, host and port as a
URL. | StringBuilder pathAndQuery = new StringBuilder(100);
String path = this.getPath();
if (path.startsWith(HTTP_PREFIX)
|| path.startsWith(HTTPS_PREFIX)){
return new URL(path);
}
String domain = getDomain();
String protocol = getProtocol();
... | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.