query_id
string
corpus_id
string
query
string
code
string
label
int64
81fef09b89a9baf964c0e5c03c5eb6d6
77806216301e1b17377efe3d455c6323
Convert image from RGB to HSV and randomly change the V component. Then convert back to RGB
HLS_before = cv2.cvtColor(image, cv2.COLOR_RGB2HLS) h, l, s = cv2.split(HLS_before) randH = np.random.randint(low=0, high=20, dtype=np.uint8) signH = np.random.randint(low=0, high=2) if signH == 1: h = h + randH else: mask = (h >= randH) h = h - mask * randH randL = ...
0
eb36beea95d522b19009fa0b980f332d
d9605ebd189520b1cf9373c613474fa4
Loads cortex dataset.
class VitonDataset(CpVtonDataset): def __init__(self, opt): super().__init__(opt)
0
ad0a0634bc20bd633d1ec30a900e6031
1261b80af0ab915940dcd3b0217acd1e
A categorical distribution for multi-branched discrete actions.
p: Distribution, q: Distribution, input_var: Optional[List[str]] = None, dim: Optional[int] = None): self.dim = dim super().__init__(p, q, input_var)
0
720c5d634f4b1af33be3635f488473d8
2b48d596e23e15831b640bd5c6283bd6
Checks if it's legal move. If not, the error message comes out.
public class Board public boolean moveIsLegal(int index, Stone m) { int[] coord = getCoordinates(index); return moveIsLegal(coord[0], coord[1], m); }
0
fcd210e9e0892f84c96cd6a907930d92
a2baf7b47d1fa830fb994362db118cc2
BenchmarkRegister benchmarks the Register method for work units.
c := NewCounter() for i := 0; i < b.N; i++ { c.Add(1) } }
0
b4faea0d8172661a2c1eb76e5d91727e
b7b4235bcfb2911aa1686a60441a65fc
round d to 5 sig digits
class EulerAnglesSimplifyTest : public ::testing::Test inline double round6(double v) { return round(v * 1000000) / 1000000; }
0
d0a7e023d36f39bd7987aa7bc6ad7250
b8692c24c22ac5e3d1c0fb654f9658fc
initialise un graphe d'apres la liste d'adjacence l_adj et son ordre n
for i in range(self.nombre_sommets()) : self._matrice_adjacence[i].append(0) self._matrice_adjacence.append([0] * (self.nombre_sommets()+1)) return self.nombre_sommets()-1
0
33e52fee07fcf6a84c8b91c0eeaea644
24a2a4574e30c91e987ce08509de9723
r""" Return the Hecke module of level N corresponding to self, which is the domain or codomain of a degeneracy map from self. Here N must be either a divisor or a multiple of the level of self.
class HeckeAlgebraElement(AlgebraElement): def fcp(self, var='x'): return self.hecke_module_morphism().fcp(var)
0
8fd62b647d450c10d56cfbdc1d9a4074
19b0fffeeab365e0001b2a6e13202655
Retrieves an existing Brain.
class Adapter(object): def get_brain(self, interfaces=None, **query): brains = self.get_brains(interfaces=interfaces, **query) if brains: return brains[0]
1
cf3694ed0f9e6af3248a30435e6d78f1
c9dc9398f9e8a089d60f4707f62c4659
キー入力 4 の入力キーの設定を既定値にリセットする
namespace Macrobo public partial class MainMenu : BaseForm public void ClearKeyInput() { try { ShiftKeyDown = false; ControlKeyDown = false; SKeyDown = false; } catch (Exception ex) { ...
0
98ca9d6d2cd2130f3657b451c2508bb7
8953c15299782a5391ea41399d958f92
将0所在的行与列均赋值为0
in := [][]int { {1,4,3,4}, {0,8,2,5}, {8,4,6,6}, } n:=len(in) m:=len(in[0]) var row0 []int var col0 []int for i:=0;i<n;i++{ fmt.Println(in[i]) for j:=0;j<m;j++{ if in[i][j] == 0{ fmt.Println(i,j) row0 = append(row0, i) col0 = append(col0, j) } } } fmt.Println("--------------------...
1
c21ae42f5160274e1d2b6a501dcd06b5
3519bd1efb71cfc129c0da7e4f6ec49d
Recursive function that calculates the Pascal Triangle values using summation property
if col == 0 or row == col: return 1 else: return computeCoeff(row-1, col) + computeCoeff(row-1, col-1)
1
cae8c66c952c2b47b45c6543eaac48ff
551ad08f42678ab5c291d95d153d4eac
配送先住所変更の対象データを取得
class LC_Page_Entry_Kiyaku extends LC_Page_EntryBase function lfGetDelivData($customer_id) { $objQuery = new SC_Query(); $sql = " SELECT *"; $sql .= " FROM dtb_other_deliv "; $sql .= " WHERE customer_id = ? "; $sql .= " ORDER BY other_deliv_id DESC "; $arrval = array( ...
1
a3fa8fe254a2afd25716ef4a991cb824
91b3a909550e35f92f614ab85afcd8e3
Поворачивать и перемещать врага к цели
public class MonsterControllers : MonoBehaviour void MoveAndRotation() { nav.destination = target.position; float newSpeed = Mathf.LerpAngle(ani.GetFloat(walk), speed, Time.deltaTime); ani.SetFloat(walk, newSpeed); }
1
c7c6389609d3237d76af381d3fbe6b9b
c36affac332c6aff6baecb1f96592fe5
Must return True or False and tell if rpc must challenge authentication for the current peer.
class AMQPChannel(StatefulObject): def _check_for_rpc_request(self, value): pass
0
770e8b0d36c19ffbc654fa38ddc54805
b524e042eba1c6a92ac1a6c8c4de221e
Returns a collection of Profile objects. (asynchronously)
export class ProfilesApi extends BaseAPI public listProfiles(options?: any) { return ProfilesApiFp(this.configuration).listProfiles(options).then((request) => request(this.axios, this.basePath)); }
1
1abb08f4eb0d69320503207f8256efa7
96743555a81b874215ba2cb9fd8ff4ad
intSeq这个函数返回了另外一个匿名的函数,返回的这个函数对i形成了闭包
var n = 10 return func(i int) int { n = n + i return n } }
1
79e41e33b273c9a21140664472aa2713
50dc6ff91e60d294356ebc7f633d2b77
updates the page number when user moves to next page
if (e.target !== '...') { this.currentPage = parseInt(e.target.innerHTML); this.currentPageData(); } }
1
b3f928aa904831285375552ff76ecc5b
cb6740f26e1d61011e4e98dd27f6c602
#Parse the homolog file from OrthoVenn2 into DataFrame.
motif.tab <- read.table( path, header=TRUE ) colnames(motif.tab) <- c( "consensus", "pval", "log.pval", "fdr", "occ.motif.top2K", "frac.pos.peak", "occ.motif.bkg", "frac.pos.bkg" ) motif.tab <- within(motif.tab, { frac.pos.peak <- as.character( frac.pos.peak ) frac.pos.bkg <- ...
0
2e51719a476f7483d5802ea15f2d9523
17af111fc8f766c8aebd9c0c809107ed
Delete a batch of supplied messages that have been handled.
class Queue public static function deleteBatchMessages($processedItem) { if (self::$sqsClient === null) { return null; } self::$sqsClient->deleteMessageBatch([ "QueueUrl" => self::$queueUrl, 'Entries' => $processedItem ]); }
1
adb91dbd5ec0a5ccbf5b44253f9ecd6b
1f3c2f7516b8fccbbca94c08e624149c
Creates a condition to search by a Framework Id.
if (!this.Project.Frameworks.ContainsKey(framework)) { throw new ArgumentException(string.Format(CultureInfo.InvariantCulture, ResourceUtils.GetString("NA1096"), framework)); } }
0
7b6a6f6da0cd299b3b311fd62edb2555
186e530d87685de5b7ccad56367f1d01
Sends the result from worker to master
void uniteResult() { if (cur_rank == 0) { MPI_Status s; for (int r = 1; r < process_count; ++r) { MPI_Recv(C + r * matrix_size * block_size, matrix_size * block_size, MPI_INT, r, 0, MPI_COMM_WORLD, &s); } } else MPI_Send(C1, block_size * matrix_size, MPI_INT, 0, 0, MPI_COMM_WORLD); }
1
222cdfe2d40b27f936b6c8bb486503a4
48da6034357923b453b82989c5f272b0
根据页面查询条件(商户号,商户名,当前等级)查询商户评级信息临时表
public class SmDisrateImportDao extends BaseDao public PageResult<Map<String, Object>> selectTmpDisrateDealerQuery(Map<String, Object> map, int curPage, int pageSize)throws Exception{ StringBuffer sbSql=new StringBuffer(); sbSql.append("SELECT *\n"); sbSql.append(" FROM TMP_DISRATE_DEALER\n"); sbSql.append("...
0
150931a4f4e4b0eee1c402b54fe78e80
a00c232cbc1d6ac7ca2446d4f38dd635
用一个纹理绘制指定范围内的所有可见字符
class AWTFontRenderer(val font: Font, startChar: Int = 0, stopChar: Int = 255) private fun renderBitmap(startChar: Int, stopChar: Int) { val fontImages = arrayOfNulls<BufferedImage>(stopChar) var rowHeight = 0 var charX = 0 var charY = 0 for (targetChar in startChar until stopCha...
1
3b5a620ebb45751e5acf2b8220602f51
ec0f24636684b1cebc97452639b8c027
##================== COMPUTE FUZZY MEMBERSHIP MATRIX [SAMPLES * POINTS] =============================
mx = matrix(data = rep(0, max.clusters * max.clusters), nrow = max.clusters, ncol = max.clusters) for (i in 1:max.clusters) { helper = cutree(clust, k = i) for (j in 1:i) { if ((sum((dt$X.dem..country_code == "US") * helper == j) == 0)) { mx[i, j] = 0 } el...
0
127fc9be720262729c7ee27858a334b3
2e1b904bdfe6fe45a0ff91c36004ea65
获取1分钟负载监控数据
return new Promise(function(resolve,reject){ $.get("/dist/mock/render.json").then(res => { resolve(res['stat-by-minute']) }) }); }
1
2e160018a90b7f0ad75b22ca6affe78d
9ee14729e0e5a4867535ff001ace4337
Function Name: StepPulser_ReadRxStatus Returns the current state of the receiver status register and the software buffer overflow status. None. Current state of the status register. Side Effect: All status register bits are clear-on-read except StepPulser_RX_STS_FIFO_NOTEMPTY. StepPulser_RX_STS_FIFO_NOTEMPTY clears imm...
uint8 PERI_SPIM_ReadStatus(void) { uint8 tmpStatus; #if(PERI_SPIM_TX_SOFTWARE_BUF_ENABLED || PERI_SPIM_RX_SOFTWARE_BUF_ENABLED) PERI_SPIM_DisableInt(); tmpStatus = PERI_SPIM_GET_STATUS_RX(PERI_SPIM_swStatusRx); tmpStatus |= PERI_SPIM_GET_STATUS_TX(PERI_SPIM_swStatusTx); tmpStat...
0
4218ceee30748b98f2d6a804db0baa8f
e4f5e3b097cbeb9f0e7aae35692c2b19
초과 근무 관리 페이지
const { auth_user_id } = request.query; if (auth_user_id === null || auth_user_id === undefined) { return response .status(400) .send({ errorMessage: 'query.auth_user_id 누락' }); } const datas = await WorkLog.findAllOverWorkTime({ login_auth_id: auth_user_id }); return response.send(datas...
1
a5adea9fbb3b803f4ca8d7312d16d0d4
406d8b1ba008cc7572c987991078c14f
convert from DTO > save into DB
String objectId = dtoToConvert.getId(); Address objectAddress = AddressMapper.dtoToObject(dtoToConvert.getAddress()); Local objectLocal = LocalMapper.dtoToObject(dtoToConvert.getLocation()); List<Room> objectRoomService = new ArrayList<>(); for (RoomDTO y : dtoToConvert.getRoomLi...
0
7490a4384115101d91c6b8296d482968
279a09f023db4bf32df35cba2f366daf
获得CI_Tree数据表中的所有记录
namespace Hownet.BLL public partial class CW_KJFLInfo public DataSet GetAllList() { return GetList(""); }
0
f1f7f8595dedf60d46b712272b440c34
76fa42394e10502e77ac685932dad0ca
新闻图片绑定数据
public class CardAdapter extends RecyclerView.Adapter implements View.OnClickListener{ @Override public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) { MyViewHolder holder2 = (MyViewHolder) holder; PhotoInfo newsinfo = mData.get(position); holder2.NewsImg.setImageDraw...
1
fd71ed2f5d9dd89b3df2b6cd7228770a
60c2511ac66253e695a98b2c34407450
Downsample depth pixels with nearest neighbor
def _downsample(x): return nn.AvgPool2d(kernel_size=2)(x)
0
e7e1e58aac41794f8944dbe1c3fa8be1
713a8a66402e9c1c2e74b23e33cd9107
Returns True if photo is a burst photo and has been selected from the burst set by the user, otherwise False
class PhotoInfo: def burst_selected(self): return bool(self._info["burstPickType"] & BURST_SELECTED)
1
545d98ec99c4743c6466a8873a3dd759
a2e17893a34d8902b36ce41a2c26804f
指定したパスのインスタンス番号を返す
public class ChessLite extends Application public int getPieceSelection(String pathIn) { int i = 0; for(String str : AVAILABLE_PATHS) { if(str.equals(pathIn)) { return i; } i++; } return 0; }
1
86a176b0eb8c5fa271c9dd34a675f2d0
b4b940e949eaa00ba0ffa8f7feb07d44
Returns the language code associated with a particular taxonomy.
function bbl_get_taxonomy_in_lang( $taxonomy, $lang_code = null ) { global $bbl_taxonomies; return $bbl_taxonomies->get_taxonomy_in_lang( $taxonomy, $lang_code ); }
0
7debb53eabd3bb01661adde71f09fd32
473c7302a81f8846931697ce862dfbed
Ritorna il tempo di time slice per le politiche di schedulazione di processi con prerilascio. Il tempo è espresso in millisecondi.
( _task_id task_id, uint32_t *ms_ptr ) { TIME_STRUCT time; MQX_TICK_STRUCT tick; uint32_t slice; if (_sched_get_rr_interval_ticks(task_id, &tick) != MQX_OK) { *ms_ptr = MAX_UINT_32; return MAX_UINT_32; } PSP_TICKS_TO_TIME(&tick, &time); if (time.SE...
1
84297379b377d531a3392a91e3737aa0
daa5412080e534add401b19b297f6e47
Возвращает НДС (Value-added tax) в %
namespace AutoCalculator_Alex public partial class MainForm : Form private int Calc_NDS(int price, int mainTax, int excise) { double NDS; NDS = (price + mainTax + excise) * 0.18; return Convert.ToInt32(NDS); }
0
226afd0fdeb31d5e1a8fefb7dc068445
c8890290e70b53a317a2f9a74b54ca2e
当前状态可以扣积分,扣除后,将状态设置为可以抽奖的状态
public class NoRaffleState implements State @Override public boolean raffle() { System.out.println("扣了积分才可以进行抽奖!"); return false; }
0
01a223d48048c05181728e61b4c990ef
38475cc1b649b24661f7326e3ae328cb
creates a test sample, and then computes the corresponding bayes factors for the permuted and unpermuted data sets
boolean reorderDiscreteVariable, int numPermutationsToCheck) throws Exception { RandomGenerator rg = new RandomGenerator(); int[][] newOrderings = rg.generateRandomPerturbations( continuousDataX.length, numPermutationsToCheck); return computeSignificance(reorderDiscreteVariable, newOrderings); }
0
b834700305e128d32458b18cd727b54b
26fc694b1f87697b0fad4f45c5f61c8b
普通提额
public void activeMorerate(HttpServletRequest request, HttpSession session, HttpServletResponse response) { String account = (String) session.getAttribute("loginUser"); String n = (String) request.getParameter("n"); String c = (String) request.getParameter("c"); if (Empty...
1
f5d80b7fd806660cd6ec072d6b5e0051
1d99c774b981960cff45d14495589929
grabs the mouse to the window
void BaseDX::captureMouse() { SetCapture(mWindowsScreen); RECT rcClient; POINT ptClientUL; POINT ptClientLR; GetClientRect(mWindowsScreen, &rcClient); ptClientUL.x = rcClient.left; ptClientUL.y = rcClient.top; ptClientLR.x = rcClient.right + 1; ...
1
2d8742a44e142aaeed9f881b452d8918
0a26e88ac0f7d3028c713a4ecd46d05d
在相册中上传照片页面
class PhotoController extends Controller public function create(Request $request) { return view('photo.upload', $this->getUserPhotoGroupInfo() ); }
1
f42bb17b33b608e46db50d2d68972990
450dd8ea91157dc2874d313905a51ebf
compares a specific number with course number
if (strcmp(code, courseCode_) == 0){ return true; } return false; }
0
3afe7898a859475ce156f3eb0b2d2ddf
30e5ddef5b6dfd6860d0f2ae745417cd
Consumes the next token and asserts it's the end of an array
class SmileGenerator(object): def write_end_array(self): self.write_byte(TOKEN_LITERAL_END_ARRAY)
0
ed7fe8f5c53d63ff9335eccfffef1139
a5fb79ea549c4b39827d7ef95f4d166b
Разбор ответа с дельтой импульсов
String raw = ""; int index = 21; if(rec[0] == 0x01 && rec[1] == 0x00 && rec[2] == 0x01) { for(int unit = 1; unit < 9; unit++) { for(int ch = 1; ch < 17; ch++) { for(int i = 0; i < 4; i++) { if(ch <= MAX_CH && unit <= MAX_UNIT) { raw += String.format("%02x", rec[index]); } in...
0
5ef2857b285c2040b201af25ae08c777
2828ed6018bac08ab523335841e74ba4
Save device token in the database
if(firebaseAuth.getCurrentUser() != null) { Map<String, Object> data = new HashMap<>(); String uuid = firebaseAuth.getCurrentUser().getUid(); String token = FirebaseInstanceId.getInstance().getToken(); data.put("id", token); db.collection(USERS).docume...
1
a71089e0d9a9f21f72db505c339175b6
eed2f5cb063f17b23360dfa3aa3fbe29
Bob Jenkins' "one_at_a_time" hash function http://burtleburtle.net/bob/hash/doobs.html
int h = hv; h += ~(h << 9); h ^= h >>> 14; h += h << 4; h ^= h >>> 10; return h; }
1
bb2dbc840f378f6430288025d620ebdc
7b27ff14789bf1525453c7a427ea0b72
转换SNES格式的8x8像素Tile为BMP格式
function make8x8Tiles( $source, $gd, $pal, $tileAddr ) { fseek($source, $tileAddr); $i = 0; for($i= 0; $i < 48; $i++) { $j = 0; for($j= 0; $j < 32; $j++) { $y = 0; for($y= 0; $y < 8; $y++) { $x = 0; for($x= 0; $x < 8; $x = $x + 2) { $byte = getByte($source); $rightpixel = floor(...
1
18cd87a5bec0753ccf1de0e32639f442
f408c1c3867d9fac902d2f9832321212
Sets the team 1 expected score.
@Entity @Table(name = "Game") public class Game public void setScore1( String score1 ) { this.score1 = score1; }
1
8dff6a53cccd72dbefff6424f8ee072d
1d777ab359e61c15a7fddec5d99c9258
Remove the specified gallery_Project from storage.
class GalleryController extends Controller public function destroy(Gallery $gallery) { Gallery::findorFail($gallery->id)->delete(); return redirect()->route('galleries.index')->with('success','Gallery Deleted successfully'); }
1
ac8bb1ea7791bd332d3b8da970404476
763850d258bac5ef988c471712f05a0d
# ~4-7 lines # Perform classification using artificial neural networks using the nnet library
x1 = cbind(array(1, c(nrow(input), 1)), input) z1 = x1 %*% t(w1) s1 = nnet_sigmoid(z1) x2 = cbind(array(1, c(nrow(s1), 1)), s1) z2 = x2 %*% t(w2) s2 = nnet_sigmoid(z2) x3 = cbind(array(1, c(nrow(s2), 1)), s2) z3 = x3 %*% t(w3) s3 = nnet_sigmoid(z3) x4 = cbind(array(1, c(nrow(s3), 1)), s3) z4 = x4 ...
1
7ecc9193c8bbfb5f4d217a419513dd7d
e804eed9f5b3906a6439e09c0f58dec2
Returns a preferred high-quality interpolation method for resizing. The preferred method depends on whether the image is decreasing in size or expanding in size.
if (value == null) { return LINEAR; } switch (value) { case 9728: case 9986: case 9984: return NEAREST; default: return LINEAR; } }
0
9006a6c3d0855cba8c57ee7f29b57c4e
1fb459e9afcfe574c03970e82be302ab
Testing visibility of review requests assigned to invite-only groups by a non-member
class GroupMembershipRequestFormTest extends GroupBrowserTestBase public function testRequestForm() { $this->drupalGet("/group/{$this->group->id()}/request-membership"); $this->assertSession()->statusCodeEquals(403); $account = $this->createUser(); $this->drupalLogin($account); $this->drupalGet("/gr...
0
6ccbfbdc6327719f8f912ab63f89b979
fc131617403fe17bb897f62012883eb2
Get the position of the next lexeme in the stream.
namespace Engine class RegexParser private int GetPosition() => next;
1
c64b155ea33cff4793cbb71235621179
f63ee76b09c155ae9977cc96e3b5a38b
Cette fonction est appelée automatiquement toutes les secondes grâce au setInterval(...) de la fonction init(). Elle doit parcourir l'ensemble des capteurs réels créés (et contenu dans le tableau javascript capteursReels) et pour chacun, émettre une requête ajax
function majCapteursReels(event) { }
1
64910adca3a13d7a7be834a073311d86
5fc5c0d34d3c284c323fc91ec7ce49d5
PDお問合せの回答目処日アラート通知
@RunWith(YcComJUnit4ClassRunner.class) @ContextConfiguration("/jcclientContext.xml") public class MailTest extends BaseTest @Test public void testQuestionAnswerSummary() { CommunityUserDO communityUser1 = createCommunityUser("テスト1", false); CommunityUserDO communityUser2 = createCommunityUser("テスト2", false); C...
1
be48914bf087795e7ab5c89f76417345
0aafabe77fe443a4cf4074526d7ab003
In no classpath mode, when we build a field access, we have a binding typed by ProblemBinding. We try to get all information we can get from this binding. Used to get the problem binding of the field access and the name of the declaring type.
Element element = getBindingManager().getElement(param.toString()); return ClassName.get(getPackage(element).getQualifiedName().toString(), element.getSimpleName() + ClassBuilder.STUB_SUFFIX); }
0
92c650547fa0d657cd3e6b3f4aecc950
2fc220d3d375e7e227c1071e93f64e45
Test Qi Stage Lib But No Such Target
class InterfaceTest(cros_test_lib.OutputTestCase): def testNoTarget(self): argv = ['--gs-path', _GS_PATH] self.assertParseError(argv)
1
abb7bef8334c1815e3414e890ea07780
303b379477ebc6ab550e0fd2db207122
Test the less than comparison when the value is equal.
class LessThanEqualTest extends PHPUnitTestCase public function testValueBeingLessThanEqualWithALessThanValue() { $Check = new FireCheck\LessThanEqual(3); $code = $Check->passesCheck(2); $this->assertSame(FireCheck\ErrorCodes::NO_ERROR, $code); }
0
8d61167386aab81825a351fa2f2794f9
ec2c94d085929b5b6492e59f2b60fe80
%% Percent of Data that is Unique
if myserie.unique().shape[0] == myserie.shape[0]: return True else: print('{:.0%}'.format(myserie.unique().shape[0] / myserie.shape[0]), ' of values unique') return False
1
49b6b8c702d72c3c27460f367204db47
dc3774800fa3003680898756333a39ab
Get the font-awesome icon class (e.g. fa-pie-chart) http://fortawesome.github.io/Font-Awesome/icons
class Typing_Text extends Widget_Base public function get_icon() { return 'fas fa-feather-alt'; }
1
5ef6c9cf1befb1ebb3a48e11ce9a91bd
f8e9297b572d3b8a0a2e5e10862ab1ee
Retrieve a stable, default mac address for the device
class BaseView(View): def get_macaddress(): return get_mac()
0
7608365809a07d6cb0ec44a3275f5e58
3e6b25e8e411fe184fc630a424cfe6fd
根据输入料号,查找该料号的直接下层;
{ OleDbCommand comm = new OleDbCommand(); comm.Connection = mySystem.Parameter.connOle; comm.CommandText = "select ID from 吹膜工序领料退料记录 where 生产指令ID=" + instrid + " and 物料代码='"+matcode+"'"; OleDbDataAdapter da = new OleDbDataAdapter(comm); DataTable temp...
0
85994fe2df30f374d086f4638ff8fce0
2bf7768e0e16027e22896a6e4d499b42
获取某天的数据。 在Redis和数据库中缓存。 <p>
Date get(String type);
0
b7f2dc280d9af9bd4a55bc546e68887a
557185ee1fc76fb46b4c7815e950547a
建立功能選單維護作業的樹(可按滑鼠右鍵那一支)<br>要記得先setSysid的值
{ List<TreeEntityForLayui> retValue = new List<TreeEntityForLayui>(); listFUNINFO.Where(f => f.ParentID == "0" && f.SYSID == SYSID).ToList().ForEach((f) => { TreeEntityForLayui tree = new TreeEntityForLayui() { name = f.FUNName, id = f.FUNID, pid = f...
1
7e081f5fd62efe8e923c935423ac83a2
9a0645073d78fbd5075b5304181a6bcd
创建右侧fragment
setBehindContentView(R.layout.menu_frame_right); getSupportFragmentManager().beginTransaction().replace(R.id.menu_frame, new SlidingRightFragment()).commit(); final SlidingMenu sm = getSlidingMenu(); sm.setMode(SlidingMenu.RIGHT); sm.setShadowWidthRes(R.dimen.shadow_width); ...
1
f5963ee2c1d41f9af187c1c881a60c02
9ad4fb414c460d411701a3c261a1b1b3
updates the location of the rock, and the direction the rock is traveling.
{ totalTravelled += distanceToAsteroid(newX, newY); x = newX; y = newY; }
0
b7baca6323aaa7bab84f0af9b45f38c6
c307073f586a4fab095ad6e5f2ea3745
Käsitellään tietokoneen muokkaamista. Tarkistetaan, että käyttäjä on kirjautunut. Luodaan tietokone-objekti POST-tiedoista, ja päivitetään tietokone tietokannassa. Virhetilanteessa näytetään muokkaamissivu uudestaan ja missä kentissä ongelmakohdat olivat.
@Controller public class NewsController @RequestMapping(value = "/news/{newsId}", method = RequestMethod.POST) public String updateNews(@Valid News news, BindingResult result, RedirectAttributes redirectAttributes, @RequestParam MultipartFile file) { if (result.hasErrors()) { redirectAttributes....
1
6acbbe4d9a4de89dad993be28be9eead
f8adfce828df2d7ac7e4d48f04c38320
Возвращает список, где вместо пары элементов записана их сумма.
namespace TestProject public class NumCollectionParser public static Dictionary<int, int> GetPairSumDict(ICollection<int> nums, int sum) { var resultDict = new Dictionary<int, int>(); var list = nums.ToList(); list.Sort(); var startIndex = 0; var e...
0
7b3c29a6cd337b0a0f805b7fe3e0bfea
939881bbb4cf4301c0347f8755e1ae46
判断输入格式正误并将输入写入数组
bool readInputData() { fstream file("input.txt", ios::in | ios::out); int num = 0; while (!file.eof()) { char ch; file.get(ch); if (ch == ' ' || ch == '\n') { if (num != -1) { arr.push_back(num); } num = -1; } else { if (num == -1) { num = 0; } int x = int(ch) - 48; if (x < 0 |...
1
2033bb46f29a2bbefc4551fab7cddc69
018ba362f7a8c89576f8b16fbf7bb372
Returns the name of the allocator as shown in the ui.
std::string Assignments::getName() { return assignmentName; }
0
e7bf99a6a88823d42c56dd5c3a6a0809
840e44507aac16a46de4c0fdb509935a
dynamically allocates memory for struct pos
kfloat ***position = new kfloat **[x]; for (int i = 0; i < x; ++i) { position[i] = new kfloat *[y]; for (int j = 0; j < y; ++j) position[i][j] = new kfloat[z]; } return position; }
0
afc95b02e2af31e9bedd62c601889791
701d13762d84b91187a5e9a9016723ee
Reference to the slide collection for this presentation.
class SlideLayout(BaseSlide): def slide_master(self): return self.part_related_by(RT.SLIDE_MASTER)
0
ffa85bf071491b12ecd8f8edced9f822
005f05b947b41bb5b61e0fe6c7326c7d
Convert interval name to number of seconds
switch (str){ case '5m': return 2; case '15m':return 3; case '30m':return 4; case '1h': return 4; case '8h': return 5; case '1d': return 6; } }
0
99b5ea6acc0caa9c152f87736438328a
7cec4d5718e070101ee51cd48f81273c
Tests if two matrices (4x4 xyzw) are equal within an optional tolerance
namespace SharpMedia.Math.Matrix [Serializable] public class Matrix4x4f : IMatrixf<Matrix4x4f, Matrix4x4f> public static bool NearEqual(Matrix4x4f first, Matrix4x4f other, float eps) { if (MathHelper.NearEqual(first.M00, other.M00, eps) && MathHelper.NearEqual(first.M01, other.M01, eps) && M...
1
1ab70f2612360676f986d97c32e58cad
6edee5956de668c272bced248a53b275
This method copies the question.
{ old.Choices = newQ.Choices; old.Content = newQ.Content; old.Created = newQ.Created; old.Explanation = newQ.Explanation; old.Image = newQ.Image; old.IsPoll = newQ.IsPoll; old.IsTrueCorrect = newQ.IsTrueCorrect; old....
1
d317d8a8a33655308a7212ae560dd8e4
6ffcc2495b8ad955fa6e0fcdd709664a
No type argument in {@link ClassInstanceCreation} itself, but in Java7 we can use "diamond".
public class ClassTypeCreator22<T> public Object createNew(String typename, Object... args) throws IllegalAccessException, InstantiationException, ClassNotFoundException, NoSuchMethodException, InvocationTargetException { switch(args.length) { case 1 : return Class.forName(typename).getConstructor...
0
c8ce85dbe943cd591554c12b0d7c5a5e
d3e40318f47b85e4e12d146ae6a6510a
弹出栈顶字符
if (top == NULL||(*top)==NULL) { return NULL; } Stack *pdel = *top; char str = pdel->data; (*top) = (*top)->pa; if (*top) { (*top)->next = NULL; } free(pdel); return str; }
1
01da3b87ca192dcc2f194ae37a0190b6
1c03871a015105424ead56d0db2c01c9
schedule in level order traversal of the group DAG
void bfs(int n){ queue<int>q; q.push(n); visi[n]=true; while(!q.empty()){ int f=q.front(); cout<<f<<" "; q.pop(); for(int w:grp[n]){ if(!visi[w]) { q.push(w);visi[w]=true; } }} }
1
055da942f8bb9a91a96cfcba7c5577d0
439084b8da98e72cbf37c8cdf2370e94
Mark the element as expanded.
namespace Avalonia.Automation.Provider void Expand();
1
bc5aceb68e1f197effef4b45982d8c87
e1e3d90532c3cd6320fb1b9f15527f89
将多个CompletableFuture组合成一个CompletableFuture,这个组合后的CompletableFuture的 计算结果是个List,它包含前面所有的CompletableFuture的计算结果
List<CompletableFuture<String>> completableFutureList = shopList.stream() .map(shop -> CompletableFuture.supplyAsync( () -> String.format("%s price is %.2f", shop.getName(), shop.getPrice(product)))) .collect(Collectors.to...
0
e0d23447bf7a3d7d7148662eab5fba34
bb033bea32d650e1e0f4792f23805edb
ClearCaches(self: GH_GeometricGooWrapper)
func UConverterFlushCache() (_swig_ret int)
0
24c115fad662bf64f4b8a0311c6c5ec6
d5e9c387ee0940c49c3d80febb69fd04
\brief Has this process completed the required time units?
{ LARGE_INTEGER llCurrentTime; LARGE_INTEGER llFreq; QueryPerformanceFrequency(&llFreq); QueryPerformanceCounter(&llCurrentTime); if (llCurrentTime.QuadPart >= sT->llStopTime.QuadPart) { if (sT->iType == 0) { sT->llStopTime.QuadPart += llFreq.QuadPart * sT->ulInterval / 1000000; } return true; } else { ...
1
7c1de67fa030f664b0c346b325d8167c
a7d85a25dc9cde74b91281235da4fc2b
This function creates and initiliazes all opengl objects needed to render the character.
GLUquadricObj *playerSphere = gluNewQuadric(); gluQuadricDrawStyle(playerSphere, GLU_FILL); gluQuadricTexture(playerSphere, TRUE); gluQuadricNormals(playerSphere, GLU_SMOOTH); playerModelDL = glGenLists(1); glNewList(playerModelDL, GL_COMPILE); glColorMaterial(GL_FRONT, GL_EMISSION); ...
1
5d8af5ea51f4862236ab349e9accd5ea
4c5bfc87a00bce2ac33805408fdd0536
adds all the aliens to the array
for(int i = 0; i < invaders.length; i++){ invaders[i] = new UFO(context, i, screenWidth, screenHeight -(screenHeight /10)); } }
1
c532b5e3423da47a77b40f0e8b507c86
6c1b89eea709b114ee5454ed3ca8ac36
An expression being passed as a parameter (as part of a call).
public class HandlerParameter public String getExpression() { return this.functionParam.getExpression(); }
1
56f09c6f11103c98efc2df74e97d66a5
99e07ac60d36ab323b1aec9022c81e49
функция открытия окна "соощение успешно отправлено"
elem = document.querySelector('.confirm-button'); elem.style.display = 'none'; elem = document.querySelector('.success'); elem.style.display = 'block'; }
1
a2f9e1412458eb676454c419003373ae
eee465eaf033ae04d53f4b4574bc4f39
爬取 行业 -> 省份直辖市 链接
class FtxSpider(scrapy.Spider): def parse(self, response): trs = response.xpath('//div[@class="outCont"]//tr')[:-1] province = None for tr in trs: tds = tr.xpath('.//td[not(@class)]') province_text = re.sub(r'\s', '', tds[0].xpath('.//text()').get()) if prov...
1
24e43f6eaa22fcd8564c519ea14e4445
bfec60395056d0e72fdaffc20f981daa
Test der Konto-Klassen
Kunde ich = new Kunde("Dorothea", "Hubrich", "zuhause", LocalDate.parse("1976-07-13")); Girokonto meinGiro = new Girokonto(ich, 1234, 1000.0); meinGiro.einzahlen(50); System.out.println(meinGiro); Sparbuch meinSpar = new Sparbuch(ich, 9876); meinSpar.einzahlen(50); meinSpar.waehrungswechsel(Waehrung.BGN);...
1
43b753a0715814c0879f59bd476f35fb
d190ba1d81aab7e6a1462f1f89ed4984
Retrieves a collection of custom attributes of a specified type that are applied to a specified parameter.
namespace System.Reflection [ClassInterface(ClassInterfaceType.None)] [ComDefaultInterface(typeof (_ParameterInfo))] [ComVisible(true)] [__DynamicallyInvokable] [Serializable] public class ParameterInfo : _ParameterInfo, ICustomAttributeProvider, IObjectReference [__DynamicallyInvokable] public virtual ...
1
2b16210f7002590ba5f51b740cb5909e
96be30d3dc5184ed79cdcf1391fb82c7
Test 'ping <ip>' with unknown/unparsable errors on osx 10.14.6
class MyTests(unittest.TestCase): # input # centos def test_ping6_s_ip_p_freebsd12(self): self.assertEqual(list(jc.parsers.ping_s.parse(self.freebsd12_ping6_ip_p.splitlines(), quiet=True)), self.freebsd12_ping6_ip_p_streaming_json)
0
73e8f3778e317072a67f54eec8a666f0
177c67afd6b9ccb917b527f4d9c3da8e
Gets a list of filenames or relative paths of images and files which are used in the doc This allows one to delete figures which are not used At present this function only checks for files based on \input and \includegraphics ideally this function should utilize the functions of a latex compiler
filenames = [] dc_pattern = re.compile(r"\\documentclass(\[[^\]]*\])*{[^}]*}") texfile_pattern = re.compile(r".*\.tex") for root, _, files in os.walk(app.config['UPLOAD_FOLDER']): for filename in files: if texfile_pattern.match(filename): path = os.path.join(root, fil...
0
a576c76875d649948c6773b8c109214f
f899b3c08d27d3a9b37247df3cdf8573
跳转某篇文章
var url = APP_PATH + '/article.jsp?fid=' + fid; window.location.href = url; }
1
4c9f97f91b2b98c380f56b0efb501cfa
64964f4d3c0445b144adde7a79fe115e
カラムのSQL型を取得します。
namespace Com.Mparang.AZLib public class AZSql public SQL_TYPE GetSqlType() { return this.db_info.SqlType; }
0
b0dcab0140547ec42a36a1154abcaa56
6f36f22639a395eebfec025278a69d2b
Returns the largest palindrome made from a given digit number
{ integer min; integer max; integer i, j; integer largest; integer prod; min = (integer) powl(10.0L, digits - 1); max = (integer) powl(10.0L, digits) - 1; largest = 0; for (i = max; i >= min; --i) for (j = max; j >= min; --j) { prod = i * j; if (prod > larges...
1
cd56a24800aa7aaf0d5c72d704131cab
508b90248de32137b670324ac42a8c8d
konstruktor bezparametrowy robiący pustą macierz
class Matrix Matrix() : a(nullptr), column(0), row(0) {}
1
93563c96c3b3fd0e604b88ccde0173a6
871c4f1fb3a43dd4b494c58f6ace5a95
Returns the path to the local saves directory * On Windows, at %APPDATA%/.minecraft/saves/ * On Darwin, at $HOME/Library/Application Support/minecraft/saves/ * at $HOME/.minecraft/saves/
def getPathToSaves(): return '/opt/cernent/ScanEvents/'
0
aceb446cf962d4982a1dd149ada3bb87
3e11be46d5d375629b6f919ae3766886
факториальная сумма цифр
def sum_of_fact_digits(n): return sum([factorial(int(i)) for i in str(n)])
1
56ac7c44e20cdfd256c1a3e9a04c1431
4ebd2ffa0b889c0ac624948e8967b841
Validator fot the `Gallery.name` field. It can't contain '/' character.
value = force_text(value) if not value or '.' not in value or re.search(r"\s", value) or '/' in value: raise ValidationError(self.message, code=self.code)
1
30f56a3c7d32a4fb9e8ab96c2d896d53
f1c86773906b0a7599b805aa0057f241
Deleting a node from an empty graph should raise an error.
def test_neightbors_raise_error_for_no_node(graph_fixture): with pytest.raises(KeyError): graph_fixture.neighbors(3)
0