query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
67c740f3d3d7083695d28c0b260e3d9c | a0a55ee8ededa3f87698246833195d27 | Gets the session property indicated by the specified key.
or the default value if there is no property with that key. | String value = lookupProperty(key);
return (value != null ? value : defaultValue);
} | 1 |
30880c222da9f59c76476bdc6e37a03a | 3c429198952b17f7d3bf15aae632b8fb | Frage die verantwortlichen Moderatoren für den Kanal ab. | namespace DataHandlingLayer.Controller
public class ChannelController : MainController
public async Task<List<Moderator>> GetResponsibleModeratorsAsync(int channelId)
{
List<Moderator> responsibleModerators = new List<Moderator>();
string serverResponse = null;
try
... | 1 |
f5383e12658999d630e121d7faaae92a | 0033e4016ae6eb98e2c3a0a5d965273f | Метод для настройки внешнего вида таблиц процессов и потоков: | self.processTableWidget.clear()
self.processTableWidget.setColumnCount(4)
self.processTableWidget.setHorizontalHeaderLabels(['Argument', 'Type', 'Value', 'Edit'])
header = self.processTableWidget.horizontalHeader()
self.processTableWidget.setSortingEnabled(True)
self.proc... | 1 |
84b288b9939ceb6887928320bb4452cf | 7aaae4b5e1b3bd6de27aab06cbff93ff | Returns whether the data is raw.
instead of onFilterEvent for raw data. {@code false} otherwise. | class RecordsList extends \Api\ManageConsents\BaseAction
protected function isRawData(): bool
{
return 1 === (int) $this->controller->headers['x-raw-data'];
} | 1 |
0b33c63e6fd7380233244943f08d2cbc | 2f6736230e1e2b799c4bb518bc66a2ef | Initializes Run parameter list. | namespace Google.Apis.AnalyticsData.v1alpha
public class V1alphaResource
public class BatchRunReportsRequest : AnalyticsDataBaseServiceRequest<Google.Apis.AnalyticsData.v1alpha.Data.BatchRunReportsResponse>
protected override void InitParameters()
{
base.InitParameters();
... | 0 |
a9bd9126c9d458e106f51e40825049e3 | 861adce71d4bb58ab87a8eb3500752c7 | Actualiza estado de Impresión en las solicitudes de transferencias de inventario. | class FacturaLogica
function habilitaImpresion($arregloDatos) {
$this->datos->habilitaReimpresion($arregloDatos);
$this->consultaFactura($arregloDatos);
} | 0 |
a950cfbc84d1c75bd8acba1fd821f61a | 03109233694a53e2d85cac69ba91bbdc | Returns the last FacebookRequest that was sent.
Useful for debugging and testing. | class SugarOAuth
public function getLastRequest()
{
return $this->_lastReq;
} | 1 |
eacb35288d8fb392b6a88d65974c9323 | 2c83465a7a6b219bb5412901d44f7fa8 | Calculates the width of the board depending on the contents. | class PuzzleBoard:
def __get_width__(self):
max_width = 0
for value in self.board_blocks.values():
max_width = max(value[0], max_width)
return max_width + 1 | 1 |
20eb2e6083b7c0c2e309f5085061365a | 7f61448ad6da3ef0f9cb03f40c5be655 | initialization function. | cases like (1) | 0 |
effc594800512b4e16ca898d346fee87 | eeacc579cc350890a948a7aebb7b04d8 | check the checkboxes of all member course members | function cacscadeSelectAllToAllChecboxes(isSelectedAll) {
var i,
membersCnt = 0;
for (i = 0; i < scope.mgCbSelectAll.length; i++) {
if (_memberFilterFunction) {
if (!_memberFilterFunct... | 1 |
bdd8163be8281b1801aabeb3a37427bf | 36018018648532402edb21bbb4377785 | <p>prj070scJuuyou を取得します。 | public class Prj050Form extends Prj060Form
public String getPrj050syuryoJissekiYear() {
return prj050syuryoJissekiYear__;
} | 0 |
77e9bffea8908129e85b5bc11376bfdf | 44804191b85df2dadda19fe13a564adb | Display an icon of a country. | class City(CoordinatesModel, PicturableModel):
def get_country_icon(self, directory="png24"):
return self.country.get_icon(directory=directory) | 1 |
117bf71780005b6f98d6d35bd4e8fae0 | e3ab5024524783fe7b66ce2d797537c6 | Builds a sinc filter kernel. | if not torch.is_tensor(dx):
dx = torch.tensor(dx, dtype=dtype, device=device)
if device is None:
device = dx.device
if dtype is None:
dtype = dx.dtype
D = dx.abs().ceil().int()
S = 2 * (a + D) + 1
S_max = S.max() if hasattr(S, 'shape') else S
if (N is None) or (N < ... | 1 |
962b539824d5427d9576ffc3f6f7820a | 38c02fc908609e1f63c47eb7cfc0106a | The cluster instance variable is used to keep track of the cluster
to which this point belongs. This method sets the cluster variable. | @objid ("f8d8c797-0368-400a-b192-3ccc33075a2c")
void setCluster(Instance value); | 1 |
eb821a2972d5d8ea9328bb269776b0ac | c58eb1cdcbe67f136bf6b9d300c5e52f | Determines whether [is different than] [the specified second list]. | final class Module extends Data\Module implements ISeq\Module
public static function ne(IArrayList\Type $xs, Core\Type $ys) : IBool\Type {
return IBool\Module::not(IArrayList\Module::eq($xs, $ys));
} | 1 |
dcf1d10a387aad69dfe30f7494385318 | d81a06406b42da8cf9cf8e1440ca5d29 | Retrieve checkout quote model object | class HeidelpayCD_Edition_Model_Payment_Abstract extends Mage_Payment_Model_Method_Abstract
public function getQuote()
{
return $this->getCheckout()->getQuote();
} | 1 |
6efcdaf4e9d168b394f25f8e6812e9c9 | 0ef4e416f481f35e35edd348ef7f551f | 输出,如'2♡' | string Card::toString()
{
return allface[face]+allsuit[suit];
} | 1 |
8381ece66a58867105d7a7ce27b1f8ea | 6967ede82c51d115f509ca64064e9be0 | 取得當日日期,如20200407,每天只能存取當日的資料 | namespace DeanERP.Dac
public class _ERPDBDac: IDisposable
protected string GetDate()
{
return DateTime.Now.ToString("yyyyMMdd");
} | 1 |
73ddffffde03d61ef9ed7c409ccab996 | dd11374b8bbf76b091565ef5b77113ee | This method is expected to be overwritten by subclass | class MessageResponse::Base
def success_method
raise RuntimeError, 'Subclass Responsibility'
end | 1 |
ea22deb14d932e22ba0c851acff356f1 | 6b28c01aa939c3e16b6ab30d2c89eff9 | Adds the block to the first available position.
This function will create indirect blocks as necessary. | bool Blocks::Add( const char * aData, unsigned int aSize )
{
char * Buffer = Add( aSize );
if( !Buffer )
return false;
memcpy( Buffer, aData, aSize );
return true;
} | 0 |
6b69da777b3149cfce347e5a541d7d25 | 7b22720c4724ab55fbad13b4520e1631 | 获取C2C交易配置参数 | @ResponseBody
public String getStcEntity(SwapParamsDto swapParamsDto) throws Exception {
LOG.debug("查询参数=" + JSON.toJSONString(swapParamsDto));
SwapParamsEntity swapEntity = (SwapParamsEntity)
commonDao.findByEntity("SchedTradeConfig.getStcEntity", swapParamsDto);
if (swa... | 1 |
388d65f1cffb53fcdec53e3704bb48de | 04759d05f6a17e17e41dcd7ddcc1aa0c | This function is called during testing, but normal programs don't
need to call it. | function edd_testsetup_callback()
{
printf("");
} | 1 |
0c94c25dd7d19c36d83c9c6015ca1d7e | bc5215f100115633ac4ef979d731b5b8 | 设置已使用容量的颜色 | public class BatteryView extends View
public void setCapacityBackgroundColor(int color) {
this.mBackgroundColor = color;
invalidate();
} | 0 |
b2a27093d5f2d57f1075a63b1867e079 | 6c53661dd3a4169c7cff058dc45df466 | Enter a parse tree produced by the {@code modulusMinExpr}
labeled alternative in {@link IPSParser#expr}. | public class CMCGrammarBaseListener implements CMCGrammarListener
@Override public void enterExprMinum(CMCGrammarParser.ExprMinumContext ctx) { } | 0 |
8bf4982372a31267052ee138961a6183 | 8c12f995493a02e90acc4a9decaea184 | Test whether the recipient e-mail is valid according to RFC. | boolean result = true;
try {
InternetAddress emailAddr = new InternetAddress(email);
emailAddr.validate();
} catch (AddressException ex) {
result = false;
}
return result;
} | 1 |
55356ca5ae03c03c39add6a25f8a037b | 19a881540c625285c0288724444c5952 | タイトル画面の描画。 | void Title_Trans() {
clear();
bkgd(' ' | COLOR_PAIR(TITLE_BG));
attrset(A_BOLD | COLOR_PAIR(LOGO));
mvprintw(10, scrx / 3 - 10, " _/ _/ _/_/_/_/ ");
attrset(A_BOLD | COLOR_PAIR(LOGO2));
mvprintw(11, scrx / 3 - 10, " _/_/ _/ ... | 1 |
600e560d1a74c8cc52d4c908cd074670 | 9e9bbc3ff62a1aa955264eb1872db5f7 | \brief Metoda łączy się z klientem Google Api.
Metoda łączy się z klientem Google Api. | public class MainActivity extends WearableActivity implements
DataApi.DataListener, GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener{
public void onResume(){
super.onResume();
googleClient.connect();
} | 1 |
d77eb8d256c23f4fa97766b7e3bee0b3 | 3fd13048a5d9220cc0b268543f318448 | Testar se método add_holiday consegue adicionar mais de
um novo feriado. | class BasicTestCaseEE(unittest.TestCase):
def test_count_holidays(self):
self.assertEqual(self.my_first_prod_cal.count_holidays([2016, 4, 1], [2016, 4, 30]), 9)
self.assertEqual(self.my_first_prod_cal.count_holidays([2016, 5, 1], [2016, 5, 31]), 9)
self.assertEqual(self.my_first_prod_cal.count_h... | 0 |
41dcc217a3f96b5ab68387e60b838863 | ecccd7d6cc656d80bd67d39b2a344ee7 | Updates tags when the view layout is changed. | namespace Microsoft.Sarif.Viewer.Tags
internal class KeyEventAdornmentManager
internal void View_LayoutChanged(object sender, TextViewLayoutChangedEventArgs e)
{
this.RefreshAdornments();
} | 1 |
ad8b877022811ac678844bb0a190ad04 | 5be73f85b9cfe652d4fbb6f845535162 | Method called upon instantiation | class Menu
initialize() {
} | 1 |
5cce882d0f19dcb0b02810bcab0d985f | e22b53f45742823ebf4becfd373617ad | 网站栏目属性为单页的处理方法 | {
if ($this->request->isPost()) {
$data = $this->request->post();
$data['modelFieldExt'] = isset($data['modelFieldExt']) ? $data['modelFieldExt'] : [];
try {
$this->CmsModel->editModelData($data['modelField'], $data['modelFieldExt']);
} catch (... | 1 |
deb2302f76a30e77bfbea247e9eff7e4 | 67c985520f551b6201c14d47fd9a09a5 | Create an empty board for photons, with a given size. | Borad = {}
for x in range(size[0]):
for y in range(size[1]):
Borad[(x,y)] = 0
return Borad | 1 |
b255f268c0d72ac85d0bbda55d5932ca | f29e409caf8aabd24256f1e25705b6f0 | Deletes a single version of a DataBrew recipe. | try {
String resource = getResourcePath(context, id);
URL u = buildUrl(resource, "versions");
HttpURLConnection con = (HttpURLConnection) u.openConnection();
Map<String, String> headers = new HashMap<String, String>();
headers.put("x-emc-uid", uid);
... | 1 |
ed48f2d1bed0e14c522b8b029ef521f3 | 6679517203ddb8d165cde08f014626a9 | ## boxplot+points | cbydboxjit <- function(dataf, vard, varc, useNA = "no",
labellayer = "", labelall = "All values", labelgroups = "by goup") {
if (useNA == "no") {
dataf <- dataf[!is.na(dataf[[vard]]) & !is.na(dataf[[varc]]), ]
}
dataf$fact_vard. <- factor(dataf[[vard]])
... | 1 |
c7fae86784e8f7f7ada9a435183c9461 | 9498a6cd622a7523540c547e950a614e | e.g. '25/02/1996' --> datetime() | try:
return datetime.datetime.strptime(value, '%Y-%m-%d').date()
except ValueError:
pass
value = self.delimiters.sub('-', value.strip())
if '-' in value:
date_format = '%Y-%m-%d'
else:
date_format = '%Y%m%d'
return datetime.... | 1 |
6afb3b3c8000394663f93fcbcbd9e3ed | f61220885775a187e76919e8825dbee7 | Function to shorten all whitespace to a single space | def reduceWhitespace(line):
line = line.split(' ')
while '' in line:
line.remove('')
newline = line[0]
for k in range(1, len(line)):
newline = newline + ' ' + line[k]
return newline | 0 |
19c9820a17cf3afa5803b86a796353bb | 84c5e2897be9ff8c473dfbce168f1d59 | Number of term occurrences in the corpus. If a term appears 10 times, it
will be counted 10 times. | public class TermInDictionairy implements Comparable, Serializable{
public int getTotalOccurencesInCorpus() {
return totalOccurencesInCorpus;
} | 1 |
6672bb78ad6d0a32ed0b38d832fff5df | e631774ee23c727d233124307fa27aaa | Create the file system structure. (Often referred to as a "high level
format".)
The file descriptor argument "device" is the open device.
Returns 0 for success and -1 for failure. | int _format(block_device *blockDev, int fd, int zonesize, int fragment)
{
int result, result2;
pfs_cache_t *clink, *cache;
pfs_super_block *sb;
int scale;
u32 i, mainsize, subnumber = blockDev->getSubNumber(fd);
mainsize=blockDev->getSize(fd, 0);
if(checkZoneSize(zonesize) == 0)
return -EINVAL;
scale = getSc... | 1 |
5d1400fb65128671881bbdce32778316 | 37ffb25812a0dfc273fade1d911f78dc | 用户主动登录群组 | const that = this
const identifier = params.identifier
const identifierNick = params.identifierNick
const avChatRoomId = params.avChatRoomId
const sdkAppID = params.sdkAppID
const userSig = params.userSig
webimhandler.init({
accountMode: 0,
accountType: 1,... | 1 |
af77ad4f649f7e6fa7444ac193d1a7fa | 1b3e6902351d6fa7b01ff95b245c61fa | initializes the VR engine and sets the callbacks | int depthSize = 16;
int stencilSize = 0;
boolean translucent = Vuforia.requiresAlpha();
mGlView = new VRSurfaceView(this);
mGlView.setVRModeEnabled(false);
mGlView.setSettingsButtonEnabled(false);
mRenderer = new ImageTargetRendererObj(this, vuforiaAppSession);
... | 0 |
414c93345419d6b7d27800be6db762c3 | 44d63f153c151b8d8b8452c74e19f7df | Getter for <code>appcenter_mall_data.t_scm_purecv.createTime</code>. 创建时间 | public class ConfigCompanyVo extends BaseVo{
public java.util.Date getCreateTime(){
return this.createTime;
} | 1 |
c7d5e12028c63a44bc19a32a48ffd73f | 3faadb7fca0e89436571a755a4cfefea | 更新质量检查表 | namespace HST.Art.Data
public class WorkOrderProvider : EntityProviderBase
public bool AddQualityCheck(DataEntity qualityCheck)
{
DBHelper dbHelper = new DBHelper(ConnectionString, DbProviderType.SqlServer);
string strSql = @"Insert Into QualityCheck([WorkOrderID],[WorkProcessID],[Is... | 0 |
70b2d0ce1217150d9be4f65ff108a6e5 | 534a5c7ebee0efeb17d5518a1c42a3fa | 当重新获取数据时,显示当前时间 | SimpleDateFormat format = new SimpleDateFormat("yyyy年MM月dd日 HH:mm");
String date = format.format(new Date());
lastUpdatedTextView.setText("最近更新:" + date);
super.setAdapter(adapter);
} | 1 |
f9fdb5c27655c785f847116bfca6cf68 | 315003d6c831b87a484574c94bd5f67a | Compute 3drism pressure using loaded xvv file.
Uses equation 20 from the article by Sergiievskyi et al.
(http://dx.doi.org/10.1063/1.4935065). | global cpss,spss,dpsrr,xnext,xs,zs,dxsx,dxsy,dxsz,other,dzetas,ddzetadx,ddzetady,ddzetadz,zsww
xshift = 4.5
f = np.array([-745796.7338,1176470.141,-444610.529,-57508.01028])
beta = np.array([7.9250000,8.0850000,8.4712500,27.89500])
rhos=np.sqrt((xs-xshift)**2+y**2)
if rhos < 1e-5:
drhosdx... | 0 |
67d3fa79aa5a0d1658174f61209566d5 | fdbd93ff2fa22a0dcd96caaae36e60e9 | チームのコライダートランスフォームの未来予測をリセットする | _turnOrderDataCollection.Get (turnOrder).ClockTicks = 0;
_turnOrderDataCollection.Get (turnOrder).IsCombatReady = false;
_turnOrderDataCollection.Get (turnOrder).RoundAppearences = 0;
} | 0 |
68553e42fc0458d65d8e64ad0c571719 | 10cbb716b46509cb234c6c9bc25fd3b3 | 展示有多少个用户和前十个用户的用户名 | def give_top_us_users(us_users):
top_us_users = []
user_count = 0
for item in range(1000):
user_count = user_count + 1
if user_count < 10 :
top_us_users.append(item)
min_user, min_count = list_min_user(top_us_users, us_users)
else:
if us_users [ite... | 0 |
9466963071e02d5b549385d626899fd9 | c5e1638422c3698af3b070b96668738b | Gets the first player's spawn. | public class WorldManager
public Location getLobbySpawn() {
return lobbySpawn.clone();
} | 0 |
5526e1ce5cb07cb13f12282bf936f802 | b373d0f5b1561302f80dd80d593625d9 | 真正实现添加购物车的部分 | function Add_cart(email,pid,number){
var sql='SELECT * FROM products WHERE id='+pid;
var sql1='INSERT INTO shopping_cart (pid,number,user_email) VALUES ('+pid+', '+number+', '+'\''+email+'\''+')';
function callback(rows,judge){
var state=-5;
if(rows[0].number<number){
... | 1 |
0018531601df3a3209322816b33a7635 | 574fbdd4f3950472c8d3f8f989d0d1c7 | Updates the WAX values of any items displayed in event displays or visible
inventory panels | for (int i = 0; i < this.itsPACs.size(); i++) {
EdPAC ePAC = this.itsPACs.elementAt(i);
this.updatePAC(ePAC);
}
} | 0 |
106ae4fea87ce721f10c8896dbbc28be | 044556e5cb0bf93513fa0592bdadd645 | tells the server that the videos in the present test case are done playing | class Choral_application extends MY_Model
public function set_video_done($student_id = NULL, $program_id = NULL){
if ($student_id === NULL)
{
throw new Exception("NULL student_id in set_video_done method of application_model");
}
if ($program_id === NULL)
{
t... | 1 |
15c759a6c1f6a2381a9d1ebabef92a5e | 5311e014e0ac63094e14366bad80cb3d | удаляет ссылку | public async Task<IActionResult> DeleteLink([FromBody] int id)
{
Link link = await _context.Links.FirstOrDefaultAsync(x => x.Id == id);
if(link==null)
{
return NotFound();
}
_context.Links.Remove(link);
await _contex... | 1 |
16c606e17189405478549a0394357c53 | 0ea7b98f58a6ba1741df590a7f1b99b1 | Set order by - Allowed: +date, -date, +label, -label, +sort, -sort
A plus means ASC
A minus means DESC | abstract class tx_seminars_BagBuilder_Abstract
public function setOrderBy($orderBy) {
$this->orderBy = $orderBy;
} | 1 |
5ccc47696c2216a1c462cd90b1973f46 | c7ad96c3ed4e6df483516b9eb22eab2d | Gets the total number of {@link com.coremedia.elastic.social.api.comments.Comment comments} issued for the current page's
content. | int getCommentCount(); | 1 |
9aa2561ae7d36020014c26964e846991 | 0fdb34ff6981667e4e96f40a6d1f2952 | 商品一覧ページから、そのページに表示されている全商品のリンクを返す | {
$objQuery = SC_Query_Ex::getSingletonInstance();
$sql = 'SELECT category_id FROM dtb_category WHERE del_flg = 0';
$result = $objQuery->getAll($sql);
$arrRet = array();
foreach ($result as $row) {
$arrPage['url'] = HTTP_URL . 'products/list.php?category_id=' . $r... | 0 |
bec2e480be20e61a82aae0b711a0f6a3 | 642989f0a0077d5770bd3593a0923202 | Drops the database and creates a new empty one. | public class DB_blob extends DB_base
public void removeAll() {
dbConnection.execSQL(Schema.SQL_DROP_DB);
dbConnection.execSQL(Schema.SQL_CREATE_DB);
LocalEventsManager.fireEvent(ctx, LocalEvents.DB_blob_Change, dbName, null);
} | 1 |
bd0bec23677a070e74c11d12fbbea3bf | a5b76f7657db1a9ebbc285e654658458 | Read the highscore table and extract the guessing time values from it | SharedPreferences sharedPrefs = getSharedPreferences("HighScores", MODE_PRIVATE);
Gson gson = new Gson();
String json = sharedPrefs.getString("HighScores", null);
Type type = new TypeToken<List<Score>>() {}.getType();
highScores = gson.fromJson(json, type);
if(highScores ... | 1 |
b090991f49d0e9121c394b794ddf38c7 | 80c20f981ea3669c160b5cff21799f6e | least-square fit the plane by Root Mean Square | def fit_plane(X, Y, Z):
X, Y, Z = np.array(X), np.array(Y), np.array(Z)
assert (X.size == Y.size == Z.size)
A = np.column_stack([X, Y, np.ones(X.size)])
C, _, _, _ = linalg.lstsq(A, Z)
a, b, c = C
return a, b, c | 1 |
9652bc823b4046b7aefb7ebcf899550b | ba20897b4e6fcf9dbac31fdddabedb33 | adds animations to a vector | v[0] += tx;
v[1] += ty;
v[2] += tz;
} | 0 |
97cd8bae20c88e20109bc37e9e5d216e | 89a2215e47f1ae2486bbc661823c67f2 | Creates the class Pile which is used to track and remove sticks from the pile | self.L = L
self.p = p
self.pileLog = []
self.tholdsLog = []
self.avalsLog = [] | 0 |
3aaea3e3e294ed28f9b0f8d695490678 | 52e61d14031cd8c5a4e23c61ffaa9dd7 | 批量删除选中行的专利数据 | @Controller
@RequestMapping("/data")
public class Data
@RequestMapping(value = "/deletePatent",method = RequestMethod.POST)
@ResponseBody
public String delete_p(HttpServletRequest request, Model model){
String[] index_list = request.getParameterValues("ids");
System.out.println(index_list);
... | 1 |
94297e12cacf2a49a6df863d7251e4a7 | a7355de84c74549e01c7b437b2152786 | Возвращает массив с названиями параметров и отформатированными значениями для вывода в отчете. | public function toArray(array $params = array()) : array; | 1 |
bb779bcc1d13d50e04d9fae1ab469929 | d8f1a3f2aeed400dcc0ee1aa6e65450b | # ReadFid ============================================================================== | headerlength <- (scan(input, nlines = 1, sep = ",", quiet = T)[1] - 1)
FFI <- scan(input, nlines = 1, sep = ",", quiet = T)[2]
if(FFI == "1001") {
dataset <- read.table(input, skip = headerlength, header = TRUE, sep=",")
inputname <- gsub('.{4}$', '', input)
filepath <- ifelse(is.null(outfile), paste0(input... | 1 |
2387050ed6182b8e806100a7c03fcadc | 4a9afdb9a45b3934a0d88fe8b921e2f4 | Set True to use Store filter functions instead of server side filtering. | {
if (!$this->getFlag('store_filter_added')) {
$this->performAddStoreFilter($store, $withAdmin);
}
return $this;
} | 0 |
5bcc73cdc3be015fc1893db459c87ccd | 93f4d59632ec8e2fce929e865303b1cf | Get the date signature. | class AttestationCacm
public function getSignDate(): ?DateTime {
return $this->signDate;
} | 1 |
56df017a8082fe00f949435c3234bcf2 | 0043f831b6b6b532698be388cdd17a97 | Configures WebAPI to send formatted JSON responses (instead of XML) to browsers that request text/html. | namespace EdFi.Ods.Api.Startup
public abstract class StartupBase : IDisposable
protected virtual void ConfigureFormatters(HttpConfiguration config)
{
var existingJsonFormatter = config.Formatters.SingleOrDefault(f => f is JsonMediaTypeFormatter);
if (existingJsonFormatter != null)
... | 1 |
5ce4d9eb11da7b6b0725cff7e1646743 | 1c1d7dff3f9fef431c4d43740f61e28c | Retrieve 1 or 2D convolution parameter "kernels" as pixel data | class Visualizer:
def get_kernels(self, layer_name):
kernels = self.model.get_layer(layer_name).get_weights()[0]
return kernels | 1 |
f6ad3ab3e0353bbfd87f09a10456d00b | 849a5ac5ed1e47735839066601385c1d | Store the basis to the basis file.
The basis file contains a list of graph6 strings for canonically labeled graphs building a basis of the
vector space.
The first line of the basis file contains the dimension of the vector space. | def write_json_basis(file_path, bs):
_write_plain_json(file_path, sort_basis_dict(bs)) | 0 |
1a203bd2be82a2d5bc9fa9122159d7a4 | e8abe95e67b8ac739852ca540155d363 | 组件挂载之前,从本地存储加载数据 | load () {
let data = localStorage.getItem('data');
if(data){
this.data = JSON.parse(data);
};
} | 1 |
174d05129c64c876916f83ea8ea08051 | e7653b16257e0652d8726a972ce4a699 | Gets the most recent price ticker from Bitfinex | response = requests.get(f'https://bitbay.net/API/Public/{crypto}/ticker.json',timeout=5)
try:
response
except requests.exceptions.Timeout as to:
print(f'Request times out {to}')
except requests.exceptions.TooManyRedirects as tmr:
print(f'Request exceeds the configured number of m... | 0 |
f6e3699c9076bed671aa19eaca1d3c6e | 21ccd52f1d04510871040f75023e6850 | Return the selects that make up this union. | public abstract class DefaultSqlExpressionVisitor : SqlExpressionVisitor
protected override Expression VisitUnion(UnionExpression unionExpression)
{
return unionExpression.Update((SelectExpression)Visit(unionExpression.Source1),
(SelectExpression)Visit(unionExpression.Source... | 1 |
cd83bb04dd689f09a8801d51813b76c4 | fff3f729f2c13d8e89061b3d528f69d7 | Create an instance of {@link PutResponseType } | @XmlRegistry
public class ObjectFactory
public StockItemResponseType createStockItemResponseType() {
return new StockItemResponseType();
} | 0 |
51acbc7e458694c89129f11a27b73299 | 8de0f0030373e4f635d907df514cb8f7 | set trim capacitor without programming trim EEPROM | {
uint32_t tmpreg;
assert_param(IS_BKP_DUCC_TRIM(DUccTrim));
tmpreg = MDR_BKP->REG_0E & (~(uint32_t)DUccTrim_Mask);
tmpreg |= DUccTrim_Mask & (uint32_t)DUccTrim;
MDR_BKP -> REG_0E = tmpreg;
} | 1 |
bb7c46bb97ebce538fcc0f08e576907c | 7b21a0cae483a94d21a70914b7a4c195 | Given a number, num, prints out that many of the top/most frequent words in the text. | const char* word;
map_iter_t iter = map_iter(&words);
int i=0;
printf("%s",msg);
pair* sort = calloc(size, sizeof(pair));
while((word = map_next(&occurrences, &iter))){
pair occurrence;
strcpy(occurrence.word, word);
occurrence.count = *map_get(&occurrences,word);
... | 1 |
9a8364320418934f8f433ec207fc9dea | 50adf26a0981658175eb254f446653e7 | 标识符:TTMS_SCU_Studio_UI_Mod
函数功能:用于修改系统中现存的一个演出厅数据。
参数说明:id为整型,是需要修改的演出厅ID。
返 回 值:整型,表示是否成功修改了演出厅的标志。 | int Play_UI_Modify(int id){
play_t play;
int rtn = 0;
int n;
play_list_t list;
int playcount;
char type[10];
char rating[10];
if (!Play_Srv_FetchByID(id,&play)){
printf ("无剧目!按任意键返回\n");
getchar();
return 0;
}
if (play.type == (play_type_t)1)
strcpy(type,"电影");
else if (play.type == (play_type_t)... | 0 |
c342b6ff14bcc166aedf71ef00b7a227 | 0479a398d954053b3d8088a9510d4571 | Connects to server endpoint with user name and password. The password
will be encrypted. The Unified Automation's server accepts user "root" with password "secret" | timeSession = System.currentTimeMillis();
connection = new Connection(address);
try {
connection.connect();
if (connection.authenticateWithPassword(user, pwd) == false)
throw new IOException("Authentication failed.");
} catch (Exception e) {
output(e.getMessage());
}
} | 0 |
5e03cefa86e290d5e445ed1452064fdf | cfc8e2a745b60f073f2c7393888152a7 | 取得H5游戏列表,id:只取某个游戏 | $game_ids = $this->e_redis->get($this->hd."_gameIds_list");
if(!$game_ids){
$secretKey = "Q4kDrf7HociYDbIt";
$timestamp = time();
$data = [
"main_id" => $main_id,
"time" => $timestamp,
"sign" => md5($timestamp.$secretKey... | 0 |
a27cdeca5b26fee44d583ceb2201a4a9 | 576c0f96e59a1a0027453d68928eaacf | Does this crop spread? | return (
self.__has_crop_mask
or self.has_masking_objects
or (self.has_parent_image and self.parent_image.has_crop_mask)
) | 0 |
d212a2054e6d1272d1aed518285339e1 | 1e9b52ca43bc4bf3f9cacc75cfaaec9f | 获得并且重置上次修改的状态 | public class DetailModifyStatus
public static Boolean setCurrentModify(Account account, Post post) {
releaseModifyStatus(account);
DetailModifyStatus.currentModify.put(String.valueOf(account.getId()), String.valueOf(post.getId()));
DetailModifyStatus.currentModifyName.put(String.valueOf(post.getId()), account.get... | 0 |
c0dbd8915dfb7b6e13f4b0dfaddafef8 | 0c69b1a89eb822b5598db1ddc83a227f | Implementation for `update_params`. | class Protocol(CommandResponseInstrumentProtocol):
def _update_params(self, *args, **kwargs): | 1 |
3df00796433405678c7406eb93c5e1ba | d1d40303dad374d683b7e72db8f9db60 | A collection has many land owners | class User extends Authenticatable implements JWTsubject
public function ship_owners()
{
return $this->hasMany('App\ShipOwner');
} | 0 |
e5ed589020f83355d32fb708eb0f2f81 | 9697957b9c86ca2dbe5d3db085602ef6 | Determines whether a threaded binary search tree is empty. | class Thread_BinaryTree{
bool Thread_BinaryTreeisEmpty() const{return root == NULL;} | 1 |
6edd7e2e8917293aee4c14b1154c8f58 | 2be1f6d18169d310731d2315736f3c70 | ### messages.editChatTitle | namespace VkNet.Categories
public partial class MessagesCategory
[ApiVersion("5.44")]
public bool EditChat(long chatId, [NotNull] string title)
{
if (string.IsNullOrEmpty(title))
{
throw new ArgumentException("Title can not be empty or null.", "title");
}
var parameters = new VkParameters
{
... | 1 |
b6160a52767ea5a8f6512f9fcc3dde93 | 400dd9c2102345ab1d78bcf5269b7d3b | Shows error popup with action button. | namespace AppStatistics.Tizen.Wearable.Services
class InformationPopupService : IInformationPopupService
public void ShowErrorPopup()
{
InformationPopup informationPopup = new InformationPopup();
MenuItem bottomButton = new MenuItem()
{
Text = ErrorPopupB... | 1 |
0d37ca81a65393b6878c3700f264a934 | f68db7cfa7a133d581561082ee486cde | 初始化窗体系统按钮列表 | namespace VisionFrame.UI.Forms
public partial class ListModuleForm : ModuleForm,IListModuleForm
protected override void InitToolBar()
{
bar1.Items.Clear();
bar1.Items.Add(btnAdd);
bar1.Items.Add(btnEdit);
bar1.Items.Add(btnView);
bar1.Items.Add(btn... | 1 |
19315918e92d6a09dd227584401d2b07 | a1c65bcd80cc6d433404b552820cf563 | 用前e个物品装容量为h的包产生的最大价值 | let f: number[][] = [];
for(let i=0; i<e; i++){
f[i] = [];
for(let j=0; j<h; j++){
f[i][j] = j;
}
}
for(let i=1; i<e; i++){
for(let j=1; j<h; j++){
for(let x=1; x<j; x++){
f[i][j] = Math.... | 0 |
be46b1cdb2a05c3f6bf313292fb87324 | 2370ba4e16e446f9dbcf21906357b109 | ハミング距離 | int hDist(int x, int y) {
int count = 0;
for(int z=1; z< (1<<B); z*=2)
if((z&x) != (z&y))
count++;
return count;
} | 1 |
f7d4810c1c817005f724068214220549 | 27113e26c21506b00a0dc73544b84dec | This function makes a matrix of [node_i, node_j] rows for the edge embeddings | def fill_edge_matrix(nsrcs, match_dict):
e_matrix = np.zeros((nsrcs, nsrcs))
for k, v in match_dict.items():
e_matrix[k[0], k[1]] = v
return e_matrix | 1 |
0f657b0c8aba35c4458f042fa1e6e502 | 05cd92ab00e11bed8038dab2c348146b | Loads the save that was created upon death | namespace TankPocalypse.Model.Interfaces
public void LoadFromSave(Vector2 posVector, byte heath, short bodyIdx, short turretIdx, Vector2 velocity, Vector2 turretNorm); | 1 |
298c97fcc990171c172d3898d8f4c4bd | 2e23b9758d339868d599919708556350 | Sets the value of the specified parameter in the {@code RowSet} command
with the ASCII data in the supplied {@code java.io.InputStream} value.
Data is read from the {@code InputStream} until end-of-file is reached.
the index of the parameter to set; the first parameter's index
is 1.
the ASCII data value to which the pa... | @SuppressWarnings("java:S1192")
public abstract class AbstractPreparedQuery<Stmt extends PreparedStatement, This extends AbstractPreparedQuery<Stmt, This>> implements Closeable
public This setCharacterStream(int parameterIndex, Reader reader, long length) throws SQLException {
stmt.setCharacterStream(parameter... | 0 |
ad5b3ebf18bb106d70e63d727f9fe340 | 8b0f83f59370cfc10b83a8f92f46ec5a | Creates a C Project. | IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
final IProject newProjectHandle = root.getProject(name);
IProject project = null;
if (!newProjectHandle.exists()) {
IWorkspace workspace = ResourcesPlugin.getWorkspace();
IWorkspaceDescription workspaceDesc = workspace.getDescription();
wo... | 1 |
ef6da5c8a1ed7e697842224f3ea5e0d3 | 7eaea67bb02b9ed2a9d38a9e77c16818 | Returns the text in the Bottom Text View | public class MovieEditorController
public ViewGroup getBottomView() {
return getActivity().getBottomView();
} | 0 |
0bd370811efce3409d6ed3b73bd5f296 | 76aa6b25e2744e08761e9fcc4c63004d | simplicial distance | bool mdis(const pi &a, const pi &b){ return abs(a.first-b.first)+abs(a.second-b.second); } | 0 |
bc46ddaaad60eab54f4394162284fc90 | 3e16f7b5af9e58db9c10e0264c9b5831 | Notify this worker's children to run and start trying to steal. | namespace corgi
void EntityManager::WakeWorkerThreads() {
SDL_LockMutex(worker_thread_mutex_);
SDL_CondBroadcast(worker_thread_cond_);
SDL_UnlockMutex(worker_thread_mutex_);
} | 1 |
c5a7ce960bfb06a5288bde7b5aacad4a | 993ab303aa1e6ef9585d31e728b0dfd4 | Prompt user for integer to add to vector | if add_collin:
prompt += ': '
while True:
try:
i_value: int = input_processor(input(prompt))
assert i_value > 0
return i_value + input_0
except (TypeError, AssertionError):
pass | 1 |
aa7a02856acd32b3c5ef9b2c22dda664 | 4da8dffe597c95b1d6eb3cada4a80cf1 | Return the secrets provider config. | {
return array(
'clientId' => 'mautic.integration.keyfield.clientid',
'clientSecret' => 'mautic.integration.keyfield.clientsecret'
);
} | 1 |
366d0e0c1c5ded8443078d2a58c31426 | 0e07daea39ea9ad94c1b90aa15e097b7 | 将句子都设置成同样的长度 | def padding_sentence(sentences, padding_token='UNK', padding_sentence_length=None):
max_padding_length = padding_sentence_length if padding_sentence_length is not \
None else max([len(sentence) for sentence in sentences])
for i,sentence in enumerate(sentences)... | 1 |
5b5d667fc0ee3dc1560782ddd022083f | 5c6b99844d1fe4f1e28ca79852634519 | On construction, initialize the pointer and figure out if
we're capturing the pointer or attaching to it | if (attached)
return false;
pin = p;
if (atch && pin!=-1)
return attach();
return true;
} | 1 |
668ad6dbfc4826b76d1225ed1a9c683a | b941f1caf6cae1d6458c56c92dac4ff1 | Check if 'percent_health' has a value | class LobbyPokemon extends \Protobuf\AbstractMessage
public function hasPercentHealth()
{
return $this->percent_health !== null;
} | 1 |
bb6caa16ae7330b2dc423a448c2eb7e2 | b596c7a78094eb56710ed552889adea7 | Convert a binary char array to unsigned int | class BLYreader():
def byte_to_uint(self, b_arr):
return struct.unpack('>I', str(b_arr))[0] | 1 |
cbe3e0199384765e91a995422c9abd6e | 550601ae99f7e9200dda447ab9089831 | XとYの差集合 | {
if( xArray.Length != yArray.Length )
{
return null;
}
_ValueT[] ret = new _ValueT[xArray.Length];
for( int index = 0; index < ret.Length; index++ )
{
ret[index] = xArray[index] - yArray[index];
... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.