query_id
string
corpus_id
string
query
string
code
string
label
int64
f70bdc686ccb72c3831c83cad469408e
fbbebeec8bd6283ff0d838a198f64086
Problem : Print the elements of matrix in diagonal order Link:http://www.ideserve.co.in/learn/print-matrix-diagonally
std::cout << "Hello, World!\n"; vector<vector<int>> m = {{1,2,3},{4,5,6},{7,8,9}}; vector<int> res = findDiagonalOrder(m); for(auto v:res) cout<<v<<" "; return 0; }
1
cb7f060fa0696e881fd8718aee3b1f95
5e1e3c2aac516c744275da2692342ba4
認証キーのPDFファイルを表示する
var fileName = 'motiur.pdf'; if (isiOS11_2()) { fileName = fileInTemporaryDirectory(fileName); } var docViewer = Ti.UI.iOS.createDocumentViewer({ url : fileName }); docViewer.show(); }
0
d345f3fb28eccc02c08081145dd59d58
21a55e10a2191703ac248f916373cf4d
Returns all Items containing the given Field Value.
$resultSet = array(); $query = $this -> db -> query( "SELECT * FROM $this->table WHERE $field = '$value'; " ); while( $row = $query -> fetch_object() ) { $resultSet[] = $row; } return $resultSet; }
1
138252b8de75e3db2e31bc9a1fdfd33a
31fcfc1073fb9d826773f409be10d196
Compute the bit code for a point (x, y) using the clip rectangle bounded diagonally by (xmin, ymin), and (xmax, ymax)
gl_ix = self.find_glyph(code_point) if gl_ix is None: return None self.init_bitfield(gl_ix) w = self.get_bitfield(self.data[U8_BPCW]) h = self.get_bitfield(self.data[U8_BPCH]) x += self.get_bitfield(self.data[U8_BPCX]) - (1 << (self.data[U8_BPCX] - 1)) ...
0
88ada225a616e2cfd369008bab566fb9
85a2db4e4b45f9469ea0615b55c3ef9a
対象年度からフォーカスが離れるときの処理
namespace NhsCui.Toolkit.WinForms internal partial class NhsCalendar : Form private void PrevYearNav_Leave(object sender, EventArgs e) { RemoveFocus(sender); }
1
3a259a3839a685cf98f5fdd36fc60f14
bfbf8d73360c35c7813fb5b1c8dcba26
Obtiene las diferentes condiciones que se tienen con los proveedores.
return this.sapcrmCacheProvider.getStatus().then( (res: Status[]) => { this.states = []; for (let status of res) { if (status.PROCESS_TYPE == AppSettings.ORDER_TYPE_OPPORTUNITY || status.PROCESS_TYPE == AppSettings.ORDER_TYPE_SALES) { ...
0
0f94cf2f3668243e82283c5812cf60f0
f12b16f6be35c12890cd5c1a5e5023e7
商品圖垂直置中
function center_bg(obj){ obj.css('marginTop',($(window).height()-obj.height())/2); $(window).resize(function(){ obj.css('marginTop',($(window).height()-obj.height())/2) }); }
1
8f7a89de56d4520b0eec557dc51fe3aa
623a582d8e22c2c53c5adb28e637d3a0
Add another point to the end of this stroke.
{ Array.Resize(ref _Points, Points.Length + 1); _Points[Points.Length - 1] = newPoint; }
1
7fb9c7e17a72658742f1ff648f3f6489
4d6a15006f469f703856e5fc4748c5cc
Gets the style of this Footer. # noqa: E501
class SearchHitSearchableTraits(object): def style(self): return self._style
0
208fc7d60e7d0711fb76c1ce6ded2c7c
0d0e5e6f10b0fe4426967bf3feea16dc
Implementations of this method should initialize static implementations of skill types in the SkillType class.
public class BossSkillsManager : MonoBehaviour private void MeleeSkillsInitialization() { }
0
b507d1792a7ce3fbd147b7eb3ed02ed6
dcf9cc92f85de6426156165134ce2fc5
RESOLVE PROVIDED HOSTNAME USING THE SUPPLIED DNS SERVER AND CALL THE USER PROVIDED DNS DONE CB FUNCTION WHEN DONE
int fnCDDB_DoDNSlookup(char *szArg1, void *pvInetAddress) { struct hostent *pstHostEntry; struct in_addr *pstInetAddress; pstInetAddress = (struct in_addr *) pvInetAddress; if (!inet_aton(szArg1, pstInetAddress)) { if (! (pstHostEntry = gethostbyname(szArg1))) { fprintf(std...
0
15c4ad1858335c77a21855e2b66deb6b
5d6a973f20378a031717243bb30da240
build internal nodes bottom up after leaves were constructed.
if(children.size() == 1){ return children.get(0); } boolean odd = children.size() % 2 != 0; for(int i = 1; i < children.size(); i += 2){ Node left = children.get(i-1); Node right = children.get(i); Node parent = new Node(Utility.SHA512(left...
1
571e350d76265716012fec3ad0fbaeeb
73d90683f2def12cadada58f0a8a6877
跳转我的理赔流程指南页面
public String GuidesReimbursement(Integer reportDetailId,HttpServletRequest request) { request.setAttribute("reportDetailId",reportDetailId); return "voucher/GuidesReimbursement"; }
1
8a69272b1dc33f99fe2e36dd76cf89ee
5daf5bcd5bb2c350714cf667ba9c93d0
Returns the HTMLElement that controls the state of the menu.
public JMenuElementStateX getState();
0
d891d54f96f7c348866b778d9df7b86c
0516dc3959764a6cd4a5730809216159
# Entrega nombre de la región según código # Entrada: código numérico de la región # Salida: nombre de la región
function nombreregion($idregion){ require_once "libcon.php"; $con = Conectarfb(); $sql = " select descripcion from regionoperaciones where codigo = ".$idregion; $result = ibase_query($con, $sql); if (!$result){ die('Error ' . ibase_errmsg()); exit; } ...
1
1fe37caea4a85dc302478a56051798ad
b9b0d428e48e9a6c269bce5650ba7681
Generate a directive which assignes an array of selected tag ids to the model.
{ if(is_array($selected)) $selected = implode(' selected_',$selected); $cssClass = CHtml::activeId($model, $attribute).' selected_'.$selected; if(isset($options['class'])) $options['class'].=' '.$cssClass; else $options = array_merge($options, array('class'=>$cssClass)); echo CHtml::openTag('div', $...
0
05bfb2ad0ff9c29fe8dbfadda1ce331a
72b8f8503756c7dbf8644b018787d711
获取拼音相同但名字不同的用户信息.
class User extends Base public function getOtherUsersInfo($param, $header = []) { return $this->request("POST", $this->getGetOtherUsersInfoUrl(), $param, $header); }
0
181a40a3588c0947127175ccc737f1c6
35e3dda67f6f25a0f1d2277ce19d89ee
Get OriginAirport value
public function getOrigin(string $fieldName = null) { if(is_null($fieldName)) { return $this->_origin; } return $this->_origin[$fieldName] ?? null; }
1
ffa22fd9b79eb84ebbeee1555f9193b2
a973eb9f242675738f82bccd519831de
This is in a separate function so that it can be called at the very end of the stack. Returns whether it had to go back to its corresponding BeginLoop.
public final class LoopContext public void endLoop() { if (!loopStack.empty()) loopStack.pop(); }
0
0bcbb7411e3fab97caed7ec7d9c1a1a1
87bf0b14f5ad5cb9ff0a11c5fc17a9b4
#partial F-test.
combined = c(a,b) diff.observed = mean(b) - mean(a) number_of_permutations = number_of_permutations diff.random = NULL for (i in 1 : number_of_permutations) { shuffled = sample (combined, length(combined)) a.random = shuffled[1 : length(a)] b.random = shuffled[(length(a) + 1) : len...
0
fd21d273e247d520202477d22acdfbe0
691263a5da843ef64efcbb7c8d31fc60
Prints a laser reading to standard out
void laser_scan_callback(const sensor_msgs::LaserScan& msg) { #ifdef DEBUG #endif }
0
817fea5778e16ba3deb52ca093860242
f166797936cb23e5e6a221b474341afc
根据条件查询排行榜子榜单数量
public Integer countProductsKeywordsRankByConditions(ProductsKeywordsRankDTO condition);
1
3f1729e613bb1ae875030388ae64e09c
a7c28315baf155ddb6b2cf40a7e41122
Отправляет меню с доступными курсами для того, чтобы пользователь мог вступить в них.
current_lesson = controller.get_current_lesson(about_user_id) next_lesson = controller.get_next_lesson(about_user_id) reply = permanent.HEADER_NOW + current_lesson.get_str_current() if current_lesson else "" if next_lesson: reply += permanent.HEADER_NEXT + next_lesson.get_str...
0
a2af73823572333b5e979c7b92e6a7d3
7abbc0b3aceb7885288299ae87446bc1
Создаем титульный лист
namespace Order2000.Modules class ExporterInExcelOrder538 : ExporterInExcelTemplateMethod protected override void CreateFooter() { dynamic postRange = _workSheet.Range[_workSheet.Cells[_currentRowNumber, 1], _workSheet.Cells[_currentRowNumber, 1]]; postRange.Value = "Начальник ткацко...
0
d453d8f79e02abd2c68d69ac955a72cc
c7d533874e7ea95f86b3dc349f344d54
Layout volgens balansstyle.
void MainWindow::initializeLayout() { ui->splitter->setStretchFactor(0, 1); ui->splitter->setStretchFactor(1, 8); }
1
0ab8bb4d9f8768bd9f1a0881c7251c64
663470762905dd16ed7d736fa61079bb
Fetches daily revenues between the specified days (start and end days included)
def get_data_per_day(session, start_date, end_date): return _get_data(session, 'jour', start_date, end_date)
1
1fc2ea014fde58dc6d09036e38348123
6e0c12fc46c3a47f28dc4e9d6ae296a1
Gets the port_count of this HardwareConnector. Configured number of ports in the connector. (1/2/4 for QSFP)
int getConnectorCount();
0
7912b3bd809fadbbd7cb3b932a50ac96
c4ceafdadc4e48670cf7d2449854c56a
Handles Disabling/Enabling The Options of The Extenstion Based onUser Selection
{ try { with(document.options_sys_sel_ext_dlg) { Remove.disabled = Extensions.options.selectedIndex < 0; } } catch (err) { g_ErrorHandler.DisplayException (err); return; } }
1
6d7591fc19517370e8691121a8e714a0
22983ed0c177dd962ea590f2be069d71
Function that gets called from the algorithm module. Takes user inpt (one letter) and sends it through the enigma machine in three steps (illustrated in the following functions, respectively). Note: several print-statements are available to view the process of the coding.
class Enigma(object): def keyboardInput(self, key): self.stepRotors() s = self.static.produceLetterOutput(key) s_i = string.ascii_uppercase.index(s) s_l = self.positionToLetter(self.rotorR, s_i) r = self.rotorR.produceLetterOutput(s_l) r_i = self.letterToPosition(self.ro...
1
981977934efa31cd757fcafe7399fda6
2279c2905f3d84621180bedf0ec3c053
Blacklist the currently selected ID to ensure it never shows up again
{ if (false === $this->admin->isGranted('BLACKLIST')) { throw new AccessDeniedException(); } $id = $this->get('request')->get($this->admin->getIdParameter()); $object = $this->admin->getObject($id); if (!$object) { throw new NotFoundHttpException(sprin...
1
abab11b664f5064cfa4aaa888689ffd6
b560fe01d31fd5c7ea6e75192d9e8bbc
Computes vector sum of list of vectors
out = [] s=0 for element in (vec): s += element out.append(s) return out
0
cd1a23eb1c7561f42698eb23c727c456
0f6224f8005887282a5100f433e0583c
vip商家发布商品的获取规则接口 tmall.item.vip.add.schema.get 获取vip商家发布商品的规则
func TmallItemVipSchemaAdd(clt *core.SDKClient, req *product.TmallItemVipSchemaAddRequest, session string) (*product.TmallItemVipSchemaAddAPIResponse, error) { var resp product.TmallItemVipSchemaAddAPIResponse err := clt.Post(req, &resp, session) if err != nil { return nil, err } return &res...
0
4843b0a005526cd5e2f0adf714361151
25c870786206cad7449829c9958fabfd
Find candidate subrs in DAWG
void count_dpnd_candidates(SENTENCE_DATA *sp, DPND *dpnd, int pos) { int i, count = 0, d_possibility = 1; BNST_DATA *b_ptr = sp->bnst_data + pos; if (pos == -1) { return; } if (pos < sp->Bnst_num - 2) { for (i = pos + 2; i < dpnd->head[pos + 1]; i++) { dpnd->mask[i] = 0; } } for (i = pos...
0
fee3c2e88d4573466680c98c1dcd7bbe
c35c6125d341e795460cf80ce07b0e1e
获取我关注的好友的话题列表
@Controller @RequestMapping("subject") public class SubjectController extends BaseController{ @RequestMapping("/friendsSubject") @ResponseBody public String friendsSubject(@RequestParam String data,HttpServletRequest request){ PostListResponseCode response = new PostListResponseCode(); int userId = (int)reque...
1
15ce5056c40f0f0200c90c55b4d09d82
b580b09cb8355053794e5c992c59f0f7
Takes a regex string and tries to fix all the known errors from the text comparison output
namespace Kentico.AcceleratedMobilePages public class AmpFilter private string PerformRegexCorrections(string finalHtml) { finalHtml = finalHtml.Replace(Constants.HTML_TAG, Constants.HTML_REPLACEMENT); finalHtml = new Regex(Constants.REGEX_CONDITIONAL_COMMENTS).Replace(finalHtml, "")...
1
7a5981bbb32529b764b3b77f624263bd
7b997b5ff063154c7475f9bac08a337e
关闭NpcShop
if currNpcId == nil or NpcInfo[currNpcId] == nil or NpcInfo[currNpcId].ShopId == nil then return end SoundUtil.Play2DSE(localPlayer.UserId, 5) npcGui.Visible = false NetUtil.Fire_C('SwitchStoreUIEvent', localPlayer, 1, currNpcId) end
1
ca5911e942368a0e1f0b1e1fccaefb10
51bc32145844f8b9064180db252a3364
iterate through the submit annotation todo list and post annotations
var selector = 'div.annotation'; const idsUsed = new Set(); const footnotesStack = new Map(); root.querySelectorAll(selector).forEach(node => { if (!( node.parentNode.rawTagName == 'html' || node.parentNode.rawTagName == 'body' || node.parentNode.rawTagName == 'article' || ( ...
0
371e9894ef2844df35cc5267a0bb49a5
6aa830554bb4f39a1475303cce1b4141
This method sets an error message in the label.
public class CreateAccountActivity extends AppCompatActivity implements View.OnClickListener private void setErrorMessage(String message) { errorLabel.setText(message != null ? message:""); }
1
9ecc4a067012602e7035c3082a0798fd
0dfef05cc06ca6266d6836eb6408db4c
SSM parameter where the bootstrap stack version number can be found. Only used if ``requiresBootstrapStackVersion`` is set. - If this value is not set, the bootstrap stack name must be known at deployment time so the stack version can be looked up from the stack outputs. - If this value is set, the bootstrap stack can ...
@Fluent public final class SessionHostInner extends ProxyResource public String sxSStackVersion() { return this.innerProperties() == null ? null : this.innerProperties().sxSStackVersion(); }
0
346c6607e7e754cf028db8f992db8493
4bb819e975e4c52cabf9c03c1ece44fb
加载登录帐号列表文件
{ if (NULL == lpszFileName || NULL ==*lpszFileName) return FALSE; int nCount = (int)m_arrLoginAccount.size(); if (nCount <= 0) return FALSE; FILE* fp = _tfopen(lpszFileName, _T("wb")); if (NULL == fp) return FALSE; _fwrite(&nCount, sizeof(nCount), 1, fp); _fwrite(&m_nLastLoginUser, sizeof(m_nLastLoginUser)...
0
419c8a2503bf1436c5c37b56fa8d704e
048ad638de9ef51c1b52119a56ae5d58
Dodaje spółkę na podstawie określonych danych.
namespace EMS.DataAccess public class Connection public bool AddCompany(string name, string street, string postalCode, string city, string country, string phone, string fax, string year) { bool result = true; int yearParsed = 0; bool yearParsedResult = false; ...
1
6475cba8b6a43dec6da4b7dfc0efd326
6f51e56a7e475226ebc25eec1457d18c
预先加载Web应用必须的类
class AreaStrategy extends Basement_Service public function toPreload() { return array('utils.Config', 'web.Visit'); }
1
e13c85f5bbcbb56c1319145d952e4989
ac7c416b58a40f38c554de6ee3eb4851
Método que inicia el tablero del J1.
int contador = 0; ArrayList<Casilla> casillas = tableroJugador.getCasillas(); for (int i = 0; i < 10; i++) { HBox filas = new HBox(); for (int j = 0; j < 10; j++) { Casilla casilla = new Casilla(j, i); casilla.setNave(casillas.get(contador).getNave()); ...
1
af467bf2adb5b22c8e583c799f5a0548
f99727d21372a85d2077a84edf576dbd
Aid to generating full aliases. Recursively gets and sets the parent alias, eventually creating, caching and returning an alias for itself.
function addAliasRecursion(targetAlias,targetDeps,map,key){ if(typeof(targetAlias[key]) === "undefined"){ targetAlias[key] = map.alias[key]; addDepsRecursion(targetAlias,targetDeps,map,map.alias[key]); } }
1
cf540a5890706920313f6d4f859a6d86
4cca269ebfac4375db3c8c6eed371fdd
判断结束时间是否小于系统现在时间
boolean rs = false; SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); try { if (CommonSocket.TimeAddHour(sysdate, 1).after( sdf.parse(finishtime)) && sysdate.before(sdf.parse(finishtime))) { rs = true; } } catch (ParseException e) { e.printStackTrace(); } return rs; ...
0
05c4b3dcd976f10670c88aef5775c94c
c1d076471c540020ceaadaa93be5121b
Adds each presentation's information to an sqlite3 database
conn = sqlite3.connect(db_path) c = conn.cursor() c.execute('''CREATE TABLE IF NOT EXISTS log (id INTEGER PRIMARY KEY AUTOINCREMENT, start DATETIME, end DATETIME, category VARCHAR, description TEXT)''') for k, v in self._slices.items(): if not v[1]: start_str...
1
21898eb7e207c8d94d1d0c3bbf5aec43
23e414d63cfb01ece420002eb18f1b6e
Positional arguments and Keyword arguments
class CallableTests(TestCase): def test_postional_arguments(self): def f(*args, **kwargs): self.assertEqual(len(args),3) self.assertEqual(len(kwargs),0) self.assertEqual(args[0],'a') self.assertEqual(args[1],True) self.assertEqual(args[2],'c')
1
907b4c5b4cce9ed898cb69d17b6c8f96
a37678533bbe50fa45ef82ed07e75d0e
Returns the name of the HTTP method with which this request was made
public class Request public String methodName() { return methodName; }
0
088795def2f8b0ea15daf489c4857c41
ac594e55e51c21590a3b4441cb870478
Repeat the action while movement button is hold.
namespace HyperCasual public static class MonoBehaviourExtensions public static Coroutine DoRepeatedly(this MonoBehaviour self, float interval, Action<int> action) { return self.DoRepeatedly(interval, true, action); }
0
68bc0a5470649918ac301d77191f50bb
69da12107c080c73610a558295e61a01
Loads a file from Github.
requestcontext = Context(user, repo, path) gitrequest, token = githubrequest(user, repo, path) return finishrequest(requestcontext, gitrequest, token, lambda x: base64.b64decode(x['content'].encode('utf-8')))
1
95af99208dce9b5165e451777a799c18
55a32fff4eeaf9f8b2d47d7edc08e0a6
Timer para cargar datos al Datagridview
namespace Mutuales2020.Ahorros public partial class FrmAhorrosaFuturoIntereses : Form private void pmtdCargarGrid() { }
0
013bf5cff7803ff8c035a13a0e6dc7a9
8b31b96034a69c981ffb842d8f849aea
Производит выстрел из пистолета
{ auto gunshell = player_->shoot(); if(gunshell) { gunshell->init(); objectsStorage_.pushGunshell(std::move(gunshell)); } }
1
3a6c05746c6987982ec0c803799de085
9bb9ee8a37f41c8556336206280b2d39
Construct perturbation potential to violate the symmetries
bas1B = self._sp_basis ref = self._reference n = len(bas1B) if flag == 0: Ga = tn.Node(np.transpose(np.append(ref[np.newaxis,:], np.zeros((1,n)), axis=0).astype(self.DATA_TYPE))) Gb = tn.Node(np.transpose(Ga.tensor)) Gc = tn.Node(np.transpose(np.appen...
0
46c3f5a8892629744982c95f0a44ba4f
13e05fccb2d1e2be7a60d358c5a33f71
Import layout database from gds file.
class BagProject: def import_design_library(self, lib_name, view_name='schematic'): self.impl_db.import_design_library(lib_name, view_name)
0
533df260ae4b2270b3aec91f90296c3b
2b58903d255a65fee3aae209471d318e
Función para chequear si un campo se ha llenado con espacios en blanco, por medio de una expresión regular
function blanck(element) { let valido = true; if (element != null) { if (element.value == '') { valido = false; } } else { valido = false; } return valido; }
0
9b9ccd10c36bb4e88e91358434e54a35
56938ca048754c8c2b663deedc5b1858
Metodo principal de la aplicacion muestra el menu y espera a recibir solicitud de parte del usuario hasta que el decida terminar el programa
do { menu.show(); String action = menu.getSelectedOptionActionCommand(); processAction(action); } while (true); }
1
9e627ef42cea61e1ddec589ae2805c04
707abe399884d809c2659bd5fd054dc9
Returns the {@link Warehouse} id of the relationship.
abstract class AbstractAllocationLine public function getWarehouseId() { return $this->warehouseId; }
1
05082e5edc6010cc68720644cdf2fbf5
55990d46db1bc68a296b84a143228b23
Gets the attention distributions for each alternating iteration.
class Attention(nn.Module): def __init__(self, hparams, device): super().__init__() self.hp = hparams self.device = device self.to(device) self.Na = getlinear(self.hp.d*self.hp.k, 3*self.hp.c)
0
9eab3f73ea2e0cca24ed2349541fb5c6
d229822be52b15510d96ad7cf71af491
Get the path to a child's socket
if self._path == self.ROOT: child_path = child_name else: child_path = self._path + '\\' + child_name return child_path
0
b90883d9e49f8c57416695529d3f3244
8258620be5d38a161e6226a2031585df
Upon clicking GROUP, goes to activity listing groups.
public class SelectGroupActivity extends AppCompatActivity public void goToGroup(String name, int id){ Intent intent = new Intent(this, StudentsInGroupActivity.class); intent.putExtra("NameGroup", name); startActivity(intent); }
0
98a41db22f3a571af4eb210330186f7f
d49f51261e5254fa537bae756a9b3f67
Sets the current operator identifier.
if (null == operator) { throw new NullPointerException(); } this.operator = operator; }
1
91ca4bb2f5481f28e672dd4a5d92712a
cac8108622e9670efa5180e3aae31d54
Update the sensors of the rectangle agent.
{ for( int i = 0 ; i < _wm->_cameraSensorsNb; i++) { int targetIndex = _wm->getObjectIdFromCameraSensor(i); if ( PhysicalObject::isInstanceOf(targetIndex) ) { targetIndex = targetIndex - gPhysicalObjectIndexStartOffset; gPhysicalObjects[targetIndex]->isTouched(...
0
ef4b040fe20904d89fb2844988ee34a3
691a578a9a17b0fcc13368507fd4703e
Test de recibir daño. Verifica que la vida restante luego de recibir un ataque sea la correcta para la combinacion de vida inicial daño recibido, y valor de defensa.
public void AsignarDefensaNegativa() { this.armadura.Defensa = -20; Assert.AreEqual(this.armadura.Defensa, 0); }
0
59476b205de1ee4523e237550ad5c5a1
ee660e4b53e9e34affe74bcdd0dad10b
广度优先搜索(层序遍历)
{ int count = 0; queue<int> bfs_queue; cout<<"widthFirstSearch:"<<endl; for ( int i = 0; i < iVertexNum ; ++i ) { vecVertex.at(i).bIsVisited = false; } for ( int i = 0; i < iVertexNum ; ++i) { if(!vecVertex.at(i).bIsVisited) { vecVertex.at(i).bIsVisited = true; cout<<vecV...
1
4d160e560f5861ce7110617ed0c8e4a4
e1105b53d68917bb3ed8d8d81db595a6
Stops the message manager. Call this to safely close the application.
csf::core::base::csf_int32 csf_message_manager::stop(const csf_configure_manager * conf_mg) { return 0; }
1
cb57865b6561b6dc2da8790427dbe6d0
66c6099064d6c6858ce10d24883f8e50
Print a single link
void printEndJsonLinkLine(FILE *f, struct jsonLinkLine *links) { fprintf(f," %s\"%s\"%s%d%s", "{","source", ":", links->source, ","); fprintf(f,"\"%s\"%s%d%s", "target", ":" , links->target, ","); fprintf(f,"\"%s\"%s%0.31f%s\n", "distance", ":" , links->distance , "}"); }
1
2c01b3d7bf58488a4136547d0168bd0b
b827e9eed6b39c8057778e449fa856d6
Show the form for updating news.
class NewsController extends BaseController public function updateAction(Request $request, $id) { return parent::updateAction($request, $id); }
0
17fa5f0d0549d21a398911e315f073bb
e59f5d39a9280fa84546953ee356d6fc
Constructs and returns the algorithm currently chosen to handle finding all possible paths in a graph.
public class App extends Application{ private static SchedulingAlgorithm selectAlgorithm(CLIConfig config) { if(config.isVisualize()) { return new SequentialBranchBoundAlgorithm(new AOSolutionSpace(), monitor); } else if(config.numberOfParallelCores() == 1) { return new Sequentia...
1
e0922daf73827f637e27ff94accfbcca
ac4ba697ee864cfb654c4c6d37fd2157
Retrieve the key for the selected row
abstract class BL_CustomGrid_Block_Widget_Grid_Column_Renderer_Sales_Items_Custom_Abstract extends BL_CustomGrid_Block_Widget_Grid_Column_Renderer_Sales_Items_Abstract abstract protected function _getRowKey();
1
ebb6f36c34b9c98f605a73de0aa215bd
52faf2686d5df4d638acc9a50da3b07f
Function to compute stresses and viscous strains using the effective stress function algorithm.
class AnalyticalSoln(object): def viscous_strain(self, locs): (npts, dim) = locs.shape viscous_strain = numpy.zeros((numSteps, npts, 3*self.TENSOR_SIZE), dtype=numpy.float64) viscous_strain[:,:, 0] = eVis[:, 0, 0].reshape(numSteps, 1) viscous_strain[:,:, 1] = eVis[:, 1, 0].reshape(numSte...
0
6ddd1c0152279a6fd7b77640ea2a218e
4ed0c091116aa3cdc8908b6d1aee53be
删除系统账号
class WeChatController extends \common\controllers\Admin public function deleteAccountAction() { $this->end(); }
0
bfbbac7a504ec46a85d77622f5683e82
300856799be8342807162b93efc9bbf3
Test that a anonymous user can not access resource protected by require(in_group(...))
def test_group_page(client, auth): response = client.get('/groups/1/') assert response.status_code == 401 auth.login_as("bob") response = client.get('/groups/2/') assert response.status_code == 403 response = client.get("/groups/1/") assert response.status_code == 200
1
b626e20f74a2cdd7ba96cf7f3e504307
76cd37114526ac278483b0a182e84d53
Set whether or not a notification should be automatically generated for this activity. Set this to `false` if the app already generates a notification for the event.
public class NotificationBuilder public static class V1 public V1 setAutoCancel(boolean autoCancel) { N.setAutoCancel(autoCancel); return this; }
0
4260732dfb24001fa020f80c9fe3e41a
09eda390371d1a061cc8f2bb2ada32ab
Aborts the operation to write to the blob.
namespace Microsoft.Health public class BlobStream : Stream public override void EndWrite(IAsyncResult asyncResult) { throw new NotSupportedException(); }
0
7632ef315327c78bb44276414238ca49
292b651b3734c73ae134961acf54eec2
找回交易密码获取验证码
getPinCodeVerifyCode(data){ return instance.post('/assets/sendupdatetransactionpasswordcode', data) }
1
5d7f788771feca943d495f97129e5ea4
4b56228857ec641e541d4bcf778b168c
Returns the account remind later of this custom user.
class Leads extends \Base\Entity\Leads implements \Doctrine\ORM\Proxy\Proxy public function getmessageReminder() { $this->__initializer__ && $this->__initializer__->__invoke($this, 'getmessageReminder', array()); return parent::getmessageReminder(); }
0
f1ba18a02a00963d8ed394b2e5b16acd
f166e22d8ca4223b8dccb532f60f52e0
Fungsi untuk membuat tombol aksi pada tabel
function tableTool($title, $route, $routeDetail=null) { return '<a class="btn default btn-xs green" href="'.route($route, $routeDetail).'"> '.$title.'</a>'; }
1
5d2d9d016f2e01186b15695d214b978a
87f244a5da9f053ea6cdb2e8a1d72559
returns the BTreeNode that will replace current in deletingNonLeafCase
namespace BTreeDemonstration class BTreeNode public void removeFromNonLeaf(int idx) { int key = keys[idx]; if (children[idx].numOfKeys >= t) { int pred = getPred(idx); keys[idx] = pred; children[idx].remove(pred); ...
0
24cf469e3c05f2188da0790001edffa9
d0257d7685fc0962a67654bd85539ce1
Sets all maximum goals.
void setMaximumValues(int maximumValues);
1
e5e0a41ff21aeff7a994dc0c4d1b3867
17522967c386844d7852170dc1739542
Notify the triangle renderer that the Window size has changed.
namespace Pyro void Window::onSizeChanged(uint32_t newWidth, uint32_t newHeight) { if (INSTANCE->rendererCallback == nullptr || newWidth == 0 || newHeight == 0) return; INSTANCE->width = newWidth; INSTANCE->height = newHeight; INSTANCE->swapchain->recreate(); INST...
1
f59e5bbe361912b3187aeeaadba60b42
fc7d5eadca2809c1b3aa3c9cb141bd87
LC_0008
cout << "LeetCode 676. Implement Magic Dictionary, C++ ...\n\n"; MagicDictionary md; vector<string> dict { "hello", "leetcode" }; md.buildDict(dict); string word = "hello"; bool r = md.search(word); cout << (r ? "true" : "false") << '\n'; word = "hhllo"; r = md.search(wor...
0
18f394b42ab38eaddc975af9813a3930
9e4c2c4627676d379898e08fd7e1abf0
e.g. Urgent
now = datetime.now() diff_hours = (deadline - now).total_seconds() / SECONDS_IN_HOUR if diff_hours <= URGENT_HOURS and is_important: return IMPORTANT_URGENT elif diff_hours > URGENT_HOURS and is_important: return IMPORTANT_NOT_URGENT elif diff_hours <= URG...
1
e5484bd2bf840ce477c61b9dff77ec3a
8a64047bc3cd56b3603d045b5abcf82c
Returns a collection containing all the known test steps.
CopyOnWriteArrayList<RSTests> getListSteps();
1
3f019b8a0cb455e983e76a88017aa888
810f099ac74a70f8f40ecad27001168b
Do the actual work.
class Quicklook(): def run(self): try: self.setup_workdir() self.compute_jpegs() self.move_jpegs() self.clean_workdir() return True except Exception, e: self.log.error('Quicklook.run() aborted with exception: "%s"' % e) ...
1
47e2ae8b1a911c951864d4b2ac6b6d69
d2064ac22814aa2395f7ae5079247c5a
Calculate nDCG
allOnes = np.ones((1,len(Ranking))) Max_score = max_score discount_rate = np.log2(np.array(range(0, len(Ranking) + 2)[2:], dtype= float)) def calculateDifferenceDCG(Ranking): gain_E = np.subtract(np.power(2, Ranking), allOnes) disc_gain_E = np.sum(gain_E/ discount_rate[:]) retur...
1
171886bf2541dbb2227990f1512a6ae7
33136d89dbc3bdf0d8fc927db94a95eb
Returns array of Xmlify test arrays
{ $mapAreas = XmlHelper::parseAllAreas(); $testCaseArray = array(); foreach ($mapAreas as $singleMapTest) { $testArray = array_merge($singleMapTest['test_valid'],$singleMapTest['test_invalid']); $i=0; foreach ($testArray as $testPoint) { $t...
1
d0836e5f356f12255030a034a8230bf3
0f5692c592d71a8f99b3454e5c094e46
True if this plane segment presents a depth discontinuity with another one. False if there is no depth discontinuity
const Vector3& point) const { return ( planes[0].isBehindPlane(point) && planes[1].isBehindPlane(point) && planes[2].isBehindPlane(point) && planes[3].isBehindPlane(point) && planes[4].isBehindPlane(point)); }
0
904581fa93e700a84c709e183b1c3460
e6abc0014e076381deeff6f0d1f469da
5.实现根据员工姓名查询员工完整工号功能。
@Controller @RequestMapping("/recruit") public class RecruitEditController extends BaseController{ @RequestMapping("/searchName") @ResponseBody public AjaxResult searchName(String personCode) { AjaxResult map = new AjaxResult(); OrgPerson orgPerson = orgPersonMapper.selectByPersonCode2(personCode); if (orgPerso...
0
c409fe4dcc223c488e901817062b5472
49afab33413c0cd2f7da0df5e23a0a4a
Returns the sizes of the communities as a map from node id to size
return { key: len(value) for key, value in self.clusters(density_hill_map).items() }
0
cbb00797f5d31097fa6aff22c1d28fd4
23f6a6efb8cbde30da997336ab85a5d0
Cancela la edición y ejecuta una acción diferida si el usuario accepta la confirmación de perder los cambios.
onCancel(event) { if (this.shouldConfirmCancel && this.isDirty()) { event.preventDefault() this.confirmCancel() } }
1
94f37ee325ecaa3ede913521cbe92b61
ad59e4be8c39df86f4341535e83e93af
Checks if project is closed
@ManagedBean @Scope("view") public class ProjectHomePage extends AbstractPage public String getClosed() { return CorresponStatus.CLOSED.name(); }
0
26a81099d2e6983d9067a8b34c82ff10
249d8e1bdf17d38596cd6bfd8e82d61d
This function is called by the RS485 driver when a requested read completes.
{ PRO100_RFD rfd; phys_t ptr; if (ctx == NULL || buf == NULL || size == 0) { return; } if (ctx->guest_rfd_current == 0) { return; } ptr = ctx->guest_rfd_current; pro100_mem_read(&rfd, ptr, sizeof(PRO100_RFD)); if (rfd.eof) { return; } rfd.status = 0; rfd.sf = rfd.h = 0; SeCopy(rfd.data, buf, size)...
1
412aea97ff040eac6571610055a377ea
4f24737613118161d699ba2b51492b71
处理IotGetMqttInfo()返回的数据
{ if (currentData["PRC_MSG"] == "OK" || currentData["PRC_MSG"] == "FAIL") iotData.Add(currentData); }
1
06113aa635c5a6244d72b0c7ba5d8e86
8b2dc99b705b7c9807cc4e2309128f23
Returns the name of the member. The search will be carried out in the following order: <br /> 返回成员的名称。将按照以下顺序进行寻找: <para> - <see cref="DisplayNameAttribute"/> <br /> - Name </para>
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Method | AttributeTargets.Class, AllowMultiple = false)] public sealed class DisplayAttribute : Attribute public string? GetName() => this.name.GetLocalizableValue();
0
956e9767ee0de44719e1d4ecc6d274aa
404cc5ae66ba5b5bd56214f1b0cef12b
Get adjacency list of graph
List<E> getAdjList();
1
b75a0af1e79fef8ab3597167f49b4b7e
07757c4142dee5f4d2d9b037444fbfde
Source: https://stackoverflow.com/a/3663505
def split(s:str, delimiters:Iterable[str], maxsplit:int=0) -> List[str]: regex_pattern = '|'.join(map(re.escape, delimiters)) return re.split(regex_pattern, s, maxsplit)
1
84e1a04fa0fe15386bc9cee9794e8af4
b28f44a34042e37816809d619a4f3b85
Checks if movie has trailers
predicates = [ lambda t: type(t) is Tag, lambda t: bool(t.get("href")), lambda t: not t.text.endswith(".mp4") ] application: List[bool] = [f(tag) for f in predicates] return all(application)
0
a1716b04c86b3d07dd119303bb225c3b
605b218c50c258bd26b9910479f7a27b
Які продукти купляли усі покупці?
@Query(value = "SELECT SUM(s.product_number)" + "FROM ((\"check\" c LEFT JOIN sale s on c.check_number = s.check_number)" + "LEFT JOIN store_product sp ON sp.upc = s.upc)" + "LEFT JOIN product p ON p.id_product = sp.id_product " + "WHERE c.print_date BETWEEN :start AND :end", nativeQuery = true) int a...
0
4df479eab8ae26e71c1bfb0a69ff9958
54f18c398853e461169aac4de7befdc1
GET: Zwierzeta
{ if (Request.Cookies["zalogowanyID"] == null) { return RedirectToAction("Logowanie", "User"); } if (!Request.Cookies["zalogowanyRola"].Value.Equals("admin")) { return RedirectToAction("BrakUprawnien","Admin"); ...
0
5fcac9098cbd71ff29f89df826ff768e
86e2a89d577533153f08c3d2e826c81a
initialize the pins for all 3 phototransistors
void setup() { pinMode(TL1_G,OUTPUT),pinMode(TL1_Y, OUTPUT),pinMode(TL1_R, OUTPUT); pinMode(TL2_G,OUTPUT),pinMode(TL2_Y, OUTPUT),pinMode(TL2_R, OUTPUT); }
0