query_id
string
corpus_id
string
query
string
code
string
label
int64
4f656295517fe7eca1787d4baccfa531
cad912ac556a2bafb6458623ede883ff
Book Name Search
public class BookQuery extends JInternalFrame private void queryBookNamePerformed(ActionEvent evt) { String bookName = this.bookNameTxt.getText(); Book book = new Book(bookName, "name"); try { this.fillTable(book); } catch (Exception e1) { e1.printStackTrace(); } }
1
f1f7f8595dedf60d46b712272b440c34
d1c98e0484e3d19b153bf79b5e6bd2d9
新闻图片绑定数据
{ IList<EyouSoft.Model.NewsStructure.WebSiteNews> newList =EyouSoft.BLL.NewsStructure.NewsBll.CreateInstance().GetHeadNews(10); if (newList != null) { if (newList.Count >= 1) { EyouSoft.Model.NewsStructure.WebSiteNews new...
1
fd71ed2f5d9dd89b3df2b6cd7228770a
de106e5171c830092d69875970d47dde
Downsample depth pixels with nearest neighbor
def downsampleDepth(img): img_ = np.stack([img[0::2,0::2], img[0::2,1::2], img[1::2,0::2], img[1::2,1::2]], axis=2) num_nonzero = np.count_nonzero(img_, axis=2) num_nonzero[np.where(num_nonzero == 0)] = 1 img_new = np.sum(img_, axis=2) / num_nonzero return img_new.astype(np.uint8)
0
e7e1e58aac41794f8944dbe1c3fa8be1
5c846553a5699b4e36851de16f7ed624
Returns True if photo is a burst photo and has been selected from the burst set by the user, otherwise False
class DG4062: # ################# # # ## F/AWG enums ## # # ################# # def is_chn_burst(self, chn: Channels) -> bool: return self.__device.query(f":{chn.value}:BURS:STATE?") == "ON"
0
545d98ec99c4743c6466a8873a3dd759
0bd6a122381f2b1445768e824832ab05
指定したパスのインスタンス番号を返す
{ int id = 0; if (File.Exists(INDEX_STORE_PATH + "\\" + recordPath)) { try { id = int.Parse(File.ReadAllText(INDEX_STORE_PATH + "\\" + recordPath)); } catch { }...
1
86a176b0eb8c5fa271c9dd34a675f2d0
5508a09a0e55e26b69c93ab2d8626df5
Returns the language code associated with a particular taxonomy.
{ $tree = taxonomy_get_vocabularies(); $arr = reset($tree); return ($arr->vid); }
0
7debb53eabd3bb01661adde71f09fd32
aedd2e0273db59232bbf4233b6a4da0a
Ritorna il tempo di time slice per le politiche di schedulazione di processi con prerilascio. Il tempo è espresso in millisecondi.
int64_t proc_waiter_get_sleep_time(){return(PROC_WAITER_SLEEP_TIME);}
0
724aaf48381741199c51f4512422f8f9
2e7367c10e8ea60cd74e3e761ac0f6da
Computed property's key is a right hand node.
namespace org.mozilla.javascript.ast public Name getProperty() { return (Name)getRight(); }
1
226afd0fdeb31d5e1a8fefb7dc068445
bf9a4cd3eddf39cb73a9f201706d9c3e
当前状态可以扣积分,扣除后,将状态设置为可以抽奖的状态
public class NotRaffleState implements State @Override public boolean raffle() { System.out.println("积分扣除成功才可以抽奖哦!"); return false; }
0
01a223d48048c05181728e61b4c990ef
dac85e3042394a180f6f2ab3147c4c01
creates a test sample, and then computes the corresponding bayes factors for the permuted and unpermuted data sets
class PerseusTests(PerseusBase): def fdr_permutation(self):
0
b834700305e128d32458b18cd727b54b
7a60e2fe7c5e1a0a9b82176892bd3778
普通提额
class FckModel extends CommonModel public function rifenhong() { $fee = M('fee'); $fee_rs = $fee->field('s12')->find(1); $s12 = $fee_rs['s12'] / 100; $where['rifenhong'] = 1; $where['is_pay'] = 1; $field = 'zjj,cpzj,id,user_id,re_path'; $fck_rs = $this->where($w...
0
f5d80b7fd806660cd6ec072d6b5e0051
44a26af1689380d02878161ae4e88be5
grabs the mouse to the window
{ if(document.all) { mouseX = window.event.x + document.body.scrollLeft; mouseY = window.event.y + document.body.scrollTop; } else { mouseX = e.pageX; mouseY = e.pageY; } }
0
2d8742a44e142aaeed9f881b452d8918
b94ab043426d84e8792e8a95d2b9b609
在相册中上传照片页面
public String uploadPhotos( Model model,HttpServletRequest req,HttpSession session) { String userid=(String) session.getAttribute("userid"); if(userid==null) { return "redirect:login"; } String album=req.getParameter("album"); model.addAttribute("album", album); return "uploadphotos"; }
1
6e9e2175b48ac54c1048fa9b865f22ca
02a8fa2154dd53c6db59dc98279147ca
Checks equality of the collimators returns: boolean True if they are equal, False otherwise
return \ ( math.isclose(c1.r, c2.r, rel_tol = rel_tol, abs_tol = abs_tol) and math.isclose(c1.g, c2.g, rel_tol = rel_tol, abs_tol = abs_tol) and math.isclose(c1.b, c2.b, rel_tol = rel_tol, abs_tol = a...
1
77de044f1ad56a537188d6da1590457c
2ed21797cb0023a1955c85aa5406a835
Returns a dict containing the option attribute names as keys and their values as values
class ConfigurationController( BaseAPIController ): # config attributes viewable by non-admin users def _get_options( self, config, keys ): return dict( [ (key, getattr( config, key, None ) ) for key in keys ] )
1
ed7fe8f5c53d63ff9335eccfffef1139
9d2c3bda3414597037f1f9e2fe292671
Разбор ответа с дельтой импульсов
{ int deltas = m_DeltaList.GetSize() ; if (deltas == 0) { return true ; } ElementXML* pMsg = GetConnection()->CreateSMLCommand(sml_Names::kCommand_Input) ; ElementXML_Handle hCommand = GetConnection()->AddParameterToSMLCommand(pMsg, sml_Names::kParamAgent, GetAgentName()) ; ElementXM...
0
5ef2857b285c2040b201af25ae08c777
934af0dafdeffbd0f81b0ded9c4ee26d
Save device token in the database
function saveMessagingDeviceToken() { firebase.messaging().getToken().then(function(currentToken) { if (currentToken) { firebase.database().ref('/fcmTokens').child(currentToken) .set(firebase.auth().currentUser.uid); } else { requestNotificationsPermissions(); } }).catch(function(e...
1
a71089e0d9a9f21f72db505c339175b6
914a677173d05eba9299d8f55f5baafb
Bob Jenkins' "one_at_a_time" hash function http://burtleburtle.net/bob/hash/doobs.html
int hash_i(int i, long long x ) { return ((x % H1PRIME) + i*(x % H2PRIME) + 1 + i*i); }
0
bb2dbc840f378f6430288025d620ebdc
1f5cefbca14db39f57758ff54bf7a391
转换SNES格式的8x8像素Tile为BMP格式
{ Bitmap bmp = new Bitmap(width, height, PixelFormat.Format8bppIndexed); BitmapData bmpData = bmp.LockBits(new Rectangle(0, 0, width, height), ImageLockMode.WriteOnly, PixelFormat.Format8bppIndexed); int stride = bmpData.Stride; int offset = strid...
1
18cd87a5bec0753ccf1de0e32639f442
996b21df750b202016f8804e0dc6895a
Sets the team 1 expected score.
class Game public function setTeam1Goals($team1Goals) { $this->team_1_goals = $team1Goals; return $this; }
1
8dff6a53cccd72dbefff6424f8ee072d
8fd313a9ecc75f63e55c0d81bec236c7
Remove the specified gallery_Project from storage.
class GalleryController extends Controller public function destroy(Request $request) { $Product = Product::where('id_gallery','=', $request->id_gallery) ->where('status_product','=', '1')->get(); if (count($Product) == 0) { $Gallery = Gallery::where('id_gallery','=',$r...
0
ac8bb1ea7791bd332d3b8da970404476
7ff232c7a9841dfe66e26e184a3899e1
# ~4-7 lines # Perform classification using artificial neural networks using the nnet library
NNClassifier <- function(x){ index <- findNN(x) return(trainLabels[index]) }
0
7ecc9193c8bbfb5f4d217a419513dd7d
c87b7bf9c68e12e58cb26ff0158e5ac9
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.
class HGImageManager implements FileRepositoryFileManagerInterface protected function getMethod($type, $size) { $size = $this->getSize($type, $size); return !isset($size['method']) ? $this->defaultMethod : $size['method']; }
0
9006a6c3d0855cba8c57ee7f29b57c4e
7d70a3b3e7daa8979de5d054b6733fcb
Testing visibility of review requests assigned to invite-only groups by a non-member
class PolicyTests(TestCase): def test_review_request_public(self): review_request = self._get_review_request() self.assertTrue(review_request.is_accessible_by(self.user)) self.assertTrue(review_request.is_accessible_by(self.anonymous))
0
6ccbfbdc6327719f8f912ab63f89b979
2e92a1f259c88e28b44c753c69526599
Get the position of the next lexeme in the stream.
public class LexString<T extends LexDefinition> public int pos() { return this.pos; }
1
c64b155ea33cff4793cbb71235621179
1e7f98015fbe8a46fe397916a105c052
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
{ QString sCommande (""); QList<QString> lstAdresse; QList<QString> lstNomCapteur; QSettings stgAdresses("Adresses.ini", QSettings::IniFormat); for(unsigned int i=0; i <=143; i++) { sCommande = "iR00" + QString::number(i) + "02"; if(i > 9) { sCommande.remove(2...
0
64910adca3a13d7a7be834a073311d86
31b69a5e54aaf401f370915d540a0b2f
PDお問合せの回答目処日アラート通知
ActionMapping map, HttpServletRequest req, Tcd070Form form) { Cmn999Form cmn999Form = new Cmn999Form(); ActionForward urlForward = null; cmn999Form.setType(Cmn999Form.TYPE_OK); MessageResources msgRes = getResources(req); cmn999Form.setIcon(Cmn999Form.ICON...
0
119c9e8518171c223a154c06a9f2fd72
58e091481cebb8e12155ad37fca0978b
指定IDのCSV出力設定が存在するかチェック
@Controller @RequestMapping("P10030") public class CsvOutColSettingController @RequestMapping(value = "/checkDataInput", method = RequestMethod.POST) @ResponseBody public ResultData checkDataInput(@RequestBody MCsvoutWhereSimpleDto form) { try { return csvOutWhereSimpleService.check(form); ...
1
92c650547fa0d657cd3e6b3f4aecc950
02e954697406c26062e16bb07e94162e
Test Qi Stage Lib But No Such Target
def test_no_os_versions(dummy_command): dummy_command.get_simulators.return_value = {} with pytest.raises(BriefcaseCommandError): dummy_command.select_target_device()
1
abb7bef8334c1815e3414e890ea07780
124b7c7721753cdd1ce420eda919c10d
Test the less than comparison when the value is equal.
def test_comparison_ops_le_t(): return """ fn main() { {dest} = 1 < 2; } """
0
8d61167386aab81825a351fa2f2794f9
e3011da431eb177bf79796126903caa2
%% Percent of Data that is Unique
new_data_frame = data_frame[data_frame[col] == True] col_n = len(new_data_frame.index) col_p = (col_n / total_n) return col_p
0
49b6b8c702d72c3c27460f367204db47
b75e8c1d30cf244789260b55277a355b
Get the font-awesome icon class (e.g. fa-pie-chart) http://fortawesome.github.io/Font-Awesome/icons
function fontAwesomeClass(value) { return 'fa fa-' + value; }
1
8880ccdf4fbe5788909d1728a70f2d71
2d008e42edba1fee44124ced3dcf4199
检查指定名称进程存活数量
def process_exit(process_name): process_check_response = os.popen('ps aux | grep "' + process_name + '" | grep -v grep').readlines() return len(process_check_response)
1
63f71a387f0408fd880bb27c4fe54cc5
be73559b3e650a068d7c67d9c658afbd
Returns the default template ID that child pages should use.
public class StringTemplate extends FreeColObject public final String getDefaultId() { return defaultId; }
1
85994fe2df30f374d086f4638ff8fce0
5907586132cb27f81971b11d430877de
获取某天的数据。 在Redis和数据库中缓存。 <p>
LinkedHashMap<LocalDate, StockData> getDataMap(String code);
0
b7f2dc280d9af9bd4a55bc546e68887a
c27a7a2367ca924832db2625c20c277a
建立功能選單維護作業的樹(可按滑鼠右鍵那一支)<br>要記得先setSysid的值
this.systemName = systemName; FleaMenu systemFleaMenu = new FleaMenu(); systemFleaMenu.setMenuId(CommonConstants.NumeralConstants.MINUS_ONE); systemFleaMenu.setMenuName(systemName); systemFleaMenu.setParentId(CommonConstants.NumeralConstants.MINUS_TWO); systemFleaMenu.set...
0
7e081f5fd62efe8e923c935423ac83a2
69929b40b73c87855da922956f6e94b3
创建右侧fragment
public class SafetyListActivity extends SlidingFragmentActivity implements LeftFragment.onItemListener,com.haocean.dinninghall.safety.TitleFragment.onCreateButton, ListViewAdapter.onEditButton private void initRightMenu(SlidingMenu sideingMenu){ _RightFragment= RecordList.RightFragment.get(typeRecord); ...
1
91ef653715af85c18666e42cf59ff0d0
bf7c4f303f79591ce5b4fff37c1e18cd
Actual decoding of DDD file is done here
unsigned char **data, unsigned int *bytes, unsigned int block) { unsigned int skip, strip; unsigned char *ptr1, *ptr2; unsigned int cnt, cnt1, cnt2; int bits, act; DDS_initbuffer(); DDS_clearbits(); DDS_loadbits(chunk, size); skip = DDS_readbits(2) + 1; strip = DDS_readbits(16) + 1; ptr1 = ptr2 = NULL; cnt...
1
b7baca6323aaa7bab84f0af9b45f38c6
c9ad0bf1b2115de5838ff688fe73b322
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.
class AdminsController def update admin = Admin.find(params[:id]).try(:authenticate, params[:old_password]) if admin unless params[:admin][:password].empty? if admin.update_attributes(params[:admin]) flash[:adminnotice] = "Tiedot päivitetty" else flash[:admin] = admin ...
0
dd38838dda2edfff3690ed9d14c64376
c1b3580218db57cc3d5dc5072cb0296c
Similar to ifa_foraddr, except with the added interface scope constraint (unless the caller passes in IFSCOPE_NONE in which case there is no scope restriction).
ifa_ifwithaddr_scoped_locked(const struct sockaddr *addr, unsigned int ifscope) { struct ifaddr *result = NULL; struct ifnet *ifp; if (ifscope == IFSCOPE_NONE) return (ifa_ifwithaddr_locked(addr)); if (ifscope > (unsigned int)if_index) { return (NULL); } ifp = ifindex2ifnet[ifscope]; if (ifp != NULL) { str...
1
7b3c29a6cd337b0a0f805b7fe3e0bfea
3ffdb4f6d7fd0b4422ae93c63182c4cb
判断输入格式正误并将输入写入数组
{ char tem = getchar(); bool inexp = false; if (v.empty()) { if (!isVaild_NoEnter(tem)) { iv = false; return; } } if (!(tem >= 48 && tem <= 57) && tem != '-' && tem != '+' && tem != ' ') { cout << "**Error: The first character should be...
1
89f63dc3e9f8383678c741a88d86a2ac
bfa5482a450e9e5b863b51f72545c1ac
Получить все невыполненные дела.
namespace WorkApp.Service.Interfaces Task<Result<List<ToDoDto>>> GetIncompleteToDoesOfUserAsync(string userId);
1
e7bf99a6a88823d42c56dd5c3a6a0809
190ee9e1be76e041b32c6fd54cb196f5
dynamically allocates memory for struct pos
{ free_pos.resize(100); for (int i=0; i < free_pos.size(); i++) free_pos[i] = i; }
0
afc95b02e2af31e9bedd62c601889791
f8dc70f9f84ad5b6788c0eff8f9727c4
Reference to the slide collection for this presentation.
class _SlideLayout(_BaseSlide): def slidemaster(self): assert self.__slidemaster is not None, ("_SlideLayout.slidemaster " "referenced before assigned") return self.__slidemaster
0
aa29342f3ebf18e4647dbc61be036d3b
84f826bcff6fea18a67e2856196460f0
チェックボックスの状態によって表示を切り替える
namespace PeerstPlayer.Forms.ThreadSelect public partial class ThreadSelectView : Form private void checkBox_CheckedChanged(object sender, EventArgs e) { Logger.Instance.InfoFormat("チェックボックス押下 [ストップスレッドの表示:{0}]", checkBox.Checked); DrawThreadList(); }
1
99b5ea6acc0caa9c152f87736438328a
bfc6a7d4fdac75171664ae9a4465352c
Tests if two matrices (4x4 xyzw) are equal within an optional tolerance
inline bool FMatrix::Equals(const FMatrix& Other, FLOAT Tolerance) const { for(INT X = 0;X < 4;X++) { for(INT Y = 0;Y < 4;Y++) { if( std::abs(M[X][Y] - Other.M[X][Y]) > Tolerance ) { return false; } } } return true; }
1
1ab70f2612360676f986d97c32e58cad
e67b19e2cd346d7b05ba7b62d920bfa8
This method copies the question.
osid.shared.Id questionId, osid.shared.Id destId ) { try { } catch(Exception e) { log.error(e.getMessage(), e); throw new RuntimeException(e); } }
0
d317d8a8a33655308a7212ae560dd8e4
bd147abcd6d7af34f8940853b3d40688
No type argument in {@link ClassInstanceCreation} itself, but in Java7 we can use "diamond".
public class GenericsMethodUnderstanding public <T extends Number & Runnable> void m7(T tTypeObject) { }
0
c8ce85dbe943cd591554c12b0d7c5a5e
be43b942eaae226f8d1454543869d236
弹出栈顶字符
char cpop(cstack *s) { char t; cstack temp; temp = (*s); t = (*s)->a; *s = (*s)->p; free(temp); return t; }
1
01da3b87ca192dcc2f194ae37a0190b6
5150a1b1f339ea847a6d4f5a2a6b2313
schedule in level order traversal of the group DAG
var visited = {}; var simpleNodes = _.filter(g.nodes(), function(v) { return !g.children(v).length; }); var maxRank = _.max(_.map(simpleNodes, function(v) { return g.node(v).rank; })); var layers = _.map(_.range(maxRank + 1), function() { return []; }); function dfs(v) { if (_.has(visited, v)) retur...
1
055da942f8bb9a91a96cfcba7c5577d0
5acc030d4d59f0de5bff92b7e6240eeb
Mark the element as expanded.
if (!pageItem.classList.contains(opts.class.expanded)) { this.setDescendantExpandedAppearance(pageItem); pageItem.classList.add(opts.class.expanded); this.cancelPendingCollapse(pageItem); this.state.expandedItem = pageItem; } }
1
bc5aceb68e1f197effef4b45982d8c87
cda9ea681191a9705a4ba9dbf6e52dd8
将多个CompletableFuture组合成一个CompletableFuture,这个组合后的CompletableFuture的 计算结果是个List,它包含前面所有的CompletableFuture的计算结果
CompletableFuture<T> resultFuture = new CompletableFuture<>(); CompletableFuture.allOf(futures.stream() .map(future -> future.thenAccept(r -> resultFuture.complete(r))) .toArray(CompletableFuture[]::new)) .whenComplete((r, e) -> { if (!resultFuture.isD...
0
e0d23447bf7a3d7d7148662eab5fba34
ad01ed38002d603b4b7fb1dedb24b1de
ClearCaches(self: GH_GeometricGooWrapper)
class AnalyseBase(object): def ClearCache(self): self._DefaultClearCache()
0
24c115fad662bf64f4b8a0311c6c5ec6
1f7ca4dfa3228231c53e925c4f25a461
\brief Has this process completed the required time units?
bool vprocess::is_finished() const { return !is_processing(); }
0
7c1de67fa030f664b0c346b325d8167c
005867d176a1771249d31fbcfd1b3f40
This function creates and initiliazes all opengl objects needed to render the character.
void initialize_Player(){ player.shaderID = shader.texture; player.show = true; vector<shape_t> objectData; vector<material_t> materialData; string err; if(!LoadObj(objectData, materialData, err, (playerRootPath+player.objFilePath).c_str(), playerRootPath.c_str())){ cout<<"\nError"<<err; exit(1); } player.o...
1
5d8af5ea51f4862236ab349e9accd5ea
14c1cfb611b13ccdd25ef4d8874278a3
adds all the aliens to the array
void alienStateInitialise(){ for(int y=4 ; y<=25 ; y+=7){ for( int x=2; x<=58 ; x+=8){ enemy[enemyNumber] = true; alien(x, y, enemy[enemyNumber]); enemyNumber++; } } }
1
c532b5e3423da47a77b40f0e8b507c86
d7f10963d9b7b6a259f4488ef5074f3b
An expression being passed as a parameter (as part of a call).
Expression getArgument();
1
56f09c6f11103c98efc2df74e97d66a5
73f9cf9824f9678b65e3f4d2dff28181
функция открытия окна "соощение успешно отправлено"
function winwindowshow() { winwindow = document.createElement("div"); winwindow.id = "winwindowid"; helloWindow.appendChild(winwindow); winMessageArea = document.createElement("div"); winMessageArea.id = "winMessageAreaid"; winwindow.appendChild(winMessageArea); win_message = document.createElement("p1"); win_m...
1
a2f9e1412458eb676454c419003373ae
c07321c5569e6344f3992ffe07995cc3
爬取 行业 -> 省份直辖市 链接
class Yyk99Spider(scrapy.Spider): def parse2(self,response): res = Selector(response) yys = res.xpath("//div[@class='g-warp']//a/@href").extract() urls = [] for yy in yys: colection = [] for item in self.get_province_url(yy,colection): urls.append(...
1
24e43f6eaa22fcd8564c519ea14e4445
f57e98a46e754e572105f8944cc29030
Test der Konto-Klassen
bool test01() { Datum d1(1, 1, 2008); Konto k("Huber", "4711", "0815", 123, d1); if (k.kontostand() != 123) return !OK; Datum d2(30, 1, 2008); k.hebeAb(123, d2); if (k.kontostand() != 0) return !OK; Datum d3(1, 3, 2008); k.hebeAb(123, d3); if (k.kontostand() != -123) ...
1
43b753a0715814c0879f59bd476f35fb
80c8db2a584d4395b1efe57da435fef8
Retrieves a collection of custom attributes of a specified type that are applied to a specified parameter.
public static IEnumerable<Attribute> GetCustomAttributes(this ParameterInfo element, Type attributeType) { return (IEnumerable<Attribute>) Attribute.GetCustomAttributes(element, attributeType); }
1
2b16210f7002590ba5f51b740cb5909e
a35124c063923ef59642d3f61223f744
Test 'ping <ip>' with unknown/unparsable errors on osx 10.14.6
class MyTests(unittest.TestCase): def test_ping6_hostname_osx_10_14_6(self): self.assertEqual(list(jc.parsers.ping_s.parse(self.osx_10_14_6_ping6_hostname.splitlines(), quiet=True)), self.osx_10_14_6_ping6_hostname_streaming_json)
0
73e8f3778e317072a67f54eec8a666f0
9d664b9a4def2a75ab7d6ae8c68ef4b1
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
basename = os.path.basename(path_dir) if include_single_image & \ (('.nii.gz' in basename) | ('.nii' in basename) | ('.mgz' in basename) | ('.npz' in basename)): assert os.path.isfile(path_dir), 'file %s does not exist' % path_dir list_images = [path_dir] else: if os.path...
0
a576c76875d649948c6773b8c109214f
59bb3899bb00ed9378e6e95ba68c88cf
跳转某篇文章
Intent intent = new Intent(); intent.putExtra(DataKey.ARTICLE_ID, articleId); intent.setClass(context, CommonArticleActivity.class); context.startActivity(intent); }
1
0b1c0e5de45cb25679bfdeab5dee0820
47c3955b84f472656d36bf34699d56c3
创建某个学生和某次排课的考勤记录以及后续的课耗处理
[Authorize] public Resp CreateAttendanceForStudentExperienceCourse(string registerIds, long scheduleId) { try { ExperienceCourseAttendanceBusiness.CreateAttendanceForStudentExperienceCourse(registerIds, scheduleId); return Resp.Success(); ...
1
b0dcab0140547ec42a36a1154abcaa56
c1f375faa1fbf27452bbbf2c172b1466
Returns the largest palindrome made from a given digit number
def largest_palindrome_product(n_digits): ceiling = (10 ** n_digits) - 1 floor = (10 ** (n_digits - 1)) - 1 print ceiling, floor max_palindrome_product = 0 for index_i in range(ceiling, floor, -1): for index_j in range(ceiling, floor, -1): if palindrome(str(index_i * index_j)): ...
1
cd56a24800aa7aaf0d5c72d704131cab
711795f0bb01435f2df29a9e4c50cbd9
konstruktor bezparametrowy robiący pustą macierz
Wektor<T,ROZMIAR>::Wektor() { for(int x=0;x<ROZMIAR;x++) tab[x]=0; }
0
45cbe219375f3eece268e8255c492dcf
07d9f76fca43a48ae37b934cb3bb49ac
r"""Method used in the HTTP request that this callout sends. Mutually exclusive with the full HTTP request expression.<br/>Possible values = GET, POST
public final class TempUrlArgs extends com.pulumi.resources.ResourceArgs public static final class Builder public Builder method(@Nullable Output<String> method) { $.method = method; return this; }
1
aceb446cf962d4982a1dd149ada3bb87
9aac6eb40d1f193d5f4a2f20f5e33730
факториальная сумма цифр
def f(n): return sum(math.factorial(int(ch)) for ch in str(n))
1
56ac7c44e20cdfd256c1a3e9a04c1431
ae19c5ee2a94baddb0d598e34e398404
Validator fot the `Gallery.name` field. It can't contain '/' character.
class GoodsGallery extends ActiveRecord public function rules() { return [ ['path','safe'], ]; }
0
30f56a3c7d32a4fb9e8ab96c2d896d53
b3381df8e63d952f8eb70445492f4f58
Deleting a node from an empty graph should raise an error.
identity, msg = self.neo4j.update_node('id', 0, extra_attrs={}) self.assertIsNotNone(identity) self.assertFalse('success' in msg)
0
b5031abde7a96f3a6fb58110f685dce2
a3004fe94833d7623f55b60d60527b75
Retrievies a Query object by its given name. Reads the sql string from file and parses it to create a Query object.
{ if ( String.IsNullOrEmpty(name) ) { throw new ArgumentNullException("name"); } using ( new LockHolder<object>(_lockHandle, TIMEOUT) ) { if ( !_queries.ContainsKey(name) ) { throw new...
0
70559ae8c28fe8839f64367f5faf9aef
4849851b370ec78c192953a797ba5c4a
Get mass point for T2tt components from filename
def SSPMass(afile): names = ['IMF', 'slope', 'MH', 'age', 'mTot', 'mSRem', 'mS', 'mRem', 'mGas', 'mlSRemV', 'mlSV', 'mV', 'unk'] bData = Table.read(afile, names=names, format='ascii') return bData
0
3d27fa97654b814afe5cd9ce4d9d34d2
3d1b9f90c3864cd52d4b445cc1c61123
Photo Source URLを生成するメソッド
if(MyUtils.isNotNull(this.url)) { return url; }else { return "/resource/photo/course01.jpg"; } }
1
82edb667e6c4672b4425ea1ddff03f25
206c8690bd02ca37a95f7e17473c9e12
Sets the month-panel's dimensions.
{ YearMonth yearMonth = myDisplayedYearMonth.get(); String str = formatMonth(yearMonth); myMonthLabel.setText(str); str = formatYear(yearMonth); myYearLabel.setText(str); double width = myYearLabel.getFont().getSize() * str.length(); if (width > myYearLabel.ge...
0
7e18d2824e59ede66b3e67b540132455
417ee761408ad8ede1cea5fa394dec9e
Nearest neighbour scalar quantizer
to_values = np.linspace(min_amplitude, max_amplitude, quantization_levels) outputSig = [0] * inputSig.size for i in range(inputSig.size): best_match = None best_match_diff = None for other_val in to_values: diff = abs(other_val - inputSig[i]) if best_match is ...
1
bce47a22dd24b1bb6ba4db93d7d848fe
1a4b83b4abbdbff479584b0a5160b3fa
Called after a SynchronizationMessage is dispatched.
namespace ClientLogger public class ConsoleInputHandler protected void OnSynchronize(SynchronizeEventArgs synchronizeEventArgs) { }
1
701b2925866d5efc5aad7571a4590180
c3aacb2912666e4d639bb3082a6ef04b
In-order traversal of the tree. Can visualize the tree.
if self.root is None: print("EMPTY TREE.") else: print("-----------------Visualize Tree----------------------") layer = deque([self.root]) layer_count = self.getDepth() while len( list(filter(lambda x:x is not None, layer) )): n...
0
0451aadf3633ca6d53b8c34d7e6c1226
c9319a9662a8ad04aa36da0b7bcb3b65
Actually perform the join
for (lPageId, lhsPage) in iter(self.lhsPlan): for lTuple in lhsPage: joinExprEnv = self.loadSchema(self.lhsSchema, lTuple) for (rPageId, rhsPage) in iter(self.rhsPlan): for rTuple in rhsPage: joinExprEnv.update(self.loadSche...
1
b5d813cac2bfe943c258f8062b8333f7
45dd07c233b9d086fd2a6dd11a2d7e0e
循环某个范围的数,算出每个数的平方,根据第二个参数中数字,看该数字在得出结果出现几次
public class Mathf003 : MonoBehaviour private void _23() { static void Main(string[] args) { float n = 0; float sum = 0; while (n<=10) { n++; sum+=Mathf.Pow(n, 2); } Console.WriteLine("sum=>{0}",s...
0
ee3595d4a7dd4827b64ce3a9101c8933
379b36e4233603c11e4e4a965f6d0064
Metod som överskuggar/döljer superklassens metod Anropar klassens metod - RitaLinjer - vid varje omritning
class MainViewModel: ViewModel() private fun linjeFarge(googleMap: GoogleMap) { val vindStyrke = (forrigeVind + currVind + mellomVind + mellomVind2 + mellomVind3) / 5 val temp = (forrigeTemp + currTemp + mellomTemp + mellomTemp2 + mellomTemp3) / 5 if (vindStyrke >= 6.0 || temp <= 12....
0
3422d3442edde4e0d8ad9daa6fa9976a
2cd29018a44adf2e4174a0c4f682b032
生成number位大写验证码
Random rd = new Random(); String codeToken = ""; int getNum; do { getNum = Math.abs(rd.nextInt()) % 10 + 48; char charNum = (char) getNum; String dn = Character.toString(charNum); codeToken += dn; } while (codeToken.length() < numbe...
0
f98fd6d8d896c6ddf7bdea392bc35351
93121babd41f543a5b2fb841d13d7127
顯示已加入收藏訊息
function showFavoriteSetInfo(record, linkId, name){ if(!record){ return ; } var html = ''; var field; html += '<div class="item clearfix">' + '<div class="pull-left">'; if(record.name){ html += '<h4>' + tek.dataUtility.stringToHTML(record.name) + '</h4>'; } html += '</div>'; html += '<div class="pull-rig...
1
38e52449a6c36f3b3456ee7e4c8d14fd
9667deceacb8129c2fa13c95effb80e2
Sets the UIPanel component's rect.
setRect(rc: Rect): this { if (this._orc == null) { this._orc = rc; } else { this._orc.x = rc.x; this._orc.y = rc.y; this._orc.width = rc.width; this._orc.height = rc.height; } this._rc = this....
1
2a8c0613bf19dd10e5f16dcc463553db
676100f251e71904a7d378f073323bd2
返回下拉刷新包裹对象
if (mPullToRefreshListView == null) { if (baseActivity != null) { mPullToRefreshListView = (PullToRefreshListView) baseActivity.findViewById(R.id.pull_to_refresh_list); mPullToRefreshListView.setOnRefreshListener(baseActivity); } else if (baseFragment != n...
1
7833b2f5d3cffb8fc202f06508d50a08
1c6d5d7268b796bdefe981084c193e8a
遷移アニメーションが終わったかどうか確認
public class SceneMappingManager : MonoBehaviour public bool isFadeAnimationDone() { if (fadeImage.color.a >= 0.8f) { return true; } else return false; }
1
df477b6db6e11a663f84c3e6ddecb6b0
f302dd42675f7394e1bd1540dba50980
Sets a flag that indicates whether or not the data represents a time series.
@PublicSPI @BeanDefinition public class TimeSeriesDocument<T> extends DirectBean implements UniqueIdentifiable, MutableUniqueIdentifiable public void setTimeSeries(DoubleTimeSeries<T> timeSeries) { this._timeSeries = timeSeries; }
0
e237d3d44aa4f926cff1bb16a4b4681e
7c70a7f39828992571e767449627bbf5
根據spec處理skip macroblock P - 搬運 forward frame資料, motion為0,0 B - 根據上一個macro type和motion vector決定如何搬運
{ static const int p_v2b8[5] = { 4, 5, 6, 7, IBLOCK }; static const int p_v2pd[5] = { 0, 0, 0, 0, -1 }; static const int b_v2b8[14] = { 0, 4, 4, 4, 5, 6, 5, 6, 5, 6, 7, 7, 7, IBLOCK }; static const int b_v2pd[14] = { 2, 0, 1, 2, 0, 0, 1, 1, 2, 2, 0, 1, 2, -1 }; if (img->type == B_SLICE) { currMB->b8mode[i] = ...
1
9f5e610a950588747ce4e295b5dedc1d
c5e1367c1dc17725b9cdea6698b637ff
Automatically register the help command
help_register(void) { static action_table_t help_actions[] = { { AnHelp, Help_action, ACTION_KE } }; register_actions(help_actions, array_count(help_actions)); }
1
974350558fba73003002a2ad1017d65e
6d3ed6e426ad1cee8aa7fca81f17effc
Sets the state to be used for style matching.
void GestureInput::clearState() { _match = false; }
0
d29ede9f988d80addf42ecee91b06474
eabb4129eef0310e47d5ac595d3743d3
Position cursor at the last record.
{ if (Recordset != null) { if (Recordset.RecordCount > 0) Recordset.MoveLast(); ValidateButtonStatus(); } }
1
92843b8d4e079629bade27954c1ebcc8
40995369a5db5054c2ae66b229842775
Generate a list of armor that are attached to the player model. These will likely all be inactive.
public class InvMaster extends JavaPlugin public static Inventory getPlayerArmor(OfflinePlayer p) { if (p == null) return null; if (!(playerfiles.containsKey(p) && armor.containsKey(playerfiles.get(p)))) return null; if (p.isOnline()) { playerfiles.get(p).setChanged(); armor.get(getPlayerFile(p)).s...
0
f7234ba29389dca60a317d81cde5fe2a
5a39ec6837725cd89f9ade35cd089836
@brief Set I2S controller Link On
{ HAL_PINCTRL_SetIOMUX(GPIO_BANK0, GPIO_PIN_A6 | GPIO_PIN_A7 | GPIO_PIN_B0, PIN_CONFIG_MUX_FUNC4); HAL_PINCTRL_SetIOMUX(GPIO_BANK0, GPIO_PIN_D7, PIN_CON...
1
9be86f3ed99a97e936e66becbff7bb5f
54038e6968ff0de838e98c731ea2389e
Process the feed, subscribe the user to the list.
{ $this->Viewer_SetResponseAjax('json'); if (!$this->oUserCurrent) { parent::EventNotFound(); } if (!getRequest('login') or !is_string(getRequest('login'))) { $this->Message_AddError($this->Lang_Get('system_error'), $this->Lang_Get('error')); retur...
1
dd2dc370a54610463955ef8399f1bb1e
f0ba023e426fd1e32c2d180d0b608195
Inserts the specified element into this queue if it is possible to do so immediately without violating capacity restrictions.
public class LinkedBlockingQueue<E> extends AbstractQueue<E> implements BlockingQueue<E>, java.io.Serializable public void put(E e) throws InterruptedException { if (e == null) throw new NullPointerException(); int c = -1; Node<E> node = new Node<E>(e); final ReentrantLock putLoc...
1
3be06c6363ad98a0eacf4ed4b9dc35be
585e43110c374dcfac221bf3129e99c5
Creates an AND combinator for two {@link Filter}s on the same type.
@Nonnull default AccumuloElementFilter<T> and(@Nonnull AccumuloElementFilter<T> another) { return And.create(this, another); }
1
4c12e6bcd39e3f435dc63077e5382528
dc33a93da1bffdcad54b8baac98537ba
calcule el puntaje basado en la posición relativa del círculo y el rectángulo.
switch (lineas){ case 1: points = points + (40*level); break; case 2: points = points + (100*level); break; case 3: points = points + (300*level); break; case 4: ...
0
1e1cd9a909968d285b4da0fea75bcdcd
7837830f9b317891625f348d8e2c6066
Attempts to run all the functions, which take callbacks. Runs the callback function when they all resolve or upon the first error.
function resolveCallback(fn: VoidFunction<[TFunction, ...any[]]>, ...args: any[]): Promise<void> { return new Promise(resolve => fn(resolve, ...args)); }
0
96b89def6d3f29f2d00acd7c55502e9d
4bd2143d10aa40a54c752111e2b1f724
On détruit tous le contenu de la page, sauf le menu permettant de passer d'une section à une autre
function delete_contenu() { if (isset($_SESSION['ADMIN'])) { $mpages = new MPages($_GET['ID_CONTENU']); $mpages->SetValue($_POST); $mpages->Delete(); $value ['ID_ITEM'] = isset($_REQUEST['ID_ITEM']) ? $_REQUEST['ID_ITEM'] : $id_item ; $mpages = new MPages(); $mpag...
0
96bef4d4d195f936cf343a6a008ca139
4f1d6b434eec03bc4e381b2596854cac
Ustawienie tła pod odpowiedzi - jeżeli błędne - czerwone - poprawne - zielone
namespace MastermindClient public partial class ResultPeg : UserControl public void SetCorrectColour() { peg.Background = Brushes.Yellow; }
0